@sio-group/form-react 0.4.2 → 0.4.3
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/CHANGELOG.md +6 -0
- package/dist/index.cjs +187 -322
- package/dist/index.d.cts +2 -98
- package/dist/index.d.ts +2 -98
- package/dist/index.js +170 -293
- package/dist/styles/index.css +0 -287
- package/dist/styles/index.css.map +1 -1
- package/package.json +1 -1
- package/src/components/Fields/Input/DateInput/index.tsx +1 -1
- package/src/components/Fields/Input/FileInput/index.tsx +1 -1
- package/src/components/Fields/Input/NumberInput/index.tsx +1 -1
- package/src/components/Fields/InputWrapper/index.tsx +1 -1
- package/src/components/Form.tsx +2 -1
- package/src/index.ts +0 -2
- package/src/types/form-config.d.ts +1 -1
- package/dist/styles/components/button.css +0 -244
- package/dist/styles/components/button.css.map +0 -1
- package/dist/styles/components/link.css +0 -113
- package/dist/styles/components/link.css.map +0 -1
package/dist/index.js
CHANGED
|
@@ -561,67 +561,9 @@ var Checkbox = ({
|
|
|
561
561
|
// src/components/Fields/Input/Input.tsx
|
|
562
562
|
import { memo as memo2, useMemo } from "react";
|
|
563
563
|
|
|
564
|
-
// src/components/Button/index.tsx
|
|
565
|
-
import React2 from "react";
|
|
566
|
-
import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
567
|
-
var ButtonComponent = ({
|
|
568
|
-
type = "button",
|
|
569
|
-
label,
|
|
570
|
-
onClick,
|
|
571
|
-
variant = "primary",
|
|
572
|
-
color = "default",
|
|
573
|
-
size = "md",
|
|
574
|
-
block = false,
|
|
575
|
-
loading = false,
|
|
576
|
-
disabled = false,
|
|
577
|
-
className = "",
|
|
578
|
-
ariaLabel = "",
|
|
579
|
-
style = {},
|
|
580
|
-
children
|
|
581
|
-
}) => {
|
|
582
|
-
const isDisabled = disabled || loading;
|
|
583
|
-
const handleClick = (e) => {
|
|
584
|
-
if (isDisabled) {
|
|
585
|
-
e.preventDefault();
|
|
586
|
-
return;
|
|
587
|
-
}
|
|
588
|
-
onClick?.(e);
|
|
589
|
-
};
|
|
590
|
-
const buttonClasses = [
|
|
591
|
-
"btn",
|
|
592
|
-
`btn--${variant}`,
|
|
593
|
-
`btn--${size}`,
|
|
594
|
-
`btn--${color}`,
|
|
595
|
-
block && "btn--block",
|
|
596
|
-
loading && "btn--loading",
|
|
597
|
-
isDisabled && "btn--disabled",
|
|
598
|
-
className
|
|
599
|
-
].filter(Boolean).join(" ");
|
|
600
|
-
return /* @__PURE__ */ jsx4(
|
|
601
|
-
"button",
|
|
602
|
-
{
|
|
603
|
-
type,
|
|
604
|
-
onClick: handleClick,
|
|
605
|
-
className: buttonClasses,
|
|
606
|
-
style,
|
|
607
|
-
disabled: isDisabled,
|
|
608
|
-
"aria-label": ariaLabel || label,
|
|
609
|
-
"aria-busy": loading,
|
|
610
|
-
"aria-disabled": isDisabled,
|
|
611
|
-
children: loading ? /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
612
|
-
/* @__PURE__ */ jsx4("span", { className: "btn__spinner", "aria-hidden": "true", children: /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx4("circle", { cx: "10", cy: "10", r: "8" }) }) }),
|
|
613
|
-
/* @__PURE__ */ jsx4("span", { className: "btn__loading-text", children: "Processing..." })
|
|
614
|
-
] }) : /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
615
|
-
children,
|
|
616
|
-
label
|
|
617
|
-
] })
|
|
618
|
-
}
|
|
619
|
-
);
|
|
620
|
-
};
|
|
621
|
-
var Button = React2.memo(ButtonComponent);
|
|
622
|
-
|
|
623
564
|
// src/components/Fields/Input/NumberInput/index.tsx
|
|
624
|
-
import {
|
|
565
|
+
import { Button } from "@sio-group/ui-core";
|
|
566
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
625
567
|
var NumberInput = ({
|
|
626
568
|
value,
|
|
627
569
|
min,
|
|
@@ -677,7 +619,7 @@ var NumberInput = ({
|
|
|
677
619
|
}
|
|
678
620
|
onChange(value2);
|
|
679
621
|
};
|
|
680
|
-
return /* @__PURE__ */
|
|
622
|
+
return /* @__PURE__ */ jsxs3(
|
|
681
623
|
InputWrapper_default,
|
|
682
624
|
{
|
|
683
625
|
type,
|
|
@@ -693,7 +635,7 @@ var NumberInput = ({
|
|
|
693
635
|
className,
|
|
694
636
|
style,
|
|
695
637
|
children: [
|
|
696
|
-
spinner && spinner === "horizontal" && /* @__PURE__ */
|
|
638
|
+
spinner && spinner === "horizontal" && /* @__PURE__ */ jsx4(
|
|
697
639
|
Button,
|
|
698
640
|
{
|
|
699
641
|
type: "button",
|
|
@@ -705,8 +647,8 @@ var NumberInput = ({
|
|
|
705
647
|
label: "-"
|
|
706
648
|
}
|
|
707
649
|
),
|
|
708
|
-
/* @__PURE__ */
|
|
709
|
-
/* @__PURE__ */
|
|
650
|
+
/* @__PURE__ */ jsx4(Icon, { icon }),
|
|
651
|
+
/* @__PURE__ */ jsx4(
|
|
710
652
|
"input",
|
|
711
653
|
{
|
|
712
654
|
type: "number",
|
|
@@ -739,7 +681,7 @@ var NumberInput = ({
|
|
|
739
681
|
style: spinner && spinner === "horizontal" ? { textAlign: "center" } : {}
|
|
740
682
|
}
|
|
741
683
|
),
|
|
742
|
-
spinner && (spinner === "horizontal" ? /* @__PURE__ */
|
|
684
|
+
spinner && (spinner === "horizontal" ? /* @__PURE__ */ jsx4(
|
|
743
685
|
Button,
|
|
744
686
|
{
|
|
745
687
|
type: "button",
|
|
@@ -750,8 +692,8 @@ var NumberInput = ({
|
|
|
750
692
|
"aria-label": "Increase value",
|
|
751
693
|
label: "+"
|
|
752
694
|
}
|
|
753
|
-
) : /* @__PURE__ */
|
|
754
|
-
/* @__PURE__ */
|
|
695
|
+
) : /* @__PURE__ */ jsxs3("div", { className: "form-field__spinner", "aria-hidden": "true", children: [
|
|
696
|
+
/* @__PURE__ */ jsx4(
|
|
755
697
|
Button,
|
|
756
698
|
{
|
|
757
699
|
type: "button",
|
|
@@ -761,7 +703,7 @@ var NumberInput = ({
|
|
|
761
703
|
label: "\u25B2"
|
|
762
704
|
}
|
|
763
705
|
),
|
|
764
|
-
/* @__PURE__ */
|
|
706
|
+
/* @__PURE__ */ jsx4(
|
|
765
707
|
Button,
|
|
766
708
|
{
|
|
767
709
|
type: "button",
|
|
@@ -778,7 +720,7 @@ var NumberInput = ({
|
|
|
778
720
|
};
|
|
779
721
|
|
|
780
722
|
// src/components/Fields/Input/RangeInput/index.tsx
|
|
781
|
-
import { jsx as
|
|
723
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
782
724
|
var RangeInput = ({
|
|
783
725
|
value,
|
|
784
726
|
min,
|
|
@@ -805,7 +747,7 @@ var RangeInput = ({
|
|
|
805
747
|
className,
|
|
806
748
|
style
|
|
807
749
|
}) => {
|
|
808
|
-
return /* @__PURE__ */
|
|
750
|
+
return /* @__PURE__ */ jsxs4(
|
|
809
751
|
InputWrapper_default,
|
|
810
752
|
{
|
|
811
753
|
type,
|
|
@@ -821,9 +763,9 @@ var RangeInput = ({
|
|
|
821
763
|
className,
|
|
822
764
|
style,
|
|
823
765
|
children: [
|
|
824
|
-
/* @__PURE__ */
|
|
825
|
-
showValue && /* @__PURE__ */
|
|
826
|
-
/* @__PURE__ */
|
|
766
|
+
/* @__PURE__ */ jsx5(Icon, { icon }),
|
|
767
|
+
showValue && /* @__PURE__ */ jsx5("span", { className: "form-field__range-value", children: Number(value) }),
|
|
768
|
+
/* @__PURE__ */ jsx5(
|
|
827
769
|
"input",
|
|
828
770
|
{
|
|
829
771
|
type,
|
|
@@ -857,110 +799,111 @@ var RangeInput = ({
|
|
|
857
799
|
|
|
858
800
|
// src/components/Fields/Input/DateInput/index.tsx
|
|
859
801
|
import { useRef } from "react";
|
|
802
|
+
import { Button as Button2 } from "@sio-group/ui-core";
|
|
860
803
|
|
|
861
804
|
// src/utils/custom-icons.tsx
|
|
862
|
-
import { jsx as
|
|
805
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
863
806
|
var CustomIcons = {
|
|
864
|
-
Date: () => /* @__PURE__ */
|
|
865
|
-
/* @__PURE__ */
|
|
866
|
-
/* @__PURE__ */
|
|
867
|
-
/* @__PURE__ */
|
|
868
|
-
/* @__PURE__ */
|
|
807
|
+
Date: () => /* @__PURE__ */ jsxs5("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
808
|
+
/* @__PURE__ */ jsx6("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2", stroke: "currentColor", fill: "none" }),
|
|
809
|
+
/* @__PURE__ */ jsx6("line", { x1: "8", y1: "2", x2: "8", y2: "6", stroke: "currentColor" }),
|
|
810
|
+
/* @__PURE__ */ jsx6("line", { x1: "16", y1: "2", x2: "16", y2: "6", stroke: "currentColor" }),
|
|
811
|
+
/* @__PURE__ */ jsx6("line", { x1: "3", y1: "10", x2: "21", y2: "10", stroke: "currentColor" })
|
|
869
812
|
] }),
|
|
870
|
-
Time: () => /* @__PURE__ */
|
|
871
|
-
/* @__PURE__ */
|
|
872
|
-
/* @__PURE__ */
|
|
873
|
-
/* @__PURE__ */
|
|
813
|
+
Time: () => /* @__PURE__ */ jsxs5("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
814
|
+
/* @__PURE__ */ jsx6("circle", { cx: "12", cy: "12", r: "10" }),
|
|
815
|
+
/* @__PURE__ */ jsx6("polyline", { points: "12 6 12 12 16 14" }),
|
|
816
|
+
/* @__PURE__ */ jsx6("circle", { cx: "12", cy: "12", r: "1", fill: "currentColor", fillOpacity: "0.3", stroke: "none" })
|
|
874
817
|
] }),
|
|
875
|
-
DateTime: () => /* @__PURE__ */
|
|
876
|
-
/* @__PURE__ */
|
|
877
|
-
/* @__PURE__ */
|
|
878
|
-
/* @__PURE__ */
|
|
879
|
-
/* @__PURE__ */
|
|
880
|
-
/* @__PURE__ */
|
|
881
|
-
/* @__PURE__ */
|
|
818
|
+
DateTime: () => /* @__PURE__ */ jsxs5("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
819
|
+
/* @__PURE__ */ jsx6("rect", { x: "2", y: "3", width: "14", height: "14", rx: "2", ry: "2" }),
|
|
820
|
+
/* @__PURE__ */ jsx6("line", { x1: "5", y1: "2", x2: "5", y2: "5" }),
|
|
821
|
+
/* @__PURE__ */ jsx6("line", { x1: "13", y1: "2", x2: "13", y2: "5" }),
|
|
822
|
+
/* @__PURE__ */ jsx6("line", { x1: "2", y1: "7", x2: "16", y2: "7" }),
|
|
823
|
+
/* @__PURE__ */ jsx6("circle", { cx: "19", cy: "15", r: "4" }),
|
|
824
|
+
/* @__PURE__ */ jsx6("polyline", { points: "19 13 19 15 21 16" })
|
|
882
825
|
] }),
|
|
883
|
-
FileUpload: () => /* @__PURE__ */
|
|
884
|
-
/* @__PURE__ */
|
|
885
|
-
/* @__PURE__ */
|
|
886
|
-
/* @__PURE__ */
|
|
826
|
+
FileUpload: () => /* @__PURE__ */ jsxs5("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
827
|
+
/* @__PURE__ */ jsx6("path", { d: "M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z" }),
|
|
828
|
+
/* @__PURE__ */ jsx6("polyline", { points: "13 2 13 9 20 9" }),
|
|
829
|
+
/* @__PURE__ */ jsx6("path", { d: "M12 12v6m0-6 2 2m-2-2-2 2" })
|
|
887
830
|
] }),
|
|
888
|
-
CloudUpload: () => /* @__PURE__ */
|
|
889
|
-
/* @__PURE__ */
|
|
890
|
-
/* @__PURE__ */
|
|
831
|
+
CloudUpload: () => /* @__PURE__ */ jsxs5("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
832
|
+
/* @__PURE__ */ jsx6("path", { d: "M12 16v-6m0 0-2 2m2-2 2 2" }),
|
|
833
|
+
/* @__PURE__ */ jsx6("path", { d: "M16 16h3a4 4 0 0 0 0-8h-1.5A5.5 5.5 0 0 0 7 9a5 5 0 0 0-1 9.8" })
|
|
891
834
|
] }),
|
|
892
|
-
TrashIcon: () => /* @__PURE__ */
|
|
893
|
-
/* @__PURE__ */
|
|
894
|
-
/* @__PURE__ */
|
|
895
|
-
/* @__PURE__ */
|
|
896
|
-
/* @__PURE__ */
|
|
897
|
-
/* @__PURE__ */
|
|
898
|
-
/* @__PURE__ */
|
|
835
|
+
TrashIcon: () => /* @__PURE__ */ jsxs5("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
836
|
+
/* @__PURE__ */ jsx6("path", { d: "M3 6h18" }),
|
|
837
|
+
/* @__PURE__ */ jsx6("rect", { x: "6", y: "6", width: "12", height: "14", rx: "1", ry: "1" }),
|
|
838
|
+
/* @__PURE__ */ jsx6("path", { d: "M9 3h6" }),
|
|
839
|
+
/* @__PURE__ */ jsx6("path", { d: "M10 3v3M14 3v3" }),
|
|
840
|
+
/* @__PURE__ */ jsx6("line", { x1: "10", y1: "10", x2: "10", y2: "16" }),
|
|
841
|
+
/* @__PURE__ */ jsx6("line", { x1: "14", y1: "10", x2: "14", y2: "16" })
|
|
899
842
|
] }),
|
|
900
|
-
SimpleTrashIcon: () => /* @__PURE__ */
|
|
901
|
-
/* @__PURE__ */
|
|
902
|
-
/* @__PURE__ */
|
|
903
|
-
/* @__PURE__ */
|
|
843
|
+
SimpleTrashIcon: () => /* @__PURE__ */ jsxs5("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
844
|
+
/* @__PURE__ */ jsx6("path", { d: "M3 6h18" }),
|
|
845
|
+
/* @__PURE__ */ jsx6("rect", { x: "6", y: "8", width: "12", height: "12", rx: "1", ry: "1" }),
|
|
846
|
+
/* @__PURE__ */ jsx6("path", { d: "M9 4h6" })
|
|
904
847
|
] }),
|
|
905
|
-
DeleteTrashIcon: () => /* @__PURE__ */
|
|
906
|
-
/* @__PURE__ */
|
|
907
|
-
/* @__PURE__ */
|
|
908
|
-
/* @__PURE__ */
|
|
909
|
-
/* @__PURE__ */
|
|
910
|
-
/* @__PURE__ */
|
|
911
|
-
/* @__PURE__ */
|
|
848
|
+
DeleteTrashIcon: () => /* @__PURE__ */ jsxs5("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
849
|
+
/* @__PURE__ */ jsx6("path", { d: "M3 6h18" }),
|
|
850
|
+
/* @__PURE__ */ jsx6("rect", { x: "6", y: "6", width: "12", height: "14", rx: "1", ry: "1" }),
|
|
851
|
+
/* @__PURE__ */ jsx6("path", { d: "M9 3h6" }),
|
|
852
|
+
/* @__PURE__ */ jsx6("path", { d: "M10 3v3M14 3v3" }),
|
|
853
|
+
/* @__PURE__ */ jsx6("line", { x1: "9", y1: "10", x2: "15", y2: "16" }),
|
|
854
|
+
/* @__PURE__ */ jsx6("line", { x1: "15", y1: "10", x2: "9", y2: "16" })
|
|
912
855
|
] }),
|
|
913
|
-
FileIcon: () => /* @__PURE__ */
|
|
914
|
-
/* @__PURE__ */
|
|
915
|
-
/* @__PURE__ */
|
|
856
|
+
FileIcon: () => /* @__PURE__ */ jsxs5("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
857
|
+
/* @__PURE__ */ jsx6("path", { d: "M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z" }),
|
|
858
|
+
/* @__PURE__ */ jsx6("polyline", { points: "13 2 13 9 20 9" })
|
|
916
859
|
] }),
|
|
917
|
-
Word: () => /* @__PURE__ */
|
|
918
|
-
/* @__PURE__ */
|
|
919
|
-
/* @__PURE__ */
|
|
920
|
-
/* @__PURE__ */
|
|
921
|
-
/* @__PURE__ */
|
|
922
|
-
/* @__PURE__ */
|
|
860
|
+
Word: () => /* @__PURE__ */ jsxs5("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
861
|
+
/* @__PURE__ */ jsx6("path", { d: "M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z" }),
|
|
862
|
+
/* @__PURE__ */ jsx6("polyline", { points: "13 2 13 9 20 9" }),
|
|
863
|
+
/* @__PURE__ */ jsx6("line", { x1: "8", y1: "13", x2: "16", y2: "13" }),
|
|
864
|
+
/* @__PURE__ */ jsx6("line", { x1: "8", y1: "16", x2: "16", y2: "16" }),
|
|
865
|
+
/* @__PURE__ */ jsx6("line", { x1: "8", y1: "19", x2: "13", y2: "19" })
|
|
923
866
|
] }),
|
|
924
|
-
Excel: () => /* @__PURE__ */
|
|
925
|
-
/* @__PURE__ */
|
|
926
|
-
/* @__PURE__ */
|
|
927
|
-
/* @__PURE__ */
|
|
928
|
-
/* @__PURE__ */
|
|
929
|
-
/* @__PURE__ */
|
|
867
|
+
Excel: () => /* @__PURE__ */ jsxs5("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
868
|
+
/* @__PURE__ */ jsx6("path", { d: "M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z" }),
|
|
869
|
+
/* @__PURE__ */ jsx6("polyline", { points: "13 2 13 9 20 9" }),
|
|
870
|
+
/* @__PURE__ */ jsx6("rect", { x: "7", y: "12", width: "10", height: "7", rx: "1" }),
|
|
871
|
+
/* @__PURE__ */ jsx6("line", { x1: "7", y1: "15.5", x2: "17", y2: "15.5" }),
|
|
872
|
+
/* @__PURE__ */ jsx6("line", { x1: "11.5", y1: "12", x2: "11.5", y2: "19" })
|
|
930
873
|
] }),
|
|
931
|
-
PowerPoint: () => /* @__PURE__ */
|
|
932
|
-
/* @__PURE__ */
|
|
933
|
-
/* @__PURE__ */
|
|
934
|
-
/* @__PURE__ */
|
|
935
|
-
/* @__PURE__ */
|
|
874
|
+
PowerPoint: () => /* @__PURE__ */ jsxs5("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
875
|
+
/* @__PURE__ */ jsx6("path", { d: "M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z" }),
|
|
876
|
+
/* @__PURE__ */ jsx6("polyline", { points: "13 2 13 9 20 9" }),
|
|
877
|
+
/* @__PURE__ */ jsx6("rect", { x: "7", y: "12", width: "10", height: "7", rx: "1" }),
|
|
878
|
+
/* @__PURE__ */ jsx6("path", { d: "M9 17l2-3 2 2 2-3" })
|
|
936
879
|
] }),
|
|
937
|
-
Pdf: () => /* @__PURE__ */
|
|
938
|
-
/* @__PURE__ */
|
|
939
|
-
/* @__PURE__ */
|
|
940
|
-
/* @__PURE__ */
|
|
880
|
+
Pdf: () => /* @__PURE__ */ jsxs5("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
881
|
+
/* @__PURE__ */ jsx6("path", { d: "M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z" }),
|
|
882
|
+
/* @__PURE__ */ jsx6("polyline", { points: "13 2 13 9 20 9" }),
|
|
883
|
+
/* @__PURE__ */ jsx6("rect", { x: "7", y: "14", width: "10", height: "4", rx: "1" })
|
|
941
884
|
] }),
|
|
942
|
-
Image: () => /* @__PURE__ */
|
|
943
|
-
/* @__PURE__ */
|
|
944
|
-
/* @__PURE__ */
|
|
945
|
-
/* @__PURE__ */
|
|
946
|
-
/* @__PURE__ */
|
|
885
|
+
Image: () => /* @__PURE__ */ jsxs5("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
886
|
+
/* @__PURE__ */ jsx6("path", { d: "M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z" }),
|
|
887
|
+
/* @__PURE__ */ jsx6("polyline", { points: "13 2 13 9 20 9" }),
|
|
888
|
+
/* @__PURE__ */ jsx6("circle", { cx: "9", cy: "13", r: "1.5" }),
|
|
889
|
+
/* @__PURE__ */ jsx6("path", { d: "M7 18l3-3 2 2 3-3 2 4" })
|
|
947
890
|
] }),
|
|
948
|
-
Audio: () => /* @__PURE__ */
|
|
949
|
-
/* @__PURE__ */
|
|
950
|
-
/* @__PURE__ */
|
|
951
|
-
/* @__PURE__ */
|
|
952
|
-
/* @__PURE__ */
|
|
953
|
-
/* @__PURE__ */
|
|
954
|
-
/* @__PURE__ */
|
|
955
|
-
/* @__PURE__ */
|
|
891
|
+
Audio: () => /* @__PURE__ */ jsxs5("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
892
|
+
/* @__PURE__ */ jsx6("path", { d: "M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z" }),
|
|
893
|
+
/* @__PURE__ */ jsx6("polyline", { points: "13 2 13 9 20 9" }),
|
|
894
|
+
/* @__PURE__ */ jsx6("path", { d: "M8 16v-2" }),
|
|
895
|
+
/* @__PURE__ */ jsx6("path", { d: "M10 17v-4" }),
|
|
896
|
+
/* @__PURE__ */ jsx6("path", { d: "M12 18v-6" }),
|
|
897
|
+
/* @__PURE__ */ jsx6("path", { d: "M14 17v-4" }),
|
|
898
|
+
/* @__PURE__ */ jsx6("path", { d: "M16 16v-2" })
|
|
956
899
|
] }),
|
|
957
|
-
Video: () => /* @__PURE__ */
|
|
958
|
-
/* @__PURE__ */
|
|
959
|
-
/* @__PURE__ */
|
|
960
|
-
/* @__PURE__ */
|
|
961
|
-
/* @__PURE__ */
|
|
900
|
+
Video: () => /* @__PURE__ */ jsxs5("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
901
|
+
/* @__PURE__ */ jsx6("path", { d: "M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z" }),
|
|
902
|
+
/* @__PURE__ */ jsx6("polyline", { points: "13 2 13 9 20 9" }),
|
|
903
|
+
/* @__PURE__ */ jsx6("rect", { x: "7", y: "12", width: "8", height: "6", rx: "1" }),
|
|
904
|
+
/* @__PURE__ */ jsx6("polygon", { points: "11 14 14 15 11 16" })
|
|
962
905
|
] }),
|
|
963
|
-
Globe: () => /* @__PURE__ */
|
|
906
|
+
Globe: () => /* @__PURE__ */ jsxs5(
|
|
964
907
|
"svg",
|
|
965
908
|
{
|
|
966
909
|
width: "20",
|
|
@@ -972,16 +915,16 @@ var CustomIcons = {
|
|
|
972
915
|
strokeLinecap: "round",
|
|
973
916
|
strokeLinejoin: "round",
|
|
974
917
|
children: [
|
|
975
|
-
/* @__PURE__ */
|
|
976
|
-
/* @__PURE__ */
|
|
977
|
-
/* @__PURE__ */
|
|
918
|
+
/* @__PURE__ */ jsx6("circle", { cx: "12", cy: "12", r: "10" }),
|
|
919
|
+
/* @__PURE__ */ jsx6("path", { d: "M2 12h20" }),
|
|
920
|
+
/* @__PURE__ */ jsx6("path", { d: "M12 2a15.3 15.3 0 0 1 0 20 15.3 15.3 0 0 1 0-20z" })
|
|
978
921
|
]
|
|
979
922
|
}
|
|
980
923
|
)
|
|
981
924
|
};
|
|
982
925
|
|
|
983
926
|
// src/components/Fields/Input/DateInput/index.tsx
|
|
984
|
-
import { jsx as
|
|
927
|
+
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
985
928
|
var DateInput = ({
|
|
986
929
|
value,
|
|
987
930
|
min,
|
|
@@ -1016,7 +959,7 @@ var DateInput = ({
|
|
|
1016
959
|
}
|
|
1017
960
|
}
|
|
1018
961
|
};
|
|
1019
|
-
return /* @__PURE__ */
|
|
962
|
+
return /* @__PURE__ */ jsxs6(
|
|
1020
963
|
InputWrapper_default,
|
|
1021
964
|
{
|
|
1022
965
|
type,
|
|
@@ -1032,8 +975,8 @@ var DateInput = ({
|
|
|
1032
975
|
className,
|
|
1033
976
|
style,
|
|
1034
977
|
children: [
|
|
1035
|
-
/* @__PURE__ */
|
|
1036
|
-
/* @__PURE__ */
|
|
978
|
+
/* @__PURE__ */ jsx7(Icon, { icon }),
|
|
979
|
+
/* @__PURE__ */ jsx7(
|
|
1037
980
|
"input",
|
|
1038
981
|
{
|
|
1039
982
|
ref: inputRef,
|
|
@@ -1059,8 +1002,8 @@ var DateInput = ({
|
|
|
1059
1002
|
"aria-label": label || placeholder
|
|
1060
1003
|
}
|
|
1061
1004
|
),
|
|
1062
|
-
/* @__PURE__ */
|
|
1063
|
-
|
|
1005
|
+
/* @__PURE__ */ jsx7(
|
|
1006
|
+
Button2,
|
|
1064
1007
|
{
|
|
1065
1008
|
className: "form-field__action",
|
|
1066
1009
|
type: "button",
|
|
@@ -1077,6 +1020,7 @@ var DateInput = ({
|
|
|
1077
1020
|
|
|
1078
1021
|
// src/components/Fields/Input/FileInput/index.tsx
|
|
1079
1022
|
import { isValidFile } from "@sio-group/form-validation";
|
|
1023
|
+
import { Button as Button3 } from "@sio-group/ui-core";
|
|
1080
1024
|
|
|
1081
1025
|
// src/utils/get-accept-string.ts
|
|
1082
1026
|
var getAccept = (accept) => {
|
|
@@ -1164,7 +1108,7 @@ var FileTypeIcon = (mime) => {
|
|
|
1164
1108
|
};
|
|
1165
1109
|
|
|
1166
1110
|
// src/components/Fields/Input/FileInput/index.tsx
|
|
1167
|
-
import { Fragment
|
|
1111
|
+
import { Fragment, jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1168
1112
|
var FileInput = ({
|
|
1169
1113
|
value,
|
|
1170
1114
|
onChange,
|
|
@@ -1226,8 +1170,8 @@ var FileInput = ({
|
|
|
1226
1170
|
onChange(fileList);
|
|
1227
1171
|
if (onError) onError(errorList ?? []);
|
|
1228
1172
|
};
|
|
1229
|
-
return /* @__PURE__ */
|
|
1230
|
-
/* @__PURE__ */
|
|
1173
|
+
return /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
1174
|
+
/* @__PURE__ */ jsxs7(
|
|
1231
1175
|
InputWrapper_default,
|
|
1232
1176
|
{
|
|
1233
1177
|
type,
|
|
@@ -1243,8 +1187,8 @@ var FileInput = ({
|
|
|
1243
1187
|
className,
|
|
1244
1188
|
style,
|
|
1245
1189
|
children: [
|
|
1246
|
-
/* @__PURE__ */
|
|
1247
|
-
/* @__PURE__ */
|
|
1190
|
+
/* @__PURE__ */ jsx8(Icon, { icon }),
|
|
1191
|
+
/* @__PURE__ */ jsx8(
|
|
1248
1192
|
"input",
|
|
1249
1193
|
{
|
|
1250
1194
|
type,
|
|
@@ -1268,8 +1212,8 @@ var FileInput = ({
|
|
|
1268
1212
|
multiple
|
|
1269
1213
|
}
|
|
1270
1214
|
),
|
|
1271
|
-
/* @__PURE__ */
|
|
1272
|
-
|
|
1215
|
+
/* @__PURE__ */ jsx8(
|
|
1216
|
+
Button3,
|
|
1273
1217
|
{
|
|
1274
1218
|
className: "form-field__action",
|
|
1275
1219
|
type: "button",
|
|
@@ -1285,16 +1229,16 @@ var FileInput = ({
|
|
|
1285
1229
|
]
|
|
1286
1230
|
}
|
|
1287
1231
|
),
|
|
1288
|
-
currentFiles.length !== 0 && /* @__PURE__ */
|
|
1289
|
-
currentFiles.map((file, index) => /* @__PURE__ */
|
|
1290
|
-
/* @__PURE__ */
|
|
1232
|
+
currentFiles.length !== 0 && /* @__PURE__ */ jsxs7("div", { className: "form-field__upload-file-section", children: [
|
|
1233
|
+
currentFiles.map((file, index) => /* @__PURE__ */ jsxs7("div", { className: "form-field__upload-file", children: [
|
|
1234
|
+
/* @__PURE__ */ jsxs7("div", { className: "form-field__upload-file-label", children: [
|
|
1291
1235
|
FileTypeIcon(file.type || "text/uri-list"),
|
|
1292
|
-
/* @__PURE__ */
|
|
1236
|
+
/* @__PURE__ */ jsxs7("span", { children: [
|
|
1293
1237
|
file.name,
|
|
1294
1238
|
file.size ? ` (${getFileSize(file.size)})` : ""
|
|
1295
1239
|
] })
|
|
1296
1240
|
] }),
|
|
1297
|
-
/* @__PURE__ */
|
|
1241
|
+
/* @__PURE__ */ jsx8("div", { className: "form-field__upload-file__buttons", children: /* @__PURE__ */ jsx8(
|
|
1298
1242
|
"button",
|
|
1299
1243
|
{
|
|
1300
1244
|
type: "button",
|
|
@@ -1304,7 +1248,7 @@ var FileInput = ({
|
|
|
1304
1248
|
}
|
|
1305
1249
|
) })
|
|
1306
1250
|
] }, index)),
|
|
1307
|
-
/* @__PURE__ */
|
|
1251
|
+
/* @__PURE__ */ jsx8("div", { className: "form-field__upload-buttons", children: /* @__PURE__ */ jsxs7(
|
|
1308
1252
|
"button",
|
|
1309
1253
|
{
|
|
1310
1254
|
type: "button",
|
|
@@ -1312,7 +1256,7 @@ var FileInput = ({
|
|
|
1312
1256
|
onClick: handleRemoveAll,
|
|
1313
1257
|
children: [
|
|
1314
1258
|
CustomIcons.TrashIcon(),
|
|
1315
|
-
/* @__PURE__ */
|
|
1259
|
+
/* @__PURE__ */ jsx8("span", { children: "Verwijder alles" })
|
|
1316
1260
|
]
|
|
1317
1261
|
}
|
|
1318
1262
|
) })
|
|
@@ -1321,7 +1265,7 @@ var FileInput = ({
|
|
|
1321
1265
|
};
|
|
1322
1266
|
|
|
1323
1267
|
// src/components/Fields/Input/TextInput/index.tsx
|
|
1324
|
-
import { jsx as
|
|
1268
|
+
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1325
1269
|
var TextInput = ({
|
|
1326
1270
|
value,
|
|
1327
1271
|
onChange,
|
|
@@ -1344,7 +1288,7 @@ var TextInput = ({
|
|
|
1344
1288
|
className,
|
|
1345
1289
|
style
|
|
1346
1290
|
}) => {
|
|
1347
|
-
return /* @__PURE__ */
|
|
1291
|
+
return /* @__PURE__ */ jsxs8(
|
|
1348
1292
|
InputWrapper_default,
|
|
1349
1293
|
{
|
|
1350
1294
|
type,
|
|
@@ -1360,8 +1304,8 @@ var TextInput = ({
|
|
|
1360
1304
|
className,
|
|
1361
1305
|
style,
|
|
1362
1306
|
children: [
|
|
1363
|
-
/* @__PURE__ */
|
|
1364
|
-
/* @__PURE__ */
|
|
1307
|
+
/* @__PURE__ */ jsx9(Icon, { icon }),
|
|
1308
|
+
/* @__PURE__ */ jsx9(
|
|
1365
1309
|
"input",
|
|
1366
1310
|
{
|
|
1367
1311
|
type,
|
|
@@ -1389,24 +1333,24 @@ var TextInput = ({
|
|
|
1389
1333
|
};
|
|
1390
1334
|
|
|
1391
1335
|
// src/components/Fields/Input/Input.tsx
|
|
1392
|
-
import { jsx as
|
|
1336
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1393
1337
|
var Input = memo2(
|
|
1394
1338
|
(props) => {
|
|
1395
1339
|
const { type = "text" } = props;
|
|
1396
1340
|
return useMemo(() => {
|
|
1397
1341
|
switch (props.type) {
|
|
1398
1342
|
case "number":
|
|
1399
|
-
return /* @__PURE__ */
|
|
1343
|
+
return /* @__PURE__ */ jsx10(NumberInput, { ...props });
|
|
1400
1344
|
case "range":
|
|
1401
|
-
return /* @__PURE__ */
|
|
1345
|
+
return /* @__PURE__ */ jsx10(RangeInput, { ...props });
|
|
1402
1346
|
case "date":
|
|
1403
1347
|
case "time":
|
|
1404
1348
|
case "datetime-local":
|
|
1405
|
-
return /* @__PURE__ */
|
|
1349
|
+
return /* @__PURE__ */ jsx10(DateInput, { ...props });
|
|
1406
1350
|
case "file":
|
|
1407
|
-
return /* @__PURE__ */
|
|
1351
|
+
return /* @__PURE__ */ jsx10(FileInput, { ...props });
|
|
1408
1352
|
case "hidden":
|
|
1409
|
-
return /* @__PURE__ */
|
|
1353
|
+
return /* @__PURE__ */ jsx10(
|
|
1410
1354
|
"input",
|
|
1411
1355
|
{
|
|
1412
1356
|
type: props.type,
|
|
@@ -1416,14 +1360,14 @@ var Input = memo2(
|
|
|
1416
1360
|
}
|
|
1417
1361
|
);
|
|
1418
1362
|
default:
|
|
1419
|
-
return /* @__PURE__ */
|
|
1363
|
+
return /* @__PURE__ */ jsx10(TextInput, { ...props });
|
|
1420
1364
|
}
|
|
1421
1365
|
}, [type, props]);
|
|
1422
1366
|
}
|
|
1423
1367
|
);
|
|
1424
1368
|
|
|
1425
1369
|
// src/components/Fields/Radio/index.tsx
|
|
1426
|
-
import { jsx as
|
|
1370
|
+
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1427
1371
|
var Radio = ({
|
|
1428
1372
|
value,
|
|
1429
1373
|
onChange,
|
|
@@ -1445,7 +1389,7 @@ var Radio = ({
|
|
|
1445
1389
|
className,
|
|
1446
1390
|
style
|
|
1447
1391
|
}) => {
|
|
1448
|
-
return /* @__PURE__ */
|
|
1392
|
+
return /* @__PURE__ */ jsxs9(
|
|
1449
1393
|
InputWrapper_default,
|
|
1450
1394
|
{
|
|
1451
1395
|
type,
|
|
@@ -1461,16 +1405,16 @@ var Radio = ({
|
|
|
1461
1405
|
style,
|
|
1462
1406
|
hideLayout: true,
|
|
1463
1407
|
children: [
|
|
1464
|
-
/* @__PURE__ */
|
|
1408
|
+
/* @__PURE__ */ jsx11(Icon, { icon }),
|
|
1465
1409
|
options.filter((option) => typeof option === "string" || !option.hide).map((option) => {
|
|
1466
1410
|
const opt = typeof option === "string" ? { value: option, label: option } : option;
|
|
1467
|
-
return /* @__PURE__ */
|
|
1411
|
+
return /* @__PURE__ */ jsxs9(
|
|
1468
1412
|
"label",
|
|
1469
1413
|
{
|
|
1470
1414
|
htmlFor: `${id}-${opt.value}`,
|
|
1471
1415
|
className: value === opt.value ? "form-field--has-value" : "",
|
|
1472
1416
|
children: [
|
|
1473
|
-
/* @__PURE__ */
|
|
1417
|
+
/* @__PURE__ */ jsx11(
|
|
1474
1418
|
"input",
|
|
1475
1419
|
{
|
|
1476
1420
|
name,
|
|
@@ -1486,7 +1430,7 @@ var Radio = ({
|
|
|
1486
1430
|
disabled: opt.disabled || disabled
|
|
1487
1431
|
}
|
|
1488
1432
|
),
|
|
1489
|
-
/* @__PURE__ */
|
|
1433
|
+
/* @__PURE__ */ jsx11("div", { children: opt.label })
|
|
1490
1434
|
]
|
|
1491
1435
|
},
|
|
1492
1436
|
opt.value
|
|
@@ -1498,7 +1442,7 @@ var Radio = ({
|
|
|
1498
1442
|
};
|
|
1499
1443
|
|
|
1500
1444
|
// src/components/Fields/Select/index.tsx
|
|
1501
|
-
import { jsx as
|
|
1445
|
+
import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1502
1446
|
var Select = ({
|
|
1503
1447
|
value,
|
|
1504
1448
|
onChange,
|
|
@@ -1525,13 +1469,13 @@ var Select = ({
|
|
|
1525
1469
|
}) => {
|
|
1526
1470
|
const renderOption = (option) => {
|
|
1527
1471
|
if (typeof option === "string") {
|
|
1528
|
-
return /* @__PURE__ */
|
|
1472
|
+
return /* @__PURE__ */ jsx12("option", { value: option, children: option }, option);
|
|
1529
1473
|
}
|
|
1530
1474
|
if ("options" in option) {
|
|
1531
|
-
return /* @__PURE__ */
|
|
1475
|
+
return /* @__PURE__ */ jsx12("optgroup", { label: option.label, children: option.options.map(renderOption) }, option.label);
|
|
1532
1476
|
}
|
|
1533
1477
|
if (option.hide) return null;
|
|
1534
|
-
return /* @__PURE__ */
|
|
1478
|
+
return /* @__PURE__ */ jsx12(
|
|
1535
1479
|
"option",
|
|
1536
1480
|
{
|
|
1537
1481
|
value: option.value,
|
|
@@ -1541,7 +1485,7 @@ var Select = ({
|
|
|
1541
1485
|
option.value
|
|
1542
1486
|
);
|
|
1543
1487
|
};
|
|
1544
|
-
return /* @__PURE__ */
|
|
1488
|
+
return /* @__PURE__ */ jsxs10(
|
|
1545
1489
|
InputWrapper_default,
|
|
1546
1490
|
{
|
|
1547
1491
|
type,
|
|
@@ -1557,8 +1501,8 @@ var Select = ({
|
|
|
1557
1501
|
className: `${className ?? ""} ${multiple ? "form-field__select-multiple" : "form-field__select-single"}`,
|
|
1558
1502
|
style,
|
|
1559
1503
|
children: [
|
|
1560
|
-
/* @__PURE__ */
|
|
1561
|
-
/* @__PURE__ */
|
|
1504
|
+
/* @__PURE__ */ jsx12(Icon, { icon }),
|
|
1505
|
+
/* @__PURE__ */ jsxs10(
|
|
1562
1506
|
"select",
|
|
1563
1507
|
{
|
|
1564
1508
|
name,
|
|
@@ -1584,7 +1528,7 @@ var Select = ({
|
|
|
1584
1528
|
multiple,
|
|
1585
1529
|
"aria-label": label || placeholder,
|
|
1586
1530
|
children: [
|
|
1587
|
-
placeholder && /* @__PURE__ */
|
|
1531
|
+
placeholder && /* @__PURE__ */ jsxs10("option", { value: "", selected: true, disabled: true, children: [
|
|
1588
1532
|
placeholder,
|
|
1589
1533
|
!label && required ? " *" : ""
|
|
1590
1534
|
] }),
|
|
@@ -1598,7 +1542,7 @@ var Select = ({
|
|
|
1598
1542
|
};
|
|
1599
1543
|
|
|
1600
1544
|
// src/components/Fields/Textarea/index.tsx
|
|
1601
|
-
import { jsx as
|
|
1545
|
+
import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1602
1546
|
var Textarea = ({
|
|
1603
1547
|
value,
|
|
1604
1548
|
onChange,
|
|
@@ -1623,7 +1567,7 @@ var Textarea = ({
|
|
|
1623
1567
|
className,
|
|
1624
1568
|
style
|
|
1625
1569
|
}) => {
|
|
1626
|
-
return /* @__PURE__ */
|
|
1570
|
+
return /* @__PURE__ */ jsxs11(
|
|
1627
1571
|
InputWrapper_default,
|
|
1628
1572
|
{
|
|
1629
1573
|
type,
|
|
@@ -1639,8 +1583,8 @@ var Textarea = ({
|
|
|
1639
1583
|
className,
|
|
1640
1584
|
style,
|
|
1641
1585
|
children: [
|
|
1642
|
-
/* @__PURE__ */
|
|
1643
|
-
/* @__PURE__ */
|
|
1586
|
+
/* @__PURE__ */ jsx13(Icon, { icon }),
|
|
1587
|
+
/* @__PURE__ */ jsx13(
|
|
1644
1588
|
"textarea",
|
|
1645
1589
|
{
|
|
1646
1590
|
name,
|
|
@@ -1668,76 +1612,12 @@ var Textarea = ({
|
|
|
1668
1612
|
);
|
|
1669
1613
|
};
|
|
1670
1614
|
|
|
1671
|
-
// src/components/Link/index.tsx
|
|
1672
|
-
import React4 from "react";
|
|
1673
|
-
import { Fragment as Fragment3, jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1674
|
-
var LinkComponent = ({
|
|
1675
|
-
label,
|
|
1676
|
-
to = "#",
|
|
1677
|
-
onClick,
|
|
1678
|
-
color = "default",
|
|
1679
|
-
size = "md",
|
|
1680
|
-
block = false,
|
|
1681
|
-
loading = false,
|
|
1682
|
-
disabled = false,
|
|
1683
|
-
className = "",
|
|
1684
|
-
ariaLabel = "",
|
|
1685
|
-
navigate,
|
|
1686
|
-
external = false,
|
|
1687
|
-
style = {},
|
|
1688
|
-
children
|
|
1689
|
-
}) => {
|
|
1690
|
-
const isDisabled = disabled || loading;
|
|
1691
|
-
const isExternal = external || /^(https?:|mailto:|tel:|ftp:)/.test(to);
|
|
1692
|
-
const handleClick = (e) => {
|
|
1693
|
-
if (isDisabled) {
|
|
1694
|
-
e.preventDefault();
|
|
1695
|
-
return;
|
|
1696
|
-
}
|
|
1697
|
-
onClick?.(e);
|
|
1698
|
-
if (!isExternal && navigate) {
|
|
1699
|
-
e.preventDefault();
|
|
1700
|
-
navigate();
|
|
1701
|
-
}
|
|
1702
|
-
};
|
|
1703
|
-
const linkClasses = [
|
|
1704
|
-
"link",
|
|
1705
|
-
`link--${color}`,
|
|
1706
|
-
`btn--${size}`,
|
|
1707
|
-
block && "link--block",
|
|
1708
|
-
loading && "link--loading",
|
|
1709
|
-
isDisabled && "link--disabled",
|
|
1710
|
-
className
|
|
1711
|
-
].filter(Boolean).join(" ");
|
|
1712
|
-
return /* @__PURE__ */ jsx15(
|
|
1713
|
-
"a",
|
|
1714
|
-
{
|
|
1715
|
-
href: isDisabled ? void 0 : to,
|
|
1716
|
-
onClick: handleClick,
|
|
1717
|
-
className: linkClasses,
|
|
1718
|
-
style,
|
|
1719
|
-
"aria-label": ariaLabel || label,
|
|
1720
|
-
"aria-busy": loading,
|
|
1721
|
-
"aria-disabled": isDisabled,
|
|
1722
|
-
target: isExternal ? "_blank" : void 0,
|
|
1723
|
-
rel: isExternal ? "noopener noreferrer" : void 0,
|
|
1724
|
-
children: loading ? /* @__PURE__ */ jsxs13(Fragment3, { children: [
|
|
1725
|
-
/* @__PURE__ */ jsx15("span", { className: "btn__spinner", "aria-hidden": "true", children: /* @__PURE__ */ jsx15("svg", { viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx15("circle", { cx: "10", cy: "10", r: "8" }) }) }),
|
|
1726
|
-
/* @__PURE__ */ jsx15("span", { className: "btn__loading-text", children: "Processing..." })
|
|
1727
|
-
] }) : /* @__PURE__ */ jsxs13(Fragment3, { children: [
|
|
1728
|
-
children,
|
|
1729
|
-
label && /* @__PURE__ */ jsx15("span", { className: "btn__label", children: label })
|
|
1730
|
-
] })
|
|
1731
|
-
}
|
|
1732
|
-
);
|
|
1733
|
-
};
|
|
1734
|
-
var Link = React4.memo(LinkComponent);
|
|
1735
|
-
|
|
1736
1615
|
// src/components/Form.tsx
|
|
1737
|
-
import {
|
|
1616
|
+
import { Link, Button as Button4 } from "@sio-group/ui-core";
|
|
1617
|
+
import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1738
1618
|
import { createElement } from "react";
|
|
1739
|
-
var DefaultContainer = ({ children }) => /* @__PURE__ */
|
|
1740
|
-
var DefaultButtonContainer = ({ children }) => /* @__PURE__ */
|
|
1619
|
+
var DefaultContainer = ({ children }) => /* @__PURE__ */ jsx14("div", { children });
|
|
1620
|
+
var DefaultButtonContainer = ({ children }) => /* @__PURE__ */ jsx14("div", { className: "btn-group", children });
|
|
1741
1621
|
var Form = ({
|
|
1742
1622
|
fields,
|
|
1743
1623
|
layout = [],
|
|
@@ -1784,7 +1664,7 @@ var Form = ({
|
|
|
1784
1664
|
case "hidden":
|
|
1785
1665
|
return /* @__PURE__ */ createElement(Input, { ...register(field.name, field, renderLayout), key: field.name });
|
|
1786
1666
|
default:
|
|
1787
|
-
return /* @__PURE__ */
|
|
1667
|
+
return /* @__PURE__ */ jsxs12("div", { children: [
|
|
1788
1668
|
field.type,
|
|
1789
1669
|
" to implement"
|
|
1790
1670
|
] }, field.name);
|
|
@@ -1796,7 +1676,7 @@ var Form = ({
|
|
|
1796
1676
|
const content = target.map((element) => {
|
|
1797
1677
|
if ("fields" in element) {
|
|
1798
1678
|
const classes = getColumnClasses(element.layout, element.layout?.className);
|
|
1799
|
-
return /* @__PURE__ */
|
|
1679
|
+
return /* @__PURE__ */ jsx14(
|
|
1800
1680
|
"div",
|
|
1801
1681
|
{
|
|
1802
1682
|
className: classes,
|
|
@@ -1811,7 +1691,7 @@ var Form = ({
|
|
|
1811
1691
|
}
|
|
1812
1692
|
return loadElement(element, hasLayout);
|
|
1813
1693
|
});
|
|
1814
|
-
return hasLayout ? /* @__PURE__ */
|
|
1694
|
+
return hasLayout ? /* @__PURE__ */ jsx14("div", { className: "sio-row", children: content }) : content;
|
|
1815
1695
|
};
|
|
1816
1696
|
const fieldMap = useMemo2(() => {
|
|
1817
1697
|
const map = /* @__PURE__ */ new Map();
|
|
@@ -1827,12 +1707,12 @@ var Form = ({
|
|
|
1827
1707
|
reset();
|
|
1828
1708
|
};
|
|
1829
1709
|
const renderButton = (props, i) => {
|
|
1830
|
-
return props.type === "link" ? /* @__PURE__ */ createElement(Link, { ...props, key: i }) : /* @__PURE__ */ createElement(
|
|
1710
|
+
return props.type === "link" ? /* @__PURE__ */ createElement(Link, { ...props, key: i }) : /* @__PURE__ */ createElement(Button4, { ...props, key: i });
|
|
1831
1711
|
};
|
|
1832
1712
|
const renderButtons = () => {
|
|
1833
|
-
return submitShow || cancelShow || buttons.length ? /* @__PURE__ */
|
|
1834
|
-
submitShow && /* @__PURE__ */
|
|
1835
|
-
|
|
1713
|
+
return submitShow || cancelShow || buttons.length ? /* @__PURE__ */ jsxs12(ButtonContainer, { children: [
|
|
1714
|
+
submitShow && /* @__PURE__ */ jsx14(
|
|
1715
|
+
Button4,
|
|
1836
1716
|
{
|
|
1837
1717
|
type: "submit",
|
|
1838
1718
|
onClick: handleSubmit,
|
|
@@ -1842,32 +1722,29 @@ var Form = ({
|
|
|
1842
1722
|
disabled: !isValid() || !extraValidation(getValues())
|
|
1843
1723
|
}
|
|
1844
1724
|
),
|
|
1845
|
-
cancelShow && /* @__PURE__ */
|
|
1846
|
-
|
|
1725
|
+
cancelShow && /* @__PURE__ */ jsx14(
|
|
1726
|
+
Button4,
|
|
1847
1727
|
{
|
|
1848
1728
|
type: "button",
|
|
1849
1729
|
onClick: handleCancel,
|
|
1850
1730
|
variant: "secondary",
|
|
1851
|
-
label: cancelLabel
|
|
1852
|
-
disabled: !isDirty()
|
|
1731
|
+
label: cancelLabel
|
|
1853
1732
|
}
|
|
1854
1733
|
),
|
|
1855
1734
|
buttons?.map(renderButton)
|
|
1856
1735
|
] }) : null;
|
|
1857
1736
|
};
|
|
1858
|
-
return /* @__PURE__ */
|
|
1859
|
-
/* @__PURE__ */
|
|
1737
|
+
return /* @__PURE__ */ jsxs12("form", { className, style, noValidate: true, children: [
|
|
1738
|
+
/* @__PURE__ */ jsx14(Container, { children: renderFields() }),
|
|
1860
1739
|
renderButtons()
|
|
1861
1740
|
] });
|
|
1862
1741
|
};
|
|
1863
1742
|
export {
|
|
1864
|
-
Button,
|
|
1865
1743
|
Checkbox,
|
|
1866
1744
|
DateInput,
|
|
1867
1745
|
FileInput,
|
|
1868
1746
|
Form,
|
|
1869
1747
|
Input,
|
|
1870
|
-
Link,
|
|
1871
1748
|
NumberInput,
|
|
1872
1749
|
Radio,
|
|
1873
1750
|
RangeInput,
|