react-luna-form 0.0.31 → 0.0.33
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/client/cjs/index.js +1 -1
- package/dist/client/esm/index.js +1 -1
- package/dist/config/cjs/index.js +1 -1
- package/dist/config/esm/index.js +1 -1
- package/dist/server/cjs/index.js +1 -1
- package/dist/server/esm/index.js +1 -1
- package/dist/types/client/component/field/field-list.d.ts +2 -0
- package/dist/types/client/component/field/field-with-state.d.ts +13 -0
- package/dist/types/client/component/field/field.d.ts +7 -0
- package/dist/types/client/component/form-content.d.ts +20 -0
- package/dist/types/client/component/form.d.ts +20 -0
- package/dist/types/client/component/guard/list-guard.d.ts +2 -0
- package/dist/types/client/component/guard/visibility-guard.d.ts +6 -0
- package/dist/types/client/component/input.d.ts +16 -0
- package/dist/types/client/component/slot/slot.d.ts +7 -0
- package/dist/types/client/hook/use-data-source.d.ts +3 -0
- package/dist/types/client/hook/use-fetch.d.ts +3 -0
- package/dist/types/client/hook/use-field-list.d.ts +2 -0
- package/dist/types/client/hook/use-form-action.d.ts +13 -0
- package/dist/types/client/hook/use-input.d.ts +2 -0
- package/dist/types/client/hook/use-schema.d.ts +2 -0
- package/dist/types/client/hook/use-store.d.ts +1 -0
- package/dist/types/client/hook/use-timeout.d.ts +1 -0
- package/dist/types/client/hook/use-value.d.ts +6 -0
- package/dist/types/client/index.d.ts +3 -0
- package/dist/types/client/lib/error-store.d.ts +7 -0
- package/dist/types/client/lib/source-store.d.ts +5 -0
- package/dist/types/client/lib/state-store.d.ts +5 -0
- package/dist/types/client/lib/store-helper.d.ts +26 -0
- package/dist/types/client/lib/value-store.d.ts +10 -0
- package/dist/types/component/chevron-icon.d.ts +3 -0
- package/dist/types/component/column.d.ts +5 -0
- package/dist/types/component/control.d.ts +5 -0
- package/dist/types/component/description.d.ts +3 -0
- package/dist/types/component/field/field-base.d.ts +12 -0
- package/dist/types/component/field/field-error.d.ts +5 -0
- package/dist/types/component/field/field-group.d.ts +8 -0
- package/dist/types/component/field/field-horizontal.d.ts +2 -0
- package/dist/types/component/field/field-list-item.d.ts +8 -0
- package/dist/types/component/field/field-list.d.ts +7 -0
- package/dist/types/component/field/field-set-advanced.d.ts +5 -0
- package/dist/types/component/field/field-set-base.d.ts +7 -0
- package/dist/types/component/field/field-set.d.ts +6 -0
- package/dist/types/component/field/field-vertical.d.ts +2 -0
- package/dist/types/component/field/field.d.ts +10 -0
- package/dist/types/component/form.d.ts +13 -0
- package/dist/types/component/formatted-description.d.ts +7 -0
- package/dist/types/component/group.d.ts +4 -0
- package/dist/types/component/input/input-base.d.ts +9 -0
- package/dist/types/component/input-group.d.ts +10 -0
- package/dist/types/component/input-label.d.ts +9 -0
- package/dist/types/component/label.d.ts +7 -0
- package/dist/types/component/legend.d.ts +4 -0
- package/dist/types/component/list.d.ts +5 -0
- package/dist/types/component/separator.d.ts +1 -0
- package/dist/types/component/slot/list-slot.d.ts +2 -0
- package/dist/types/component/slot/slot-base.d.ts +16 -0
- package/dist/types/component/slot/slot-create.d.ts +10 -0
- package/dist/types/component/slot/slot-list.d.ts +12 -0
- package/dist/types/component/slot/slot.d.ts +7 -0
- package/dist/types/config/index.d.ts +31 -0
- package/dist/types/lib/render-If-exists.d.ts +1 -0
- package/dist/types/lib/string.d.ts +1 -0
- package/dist/types/luna-core/src/helper/input.d.ts +1 -0
- package/dist/types/luna-core/src/type.d.ts +3 -3
- package/dist/types/luna-core/src/util/build.d.ts +1 -1
- package/dist/types/luna-core/src/util/constant.d.ts +1 -2
- package/dist/types/luna-core/src/util/extract.d.ts +1 -0
- package/dist/types/luna-core/src/util/is-input.d.ts +1 -1
- package/dist/types/luna-core/src/util/style.d.ts +1 -1
- package/dist/types/luna-react/src/client/component/input.d.ts +2 -2
- package/dist/types/luna-react/src/component/field/field-base.d.ts +1 -2
- package/dist/types/luna-react/src/component/field/field-group.d.ts +2 -2
- package/dist/types/luna-react/src/component/formatted-description.d.ts +4 -0
- package/dist/types/luna-react/src/component/input/input-base.d.ts +2 -2
- package/dist/types/luna-react/src/component/input-group.d.ts +2 -2
- package/dist/types/luna-react/src/component/input-label.d.ts +2 -2
- package/dist/types/luna-react/src/config/index.d.ts +2 -2
- package/dist/types/luna-react/src/server/component/input.d.ts +2 -2
- package/dist/types/luna-react/src/type.d.ts +2 -2
- package/dist/types/server/component/fallback.d.ts +7 -0
- package/dist/types/server/component/form.d.ts +13 -0
- package/dist/types/server/component/input.d.ts +13 -0
- package/dist/types/server/index.d.ts +4 -0
- package/dist/types/type.d.ts +29 -0
- package/package.json +2 -2
package/dist/server/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as ln}from"react/jsx-runtime";function oe(e){let t=typeof e.children=="function"?e.children({isPending:e.isPending}):e.children;return ln("div",{"data-slot":"field-control",className:"w-full",children:t})}import{Activity as vn,useCallback as En,useState as On}from"react";import{jsx as ie}from"react/jsx-runtime";function le(e){return ie("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:`size-4 transition-transform duration-200 ${e.expanded?"rotate-90":""}`,children:ie("path",{fillRule:"evenodd",d:"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})})}var O="input",ae="input/email",se="input/number";var de="textarea",ce="radio",ue="checkbox",Y="list";var fe="select",me="select/month",pe="select/year";var F="column",H="fields",ge="label",X="value",w="options",K="email",ye="number",xe="password",be="tel",S="text",Re="aria-errormessage",Te="aria-invalid",he="data-invalid",Ae="data-readonly",Fe="aria",Se="data",Ne="min",Ce="max",Ie="minLength",Le="maxLength",T="$ref";var p="vertical",h="horizontal";var ke="type";function a(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function g(e){return u(e)||typeof e=="number"||an(e)}function u(e){return typeof e=="string"}function an(e){return typeof e=="boolean"}function ve(e,t=X){if(e!=null){if(g(e))return e;if(a(e)){let n=sn(e,t);if(g(n))return n}}}function sn(e,t){let n=f(e,t);if(g(n))return n}function f(e,t){if(!t||!a(e))return null;let n=t.split(".").filter(o=>o!=="");if(n.length===0)return null;let r=e;for(let o of n)if(a(r)&&o in r)r=r[o];else return null;return r}function Ee(e,t={label:ge,value:X}){return e.map(n=>{if(a(n)){let r=f(n,t.label),o=f(n,t.value);if(g(r)&&g(o))return{label:`${r}`,value:`${o}`}}return n})}function Oe(e=S){if(e){let t=e.lastIndexOf("/"),n=t===-1?e:e.slice(t+1);if(n&&n!==O)return n.trim().toLowerCase()}return S}var dn=/\[([^\]]{1,500})\]\(([^)]{1,2000})\)/g;function W(e,t={}){if(u(e))return cn(e,t);if(Array.isArray(e))return e.map(n=>W(n,t));if(a(e)){let n={};for(let r in e)n[r]=W(e[r],t);return n}return e}function z(e,t={}){return q(e)?W(e,t):e}function q(e){return u(e)?/{([^}]{1,200})}/.test(e):Array.isArray(e)?e.some(t=>q(t)):a(e)?Object.values(e).some(t=>q(t)):!1}function cn(e,t={}){return e.replace(/{([^}]{1,200})}/g,(n,r)=>{let o=r.includes(".")?f(t,r):t[r];return g(o)?String(o):n})}function we(e,t){if(!u(e)||!e||e.trim().length===0)return null;let n,r=0,o=!1,i=[];for(;(n=dn.exec(e))!==null;){let[l,s,rn]=n,E=n.index;o=!0,E>r&&i.push(e.substring(r,E));let on=t?t(E,rn,s):l;i.push(on),r=E+l.length}return o?(r<e.length&&i.push(e.substring(r)),i):e}var Pe=e=>c(me)(e),Me=e=>c(pe)(e),d=c(ue),De=c(O),x=c(ce),m=c(fe),_e=c(de),Ve=c(S,K,xe,be),wr=c(ae,K),Be=c(se,ye);function Ge(e){return x(e)||d(e)}function $e(e){return e.type===Y}function A(e){return e.type===F}function P(e){return e.type!==F&&e.type!==Y}function Ue(e){return m(e)||x(e)}function Z(e){return e!=null&&e!==""}function c(...e){return t=>{let n=u(t.type)?t.type:void 0;return n?e.some(r=>n===r||n?.startsWith(`${r}/`)):!1}}function Ye(e,t={}){if(m(e)&&e.disabled){let n=e.name?t?.[e.name]:void 0;if(n&&a(n))return[n]}}function He(e){return x(e)||d(e)?h:e.advanced?.orientation??p}function Xe(e){return d(e)?e.advanced?.reverse!==!1:!1}function Ke(e,t){let n=e.readonly??!1;return t||n}function We(e){if(x(e)||m(e)&&!e.disabled){let t=e.source;if(Array.isArray(t)||a(t)&&!(T in t))return t}}var un=/^\d+$/;function qe(){return Array.from({length:12},(e,t)=>({value:(t+1).toString(),label:new Date(0,t).toLocaleString("default",{month:"long"})}))}function ze(e,t){return t>=e?Array.from({length:t-e+1},(n,r)=>{let o=e+r;return{value:o.toString(),label:o.toString()}}):[]}function J(){return new Date().getFullYear()}function Q(e,t){if(typeof e=="number")return e;let n=t??J(),r=e.trim().toLowerCase();if(r.startsWith("current")){let o=r.match(/^current([+-])(\d+)$/);if(o){let[,i,l]=o,s=parseInt(l,10);if(!isNaN(s))return i==="+"?n+s:n-s}return n}return un.test(r)?parseInt(r,10):n}var M=J();function fn(e){if(m(e))return mn(e)}function mn(e){if(Pe(e))return qe();if(Me(e)){let t=e.advanced?.length?.min??M,n=e.advanced?.length?.max??M+5;return ze(Q(t,M),Q(n,M))}}function Ze(e,t=!1){let n={disabled:t,id:e.name,name:e.name,placeholder:e.placeholder,required:e.required};return De(e)?{...n,...pn(e)}:m(e)?{...n,...gn(e)}:_e(e)?{...n,...yn(e)}:n}function pn(e){let t=Oe(e.type),n={...e,type:t};return{...Je(e),...xn(n),...Ve(n)?Qe(n):{},type:t}}function gn(e){let t=fn(e);return t?{options:t}:{}}function yn(e){return{...Je(e),...Qe(e)}}function Je(e){let t=e.advanced?.autocomplete;return t?{autoComplete:t}:{}}function xn(e){return Be(e)?bn(e):{}}function Qe(e){return je(e,{min:Ie,max:Le})}function bn(e){return je(e,{min:Ne,max:Ce})}function je(e,t){let n={},r=e.advanced?.length;return r&&(r.min!==void 0&&(n[t.min]=r.min),r.max!==void 0&&(n[t.max]=r.max)),n}function et(e,t){let n=We(e);return n||Ye(e,t)}function Rn(e,t){let n=a(t)&&e.name in t?t[e.name]:t;return ve(n,e.advanced?.entity)}function Tn(e,t,n){return Ue(e)&&Array.isArray(n)?{...t,[w]:n}:t}function hn(e,t,n){if(e.required&&!Z(n)&&m(e)&&e.advanced?.preselected!==!1&&w in t){let r=t[w];if(Array.isArray(r)&&r.length===1)return r[0]}return n}function An(e,t){return m(e)&&Array.isArray(t)?Ee(t,e.advanced?.options):t}function tt(e,t,n,r){let o=Rn(e,r),i=Array.isArray(n)?An(e,n):n,l=Tn(e,t,i),s=hn(e,l,o);return{commonPropsWithOptions:l,defaultValue:s}}function nt(e,t){return d(e)?{defaultChecked:Z(t)}:{defaultValue:t}}var Fn=/^#\/definition\//;function _(e=[],t){let n=D(e,t);return Array.isArray(n)?n.filter(Nn).sort((r,o)=>rt(r)-rt(o)):[]}function D(e,t,n=new Map,r=new WeakSet){if(!Sn(t)||!e||typeof e!="object")return e;if(n.has(e))return n.get(e);if(r.has(e))return e;if(r.add(e),Array.isArray(e))return e.map(i=>D(i,t,n,r));if(T in e&&u(e[T])){let i=e[T].replace(Fn,""),l=f(t,i);return l!==null?D(l,t,n,r):e}let o={};for(let[i,l]of Object.entries(e))o[i]=D(l,t,n,r);return r.delete(e),n.set(e,o),o}function ot(e){return Object.entries(e??{})}function rt(e){return e.order??Number.MAX_VALUE}function Sn(e){return e!==void 0&&a(e)&&Object.keys(e).length>0}function Nn(e){return ke in e?!0:Array.isArray(e[H])?e[H].length>0:!0}function it(e,t){let n={};for(let[r,o]of ot(t))n[`${e}-${r}`]=o;return n}function Cn(e){return it(Fe,e)}function In(e){return it(Se,e)}function lt(e,t){let n=Cn(e.advanced?.aria);return t&&t.length>0&&(n[Te]="true",n[Re]=`${e.name}-error`),n}function at(e){return In(e.advanced?.data)}var st={1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3"},dt={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3"};function ct(e,t=2){return st[e&&e in st?e:t]}function ut(e){if(e&&e in dt)return dt[e]}function Ln(e,t){let n=e.advanced?.length?.min??1;if(t){let r=f(t,e.name);if(Array.isArray(r))return Math.max(r.length,n)}return Math.max(n,0)}function ft(e){return!Array.isArray(e.fields)||e.fields.length===0?!1:e.fields.length>1||e.fields[0].type===F}function mt(e,t){let n=Ln(e,t);return Array.from({length:n},(r,o)=>o)}function pt(e){return e.label??e.name}function b(e,t){return e?t?t[e]??e:e:""}function V(e,t){return{...e,...t}}import{jsx as kn}from"react/jsx-runtime";function y(e){return we(e,(t,n,r)=>kn("a",{className:"underline",href:n,rel:"noopener noreferrer",target:"_blank",children:r},`${n}-${t}`))}import{jsx as N,jsxs as j}from"react/jsx-runtime";function gt(e){let{fields:t=[]}=e.section,[n,r]=On(!1),o=En(()=>r(i=>!i),[]);return j("fieldset",{"data-slot":"field-set","data-advanced":"true","data-expanded":n,"data-empty":t.length===0,className:"flex flex-col",id:e.section.id?.toString(),children:[N("legend",{children:j("button",{className:"flex cursor-pointer items-center gap-2 text-base font-medium text-slate-600 dark:text-slate-400",onClick:o,type:"button",children:[N(le,{expanded:n}),N("span",{children:y(e.section.title)})]})}),N(vn,{mode:n?"visible":"hidden",children:j("div",{className:"mt-3 ml-1.5 flex flex-col gap-4 border-l-2 border-slate-300 pl-4 dark:border-slate-600","data-slot":"field-set-content",children:[e.section.description&&N("p",{className:"text-sm leading-normal font-normal text-slate-600 dark:text-slate-400",children:y(e.section.description)}),e.group]})})]})}import{Fragment as wn,jsx as yt,jsxs as Pn}from"react/jsx-runtime";function xt(e){return Pn(wn,{children:[e.title&&yt("legend",{className:"mb-3 font-medium text-slate-800 dark:text-slate-200",children:y(e.title)}),e.description&&yt("p",{className:"-mt-2 text-sm leading-normal font-normal text-slate-600 dark:text-slate-400",children:y(e.description)})]})}import{jsx as Mn,jsxs as Dn}from"react/jsx-runtime";function B(e){return Dn("fieldset",{"data-slot":"field-set","data-empty":e.empty,className:"flex flex-col data-[empty=false]:gap-6",id:e.id,children:[Mn(xt,{description:e.description,title:e.title}),e.children]})}import{jsx as _n}from"react/jsx-runtime";function R(e){return _n("div",{"data-slot":"field-group","data-compact":e.compact,className:"flex w-full flex-col gap-8 data-[compact=true]:gap-3",children:e.children})}import{jsx as ee}from"react/jsx-runtime";function bt(e){let{fields:t=[]}=e.section,{compact:n}=V(e.style,{compact:e.section.compact}),r=ee(R,{compact:n,children:e.children});return!e.section.title&&!e.section.description?r:e.section.advanced?ee(gt,{section:e.section,group:r}):ee(B,{description:e.section.description,empty:t.length===0,id:e.section.id?.toString(),title:e.section.title,children:r})}import{useAtomValue as Hn}from"jotai";import{atom as C}from"jotai";import{atomFamily as Vn}from"jotai-family";import{deepEqual as Rt}from"fast-equals";function Bn(e,t){let{[t]:n,...r}=e;return r}function Gn(e){return Vn(t=>C(n=>n(e)[t]??void 0,(n,r,o)=>{let i=n(e);if(o!=null){let l=i[t];(!l||!Rt(l,o))&&r(e,{...i,[t]:o})}else i[t]&&r(e,Bn(i,t))}))}function $n(e){return C(null,(t,n)=>{let r=t(e);r&&Object.keys(r).length>0&&n(e,{})})}function Un(e){return C(null,(t,n,r)=>{let i={...t(e)},l=!1;for(let s of r)i[s]&&(delete i[s],l=!0);l&&n(e,i)})}function Yn(e){return C(null,(t,n,r)=>{let o=t(e);Rt(o,r)||n(e,r)})}function Tt(e={}){let t=C(e);return{atom:t,clearAll:$n(t),clear:Un(t),bulkReport:Yn(t),report:Gn(t)}}var ht=Tt(),At=ht.atom,Po=ht.report;function Xn(e,t){return e.fields.every(n=>Ft(n,t))}function Ft(e,t){return t[e.name]?.hidden??e.hidden??!1}function Kn(e,t){return A(e)?Xn(e,t):Ft(e,t)}function St(e){let t=Hn(At);return e.container&&(t[e.container.name]?.hidden??e.container.hidden??!1)||e.fields.length===0||e.fields.every(r=>Kn(r,t))?null:e.children}import{jsx as Nt}from"react/jsx-runtime";function Ct(){return Nt("div",{"data-slot":"field-separator",className:"relative -my-2 h-5 text-sm",children:Nt("div",{className:"absolute inset-0 top-1/2 h-px w-full bg-slate-200 dark:bg-slate-800"})})}import{jsx as I,jsxs as It}from"react/jsx-runtime";function Lt(e){let t=_(e.sections,e.definition);return I("div",{className:"h-full w-full",children:I("form",{noValidate:e.noValidate,action:e.action,children:It(R,{children:[t.map((n,r)=>It(St,{fields:n.fields??[],children:[I(bt,{section:n,style:e.config.style,children:e.children({disabled:e.readOnly,fields:n.fields})}),n.separator&&I(Ct,{})]},r)),e.control&&I(oe,{isPending:e.isPending,children:e.control})]})})})}import{jsx as Wn}from"react/jsx-runtime";function kt(e){return Wn("p",{className:"-mt-2 text-xs leading-normal font-normal text-slate-600 dark:text-slate-400",children:e.children})}import{jsx as qn}from"react/jsx-runtime";function G(e){let t=y(e.text);return t?qn(kt,{children:t}):null}import{twMerge as zn}from"tailwind-merge";import{jsx as Zn,jsxs as Jn}from"react/jsx-runtime";function vt(e){let t=e.style?.showOptionalLabel??!0,n=x(e.field)||d(e.field);return Jn("label",{"data-slot":"field-label","data-normal":n,className:zn("flex w-fit items-center gap-2 text-sm leading-snug font-medium select-none","data-[normal=true]:font-normal","group-data-[readonly=true]:cursor-not-allowed group-data-[readonly=true]:opacity-50"),htmlFor:e.field.name,children:[e.children,t&&!e.field.required&&Zn("span",{className:"text-sm text-slate-600 dark:text-slate-400",children:b("(Optional)",e.translations)})]})}import{jsx as Et,jsxs as Qn}from"react/jsx-runtime";function Ot(e){let t={context:e.context,env:e.config?.env},n=z(e.field.label,t),r=z(e.field.description,t);return Qn("div",{"data-slot":"field-content",className:"flex w-full flex-1 flex-col gap-1.5 leading-snug",children:[Et(vt,{field:e.field,style:e.config?.style,translations:e.translations,children:b(n,e.translations)}),e.orientation===h&&Et(G,{text:b(r,e.translations)})]})}import{Fragment as jn,jsx as wt,jsxs as er}from"react/jsx-runtime";function Pt(e){return er(jn,{children:[e.field.name&&e.field.label&&wt(Ot,{config:e.config,context:e.context,field:e.field,orientation:e.orientation,translations:e.translations}),e.children,e.orientation===p&&e.field.description&&wt(G,{text:b(e.field.description,e.translations)})]})}function Mt(e,t){return e?t(e):null}import{jsx as Dt}from"react/jsx-runtime";function _t(e){let t=et(e.field,e.value),{commonPropsWithOptions:n,defaultValue:r}=tt(e.field,e.commonProps,t,e.value),o=nt(e.field,r);return Mt(e.config.inputs[e.field.type],i=>Dt(Pt,{config:e.config,context:e.context,field:e.field,orientation:e.orientation,translations:e.translations,children:Dt(i,{...e.ariaAttributes,...n,...e.dataAttributes,...o})}))}import{jsx as Vt}from"react/jsx-runtime";function Bt(e){return!e.errors||e.errors.length===0?null:Vt("ul",{className:"text-sm text-red-600 dark:text-red-500",id:e.name?`${e.name}-error`:void 0,children:e.errors?.map((t,n)=>Vt("li",{children:t},e.name?`${e.name}-error-${n}`:n))})}import{twMerge as tr}from"tailwind-merge";import{jsx as nr}from"react/jsx-runtime";function $(e){let t=e.errors&&e.errors.length>0;return nr("div",{"data-slot":"field","data-clickable":e.isClickable?"true":"false",...t&&{[he]:"true"},...e.disabled&&{[Ae]:"true"},"data-orientation":e.orientation,className:tr("group flex w-full flex-col items-center data-[invalid=true]:text-red-600 data-[invalid=true]:dark:text-red-500","data-[clickable=true]:items-start",e.isCheckbox&&(e.isReversed?"flex-row-reverse!":"flex-row!"),"data-[clickable=true]:has-[>[data-slot=field-content]]:[&>:first-child]:mt-px",e.className),children:e.children})}import{twMerge as rr}from"tailwind-merge";import{jsx as or}from"react/jsx-runtime";function Gt(e){return or($,{...e,orientation:p,className:rr("gap-3 has-[>[data-slot=field-content]]:items-start",!e.isClickable&&"[&>*]:w-full"),children:e.children})}import{twMerge as ir}from"tailwind-merge";import{jsx as lr}from"react/jsx-runtime";function $t(e){return lr($,{...e,orientation:h,className:ir("gap-2 md:flex-row md:gap-4","[&>[data-slot=field-content]]:min-w-0 [&>[data-slot=field-content]]:flex-grow [&>[data-slot=field-content]]:self-start","[&_[role=checkbox]]:mt-[1.5px]",e.isClickable&&"md:flex-col",!e.isClickable&&["md:justify-between","[&>*:not([data-slot=field-content])]:w-full","[&>*:not([data-slot=field-content])]:md:w-1/2","[&>*:not([data-slot=field-content])]:xl:w-2/5"]),children:e.children})}import{jsx as Ut}from"react/jsx-runtime";function Yt(e){let t=Ge(e.field),n=d(e.field),r=Xe(e.field);return e.orientation===p?Ut(Gt,{disabled:e.disabled,errors:e.errors,isCheckbox:n,isReversed:r,isClickable:t,children:e.children}):Ut($t,{disabled:e.disabled,errors:e.errors,isCheckbox:n,isReversed:r,isClickable:t,children:e.children})}function Ht(e){if(!e.field.type)return null;let t=Ze(e.field,e.disabled),n=at(e.field),r=lt(e.field,e.errors),o={...e.field,disabled:t.disabled};return e.children({ariaAttributes:r,commonProps:t,dataAttributes:n,field:o,orientation:e.orientation})}import{twMerge as ar}from"tailwind-merge";import{jsx as te,jsxs as sr}from"react/jsx-runtime";function Xt(e){let t=e.field.advanced?.cols,n=e.field.name?e.errors?.[e.field.name]:void 0,{orientation:r}=V(e.style,{orientation:He(e.field)}),o=Ke(e.field,e.disabled);return sr("div",{className:ar("flex flex-col gap-3",ut(t)),children:[te(Yt,{disabled:o,errors:n,field:e.field,orientation:r,children:te(Ht,{disabled:o,errors:n,field:e.field,orientation:r,children:e.children})}),te(Bt,{errors:n,name:e.field.name})]})}import{twMerge as dr}from"tailwind-merge";import{jsx as L,jsxs as U}from"react/jsx-runtime";function Kt(e){function t(){e.canRemove&&e.onRemove&&e.onRemove(e.index)}let n=e.canRemove&&e.onRemove!=null&&L("button",{"aria-label":`Remove ${e.label} item ${e.index+1}`,className:dr("rounded p-1 text-xl text-slate-400","transition-colors duration-150","hover:text-red-500","focus-visible:ring-2 focus-visible:ring-slate-400 focus-visible:outline-none","dark:text-slate-500 dark:hover:text-red-400"),onClick:t,type:"button",children:L("span",{"aria-hidden":"true",children:"\xD7"})});return e.isMultiField?U("div",{className:"rounded-lg border border-slate-100 p-4 dark:border-slate-900",children:[U("div",{className:"mb-3 flex items-center justify-between",children:[U("span",{className:"text-sm font-medium text-slate-400 dark:text-slate-500",children:[e.label," ",e.index+1]}),n]}),L(R,{children:e.children})]}):U("div",{className:"flex items-start gap-2",children:[L(R,{children:e.children}),n&&L("div",{className:"shrink-0",children:n})]})}import{jsx as cr}from"react/jsx-runtime";function Wt(e){let t=pt(e.field),n=ft(e.field);return mt(e.field,e.value).map(r=>cr(Kt,{index:r,isMultiField:n,label:t,children:e.children(r)},r))}import{jsx as ur}from"react/jsx-runtime";function qt(e){let t=Array.isArray(e.field.fields)&&e.field.fields.length===0;return ur(B,{description:e.field.description,empty:t,id:e.field.name,title:e.field.label,children:e.children})}import{jsx as zt}from"react/jsx-runtime";function Zt({children:e,field:t,value:n}){return zt(qt,{field:t,children:zt(Wt,{field:t,value:n,children:e})})}import{twMerge as fr}from"tailwind-merge";import{jsx as Jt}from"react/jsx-runtime";function Qt(e){let t=ct(e.column?.advanced?.cols);return Jt("div",{className:"flex w-full flex-col gap-4",children:Jt("div",{className:fr("grid grid-cols-1 gap-3 sm:gap-4",t),children:e.children})})}import{Fragment as pr}from"react";import{jsx as mr}from"react/jsx-runtime";function jt(e){let t=Array.isArray(e.field.fields)?e.field.fields.map(n=>P(n)?{...n,name:`${e.field.name}.${e.index}.${n.name}`}:A(n)?{...n,fields:n.fields.map(r=>({...r,name:`${e.field.name}.${e.index}.${r.name}`}))}:n):[];return mr(k,{children:e.children,components:e.components,disabled:e.disabled,fields:t,style:e.style,value:e.value})}import{jsx as v,jsxs as gr}from"react/jsx-runtime";function k(e){let{field:t,list:n}=e.components;return _(e.fields).map((r,o)=>gr(pr,{children:[A(r)&&v(Qt,{column:r,children:v(k,{...e,fields:r.fields})}),P(r)&&v(t,{disabled:e.disabled,field:r,style:e.style,children:e.children}),$e(r)&&v(n,{field:r,value:e.value,children:i=>v(jt,{children:e.children,components:e.components,disabled:e.disabled,field:r,index:i,style:e.style,value:e.value})})]},o))}import{jsx as yr}from"react/jsx-runtime";function en(e){return n=>yr(k,{...n,components:e})}var tn=en({field:Xt,list:Zt});import{jsx as ne}from"react/jsx-runtime";function re(e){let t=e.translations?.[e.lang??""];return ne(Lt,{config:e.config,control:e.children,definition:e.definition,readOnly:e.readOnly,sections:e.sections,children:({disabled:n,fields:r})=>ne(tn,{disabled:n,fields:r,style:e.config.style,children:o=>ne(_t,{...o,config:e.config,context:e.context,translations:t,value:e.value})})})}import{Suspense as xr}from"react";import{jsx as nn}from"react/jsx-runtime";function br(e){return nn(xr,{fallback:nn(re,{config:e.config,sections:e.sections,readOnly:!0}),children:e.children})}export{br as Fallback,re as Form};
|
|
1
|
+
import{jsx as on}from"react/jsx-runtime";function re(e){let t=typeof e.children=="function"?e.children({isPending:e.isPending}):e.children;return on("div",{"data-slot":"field-control",className:"w-full",children:t})}import{Activity as kn,useCallback as Ln,useState as En}from"react";import{jsx as oe}from"react/jsx-runtime";function ie(e){return oe("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:`size-4 transition-transform duration-200 ${e.expanded?"rotate-90":""}`,children:oe("path",{fillRule:"evenodd",d:"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})})}var L="input",le="input/email",ae="input/number";var se="textarea",de="radio",ce="checkbox",z="list";var ue="select",fe="select/month",me="select/year";var T="column",ge="description",U="fields",pe="label",Y="value",E="options",X="email",ye="number",xe="password",be="tel",A="text",Re="aria-errormessage",he="aria-invalid",Te="data-invalid",Ae="data-readonly",Fe="aria",Se="data",Ne="min",Ce="max",Ie="minLength",ve="maxLength",b="$ref";var ke="type";function a(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function f(e){return m(e)||typeof e=="number"||ln(e)}function m(e){return typeof e=="string"}function ln(e){return typeof e=="boolean"}function Le(e,t=Y){if(e!=null){if(f(e))return e;if(a(e)){let n=an(e,t);if(f(n))return n}}}function an(e,t){let n=d(e,t);if(f(n))return n}function d(e,t){if(!t||!a(e))return null;let n=t.split(".").filter(o=>o!=="");if(n.length===0)return null;let r=e;for(let o of n)if(a(r)&&o in r)r=r[o];else return null;return r}function Ee(e,t={description:ge,label:pe,value:Y}){return e.map(n=>{if(a(n)){let r=d(n,t.label),o=d(n,t.value);if(f(r)&&f(o)){let i=d(n,t.description);return{label:`${r}`,value:`${o}`,...f(i)&&{description:`${i}`}}}}return n})}function we(e=A){if(e){let t=e.lastIndexOf("/"),n=t===-1?e:e.slice(t+1);if(n&&n!==L)return n.trim().toLowerCase()}return A}var sn=/\[([^\]]{1,500})\]\(([^)]{1,2000})\)/g;function H(e,t={}){if(m(e))return dn(e,t);if(Array.isArray(e))return e.map(n=>H(n,t));if(a(e)){let n={};for(let r in e)n[r]=H(e[r],t);return n}return e}function w(e,t={}){return K(e)?H(e,t):e}function K(e){return m(e)?/{([^}]{1,200})}/.test(e):Array.isArray(e)?e.some(t=>K(t)):a(e)?Object.values(e).some(t=>K(t)):!1}function dn(e,t={}){return e.replace(/{([^}]{1,200})}/g,(n,r)=>{let o=r.includes(".")?d(t,r):t[r];return f(o)?String(o):n})}function Pe(e,t){if(!m(e)||!e||e.trim().length===0)return null;let n,r=0,o=!1,i=[];for(;(n=sn.exec(e))!==null;){let[l,s,nn]=n,k=n.index;o=!0,k>r&&i.push(e.substring(r,k));let rn=t?t(k,nn,s):l;i.push(rn),r=k+l.length}return o?(r<e.length&&i.push(e.substring(r)),i):e}var Oe=e=>u(fe)(e),Me=e=>u(me)(e),c=u(ce),De=u(L),y=u(de),g=u(ue),_e=u(se),Ve=u(A,X,xe,be),wr=u(le,X),Be=u(ae,ye);function Ge(e){return y(e)||c(e)}function $e(e){return e.type===z}function R(e){return e.type===T}function P(e){return e.type!==T&&e.type!==z}function W(e){return g(e)||y(e)}function q(e){return e!=null&&e!==""}function u(...e){return t=>{let n=m(t.type)?t.type:void 0;return n?e.some(r=>n===r||n?.startsWith(`${r}/`)):!1}}function ze(e,t={}){if(g(e)&&e.disabled){let n=e.name?t?.[e.name]:void 0;if(n&&a(n))return[n]}}function Ue(e){return y(e)||c(e)?!0:e.advanced?.horizontal??!1}function Ye(e){return c(e)?e.advanced?.reverse!==!1:!1}function Xe(e,t){let n=e.readonly??!1;return t||n}function He(e){if(y(e)||g(e)&&!e.disabled){let t=e.source;if(Array.isArray(t)||a(t)&&!(b in t))return t}}var cn=/^\d+$/;function Ke(){return Array.from({length:12},(e,t)=>({value:(t+1).toString(),label:new Date(0,t).toLocaleString("default",{month:"long"})}))}function We(e,t){return t>=e?Array.from({length:t-e+1},(n,r)=>{let o=e+r;return{value:o.toString(),label:o.toString()}}):[]}function Z(){return new Date().getFullYear()}function J(e,t){if(typeof e=="number")return e;let n=t??Z(),r=e.trim().toLowerCase();if(r.startsWith("current")){let o=r.match(/^current([+-])(\d+)$/);if(o){let[,i,l]=o,s=parseInt(l,10);if(!isNaN(s))return i==="+"?n+s:n-s}return n}return cn.test(r)?parseInt(r,10):n}var O=Z();function un(e){if(g(e))return fn(e)}function fn(e){if(Oe(e))return Ke();if(Me(e)){let t=e.advanced?.length?.min??O,n=e.advanced?.length?.max??O+5;return We(J(t,O),J(n,O))}}function qe(e,t=!1){let n={disabled:t,id:e.name,name:e.name,placeholder:e.placeholder,required:e.required};return De(e)?{...n,...mn(e)}:g(e)?{...n,...gn(e)}:_e(e)?{...n,...pn(e)}:n}function mn(e){let t=we(e.type),n={...e,type:t};return{...Ze(e),...yn(n),...Ve(n)?Je(n):{},type:t}}function gn(e){let t=un(e);return t?{options:t}:{}}function pn(e){return{...Ze(e),...Je(e)}}function Ze(e){let t=e.advanced?.autocomplete;return t?{autoComplete:t}:{}}function yn(e){return Be(e)?xn(e):{}}function Je(e){return Qe(e,{min:Ie,max:ve})}function xn(e){return Qe(e,{min:Ne,max:Ce})}function Qe(e,t){let n={},r=e.advanced?.length;return r&&(r.min!==void 0&&(n[t.min]=r.min),r.max!==void 0&&(n[t.max]=r.max)),n}function je(e,t){let n=He(e);return n||ze(e,t)}function bn(e,t){let n=a(t)&&e.name in t?t[e.name]:t;return Le(n,e.advanced?.entity)}function Rn(e,t,n){return W(e)&&Array.isArray(n)?{...t,[E]:n}:t}function hn(e,t,n){if(e.required&&!q(n)&&g(e)&&e.advanced?.preselected!==!1&&E in t){let r=t[E];if(Array.isArray(r)&&r.length===1)return r[0]}return n}function Tn(e,t){return W(e)&&Array.isArray(t)?Ee(t,e.advanced?.options):t}function et(e,t,n,r){let o=bn(e,r),i=Array.isArray(n)?Tn(e,n):n,l=Rn(e,t,i),s=hn(e,l,o);return{commonPropsWithOptions:l,defaultValue:s}}function tt(e,t){return c(e)?{defaultChecked:q(t)}:{defaultValue:t}}var An=/^#\/definition\//;function D(e=[],t){let n=M(e,t);return Array.isArray(n)?n.filter(Sn).sort((r,o)=>nt(r)-nt(o)):[]}function M(e,t,n=new Map,r=new WeakSet){if(!Fn(t)||!e||typeof e!="object")return e;if(n.has(e))return n.get(e);if(r.has(e))return e;if(r.add(e),Array.isArray(e))return e.map(i=>M(i,t,n,r));if(b in e&&m(e[b])){let i=e[b].replace(An,""),l=d(t,i);return l!==null?M(l,t,n,r):e}let o={};for(let[i,l]of Object.entries(e))o[i]=M(l,t,n,r);return r.delete(e),n.set(e,o),o}function rt(e){return Object.entries(e??{})}function nt(e){return e.order??Number.MAX_VALUE}function Fn(e){return e!==void 0&&a(e)&&Object.keys(e).length>0}function Sn(e){return ke in e?!0:Array.isArray(e[U])?e[U].length>0:!0}function ot(e,t){let n={};for(let[r,o]of rt(t))n[`${e}-${r}`]=o;return n}function Nn(e){return ot(Fe,e)}function Cn(e){return ot(Se,e)}function it(e,t){let n=Nn(e.advanced?.aria);return t&&t.length>0&&(n[he]="true",n[Re]=`${e.name}-error`),n}function lt(e){return Cn(e.advanced?.data)}var at={1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3"},st={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3"};function dt(e,t=2){return at[e&&e in at?e:t]}function ct(e){if(e&&e in st)return st[e]}function In(e,t){let n=e.advanced?.length?.min??1;if(t){let r=d(t,e.name);if(Array.isArray(r))return Math.max(r.length,n)}return Math.max(n,0)}function ut(e){return!Array.isArray(e.fields)||e.fields.length===0?!1:e.fields.length>1||e.fields[0].type===T}function ft(e,t){let n=In(e,t);return Array.from({length:n},(r,o)=>o)}function mt(e){return e.label??e.name}function h(e,t){return e?t?t[e]??e:e:""}function _(e,t){return{...e,...t}}import{jsx as vn}from"react/jsx-runtime";function p(e){return Pe(e,(t,n,r)=>vn("a",{className:"underline",href:n,rel:"noopener noreferrer",target:"_blank",children:r},`${n}-${t}`))}import{jsx as F,jsxs as Q}from"react/jsx-runtime";function gt(e){let{fields:t=[]}=e.section,[n,r]=En(!1),o=Ln(()=>r(i=>!i),[]);return Q("fieldset",{"data-slot":"field-set","data-advanced":"true","data-expanded":n,"data-empty":t.length===0,className:"flex flex-col",id:e.section.id?.toString(),children:[F("legend",{children:Q("button",{className:"flex cursor-pointer items-center gap-2 text-base font-medium text-slate-600 dark:text-slate-400",onClick:o,type:"button",children:[F(ie,{expanded:n}),F("span",{children:p(e.section.title)})]})}),F(kn,{mode:n?"visible":"hidden",children:Q("div",{className:"mt-3 ml-1.5 flex flex-col gap-4 border-l-2 border-slate-300 pl-4 dark:border-slate-600","data-slot":"field-set-content",children:[e.section.description&&F("p",{className:"text-sm leading-normal font-normal text-slate-600 dark:text-slate-400",children:p(e.section.description)}),e.group]})})]})}import{Fragment as wn,jsx as pt,jsxs as Pn}from"react/jsx-runtime";function yt(e){return Pn(wn,{children:[e.title&&pt("legend",{className:"mb-3 font-medium text-slate-800 dark:text-slate-200",children:p(e.title)}),e.description&&pt("p",{className:"-mt-2 text-sm leading-normal font-normal text-slate-600 dark:text-slate-400",children:p(e.description)})]})}import{jsx as On,jsxs as Mn}from"react/jsx-runtime";function V(e){return Mn("fieldset",{"data-slot":"field-set","data-empty":e.empty,className:"flex flex-col data-[empty=false]:gap-6",id:e.id,children:[On(yt,{description:e.description,title:e.title}),e.children]})}import{jsx as Dn}from"react/jsx-runtime";function x(e){return Dn("div",{"data-slot":"field-group","data-compact":e.compact,className:"flex w-full flex-col gap-8 data-[compact=true]:gap-3",children:e.children})}import{jsx as j}from"react/jsx-runtime";function xt(e){let{fields:t=[]}=e.section,{compact:n}=_(e.style,{compact:e.section.compact}),r=j(x,{compact:n,children:e.children});return!e.section.title&&!e.section.description?r:e.section.advanced?j(gt,{section:e.section,group:r}):j(V,{description:e.section.description,empty:t.length===0,id:e.section.id?.toString(),title:e.section.title,children:r})}import{useAtomValue as Un}from"jotai";import{atom as S}from"jotai";import{atomFamily as _n}from"jotai-family";import{deepEqual as bt}from"fast-equals";function Vn(e,t){let{[t]:n,...r}=e;return r}function Bn(e){return _n(t=>S(n=>n(e)[t]??void 0,(n,r,o)=>{let i=n(e);if(o!=null){let l=i[t];(!l||!bt(l,o))&&r(e,{...i,[t]:o})}else i[t]&&r(e,Vn(i,t))}))}function Gn(e){return S(null,(t,n)=>{let r=t(e);r&&Object.keys(r).length>0&&n(e,{})})}function $n(e){return S(null,(t,n,r)=>{let i={...t(e)},l=!1;for(let s of r)i[s]&&(delete i[s],l=!0);l&&n(e,i)})}function zn(e){return S(null,(t,n,r)=>{let o=t(e);bt(o,r)||n(e,r)})}function Rt(e={}){let t=S(e);return{atom:t,clearAll:Gn(t),clear:$n(t),bulkReport:zn(t),report:Bn(t)}}var ht=Rt(),Tt=ht.atom,Po=ht.report;function Yn(e,t){return e.fields.every(n=>At(n,t))}function At(e,t){return t[e.name]?.hidden??e.hidden??!1}function Xn(e,t){return R(e)?Yn(e,t):At(e,t)}function Ft(e){let t=Un(Tt);return e.container&&(t[e.container.name]?.hidden??e.container.hidden??!1)||e.fields.length===0||e.fields.every(r=>Xn(r,t))?null:e.children}import{jsx as St}from"react/jsx-runtime";function Nt(){return St("div",{"data-slot":"field-separator",className:"relative -my-2 h-5 text-sm",children:St("div",{className:"absolute inset-0 top-1/2 h-px w-full bg-slate-200 dark:bg-slate-800"})})}import{jsx as N,jsxs as Ct}from"react/jsx-runtime";function It(e){let t=D(e.sections,e.definition);return N("div",{className:"h-full w-full",children:N("form",{noValidate:e.noValidate,action:e.action,children:Ct(x,{children:[t.map((n,r)=>Ct(Ft,{fields:n.fields??[],children:[N(xt,{section:n,style:e.config.style,children:e.children({disabled:e.readOnly,fields:n.fields})}),n.separator&&N(Nt,{})]},r)),e.control&&N(re,{isPending:e.isPending,children:e.control})]})})})}import{jsx as Hn}from"react/jsx-runtime";function vt(e){return Hn("p",{className:"-mt-2 text-xs leading-normal font-normal text-slate-600 dark:text-slate-400",children:e.children})}import{jsx as Kn}from"react/jsx-runtime";function B(e){let t={context:e.context,env:e.config?.env},n=h(w(e.text,t),e.translations),r=p(n);return r?Kn(vt,{children:r}):null}import{twMerge as Wn}from"tailwind-merge";import{jsx as qn,jsxs as Zn}from"react/jsx-runtime";function kt(e){let t=e.style?.showOptionalLabel??!0,n=y(e.field)||c(e.field);return Zn("label",{"data-slot":"field-label","data-normal":n,className:Wn("flex w-fit items-center gap-2 text-sm leading-snug font-medium select-none","data-[normal=true]:font-normal","group-data-[readonly=true]:cursor-not-allowed group-data-[readonly=true]:opacity-50"),htmlFor:e.field.name,children:[e.children,t&&!e.field.required&&qn("span",{className:"text-sm text-slate-600 dark:text-slate-400",children:h("(Optional)",e.translations)})]})}import{jsx as Lt,jsxs as Jn}from"react/jsx-runtime";function Et(e){let t={context:e.context,env:e.config?.env},n=w(e.field.label,t);return Jn("div",{"data-slot":"field-content",className:"flex w-full flex-1 flex-col gap-1.5 leading-snug",children:[Lt(kt,{field:e.field,style:e.config?.style,translations:e.translations,children:h(n,e.translations)}),e.horizontal===!0&&Lt(B,{config:e.config,context:e.context,text:e.field.description,translations:e.translations})]})}import{Fragment as Qn,jsx as wt,jsxs as jn}from"react/jsx-runtime";function Pt(e){return jn(Qn,{children:[e.field.name&&e.field.label&&wt(Et,{config:e.config,context:e.context,field:e.field,horizontal:e.horizontal,translations:e.translations}),e.children,e.horizontal===!1&&wt(B,{config:e.config,context:e.context,text:e.field.description,translations:e.translations})]})}function Ot(e,t){return e?t(e):null}import{jsx as Mt}from"react/jsx-runtime";function Dt(e){let t=je(e.field,e.value),{commonPropsWithOptions:n,defaultValue:r}=et(e.field,e.commonProps,t,e.value),o=tt(e.field,r);return Ot(e.config.inputs[e.field.type],i=>Mt(Pt,{config:e.config,context:e.context,field:e.field,horizontal:e.horizontal,translations:e.translations,children:Mt(i,{...e.ariaAttributes,...n,...e.dataAttributes,...o})}))}import{jsx as _t}from"react/jsx-runtime";function Vt(e){return!e.errors||e.errors.length===0?null:_t("ul",{className:"text-sm text-red-600 dark:text-red-500",id:e.name?`${e.name}-error`:void 0,children:e.errors?.map((t,n)=>_t("li",{children:t},e.name?`${e.name}-error-${n}`:n))})}import{twMerge as er}from"tailwind-merge";import{jsx as tr}from"react/jsx-runtime";function G(e){let t=e.errors&&e.errors.length>0;return tr("div",{"data-slot":"field","data-clickable":e.isClickable?"true":"false",...t&&{[Te]:"true"},...e.disabled&&{[Ae]:"true"},"data-orientation":e.orientation,className:er("group flex w-full flex-col items-center data-[invalid=true]:text-red-600 data-[invalid=true]:dark:text-red-500","data-[clickable=true]:items-start",e.isCheckbox&&(e.isReversed?"flex-row-reverse!":"flex-row!"),"data-[clickable=true]:has-[>[data-slot=field-content]]:[&>:first-child]:mt-px",e.className),children:e.children})}import{twMerge as nr}from"tailwind-merge";import{jsx as rr}from"react/jsx-runtime";function Bt(e){return rr(G,{...e,orientation:"vertical",className:nr("gap-3 has-[>[data-slot=field-content]]:items-start",!e.isClickable&&"[&>*]:w-full"),children:e.children})}import{twMerge as or}from"tailwind-merge";import{jsx as ir}from"react/jsx-runtime";function Gt(e){return ir(G,{...e,orientation:"horizontal",className:or("gap-2 md:flex-row md:gap-4","[&>[data-slot=field-content]]:min-w-0 [&>[data-slot=field-content]]:flex-grow [&>[data-slot=field-content]]:self-start","[&_[role=checkbox]]:mt-[1.5px]",e.isClickable&&"md:flex-col",!e.isClickable&&["md:justify-between","[&>*:not([data-slot=field-content])]:w-full","[&>*:not([data-slot=field-content])]:md:w-1/2","[&>*:not([data-slot=field-content])]:xl:w-2/5"]),children:e.children})}import{jsx as $t}from"react/jsx-runtime";function zt(e){let t=Ge(e.field),n=c(e.field),r=Ye(e.field);return e.horizontal?$t(Gt,{disabled:e.disabled,errors:e.errors,isCheckbox:n,isReversed:r,isClickable:t,children:e.children}):$t(Bt,{disabled:e.disabled,errors:e.errors,isCheckbox:n,isReversed:r,isClickable:t,children:e.children})}function Ut(e){if(!e.field.type)return null;let t=qe(e.field,e.disabled),n=lt(e.field),r=it(e.field,e.errors),o={...e.field,disabled:t.disabled};return e.children({ariaAttributes:r,commonProps:t,dataAttributes:n,field:o,horizontal:e.horizontal})}import{twMerge as lr}from"tailwind-merge";import{jsx as ee,jsxs as ar}from"react/jsx-runtime";function Yt(e){let t=e.field.advanced?.cols,n=e.field.name?e.errors?.[e.field.name]:void 0,{horizontal:r}=_(e.style,{horizontal:Ue(e.field)}),o=Xe(e.field,e.disabled);return ar("div",{className:lr("flex flex-col gap-3",ct(t)),children:[ee(zt,{disabled:o,errors:n,field:e.field,horizontal:r,children:ee(Ut,{disabled:o,errors:n,field:e.field,horizontal:r,children:e.children})}),ee(Vt,{errors:n,name:e.field.name})]})}import{twMerge as sr}from"tailwind-merge";import{jsx as C,jsxs as $}from"react/jsx-runtime";function Xt(e){function t(){e.canRemove&&e.onRemove&&e.onRemove(e.index)}let n=e.canRemove&&e.onRemove!=null&&C("button",{"aria-label":`Remove ${e.label} item ${e.index+1}`,className:sr("rounded p-1 text-xl text-slate-400","transition-colors duration-150","hover:text-red-500","focus-visible:ring-2 focus-visible:ring-slate-400 focus-visible:outline-none","dark:text-slate-500 dark:hover:text-red-400"),onClick:t,type:"button",children:C("span",{"aria-hidden":"true",children:"\xD7"})});return e.isMultiField?$("div",{className:"rounded-lg border border-slate-100 p-4 dark:border-slate-900",children:[$("div",{className:"mb-3 flex items-center justify-between",children:[$("span",{className:"text-sm font-medium text-slate-400 dark:text-slate-500",children:[e.label," ",e.index+1]}),n]}),C(x,{children:e.children})]}):$("div",{className:"flex items-start gap-2",children:[C(x,{children:e.children}),n&&C("div",{className:"shrink-0",children:n})]})}import{jsx as dr}from"react/jsx-runtime";function Ht(e){let t=mt(e.field),n=ut(e.field);return ft(e.field,e.value).map(r=>dr(Xt,{index:r,isMultiField:n,label:t,children:e.children(r)},r))}import{jsx as cr}from"react/jsx-runtime";function Kt(e){let t=Array.isArray(e.field.fields)&&e.field.fields.length===0;return cr(V,{description:e.field.description,empty:t,id:e.field.name,title:e.field.label,children:e.children})}import{jsx as Wt}from"react/jsx-runtime";function qt({children:e,field:t,value:n}){return Wt(Kt,{field:t,children:Wt(Ht,{field:t,value:n,children:e})})}import{twMerge as ur}from"tailwind-merge";import{jsx as Zt}from"react/jsx-runtime";function Jt(e){let t=dt(e.column?.advanced?.cols);return Zt("div",{className:"flex w-full flex-col gap-4",children:Zt("div",{className:ur("grid grid-cols-1 gap-3 sm:gap-4",t),children:e.children})})}import{Fragment as mr}from"react";import{jsx as fr}from"react/jsx-runtime";function Qt(e){let t=Array.isArray(e.field.fields)?e.field.fields.map(n=>P(n)?{...n,name:`${e.field.name}.${e.index}.${n.name}`}:R(n)?{...n,fields:n.fields.map(r=>({...r,name:`${e.field.name}.${e.index}.${r.name}`}))}:n):[];return fr(I,{children:e.children,components:e.components,disabled:e.disabled,fields:t,style:e.style,value:e.value})}import{jsx as v,jsxs as gr}from"react/jsx-runtime";function I(e){let{field:t,list:n}=e.components;return D(e.fields).map((r,o)=>gr(mr,{children:[R(r)&&v(Jt,{column:r,children:v(I,{...e,fields:r.fields})}),P(r)&&v(t,{disabled:e.disabled,field:r,style:e.style,children:e.children}),$e(r)&&v(n,{field:r,value:e.value,children:i=>v(Qt,{children:e.children,components:e.components,disabled:e.disabled,field:r,index:i,style:e.style,value:e.value})})]},o))}import{jsx as pr}from"react/jsx-runtime";function jt(e){return n=>pr(I,{...n,components:e})}var en=jt({field:Yt,list:qt});import{jsx as te}from"react/jsx-runtime";function ne(e){let t=e.translations?.[e.lang??""];return te(It,{config:e.config,control:e.children,definition:e.definition,readOnly:e.readOnly,sections:e.sections,children:({disabled:n,fields:r})=>te(en,{disabled:n,fields:r,style:e.config.style,children:o=>te(Dt,{...o,config:e.config,context:e.context,translations:t,value:e.value})})})}import{Suspense as yr}from"react";import{jsx as tn}from"react/jsx-runtime";function xr(e){return tn(yr,{fallback:tn(ne,{config:e.config,sections:e.sections,readOnly:!0}),children:e.children})}export{xr as Fallback,ne as Form};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function withError<P extends {
|
|
2
|
+
errors?: Record<string, string[]>;
|
|
3
|
+
field: {
|
|
4
|
+
name: string;
|
|
5
|
+
};
|
|
6
|
+
}>(Component: React.ComponentType<P>): (props: Readonly<P>) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export declare function withState<P extends {
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
field: {
|
|
10
|
+
name: string;
|
|
11
|
+
hidden?: boolean;
|
|
12
|
+
};
|
|
13
|
+
}>(Component: React.ComponentType<P>): (props: Readonly<P>) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const Field: (props: Readonly<Readonly<Readonly<{
|
|
2
|
+
children: import("../../../type").Children;
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
errors?: Record<string, string[]>;
|
|
5
|
+
field: import("@luna-form/core").Field;
|
|
6
|
+
style?: import("@luna-form/core").Style;
|
|
7
|
+
}>>>) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type FormState } from '../hook/use-form-action';
|
|
2
|
+
import type { Config, Control } from '../../type';
|
|
3
|
+
import type { Definition, Nullable, Sections, ZodSchema } from '@luna-form/core';
|
|
4
|
+
export declare function FormContent<T extends Record<string, unknown> = Record<string, unknown>, F = Record<string, unknown>>(props: Readonly<{
|
|
5
|
+
action?: (formData: F, schema?: ZodSchema) => Promise<FormState<T>>;
|
|
6
|
+
children?: Control;
|
|
7
|
+
config: Config;
|
|
8
|
+
context?: Record<string, unknown>;
|
|
9
|
+
definition?: Definition;
|
|
10
|
+
lang?: string;
|
|
11
|
+
onSuccess?: (data: T) => void;
|
|
12
|
+
onValueChange?: (input: {
|
|
13
|
+
name: string;
|
|
14
|
+
value: unknown;
|
|
15
|
+
}) => void;
|
|
16
|
+
readOnly?: boolean;
|
|
17
|
+
sections: Sections;
|
|
18
|
+
translations?: Record<string, Record<string, string>>;
|
|
19
|
+
value?: Nullable<T>;
|
|
20
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Config, Control } from '../../type';
|
|
2
|
+
import type { Definition, Nullable, Sections, ZodSchema } from '@luna-form/core';
|
|
3
|
+
import type { FormState } from '../hook/use-form-action';
|
|
4
|
+
export declare function Form<T extends Record<string, unknown> = Record<string, unknown>, F = Record<string, unknown>>(props: Readonly<{
|
|
5
|
+
action?: (formData: F, schema?: ZodSchema) => Promise<FormState<T>>;
|
|
6
|
+
children?: Control;
|
|
7
|
+
config: Config;
|
|
8
|
+
context?: Record<string, unknown>;
|
|
9
|
+
definition?: Definition;
|
|
10
|
+
lang?: string;
|
|
11
|
+
onSuccess?: (data: T) => void;
|
|
12
|
+
onValueChange?: (input: {
|
|
13
|
+
name: string;
|
|
14
|
+
value: unknown;
|
|
15
|
+
}) => void;
|
|
16
|
+
readOnly?: boolean;
|
|
17
|
+
sections: Sections;
|
|
18
|
+
translations?: Record<string, Record<string, string>>;
|
|
19
|
+
value?: Nullable<T>;
|
|
20
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type AriaAttributes, type CommonProps, type DataAttributes, type Field, type Nullable, type Schema } from '@luna-form/core';
|
|
2
|
+
import type { Config, InputChange } from '../../type';
|
|
3
|
+
export declare function Input(props: Readonly<{
|
|
4
|
+
ariaAttributes?: AriaAttributes;
|
|
5
|
+
commonProps: CommonProps;
|
|
6
|
+
config: Config;
|
|
7
|
+
context?: Record<string, unknown>;
|
|
8
|
+
dataAttributes?: DataAttributes;
|
|
9
|
+
field: Field;
|
|
10
|
+
horizontal?: boolean;
|
|
11
|
+
onMount: (name: string, schema: Schema, field: Field) => void;
|
|
12
|
+
onUnmount: (name: string) => void;
|
|
13
|
+
onValueChange?: (input: InputChange) => void;
|
|
14
|
+
translations?: Record<string, string>;
|
|
15
|
+
value?: Nullable<Record<string, unknown>>;
|
|
16
|
+
}>): import("react").ReactNode;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const Slot: (props: Readonly<{
|
|
2
|
+
children: import("../../../type").Children;
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
fields?: import("@luna-form/core").Fields;
|
|
5
|
+
style?: import("@luna-form/core").Style;
|
|
6
|
+
value?: import("@luna-form/core").Nullable<Record<string, unknown>>;
|
|
7
|
+
}>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type Field, type Nullable } from '@luna-form/core';
|
|
2
|
+
import type { Config } from '../../type';
|
|
3
|
+
export declare function useDataSource(field: Field, config: Config, value?: Nullable<Record<string, unknown>>): readonly [Nullable<unknown[]>, (target: string, value: import("@luna-form/core").DataSource | undefined) => void];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Field, type FormStateError, type Nullable, type Schemas, type ZodSchema } from '@luna-form/core';
|
|
2
|
+
export type FormState<T> = {
|
|
3
|
+
data: Nullable<T>;
|
|
4
|
+
error: Nullable<FormStateError>;
|
|
5
|
+
success: boolean;
|
|
6
|
+
};
|
|
7
|
+
export type FormActionOptions<T> = {
|
|
8
|
+
onSuccess?: (data: T) => void;
|
|
9
|
+
preserveValues?: boolean;
|
|
10
|
+
translations?: Record<string, string>;
|
|
11
|
+
validation?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare function useFormState<T, F = Record<string, unknown>>(getSchema: () => readonly [Schemas, Field[]], action?: (formData: F, schema?: ZodSchema) => Promise<FormState<T>>, options?: FormActionOptions<T>): readonly [(payload: FormData) => void, FormState<T>, boolean];
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { Field, Schema } from '@luna-form/core';
|
|
2
|
+
export declare function useInput(field: Field, onMount: (name: string, schema: Schema, field: Field) => void, onUnmount: (name: string) => void, translations?: Record<string, string>): import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useStore(): (names: string | string[]) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useTimeout(): (callback: () => void, delay: number) => void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type Field, type Nullable } from '@luna-form/core';
|
|
2
|
+
export declare function useValue(field: Field, currentValue?: Nullable<Record<string, unknown>>): {
|
|
3
|
+
readonly setValue: (newValue: unknown) => void;
|
|
4
|
+
readonly shouldSkipOnChange: () => boolean;
|
|
5
|
+
readonly value: {} | undefined;
|
|
6
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const clearInputErrorAtom: import("jotai").WritableAtom<null, [names: string[]], void> & {
|
|
2
|
+
init: null;
|
|
3
|
+
};
|
|
4
|
+
export declare const reportErrorAtom: import("jotai").WritableAtom<null, [newValue: Record<string, string[]>], void> & {
|
|
5
|
+
init: null;
|
|
6
|
+
};
|
|
7
|
+
export declare const reportInputErrorAtom: import("jotai-family").AtomFamily<string, import("jotai").WritableAtom<string[] | undefined, [newValue: string[] | undefined], void>>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type DataSource } from '@luna-form/core';
|
|
2
|
+
export declare const reportSourceAtom: import("jotai-family").AtomFamily<string, import("jotai").WritableAtom<DataSource | undefined, [target: string, value: DataSource | undefined], void>>;
|
|
3
|
+
export declare const clearInputSourceAtom: import("jotai").WritableAtom<null, [contributorNames: string[]], void> & {
|
|
4
|
+
init: null;
|
|
5
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { FieldState } from '@luna-form/core';
|
|
2
|
+
export declare const fieldStateAtom: import("jotai").PrimitiveAtom<Record<string, FieldState>> & {
|
|
3
|
+
init: Record<string, FieldState>;
|
|
4
|
+
};
|
|
5
|
+
export declare const reportFieldStateAtom: import("jotai-family").AtomFamily<string, import("jotai").WritableAtom<FieldState | undefined, [newValue: FieldState | undefined], void>>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type PrimitiveAtom } from 'jotai';
|
|
2
|
+
interface NestedAtomFamilyOptions<TInner> {
|
|
3
|
+
merge?: (values: TInner[]) => TInner | undefined;
|
|
4
|
+
validateTarget?: (target: string) => boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function omitKey<T extends Record<string, unknown>>(obj: T, key: string): T;
|
|
7
|
+
export declare function createNestedRecordAtomFamily<TInner, TRecord extends Record<string, Record<string, TInner>> = Record<string, Record<string, TInner>>>(baseAtom: PrimitiveAtom<TRecord>, options?: NestedAtomFamilyOptions<TInner>): import("jotai-family").AtomFamily<string, import("jotai").WritableAtom<TInner | undefined, [target: string, value: TInner | undefined], void>>;
|
|
8
|
+
export declare function createNestedClearAtom<TInner>(baseAtom: PrimitiveAtom<Record<string, Record<string, TInner>>>): import("jotai").WritableAtom<null, [contributorNames: string[]], void> & {
|
|
9
|
+
init: null;
|
|
10
|
+
};
|
|
11
|
+
export declare function createAtomStore<T>(initialValue?: Record<string, T>): {
|
|
12
|
+
atom: PrimitiveAtom<Record<string, T>> & {
|
|
13
|
+
init: Record<string, T>;
|
|
14
|
+
};
|
|
15
|
+
clearAll: import("jotai").WritableAtom<null, [], void> & {
|
|
16
|
+
init: null;
|
|
17
|
+
};
|
|
18
|
+
clear: import("jotai").WritableAtom<null, [names: string[]], void> & {
|
|
19
|
+
init: null;
|
|
20
|
+
};
|
|
21
|
+
bulkReport: import("jotai").WritableAtom<null, [newValue: Record<string, T>], void> & {
|
|
22
|
+
init: null;
|
|
23
|
+
};
|
|
24
|
+
report: import("jotai-family").AtomFamily<string, import("jotai").WritableAtom<NonNullable<T> | undefined, [newValue: T | undefined], void>>;
|
|
25
|
+
};
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const valueAtom: import("jotai").PrimitiveAtom<Record<string, unknown>> & {
|
|
2
|
+
init: Record<string, unknown>;
|
|
3
|
+
};
|
|
4
|
+
export declare const clearAllValueAtom: import("jotai").WritableAtom<null, [], void> & {
|
|
5
|
+
init: null;
|
|
6
|
+
};
|
|
7
|
+
export declare const clearInputValueAtom: import("jotai").WritableAtom<null, [names: string[]], void> & {
|
|
8
|
+
init: null;
|
|
9
|
+
};
|
|
10
|
+
export declare const reportValueAtom: import("jotai-family").AtomFamily<string, import("jotai").WritableAtom<{} | undefined, [newValue: unknown], void>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type FieldLayoutProps = {
|
|
2
|
+
children: React.ReactNode;
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
errors?: string[];
|
|
5
|
+
isCheckbox?: boolean;
|
|
6
|
+
isReversed?: boolean;
|
|
7
|
+
isClickable?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare function FieldBase(props: Readonly<FieldLayoutProps & {
|
|
10
|
+
className?: string;
|
|
11
|
+
orientation: 'horizontal' | 'vertical';
|
|
12
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type List, type Nullable } from '@luna-form/core';
|
|
2
|
+
export type ListProps = Readonly<{
|
|
3
|
+
children: (index: number) => React.ReactNode;
|
|
4
|
+
field: List;
|
|
5
|
+
value?: Nullable<Record<string, unknown>>;
|
|
6
|
+
}>;
|
|
7
|
+
export declare function FieldList(props: ListProps): import("react/jsx-runtime").JSX.Element[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Field, type Style } from '@luna-form/core';
|
|
2
|
+
import type { Children } from '../../type';
|
|
3
|
+
export type FieldProps = Readonly<{
|
|
4
|
+
children: Children;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
errors?: Record<string, string[]>;
|
|
7
|
+
field: Field;
|
|
8
|
+
style?: Style;
|
|
9
|
+
}>;
|
|
10
|
+
export declare function Field(props: FieldProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Definition, type Sections } from '@luna-form/core';
|
|
2
|
+
import type { Config, Control, Slot } from '../type';
|
|
3
|
+
export declare function Form(props: Readonly<{
|
|
4
|
+
action?: (formData: FormData) => void;
|
|
5
|
+
children: Slot;
|
|
6
|
+
config: Config;
|
|
7
|
+
control?: Control;
|
|
8
|
+
definition?: Definition;
|
|
9
|
+
isPending?: boolean;
|
|
10
|
+
noValidate?: boolean;
|
|
11
|
+
readOnly?: boolean;
|
|
12
|
+
sections: Sections;
|
|
13
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Config } from '../type';
|
|
2
|
+
export declare function FormattedDescription(props: Readonly<{
|
|
3
|
+
config?: Config;
|
|
4
|
+
context?: Record<string, unknown>;
|
|
5
|
+
text?: string;
|
|
6
|
+
translations?: Record<string, string>;
|
|
7
|
+
}>): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Field } from '@luna-form/core';
|
|
2
|
+
import type { Children } from '../../type';
|
|
3
|
+
export declare function InputBase(props: Readonly<{
|
|
4
|
+
children: Children;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
errors?: string[];
|
|
7
|
+
field: Field;
|
|
8
|
+
horizontal?: boolean;
|
|
9
|
+
}>): import("react").ReactNode;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Config } from '../type';
|
|
2
|
+
import type { Field } from '@luna-form/core';
|
|
3
|
+
export declare function InputGroup(props: Readonly<{
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
config?: Config;
|
|
6
|
+
context?: Record<string, unknown>;
|
|
7
|
+
field: Field;
|
|
8
|
+
horizontal?: boolean;
|
|
9
|
+
translations?: Record<string, string>;
|
|
10
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Field } from '@luna-form/core';
|
|
2
|
+
import type { Config } from '../type';
|
|
3
|
+
export declare function InputLabel(props: Readonly<{
|
|
4
|
+
config?: Config;
|
|
5
|
+
context?: Record<string, unknown>;
|
|
6
|
+
field: Field;
|
|
7
|
+
horizontal?: boolean;
|
|
8
|
+
translations?: Record<string, string>;
|
|
9
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Separator(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Fields, type Nullable, type Style } from '@luna-form/core';
|
|
2
|
+
import type { Children } from '../../type';
|
|
3
|
+
import type { FieldProps } from '../field/field';
|
|
4
|
+
import type { ListProps } from '../field/field-list';
|
|
5
|
+
export type SlotComponents = {
|
|
6
|
+
field: React.ComponentType<FieldProps>;
|
|
7
|
+
list: React.ComponentType<ListProps>;
|
|
8
|
+
};
|
|
9
|
+
export declare function SlotBase(props: Readonly<{
|
|
10
|
+
children: Children;
|
|
11
|
+
components: SlotComponents;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
fields?: Fields;
|
|
14
|
+
style?: Style;
|
|
15
|
+
value?: Nullable<Record<string, unknown>>;
|
|
16
|
+
}>): import("react/jsx-runtime").JSX.Element[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Children } from '../../type';
|
|
2
|
+
import type { Fields, Nullable, Style } from '@luna-form/core';
|
|
3
|
+
import type { SlotComponents } from './slot-base';
|
|
4
|
+
export declare function createSlot(components: SlotComponents): (props: Readonly<{
|
|
5
|
+
children: Children;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
fields?: Fields;
|
|
8
|
+
style?: Style;
|
|
9
|
+
value?: Nullable<Record<string, unknown>>;
|
|
10
|
+
}>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type List, type Nullable, type Style } from '@luna-form/core';
|
|
2
|
+
import { type SlotComponents } from './slot-base';
|
|
3
|
+
import type { Children } from '../../type';
|
|
4
|
+
export declare function SlotList(props: Readonly<{
|
|
5
|
+
children: Children;
|
|
6
|
+
components: SlotComponents;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
field: List;
|
|
9
|
+
index: number;
|
|
10
|
+
style?: Style;
|
|
11
|
+
value?: Nullable<Record<string, unknown>>;
|
|
12
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const Slot: (props: Readonly<{
|
|
2
|
+
children: import("../../type").Children;
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
fields?: import("@luna-form/core").Fields;
|
|
5
|
+
style?: import("@luna-form/core").Style;
|
|
6
|
+
value?: import("@luna-form/core").Nullable<Record<string, unknown>>;
|
|
7
|
+
}>) => import("react/jsx-runtime").JSX.Element;
|