@apexcura/ui-components 0.0.14-Beta206 → 0.0.14-Beta209

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.js CHANGED
@@ -718,6 +718,8 @@ var TableElement = (props) => {
718
718
  const [selectedRecord, setSelectedRecord] = (0, import_react20.useState)({});
719
719
  const [model, setModel] = (0, import_react20.useState)(false);
720
720
  const [dataSource, setDataSource] = (0, import_react20.useState)([]);
721
+ console.log(props.value);
722
+ const defaultVal = props.value;
721
723
  (0, import_react20.useEffect)(() => {
722
724
  if (tbody) {
723
725
  setDataSource(
@@ -730,8 +732,10 @@ var TableElement = (props) => {
730
732
  }
731
733
  }, [tbody]);
732
734
  const handleChange = (record) => {
733
- if (props.onChange) {
734
- props.onChange(record);
735
+ if (record) {
736
+ props.onChange && props.onChange(record);
737
+ } else {
738
+ props.onChange && props.onChange(defaultVal);
735
739
  }
736
740
  };
737
741
  let columns = [];
@@ -815,6 +819,7 @@ var TableElement = (props) => {
815
819
  {
816
820
  className: props.className,
817
821
  pagination: props.pagination ? {
822
+ defaultCurrent: props.value && props.value.page,
818
823
  showTotal: (total) => `Total: ${total} items`,
819
824
  total: props.count,
820
825
  showSizeChanger: props.count ? props.count > 10 : 0 > 10,
@@ -906,7 +911,7 @@ var DateRangePickerElement = (props) => {
906
911
  console.log("formattedDate", formattedDate);
907
912
  props.onChange && props.onChange(formattedDate);
908
913
  } else {
909
- props.onChange && props.onChange("");
914
+ props.onChange && props.onChange(["", ""]);
910
915
  }
911
916
  };
912
917
  const rangePresets = [
@@ -923,6 +928,7 @@ var DateRangePickerElement = (props) => {
923
928
  {
924
929
  disabledDate,
925
930
  presets: rangePresets,
931
+ format: { format: "DD-MM-YYYY" },
926
932
  onChange: handleChange,
927
933
  value: value && value.length === 2 && [
928
934
  (0, import_dayjs2.default)(value[0], "DD-MM-YYYY"),
package/dist/index.mjs CHANGED
@@ -652,6 +652,8 @@ var TableElement = (props) => {
652
652
  const [selectedRecord, setSelectedRecord] = useState5({});
653
653
  const [model, setModel] = useState5(false);
654
654
  const [dataSource, setDataSource] = useState5([]);
655
+ console.log(props.value);
656
+ const defaultVal = props.value;
655
657
  useEffect2(() => {
656
658
  if (tbody) {
657
659
  setDataSource(
@@ -664,8 +666,10 @@ var TableElement = (props) => {
664
666
  }
665
667
  }, [tbody]);
666
668
  const handleChange = (record) => {
667
- if (props.onChange) {
668
- props.onChange(record);
669
+ if (record) {
670
+ props.onChange && props.onChange(record);
671
+ } else {
672
+ props.onChange && props.onChange(defaultVal);
669
673
  }
670
674
  };
671
675
  let columns = [];
@@ -749,6 +753,7 @@ var TableElement = (props) => {
749
753
  {
750
754
  className: props.className,
751
755
  pagination: props.pagination ? {
756
+ defaultCurrent: props.value && props.value.page,
752
757
  showTotal: (total) => `Total: ${total} items`,
753
758
  total: props.count,
754
759
  showSizeChanger: props.count ? props.count > 10 : 0 > 10,
@@ -840,7 +845,7 @@ var DateRangePickerElement = (props) => {
840
845
  console.log("formattedDate", formattedDate);
841
846
  props.onChange && props.onChange(formattedDate);
842
847
  } else {
843
- props.onChange && props.onChange("");
848
+ props.onChange && props.onChange(["", ""]);
844
849
  }
845
850
  };
846
851
  const rangePresets = [
@@ -857,6 +862,7 @@ var DateRangePickerElement = (props) => {
857
862
  {
858
863
  disabledDate,
859
864
  presets: rangePresets,
865
+ format: { format: "DD-MM-YYYY" },
860
866
  onChange: handleChange,
861
867
  value: value && value.length === 2 && [
862
868
  dayjs2(value[0], "DD-MM-YYYY"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.14-Beta206",
3
+ "version": "0.0.14-Beta209",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",