@kbgarcia8/react-dynamic-form 1.0.2 → 1.0.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/components/organisms/DynamicForm/DynamicForm.d.ts +1 -1
- package/dist/components/organisms/DynamicForm/DynamicForm.d.ts.map +1 -1
- package/dist/hooks/useTheme.d.ts +1 -1
- package/dist/hooks/useTheme.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/react-dynamic-form.cjs.js +18 -18
- package/dist/react-dynamic-form.es.js +255 -249
- package/dist/type/propTypes.d.ts +23 -12
- package/dist/type/propTypes.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { DynamicFormProps } from "../../../type/propTypes";
|
|
3
|
-
declare const DynamicForm: ({ fieldsets, legendText, isExpandable, id, formInputs, labelAndInputContainerClass, labelClass, inputClass, handleEditableInputEntryChange, handleAddingInputEntry, hasSubmit, hasCancel, hasDelete, hasEdit, submitText, handleSubmitForm, handleSubmit, cancelText, handleCancel, deleteText, handleDelete, editText, handleEdit, className, children }: React.PropsWithChildren<DynamicFormProps
|
|
3
|
+
declare const DynamicForm: <T extends null, K extends boolean = false, E extends boolean = false>({ fieldsets, legendText, isExpandable, id, formInputs, labelAndInputContainerClass, labelClass, inputClass, handleEditableInputEntryChange, handleAddingInputEntry, hasSubmit, hasCancel, hasDelete, hasEdit, submitText, handleSubmitForm, handleSubmit, cancelText, handleCancel, deleteText, handleDelete, editText, handleEdit, className, children }: React.PropsWithChildren<DynamicFormProps<T, K, E>>) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export default DynamicForm;
|
|
5
5
|
//# sourceMappingURL=DynamicForm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicForm.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/DynamicForm/DynamicForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,KAAK,EAAgB,gBAAgB,EAAgD,MAAM,yBAAyB,CAAC;AAE5H,QAAA,MAAM,WAAW,GAAI,
|
|
1
|
+
{"version":3,"file":"DynamicForm.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/DynamicForm/DynamicForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,KAAK,EAAgB,gBAAgB,EAAgD,MAAM,yBAAyB,CAAC;AAE5H,QAAA,MAAM,WAAW,GAAI,CAAC,SAAS,IAAI,EAAE,CAAC,SAAS,OAAO,GAAG,KAAK,EAAE,CAAC,SAAS,OAAO,GAAG,KAAK,EAAE,2VA0BzF,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,EAAC,CAAC,CAAC,CAAC,4CAmJlD,CAAA;AAGD,eAAe,WAAW,CAAC"}
|
package/dist/hooks/useTheme.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../src/hooks/useTheme.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../src/hooks/useTheme.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,QAAQ,kDAAyC,CAAC;AAExD,eAAe,QAAQ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,4 +3,5 @@ export { ThemeContextProvider } from "./context/ThemeContextWrapper";
|
|
|
3
3
|
export { default as ThemeContext } from "./context/ThemeContext";
|
|
4
4
|
export { default as useTheme } from "./hooks/useTheme";
|
|
5
5
|
export * from "./styles/theme";
|
|
6
|
+
export type * from './type/propTypes';
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,cAAc,gBAAgB,CAAC;AAC/B,mBAAmB,kBAAkB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),v=require("react"),c=require("styled-components"),t={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"}},
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),v=require("react"),c=require("styled-components"),t={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;
|
|
@@ -24,28 +24,28 @@
|
|
|
24
24
|
& .button-icon-text-space svg {
|
|
25
25
|
max-width: 100%;
|
|
26
26
|
}
|
|
27
|
-
`,
|
|
27
|
+
`,X=c.div`
|
|
28
28
|
width: 100%;
|
|
29
29
|
display: flex;
|
|
30
30
|
flex-direction: row;
|
|
31
31
|
align-items: center;
|
|
32
32
|
justify-content: center;
|
|
33
|
-
`,
|
|
33
|
+
`,Y=c.img`
|
|
34
34
|
maxwidth: 100%;
|
|
35
|
-
`,
|
|
35
|
+
`,Z=c.span`
|
|
36
36
|
font-size: ${t.fontSize.xsmall};
|
|
37
37
|
font-weight: ${t.fontWeight.medium};
|
|
38
38
|
font-family: ${t.fonts.tertiary}, ${t.fonts.fallback};
|
|
39
39
|
display: flex;
|
|
40
40
|
align-items: center;
|
|
41
41
|
justify-content: center;
|
|
42
|
-
`,
|
|
42
|
+
`,g=({onClick:n,id:o,buttonType:i,source:s,svg:r,alt:d="alt-button-icon",text:m="",className:l="",dataAttributes:b={}})=>e.jsx(V,{onClick:n,id:o,type:i,className:l,...b,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;
|
|
46
46
|
width: 100%;
|
|
47
47
|
margin-bottom: ${t.spacing.small};
|
|
48
|
-
`,
|
|
48
|
+
`,I=c.div`
|
|
49
49
|
display: flex;
|
|
50
50
|
gap: ${t.spacing.xsmall};
|
|
51
51
|
width: auto;
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
align-items: center;
|
|
76
76
|
`,ae=c.span`
|
|
77
77
|
font-weight: ${t.fontWeight.light};
|
|
78
|
-
`,P=({htmlFor:n,textLabel:o,additionalInfo:
|
|
78
|
+
`,P=({htmlFor:n,textLabel:o,additionalInfo:i,$labelFlexDirection:s,source:r,svg:d,className:m,children:l})=>e.jsxs(ee,{htmlFor:n,className:m,$labelFlexDirection:s,children:[(r||d)&&e.jsx(ne,{className:"label-icon-container",children:r?e.jsx("img",{src:r,alt:`${n}-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: ${t.fonts.secondary}, ${t.fonts.fallback};
|
|
@@ -105,17 +105,17 @@
|
|
|
105
105
|
max-width: 100%;
|
|
106
106
|
resize: none;
|
|
107
107
|
overflow-y: auto;
|
|
108
|
-
`,z=v.forwardRef((n,o)=>{const{type:
|
|
108
|
+
`,z=v.forwardRef((n,o)=>{const{type:i,id:s,onChange:r,isRequired:d,dataAttributes:m,disabled:l,className:b}=n;if(i==="textarea"){const{rows:j=5,cols:N=30,value:T,...A}=n;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}=n;return e.jsx(W,{ref:o,type:"checkbox",id:s,checked:j,onChange:r,disabled:l,className:b,...m})}const u=n,{value:y,pattern:f,placeholderText:p,...C}=u;return e.jsx(W,{id:s,name:s,placeholder:p,onChange:r,value:y,type:i,required:d,...m,className:b,ref:o,disabled:l,pattern:f})}),E=n=>{const{className:o,type:i,id:s,textLabel:r,additionalInfo:d,$labelFlexDirection:m,svg:l,labelClass:b,onChange:u,isRequired:y,dataAttributes:f,inputClass:p,ref:C,disabled:j,isEditable:N,editIcon:T,onClickEdit:A,deleteIcon:R,onClickDelete:B,idx:S,children:q}=n;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}=n;return e.jsx(z,{id:s,name:s,type:"textarea",isRequired:y,onChange:u,value:D,rows:k,cols:w,...f,className:p,ref:C,disabled:j})})(),i!=="radio"&&i!=="checkbox"&&i!=="textarea"&&(()=>{const k=n,{value:w,pattern:D,placeholderText:a,...$}=k;return e.jsx(z,{id:s,name:s,placeholderText:a,onChange:u,value:w,type:i,isRequired:y,...f,className:p,ref:C,disabled:j,pattern:D})})(),(i==="radio"||i==="checkbox")&&(()=>{const{checked:k,...w}=n;return e.jsxs(e.Fragment,{children:[e.jsx(z,{ref:C,type:"checkbox",name:s,id:s,isRequired:y,checked:k,onChange:u,disabled:j,className:p,...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(g,{id:`editable-${s}-edit-btn`,svg:T,buttonType:"button",onClick:A,className:`edit-radio-${S}`,dataAttributes:f}),e.jsx(g,{id:`editable-${s}-delete-btn`,svg:R,buttonType:"button",onClick:B,className:`delete-radio-${S}`,dataAttributes:f})]}),q]})},se=c.fieldset`
|
|
109
109
|
padding: 0;
|
|
110
110
|
height: auto;
|
|
111
111
|
width: 100%;
|
|
112
|
-
`,
|
|
112
|
+
`,ie=c.legend`
|
|
113
113
|
font-size: ${t.spacing.medium};
|
|
114
114
|
font-weight: 500;
|
|
115
115
|
margin: 0 auto ${t.spacing.small} auto;
|
|
116
116
|
text-align: center;
|
|
117
117
|
font-family: ${t.fonts.secondary}, ${t.fonts.fallback};
|
|
118
|
-
`,
|
|
118
|
+
`,le=c.div`
|
|
119
119
|
display: flex;
|
|
120
120
|
flex-direction: column;
|
|
121
121
|
align-items: flex-start;
|
|
@@ -125,26 +125,26 @@
|
|
|
125
125
|
display: flex;
|
|
126
126
|
justify-content: space-between;
|
|
127
127
|
width: 100%;
|
|
128
|
-
`,
|
|
128
|
+
`,M=({legend:n,idx:o,editableInformation:i,onChangeOfEditableOption:s,onClickSaveEdit:r,onClickCancelEdit:d,onClickDeleteEntry:m})=>e.jsxs(se,{className:"editable-selection-fieldset",children:[e.jsx(ie,{children:`${n} ${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(g,{id:`editable-selection-${o}-submit`,buttonType:"submit",text:"Save",onClick:r,className:"editable-selection-btn",dataAttributes:{"data-index":o}}),e.jsx(g,{id:`editable-selection-${o}-cancel`,buttonType:"button",text:"Cancel",onClick:d,className:"editable-selection-btn",dataAttributes:{"data-index":o}}),e.jsx(g,{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:n,hasSubmit:o,submitText:
|
|
132
|
+
`,de=({id:n,hasSubmit:o,submitText:i,handleSubmit:s,hasEdit:r,editText:d,handleEdit:m,hasCancel:l,cancelText:b,handleCancel:u,hasDelete:y,deleteText:f,handleDelete:p})=>e.jsxs(re,{className:"form-main-button-container",children:[o&&e.jsx(g,{id:`form-${n}-submit`,buttonType:"submit",text:i??"Submit",onClick:s,className:"submit-form-btn"}),r&&e.jsx(g,{id:`form-${n}-edit`,buttonType:"button",text:d??"Edit",onClick:m,className:"edit-form-btn"}),l&&e.jsx(g,{id:`form-${n}-cancel`,buttonType:"button",text:b??"Cancel",onClick:u,className:"cancel-form-btn"}),y&&e.jsx(g,{id:`form-${n}-delete`,buttonType:"button",text:f??"Delete",onClick:p,className:"delete-form-btn"})]}),U=c.legend`
|
|
133
133
|
font-size: ${t.spacing.medium};
|
|
134
134
|
font-weight: 500;
|
|
135
135
|
margin-bottom: ${t.spacing.small};
|
|
136
136
|
width: auto;
|
|
137
137
|
text-align: center;
|
|
138
138
|
font-family: ${t.fonts.secondary}, ${t.fonts.fallback};
|
|
139
|
-
`,
|
|
139
|
+
`,H=c.fieldset`
|
|
140
140
|
padding: 0;
|
|
141
141
|
height: auto;
|
|
142
142
|
width: 100%;
|
|
143
|
-
`,
|
|
143
|
+
`,G=c.div`
|
|
144
144
|
padding: ${t.spacing.small};
|
|
145
145
|
height: auto;
|
|
146
146
|
width: 100%;
|
|
147
|
-
`,
|
|
147
|
+
`,J=c.div`
|
|
148
148
|
display: flex;
|
|
149
149
|
justify-content: center;
|
|
150
150
|
align-items: center;
|
|
@@ -158,14 +158,14 @@
|
|
|
158
158
|
flex-direction: column;
|
|
159
159
|
align-items: center;
|
|
160
160
|
width: 100%;
|
|
161
|
-
`,
|
|
161
|
+
`,K=c.div`
|
|
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:n=null,legendText:o,isExpandable:i,id:s,formInputs:r,labelAndInputContainerClass:d,labelClass:m,inputClass:l,handleEditableInputEntryChange:b,handleAddingInputEntry:u,hasSubmit:y=!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:q,handleEdit:k,className:w,children:D})=>e.jsxs(me,{id:`${s}-form`,className:w,onSubmit:N,children:[n?n.map((a,$)=>e.jsxs(G,{children:[e.jsxs(H,{id:`${s}-form-fieldset-${$}`,className:"form-fieldset",children:[a.legend&&e.jsx(U,{children:a.legend}),a.inputs.length!==0?a.inputs.map((h,F)=>e.jsxs(v.Fragment,{children:[h.type==="textarea"&&e.jsx(E,{...h,id:h.id??`${a.legend}-input`,labelClass:m,inputClass:l,idx:F,className:d}),(h.type==="radio"||h.type==="checkbox")&&e.jsx(E,{...h,id:h.id??`${a.legend}-input`,labelClass:m,inputClass:l,idx:F,className:d}),h.type!=="textarea"&&h.type!=="radio"&&h.type!=="checkbox"&&e.jsx(E,{...h,id:h.id??`${a.legend}-input`,labelClass:m,inputClass:l,idx:F,className:d}),h.editable&&h.editing&&e.jsx(M,{legend:`${a.legend} ${F+1}`,idx:F,editableInformation:h?.editableInformation,onChangeOfEditableOption:b,onClickSaveEdit:h?.onClickSave,onClickCancelEdit:h?.onClickCancel,onClickDeleteEntry:h?.onClickDelete})]},`form-${s}-${F}`)):a.expandable?e.jsx(J,{children:`No entry yet on ${a.legend}. Click "+" button to add entry.`}):""]}),a.expandable&&e.jsx(K,{className:"add-input-button-space",children:e.jsx(g,{id:`expand-${a.legend}-inputs`,buttonType:"button",text:"+",onClick:u,className:"add-input-entry"})})]},`${a.legend}-${$}`)):e.jsxs(G,{children:[e.jsxs(H,{id:`${s}-form-fieldset`,className:"form-fieldset",children:[o&&e.jsx(U,{children:o}),r.length!==0?r.map((a,$)=>e.jsxs(v.Fragment,{children:[a.type==="textarea"&&e.jsx(E,{...a,id:a.id??`${o}-input`,labelClass:m,inputClass:l,idx:$,className:d}),(a.type==="radio"||a.type==="checkbox")&&e.jsx(E,{...a,id:a.id??`${o}-input`,labelClass:m,inputClass:l,idx:$,className:d}),a.type!=="textarea"&&a.type!=="radio"&&a.type!=="checkbox"&&e.jsx(E,{...a,id:a.id??`${o}-input`,labelClass:m,inputClass:l,idx:$,className:d}),a.editable&&a.editing&&e.jsx(M,{legend:`${o} ${$+1}`,idx:$,editableInformation:a?.editableInformation,onChangeOfEditableOption:b,onClickSaveEdit:a?.onClickSave,onClickCancelEdit:a?.onClickEdit,onClickDeleteEntry:a?.onClickDelete})]},`form-${s}-${$}`)):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(g,{id:`expand-${o}-inputs`,buttonType:"button",text:"+",onClick:u,className:"add-input-entry"})})]}),e.jsx(de,{id:s,hasSubmit:y,submitText:j,handleSubmit:T,hasEdit:C,editText:q,handleEdit:k,hasCancel:f,cancelText:A,handleCancel:R,hasDelete:p,deleteText:B,handleDelete:S}),e.jsx(xe,{className:"children-container",children:D})]}),he=n=>{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(n)||i.test(n)||CSS.supports("color",n)},x=n=>{if(!he(n))throw new Error(`Invalid color: ${n}`);return n},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")}},O=v.createContext(void 0),ge=({children:n})=>{const[o,i]=v.useState(L),s=()=>{i(r=>r===L?Q:L)};return e.jsx(O.Provider,{value:{currentTheme:o,toggleTheme:s},children:e.jsx(c.ThemeProvider,{theme:o,children:n})})},ue=()=>v.useContext(O);exports.DynamicForm=be;exports.ThemeContext=O;exports.ThemeContextProvider=ge;exports.breakpoints=fe;exports.darkTheme=Q;exports.lightTheme=L;exports.useTheme=ue;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import W, { forwardRef as
|
|
3
|
-
import
|
|
1
|
+
import { jsx as e, jsxs as g, Fragment as V } from "react/jsx-runtime";
|
|
2
|
+
import W, { forwardRef as X, createContext as Y, useState as Z, useContext as _ } from "react";
|
|
3
|
+
import s, { ThemeProvider as I } from "styled-components";
|
|
4
4
|
const t = {
|
|
5
5
|
fonts: {
|
|
6
6
|
secondary: "Raleway",
|
|
@@ -32,7 +32,7 @@ const t = {
|
|
|
32
32
|
thin: "0.0625rem",
|
|
33
33
|
light: "0.125rem"
|
|
34
34
|
}
|
|
35
|
-
}, ee =
|
|
35
|
+
}, ee = s.button`
|
|
36
36
|
display: flex;
|
|
37
37
|
align-items: center;
|
|
38
38
|
justify-content: center;
|
|
@@ -58,15 +58,15 @@ const t = {
|
|
|
58
58
|
& .button-icon-text-space svg {
|
|
59
59
|
max-width: 100%;
|
|
60
60
|
}
|
|
61
|
-
`, te =
|
|
61
|
+
`, te = s.div`
|
|
62
62
|
width: 100%;
|
|
63
63
|
display: flex;
|
|
64
64
|
flex-direction: row;
|
|
65
65
|
align-items: center;
|
|
66
66
|
justify-content: center;
|
|
67
|
-
`, ne =
|
|
67
|
+
`, ne = s.img`
|
|
68
68
|
maxwidth: 100%;
|
|
69
|
-
`, ae =
|
|
69
|
+
`, ae = s.span`
|
|
70
70
|
font-size: ${t.fontSize.xsmall};
|
|
71
71
|
font-weight: ${t.fontWeight.medium};
|
|
72
72
|
font-family: ${t.fonts.tertiary}, ${t.fonts.fallback};
|
|
@@ -76,38 +76,38 @@ const t = {
|
|
|
76
76
|
`, x = ({
|
|
77
77
|
onClick: n,
|
|
78
78
|
id: o,
|
|
79
|
-
buttonType:
|
|
80
|
-
source:
|
|
79
|
+
buttonType: l,
|
|
80
|
+
source: i,
|
|
81
81
|
svg: r,
|
|
82
|
-
alt:
|
|
83
|
-
text:
|
|
84
|
-
className:
|
|
85
|
-
dataAttributes:
|
|
82
|
+
alt: d = "alt-button-icon",
|
|
83
|
+
text: m = "",
|
|
84
|
+
className: c = "",
|
|
85
|
+
dataAttributes: h = {}
|
|
86
86
|
}) => /* @__PURE__ */ e(
|
|
87
87
|
ee,
|
|
88
88
|
{
|
|
89
89
|
onClick: n,
|
|
90
90
|
id: o,
|
|
91
|
-
type:
|
|
92
|
-
className:
|
|
93
|
-
...
|
|
94
|
-
children: /* @__PURE__ */
|
|
95
|
-
|
|
96
|
-
|
|
91
|
+
type: l,
|
|
92
|
+
className: c,
|
|
93
|
+
...h,
|
|
94
|
+
children: /* @__PURE__ */ g(te, { className: "button-icon-text-space", children: [
|
|
95
|
+
i ? /* @__PURE__ */ e(ne, { src: i, alt: d }) : r || "",
|
|
96
|
+
m && /* @__PURE__ */ e(ae, { id: o, children: m })
|
|
97
97
|
] })
|
|
98
98
|
}
|
|
99
|
-
), oe =
|
|
99
|
+
), oe = s.div`
|
|
100
100
|
display: flex;
|
|
101
101
|
flex-direction: column;
|
|
102
102
|
align-items: left;
|
|
103
103
|
width: 100%;
|
|
104
104
|
margin-bottom: ${t.spacing.small};
|
|
105
|
-
`,
|
|
105
|
+
`, ie = s.div`
|
|
106
106
|
display: flex;
|
|
107
107
|
gap: ${t.spacing.xsmall};
|
|
108
108
|
width: auto;
|
|
109
109
|
height: auto;
|
|
110
|
-
`,
|
|
110
|
+
`, le = s.label`
|
|
111
111
|
display: flex;
|
|
112
112
|
align-items: center;
|
|
113
113
|
justify-content:center;
|
|
@@ -124,29 +124,29 @@ const t = {
|
|
|
124
124
|
height: auto;
|
|
125
125
|
object-fit: contain;
|
|
126
126
|
}
|
|
127
|
-
`,
|
|
127
|
+
`, ce = s.span`
|
|
128
128
|
font-weight: ${t.fontWeight.bolder};
|
|
129
|
-
`,
|
|
129
|
+
`, se = s.div`
|
|
130
130
|
max-width: 100%;
|
|
131
131
|
display: flex;
|
|
132
132
|
align-items: center;
|
|
133
|
-
`, re =
|
|
133
|
+
`, re = s.span`
|
|
134
134
|
font-weight: ${t.fontWeight.light};
|
|
135
135
|
`, P = ({
|
|
136
136
|
htmlFor: n,
|
|
137
137
|
textLabel: o,
|
|
138
|
-
additionalInfo:
|
|
139
|
-
$labelFlexDirection:
|
|
138
|
+
additionalInfo: l,
|
|
139
|
+
$labelFlexDirection: i,
|
|
140
140
|
source: r,
|
|
141
|
-
svg:
|
|
142
|
-
className:
|
|
143
|
-
children:
|
|
144
|
-
}) => /* @__PURE__ */
|
|
145
|
-
(r ||
|
|
146
|
-
/* @__PURE__ */ e(
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
] }), q =
|
|
141
|
+
svg: d,
|
|
142
|
+
className: m,
|
|
143
|
+
children: c
|
|
144
|
+
}) => /* @__PURE__ */ g(le, { htmlFor: n, className: m, $labelFlexDirection: i, children: [
|
|
145
|
+
(r || d) && /* @__PURE__ */ e(se, { className: "label-icon-container", children: r ? /* @__PURE__ */ e("img", { src: r, alt: `${n}-label-icon` }) : d || "" }),
|
|
146
|
+
/* @__PURE__ */ e(ce, { className: "main-label", children: o }),
|
|
147
|
+
l && /* @__PURE__ */ e(re, { className: "additional-info", children: l }),
|
|
148
|
+
c
|
|
149
|
+
] }), q = s.input`
|
|
150
150
|
display: flex;
|
|
151
151
|
place-content: center;
|
|
152
152
|
font-family: ${t.fonts.secondary}, ${t.fonts.fallback};
|
|
@@ -163,7 +163,7 @@ const t = {
|
|
|
163
163
|
&:focus{
|
|
164
164
|
border: ${t.borderThickness.thin} solid ${({ theme: n }) => n.colors.teal};
|
|
165
165
|
}
|
|
166
|
-
`, de =
|
|
166
|
+
`, de = s.textarea`
|
|
167
167
|
display: flex;
|
|
168
168
|
place-content: center;
|
|
169
169
|
border: ${t.borderThickness.light} solid ${({ theme: n }) => n.colors.text};
|
|
@@ -176,245 +176,245 @@ const t = {
|
|
|
176
176
|
max-width: 100%;
|
|
177
177
|
resize: none;
|
|
178
178
|
overflow-y: auto;
|
|
179
|
-
`, j =
|
|
180
|
-
const { type:
|
|
181
|
-
if (
|
|
182
|
-
const { rows:
|
|
179
|
+
`, j = X((n, o) => {
|
|
180
|
+
const { type: l, id: i, onChange: r, isRequired: d, dataAttributes: m, disabled: c, className: h } = n;
|
|
181
|
+
if (l === "textarea") {
|
|
182
|
+
const { rows: N = 5, cols: F = 30, value: A, ...S } = n;
|
|
183
183
|
return /* @__PURE__ */ e(
|
|
184
184
|
de,
|
|
185
185
|
{
|
|
186
|
-
id:
|
|
186
|
+
id: i,
|
|
187
187
|
onChange: r,
|
|
188
|
-
value:
|
|
189
|
-
rows:
|
|
188
|
+
value: A,
|
|
189
|
+
rows: N,
|
|
190
190
|
cols: F,
|
|
191
|
-
...
|
|
192
|
-
className:
|
|
191
|
+
...m,
|
|
192
|
+
className: h,
|
|
193
193
|
ref: o,
|
|
194
|
-
disabled:
|
|
195
|
-
required:
|
|
194
|
+
disabled: c,
|
|
195
|
+
required: d
|
|
196
196
|
}
|
|
197
197
|
);
|
|
198
198
|
}
|
|
199
|
-
if (
|
|
200
|
-
const { checked:
|
|
199
|
+
if (l === "radio" || l === "checkbox") {
|
|
200
|
+
const { checked: N, ...F } = n;
|
|
201
201
|
return /* @__PURE__ */ e(
|
|
202
202
|
q,
|
|
203
203
|
{
|
|
204
204
|
ref: o,
|
|
205
205
|
type: "checkbox",
|
|
206
|
-
id:
|
|
207
|
-
checked:
|
|
206
|
+
id: i,
|
|
207
|
+
checked: N,
|
|
208
208
|
onChange: r,
|
|
209
|
-
disabled:
|
|
210
|
-
className:
|
|
211
|
-
...
|
|
209
|
+
disabled: c,
|
|
210
|
+
className: h,
|
|
211
|
+
...m
|
|
212
212
|
}
|
|
213
213
|
);
|
|
214
214
|
}
|
|
215
|
-
const $ = n, { value: p, pattern:
|
|
215
|
+
const $ = n, { value: p, pattern: u, placeholderText: k, ...C } = $;
|
|
216
216
|
return /* @__PURE__ */ e(
|
|
217
217
|
q,
|
|
218
218
|
{
|
|
219
|
-
id:
|
|
220
|
-
name:
|
|
219
|
+
id: i,
|
|
220
|
+
name: i,
|
|
221
221
|
placeholder: k,
|
|
222
222
|
onChange: r,
|
|
223
223
|
value: p,
|
|
224
|
-
type:
|
|
225
|
-
required:
|
|
226
|
-
...
|
|
227
|
-
className:
|
|
224
|
+
type: l,
|
|
225
|
+
required: d,
|
|
226
|
+
...m,
|
|
227
|
+
className: h,
|
|
228
228
|
ref: o,
|
|
229
|
-
disabled:
|
|
230
|
-
pattern:
|
|
229
|
+
disabled: c,
|
|
230
|
+
pattern: u
|
|
231
231
|
}
|
|
232
232
|
);
|
|
233
|
-
}),
|
|
233
|
+
}), T = (n) => {
|
|
234
234
|
const {
|
|
235
235
|
className: o,
|
|
236
|
-
type:
|
|
237
|
-
id:
|
|
236
|
+
type: l,
|
|
237
|
+
id: i,
|
|
238
238
|
textLabel: r,
|
|
239
|
-
additionalInfo:
|
|
240
|
-
$labelFlexDirection:
|
|
241
|
-
svg:
|
|
242
|
-
labelClass:
|
|
239
|
+
additionalInfo: d,
|
|
240
|
+
$labelFlexDirection: m,
|
|
241
|
+
svg: c,
|
|
242
|
+
labelClass: h,
|
|
243
243
|
onChange: $,
|
|
244
244
|
isRequired: p,
|
|
245
|
-
dataAttributes:
|
|
245
|
+
dataAttributes: u,
|
|
246
246
|
inputClass: k,
|
|
247
|
-
ref:
|
|
248
|
-
disabled:
|
|
247
|
+
ref: C,
|
|
248
|
+
disabled: N,
|
|
249
249
|
isEditable: F,
|
|
250
|
-
editIcon:
|
|
250
|
+
editIcon: A,
|
|
251
251
|
onClickEdit: S,
|
|
252
252
|
deleteIcon: L,
|
|
253
253
|
onClickDelete: B,
|
|
254
254
|
idx: z,
|
|
255
255
|
children: R
|
|
256
256
|
} = n;
|
|
257
|
-
return /* @__PURE__ */
|
|
258
|
-
|
|
259
|
-
|
|
257
|
+
return /* @__PURE__ */ g(oe, { className: `${o} ${i.replace("#", "")}-label-input-container`, children: [
|
|
258
|
+
l !== "radio" && l !== "checkbox" && /* @__PURE__ */ e(P, { htmlFor: i, textLabel: r, additionalInfo: d, $labelFlexDirection: m, svg: c, className: h }),
|
|
259
|
+
l !== "radio" && l !== "checkbox" && l === "textarea" && (() => {
|
|
260
260
|
const { rows: w = 5, cols: E = 30, value: D, ...a } = n;
|
|
261
261
|
return /* @__PURE__ */ e(
|
|
262
262
|
j,
|
|
263
263
|
{
|
|
264
|
-
id:
|
|
265
|
-
name:
|
|
264
|
+
id: i,
|
|
265
|
+
name: i,
|
|
266
266
|
type: "textarea",
|
|
267
267
|
isRequired: p,
|
|
268
268
|
onChange: $,
|
|
269
269
|
value: D,
|
|
270
270
|
rows: w,
|
|
271
271
|
cols: E,
|
|
272
|
-
...
|
|
272
|
+
...u,
|
|
273
273
|
className: k,
|
|
274
|
-
ref:
|
|
275
|
-
disabled:
|
|
274
|
+
ref: C,
|
|
275
|
+
disabled: N
|
|
276
276
|
}
|
|
277
277
|
);
|
|
278
278
|
})(),
|
|
279
|
-
|
|
279
|
+
l !== "radio" && l !== "checkbox" && l !== "textarea" && (() => {
|
|
280
280
|
const w = n, { value: E, pattern: D, placeholderText: a, ...y } = w;
|
|
281
281
|
return /* @__PURE__ */ e(
|
|
282
282
|
j,
|
|
283
283
|
{
|
|
284
|
-
id:
|
|
285
|
-
name:
|
|
284
|
+
id: i,
|
|
285
|
+
name: i,
|
|
286
286
|
placeholderText: a,
|
|
287
287
|
onChange: $,
|
|
288
288
|
value: E,
|
|
289
|
-
type:
|
|
289
|
+
type: l,
|
|
290
290
|
isRequired: p,
|
|
291
|
-
...
|
|
291
|
+
...u,
|
|
292
292
|
className: k,
|
|
293
|
-
ref:
|
|
294
|
-
disabled:
|
|
293
|
+
ref: C,
|
|
294
|
+
disabled: N,
|
|
295
295
|
pattern: D
|
|
296
296
|
}
|
|
297
297
|
);
|
|
298
298
|
})(),
|
|
299
|
-
(
|
|
299
|
+
(l === "radio" || l === "checkbox") && (() => {
|
|
300
300
|
const { checked: w, ...E } = n;
|
|
301
|
-
return /* @__PURE__ */
|
|
301
|
+
return /* @__PURE__ */ g(V, { children: [
|
|
302
302
|
/* @__PURE__ */ e(
|
|
303
303
|
j,
|
|
304
304
|
{
|
|
305
|
-
ref:
|
|
305
|
+
ref: C,
|
|
306
306
|
type: "checkbox",
|
|
307
|
-
name:
|
|
308
|
-
id:
|
|
307
|
+
name: i,
|
|
308
|
+
id: i,
|
|
309
309
|
isRequired: p,
|
|
310
310
|
checked: w,
|
|
311
311
|
onChange: $,
|
|
312
|
-
disabled:
|
|
312
|
+
disabled: N,
|
|
313
313
|
className: k,
|
|
314
|
-
...
|
|
314
|
+
...u
|
|
315
315
|
}
|
|
316
316
|
),
|
|
317
|
-
/* @__PURE__ */ e(P, { htmlFor:
|
|
317
|
+
/* @__PURE__ */ e(P, { htmlFor: i, textLabel: r, additionalInfo: d, $labelFlexDirection: m, svg: c, className: h })
|
|
318
318
|
] });
|
|
319
319
|
})(),
|
|
320
|
-
F && /* @__PURE__ */
|
|
321
|
-
/* @__PURE__ */ e(x, { id: `editable-${
|
|
322
|
-
/* @__PURE__ */ e(x, { id: `editable-${
|
|
320
|
+
F && /* @__PURE__ */ g(ie, { className: "input-edit-buttons", children: [
|
|
321
|
+
/* @__PURE__ */ e(x, { id: `editable-${i}-edit-btn`, svg: A, buttonType: "button", onClick: S, className: `edit-radio-${z}`, dataAttributes: u }),
|
|
322
|
+
/* @__PURE__ */ e(x, { id: `editable-${i}-delete-btn`, svg: L, buttonType: "button", onClick: B, className: `delete-radio-${z}`, dataAttributes: u })
|
|
323
323
|
] }),
|
|
324
324
|
R
|
|
325
325
|
] });
|
|
326
|
-
}, me =
|
|
326
|
+
}, me = s.fieldset`
|
|
327
327
|
padding: 0;
|
|
328
328
|
height: auto;
|
|
329
329
|
width: 100%;
|
|
330
|
-
`, be =
|
|
330
|
+
`, be = s.legend`
|
|
331
331
|
font-size: ${t.spacing.medium};
|
|
332
332
|
font-weight: 500;
|
|
333
333
|
margin: 0 auto ${t.spacing.small} auto;
|
|
334
334
|
text-align: center;
|
|
335
335
|
font-family: ${t.fonts.secondary}, ${t.fonts.fallback};
|
|
336
|
-
`, he =
|
|
336
|
+
`, he = s.div`
|
|
337
337
|
display: flex;
|
|
338
338
|
flex-direction: column;
|
|
339
339
|
align-items: flex-start;
|
|
340
340
|
width: 100%;
|
|
341
341
|
margin-bottom: ${t.spacing.small};
|
|
342
|
-
`, fe =
|
|
342
|
+
`, fe = s.div`
|
|
343
343
|
display: flex;
|
|
344
344
|
justify-content: space-between;
|
|
345
345
|
width: 100%;
|
|
346
|
-
`,
|
|
346
|
+
`, M = ({
|
|
347
347
|
legend: n,
|
|
348
348
|
idx: o,
|
|
349
|
-
editableInformation:
|
|
350
|
-
onChangeOfEditableOption:
|
|
349
|
+
editableInformation: l,
|
|
350
|
+
onChangeOfEditableOption: i,
|
|
351
351
|
onClickSaveEdit: r,
|
|
352
|
-
onClickCancelEdit:
|
|
353
|
-
onClickDeleteEntry:
|
|
354
|
-
}) => /* @__PURE__ */
|
|
352
|
+
onClickCancelEdit: d,
|
|
353
|
+
onClickDeleteEntry: m
|
|
354
|
+
}) => /* @__PURE__ */ g(me, { className: "editable-selection-fieldset", children: [
|
|
355
355
|
/* @__PURE__ */ e(be, { children: `${n} ${o + 1}` }),
|
|
356
|
-
|
|
356
|
+
l.map((c, h) => /* @__PURE__ */ e(he, { className: "editable-selection-container", children: /* @__PURE__ */ e(
|
|
357
357
|
j,
|
|
358
358
|
{
|
|
359
|
-
id: `editable-selection-${
|
|
360
|
-
name: `editable-selection-${
|
|
361
|
-
placeholderText:
|
|
362
|
-
onChange:
|
|
363
|
-
value:
|
|
364
|
-
type:
|
|
359
|
+
id: `editable-selection-${h}`,
|
|
360
|
+
name: `editable-selection-${h}`,
|
|
361
|
+
placeholderText: c.name.charAt(0).toUpperCase() + c.name.slice(1),
|
|
362
|
+
onChange: i,
|
|
363
|
+
value: c.info,
|
|
364
|
+
type: c.type,
|
|
365
365
|
isRequired: !0,
|
|
366
366
|
className: "editable-selection",
|
|
367
367
|
dataAttributes: {
|
|
368
|
-
"data-index":
|
|
368
|
+
"data-index": h,
|
|
369
369
|
//* should be idx to correspond to radio button index and not with input increment
|
|
370
|
-
"data-key":
|
|
370
|
+
"data-key": c.info
|
|
371
371
|
}
|
|
372
372
|
}
|
|
373
|
-
) }, `${
|
|
374
|
-
/* @__PURE__ */
|
|
373
|
+
) }, `${c.name}-${h}`)),
|
|
374
|
+
/* @__PURE__ */ g(fe, { className: "editable-selection-button-space", children: [
|
|
375
375
|
/* @__PURE__ */ e(x, { id: `editable-selection-${o}-submit`, buttonType: "submit", text: "Save", onClick: r, className: "editable-selection-btn", dataAttributes: { "data-index": o } }),
|
|
376
|
-
/* @__PURE__ */ e(x, { id: `editable-selection-${o}-cancel`, buttonType: "button", text: "Cancel", onClick:
|
|
377
|
-
/* @__PURE__ */ e(x, { id: `editable-selection-${o}-delete`, buttonType: "button", text: "Delete", onClick:
|
|
376
|
+
/* @__PURE__ */ e(x, { id: `editable-selection-${o}-cancel`, buttonType: "button", text: "Cancel", onClick: d, className: "editable-selection-btn", dataAttributes: { "data-index": o } }),
|
|
377
|
+
/* @__PURE__ */ e(x, { id: `editable-selection-${o}-delete`, buttonType: "button", text: "Delete", onClick: m, className: "editable-selection-btn", dataAttributes: { "data-index": o } })
|
|
378
378
|
] })
|
|
379
|
-
] }),
|
|
379
|
+
] }), ge = s.div`
|
|
380
380
|
display: flex;
|
|
381
381
|
justify-content: space-between;
|
|
382
382
|
max-width: 100%;
|
|
383
|
-
`,
|
|
383
|
+
`, ue = ({
|
|
384
384
|
id: n,
|
|
385
385
|
hasSubmit: o,
|
|
386
|
-
submitText:
|
|
387
|
-
handleSubmit:
|
|
386
|
+
submitText: l,
|
|
387
|
+
handleSubmit: i,
|
|
388
388
|
hasEdit: r,
|
|
389
|
-
editText:
|
|
390
|
-
handleEdit:
|
|
391
|
-
hasCancel:
|
|
392
|
-
cancelText:
|
|
389
|
+
editText: d,
|
|
390
|
+
handleEdit: m,
|
|
391
|
+
hasCancel: c,
|
|
392
|
+
cancelText: h,
|
|
393
393
|
handleCancel: $,
|
|
394
394
|
hasDelete: p,
|
|
395
|
-
deleteText:
|
|
395
|
+
deleteText: u,
|
|
396
396
|
handleDelete: k
|
|
397
|
-
}) => /* @__PURE__ */
|
|
398
|
-
o && /* @__PURE__ */ e(x, { id: `form-${n}-submit`, buttonType: "submit", text:
|
|
399
|
-
r && /* @__PURE__ */ e(x, { id: `form-${n}-edit`, buttonType: "button", text:
|
|
400
|
-
|
|
401
|
-
p && /* @__PURE__ */ e(x, { id: `form-${n}-delete`, buttonType: "button", text:
|
|
402
|
-
] }),
|
|
397
|
+
}) => /* @__PURE__ */ g(ge, { className: "form-main-button-container", children: [
|
|
398
|
+
o && /* @__PURE__ */ e(x, { id: `form-${n}-submit`, buttonType: "submit", text: l ?? "Submit", onClick: i, className: "submit-form-btn" }),
|
|
399
|
+
r && /* @__PURE__ */ e(x, { id: `form-${n}-edit`, buttonType: "button", text: d ?? "Edit", onClick: m, className: "edit-form-btn" }),
|
|
400
|
+
c && /* @__PURE__ */ e(x, { id: `form-${n}-cancel`, buttonType: "button", text: h ?? "Cancel", onClick: $, className: "cancel-form-btn" }),
|
|
401
|
+
p && /* @__PURE__ */ e(x, { id: `form-${n}-delete`, buttonType: "button", text: u ?? "Delete", onClick: k, className: "delete-form-btn" })
|
|
402
|
+
] }), U = s.legend`
|
|
403
403
|
font-size: ${t.spacing.medium};
|
|
404
404
|
font-weight: 500;
|
|
405
405
|
margin-bottom: ${t.spacing.small};
|
|
406
406
|
width: auto;
|
|
407
407
|
text-align: center;
|
|
408
408
|
font-family: ${t.fonts.secondary}, ${t.fonts.fallback};
|
|
409
|
-
`,
|
|
409
|
+
`, H = s.fieldset`
|
|
410
410
|
padding: 0;
|
|
411
411
|
height: auto;
|
|
412
412
|
width: 100%;
|
|
413
|
-
`,
|
|
413
|
+
`, G = s.div`
|
|
414
414
|
padding: ${t.spacing.small};
|
|
415
415
|
height: auto;
|
|
416
416
|
width: 100%;
|
|
417
|
-
`,
|
|
417
|
+
`, J = s.div`
|
|
418
418
|
display: flex;
|
|
419
419
|
justify-content: center;
|
|
420
420
|
align-items: center;
|
|
@@ -423,44 +423,44 @@ const t = {
|
|
|
423
423
|
font-family: ${t.fonts.tertiary}, ${t.fonts.fallback};
|
|
424
424
|
font-size: ${t.fontSize.xsmall};
|
|
425
425
|
font-weight: ${t.fontWeight.bold};
|
|
426
|
-
`, xe =
|
|
426
|
+
`, xe = s.form`
|
|
427
427
|
display: flex;
|
|
428
428
|
flex-direction: column;
|
|
429
429
|
align-items: center;
|
|
430
430
|
width: 100%;
|
|
431
|
-
`,
|
|
431
|
+
`, K = s.div`
|
|
432
432
|
display: flex;
|
|
433
433
|
justify-content: space-between;
|
|
434
434
|
width: 100%;
|
|
435
|
-
`, $e =
|
|
435
|
+
`, $e = s.div`
|
|
436
436
|
width: 100%;
|
|
437
437
|
display: flex;
|
|
438
438
|
flex-direction: column;
|
|
439
439
|
align-items: center;
|
|
440
440
|
justify-content: center;
|
|
441
|
-
`,
|
|
441
|
+
`, Ce = ({
|
|
442
442
|
fieldsets: n = null,
|
|
443
443
|
//* if a form has differrent fieldsets
|
|
444
444
|
legendText: o,
|
|
445
445
|
//* if form has no fieldsets, depends if you have fieldset for solo form
|
|
446
|
-
isExpandable:
|
|
446
|
+
isExpandable: l,
|
|
447
447
|
//* if form has no fieldsets this is default to false - to add inputs
|
|
448
|
-
id:
|
|
448
|
+
id: i,
|
|
449
449
|
formInputs: r,
|
|
450
450
|
//* object that contains the input fields information to make it reusable
|
|
451
|
-
labelAndInputContainerClass:
|
|
452
|
-
labelClass:
|
|
453
|
-
inputClass:
|
|
454
|
-
handleEditableInputEntryChange:
|
|
451
|
+
labelAndInputContainerClass: d,
|
|
452
|
+
labelClass: m,
|
|
453
|
+
inputClass: c,
|
|
454
|
+
handleEditableInputEntryChange: h,
|
|
455
455
|
//* handles change on editable inputs
|
|
456
456
|
handleAddingInputEntry: $,
|
|
457
457
|
hasSubmit: p = !1,
|
|
458
|
-
hasCancel:
|
|
458
|
+
hasCancel: u = !1,
|
|
459
459
|
hasDelete: k = !1,
|
|
460
|
-
hasEdit:
|
|
461
|
-
submitText:
|
|
460
|
+
hasEdit: C = !1,
|
|
461
|
+
submitText: N,
|
|
462
462
|
handleSubmitForm: F,
|
|
463
|
-
handleSubmit:
|
|
463
|
+
handleSubmit: A,
|
|
464
464
|
cancelText: S,
|
|
465
465
|
handleCancel: L,
|
|
466
466
|
deleteText: B,
|
|
@@ -470,117 +470,123 @@ const t = {
|
|
|
470
470
|
className: E,
|
|
471
471
|
children: D
|
|
472
472
|
//* if there are nodes to be inserted after submit/edit/cancel buttons usually in login or signup forms
|
|
473
|
-
}) => /* @__PURE__ */
|
|
474
|
-
n ? n.map((a, y) => /* @__PURE__ */
|
|
475
|
-
/* @__PURE__ */
|
|
476
|
-
a.legend && /* @__PURE__ */ e(
|
|
477
|
-
a.inputs.length !== 0 ? a.inputs.map((
|
|
478
|
-
|
|
479
|
-
|
|
473
|
+
}) => /* @__PURE__ */ g(xe, { id: `${i}-form`, className: E, onSubmit: F, children: [
|
|
474
|
+
n ? n.map((a, y) => /* @__PURE__ */ g(G, { children: [
|
|
475
|
+
/* @__PURE__ */ g(H, { id: `${i}-form-fieldset-${y}`, className: "form-fieldset", children: [
|
|
476
|
+
a.legend && /* @__PURE__ */ e(U, { children: a.legend }),
|
|
477
|
+
a.inputs.length !== 0 ? a.inputs.map((f, v) => /* @__PURE__ */ g(W.Fragment, { children: [
|
|
478
|
+
f.type === "textarea" && /* @__PURE__ */ e(
|
|
479
|
+
T,
|
|
480
480
|
{
|
|
481
|
-
...
|
|
482
|
-
id:
|
|
483
|
-
labelClass:
|
|
484
|
-
inputClass:
|
|
485
|
-
idx: v
|
|
481
|
+
...f,
|
|
482
|
+
id: f.id ?? `${a.legend}-input`,
|
|
483
|
+
labelClass: m,
|
|
484
|
+
inputClass: c,
|
|
485
|
+
idx: v,
|
|
486
|
+
className: d
|
|
486
487
|
}
|
|
487
488
|
),
|
|
488
|
-
(
|
|
489
|
-
|
|
489
|
+
(f.type === "radio" || f.type === "checkbox") && /* @__PURE__ */ e(
|
|
490
|
+
T,
|
|
490
491
|
{
|
|
491
|
-
...
|
|
492
|
-
id:
|
|
493
|
-
labelClass:
|
|
494
|
-
inputClass:
|
|
495
|
-
idx: v
|
|
492
|
+
...f,
|
|
493
|
+
id: f.id ?? `${a.legend}-input`,
|
|
494
|
+
labelClass: m,
|
|
495
|
+
inputClass: c,
|
|
496
|
+
idx: v,
|
|
497
|
+
className: d
|
|
496
498
|
}
|
|
497
499
|
),
|
|
498
|
-
|
|
499
|
-
|
|
500
|
+
f.type !== "textarea" && f.type !== "radio" && f.type !== "checkbox" && /* @__PURE__ */ e(
|
|
501
|
+
T,
|
|
500
502
|
{
|
|
501
|
-
...
|
|
502
|
-
id:
|
|
503
|
-
labelClass:
|
|
504
|
-
inputClass:
|
|
505
|
-
idx: v
|
|
503
|
+
...f,
|
|
504
|
+
id: f.id ?? `${a.legend}-input`,
|
|
505
|
+
labelClass: m,
|
|
506
|
+
inputClass: c,
|
|
507
|
+
idx: v,
|
|
508
|
+
className: d
|
|
506
509
|
}
|
|
507
510
|
),
|
|
508
|
-
|
|
509
|
-
|
|
511
|
+
f.editable && f.editing && /* @__PURE__ */ e(
|
|
512
|
+
M,
|
|
510
513
|
{
|
|
511
514
|
legend: `${a.legend} ${v + 1}`,
|
|
512
515
|
idx: v,
|
|
513
|
-
editableInformation:
|
|
514
|
-
onChangeOfEditableOption:
|
|
515
|
-
onClickSaveEdit:
|
|
516
|
-
onClickCancelEdit:
|
|
517
|
-
onClickDeleteEntry:
|
|
516
|
+
editableInformation: f?.editableInformation,
|
|
517
|
+
onChangeOfEditableOption: h,
|
|
518
|
+
onClickSaveEdit: f?.onClickSave,
|
|
519
|
+
onClickCancelEdit: f?.onClickCancel,
|
|
520
|
+
onClickDeleteEntry: f?.onClickDelete
|
|
518
521
|
}
|
|
519
522
|
)
|
|
520
|
-
] }, `form-${
|
|
523
|
+
] }, `form-${i}-${v}`)) : a.expandable ? /* @__PURE__ */ e(J, { children: `No entry yet on ${a.legend}. Click "+" button to add entry.` }) : ""
|
|
521
524
|
] }),
|
|
522
|
-
a.expandable && /* @__PURE__ */ e(
|
|
523
|
-
] }, `${a.legend}-${y}`)) : /* @__PURE__ */
|
|
524
|
-
/* @__PURE__ */
|
|
525
|
-
o && /* @__PURE__ */ e(
|
|
526
|
-
r.length !== 0 ? r.map((a, y) => /* @__PURE__ */
|
|
525
|
+
a.expandable && /* @__PURE__ */ e(K, { className: "add-input-button-space", children: /* @__PURE__ */ e(x, { id: `expand-${a.legend}-inputs`, buttonType: "button", text: "+", onClick: $, className: "add-input-entry" }) })
|
|
526
|
+
] }, `${a.legend}-${y}`)) : /* @__PURE__ */ g(G, { children: [
|
|
527
|
+
/* @__PURE__ */ g(H, { id: `${i}-form-fieldset`, className: "form-fieldset", children: [
|
|
528
|
+
o && /* @__PURE__ */ e(U, { children: o }),
|
|
529
|
+
r.length !== 0 ? r.map((a, y) => /* @__PURE__ */ g(W.Fragment, { children: [
|
|
527
530
|
a.type === "textarea" && /* @__PURE__ */ e(
|
|
528
|
-
|
|
531
|
+
T,
|
|
529
532
|
{
|
|
530
533
|
...a,
|
|
531
534
|
id: a.id ?? `${o}-input`,
|
|
532
|
-
labelClass:
|
|
533
|
-
inputClass:
|
|
534
|
-
idx: y
|
|
535
|
+
labelClass: m,
|
|
536
|
+
inputClass: c,
|
|
537
|
+
idx: y,
|
|
538
|
+
className: d
|
|
535
539
|
}
|
|
536
540
|
),
|
|
537
541
|
(a.type === "radio" || a.type === "checkbox") && /* @__PURE__ */ e(
|
|
538
|
-
|
|
542
|
+
T,
|
|
539
543
|
{
|
|
540
544
|
...a,
|
|
541
545
|
id: a.id ?? `${o}-input`,
|
|
542
|
-
labelClass:
|
|
543
|
-
inputClass:
|
|
544
|
-
idx: y
|
|
546
|
+
labelClass: m,
|
|
547
|
+
inputClass: c,
|
|
548
|
+
idx: y,
|
|
549
|
+
className: d
|
|
545
550
|
}
|
|
546
551
|
),
|
|
547
552
|
a.type !== "textarea" && a.type !== "radio" && a.type !== "checkbox" && /* @__PURE__ */ e(
|
|
548
|
-
|
|
553
|
+
T,
|
|
549
554
|
{
|
|
550
555
|
...a,
|
|
551
556
|
id: a.id ?? `${o}-input`,
|
|
552
|
-
labelClass:
|
|
553
|
-
inputClass:
|
|
554
|
-
idx: y
|
|
557
|
+
labelClass: m,
|
|
558
|
+
inputClass: c,
|
|
559
|
+
idx: y,
|
|
560
|
+
className: d
|
|
555
561
|
}
|
|
556
562
|
),
|
|
557
563
|
a.editable && a.editing && /* @__PURE__ */ e(
|
|
558
|
-
|
|
564
|
+
M,
|
|
559
565
|
{
|
|
560
566
|
legend: `${o} ${y + 1}`,
|
|
561
567
|
idx: y,
|
|
562
568
|
editableInformation: a?.editableInformation,
|
|
563
|
-
onChangeOfEditableOption:
|
|
569
|
+
onChangeOfEditableOption: h,
|
|
564
570
|
onClickSaveEdit: a?.onClickSave,
|
|
565
571
|
onClickCancelEdit: a?.onClickEdit,
|
|
566
572
|
onClickDeleteEntry: a?.onClickDelete
|
|
567
573
|
}
|
|
568
574
|
)
|
|
569
|
-
] }, `form-${
|
|
575
|
+
] }, `form-${i}-${y}`)) : l ? /* @__PURE__ */ e(J, { children: `No entry yet on ${o}. Please click "+" button to add` }) : ""
|
|
570
576
|
] }),
|
|
571
|
-
|
|
577
|
+
l && /* @__PURE__ */ e(K, { className: "add-input-button-space", children: /* @__PURE__ */ e(x, { id: `expand-${o}-inputs`, buttonType: "button", text: "+", onClick: $, className: "add-input-entry" }) })
|
|
572
578
|
] }),
|
|
573
579
|
/* @__PURE__ */ e(
|
|
574
|
-
|
|
580
|
+
ue,
|
|
575
581
|
{
|
|
576
|
-
id:
|
|
582
|
+
id: i,
|
|
577
583
|
hasSubmit: p,
|
|
578
|
-
submitText:
|
|
579
|
-
handleSubmit:
|
|
580
|
-
hasEdit:
|
|
584
|
+
submitText: N,
|
|
585
|
+
handleSubmit: A,
|
|
586
|
+
hasEdit: C,
|
|
581
587
|
editText: R,
|
|
582
588
|
handleEdit: w,
|
|
583
|
-
hasCancel:
|
|
589
|
+
hasCancel: u,
|
|
584
590
|
cancelText: S,
|
|
585
591
|
handleCancel: L,
|
|
586
592
|
hasDelete: k,
|
|
@@ -590,9 +596,9 @@ const t = {
|
|
|
590
596
|
),
|
|
591
597
|
/* @__PURE__ */ e($e, { className: "children-container", children: D })
|
|
592
598
|
] }), ye = (n) => {
|
|
593
|
-
const o = /^#([0-9A-Fa-f]{3}){1,2}$/,
|
|
594
|
-
return o.test(n) ||
|
|
595
|
-
},
|
|
599
|
+
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
|
+
return o.test(n) || l.test(n) || CSS.supports("color", n);
|
|
601
|
+
}, b = (n) => {
|
|
596
602
|
if (!ye(n)) throw new Error(`Invalid color: ${n}`);
|
|
597
603
|
return n;
|
|
598
604
|
}, Fe = {
|
|
@@ -607,42 +613,42 @@ const t = {
|
|
|
607
613
|
}, O = {
|
|
608
614
|
name: "light",
|
|
609
615
|
colors: {
|
|
610
|
-
text:
|
|
611
|
-
bg:
|
|
612
|
-
blue:
|
|
613
|
-
blue2:
|
|
614
|
-
teal:
|
|
615
|
-
teal2:
|
|
616
|
-
gray:
|
|
617
|
-
information:
|
|
618
|
-
success:
|
|
619
|
-
warning:
|
|
620
|
-
error:
|
|
616
|
+
text: b("#333446"),
|
|
617
|
+
bg: b("#EEEEEE"),
|
|
618
|
+
blue: b("#7F8CAA"),
|
|
619
|
+
blue2: b("#80A6FF"),
|
|
620
|
+
teal: b("#5b8280ff"),
|
|
621
|
+
teal2: b("#AEEAE7"),
|
|
622
|
+
gray: b("#AEAEAE"),
|
|
623
|
+
information: b("#202234"),
|
|
624
|
+
success: b("#123524"),
|
|
625
|
+
warning: b("#F2C265"),
|
|
626
|
+
error: b("#990000")
|
|
621
627
|
}
|
|
622
628
|
}, pe = {
|
|
623
629
|
name: "dark",
|
|
624
630
|
colors: {
|
|
625
|
-
bg:
|
|
626
|
-
text:
|
|
627
|
-
blue:
|
|
628
|
-
blue2:
|
|
629
|
-
teal:
|
|
630
|
-
teal2:
|
|
631
|
-
gray:
|
|
632
|
-
information:
|
|
633
|
-
success:
|
|
634
|
-
warning:
|
|
635
|
-
error:
|
|
631
|
+
bg: b("#333446"),
|
|
632
|
+
text: b("#EEEEEE"),
|
|
633
|
+
blue: b("#80A6FF"),
|
|
634
|
+
blue2: b("#7F8CAA"),
|
|
635
|
+
teal: b("#AEEAE7"),
|
|
636
|
+
teal2: b("#5b8280ff"),
|
|
637
|
+
gray: b("#D0D0DD"),
|
|
638
|
+
information: b("#C9E6F0"),
|
|
639
|
+
success: b("#9EDF9C"),
|
|
640
|
+
warning: b("#FCFFC1"),
|
|
641
|
+
error: b("#FAD4D4")
|
|
636
642
|
}
|
|
637
|
-
},
|
|
638
|
-
const [o,
|
|
639
|
-
|
|
643
|
+
}, Q = Y(void 0), Ee = ({ children: n }) => {
|
|
644
|
+
const [o, l] = Z(O), i = () => {
|
|
645
|
+
l((r) => r === O ? pe : O);
|
|
640
646
|
};
|
|
641
|
-
return /* @__PURE__ */ e(
|
|
642
|
-
}, ve = () =>
|
|
647
|
+
return /* @__PURE__ */ e(Q.Provider, { value: { currentTheme: o, toggleTheme: i }, children: /* @__PURE__ */ e(I, { theme: o, children: n }) });
|
|
648
|
+
}, ve = () => _(Q);
|
|
643
649
|
export {
|
|
644
|
-
|
|
645
|
-
|
|
650
|
+
Ce as DynamicForm,
|
|
651
|
+
Q as ThemeContext,
|
|
646
652
|
Ee as ThemeContextProvider,
|
|
647
653
|
Fe as breakpoints,
|
|
648
654
|
pe as darkTheme,
|
package/dist/type/propTypes.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ type stringType = string | undefined;
|
|
|
11
11
|
type dataAttributesType = Record<string, string | number | boolean> | undefined;
|
|
12
12
|
type ButtonType = 'button' | 'submit';
|
|
13
13
|
export interface ButtonProps {
|
|
14
|
-
onClick: React.MouseEventHandler<HTMLButtonElement
|
|
14
|
+
onClick: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
15
15
|
id: string;
|
|
16
16
|
buttonType: ButtonType;
|
|
17
17
|
source?: string;
|
|
@@ -23,9 +23,9 @@ export interface ButtonProps {
|
|
|
23
23
|
dataAttributes?: dataAttributesType;
|
|
24
24
|
}
|
|
25
25
|
declare const InputTypes: readonly ["text", "password", "email", "number", "tel", "url", "search", "date", "file", "hidden"];
|
|
26
|
-
interface BaseInput {
|
|
26
|
+
export interface BaseInput {
|
|
27
27
|
id: string;
|
|
28
|
-
onChange: React.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement
|
|
28
|
+
onChange: React.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
|
|
29
29
|
isRequired: boolean;
|
|
30
30
|
dataAttributes?: dataAttributesType;
|
|
31
31
|
disabled?: boolean | undefined;
|
|
@@ -89,7 +89,7 @@ export interface FormActionButtonsProps {
|
|
|
89
89
|
deleteText: string;
|
|
90
90
|
handleDelete: React.MouseEventHandler<HTMLButtonElement>;
|
|
91
91
|
}
|
|
92
|
-
interface EditableInformation {
|
|
92
|
+
export interface EditableInformation {
|
|
93
93
|
name: string;
|
|
94
94
|
info: string;
|
|
95
95
|
type: typeof InputTypes[number];
|
|
@@ -98,7 +98,7 @@ export interface NestedEditableOptionProps {
|
|
|
98
98
|
legend: string;
|
|
99
99
|
idx: number;
|
|
100
100
|
editableInformation: EditableInformation[];
|
|
101
|
-
onChangeOfEditableOption: React.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement
|
|
101
|
+
onChangeOfEditableOption: React.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement> | undefined;
|
|
102
102
|
onClickSaveEdit: React.MouseEventHandler<HTMLButtonElement>;
|
|
103
103
|
onClickCancelEdit: React.MouseEventHandler<HTMLButtonElement>;
|
|
104
104
|
onClickDeleteEntry: React.MouseEventHandler<HTMLButtonElement>;
|
|
@@ -123,22 +123,33 @@ export type inputEntryShape<T extends boolean> = LabeledInputProps & {
|
|
|
123
123
|
onClickSave?: never;
|
|
124
124
|
onClickCancel?: never;
|
|
125
125
|
});
|
|
126
|
-
interface FieldsetShape {
|
|
126
|
+
export interface FieldsetShape {
|
|
127
127
|
legend: string;
|
|
128
128
|
inputs: inputEntryShape<boolean>[];
|
|
129
129
|
height: string;
|
|
130
130
|
expandable: boolean;
|
|
131
131
|
}
|
|
132
|
-
export type DynamicFormProps = FormActionButtonsProps & LabeledInputProps & {
|
|
133
|
-
fieldsets: FieldsetShape[] | null;
|
|
132
|
+
export type DynamicFormProps<T extends null, K extends boolean, E extends boolean> = FormActionButtonsProps & LabeledInputProps & {
|
|
133
|
+
fieldsets: FieldsetShape[] | null | T;
|
|
134
134
|
id: string;
|
|
135
|
+
isExpandable: K;
|
|
136
|
+
handleSubmitForm: React.FormEventHandler<HTMLFormElement>;
|
|
137
|
+
} & (T extends null ? {
|
|
135
138
|
formInputs: inputEntryShape<boolean>[];
|
|
136
139
|
legendText?: string;
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
+
labelAndInputContainerClass?: string;
|
|
141
|
+
} : {
|
|
142
|
+
formInputs?: never;
|
|
143
|
+
legendText?: never;
|
|
144
|
+
labelAndInputContainerClass?: never;
|
|
145
|
+
}) & (E extends true ? {
|
|
140
146
|
handleEditableInputEntryChange: React.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>;
|
|
147
|
+
} : {
|
|
148
|
+
handleEditableInputEntryChange?: never;
|
|
149
|
+
}) & (K extends true ? {
|
|
141
150
|
handleAddingInputEntry: React.MouseEventHandler<HTMLButtonElement>;
|
|
142
|
-
}
|
|
151
|
+
} : {
|
|
152
|
+
handleAddingInputEntry?: never;
|
|
153
|
+
});
|
|
143
154
|
export {};
|
|
144
155
|
//# sourceMappingURL=propTypes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propTypes.d.ts","sourceRoot":"","sources":["../../src/type/propTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,KAAK,CAAC;IACpB,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,KAAK,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;AAErC,KAAK,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAC,MAAM,GAAC,OAAO,CAAC,GAAG,SAAS,CAAA;AAE3E,KAAK,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEtC,MAAM,WAAW,WAAW;IACxB,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CA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