@apexcura/ui-components 0.0.15-Beta33 → 0.0.15-Beta35
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 +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +11 -7
- package/dist/index.mjs +11 -7
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -114,7 +114,14 @@ declare const Sidebar: (props: ElementType) => React$1.JSX.Element;
|
|
|
114
114
|
|
|
115
115
|
declare const Navbar: (props: ElementType) => React$1.JSX.Element;
|
|
116
116
|
|
|
117
|
-
|
|
117
|
+
interface PaginationType {
|
|
118
|
+
page?: number;
|
|
119
|
+
pageSize?: number;
|
|
120
|
+
}
|
|
121
|
+
interface TableElementProps extends ElementType {
|
|
122
|
+
value?: PaginationType;
|
|
123
|
+
}
|
|
124
|
+
declare const TableElement: (props: TableElementProps) => React$1.JSX.Element;
|
|
118
125
|
|
|
119
126
|
declare const DatePickerElement: (props: ElementType) => React$1.JSX.Element;
|
|
120
127
|
|
package/dist/index.d.ts
CHANGED
|
@@ -114,7 +114,14 @@ declare const Sidebar: (props: ElementType) => React$1.JSX.Element;
|
|
|
114
114
|
|
|
115
115
|
declare const Navbar: (props: ElementType) => React$1.JSX.Element;
|
|
116
116
|
|
|
117
|
-
|
|
117
|
+
interface PaginationType {
|
|
118
|
+
page?: number;
|
|
119
|
+
pageSize?: number;
|
|
120
|
+
}
|
|
121
|
+
interface TableElementProps extends ElementType {
|
|
122
|
+
value?: PaginationType;
|
|
123
|
+
}
|
|
124
|
+
declare const TableElement: (props: TableElementProps) => React$1.JSX.Element;
|
|
118
125
|
|
|
119
126
|
declare const DatePickerElement: (props: ElementType) => React$1.JSX.Element;
|
|
120
127
|
|
package/dist/index.js
CHANGED
|
@@ -772,7 +772,7 @@ var TableElement = (props) => {
|
|
|
772
772
|
key: "index",
|
|
773
773
|
fixed: "left"
|
|
774
774
|
},
|
|
775
|
-
...thead.map((col
|
|
775
|
+
...thead.map((col) => ({
|
|
776
776
|
title: col.label,
|
|
777
777
|
dataIndex: col.name,
|
|
778
778
|
key: col.key,
|
|
@@ -780,10 +780,14 @@ var TableElement = (props) => {
|
|
|
780
780
|
render: col.render,
|
|
781
781
|
sorter: {
|
|
782
782
|
compare: (a, b) => {
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
return
|
|
783
|
+
const aValue = a[col.key];
|
|
784
|
+
const bValue = b[col.key];
|
|
785
|
+
if (typeof aValue === "number" && typeof bValue === "number") {
|
|
786
|
+
return aValue - bValue;
|
|
787
|
+
} else if (typeof aValue === "string" && typeof bValue === "string") {
|
|
788
|
+
return aValue.localeCompare(bValue);
|
|
789
|
+
} else {
|
|
790
|
+
return 0;
|
|
787
791
|
}
|
|
788
792
|
}
|
|
789
793
|
}
|
|
@@ -796,7 +800,7 @@ var TableElement = (props) => {
|
|
|
796
800
|
}
|
|
797
801
|
};
|
|
798
802
|
const rowSelectionConfig = props.rowSelection ? {
|
|
799
|
-
onChange: (
|
|
803
|
+
onChange: (selectedRows) => {
|
|
800
804
|
if (props.onChange) {
|
|
801
805
|
props.onChange(selectedRows);
|
|
802
806
|
}
|
|
@@ -808,7 +812,7 @@ var TableElement = (props) => {
|
|
|
808
812
|
loading: props.loading,
|
|
809
813
|
className: props.className,
|
|
810
814
|
pagination: props.pagination ? {
|
|
811
|
-
current: props.value
|
|
815
|
+
current: props.value?.page,
|
|
812
816
|
showTotal: (total) => `Total: ${total} items`,
|
|
813
817
|
total: props.count,
|
|
814
818
|
showSizeChanger: props.count ? props.count > 10 : 0 > 10,
|
package/dist/index.mjs
CHANGED
|
@@ -703,7 +703,7 @@ var TableElement = (props) => {
|
|
|
703
703
|
key: "index",
|
|
704
704
|
fixed: "left"
|
|
705
705
|
},
|
|
706
|
-
...thead.map((col
|
|
706
|
+
...thead.map((col) => ({
|
|
707
707
|
title: col.label,
|
|
708
708
|
dataIndex: col.name,
|
|
709
709
|
key: col.key,
|
|
@@ -711,10 +711,14 @@ var TableElement = (props) => {
|
|
|
711
711
|
render: col.render,
|
|
712
712
|
sorter: {
|
|
713
713
|
compare: (a, b) => {
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
return
|
|
714
|
+
const aValue = a[col.key];
|
|
715
|
+
const bValue = b[col.key];
|
|
716
|
+
if (typeof aValue === "number" && typeof bValue === "number") {
|
|
717
|
+
return aValue - bValue;
|
|
718
|
+
} else if (typeof aValue === "string" && typeof bValue === "string") {
|
|
719
|
+
return aValue.localeCompare(bValue);
|
|
720
|
+
} else {
|
|
721
|
+
return 0;
|
|
718
722
|
}
|
|
719
723
|
}
|
|
720
724
|
}
|
|
@@ -727,7 +731,7 @@ var TableElement = (props) => {
|
|
|
727
731
|
}
|
|
728
732
|
};
|
|
729
733
|
const rowSelectionConfig = props.rowSelection ? {
|
|
730
|
-
onChange: (
|
|
734
|
+
onChange: (selectedRows) => {
|
|
731
735
|
if (props.onChange) {
|
|
732
736
|
props.onChange(selectedRows);
|
|
733
737
|
}
|
|
@@ -739,7 +743,7 @@ var TableElement = (props) => {
|
|
|
739
743
|
loading: props.loading,
|
|
740
744
|
className: props.className,
|
|
741
745
|
pagination: props.pagination ? {
|
|
742
|
-
current: props.value
|
|
746
|
+
current: props.value?.page,
|
|
743
747
|
showTotal: (total) => `Total: ${total} items`,
|
|
744
748
|
total: props.count,
|
|
745
749
|
showSizeChanger: props.count ? props.count > 10 : 0 > 10,
|