@arudovwen/form-builder-react 1.5.3 → 1.5.4
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/form-builder.es.js
CHANGED
|
@@ -3761,7 +3761,7 @@ const ts = () => /* @__PURE__ */ n.jsx("blockquote", { className: "bg-gray-100 p
|
|
|
3761
3761
|
"a",
|
|
3762
3762
|
{
|
|
3763
3763
|
download: !0,
|
|
3764
|
-
href: a === "dataGrid" ? "/
|
|
3764
|
+
href: a === "dataGrid" ? "https://res.cloudinary.com/arudovwen-me/raw/upload/v1775419737/table_sheet_bu7l6g.xlsx" : "https://res.cloudinary.com/arudovwen-me/raw/upload/v1775419737/list_sheet_1_pi6bwv.xlsx",
|
|
3765
3765
|
style: { color: (t == null ? void 0 : t.buttonColor) || "#333" },
|
|
3766
3766
|
className: "text-xs text-gray-600 mb-2 cursor-pointer font-medium",
|
|
3767
3767
|
children: "Download Sample File"
|
package/dist/form-builder.umd.js
CHANGED
|
@@ -45,7 +45,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
45
45
|
{ "label": "Option 1", "value": "1" },
|
|
46
46
|
{ "label": "Option 2", "value": "2" }
|
|
47
47
|
]
|
|
48
|
-
}`})})]})]})}),vn=e=>String(e).toLowerCase().trim().replace(/[\s-]+/g,"_").replace(/[^a-z0-9_]/g,""),vi=e=>e.map(n=>{var o;return{...n,value:n.value!==void 0&&String(n.value).trim()!==""?n.value:vn((o=n.label)!=null?o:"")}}),pi=e=>e.map(n=>{var o;return{...n,field:n.field!==void 0&&String(n.field).trim()!==""?n.field:vn((o=n.headerName)!=null?o:"")}}),pn=({setValue:e,name:n,isFloating:o,label:s,type:a})=>{const[t,l]=m.useState(""),r=ve("config"),d=u=>{const c=u.target.files[0];if(!c)return;l(c.name);const p=new FileReader;c.name.endsWith(".csv")?(p.onload=b=>{const g=b.target.result,f=Gn.parse(g,{header:!0});e(n,(a==="dataGrid"?pi:vi)(f.data))},p.readAsText(c)):c.name.endsWith(".xlsx")||c.name.endsWith(".xls")?(p.onload=b=>{const g=new Uint8Array(b.target.result),f=Bi.read(g,{type:"array"}),w=f.SheetNames[0],x=f.Sheets[w],h=Bi.utils.sheet_to_json(x);e(n,(a==="dataGrid"?pi:vi)(h))},p.readAsArrayBuffer(c)):fe.toast.error("Unsupported file type. Please upload a CSV or Excel file.")};return i.jsxs("div",{children:[i.jsxs("div",{className:"relative",children:[i.jsx("label",{className:"block text-sm font-medium text-[#344054] font-onest mb-1.5",children:s}),i.jsx("input",{type:"file",accept:".csv,.xlsx,.xls",onChange:d,className:"mb-4 field-control file:bg-gray-600 file:text-white file:text-sm file:rounded file:border-gray-600 file:outline-none"}),t&&i.jsxs("p",{className:"text-xs text-gray-600 mb-2",children:["Uploaded: ",t]})]}),i.jsx("a",{download:!0,href:a==="dataGrid"?"/
|
|
48
|
+
}`})})]})]})}),vn=e=>String(e).toLowerCase().trim().replace(/[\s-]+/g,"_").replace(/[^a-z0-9_]/g,""),vi=e=>e.map(n=>{var o;return{...n,value:n.value!==void 0&&String(n.value).trim()!==""?n.value:vn((o=n.label)!=null?o:"")}}),pi=e=>e.map(n=>{var o;return{...n,field:n.field!==void 0&&String(n.field).trim()!==""?n.field:vn((o=n.headerName)!=null?o:"")}}),pn=({setValue:e,name:n,isFloating:o,label:s,type:a})=>{const[t,l]=m.useState(""),r=ve("config"),d=u=>{const c=u.target.files[0];if(!c)return;l(c.name);const p=new FileReader;c.name.endsWith(".csv")?(p.onload=b=>{const g=b.target.result,f=Gn.parse(g,{header:!0});e(n,(a==="dataGrid"?pi:vi)(f.data))},p.readAsText(c)):c.name.endsWith(".xlsx")||c.name.endsWith(".xls")?(p.onload=b=>{const g=new Uint8Array(b.target.result),f=Bi.read(g,{type:"array"}),w=f.SheetNames[0],x=f.Sheets[w],h=Bi.utils.sheet_to_json(x);e(n,(a==="dataGrid"?pi:vi)(h))},p.readAsArrayBuffer(c)):fe.toast.error("Unsupported file type. Please upload a CSV or Excel file.")};return i.jsxs("div",{children:[i.jsxs("div",{className:"relative",children:[i.jsx("label",{className:"block text-sm font-medium text-[#344054] font-onest mb-1.5",children:s}),i.jsx("input",{type:"file",accept:".csv,.xlsx,.xls",onChange:d,className:"mb-4 field-control file:bg-gray-600 file:text-white file:text-sm file:rounded file:border-gray-600 file:outline-none"}),t&&i.jsxs("p",{className:"text-xs text-gray-600 mb-2",children:["Uploaded: ",t]})]}),i.jsx("a",{download:!0,href:a==="dataGrid"?"https://res.cloudinary.com/arudovwen-me/raw/upload/v1775419737/table_sheet_bu7l6g.xlsx":"https://res.cloudinary.com/arudovwen-me/raw/upload/v1775419737/list_sheet_1_pi6bwv.xlsx",style:{color:(r==null?void 0:r.buttonColor)||"#333"},className:"text-xs text-gray-600 mb-2 cursor-pointer font-medium",children:"Download Sample File"})]})},ka=()=>i.jsx("blockquote",{className:"bg-gray-100 p-4 rounded-md text-gray-700 text-sm space-y-3",children:i.jsxs("ul",{className:"list-disc list-inside space-y-1",children:[i.jsxs("li",{children:[i.jsx("strong",{children:"Method:"})," ",i.jsx("code",{children:"GET"})]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Response format:"}),i.jsx("pre",{className:"bg-white p-2 mt-1 rounded-md overflow-auto text-xs",children:i.jsx("code",{children:`{
|
|
49
49
|
"data": [
|
|
50
50
|
{ "field": "Name", "headerName": "name", editable:true },
|
|
51
51
|
]
|