@nestledjs/forms-native 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1126 -1138
- package/lib/fields/button-field.d.ts +2 -2
- package/lib/fields/button.d.ts +1 -1
- package/lib/fields/checkbox-field.d.ts +1 -1
- package/lib/fields/checkbox-group.d.ts +2 -2
- package/lib/fields/content-field.d.ts +2 -2
- package/lib/fields/custom-checkbox-field.d.ts +2 -2
- package/lib/fields/custom-field.d.ts +2 -3
- package/lib/fields/datepicker-field.d.ts +2 -2
- package/lib/fields/datetimepicker-field.d.ts +2 -2
- package/lib/fields/email-field.d.ts +2 -2
- package/lib/fields/label.d.ts +1 -1
- package/lib/fields/markdown-editor.d.ts +2 -2
- package/lib/fields/money-field.d.ts +2 -2
- package/lib/fields/number-field.d.ts +2 -2
- package/lib/fields/password-field.d.ts +2 -2
- package/lib/fields/phone-field.d.ts +2 -2
- package/lib/fields/radio-field.d.ts +2 -2
- package/lib/fields/select-field-enum.d.ts +2 -2
- package/lib/fields/select-field-multi-search-apollo.d.ts +2 -2
- package/lib/fields/select-field-multi-search.d.ts +2 -2
- package/lib/fields/select-field-multi.d.ts +2 -2
- package/lib/fields/select-field-search-apollo.d.ts +2 -2
- package/lib/fields/select-field-search.d.ts +2 -2
- package/lib/fields/select-field.d.ts +2 -2
- package/lib/fields/switch-field.d.ts +2 -2
- package/lib/fields/text-field.d.ts +2 -2
- package/lib/fields/textarea-field.d.ts +2 -2
- package/lib/fields/timepicker-field.d.ts +2 -2
- package/lib/fields/url-field.d.ts +2 -2
- package/lib/render-form-field.d.ts +2 -2
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { z as r, ZodError as ce } from "zod";
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { zodResolver as
|
|
2
|
+
import { createContext as X, useContext as Q, useMemo as W, useState as I, useEffect as q, useCallback as Oe, useRef as Ve } from "react";
|
|
3
|
+
import { zodResolver as Fe } from "@hookform/resolvers/zod";
|
|
4
4
|
import ue from "dayjs";
|
|
5
|
-
import { jsxs as
|
|
6
|
-
import { StyleSheet as w, TextInput as
|
|
7
|
-
import { Controller as z, useWatch as pe, useForm as
|
|
8
|
-
var
|
|
5
|
+
import { jsxs as S, Fragment as O, jsx as l } from "react/jsx-runtime";
|
|
6
|
+
import { StyleSheet as w, TextInput as P, Text as u, View as y, Pressable as R, Switch as ie, ActivityIndicator as Pe, Platform as j, ScrollView as De } from "react-native";
|
|
7
|
+
import { Controller as z, useWatch as pe, useForm as ze } from "react-hook-form";
|
|
8
|
+
var x = /* @__PURE__ */ ((t) => (t.Text = "Text", t.TextArea = "TextArea", t.Email = "Email", t.Password = "Password", t.Url = "Url", t.Phone = "Phone", t.Number = "Number", t.Currency = "Currency", t.Checkbox = "Checkbox", t.Switch = "Switch", t.Button = "Button", t.DatePicker = "DatePicker", t.DateTimePicker = "DateTimePicker", t.TimePicker = "TimePicker", t.Select = "Select", t.EnumSelect = "EnumSelect", t.MultiSelect = "MultiSelect", t.Radio = "Radio", t.CheckboxGroup = "CheckboxGroup", t.SearchSelect = "SearchSelect", t.SearchSelectApollo = "SearchSelectApollo", t.SearchSelectMulti = "SearchSelectMulti", t.SearchSelectMultiApollo = "SearchSelectMultiApollo", t.Content = "Content", t.Custom = "Custom", t.CustomCheckbox = "CustomCheckbox", t.MarkdownEditor = "MarkdownEditor", t))(x || {});
|
|
9
9
|
const he = r.object({
|
|
10
10
|
global: r.object({
|
|
11
11
|
input: r.string().default(""),
|
|
@@ -351,8 +351,8 @@ const he = r.object({
|
|
|
351
351
|
helpText: r.string().default("")
|
|
352
352
|
}).default({})
|
|
353
353
|
// Add more fields as needed
|
|
354
|
-
}),
|
|
355
|
-
class
|
|
354
|
+
}), J = "This field is required";
|
|
355
|
+
class qt {
|
|
356
356
|
/**
|
|
357
357
|
* Creates a generic form field. Usually you'll want to use specific methods like text(), email(), etc.
|
|
358
358
|
*
|
|
@@ -361,8 +361,8 @@ class It {
|
|
|
361
361
|
* @param options - Configuration options for the field
|
|
362
362
|
* @returns A FormField object that can be used with Form component
|
|
363
363
|
*/
|
|
364
|
-
static field(e, o,
|
|
365
|
-
return { type: e, key: o, options:
|
|
364
|
+
static field(e, o, a = {}) {
|
|
365
|
+
return { type: e, key: o, options: a };
|
|
366
366
|
}
|
|
367
367
|
/**
|
|
368
368
|
* Creates a text input field.
|
|
@@ -381,7 +381,7 @@ class It {
|
|
|
381
381
|
* ```
|
|
382
382
|
*/
|
|
383
383
|
static text(e, o = {}) {
|
|
384
|
-
return this.field(
|
|
384
|
+
return this.field(x.Text, e, o);
|
|
385
385
|
}
|
|
386
386
|
/**
|
|
387
387
|
* Creates a textarea field for multi-line text input.
|
|
@@ -400,7 +400,7 @@ class It {
|
|
|
400
400
|
* ```
|
|
401
401
|
*/
|
|
402
402
|
static textArea(e, o = {}) {
|
|
403
|
-
return this.field(
|
|
403
|
+
return this.field(x.TextArea, e, o);
|
|
404
404
|
}
|
|
405
405
|
/**
|
|
406
406
|
* Creates a markdown editor field with rich text editing capabilities.
|
|
@@ -441,7 +441,7 @@ class It {
|
|
|
441
441
|
static markdownEditor(e, o = {}) {
|
|
442
442
|
return {
|
|
443
443
|
key: e,
|
|
444
|
-
type:
|
|
444
|
+
type: x.MarkdownEditor,
|
|
445
445
|
options: {
|
|
446
446
|
label: e,
|
|
447
447
|
outputFormat: "markdown",
|
|
@@ -453,10 +453,10 @@ class It {
|
|
|
453
453
|
/**
|
|
454
454
|
* Creates a Markdown editor field with image upload support
|
|
455
455
|
*/
|
|
456
|
-
static markdownEditorWithImages(e, o,
|
|
456
|
+
static markdownEditorWithImages(e, o, a = {}) {
|
|
457
457
|
return {
|
|
458
458
|
key: e,
|
|
459
|
-
type:
|
|
459
|
+
type: x.MarkdownEditor,
|
|
460
460
|
options: {
|
|
461
461
|
label: e,
|
|
462
462
|
enableImageUpload: !0,
|
|
@@ -465,7 +465,7 @@ class It {
|
|
|
465
465
|
// 5MB default
|
|
466
466
|
allowedImageTypes: ["image/png", "image/jpeg", "image/gif", "image/webp"],
|
|
467
467
|
imageUploadMode: "custom",
|
|
468
|
-
...
|
|
468
|
+
...a
|
|
469
469
|
}
|
|
470
470
|
};
|
|
471
471
|
}
|
|
@@ -486,7 +486,7 @@ class It {
|
|
|
486
486
|
* ```
|
|
487
487
|
*/
|
|
488
488
|
static email(e, o = {}) {
|
|
489
|
-
return this.field(
|
|
489
|
+
return this.field(x.Email, e, o);
|
|
490
490
|
}
|
|
491
491
|
/**
|
|
492
492
|
* Creates a password input field.
|
|
@@ -505,22 +505,22 @@ class It {
|
|
|
505
505
|
* ```
|
|
506
506
|
*/
|
|
507
507
|
static password(e, o = {}) {
|
|
508
|
-
return this.field(
|
|
508
|
+
return this.field(x.Password, e, o);
|
|
509
509
|
}
|
|
510
510
|
static url(e, o = {}) {
|
|
511
|
-
return this.field(
|
|
511
|
+
return this.field(x.Url, e, o);
|
|
512
512
|
}
|
|
513
513
|
static phone(e, o = {}) {
|
|
514
|
-
return this.field(
|
|
514
|
+
return this.field(x.Phone, e, o);
|
|
515
515
|
}
|
|
516
516
|
static number(e, o = {}) {
|
|
517
|
-
return this.field(
|
|
517
|
+
return this.field(x.Number, e, o);
|
|
518
518
|
}
|
|
519
519
|
static currency(e, o = {}) {
|
|
520
|
-
return this.field(
|
|
520
|
+
return this.field(x.Currency, e, o);
|
|
521
521
|
}
|
|
522
522
|
static checkbox(e, o = {}) {
|
|
523
|
-
return this.field(
|
|
523
|
+
return this.field(x.Checkbox, e, o);
|
|
524
524
|
}
|
|
525
525
|
/**
|
|
526
526
|
* Creates a checkbox group field with multiple selectable options.
|
|
@@ -544,227 +544,232 @@ class It {
|
|
|
544
544
|
* ```
|
|
545
545
|
*/
|
|
546
546
|
static checkboxGroup(e, o) {
|
|
547
|
-
return this.field(
|
|
547
|
+
return this.field(x.CheckboxGroup, e, o);
|
|
548
548
|
}
|
|
549
549
|
static customCheckbox(e, o = {}) {
|
|
550
|
-
return this.field(
|
|
550
|
+
return this.field(x.CustomCheckbox, e, o);
|
|
551
551
|
}
|
|
552
552
|
static switch(e, o = {}) {
|
|
553
|
-
return this.field(
|
|
553
|
+
return this.field(x.Switch, e, o);
|
|
554
554
|
}
|
|
555
555
|
static button(e, o = {}) {
|
|
556
|
-
const { label:
|
|
557
|
-
return this.field(
|
|
556
|
+
const { label: a, ...s } = o;
|
|
557
|
+
return this.field(x.Button, e, s);
|
|
558
558
|
}
|
|
559
559
|
static datePicker(e, o = {}) {
|
|
560
|
-
return this.field(
|
|
560
|
+
return this.field(x.DatePicker, e, o);
|
|
561
561
|
}
|
|
562
562
|
static dateTimePicker(e, o = {}) {
|
|
563
|
-
return this.field(
|
|
563
|
+
return this.field(x.DateTimePicker, e, o);
|
|
564
564
|
}
|
|
565
565
|
static select(e, o) {
|
|
566
|
-
return this.field(
|
|
566
|
+
return this.field(x.Select, e, o);
|
|
567
567
|
}
|
|
568
568
|
static enumSelect(e, o) {
|
|
569
|
-
return this.field(
|
|
569
|
+
return this.field(x.EnumSelect, e, o);
|
|
570
570
|
}
|
|
571
571
|
static searchSelect(e, o) {
|
|
572
|
-
return this.field(
|
|
572
|
+
return this.field(x.SearchSelect, e, o);
|
|
573
573
|
}
|
|
574
574
|
static searchSelectApollo(e, o) {
|
|
575
|
-
return this.field(
|
|
575
|
+
return this.field(x.SearchSelectApollo, e, o);
|
|
576
576
|
}
|
|
577
577
|
static searchSelectMulti(e, o) {
|
|
578
|
-
return this.field(
|
|
578
|
+
return this.field(x.SearchSelectMulti, e, o);
|
|
579
579
|
}
|
|
580
580
|
static searchSelectMultiApollo(e, o) {
|
|
581
|
-
return this.field(
|
|
581
|
+
return this.field(x.SearchSelectMultiApollo, e, o);
|
|
582
582
|
}
|
|
583
583
|
static content(e, o) {
|
|
584
|
-
return this.field(
|
|
584
|
+
return this.field(x.Content, e, o);
|
|
585
585
|
}
|
|
586
586
|
static custom(e, o) {
|
|
587
|
-
return this.field(
|
|
587
|
+
return this.field(x.Custom, e, o);
|
|
588
588
|
}
|
|
589
589
|
}
|
|
590
|
-
const be =
|
|
591
|
-
function
|
|
592
|
-
const t =
|
|
590
|
+
const be = X(null);
|
|
591
|
+
function Ie() {
|
|
592
|
+
const t = Q(be);
|
|
593
593
|
if (!t)
|
|
594
594
|
throw new Error("FormField components must be used within a <Form> component.");
|
|
595
595
|
return t;
|
|
596
596
|
}
|
|
597
|
-
const ye =
|
|
597
|
+
const ye = X({
|
|
598
598
|
labelDisplay: "default"
|
|
599
599
|
// 'default' is the sensible default
|
|
600
600
|
});
|
|
601
|
-
function
|
|
602
|
-
const t =
|
|
601
|
+
function Re() {
|
|
602
|
+
const t = Q(ye);
|
|
603
603
|
if (!t)
|
|
604
604
|
throw new Error("useFormConfig must be used within a <Form> component.");
|
|
605
605
|
return t;
|
|
606
606
|
}
|
|
607
|
-
const
|
|
608
|
-
function
|
|
609
|
-
return
|
|
607
|
+
const We = he.parse({}), fe = X(We);
|
|
608
|
+
function Lt() {
|
|
609
|
+
return Q(fe);
|
|
610
610
|
}
|
|
611
|
-
function
|
|
611
|
+
function Ae(t, e) {
|
|
612
612
|
return async (o) => {
|
|
613
613
|
try {
|
|
614
614
|
return await t.parseAsync(o), !0;
|
|
615
|
-
} catch (
|
|
616
|
-
if (
|
|
617
|
-
const s =
|
|
618
|
-
return e?.[
|
|
615
|
+
} catch (a) {
|
|
616
|
+
if (a instanceof ce) {
|
|
617
|
+
const s = a.errors[0], n = s.code;
|
|
618
|
+
return e?.[n] ?? s.message;
|
|
619
619
|
}
|
|
620
620
|
return "Invalid value";
|
|
621
621
|
}
|
|
622
622
|
};
|
|
623
623
|
}
|
|
624
|
-
function
|
|
625
|
-
return async (o,
|
|
626
|
-
const s = await t(o,
|
|
627
|
-
return s !== !0 ? s : e(o,
|
|
624
|
+
function He(t, e) {
|
|
625
|
+
return async (o, a) => {
|
|
626
|
+
const s = await t(o, a);
|
|
627
|
+
return s !== !0 ? s : e(o, a);
|
|
628
628
|
};
|
|
629
629
|
}
|
|
630
|
-
async function
|
|
631
|
-
|
|
632
|
-
|
|
630
|
+
async function Be(t, e, o) {
|
|
631
|
+
try {
|
|
632
|
+
return await t.parseAsync(e), null;
|
|
633
|
+
} catch (a) {
|
|
634
|
+
if (a instanceof ce) {
|
|
635
|
+
const s = a.errors[0];
|
|
636
|
+
return {
|
|
637
|
+
type: s.code,
|
|
638
|
+
message: o?.[s.code] || s.message
|
|
639
|
+
};
|
|
640
|
+
}
|
|
633
641
|
return null;
|
|
634
|
-
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
async function Me(t, e, o) {
|
|
645
|
+
const { options: a } = t;
|
|
646
|
+
if (a.validateWhen && !a.validateWhen(o))
|
|
647
|
+
return null;
|
|
648
|
+
if ((a.required || a.requiredWhen?.(o)) && !e)
|
|
635
649
|
return {
|
|
636
650
|
type: "required",
|
|
637
|
-
message:
|
|
651
|
+
message: a.errorMessages?.required || "This field is required"
|
|
638
652
|
};
|
|
639
|
-
if (
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
type: a.code,
|
|
647
|
-
message: i.errorMessages?.[a.code] || a.message
|
|
648
|
-
};
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
if (i.validate) {
|
|
652
|
-
const l = await i.validate(e);
|
|
653
|
-
if (l !== !0)
|
|
653
|
+
if (a.schema) {
|
|
654
|
+
const n = await Be(a.schema, e, a.errorMessages);
|
|
655
|
+
if (n) return n;
|
|
656
|
+
}
|
|
657
|
+
if (a.validate) {
|
|
658
|
+
const n = await a.validate(e);
|
|
659
|
+
if (n !== !0)
|
|
654
660
|
return {
|
|
655
661
|
type: "validate",
|
|
656
|
-
message:
|
|
662
|
+
message: n
|
|
657
663
|
};
|
|
658
664
|
}
|
|
659
|
-
if (
|
|
660
|
-
const
|
|
661
|
-
if (
|
|
665
|
+
if (a.validateWithForm) {
|
|
666
|
+
const n = await a.validateWithForm(e, o);
|
|
667
|
+
if (n !== !0)
|
|
662
668
|
return {
|
|
663
669
|
type: "validateWithForm",
|
|
664
|
-
message:
|
|
670
|
+
message: n
|
|
665
671
|
};
|
|
666
672
|
}
|
|
667
673
|
return null;
|
|
668
674
|
}
|
|
669
|
-
function
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
i.validate && typeof i.validate == "object" ? i.validate.schema = s : i.validate = s;
|
|
675
|
+
function te(t, e, o) {
|
|
676
|
+
if (!t.validate) {
|
|
677
|
+
t.validate = e;
|
|
678
|
+
return;
|
|
674
679
|
}
|
|
675
|
-
if (t.validate)
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
680
|
+
if (typeof t.validate == "object") {
|
|
681
|
+
t.validate[o] = e;
|
|
682
|
+
return;
|
|
683
|
+
}
|
|
684
|
+
t.validate = He(t.validate, e);
|
|
685
|
+
}
|
|
686
|
+
async function je(t, e, o) {
|
|
687
|
+
for (const [, a] of Object.entries(t))
|
|
688
|
+
if (typeof a == "function") {
|
|
689
|
+
const s = await a(e, o);
|
|
690
|
+
if (s !== !0) return s;
|
|
691
|
+
}
|
|
692
|
+
return !0;
|
|
693
|
+
}
|
|
694
|
+
function qe(t, e, o) {
|
|
695
|
+
return async (a, s) => e.validateWhen && !e.validateWhen(s) || o && e.validationGroup && e.validationGroup !== o ? !0 : typeof t == "function" ? t(a, s) : typeof t == "object" ? je(t, a, s) : !0;
|
|
696
|
+
}
|
|
697
|
+
function Le(t, e, o) {
|
|
698
|
+
const a = {};
|
|
699
|
+
if (e && (a.required = t.errorMessages?.required || "This field is required"), t.schema) {
|
|
700
|
+
const n = Ae(t.schema, t.errorMessages);
|
|
701
|
+
te(a, n, "schema");
|
|
702
|
+
}
|
|
703
|
+
if (t.validate) {
|
|
704
|
+
const n = t.validate;
|
|
705
|
+
te(a, (i) => n(i), "custom");
|
|
701
706
|
}
|
|
702
|
-
return
|
|
707
|
+
return t.validateWithForm && te(a, t.validateWithForm, "crossField"), a.validate && (t.validateWhen || t.validationGroup) && (a.validate = qe(a.validate, t, o)), a;
|
|
703
708
|
}
|
|
704
|
-
function
|
|
709
|
+
function Ne(t, e, o) {
|
|
705
710
|
if (t)
|
|
706
|
-
return
|
|
707
|
-
const
|
|
711
|
+
return Fe(t);
|
|
712
|
+
const a = e?.filter(
|
|
708
713
|
(s) => s.options.schema || s.options.validateWithForm || s.options.validate
|
|
709
714
|
);
|
|
710
|
-
if (
|
|
711
|
-
return async (s,
|
|
712
|
-
const
|
|
713
|
-
for (const
|
|
714
|
-
const c = s[
|
|
715
|
-
|
|
715
|
+
if (a?.length)
|
|
716
|
+
return async (s, n, i) => {
|
|
717
|
+
const h = {};
|
|
718
|
+
for (const b of a) {
|
|
719
|
+
const c = s[b.key], p = await Me(b, c, s);
|
|
720
|
+
p && (h[b.key] = p);
|
|
716
721
|
}
|
|
717
722
|
return {
|
|
718
|
-
values: Object.keys(
|
|
719
|
-
errors:
|
|
723
|
+
values: Object.keys(h).length ? {} : s,
|
|
724
|
+
errors: h
|
|
720
725
|
};
|
|
721
726
|
};
|
|
722
727
|
}
|
|
723
|
-
async function
|
|
724
|
-
const
|
|
725
|
-
return
|
|
728
|
+
async function Nt(t, e, o) {
|
|
729
|
+
const a = o.filter((s) => s.options.validationGroup === e).map((s) => s.key);
|
|
730
|
+
return a.length === 0 ? !0 : await t.trigger(a);
|
|
726
731
|
}
|
|
727
|
-
function
|
|
732
|
+
function Et(t) {
|
|
728
733
|
const e = /* @__PURE__ */ new Set();
|
|
729
734
|
return t.forEach((o) => {
|
|
730
735
|
o.options.validationGroup && e.add(o.options.validationGroup);
|
|
731
|
-
}), Array.from(e).sort((o,
|
|
736
|
+
}), Array.from(e).sort((o, a) => o.localeCompare(a));
|
|
732
737
|
}
|
|
733
|
-
function
|
|
738
|
+
function $t(t, e) {
|
|
734
739
|
return t.filter((o) => o.options.validationGroup === e);
|
|
735
740
|
}
|
|
736
|
-
function
|
|
741
|
+
function Ut(t, e, o) {
|
|
737
742
|
return !(t.options.validateWhen && !t.options.validateWhen(e) || o && t.options.validationGroup && t.options.validationGroup !== o);
|
|
738
743
|
}
|
|
739
|
-
function
|
|
744
|
+
function Gt(t, e) {
|
|
740
745
|
return W(() => {
|
|
741
|
-
const
|
|
742
|
-
return
|
|
746
|
+
const a = t.options.required || !1;
|
|
747
|
+
return Le(
|
|
743
748
|
t.options,
|
|
744
|
-
|
|
749
|
+
a,
|
|
745
750
|
void 0
|
|
746
751
|
);
|
|
747
752
|
}, [
|
|
748
|
-
// Use stable references for the field options
|
|
749
753
|
t.key,
|
|
750
754
|
t.options.required,
|
|
751
|
-
t.options.schema
|
|
752
|
-
|
|
753
|
-
|
|
755
|
+
t.options.schema,
|
|
756
|
+
t.options.validate,
|
|
757
|
+
t.options.validateWithForm,
|
|
758
|
+
t.options.validateWhen
|
|
754
759
|
]);
|
|
755
760
|
}
|
|
756
|
-
function
|
|
757
|
-
const [o,
|
|
758
|
-
return
|
|
761
|
+
function Kt(t, e = 500) {
|
|
762
|
+
const [o, a] = I(t);
|
|
763
|
+
return q(() => {
|
|
759
764
|
const s = setTimeout(() => {
|
|
760
|
-
|
|
765
|
+
a(t);
|
|
761
766
|
}, e);
|
|
762
767
|
return () => {
|
|
763
768
|
clearTimeout(s);
|
|
764
769
|
};
|
|
765
770
|
}, [t, e]), o;
|
|
766
771
|
}
|
|
767
|
-
const
|
|
772
|
+
const H = {
|
|
768
773
|
USD: {
|
|
769
774
|
code: "USD",
|
|
770
775
|
symbol: "$",
|
|
@@ -1054,85 +1059,85 @@ const A = {
|
|
|
1054
1059
|
decimalSeparator: ","
|
|
1055
1060
|
}
|
|
1056
1061
|
};
|
|
1057
|
-
function
|
|
1058
|
-
return
|
|
1062
|
+
function Ee(t) {
|
|
1063
|
+
return H[t];
|
|
1059
1064
|
}
|
|
1060
|
-
function
|
|
1061
|
-
return Object.values(
|
|
1065
|
+
function Yt() {
|
|
1066
|
+
return Object.values(H).map((t) => ({
|
|
1062
1067
|
value: t.code,
|
|
1063
1068
|
label: `${t.symbol} ${t.code} - ${t.name}`
|
|
1064
1069
|
}));
|
|
1065
1070
|
}
|
|
1066
|
-
function
|
|
1071
|
+
function Zt() {
|
|
1067
1072
|
return ["USD", "EUR", "GBP", "JPY", "CAD", "AUD", "CHF", "CNY"].map((e) => ({
|
|
1068
1073
|
value: e,
|
|
1069
|
-
label: `${
|
|
1074
|
+
label: `${H[e].symbol} ${e} - ${H[e].name}`
|
|
1070
1075
|
}));
|
|
1071
1076
|
}
|
|
1072
|
-
function
|
|
1073
|
-
const o = t.startsWith("-"),
|
|
1074
|
-
if (
|
|
1075
|
-
return o ? "-" +
|
|
1077
|
+
function $e(t, e) {
|
|
1078
|
+
const o = t.startsWith("-"), a = o ? t.slice(1) : t;
|
|
1079
|
+
if (a.length <= 3 || e === "")
|
|
1080
|
+
return o ? "-" + a : a;
|
|
1076
1081
|
let s = "";
|
|
1077
|
-
for (let
|
|
1078
|
-
s = e +
|
|
1079
|
-
const
|
|
1080
|
-
return o ? "-" +
|
|
1082
|
+
for (let h = a.length; h > 3; h -= 3)
|
|
1083
|
+
s = e + a.slice(h - 3, h) + s;
|
|
1084
|
+
const n = a.length % 3 || 3, i = a.slice(0, n) + s;
|
|
1085
|
+
return o ? "-" + i : i;
|
|
1081
1086
|
}
|
|
1082
|
-
function
|
|
1083
|
-
const { showSymbol:
|
|
1087
|
+
function M(t, e, o = {}) {
|
|
1088
|
+
const { showSymbol: a = !0, showCode: s = !1, includeDecimals: n = !0 } = o;
|
|
1084
1089
|
if (t == null || t === "")
|
|
1085
1090
|
return "";
|
|
1086
|
-
const
|
|
1087
|
-
if (isNaN(
|
|
1091
|
+
const i = typeof t == "string" ? Number.parseFloat(t) : t;
|
|
1092
|
+
if (Number.isNaN(i))
|
|
1088
1093
|
return "";
|
|
1089
|
-
const
|
|
1090
|
-
let
|
|
1091
|
-
return
|
|
1094
|
+
const h = n ? e.decimalPlaces : 0, b = i.toFixed(h), [c, p] = b.split("."), d = $e(c, e.thousandsSeparator);
|
|
1095
|
+
let g = p ? `${d}${e.decimalSeparator}${p}` : d;
|
|
1096
|
+
return a && (e.symbolPosition === "before" ? g = `${e.symbol}${g}` : g = `${g} ${e.symbol}`), s && (g = `${g} ${e.code}`), g;
|
|
1092
1097
|
}
|
|
1093
|
-
function
|
|
1098
|
+
function _t(t, e) {
|
|
1094
1099
|
if (!t || typeof t != "string")
|
|
1095
1100
|
return null;
|
|
1096
1101
|
let o = t.replace(e.symbol, "").replace(e.code, "").trim();
|
|
1097
|
-
o = o.
|
|
1098
|
-
const
|
|
1099
|
-
return isNaN(
|
|
1102
|
+
o = o.replaceAll(e.thousandsSeparator, ""), e.decimalSeparator !== "." && (o = o.replace(e.decimalSeparator, "."));
|
|
1103
|
+
const a = Number.parseFloat(o);
|
|
1104
|
+
return Number.isNaN(a) ? null : a;
|
|
1100
1105
|
}
|
|
1101
|
-
function
|
|
1106
|
+
function Jt(t) {
|
|
1102
1107
|
return t.decimalPlaces === 0 ? "1" : `0.${"0".repeat(t.decimalPlaces - 1)}1`;
|
|
1103
1108
|
}
|
|
1104
|
-
function
|
|
1109
|
+
function Ue(t = "USD", e) {
|
|
1105
1110
|
return t === "custom" && e ? {
|
|
1106
|
-
...
|
|
1111
|
+
...H.USD,
|
|
1107
1112
|
...e,
|
|
1108
1113
|
code: e.code || "USD"
|
|
1109
|
-
} :
|
|
1114
|
+
} : H[t] || H.USD;
|
|
1110
1115
|
}
|
|
1111
|
-
function
|
|
1112
|
-
return t in
|
|
1116
|
+
function Xt(t) {
|
|
1117
|
+
return t in H;
|
|
1113
1118
|
}
|
|
1114
|
-
function
|
|
1119
|
+
function Qt(t, e, o, a) {
|
|
1115
1120
|
if (e === o)
|
|
1116
1121
|
return t;
|
|
1117
|
-
if (!
|
|
1122
|
+
if (!a)
|
|
1118
1123
|
throw new Error("Exchange rates required for currency conversion");
|
|
1119
|
-
const s =
|
|
1124
|
+
const s = a[`${e}_${o}`];
|
|
1120
1125
|
if (!s)
|
|
1121
1126
|
throw new Error(`Exchange rate not found for ${e} to ${o}`);
|
|
1122
1127
|
return t * s;
|
|
1123
1128
|
}
|
|
1124
|
-
function
|
|
1125
|
-
const
|
|
1129
|
+
function er(t, e, o = "display") {
|
|
1130
|
+
const a = Ee(e);
|
|
1126
1131
|
switch (o) {
|
|
1127
1132
|
case "input":
|
|
1128
|
-
return
|
|
1133
|
+
return M(t, { ...a, thousandsSeparator: "" }, { showSymbol: !1 });
|
|
1129
1134
|
case "compact": {
|
|
1130
|
-
const s = typeof t == "string" ? parseFloat(t) : t;
|
|
1131
|
-
return s && s >= 1e6 ?
|
|
1135
|
+
const s = typeof t == "string" ? Number.parseFloat(t) : t;
|
|
1136
|
+
return s && s >= 1e6 ? M(s / 1e6, a, { includeDecimals: !1 }) + "M" : s && s >= 1e3 ? M(s / 1e3, a, { includeDecimals: !1 }) + "K" : M(t, a);
|
|
1132
1137
|
}
|
|
1133
1138
|
case "display":
|
|
1134
1139
|
default:
|
|
1135
|
-
return
|
|
1140
|
+
return M(t, a);
|
|
1136
1141
|
}
|
|
1137
1142
|
}
|
|
1138
1143
|
function ge(t) {
|
|
@@ -1141,13 +1146,13 @@ function ge(t) {
|
|
|
1141
1146
|
function re(t, e) {
|
|
1142
1147
|
return t ? ue(ge(t)).format(e ? "MM/DD/YYYY" : "MMMM DD, YYYY") : null;
|
|
1143
1148
|
}
|
|
1144
|
-
function
|
|
1149
|
+
function Ge(t) {
|
|
1145
1150
|
return t ? t.slice(0, 16) : null;
|
|
1146
1151
|
}
|
|
1147
|
-
function
|
|
1152
|
+
function ne(t, e) {
|
|
1148
1153
|
return t ? ue(t).format(e ? "MM/DD/YYYY h:mm A" : "MMMM DD, YYYY h:mm A") : null;
|
|
1149
1154
|
}
|
|
1150
|
-
const
|
|
1155
|
+
const E = {
|
|
1151
1156
|
// ── Global ──
|
|
1152
1157
|
global: w.create({
|
|
1153
1158
|
input: {
|
|
@@ -2103,108 +2108,109 @@ const $ = {
|
|
|
2103
2108
|
flexDirection: "column"
|
|
2104
2109
|
}
|
|
2105
2110
|
})
|
|
2106
|
-
}, me =
|
|
2107
|
-
function
|
|
2108
|
-
return
|
|
2111
|
+
}, me = X(E);
|
|
2112
|
+
function T() {
|
|
2113
|
+
return Q(me);
|
|
2109
2114
|
}
|
|
2110
|
-
function
|
|
2115
|
+
function Ke(t, e) {
|
|
2116
|
+
return e ? { ...t, ...e } : t;
|
|
2117
|
+
}
|
|
2118
|
+
function Ye(t, e) {
|
|
2119
|
+
if (!e)
|
|
2120
|
+
return t;
|
|
2121
|
+
const o = {};
|
|
2122
|
+
for (const a of Object.keys(t)) {
|
|
2123
|
+
const s = t[a], n = e[a];
|
|
2124
|
+
o[a] = Ke(s, n);
|
|
2125
|
+
}
|
|
2126
|
+
for (const a of Object.keys(e))
|
|
2127
|
+
a in o || (o[a] = e[a]);
|
|
2128
|
+
return o;
|
|
2129
|
+
}
|
|
2130
|
+
function Ze(t = {}) {
|
|
2111
2131
|
if (!t || Object.keys(t).length === 0)
|
|
2112
|
-
return
|
|
2132
|
+
return E;
|
|
2113
2133
|
const e = {};
|
|
2114
|
-
for (const o of Object.keys(
|
|
2115
|
-
const
|
|
2116
|
-
|
|
2117
|
-
e[o] = i;
|
|
2118
|
-
continue;
|
|
2119
|
-
}
|
|
2120
|
-
const l = {};
|
|
2121
|
-
for (const a of Object.keys(i)) {
|
|
2122
|
-
const p = i[a], h = s[a];
|
|
2123
|
-
h ? l[a] = { ...p, ...h } : l[a] = p;
|
|
2124
|
-
}
|
|
2125
|
-
for (const a of Object.keys(s))
|
|
2126
|
-
a in l || (l[a] = s[a]);
|
|
2127
|
-
e[o] = l;
|
|
2134
|
+
for (const o of Object.keys(E)) {
|
|
2135
|
+
const a = E[o], s = t[o];
|
|
2136
|
+
e[o] = Ye(a, s);
|
|
2128
2137
|
}
|
|
2129
2138
|
return e;
|
|
2130
2139
|
}
|
|
2131
|
-
function
|
|
2140
|
+
function _e({
|
|
2132
2141
|
form: t,
|
|
2133
2142
|
field: e,
|
|
2134
2143
|
hasError: o,
|
|
2135
|
-
formReadOnly:
|
|
2144
|
+
formReadOnly: a = !1,
|
|
2136
2145
|
formReadOnlyStyle: s = "value"
|
|
2137
2146
|
}) {
|
|
2138
|
-
const
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
return /* @__PURE__ */ x(F, { children: [
|
|
2158
|
-
/* @__PURE__ */ n(
|
|
2159
|
-
D,
|
|
2147
|
+
const n = T(), i = e.options.readOnly ?? a, h = e.options.readOnlyStyle ?? s, b = t.getValues(e.key) ?? "";
|
|
2148
|
+
return i ? h === "disabled" ? /* @__PURE__ */ S(O, { children: [
|
|
2149
|
+
/* @__PURE__ */ l(
|
|
2150
|
+
P,
|
|
2151
|
+
{
|
|
2152
|
+
nativeID: e.key,
|
|
2153
|
+
editable: !1,
|
|
2154
|
+
value: b,
|
|
2155
|
+
style: [n.textField.input, o && n.textField.error, n.textField.disabled],
|
|
2156
|
+
accessibilityLabel: e.options.label
|
|
2157
|
+
}
|
|
2158
|
+
),
|
|
2159
|
+
e.options.helpText && /* @__PURE__ */ l(u, { style: n.textField.helpText, children: e.options.helpText })
|
|
2160
|
+
] }) : /* @__PURE__ */ S(O, { children: [
|
|
2161
|
+
/* @__PURE__ */ l(y, { style: n.textField.readOnly, children: /* @__PURE__ */ l(u, { style: n.textField.readOnlyText, children: b || "—" }) }),
|
|
2162
|
+
e.options.helpText && /* @__PURE__ */ l(u, { style: n.textField.helpText, children: e.options.helpText })
|
|
2163
|
+
] }) : /* @__PURE__ */ S(O, { children: [
|
|
2164
|
+
/* @__PURE__ */ l(
|
|
2165
|
+
P,
|
|
2160
2166
|
{
|
|
2161
2167
|
nativeID: e.key,
|
|
2162
2168
|
editable: !e.options.disabled,
|
|
2163
2169
|
placeholder: e.options.placeholder,
|
|
2164
2170
|
placeholderTextColor: "#9ca3af",
|
|
2165
2171
|
defaultValue: e.options.defaultValue,
|
|
2166
|
-
onChangeText: (
|
|
2172
|
+
onChangeText: (c) => t.setValue(e.key, c, { shouldValidate: !0 }),
|
|
2167
2173
|
onBlur: () => t.trigger(e.key),
|
|
2168
2174
|
style: [
|
|
2169
|
-
|
|
2170
|
-
e.options.disabled &&
|
|
2171
|
-
o &&
|
|
2175
|
+
n.textField.input,
|
|
2176
|
+
e.options.disabled && n.textField.disabled,
|
|
2177
|
+
o && n.textField.error
|
|
2172
2178
|
],
|
|
2173
2179
|
accessibilityLabel: e.options.label,
|
|
2174
2180
|
keyboardType: "default"
|
|
2175
2181
|
}
|
|
2176
2182
|
),
|
|
2177
|
-
e.options.helpText && /* @__PURE__ */
|
|
2183
|
+
e.options.helpText && /* @__PURE__ */ l(u, { style: n.textField.helpText, children: e.options.helpText })
|
|
2178
2184
|
] });
|
|
2179
2185
|
}
|
|
2180
|
-
function
|
|
2186
|
+
function Je({
|
|
2181
2187
|
form: t,
|
|
2182
2188
|
field: e,
|
|
2183
2189
|
hasError: o,
|
|
2184
|
-
formReadOnly:
|
|
2190
|
+
formReadOnly: a = !1,
|
|
2185
2191
|
formReadOnlyStyle: s = "value"
|
|
2186
2192
|
}) {
|
|
2187
|
-
const
|
|
2188
|
-
return
|
|
2189
|
-
/* @__PURE__ */
|
|
2190
|
-
|
|
2193
|
+
const n = T(), i = e.options.readOnly ?? a, h = e.options.readOnlyStyle ?? s, b = t.getValues(e.key) ?? "", c = e.options.rows ?? 4, [p, d] = I(c * 20);
|
|
2194
|
+
return i ? h === "disabled" ? /* @__PURE__ */ S(O, { children: [
|
|
2195
|
+
/* @__PURE__ */ l(
|
|
2196
|
+
P,
|
|
2191
2197
|
{
|
|
2192
2198
|
nativeID: e.key,
|
|
2193
2199
|
multiline: !0,
|
|
2194
2200
|
numberOfLines: c,
|
|
2195
2201
|
editable: !1,
|
|
2196
|
-
value:
|
|
2197
|
-
style: [
|
|
2202
|
+
value: b,
|
|
2203
|
+
style: [n.textAreaField.textarea, n.textAreaField.disabled, o && n.textAreaField.error, { minHeight: c * 20 }],
|
|
2198
2204
|
accessibilityLabel: e.options.label
|
|
2199
2205
|
}
|
|
2200
2206
|
),
|
|
2201
|
-
e.options.helpText && /* @__PURE__ */
|
|
2202
|
-
] }) : /* @__PURE__ */
|
|
2203
|
-
/* @__PURE__ */
|
|
2204
|
-
e.options.helpText && /* @__PURE__ */
|
|
2205
|
-
] }) : /* @__PURE__ */
|
|
2206
|
-
/* @__PURE__ */
|
|
2207
|
-
|
|
2207
|
+
e.options.helpText && /* @__PURE__ */ l(u, { style: n.textAreaField.helpText, children: e.options.helpText })
|
|
2208
|
+
] }) : /* @__PURE__ */ S(O, { children: [
|
|
2209
|
+
/* @__PURE__ */ l(u, { style: n.textAreaField.readOnlyValue, children: b || "—" }),
|
|
2210
|
+
e.options.helpText && /* @__PURE__ */ l(u, { style: n.textAreaField.helpText, children: e.options.helpText })
|
|
2211
|
+
] }) : /* @__PURE__ */ S(O, { children: [
|
|
2212
|
+
/* @__PURE__ */ l(
|
|
2213
|
+
P,
|
|
2208
2214
|
{
|
|
2209
2215
|
nativeID: e.key,
|
|
2210
2216
|
multiline: !0,
|
|
@@ -2213,42 +2219,42 @@ function $e({
|
|
|
2213
2219
|
placeholder: e.options.placeholder,
|
|
2214
2220
|
placeholderTextColor: "#9ca3af",
|
|
2215
2221
|
defaultValue: e.options.defaultValue,
|
|
2216
|
-
onChangeText: (
|
|
2222
|
+
onChangeText: (f) => t.setValue(e.key, f, { shouldValidate: !0 }),
|
|
2217
2223
|
onBlur: () => t.trigger(e.key),
|
|
2218
|
-
onContentSizeChange: (
|
|
2219
|
-
d(Math.max(c * 20,
|
|
2224
|
+
onContentSizeChange: (f) => {
|
|
2225
|
+
d(Math.max(c * 20, f.nativeEvent.contentSize.height));
|
|
2220
2226
|
},
|
|
2221
2227
|
style: [
|
|
2222
|
-
|
|
2223
|
-
{ minHeight:
|
|
2224
|
-
e.options.disabled &&
|
|
2225
|
-
o &&
|
|
2228
|
+
n.textAreaField.textarea,
|
|
2229
|
+
{ minHeight: p },
|
|
2230
|
+
e.options.disabled && n.textAreaField.disabled,
|
|
2231
|
+
o && n.textAreaField.error
|
|
2226
2232
|
],
|
|
2227
2233
|
accessibilityLabel: e.options.label
|
|
2228
2234
|
}
|
|
2229
2235
|
),
|
|
2230
|
-
e.options.helpText && /* @__PURE__ */
|
|
2236
|
+
e.options.helpText && /* @__PURE__ */ l(u, { style: n.textAreaField.helpText, children: e.options.helpText })
|
|
2231
2237
|
] });
|
|
2232
2238
|
}
|
|
2233
|
-
function
|
|
2239
|
+
function Xe({
|
|
2234
2240
|
form: t,
|
|
2235
2241
|
field: e,
|
|
2236
2242
|
hasError: o,
|
|
2237
|
-
formReadOnly:
|
|
2243
|
+
formReadOnly: a = !1,
|
|
2238
2244
|
formReadOnlyStyle: s = "value"
|
|
2239
2245
|
}) {
|
|
2240
|
-
const
|
|
2241
|
-
return
|
|
2242
|
-
|
|
2246
|
+
const n = T(), i = e.options.readOnly ?? a, h = e.options.readOnlyStyle ?? s, b = t.getValues(e.key) ?? "";
|
|
2247
|
+
return i ? h === "disabled" ? /* @__PURE__ */ l(
|
|
2248
|
+
P,
|
|
2243
2249
|
{
|
|
2244
2250
|
nativeID: e.key,
|
|
2245
2251
|
editable: !1,
|
|
2246
|
-
value:
|
|
2247
|
-
style: [
|
|
2252
|
+
value: b,
|
|
2253
|
+
style: [n.emailField.input, n.emailField.disabled, o && n.emailField.error],
|
|
2248
2254
|
accessibilityLabel: e.options.label
|
|
2249
2255
|
}
|
|
2250
|
-
) : /* @__PURE__ */
|
|
2251
|
-
|
|
2256
|
+
) : /* @__PURE__ */ l(y, { style: n.emailField.readOnlyValue, children: /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: b || "—" }) }) : /* @__PURE__ */ l(
|
|
2257
|
+
P,
|
|
2252
2258
|
{
|
|
2253
2259
|
nativeID: e.key,
|
|
2254
2260
|
editable: !e.options.disabled,
|
|
@@ -2261,93 +2267,93 @@ function Ue({
|
|
|
2261
2267
|
onChangeText: (c) => t.setValue(e.key, c, { shouldValidate: !0 }),
|
|
2262
2268
|
onBlur: () => t.trigger(e.key),
|
|
2263
2269
|
style: [
|
|
2264
|
-
|
|
2265
|
-
e.options.disabled &&
|
|
2266
|
-
o &&
|
|
2270
|
+
n.emailField.input,
|
|
2271
|
+
e.options.disabled && n.emailField.disabled,
|
|
2272
|
+
o && n.emailField.error
|
|
2267
2273
|
],
|
|
2268
2274
|
accessibilityLabel: e.options.label
|
|
2269
2275
|
}
|
|
2270
2276
|
);
|
|
2271
2277
|
}
|
|
2272
|
-
function
|
|
2278
|
+
function Qe({
|
|
2273
2279
|
form: t,
|
|
2274
2280
|
field: e,
|
|
2275
2281
|
hasError: o,
|
|
2276
|
-
formReadOnly:
|
|
2282
|
+
formReadOnly: a = !1,
|
|
2277
2283
|
formReadOnlyStyle: s = "value"
|
|
2278
2284
|
}) {
|
|
2279
|
-
const
|
|
2280
|
-
return
|
|
2281
|
-
|
|
2285
|
+
const n = T(), [i, h] = I(!1), b = e.options.readOnly ?? a, c = e.options.readOnlyStyle ?? s, p = t.getValues(e.key) ?? "";
|
|
2286
|
+
return b ? c === "disabled" ? /* @__PURE__ */ l(
|
|
2287
|
+
P,
|
|
2282
2288
|
{
|
|
2283
2289
|
nativeID: e.key,
|
|
2284
2290
|
editable: !1,
|
|
2285
2291
|
secureTextEntry: !0,
|
|
2286
|
-
value:
|
|
2287
|
-
style: [
|
|
2292
|
+
value: p,
|
|
2293
|
+
style: [n.passwordField.input, n.passwordField.disabled, o && n.passwordField.error],
|
|
2288
2294
|
accessibilityLabel: e.options.label
|
|
2289
2295
|
}
|
|
2290
|
-
) : /* @__PURE__ */
|
|
2291
|
-
/* @__PURE__ */
|
|
2292
|
-
|
|
2296
|
+
) : /* @__PURE__ */ l(y, { style: n.passwordField.readOnlyValue, children: /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: "*".repeat(p.length) || "—" }) }) : /* @__PURE__ */ S(y, { style: n.passwordField.container, children: [
|
|
2297
|
+
/* @__PURE__ */ l(
|
|
2298
|
+
P,
|
|
2293
2299
|
{
|
|
2294
2300
|
nativeID: e.key,
|
|
2295
2301
|
editable: !e.options.disabled,
|
|
2296
2302
|
placeholder: e.options.placeholder,
|
|
2297
2303
|
placeholderTextColor: "#9ca3af",
|
|
2298
2304
|
defaultValue: e.options.defaultValue,
|
|
2299
|
-
secureTextEntry: !
|
|
2305
|
+
secureTextEntry: !i,
|
|
2300
2306
|
autoCapitalize: "none",
|
|
2301
2307
|
autoComplete: "password",
|
|
2302
2308
|
onChangeText: (d) => t.setValue(e.key, d, { shouldValidate: !0 }),
|
|
2303
2309
|
onBlur: () => t.trigger(e.key),
|
|
2304
2310
|
style: [
|
|
2305
|
-
|
|
2306
|
-
e.options.disabled &&
|
|
2307
|
-
o &&
|
|
2311
|
+
n.passwordField.input,
|
|
2312
|
+
e.options.disabled && n.passwordField.disabled,
|
|
2313
|
+
o && n.passwordField.error
|
|
2308
2314
|
],
|
|
2309
2315
|
accessibilityLabel: e.options.label
|
|
2310
2316
|
}
|
|
2311
2317
|
),
|
|
2312
|
-
/* @__PURE__ */
|
|
2313
|
-
|
|
2318
|
+
/* @__PURE__ */ l(
|
|
2319
|
+
R,
|
|
2314
2320
|
{
|
|
2315
|
-
onPress: () =>
|
|
2316
|
-
style:
|
|
2317
|
-
accessibilityLabel:
|
|
2321
|
+
onPress: () => h(!i),
|
|
2322
|
+
style: n.passwordField.toggleButton,
|
|
2323
|
+
accessibilityLabel: i ? "Hide password" : "Show password",
|
|
2318
2324
|
accessibilityRole: "button",
|
|
2319
|
-
children: /* @__PURE__ */
|
|
2325
|
+
children: /* @__PURE__ */ l(u, { style: n.passwordField.toggleText, children: i ? "Hide" : "Show" })
|
|
2320
2326
|
}
|
|
2321
2327
|
),
|
|
2322
|
-
e.options.helpText && /* @__PURE__ */
|
|
2328
|
+
e.options.helpText && /* @__PURE__ */ l(u, { style: n.passwordField.helpText, children: e.options.helpText })
|
|
2323
2329
|
] });
|
|
2324
2330
|
}
|
|
2325
|
-
function
|
|
2331
|
+
function et({
|
|
2326
2332
|
form: t,
|
|
2327
2333
|
field: e,
|
|
2328
2334
|
hasError: o,
|
|
2329
|
-
formReadOnly:
|
|
2335
|
+
formReadOnly: a = !1,
|
|
2330
2336
|
formReadOnlyStyle: s = "value"
|
|
2331
2337
|
}) {
|
|
2332
|
-
const
|
|
2333
|
-
return
|
|
2334
|
-
/* @__PURE__ */
|
|
2335
|
-
|
|
2338
|
+
const n = T(), i = e.options.readOnly ?? a, h = e.options.readOnlyStyle ?? s, b = t.getValues(e.key) ?? "";
|
|
2339
|
+
return i ? h === "disabled" ? /* @__PURE__ */ S(O, { children: [
|
|
2340
|
+
/* @__PURE__ */ l(
|
|
2341
|
+
P,
|
|
2336
2342
|
{
|
|
2337
2343
|
nativeID: e.key,
|
|
2338
2344
|
editable: !1,
|
|
2339
|
-
value:
|
|
2340
|
-
style: [
|
|
2345
|
+
value: b,
|
|
2346
|
+
style: [n.urlField.input, n.urlField.disabled, o && n.urlField.error],
|
|
2341
2347
|
accessibilityLabel: e.options.label
|
|
2342
2348
|
}
|
|
2343
2349
|
),
|
|
2344
|
-
e.options.helpText && /* @__PURE__ */
|
|
2345
|
-
] }) : /* @__PURE__ */
|
|
2346
|
-
/* @__PURE__ */
|
|
2347
|
-
e.options.helpText && /* @__PURE__ */
|
|
2348
|
-
] }) : /* @__PURE__ */
|
|
2349
|
-
/* @__PURE__ */
|
|
2350
|
-
|
|
2350
|
+
e.options.helpText && /* @__PURE__ */ l(u, { style: n.urlField.helpText, children: e.options.helpText })
|
|
2351
|
+
] }) : /* @__PURE__ */ S(O, { children: [
|
|
2352
|
+
/* @__PURE__ */ l(y, { style: n.urlField.readOnlyValue, children: /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: b || "—" }) }),
|
|
2353
|
+
e.options.helpText && /* @__PURE__ */ l(u, { style: n.urlField.helpText, children: e.options.helpText })
|
|
2354
|
+
] }) : /* @__PURE__ */ S(O, { children: [
|
|
2355
|
+
/* @__PURE__ */ l(
|
|
2356
|
+
P,
|
|
2351
2357
|
{
|
|
2352
2358
|
nativeID: e.key,
|
|
2353
2359
|
editable: !e.options.disabled,
|
|
@@ -2359,36 +2365,36 @@ function Ge({
|
|
|
2359
2365
|
onChangeText: (c) => t.setValue(e.key, c, { shouldValidate: !0 }),
|
|
2360
2366
|
onBlur: () => t.trigger(e.key),
|
|
2361
2367
|
style: [
|
|
2362
|
-
|
|
2363
|
-
e.options.disabled &&
|
|
2364
|
-
o &&
|
|
2368
|
+
n.urlField.input,
|
|
2369
|
+
e.options.disabled && n.urlField.disabled,
|
|
2370
|
+
o && n.urlField.error
|
|
2365
2371
|
],
|
|
2366
2372
|
accessibilityLabel: e.options.label
|
|
2367
2373
|
}
|
|
2368
2374
|
),
|
|
2369
|
-
e.options.helpText && /* @__PURE__ */
|
|
2375
|
+
e.options.helpText && /* @__PURE__ */ l(u, { style: n.urlField.helpText, children: e.options.helpText })
|
|
2370
2376
|
] });
|
|
2371
2377
|
}
|
|
2372
|
-
function
|
|
2378
|
+
function tt({
|
|
2373
2379
|
form: t,
|
|
2374
2380
|
field: e,
|
|
2375
2381
|
hasError: o,
|
|
2376
|
-
formReadOnly:
|
|
2382
|
+
formReadOnly: a = !1,
|
|
2377
2383
|
formReadOnlyStyle: s = "value"
|
|
2378
2384
|
}) {
|
|
2379
|
-
const
|
|
2380
|
-
return
|
|
2381
|
-
|
|
2385
|
+
const n = T(), i = e.options.readOnly ?? a, h = e.options.readOnlyStyle ?? s, b = t.getValues(e.key) ?? "";
|
|
2386
|
+
return i ? h === "disabled" ? /* @__PURE__ */ l(
|
|
2387
|
+
P,
|
|
2382
2388
|
{
|
|
2383
2389
|
nativeID: e.key,
|
|
2384
2390
|
editable: !1,
|
|
2385
|
-
value:
|
|
2386
|
-
style: [
|
|
2391
|
+
value: b,
|
|
2392
|
+
style: [n.phoneField.input, n.phoneField.disabled, o && n.phoneField.error],
|
|
2387
2393
|
accessibilityLabel: e.options.label
|
|
2388
2394
|
}
|
|
2389
|
-
) : /* @__PURE__ */
|
|
2390
|
-
/* @__PURE__ */
|
|
2391
|
-
|
|
2395
|
+
) : /* @__PURE__ */ l(y, { style: n.phoneField.readOnlyValue, children: /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: b == null || b === "" ? "—" : b }) }) : /* @__PURE__ */ S(O, { children: [
|
|
2396
|
+
/* @__PURE__ */ l(
|
|
2397
|
+
P,
|
|
2392
2398
|
{
|
|
2393
2399
|
nativeID: e.key,
|
|
2394
2400
|
editable: !e.options.disabled,
|
|
@@ -2400,137 +2406,137 @@ function Ye({
|
|
|
2400
2406
|
onChangeText: (c) => t.setValue(e.key, c, { shouldValidate: !0 }),
|
|
2401
2407
|
onBlur: () => t.trigger(e.key),
|
|
2402
2408
|
style: [
|
|
2403
|
-
|
|
2404
|
-
e.options.disabled &&
|
|
2405
|
-
o &&
|
|
2409
|
+
n.phoneField.input,
|
|
2410
|
+
e.options.disabled && n.phoneField.disabled,
|
|
2411
|
+
o && n.phoneField.error
|
|
2406
2412
|
],
|
|
2407
2413
|
accessibilityLabel: e.options.label
|
|
2408
2414
|
}
|
|
2409
2415
|
),
|
|
2410
|
-
e.options.helpText && /* @__PURE__ */
|
|
2416
|
+
e.options.helpText && /* @__PURE__ */ l(u, { style: n.phoneField.helpText, children: e.options.helpText })
|
|
2411
2417
|
] });
|
|
2412
2418
|
}
|
|
2413
|
-
function
|
|
2419
|
+
function rt({
|
|
2414
2420
|
form: t,
|
|
2415
2421
|
field: e,
|
|
2416
2422
|
hasError: o,
|
|
2417
|
-
formReadOnly:
|
|
2423
|
+
formReadOnly: a = !1,
|
|
2418
2424
|
formReadOnlyStyle: s = "value"
|
|
2419
2425
|
}) {
|
|
2420
|
-
const
|
|
2421
|
-
if (
|
|
2422
|
-
return
|
|
2423
|
-
|
|
2426
|
+
const n = T(), i = e.options.readOnly ?? a, h = e.options.readOnlyStyle ?? s, b = t.getValues(e.key) ?? "";
|
|
2427
|
+
if (i)
|
|
2428
|
+
return h === "disabled" ? /* @__PURE__ */ l(
|
|
2429
|
+
P,
|
|
2424
2430
|
{
|
|
2425
2431
|
nativeID: e.key,
|
|
2426
2432
|
editable: !1,
|
|
2427
|
-
value: String(
|
|
2433
|
+
value: String(b),
|
|
2428
2434
|
keyboardType: "decimal-pad",
|
|
2429
|
-
style: [
|
|
2435
|
+
style: [n.numberField.input, n.numberField.disabled, o && n.numberField.error],
|
|
2430
2436
|
accessibilityLabel: e.options.label
|
|
2431
2437
|
}
|
|
2432
|
-
) : /* @__PURE__ */
|
|
2438
|
+
) : /* @__PURE__ */ l(y, { style: n.numberField.readOnlyValue, children: /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: b == null || b === "" ? "—" : String(b) }) });
|
|
2433
2439
|
const c = (d) => {
|
|
2434
|
-
const
|
|
2435
|
-
t.setValue(e.key,
|
|
2436
|
-
},
|
|
2440
|
+
const f = d.replaceAll(/[^0-9.-]/g, ""), g = f === "" || f === "-" ? f : Number.parseFloat(f);
|
|
2441
|
+
t.setValue(e.key, g === "" || Number.isNaN(g) ? "" : g, { shouldValidate: !0 });
|
|
2442
|
+
}, p = () => {
|
|
2437
2443
|
const d = t.getValues(e.key);
|
|
2438
2444
|
if (d !== "" && d !== void 0) {
|
|
2439
|
-
let
|
|
2440
|
-
isNaN(
|
|
2445
|
+
let f = typeof d == "string" ? Number.parseFloat(d) : d;
|
|
2446
|
+
Number.isNaN(f) || (e.options.min !== void 0 && f < e.options.min && (f = e.options.min), e.options.max !== void 0 && f > e.options.max && (f = e.options.max), t.setValue(e.key, f));
|
|
2441
2447
|
}
|
|
2442
2448
|
t.trigger(e.key);
|
|
2443
2449
|
};
|
|
2444
|
-
return /* @__PURE__ */
|
|
2445
|
-
/* @__PURE__ */
|
|
2446
|
-
|
|
2450
|
+
return /* @__PURE__ */ S(O, { children: [
|
|
2451
|
+
/* @__PURE__ */ l(
|
|
2452
|
+
P,
|
|
2447
2453
|
{
|
|
2448
2454
|
nativeID: e.key,
|
|
2449
2455
|
editable: !e.options.disabled,
|
|
2450
2456
|
placeholder: e.options.placeholder,
|
|
2451
2457
|
placeholderTextColor: "#9ca3af",
|
|
2452
|
-
defaultValue: e.options.defaultValue
|
|
2458
|
+
defaultValue: e.options.defaultValue === void 0 ? void 0 : String(e.options.defaultValue),
|
|
2453
2459
|
keyboardType: "decimal-pad",
|
|
2454
2460
|
onChangeText: c,
|
|
2455
|
-
onBlur:
|
|
2461
|
+
onBlur: p,
|
|
2456
2462
|
style: [
|
|
2457
|
-
|
|
2458
|
-
e.options.disabled &&
|
|
2459
|
-
o &&
|
|
2463
|
+
n.numberField.input,
|
|
2464
|
+
e.options.disabled && n.numberField.disabled,
|
|
2465
|
+
o && n.numberField.error
|
|
2460
2466
|
],
|
|
2461
2467
|
accessibilityLabel: e.options.label
|
|
2462
2468
|
}
|
|
2463
2469
|
),
|
|
2464
|
-
e.options.helpText && /* @__PURE__ */
|
|
2470
|
+
e.options.helpText && /* @__PURE__ */ l(u, { style: n.numberField.helpText, children: e.options.helpText })
|
|
2465
2471
|
] });
|
|
2466
2472
|
}
|
|
2467
|
-
function
|
|
2473
|
+
function nt({
|
|
2468
2474
|
form: t,
|
|
2469
2475
|
field: e,
|
|
2470
2476
|
hasError: o,
|
|
2471
|
-
formReadOnly:
|
|
2477
|
+
formReadOnly: a = !1,
|
|
2472
2478
|
formReadOnlyStyle: s = "value"
|
|
2473
2479
|
}) {
|
|
2474
|
-
const
|
|
2475
|
-
|
|
2476
|
-
const
|
|
2477
|
-
|
|
2480
|
+
const n = T(), i = Ue(e.options.currency, e.options.customCurrency), h = e.options.readOnly ?? a, b = e.options.readOnlyStyle ?? s, c = t.getValues(e.key) ?? "", p = e.options.hideSymbolWhenEmpty ?? !0, [d, f] = I(!!c);
|
|
2481
|
+
q(() => {
|
|
2482
|
+
const m = t.getValues(e.key);
|
|
2483
|
+
f(!!m);
|
|
2478
2484
|
}, [t, e.key]);
|
|
2479
|
-
const
|
|
2480
|
-
|
|
2481
|
-
e.options.showCurrencyCode && /* @__PURE__ */
|
|
2485
|
+
const k = !p || d ? /* @__PURE__ */ S(u, { style: n.moneyField.currencySymbol, children: [
|
|
2486
|
+
i.symbol,
|
|
2487
|
+
e.options.showCurrencyCode && /* @__PURE__ */ S(u, { style: { fontSize: 12, opacity: 0.75 }, children: [
|
|
2482
2488
|
" ",
|
|
2483
|
-
|
|
2489
|
+
i.code
|
|
2484
2490
|
] })
|
|
2485
2491
|
] }) : null;
|
|
2486
|
-
if (
|
|
2487
|
-
if (
|
|
2488
|
-
return /* @__PURE__ */
|
|
2489
|
-
|
|
2490
|
-
/* @__PURE__ */
|
|
2491
|
-
|
|
2492
|
+
if (h) {
|
|
2493
|
+
if (b === "disabled")
|
|
2494
|
+
return /* @__PURE__ */ S(y, { style: n.moneyField.container, children: [
|
|
2495
|
+
i.symbolPosition === "before" && k,
|
|
2496
|
+
/* @__PURE__ */ l(
|
|
2497
|
+
P,
|
|
2492
2498
|
{
|
|
2493
2499
|
nativeID: e.key,
|
|
2494
2500
|
editable: !1,
|
|
2495
2501
|
value: String(c),
|
|
2496
2502
|
keyboardType: "decimal-pad",
|
|
2497
|
-
style: [
|
|
2503
|
+
style: [n.moneyField.input, n.moneyField.disabled, o && n.moneyField.error],
|
|
2498
2504
|
accessibilityLabel: e.options.label
|
|
2499
2505
|
}
|
|
2500
2506
|
),
|
|
2501
|
-
|
|
2507
|
+
i.symbolPosition === "after" && k
|
|
2502
2508
|
] });
|
|
2503
|
-
const
|
|
2509
|
+
const m = M(c, i, {
|
|
2504
2510
|
showSymbol: !0,
|
|
2505
2511
|
showCode: e.options.showCurrencyCode
|
|
2506
2512
|
});
|
|
2507
|
-
return /* @__PURE__ */
|
|
2513
|
+
return /* @__PURE__ */ l(y, { style: n.moneyField.readOnlyValue, children: /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: m || "—" }) });
|
|
2508
2514
|
}
|
|
2509
|
-
return /* @__PURE__ */
|
|
2510
|
-
|
|
2511
|
-
/* @__PURE__ */
|
|
2512
|
-
|
|
2515
|
+
return /* @__PURE__ */ S(y, { style: n.moneyField.container, children: [
|
|
2516
|
+
i.symbolPosition === "before" && k,
|
|
2517
|
+
/* @__PURE__ */ l(
|
|
2518
|
+
P,
|
|
2513
2519
|
{
|
|
2514
2520
|
nativeID: e.key,
|
|
2515
2521
|
editable: !e.options.disabled,
|
|
2516
2522
|
placeholder: e.options.placeholder,
|
|
2517
2523
|
placeholderTextColor: "#9ca3af",
|
|
2518
|
-
defaultValue: e.options.defaultValue
|
|
2524
|
+
defaultValue: e.options.defaultValue === void 0 ? void 0 : String(e.options.defaultValue),
|
|
2519
2525
|
keyboardType: "decimal-pad",
|
|
2520
|
-
onChangeText: (
|
|
2521
|
-
const
|
|
2522
|
-
|
|
2526
|
+
onChangeText: (m) => {
|
|
2527
|
+
const C = m.replaceAll(/[^0-9.-]/g, ""), v = C === "" ? "" : Number.parseFloat(C);
|
|
2528
|
+
f(!!C), t.setValue(e.key, v === "" || Number.isNaN(v) ? "" : v, { shouldValidate: !0 });
|
|
2523
2529
|
},
|
|
2524
2530
|
onBlur: () => t.trigger(e.key),
|
|
2525
2531
|
style: [
|
|
2526
|
-
|
|
2527
|
-
e.options.disabled &&
|
|
2528
|
-
o &&
|
|
2532
|
+
n.moneyField.input,
|
|
2533
|
+
e.options.disabled && n.moneyField.disabled,
|
|
2534
|
+
o && n.moneyField.error
|
|
2529
2535
|
],
|
|
2530
2536
|
accessibilityLabel: e.options.label
|
|
2531
2537
|
}
|
|
2532
2538
|
),
|
|
2533
|
-
|
|
2539
|
+
i.symbolPosition === "after" && k
|
|
2534
2540
|
] });
|
|
2535
2541
|
}
|
|
2536
2542
|
let Se = null;
|
|
@@ -2538,140 +2544,140 @@ try {
|
|
|
2538
2544
|
Se = require("expo-checkbox").default;
|
|
2539
2545
|
} catch {
|
|
2540
2546
|
}
|
|
2541
|
-
function
|
|
2542
|
-
return /* @__PURE__ */
|
|
2543
|
-
|
|
2547
|
+
function lt({ value: t, onValueChange: e, disabled: o, color: a }) {
|
|
2548
|
+
return /* @__PURE__ */ l(
|
|
2549
|
+
R,
|
|
2544
2550
|
{
|
|
2545
2551
|
onPress: () => !o && e(!t),
|
|
2546
2552
|
style: {
|
|
2547
2553
|
width: 22,
|
|
2548
2554
|
height: 22,
|
|
2549
2555
|
borderWidth: 2,
|
|
2550
|
-
borderColor: t ?
|
|
2556
|
+
borderColor: t ? a || "#0284c7" : "#d1d5db",
|
|
2551
2557
|
borderRadius: 4,
|
|
2552
|
-
backgroundColor: t ?
|
|
2558
|
+
backgroundColor: t ? a || "#0284c7" : "transparent",
|
|
2553
2559
|
justifyContent: "center",
|
|
2554
2560
|
alignItems: "center",
|
|
2555
2561
|
opacity: o ? 0.5 : 1
|
|
2556
2562
|
},
|
|
2557
2563
|
accessibilityRole: "checkbox",
|
|
2558
2564
|
accessibilityState: { checked: t, disabled: o },
|
|
2559
|
-
children: t && /* @__PURE__ */
|
|
2565
|
+
children: t && /* @__PURE__ */ l(u, { style: { color: "#ffffff", fontSize: 14, fontWeight: "700" }, children: "✓" })
|
|
2560
2566
|
}
|
|
2561
2567
|
);
|
|
2562
2568
|
}
|
|
2563
|
-
function
|
|
2564
|
-
const { field: e, form: o, hasError:
|
|
2565
|
-
return
|
|
2566
|
-
/* @__PURE__ */
|
|
2567
|
-
/* @__PURE__ */
|
|
2568
|
-
|
|
2569
|
+
function ot(t) {
|
|
2570
|
+
const { field: e, form: o, hasError: a, errorMessage: s, formReadOnly: n = !1, formReadOnlyStyle: i = "value" } = t, h = e.options, c = T().checkbox, p = h.readOnly ?? n, d = h.readOnlyStyle ?? i, f = o.getValues(e.key), g = Se || lt;
|
|
2571
|
+
return p ? d === "disabled" ? /* @__PURE__ */ S(y, { style: c.wrapper, children: [
|
|
2572
|
+
/* @__PURE__ */ S(y, { style: c.row, children: [
|
|
2573
|
+
/* @__PURE__ */ l(
|
|
2574
|
+
g,
|
|
2569
2575
|
{
|
|
2570
|
-
value: !!
|
|
2576
|
+
value: !!f,
|
|
2571
2577
|
onValueChange: () => {
|
|
2572
2578
|
},
|
|
2573
2579
|
disabled: !0
|
|
2574
2580
|
}
|
|
2575
2581
|
),
|
|
2576
|
-
|
|
2582
|
+
h.label && /* @__PURE__ */ l(u, { style: [c.label, c.disabled], children: h.label })
|
|
2577
2583
|
] }),
|
|
2578
|
-
|
|
2579
|
-
] }) : /* @__PURE__ */
|
|
2584
|
+
h.helpText && /* @__PURE__ */ l(u, { style: c.helpText, children: h.helpText })
|
|
2585
|
+
] }) : /* @__PURE__ */ l(y, { style: c.wrapper, children: /* @__PURE__ */ l(u, { style: c.readOnly, children: f ? "Yes" : "No" }) }) : /* @__PURE__ */ l(
|
|
2580
2586
|
z,
|
|
2581
2587
|
{
|
|
2582
2588
|
name: e.key,
|
|
2583
2589
|
control: o.control,
|
|
2584
|
-
defaultValue:
|
|
2585
|
-
rules: { required:
|
|
2586
|
-
render: ({ field:
|
|
2587
|
-
/* @__PURE__ */
|
|
2588
|
-
/* @__PURE__ */
|
|
2589
|
-
|
|
2590
|
+
defaultValue: h.defaultValue,
|
|
2591
|
+
rules: { required: h.required ? J : !1 },
|
|
2592
|
+
render: ({ field: k }) => /* @__PURE__ */ S(y, { style: c.wrapper, children: [
|
|
2593
|
+
/* @__PURE__ */ S(y, { style: c.row, children: [
|
|
2594
|
+
/* @__PURE__ */ l(
|
|
2595
|
+
g,
|
|
2590
2596
|
{
|
|
2591
|
-
value: !!
|
|
2592
|
-
onValueChange: (
|
|
2593
|
-
disabled:
|
|
2594
|
-
color:
|
|
2597
|
+
value: !!k.value,
|
|
2598
|
+
onValueChange: (m) => k.onChange(m),
|
|
2599
|
+
disabled: h.disabled,
|
|
2600
|
+
color: k.value ? "#0284c7" : void 0
|
|
2595
2601
|
}
|
|
2596
2602
|
),
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2603
|
+
h.label && /* @__PURE__ */ S(u, { style: [c.label, h.disabled && c.disabled], children: [
|
|
2604
|
+
h.label,
|
|
2605
|
+
h.required && /* @__PURE__ */ l(u, { style: { color: "#dc2626" }, children: " *" })
|
|
2600
2606
|
] })
|
|
2601
2607
|
] }),
|
|
2602
|
-
|
|
2603
|
-
|
|
2608
|
+
h.helpText && /* @__PURE__ */ l(u, { style: c.helpText, children: h.helpText }),
|
|
2609
|
+
a && s && /* @__PURE__ */ l(u, { style: c.errorMessage, children: s })
|
|
2604
2610
|
] })
|
|
2605
2611
|
}
|
|
2606
2612
|
);
|
|
2607
2613
|
}
|
|
2608
|
-
function
|
|
2614
|
+
function at({
|
|
2609
2615
|
form: t,
|
|
2610
2616
|
field: e,
|
|
2611
2617
|
hasError: o,
|
|
2612
|
-
formReadOnly:
|
|
2618
|
+
formReadOnly: a = !1,
|
|
2613
2619
|
formReadOnlyStyle: s = "value"
|
|
2614
2620
|
}) {
|
|
2615
|
-
const
|
|
2616
|
-
return
|
|
2617
|
-
/* @__PURE__ */
|
|
2621
|
+
const n = T(), i = e.options.readOnly ?? a, h = e.options.readOnlyStyle ?? s, b = t.getValues(e.key);
|
|
2622
|
+
return i ? h === "disabled" ? /* @__PURE__ */ S(y, { style: n.switchField.container, children: [
|
|
2623
|
+
/* @__PURE__ */ S(u, { style: n.switchField.label, children: [
|
|
2618
2624
|
e.options.label,
|
|
2619
|
-
e.options.required && /* @__PURE__ */
|
|
2625
|
+
e.options.required && /* @__PURE__ */ l(u, { style: { color: "#dc2626" }, children: " *" })
|
|
2620
2626
|
] }),
|
|
2621
|
-
/* @__PURE__ */
|
|
2627
|
+
/* @__PURE__ */ l(
|
|
2622
2628
|
ie,
|
|
2623
2629
|
{
|
|
2624
|
-
value: !!
|
|
2630
|
+
value: !!b,
|
|
2625
2631
|
disabled: !0,
|
|
2626
2632
|
trackColor: { false: "#d1d5db", true: "#7dd3fc" },
|
|
2627
|
-
thumbColor:
|
|
2633
|
+
thumbColor: b ? "#0284c7" : "#f3f4f6"
|
|
2628
2634
|
}
|
|
2629
2635
|
)
|
|
2630
|
-
] }) : /* @__PURE__ */
|
|
2636
|
+
] }) : /* @__PURE__ */ l(u, { style: n.switchField.readOnlyValue, children: b ? "On" : "Off" }) : /* @__PURE__ */ l(
|
|
2631
2637
|
z,
|
|
2632
2638
|
{
|
|
2633
2639
|
name: e.key,
|
|
2634
2640
|
control: t.control,
|
|
2635
2641
|
defaultValue: e.options.defaultValue,
|
|
2636
|
-
render: ({ field: { onChange: c, value:
|
|
2637
|
-
/* @__PURE__ */
|
|
2638
|
-
/* @__PURE__ */
|
|
2642
|
+
render: ({ field: { onChange: c, value: p } }) => /* @__PURE__ */ S(y, { children: [
|
|
2643
|
+
/* @__PURE__ */ S(y, { style: n.switchField.container, children: [
|
|
2644
|
+
/* @__PURE__ */ S(u, { style: [n.switchField.label, e.options.disabled && n.switchField.disabled], children: [
|
|
2639
2645
|
e.options.label,
|
|
2640
|
-
e.options.required && /* @__PURE__ */
|
|
2646
|
+
e.options.required && /* @__PURE__ */ l(u, { style: { color: "#dc2626" }, children: " *" })
|
|
2641
2647
|
] }),
|
|
2642
|
-
/* @__PURE__ */
|
|
2648
|
+
/* @__PURE__ */ l(
|
|
2643
2649
|
ie,
|
|
2644
2650
|
{
|
|
2645
|
-
value: !!
|
|
2651
|
+
value: !!p,
|
|
2646
2652
|
onValueChange: (d) => {
|
|
2647
2653
|
e.options.disabled || c(d);
|
|
2648
2654
|
},
|
|
2649
2655
|
disabled: e.options.disabled,
|
|
2650
2656
|
trackColor: { false: "#d1d5db", true: "#7dd3fc" },
|
|
2651
|
-
thumbColor:
|
|
2657
|
+
thumbColor: p ? "#0284c7" : "#f3f4f6",
|
|
2652
2658
|
accessibilityLabel: e.options.label,
|
|
2653
2659
|
accessibilityRole: "switch"
|
|
2654
2660
|
}
|
|
2655
2661
|
)
|
|
2656
2662
|
] }),
|
|
2657
|
-
e.options.helpText && /* @__PURE__ */
|
|
2663
|
+
e.options.helpText && /* @__PURE__ */ l(u, { style: n.switchField.helpText, children: e.options.helpText })
|
|
2658
2664
|
] })
|
|
2659
2665
|
}
|
|
2660
2666
|
);
|
|
2661
2667
|
}
|
|
2662
|
-
function
|
|
2668
|
+
function it({
|
|
2663
2669
|
children: t,
|
|
2664
2670
|
variant: e = "primary",
|
|
2665
2671
|
disabled: o,
|
|
2666
|
-
loading:
|
|
2672
|
+
loading: a = !1,
|
|
2667
2673
|
fullWidth: s = !1,
|
|
2668
|
-
onPress:
|
|
2669
|
-
style:
|
|
2670
|
-
textStyle:
|
|
2671
|
-
className:
|
|
2674
|
+
onPress: n,
|
|
2675
|
+
style: i,
|
|
2676
|
+
textStyle: h,
|
|
2677
|
+
className: b,
|
|
2672
2678
|
accessibilityLabel: c
|
|
2673
2679
|
}) {
|
|
2674
|
-
const d =
|
|
2680
|
+
const d = T().button, f = o || a, g = () => {
|
|
2675
2681
|
switch (e) {
|
|
2676
2682
|
case "danger":
|
|
2677
2683
|
return d.dangerText;
|
|
@@ -2680,359 +2686,359 @@ function et({
|
|
|
2680
2686
|
default:
|
|
2681
2687
|
return d.primaryText;
|
|
2682
2688
|
}
|
|
2683
|
-
};
|
|
2684
|
-
return /* @__PURE__ */
|
|
2685
|
-
|
|
2689
|
+
}, k = () => a ? /* @__PURE__ */ l(Pe, { size: "small", color: e === "secondary" ? "#374151" : "#ffffff" }) : typeof t == "string" ? /* @__PURE__ */ l(u, { style: [d.text, g(), f && d.disabledText, h], children: t }) : t;
|
|
2690
|
+
return /* @__PURE__ */ l(
|
|
2691
|
+
R,
|
|
2686
2692
|
{
|
|
2687
|
-
onPress:
|
|
2688
|
-
disabled:
|
|
2693
|
+
onPress: f ? void 0 : n,
|
|
2694
|
+
disabled: f,
|
|
2689
2695
|
style: [
|
|
2690
2696
|
d.base,
|
|
2691
2697
|
d[e],
|
|
2692
|
-
|
|
2693
|
-
|
|
2698
|
+
f && d.disabled,
|
|
2699
|
+
a && d.loading,
|
|
2694
2700
|
s && d.fullWidth,
|
|
2695
|
-
|
|
2701
|
+
i
|
|
2696
2702
|
],
|
|
2697
2703
|
accessibilityRole: "button",
|
|
2698
|
-
accessibilityState: { disabled:
|
|
2704
|
+
accessibilityState: { disabled: f },
|
|
2699
2705
|
accessibilityLabel: c,
|
|
2700
|
-
...
|
|
2701
|
-
children:
|
|
2706
|
+
...b ? { className: b } : {},
|
|
2707
|
+
children: k()
|
|
2702
2708
|
}
|
|
2703
2709
|
);
|
|
2704
2710
|
}
|
|
2705
|
-
function
|
|
2711
|
+
function st({
|
|
2706
2712
|
field: t,
|
|
2707
2713
|
form: e,
|
|
2708
2714
|
hasError: o
|
|
2709
2715
|
}) {
|
|
2710
|
-
const
|
|
2716
|
+
const a = async () => {
|
|
2711
2717
|
t.options.disabled || (t.options.type === "submit" && e.handleSubmit((s) => {
|
|
2712
2718
|
})(), t.options.onClick && await t.options.onClick());
|
|
2713
2719
|
};
|
|
2714
|
-
return /* @__PURE__ */
|
|
2715
|
-
|
|
2720
|
+
return /* @__PURE__ */ l(
|
|
2721
|
+
it,
|
|
2716
2722
|
{
|
|
2717
2723
|
variant: t.options.variant,
|
|
2718
2724
|
loading: t.options.loading,
|
|
2719
2725
|
disabled: t.options.disabled,
|
|
2720
2726
|
fullWidth: t.options.fullWidth,
|
|
2721
|
-
onPress:
|
|
2727
|
+
onPress: a,
|
|
2722
2728
|
accessibilityLabel: t.options.text ?? t.options.label ?? "Button",
|
|
2723
2729
|
children: t.options.text ?? t.options.label ?? "Button"
|
|
2724
2730
|
}
|
|
2725
2731
|
);
|
|
2726
2732
|
}
|
|
2727
|
-
let
|
|
2733
|
+
let le = null;
|
|
2728
2734
|
try {
|
|
2729
|
-
|
|
2735
|
+
le = require("@react-native-community/datetimepicker").default;
|
|
2730
2736
|
} catch {
|
|
2731
2737
|
}
|
|
2732
|
-
function
|
|
2738
|
+
function dt({
|
|
2733
2739
|
form: t,
|
|
2734
2740
|
field: e,
|
|
2735
2741
|
hasError: o,
|
|
2736
|
-
formReadOnly:
|
|
2742
|
+
formReadOnly: a = !1,
|
|
2737
2743
|
formReadOnlyStyle: s = "value"
|
|
2738
2744
|
}) {
|
|
2739
|
-
const
|
|
2740
|
-
return
|
|
2741
|
-
/* @__PURE__ */
|
|
2742
|
-
|
|
2743
|
-
] }) : /* @__PURE__ */
|
|
2744
|
-
/* @__PURE__ */
|
|
2745
|
-
|
|
2746
|
-
] }) : /* @__PURE__ */
|
|
2745
|
+
const n = T().datePicker, i = e.options, h = i.readOnly ?? a, b = i.readOnlyStyle ?? s, c = t.getValues(e.key) ?? "", [p, d] = I(!1);
|
|
2746
|
+
return le ? h ? b === "disabled" ? /* @__PURE__ */ S(O, { children: [
|
|
2747
|
+
/* @__PURE__ */ l(y, { style: [n.trigger, n.disabled], children: /* @__PURE__ */ l(u, { style: n.triggerText, children: c ? re(c) ?? c : "—" }) }),
|
|
2748
|
+
i.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: i.helpText })
|
|
2749
|
+
] }) : /* @__PURE__ */ S(O, { children: [
|
|
2750
|
+
/* @__PURE__ */ l(y, { style: n.readOnlyValue, children: /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: re(c) || "—" }) }),
|
|
2751
|
+
i.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: i.helpText })
|
|
2752
|
+
] }) : /* @__PURE__ */ l(
|
|
2747
2753
|
z,
|
|
2748
2754
|
{
|
|
2749
2755
|
name: e.key,
|
|
2750
2756
|
control: t.control,
|
|
2751
|
-
defaultValue: ge(
|
|
2752
|
-
rules: { required:
|
|
2753
|
-
render: ({ field:
|
|
2754
|
-
const
|
|
2755
|
-
return /* @__PURE__ */
|
|
2756
|
-
/* @__PURE__ */
|
|
2757
|
-
|
|
2757
|
+
defaultValue: ge(i.defaultValue ?? ""),
|
|
2758
|
+
rules: { required: i.required },
|
|
2759
|
+
render: ({ field: f }) => {
|
|
2760
|
+
const g = f.value ? new Date(f.value) : /* @__PURE__ */ new Date();
|
|
2761
|
+
return /* @__PURE__ */ S(y, { children: [
|
|
2762
|
+
/* @__PURE__ */ l(
|
|
2763
|
+
R,
|
|
2758
2764
|
{
|
|
2759
|
-
onPress: () => !
|
|
2765
|
+
onPress: () => !i.disabled && d(!0),
|
|
2760
2766
|
style: [
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
o &&
|
|
2767
|
+
n.trigger,
|
|
2768
|
+
i.disabled && n.disabled,
|
|
2769
|
+
o && n.error
|
|
2764
2770
|
],
|
|
2765
|
-
accessibilityLabel:
|
|
2771
|
+
accessibilityLabel: i.label ?? "Select date",
|
|
2766
2772
|
accessibilityRole: "button",
|
|
2767
|
-
children: /* @__PURE__ */
|
|
2773
|
+
children: /* @__PURE__ */ l(u, { style: f.value ? n.triggerText : n.placeholderText, children: f.value ? re(f.value) ?? f.value : i.placeholder || "Select date..." })
|
|
2768
2774
|
}
|
|
2769
2775
|
),
|
|
2770
|
-
|
|
2771
|
-
|
|
2776
|
+
p && /* @__PURE__ */ l(
|
|
2777
|
+
le,
|
|
2772
2778
|
{
|
|
2773
|
-
value:
|
|
2779
|
+
value: g,
|
|
2774
2780
|
mode: "date",
|
|
2775
|
-
display:
|
|
2776
|
-
minimumDate:
|
|
2777
|
-
maximumDate:
|
|
2778
|
-
onChange: (
|
|
2779
|
-
if (d(
|
|
2780
|
-
const
|
|
2781
|
-
|
|
2781
|
+
display: j.OS === "ios" ? "spinner" : "default",
|
|
2782
|
+
minimumDate: i.min ? new Date(i.min) : void 0,
|
|
2783
|
+
maximumDate: i.max ? new Date(i.max) : void 0,
|
|
2784
|
+
onChange: (k, m) => {
|
|
2785
|
+
if (d(j.OS === "ios"), m) {
|
|
2786
|
+
const C = m.toISOString().split("T")[0];
|
|
2787
|
+
f.onChange(C);
|
|
2782
2788
|
}
|
|
2783
2789
|
}
|
|
2784
2790
|
}
|
|
2785
2791
|
),
|
|
2786
|
-
|
|
2792
|
+
i.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: i.helpText })
|
|
2787
2793
|
] });
|
|
2788
2794
|
}
|
|
2789
2795
|
}
|
|
2790
|
-
) : /* @__PURE__ */
|
|
2796
|
+
) : /* @__PURE__ */ l(y, { style: n.trigger, children: /* @__PURE__ */ l(u, { style: n.placeholderText, children: "Install @react-native-community/datetimepicker to use DatePickerField" }) });
|
|
2791
2797
|
}
|
|
2792
|
-
let
|
|
2798
|
+
let $ = null;
|
|
2793
2799
|
try {
|
|
2794
|
-
|
|
2800
|
+
$ = require("@react-native-community/datetimepicker").default;
|
|
2795
2801
|
} catch {
|
|
2796
2802
|
}
|
|
2797
|
-
function
|
|
2803
|
+
function ct({
|
|
2798
2804
|
form: t,
|
|
2799
2805
|
field: e,
|
|
2800
2806
|
hasError: o,
|
|
2801
|
-
formReadOnly:
|
|
2807
|
+
formReadOnly: a = !1,
|
|
2802
2808
|
formReadOnlyStyle: s = "value"
|
|
2803
2809
|
}) {
|
|
2804
|
-
const
|
|
2805
|
-
return
|
|
2810
|
+
const n = T().dateTimePicker, i = e.options, h = i.readOnly ?? a, b = i.readOnlyStyle ?? s, c = t.getValues(e.key) ?? "", [p, d] = I(!1), [f, g] = I(!1), [k, m] = I(null);
|
|
2811
|
+
return $ ? h ? b === "disabled" ? /* @__PURE__ */ l(y, { style: [n.trigger, n.disabled], children: /* @__PURE__ */ l(u, { style: n.triggerText, children: c ? ne(c) ?? c : "—" }) }) : /* @__PURE__ */ l(y, { style: n.readOnlyValue, children: /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: ne(c) ?? "—" }) }) : /* @__PURE__ */ l(
|
|
2806
2812
|
z,
|
|
2807
2813
|
{
|
|
2808
2814
|
name: e.key,
|
|
2809
2815
|
control: t.control,
|
|
2810
|
-
defaultValue:
|
|
2811
|
-
rules: { required:
|
|
2812
|
-
render: ({ field:
|
|
2813
|
-
const
|
|
2814
|
-
return /* @__PURE__ */
|
|
2815
|
-
/* @__PURE__ */
|
|
2816
|
-
|
|
2816
|
+
defaultValue: Ge(i.defaultValue ?? ""),
|
|
2817
|
+
rules: { required: i.required },
|
|
2818
|
+
render: ({ field: C }) => {
|
|
2819
|
+
const v = C.value ? new Date(C.value) : /* @__PURE__ */ new Date();
|
|
2820
|
+
return /* @__PURE__ */ S(y, { children: [
|
|
2821
|
+
/* @__PURE__ */ l(
|
|
2822
|
+
R,
|
|
2817
2823
|
{
|
|
2818
|
-
onPress: () => !
|
|
2824
|
+
onPress: () => !i.disabled && d(!0),
|
|
2819
2825
|
style: [
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
o &&
|
|
2826
|
+
n.trigger,
|
|
2827
|
+
i.disabled && n.disabled,
|
|
2828
|
+
o && n.error
|
|
2823
2829
|
],
|
|
2824
|
-
accessibilityLabel:
|
|
2830
|
+
accessibilityLabel: i.label ?? "Select date and time",
|
|
2825
2831
|
accessibilityRole: "button",
|
|
2826
|
-
children: /* @__PURE__ */
|
|
2832
|
+
children: /* @__PURE__ */ l(u, { style: C.value ? n.triggerText : n.placeholderText, children: C.value ? ne(C.value) ?? C.value : i.placeholder || "Select date and time..." })
|
|
2827
2833
|
}
|
|
2828
2834
|
),
|
|
2829
|
-
|
|
2830
|
-
|
|
2835
|
+
p && /* @__PURE__ */ l(
|
|
2836
|
+
$,
|
|
2831
2837
|
{
|
|
2832
|
-
value:
|
|
2838
|
+
value: v,
|
|
2833
2839
|
mode: "date",
|
|
2834
|
-
display:
|
|
2835
|
-
minimumDate:
|
|
2836
|
-
maximumDate:
|
|
2837
|
-
onChange: (
|
|
2838
|
-
d(!1),
|
|
2840
|
+
display: j.OS === "ios" ? "spinner" : "default",
|
|
2841
|
+
minimumDate: i.min ? new Date(i.min) : void 0,
|
|
2842
|
+
maximumDate: i.max ? new Date(i.max) : void 0,
|
|
2843
|
+
onChange: (V, F) => {
|
|
2844
|
+
d(!1), F && (m(F), g(!0));
|
|
2839
2845
|
}
|
|
2840
2846
|
}
|
|
2841
2847
|
),
|
|
2842
|
-
|
|
2843
|
-
|
|
2848
|
+
f && /* @__PURE__ */ l(
|
|
2849
|
+
$,
|
|
2844
2850
|
{
|
|
2845
|
-
value:
|
|
2851
|
+
value: k || v,
|
|
2846
2852
|
mode: "time",
|
|
2847
|
-
display:
|
|
2848
|
-
onChange: (
|
|
2849
|
-
if (
|
|
2850
|
-
const
|
|
2851
|
-
|
|
2852
|
-
const
|
|
2853
|
-
|
|
2853
|
+
display: j.OS === "ios" ? "spinner" : "default",
|
|
2854
|
+
onChange: (V, F) => {
|
|
2855
|
+
if (g(!1), F && k) {
|
|
2856
|
+
const D = new Date(k);
|
|
2857
|
+
D.setHours(F.getHours()), D.setMinutes(F.getMinutes());
|
|
2858
|
+
const A = D.toISOString().slice(0, 16);
|
|
2859
|
+
C.onChange(A);
|
|
2854
2860
|
}
|
|
2855
|
-
|
|
2861
|
+
m(null);
|
|
2856
2862
|
}
|
|
2857
2863
|
}
|
|
2858
2864
|
),
|
|
2859
|
-
|
|
2865
|
+
i.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: i.helpText })
|
|
2860
2866
|
] });
|
|
2861
2867
|
}
|
|
2862
2868
|
}
|
|
2863
|
-
) : /* @__PURE__ */
|
|
2869
|
+
) : /* @__PURE__ */ l(y, { style: n.trigger, children: /* @__PURE__ */ l(u, { style: n.placeholderText, children: "Install @react-native-community/datetimepicker to use DateTimePickerField" }) });
|
|
2864
2870
|
}
|
|
2865
2871
|
let oe = null;
|
|
2866
2872
|
try {
|
|
2867
2873
|
oe = require("@react-native-community/datetimepicker").default;
|
|
2868
2874
|
} catch {
|
|
2869
2875
|
}
|
|
2870
|
-
function
|
|
2876
|
+
function ut({
|
|
2871
2877
|
form: t,
|
|
2872
2878
|
field: e,
|
|
2873
2879
|
hasError: o,
|
|
2874
|
-
formReadOnly:
|
|
2880
|
+
formReadOnly: a = !1,
|
|
2875
2881
|
formReadOnlyStyle: s = "value"
|
|
2876
2882
|
}) {
|
|
2877
|
-
const
|
|
2883
|
+
const n = T().timePicker, i = e.options.readOnly ?? a, h = e.options.readOnlyStyle ?? s, b = t.getValues(e.key) ?? "", [c, p] = I(!1);
|
|
2878
2884
|
if (!oe)
|
|
2879
|
-
return /* @__PURE__ */
|
|
2880
|
-
if (
|
|
2881
|
-
return
|
|
2882
|
-
/* @__PURE__ */
|
|
2883
|
-
e.options.helpText && /* @__PURE__ */
|
|
2884
|
-
] }) : /* @__PURE__ */
|
|
2885
|
-
/* @__PURE__ */
|
|
2886
|
-
e.options.helpText && /* @__PURE__ */
|
|
2885
|
+
return /* @__PURE__ */ l(y, { style: n.trigger, children: /* @__PURE__ */ l(u, { style: n.placeholderText, children: "Install @react-native-community/datetimepicker to use TimePickerField" }) });
|
|
2886
|
+
if (i)
|
|
2887
|
+
return h === "disabled" ? /* @__PURE__ */ S(O, { children: [
|
|
2888
|
+
/* @__PURE__ */ l(y, { style: [n.trigger, n.disabled], children: /* @__PURE__ */ l(u, { style: n.triggerText, children: b || "—" }) }),
|
|
2889
|
+
e.options.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: e.options.helpText })
|
|
2890
|
+
] }) : /* @__PURE__ */ S(O, { children: [
|
|
2891
|
+
/* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: b || "—" }),
|
|
2892
|
+
e.options.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: e.options.helpText })
|
|
2887
2893
|
] });
|
|
2888
|
-
const d = (
|
|
2889
|
-
const
|
|
2890
|
-
if (
|
|
2891
|
-
const [
|
|
2892
|
-
|
|
2894
|
+
const d = (f) => {
|
|
2895
|
+
const g = /* @__PURE__ */ new Date();
|
|
2896
|
+
if (f) {
|
|
2897
|
+
const [k, m] = f.split(":").map(Number);
|
|
2898
|
+
g.setHours(k || 0), g.setMinutes(m || 0);
|
|
2893
2899
|
}
|
|
2894
|
-
return
|
|
2900
|
+
return g;
|
|
2895
2901
|
};
|
|
2896
|
-
return /* @__PURE__ */
|
|
2902
|
+
return /* @__PURE__ */ l(
|
|
2897
2903
|
z,
|
|
2898
2904
|
{
|
|
2899
2905
|
name: e.key,
|
|
2900
2906
|
control: t.control,
|
|
2901
2907
|
defaultValue: e.options.defaultValue,
|
|
2902
2908
|
rules: { required: e.options.required },
|
|
2903
|
-
render: ({ field:
|
|
2904
|
-
/* @__PURE__ */
|
|
2905
|
-
|
|
2909
|
+
render: ({ field: f }) => /* @__PURE__ */ S(y, { children: [
|
|
2910
|
+
/* @__PURE__ */ l(
|
|
2911
|
+
R,
|
|
2906
2912
|
{
|
|
2907
|
-
onPress: () => !e.options.disabled &&
|
|
2913
|
+
onPress: () => !e.options.disabled && p(!0),
|
|
2908
2914
|
style: [
|
|
2909
|
-
|
|
2910
|
-
e.options.disabled &&
|
|
2911
|
-
o &&
|
|
2915
|
+
n.trigger,
|
|
2916
|
+
e.options.disabled && n.disabled,
|
|
2917
|
+
o && n.error
|
|
2912
2918
|
],
|
|
2913
2919
|
accessibilityLabel: e.options.label ?? "Select time",
|
|
2914
2920
|
accessibilityRole: "button",
|
|
2915
|
-
children: /* @__PURE__ */
|
|
2921
|
+
children: /* @__PURE__ */ l(u, { style: f.value ? n.triggerText : n.placeholderText, children: f.value || "Select time..." })
|
|
2916
2922
|
}
|
|
2917
2923
|
),
|
|
2918
|
-
c && /* @__PURE__ */
|
|
2924
|
+
c && /* @__PURE__ */ l(
|
|
2919
2925
|
oe,
|
|
2920
2926
|
{
|
|
2921
|
-
value: d(
|
|
2927
|
+
value: d(f.value || ""),
|
|
2922
2928
|
mode: "time",
|
|
2923
|
-
display:
|
|
2924
|
-
onChange: (
|
|
2925
|
-
if (
|
|
2926
|
-
const
|
|
2927
|
-
|
|
2929
|
+
display: j.OS === "ios" ? "spinner" : "default",
|
|
2930
|
+
onChange: (g, k) => {
|
|
2931
|
+
if (p(j.OS === "ios"), k) {
|
|
2932
|
+
const m = k.getHours().toString().padStart(2, "0"), C = k.getMinutes().toString().padStart(2, "0");
|
|
2933
|
+
f.onChange(`${m}:${C}`);
|
|
2928
2934
|
}
|
|
2929
2935
|
}
|
|
2930
2936
|
}
|
|
2931
2937
|
),
|
|
2932
|
-
e.options.helpText && /* @__PURE__ */
|
|
2938
|
+
e.options.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: e.options.helpText })
|
|
2933
2939
|
] })
|
|
2934
2940
|
}
|
|
2935
2941
|
);
|
|
2936
2942
|
}
|
|
2937
|
-
let
|
|
2943
|
+
let U = null;
|
|
2938
2944
|
try {
|
|
2939
|
-
|
|
2945
|
+
U = require("react-native-element-dropdown").Dropdown;
|
|
2940
2946
|
} catch {
|
|
2941
2947
|
}
|
|
2942
2948
|
function xe({
|
|
2943
2949
|
form: t,
|
|
2944
2950
|
field: e,
|
|
2945
2951
|
hasError: o,
|
|
2946
|
-
formReadOnly:
|
|
2952
|
+
formReadOnly: a = !1,
|
|
2947
2953
|
formReadOnlyStyle: s = "value"
|
|
2948
2954
|
}) {
|
|
2949
|
-
const
|
|
2950
|
-
if (!
|
|
2951
|
-
return /* @__PURE__ */
|
|
2952
|
-
if (
|
|
2953
|
-
const
|
|
2954
|
-
return
|
|
2955
|
-
/* @__PURE__ */
|
|
2956
|
-
|
|
2955
|
+
const n = T().selectField, i = e.options.options || [], h = e.options.readOnly ?? a, b = e.options.readOnlyStyle ?? s, c = t.getValues(e.key);
|
|
2956
|
+
if (!U)
|
|
2957
|
+
return /* @__PURE__ */ l(y, { style: n.container, children: /* @__PURE__ */ l(u, { style: n.placeholder, children: "Install react-native-element-dropdown to use SelectField" }) });
|
|
2958
|
+
if (h) {
|
|
2959
|
+
const p = i.find((d) => d.value === c);
|
|
2960
|
+
return b === "disabled" ? /* @__PURE__ */ S(O, { children: [
|
|
2961
|
+
/* @__PURE__ */ l(
|
|
2962
|
+
U,
|
|
2957
2963
|
{
|
|
2958
|
-
data:
|
|
2964
|
+
data: i.map((d) => ({ label: d.label, value: String(d.value) })),
|
|
2959
2965
|
labelField: "label",
|
|
2960
2966
|
valueField: "value",
|
|
2961
2967
|
value: c ? String(c) : null,
|
|
2962
2968
|
disable: !0,
|
|
2963
2969
|
placeholder: e.options.placeholder || "Select...",
|
|
2964
|
-
style: [
|
|
2965
|
-
placeholderStyle:
|
|
2966
|
-
selectedTextStyle:
|
|
2970
|
+
style: [n.container, n.disabled, o && n.error],
|
|
2971
|
+
placeholderStyle: n.placeholder,
|
|
2972
|
+
selectedTextStyle: n.selectedText,
|
|
2967
2973
|
onChange: () => {
|
|
2968
2974
|
}
|
|
2969
2975
|
}
|
|
2970
2976
|
),
|
|
2971
|
-
e.options.helpText && /* @__PURE__ */
|
|
2972
|
-
] }) : /* @__PURE__ */
|
|
2973
|
-
/* @__PURE__ */
|
|
2974
|
-
e.options.helpText && /* @__PURE__ */
|
|
2977
|
+
e.options.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: e.options.helpText })
|
|
2978
|
+
] }) : /* @__PURE__ */ S(O, { children: [
|
|
2979
|
+
/* @__PURE__ */ l(y, { style: n.readOnlyValue, children: /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: p?.label || "—" }) }),
|
|
2980
|
+
e.options.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: e.options.helpText })
|
|
2975
2981
|
] });
|
|
2976
2982
|
}
|
|
2977
|
-
return /* @__PURE__ */
|
|
2983
|
+
return /* @__PURE__ */ l(
|
|
2978
2984
|
z,
|
|
2979
2985
|
{
|
|
2980
2986
|
name: e.key,
|
|
2981
2987
|
control: t.control,
|
|
2982
2988
|
defaultValue: e.options.defaultValue,
|
|
2983
2989
|
rules: { required: e.options.required },
|
|
2984
|
-
render: ({ field:
|
|
2985
|
-
/* @__PURE__ */
|
|
2986
|
-
|
|
2990
|
+
render: ({ field: p }) => /* @__PURE__ */ S(y, { style: n.wrapper, children: [
|
|
2991
|
+
/* @__PURE__ */ l(
|
|
2992
|
+
U,
|
|
2987
2993
|
{
|
|
2988
|
-
data:
|
|
2994
|
+
data: i.map((d) => ({ label: d.label, value: String(d.value) })),
|
|
2989
2995
|
labelField: "label",
|
|
2990
2996
|
valueField: "value",
|
|
2991
|
-
value:
|
|
2997
|
+
value: p.value ? String(p.value) : null,
|
|
2992
2998
|
onChange: (d) => {
|
|
2993
|
-
|
|
2999
|
+
p.onChange(d.value);
|
|
2994
3000
|
},
|
|
2995
|
-
onBlur:
|
|
3001
|
+
onBlur: p.onBlur,
|
|
2996
3002
|
disable: e.options.disabled,
|
|
2997
3003
|
placeholder: e.options.placeholder || "Select...",
|
|
2998
|
-
style: [
|
|
2999
|
-
placeholderStyle:
|
|
3000
|
-
selectedTextStyle:
|
|
3001
|
-
itemTextStyle:
|
|
3002
|
-
activeColor:
|
|
3004
|
+
style: [n.container, e.options.disabled && n.disabled, o && n.error],
|
|
3005
|
+
placeholderStyle: n.placeholder,
|
|
3006
|
+
selectedTextStyle: n.selectedText,
|
|
3007
|
+
itemTextStyle: n.itemText,
|
|
3008
|
+
activeColor: n.selectedItem?.backgroundColor,
|
|
3003
3009
|
accessibilityLabel: e.options.label
|
|
3004
3010
|
}
|
|
3005
3011
|
),
|
|
3006
|
-
e.options.helpText && /* @__PURE__ */
|
|
3012
|
+
e.options.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: e.options.helpText })
|
|
3007
3013
|
] })
|
|
3008
3014
|
}
|
|
3009
3015
|
);
|
|
3010
3016
|
}
|
|
3011
|
-
function
|
|
3017
|
+
function pt({
|
|
3012
3018
|
form: t,
|
|
3013
3019
|
field: e,
|
|
3014
3020
|
hasError: o,
|
|
3015
|
-
formReadOnly:
|
|
3021
|
+
formReadOnly: a = !1,
|
|
3016
3022
|
formReadOnlyStyle: s = "value"
|
|
3017
3023
|
}) {
|
|
3018
|
-
const
|
|
3019
|
-
label:
|
|
3020
|
-
value: String(
|
|
3021
|
-
})),
|
|
3024
|
+
const n = Object.entries(e.options.enum || {}).map(([h, b]) => ({
|
|
3025
|
+
label: h,
|
|
3026
|
+
value: String(b)
|
|
3027
|
+
})), i = {
|
|
3022
3028
|
...e,
|
|
3023
|
-
type:
|
|
3029
|
+
type: x.Select,
|
|
3024
3030
|
options: {
|
|
3025
3031
|
...e.options,
|
|
3026
|
-
options:
|
|
3032
|
+
options: n
|
|
3027
3033
|
}
|
|
3028
3034
|
};
|
|
3029
|
-
return /* @__PURE__ */
|
|
3035
|
+
return /* @__PURE__ */ l(
|
|
3030
3036
|
xe,
|
|
3031
3037
|
{
|
|
3032
3038
|
form: t,
|
|
3033
|
-
field:
|
|
3039
|
+
field: i,
|
|
3034
3040
|
hasError: o,
|
|
3035
|
-
formReadOnly:
|
|
3041
|
+
formReadOnly: a,
|
|
3036
3042
|
formReadOnlyStyle: s
|
|
3037
3043
|
}
|
|
3038
3044
|
);
|
|
@@ -3042,37 +3048,40 @@ try {
|
|
|
3042
3048
|
G = require("react-native-element-dropdown").MultiSelect;
|
|
3043
3049
|
} catch {
|
|
3044
3050
|
}
|
|
3045
|
-
function
|
|
3051
|
+
function ht(t) {
|
|
3052
|
+
return typeof t == "string" ? t : t?.value !== void 0 ? String(t.value) : String(t);
|
|
3053
|
+
}
|
|
3054
|
+
function bt(t) {
|
|
3046
3055
|
return Array.isArray(t) ? t.map((e) => typeof e == "string" ? e : e && typeof e == "object" && "value" in e ? e.value : String(e)) : [];
|
|
3047
3056
|
}
|
|
3048
|
-
function
|
|
3057
|
+
function yt({
|
|
3049
3058
|
form: t,
|
|
3050
3059
|
field: e,
|
|
3051
3060
|
hasError: o,
|
|
3052
|
-
formReadOnly:
|
|
3061
|
+
formReadOnly: a = !1,
|
|
3053
3062
|
formReadOnlyStyle: s = "value"
|
|
3054
3063
|
}) {
|
|
3055
|
-
const
|
|
3056
|
-
if (e.options.submitTransform ??=
|
|
3057
|
-
return /* @__PURE__ */
|
|
3058
|
-
if (
|
|
3059
|
-
const c = t.getValues(e.key) ?? [],
|
|
3060
|
-
return
|
|
3064
|
+
const n = T().multiSelect, i = (e.options.options || []).map((c) => ({ label: c.label, value: String(c.value) })), h = e.options.readOnly ?? a, b = e.options.readOnlyStyle ?? s;
|
|
3065
|
+
if (e.options.submitTransform ??= bt, !G)
|
|
3066
|
+
return /* @__PURE__ */ l(y, { style: n.container, children: /* @__PURE__ */ l(u, { style: n.placeholder, children: "Install react-native-element-dropdown to use SelectFieldMulti" }) });
|
|
3067
|
+
if (h) {
|
|
3068
|
+
const c = t.getValues(e.key) ?? [], p = Array.isArray(c) ? c.map(String) : [], d = i.filter((f) => p.includes(f.value)).map((f) => f.label);
|
|
3069
|
+
return b === "disabled" ? /* @__PURE__ */ l(
|
|
3061
3070
|
G,
|
|
3062
3071
|
{
|
|
3063
|
-
data:
|
|
3072
|
+
data: i,
|
|
3064
3073
|
labelField: "label",
|
|
3065
3074
|
valueField: "value",
|
|
3066
|
-
value:
|
|
3075
|
+
value: p,
|
|
3067
3076
|
disable: !0,
|
|
3068
3077
|
placeholder: e.options.placeholder || "Select...",
|
|
3069
|
-
style: [
|
|
3078
|
+
style: [n.container, n.disabled],
|
|
3070
3079
|
onChange: () => {
|
|
3071
3080
|
}
|
|
3072
3081
|
}
|
|
3073
|
-
) : /* @__PURE__ */
|
|
3082
|
+
) : /* @__PURE__ */ l(y, { style: n.readOnlyValue, children: /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: d.join(", ") || "—" }) });
|
|
3074
3083
|
}
|
|
3075
|
-
return /* @__PURE__ */
|
|
3084
|
+
return /* @__PURE__ */ l(
|
|
3076
3085
|
z,
|
|
3077
3086
|
{
|
|
3078
3087
|
name: e.key,
|
|
@@ -3080,87 +3089,87 @@ function it({
|
|
|
3080
3089
|
defaultValue: e.options.defaultValue ?? [],
|
|
3081
3090
|
rules: { required: e.options.required },
|
|
3082
3091
|
render: ({ field: c }) => {
|
|
3083
|
-
const
|
|
3084
|
-
return /* @__PURE__ */
|
|
3085
|
-
/* @__PURE__ */
|
|
3092
|
+
const p = Array.isArray(c.value) ? c.value.map(ht) : [];
|
|
3093
|
+
return /* @__PURE__ */ S(y, { style: n.wrapper, children: [
|
|
3094
|
+
/* @__PURE__ */ l(
|
|
3086
3095
|
G,
|
|
3087
3096
|
{
|
|
3088
|
-
data:
|
|
3097
|
+
data: i,
|
|
3089
3098
|
labelField: "label",
|
|
3090
3099
|
valueField: "value",
|
|
3091
|
-
value:
|
|
3100
|
+
value: p,
|
|
3092
3101
|
onChange: (d) => {
|
|
3093
3102
|
c.onChange(d);
|
|
3094
3103
|
},
|
|
3095
3104
|
disable: e.options.disabled,
|
|
3096
3105
|
placeholder: e.options.placeholder || "Select...",
|
|
3097
|
-
style: [
|
|
3098
|
-
placeholderStyle:
|
|
3099
|
-
selectedTextStyle:
|
|
3106
|
+
style: [n.container, e.options.disabled && n.disabled, o && n.error],
|
|
3107
|
+
placeholderStyle: n.placeholder,
|
|
3108
|
+
selectedTextStyle: n.selectedItemText,
|
|
3100
3109
|
accessibilityLabel: e.options.label
|
|
3101
3110
|
}
|
|
3102
3111
|
),
|
|
3103
|
-
e.options.helpText && /* @__PURE__ */
|
|
3112
|
+
e.options.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: e.options.helpText })
|
|
3104
3113
|
] });
|
|
3105
3114
|
}
|
|
3106
3115
|
}
|
|
3107
3116
|
);
|
|
3108
3117
|
}
|
|
3109
|
-
function
|
|
3110
|
-
const e =
|
|
3111
|
-
|
|
3112
|
-
const
|
|
3113
|
-
if (
|
|
3114
|
-
const
|
|
3115
|
-
|
|
3116
|
-
}
|
|
3117
|
-
}, [
|
|
3118
|
-
const
|
|
3119
|
-
function
|
|
3120
|
-
|
|
3118
|
+
function ft(t) {
|
|
3119
|
+
const e = T(), [o, a] = I(), [s, n] = I(""), i = t.field?.options;
|
|
3120
|
+
q(() => {
|
|
3121
|
+
const g = t.form.getValues(t.field.key);
|
|
3122
|
+
if (i?.defaultValue !== void 0 && (g === void 0 || g === "")) {
|
|
3123
|
+
const k = i?.radioOptions?.find((m) => m.value === i?.defaultValue);
|
|
3124
|
+
k?.value && t.form.setValue(t.field.key, k.value), i?.defaultSubValue !== void 0 && k?.checkedSubOption && (a(k.checkedSubOption.key), n(i.defaultSubValue), t.form.setValue(k.checkedSubOption.key, i.defaultSubValue));
|
|
3125
|
+
}
|
|
3126
|
+
}, [i?.defaultValue, i?.defaultSubValue, t.field.key]);
|
|
3127
|
+
const h = i.readOnly ?? t.formReadOnly, b = i.readOnlyStyle ?? t.formReadOnlyStyle, c = t.form.getValues(t.field.key), p = i.radioOptions?.find((g) => g.value === c), d = e.radioField;
|
|
3128
|
+
function f(g, k) {
|
|
3129
|
+
k(g.value), g?.checkedSubOption?.key ? (a(g.checkedSubOption.key), n(""), t.form.setValue(g.checkedSubOption.key, "")) : o && (t.form.setValue(o, ""), a(void 0), n(""));
|
|
3121
3130
|
}
|
|
3122
|
-
return
|
|
3123
|
-
/* @__PURE__ */
|
|
3124
|
-
/* @__PURE__ */
|
|
3125
|
-
] },
|
|
3131
|
+
return h ? b === "disabled" ? /* @__PURE__ */ l(y, { style: i.radioDirection === "row" ? d.containerRow : d.containerColumn, children: i?.radioOptions?.map((g) => /* @__PURE__ */ S(y, { style: d.optionContainer, children: [
|
|
3132
|
+
/* @__PURE__ */ l(y, { style: [d.radio, g.value === c && d.radioSelected, d.disabled], children: g.value === c && /* @__PURE__ */ l(y, { style: d.radioInner }) }),
|
|
3133
|
+
/* @__PURE__ */ l(u, { style: [d.label, d.disabled], children: g.label })
|
|
3134
|
+
] }, g.key)) }) : p ? /* @__PURE__ */ l(y, { style: d.readOnlySelected, children: /* @__PURE__ */ l(u, { style: d.label, children: p.label }) }) : /* @__PURE__ */ l(u, { style: d.readOnlyUnselected, children: "—" }) : /* @__PURE__ */ l(
|
|
3126
3135
|
z,
|
|
3127
3136
|
{
|
|
3128
3137
|
name: t.field.key,
|
|
3129
3138
|
control: t.form.control,
|
|
3130
|
-
defaultValue:
|
|
3131
|
-
render: ({ field: { value:
|
|
3132
|
-
|
|
3133
|
-
/* @__PURE__ */
|
|
3134
|
-
if (
|
|
3135
|
-
const
|
|
3136
|
-
return /* @__PURE__ */
|
|
3137
|
-
/* @__PURE__ */
|
|
3138
|
-
|
|
3139
|
+
defaultValue: i?.defaultValue,
|
|
3140
|
+
render: ({ field: { value: g, onChange: k } }) => /* @__PURE__ */ S(y, { children: [
|
|
3141
|
+
i.helpText && /* @__PURE__ */ l(u, { style: d.helpText, children: i.helpText }),
|
|
3142
|
+
/* @__PURE__ */ l(y, { style: i.radioDirection === "row" ? d.containerRow : d.containerColumn, children: i?.radioOptions?.map((m) => {
|
|
3143
|
+
if (m.hidden) return null;
|
|
3144
|
+
const C = m.value === g;
|
|
3145
|
+
return /* @__PURE__ */ S(y, { children: [
|
|
3146
|
+
/* @__PURE__ */ S(
|
|
3147
|
+
R,
|
|
3139
3148
|
{
|
|
3140
|
-
onPress: () => !
|
|
3149
|
+
onPress: () => !i.disabled && f(m, k),
|
|
3141
3150
|
style: d.optionContainer,
|
|
3142
3151
|
accessibilityRole: "radio",
|
|
3143
|
-
accessibilityState: { selected:
|
|
3152
|
+
accessibilityState: { selected: C, disabled: i.disabled },
|
|
3144
3153
|
children: [
|
|
3145
|
-
/* @__PURE__ */
|
|
3146
|
-
/* @__PURE__ */
|
|
3154
|
+
/* @__PURE__ */ l(y, { style: [d.radio, C && d.radioSelected, i.disabled && d.disabled], children: C && /* @__PURE__ */ l(y, { style: d.radioInner }) }),
|
|
3155
|
+
/* @__PURE__ */ l(u, { style: [d.label, i.disabled && d.disabled], children: m.label })
|
|
3147
3156
|
]
|
|
3148
3157
|
}
|
|
3149
3158
|
),
|
|
3150
|
-
|
|
3151
|
-
|
|
3159
|
+
C && m.checkedSubOption && /* @__PURE__ */ l(
|
|
3160
|
+
P,
|
|
3152
3161
|
{
|
|
3153
|
-
placeholder:
|
|
3162
|
+
placeholder: m.checkedSubOption.label,
|
|
3154
3163
|
placeholderTextColor: "#9ca3af",
|
|
3155
3164
|
value: s,
|
|
3156
|
-
onChangeText: (
|
|
3157
|
-
|
|
3165
|
+
onChangeText: (v) => {
|
|
3166
|
+
n(v), m.checkedSubOption?.key && t.form.setValue(m.checkedSubOption.key, v);
|
|
3158
3167
|
},
|
|
3159
|
-
editable: !
|
|
3168
|
+
editable: !i.disabled,
|
|
3160
3169
|
style: d.subOptionInput
|
|
3161
3170
|
}
|
|
3162
3171
|
)
|
|
3163
|
-
] },
|
|
3172
|
+
] }, m.key);
|
|
3164
3173
|
}) })
|
|
3165
3174
|
] })
|
|
3166
3175
|
}
|
|
@@ -3171,272 +3180,275 @@ try {
|
|
|
3171
3180
|
Ce = require("expo-checkbox").default;
|
|
3172
3181
|
} catch {
|
|
3173
3182
|
}
|
|
3174
|
-
function
|
|
3175
|
-
return /* @__PURE__ */
|
|
3176
|
-
|
|
3183
|
+
function gt({ value: t, onValueChange: e, disabled: o, color: a }) {
|
|
3184
|
+
return /* @__PURE__ */ l(
|
|
3185
|
+
R,
|
|
3177
3186
|
{
|
|
3178
3187
|
onPress: () => !o && e(!t),
|
|
3179
3188
|
style: {
|
|
3180
3189
|
width: 22,
|
|
3181
3190
|
height: 22,
|
|
3182
3191
|
borderWidth: 2,
|
|
3183
|
-
borderColor: t ?
|
|
3192
|
+
borderColor: t ? a || "#0284c7" : "#d1d5db",
|
|
3184
3193
|
borderRadius: 4,
|
|
3185
|
-
backgroundColor: t ?
|
|
3194
|
+
backgroundColor: t ? a || "#0284c7" : "transparent",
|
|
3186
3195
|
justifyContent: "center",
|
|
3187
3196
|
alignItems: "center",
|
|
3188
3197
|
opacity: o ? 0.5 : 1
|
|
3189
3198
|
},
|
|
3190
3199
|
accessibilityRole: "checkbox",
|
|
3191
3200
|
accessibilityState: { checked: t, disabled: o },
|
|
3192
|
-
children: t && /* @__PURE__ */
|
|
3201
|
+
children: t && /* @__PURE__ */ l(u, { style: { color: "#ffffff", fontSize: 14, fontWeight: "700" }, children: "✓" })
|
|
3193
3202
|
}
|
|
3194
3203
|
);
|
|
3195
3204
|
}
|
|
3196
|
-
const
|
|
3197
|
-
function
|
|
3205
|
+
const se = (t, e) => !t || t.trim() === "" ? [] : t.split(e).map((o) => o.trim()).filter((o) => o !== ""), mt = (t, e) => t.join(e);
|
|
3206
|
+
function St({
|
|
3198
3207
|
form: t,
|
|
3199
3208
|
field: e,
|
|
3200
3209
|
hasError: o,
|
|
3201
|
-
formReadOnly:
|
|
3210
|
+
formReadOnly: a = !1,
|
|
3202
3211
|
formReadOnlyStyle: s = "value"
|
|
3203
3212
|
}) {
|
|
3204
|
-
const
|
|
3205
|
-
if (
|
|
3206
|
-
const
|
|
3207
|
-
(
|
|
3213
|
+
const i = T().checkboxGroup, h = e.options, b = h.readOnly ?? a, c = h.readOnlyStyle ?? s, p = h.valueSeparator ?? ",", d = Ce || gt;
|
|
3214
|
+
if (b) {
|
|
3215
|
+
const f = t.getValues(e.key), g = se(f, p), k = h.checkboxOptions.filter(
|
|
3216
|
+
(m) => g.includes(String(m.value))
|
|
3208
3217
|
);
|
|
3209
|
-
return c === "disabled" ? /* @__PURE__ */
|
|
3210
|
-
const
|
|
3211
|
-
return /* @__PURE__ */
|
|
3212
|
-
/* @__PURE__ */
|
|
3218
|
+
return c === "disabled" ? /* @__PURE__ */ l(y, { style: i.wrapper, children: /* @__PURE__ */ l(y, { style: h.checkboxDirection === "row" ? i.containerRow : i.containerColumn, children: h.checkboxOptions.map((m) => {
|
|
3219
|
+
const C = g.includes(String(m.value));
|
|
3220
|
+
return /* @__PURE__ */ S(y, { style: i.optionContainer, children: [
|
|
3221
|
+
/* @__PURE__ */ l(
|
|
3213
3222
|
d,
|
|
3214
3223
|
{
|
|
3215
|
-
value:
|
|
3224
|
+
value: C,
|
|
3216
3225
|
onValueChange: () => {
|
|
3217
3226
|
},
|
|
3218
3227
|
disabled: !0,
|
|
3219
|
-
color:
|
|
3228
|
+
color: C ? "#0284c7" : void 0
|
|
3220
3229
|
}
|
|
3221
3230
|
),
|
|
3222
|
-
/* @__PURE__ */
|
|
3223
|
-
] },
|
|
3224
|
-
}) }) }) : /* @__PURE__ */
|
|
3231
|
+
/* @__PURE__ */ l(u, { style: [i.label, i.disabled], children: m.label })
|
|
3232
|
+
] }, m.key);
|
|
3233
|
+
}) }) }) : /* @__PURE__ */ l(y, { children: k.length > 0 ? k.map((m) => /* @__PURE__ */ S(u, { style: i.readOnlySelected, children: [
|
|
3225
3234
|
"✓ ",
|
|
3226
|
-
|
|
3227
|
-
] },
|
|
3235
|
+
m.label
|
|
3236
|
+
] }, m.key)) : /* @__PURE__ */ l(u, { style: i.readOnlyUnselected, children: "No options selected" }) });
|
|
3228
3237
|
}
|
|
3229
|
-
return /* @__PURE__ */
|
|
3238
|
+
return /* @__PURE__ */ l(
|
|
3230
3239
|
z,
|
|
3231
3240
|
{
|
|
3232
3241
|
control: t.control,
|
|
3233
3242
|
name: e.key,
|
|
3234
|
-
defaultValue:
|
|
3235
|
-
rules: { required:
|
|
3236
|
-
render: ({ field: { onChange:
|
|
3237
|
-
const
|
|
3238
|
-
const
|
|
3239
|
-
let
|
|
3240
|
-
|
|
3243
|
+
defaultValue: h.defaultValue || "",
|
|
3244
|
+
rules: { required: h.required },
|
|
3245
|
+
render: ({ field: { onChange: f, value: g } }) => {
|
|
3246
|
+
const k = se(g, p), m = (C, v) => {
|
|
3247
|
+
const V = String(C);
|
|
3248
|
+
let F;
|
|
3249
|
+
v ? F = k.includes(V) ? k : [...k, V] : F = k.filter((D) => D !== V), f(mt(F, p));
|
|
3241
3250
|
};
|
|
3242
|
-
return /* @__PURE__ */
|
|
3243
|
-
if (
|
|
3244
|
-
const
|
|
3245
|
-
return /* @__PURE__ */
|
|
3246
|
-
/* @__PURE__ */
|
|
3251
|
+
return /* @__PURE__ */ l(y, { style: i.wrapper, children: /* @__PURE__ */ l(y, { style: h.checkboxDirection === "row" ? i.containerRow : i.containerColumn, children: h.checkboxOptions.map((C) => {
|
|
3252
|
+
if (C.hidden) return null;
|
|
3253
|
+
const v = k.includes(String(C.value));
|
|
3254
|
+
return /* @__PURE__ */ S(y, { style: i.optionContainer, children: [
|
|
3255
|
+
/* @__PURE__ */ l(
|
|
3247
3256
|
d,
|
|
3248
3257
|
{
|
|
3249
|
-
value:
|
|
3250
|
-
onValueChange: (
|
|
3251
|
-
disabled: !!
|
|
3252
|
-
color:
|
|
3258
|
+
value: v,
|
|
3259
|
+
onValueChange: (V) => m(C.value, V),
|
|
3260
|
+
disabled: !!h.disabled,
|
|
3261
|
+
color: v ? "#0284c7" : void 0
|
|
3253
3262
|
}
|
|
3254
3263
|
),
|
|
3255
|
-
/* @__PURE__ */
|
|
3256
|
-
] },
|
|
3264
|
+
/* @__PURE__ */ l(u, { style: [i.label, h.disabled && i.disabled], children: C.label })
|
|
3265
|
+
] }, C.key);
|
|
3257
3266
|
}) }) });
|
|
3258
3267
|
}
|
|
3259
3268
|
}
|
|
3260
3269
|
);
|
|
3261
3270
|
}
|
|
3262
|
-
let
|
|
3271
|
+
let K = null;
|
|
3263
3272
|
try {
|
|
3264
|
-
|
|
3273
|
+
K = require("react-native-element-dropdown").Dropdown;
|
|
3265
3274
|
} catch {
|
|
3266
3275
|
}
|
|
3267
|
-
function
|
|
3276
|
+
function xt({
|
|
3268
3277
|
form: t,
|
|
3269
3278
|
field: e,
|
|
3270
3279
|
hasError: o,
|
|
3271
|
-
formReadOnly:
|
|
3280
|
+
formReadOnly: a = !1,
|
|
3272
3281
|
formReadOnlyStyle: s = "value"
|
|
3273
3282
|
}) {
|
|
3274
|
-
const
|
|
3275
|
-
if (!
|
|
3276
|
-
return /* @__PURE__ */
|
|
3277
|
-
if (
|
|
3278
|
-
const
|
|
3279
|
-
return
|
|
3280
|
-
|
|
3283
|
+
const n = T().searchSelect, i = e.options.options || [], h = e.options.readOnly ?? a, b = e.options.readOnlyStyle ?? s, c = t.getValues(e.key);
|
|
3284
|
+
if (!K)
|
|
3285
|
+
return /* @__PURE__ */ l(y, { style: n.container, children: /* @__PURE__ */ l(u, { style: n.placeholder, children: "Install react-native-element-dropdown to use SelectFieldSearch" }) });
|
|
3286
|
+
if (h) {
|
|
3287
|
+
const p = i.find((d) => d.value === c);
|
|
3288
|
+
return b === "disabled" ? /* @__PURE__ */ l(
|
|
3289
|
+
K,
|
|
3281
3290
|
{
|
|
3282
|
-
data:
|
|
3291
|
+
data: i.map((d) => ({ label: d.label, value: d.value })),
|
|
3283
3292
|
labelField: "label",
|
|
3284
3293
|
valueField: "value",
|
|
3285
3294
|
value: c,
|
|
3286
3295
|
disable: !0,
|
|
3287
3296
|
search: !0,
|
|
3288
3297
|
placeholder: e.options.placeholder || "Search...",
|
|
3289
|
-
style: [
|
|
3298
|
+
style: [n.container, n.disabled],
|
|
3290
3299
|
onChange: () => {
|
|
3291
3300
|
}
|
|
3292
3301
|
}
|
|
3293
|
-
) : /* @__PURE__ */
|
|
3302
|
+
) : /* @__PURE__ */ l(y, { style: n.readOnlyValue, children: /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: p?.label || "—" }) });
|
|
3294
3303
|
}
|
|
3295
|
-
return /* @__PURE__ */
|
|
3304
|
+
return /* @__PURE__ */ l(
|
|
3296
3305
|
z,
|
|
3297
3306
|
{
|
|
3298
3307
|
name: e.key,
|
|
3299
3308
|
control: t.control,
|
|
3300
3309
|
defaultValue: e.options.defaultValue,
|
|
3301
3310
|
rules: { required: e.options.required },
|
|
3302
|
-
render: ({ field:
|
|
3303
|
-
/* @__PURE__ */
|
|
3304
|
-
|
|
3311
|
+
render: ({ field: p }) => /* @__PURE__ */ S(y, { style: n.wrapper, children: [
|
|
3312
|
+
/* @__PURE__ */ l(
|
|
3313
|
+
K,
|
|
3305
3314
|
{
|
|
3306
|
-
data:
|
|
3315
|
+
data: i.map((d) => ({ label: d.label, value: d.value })),
|
|
3307
3316
|
labelField: "label",
|
|
3308
3317
|
valueField: "value",
|
|
3309
|
-
value:
|
|
3318
|
+
value: p.value,
|
|
3310
3319
|
search: !0,
|
|
3311
3320
|
searchPlaceholder: "Search...",
|
|
3312
3321
|
onChange: (d) => {
|
|
3313
|
-
|
|
3322
|
+
p.onChange(d.value), t.trigger && t.trigger(e.key);
|
|
3314
3323
|
},
|
|
3315
|
-
onBlur:
|
|
3324
|
+
onBlur: p.onBlur,
|
|
3316
3325
|
disable: e.options.disabled,
|
|
3317
3326
|
placeholder: e.options.placeholder || "Search...",
|
|
3318
|
-
style: [
|
|
3319
|
-
placeholderStyle:
|
|
3320
|
-
inputSearchStyle:
|
|
3327
|
+
style: [n.container, e.options.disabled && n.disabled, o && n.error],
|
|
3328
|
+
placeholderStyle: n.placeholder,
|
|
3329
|
+
inputSearchStyle: n.inputSearch,
|
|
3321
3330
|
accessibilityLabel: e.options.label
|
|
3322
3331
|
}
|
|
3323
3332
|
),
|
|
3324
|
-
e.options.helpText && /* @__PURE__ */
|
|
3333
|
+
e.options.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: e.options.helpText })
|
|
3325
3334
|
] })
|
|
3326
3335
|
}
|
|
3327
3336
|
);
|
|
3328
3337
|
}
|
|
3329
|
-
let
|
|
3338
|
+
let Y = null;
|
|
3330
3339
|
try {
|
|
3331
|
-
|
|
3340
|
+
Y = require("react-native-element-dropdown").Dropdown;
|
|
3332
3341
|
} catch {
|
|
3333
3342
|
}
|
|
3334
|
-
function
|
|
3343
|
+
function Ct(t) {
|
|
3335
3344
|
return t ? typeof t == "string" ? t : t && typeof t == "object" && "value" in t ? t.value : String(t) : null;
|
|
3336
3345
|
}
|
|
3337
|
-
function
|
|
3346
|
+
function kt({
|
|
3338
3347
|
form: t,
|
|
3339
3348
|
field: e,
|
|
3340
3349
|
hasError: o,
|
|
3341
|
-
formReadOnly:
|
|
3350
|
+
formReadOnly: a = !1,
|
|
3342
3351
|
formReadOnlyStyle: s = "value"
|
|
3343
3352
|
}) {
|
|
3344
|
-
const
|
|
3345
|
-
e.options.submitTransform ??=
|
|
3346
|
-
let
|
|
3353
|
+
const n = T().searchSelect, i = e.options.readOnly ?? a, h = e.options.readOnlyStyle ?? s;
|
|
3354
|
+
e.options.submitTransform ??= Ct;
|
|
3355
|
+
let b = [], c = () => {
|
|
3347
3356
|
};
|
|
3348
3357
|
try {
|
|
3349
|
-
|
|
3358
|
+
b = e.options.initialOptions ?? [];
|
|
3350
3359
|
} catch {
|
|
3351
3360
|
}
|
|
3352
|
-
const
|
|
3361
|
+
const p = pe({
|
|
3353
3362
|
control: t.control,
|
|
3354
3363
|
name: e.key
|
|
3355
|
-
}), d = W(() =>
|
|
3356
|
-
return
|
|
3357
|
-
|
|
3364
|
+
}), d = W(() => p ? p && typeof p == "object" && "value" in p && "label" in p ? p : typeof p == "string" ? b.find((g) => g.value === p) || { value: p, label: p } : { value: String(p), label: String(p) } : null, [p, b]);
|
|
3365
|
+
return Y ? i ? h === "disabled" ? /* @__PURE__ */ l(
|
|
3366
|
+
Y,
|
|
3358
3367
|
{
|
|
3359
|
-
data:
|
|
3368
|
+
data: b,
|
|
3360
3369
|
labelField: "label",
|
|
3361
3370
|
valueField: "value",
|
|
3362
3371
|
value: d?.value,
|
|
3363
3372
|
disable: !0,
|
|
3364
3373
|
search: !0,
|
|
3365
|
-
style: [
|
|
3374
|
+
style: [n.container, n.disabled],
|
|
3366
3375
|
onChange: () => {
|
|
3367
3376
|
}
|
|
3368
3377
|
}
|
|
3369
|
-
) : /* @__PURE__ */
|
|
3378
|
+
) : /* @__PURE__ */ l(y, { style: n.readOnlyValue, children: /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: d?.label || "—" }) }) : /* @__PURE__ */ l(
|
|
3370
3379
|
z,
|
|
3371
3380
|
{
|
|
3372
3381
|
name: e.key,
|
|
3373
3382
|
control: t.control,
|
|
3374
3383
|
defaultValue: e.options.defaultValue,
|
|
3375
3384
|
rules: { required: e.options.required },
|
|
3376
|
-
render: ({ field:
|
|
3377
|
-
/* @__PURE__ */
|
|
3378
|
-
|
|
3385
|
+
render: ({ field: f }) => /* @__PURE__ */ S(y, { style: n.wrapper, children: [
|
|
3386
|
+
/* @__PURE__ */ l(
|
|
3387
|
+
Y,
|
|
3379
3388
|
{
|
|
3380
|
-
data:
|
|
3389
|
+
data: b,
|
|
3381
3390
|
labelField: "label",
|
|
3382
3391
|
valueField: "value",
|
|
3383
3392
|
value: d?.value,
|
|
3384
3393
|
search: !0,
|
|
3385
3394
|
searchPlaceholder: "Search...",
|
|
3386
3395
|
onChangeText: c,
|
|
3387
|
-
onChange: (
|
|
3388
|
-
|
|
3396
|
+
onChange: (g) => {
|
|
3397
|
+
f.onChange(g), t.trigger && t.trigger(e.key);
|
|
3389
3398
|
},
|
|
3390
|
-
onBlur:
|
|
3399
|
+
onBlur: f.onBlur,
|
|
3391
3400
|
disable: e.options.disabled,
|
|
3392
3401
|
placeholder: e.options.placeholder || "Search...",
|
|
3393
|
-
style: [
|
|
3394
|
-
placeholderStyle:
|
|
3395
|
-
inputSearchStyle:
|
|
3402
|
+
style: [n.container, e.options.disabled && n.disabled, o && n.error],
|
|
3403
|
+
placeholderStyle: n.placeholder,
|
|
3404
|
+
inputSearchStyle: n.inputSearch,
|
|
3396
3405
|
accessibilityLabel: e.options.label
|
|
3397
3406
|
}
|
|
3398
3407
|
),
|
|
3399
|
-
e.options.helpText && /* @__PURE__ */
|
|
3408
|
+
e.options.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: e.options.helpText })
|
|
3400
3409
|
] })
|
|
3401
3410
|
}
|
|
3402
|
-
) : /* @__PURE__ */
|
|
3411
|
+
) : /* @__PURE__ */ l(y, { style: n.container, children: /* @__PURE__ */ l(u, { style: n.placeholder, children: "Install react-native-element-dropdown to use SelectFieldSearchApollo" }) });
|
|
3403
3412
|
}
|
|
3404
|
-
let
|
|
3413
|
+
let Z = null;
|
|
3405
3414
|
try {
|
|
3406
|
-
|
|
3415
|
+
Z = require("react-native-element-dropdown").MultiSelect;
|
|
3407
3416
|
} catch {
|
|
3408
3417
|
}
|
|
3409
|
-
function
|
|
3418
|
+
function de(t) {
|
|
3419
|
+
return typeof t == "string" ? t : t?.value !== void 0 ? String(t.value) : String(t);
|
|
3420
|
+
}
|
|
3421
|
+
function vt(t) {
|
|
3410
3422
|
return Array.isArray(t) ? t.map((e) => typeof e == "string" ? e : e && typeof e == "object" && "value" in e ? e.value : String(e)) : [];
|
|
3411
3423
|
}
|
|
3412
|
-
function
|
|
3424
|
+
function Tt({
|
|
3413
3425
|
form: t,
|
|
3414
3426
|
field: e,
|
|
3415
3427
|
hasError: o,
|
|
3416
|
-
formReadOnly:
|
|
3428
|
+
formReadOnly: a = !1,
|
|
3417
3429
|
formReadOnlyStyle: s = "value"
|
|
3418
3430
|
}) {
|
|
3419
|
-
const
|
|
3420
|
-
if (e.options.submitTransform ??=
|
|
3421
|
-
return /* @__PURE__ */
|
|
3422
|
-
if (
|
|
3423
|
-
const c = t.getValues(e.key) ?? [],
|
|
3424
|
-
return
|
|
3425
|
-
|
|
3431
|
+
const n = T().multiSelect, i = (e.options.options || []).map((c) => ({ label: c.label, value: c.value })), h = e.options.readOnly ?? a, b = e.options.readOnlyStyle ?? s;
|
|
3432
|
+
if (e.options.submitTransform ??= vt, !Z)
|
|
3433
|
+
return /* @__PURE__ */ l(y, { style: n.container, children: /* @__PURE__ */ l(u, { style: n.placeholder, children: "Install react-native-element-dropdown to use SelectFieldMultiSearch" }) });
|
|
3434
|
+
if (h) {
|
|
3435
|
+
const c = t.getValues(e.key) ?? [], p = Array.isArray(c) ? c.map(de) : [], d = i.filter((f) => p.includes(f.value)).map((f) => f.label);
|
|
3436
|
+
return b === "disabled" ? /* @__PURE__ */ l(
|
|
3437
|
+
Z,
|
|
3426
3438
|
{
|
|
3427
|
-
data:
|
|
3439
|
+
data: i,
|
|
3428
3440
|
labelField: "label",
|
|
3429
3441
|
valueField: "value",
|
|
3430
|
-
value:
|
|
3442
|
+
value: p,
|
|
3431
3443
|
disable: !0,
|
|
3432
3444
|
search: !0,
|
|
3433
|
-
style: [
|
|
3445
|
+
style: [n.container, n.disabled],
|
|
3434
3446
|
onChange: () => {
|
|
3435
3447
|
}
|
|
3436
3448
|
}
|
|
3437
|
-
) : /* @__PURE__ */
|
|
3449
|
+
) : /* @__PURE__ */ l(y, { style: n.readOnlyValue, children: /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: d.join(", ") || "—" }) });
|
|
3438
3450
|
}
|
|
3439
|
-
return /* @__PURE__ */
|
|
3451
|
+
return /* @__PURE__ */ l(
|
|
3440
3452
|
z,
|
|
3441
3453
|
{
|
|
3442
3454
|
name: e.key,
|
|
@@ -3444,15 +3456,15 @@ function ft({
|
|
|
3444
3456
|
defaultValue: e.options.defaultValue ?? [],
|
|
3445
3457
|
rules: { required: e.options.required },
|
|
3446
3458
|
render: ({ field: c }) => {
|
|
3447
|
-
const
|
|
3448
|
-
return /* @__PURE__ */
|
|
3449
|
-
/* @__PURE__ */
|
|
3450
|
-
|
|
3459
|
+
const p = Array.isArray(c.value) ? c.value.map(de) : [];
|
|
3460
|
+
return /* @__PURE__ */ S(y, { style: n.wrapper, children: [
|
|
3461
|
+
/* @__PURE__ */ l(
|
|
3462
|
+
Z,
|
|
3451
3463
|
{
|
|
3452
|
-
data:
|
|
3464
|
+
data: i,
|
|
3453
3465
|
labelField: "label",
|
|
3454
3466
|
valueField: "value",
|
|
3455
|
-
value:
|
|
3467
|
+
value: p,
|
|
3456
3468
|
search: !0,
|
|
3457
3469
|
searchPlaceholder: "Search...",
|
|
3458
3470
|
onChange: (d) => {
|
|
@@ -3460,104 +3472,104 @@ function ft({
|
|
|
3460
3472
|
},
|
|
3461
3473
|
disable: e.options.disabled,
|
|
3462
3474
|
placeholder: e.options.placeholder || "Search...",
|
|
3463
|
-
style: [
|
|
3464
|
-
placeholderStyle:
|
|
3475
|
+
style: [n.container, e.options.disabled && n.disabled, o && n.error],
|
|
3476
|
+
placeholderStyle: n.placeholder,
|
|
3465
3477
|
accessibilityLabel: e.options.label
|
|
3466
3478
|
}
|
|
3467
3479
|
),
|
|
3468
|
-
e.options.helpText && /* @__PURE__ */
|
|
3480
|
+
e.options.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: e.options.helpText })
|
|
3469
3481
|
] });
|
|
3470
3482
|
}
|
|
3471
3483
|
}
|
|
3472
3484
|
);
|
|
3473
3485
|
}
|
|
3474
|
-
let
|
|
3486
|
+
let _ = null;
|
|
3475
3487
|
try {
|
|
3476
|
-
|
|
3488
|
+
_ = require("react-native-element-dropdown").MultiSelect;
|
|
3477
3489
|
} catch {
|
|
3478
3490
|
}
|
|
3479
3491
|
function ke(t) {
|
|
3480
3492
|
return Array.isArray(t) ? t.map((e) => typeof e == "string" ? e : e && typeof e == "object" && "value" in e ? e.value : String(e)) : [];
|
|
3481
3493
|
}
|
|
3482
|
-
const
|
|
3483
|
-
function
|
|
3494
|
+
const tr = ke;
|
|
3495
|
+
function wt({
|
|
3484
3496
|
form: t,
|
|
3485
3497
|
field: e,
|
|
3486
3498
|
hasError: o,
|
|
3487
|
-
formReadOnly:
|
|
3499
|
+
formReadOnly: a = !1,
|
|
3488
3500
|
formReadOnlyStyle: s = "value"
|
|
3489
3501
|
}) {
|
|
3490
|
-
const
|
|
3502
|
+
const n = T().multiSelect, i = e.options.readOnly ?? a, h = e.options.readOnlyStyle ?? s;
|
|
3491
3503
|
e.options.submitTransform ??= ke;
|
|
3492
|
-
const
|
|
3504
|
+
const b = e.options.initialOptions ?? [], [c, p] = I(/* @__PURE__ */ new Map()), d = pe({ control: t.control, name: e.key }), f = W(() => {
|
|
3493
3505
|
const m = d ?? [];
|
|
3494
|
-
return Array.isArray(m) ? m.map((
|
|
3506
|
+
return Array.isArray(m) ? m.map((C) => typeof C == "string" ? C : C && typeof C == "object" && "value" in C ? String(C.value) : String(C)) : [];
|
|
3495
3507
|
}, [d]);
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
let
|
|
3499
|
-
for (const
|
|
3500
|
-
if (!m.has(
|
|
3501
|
-
|
|
3508
|
+
q(() => {
|
|
3509
|
+
b.length > 0 && p((m) => {
|
|
3510
|
+
let C = !1;
|
|
3511
|
+
for (const V of b)
|
|
3512
|
+
if (!m.has(V.value)) {
|
|
3513
|
+
C = !0;
|
|
3502
3514
|
break;
|
|
3503
3515
|
}
|
|
3504
|
-
if (!
|
|
3505
|
-
const
|
|
3506
|
-
return
|
|
3516
|
+
if (!C) return m;
|
|
3517
|
+
const v = new Map(m);
|
|
3518
|
+
return b.forEach((V) => v.set(V.value, V)), v;
|
|
3507
3519
|
});
|
|
3508
|
-
}, [
|
|
3509
|
-
const
|
|
3520
|
+
}, [b]);
|
|
3521
|
+
const g = W(() => {
|
|
3510
3522
|
const m = /* @__PURE__ */ new Map();
|
|
3511
|
-
return c.forEach((
|
|
3512
|
-
}, [
|
|
3513
|
-
if (!
|
|
3514
|
-
return /* @__PURE__ */
|
|
3515
|
-
if (
|
|
3516
|
-
const m =
|
|
3517
|
-
return
|
|
3518
|
-
|
|
3523
|
+
return c.forEach((C, v) => m.set(v, C)), b.forEach((C) => m.set(C.value, C)), Array.from(m.values());
|
|
3524
|
+
}, [b, c]), k = Oe((m) => g.find((v) => v.value === m) || { value: m, label: m }, [g]);
|
|
3525
|
+
if (!_)
|
|
3526
|
+
return /* @__PURE__ */ l(y, { style: n.container, children: /* @__PURE__ */ l(u, { style: n.placeholder, children: "Install react-native-element-dropdown to use SelectFieldMultiSearchApollo" }) });
|
|
3527
|
+
if (i) {
|
|
3528
|
+
const m = f.map((C) => g.find((v) => v.value === C)?.label ?? C);
|
|
3529
|
+
return h === "disabled" ? /* @__PURE__ */ l(
|
|
3530
|
+
_,
|
|
3519
3531
|
{
|
|
3520
|
-
data:
|
|
3532
|
+
data: g,
|
|
3521
3533
|
labelField: "label",
|
|
3522
3534
|
valueField: "value",
|
|
3523
|
-
value:
|
|
3535
|
+
value: f,
|
|
3524
3536
|
disable: !0,
|
|
3525
3537
|
search: !0,
|
|
3526
|
-
style: [
|
|
3538
|
+
style: [n.container, n.disabled],
|
|
3527
3539
|
onChange: () => {
|
|
3528
3540
|
}
|
|
3529
3541
|
}
|
|
3530
|
-
) : /* @__PURE__ */
|
|
3542
|
+
) : /* @__PURE__ */ l(y, { style: n.readOnlyValue, children: /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: m.join(", ") || "—" }) });
|
|
3531
3543
|
}
|
|
3532
|
-
return /* @__PURE__ */
|
|
3544
|
+
return /* @__PURE__ */ l(
|
|
3533
3545
|
z,
|
|
3534
3546
|
{
|
|
3535
3547
|
name: e.key,
|
|
3536
3548
|
control: t.control,
|
|
3537
3549
|
defaultValue: e.options.defaultValue ?? [],
|
|
3538
3550
|
rules: { required: e.options.required },
|
|
3539
|
-
render: ({ field: m }) => /* @__PURE__ */
|
|
3540
|
-
/* @__PURE__ */
|
|
3541
|
-
|
|
3551
|
+
render: ({ field: m }) => /* @__PURE__ */ S(y, { style: n.wrapper, children: [
|
|
3552
|
+
/* @__PURE__ */ l(
|
|
3553
|
+
_,
|
|
3542
3554
|
{
|
|
3543
|
-
data:
|
|
3555
|
+
data: g,
|
|
3544
3556
|
labelField: "label",
|
|
3545
3557
|
valueField: "value",
|
|
3546
|
-
value:
|
|
3558
|
+
value: f,
|
|
3547
3559
|
search: !0,
|
|
3548
3560
|
searchPlaceholder: "Search...",
|
|
3549
|
-
onChange: (
|
|
3550
|
-
const
|
|
3551
|
-
m.onChange(
|
|
3561
|
+
onChange: (C) => {
|
|
3562
|
+
const v = C.map((V) => k(V));
|
|
3563
|
+
m.onChange(v), t.trigger && t.trigger(e.key);
|
|
3552
3564
|
},
|
|
3553
3565
|
disable: e.options.disabled,
|
|
3554
3566
|
placeholder: e.options.placeholder || "Search...",
|
|
3555
|
-
style: [
|
|
3556
|
-
placeholderStyle:
|
|
3567
|
+
style: [n.container, e.options.disabled && n.disabled, o && n.error],
|
|
3568
|
+
placeholderStyle: n.placeholder,
|
|
3557
3569
|
accessibilityLabel: e.options.label
|
|
3558
3570
|
}
|
|
3559
3571
|
),
|
|
3560
|
-
e.options.helpText && /* @__PURE__ */
|
|
3572
|
+
e.options.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: e.options.helpText })
|
|
3561
3573
|
] })
|
|
3562
3574
|
}
|
|
3563
3575
|
);
|
|
@@ -3566,11 +3578,11 @@ function ve({
|
|
|
3566
3578
|
form: t,
|
|
3567
3579
|
field: e,
|
|
3568
3580
|
hasError: o,
|
|
3569
|
-
formReadOnly:
|
|
3581
|
+
formReadOnly: a = !1,
|
|
3570
3582
|
formReadOnlyStyle: s = "value"
|
|
3571
3583
|
}) {
|
|
3572
|
-
const
|
|
3573
|
-
if (
|
|
3584
|
+
const n = T().customField, i = e.options, h = i.readOnly ?? a, b = i.readOnlyStyle ?? s, c = t.getValues(e.key) ?? i.defaultValue;
|
|
3585
|
+
if (h) {
|
|
3574
3586
|
let d;
|
|
3575
3587
|
if (c == null || c === "")
|
|
3576
3588
|
d = "—";
|
|
@@ -3582,9 +3594,9 @@ function ve({
|
|
|
3582
3594
|
} catch {
|
|
3583
3595
|
d = String(c);
|
|
3584
3596
|
}
|
|
3585
|
-
return
|
|
3597
|
+
return b === "disabled" ? /* @__PURE__ */ l(y, { style: n.wrapper, children: /* @__PURE__ */ l(P, { editable: !1, value: d, style: { fontSize: 16, color: "#9ca3af" } }) }) : /* @__PURE__ */ l(y, { style: n.wrapper, children: /* @__PURE__ */ l(y, { style: n.readOnlyValue, children: /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: d }) }) });
|
|
3586
3598
|
}
|
|
3587
|
-
const
|
|
3599
|
+
const p = {
|
|
3588
3600
|
value: c,
|
|
3589
3601
|
onChange: (d) => {
|
|
3590
3602
|
t.setValue(e.key, d), t.trigger(e.key);
|
|
@@ -3592,65 +3604,65 @@ function ve({
|
|
|
3592
3604
|
field: e
|
|
3593
3605
|
};
|
|
3594
3606
|
try {
|
|
3595
|
-
const d =
|
|
3596
|
-
return
|
|
3607
|
+
const d = i.customField(p);
|
|
3608
|
+
return i.customWrapper ? i.customWrapper(d) : /* @__PURE__ */ l(y, { style: n.wrapper, children: d });
|
|
3597
3609
|
} catch (d) {
|
|
3598
|
-
return console.error("Error rendering custom field:", d), /* @__PURE__ */
|
|
3610
|
+
return console.error("Error rendering custom field:", d), /* @__PURE__ */ l(y, { style: n.wrapper, children: /* @__PURE__ */ S(u, { style: n.errorText, children: [
|
|
3599
3611
|
"Error rendering custom field: ",
|
|
3600
3612
|
e.key
|
|
3601
3613
|
] }) });
|
|
3602
3614
|
}
|
|
3603
3615
|
}
|
|
3604
3616
|
ve.displayName = "CustomField";
|
|
3605
|
-
function
|
|
3617
|
+
function Ot({
|
|
3606
3618
|
form: t,
|
|
3607
3619
|
field: e,
|
|
3608
3620
|
hasError: o,
|
|
3609
|
-
formReadOnly:
|
|
3621
|
+
formReadOnly: a = !1,
|
|
3610
3622
|
formReadOnlyStyle: s = "value"
|
|
3611
3623
|
}) {
|
|
3612
|
-
const
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
] }) : null,
|
|
3616
|
-
return
|
|
3617
|
-
/* @__PURE__ */
|
|
3618
|
-
/* @__PURE__ */
|
|
3619
|
-
|
|
3624
|
+
const n = T().customCheckbox, i = e.options, h = i.readOnly ?? a, b = i.readOnlyStyle ?? s, c = t.getValues(e.key), p = i.checkedIcon ?? /* @__PURE__ */ l(u, { style: { fontSize: 20 }, children: "☑" }), d = i.uncheckedIcon ?? /* @__PURE__ */ l(u, { style: { fontSize: 20 }, children: "☐" }), f = i.label ? /* @__PURE__ */ S(u, { style: n.label, children: [
|
|
3625
|
+
i.label,
|
|
3626
|
+
i.required && /* @__PURE__ */ l(u, { style: { color: "#dc2626" }, children: " *" })
|
|
3627
|
+
] }) : null, g = i.helpText ? /* @__PURE__ */ l(u, { style: n.helpText, children: i.helpText }) : null;
|
|
3628
|
+
return h ? b === "disabled" ? /* @__PURE__ */ S(y, { style: n.wrapper, children: [
|
|
3629
|
+
/* @__PURE__ */ S(y, { style: n.row, children: [
|
|
3630
|
+
/* @__PURE__ */ l(y, { style: [n.checkboxContainer, n.disabled], children: c ? p : d }),
|
|
3631
|
+
f
|
|
3620
3632
|
] }),
|
|
3621
|
-
|
|
3622
|
-
] }) : /* @__PURE__ */
|
|
3633
|
+
g
|
|
3634
|
+
] }) : /* @__PURE__ */ l(y, { style: n.wrapper, children: /* @__PURE__ */ l(u, { style: n.readOnly, children: c ? "Yes" : "No" }) }) : /* @__PURE__ */ l(
|
|
3623
3635
|
z,
|
|
3624
3636
|
{
|
|
3625
3637
|
name: e.key,
|
|
3626
3638
|
control: t.control,
|
|
3627
|
-
defaultValue:
|
|
3628
|
-
rules: { required:
|
|
3629
|
-
render: ({ field:
|
|
3630
|
-
/* @__PURE__ */
|
|
3631
|
-
/* @__PURE__ */
|
|
3632
|
-
|
|
3639
|
+
defaultValue: i.defaultValue,
|
|
3640
|
+
rules: { required: i.required },
|
|
3641
|
+
render: ({ field: k }) => /* @__PURE__ */ S(y, { style: n.wrapper, children: [
|
|
3642
|
+
/* @__PURE__ */ S(y, { style: n.row, children: [
|
|
3643
|
+
/* @__PURE__ */ l(
|
|
3644
|
+
R,
|
|
3633
3645
|
{
|
|
3634
|
-
onPress: () => !
|
|
3635
|
-
style: [
|
|
3646
|
+
onPress: () => !i.disabled && k.onChange(!k.value),
|
|
3647
|
+
style: [n.checkboxContainer, i.disabled && n.disabled],
|
|
3636
3648
|
accessibilityRole: "checkbox",
|
|
3637
|
-
accessibilityState: { checked: !!
|
|
3638
|
-
children:
|
|
3649
|
+
accessibilityState: { checked: !!k.value, disabled: i.disabled },
|
|
3650
|
+
children: k.value ? p : d
|
|
3639
3651
|
}
|
|
3640
3652
|
),
|
|
3641
|
-
|
|
3653
|
+
f
|
|
3642
3654
|
] }),
|
|
3643
|
-
|
|
3655
|
+
g
|
|
3644
3656
|
] })
|
|
3645
3657
|
}
|
|
3646
3658
|
);
|
|
3647
3659
|
}
|
|
3648
|
-
let
|
|
3660
|
+
let L = null;
|
|
3649
3661
|
try {
|
|
3650
|
-
|
|
3662
|
+
L = require("react-native-markdown-display").default;
|
|
3651
3663
|
} catch {
|
|
3652
3664
|
}
|
|
3653
|
-
const
|
|
3665
|
+
const Vt = [
|
|
3654
3666
|
{ label: "B", syntax: "**", wrap: !0, title: "Bold" },
|
|
3655
3667
|
{ label: "I", syntax: "*", wrap: !0, title: "Italic" },
|
|
3656
3668
|
{ label: "H", syntax: "# ", wrap: !1, title: "Heading" },
|
|
@@ -3660,28 +3672,28 @@ const St = [
|
|
|
3660
3672
|
{ label: "•", syntax: "- ", wrap: !1, title: "List item" },
|
|
3661
3673
|
{ label: "🔗", syntax: "[text](url)", wrap: !1, title: "Link" }
|
|
3662
3674
|
];
|
|
3663
|
-
function
|
|
3675
|
+
function Ft({
|
|
3664
3676
|
form: t,
|
|
3665
3677
|
field: e,
|
|
3666
3678
|
hasError: o,
|
|
3667
|
-
formReadOnly:
|
|
3679
|
+
formReadOnly: a = !1,
|
|
3668
3680
|
formReadOnlyStyle: s = "value"
|
|
3669
3681
|
}) {
|
|
3670
|
-
const
|
|
3671
|
-
if (
|
|
3672
|
-
const
|
|
3673
|
-
return c === "disabled" ? /* @__PURE__ */
|
|
3674
|
-
/* @__PURE__ */
|
|
3675
|
-
/* @__PURE__ */
|
|
3676
|
-
/* @__PURE__ */
|
|
3682
|
+
const n = T().markdownEditor, [i, h] = I("edit"), b = e.options.readOnly ?? a, c = e.options.readOnlyStyle ?? s;
|
|
3683
|
+
if (b) {
|
|
3684
|
+
const p = t.getValues(e.key) ?? "";
|
|
3685
|
+
return c === "disabled" ? /* @__PURE__ */ S(O, { children: [
|
|
3686
|
+
/* @__PURE__ */ S(y, { style: [n.editor, n.disabled], children: [
|
|
3687
|
+
/* @__PURE__ */ l(y, { style: n.toolbar, children: /* @__PURE__ */ l(u, { style: { fontSize: 13, color: "#9ca3af" }, children: "Markdown Editor (Disabled)" }) }),
|
|
3688
|
+
/* @__PURE__ */ l(y, { style: [n.preview, { opacity: 0.5, minHeight: 200 }], children: /* @__PURE__ */ l(u, { style: { fontFamily: "monospace", fontSize: 14 }, children: p || "—" }) })
|
|
3677
3689
|
] }),
|
|
3678
|
-
e.options.helpText && /* @__PURE__ */
|
|
3679
|
-
] }) : /* @__PURE__ */
|
|
3680
|
-
/* @__PURE__ */
|
|
3681
|
-
e.options.helpText && /* @__PURE__ */
|
|
3690
|
+
e.options.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: e.options.helpText })
|
|
3691
|
+
] }) : /* @__PURE__ */ S(O, { children: [
|
|
3692
|
+
/* @__PURE__ */ l(y, { style: n.readOnlyValue, children: L ? /* @__PURE__ */ l(L, { children: p || "—" }) : /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: p || "—" }) }),
|
|
3693
|
+
e.options.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: e.options.helpText })
|
|
3682
3694
|
] });
|
|
3683
3695
|
}
|
|
3684
|
-
return /* @__PURE__ */
|
|
3696
|
+
return /* @__PURE__ */ l(
|
|
3685
3697
|
z,
|
|
3686
3698
|
{
|
|
3687
3699
|
control: t.control,
|
|
@@ -3691,95 +3703,95 @@ function xt({
|
|
|
3691
3703
|
required: e.options.required,
|
|
3692
3704
|
maxLength: e.options.maxLength ? { value: e.options.maxLength, message: `Content must be less than ${e.options.maxLength} characters` } : void 0
|
|
3693
3705
|
},
|
|
3694
|
-
render: ({ field: { onChange:
|
|
3695
|
-
/* @__PURE__ */
|
|
3696
|
-
/* @__PURE__ */
|
|
3697
|
-
/* @__PURE__ */
|
|
3698
|
-
|
|
3706
|
+
render: ({ field: { onChange: p, value: d } }) => /* @__PURE__ */ S(y, { style: n.wrapper, children: [
|
|
3707
|
+
/* @__PURE__ */ S(y, { style: [n.editor, o && n.error, e.options.disabled && n.disabled], children: [
|
|
3708
|
+
/* @__PURE__ */ S(y, { style: n.toggleContainer, children: [
|
|
3709
|
+
/* @__PURE__ */ l(
|
|
3710
|
+
R,
|
|
3699
3711
|
{
|
|
3700
|
-
onPress: () =>
|
|
3701
|
-
style: [
|
|
3702
|
-
children: /* @__PURE__ */
|
|
3712
|
+
onPress: () => h("edit"),
|
|
3713
|
+
style: [n.toggleButton, i === "edit" && n.toggleButtonActive],
|
|
3714
|
+
children: /* @__PURE__ */ l(u, { style: [n.toggleButtonText, i === "edit" && n.toggleButtonTextActive], children: "Edit" })
|
|
3703
3715
|
}
|
|
3704
3716
|
),
|
|
3705
|
-
/* @__PURE__ */
|
|
3706
|
-
|
|
3717
|
+
/* @__PURE__ */ l(
|
|
3718
|
+
R,
|
|
3707
3719
|
{
|
|
3708
|
-
onPress: () =>
|
|
3709
|
-
style: [
|
|
3710
|
-
children: /* @__PURE__ */
|
|
3720
|
+
onPress: () => h("preview"),
|
|
3721
|
+
style: [n.toggleButton, i === "preview" && n.toggleButtonActive],
|
|
3722
|
+
children: /* @__PURE__ */ l(u, { style: [n.toggleButtonText, i === "preview" && n.toggleButtonTextActive], children: "Preview" })
|
|
3711
3723
|
}
|
|
3712
3724
|
)
|
|
3713
3725
|
] }),
|
|
3714
|
-
|
|
3715
|
-
|
|
3726
|
+
i === "edit" && /* @__PURE__ */ l(y, { style: n.toolbar, children: Vt.map((f) => /* @__PURE__ */ l(
|
|
3727
|
+
R,
|
|
3716
3728
|
{
|
|
3717
3729
|
onPress: () => {
|
|
3718
|
-
|
|
3730
|
+
f.wrap ? p(`${d || ""}${f.syntax}text${f.syntax}`) : p(`${d || ""}${f.syntax}`);
|
|
3719
3731
|
},
|
|
3720
|
-
style:
|
|
3721
|
-
accessibilityLabel:
|
|
3722
|
-
children: /* @__PURE__ */
|
|
3732
|
+
style: n.toolbarButton,
|
|
3733
|
+
accessibilityLabel: f.title,
|
|
3734
|
+
children: /* @__PURE__ */ l(u, { style: n.toolbarButtonText, children: f.label })
|
|
3723
3735
|
},
|
|
3724
|
-
|
|
3736
|
+
f.label
|
|
3725
3737
|
)) }),
|
|
3726
|
-
|
|
3727
|
-
|
|
3738
|
+
i === "edit" ? /* @__PURE__ */ l(
|
|
3739
|
+
P,
|
|
3728
3740
|
{
|
|
3729
3741
|
multiline: !0,
|
|
3730
3742
|
value: d ?? "",
|
|
3731
|
-
onChangeText: (
|
|
3732
|
-
e.options.maxLength &&
|
|
3743
|
+
onChangeText: (f) => {
|
|
3744
|
+
e.options.maxLength && f.length > e.options.maxLength || p(f);
|
|
3733
3745
|
},
|
|
3734
3746
|
placeholder: e.options.placeholder,
|
|
3735
3747
|
placeholderTextColor: "#9ca3af",
|
|
3736
3748
|
editable: !e.options.disabled,
|
|
3737
|
-
style: [
|
|
3749
|
+
style: [n.textInput, { minHeight: e.options.height ?? 200 }],
|
|
3738
3750
|
accessibilityLabel: e.options.label
|
|
3739
3751
|
}
|
|
3740
|
-
) : /* @__PURE__ */
|
|
3741
|
-
e.options.maxLength && /* @__PURE__ */
|
|
3752
|
+
) : /* @__PURE__ */ l(De, { style: [n.preview, { minHeight: e.options.height ?? 200 }], children: L ? /* @__PURE__ */ l(L, { children: d || "" }) : /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: d || "Nothing to preview" }) }),
|
|
3753
|
+
e.options.maxLength && /* @__PURE__ */ S(u, { style: { fontSize: 13, color: "#6b7280", textAlign: "right", padding: 8 }, children: [
|
|
3742
3754
|
(d ?? "").length,
|
|
3743
3755
|
"/",
|
|
3744
3756
|
e.options.maxLength
|
|
3745
3757
|
] })
|
|
3746
3758
|
] }),
|
|
3747
|
-
e.options.helpText && /* @__PURE__ */
|
|
3759
|
+
e.options.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: e.options.helpText })
|
|
3748
3760
|
] })
|
|
3749
3761
|
}
|
|
3750
3762
|
);
|
|
3751
3763
|
}
|
|
3752
|
-
function
|
|
3764
|
+
function Pt({
|
|
3753
3765
|
field: t
|
|
3754
3766
|
}) {
|
|
3755
|
-
const e =
|
|
3756
|
-
return /* @__PURE__ */
|
|
3767
|
+
const e = T().contentField;
|
|
3768
|
+
return /* @__PURE__ */ l(y, { style: e.wrapper, children: t.options.content });
|
|
3757
3769
|
}
|
|
3758
|
-
function
|
|
3770
|
+
function Dt({
|
|
3759
3771
|
fieldKey: t,
|
|
3760
3772
|
label: e,
|
|
3761
3773
|
required: o,
|
|
3762
|
-
unstyled:
|
|
3774
|
+
unstyled: a,
|
|
3763
3775
|
containerStyle: s,
|
|
3764
|
-
labelStyle:
|
|
3765
|
-
requiredIndicatorStyle:
|
|
3766
|
-
containerClassName:
|
|
3767
|
-
labelClassName:
|
|
3776
|
+
labelStyle: n,
|
|
3777
|
+
requiredIndicatorStyle: i,
|
|
3778
|
+
containerClassName: h,
|
|
3779
|
+
labelClassName: b,
|
|
3768
3780
|
requiredIndicatorClassName: c
|
|
3769
3781
|
}) {
|
|
3770
|
-
const
|
|
3771
|
-
return /* @__PURE__ */
|
|
3782
|
+
const p = T();
|
|
3783
|
+
return /* @__PURE__ */ S(
|
|
3772
3784
|
u,
|
|
3773
3785
|
{
|
|
3774
3786
|
nativeID: `${t}-label`,
|
|
3775
|
-
style: [!
|
|
3776
|
-
...
|
|
3787
|
+
style: [!a && p.label.base, n],
|
|
3788
|
+
...b ? { className: b } : {},
|
|
3777
3789
|
children: [
|
|
3778
3790
|
e,
|
|
3779
|
-
o && /* @__PURE__ */
|
|
3791
|
+
o && /* @__PURE__ */ l(
|
|
3780
3792
|
u,
|
|
3781
3793
|
{
|
|
3782
|
-
style: [!
|
|
3794
|
+
style: [!a && p.label.requiredIndicator, i],
|
|
3783
3795
|
...c ? { className: c } : {},
|
|
3784
3796
|
children: " *"
|
|
3785
3797
|
}
|
|
@@ -3788,215 +3800,191 @@ function kt({
|
|
|
3788
3800
|
}
|
|
3789
3801
|
);
|
|
3790
3802
|
}
|
|
3791
|
-
function
|
|
3803
|
+
function zt(t, e, o, a) {
|
|
3792
3804
|
const s = !!t.formState.errors[e.key];
|
|
3793
3805
|
switch (e.type) {
|
|
3794
|
-
case
|
|
3795
|
-
return /* @__PURE__ */
|
|
3796
|
-
case
|
|
3797
|
-
return /* @__PURE__ */
|
|
3798
|
-
case
|
|
3799
|
-
return /* @__PURE__ */
|
|
3800
|
-
case
|
|
3801
|
-
return /* @__PURE__ */
|
|
3802
|
-
case
|
|
3803
|
-
return /* @__PURE__ */
|
|
3804
|
-
case
|
|
3805
|
-
return /* @__PURE__ */
|
|
3806
|
-
case
|
|
3807
|
-
return /* @__PURE__ */
|
|
3808
|
-
case
|
|
3809
|
-
return /* @__PURE__ */
|
|
3810
|
-
case
|
|
3811
|
-
return /* @__PURE__ */
|
|
3812
|
-
case
|
|
3813
|
-
return /* @__PURE__ */
|
|
3814
|
-
case
|
|
3815
|
-
return /* @__PURE__ */
|
|
3816
|
-
case
|
|
3817
|
-
return /* @__PURE__ */
|
|
3818
|
-
case
|
|
3819
|
-
return /* @__PURE__ */
|
|
3820
|
-
|
|
3806
|
+
case x.Text:
|
|
3807
|
+
return /* @__PURE__ */ l(_e, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
|
|
3808
|
+
case x.TextArea:
|
|
3809
|
+
return /* @__PURE__ */ l(Je, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
|
|
3810
|
+
case x.MarkdownEditor:
|
|
3811
|
+
return /* @__PURE__ */ l(Ft, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
|
|
3812
|
+
case x.Email:
|
|
3813
|
+
return /* @__PURE__ */ l(Xe, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
|
|
3814
|
+
case x.Password:
|
|
3815
|
+
return /* @__PURE__ */ l(Qe, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
|
|
3816
|
+
case x.Url:
|
|
3817
|
+
return /* @__PURE__ */ l(et, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
|
|
3818
|
+
case x.Phone:
|
|
3819
|
+
return /* @__PURE__ */ l(tt, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
|
|
3820
|
+
case x.Number:
|
|
3821
|
+
return /* @__PURE__ */ l(rt, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
|
|
3822
|
+
case x.Currency:
|
|
3823
|
+
return /* @__PURE__ */ l(nt, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
|
|
3824
|
+
case x.Select:
|
|
3825
|
+
return /* @__PURE__ */ l(xe, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
|
|
3826
|
+
case x.EnumSelect:
|
|
3827
|
+
return /* @__PURE__ */ l(pt, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
|
|
3828
|
+
case x.MultiSelect:
|
|
3829
|
+
return /* @__PURE__ */ l(yt, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
|
|
3830
|
+
case x.Checkbox:
|
|
3831
|
+
return /* @__PURE__ */ l(
|
|
3832
|
+
ot,
|
|
3821
3833
|
{
|
|
3822
3834
|
form: t,
|
|
3823
3835
|
field: e,
|
|
3824
3836
|
hasError: s,
|
|
3825
|
-
errorMessage: s ? t.formState.errors[e.key]?.message ??
|
|
3837
|
+
errorMessage: s ? t.formState.errors[e.key]?.message ?? J : void 0,
|
|
3826
3838
|
formReadOnly: o,
|
|
3827
|
-
formReadOnlyStyle:
|
|
3839
|
+
formReadOnlyStyle: a
|
|
3828
3840
|
}
|
|
3829
3841
|
);
|
|
3830
|
-
case
|
|
3831
|
-
return /* @__PURE__ */
|
|
3832
|
-
case
|
|
3833
|
-
return /* @__PURE__ */
|
|
3834
|
-
case
|
|
3835
|
-
return /* @__PURE__ */
|
|
3836
|
-
case
|
|
3837
|
-
return /* @__PURE__ */
|
|
3838
|
-
case
|
|
3839
|
-
return /* @__PURE__ */
|
|
3840
|
-
case
|
|
3841
|
-
return /* @__PURE__ */
|
|
3842
|
-
case
|
|
3843
|
-
return /* @__PURE__ */
|
|
3844
|
-
case
|
|
3845
|
-
return /* @__PURE__ */
|
|
3846
|
-
case
|
|
3847
|
-
return /* @__PURE__ */
|
|
3848
|
-
case
|
|
3849
|
-
return /* @__PURE__ */
|
|
3850
|
-
case
|
|
3851
|
-
return /* @__PURE__ */
|
|
3852
|
-
case
|
|
3853
|
-
return /* @__PURE__ */
|
|
3854
|
-
case
|
|
3855
|
-
return /* @__PURE__ */
|
|
3856
|
-
case
|
|
3857
|
-
return /* @__PURE__ */
|
|
3842
|
+
case x.Switch:
|
|
3843
|
+
return /* @__PURE__ */ l(at, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
|
|
3844
|
+
case x.Button:
|
|
3845
|
+
return /* @__PURE__ */ l(st, { field: e, form: t, hasError: s });
|
|
3846
|
+
case x.DatePicker:
|
|
3847
|
+
return /* @__PURE__ */ l(dt, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
|
|
3848
|
+
case x.DateTimePicker:
|
|
3849
|
+
return /* @__PURE__ */ l(ct, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
|
|
3850
|
+
case x.TimePicker:
|
|
3851
|
+
return /* @__PURE__ */ l(ut, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
|
|
3852
|
+
case x.Radio:
|
|
3853
|
+
return /* @__PURE__ */ l(ft, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
|
|
3854
|
+
case x.CheckboxGroup:
|
|
3855
|
+
return /* @__PURE__ */ l(St, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
|
|
3856
|
+
case x.SearchSelect:
|
|
3857
|
+
return /* @__PURE__ */ l(xt, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
|
|
3858
|
+
case x.SearchSelectApollo:
|
|
3859
|
+
return /* @__PURE__ */ l(kt, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
|
|
3860
|
+
case x.SearchSelectMulti:
|
|
3861
|
+
return /* @__PURE__ */ l(Tt, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
|
|
3862
|
+
case x.SearchSelectMultiApollo:
|
|
3863
|
+
return /* @__PURE__ */ l(wt, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
|
|
3864
|
+
case x.Content:
|
|
3865
|
+
return /* @__PURE__ */ l(Pt, { field: e });
|
|
3866
|
+
case x.Custom:
|
|
3867
|
+
return /* @__PURE__ */ l(ve, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
|
|
3868
|
+
case x.CustomCheckbox:
|
|
3869
|
+
return /* @__PURE__ */ l(Ot, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
|
|
3858
3870
|
default:
|
|
3859
3871
|
return null;
|
|
3860
3872
|
}
|
|
3861
3873
|
}
|
|
3862
|
-
function
|
|
3874
|
+
function It({
|
|
3863
3875
|
field: t,
|
|
3864
3876
|
formReadOnly: e = !1,
|
|
3865
3877
|
formReadOnlyStyle: o = "value",
|
|
3866
|
-
style:
|
|
3878
|
+
style: a,
|
|
3867
3879
|
className: s
|
|
3868
3880
|
}) {
|
|
3869
|
-
const
|
|
3870
|
-
const { showWhen:
|
|
3881
|
+
const n = Ie(), { labelDisplay: i } = Re(), h = T(), b = n.watch(), c = W(() => {
|
|
3882
|
+
const { showWhen: B, requiredWhen: N, disabledWhen: ae } = t.options;
|
|
3871
3883
|
try {
|
|
3872
|
-
const
|
|
3873
|
-
return { isVisible:
|
|
3874
|
-
} catch (
|
|
3875
|
-
return console.warn(`Error evaluating conditional logic for field ${t.key}:`,
|
|
3876
|
-
}
|
|
3877
|
-
}, [
|
|
3878
|
-
if (
|
|
3879
|
-
const
|
|
3880
|
-
if (
|
|
3881
|
-
|
|
3884
|
+
const ee = B ? B(b) : !0, Te = N ? N(b) : !1, we = ae ? ae(b) : !1;
|
|
3885
|
+
return { isVisible: ee, isDynamicallyRequired: Te, isDynamicallyDisabled: we };
|
|
3886
|
+
} catch (ee) {
|
|
3887
|
+
return console.warn(`Error evaluating conditional logic for field ${t.key}:`, ee), { isVisible: !0, isDynamicallyRequired: !1, isDynamicallyDisabled: !1 };
|
|
3888
|
+
}
|
|
3889
|
+
}, [b, t.options, t.key]), p = Ve(void 0);
|
|
3890
|
+
if (q(() => {
|
|
3891
|
+
const B = t.options.required || c.isDynamicallyRequired;
|
|
3892
|
+
if (p.current !== B) {
|
|
3893
|
+
p.current = B;
|
|
3882
3894
|
try {
|
|
3883
|
-
|
|
3884
|
-
required:
|
|
3895
|
+
n.register(t.key, {
|
|
3896
|
+
required: B ? J : !1
|
|
3885
3897
|
});
|
|
3886
|
-
} catch (
|
|
3887
|
-
console.warn(`Error updating field registration for ${t.key}:`,
|
|
3898
|
+
} catch (N) {
|
|
3899
|
+
console.warn(`Error updating field registration for ${t.key}:`, N);
|
|
3888
3900
|
}
|
|
3889
3901
|
}
|
|
3890
|
-
}, [c.isDynamicallyRequired, t.options.required, t.key,
|
|
3902
|
+
}, [c.isDynamicallyRequired, t.options.required, t.key, n]), !c.isVisible)
|
|
3891
3903
|
return null;
|
|
3892
|
-
const d =
|
|
3893
|
-
let
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
case "all":
|
|
3897
|
-
m = !0;
|
|
3898
|
-
break;
|
|
3899
|
-
case "none":
|
|
3900
|
-
m = !1;
|
|
3901
|
-
break;
|
|
3902
|
-
case "default":
|
|
3903
|
-
default:
|
|
3904
|
-
m = t.type !== C.Checkbox;
|
|
3905
|
-
break;
|
|
3906
|
-
}
|
|
3907
|
-
const g = t.options.required || c.isDynamicallyRequired, k = t.options.disabled || c.isDynamicallyDisabled, T = {
|
|
3904
|
+
const d = n.formState.errors[t.key], f = d?.message ?? (d ? J : null), g = !!t.options.label;
|
|
3905
|
+
let k;
|
|
3906
|
+
g ? i === "all" ? k = !0 : i === "none" ? k = !1 : k = t.type !== x.Checkbox : k = !1;
|
|
3907
|
+
const m = t.options.required || c.isDynamicallyRequired, C = t.options.disabled || c.isDynamicallyDisabled, v = {
|
|
3908
3908
|
...t,
|
|
3909
3909
|
options: {
|
|
3910
3910
|
...t.options,
|
|
3911
|
-
disabled:
|
|
3912
|
-
required:
|
|
3913
|
-
}
|
|
3914
|
-
},
|
|
3915
|
-
|
|
3916
|
-
/* @__PURE__ */
|
|
3917
|
-
|
|
3918
|
-
d && t.type !==
|
|
3911
|
+
disabled: C,
|
|
3912
|
+
required: m
|
|
3913
|
+
}
|
|
3914
|
+
}, V = zt(n, v, e, o), F = k && /* @__PURE__ */ l(Dt, { fieldKey: t.key, label: t.options.label ?? "", required: m }), A = (t.options.layout || "vertical") === "horizontal" ? /* @__PURE__ */ S(y, { style: { flexDirection: "row", alignItems: "center", gap: 12 }, children: [
|
|
3915
|
+
F,
|
|
3916
|
+
/* @__PURE__ */ S(y, { style: { flex: 1 }, children: [
|
|
3917
|
+
V,
|
|
3918
|
+
d && t.type !== x.Checkbox && /* @__PURE__ */ l(u, { style: h.global.errorText, children: f })
|
|
3919
3919
|
] })
|
|
3920
|
-
] }) : /* @__PURE__ */
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
d && t.type !==
|
|
3920
|
+
] }) : /* @__PURE__ */ S(O, { children: [
|
|
3921
|
+
F,
|
|
3922
|
+
V,
|
|
3923
|
+
d && t.type !== x.Checkbox && /* @__PURE__ */ l(u, { style: h.global.errorText, children: f })
|
|
3924
3924
|
] });
|
|
3925
|
-
return t.options.customWrapper ? t.options.customWrapper(
|
|
3926
|
-
|
|
3925
|
+
return t.options.customWrapper ? t.options.customWrapper(A) : /* @__PURE__ */ l(
|
|
3926
|
+
y,
|
|
3927
3927
|
{
|
|
3928
|
-
style: [{ gap: 4 },
|
|
3928
|
+
style: [{ gap: 4 }, a],
|
|
3929
3929
|
...s ? { className: s } : {},
|
|
3930
|
-
children:
|
|
3930
|
+
children: A
|
|
3931
3931
|
}
|
|
3932
3932
|
);
|
|
3933
3933
|
}
|
|
3934
|
-
function
|
|
3934
|
+
function rr({
|
|
3935
3935
|
id: t,
|
|
3936
3936
|
fields: e,
|
|
3937
3937
|
children: o,
|
|
3938
|
-
submit:
|
|
3938
|
+
submit: a,
|
|
3939
3939
|
defaultValues: s,
|
|
3940
|
-
style:
|
|
3941
|
-
className:
|
|
3942
|
-
readOnly:
|
|
3943
|
-
readOnlyStyle:
|
|
3940
|
+
style: n,
|
|
3941
|
+
className: i,
|
|
3942
|
+
readOnly: h = !1,
|
|
3943
|
+
readOnlyStyle: b = "value",
|
|
3944
3944
|
nativeTheme: c = {},
|
|
3945
|
-
labelDisplay:
|
|
3945
|
+
labelDisplay: p = "default",
|
|
3946
3946
|
schema: d,
|
|
3947
|
-
validationGroup:
|
|
3948
|
-
validationGroups:
|
|
3947
|
+
validationGroup: f,
|
|
3948
|
+
validationGroups: g
|
|
3949
3949
|
}) {
|
|
3950
|
-
const
|
|
3951
|
-
if (d || e?.some((
|
|
3952
|
-
if (
|
|
3953
|
-
const
|
|
3954
|
-
return
|
|
3950
|
+
const k = W(() => {
|
|
3951
|
+
if (d || e?.some((D) => {
|
|
3952
|
+
if (D?.type === x.Button) return !1;
|
|
3953
|
+
const A = D?.options;
|
|
3954
|
+
return A?.schema || A?.validateWithForm || A?.validate;
|
|
3955
3955
|
}))
|
|
3956
|
-
return
|
|
3956
|
+
return Ne(
|
|
3957
3957
|
d,
|
|
3958
|
-
e?.filter((
|
|
3959
|
-
key:
|
|
3960
|
-
options:
|
|
3958
|
+
e?.filter((D) => D !== null).filter((D) => D.type !== x.Button).map((D) => ({
|
|
3959
|
+
key: D.key,
|
|
3960
|
+
options: D.options
|
|
3961
3961
|
}))
|
|
3962
3962
|
);
|
|
3963
|
-
}, [d, e,
|
|
3963
|
+
}, [d, e, f, g]), m = ze({
|
|
3964
3964
|
defaultValues: s,
|
|
3965
|
-
resolver:
|
|
3965
|
+
resolver: k,
|
|
3966
3966
|
mode: "onBlur",
|
|
3967
3967
|
reValidateMode: "onChange"
|
|
3968
3968
|
});
|
|
3969
|
-
|
|
3970
|
-
s && typeof s != "function" &&
|
|
3971
|
-
}, [s,
|
|
3972
|
-
const
|
|
3973
|
-
return
|
|
3974
|
-
|
|
3975
|
-
for (const [P, M] of Object.entries(O))
|
|
3976
|
-
e?.some(
|
|
3977
|
-
(j) => j && j.key === P && j.type === C.Button
|
|
3978
|
-
) || (V[P] = M);
|
|
3979
|
-
if (!e)
|
|
3980
|
-
return i(V);
|
|
3981
|
-
const R = { ...V };
|
|
3982
|
-
return e.filter((P) => P !== null).filter((P) => P.type !== C.Button).forEach((P) => {
|
|
3983
|
-
P.options.submitTransform && P.key in R && (R[P.key] = P.options.submitTransform(R[P.key]));
|
|
3984
|
-
}), i(R);
|
|
3985
|
-
}, [e, i]), /* @__PURE__ */ n(ye.Provider, { value: I, children: /* @__PURE__ */ n(fe.Provider, { value: k, children: /* @__PURE__ */ n(me.Provider, { value: T, children: /* @__PURE__ */ n(be.Provider, { value: g, children: /* @__PURE__ */ x(
|
|
3986
|
-
f,
|
|
3969
|
+
q(() => {
|
|
3970
|
+
s && typeof s != "function" && m.reset(s);
|
|
3971
|
+
}, [s, m]);
|
|
3972
|
+
const C = W(() => he.parse({}), []), v = W(() => Ze(c), [c]), V = W(() => ({ labelDisplay: p }), [p]);
|
|
3973
|
+
return /* @__PURE__ */ l(ye.Provider, { value: V, children: /* @__PURE__ */ l(fe.Provider, { value: C, children: /* @__PURE__ */ l(me.Provider, { value: v, children: /* @__PURE__ */ l(be.Provider, { value: m, children: /* @__PURE__ */ S(
|
|
3974
|
+
y,
|
|
3987
3975
|
{
|
|
3988
3976
|
nativeID: t,
|
|
3989
|
-
style: [{ gap: 16 },
|
|
3990
|
-
...
|
|
3977
|
+
style: [{ gap: 16 }, n],
|
|
3978
|
+
...i ? { className: i } : {},
|
|
3991
3979
|
children: [
|
|
3992
|
-
e?.filter((
|
|
3993
|
-
|
|
3980
|
+
e?.filter((F) => F !== null).map((F) => /* @__PURE__ */ l(
|
|
3981
|
+
It,
|
|
3994
3982
|
{
|
|
3995
|
-
field:
|
|
3996
|
-
formReadOnly:
|
|
3997
|
-
formReadOnlyStyle:
|
|
3983
|
+
field: F,
|
|
3984
|
+
formReadOnly: h,
|
|
3985
|
+
formReadOnlyStyle: b
|
|
3998
3986
|
},
|
|
3999
|
-
|
|
3987
|
+
F.key
|
|
4000
3988
|
)),
|
|
4001
3989
|
o
|
|
4002
3990
|
]
|
|
@@ -4004,74 +3992,74 @@ function Gt({
|
|
|
4004
3992
|
) }) }) }) });
|
|
4005
3993
|
}
|
|
4006
3994
|
export {
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
3995
|
+
it as Button,
|
|
3996
|
+
st as ButtonField,
|
|
3997
|
+
H as CURRENCY_CONFIGS,
|
|
3998
|
+
ot as CheckboxField,
|
|
3999
|
+
St as CheckboxGroupField,
|
|
4000
|
+
Pt as ContentField,
|
|
4001
|
+
Ot as CustomCheckboxField,
|
|
4014
4002
|
ve as CustomField,
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4003
|
+
J as DEFAULT_REQUIRED_ERROR_MESSAGE,
|
|
4004
|
+
dt as DatePickerField,
|
|
4005
|
+
ct as DateTimePickerField,
|
|
4006
|
+
Xe as EmailField,
|
|
4019
4007
|
ye as FormConfigContext,
|
|
4020
4008
|
be as FormContext,
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4009
|
+
qt as FormFieldClass,
|
|
4010
|
+
x as FormFieldType,
|
|
4011
|
+
Dt as FormLabel,
|
|
4024
4012
|
he as FormThemeSchema,
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4013
|
+
Ft as MarkdownEditor,
|
|
4014
|
+
nt as MoneyField,
|
|
4015
|
+
rr as NativeForm,
|
|
4028
4016
|
me as NativeThemeContext,
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4017
|
+
rt as NumberField,
|
|
4018
|
+
Qe as PasswordField,
|
|
4019
|
+
tt as PhoneField,
|
|
4020
|
+
ft as RadioField,
|
|
4021
|
+
It as RenderFormField,
|
|
4034
4022
|
xe as SelectField,
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4023
|
+
pt as SelectFieldEnum,
|
|
4024
|
+
yt as SelectFieldMulti,
|
|
4025
|
+
Tt as SelectFieldMultiSearch,
|
|
4026
|
+
wt as SelectFieldMultiSearchApollo,
|
|
4027
|
+
xt as SelectFieldSearch,
|
|
4028
|
+
kt as SelectFieldSearchApollo,
|
|
4029
|
+
at as SwitchField,
|
|
4030
|
+
Je as TextAreaField,
|
|
4031
|
+
_e as TextField,
|
|
4044
4032
|
fe as ThemeContext,
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4033
|
+
ut as TimePickerField,
|
|
4034
|
+
et as UrlField,
|
|
4035
|
+
tr as apolloMultiSelectSubmitTransform,
|
|
4036
|
+
Qt as convertCurrency,
|
|
4037
|
+
Le as createFieldValidation,
|
|
4038
|
+
Ze as createFinalNativeTheme,
|
|
4039
|
+
Ne as createFormResolver,
|
|
4040
|
+
E as defaultNativeTheme,
|
|
4041
|
+
M as formatCurrency,
|
|
4042
|
+
er as formatCurrencyForDisplay,
|
|
4055
4043
|
re as formatDateFromDateTime,
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4044
|
+
ne as formatDateTimeFromValue,
|
|
4045
|
+
Ee as getCurrencyConfig,
|
|
4046
|
+
Yt as getCurrencyOptions,
|
|
4047
|
+
Jt as getCurrencyStep,
|
|
4060
4048
|
ge as getDateFromDateTime,
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4049
|
+
Ge as getDateTimeFromValue,
|
|
4050
|
+
$t as getFieldsInGroup,
|
|
4051
|
+
Zt as getPopularCurrencyOptions,
|
|
4052
|
+
Et as getValidationGroups,
|
|
4053
|
+
Xt as isSupportedCurrency,
|
|
4066
4054
|
ke as multiSelectSubmitTransform,
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4055
|
+
_t as parseCurrency,
|
|
4056
|
+
Ue as resolveCurrencyConfig,
|
|
4057
|
+
Ut as shouldValidateField,
|
|
4058
|
+
Kt as useDebounce,
|
|
4059
|
+
Gt as useFieldValidation,
|
|
4060
|
+
Re as useFormConfig,
|
|
4061
|
+
Ie as useFormContext,
|
|
4062
|
+
Lt as useFormTheme,
|
|
4063
|
+
T as useNativeTheme,
|
|
4064
|
+
Nt as validateGroup
|
|
4077
4065
|
};
|