finform-react-builder 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +27 -24
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1191,7 +1191,10 @@ const Xo = ({
|
|
|
1191
1191
|
}
|
|
1192
1192
|
}
|
|
1193
1193
|
) }), Jo = ({ field: e, control: t, errors: r }) => {
|
|
1194
|
-
const n = r[e.name], i = !!n
|
|
1194
|
+
const n = r[e.name], i = !!n, a = () => {
|
|
1195
|
+
var l;
|
|
1196
|
+
return ((l = e.validation) == null ? void 0 : l.required) === !0 || e.required === !0;
|
|
1197
|
+
}, o = (l) => a() ? `${l} *` : l;
|
|
1195
1198
|
return /* @__PURE__ */ V(_e, { children: (() => {
|
|
1196
1199
|
switch (e.type) {
|
|
1197
1200
|
case "title":
|
|
@@ -1227,13 +1230,13 @@ const Xo = ({
|
|
|
1227
1230
|
name: e.name,
|
|
1228
1231
|
control: t,
|
|
1229
1232
|
defaultValue: "",
|
|
1230
|
-
render: ({ field:
|
|
1233
|
+
render: ({ field: l }) => /* @__PURE__ */ V(
|
|
1231
1234
|
lr,
|
|
1232
1235
|
{
|
|
1233
|
-
...
|
|
1236
|
+
...l,
|
|
1234
1237
|
id: e.id,
|
|
1235
1238
|
fullWidth: !0,
|
|
1236
|
-
label: e.label,
|
|
1239
|
+
label: o(e.label),
|
|
1237
1240
|
type: e.type,
|
|
1238
1241
|
placeholder: e.placeholder,
|
|
1239
1242
|
disabled: e.disabled,
|
|
@@ -1250,13 +1253,13 @@ const Xo = ({
|
|
|
1250
1253
|
name: e.name,
|
|
1251
1254
|
control: t,
|
|
1252
1255
|
defaultValue: "",
|
|
1253
|
-
render: ({ field:
|
|
1256
|
+
render: ({ field: l }) => /* @__PURE__ */ V(
|
|
1254
1257
|
lr,
|
|
1255
1258
|
{
|
|
1256
|
-
...
|
|
1259
|
+
...l,
|
|
1257
1260
|
id: e.id,
|
|
1258
1261
|
fullWidth: !0,
|
|
1259
|
-
label: e.label,
|
|
1262
|
+
label: o(e.label),
|
|
1260
1263
|
placeholder: e.placeholder,
|
|
1261
1264
|
disabled: e.disabled,
|
|
1262
1265
|
error: i,
|
|
@@ -1274,13 +1277,13 @@ const Xo = ({
|
|
|
1274
1277
|
name: e.name,
|
|
1275
1278
|
control: t,
|
|
1276
1279
|
defaultValue: "",
|
|
1277
|
-
render: ({ field:
|
|
1280
|
+
render: ({ field: l }) => /* @__PURE__ */ V(
|
|
1278
1281
|
lr,
|
|
1279
1282
|
{
|
|
1280
|
-
...
|
|
1283
|
+
...l,
|
|
1281
1284
|
id: e.id,
|
|
1282
1285
|
fullWidth: !0,
|
|
1283
|
-
label: e.label,
|
|
1286
|
+
label: o(e.label),
|
|
1284
1287
|
type: "number",
|
|
1285
1288
|
placeholder: e.placeholder,
|
|
1286
1289
|
disabled: e.disabled,
|
|
@@ -1301,16 +1304,16 @@ const Xo = ({
|
|
|
1301
1304
|
name: e.name,
|
|
1302
1305
|
control: t,
|
|
1303
1306
|
defaultValue: "",
|
|
1304
|
-
render: ({ field:
|
|
1305
|
-
/* @__PURE__ */ V(vo, { id: e.id, children: e.label }),
|
|
1307
|
+
render: ({ field: l }) => /* @__PURE__ */ Ce(go, { fullWidth: !0, error: i, children: [
|
|
1308
|
+
/* @__PURE__ */ V(vo, { id: e.id, children: o(e.label) }),
|
|
1306
1309
|
/* @__PURE__ */ V(
|
|
1307
1310
|
yo,
|
|
1308
1311
|
{
|
|
1309
|
-
...
|
|
1312
|
+
...l,
|
|
1310
1313
|
labelId: e.id,
|
|
1311
|
-
label: e.label,
|
|
1314
|
+
label: o(e.label),
|
|
1312
1315
|
disabled: e.disabled,
|
|
1313
|
-
children: e.options.map((
|
|
1316
|
+
children: e.options.map((d) => /* @__PURE__ */ V(xo, { value: d.value, children: d.label }, d.value))
|
|
1314
1317
|
}
|
|
1315
1318
|
),
|
|
1316
1319
|
i && /* @__PURE__ */ V(qn, { children: n == null ? void 0 : n.message })
|
|
@@ -1324,20 +1327,20 @@ const Xo = ({
|
|
|
1324
1327
|
name: e.name,
|
|
1325
1328
|
control: t,
|
|
1326
1329
|
defaultValue: !1,
|
|
1327
|
-
render: ({ field:
|
|
1330
|
+
render: ({ field: l }) => /* @__PURE__ */ Ce(_e, { sx: { mt: 1, mb: 0 }, children: [
|
|
1328
1331
|
/* @__PURE__ */ V(
|
|
1329
1332
|
mo,
|
|
1330
1333
|
{
|
|
1331
1334
|
control: /* @__PURE__ */ V(
|
|
1332
1335
|
ho,
|
|
1333
1336
|
{
|
|
1334
|
-
...
|
|
1337
|
+
...l,
|
|
1335
1338
|
id: e.id,
|
|
1336
|
-
checked:
|
|
1339
|
+
checked: l.value,
|
|
1337
1340
|
disabled: e.disabled
|
|
1338
1341
|
}
|
|
1339
1342
|
),
|
|
1340
|
-
label: e.label
|
|
1343
|
+
label: o(e.label)
|
|
1341
1344
|
}
|
|
1342
1345
|
),
|
|
1343
1346
|
i && /* @__PURE__ */ V(qn, { error: !0, sx: { ml: 0 }, children: n == null ? void 0 : n.message })
|
|
@@ -1351,13 +1354,13 @@ const Xo = ({
|
|
|
1351
1354
|
name: e.name,
|
|
1352
1355
|
control: t,
|
|
1353
1356
|
defaultValue: "",
|
|
1354
|
-
render: ({ field:
|
|
1357
|
+
render: ({ field: l }) => /* @__PURE__ */ V(
|
|
1355
1358
|
lr,
|
|
1356
1359
|
{
|
|
1357
|
-
...
|
|
1360
|
+
...l,
|
|
1358
1361
|
id: e.id,
|
|
1359
1362
|
fullWidth: !0,
|
|
1360
|
-
label: e.label,
|
|
1363
|
+
label: o(e.label),
|
|
1361
1364
|
type: "date",
|
|
1362
1365
|
disabled: e.disabled,
|
|
1363
1366
|
error: i,
|
|
@@ -1380,10 +1383,10 @@ const Xo = ({
|
|
|
1380
1383
|
name: e.name,
|
|
1381
1384
|
control: t,
|
|
1382
1385
|
defaultValue: "",
|
|
1383
|
-
render: ({ field:
|
|
1386
|
+
render: ({ field: l }) => /* @__PURE__ */ V(
|
|
1384
1387
|
Xo,
|
|
1385
1388
|
{
|
|
1386
|
-
src:
|
|
1389
|
+
src: l.value || e.defaultValue || e.src,
|
|
1387
1390
|
alt: e.alt || e.label,
|
|
1388
1391
|
width: e.width,
|
|
1389
1392
|
height: e.height,
|