@kbgarcia8/react-dynamic-form 1.1.38 → 1.1.39

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,2GAmDT,CAAC;AAEH,eAAe,KAAK,CAAC"}
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,2GAoDT,CAAC;AAEH,eAAe,KAAK,CAAC"}
@@ -111,7 +111,7 @@
111
111
  max-width: 100%;
112
112
  resize: none;
113
113
  overflow-y: auto;
114
- `,A=F.forwardRef((a,o)=>{const{type:s,id:i,onChange:m,isRequired:r,dataAttributes:d={},disabled:b,className:h}=a;if(s==="textarea"){const{rows:y=5,cols:N=30,value:E,...v}=a;return e.jsx(ne,{onChange:m,value:E,rows:y,cols:N,className:h,ref:o,disabled:b,required:r,...v,...d})}if(s==="radio"||s==="checkbox"){const{checked:y,...N}=a;return e.jsx(B,{ref:o,checked:y,onChange:m,disabled:b,className:h,...N,...d})}const u=a,{value:j,pattern:$,placeholderText:k,...C}=u;return e.jsx(B,{placeholder:k,onChange:m,value:j,required:r,className:h,ref:o,disabled:b,pattern:$,...C,...d})}),w=a=>{const{className:o,type:s,id:i,textLabel:m,additionalInfo:r,$labelFlexDirection:d,svg:b,labelClass:h,onChange:u,isRequired:j,dataAttributes:$,inputClass:k,ref:C,disabled:y,isEditable:N,editIcon:E,onClickEdit:v,deleteIcon:D,onClickDelete:S,idx:T,children:q}=a;return e.jsxs(Y,{className:`${o} ${i.replace("#","")}-label-input-container`,children:[s!=="radio"&&s!=="checkbox"&&e.jsx(R,{htmlFor:i,textLabel:m,additionalInfo:r,$labelFlexDirection:d,svg:b,className:h}),s!=="radio"&&s!=="checkbox"&&s==="textarea"&&(()=>{const{rows:n=5,cols:g=30,value:l,...p}=a;return e.jsx(A,{id:i,name:i,type:"textarea",isRequired:j,onChange:u,value:l,rows:n,cols:g,dataAttributes:$,className:k,ref:C,disabled:y})})(),s!=="radio"&&s!=="checkbox"&&s!=="textarea"&&(()=>{const n=a,{value:g,pattern:l,placeholderText:p,...z}=n;return e.jsx(A,{id:i,name:i,placeholderText:p,onChange:u,value:g,type:s,isRequired:j,dataAttributes:$,className:k,ref:C,disabled:y,pattern:l})})(),(s==="radio"||s==="checkbox")&&(()=>{const{checked:n,...g}=a;return e.jsxs(e.Fragment,{children:[e.jsx(A,{ref:C,type:s,name:i,id:i,isRequired:j,checked:n,onChange:u,disabled:y,className:k,dataAttributes:$}),e.jsx(R,{htmlFor:i,textLabel:m,additionalInfo:r,$labelFlexDirection:d,svg:b,className:h})]})})(),N&&e.jsxs(Z,{className:"input-edit-buttons",children:[e.jsx(f,{id:`editable-${i}-edit-btn`,svg:E,buttonType:"button",onClick:v,className:`edit-radio-${T}`,dataAttributes:$}),e.jsx(f,{id:`editable-${i}-delete-btn`,svg:D,buttonType:"button",onClick:S,className:`delete-radio-${T}`,dataAttributes:$})]}),q]})},se=c.fieldset`
114
+ `,A=F.forwardRef((a,o)=>{const{type:s,id:i,onChange:m,isRequired:r,dataAttributes:d={},disabled:b,className:h}=a;if(s==="textarea"){const{rows:y=5,cols:N=30,value:E,...v}=a;return e.jsx(ne,{onChange:m,value:E,rows:y,cols:N,className:h,ref:o,disabled:b,required:r,...v,...d})}if(s==="radio"||s==="checkbox"){const{checked:y,...N}=a;return e.jsx(B,{ref:o,checked:y,onChange:m,disabled:b,className:h,required:r,...N,...d})}const u=a,{value:j,pattern:$,placeholderText:k,...C}=u;return e.jsx(B,{placeholder:k,onChange:m,value:j,required:r,className:h,ref:o,disabled:b,pattern:$,...C,...d})}),w=a=>{const{className:o,type:s,id:i,textLabel:m,additionalInfo:r,$labelFlexDirection:d,svg:b,labelClass:h,onChange:u,isRequired:j,dataAttributes:$,inputClass:k,ref:C,disabled:y,isEditable:N,editIcon:E,onClickEdit:v,deleteIcon:D,onClickDelete:S,idx:T,children:q}=a;return e.jsxs(Y,{className:`${o} ${i.replace("#","")}-label-input-container`,children:[s!=="radio"&&s!=="checkbox"&&e.jsx(R,{htmlFor:i,textLabel:m,additionalInfo:r,$labelFlexDirection:d,svg:b,className:h}),s!=="radio"&&s!=="checkbox"&&s==="textarea"&&(()=>{const{rows:n=5,cols:g=30,value:l,...p}=a;return e.jsx(A,{id:i,name:i,type:"textarea",isRequired:j,onChange:u,value:l,rows:n,cols:g,dataAttributes:$,className:k,ref:C,disabled:y})})(),s!=="radio"&&s!=="checkbox"&&s!=="textarea"&&(()=>{const n=a,{value:g,pattern:l,placeholderText:p,...z}=n;return e.jsx(A,{id:i,name:i,placeholderText:p,onChange:u,value:g,type:s,isRequired:j,dataAttributes:$,className:k,ref:C,disabled:y,pattern:l})})(),(s==="radio"||s==="checkbox")&&(()=>{const{checked:n,...g}=a;return e.jsxs(e.Fragment,{children:[e.jsx(A,{ref:C,type:s,name:i,id:i,isRequired:j,checked:n,onChange:u,disabled:y,className:k,dataAttributes:$}),e.jsx(R,{htmlFor:i,textLabel:m,additionalInfo:r,$labelFlexDirection:d,svg:b,className:h})]})})(),N&&e.jsxs(Z,{className:"input-edit-buttons",children:[e.jsx(f,{id:`editable-${i}-edit-btn`,svg:E,buttonType:"button",onClick:v,className:`edit-radio-${T}`,dataAttributes:$}),e.jsx(f,{id:`editable-${i}-delete-btn`,svg:D,buttonType:"button",onClick:S,className:`delete-radio-${T}`,dataAttributes:$})]}),q]})},se=c.fieldset`
115
115
  padding: 0;
