@object-ui/fields 3.1.0 → 3.1.1
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/index.cjs +5 -5
- package/dist/index.js +140 -114
- package/package.json +4 -4
- package/src/__tests__/cell-renderers.test.tsx +90 -0
- package/src/index.tsx +30 -3
package/dist/index.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react"),b=require("@object-ui/core"),d=require("@object-ui/components"),_=require("lucide-react");var X={exports:{}},V={};var Ge;function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react"),b=require("@object-ui/core"),d=require("@object-ui/components"),_=require("lucide-react");var X={exports:{}},V={};var Ge;function ht(){if(Ge)return V;Ge=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function n(a,s,i){var l=null;if(i!==void 0&&(l=""+i),s.key!==void 0&&(l=""+s.key),"key"in s){i={};for(var o in s)o!=="key"&&(i[o]=s[o])}else i=s;return s=i.ref,{$$typeof:e,type:a,key:l,ref:s!==void 0?s:null,props:i}}return V.Fragment=r,V.jsx=n,V.jsxs=n,V}var Y={};var Je;function bt(){return Je||(Je=1,process.env.NODE_ENV!=="production"&&(function(){function e(u){if(u==null)return null;if(typeof u=="function")return u.$$typeof===I?null:u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case k:return"Fragment";case P:return"Profiler";case v:return"StrictMode";case j:return"Suspense";case S:return"SuspenseList";case O:return"Activity"}if(typeof u=="object")switch(typeof u.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),u.$$typeof){case F:return"Portal";case B:return u.displayName||"Context";case z:return(u._context.displayName||"Context")+".Consumer";case W:var y=u.render;return u=u.displayName,u||(u=y.displayName||y.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case A:return y=u.displayName||null,y!==null?y:e(u.type)||"Memo";case $:y=u._payload,u=u._init;try{return e(u(y))}catch{}}return null}function r(u){return""+u}function n(u){try{r(u);var y=!1}catch{y=!0}if(y){y=console;var w=y.error,R=typeof Symbol=="function"&&Symbol.toStringTag&&u[Symbol.toStringTag]||u.constructor.name||"Object";return w.call(y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",R),r(u)}}function a(u){if(u===k)return"<>";if(typeof u=="object"&&u!==null&&u.$$typeof===$)return"<...>";try{var y=e(u);return y?"<"+y+">":"<...>"}catch{return"<...>"}}function s(){var u=L.A;return u===null?null:u.getOwner()}function i(){return Error("react-stack-top-frame")}function l(u){if(D.call(u,"key")){var y=Object.getOwnPropertyDescriptor(u,"key").get;if(y&&y.isReactWarning)return!1}return u.key!==void 0}function o(u,y){function w(){Ue||(Ue=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",y))}w.isReactWarning=!0,Object.defineProperty(u,"key",{get:w,configurable:!0})}function c(){var u=e(this.type);return Be[u]||(Be[u]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),u=this.props.ref,u!==void 0?u:null}function f(u,y,w,R,Q,re){var T=w.ref;return u={$$typeof:h,type:u,key:y,props:w,_owner:R},(T!==void 0?T:null)!==null?Object.defineProperty(u,"ref",{enumerable:!1,get:c}):Object.defineProperty(u,"ref",{enumerable:!1,value:null}),u._store={},Object.defineProperty(u._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(u,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(u,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Q}),Object.defineProperty(u,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:re}),Object.freeze&&(Object.freeze(u.props),Object.freeze(u)),u}function g(u,y,w,R,Q,re){var T=y.children;if(T!==void 0)if(R)if(xt(T)){for(R=0;R<T.length;R++)p(T[R]);Object.freeze&&Object.freeze(T)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else p(T);if(D.call(y,"key")){T=e(u);var U=Object.keys(y).filter(function(gt){return gt!=="key"});R=0<U.length?"{key: someKey, "+U.join(": ..., ")+": ...}":"{key: someKey}",qe[T+R]||(U=0<U.length?"{"+U.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
2
|
let props = %s;
|
|
3
3
|
<%s {...props} />
|
|
4
4
|
React keys must be passed directly to JSX without using spread:
|
|
5
5
|
let props = %s;
|
|
6
|
-
<%s key={someKey} {...props} />`,R,T,U,T),qe[T+R]=!0)}if(T=null,w!==void 0&&(n(w),T=""+w),l(y)&&(n(y.key),T=""+y.key),"key"in y){w={};for(var se in y)se!=="key"&&(w[se]=y[se])}else w=y;return T&&o(w,typeof u=="function"?u.displayName||u.name||"Unknown":u),f(u,T,w,s(),Q,re)}function p(u){m(u)?u._store&&(u._store.validated=1):typeof u=="object"&&u!==null&&u.$$typeof===$&&(u._payload.status==="fulfilled"?m(u._payload.value)&&u._payload.value._store&&(u._payload.value._store.validated=1):u._store&&(u._store.validated=1))}function m(u){return typeof u=="object"&&u!==null&&u.$$typeof===g}var x=C,g=Symbol.for("react.transitional.element"),F=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),B=Symbol.for("react.context"),W=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),S=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),I=Symbol.for("react.client.reference"),L=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=Object.prototype.hasOwnProperty,xt=Array.isArray,te=console.createTask?console.createTask:function(){return null};x={react_stack_bottom_frame:function(u){return u()}};var Ue,Be={},Ve=x.react_stack_bottom_frame.bind(x,i)(),Ye=te(a(i)),qe={};Y.Fragment=k,Y.jsx=function(u,y,w){var R=1e4>L.recentlyCreatedOwnerStacks++;return h(u,y,w,!1,R?Error("react-stack-top-frame"):Ve,R?te(a(u)):Ye)},Y.jsxs=function(u,y,w){var R=1e4>L.recentlyCreatedOwnerStacks++;return h(u,y,w,!0,R?Error("react-stack-top-frame"):Ve,R?te(a(u)):Ye)}})()),Y}var We;function jt(){return We||(We=1,process.env.NODE_ENV==="production"?X.exports=gt():X.exports=bt()),X.exports}var t=jt();function ie({value:e,onChange:r,field:n,readonly:a,...s}){const i=n||s.schema;if(a)return t.jsx("span",{className:"text-sm",children:e||"-"});const l=i?.rows,{inputType:o,...c}=s;return l&&l>1?t.jsx(d.Textarea,{...c,value:e||"",onChange:f=>r(f.target.value),placeholder:i?.placeholder,disabled:a||c.disabled}):t.jsx(d.Input,{...c,type:i?.type==="password"?"password":"text",value:e||"",onChange:f=>r(f.target.value),placeholder:i?.placeholder,disabled:a||c.disabled})}const yt=Object.freeze(Object.defineProperty({__proto__:null,TextField:ie},Symbol.toStringTag,{value:"Module"}));function oe({value:e,onChange:r,field:n,readonly:a,...s}){if(a)return t.jsx("span",{className:"text-sm",children:e??"-"});const i=n||s.schema,l=i?.precision,{inputType:o,...c}=s;return t.jsx(d.Input,{...c,type:"number",value:e??"",onChange:f=>{const h=f.target.value;r(h===""?null:Number(h))},placeholder:i?.placeholder,disabled:a||c.disabled,step:l?Math.pow(10,-l):"any"})}const Nt=Object.freeze(Object.defineProperty({__proto__:null,NumberField:oe},Symbol.toStringTag,{value:"Module"}));function ce({value:e,onChange:r,field:n,readonly:a,...s}){const i=n||s.schema,l=i?.widget,o=C.useId(),c=i?.name||o,f=i?.label||"Checkbox";if(a)return t.jsx("span",{className:"text-sm",children:e?"Yes":"No"});const{inputType:h,...p}=s;return l==="checkbox"?t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx(d.Checkbox,{...p,id:c,checked:!!e,onCheckedChange:m=>r(!!m),disabled:a||p.disabled}),t.jsx(d.Label,{htmlFor:c,children:f})]}):t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx(d.Switch,{...p,id:c,checked:!!e,onCheckedChange:r,disabled:a||p.disabled}),t.jsx(d.Label,{htmlFor:c,children:f})]})}const vt=Object.freeze(Object.defineProperty({__proto__:null,BooleanField:ce},Symbol.toStringTag,{value:"Module"}));function de({value:e,onChange:r,field:n,readonly:a,...s}){const i=n||s.schema,l=i?.options||[];if(a){const o=l.find(c=>c.value===e);return t.jsx("span",{className:"text-sm",children:o?.label||e||"-"})}return t.jsxs(d.Select,{...s,value:e,onValueChange:r,disabled:a||s.disabled,children:[t.jsx(d.SelectTrigger,{className:s.className,id:s.id,children:t.jsx(d.SelectValue,{placeholder:i?.placeholder||"Select an option"})}),t.jsx(d.SelectContent,{position:"popper",children:l.map(o=>t.jsx(d.SelectItem,{value:o.value,children:o.label},o.value))})]})}const Ft=Object.freeze(Object.defineProperty({__proto__:null,SelectField:de},Symbol.toStringTag,{value:"Module"}));function ue({value:e,onChange:r,field:n,readonly:a,...s}){if(a)return t.jsx("span",{className:"text-sm",children:e?new Date(e).toLocaleDateString():"-"});const{inputType:i,...l}=s;return t.jsx(d.Input,{...l,type:"date",value:e||"",onChange:o=>r(o.target.value),disabled:a||l.disabled})}const _t=Object.freeze(Object.defineProperty({__proto__:null,DateField:ue},Symbol.toStringTag,{value:"Module"}));function me({value:e,onChange:r,field:n,readonly:a,errorMessage:s,...i}){const l=n||i.schema;if(a)return e?t.jsx("a",{href:`mailto:${e}`,className:"text-sm text-blue-600 hover:text-blue-800 hover:underline",children:e}):t.jsx("span",{className:"text-sm",children:"-"});const{inputType:o,...c}=i;return t.jsx(d.Input,{...c,type:"email",value:e||"",onChange:f=>r(f.target.value),placeholder:l?.placeholder||"email@example.com",disabled:a||c.disabled,"aria-invalid":!!s})}const Ct=Object.freeze(Object.defineProperty({__proto__:null,EmailField:me},Symbol.toStringTag,{value:"Module"}));function fe({value:e,onChange:r,field:n,readonly:a,errorMessage:s,...i}){const l=n||i.schema;if(a)return e?t.jsx("a",{href:`tel:${e}`,className:"text-sm text-blue-600 hover:text-blue-800 hover:underline",children:e}):t.jsx("span",{className:"text-sm",children:"-"});const{inputType:o,...c}=i;return t.jsx(d.Input,{...c,type:"tel",value:e||"",onChange:f=>r(f.target.value),placeholder:l?.placeholder||"(555) 123-4567",disabled:a||c.disabled,"aria-invalid":!!s})}const wt=Object.freeze(Object.defineProperty({__proto__:null,PhoneField:fe},Symbol.toStringTag,{value:"Module"}));function pe({value:e,onChange:r,field:n,readonly:a,errorMessage:s,...i}){const l=n||i.schema;if(a)return e?e.startsWith("http://")||e.startsWith("https://")?t.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-blue-600 hover:text-blue-800 hover:underline",children:e}):t.jsx("span",{className:"text-sm",children:e}):t.jsx("span",{className:"text-sm",children:"-"});const{inputType:o,...c}=i;return t.jsx(d.Input,{...c,type:"url",value:e||"",onChange:f=>r(f.target.value),placeholder:l?.placeholder||"https://example.com",disabled:a||c.disabled,"aria-invalid":!!s})}const St=Object.freeze(Object.defineProperty({__proto__:null,UrlField:pe},Symbol.toStringTag,{value:"Module"}));function Rt(e,r="USD"){try{return new Intl.NumberFormat("en-US",{style:"currency",currency:r}).format(e)}catch{return`${r} ${e.toFixed(2)}`}}function xe({value:e,onChange:r,field:n,readonly:a,errorMessage:s,className:i,...l}){const o=n||l.schema,c=o?.currency||"USD",f=o?.precision??2;if(a)return e==null?t.jsx("span",{className:"text-sm",children:"-"}):t.jsx("span",{className:"text-sm font-medium tabular-nums",children:Rt(Number(e),c)});const h=p=>{const m=parseFloat(p.target.value);isNaN(m)||r(parseFloat(m.toFixed(f)))};return t.jsxs("div",{className:"relative",children:[t.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:c==="USD"?"$":c}),t.jsx(d.Input,{...l,type:"number",value:e??"",onChange:p=>{const m=p.target.value===""?null:parseFloat(p.target.value);r(m)},onBlur:h,placeholder:o?.placeholder||"0.00",disabled:a||l.disabled,className:`pl-8 ${i||""}`,step:Math.pow(10,-f).toFixed(f),"aria-invalid":!!s})]})}const Tt=Object.freeze(Object.defineProperty({__proto__:null,CurrencyField:xe},Symbol.toStringTag,{value:"Module"}));function he({value:e,onChange:r,field:n,readonly:a,errorMessage:s,...i}){if(a)return t.jsx("div",{className:"text-sm whitespace-pre-wrap",children:e||"-"});const l=n||i.schema,o=l?.rows||4,c=l?.max_length,{inputType:f,...h}=i;return t.jsxs("div",{className:"relative",children:[t.jsx(d.Textarea,{...h,value:e||"",onChange:p=>r(p.target.value),placeholder:l?.placeholder,disabled:a||h.disabled,rows:o,maxLength:c,"aria-invalid":!!s}),c&&t.jsxs("div",{className:"absolute bottom-2 right-2 text-xs text-gray-400","aria-live":"polite","aria-label":`Character count: ${(e||"").length} of ${c}`,children:[(e||"").length,"/",c]})]})}const Pt=Object.freeze(Object.defineProperty({__proto__:null,TextAreaField:he},Symbol.toStringTag,{value:"Module"}));function H({value:e,onChange:r,field:n,readonly:a,errorMessage:s,...i}){if(a)return t.jsx("div",{className:"text-sm prose prose-sm max-w-none",children:e||"-"});const l=n||i.schema,o=l?.rows||8,c=l?.format||"markdown";return t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[t.jsxs("span",{children:["Format: ",c]}),t.jsx("span",{className:"italic",children:"Rich text editor (basic)"})]}),t.jsx(d.Textarea,{value:e||"",onChange:f=>r(f.target.value),placeholder:l?.placeholder||"Enter text...",disabled:a||i.disabled,rows:o,className:`font-mono text-sm ${i.className||""}`,"aria-invalid":!!s})]})}const Qe=Object.freeze(Object.defineProperty({__proto__:null,RichTextField:H},Symbol.toStringTag,{value:"Module"}));function ge({value:e,onChange:r,field:n,readonly:a,...s}){const[i,l]=C.useState(!1),[o,c]=C.useState(""),f=n||s.schema,h=f?.options||[],p=f.multiple||!1,m=f.display_field||"label",x=h.filter(v=>v.label.toLowerCase().includes(o.toLowerCase())),g=p?(Array.isArray(e)?e:[]).map(v=>h.find(P=>P.value===v)).filter(Boolean):e?[h.find(v=>v.value===e)].filter(Boolean):[],F=v=>{if(p){const P=Array.isArray(e)?e:[],z=P.includes(v.value);r(z?P.filter(B=>B!==v.value):[...P,v.value])}else r(v.value),l(!1)},k=v=>{if(p){const P=Array.isArray(e)?e:[];r(P.filter(z=>z!==v))}else r(null)};return a?g.length?p?t.jsx("div",{className:"flex flex-wrap gap-1",children:g.map((v,P)=>t.jsx(d.Badge,{variant:"outline",children:v?.[m]||v?.label},P))}):t.jsx("span",{className:"text-sm",children:g[0]?.[m]||g[0]?.label}):t.jsx("span",{className:"text-sm",children:"-"}):t.jsxs("div",{className:"space-y-2",children:[g.length>0&&t.jsx("div",{className:"flex flex-wrap gap-1",children:g.map((v,P)=>t.jsxs(d.Badge,{variant:"outline",className:"gap-1",children:[v?.[m]||v?.label,t.jsx("button",{onClick:()=>k(v?.value),className:"ml-1 hover:text-destructive",type:"button","aria-label":`Remove ${v?.[m]||v?.label}`,children:t.jsx(_.X,{className:"size-3"})})]},P))}),t.jsxs(d.Dialog,{open:i,onOpenChange:l,children:[t.jsx(d.DialogTrigger,{asChild:!0,children:t.jsxs(d.Button,{variant:"outline",className:"w-full justify-start text-left font-normal",type:"button",children:[t.jsx(_.Search,{className:"mr-2 size-4"}),g.length===0?f?.placeholder||"Select...":p?`${g.length} selected`:"Change selection"]})}),t.jsxs(d.DialogContent,{className:"max-w-md",children:[t.jsx(d.DialogHeader,{children:t.jsxs(d.DialogTitle,{children:[f?.label||"Select"," ",p&&"(multiple)"]})}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(d.Input,{placeholder:"Search...",value:o,onChange:v=>c(v.target.value),className:"w-full"}),t.jsx("div",{className:"max-h-64 overflow-y-auto space-y-1",children:x.length===0?t.jsx("p",{className:"text-sm text-gray-500 text-center py-4",children:"No options found"}):x.map(v=>{const P=p?(Array.isArray(e)?e:[]).includes(v.value):e===v.value;return t.jsxs("button",{onClick:()=>F(v),className:`w-full text-left px-3 py-2 rounded-md text-sm hover:bg-gray-100 flex items-center justify-between ${P?"bg-blue-50 text-blue-700":""}`,type:"button",children:[t.jsx("span",{children:v.label}),P&&t.jsx(d.Badge,{variant:"default",className:"ml-2",children:"Selected"})]},v.value)})})]})]})]})]})}const Ot=Object.freeze(Object.defineProperty({__proto__:null,LookupField:ge},Symbol.toStringTag,{value:"Module"}));function be({value:e,onChange:r,field:n,readonly:a,...s}){if(a){if(!e)return t.jsx("span",{className:"text-sm",children:"-"});const o=new Date(e);return t.jsxs("span",{className:"text-sm",children:[o.toLocaleDateString()," ",o.toLocaleTimeString()]})}const{inputType:i,...l}=s;return t.jsx(d.Input,{...l,type:"datetime-local",value:e||"",onChange:o=>r(o.target.value),disabled:a||l.disabled})}const kt=Object.freeze(Object.defineProperty({__proto__:null,DateTimeField:be},Symbol.toStringTag,{value:"Module"}));function je({value:e,onChange:r,field:n,readonly:a,...s}){if(a)return t.jsx("span",{className:"text-sm",children:e||"-"});const{inputType:i,...l}=s;return t.jsx(d.Input,{...l,type:"time",value:e||"",onChange:o=>r(o.target.value),disabled:a||l.disabled})}const At=Object.freeze(Object.defineProperty({__proto__:null,TimeField:je},Symbol.toStringTag,{value:"Module"}));function ye({value:e,onChange:r,field:n,readonly:a,errorMessage:s,className:i,...l}){const o=n||l.schema,c=o?.precision??2;if(a)return e==null?t.jsx("span",{className:"text-sm",children:"-"}):t.jsxs("span",{className:"text-sm font-medium tabular-nums",children:[(e*100).toFixed(c),"%"]});const f=e!=null?e*100:"",h=e!=null?e*100:0,p=g=>{if(g.target.value===""){r(null);return}const F=parseFloat(g.target.value),k=isNaN(F)?null:F/100;r(k)},m=g=>{if(a||l.disabled)return;if(!Array.isArray(g)||g.length===0){r(null);return}const F=g[0],k=typeof F=="number"?F/100:null;r(k)},x=Math.pow(10,-c);return t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"relative",children:[t.jsx(d.Input,{...l,type:"number",value:f,onChange:p,placeholder:o?.placeholder||"0",disabled:a||l.disabled,className:`pr-8 ${i||""}`,step:Math.pow(10,-c).toFixed(c),"aria-invalid":!!s}),t.jsx("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:"%"})]}),t.jsx(d.Slider,{value:[h],onValueChange:m,min:0,max:100,step:x,disabled:a||l.disabled,className:"w-full","aria-label":"Percentage","data-testid":"percent-slider"})]})}const $t=Object.freeze(Object.defineProperty({__proto__:null,PercentField:ye},Symbol.toStringTag,{value:"Module"}));function Ne({value:e,onChange:r,field:n,readonly:a,className:s,...i}){const[l,o]=C.useState(!1),c=n||i.schema;if(a)return t.jsx("span",{className:"text-sm",children:"••••••••"});const{inputType:f,...h}=i;return t.jsxs("div",{className:"relative",children:[t.jsx(d.Input,{...h,type:l?"text":"password",value:e||"",onChange:p=>r(p.target.value),placeholder:c?.placeholder,disabled:a||h.disabled,className:`pr-10 ${s||""}`}),t.jsx(d.Button,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>o(!l),tabIndex:-1,children:l?t.jsx(_.EyeOff,{className:"size-4 text-gray-500"}):t.jsx(_.Eye,{className:"size-4 text-gray-500"})})]})}const Et=Object.freeze(Object.defineProperty({__proto__:null,PasswordField:Ne},Symbol.toStringTag,{value:"Module"}));function ve({value:e,onChange:r,field:n,readonly:a,...s}){const i=C.useRef(null),l=n||s.schema,o=l?.multiple||!1,c=l?.accept?l.accept.join(","):void 0,f=l?.maxSize,[h,p]=C.useState(!1),[m,x]=C.useState([]),g=e?Array.isArray(e)?e:[e]:[],F=C.useCallback(j=>{if(j.length===0)return;const S=[],A=j.filter(O=>{if(f&&O.size>f){const I=(f/1048576).toFixed(1);return S.push(`"${O.name}" exceeds max size (${I} MB)`),!1}return!0});if(x(S),A.length===0)return;const $=A.map(O=>({name:O.name,original_name:O.name,size:O.size,mime_type:O.type,url:URL.createObjectURL(O)}));r(o?[...g,...$]:$[0])},[g,o,r,f]),k=C.useCallback(j=>{j.preventDefault(),j.stopPropagation(),p(!0)},[]),v=C.useCallback(j=>{j.preventDefault(),j.stopPropagation(),p(!1)},[]),P=C.useCallback(j=>{j.preventDefault(),j.stopPropagation(),p(!1);const S=Array.from(j.dataTransfer.files);if(c){const A=c.split(",").map(O=>O.trim().toLowerCase()),$=S.filter(O=>{const I=O.name.split("."),L=I.length>1?"."+I.pop()?.toLowerCase():"";return A.some(D=>D===O.type||L&&D===L||D.endsWith("/*")&&O.type.startsWith(D.replace("/*","/")))});F($)}else F(S)},[c,F]);if(a){if(!e)return t.jsx("span",{className:"text-sm",children:"-"});const j=Array.isArray(e)?e:[e];return t.jsx("div",{className:"flex flex-wrap gap-2",children:j.map((S,A)=>t.jsx("span",{className:"text-sm truncate max-w-xs",children:S.name||S.original_name||"File"},A))})}const z=j=>{F(Array.from(j.target.files||[]))},B=j=>{if(o){const S=g.filter((A,$)=>$!==j);r(S.length>0?S:null)}else r(null)},W=j=>(j.mime_type||"").startsWith("image/");return t.jsxs("div",{className:s.className,children:[t.jsx("input",{ref:i,type:"file",multiple:o,accept:c,onChange:z,className:"hidden"}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{onDragOver:k,onDragLeave:v,onDrop:P,onClick:()=>i.current?.click(),className:`
|
|
6
|
+
<%s key={someKey} {...props} />`,R,T,U,T),qe[T+R]=!0)}if(T=null,w!==void 0&&(n(w),T=""+w),l(y)&&(n(y.key),T=""+y.key),"key"in y){w={};for(var se in y)se!=="key"&&(w[se]=y[se])}else w=y;return T&&o(w,typeof u=="function"?u.displayName||u.name||"Unknown":u),f(u,T,w,s(),Q,re)}function p(u){m(u)?u._store&&(u._store.validated=1):typeof u=="object"&&u!==null&&u.$$typeof===$&&(u._payload.status==="fulfilled"?m(u._payload.value)&&u._payload.value._store&&(u._payload.value._store.validated=1):u._store&&(u._store.validated=1))}function m(u){return typeof u=="object"&&u!==null&&u.$$typeof===h}var x=C,h=Symbol.for("react.transitional.element"),F=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),B=Symbol.for("react.context"),W=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),S=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),I=Symbol.for("react.client.reference"),L=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=Object.prototype.hasOwnProperty,xt=Array.isArray,te=console.createTask?console.createTask:function(){return null};x={react_stack_bottom_frame:function(u){return u()}};var Ue,Be={},Ve=x.react_stack_bottom_frame.bind(x,i)(),Ye=te(a(i)),qe={};Y.Fragment=k,Y.jsx=function(u,y,w){var R=1e4>L.recentlyCreatedOwnerStacks++;return g(u,y,w,!1,R?Error("react-stack-top-frame"):Ve,R?te(a(u)):Ye)},Y.jsxs=function(u,y,w){var R=1e4>L.recentlyCreatedOwnerStacks++;return g(u,y,w,!0,R?Error("react-stack-top-frame"):Ve,R?te(a(u)):Ye)}})()),Y}var We;function jt(){return We||(We=1,process.env.NODE_ENV==="production"?X.exports=ht():X.exports=bt()),X.exports}var t=jt();function ie({value:e,onChange:r,field:n,readonly:a,...s}){const i=n||s.schema;if(a)return t.jsx("span",{className:"text-sm",children:e||"-"});const l=i?.rows,{inputType:o,...c}=s;return l&&l>1?t.jsx(d.Textarea,{...c,value:e||"",onChange:f=>r(f.target.value),placeholder:i?.placeholder,disabled:a||c.disabled}):t.jsx(d.Input,{...c,type:i?.type==="password"?"password":"text",value:e||"",onChange:f=>r(f.target.value),placeholder:i?.placeholder,disabled:a||c.disabled})}const yt=Object.freeze(Object.defineProperty({__proto__:null,TextField:ie},Symbol.toStringTag,{value:"Module"}));function oe({value:e,onChange:r,field:n,readonly:a,...s}){if(a)return t.jsx("span",{className:"text-sm",children:e??"-"});const i=n||s.schema,l=i?.precision,{inputType:o,...c}=s;return t.jsx(d.Input,{...c,type:"number",value:e??"",onChange:f=>{const g=f.target.value;r(g===""?null:Number(g))},placeholder:i?.placeholder,disabled:a||c.disabled,step:l?Math.pow(10,-l):"any"})}const Nt=Object.freeze(Object.defineProperty({__proto__:null,NumberField:oe},Symbol.toStringTag,{value:"Module"}));function ce({value:e,onChange:r,field:n,readonly:a,...s}){const i=n||s.schema,l=i?.widget,o=C.useId(),c=i?.name||o,f=i?.label||"Checkbox";if(a)return t.jsx("span",{className:"text-sm",children:e?"Yes":"No"});const{inputType:g,...p}=s;return l==="checkbox"?t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx(d.Checkbox,{...p,id:c,checked:!!e,onCheckedChange:m=>r(!!m),disabled:a||p.disabled}),t.jsx(d.Label,{htmlFor:c,children:f})]}):t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx(d.Switch,{...p,id:c,checked:!!e,onCheckedChange:r,disabled:a||p.disabled}),t.jsx(d.Label,{htmlFor:c,children:f})]})}const vt=Object.freeze(Object.defineProperty({__proto__:null,BooleanField:ce},Symbol.toStringTag,{value:"Module"}));function de({value:e,onChange:r,field:n,readonly:a,...s}){const i=n||s.schema,l=i?.options||[];if(a){const o=l.find(c=>c.value===e);return t.jsx("span",{className:"text-sm",children:o?.label||e||"-"})}return t.jsxs(d.Select,{...s,value:e,onValueChange:r,disabled:a||s.disabled,children:[t.jsx(d.SelectTrigger,{className:s.className,id:s.id,children:t.jsx(d.SelectValue,{placeholder:i?.placeholder||"Select an option"})}),t.jsx(d.SelectContent,{position:"popper",children:l.map(o=>t.jsx(d.SelectItem,{value:o.value,children:o.label},o.value))})]})}const Ft=Object.freeze(Object.defineProperty({__proto__:null,SelectField:de},Symbol.toStringTag,{value:"Module"}));function ue({value:e,onChange:r,field:n,readonly:a,...s}){if(a)return t.jsx("span",{className:"text-sm",children:e?new Date(e).toLocaleDateString():"-"});const{inputType:i,...l}=s;return t.jsx(d.Input,{...l,type:"date",value:e||"",onChange:o=>r(o.target.value),disabled:a||l.disabled})}const _t=Object.freeze(Object.defineProperty({__proto__:null,DateField:ue},Symbol.toStringTag,{value:"Module"}));function me({value:e,onChange:r,field:n,readonly:a,errorMessage:s,...i}){const l=n||i.schema;if(a)return e?t.jsx("a",{href:`mailto:${e}`,className:"text-sm text-blue-600 hover:text-blue-800 hover:underline",children:e}):t.jsx("span",{className:"text-sm",children:"-"});const{inputType:o,...c}=i;return t.jsx(d.Input,{...c,type:"email",value:e||"",onChange:f=>r(f.target.value),placeholder:l?.placeholder||"email@example.com",disabled:a||c.disabled,"aria-invalid":!!s})}const Ct=Object.freeze(Object.defineProperty({__proto__:null,EmailField:me},Symbol.toStringTag,{value:"Module"}));function fe({value:e,onChange:r,field:n,readonly:a,errorMessage:s,...i}){const l=n||i.schema;if(a)return e?t.jsx("a",{href:`tel:${e}`,className:"text-sm text-blue-600 hover:text-blue-800 hover:underline",children:e}):t.jsx("span",{className:"text-sm",children:"-"});const{inputType:o,...c}=i;return t.jsx(d.Input,{...c,type:"tel",value:e||"",onChange:f=>r(f.target.value),placeholder:l?.placeholder||"(555) 123-4567",disabled:a||c.disabled,"aria-invalid":!!s})}const wt=Object.freeze(Object.defineProperty({__proto__:null,PhoneField:fe},Symbol.toStringTag,{value:"Module"}));function pe({value:e,onChange:r,field:n,readonly:a,errorMessage:s,...i}){const l=n||i.schema;if(a)return e?e.startsWith("http://")||e.startsWith("https://")?t.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-blue-600 hover:text-blue-800 hover:underline",children:e}):t.jsx("span",{className:"text-sm",children:e}):t.jsx("span",{className:"text-sm",children:"-"});const{inputType:o,...c}=i;return t.jsx(d.Input,{...c,type:"url",value:e||"",onChange:f=>r(f.target.value),placeholder:l?.placeholder||"https://example.com",disabled:a||c.disabled,"aria-invalid":!!s})}const St=Object.freeze(Object.defineProperty({__proto__:null,UrlField:pe},Symbol.toStringTag,{value:"Module"}));function Rt(e,r="USD"){try{return new Intl.NumberFormat("en-US",{style:"currency",currency:r}).format(e)}catch{return`${r} ${e.toFixed(2)}`}}function xe({value:e,onChange:r,field:n,readonly:a,errorMessage:s,className:i,...l}){const o=n||l.schema,c=o?.currency||"USD",f=o?.precision??2;if(a)return e==null?t.jsx("span",{className:"text-sm",children:"-"}):t.jsx("span",{className:"text-sm font-medium tabular-nums",children:Rt(Number(e),c)});const g=p=>{const m=parseFloat(p.target.value);isNaN(m)||r(parseFloat(m.toFixed(f)))};return t.jsxs("div",{className:"relative",children:[t.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:c==="USD"?"$":c}),t.jsx(d.Input,{...l,type:"number",value:e??"",onChange:p=>{const m=p.target.value===""?null:parseFloat(p.target.value);r(m)},onBlur:g,placeholder:o?.placeholder||"0.00",disabled:a||l.disabled,className:`pl-8 ${i||""}`,step:Math.pow(10,-f).toFixed(f),"aria-invalid":!!s})]})}const Tt=Object.freeze(Object.defineProperty({__proto__:null,CurrencyField:xe},Symbol.toStringTag,{value:"Module"}));function ge({value:e,onChange:r,field:n,readonly:a,errorMessage:s,...i}){if(a)return t.jsx("div",{className:"text-sm whitespace-pre-wrap",children:e||"-"});const l=n||i.schema,o=l?.rows||4,c=l?.max_length,{inputType:f,...g}=i;return t.jsxs("div",{className:"relative",children:[t.jsx(d.Textarea,{...g,value:e||"",onChange:p=>r(p.target.value),placeholder:l?.placeholder,disabled:a||g.disabled,rows:o,maxLength:c,"aria-invalid":!!s}),c&&t.jsxs("div",{className:"absolute bottom-2 right-2 text-xs text-gray-400","aria-live":"polite","aria-label":`Character count: ${(e||"").length} of ${c}`,children:[(e||"").length,"/",c]})]})}const Pt=Object.freeze(Object.defineProperty({__proto__:null,TextAreaField:ge},Symbol.toStringTag,{value:"Module"}));function H({value:e,onChange:r,field:n,readonly:a,errorMessage:s,...i}){if(a)return t.jsx("div",{className:"text-sm prose prose-sm max-w-none",children:e||"-"});const l=n||i.schema,o=l?.rows||8,c=l?.format||"markdown";return t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[t.jsxs("span",{children:["Format: ",c]}),t.jsx("span",{className:"italic",children:"Rich text editor (basic)"})]}),t.jsx(d.Textarea,{value:e||"",onChange:f=>r(f.target.value),placeholder:l?.placeholder||"Enter text...",disabled:a||i.disabled,rows:o,className:`font-mono text-sm ${i.className||""}`,"aria-invalid":!!s})]})}const Qe=Object.freeze(Object.defineProperty({__proto__:null,RichTextField:H},Symbol.toStringTag,{value:"Module"}));function he({value:e,onChange:r,field:n,readonly:a,...s}){const[i,l]=C.useState(!1),[o,c]=C.useState(""),f=n||s.schema,g=f?.options||[],p=f.multiple||!1,m=f.display_field||"label",x=g.filter(v=>v.label.toLowerCase().includes(o.toLowerCase())),h=p?(Array.isArray(e)?e:[]).map(v=>g.find(P=>P.value===v)).filter(Boolean):e?[g.find(v=>v.value===e)].filter(Boolean):[],F=v=>{if(p){const P=Array.isArray(e)?e:[],z=P.includes(v.value);r(z?P.filter(B=>B!==v.value):[...P,v.value])}else r(v.value),l(!1)},k=v=>{if(p){const P=Array.isArray(e)?e:[];r(P.filter(z=>z!==v))}else r(null)};return a?h.length?p?t.jsx("div",{className:"flex flex-wrap gap-1",children:h.map((v,P)=>t.jsx(d.Badge,{variant:"outline",children:v?.[m]||v?.label},P))}):t.jsx("span",{className:"text-sm",children:h[0]?.[m]||h[0]?.label}):t.jsx("span",{className:"text-sm",children:"-"}):t.jsxs("div",{className:"space-y-2",children:[h.length>0&&t.jsx("div",{className:"flex flex-wrap gap-1",children:h.map((v,P)=>t.jsxs(d.Badge,{variant:"outline",className:"gap-1",children:[v?.[m]||v?.label,t.jsx("button",{onClick:()=>k(v?.value),className:"ml-1 hover:text-destructive",type:"button","aria-label":`Remove ${v?.[m]||v?.label}`,children:t.jsx(_.X,{className:"size-3"})})]},P))}),t.jsxs(d.Dialog,{open:i,onOpenChange:l,children:[t.jsx(d.DialogTrigger,{asChild:!0,children:t.jsxs(d.Button,{variant:"outline",className:"w-full justify-start text-left font-normal",type:"button",children:[t.jsx(_.Search,{className:"mr-2 size-4"}),h.length===0?f?.placeholder||"Select...":p?`${h.length} selected`:"Change selection"]})}),t.jsxs(d.DialogContent,{className:"max-w-md",children:[t.jsx(d.DialogHeader,{children:t.jsxs(d.DialogTitle,{children:[f?.label||"Select"," ",p&&"(multiple)"]})}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(d.Input,{placeholder:"Search...",value:o,onChange:v=>c(v.target.value),className:"w-full"}),t.jsx("div",{className:"max-h-64 overflow-y-auto space-y-1",children:x.length===0?t.jsx("p",{className:"text-sm text-gray-500 text-center py-4",children:"No options found"}):x.map(v=>{const P=p?(Array.isArray(e)?e:[]).includes(v.value):e===v.value;return t.jsxs("button",{onClick:()=>F(v),className:`w-full text-left px-3 py-2 rounded-md text-sm hover:bg-gray-100 flex items-center justify-between ${P?"bg-blue-50 text-blue-700":""}`,type:"button",children:[t.jsx("span",{children:v.label}),P&&t.jsx(d.Badge,{variant:"default",className:"ml-2",children:"Selected"})]},v.value)})})]})]})]})]})}const Ot=Object.freeze(Object.defineProperty({__proto__:null,LookupField:he},Symbol.toStringTag,{value:"Module"}));function be({value:e,onChange:r,field:n,readonly:a,...s}){if(a){if(!e)return t.jsx("span",{className:"text-sm",children:"-"});const o=new Date(e);return t.jsxs("span",{className:"text-sm",children:[o.toLocaleDateString()," ",o.toLocaleTimeString()]})}const{inputType:i,...l}=s;return t.jsx(d.Input,{...l,type:"datetime-local",value:e||"",onChange:o=>r(o.target.value),disabled:a||l.disabled})}const kt=Object.freeze(Object.defineProperty({__proto__:null,DateTimeField:be},Symbol.toStringTag,{value:"Module"}));function je({value:e,onChange:r,field:n,readonly:a,...s}){if(a)return t.jsx("span",{className:"text-sm",children:e||"-"});const{inputType:i,...l}=s;return t.jsx(d.Input,{...l,type:"time",value:e||"",onChange:o=>r(o.target.value),disabled:a||l.disabled})}const At=Object.freeze(Object.defineProperty({__proto__:null,TimeField:je},Symbol.toStringTag,{value:"Module"}));function ye({value:e,onChange:r,field:n,readonly:a,errorMessage:s,className:i,...l}){const o=n||l.schema,c=o?.precision??2;if(a)return e==null?t.jsx("span",{className:"text-sm",children:"-"}):t.jsxs("span",{className:"text-sm font-medium tabular-nums",children:[(e*100).toFixed(c),"%"]});const f=e!=null?e*100:"",g=e!=null?e*100:0,p=h=>{if(h.target.value===""){r(null);return}const F=parseFloat(h.target.value),k=isNaN(F)?null:F/100;r(k)},m=h=>{if(a||l.disabled)return;if(!Array.isArray(h)||h.length===0){r(null);return}const F=h[0],k=typeof F=="number"?F/100:null;r(k)},x=Math.pow(10,-c);return t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"relative",children:[t.jsx(d.Input,{...l,type:"number",value:f,onChange:p,placeholder:o?.placeholder||"0",disabled:a||l.disabled,className:`pr-8 ${i||""}`,step:Math.pow(10,-c).toFixed(c),"aria-invalid":!!s}),t.jsx("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:"%"})]}),t.jsx(d.Slider,{value:[g],onValueChange:m,min:0,max:100,step:x,disabled:a||l.disabled,className:"w-full","aria-label":"Percentage","data-testid":"percent-slider"})]})}const $t=Object.freeze(Object.defineProperty({__proto__:null,PercentField:ye},Symbol.toStringTag,{value:"Module"}));function Ne({value:e,onChange:r,field:n,readonly:a,className:s,...i}){const[l,o]=C.useState(!1),c=n||i.schema;if(a)return t.jsx("span",{className:"text-sm",children:"••••••••"});const{inputType:f,...g}=i;return t.jsxs("div",{className:"relative",children:[t.jsx(d.Input,{...g,type:l?"text":"password",value:e||"",onChange:p=>r(p.target.value),placeholder:c?.placeholder,disabled:a||g.disabled,className:`pr-10 ${s||""}`}),t.jsx(d.Button,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>o(!l),tabIndex:-1,children:l?t.jsx(_.EyeOff,{className:"size-4 text-gray-500"}):t.jsx(_.Eye,{className:"size-4 text-gray-500"})})]})}const Et=Object.freeze(Object.defineProperty({__proto__:null,PasswordField:Ne},Symbol.toStringTag,{value:"Module"}));function ve({value:e,onChange:r,field:n,readonly:a,...s}){const i=C.useRef(null),l=n||s.schema,o=l?.multiple||!1,c=l?.accept?l.accept.join(","):void 0,f=l?.maxSize,[g,p]=C.useState(!1),[m,x]=C.useState([]),h=e?Array.isArray(e)?e:[e]:[],F=C.useCallback(j=>{if(j.length===0)return;const S=[],A=j.filter(O=>{if(f&&O.size>f){const I=(f/1048576).toFixed(1);return S.push(`"${O.name}" exceeds max size (${I} MB)`),!1}return!0});if(x(S),A.length===0)return;const $=A.map(O=>({name:O.name,original_name:O.name,size:O.size,mime_type:O.type,url:URL.createObjectURL(O)}));r(o?[...h,...$]:$[0])},[h,o,r,f]),k=C.useCallback(j=>{j.preventDefault(),j.stopPropagation(),p(!0)},[]),v=C.useCallback(j=>{j.preventDefault(),j.stopPropagation(),p(!1)},[]),P=C.useCallback(j=>{j.preventDefault(),j.stopPropagation(),p(!1);const S=Array.from(j.dataTransfer.files);if(c){const A=c.split(",").map(O=>O.trim().toLowerCase()),$=S.filter(O=>{const I=O.name.split("."),L=I.length>1?"."+I.pop()?.toLowerCase():"";return A.some(D=>D===O.type||L&&D===L||D.endsWith("/*")&&O.type.startsWith(D.replace("/*","/")))});F($)}else F(S)},[c,F]);if(a){if(!e)return t.jsx("span",{className:"text-sm",children:"-"});const j=Array.isArray(e)?e:[e];return t.jsx("div",{className:"flex flex-wrap gap-2",children:j.map((S,A)=>t.jsx("span",{className:"text-sm truncate max-w-xs",children:S.name||S.original_name||"File"},A))})}const z=j=>{F(Array.from(j.target.files||[]))},B=j=>{if(o){const S=h.filter((A,$)=>$!==j);r(S.length>0?S:null)}else r(null)},W=j=>(j.mime_type||"").startsWith("image/");return t.jsxs("div",{className:s.className,children:[t.jsx("input",{ref:i,type:"file",multiple:o,accept:c,onChange:z,className:"hidden"}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{onDragOver:k,onDragLeave:v,onDrop:P,onClick:()=>i.current?.click(),className:`
|
|
7
7
|
flex flex-col items-center justify-center gap-2 p-6
|
|
8
8
|
border-2 border-dashed rounded-lg cursor-pointer
|
|
9
9
|
transition-colors duration-200
|
|
10
|
-
${
|
|
11
|
-
`,role:"button",tabIndex:0,onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),i.current?.click())},children:[t.jsx(_.Upload,{className:`size-8 ${
|
|
10
|
+
${g?"border-primary bg-primary/5 text-primary":"border-muted-foreground/25 hover:border-primary/50 text-muted-foreground hover:text-foreground"}
|
|
11
|
+
`,role:"button",tabIndex:0,onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),i.current?.click())},children:[t.jsx(_.Upload,{className:`size-8 ${g?"text-primary":"text-muted-foreground"}`}),t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-sm font-medium",children:g?"Drop files here":"Drag & drop files here"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"or click to browse"})]})]}),m.length>0&&t.jsx("div",{className:"space-y-0.5",children:m.map((j,S)=>t.jsx("p",{className:"text-xs text-destructive",children:j},S))}),h.length>0&&t.jsx("div",{className:"space-y-1",children:h.map((j,S)=>t.jsxs("div",{className:"flex items-center justify-between gap-2 p-2 bg-muted/50 rounded-md border",children:[t.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[W(j)&&j.url?t.jsx("img",{src:j.url,alt:j.name,className:"size-8 object-cover rounded flex-shrink-0"}):W(j)?t.jsx(_.ImageIcon,{className:"size-4 text-muted-foreground flex-shrink-0"}):t.jsx(_.File,{className:"size-4 text-muted-foreground flex-shrink-0"}),t.jsx("span",{className:"text-sm truncate",children:j.name||j.original_name||"File"}),j.size&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",(j.size/1024).toFixed(1)," KB)"]})]}),t.jsx(d.Button,{type:"button",variant:"ghost",size:"sm",onClick:A=>{A.stopPropagation(),B(S)},className:"h-6 w-6 p-0",children:t.jsx(_.X,{className:"size-3"})})]},S))})]})]})}const zt=Object.freeze(Object.defineProperty({__proto__:null,FileField:ve},Symbol.toStringTag,{value:"Module"}));function Fe({value:e,onChange:r,field:n,readonly:a,...s}){const i=C.useRef(null),l=n||s.schema,o=l?.multiple||!1,c=l?.accept?l.accept.join(","):"image/*";if(a){if(!e)return t.jsx("span",{className:"text-sm",children:"-"});const m=Array.isArray(e)?e:[e];return t.jsx("div",{className:"flex flex-wrap gap-2",children:m.map((x,h)=>t.jsx("img",{src:x.url||"",alt:x.name||`Image ${h+1}`,className:"size-20 rounded-md object-cover border border-gray-200"},h))})}const f=e?Array.isArray(e)?e:[e]:[],g=m=>{const x=Array.from(m.target.files||[]);if(x.length===0)return;const h=x.map(F=>({name:F.name,original_name:F.name,size:F.size,mime_type:F.type,url:URL.createObjectURL(F)}));r(o?[...f,...h]:h[0])},p=m=>{if(o){const x=f.filter((h,F)=>F!==m);r(x.length>0?x:null)}else r(null)};return t.jsxs("div",{className:s.className,children:[t.jsx("input",{ref:i,type:"file",multiple:o,accept:c,onChange:g,className:"hidden"}),t.jsxs("div",{className:"space-y-2",children:[f.length>0&&t.jsx("div",{className:"grid grid-cols-4 gap-2",children:f.map((m,x)=>t.jsxs("div",{className:"relative group",children:[t.jsx("img",{src:m.url||"",alt:m.name||`Image ${x+1}`,className:"size-20 rounded-md object-cover border border-gray-200"}),t.jsx(d.Button,{type:"button",variant:"destructive",size:"sm",onClick:()=>p(x),className:"absolute top-1 right-1 h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(_.X,{className:"size-3"})})]},x))}),t.jsxs(d.Button,{type:"button",variant:"outline",onClick:()=>i.current?.click(),className:"w-full",children:[t.jsx(_.Image,{className:"size-4 mr-2"}),f.length>0?"Add More Images":"Upload Image"]})]})]})}const Dt=Object.freeze(Object.defineProperty({__proto__:null,ImageField:Fe},Symbol.toStringTag,{value:"Module"}));function _e({value:e,onChange:r,field:n,readonly:a,...s}){const i=n||s.schema,l=e&&typeof e=="object"?`${e.latitude||0}, ${e.longitude||0}`:"";if(a)return t.jsx("span",{className:"text-sm",children:l||"-"});const o=c=>{const f=c.target.value;if(!f.trim()){r(null);return}const g=f.split(",").map(p=>p.trim());if(g.length===2){const p=parseFloat(g[0]),m=parseFloat(g[1]);!isNaN(p)&&!isNaN(m)&&r({latitude:p,longitude:m})}};return t.jsx(d.Input,{type:"text",value:l,onChange:o,placeholder:i?.placeholder||"latitude, longitude",disabled:a||s.disabled,className:s.className})}const Mt=Object.freeze(Object.defineProperty({__proto__:null,LocationField:_e},Symbol.toStringTag,{value:"Module"}));function Ce({value:e,field:r,...n}){const s=(r||n.schema)?.return_type||"text";let i="-";return e!=null&&(s==="number"||s==="currency"?i=typeof e=="number"?e.toFixed(2):String(e):s==="boolean"?i=e?"Yes":"No":s==="date"?i=new Date(e).toLocaleDateString():i=String(e)),t.jsx("span",{className:`text-sm font-mono text-gray-700 ${n.className||""}`,children:i})}const It=Object.freeze(Object.defineProperty({__proto__:null,FormulaField:Ce},Symbol.toStringTag,{value:"Module"}));function we({value:e,field:r,...n}){const s=(r||n.schema)?.summary_type||"count";let i="-";return e!=null&&(s==="count"?i=String(e):["sum","avg","min","max"].includes(s)?i=typeof e=="number"?e.toFixed(2):String(e):i=String(e)),t.jsx("span",{className:`text-sm font-medium tabular-nums text-gray-700 ${n.className||""}`,children:i})}const Lt=Object.freeze(Object.defineProperty({__proto__:null,SummaryField:we},Symbol.toStringTag,{value:"Module"}));function Se({value:e,field:r,...n}){const a=e!=null?String(e):"-";return t.jsx("span",{className:`text-sm font-mono text-gray-700 ${n.className||""}`,children:a})}const Ut=Object.freeze(Object.defineProperty({__proto__:null,AutoNumberField:Se},Symbol.toStringTag,{value:"Module"}));function Z({value:e,onChange:r,field:n,readonly:a,...s}){const l=(n||s.schema)?.multiple||!1;if(a){if(!e)return t.jsx("span",{className:"text-sm",children:"-"});const f=Array.isArray(e)?e:[e];return t.jsxs("div",{className:"flex -space-x-2",children:[f.slice(0,3).map((g,p)=>{const m=g.name||g.username||"User",x=m.split(" ").map(h=>h[0]).join("").toUpperCase().slice(0,2);return t.jsx(d.Avatar,{className:"size-8 border-2 border-white",title:m,children:t.jsx(d.AvatarFallback,{className:"bg-blue-500 text-white text-xs",children:x})},p)}),f.length>3&&t.jsx(d.Avatar,{className:"size-8 border-2 border-white",children:t.jsxs(d.AvatarFallback,{className:"bg-gray-200 text-gray-600 text-xs",children:["+",f.length-3]})})]})}const o=e?Array.isArray(e)?e:[e]:[],c=f=>{if(l){const g=o.filter((p,m)=>m!==f);r(g.length>0?g:null)}else r(null)};return t.jsxs("div",{className:s.className,children:[o.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:o.map((f,g)=>{const p=f.name||f.username||"User",m=p.split(" ").map(x=>x[0]).join("").toUpperCase().slice(0,2);return t.jsxs(d.Badge,{variant:"outline",className:"gap-2 pr-1",children:[t.jsx(d.Avatar,{className:"size-5",children:t.jsx(d.AvatarFallback,{className:"bg-blue-500 text-white text-xs",children:m})}),t.jsx("span",{className:"text-sm",children:p}),t.jsx("button",{type:"button",onClick:()=>c(g),className:"ml-1 rounded-full hover:bg-gray-200 p-0.5",children:t.jsx(_.X,{className:"size-3"})})]},g)})}),t.jsx("div",{className:"text-sm text-gray-500 italic",children:"User selection component requires integration with user management system"})]})}const Xe=Object.freeze(Object.defineProperty({__proto__:null,UserField:Z},Symbol.toStringTag,{value:"Module"}));function Re({value:e,onChange:r,field:n,readonly:a,...s}){const i=n||s.schema,l=()=>e==null?"":JSON.stringify(e,null,2),[o,c]=C.useState(l),[f,g]=C.useState(null);if(C.useEffect(()=>{try{if(e==null){c("");return}const m=o?JSON.parse(o):null;JSON.stringify(m)!==JSON.stringify(e)&&c(JSON.stringify(e,null,2))}catch{c(JSON.stringify(e,null,2))}},[e,o]),a)return e?t.jsx("pre",{className:d.cn("text-xs bg-gray-50 p-2 rounded border border-gray-200 overflow-auto max-h-40",s.className),children:JSON.stringify(e,null,2)}):t.jsx("span",{className:"text-sm",children:"-"});const p=m=>{const x=m.target.value;if(c(x),g(null),!x.trim()){r(null);return}try{const h=JSON.parse(x);r(h)}catch{g("Invalid JSON")}};return t.jsxs("div",{className:"space-y-1",children:[t.jsx(d.Textarea,{value:o,onChange:p,placeholder:i?.placeholder||`{
|
|
12
12
|
"key": "value"
|
|
13
|
-
}`,disabled:a||s.disabled,className:d.cn("font-mono text-xs",f?"border-red-500 focus-visible:ring-red-500":"",s.className),rows:6}),f&&t.jsx("p",{className:"text-xs text-red-500",children:f})]})}const Bt=Object.freeze(Object.defineProperty({__proto__:null,ObjectField:Re},Symbol.toStringTag,{value:"Module"}));function Te({value:e,field:r,...n}){const s=(r||n.schema)?.dimensions||(Array.isArray(e)?e.length:0);if(!e||!Array.isArray(e))return t.jsx("span",{className:"text-sm text-gray-500",children:"-"});const i=e.slice(0,3).map(l=>{const o=Number(l);return isNaN(o)?"0":o.toFixed(4)}).join(", ");return t.jsxs("div",{className:`text-sm ${n.className||""}`,children:[t.jsxs("span",{className:"font-mono text-gray-700",children:["[",i,"...]"]}),t.jsxs("span",{className:"text-gray-500 ml-2",children:["(",s,"D)"]})]})}const Vt=Object.freeze(Object.defineProperty({__proto__:null,VectorField:Te},Symbol.toStringTag,{value:"Module"}));function Pe({value:e,field:r,readonly:n,...a}){const i=(r||a.schema)?.columns||[];return!e||!Array.isArray(e)?t.jsx("span",{className:"text-sm text-muted-foreground",children:"-"}):n?t.jsx("div",{className:d.cn("text-sm",a.className),children:t.jsxs("span",{className:"text-foreground",children:[e.length," rows"]})}):t.jsxs("div",{className:d.cn("border border-border rounded-lg overflow-hidden",a.className),children:[t.jsx("div",{className:"overflow-auto max-h-60",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{className:"bg-muted border-b border-border",children:t.jsx("tr",{children:i.map((l,o)=>t.jsx("th",{className:"px-3 py-2 text-left text-xs font-medium text-muted-foreground",children:l.label||l.name},o))})}),t.jsx("tbody",{className:"divide-y divide-border",children:e.slice(0,5).map((l,o)=>t.jsx("tr",{className:"hover:bg-muted/50 transition-colors",children:i.map((c,f)=>t.jsx("td",{className:"px-3 py-2 text-foreground",children:l[c.name]!=null?String(l[c.name]):"-"},f))},o))})]})}),e.length>5&&t.jsxs("div",{className:"bg-muted px-3 py-2 text-xs text-muted-foreground border-t border-border",children:["Showing 5 of ",e.length," rows"]})]})}const Yt=Object.freeze(Object.defineProperty({__proto__:null,GridField:Pe},Symbol.toStringTag,{value:"Module"}));function Oe({value:e,onChange:r,field:n,readonly:a,...s}){const i=n||s.schema;return a?t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-6 h-6 rounded border border-input",style:{backgroundColor:e||"#000000"}}),t.jsx("span",{className:"text-sm",children:e||"-"})]}):t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("input",{type:"color",value:e||"#000000",onChange:l=>r(l.target.value),disabled:a||s.disabled,className:"w-10 h-10 rounded border border-input cursor-pointer"}),t.jsx(d.Input,{type:"text",value:e||"",onChange:l=>r(l.target.value),placeholder:i?.placeholder||"#000000",disabled:a||s.disabled,className:s.className,pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"})]})}const qt=Object.freeze(Object.defineProperty({__proto__:null,ColorField:Oe},Symbol.toStringTag,{value:"Module"}));function ke({value:e,onChange:r,field:n,readonly:a,...s}){const i=n||s.schema,l=i?.min??0,o=i?.max??100,c=i?.step??1;return a?t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm font-medium",children:e??l}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:["/ ",o]})]}):t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(d.Slider,{value:[e??l],onValueChange:f=>r(f[0]),min:l,max:o,step:c,disabled:a||s.disabled,className:s.className}),t.jsx("span",{className:"text-sm font-medium w-12 text-right",children:e??l})]})}const Gt=Object.freeze(Object.defineProperty({__proto__:null,SliderField:ke},Symbol.toStringTag,{value:"Module"}));function Ae({value:e,onChange:r,field:n,readonly:a,className:s,...i}){const o=(n||i.schema)?.max??5,c=e??0,[f,h]=C.useState(null),p=f!==null?f:c;return a?t.jsxs("div",{className:d.cn("flex items-center gap-1",s),children:[Array.from({length:o},(m,x)=>t.jsx(_.Star,{className:`w-5 h-5 ${x<c?"fill-yellow-400 text-yellow-400":"text-muted-foreground"}`},x)),t.jsxs("span",{className:"ml-2 text-sm text-muted-foreground",children:[c," / ",o]})]}):t.jsxs("div",{className:d.cn("flex items-center gap-1",s),children:[Array.from({length:o},(m,x)=>t.jsx("button",{type:"button",onClick:()=>r(x+1),onMouseEnter:()=>h(x+1),onMouseLeave:()=>h(null),className:"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 rounded",disabled:a||i.disabled,children:t.jsx(_.Star,{className:`w-5 h-5 transition-colors ${x<p?"fill-yellow-400 text-yellow-400 hover:fill-yellow-500 hover:text-yellow-500":"text-muted-foreground hover:text-yellow-400"}`})},x)),t.jsxs("span",{className:"ml-2 text-sm text-muted-foreground",children:[c," / ",o]})]})}const Jt=Object.freeze(Object.defineProperty({__proto__:null,RatingField:Ae},Symbol.toStringTag,{value:"Module"}));function $e({value:e,onChange:r,field:n,readonly:a,...s}){const i=n||s.schema,l=i?.language??"javascript";return a?t.jsx("pre",{className:d.cn("text-sm bg-muted p-2 rounded overflow-x-auto border",s.className),children:t.jsx("code",{children:e||"-"})}):t.jsx(d.Textarea,{value:e||"",onChange:o=>r(o.target.value),placeholder:i?.placeholder||`// Write ${l} code here...`,disabled:a||s.disabled,className:d.cn("font-mono text-sm",s.className),rows:12,spellCheck:!1})}const Wt=Object.freeze(Object.defineProperty({__proto__:null,CodeField:$e},Symbol.toStringTag,{value:"Module"}));function Ee({value:e,onChange:r,field:n,readonly:a,...s}){const[i,l]=C.useState(!1),o=C.useRef(null),c=n||s.schema,f=m=>{const x=m.target.files?.[0];if(!x)return;if(!x.type.startsWith("image/")){console.error("Please select an image file");return}if(x.size>5*1024*1024){console.error("File size must be less than 5MB");return}const g=new FileReader;g.onloadend=()=>{r(g.result)},g.readAsDataURL(x)},h=()=>{r("")},p=()=>(c?.defaultName||c?.label||"User").split(" ").map(x=>x[0]).join("").toUpperCase().slice(0,2);return a?t.jsxs(d.Avatar,{className:"w-16 h-16",children:[e&&t.jsx(d.AvatarImage,{src:e,alt:c?.label}),t.jsx(d.AvatarFallback,{children:p()})]}):t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("div",{className:"relative",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[t.jsxs(d.Avatar,{className:"w-16 h-16",children:[e&&t.jsx(d.AvatarImage,{src:e,alt:c?.label}),t.jsx(d.AvatarFallback,{children:p()})]}),!a&&i&&e&&t.jsx("button",{type:"button",onClick:h,className:"absolute -top-1 -right-1 bg-destructive text-destructive-foreground rounded-full p-1 hover:bg-destructive/90",children:t.jsx(_.X,{className:"w-3 h-3"})})]}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("input",{ref:o,type:"file",accept:"image/*",onChange:f,className:"hidden"}),t.jsxs(d.Button,{type:"button",variant:"outline",size:"sm",onClick:()=>o.current?.click(),disabled:a||s.disabled,children:[t.jsx(_.Upload,{className:"w-4 h-4 mr-2"}),e?"Change":"Upload"," Avatar"]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"PNG, JPG up to 5MB"})]})]})}const Qt=Object.freeze(Object.defineProperty({__proto__:null,AvatarField:Ee},Symbol.toStringTag,{value:"Module"}));function ze({value:e,onChange:r,field:n,readonly:a,...s}){const i=e||{},l=(c,f)=>{r({...i,[c]:f})},o=c=>[c.street,c.city,[c.state,c.zipCode].filter(Boolean).join(" "),c.country].filter(Boolean).join(", ")||"-";return a?t.jsx("span",{className:"text-sm",children:o(i)}):t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{children:[t.jsx(d.Label,{htmlFor:"street",className:"text-xs",children:"Street Address"}),t.jsx(d.Input,{id:"street",type:"text",value:i.street||"",onChange:c=>l("street",c.target.value),placeholder:"123 Main St",disabled:a||s.disabled,className:s.className})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{children:[t.jsx(d.Label,{htmlFor:"city",className:"text-xs",children:"City"}),t.jsx(d.Input,{id:"city",type:"text",value:i.city||"",onChange:c=>l("city",c.target.value),placeholder:"San Francisco",disabled:a||s.disabled})]}),t.jsxs("div",{children:[t.jsx(d.Label,{htmlFor:"state",className:"text-xs",children:"State / Province"}),t.jsx(d.Input,{id:"state",type:"text",value:i.state||"",onChange:c=>l("state",c.target.value),placeholder:"CA",disabled:a||s.disabled})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{children:[t.jsx(d.Label,{htmlFor:"zipCode",className:"text-xs",children:"ZIP / Postal Code"}),t.jsx(d.Input,{id:"zipCode",type:"text",value:i.zipCode||"",onChange:c=>l("zipCode",c.target.value),placeholder:"94102",disabled:a||s.disabled})]}),t.jsxs("div",{children:[t.jsx(d.Label,{htmlFor:"country",className:"text-xs",children:"Country"}),t.jsx(d.Input,{id:"country",type:"text",value:i.country||"",onChange:c=>l("country",c.target.value),placeholder:"United States",disabled:a||s.disabled})]})]})]})}const Xt=Object.freeze(Object.defineProperty({__proto__:null,AddressField:ze},Symbol.toStringTag,{value:"Module"}));function De({value:e,onChange:r,field:n,readonly:a,...s}){const[i,l]=C.useState(!1),o=e||{},c=(m,x)=>{r({...o,[m]:x?Number(x):void 0})},f=()=>{if(!navigator.geolocation){console.error("Geolocation is not supported by this browser");return}l(!0),navigator.geolocation.getCurrentPosition(m=>{r({latitude:m.coords.latitude,longitude:m.coords.longitude,accuracy:m.coords.accuracy}),l(!1)},m=>{console.error("Error getting location:",m.message),l(!1)},{enableHighAccuracy:!0,timeout:5e3,maximumAge:0})},h=m=>!m.latitude||!m.longitude?"-":`${m.latitude.toFixed(6)}, ${m.longitude.toFixed(6)}`,p=()=>{if(!o.latitude||!o.longitude)return;const m=`https://www.google.com/maps?q=${o.latitude},${o.longitude}`;window.open(m,"_blank")};return a?t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(_.MapPin,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:h(o)}),o.latitude&&o.longitude&&t.jsx(d.Button,{type:"button",variant:"link",size:"sm",onClick:p,className:"p-0 h-auto",children:"View on map"})]}):t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(d.Button,{type:"button",variant:"outline",size:"sm",onClick:f,disabled:a||i,children:[t.jsx(_.Crosshair,{className:"w-4 h-4 mr-2"}),i?"Getting location...":"Use Current Location"]}),o.latitude&&o.longitude&&t.jsxs(d.Button,{type:"button",variant:"link",size:"sm",onClick:p,children:[t.jsx(_.MapPin,{className:"w-4 h-4 mr-2"}),"View on map"]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{children:[t.jsx(d.Label,{htmlFor:"latitude",className:"text-xs",children:"Latitude"}),t.jsx(d.Input,{id:"latitude",type:"number",value:o.latitude??"",onChange:m=>c("latitude",m.target.value),placeholder:"37.7749",disabled:a||s.disabled,step:"any",className:s.className})]}),t.jsxs("div",{children:[t.jsx(d.Label,{htmlFor:"longitude",className:"text-xs",children:"Longitude"}),t.jsx(d.Input,{id:"longitude",type:"number",value:o.longitude??"",onChange:m=>c("longitude",m.target.value),placeholder:"-122.4194",disabled:a||s.disabled,step:"any"})]})]}),o.accuracy&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Accuracy: ±",o.accuracy.toFixed(0),"m"]})]})}const Ht=Object.freeze(Object.defineProperty({__proto__:null,GeolocationField:De},Symbol.toStringTag,{value:"Module"}));function Me({value:e,onChange:r,readonly:n}){const a=C.useRef(null),[s,i]=C.useState(!1),[l,o]=C.useState(!e);C.useEffect(()=>{if(e&&a.current){const x=a.current.getContext("2d");if(x){const g=new Image;g.onload=()=>{x.drawImage(g,0,0),o(!1)},g.src=e}}},[e]);const c=m=>{if(n)return;i(!0),o(!1);const x=a.current;if(!x)return;const g=x.getContext("2d");if(!g)return;const F=x.getBoundingClientRect(),k="touches"in m?m.touches[0].clientX-F.left:m.clientX-F.left,v="touches"in m?m.touches[0].clientY-F.top:m.clientY-F.top;g.beginPath(),g.moveTo(k,v)},f=m=>{if(!s||n)return;const x=a.current;if(!x)return;const g=x.getContext("2d");if(!g)return;const F=x.getBoundingClientRect(),k="touches"in m?m.touches[0].clientX-F.left:m.clientX-F.left,v="touches"in m?m.touches[0].clientY-F.top:m.clientY-F.top;g.lineTo(k,v),g.strokeStyle="#000",g.lineWidth=2,g.lineCap="round",g.lineJoin="round",g.stroke()},h=()=>{if(!s)return;i(!1);const m=a.current;if(!m)return;const x=m.toDataURL("image/png");r(x)},p=()=>{const m=a.current;if(!m)return;const x=m.getContext("2d");x&&(x.clearRect(0,0,m.width,m.height),o(!0),r(""))};return n&&e?t.jsx("div",{className:"border rounded p-2 bg-white",children:t.jsx("img",{src:e,alt:"Signature",loading:"lazy",className:"max-w-full h-auto"})}):n&&!e?t.jsx("span",{className:"text-sm text-muted-foreground",children:"No signature"}):t.jsxs("div",{className:"space-y-2",children:[t.jsx("div",{className:"border rounded bg-white",children:t.jsx("canvas",{ref:a,width:400,height:200,className:"w-full touch-none cursor-crosshair",onMouseDown:c,onMouseMove:f,onMouseUp:h,onMouseLeave:h,onTouchStart:c,onTouchMove:f,onTouchEnd:h})}),t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsx("p",{className:"text-xs text-muted-foreground",children:l?"Sign above":"Signature captured"}),t.jsxs(d.Button,{type:"button",variant:"outline",size:"sm",onClick:p,disabled:n||l,children:[t.jsx(_.Eraser,{className:"w-4 h-4 mr-2"}),"Clear"]})]})]})}const Zt=Object.freeze(Object.defineProperty({__proto__:null,SignatureField:Me},Symbol.toStringTag,{value:"Module"}));function Ie({value:e,onChange:r,field:n,readonly:a,...s}){const[i,l]=C.useState(!1),o=n||s.schema,c=h=>`https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(h)}`,f=()=>{e&&navigator.clipboard.writeText(e)};return a?t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("span",{className:"text-sm flex-1 truncate",children:e||"-"}),e&&t.jsxs(d.Button,{type:"button",variant:"outline",size:"sm",onClick:()=>l(!i),children:[t.jsx(_.QrCode,{className:"w-4 h-4 mr-2"}),i?"Hide":"Show"," QR"]})]}):t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(d.Input,{type:"text",value:e||"",onChange:h=>r(h.target.value),placeholder:o?.placeholder||"Enter text for QR code",disabled:a||s.disabled,className:s.className}),e&&t.jsxs(t.Fragment,{children:[t.jsx(d.Button,{type:"button",variant:"outline",size:"sm",onClick:f,children:t.jsx(_.Copy,{className:"w-4 h-4"})}),t.jsx(d.Button,{type:"button",variant:"outline",size:"sm",onClick:()=>l(!i),children:t.jsx(_.QrCode,{className:"w-4 h-4"})})]})]}),i&&e&&t.jsx("div",{className:"border rounded p-4 bg-white flex justify-center",children:t.jsx("img",{src:c(e),alt:"QR Code",className:"w-48 h-48"})}),e&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:["QR code contains: ",e.length," characters"]})]})}const Kt=Object.freeze(Object.defineProperty({__proto__:null,QRCodeField:Ie},Symbol.toStringTag,{value:"Module"}));function Le({value:e,onChange:r,field:n,readonly:a,className:s,...i}){const l=e||[],o=n||i.schema,c=()=>{const p={id:`new-${Date.now()}`,label:"New Related Record"};r([...l,p])},f=p=>{r(l.filter(m=>m.id!==p))},h=p=>{console.log("View detail:",p)};return a?t.jsxs("div",{className:d.cn("space-y-2",s),children:[l.length===0?t.jsx("span",{className:"text-sm text-muted-foreground",children:"No related records"}):l.map(p=>t.jsxs("div",{className:"flex items-center justify-between p-2 border rounded hover:bg-muted/50",children:[t.jsx("span",{className:"text-sm",children:p.label}),t.jsx(d.Button,{type:"button",variant:"ghost",size:"sm",onClick:()=>h(p),children:t.jsx(_.ExternalLink,{className:"w-4 h-4"})})]},p.id)),t.jsxs("p",{className:"text-xs text-muted-foreground",children:[l.length," ",l.length===1?"record":"records"]})]}):t.jsxs("div",{className:d.cn("space-y-3",s),children:[t.jsxs("div",{className:"space-y-2",children:[l.map(p=>t.jsxs("div",{className:"flex items-center justify-between gap-2 p-2 border rounded hover:bg-muted/50",children:[t.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[t.jsx(d.Badge,{variant:"outline",children:p.id}),t.jsx("span",{className:"text-sm flex-1",children:p.label})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(d.Button,{type:"button",variant:"ghost",size:"sm",onClick:()=>h(p),children:t.jsx(_.ExternalLink,{className:"w-4 h-4"})}),t.jsx(d.Button,{type:"button",variant:"ghost",size:"sm",onClick:()=>f(p.id),disabled:i.disabled,children:t.jsx(_.X,{className:"w-4 h-4"})})]})]},p.id)),l.length===0&&t.jsx("div",{className:"text-sm text-muted-foreground text-center py-4 border border-dashed rounded bg-muted/20",children:"No related records"})]}),t.jsxs(d.Button,{type:"button",variant:"outline",className:"w-full",onClick:c,disabled:i.disabled,children:[t.jsx(_.Plus,{className:"w-4 h-4 mr-2"}),"Add ",o?.label||"Record"]})]})}const er=Object.freeze(Object.defineProperty({__proto__:null,MasterDetailField:Le},Symbol.toStringTag,{value:"Module"}));function Ze(e,r="USD"){try{return new Intl.NumberFormat("en-US",{style:"currency",currency:r}).format(e)}catch{return`${r} ${e.toFixed(2)}`}}function tr(e,r="USD"){try{return new Intl.NumberFormat("en-US",{style:"currency",currency:r,notation:"compact",maximumFractionDigits:1}).format(e).replace(/\.0(?=[KMBT])/,"")}catch{return`${r} ${e}`}}function Ke(e,r=0){return`${(e>-1&&e<1?e*100:e).toFixed(r)}%`}function K(e){return e.replace(/[_-]/g," ").replace(/\b\w/g,r=>r.toUpperCase())}function et(e){if(!e)return"-";const r=typeof e=="string"?new Date(e):e;if(isNaN(r.getTime()))return"-";const n=new Date,a=new Date(n.getFullYear(),n.getMonth(),n.getDate()),i=new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime()-a.getTime(),l=Math.round(i/(1e3*60*60*24));if(l===0)return"Today";if(l===1)return"Tomorrow";if(l===-1)return"Yesterday";if(l<-1){const o=Math.abs(l);return o<=7?`Overdue ${o}d`:ee(r)}return l>1&&l<=7?`In ${l} days`:ee(r)}function ee(e,r){if(!e)return"-";const n=typeof e=="string"?new Date(e):e;if(isNaN(n.getTime()))return"-";if(r==="short"){const a=n.toLocaleDateString("en-US",{month:"short"}),s=n.getDate(),i=String(n.getFullYear()).slice(-2);return`${a} ${s}, '${i}`}return r==="relative"?et(n):n.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function rr(e){if(!e)return"-";const r=typeof e=="string"?new Date(e):e;return isNaN(r.getTime())?"-":r.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function E({value:e}){return t.jsx("span",{className:"truncate",children:e!=null&&e!==""?String(e):"-"})}function tt({value:e,field:r}){if(e==null)return t.jsx("span",{className:"text-muted-foreground",children:"-"});const a=r.precision??0,s=typeof e=="number"?new Intl.NumberFormat("en-US",{minimumFractionDigits:a,maximumFractionDigits:a}).format(e):e;return t.jsx("span",{className:"tabular-nums",children:s})}function rt({value:e,field:r}){if(e==null)return t.jsx("span",{className:"text-muted-foreground",children:"-"});const a=r.currency||"USD",s=Ze(Number(e),a);return t.jsx("span",{className:"tabular-nums font-medium whitespace-nowrap",children:s})}const sr=/progress|completion/;function st({value:e,field:r}){if(e==null)return t.jsx("span",{className:"text-muted-foreground",children:"-"});const a=r.precision??0,s=Number(e),i=sr.test(r?.name?.toLowerCase()||""),l=i?s:s>-1&&s<1?s*100:s,o=i?`${s.toFixed(a)}%`:Ke(s,a),c=Math.max(0,Math.min(100,l));return t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"h-1.5 w-16 rounded-full bg-muted overflow-hidden flex-shrink-0",role:"progressbar","aria-valuenow":c,"aria-valuemin":0,"aria-valuemax":100,children:t.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${c}%`}})}),t.jsx("span",{className:"tabular-nums whitespace-nowrap",children:o})]})}const nr=new Set(["active","is_active","enabled","is_enabled","verified","is_verified"]);function nt({value:e,field:r}){if(e==null)return t.jsx("span",{className:"text-muted-foreground/50 text-xs italic flex items-center justify-center",children:"—"});const n=r?.name?.toLowerCase()||"";return n==="completed"||n==="is_completed"||n==="done"||n==="is_done"?t.jsx("div",{className:"flex items-center justify-center",children:e?t.jsx("div",{className:"size-5 rounded-full bg-green-500 flex items-center justify-center",role:"img","aria-label":"Completed","data-testid":"completion-indicator",children:t.jsx(_.Check,{className:"size-3 text-white"})}):t.jsx("div",{className:"size-5 rounded-full border-2 border-muted-foreground/30",role:"img","aria-label":"Not completed","data-testid":"completion-indicator"})}):nr.has(n)&&!e?t.jsxs(d.Badge,{variant:"destructive",className:"text-xs","data-testid":"boolean-warning-badge",children:[r?.label||K(n)," — Off"]}):t.jsx("div",{className:"flex items-center justify-center",children:t.jsx(d.Checkbox,{checked:!!e,disabled:!0,className:"pointer-events-none"})})}function at({value:e,field:r}){if(!e)return t.jsx("span",{className:"text-muted-foreground",children:"-"});const a=r.format||"relative",s=ee(e,a),i=typeof e=="string"?new Date(e):e,l=i instanceof Date&&!isNaN(i.getTime()),o=new Date;o.setHours(0,0,0,0);const c=l&&i<o,f=l?i.toISOString():String(e);return t.jsx("span",{className:`tabular-nums${c?" text-red-600":""}`,title:f,children:s})}function lt({value:e}){if(!e)return t.jsx("span",{className:"text-muted-foreground",children:"-"});const r=typeof e=="string"?new Date(e):e;if(isNaN(r.getTime()))return t.jsx("span",{className:"text-muted-foreground",children:"-"});const n=r.toLocaleDateString(void 0,{month:"numeric",day:"numeric",year:"numeric"}),a=r.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit",hour12:!0}).toLowerCase();return t.jsxs("span",{className:"tabular-nums text-sm whitespace-nowrap",children:[t.jsx("span",{children:n}),t.jsx("span",{className:"ml-2 text-muted-foreground",children:a})]})}const ar={critical:"red",urgent:"red",high:"orange",medium:"yellow",normal:"blue",low:"gray",none:"gray"},lr={gray:"bg-gray-100 text-gray-800 border-gray-300",red:"bg-red-100 text-red-800 border-red-300",orange:"bg-orange-100 text-orange-800 border-orange-300",yellow:"bg-yellow-100 text-yellow-800 border-yellow-300",green:"bg-green-100 text-green-800 border-green-300",blue:"bg-blue-100 text-blue-800 border-blue-300",indigo:"bg-indigo-100 text-indigo-800 border-indigo-300",purple:"bg-purple-100 text-purple-800 border-purple-300",pink:"bg-pink-100 text-pink-800 border-pink-300"};function He(e,r){const n=e||(r?ar[String(r).toLowerCase()]:void 0);return lr[n||""]||"bg-muted text-muted-foreground border-border"}function q({value:e,field:r}){const a=r.options||[];if(!e)return t.jsx("span",{children:"-"});if(Array.isArray(e))return t.jsx("div",{className:"flex flex-wrap gap-1",children:e.map((o,c)=>{const f=a.find(m=>m.value===o),h=f?.label||K(String(o)),p=He(f?.color,o);return t.jsx(d.Badge,{variant:"outline",className:p,children:h},c)})});const s=a.find(o=>o.value===e),i=s?.label||K(String(e)),l=He(s?.color,e);return t.jsx(d.Badge,{variant:"outline",className:l,children:i})}function it({value:e}){if(!e)return t.jsx("span",{children:"-"});const[r,n]=C.useState(!1),a=s=>{s.stopPropagation(),s.preventDefault(),navigator.clipboard.writeText(String(e)).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)}).catch(()=>{})};return t.jsxs("span",{className:"inline-flex items-center gap-1 group/email",children:[t.jsx(d.Button,{variant:"link",className:"p-0 h-auto font-normal text-blue-600 hover:text-blue-800",asChild:!0,children:t.jsx("a",{href:`mailto:${e}`,onClick:s=>s.stopPropagation(),children:e})}),t.jsx("button",{type:"button",className:"opacity-0 group-hover/email:opacity-100 transition-opacity p-0.5 rounded hover:bg-muted",onClick:a,"aria-label":"Copy email",children:r?t.jsx(_.Check,{className:"h-3 w-3 text-green-600"}):t.jsx(_.Copy,{className:"h-3 w-3 text-muted-foreground"})})]})}function ot({value:e}){return e?t.jsx(d.Button,{variant:"link",className:"p-0 h-auto font-normal text-blue-600 hover:text-blue-800",asChild:!0,children:t.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",onClick:r=>r.stopPropagation(),children:e})}):t.jsx("span",{children:"-"})}function ct({value:e}){if(!e)return t.jsx("span",{children:"-"});const[r,n]=C.useState(!1),a=s=>{s.stopPropagation(),s.preventDefault(),navigator.clipboard.writeText(String(e)).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)}).catch(()=>{})};return t.jsxs("span",{className:"inline-flex items-center gap-1 group/phone",children:[t.jsxs("a",{href:`tel:${e}`,className:"inline-flex items-center gap-1 text-blue-600 hover:text-blue-800",onClick:s=>s.stopPropagation(),children:[t.jsx(_.Phone,{className:"h-3 w-3"}),e]}),t.jsx("button",{type:"button",className:"opacity-0 group-hover/phone:opacity-100 transition-opacity p-0.5 rounded hover:bg-muted",onClick:a,"aria-label":"Copy phone number",children:r?t.jsx(_.Check,{className:"h-3 w-3 text-green-600"}):t.jsx(_.Copy,{className:"h-3 w-3 text-muted-foreground"})})]})}function dt({value:e,field:r}){if(!e)return t.jsx("span",{children:"-"});if(r.multiple,Array.isArray(e)){const s=e.length;return t.jsxs("span",{className:"text-sm text-gray-600",children:[s," ",s===1?"file":"files"]})}const a=e.name||e.original_name||"File";return t.jsx("span",{className:"text-sm truncate",children:a})}function ut({value:e}){return e?Array.isArray(e)?t.jsxs("div",{className:"flex -space-x-2",children:[e.slice(0,3).map((r,n)=>t.jsx("img",{src:r.url||"",alt:r.name||`Image ${n+1}`,className:"size-8 rounded-md border-2 border-white object-cover"},n)),e.length>3&&t.jsxs("div",{className:"size-8 rounded-md border-2 border-white bg-gray-100 flex items-center justify-center text-xs font-medium text-gray-600",children:["+",e.length-3]})]}):t.jsx("img",{src:e.url||"",alt:e.name||"Image",className:"size-10 rounded-md object-cover"}):t.jsx("span",{children:"-"})}function G({value:e,field:r}){if(e==null||e==="")return t.jsx("span",{children:"-"});const n=r.options||[],a=s=>{if(n.length>0){const i=n.find(l=>String(l.value)===String(s));if(i)return i.label}return String(s)};if(Array.isArray(e))return t.jsx("div",{className:"flex flex-wrap gap-1",children:e.map((s,i)=>{let l;return s!=null&&typeof s=="object"?l=s.name||s.label||s._id||String(s):l=a(s),t.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-gray-100 text-gray-800",children:l},i)})});if(typeof e=="object"&&e!==null){const s=e.name||e.label||e._id||"[Object]";return t.jsx("span",{className:"truncate",children:s})}return t.jsx("span",{className:"truncate",children:a(e)})}function ne({value:e}){return t.jsx("span",{className:"text-gray-700 font-mono text-sm",children:e!=null?String(e):"-"})}function J({value:e}){if(!e)return t.jsx("span",{children:"-"});if(typeof e!="object")return t.jsx("span",{className:"truncate",children:String(e)});if(Array.isArray(e))return t.jsxs("div",{className:"flex -space-x-2",children:[e.slice(0,3).map((a,s)=>{if(typeof a!="object"||a===null)return t.jsx("span",{className:"truncate text-sm",children:String(a)},s);const i=a.name||a.username||"User",l=i.split(" ").map(o=>o[0]).join("").toUpperCase().slice(0,2);return t.jsx(d.Avatar,{className:"size-8 border-2 border-white",title:i,children:t.jsx(d.AvatarFallback,{className:"bg-blue-500 text-white text-xs",children:l})},s)}),e.length>3&&t.jsx(d.Avatar,{className:"size-8 border-2 border-white",children:t.jsxs(d.AvatarFallback,{className:"bg-gray-200 text-gray-600 text-xs",children:["+",e.length-3]})})]});const r=e.name||e.username||"User",n=r.split(" ").map(a=>a[0]).join("").toUpperCase().slice(0,2);return t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(d.Avatar,{className:"size-8",children:t.jsx(d.AvatarFallback,{className:"bg-blue-500 text-white text-xs",children:n})}),t.jsx("span",{className:"truncate",children:r})]})}const ae=new Map;function M(e,r){ae.set(e,r)}function ir(e){return ae.has(e)?ae.get(e):{text:E,textarea:E,markdown:E,html:E,number:tt,currency:rt,percent:st,boolean:nt,date:at,datetime:lt,time:E,select:q,status:q,lookup:G,master_detail:G,email:it,url:ot,phone:ct,file:dt,image:ut,formula:ne,summary:ne,auto_number:E,user:J,owner:J,password:()=>t.jsx("span",{children:"••••••"}),location:E,object:()=>t.jsx("span",{className:"text-gray-500 italic",children:"[Object]"}),vector:()=>t.jsx("span",{className:"text-gray-500 italic",children:"[Vector]"}),grid:()=>t.jsx("span",{className:"text-gray-500 italic",children:"[Grid]"})}[e]||E}M("lookup",G);M("master_detail",G);M("select",q);M("status",q);M("user",J);M("owner",J);function or(e){return{text:"field:text",textarea:"field:textarea",markdown:"field:markdown",html:"field:html",number:"field:number",currency:"field:currency",percent:"field:percent",date:"field:date",datetime:"field:datetime",time:"field:time",boolean:"field:boolean",select:"field:select",lookup:"field:lookup",master_detail:"field:master_detail",email:"field:email",phone:"field:phone",url:"field:url",file:"field:file",image:"field:image",password:"field:password",location:"field:location",formula:"field:formula",summary:"field:summary",auto_number:"field:auto_number"}[e]||"field:text"}function cr(e){if(e<0||!Number.isFinite(e)||e===0)return"0 B";const r=["B","KB","MB","GB","TB"];let n=e,a=0;for(;n>=1024&&a<r.length-1;)n/=1024,a++;return`${n.toFixed(a>0?1:0)} ${r[a]}`}function dr(e){const r={};return e.required&&(r.required=typeof e.required_message=="string"?e.required_message:`${e.label||e.name} is required`),e.min_length&&(r.minLength={value:e.min_length,message:e.min_length_message||`Minimum length is ${e.min_length} characters`}),e.max_length&&(r.maxLength={value:e.max_length,message:e.max_length_message||`Maximum length is ${e.max_length} characters`}),e.min!==void 0&&(r.min={value:e.min,message:e.min_message||`Minimum value is ${e.min}`}),e.max!==void 0&&(r.max={value:e.max,message:e.max_message||`Maximum value is ${e.max}`}),e.pattern&&(r.pattern={value:typeof e.pattern=="string"?new RegExp(e.pattern):e.pattern,message:e.pattern_message||"Invalid format"}),e.type==="email"&&(r.pattern={value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:"Please enter a valid email address"}),e.type==="url"&&(r.pattern={value:/^https?:\/\/.+/,message:"Please enter a valid URL"}),e.validate&&(r.validate=e.validate),Object.keys(r).length>0?r:void 0}function le(e,r){if(!e)return!0;if(e.field&&e.value!==void 0){const n=r[e.field];if(e.operator==="="||e.operator==="==")return n===e.value;if(e.operator==="!=")return n!==e.value;if(e.operator===">")return n>e.value;if(e.operator===">=")return n>=e.value;if(e.operator==="<")return n<e.value;if(e.operator==="<=")return n<=e.value;if(e.operator==="in")return Array.isArray(e.value)&&e.value.includes(n)}return e.and&&Array.isArray(e.and)?e.and.every(n=>le(n,r)):e.or&&Array.isArray(e.or)?e.or.some(n=>le(n,r)):!0}function N(e){const r=({schema:n,className:a,value:s,...i})=>{const[l,o]=C.useState(s??n?.value??""),c={name:n?.name||"field",label:n?.label,type:n?.type,placeholder:n?.placeholder,required:n?.required,readonly:n?.readonly||n?.readOnly,help:n?.help,description:n?.description,defaultValue:n?.defaultValue||n?.value,...n},f=C.useCallback(p=>{o(p),i.onChange&&i.onChange(p)},[i]),h=n?.readonly||n?.readOnly||!1;return t.jsxs("div",{className:"grid w-full items-center gap-1.5","data-obj-id":n?.id,"data-obj-type":n?.type,children:[n?.label&&t.jsx("label",{htmlFor:n.id,className:n.required?"after:content-['*'] after:ml-0.5 after:text-red-500":"",children:n.label}),t.jsx(e,{value:l,onChange:f,field:c,readonly:h,className:a}),n?.description&&t.jsx("p",{className:"text-sm text-gray-500",children:n.description})]})};return r.displayName=`FieldRenderer(${e.displayName||e.name||"Component"})`,r}const mt={text:()=>Promise.resolve().then(()=>yt).then(e=>({default:e.TextField})),textarea:()=>Promise.resolve().then(()=>Pt).then(e=>({default:e.TextAreaField})),number:()=>Promise.resolve().then(()=>Nt).then(e=>({default:e.NumberField})),boolean:()=>Promise.resolve().then(()=>vt).then(e=>({default:e.BooleanField})),select:()=>Promise.resolve().then(()=>Ft).then(e=>({default:e.SelectField})),date:()=>Promise.resolve().then(()=>_t).then(e=>({default:e.DateField})),datetime:()=>Promise.resolve().then(()=>kt).then(e=>({default:e.DateTimeField})),time:()=>Promise.resolve().then(()=>At).then(e=>({default:e.TimeField})),email:()=>Promise.resolve().then(()=>Ct).then(e=>({default:e.EmailField})),phone:()=>Promise.resolve().then(()=>wt).then(e=>({default:e.PhoneField})),url:()=>Promise.resolve().then(()=>St).then(e=>({default:e.UrlField})),currency:()=>Promise.resolve().then(()=>Tt).then(e=>({default:e.CurrencyField})),percent:()=>Promise.resolve().then(()=>$t).then(e=>({default:e.PercentField})),password:()=>Promise.resolve().then(()=>Et).then(e=>({default:e.PasswordField})),markdown:()=>Promise.resolve().then(()=>Qe).then(e=>({default:e.RichTextField})),html:()=>Promise.resolve().then(()=>Qe).then(e=>({default:e.RichTextField})),lookup:()=>Promise.resolve().then(()=>Ot).then(e=>({default:e.LookupField})),master_detail:()=>Promise.resolve().then(()=>er).then(e=>({default:e.MasterDetailField})),file:()=>Promise.resolve().then(()=>zt).then(e=>({default:e.FileField})),image:()=>Promise.resolve().then(()=>Dt).then(e=>({default:e.ImageField})),location:()=>Promise.resolve().then(()=>Mt).then(e=>({default:e.LocationField})),formula:()=>Promise.resolve().then(()=>It).then(e=>({default:e.FormulaField})),summary:()=>Promise.resolve().then(()=>Lt).then(e=>({default:e.SummaryField})),auto_number:()=>Promise.resolve().then(()=>Ut).then(e=>({default:e.AutoNumberField})),user:()=>Promise.resolve().then(()=>Xe).then(e=>({default:e.UserField})),owner:()=>Promise.resolve().then(()=>Xe).then(e=>({default:e.UserField})),object:()=>Promise.resolve().then(()=>Bt).then(e=>({default:e.ObjectField})),vector:()=>Promise.resolve().then(()=>Vt).then(e=>({default:e.VectorField})),grid:()=>Promise.resolve().then(()=>Yt).then(e=>({default:e.GridField})),color:()=>Promise.resolve().then(()=>qt).then(e=>({default:e.ColorField})),slider:()=>Promise.resolve().then(()=>Gt).then(e=>({default:e.SliderField})),rating:()=>Promise.resolve().then(()=>Jt).then(e=>({default:e.RatingField})),code:()=>Promise.resolve().then(()=>Wt).then(e=>({default:e.CodeField})),avatar:()=>Promise.resolve().then(()=>Qt).then(e=>({default:e.AvatarField})),address:()=>Promise.resolve().then(()=>Xt).then(e=>({default:e.AddressField})),geolocation:()=>Promise.resolve().then(()=>Ht).then(e=>({default:e.GeolocationField})),signature:()=>Promise.resolve().then(()=>Zt).then(e=>({default:e.SignatureField})),qrcode:()=>Promise.resolve().then(()=>Kt).then(e=>({default:e.QRCodeField}))};function ft(e){const r=mt[e];if(!r){console.warn(`Unknown field type: ${e}`);return}const n=C.lazy(r);b.ComponentRegistry.register(e,n,{namespace:"field"})}function pt(){Object.keys(mt).forEach(e=>{ft(e)})}function ur(){b.ComponentRegistry.register("text",N(ie),{namespace:"field"}),b.ComponentRegistry.register("textarea",N(he),{namespace:"field"}),b.ComponentRegistry.register("number",N(oe),{namespace:"field"}),b.ComponentRegistry.register("boolean",N(ce),{namespace:"field"}),b.ComponentRegistry.register("select",N(de),{namespace:"field"}),b.ComponentRegistry.register("date",N(ue),{namespace:"field"}),b.ComponentRegistry.register("datetime",N(be),{namespace:"field"}),b.ComponentRegistry.register("time",N(je),{namespace:"field"}),b.ComponentRegistry.register("email",N(me),{namespace:"field"}),b.ComponentRegistry.register("phone",N(fe),{namespace:"field"}),b.ComponentRegistry.register("url",N(pe),{namespace:"field"}),b.ComponentRegistry.register("currency",N(xe),{namespace:"field"}),b.ComponentRegistry.register("percent",N(ye),{namespace:"field"}),b.ComponentRegistry.register("password",N(Ne),{namespace:"field"}),b.ComponentRegistry.register("markdown",N(H),{namespace:"field"}),b.ComponentRegistry.register("html",N(H),{namespace:"field"}),b.ComponentRegistry.register("lookup",N(ge),{namespace:"field"}),b.ComponentRegistry.register("master_detail",N(Le),{namespace:"field"}),b.ComponentRegistry.register("file",N(ve),{namespace:"field"}),b.ComponentRegistry.register("image",N(Fe),{namespace:"field"}),b.ComponentRegistry.register("location",N(_e),{namespace:"field"}),b.ComponentRegistry.register("formula",N(Ce),{namespace:"field"}),b.ComponentRegistry.register("summary",N(we),{namespace:"field"}),b.ComponentRegistry.register("auto_number",N(Se),{namespace:"field"}),b.ComponentRegistry.register("user",N(Z),{namespace:"field"}),b.ComponentRegistry.register("owner",N(Z),{namespace:"field"}),b.ComponentRegistry.register("object",N(Re),{namespace:"field"}),b.ComponentRegistry.register("vector",N(Te),{namespace:"field"}),b.ComponentRegistry.register("grid",N(Pe),{namespace:"field"}),b.ComponentRegistry.register("color",N(Oe),{namespace:"field"}),b.ComponentRegistry.register("slider",N(ke),{namespace:"field"}),b.ComponentRegistry.register("rating",N(Ae),{namespace:"field"}),b.ComponentRegistry.register("code",N($e),{namespace:"field"}),b.ComponentRegistry.register("avatar",N(Ee),{namespace:"field"}),b.ComponentRegistry.register("address",N(ze),{namespace:"field"}),b.ComponentRegistry.register("geolocation",N(De),{namespace:"field"}),b.ComponentRegistry.register("signature",N(Me),{namespace:"field"}),b.ComponentRegistry.register("qrcode",N(Ie),{namespace:"field"})}pt();exports.AddressField=ze;exports.AutoNumberField=Se;exports.AvatarField=Ee;exports.BooleanCellRenderer=nt;exports.BooleanField=ce;exports.CodeField=$e;exports.ColorField=Oe;exports.CurrencyCellRenderer=rt;exports.CurrencyField=xe;exports.DateCellRenderer=at;exports.DateField=ue;exports.DateTimeCellRenderer=lt;exports.DateTimeField=be;exports.EmailCellRenderer=it;exports.EmailField=me;exports.FileCellRenderer=dt;exports.FileField=ve;exports.FormulaCellRenderer=ne;exports.FormulaField=Ce;exports.GeolocationField=De;exports.GridField=Pe;exports.ImageCellRenderer=ut;exports.ImageField=Fe;exports.LocationField=_e;exports.LookupCellRenderer=G;exports.LookupField=ge;exports.MasterDetailField=Le;exports.NumberCellRenderer=tt;exports.NumberField=oe;exports.ObjectField=Re;exports.PasswordField=Ne;exports.PercentCellRenderer=st;exports.PercentField=ye;exports.PhoneCellRenderer=ct;exports.PhoneField=fe;exports.QRCodeField=Ie;exports.RatingField=Ae;exports.RichTextField=H;exports.SelectCellRenderer=q;exports.SelectField=de;exports.SignatureField=Me;exports.SliderField=ke;exports.SummaryField=we;exports.TextAreaField=he;exports.TextCellRenderer=E;exports.TextField=ie;exports.TimeField=je;exports.UrlCellRenderer=ot;exports.UrlField=pe;exports.UserCellRenderer=J;exports.UserField=Z;exports.VectorField=Te;exports.buildValidationRules=dr;exports.evaluateCondition=le;exports.formatCompactCurrency=tr;exports.formatCurrency=Ze;exports.formatDate=ee;exports.formatDateTime=rr;exports.formatFileSize=cr;exports.formatPercent=Ke;exports.formatRelativeDate=et;exports.getCellRenderer=ir;exports.humanizeLabel=K;exports.mapFieldTypeToFormType=or;exports.registerAllFields=pt;exports.registerField=ft;exports.registerFieldRenderer=M;exports.registerFields=ur;
|
|
13
|
+
}`,disabled:a||s.disabled,className:d.cn("font-mono text-xs",f?"border-red-500 focus-visible:ring-red-500":"",s.className),rows:6}),f&&t.jsx("p",{className:"text-xs text-red-500",children:f})]})}const Bt=Object.freeze(Object.defineProperty({__proto__:null,ObjectField:Re},Symbol.toStringTag,{value:"Module"}));function Te({value:e,field:r,...n}){const s=(r||n.schema)?.dimensions||(Array.isArray(e)?e.length:0);if(!e||!Array.isArray(e))return t.jsx("span",{className:"text-sm text-gray-500",children:"-"});const i=e.slice(0,3).map(l=>{const o=Number(l);return isNaN(o)?"0":o.toFixed(4)}).join(", ");return t.jsxs("div",{className:`text-sm ${n.className||""}`,children:[t.jsxs("span",{className:"font-mono text-gray-700",children:["[",i,"...]"]}),t.jsxs("span",{className:"text-gray-500 ml-2",children:["(",s,"D)"]})]})}const Vt=Object.freeze(Object.defineProperty({__proto__:null,VectorField:Te},Symbol.toStringTag,{value:"Module"}));function Pe({value:e,field:r,readonly:n,...a}){const i=(r||a.schema)?.columns||[];return!e||!Array.isArray(e)?t.jsx("span",{className:"text-sm text-muted-foreground",children:"-"}):n?t.jsx("div",{className:d.cn("text-sm",a.className),children:t.jsxs("span",{className:"text-foreground",children:[e.length," rows"]})}):t.jsxs("div",{className:d.cn("border border-border rounded-lg overflow-hidden",a.className),children:[t.jsx("div",{className:"overflow-auto max-h-60",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{className:"bg-muted border-b border-border",children:t.jsx("tr",{children:i.map((l,o)=>t.jsx("th",{className:"px-3 py-2 text-left text-xs font-medium text-muted-foreground",children:l.label||l.name},o))})}),t.jsx("tbody",{className:"divide-y divide-border",children:e.slice(0,5).map((l,o)=>t.jsx("tr",{className:"hover:bg-muted/50 transition-colors",children:i.map((c,f)=>t.jsx("td",{className:"px-3 py-2 text-foreground",children:l[c.name]!=null?String(l[c.name]):"-"},f))},o))})]})}),e.length>5&&t.jsxs("div",{className:"bg-muted px-3 py-2 text-xs text-muted-foreground border-t border-border",children:["Showing 5 of ",e.length," rows"]})]})}const Yt=Object.freeze(Object.defineProperty({__proto__:null,GridField:Pe},Symbol.toStringTag,{value:"Module"}));function Oe({value:e,onChange:r,field:n,readonly:a,...s}){const i=n||s.schema;return a?t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-6 h-6 rounded border border-input",style:{backgroundColor:e||"#000000"}}),t.jsx("span",{className:"text-sm",children:e||"-"})]}):t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("input",{type:"color",value:e||"#000000",onChange:l=>r(l.target.value),disabled:a||s.disabled,className:"w-10 h-10 rounded border border-input cursor-pointer"}),t.jsx(d.Input,{type:"text",value:e||"",onChange:l=>r(l.target.value),placeholder:i?.placeholder||"#000000",disabled:a||s.disabled,className:s.className,pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"})]})}const qt=Object.freeze(Object.defineProperty({__proto__:null,ColorField:Oe},Symbol.toStringTag,{value:"Module"}));function ke({value:e,onChange:r,field:n,readonly:a,...s}){const i=n||s.schema,l=i?.min??0,o=i?.max??100,c=i?.step??1;return a?t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm font-medium",children:e??l}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:["/ ",o]})]}):t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(d.Slider,{value:[e??l],onValueChange:f=>r(f[0]),min:l,max:o,step:c,disabled:a||s.disabled,className:s.className}),t.jsx("span",{className:"text-sm font-medium w-12 text-right",children:e??l})]})}const Gt=Object.freeze(Object.defineProperty({__proto__:null,SliderField:ke},Symbol.toStringTag,{value:"Module"}));function Ae({value:e,onChange:r,field:n,readonly:a,className:s,...i}){const o=(n||i.schema)?.max??5,c=e??0,[f,g]=C.useState(null),p=f!==null?f:c;return a?t.jsxs("div",{className:d.cn("flex items-center gap-1",s),children:[Array.from({length:o},(m,x)=>t.jsx(_.Star,{className:`w-5 h-5 ${x<c?"fill-yellow-400 text-yellow-400":"text-muted-foreground"}`},x)),t.jsxs("span",{className:"ml-2 text-sm text-muted-foreground",children:[c," / ",o]})]}):t.jsxs("div",{className:d.cn("flex items-center gap-1",s),children:[Array.from({length:o},(m,x)=>t.jsx("button",{type:"button",onClick:()=>r(x+1),onMouseEnter:()=>g(x+1),onMouseLeave:()=>g(null),className:"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 rounded",disabled:a||i.disabled,children:t.jsx(_.Star,{className:`w-5 h-5 transition-colors ${x<p?"fill-yellow-400 text-yellow-400 hover:fill-yellow-500 hover:text-yellow-500":"text-muted-foreground hover:text-yellow-400"}`})},x)),t.jsxs("span",{className:"ml-2 text-sm text-muted-foreground",children:[c," / ",o]})]})}const Jt=Object.freeze(Object.defineProperty({__proto__:null,RatingField:Ae},Symbol.toStringTag,{value:"Module"}));function $e({value:e,onChange:r,field:n,readonly:a,...s}){const i=n||s.schema,l=i?.language??"javascript";return a?t.jsx("pre",{className:d.cn("text-sm bg-muted p-2 rounded overflow-x-auto border",s.className),children:t.jsx("code",{children:e||"-"})}):t.jsx(d.Textarea,{value:e||"",onChange:o=>r(o.target.value),placeholder:i?.placeholder||`// Write ${l} code here...`,disabled:a||s.disabled,className:d.cn("font-mono text-sm",s.className),rows:12,spellCheck:!1})}const Wt=Object.freeze(Object.defineProperty({__proto__:null,CodeField:$e},Symbol.toStringTag,{value:"Module"}));function Ee({value:e,onChange:r,field:n,readonly:a,...s}){const[i,l]=C.useState(!1),o=C.useRef(null),c=n||s.schema,f=m=>{const x=m.target.files?.[0];if(!x)return;if(!x.type.startsWith("image/")){console.error("Please select an image file");return}if(x.size>5*1024*1024){console.error("File size must be less than 5MB");return}const h=new FileReader;h.onloadend=()=>{r(h.result)},h.readAsDataURL(x)},g=()=>{r("")},p=()=>(c?.defaultName||c?.label||"User").split(" ").map(x=>x[0]).join("").toUpperCase().slice(0,2);return a?t.jsxs(d.Avatar,{className:"w-16 h-16",children:[e&&t.jsx(d.AvatarImage,{src:e,alt:c?.label}),t.jsx(d.AvatarFallback,{children:p()})]}):t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("div",{className:"relative",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[t.jsxs(d.Avatar,{className:"w-16 h-16",children:[e&&t.jsx(d.AvatarImage,{src:e,alt:c?.label}),t.jsx(d.AvatarFallback,{children:p()})]}),!a&&i&&e&&t.jsx("button",{type:"button",onClick:g,className:"absolute -top-1 -right-1 bg-destructive text-destructive-foreground rounded-full p-1 hover:bg-destructive/90",children:t.jsx(_.X,{className:"w-3 h-3"})})]}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("input",{ref:o,type:"file",accept:"image/*",onChange:f,className:"hidden"}),t.jsxs(d.Button,{type:"button",variant:"outline",size:"sm",onClick:()=>o.current?.click(),disabled:a||s.disabled,children:[t.jsx(_.Upload,{className:"w-4 h-4 mr-2"}),e?"Change":"Upload"," Avatar"]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"PNG, JPG up to 5MB"})]})]})}const Qt=Object.freeze(Object.defineProperty({__proto__:null,AvatarField:Ee},Symbol.toStringTag,{value:"Module"}));function ze({value:e,onChange:r,field:n,readonly:a,...s}){const i=e||{},l=(c,f)=>{r({...i,[c]:f})},o=c=>[c.street,c.city,[c.state,c.zipCode].filter(Boolean).join(" "),c.country].filter(Boolean).join(", ")||"-";return a?t.jsx("span",{className:"text-sm",children:o(i)}):t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{children:[t.jsx(d.Label,{htmlFor:"street",className:"text-xs",children:"Street Address"}),t.jsx(d.Input,{id:"street",type:"text",value:i.street||"",onChange:c=>l("street",c.target.value),placeholder:"123 Main St",disabled:a||s.disabled,className:s.className})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{children:[t.jsx(d.Label,{htmlFor:"city",className:"text-xs",children:"City"}),t.jsx(d.Input,{id:"city",type:"text",value:i.city||"",onChange:c=>l("city",c.target.value),placeholder:"San Francisco",disabled:a||s.disabled})]}),t.jsxs("div",{children:[t.jsx(d.Label,{htmlFor:"state",className:"text-xs",children:"State / Province"}),t.jsx(d.Input,{id:"state",type:"text",value:i.state||"",onChange:c=>l("state",c.target.value),placeholder:"CA",disabled:a||s.disabled})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{children:[t.jsx(d.Label,{htmlFor:"zipCode",className:"text-xs",children:"ZIP / Postal Code"}),t.jsx(d.Input,{id:"zipCode",type:"text",value:i.zipCode||"",onChange:c=>l("zipCode",c.target.value),placeholder:"94102",disabled:a||s.disabled})]}),t.jsxs("div",{children:[t.jsx(d.Label,{htmlFor:"country",className:"text-xs",children:"Country"}),t.jsx(d.Input,{id:"country",type:"text",value:i.country||"",onChange:c=>l("country",c.target.value),placeholder:"United States",disabled:a||s.disabled})]})]})]})}const Xt=Object.freeze(Object.defineProperty({__proto__:null,AddressField:ze},Symbol.toStringTag,{value:"Module"}));function De({value:e,onChange:r,field:n,readonly:a,...s}){const[i,l]=C.useState(!1),o=e||{},c=(m,x)=>{r({...o,[m]:x?Number(x):void 0})},f=()=>{if(!navigator.geolocation){console.error("Geolocation is not supported by this browser");return}l(!0),navigator.geolocation.getCurrentPosition(m=>{r({latitude:m.coords.latitude,longitude:m.coords.longitude,accuracy:m.coords.accuracy}),l(!1)},m=>{console.error("Error getting location:",m.message),l(!1)},{enableHighAccuracy:!0,timeout:5e3,maximumAge:0})},g=m=>!m.latitude||!m.longitude?"-":`${m.latitude.toFixed(6)}, ${m.longitude.toFixed(6)}`,p=()=>{if(!o.latitude||!o.longitude)return;const m=`https://www.google.com/maps?q=${o.latitude},${o.longitude}`;window.open(m,"_blank")};return a?t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(_.MapPin,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:g(o)}),o.latitude&&o.longitude&&t.jsx(d.Button,{type:"button",variant:"link",size:"sm",onClick:p,className:"p-0 h-auto",children:"View on map"})]}):t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(d.Button,{type:"button",variant:"outline",size:"sm",onClick:f,disabled:a||i,children:[t.jsx(_.Crosshair,{className:"w-4 h-4 mr-2"}),i?"Getting location...":"Use Current Location"]}),o.latitude&&o.longitude&&t.jsxs(d.Button,{type:"button",variant:"link",size:"sm",onClick:p,children:[t.jsx(_.MapPin,{className:"w-4 h-4 mr-2"}),"View on map"]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{children:[t.jsx(d.Label,{htmlFor:"latitude",className:"text-xs",children:"Latitude"}),t.jsx(d.Input,{id:"latitude",type:"number",value:o.latitude??"",onChange:m=>c("latitude",m.target.value),placeholder:"37.7749",disabled:a||s.disabled,step:"any",className:s.className})]}),t.jsxs("div",{children:[t.jsx(d.Label,{htmlFor:"longitude",className:"text-xs",children:"Longitude"}),t.jsx(d.Input,{id:"longitude",type:"number",value:o.longitude??"",onChange:m=>c("longitude",m.target.value),placeholder:"-122.4194",disabled:a||s.disabled,step:"any"})]})]}),o.accuracy&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Accuracy: ±",o.accuracy.toFixed(0),"m"]})]})}const Ht=Object.freeze(Object.defineProperty({__proto__:null,GeolocationField:De},Symbol.toStringTag,{value:"Module"}));function Me({value:e,onChange:r,readonly:n}){const a=C.useRef(null),[s,i]=C.useState(!1),[l,o]=C.useState(!e);C.useEffect(()=>{if(e&&a.current){const x=a.current.getContext("2d");if(x){const h=new Image;h.onload=()=>{x.drawImage(h,0,0),o(!1)},h.src=e}}},[e]);const c=m=>{if(n)return;i(!0),o(!1);const x=a.current;if(!x)return;const h=x.getContext("2d");if(!h)return;const F=x.getBoundingClientRect(),k="touches"in m?m.touches[0].clientX-F.left:m.clientX-F.left,v="touches"in m?m.touches[0].clientY-F.top:m.clientY-F.top;h.beginPath(),h.moveTo(k,v)},f=m=>{if(!s||n)return;const x=a.current;if(!x)return;const h=x.getContext("2d");if(!h)return;const F=x.getBoundingClientRect(),k="touches"in m?m.touches[0].clientX-F.left:m.clientX-F.left,v="touches"in m?m.touches[0].clientY-F.top:m.clientY-F.top;h.lineTo(k,v),h.strokeStyle="#000",h.lineWidth=2,h.lineCap="round",h.lineJoin="round",h.stroke()},g=()=>{if(!s)return;i(!1);const m=a.current;if(!m)return;const x=m.toDataURL("image/png");r(x)},p=()=>{const m=a.current;if(!m)return;const x=m.getContext("2d");x&&(x.clearRect(0,0,m.width,m.height),o(!0),r(""))};return n&&e?t.jsx("div",{className:"border rounded p-2 bg-white",children:t.jsx("img",{src:e,alt:"Signature",loading:"lazy",className:"max-w-full h-auto"})}):n&&!e?t.jsx("span",{className:"text-sm text-muted-foreground",children:"No signature"}):t.jsxs("div",{className:"space-y-2",children:[t.jsx("div",{className:"border rounded bg-white",children:t.jsx("canvas",{ref:a,width:400,height:200,className:"w-full touch-none cursor-crosshair",onMouseDown:c,onMouseMove:f,onMouseUp:g,onMouseLeave:g,onTouchStart:c,onTouchMove:f,onTouchEnd:g})}),t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsx("p",{className:"text-xs text-muted-foreground",children:l?"Sign above":"Signature captured"}),t.jsxs(d.Button,{type:"button",variant:"outline",size:"sm",onClick:p,disabled:n||l,children:[t.jsx(_.Eraser,{className:"w-4 h-4 mr-2"}),"Clear"]})]})]})}const Zt=Object.freeze(Object.defineProperty({__proto__:null,SignatureField:Me},Symbol.toStringTag,{value:"Module"}));function Ie({value:e,onChange:r,field:n,readonly:a,...s}){const[i,l]=C.useState(!1),o=n||s.schema,c=g=>`https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(g)}`,f=()=>{e&&navigator.clipboard.writeText(e)};return a?t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("span",{className:"text-sm flex-1 truncate",children:e||"-"}),e&&t.jsxs(d.Button,{type:"button",variant:"outline",size:"sm",onClick:()=>l(!i),children:[t.jsx(_.QrCode,{className:"w-4 h-4 mr-2"}),i?"Hide":"Show"," QR"]})]}):t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(d.Input,{type:"text",value:e||"",onChange:g=>r(g.target.value),placeholder:o?.placeholder||"Enter text for QR code",disabled:a||s.disabled,className:s.className}),e&&t.jsxs(t.Fragment,{children:[t.jsx(d.Button,{type:"button",variant:"outline",size:"sm",onClick:f,children:t.jsx(_.Copy,{className:"w-4 h-4"})}),t.jsx(d.Button,{type:"button",variant:"outline",size:"sm",onClick:()=>l(!i),children:t.jsx(_.QrCode,{className:"w-4 h-4"})})]})]}),i&&e&&t.jsx("div",{className:"border rounded p-4 bg-white flex justify-center",children:t.jsx("img",{src:c(e),alt:"QR Code",className:"w-48 h-48"})}),e&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:["QR code contains: ",e.length," characters"]})]})}const Kt=Object.freeze(Object.defineProperty({__proto__:null,QRCodeField:Ie},Symbol.toStringTag,{value:"Module"}));function Le({value:e,onChange:r,field:n,readonly:a,className:s,...i}){const l=e||[],o=n||i.schema,c=()=>{const p={id:`new-${Date.now()}`,label:"New Related Record"};r([...l,p])},f=p=>{r(l.filter(m=>m.id!==p))},g=p=>{console.log("View detail:",p)};return a?t.jsxs("div",{className:d.cn("space-y-2",s),children:[l.length===0?t.jsx("span",{className:"text-sm text-muted-foreground",children:"No related records"}):l.map(p=>t.jsxs("div",{className:"flex items-center justify-between p-2 border rounded hover:bg-muted/50",children:[t.jsx("span",{className:"text-sm",children:p.label}),t.jsx(d.Button,{type:"button",variant:"ghost",size:"sm",onClick:()=>g(p),children:t.jsx(_.ExternalLink,{className:"w-4 h-4"})})]},p.id)),t.jsxs("p",{className:"text-xs text-muted-foreground",children:[l.length," ",l.length===1?"record":"records"]})]}):t.jsxs("div",{className:d.cn("space-y-3",s),children:[t.jsxs("div",{className:"space-y-2",children:[l.map(p=>t.jsxs("div",{className:"flex items-center justify-between gap-2 p-2 border rounded hover:bg-muted/50",children:[t.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[t.jsx(d.Badge,{variant:"outline",children:p.id}),t.jsx("span",{className:"text-sm flex-1",children:p.label})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(d.Button,{type:"button",variant:"ghost",size:"sm",onClick:()=>g(p),children:t.jsx(_.ExternalLink,{className:"w-4 h-4"})}),t.jsx(d.Button,{type:"button",variant:"ghost",size:"sm",onClick:()=>f(p.id),disabled:i.disabled,children:t.jsx(_.X,{className:"w-4 h-4"})})]})]},p.id)),l.length===0&&t.jsx("div",{className:"text-sm text-muted-foreground text-center py-4 border border-dashed rounded bg-muted/20",children:"No related records"})]}),t.jsxs(d.Button,{type:"button",variant:"outline",className:"w-full",onClick:c,disabled:i.disabled,children:[t.jsx(_.Plus,{className:"w-4 h-4 mr-2"}),"Add ",o?.label||"Record"]})]})}const er=Object.freeze(Object.defineProperty({__proto__:null,MasterDetailField:Le},Symbol.toStringTag,{value:"Module"}));function Ze(e,r="USD"){try{return new Intl.NumberFormat("en-US",{style:"currency",currency:r}).format(e)}catch{return`${r} ${e.toFixed(2)}`}}function tr(e,r="USD"){try{return new Intl.NumberFormat("en-US",{style:"currency",currency:r,notation:"compact",maximumFractionDigits:1}).format(e).replace(/\.0(?=[KMBT])/,"")}catch{return`${r} ${e}`}}function Ke(e,r=0){return`${(e>-1&&e<1?e*100:e).toFixed(r)}%`}function K(e){return e.replace(/[_-]/g," ").replace(/\b\w/g,r=>r.toUpperCase())}function et(e){if(!e)return"-";const r=typeof e=="string"?new Date(e):e;if(isNaN(r.getTime()))return"-";const n=new Date,a=new Date(n.getFullYear(),n.getMonth(),n.getDate()),i=new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime()-a.getTime(),l=Math.round(i/(1e3*60*60*24));if(l===0)return"Today";if(l===1)return"Tomorrow";if(l===-1)return"Yesterday";if(l<-1){const o=Math.abs(l);return o<=7?`Overdue ${o}d`:ee(r)}return l>1&&l<=7?`In ${l} days`:ee(r)}function ee(e,r){if(!e)return"-";const n=typeof e=="string"?new Date(e):e;if(isNaN(n.getTime()))return"-";if(r==="short"){const a=n.toLocaleDateString("en-US",{month:"short"}),s=n.getDate(),i=String(n.getFullYear()).slice(-2);return`${a} ${s}, '${i}`}return r==="relative"?et(n):n.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function rr(e){if(!e)return"-";const r=typeof e=="string"?new Date(e):e;return isNaN(r.getTime())?"-":r.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function E({value:e}){return t.jsx("span",{className:"truncate",children:e!=null&&e!==""?String(e):"-"})}function tt({value:e,field:r}){if(e==null)return t.jsx("span",{className:"text-muted-foreground",children:"-"});const a=r.precision??0,s=typeof e=="number"?new Intl.NumberFormat("en-US",{minimumFractionDigits:a,maximumFractionDigits:a}).format(e):e;return t.jsx("span",{className:"tabular-nums",children:s})}function rt({value:e,field:r}){if(e==null)return t.jsx("span",{className:"text-muted-foreground",children:"-"});const a=r.currency||"USD",s=Ze(Number(e),a);return t.jsx("span",{className:"tabular-nums font-medium whitespace-nowrap",children:s})}const sr=/progress|completion/;function st({value:e,field:r}){if(e==null)return t.jsx("span",{className:"text-muted-foreground",children:"-"});const a=r.precision??0,s=Number(e),i=sr.test(r?.name?.toLowerCase()||""),l=i?s:s>-1&&s<1?s*100:s,o=i?`${s.toFixed(a)}%`:Ke(s,a),c=Math.max(0,Math.min(100,l));return t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"h-1.5 w-16 rounded-full bg-muted overflow-hidden flex-shrink-0",role:"progressbar","aria-valuenow":c,"aria-valuemin":0,"aria-valuemax":100,children:t.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${c}%`}})}),t.jsx("span",{className:"tabular-nums whitespace-nowrap",children:o})]})}const nr=new Set(["active","is_active","enabled","is_enabled","verified","is_verified"]);function nt({value:e,field:r}){if(e==null)return t.jsx("span",{className:"text-muted-foreground/50 text-xs italic flex items-center justify-center",children:"—"});const n=r?.name?.toLowerCase()||"";return n==="completed"||n==="is_completed"||n==="done"||n==="is_done"?t.jsx("div",{className:"flex items-center justify-center",children:e?t.jsx("div",{className:"size-5 rounded-full bg-green-500 flex items-center justify-center",role:"img","aria-label":"Completed","data-testid":"completion-indicator",children:t.jsx(_.Check,{className:"size-3 text-white"})}):t.jsx("div",{className:"size-5 rounded-full border-2 border-muted-foreground/30",role:"img","aria-label":"Not completed","data-testid":"completion-indicator"})}):nr.has(n)&&!e?t.jsxs(d.Badge,{variant:"destructive",className:"text-xs","data-testid":"boolean-warning-badge",children:[r?.label||K(n)," — Off"]}):t.jsx("div",{className:"flex items-center justify-center",children:t.jsx(d.Checkbox,{checked:!!e,disabled:!0,className:"pointer-events-none"})})}function at({value:e,field:r}){if(!e)return t.jsx("span",{className:"text-muted-foreground",children:"-"});const a=r.format||"relative",s=ee(e,a),i=typeof e=="string"?new Date(e):e,l=i instanceof Date&&!isNaN(i.getTime()),o=new Date;o.setHours(0,0,0,0);const c=l&&i<o,f=l?i.toISOString():String(e);return t.jsx("span",{className:`tabular-nums${c?" text-red-600":""}`,title:f,children:s})}function lt({value:e}){if(!e)return t.jsx("span",{className:"text-muted-foreground",children:"-"});const r=typeof e=="string"?new Date(e):e;if(isNaN(r.getTime()))return t.jsx("span",{className:"text-muted-foreground",children:"-"});const n=r.toLocaleDateString(void 0,{month:"numeric",day:"numeric",year:"numeric"}),a=r.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit",hour12:!0}).toLowerCase();return t.jsxs("span",{className:"tabular-nums text-sm whitespace-nowrap",children:[t.jsx("span",{children:n}),t.jsx("span",{className:"ml-2 text-muted-foreground",children:a})]})}const ar={critical:"red",urgent:"red",high:"orange",medium:"yellow",normal:"blue",low:"gray",none:"gray",paid:"green",completed:"green",done:"green",active:"green",approved:"green",resolved:"green",pending:"yellow",waiting:"yellow",on_hold:"yellow",shipped:"blue",in_progress:"blue",open:"blue",processing:"blue",draft:"gray",new:"gray",inactive:"gray",closed:"gray",cancelled:"red",canceled:"red",rejected:"red",failed:"red",overdue:"red",delivered:"purple",archived:"indigo"},lr={gray:"bg-gray-100 text-gray-800 border-gray-300",red:"bg-red-100 text-red-800 border-red-300",orange:"bg-orange-100 text-orange-800 border-orange-300",yellow:"bg-yellow-100 text-yellow-800 border-yellow-300",green:"bg-green-100 text-green-800 border-green-300",blue:"bg-blue-100 text-blue-800 border-blue-300",indigo:"bg-indigo-100 text-indigo-800 border-indigo-300",purple:"bg-purple-100 text-purple-800 border-purple-300",pink:"bg-pink-100 text-pink-800 border-pink-300"};function He(e,r){const n=e||(r?ar[String(r).toLowerCase().replace(/[\s-]/g,"_")]:void 0);return lr[n||""]||"bg-muted text-muted-foreground border-border"}function q({value:e,field:r}){const a=r.options||[];if(!e)return t.jsx("span",{children:"-"});if(Array.isArray(e))return t.jsx("div",{className:"flex flex-wrap gap-1",children:e.map((o,c)=>{const f=a.find(m=>m.value===o),g=f?.label||K(String(o)),p=He(f?.color,o);return t.jsx(d.Badge,{variant:"outline",className:p,children:g},c)})});const s=a.find(o=>o.value===e),i=s?.label||K(String(e)),l=He(s?.color,e);return t.jsx(d.Badge,{variant:"outline",className:l,children:i})}function it({value:e}){if(!e)return t.jsx("span",{children:"-"});const[r,n]=C.useState(!1),a=s=>{s.stopPropagation(),s.preventDefault(),navigator.clipboard.writeText(String(e)).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)}).catch(()=>{})};return t.jsxs("span",{className:"inline-flex items-center gap-1 group/email",children:[t.jsx(d.Button,{variant:"link",className:"p-0 h-auto font-normal text-blue-600 hover:text-blue-800",asChild:!0,children:t.jsx("a",{href:`mailto:${e}`,onClick:s=>s.stopPropagation(),children:e})}),t.jsx("button",{type:"button",className:"opacity-0 group-hover/email:opacity-100 transition-opacity p-0.5 rounded hover:bg-muted",onClick:a,"aria-label":"Copy email",children:r?t.jsx(_.Check,{className:"h-3 w-3 text-green-600"}):t.jsx(_.Copy,{className:"h-3 w-3 text-muted-foreground"})})]})}function ot({value:e}){return e?t.jsx(d.Button,{variant:"link",className:"p-0 h-auto font-normal text-blue-600 hover:text-blue-800",asChild:!0,children:t.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",onClick:r=>r.stopPropagation(),children:e})}):t.jsx("span",{children:"-"})}function ct({value:e}){if(!e)return t.jsx("span",{children:"-"});const[r,n]=C.useState(!1),a=s=>{s.stopPropagation(),s.preventDefault(),navigator.clipboard.writeText(String(e)).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)}).catch(()=>{})};return t.jsxs("span",{className:"inline-flex items-center gap-1 group/phone",children:[t.jsxs("a",{href:`tel:${e}`,className:"inline-flex items-center gap-1 text-blue-600 hover:text-blue-800",onClick:s=>s.stopPropagation(),children:[t.jsx(_.Phone,{className:"h-3 w-3"}),e]}),t.jsx("button",{type:"button",className:"opacity-0 group-hover/phone:opacity-100 transition-opacity p-0.5 rounded hover:bg-muted",onClick:a,"aria-label":"Copy phone number",children:r?t.jsx(_.Check,{className:"h-3 w-3 text-green-600"}):t.jsx(_.Copy,{className:"h-3 w-3 text-muted-foreground"})})]})}function dt({value:e,field:r}){if(!e)return t.jsx("span",{children:"-"});if(r.multiple,Array.isArray(e)){const s=e.length;return t.jsxs("span",{className:"text-sm text-gray-600",children:[s," ",s===1?"file":"files"]})}const a=e.name||e.original_name||"File";return t.jsx("span",{className:"text-sm truncate",children:a})}function ut({value:e}){return e?Array.isArray(e)?t.jsxs("div",{className:"flex -space-x-2",children:[e.slice(0,3).map((r,n)=>t.jsx("img",{src:r.url||"",alt:r.name||`Image ${n+1}`,className:"size-8 rounded-md border-2 border-white object-cover"},n)),e.length>3&&t.jsxs("div",{className:"size-8 rounded-md border-2 border-white bg-gray-100 flex items-center justify-center text-xs font-medium text-gray-600",children:["+",e.length-3]})]}):t.jsx("img",{src:e.url||"",alt:e.name||"Image",className:"size-10 rounded-md object-cover"}):t.jsx("span",{children:"-"})}function G({value:e,field:r}){if(e==null||e==="")return t.jsx("span",{children:"-"});const n=r.options||[],a=s=>{if(n.length>0){const i=n.find(l=>String(l.value)===String(s));if(i)return i.label}return String(s)};if(Array.isArray(e))return t.jsx("div",{className:"flex flex-wrap gap-1",children:e.map((s,i)=>{let l;return s!=null&&typeof s=="object"?l=s.name||s.label||s._id||String(s):l=a(s),t.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-gray-100 text-gray-800",children:l},i)})});if(typeof e=="object"&&e!==null){const s=e.name||e.label||e._id||"[Object]";return t.jsx("span",{className:"truncate",children:s})}return t.jsx("span",{className:"truncate",children:a(e)})}function ne({value:e}){return t.jsx("span",{className:"text-gray-700 font-mono text-sm",children:e!=null?String(e):"-"})}function J({value:e}){if(!e)return t.jsx("span",{children:"-"});if(typeof e!="object")return t.jsx("span",{className:"truncate",children:String(e)});if(Array.isArray(e))return t.jsxs("div",{className:"flex -space-x-2",children:[e.slice(0,3).map((a,s)=>{if(typeof a!="object"||a===null)return t.jsx("span",{className:"truncate text-sm",children:String(a)},s);const i=a.name||a.username||"User",l=i.split(" ").map(o=>o[0]).join("").toUpperCase().slice(0,2);return t.jsx(d.Avatar,{className:"size-8 border-2 border-white",title:i,children:t.jsx(d.AvatarFallback,{className:"bg-blue-500 text-white text-xs",children:l})},s)}),e.length>3&&t.jsx(d.Avatar,{className:"size-8 border-2 border-white",children:t.jsxs(d.AvatarFallback,{className:"bg-gray-200 text-gray-600 text-xs",children:["+",e.length-3]})})]});const r=e.name||e.username||"User",n=r.split(" ").map(a=>a[0]).join("").toUpperCase().slice(0,2);return t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(d.Avatar,{className:"size-8",children:t.jsx(d.AvatarFallback,{className:"bg-blue-500 text-white text-xs",children:n})}),t.jsx("span",{className:"truncate",children:r})]})}const ae=new Map;function M(e,r){ae.set(e,r)}function ir(e){return ae.has(e)?ae.get(e):{text:E,textarea:E,markdown:E,html:E,number:tt,currency:rt,percent:st,boolean:nt,date:at,datetime:lt,time:E,select:q,status:q,lookup:G,master_detail:G,email:it,url:ot,phone:ct,file:dt,image:ut,formula:ne,summary:ne,auto_number:E,user:J,owner:J,password:()=>t.jsx("span",{children:"••••••"}),location:E,object:()=>t.jsx("span",{className:"text-gray-500 italic",children:"[Object]"}),vector:()=>t.jsx("span",{className:"text-gray-500 italic",children:"[Vector]"}),grid:()=>t.jsx("span",{className:"text-gray-500 italic",children:"[Grid]"})}[e]||E}M("lookup",G);M("master_detail",G);M("select",q);M("status",q);M("user",J);M("owner",J);function or(e){return{text:"field:text",textarea:"field:textarea",markdown:"field:markdown",html:"field:html",number:"field:number",currency:"field:currency",percent:"field:percent",date:"field:date",datetime:"field:datetime",time:"field:time",boolean:"field:boolean",select:"field:select",lookup:"field:lookup",master_detail:"field:master_detail",email:"field:email",phone:"field:phone",url:"field:url",file:"field:file",image:"field:image",password:"field:password",location:"field:location",formula:"field:formula",summary:"field:summary",auto_number:"field:auto_number"}[e]||"field:text"}function cr(e){if(e<0||!Number.isFinite(e)||e===0)return"0 B";const r=["B","KB","MB","GB","TB"];let n=e,a=0;for(;n>=1024&&a<r.length-1;)n/=1024,a++;return`${n.toFixed(a>0?1:0)} ${r[a]}`}function dr(e){const r={};return e.required&&(r.required=typeof e.required_message=="string"?e.required_message:`${e.label||e.name} is required`),e.min_length&&(r.minLength={value:e.min_length,message:e.min_length_message||`Minimum length is ${e.min_length} characters`}),e.max_length&&(r.maxLength={value:e.max_length,message:e.max_length_message||`Maximum length is ${e.max_length} characters`}),e.min!==void 0&&(r.min={value:e.min,message:e.min_message||`Minimum value is ${e.min}`}),e.max!==void 0&&(r.max={value:e.max,message:e.max_message||`Maximum value is ${e.max}`}),e.pattern&&(r.pattern={value:typeof e.pattern=="string"?new RegExp(e.pattern):e.pattern,message:e.pattern_message||"Invalid format"}),e.type==="email"&&(r.pattern={value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:"Please enter a valid email address"}),e.type==="url"&&(r.pattern={value:/^https?:\/\/.+/,message:"Please enter a valid URL"}),e.validate&&(r.validate=e.validate),Object.keys(r).length>0?r:void 0}function le(e,r){if(!e)return!0;if(e.field&&e.value!==void 0){const n=r[e.field];if(e.operator==="="||e.operator==="==")return n===e.value;if(e.operator==="!=")return n!==e.value;if(e.operator===">")return n>e.value;if(e.operator===">=")return n>=e.value;if(e.operator==="<")return n<e.value;if(e.operator==="<=")return n<=e.value;if(e.operator==="in")return Array.isArray(e.value)&&e.value.includes(n)}return e.and&&Array.isArray(e.and)?e.and.every(n=>le(n,r)):e.or&&Array.isArray(e.or)?e.or.some(n=>le(n,r)):!0}function N(e){const r=({schema:n,className:a,value:s,...i})=>{const[l,o]=C.useState(s??n?.value??""),c={name:n?.name||"field",label:n?.label,type:n?.type,placeholder:n?.placeholder,required:n?.required,readonly:n?.readonly||n?.readOnly,help:n?.help,description:n?.description,defaultValue:n?.defaultValue||n?.value,...n},f=C.useCallback(p=>{o(p),i.onChange&&i.onChange(p)},[i]),g=n?.readonly||n?.readOnly||!1;return t.jsxs("div",{className:"grid w-full items-center gap-1.5","data-obj-id":n?.id,"data-obj-type":n?.type,children:[n?.label&&t.jsx("label",{htmlFor:n.id,className:n.required?"after:content-['*'] after:ml-0.5 after:text-red-500":"",children:n.label}),t.jsx(e,{value:l,onChange:f,field:c,readonly:g,className:a}),n?.description&&t.jsx("p",{className:"text-sm text-gray-500",children:n.description})]})};return r.displayName=`FieldRenderer(${e.displayName||e.name||"Component"})`,r}const mt={text:()=>Promise.resolve().then(()=>yt).then(e=>({default:e.TextField})),textarea:()=>Promise.resolve().then(()=>Pt).then(e=>({default:e.TextAreaField})),number:()=>Promise.resolve().then(()=>Nt).then(e=>({default:e.NumberField})),boolean:()=>Promise.resolve().then(()=>vt).then(e=>({default:e.BooleanField})),select:()=>Promise.resolve().then(()=>Ft).then(e=>({default:e.SelectField})),date:()=>Promise.resolve().then(()=>_t).then(e=>({default:e.DateField})),datetime:()=>Promise.resolve().then(()=>kt).then(e=>({default:e.DateTimeField})),time:()=>Promise.resolve().then(()=>At).then(e=>({default:e.TimeField})),email:()=>Promise.resolve().then(()=>Ct).then(e=>({default:e.EmailField})),phone:()=>Promise.resolve().then(()=>wt).then(e=>({default:e.PhoneField})),url:()=>Promise.resolve().then(()=>St).then(e=>({default:e.UrlField})),currency:()=>Promise.resolve().then(()=>Tt).then(e=>({default:e.CurrencyField})),percent:()=>Promise.resolve().then(()=>$t).then(e=>({default:e.PercentField})),password:()=>Promise.resolve().then(()=>Et).then(e=>({default:e.PasswordField})),markdown:()=>Promise.resolve().then(()=>Qe).then(e=>({default:e.RichTextField})),html:()=>Promise.resolve().then(()=>Qe).then(e=>({default:e.RichTextField})),lookup:()=>Promise.resolve().then(()=>Ot).then(e=>({default:e.LookupField})),master_detail:()=>Promise.resolve().then(()=>er).then(e=>({default:e.MasterDetailField})),file:()=>Promise.resolve().then(()=>zt).then(e=>({default:e.FileField})),image:()=>Promise.resolve().then(()=>Dt).then(e=>({default:e.ImageField})),location:()=>Promise.resolve().then(()=>Mt).then(e=>({default:e.LocationField})),formula:()=>Promise.resolve().then(()=>It).then(e=>({default:e.FormulaField})),summary:()=>Promise.resolve().then(()=>Lt).then(e=>({default:e.SummaryField})),auto_number:()=>Promise.resolve().then(()=>Ut).then(e=>({default:e.AutoNumberField})),user:()=>Promise.resolve().then(()=>Xe).then(e=>({default:e.UserField})),owner:()=>Promise.resolve().then(()=>Xe).then(e=>({default:e.UserField})),object:()=>Promise.resolve().then(()=>Bt).then(e=>({default:e.ObjectField})),vector:()=>Promise.resolve().then(()=>Vt).then(e=>({default:e.VectorField})),grid:()=>Promise.resolve().then(()=>Yt).then(e=>({default:e.GridField})),color:()=>Promise.resolve().then(()=>qt).then(e=>({default:e.ColorField})),slider:()=>Promise.resolve().then(()=>Gt).then(e=>({default:e.SliderField})),rating:()=>Promise.resolve().then(()=>Jt).then(e=>({default:e.RatingField})),code:()=>Promise.resolve().then(()=>Wt).then(e=>({default:e.CodeField})),avatar:()=>Promise.resolve().then(()=>Qt).then(e=>({default:e.AvatarField})),address:()=>Promise.resolve().then(()=>Xt).then(e=>({default:e.AddressField})),geolocation:()=>Promise.resolve().then(()=>Ht).then(e=>({default:e.GeolocationField})),signature:()=>Promise.resolve().then(()=>Zt).then(e=>({default:e.SignatureField})),qrcode:()=>Promise.resolve().then(()=>Kt).then(e=>({default:e.QRCodeField}))};function ft(e){const r=mt[e];if(!r){console.warn(`Unknown field type: ${e}`);return}const n=C.lazy(r);b.ComponentRegistry.register(e,n,{namespace:"field"})}function pt(){Object.keys(mt).forEach(e=>{ft(e)})}function ur(){b.ComponentRegistry.register("text",N(ie),{namespace:"field"}),b.ComponentRegistry.register("textarea",N(ge),{namespace:"field"}),b.ComponentRegistry.register("number",N(oe),{namespace:"field"}),b.ComponentRegistry.register("boolean",N(ce),{namespace:"field"}),b.ComponentRegistry.register("select",N(de),{namespace:"field"}),b.ComponentRegistry.register("date",N(ue),{namespace:"field"}),b.ComponentRegistry.register("datetime",N(be),{namespace:"field"}),b.ComponentRegistry.register("time",N(je),{namespace:"field"}),b.ComponentRegistry.register("email",N(me),{namespace:"field"}),b.ComponentRegistry.register("phone",N(fe),{namespace:"field"}),b.ComponentRegistry.register("url",N(pe),{namespace:"field"}),b.ComponentRegistry.register("currency",N(xe),{namespace:"field"}),b.ComponentRegistry.register("percent",N(ye),{namespace:"field"}),b.ComponentRegistry.register("password",N(Ne),{namespace:"field"}),b.ComponentRegistry.register("markdown",N(H),{namespace:"field"}),b.ComponentRegistry.register("html",N(H),{namespace:"field"}),b.ComponentRegistry.register("lookup",N(he),{namespace:"field"}),b.ComponentRegistry.register("master_detail",N(Le),{namespace:"field"}),b.ComponentRegistry.register("file",N(ve),{namespace:"field"}),b.ComponentRegistry.register("image",N(Fe),{namespace:"field"}),b.ComponentRegistry.register("location",N(_e),{namespace:"field"}),b.ComponentRegistry.register("formula",N(Ce),{namespace:"field"}),b.ComponentRegistry.register("summary",N(we),{namespace:"field"}),b.ComponentRegistry.register("auto_number",N(Se),{namespace:"field"}),b.ComponentRegistry.register("user",N(Z),{namespace:"field"}),b.ComponentRegistry.register("owner",N(Z),{namespace:"field"}),b.ComponentRegistry.register("object",N(Re),{namespace:"field"}),b.ComponentRegistry.register("vector",N(Te),{namespace:"field"}),b.ComponentRegistry.register("grid",N(Pe),{namespace:"field"}),b.ComponentRegistry.register("color",N(Oe),{namespace:"field"}),b.ComponentRegistry.register("slider",N(ke),{namespace:"field"}),b.ComponentRegistry.register("rating",N(Ae),{namespace:"field"}),b.ComponentRegistry.register("code",N($e),{namespace:"field"}),b.ComponentRegistry.register("avatar",N(Ee),{namespace:"field"}),b.ComponentRegistry.register("address",N(ze),{namespace:"field"}),b.ComponentRegistry.register("geolocation",N(De),{namespace:"field"}),b.ComponentRegistry.register("signature",N(Me),{namespace:"field"}),b.ComponentRegistry.register("qrcode",N(Ie),{namespace:"field"})}pt();exports.AddressField=ze;exports.AutoNumberField=Se;exports.AvatarField=Ee;exports.BooleanCellRenderer=nt;exports.BooleanField=ce;exports.CodeField=$e;exports.ColorField=Oe;exports.CurrencyCellRenderer=rt;exports.CurrencyField=xe;exports.DateCellRenderer=at;exports.DateField=ue;exports.DateTimeCellRenderer=lt;exports.DateTimeField=be;exports.EmailCellRenderer=it;exports.EmailField=me;exports.FileCellRenderer=dt;exports.FileField=ve;exports.FormulaCellRenderer=ne;exports.FormulaField=Ce;exports.GeolocationField=De;exports.GridField=Pe;exports.ImageCellRenderer=ut;exports.ImageField=Fe;exports.LocationField=_e;exports.LookupCellRenderer=G;exports.LookupField=he;exports.MasterDetailField=Le;exports.NumberCellRenderer=tt;exports.NumberField=oe;exports.ObjectField=Re;exports.PasswordField=Ne;exports.PercentCellRenderer=st;exports.PercentField=ye;exports.PhoneCellRenderer=ct;exports.PhoneField=fe;exports.QRCodeField=Ie;exports.RatingField=Ae;exports.RichTextField=H;exports.SelectCellRenderer=q;exports.SelectField=de;exports.SignatureField=Me;exports.SliderField=ke;exports.SummaryField=we;exports.TextAreaField=ge;exports.TextCellRenderer=E;exports.TextField=ie;exports.TimeField=je;exports.UrlCellRenderer=ot;exports.UrlField=pe;exports.UserCellRenderer=J;exports.UserField=Z;exports.VectorField=Te;exports.buildValidationRules=dr;exports.evaluateCondition=le;exports.formatCompactCurrency=tr;exports.formatCurrency=Ze;exports.formatDate=ee;exports.formatDateTime=rr;exports.formatFileSize=cr;exports.formatPercent=Ke;exports.formatRelativeDate=et;exports.getCellRenderer=ir;exports.humanizeLabel=K;exports.mapFieldTypeToFormType=or;exports.registerAllFields=pt;exports.registerField=ft;exports.registerFieldRenderer=M;exports.registerFields=ur;
|