react-luna-form 0.0.32 → 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 +1 -0
- package/dist/types/luna-core/src/util/constant.d.ts +1 -0
- 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/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 rn}from"react/jsx-runtime";function ne(e){let t=typeof e.children=="function"?e.children({isPending:e.isPending}):e.children;return rn("div",{"data-slot":"field-control",className:"w-full",children:t})}import{Activity as kn,useCallback as In,useState as Ln}from"react";import{jsx as re}from"react/jsx-runtime";function oe(e){return re("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:re("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",ie="input/email",le="input/number";var ae="textarea",se="radio",de="checkbox",z="list";var ce="select",ue="select/month",fe="select/year";var T="column",U="fields",me="label",Y="value",E="options",X="email",ge="number",pe="password",ye="tel",A="text",xe="aria-errormessage",be="aria-invalid",Re="data-invalid",he="data-readonly",Te="aria",Ae="data",Fe="min",Se="max",Ne="minLength",Ce="maxLength",b="$ref";var ve="type";function a(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function g(e){return u(e)||typeof e=="number"||on(e)}function u(e){return typeof e=="string"}function on(e){return typeof e=="boolean"}function ke(e,t=Y){if(e!=null){if(g(e))return e;if(a(e)){let n=ln(e,t);if(g(n))return n}}}function ln(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 Ie(e,t={label:me,value:Y}){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 Le(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 an=/\[([^\]]{1,500})\]\(([^)]{1,2000})\)/g;function H(e,t={}){if(u(e))return sn(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 u(e)?/{([^}]{1,200})}/.test(e):Array.isArray(e)?e.some(t=>K(t)):a(e)?Object.values(e).some(t=>K(t)):!1}function sn(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 Ee(e,t){if(!u(e)||!e||e.trim().length===0)return null;let n,r=0,o=!1,i=[];for(;(n=an.exec(e))!==null;){let[l,s,tn]=n,I=n.index;o=!0,I>r&&i.push(e.substring(r,I));let nn=t?t(I,tn,s):l;i.push(nn),r=I+l.length}return o?(r<e.length&&i.push(e.substring(r)),i):e}var we=e=>c(ue)(e),Pe=e=>c(fe)(e),d=c(de),Oe=c(L),y=c(se),m=c(ce),Me=c(ae),De=c(A,X,pe,ye),Er=c(ie,X),_e=c(le,ge);function Ve(e){return y(e)||d(e)}function Be(e){return e.type===z}function R(e){return e.type===T}function P(e){return e.type!==T&&e.type!==z}function Ge(e){return m(e)||y(e)}function W(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 $e(e,t={}){if(m(e)&&e.disabled){let n=e.name?t?.[e.name]:void 0;if(n&&a(n))return[n]}}function ze(e){return y(e)||d(e)?!0:e.advanced?.horizontal??!1}function Ue(e){return d(e)?e.advanced?.reverse!==!1:!1}function Ye(e,t){let n=e.readonly??!1;return t||n}function Xe(e){if(y(e)||m(e)&&!e.disabled){let t=e.source;if(Array.isArray(t)||a(t)&&!(b in t))return t}}var dn=/^\d+$/;function He(){return Array.from({length:12},(e,t)=>({value:(t+1).toString(),label:new Date(0,t).toLocaleString("default",{month:"long"})}))}function Ke(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 q(){return new Date().getFullYear()}function Z(e,t){if(typeof e=="number")return e;let n=t??q(),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 dn.test(r)?parseInt(r,10):n}var O=q();function cn(e){if(m(e))return un(e)}function un(e){if(we(e))return He();if(Pe(e)){let t=e.advanced?.length?.min??O,n=e.advanced?.length?.max??O+5;return Ke(Z(t,O),Z(n,O))}}function We(e,t=!1){let n={disabled:t,id:e.name,name:e.name,placeholder:e.placeholder,required:e.required};return Oe(e)?{...n,...fn(e)}:m(e)?{...n,...mn(e)}:Me(e)?{...n,...gn(e)}:n}function fn(e){let t=Le(e.type),n={...e,type:t};return{...qe(e),...pn(n),...De(n)?Ze(n):{},type:t}}function mn(e){let t=cn(e);return t?{options:t}:{}}function gn(e){return{...qe(e),...Ze(e)}}function qe(e){let t=e.advanced?.autocomplete;return t?{autoComplete:t}:{}}function pn(e){return _e(e)?yn(e):{}}function Ze(e){return Je(e,{min:Ne,max:Ce})}function yn(e){return Je(e,{min:Fe,max:Se})}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 Qe(e,t){let n=Xe(e);return n||$e(e,t)}function xn(e,t){let n=a(t)&&e.name in t?t[e.name]:t;return ke(n,e.advanced?.entity)}function bn(e,t,n){return Ge(e)&&Array.isArray(n)?{...t,[E]:n}:t}function Rn(e,t,n){if(e.required&&!W(n)&&m(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 hn(e,t){return m(e)&&Array.isArray(t)?Ie(t,e.advanced?.options):t}function je(e,t,n,r){let o=xn(e,r),i=Array.isArray(n)?hn(e,n):n,l=bn(e,t,i),s=Rn(e,l,o);return{commonPropsWithOptions:l,defaultValue:s}}function et(e,t){return d(e)?{defaultChecked:W(t)}:{defaultValue:t}}var Tn=/^#\/definition\//;function D(e=[],t){let n=M(e,t);return Array.isArray(n)?n.filter(Fn).sort((r,o)=>tt(r)-tt(o)):[]}function M(e,t,n=new Map,r=new WeakSet){if(!An(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&&u(e[b])){let i=e[b].replace(Tn,""),l=f(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 nt(e){return Object.entries(e??{})}function tt(e){return e.order??Number.MAX_VALUE}function An(e){return e!==void 0&&a(e)&&Object.keys(e).length>0}function Fn(e){return ve in e?!0:Array.isArray(e[U])?e[U].length>0:!0}function rt(e,t){let n={};for(let[r,o]of nt(t))n[`${e}-${r}`]=o;return n}function Sn(e){return rt(Te,e)}function Nn(e){return rt(Ae,e)}function ot(e,t){let n=Sn(e.advanced?.aria);return t&&t.length>0&&(n[be]="true",n[xe]=`${e.name}-error`),n}function it(e){return Nn(e.advanced?.data)}var lt={1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3"},at={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3"};function st(e,t=2){return lt[e&&e in lt?e:t]}function dt(e){if(e&&e in at)return at[e]}function Cn(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 ct(e){return!Array.isArray(e.fields)||e.fields.length===0?!1:e.fields.length>1||e.fields[0].type===T}function ut(e,t){let n=Cn(e,t);return Array.from({length:n},(r,o)=>o)}function ft(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 Ee(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 J}from"react/jsx-runtime";function mt(e){let{fields:t=[]}=e.section,[n,r]=Ln(!1),o=In(()=>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:[F("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:[F(oe,{expanded:n}),F("span",{children:p(e.section.title)})]})}),F(kn,{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&&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 En,jsx as gt,jsxs as wn}from"react/jsx-runtime";function pt(e){return wn(En,{children:[e.title&>("legend",{className:"mb-3 font-medium text-slate-800 dark:text-slate-200",children:p(e.title)}),e.description&>("p",{className:"-mt-2 text-sm leading-normal font-normal text-slate-600 dark:text-slate-400",children:p(e.description)})]})}import{jsx as Pn,jsxs as On}from"react/jsx-runtime";function V(e){return On("fieldset",{"data-slot":"field-set","data-empty":e.empty,className:"flex flex-col data-[empty=false]:gap-6",id:e.id,children:[Pn(pt,{description:e.description,title:e.title}),e.children]})}import{jsx as Mn}from"react/jsx-runtime";function x(e){return Mn("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 Q}from"react/jsx-runtime";function yt(e){let{fields:t=[]}=e.section,{compact:n}=_(e.style,{compact:e.section.compact}),r=Q(x,{compact:n,children:e.children});return!e.section.title&&!e.section.description?r:e.section.advanced?Q(mt,{section:e.section,group:r}):Q(V,{description:e.section.description,empty:t.length===0,id:e.section.id?.toString(),title:e.section.title,children:r})}import{useAtomValue as zn}from"jotai";import{atom as S}from"jotai";import{atomFamily as Dn}from"jotai-family";import{deepEqual as xt}from"fast-equals";function _n(e,t){let{[t]:n,...r}=e;return r}function Vn(e){return Dn(t=>S(n=>n(e)[t]??void 0,(n,r,o)=>{let i=n(e);if(o!=null){let l=i[t];(!l||!xt(l,o))&&r(e,{...i,[t]:o})}else i[t]&&r(e,_n(i,t))}))}function Bn(e){return S(null,(t,n)=>{let r=t(e);r&&Object.keys(r).length>0&&n(e,{})})}function Gn(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 $n(e){return S(null,(t,n,r)=>{let o=t(e);xt(o,r)||n(e,r)})}function bt(e={}){let t=S(e);return{atom:t,clearAll:Bn(t),clear:Gn(t),bulkReport:$n(t),report:Vn(t)}}var Rt=bt(),ht=Rt.atom,wo=Rt.report;function Un(e,t){return e.fields.every(n=>Tt(n,t))}function Tt(e,t){return t[e.name]?.hidden??e.hidden??!1}function Yn(e,t){return R(e)?Un(e,t):Tt(e,t)}function At(e){let t=zn(ht);return e.container&&(t[e.container.name]?.hidden??e.container.hidden??!1)||e.fields.length===0||e.fields.every(r=>Yn(r,t))?null:e.children}import{jsx as Ft}from"react/jsx-runtime";function St(){return Ft("div",{"data-slot":"field-separator",className:"relative -my-2 h-5 text-sm",children:Ft("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 Nt}from"react/jsx-runtime";function Ct(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:Nt(x,{children:[t.map((n,r)=>Nt(At,{fields:n.fields??[],children:[N(yt,{section:n,style:e.config.style,children:e.children({disabled:e.readOnly,fields:n.fields})}),n.separator&&N(St,{})]},r)),e.control&&N(ne,{isPending:e.isPending,children:e.control})]})})})}import{jsx as Xn}from"react/jsx-runtime";function vt(e){return Xn("p",{className:"-mt-2 text-xs leading-normal font-normal text-slate-600 dark:text-slate-400",children:e.children})}import{jsx as Hn}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?Hn(vt,{children:r}):null}import{twMerge as Kn}from"tailwind-merge";import{jsx as Wn,jsxs as qn}from"react/jsx-runtime";function kt(e){let t=e.style?.showOptionalLabel??!0,n=y(e.field)||d(e.field);return qn("label",{"data-slot":"field-label","data-normal":n,className:Kn("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&&Wn("span",{className:"text-sm text-slate-600 dark:text-slate-400",children:h("(Optional)",e.translations)})]})}import{jsx as It,jsxs as Zn}from"react/jsx-runtime";function Lt(e){let t={context:e.context,env:e.config?.env},n=w(e.field.label,t);return Zn("div",{"data-slot":"field-content",className:"flex w-full flex-1 flex-col gap-1.5 leading-snug",children:[It(kt,{field:e.field,style:e.config?.style,translations:e.translations,children:h(n,e.translations)}),e.horizontal===!0&&It(B,{config:e.config,context:e.context,text:e.field.description,translations:e.translations})]})}import{Fragment as Jn,jsx as Et,jsxs as Qn}from"react/jsx-runtime";function wt(e){return Qn(Jn,{children:[e.field.name&&e.field.label&&Et(Lt,{config:e.config,context:e.context,field:e.field,horizontal:e.horizontal,translations:e.translations}),e.children,e.horizontal===!1&&Et(B,{config:e.config,context:e.context,text:e.field.description,translations:e.translations})]})}function Pt(e,t){return e?t(e):null}import{jsx as Ot}from"react/jsx-runtime";function Mt(e){let t=Qe(e.field,e.value),{commonPropsWithOptions:n,defaultValue:r}=je(e.field,e.commonProps,t,e.value),o=et(e.field,r);return Pt(e.config.inputs[e.field.type],i=>Ot(wt,{config:e.config,context:e.context,field:e.field,horizontal:e.horizontal,translations:e.translations,children:Ot(i,{...e.ariaAttributes,...n,...e.dataAttributes,...o})}))}import{jsx as Dt}from"react/jsx-runtime";function _t(e){return!e.errors||e.errors.length===0?null:Dt("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)=>Dt("li",{children:t},e.name?`${e.name}-error-${n}`:n))})}import{twMerge as jn}from"tailwind-merge";import{jsx as er}from"react/jsx-runtime";function G(e){let t=e.errors&&e.errors.length>0;return er("div",{"data-slot":"field","data-clickable":e.isClickable?"true":"false",...t&&{[Re]:"true"},...e.disabled&&{[he]:"true"},"data-orientation":e.orientation,className:jn("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 tr}from"tailwind-merge";import{jsx as nr}from"react/jsx-runtime";function Vt(e){return nr(G,{...e,orientation:"vertical",className:tr("gap-3 has-[>[data-slot=field-content]]:items-start",!e.isClickable&&"[&>*]:w-full"),children:e.children})}import{twMerge as rr}from"tailwind-merge";import{jsx as or}from"react/jsx-runtime";function Bt(e){return or(G,{...e,orientation:"horizontal",className:rr("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 Gt}from"react/jsx-runtime";function $t(e){let t=Ve(e.field),n=d(e.field),r=Ue(e.field);return e.horizontal?Gt(Bt,{disabled:e.disabled,errors:e.errors,isCheckbox:n,isReversed:r,isClickable:t,children:e.children}):Gt(Vt,{disabled:e.disabled,errors:e.errors,isCheckbox:n,isReversed:r,isClickable:t,children:e.children})}function zt(e){if(!e.field.type)return null;let t=We(e.field,e.disabled),n=it(e.field),r=ot(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 ir}from"tailwind-merge";import{jsx as j,jsxs as lr}from"react/jsx-runtime";function Ut(e){let t=e.field.advanced?.cols,n=e.field.name?e.errors?.[e.field.name]:void 0,{horizontal:r}=_(e.style,{horizontal:ze(e.field)}),o=Ye(e.field,e.disabled);return lr("div",{className:ir("flex flex-col gap-3",dt(t)),children:[j($t,{disabled:o,errors:n,field:e.field,horizontal:r,children:j(zt,{disabled:o,errors:n,field:e.field,horizontal:r,children:e.children})}),j(_t,{errors:n,name:e.field.name})]})}import{twMerge as ar}from"tailwind-merge";import{jsx as C,jsxs as $}from"react/jsx-runtime";function Yt(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:ar("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 sr}from"react/jsx-runtime";function Xt(e){let t=ft(e.field),n=ct(e.field);return ut(e.field,e.value).map(r=>sr(Yt,{index:r,isMultiField:n,label:t,children:e.children(r)},r))}import{jsx as dr}from"react/jsx-runtime";function Ht(e){let t=Array.isArray(e.field.fields)&&e.field.fields.length===0;return dr(V,{description:e.field.description,empty:t,id:e.field.name,title:e.field.label,children:e.children})}import{jsx as Kt}from"react/jsx-runtime";function Wt({children:e,field:t,value:n}){return Kt(Ht,{field:t,children:Kt(Xt,{field:t,value:n,children:e})})}import{twMerge as cr}from"tailwind-merge";import{jsx as qt}from"react/jsx-runtime";function Zt(e){let t=st(e.column?.advanced?.cols);return qt("div",{className:"flex w-full flex-col gap-4",children:qt("div",{className:cr("grid grid-cols-1 gap-3 sm:gap-4",t),children:e.children})})}import{Fragment as fr}from"react";import{jsx as ur}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}`}:R(n)?{...n,fields:n.fields.map(r=>({...r,name:`${e.field.name}.${e.index}.${r.name}`}))}:n):[];return ur(v,{children:e.children,components:e.components,disabled:e.disabled,fields:t,style:e.style,value:e.value})}import{jsx as k,jsxs as mr}from"react/jsx-runtime";function v(e){let{field:t,list:n}=e.components;return D(e.fields).map((r,o)=>mr(fr,{children:[R(r)&&k(Zt,{column:r,children:k(v,{...e,fields:r.fields})}),P(r)&&k(t,{disabled:e.disabled,field:r,style:e.style,children:e.children}),Be(r)&&k(n,{field:r,value:e.value,children:i=>k(Jt,{children:e.children,components:e.components,disabled:e.disabled,field:r,index:i,style:e.style,value:e.value})})]},o))}import{jsx as gr}from"react/jsx-runtime";function Qt(e){return n=>gr(v,{...n,components:e})}var jt=Qt({field:Ut,list:Wt});import{jsx as ee}from"react/jsx-runtime";function te(e){let t=e.translations?.[e.lang??""];return ee(Ct,{config:e.config,control:e.children,definition:e.definition,readOnly:e.readOnly,sections:e.sections,children:({disabled:n,fields:r})=>ee(jt,{disabled:n,fields:r,style:e.config.style,children:o=>ee(Mt,{...o,config:e.config,context:e.context,translations:t,value:e.value})})})}import{Suspense as pr}from"react";import{jsx as en}from"react/jsx-runtime";function yr(e){return en(pr,{fallback:en(te,{config:e.config,sections:e.sections,readOnly:!0}),children:e.children})}export{yr as Fallback,te 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;
|