116
116
  height: auto;
117
117
  width: 100%;
@@ -1,6 +1,6 @@
1
- import { jsx as a, jsxs as u, Fragment as R } from "react/jsx-runtime";
2
- import q, { forwardRef as K, createContext as Q, useState as V, useContext as X } from "react";
3
- import c, { ThemeProvider as Y } from "styled-components";
1
+ import { jsx as a, jsxs as f, Fragment as q } from "react/jsx-runtime";
2
+ import R, { forwardRef as K, createContext as Q, useState as V, useContext as X } from "react";
3
+ import r, { ThemeProvider as Y } from "styled-components";
4
4
  const e = {
5
5
  fonts: {
6
6
  secondary: "Raleway",
@@ -32,7 +32,7 @@ const e = {
32
32
  thin: "0.0625rem",
33
33
  light: "0.125rem"
34
34
  }
35
- }, Z = c.button`
35
+ }, Z = r.button`
36
36
  display: flex;
37
37
  align-items: center;
38
38
  justify-content: center;
@@ -58,15 +58,15 @@ const e = {
58
58
  & .button-icon-text-space svg {
59
59
  max-width: 100%;
60
60
  }
61
- `, _ = c.div`
61
+ `, _ = r.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
- `, I = c.img`
67
+ `, I = r.img`
68
68
  maxwidth: 100%;
69
- `, ee = c.span`
69
+ `, ee = r.span`
70
70
  font-size: ${e.fontSize.xsmall};
71
71
  font-weight: ${e.fontWeight.medium};
72
72
  font-family: ${e.fonts.tertiary}, ${e.fonts.fallback};
@@ -79,10 +79,10 @@ const e = {
79
79
  buttonType: o,
80
80
  source: l,
81
81
  svg: m,
82
- alt: r = "alt-button-icon",
82
+ alt: c = "alt-button-icon",
83
83
  text: d = "",
84
84
  className: h = "",
85
- dataAttributes: f = {}
85
+ dataAttributes: u = {}
86
86
  }) => /* @__PURE__ */ a(
87
87
  Z,
88
88
  {
@@ -90,24 +90,24 @@ const e = {
90
90
  id: i,
91
91
  type: o,
92
92
  className: h,
93
- ...f,
94
- children: /* @__PURE__ */ u(_, { className: "button-icon-text-space", children: [
95
- l ? /* @__PURE__ */ a(I, { src: l, alt: r }) : m || "",
93
+ ...u,
94
+ children: /* @__PURE__ */ f(_, { className: "button-icon-text-space", children: [
95
+ l ? /* @__PURE__ */ a(I, { src: l, alt: c }) : m || "",
96
96
  d && /* @__PURE__ */ a(ee, { id: i, children: d })
97
97
  ] })
98
98
  }
99
- ), te = c.div`
99
+ ), te = r.div`
100
100
  display: flex;
101
101
  flex-direction: column;
102
102
  align-items: left;
103
103
  width: 100%;
104
104
  margin-bottom: ${e.spacing.small};
105
- `, ae = c.div`
105
+ `, ae = r.div`
106
106
  display: flex;
107
107
  gap: ${e.spacing.xsmall};
108
108
  width: auto;
109
109
  height: auto;
110
- `, ne = c.label`
110
+ `, ne = r.label`
111
111
  display: flex;
112
112
  align-items: center;
113
113
  justify-content:center;
@@ -124,19 +124,19 @@ const e = {
124
124
  height: auto;
125
125
  object-fit: contain;
126
126
  }
127
- `, oe = c.div`
127
+ `, oe = r.div`
128
128
  display: flex;
129
129
  flex-direction: column;
130
130
  align-items: center;
131
131
  justify-content: center;
132
132
  gap: ${e.spacing.xxxsmall};
133
- `, ie = c.span`
133
+ `, ie = r.span`
134
134
  font-weight: ${e.fontWeight.bolder};
135
- `, le = c.div`
135
+ `, le = r.div`
136
136
  max-width: 100%;
137
137
  display: flex;
138
138
  align-items: center;
139
- `, se = c.span`
139
+ `, se = r.span`
140
140
  font-weight: ${e.fontWeight.light};
141
141
  `, B = ({
142
142
  htmlFor: t,
@@ -144,17 +144,17 @@ const e = {
144
144
  additionalInfo: o,
145
145
  $labelFlexDirection: l,
146
146
  source: m,
147
- svg: r,
147
+ svg: c,
148
148
  className: d,
149
149
  children: h
150
- }) => /* @__PURE__ */ u(ne, { htmlFor: t, className: d, $labelFlexDirection: l, children: [
151
- (m || r) && /* @__PURE__ */ a(le, { className: "label-icon-container", children: m ? /* @__PURE__ */ a("img", { src: m, alt: `${t}-label-icon` }) : r || "" }),
152
- /* @__PURE__ */ u(oe, { className: "label-text-container", children: [
150
+ }) => /* @__PURE__ */ f(ne, { htmlFor: t, className: d, $labelFlexDirection: l, children: [
151
+ (m || c) && /* @__PURE__ */ a(le, { className: "label-icon-container", children: m ? /* @__PURE__ */ a("img", { src: m, alt: `${t}-label-icon` }) : c || "" }),
152
+ /* @__PURE__ */ f(oe, { className: "label-text-container", children: [
153
153
  /* @__PURE__ */ a(ie, { className: "main-label", children: i }),
154
154
  o && /* @__PURE__ */ a(se, { className: "additional-info", children: o })
155
155
  ] }),
156
156
  h
157
- ] }), W = c.input`
157
+ ] }), W = r.input`
158
158
  display: flex;
159
159
  place-content: center;
160
160
  font-family: ${e.fonts.secondary}, ${e.fonts.fallback};
@@ -171,7 +171,7 @@ const e = {
171
171
  &:focus{
172
172
  border: ${e.borderThickness.thin} solid ${({ theme: t }) => t.colors.teal};
173
173
  }
174
- `, ce = c.textarea`
174
+ `, ce = r.textarea`
175
175
  display: flex;
176
176
  place-content: center;
177
177
  border: ${e.borderThickness.light} solid ${({ theme: t }) => t.colors.text};
@@ -185,7 +185,7 @@ const e = {
185
185
  resize: none;
186
186
  overflow-y: auto;
187
187
  `, D = K((t, i) => {
188
- const { type: o, id: l, onChange: m, isRequired: r, dataAttributes: d = {}, disabled: h, className: f } = t;
188
+ const { type: o, id: l, onChange: m, isRequired: c, dataAttributes: d = {}, disabled: h, className: u } = t;
189
189
  if (o === "textarea") {
190
190
  const { rows: y = 5, cols: F = 30, value: v, ...A } = t;
191
191
  return /* @__PURE__ */ a(
@@ -195,10 +195,10 @@ const e = {
195
195
  value: v,
196
196
  rows: y,
197
197
  cols: F,
198
- className: f,
198
+ className: u,
199
199
  ref: i,
200
200
  disabled: h,
201
- required: r,
201
+ required: c,
202
202
  ...A,
203
203
  ...d
204
204
  }
@@ -213,7 +213,8 @@ const e = {
213
213
  checked: y,
214
214
  onChange: m,
215
215
  disabled: h,
216
- className: f,
216
+ className: u,
217
+ required: c,
217
218
  ...F,
218
219
  ...d
219
220
  }
@@ -226,8 +227,8 @@ const e = {
226
227
  placeholder: C,
227
228
  onChange: m,
228
229
  value: N,
229
- required: r,
230
- className: f,
230
+ required: c,
231
+ className: u,
231
232
  ref: i,
232
233
  disabled: h,
233
234
  pattern: p,
@@ -241,10 +242,10 @@ const e = {
241
242
  type: o,
242
243
  id: l,
243
244
  textLabel: m,
244
- additionalInfo: r,
245
+ additionalInfo: c,
245
246
  $labelFlexDirection: d,
246
247
  svg: h,
247
- labelClass: f,
248
+ labelClass: u,
248
249
  onChange: g,
249
250
  isRequired: N,
250
251
  dataAttributes: p,
@@ -259,8 +260,8 @@ const e = {
259
260
  idx: T,
260
261
  children: j
261
262
  } = t;
262
- return /* @__PURE__ */ u(te, { className: `${i} ${l.replace("#", "")}-label-input-container`, children: [
263
- o !== "radio" && o !== "checkbox" && /* @__PURE__ */ a(B, { htmlFor: l, textLabel: m, additionalInfo: r, $labelFlexDirection: d, svg: h, className: f }),
263
+ return /* @__PURE__ */ f(te, { className: `${i} ${l.replace("#", "")}-label-input-container`, children: [
264
+ o !== "radio" && o !== "checkbox" && /* @__PURE__ */ a(B, { htmlFor: l, textLabel: m, additionalInfo: c, $labelFlexDirection: d, svg: h, className: u }),
264
265
  o !== "radio" && o !== "checkbox" && o === "textarea" && (() => {
265
266
  const { rows: n = 5, cols: $ = 30, value: s, ...k } = t;
266
267
  return /* @__PURE__ */ a(
@@ -303,7 +304,7 @@ const e = {
303
304
  })(),
304
305
  (o === "radio" || o === "checkbox") && (() => {
305
306
  const { checked: n, ...$ } = t;
306
- return /* @__PURE__ */ u(R, { children: [
307
+ return /* @__PURE__ */ f(q, { children: [
307
308
  /* @__PURE__ */ a(
308
309
  D,
309
310
  {
@@ -319,32 +320,32 @@ const e = {
319
320
  dataAttributes: p
320
321
  }
321
322
  ),
322
- /* @__PURE__ */ a(B, { htmlFor: l, textLabel: m, additionalInfo: r, $labelFlexDirection: d, svg: h, className: f })
323
+ /* @__PURE__ */ a(B, { htmlFor: l, textLabel: m, additionalInfo: c, $labelFlexDirection: d, svg: h, className: u })
323
324
  ] });
324
325
  })(),
325
- F && /* @__PURE__ */ u(ae, { className: "input-edit-buttons", children: [
326
+ F && /* @__PURE__ */ f(ae, { className: "input-edit-buttons", children: [
326
327
  /* @__PURE__ */ a(x, { id: `editable-${l}-edit-btn`, svg: v, buttonType: "button", onClick: A, className: `edit-radio-${T}`, dataAttributes: p }),
327
328
  /* @__PURE__ */ a(x, { id: `editable-${l}-delete-btn`, svg: S, buttonType: "button", onClick: z, className: `delete-radio-${T}`, dataAttributes: p })
328
329
  ] }),
329
330
  j
330
331
  ] });
331
- }, re = c.fieldset`
332
+ }, re = r.fieldset`
332
333
  padding: 0;
333
334
  height: auto;
334
335
  width: 100%;
335
- `, de = c.legend`
336
+ `, de = r.legend`
336
337
  font-size: ${e.spacing.medium};
337
338
  font-weight: 500;
338
339
  margin: 0 auto ${e.spacing.small} auto;
339
340
  text-align: center;
340
341
  font-family: ${e.fonts.secondary}, ${e.fonts.fallback};
341
- `, me = c.div`
342
+ `, me = r.div`
342
343
  display: flex;
343
344
  flex-direction: column;
344
345
  align-items: flex-start;
345
346
  width: 100%;
346
347
  margin-bottom: ${e.spacing.small};
347
- `, be = c.div`
348
+ `, be = r.div`
348
349
  display: flex;
349
350
  justify-content: space-between;
350
351
  width: 100%;
@@ -354,69 +355,69 @@ const e = {
354
355
  idx: o,
355
356
  editableInformation: l,
356
357
  onChangeOfEditableOption: m,
357
- onClickSaveEdit: r,
358
+ onClickSaveEdit: c,
358
359
  onClickCancelEdit: d,
359
360
  onClickDeleteEntry: h
360
- }) => /* @__PURE__ */ u(re, { className: "editable-option-fieldset", children: [
361
+ }) => /* @__PURE__ */ f(re, { className: "editable-option-fieldset", children: [
361
362
  /* @__PURE__ */ a(de, { children: `${t} ${o + 1}` }),
362
- l?.map((f, g) => /* @__PURE__ */ a(me, { className: "editable-option-container", children: /* @__PURE__ */ a(
363
+ l?.map((u, g) => /* @__PURE__ */ a(me, { className: "editable-option-container", children: /* @__PURE__ */ a(
363
364
  D,
364
365
  {
365
366
  id: `editable-option-${g}`,
366
367
  name: `editable-option-${g}`,
367
- placeholderText: f.name.charAt(0).toUpperCase() + f.name.slice(1),
368
+ placeholderText: u.name.charAt(0).toUpperCase() + u.name.slice(1),
368
369
  onChange: m,
369
- value: f.info,
370
- type: f.type,
370
+ value: u.info,
371
+ type: u.type,
371
372
  isRequired: !0,
372
373
  className: "editable-option",
373
374
  dataAttributes: {
374
375
  "data-index": g,
375
376
  "data-fieldsetindex": i,
376
- "data-key": f.info
377
+ "data-key": u.info
377
378
  }
378
379
  }
379
- ) }, `${f.name}-${g}`)),
380
- /* @__PURE__ */ u(be, { className: "editable-option-button-space", children: [
381
- /* @__PURE__ */ a(x, { id: `editable-option-${o}-submit`, buttonType: "button", text: "Save", onClick: r, className: "editable-option-btn", dataAttributes: { "data-index": o, "data-fieldsetindex": i } }),
380
+ ) }, `${u.name}-${g}`)),
381
+ /* @__PURE__ */ f(be, { className: "editable-option-button-space", children: [
382
+ /* @__PURE__ */ a(x, { id: `editable-option-${o}-submit`, buttonType: "button", text: "Save", onClick: c, className: "editable-option-btn", dataAttributes: { "data-index": o, "data-fieldsetindex": i } }),
382
383
  /* @__PURE__ */ a(x, { id: `editable-option-${o}-cancel`, buttonType: "button", text: "Cancel", onClick: d, className: "editable-option-btn", dataAttributes: { "data-index": o, "data-fieldsetindex": i } }),
383
384
  /* @__PURE__ */ a(x, { id: `editable-option-${o}-delete`, buttonType: "button", text: "Delete", onClick: h, className: "editable-option-btn", dataAttributes: { "data-index": o, "data-fieldsetindex": i } })
384
385
  ] })
385
- ] }), he = c.div`
386
+ ] }), he = r.div`
386
387
  display: flex;
387
388
  justify-content: space-between;
388
389
  max-width: 100%;
389
- `, fe = ({
390
+ `, ue = ({
390
391
  id: t,
391
392
  hasSubmit: i,
392
393
  submitText: o,
393
394
  handleSubmit: l,
394
395
  hasReset: m,
395
- resetText: r,
396
+ resetText: c,
396
397
  handleReset: d,
397
398
  hasCancel: h,
398
- cancelText: f,
399
+ cancelText: u,
399
400
  handleCancel: g
400
- }) => /* @__PURE__ */ u(he, { className: "form-main-button-container", children: [
401
+ }) => /* @__PURE__ */ f(he, { className: "form-main-button-container", children: [
401
402
  i && /* @__PURE__ */ a(x, { id: `form-${t}-submit`, buttonType: "submit", text: o ?? "Submit", onClick: l, className: "submit-form-btn" }),
402
- m && /* @__PURE__ */ a(x, { id: `form-${t}-edit`, buttonType: "button", text: r ?? "Reset", onClick: d, className: "reset-form-btn" }),
403
- h && /* @__PURE__ */ a(x, { id: `form-${t}-cancel`, buttonType: "button", text: f ?? "Cancel", onClick: g, className: "cancel-form-btn" })
404
- ] }), M = c.legend`
403
+ m && /* @__PURE__ */ a(x, { id: `form-${t}-edit`, buttonType: "button", text: c ?? "Reset", onClick: d, className: "reset-form-btn" }),
404
+ h && /* @__PURE__ */ a(x, { id: `form-${t}-cancel`, buttonType: "button", text: u ?? "Cancel", onClick: g, className: "cancel-form-btn" })
405
+ ] }), M = r.legend`
405
406
  font-size: ${e.spacing.medium};
406
407
  font-weight: 500;
407
408
  margin-bottom: ${e.spacing.small};
408
409
  width: auto;
409
410
  text-align: center;
410
411
  font-family: ${e.fonts.secondary}, ${e.fonts.fallback};
411
- `, U = c.fieldset`
412
+ `, U = r.fieldset`
412
413
  padding: 0;
413
414
  height: auto;
414
415
  width: 100%;
415
- `, H = c.div`
416
+ `, H = r.div`
416
417
  padding: ${e.spacing.small};
417
418
  height: auto;
418
419
  width: 100%;
419
- `, O = c.div`
420
+ `, O = r.div`
420
421
  display: flex;
421
422
  justify-content: center;
422
423
  align-items: center;
@@ -425,16 +426,16 @@ const e = {
425
426
  font-family: ${e.fonts.tertiary}, ${e.fonts.fallback};
426
427
  font-size: ${e.fontSize.xsmall};
427
428
  font-weight: ${e.fontWeight.bold};
428
- `, ue = c.form`
429
+ `, fe = r.form`
429
430
  display: flex;
430
431
  flex-direction: column;
431
432
  align-items: center;
432
433
  width: 100%;
433
- `, G = c.div`
434
+ `, G = r.div`
434
435
  display: flex;
435
436
  justify-content: space-between;
436
437
  width: 100%;
437
- `, ge = c.div`
438
+ `, ge = r.div`
438
439
  width: 100%;
439
440
  display: flex;
440
441
  flex-direction: column;
@@ -446,10 +447,10 @@ const e = {
446
447
  isExpandable: o,
447
448
  id: l,
448
449
  formInputs: m,
449
- labelAndInputContainerClass: r,
450
+ labelAndInputContainerClass: c,
450
451
  labelClass: d,
451
452
  inputClass: h,
452
- onChangeOfEditableOption: f,
453
+ onChangeOfEditableOption: u,
453
454
  handleAddingInputEntry: g,
454
455
  hasSubmit: N = !1,
455
456
  submitText: p,
@@ -463,11 +464,11 @@ const e = {
463
464
  handleSubmitForm: z,
464
465
  className: T,
465
466
  children: j
466
- }) => /* @__PURE__ */ u(ue, { id: `${l}-form`, className: T, onSubmit: z, children: [
467
- t ? t.map((n, $) => /* @__PURE__ */ u(H, { className: `${l}-fieldset-wrapper`, children: [
468
- /* @__PURE__ */ u(U, { id: `${l}-form-fieldset-${$}`, className: `${n.legend}-fieldset`, children: [
467
+ }) => /* @__PURE__ */ f(fe, { id: `${l}-form`, className: T, onSubmit: z, children: [
468
+ t ? t.map((n, $) => /* @__PURE__ */ f(H, { className: `${l}-fieldset-wrapper`, children: [
469
+ /* @__PURE__ */ f(U, { id: `${l}-form-fieldset-${$}`, className: `${n.legend}-fieldset`, children: [
469
470
  n.legend && /* @__PURE__ */ a(M, { className: `${n.legend}-legend`, children: n.legend }),
470
- n.inputs.length !== 0 ? n.inputs.map((s, k) => /* @__PURE__ */ u(q.Fragment, { children: [
471
+ n.inputs.length !== 0 ? n.inputs.map((s, k) => /* @__PURE__ */ f(R.Fragment, { children: [
471
472
  s.type === "textarea" && /* @__PURE__ */ a(
472
473
  E,
473
474
  {
@@ -476,7 +477,7 @@ const e = {
476
477
  labelClass: d,
477
478
  inputClass: h,
478
479
  idx: k,
479
- className: `${r} ${s?.uniqueClass}`
480
+ className: `${c} ${s?.uniqueClass}`
480
481
  }
481
482
  ),
482
483
  s.type !== "textarea" && s.type !== "radio" && s.type !== "checkbox" && /* @__PURE__ */ a(
@@ -487,10 +488,10 @@ const e = {
487
488
  labelClass: d,
488
489
  inputClass: h,
489
490
  idx: k,
490
- className: `${r} ${s?.uniqueClass}`
491
+ className: `${c} ${s?.uniqueClass}`
491
492
  }
492
493
  ),
493
- (s.type === "radio" || s.type === "checkbox") && /* @__PURE__ */ u(R, { children: [
494
+ (s.type === "radio" || s.type === "checkbox") && /* @__PURE__ */ f(q, { children: [
494
495
  /* @__PURE__ */ a(
495
496
  E,
496
497
  {
@@ -499,7 +500,7 @@ const e = {
499
500
  labelClass: d,
500
501
  inputClass: h,
501
502
  idx: k,
502
- className: `${r} ${s?.uniqueClass}`
503
+ className: `${c} ${s?.uniqueClass}`
503
504
  }
504
505
  ),
505
506
  s.editing && s.isEditable && /* @__PURE__ */ a(
@@ -509,7 +510,7 @@ const e = {
509
510
  fieldsetIndex: $,
510
511
  idx: k,
511
512
  editableInformation: s?.editableInformation || [],
512
- onChangeOfEditableOption: f,
513
+ onChangeOfEditableOption: u,
513
514
  onClickSaveEdit: s?.onClickSave || ((L) => {
514
515
  }),
515
516
  onClickCancelEdit: s?.onClickCancel || ((L) => {
@@ -522,10 +523,10 @@ const e = {
522
523
  ] }, `form-${l}-${k}`)) : n.isExpandable ? /* @__PURE__ */ a(O, { children: `No entry yet on ${n.legend}. Click "+" button to add entry.` }) : ""
523
524
  ] }),
524
525
  n.isExpandable && /* @__PURE__ */ a(G, { className: "add-input-button-space", children: /* @__PURE__ */ a(x, { id: `expand-${n.legend}-inputs`, buttonType: "button", text: "+", onClick: g, className: "add-input-entry", dataAttributes: { "data-fieldsetindex": $ } }) })
525
- ] }, `${n.legend}-${$}`)) : /* @__PURE__ */ u(H, { className: `${l}-fieldset-wrapper`, children: [
526
- /* @__PURE__ */ u(U, { id: `${l}-form-fieldset`, className: `${i}-fieldset`, children: [
526
+ ] }, `${n.legend}-${$}`)) : /* @__PURE__ */ f(H, { className: `${l}-fieldset-wrapper`, children: [
527
+ /* @__PURE__ */ f(U, { id: `${l}-form-fieldset`, className: `${i}-fieldset`, children: [
527
528
  i && /* @__PURE__ */ a(M, { className: `${i}-legend`, children: i }),
528
- !t && m && m.length !== 0 ? m.map((n, $) => /* @__PURE__ */ u(q.Fragment, { children: [
529
+ !t && m && m.length !== 0 ? m.map((n, $) => /* @__PURE__ */ f(R.Fragment, { children: [
529
530
  n.type === "textarea" && /* @__PURE__ */ a(
530
531
  E,
531
532
  {
@@ -534,7 +535,7 @@ const e = {
534
535
  labelClass: d,
535
536
  inputClass: h,
536
537
  idx: $,
537
- className: `${r} ${n?.uniqueClass}`
538
+ className: `${c} ${n?.uniqueClass}`
538
539
  }
539
540
  ),
540
541
  n.type !== "textarea" && n.type !== "radio" && n.type !== "checkbox" && /* @__PURE__ */ a(
@@ -545,10 +546,10 @@ const e = {
545
546
  labelClass: d,
546
547
  inputClass: h,
547
548
  idx: $,
548
- className: `${r} ${n?.uniqueClass}`
549
+ className: `${c} ${n?.uniqueClass}`
549
550
  }
550
551
  ),
551
- (n.type === "radio" || n.type === "checkbox") && /* @__PURE__ */ u(R, { children: [
552
+ (n.type === "radio" || n.type === "checkbox") && /* @__PURE__ */ f(q, { children: [
552
553
  /* @__PURE__ */ a(
553
554
  E,
554
555
  {
@@ -557,7 +558,7 @@ const e = {
557
558
  labelClass: d,
558
559
  inputClass: h,
559
560
  idx: $,
560
- className: `${r} ${n?.uniqueClass}`
561
+ className: `${c} ${n?.uniqueClass}`
561
562
  }
562
563
  ),
563
564
  n.editing && n.isEditable && /* @__PURE__ */ a(
@@ -566,7 +567,7 @@ const e = {
566
567
  legend: `${i}`,
567
568
  idx: $,
568
569
  editableInformation: n?.editableInformation,
569
- onChangeOfEditableOption: f,
570
+ onChangeOfEditableOption: u,
570
571
  onClickSaveEdit: n?.onClickSave || ((s) => {
571
572
  }),
572
573
  onClickCancelEdit: n?.onClickCancel || ((s) => {
@@ -581,7 +582,7 @@ const e = {
581
582
  o && /* @__PURE__ */ a(G, { className: "add-input-button-space", children: /* @__PURE__ */ a(x, { id: `expand-${i}-inputs`, buttonType: "button", text: "+", onClick: g, className: "add-input-entry" }) })
582
583
  ] }),
583
584
  /* @__PURE__ */ a(
584
- fe,
585
+ ue,
585
586
  {
586
587
  id: l,
587
588
  hasSubmit: N,
@@ -646,10 +647,10 @@ const e = {
646
647
  initialTheme: i = xe,
647
648
  secondTheme: o = pe
648
649
  }) => {
649
- const [l, m] = V(i), r = () => {
650
+ const [l, m] = V(i), c = () => {
650
651
  m((d) => d === i ? o : i);
651
652
  };
652
- return /* @__PURE__ */ a(J.Provider, { value: { currentTheme: l, toggleTheme: r }, children: /* @__PURE__ */ a(Y, { theme: l, children: t }) });
653
+ return /* @__PURE__ */ a(J.Provider, { value: { currentTheme: l, toggleTheme: c }, children: /* @__PURE__ */ a(Y, { theme: l, children: t }) });
653
654
  }, Ee = () => X(J);
654
655
  export {
655
656
  Ce as DynamicForm,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kbgarcia8/react-dynamic-form",
3
- "version": "1.1.38",
3
+ "version": "1.1.39",
4
4
  "description": "A form that can be nested with editable, expandable and flexible input-forms",
5
5
  "keywords": [
6
6
  "form",