@apexcura/ui-components 0.0.14-Beta1 → 0.0.14-Beta11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -26,6 +26,8 @@ type ElementType = {
26
26
  fields?: any[];
27
27
  schema?: any[];
28
28
  options?: any[];
29
+ options1: any[];
30
+ options2: any[];
29
31
  onChange?: (value: string | number | boolean | object | any[] | undefined) => void;
30
32
  onClick?: () => void;
31
33
  dropDownOptions?: any[];
package/dist/index.d.ts CHANGED
@@ -26,6 +26,8 @@ type ElementType = {
26
26
  fields?: any[];
27
27
  schema?: any[];
28
28
  options?: any[];
29
+ options1: any[];
30
+ options2: any[];
29
31
  onChange?: (value: string | number | boolean | object | any[] | undefined) => void;
30
32
  onClick?: () => void;
31
33
  dropDownOptions?: any[];
package/dist/index.js CHANGED
@@ -464,9 +464,9 @@ var AddMoreTable = (props) => {
464
464
  if (!element) return null;
465
465
  const { element: type, label } = element;
466
466
  if (type === "single-select") {
467
- return /* @__PURE__ */ import_react12.default.createElement(SingleSelectElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false });
467
+ return /* @__PURE__ */ import_react12.default.createElement(SingleSelectElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false, options1: [], options2: [] });
468
468
  } else if (type === "textarea") {
469
- return /* @__PURE__ */ import_react12.default.createElement(TextareaElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false });
469
+ return /* @__PURE__ */ import_react12.default.createElement(TextareaElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false, options1: [], options2: [] });
470
470
  } else {
471
471
  return null;
472
472
  }
@@ -681,7 +681,23 @@ var TableElement = (props) => {
681
681
  }
682
682
  }
683
683
  }
684
- }))
684
+ })),
685
+ {
686
+ title: "View",
687
+ dataIndex: "View",
688
+ key: "View",
689
+ render: (_, record) => /* @__PURE__ */ import_react20.default.createElement(
690
+ "a",
691
+ {
692
+ onClick: () => {
693
+ setSelectedRecord(record);
694
+ handleChange(record);
695
+ setModel(true);
696
+ }
697
+ },
698
+ "View"
699
+ )
700
+ }
685
701
  ];
686
702
  }
687
703
  const dataSource = tbody && tbody.map((row, index) => ({
@@ -715,17 +731,7 @@ var TableElement = (props) => {
715
731
  columns,
716
732
  bordered: true,
717
733
  rowSelection: rowSelectionConfig,
718
- size: props.size && props.size,
719
- onRow: (record) => {
720
- return {
721
- onClick: () => {
722
- setSelectedRecord(record);
723
- handleChange(record);
724
- setModel(true);
725
- },
726
- style: { cursor: "pointer" }
727
- };
728
- }
734
+ size: props.size && props.size
729
735
  }
730
736
  ), model && /* @__PURE__ */ import_react20.default.createElement(ModelElement, { selectedRecord, ...props, columns, model, onCancel: () => setModel(false) }));
731
737
  };
