@kbgarcia8/react-dynamic-form 1.1.1 → 1.1.2
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Input/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,UAAU,EAAgB,MAAM,yBAAyB,CAAC;AAExE,QAAA,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Input/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,UAAU,EAAgB,MAAM,yBAAyB,CAAC;AAExE,QAAA,MAAM,KAAK,2GAsDT,CAAC;AAEH,eAAe,KAAK,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),v=require("react"),c=require("styled-components"),n={fonts:{secondary:"Raleway",tertiary:"Lato",fallback:"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif"},fontWeight:{light:300,medium:500,bold:700,bolder:900},fontSize:{xsmall:"0.75rem"},spacing:{xxxsmall:"0.25rem",xxsmall:"0.375rem",xsmall:"0.5rem",small:"0.75rem",medium:"1.25rem"},borderRadius:{xsmall:"0.125rem",small:"0.25rem",xlarge:"2rem"},borderThickness:{thin:"0.0625rem",light:"0.125rem"}},V=c.button`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
display: flex;
|
|
40
40
|
align-items: center;
|
|
41
41
|
justify-content: center;
|
|
42
|
-
`,$=({onClick:t,id:o,buttonType:i,source:s,svg:r,alt:d="alt-button-icon",text:
|
|
42
|
+
`,$=({onClick:t,id:o,buttonType:i,source:s,svg:r,alt:d="alt-button-icon",text:m="",className:l="",dataAttributes:b={}})=>{const g=b?Object.fromEntries(Object.entries(b).map(([u,f])=>[`data-${u}`,f])):{};return e.jsx(V,{onClick:t,id:o,type:i,className:l,...g,children:e.jsxs(X,{className:"button-icon-text-space",children:[s?e.jsx(Y,{src:s,alt:d}):r||"",m&&e.jsx(Z,{id:o,children:m})]})})},_=c.div`
|
|
43
43
|
display: flex;
|
|
44
44
|
flex-direction: column;
|
|
45
45
|
align-items: left;
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
align-items: center;
|
|
76
76
|
`,ae=c.span`
|
|
77
77
|
font-weight: ${n.fontWeight.light};
|
|
78
|
-
`,P=({htmlFor:t,textLabel:o,additionalInfo:i,$labelFlexDirection:s,source:r,svg:d,className:
|
|
78
|
+
`,P=({htmlFor:t,textLabel:o,additionalInfo:i,$labelFlexDirection:s,source:r,svg:d,className:m,children:l})=>e.jsxs(ee,{htmlFor:t,className:m,$labelFlexDirection:s,children:[(r||d)&&e.jsx(ne,{className:"label-icon-container",children:r?e.jsx("img",{src:r,alt:`${t}-label-icon`}):d||""}),e.jsx(te,{className:"main-label",children:o}),i&&e.jsx(ae,{className:"additional-info",children:i}),l]}),W=c.input`
|
|
79
79
|
display: flex;
|
|
80
80
|
place-content: center;
|
|
81
81
|
font-family: ${n.fonts.secondary}, ${n.fonts.fallback};
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
max-width: 100%;
|
|
106
106
|
resize: none;
|
|
107
107
|
overflow-y: auto;
|
|
108
|
-
`,
|
|
108
|
+
`,z=v.forwardRef((t,o)=>{const{type:i,id:s,onChange:r,isRequired:d,dataAttributes:m,disabled:l,className:b}=t;if(i==="textarea"){const{rows:j=5,cols:N=30,value:T,...A}=t;return e.jsx(oe,{id:s,onChange:r,value:T,rows:j,cols:N,...m,className:b,ref:o,disabled:l,required:d})}if(i==="radio"||i==="checkbox"){const{checked:j,...N}=t;return e.jsx(W,{ref:o,type:"checkbox",id:s,checked:j,onChange:r,disabled:l,className:b,...m})}const g=t,{value:u,pattern:f,placeholderText:p,...C}=g;return e.jsx(W,{id:s,name:s,placeholder:p,onChange:r,value:u,type:i,required:d,...m,className:b,ref:o,disabled:l,pattern:f})}),F=t=>{const{className:o,type:i,id:s,textLabel:r,additionalInfo:d,$labelFlexDirection:m,svg:l,labelClass:b,onChange:g,isRequired:u,dataAttributes:f,inputClass:p,ref:C,disabled:j,isEditable:N,editIcon:T,onClickEdit:A,deleteIcon:R,onClickDelete:B,idx:S,children:O}=t;return e.jsxs(_,{className:`${o} ${s.replace("#","")}-label-input-container`,children:[i!=="radio"&&i!=="checkbox"&&e.jsx(P,{htmlFor:s,textLabel:r,additionalInfo:d,$labelFlexDirection:m,svg:l,className:b}),i!=="radio"&&i!=="checkbox"&&i==="textarea"&&(()=>{const{rows:k=5,cols:w=30,value:D,...a}=t;return e.jsx(z,{id:s,name:s,type:"textarea",isRequired:u,onChange:g,value:D,rows:k,cols:w,dataAttributes:f,className:p,ref:C,disabled:j})})(),i!=="radio"&&i!=="checkbox"&&i!=="textarea"&&(()=>{const k=t,{value:w,pattern:D,placeholderText:a,...y}=k;return e.jsx(z,{id:s,name:s,placeholderText:a,onChange:g,value:w,type:i,isRequired:u,dataAttributes:f,className:p,ref:C,disabled:j,pattern:D})})(),(i==="radio"||i==="checkbox")&&(()=>{const{checked:k,...w}=t;return e.jsxs(e.Fragment,{children:[e.jsx(z,{ref:C,type:"checkbox",name:s,id:s,isRequired:u,checked:k,onChange:g,disabled:j,className:p,dataAttributes:f}),e.jsx(P,{htmlFor:s,textLabel:r,additionalInfo:d,$labelFlexDirection:m,svg:l,className:b})]})})(),N&&e.jsxs(I,{className:"input-edit-buttons",children:[e.jsx($,{id:`editable-${s}-edit-btn`,svg:T,buttonType:"button",onClick:A,className:`edit-radio-${S}`,dataAttributes:f}),e.jsx($,{id:`editable-${s}-delete-btn`,svg:R,buttonType:"button",onClick:B,className:`delete-radio-${S}`,dataAttributes:f})]}),O]})},se=c.fieldset`
|
|
109
109
|
padding: 0;
|
|
110
110
|
height: auto;
|
|
111
111
|
width: 100%;
|
|
@@ -125,11 +125,11 @@
|
|
|
125
125
|
display: flex;
|
|
126
126
|
justify-content: space-between;
|
|
127
127
|
width: 100%;
|
|
128
|
-
`,M=({legend:t,idx:o,editableInformation:i,onChangeOfEditableOption:s,onClickSaveEdit:r,onClickCancelEdit:d,onClickDeleteEntry:
|
|
128
|
+
`,M=({legend:t,idx:o,editableInformation:i,onChangeOfEditableOption:s,onClickSaveEdit:r,onClickCancelEdit:d,onClickDeleteEntry:m})=>e.jsxs(se,{className:"editable-selection-fieldset",children:[e.jsx(ie,{children:`${t} ${o+1}`}),i.map((l,b)=>e.jsx(le,{className:"editable-selection-container",children:e.jsx(z,{id:`editable-selection-${b}`,name:`editable-selection-${b}`,placeholderText:l.name.charAt(0).toUpperCase()+l.name.slice(1),onChange:s,value:l.info,type:l.type,isRequired:!0,className:"editable-selection",dataAttributes:{"data-index":b,"data-key":l.info}})},`${l.name}-${b}`)),e.jsxs(ce,{className:"editable-selection-button-space",children:[e.jsx($,{id:`editable-selection-${o}-submit`,buttonType:"submit",text:"Save",onClick:r,className:"editable-selection-btn",dataAttributes:{"data-index":o}}),e.jsx($,{id:`editable-selection-${o}-cancel`,buttonType:"button",text:"Cancel",onClick:d,className:"editable-selection-btn",dataAttributes:{"data-index":o}}),e.jsx($,{id:`editable-selection-${o}-delete`,buttonType:"button",text:"Delete",onClick:m,className:"editable-selection-btn",dataAttributes:{"data-index":o}})]})]}),re=c.div`
|
|
129
129
|
display: flex;
|
|
130
130
|
justify-content: space-between;
|
|
131
131
|
max-width: 100%;
|
|
132
|
-
`,de=({id:t,hasSubmit:o,submitText:i,handleSubmit:s,hasEdit:r,editText:d,handleEdit:
|
|
132
|
+
`,de=({id:t,hasSubmit:o,submitText:i,handleSubmit:s,hasEdit:r,editText:d,handleEdit:m,hasCancel:l,cancelText:b,handleCancel:g,hasDelete:u,deleteText:f,handleDelete:p})=>e.jsxs(re,{className:"form-main-button-container",children:[o&&e.jsx($,{id:`form-${t}-submit`,buttonType:"submit",text:i??"Submit",onClick:s,className:"submit-form-btn"}),r&&e.jsx($,{id:`form-${t}-edit`,buttonType:"button",text:d??"Edit",onClick:m,className:"edit-form-btn"}),l&&e.jsx($,{id:`form-${t}-cancel`,buttonType:"button",text:b??"Cancel",onClick:g,className:"cancel-form-btn"}),u&&e.jsx($,{id:`form-${t}-delete`,buttonType:"button",text:f??"Delete",onClick:p,className:"delete-form-btn"})]}),U=c.legend`
|
|
133
133
|
font-size: ${n.spacing.medium};
|
|
134
134
|
font-weight: 500;
|
|
135
135
|
margin-bottom: ${n.spacing.small};
|
|
@@ -162,10 +162,10 @@
|
|
|
162
162
|
display: flex;
|
|
163
163
|
justify-content: space-between;
|
|
164
164
|
width: 100%;
|
|
165
|
-
`,
|
|
165
|
+
`,xe=c.div`
|
|
166
166
|
width: 100%;
|
|
167
167
|
display: flex;
|
|
168
168
|
flex-direction: column;
|
|
169
169
|
align-items: center;
|
|
170
170
|
justify-content: center;
|
|
171
|
-
`,
|
|
171
|
+
`,be=({fieldsets:t=null,legendText:o,isExpandable:i,id:s,formInputs:r,labelAndInputContainerClass:d,labelClass:m,inputClass:l,handleEditableInputEntryChange:b,handleAddingInputEntry:g,hasSubmit:u=!1,hasCancel:f=!1,hasDelete:p=!1,hasEdit:C=!1,submitText:j,handleSubmitForm:N,handleSubmit:T,cancelText:A,handleCancel:R,deleteText:B,handleDelete:S,editText:O,handleEdit:k,className:w,children:D})=>e.jsxs(me,{id:`${s}-form`,className:w,onSubmit:N,children:[t?t.map((a,y)=>e.jsxs(G,{children:[e.jsxs(H,{id:`${s}-form-fieldset-${y}`,className:"form-fieldset",children:[a.legend&&e.jsx(U,{children:a.legend}),a.inputs.length!==0?a.inputs.map((h,E)=>e.jsxs(v.Fragment,{children:[h.type==="textarea"&&e.jsx(F,{...h,id:h.id??`${a.legend}-input`,labelClass:m,inputClass:l,idx:E,className:d}),(h.type==="radio"||h.type==="checkbox")&&e.jsx(F,{...h,id:h.id??`${a.legend}-input`,labelClass:m,inputClass:l,idx:E,className:d}),h.type!=="textarea"&&h.type!=="radio"&&h.type!=="checkbox"&&e.jsx(F,{...h,id:h.id??`${a.legend}-input`,labelClass:m,inputClass:l,idx:E,className:d}),h.isEditable&&h.editing&&e.jsx(M,{legend:`${a.legend} ${E+1}`,idx:E,editableInformation:h?.editableInformation,onChangeOfEditableOption:b,onClickSaveEdit:h?.onClickSave,onClickCancelEdit:h?.onClickCancel,onClickDeleteEntry:h?.onClickDelete})]},`form-${s}-${E}`)):a.isExpandable?e.jsx(J,{children:`No entry yet on ${a.legend}. Click "+" button to add entry.`}):""]}),a.isExpandable&&e.jsx(K,{className:"add-input-button-space",children:e.jsx($,{id:`expand-${a.legend}-inputs`,buttonType:"button",text:"+",onClick:g,className:"add-input-entry"})})]},`${a.legend}-${y}`)):e.jsxs(G,{children:[e.jsxs(H,{id:`${s}-form-fieldset`,className:"form-fieldset",children:[o&&e.jsx(U,{children:o}),!t&&r&&r.length!==0?r.map((a,y)=>e.jsxs(v.Fragment,{children:[a.type==="textarea"&&e.jsx(F,{...a,id:a.id??`${o}-input`,labelClass:m,inputClass:l,idx:y,className:d}),(a.type==="radio"||a.type==="checkbox")&&e.jsx(F,{...a,id:a.id??`${o}-input`,labelClass:m,inputClass:l,idx:y,className:d}),a.type!=="textarea"&&a.type!=="radio"&&a.type!=="checkbox"&&e.jsx(F,{...a,id:a.id??`${o}-input`,labelClass:m,inputClass:l,idx:y,className:d}),a.isEditable&&a.editing&&e.jsx(M,{legend:`${o} ${y+1}`,idx:y,editableInformation:a?.editableInformation,onChangeOfEditableOption:b,onClickSaveEdit:a?.onClickSave,onClickCancelEdit:a?.onClickEdit,onClickDeleteEntry:a?.onClickDelete})]},`form-${s}-${y}`)):i?e.jsx(J,{children:`No entry yet on ${o}. Please click "+" button to add`}):""]}),i&&e.jsx(K,{className:"add-input-button-space",children:e.jsx($,{id:`expand-${o}-inputs`,buttonType:"button",text:"+",onClick:g,className:"add-input-entry"})})]}),e.jsx(de,{id:s,hasSubmit:u,submitText:j,handleSubmit:T,hasEdit:C,editText:O,handleEdit:k,hasCancel:f,cancelText:A,handleCancel:R,hasDelete:p,deleteText:B,handleDelete:S}),e.jsx(xe,{className:"children-container",children:D})]}),he=t=>{const o=/^#([0-9A-Fa-f]{3}){1,2}$/,i=/^rgb(a)?\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}(?:\s*,\s*(0|1|0?\.\d+))?\s*\)$/;return o.test(t)||i.test(t)||CSS.supports("color",t)},x=t=>{if(!he(t))throw new Error(`Invalid color: ${t}`);return t},fe={mobile:"320px",tablet:"768px",desktop:"992px",largeDesktop:"1200px",largerDesktop:"1400px"},L={name:"light",colors:{text:x("#333446"),bg:x("#EEEEEE"),blue:x("#7F8CAA"),blue2:x("#80A6FF"),teal:x("#5b8280ff"),teal2:x("#AEEAE7"),gray:x("#AEAEAE"),information:x("#202234"),success:x("#123524"),warning:x("#F2C265"),error:x("#990000")}},Q={name:"dark",colors:{bg:x("#333446"),text:x("#EEEEEE"),blue:x("#80A6FF"),blue2:x("#7F8CAA"),teal:x("#AEEAE7"),teal2:x("#5b8280ff"),gray:x("#D0D0DD"),information:x("#C9E6F0"),success:x("#9EDF9C"),warning:x("#FCFFC1"),error:x("#FAD4D4")}},q=v.createContext(void 0),ge=({children:t})=>{const[o,i]=v.useState(L),s=()=>{i(r=>r===L?Q:L)};return e.jsx(q.Provider,{value:{currentTheme:o,toggleTheme:s},children:e.jsx(c.ThemeProvider,{theme:o,children:t})})},ue=()=>v.useContext(q);exports.DynamicForm=be;exports.ThemeContext=q;exports.ThemeContextProvider=ge;exports.breakpoints=fe;exports.darkTheme=Q;exports.lightTheme=L;exports.useTheme=ue;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as t, jsxs as g, Fragment as V } from "react/jsx-runtime";
|
|
2
2
|
import W, { forwardRef as X, createContext as Y, useState as Z, useContext as _ } from "react";
|
|
3
3
|
import s, { ThemeProvider as I } from "styled-components";
|
|
4
|
-
const
|
|
4
|
+
const n = {
|
|
5
5
|
fonts: {
|
|
6
6
|
secondary: "Raleway",
|
|
7
7
|
tertiary: "Lato",
|
|
@@ -38,9 +38,9 @@ const a = {
|
|
|
38
38
|
justify-content: center;
|
|
39
39
|
background-color: ${({ theme: e }) => e.colors.blue || "blue"};
|
|
40
40
|
color: ${({ theme: e }) => e.colors.bg || "white"};
|
|
41
|
-
border: ${
|
|
42
|
-
border-radius: ${
|
|
43
|
-
padding: ${
|
|
41
|
+
border: ${n.borderThickness.light} solid ${({ theme: e }) => e.colors.text || "black"};
|
|
42
|
+
border-radius: ${n.borderRadius.xlarge};
|
|
43
|
+
padding: ${n.spacing.xxxsmall} ${n.spacing.small};
|
|
44
44
|
margin: 0.125rem;
|
|
45
45
|
width: auto;
|
|
46
46
|
cursor: pointer;
|
|
@@ -48,7 +48,7 @@ const a = {
|
|
|
48
48
|
|
|
49
49
|
&:hover {
|
|
50
50
|
background-color: lightblue;
|
|
51
|
-
border: ${
|
|
51
|
+
border: ${n.borderThickness.light} solid gray;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
& .button-icon-text-space {
|
|
@@ -64,12 +64,12 @@ const a = {
|
|
|
64
64
|
flex-direction: row;
|
|
65
65
|
align-items: center;
|
|
66
66
|
justify-content: center;
|
|
67
|
-
`,
|
|
67
|
+
`, ne = s.img`
|
|
68
68
|
maxwidth: 100%;
|
|
69
|
-
`,
|
|
70
|
-
font-size: ${
|
|
71
|
-
font-weight: ${
|
|
72
|
-
font-family: ${
|
|
69
|
+
`, ae = s.span`
|
|
70
|
+
font-size: ${n.fontSize.xsmall};
|
|
71
|
+
font-weight: ${n.fontWeight.medium};
|
|
72
|
+
font-family: ${n.fonts.tertiary}, ${n.fonts.fallback};
|
|
73
73
|
display: flex;
|
|
74
74
|
align-items: center;
|
|
75
75
|
justify-content: center;
|
|
@@ -80,12 +80,12 @@ const a = {
|
|
|
80
80
|
source: i,
|
|
81
81
|
svg: r,
|
|
82
82
|
alt: d = "alt-button-icon",
|
|
83
|
-
text:
|
|
83
|
+
text: m = "",
|
|
84
84
|
className: c = "",
|
|
85
85
|
dataAttributes: h = {}
|
|
86
86
|
}) => {
|
|
87
|
-
const
|
|
88
|
-
Object.entries(h).map(([$,
|
|
87
|
+
const x = h ? Object.fromEntries(
|
|
88
|
+
Object.entries(h).map(([$, u]) => [`data-${$}`, u])
|
|
89
89
|
) : {};
|
|
90
90
|
return /* @__PURE__ */ t(
|
|
91
91
|
ee,
|
|
@@ -94,10 +94,10 @@ const a = {
|
|
|
94
94
|
id: o,
|
|
95
95
|
type: l,
|
|
96
96
|
className: c,
|
|
97
|
-
...
|
|
97
|
+
...x,
|
|
98
98
|
children: /* @__PURE__ */ g(te, { className: "button-icon-text-space", children: [
|
|
99
|
-
i ? /* @__PURE__ */ t(
|
|
100
|
-
|
|
99
|
+
i ? /* @__PURE__ */ t(ne, { src: i, alt: d }) : r || "",
|
|
100
|
+
m && /* @__PURE__ */ t(ae, { id: o, children: m })
|
|
101
101
|
] })
|
|
102
102
|
}
|
|
103
103
|
);
|
|
@@ -106,10 +106,10 @@ const a = {
|
|
|
106
106
|
flex-direction: column;
|
|
107
107
|
align-items: left;
|
|
108
108
|
width: 100%;
|
|
109
|
-
margin-bottom: ${
|
|
109
|
+
margin-bottom: ${n.spacing.small};
|
|
110
110
|
`, ie = s.div`
|
|
111
111
|
display: flex;
|
|
112
|
-
gap: ${
|
|
112
|
+
gap: ${n.spacing.xsmall};
|
|
113
113
|
width: auto;
|
|
114
114
|
height: auto;
|
|
115
115
|
`, le = s.label`
|
|
@@ -118,10 +118,10 @@ const a = {
|
|
|
118
118
|
justify-content:center;
|
|
119
119
|
height: auto;
|
|
120
120
|
flex-direction: ${(e) => e.$labelFlexDirection || "column"};
|
|
121
|
-
font-family: ${
|
|
122
|
-
font-size: ${
|
|
123
|
-
font-weight: ${
|
|
124
|
-
gap: ${
|
|
121
|
+
font-family: ${n.fonts.secondary}, ${n.fonts.fallback};
|
|
122
|
+
font-size: ${n.fontSize.xsmall};
|
|
123
|
+
font-weight: ${n.fontWeight.bold};
|
|
124
|
+
gap: ${n.spacing.xxsmall};
|
|
125
125
|
|
|
126
126
|
& .label-icon-container img,
|
|
127
127
|
& .label-icon-container svg {
|
|
@@ -130,13 +130,13 @@ const a = {
|
|
|
130
130
|
object-fit: contain;
|
|
131
131
|
}
|
|
132
132
|
`, ce = s.span`
|
|
133
|
-
font-weight: ${
|
|
133
|
+
font-weight: ${n.fontWeight.bolder};
|
|
134
134
|
`, se = s.div`
|
|
135
135
|
max-width: 100%;
|
|
136
136
|
display: flex;
|
|
137
137
|
align-items: center;
|
|
138
138
|
`, re = s.span`
|
|
139
|
-
font-weight: ${
|
|
139
|
+
font-weight: ${n.fontWeight.light};
|
|
140
140
|
`, P = ({
|
|
141
141
|
htmlFor: e,
|
|
142
142
|
textLabel: o,
|
|
@@ -144,9 +144,9 @@ const a = {
|
|
|
144
144
|
$labelFlexDirection: i,
|
|
145
145
|
source: r,
|
|
146
146
|
svg: d,
|
|
147
|
-
className:
|
|
147
|
+
className: m,
|
|
148
148
|
children: c
|
|
149
|
-
}) => /* @__PURE__ */ g(le, { htmlFor: e, className:
|
|
149
|
+
}) => /* @__PURE__ */ g(le, { htmlFor: e, className: m, $labelFlexDirection: i, children: [
|
|
150
150
|
(r || d) && /* @__PURE__ */ t(se, { className: "label-icon-container", children: r ? /* @__PURE__ */ t("img", { src: r, alt: `${e}-label-icon` }) : d || "" }),
|
|
151
151
|
/* @__PURE__ */ t(ce, { className: "main-label", children: o }),
|
|
152
152
|
l && /* @__PURE__ */ t(re, { className: "additional-info", children: l }),
|
|
@@ -154,48 +154,46 @@ const a = {
|
|
|
154
154
|
] }), q = s.input`
|
|
155
155
|
display: flex;
|
|
156
156
|
place-content: center;
|
|
157
|
-
font-family: ${
|
|
158
|
-
font-size: ${
|
|
157
|
+
font-family: ${n.fonts.secondary}, ${n.fonts.fallback};
|
|
158
|
+
font-size: ${n.fontSize.xsmall};
|
|
159
159
|
line-height: 1.75;
|
|
160
|
-
padding: ${
|
|
160
|
+
padding: ${n.spacing.xxxsmall} ${n.spacing.xsmall};
|
|
161
161
|
max-width: 100%;
|
|
162
162
|
height: auto;
|
|
163
163
|
background-color: #FFFFFF;
|
|
164
164
|
outline: none;
|
|
165
|
-
border: ${
|
|
166
|
-
border-radius: ${
|
|
165
|
+
border: ${n.borderThickness.thin} solid #000000;
|
|
166
|
+
border-radius: ${n.borderRadius.xsmall};
|
|
167
167
|
|
|
168
168
|
&:focus{
|
|
169
|
-
border: ${
|
|
169
|
+
border: ${n.borderThickness.thin} solid ${({ theme: e }) => e.colors.teal};
|
|
170
170
|
}
|
|
171
171
|
`, de = s.textarea`
|
|
172
172
|
display: flex;
|
|
173
173
|
place-content: center;
|
|
174
|
-
border: ${
|
|
175
|
-
border-radius: ${
|
|
174
|
+
border: ${n.borderThickness.light} solid ${({ theme: e }) => e.colors.text};
|
|
175
|
+
border-radius: ${n.borderRadius.small};
|
|
176
176
|
outline: none;
|
|
177
|
-
line-height: ${
|
|
178
|
-
padding: ${
|
|
179
|
-
font-family: ${
|
|
180
|
-
font-size: ${
|
|
177
|
+
line-height: ${n.spacing.small};
|
|
178
|
+
padding: ${n.spacing.xxxsmall};
|
|
179
|
+
font-family: ${n.fonts.secondary}, ${n.fonts.fallback};
|
|
180
|
+
font-size: ${n.fontSize.xsmall};
|
|
181
181
|
max-width: 100%;
|
|
182
182
|
resize: none;
|
|
183
183
|
overflow-y: auto;
|
|
184
|
-
`,
|
|
185
|
-
const { type: l, id: i, onChange: r, isRequired: d, dataAttributes:
|
|
186
|
-
Object.entries(b).map(([N, w]) => [`data-${N}`, w])
|
|
187
|
-
) : {};
|
|
184
|
+
`, z = X((e, o) => {
|
|
185
|
+
const { type: l, id: i, onChange: r, isRequired: d, dataAttributes: m, disabled: c, className: h } = e;
|
|
188
186
|
if (l === "textarea") {
|
|
189
|
-
const { rows: N = 5, cols:
|
|
187
|
+
const { rows: N = 5, cols: E = 30, value: D, ...S } = e;
|
|
190
188
|
return /* @__PURE__ */ t(
|
|
191
189
|
de,
|
|
192
190
|
{
|
|
193
191
|
id: i,
|
|
194
192
|
onChange: r,
|
|
195
|
-
value:
|
|
193
|
+
value: D,
|
|
196
194
|
rows: N,
|
|
197
|
-
cols:
|
|
198
|
-
...
|
|
195
|
+
cols: E,
|
|
196
|
+
...m,
|
|
199
197
|
className: h,
|
|
200
198
|
ref: o,
|
|
201
199
|
disabled: c,
|
|
@@ -204,7 +202,7 @@ const a = {
|
|
|
204
202
|
);
|
|
205
203
|
}
|
|
206
204
|
if (l === "radio" || l === "checkbox") {
|
|
207
|
-
const { checked: N, ...
|
|
205
|
+
const { checked: N, ...E } = e;
|
|
208
206
|
return /* @__PURE__ */ t(
|
|
209
207
|
q,
|
|
210
208
|
{
|
|
@@ -215,137 +213,137 @@ const a = {
|
|
|
215
213
|
onChange: r,
|
|
216
214
|
disabled: c,
|
|
217
215
|
className: h,
|
|
218
|
-
...
|
|
216
|
+
...m
|
|
219
217
|
}
|
|
220
218
|
);
|
|
221
219
|
}
|
|
222
|
-
const
|
|
220
|
+
const x = e, { value: $, pattern: u, placeholderText: k, ...C } = x;
|
|
223
221
|
return /* @__PURE__ */ t(
|
|
224
222
|
q,
|
|
225
223
|
{
|
|
226
224
|
id: i,
|
|
227
225
|
name: i,
|
|
228
|
-
placeholder:
|
|
226
|
+
placeholder: k,
|
|
229
227
|
onChange: r,
|
|
230
|
-
value:
|
|
228
|
+
value: $,
|
|
231
229
|
type: l,
|
|
232
230
|
required: d,
|
|
233
|
-
...
|
|
231
|
+
...m,
|
|
234
232
|
className: h,
|
|
235
233
|
ref: o,
|
|
236
234
|
disabled: c,
|
|
237
|
-
pattern:
|
|
235
|
+
pattern: u
|
|
238
236
|
}
|
|
239
237
|
);
|
|
240
|
-
}),
|
|
238
|
+
}), T = (e) => {
|
|
241
239
|
const {
|
|
242
240
|
className: o,
|
|
243
241
|
type: l,
|
|
244
242
|
id: i,
|
|
245
243
|
textLabel: r,
|
|
246
244
|
additionalInfo: d,
|
|
247
|
-
$labelFlexDirection:
|
|
245
|
+
$labelFlexDirection: m,
|
|
248
246
|
svg: c,
|
|
249
247
|
labelClass: h,
|
|
250
|
-
onChange:
|
|
248
|
+
onChange: x,
|
|
251
249
|
isRequired: $,
|
|
252
|
-
dataAttributes:
|
|
250
|
+
dataAttributes: u,
|
|
253
251
|
inputClass: k,
|
|
254
252
|
ref: C,
|
|
255
|
-
disabled:
|
|
256
|
-
isEditable:
|
|
257
|
-
editIcon:
|
|
258
|
-
onClickEdit:
|
|
259
|
-
deleteIcon:
|
|
253
|
+
disabled: N,
|
|
254
|
+
isEditable: E,
|
|
255
|
+
editIcon: D,
|
|
256
|
+
onClickEdit: S,
|
|
257
|
+
deleteIcon: L,
|
|
260
258
|
onClickDelete: B,
|
|
261
|
-
idx:
|
|
262
|
-
children:
|
|
259
|
+
idx: j,
|
|
260
|
+
children: R
|
|
263
261
|
} = e;
|
|
264
262
|
return /* @__PURE__ */ g(oe, { className: `${o} ${i.replace("#", "")}-label-input-container`, children: [
|
|
265
|
-
l !== "radio" && l !== "checkbox" && /* @__PURE__ */ t(P, { htmlFor: i, textLabel: r, additionalInfo: d, $labelFlexDirection:
|
|
263
|
+
l !== "radio" && l !== "checkbox" && /* @__PURE__ */ t(P, { htmlFor: i, textLabel: r, additionalInfo: d, $labelFlexDirection: m, svg: c, className: h }),
|
|
266
264
|
l !== "radio" && l !== "checkbox" && l === "textarea" && (() => {
|
|
267
|
-
const { rows:
|
|
265
|
+
const { rows: w = 5, cols: F = 30, value: A, ...a } = e;
|
|
268
266
|
return /* @__PURE__ */ t(
|
|
269
|
-
|
|
267
|
+
z,
|
|
270
268
|
{
|
|
271
269
|
id: i,
|
|
272
270
|
name: i,
|
|
273
271
|
type: "textarea",
|
|
274
272
|
isRequired: $,
|
|
275
|
-
onChange:
|
|
276
|
-
value:
|
|
277
|
-
rows:
|
|
278
|
-
cols:
|
|
279
|
-
dataAttributes:
|
|
273
|
+
onChange: x,
|
|
274
|
+
value: A,
|
|
275
|
+
rows: w,
|
|
276
|
+
cols: F,
|
|
277
|
+
dataAttributes: u,
|
|
280
278
|
className: k,
|
|
281
279
|
ref: C,
|
|
282
|
-
disabled:
|
|
280
|
+
disabled: N
|
|
283
281
|
}
|
|
284
282
|
);
|
|
285
283
|
})(),
|
|
286
284
|
l !== "radio" && l !== "checkbox" && l !== "textarea" && (() => {
|
|
287
|
-
const
|
|
285
|
+
const w = e, { value: F, pattern: A, placeholderText: a, ...p } = w;
|
|
288
286
|
return /* @__PURE__ */ t(
|
|
289
|
-
|
|
287
|
+
z,
|
|
290
288
|
{
|
|
291
289
|
id: i,
|
|
292
290
|
name: i,
|
|
293
|
-
placeholderText:
|
|
294
|
-
onChange:
|
|
295
|
-
value:
|
|
291
|
+
placeholderText: a,
|
|
292
|
+
onChange: x,
|
|
293
|
+
value: F,
|
|
296
294
|
type: l,
|
|
297
295
|
isRequired: $,
|
|
298
|
-
dataAttributes:
|
|
296
|
+
dataAttributes: u,
|
|
299
297
|
className: k,
|
|
300
298
|
ref: C,
|
|
301
|
-
disabled:
|
|
302
|
-
pattern:
|
|
299
|
+
disabled: N,
|
|
300
|
+
pattern: A
|
|
303
301
|
}
|
|
304
302
|
);
|
|
305
303
|
})(),
|
|
306
304
|
(l === "radio" || l === "checkbox") && (() => {
|
|
307
|
-
const { checked:
|
|
305
|
+
const { checked: w, ...F } = e;
|
|
308
306
|
return /* @__PURE__ */ g(V, { children: [
|
|
309
307
|
/* @__PURE__ */ t(
|
|
310
|
-
|
|
308
|
+
z,
|
|
311
309
|
{
|
|
312
310
|
ref: C,
|
|
313
311
|
type: "checkbox",
|
|
314
312
|
name: i,
|
|
315
313
|
id: i,
|
|
316
314
|
isRequired: $,
|
|
317
|
-
checked:
|
|
318
|
-
onChange:
|
|
319
|
-
disabled:
|
|
315
|
+
checked: w,
|
|
316
|
+
onChange: x,
|
|
317
|
+
disabled: N,
|
|
320
318
|
className: k,
|
|
321
|
-
dataAttributes:
|
|
319
|
+
dataAttributes: u
|
|
322
320
|
}
|
|
323
321
|
),
|
|
324
|
-
/* @__PURE__ */ t(P, { htmlFor: i, textLabel: r, additionalInfo: d, $labelFlexDirection:
|
|
322
|
+
/* @__PURE__ */ t(P, { htmlFor: i, textLabel: r, additionalInfo: d, $labelFlexDirection: m, svg: c, className: h })
|
|
325
323
|
] });
|
|
326
324
|
})(),
|
|
327
|
-
|
|
328
|
-
/* @__PURE__ */ t(y, { id: `editable-${i}-edit-btn`, svg:
|
|
329
|
-
/* @__PURE__ */ t(y, { id: `editable-${i}-delete-btn`, svg:
|
|
325
|
+
E && /* @__PURE__ */ g(ie, { className: "input-edit-buttons", children: [
|
|
326
|
+
/* @__PURE__ */ t(y, { id: `editable-${i}-edit-btn`, svg: D, buttonType: "button", onClick: S, className: `edit-radio-${j}`, dataAttributes: u }),
|
|
327
|
+
/* @__PURE__ */ t(y, { id: `editable-${i}-delete-btn`, svg: L, buttonType: "button", onClick: B, className: `delete-radio-${j}`, dataAttributes: u })
|
|
330
328
|
] }),
|
|
331
|
-
|
|
329
|
+
R
|
|
332
330
|
] });
|
|
333
331
|
}, me = s.fieldset`
|
|
334
332
|
padding: 0;
|
|
335
333
|
height: auto;
|
|
336
334
|
width: 100%;
|
|
337
335
|
`, be = s.legend`
|
|
338
|
-
font-size: ${
|
|
336
|
+
font-size: ${n.spacing.medium};
|
|
339
337
|
font-weight: 500;
|
|
340
|
-
margin: 0 auto ${
|
|
338
|
+
margin: 0 auto ${n.spacing.small} auto;
|
|
341
339
|
text-align: center;
|
|
342
|
-
font-family: ${
|
|
340
|
+
font-family: ${n.fonts.secondary}, ${n.fonts.fallback};
|
|
343
341
|
`, he = s.div`
|
|
344
342
|
display: flex;
|
|
345
343
|
flex-direction: column;
|
|
346
344
|
align-items: flex-start;
|
|
347
345
|
width: 100%;
|
|
348
|
-
margin-bottom: ${
|
|
346
|
+
margin-bottom: ${n.spacing.small};
|
|
349
347
|
`, fe = s.div`
|
|
350
348
|
display: flex;
|
|
351
349
|
justify-content: space-between;
|
|
@@ -357,11 +355,11 @@ const a = {
|
|
|
357
355
|
onChangeOfEditableOption: i,
|
|
358
356
|
onClickSaveEdit: r,
|
|
359
357
|
onClickCancelEdit: d,
|
|
360
|
-
onClickDeleteEntry:
|
|
358
|
+
onClickDeleteEntry: m
|
|
361
359
|
}) => /* @__PURE__ */ g(me, { className: "editable-selection-fieldset", children: [
|
|
362
360
|
/* @__PURE__ */ t(be, { children: `${e} ${o + 1}` }),
|
|
363
361
|
l.map((c, h) => /* @__PURE__ */ t(he, { className: "editable-selection-container", children: /* @__PURE__ */ t(
|
|
364
|
-
|
|
362
|
+
z,
|
|
365
363
|
{
|
|
366
364
|
id: `editable-selection-${h}`,
|
|
367
365
|
name: `editable-selection-${h}`,
|
|
@@ -381,7 +379,7 @@ const a = {
|
|
|
381
379
|
/* @__PURE__ */ g(fe, { className: "editable-selection-button-space", children: [
|
|
382
380
|
/* @__PURE__ */ t(y, { id: `editable-selection-${o}-submit`, buttonType: "submit", text: "Save", onClick: r, className: "editable-selection-btn", dataAttributes: { "data-index": o } }),
|
|
383
381
|
/* @__PURE__ */ t(y, { id: `editable-selection-${o}-cancel`, buttonType: "button", text: "Cancel", onClick: d, className: "editable-selection-btn", dataAttributes: { "data-index": o } }),
|
|
384
|
-
/* @__PURE__ */ t(y, { id: `editable-selection-${o}-delete`, buttonType: "button", text: "Delete", onClick:
|
|
382
|
+
/* @__PURE__ */ t(y, { id: `editable-selection-${o}-delete`, buttonType: "button", text: "Delete", onClick: m, className: "editable-selection-btn", dataAttributes: { "data-index": o } })
|
|
385
383
|
] })
|
|
386
384
|
] }), ge = s.div`
|
|
387
385
|
display: flex;
|
|
@@ -394,31 +392,31 @@ const a = {
|
|
|
394
392
|
handleSubmit: i,
|
|
395
393
|
hasEdit: r,
|
|
396
394
|
editText: d,
|
|
397
|
-
handleEdit:
|
|
395
|
+
handleEdit: m,
|
|
398
396
|
hasCancel: c,
|
|
399
397
|
cancelText: h,
|
|
400
|
-
handleCancel:
|
|
398
|
+
handleCancel: x,
|
|
401
399
|
hasDelete: $,
|
|
402
|
-
deleteText:
|
|
400
|
+
deleteText: u,
|
|
403
401
|
handleDelete: k
|
|
404
402
|
}) => /* @__PURE__ */ g(ge, { className: "form-main-button-container", children: [
|
|
405
403
|
o && /* @__PURE__ */ t(y, { id: `form-${e}-submit`, buttonType: "submit", text: l ?? "Submit", onClick: i, className: "submit-form-btn" }),
|
|
406
|
-
r && /* @__PURE__ */ t(y, { id: `form-${e}-edit`, buttonType: "button", text: d ?? "Edit", onClick:
|
|
407
|
-
c && /* @__PURE__ */ t(y, { id: `form-${e}-cancel`, buttonType: "button", text: h ?? "Cancel", onClick:
|
|
408
|
-
$ && /* @__PURE__ */ t(y, { id: `form-${e}-delete`, buttonType: "button", text:
|
|
404
|
+
r && /* @__PURE__ */ t(y, { id: `form-${e}-edit`, buttonType: "button", text: d ?? "Edit", onClick: m, className: "edit-form-btn" }),
|
|
405
|
+
c && /* @__PURE__ */ t(y, { id: `form-${e}-cancel`, buttonType: "button", text: h ?? "Cancel", onClick: x, className: "cancel-form-btn" }),
|
|
406
|
+
$ && /* @__PURE__ */ t(y, { id: `form-${e}-delete`, buttonType: "button", text: u ?? "Delete", onClick: k, className: "delete-form-btn" })
|
|
409
407
|
] }), U = s.legend`
|
|
410
|
-
font-size: ${
|
|
408
|
+
font-size: ${n.spacing.medium};
|
|
411
409
|
font-weight: 500;
|
|
412
|
-
margin-bottom: ${
|
|
410
|
+
margin-bottom: ${n.spacing.small};
|
|
413
411
|
width: auto;
|
|
414
412
|
text-align: center;
|
|
415
|
-
font-family: ${
|
|
413
|
+
font-family: ${n.fonts.secondary}, ${n.fonts.fallback};
|
|
416
414
|
`, H = s.fieldset`
|
|
417
415
|
padding: 0;
|
|
418
416
|
height: auto;
|
|
419
417
|
width: 100%;
|
|
420
418
|
`, G = s.div`
|
|
421
|
-
padding: ${
|
|
419
|
+
padding: ${n.spacing.small};
|
|
422
420
|
height: auto;
|
|
423
421
|
width: 100%;
|
|
424
422
|
`, J = s.div`
|
|
@@ -427,9 +425,9 @@ const a = {
|
|
|
427
425
|
align-items: center;
|
|
428
426
|
width: 100%;
|
|
429
427
|
height: auto;
|
|
430
|
-
font-family: ${
|
|
431
|
-
font-size: ${
|
|
432
|
-
font-weight: ${
|
|
428
|
+
font-family: ${n.fonts.tertiary}, ${n.fonts.fallback};
|
|
429
|
+
font-size: ${n.fontSize.xsmall};
|
|
430
|
+
font-weight: ${n.fontWeight.bold};
|
|
433
431
|
`, xe = s.form`
|
|
434
432
|
display: flex;
|
|
435
433
|
flex-direction: column;
|
|
@@ -456,70 +454,70 @@ const a = {
|
|
|
456
454
|
formInputs: r,
|
|
457
455
|
//* object that contains the input fields information to make it reusable
|
|
458
456
|
labelAndInputContainerClass: d,
|
|
459
|
-
labelClass:
|
|
457
|
+
labelClass: m,
|
|
460
458
|
inputClass: c,
|
|
461
459
|
handleEditableInputEntryChange: h,
|
|
462
460
|
//* handles change on editable inputs
|
|
463
|
-
handleAddingInputEntry:
|
|
461
|
+
handleAddingInputEntry: x,
|
|
464
462
|
hasSubmit: $ = !1,
|
|
465
|
-
hasCancel:
|
|
463
|
+
hasCancel: u = !1,
|
|
466
464
|
hasDelete: k = !1,
|
|
467
465
|
hasEdit: C = !1,
|
|
468
|
-
submitText:
|
|
469
|
-
handleSubmitForm:
|
|
470
|
-
handleSubmit:
|
|
471
|
-
cancelText:
|
|
472
|
-
handleCancel:
|
|
466
|
+
submitText: N,
|
|
467
|
+
handleSubmitForm: E,
|
|
468
|
+
handleSubmit: D,
|
|
469
|
+
cancelText: S,
|
|
470
|
+
handleCancel: L,
|
|
473
471
|
deleteText: B,
|
|
474
|
-
handleDelete:
|
|
475
|
-
editText:
|
|
476
|
-
handleEdit:
|
|
477
|
-
className:
|
|
478
|
-
children:
|
|
472
|
+
handleDelete: j,
|
|
473
|
+
editText: R,
|
|
474
|
+
handleEdit: w,
|
|
475
|
+
className: F,
|
|
476
|
+
children: A
|
|
479
477
|
//* if there are nodes to be inserted after submit/edit/cancel buttons usually in login or signup forms
|
|
480
|
-
}) => /* @__PURE__ */ g(xe, { id: `${i}-form`, className:
|
|
481
|
-
e ? e.map((
|
|
478
|
+
}) => /* @__PURE__ */ g(xe, { id: `${i}-form`, className: F, onSubmit: E, children: [
|
|
479
|
+
e ? e.map((a, p) => /* @__PURE__ */ g(G, { children: [
|
|
482
480
|
/* @__PURE__ */ g(H, { id: `${i}-form-fieldset-${p}`, className: "form-fieldset", children: [
|
|
483
|
-
|
|
484
|
-
|
|
481
|
+
a.legend && /* @__PURE__ */ t(U, { children: a.legend }),
|
|
482
|
+
a.inputs.length !== 0 ? a.inputs.map((f, v) => /* @__PURE__ */ g(W.Fragment, { children: [
|
|
485
483
|
f.type === "textarea" && /* @__PURE__ */ t(
|
|
486
|
-
|
|
484
|
+
T,
|
|
487
485
|
{
|
|
488
486
|
...f,
|
|
489
|
-
id: f.id ?? `${
|
|
490
|
-
labelClass:
|
|
487
|
+
id: f.id ?? `${a.legend}-input`,
|
|
488
|
+
labelClass: m,
|
|
491
489
|
inputClass: c,
|
|
492
|
-
idx:
|
|
490
|
+
idx: v,
|
|
493
491
|
className: d
|
|
494
492
|
}
|
|
495
493
|
),
|
|
496
494
|
(f.type === "radio" || f.type === "checkbox") && /* @__PURE__ */ t(
|
|
497
|
-
|
|
495
|
+
T,
|
|
498
496
|
{
|
|
499
497
|
...f,
|
|
500
|
-
id: f.id ?? `${
|
|
501
|
-
labelClass:
|
|
498
|
+
id: f.id ?? `${a.legend}-input`,
|
|
499
|
+
labelClass: m,
|
|
502
500
|
inputClass: c,
|
|
503
|
-
idx:
|
|
501
|
+
idx: v,
|
|
504
502
|
className: d
|
|
505
503
|
}
|
|
506
504
|
),
|
|
507
505
|
f.type !== "textarea" && f.type !== "radio" && f.type !== "checkbox" && /* @__PURE__ */ t(
|
|
508
|
-
|
|
506
|
+
T,
|
|
509
507
|
{
|
|
510
508
|
...f,
|
|
511
|
-
id: f.id ?? `${
|
|
512
|
-
labelClass:
|
|
509
|
+
id: f.id ?? `${a.legend}-input`,
|
|
510
|
+
labelClass: m,
|
|
513
511
|
inputClass: c,
|
|
514
|
-
idx:
|
|
512
|
+
idx: v,
|
|
515
513
|
className: d
|
|
516
514
|
}
|
|
517
515
|
),
|
|
518
516
|
f.isEditable && f.editing && /* @__PURE__ */ t(
|
|
519
517
|
M,
|
|
520
518
|
{
|
|
521
|
-
legend: `${
|
|
522
|
-
idx:
|
|
519
|
+
legend: `${a.legend} ${v + 1}`,
|
|
520
|
+
idx: v,
|
|
523
521
|
editableInformation: f?.editableInformation,
|
|
524
522
|
onChangeOfEditableOption: h,
|
|
525
523
|
onClickSaveEdit: f?.onClickSave,
|
|
@@ -527,85 +525,85 @@ const a = {
|
|
|
527
525
|
onClickDeleteEntry: f?.onClickDelete
|
|
528
526
|
}
|
|
529
527
|
)
|
|
530
|
-
] }, `form-${i}-${
|
|
528
|
+
] }, `form-${i}-${v}`)) : a.isExpandable ? /* @__PURE__ */ t(J, { children: `No entry yet on ${a.legend}. Click "+" button to add entry.` }) : ""
|
|
531
529
|
] }),
|
|
532
|
-
|
|
533
|
-
] }, `${
|
|
530
|
+
a.isExpandable && /* @__PURE__ */ t(K, { className: "add-input-button-space", children: /* @__PURE__ */ t(y, { id: `expand-${a.legend}-inputs`, buttonType: "button", text: "+", onClick: x, className: "add-input-entry" }) })
|
|
531
|
+
] }, `${a.legend}-${p}`)) : /* @__PURE__ */ g(G, { children: [
|
|
534
532
|
/* @__PURE__ */ g(H, { id: `${i}-form-fieldset`, className: "form-fieldset", children: [
|
|
535
533
|
o && /* @__PURE__ */ t(U, { children: o }),
|
|
536
|
-
!e && r && r.length !== 0 ? r.map((
|
|
537
|
-
|
|
538
|
-
|
|
534
|
+
!e && r && r.length !== 0 ? r.map((a, p) => /* @__PURE__ */ g(W.Fragment, { children: [
|
|
535
|
+
a.type === "textarea" && /* @__PURE__ */ t(
|
|
536
|
+
T,
|
|
539
537
|
{
|
|
540
|
-
...
|
|
541
|
-
id:
|
|
542
|
-
labelClass:
|
|
538
|
+
...a,
|
|
539
|
+
id: a.id ?? `${o}-input`,
|
|
540
|
+
labelClass: m,
|
|
543
541
|
inputClass: c,
|
|
544
542
|
idx: p,
|
|
545
543
|
className: d
|
|
546
544
|
}
|
|
547
545
|
),
|
|
548
|
-
(
|
|
549
|
-
|
|
546
|
+
(a.type === "radio" || a.type === "checkbox") && /* @__PURE__ */ t(
|
|
547
|
+
T,
|
|
550
548
|
{
|
|
551
|
-
...
|
|
552
|
-
id:
|
|
553
|
-
labelClass:
|
|
549
|
+
...a,
|
|
550
|
+
id: a.id ?? `${o}-input`,
|
|
551
|
+
labelClass: m,
|
|
554
552
|
inputClass: c,
|
|
555
553
|
idx: p,
|
|
556
554
|
className: d
|
|
557
555
|
}
|
|
558
556
|
),
|
|
559
|
-
|
|
560
|
-
|
|
557
|
+
a.type !== "textarea" && a.type !== "radio" && a.type !== "checkbox" && /* @__PURE__ */ t(
|
|
558
|
+
T,
|
|
561
559
|
{
|
|
562
|
-
...
|
|
563
|
-
id:
|
|
564
|
-
labelClass:
|
|
560
|
+
...a,
|
|
561
|
+
id: a.id ?? `${o}-input`,
|
|
562
|
+
labelClass: m,
|
|
565
563
|
inputClass: c,
|
|
566
564
|
idx: p,
|
|
567
565
|
className: d
|
|
568
566
|
}
|
|
569
567
|
),
|
|
570
|
-
|
|
568
|
+
a.isEditable && a.editing && /* @__PURE__ */ t(
|
|
571
569
|
M,
|
|
572
570
|
{
|
|
573
571
|
legend: `${o} ${p + 1}`,
|
|
574
572
|
idx: p,
|
|
575
|
-
editableInformation:
|
|
573
|
+
editableInformation: a?.editableInformation,
|
|
576
574
|
onChangeOfEditableOption: h,
|
|
577
|
-
onClickSaveEdit:
|
|
578
|
-
onClickCancelEdit:
|
|
579
|
-
onClickDeleteEntry:
|
|
575
|
+
onClickSaveEdit: a?.onClickSave,
|
|
576
|
+
onClickCancelEdit: a?.onClickEdit,
|
|
577
|
+
onClickDeleteEntry: a?.onClickDelete
|
|
580
578
|
}
|
|
581
579
|
)
|
|
582
580
|
] }, `form-${i}-${p}`)) : l ? /* @__PURE__ */ t(J, { children: `No entry yet on ${o}. Please click "+" button to add` }) : ""
|
|
583
581
|
] }),
|
|
584
|
-
l && /* @__PURE__ */ t(K, { className: "add-input-button-space", children: /* @__PURE__ */ t(y, { id: `expand-${o}-inputs`, buttonType: "button", text: "+", onClick:
|
|
582
|
+
l && /* @__PURE__ */ t(K, { className: "add-input-button-space", children: /* @__PURE__ */ t(y, { id: `expand-${o}-inputs`, buttonType: "button", text: "+", onClick: x, className: "add-input-entry" }) })
|
|
585
583
|
] }),
|
|
586
584
|
/* @__PURE__ */ t(
|
|
587
585
|
ue,
|
|
588
586
|
{
|
|
589
587
|
id: i,
|
|
590
588
|
hasSubmit: $,
|
|
591
|
-
submitText:
|
|
592
|
-
handleSubmit:
|
|
589
|
+
submitText: N,
|
|
590
|
+
handleSubmit: D,
|
|
593
591
|
hasEdit: C,
|
|
594
|
-
editText:
|
|
595
|
-
handleEdit:
|
|
596
|
-
hasCancel:
|
|
597
|
-
cancelText:
|
|
598
|
-
handleCancel:
|
|
592
|
+
editText: R,
|
|
593
|
+
handleEdit: w,
|
|
594
|
+
hasCancel: u,
|
|
595
|
+
cancelText: S,
|
|
596
|
+
handleCancel: L,
|
|
599
597
|
hasDelete: k,
|
|
600
598
|
deleteText: B,
|
|
601
|
-
handleDelete:
|
|
599
|
+
handleDelete: j
|
|
602
600
|
}
|
|
603
601
|
),
|
|
604
|
-
/* @__PURE__ */ t($e, { className: "children-container", children:
|
|
602
|
+
/* @__PURE__ */ t($e, { className: "children-container", children: A })
|
|
605
603
|
] }), ye = (e) => {
|
|
606
604
|
const o = /^#([0-9A-Fa-f]{3}){1,2}$/, l = /^rgb(a)?\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}(?:\s*,\s*(0|1|0?\.\d+))?\s*\)$/;
|
|
607
605
|
return o.test(e) || l.test(e) || CSS.supports("color", e);
|
|
608
|
-
},
|
|
606
|
+
}, b = (e) => {
|
|
609
607
|
if (!ye(e)) throw new Error(`Invalid color: ${e}`);
|
|
610
608
|
return e;
|
|
611
609
|
}, Ee = {
|
|
@@ -617,39 +615,39 @@ const a = {
|
|
|
617
615
|
//Macbook 13" (1280x800)
|
|
618
616
|
largeDesktop: "1200px",
|
|
619
617
|
largerDesktop: "1400px"
|
|
620
|
-
},
|
|
618
|
+
}, O = {
|
|
621
619
|
name: "light",
|
|
622
620
|
colors: {
|
|
623
|
-
text:
|
|
624
|
-
bg:
|
|
625
|
-
blue:
|
|
626
|
-
blue2:
|
|
627
|
-
teal:
|
|
628
|
-
teal2:
|
|
629
|
-
gray:
|
|
630
|
-
information:
|
|
631
|
-
success:
|
|
632
|
-
warning:
|
|
633
|
-
error:
|
|
621
|
+
text: b("#333446"),
|
|
622
|
+
bg: b("#EEEEEE"),
|
|
623
|
+
blue: b("#7F8CAA"),
|
|
624
|
+
blue2: b("#80A6FF"),
|
|
625
|
+
teal: b("#5b8280ff"),
|
|
626
|
+
teal2: b("#AEEAE7"),
|
|
627
|
+
gray: b("#AEAEAE"),
|
|
628
|
+
information: b("#202234"),
|
|
629
|
+
success: b("#123524"),
|
|
630
|
+
warning: b("#F2C265"),
|
|
631
|
+
error: b("#990000")
|
|
634
632
|
}
|
|
635
633
|
}, pe = {
|
|
636
634
|
name: "dark",
|
|
637
635
|
colors: {
|
|
638
|
-
bg:
|
|
639
|
-
text:
|
|
640
|
-
blue:
|
|
641
|
-
blue2:
|
|
642
|
-
teal:
|
|
643
|
-
teal2:
|
|
644
|
-
gray:
|
|
645
|
-
information:
|
|
646
|
-
success:
|
|
647
|
-
warning:
|
|
648
|
-
error:
|
|
636
|
+
bg: b("#333446"),
|
|
637
|
+
text: b("#EEEEEE"),
|
|
638
|
+
blue: b("#80A6FF"),
|
|
639
|
+
blue2: b("#7F8CAA"),
|
|
640
|
+
teal: b("#AEEAE7"),
|
|
641
|
+
teal2: b("#5b8280ff"),
|
|
642
|
+
gray: b("#D0D0DD"),
|
|
643
|
+
information: b("#C9E6F0"),
|
|
644
|
+
success: b("#9EDF9C"),
|
|
645
|
+
warning: b("#FCFFC1"),
|
|
646
|
+
error: b("#FAD4D4")
|
|
649
647
|
}
|
|
650
648
|
}, Q = Y(void 0), Fe = ({ children: e }) => {
|
|
651
|
-
const [o, l] = Z(
|
|
652
|
-
l((r) => r ===
|
|
649
|
+
const [o, l] = Z(O), i = () => {
|
|
650
|
+
l((r) => r === O ? pe : O);
|
|
653
651
|
};
|
|
654
652
|
return /* @__PURE__ */ t(Q.Provider, { value: { currentTheme: o, toggleTheme: i }, children: /* @__PURE__ */ t(I, { theme: o, children: e }) });
|
|
655
653
|
}, ve = () => _(Q);
|
|
@@ -659,6 +657,6 @@ export {
|
|
|
659
657
|
Fe as ThemeContextProvider,
|
|
660
658
|
Ee as breakpoints,
|
|
661
659
|
pe as darkTheme,
|
|
662
|
-
|
|
660
|
+
O as lightTheme,
|
|
663
661
|
ve as useTheme
|
|
664
662
|
};
|