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