@@ -733,18 +739,14 @@ var TableElement = (props) => {
733
739
  // src/Components/DatePicker.tsx
734
740
  var import_react21 = __toESM(require("react"));
735
741
  var import_antd15 = require("antd");
736
- var import_icons4 = require("@ant-design/icons");
737
- var import_moment = __toESM(require("moment"));
738
742
  var DatePickerElement = (props) => {
739
743
  const [date, setDate] = (0, import_react21.useState)(null);
744
+ const dateFormat = "DD/MM/YYYY";
740
745
  const handleChange = (date2, dateString) => {
741
- console.log("date---------", date2);
742
- console.log("datestring", dateString);
746
+ console.log(dateString);
743
747
  if (date2) {
744
- const formattedDate = dateString;
745
- console.log("formattedDate-----------------", formattedDate);
748
+ const formattedDate = date2.format(dateFormat);
746
749
  setDate(date2);
747
- console.log("changedDate------------", date2);
748
750
  if (props.onChange) {
749
751
  props.onChange(formattedDate);
750
752
  }
@@ -755,23 +757,7 @@ var DatePickerElement = (props) => {
755
757
  }
756
758
  }
757
759
  };
758
- const onHandleDecrement = () => {
759
- const currentDate = date || (0, import_moment.default)();
760
- const newDate = (0, import_moment.default)(currentDate).subtract(1, "days");
761
- setDate(newDate);
762
- if (props.onChange) {
763
- props.onChange(newDate.format("lll"));
764
- }
765
- };
766
- const onHandleIncrement = () => {
767
- const currentDate = date || (0, import_moment.default)();
768
- const newDate = (0, import_moment.default)(currentDate).add(1, "days");
769
- setDate(newDate);
770
- if (props.onChange) {
771
- props.onChange(newDate.format("lll"));
772
- }
773
- };
774
- return /* @__PURE__ */ import_react21.default.createElement("div", null, /* @__PURE__ */ import_react21.default.createElement("button", { onClick: onHandleDecrement }, /* @__PURE__ */ import_react21.default.createElement(import_icons4.LeftOutlined, null)), /* @__PURE__ */ import_react21.default.createElement(
760
+ return /* @__PURE__ */ import_react21.default.createElement("div", null, /* @__PURE__ */ import_react21.default.createElement(
775
761
  import_antd15.DatePicker,
776
762
  {
777
763
  placeholder: props.placeholder,
@@ -779,7 +765,7 @@ var DatePickerElement = (props) => {
779
765
  variant: "borderless",
780
766
  onChange: handleChange
781
767
  }
782
- ), /* @__PURE__ */ import_react21.default.createElement("button", { onClick: onHandleIncrement }, /* @__PURE__ */ import_react21.default.createElement(import_icons4.RightOutlined, null)));
768
+ ));
783
769
  };
784
770
 
785
771
  // src/Components/DateRangePickerElement.tsx
@@ -826,9 +812,14 @@ var SingleCheckbox = (props) => {
826
812
  var import_react25 = __toESM(require("react"));
827
813
  var import_antd18 = require("antd");
828
814
  var DropDownGroup = (props) => {
829
- const [selectedValue, setSelectedValue] = (0, import_react25.useState)({ firstValue: {}, secondValue: {} });
815
+ const [selectedValue, setSelectedValue] = (0, import_react25.useState)({
816
+ firstValue: {},
817
+ secondValue: {}
818
+ });
830
819
  const handleFirstChange = (value) => {
831
- const filterOption2 = props.options?.find((eachOption) => eachOption.value === value);
820
+ const filterOption2 = props.options?.find(
821
+ (eachOption) => eachOption.value === value
822
+ );
832
823
  setSelectedValue((prev) => {
833
824
  const newValue = { ...prev, firstValue: filterOption2 };
834
825
  if (newValue.firstValue) {
@@ -838,7 +829,9 @@ var DropDownGroup = (props) => {
838
829
  });
839
830
  };
840
831
  const handleSecondChange = (value) => {
841
- const filterOption2 = props.options?.find((eachOption) => eachOption.value === value);
832
+ const filterOption2 = props.options?.find(
833
+ (eachOption) => eachOption.value === value
834
+ );
842
835
  setSelectedValue((prev) => {
843
836
  const newValue = { ...prev, secondValue: filterOption2 };
844
837
  if (newValue.secondValue) {
@@ -847,27 +840,29 @@ var DropDownGroup = (props) => {
847
840
  return selectedValue;
848
841
  });
849
842
  };
850
- return /* @__PURE__ */ import_react25.default.createElement("div", { className: props.className, style: { display: "flex", flexDirection: "row", backgroundColor: "white", borderRadius: 10, border: "1px solid gray" } }, /* @__PURE__ */ import_react25.default.createElement(
843
+ return /* @__PURE__ */ import_react25.default.createElement("div", { className: props.containerClassName }, props.label && /* @__PURE__ */ import_react25.default.createElement("label", { htmlFor: props.name, className: props.labelClassName }, props.label), /* @__PURE__ */ import_react25.default.createElement("div", { className: props.subContainerClassName }, /* @__PURE__ */ import_react25.default.createElement(
851
844
  import_antd18.Select,
852
845
  {
853
846
  onChange: handleFirstChange,
854
847
  variant: props.variant,
855
- options: props.options
848
+ options: props.options1,
849
+ className: props.className
856
850
  }
857
851
  ), /* @__PURE__ */ import_react25.default.createElement("div", { style: { borderLeft: "1px solid gray", height: "33px" } }), /* @__PURE__ */ import_react25.default.createElement(
858
852
  import_antd18.Select,
859
853
  {
860
854
  onChange: handleSecondChange,
861
855
  variant: props.variant,
862
- options: props.options
856
+ options: props.options2,
857
+ className: props.className
863
858
  }
864
- ));
859
+ )));
865
860
  };
866
861
 
867
862
  // src/Components/FilesUpload.tsx
868
863
  var import_react26 = __toESM(require("react"));
869
864
  var import_antd19 = require("antd");
870
- var import_icons5 = require("@ant-design/icons");
865
+ var import_icons4 = require("@ant-design/icons");
871
866
  var FileUpload = (props) => {
872
867
  const { Dragger } = import_antd19.Upload;
873
868
  const [files, setFiles] = (0, import_react26.useState)([]);
@@ -907,7 +902,7 @@ var FileUpload = (props) => {
907
902
  showUploadList: true,
908
903
  customRequest
909
904
  },
910
- /* @__PURE__ */ import_react26.default.createElement("p", null, /* @__PURE__ */ import_react26.default.createElement(import_icons5.InboxOutlined, null)),
905
+ /* @__PURE__ */ import_react26.default.createElement("p", null, /* @__PURE__ */ import_react26.default.createElement(import_icons4.InboxOutlined, null)),
911
906
  /* @__PURE__ */ import_react26.default.createElement("p", null, "Click or drag file to upload")
912
907
  ));
913
908
  };
package/dist/index.mjs CHANGED
@@ -407,9 +407,9 @@ var AddMoreTable = (props) => {
407
407
  if (!element) return null;
408
408
  const { element: type, label } = element;
409
409
  if (type === "single-select") {
410
- return /* @__PURE__ */ React12.createElement(SingleSelectElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false });
410
+ return /* @__PURE__ */ React12.createElement(SingleSelectElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false, options1: [], options2: [] });
411
411
  } else if (type === "textarea") {
412
- return /* @__PURE__ */ React12.createElement(TextareaElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false });
412
+ return /* @__PURE__ */ React12.createElement(TextareaElement, { onChange: (value2) => console.log(label, value2), optionType: "", className: void 0, selectedStyle: false, style: false, options1: [], options2: [] });
413
413
  } else {
414
414
  return null;
415
415
  }
@@ -624,7 +624,23 @@ var TableElement = (props) => {
624
624
  }
625
625
  }
626
626
  }
627
- }))
627
+ })),
628
+ {
629
+ title: "View",
630
+ dataIndex: "View",
631
+ key: "View",
632
+ render: (_, record) => /* @__PURE__ */ React20.createElement(
633
+ "a",
634
+ {
635
+ onClick: () => {
636
+ setSelectedRecord(record);
637
+ handleChange(record);
638
+ setModel(true);
639
+ }
640
+ },
641
+ "View"
642
+ )
643
+ }
628
644
  ];
629
645
  }
630
646
  const dataSource = tbody && tbody.map((row, index) => ({
@@ -658,17 +674,7 @@ var TableElement = (props) => {
658
674
  columns,
659
675
  bordered: true,
660
676
  rowSelection: rowSelectionConfig,
661
- size: props.size && props.size,
662
- onRow: (record) => {
663
- return {
664
- onClick: () => {
665
- setSelectedRecord(record);
666
- handleChange(record);
667
- setModel(true);
668
- },
669
- style: { cursor: "pointer" }
670
- };
671
- }
677
+ size: props.size && props.size
672
678
  }
673
679
  ), model && /* @__PURE__ */ React20.createElement(ModelElement, { selectedRecord, ...props, columns, model, onCancel: () => setModel(false) }));
674
680
  };
@@ -676,18 +682,14 @@ var TableElement = (props) => {
676
682
  // src/Components/DatePicker.tsx
677
683
  import React21, { useState as useState6 } from "react";
678
684
  import { DatePicker } from "antd";
679
- import { LeftOutlined, RightOutlined } from "@ant-design/icons";
680
- import moment from "moment";
681
685
  var DatePickerElement = (props) => {
682
686
  const [date, setDate] = useState6(null);
687
+ const dateFormat = "DD/MM/YYYY";
683
688
  const handleChange = (date2, dateString) => {
684
- console.log("date---------", date2);
685
- console.log("datestring", dateString);
689
+ console.log(dateString);
686
690
  if (date2) {
687
- const formattedDate = dateString;
688
- console.log("formattedDate-----------------", formattedDate);
691
+ const formattedDate = date2.format(dateFormat);
689
692
  setDate(date2);
690
- console.log("changedDate------------", date2);
691
693
  if (props.onChange) {
692
694
  props.onChange(formattedDate);
693
695
  }
@@ -698,23 +700,7 @@ var DatePickerElement = (props) => {
698
700
  }
699
701
  }
700
702
  };
701
- const onHandleDecrement = () => {
702
- const currentDate = date || moment();
703
- const newDate = moment(currentDate).subtract(1, "days");
704
- setDate(newDate);
705
- if (props.onChange) {
706
- props.onChange(newDate.format("lll"));
707
- }
708
- };
709
- const onHandleIncrement = () => {
710
- const currentDate = date || moment();
711
- const newDate = moment(currentDate).add(1, "days");
712
- setDate(newDate);
713
- if (props.onChange) {
714
- props.onChange(newDate.format("lll"));
715
- }
716
- };
717
- return /* @__PURE__ */ React21.createElement("div", null, /* @__PURE__ */ React21.createElement("button", { onClick: onHandleDecrement }, /* @__PURE__ */ React21.createElement(LeftOutlined, null)), /* @__PURE__ */ React21.createElement(
703
+ return /* @__PURE__ */ React21.createElement("div", null, /* @__PURE__ */ React21.createElement(
718
704
  DatePicker,
719
705
  {
720
706
  placeholder: props.placeholder,
@@ -722,7 +708,7 @@ var DatePickerElement = (props) => {
722
708
  variant: "borderless",
723
709
  onChange: handleChange
724
710
  }
725
- ), /* @__PURE__ */ React21.createElement("button", { onClick: onHandleIncrement }, /* @__PURE__ */ React21.createElement(RightOutlined, null)));
711
+ ));
726
712
  };
727
713
 
728
714
  // src/Components/DateRangePickerElement.tsx
@@ -769,9 +755,14 @@ var SingleCheckbox = (props) => {
769
755
  import React25, { useState as useState7 } from "react";
770
756
  import { Select as Select4 } from "antd";
771
757
  var DropDownGroup = (props) => {
772
- const [selectedValue, setSelectedValue] = useState7({ firstValue: {}, secondValue: {} });
758
+ const [selectedValue, setSelectedValue] = useState7({
759
+ firstValue: {},
760
+ secondValue: {}
761
+ });
773
762
  const handleFirstChange = (value) => {
774
- const filterOption2 = props.options?.find((eachOption) => eachOption.value === value);
763
+ const filterOption2 = props.options?.find(
764
+ (eachOption) => eachOption.value === value
765
+ );
775
766
  setSelectedValue((prev) => {
776
767
  const newValue = { ...prev, firstValue: filterOption2 };
777
768
  if (newValue.firstValue) {
@@ -781,7 +772,9 @@ var DropDownGroup = (props) => {
781
772
  });
782
773
  };
783
774
  const handleSecondChange = (value) => {
784
- const filterOption2 = props.options?.find((eachOption) => eachOption.value === value);
775
+ const filterOption2 = props.options?.find(
776
+ (eachOption) => eachOption.value === value
777
+ );
785
778
  setSelectedValue((prev) => {
786
779
  const newValue = { ...prev, secondValue: filterOption2 };
787
780
  if (newValue.secondValue) {
@@ -790,21 +783,23 @@ var DropDownGroup = (props) => {
790
783
  return selectedValue;
791
784
  });
792
785
  };
793
- return /* @__PURE__ */ React25.createElement("div", { className: props.className, style: { display: "flex", flexDirection: "row", backgroundColor: "white", borderRadius: 10, border: "1px solid gray" } }, /* @__PURE__ */ React25.createElement(
786
+ return /* @__PURE__ */ React25.createElement("div", { className: props.containerClassName }, props.label && /* @__PURE__ */ React25.createElement("label", { htmlFor: props.name, className: props.labelClassName }, props.label), /* @__PURE__ */ React25.createElement("div", { className: props.subContainerClassName }, /* @__PURE__ */ React25.createElement(
794
787
  Select4,
795
788
  {
796
789
  onChange: handleFirstChange,
797
790
  variant: props.variant,
798
- options: props.options
791
+ options: props.options1,
792
+ className: props.className
799
793
  }
800
794
  ), /* @__PURE__ */ React25.createElement("div", { style: { borderLeft: "1px solid gray", height: "33px" } }), /* @__PURE__ */ React25.createElement(
801
795
  Select4,
802
796
  {
803
797
  onChange: handleSecondChange,
804
798
  variant: props.variant,
805
- options: props.options
799
+ options: props.options2,
800
+ className: props.className
806
801
  }
807
- ));
802
+ )));
808
803
  };
809
804
 
810
805
  // src/Components/FilesUpload.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.14-Beta1",
3
+ "version": "0.0.14-Beta11",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",