@apexcura/ui-components 0.0.13-Beta94 → 0.0.13-Beta96
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 +22 -3
- package/dist/index.mjs +22 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -643,6 +643,7 @@ var ModelElement = (props) => {
|
|
|
643
643
|
var TableElement = (props) => {
|
|
644
644
|
const { thead, tbody } = props;
|
|
645
645
|
const [selectedRecord, setSelectedRecord] = (0, import_react20.useState)({});
|
|
646
|
+
const [selectedRowKeys, setSelectedRowKeys] = (0, import_react20.useState)([]);
|
|
646
647
|
const [model, setModel] = (0, import_react20.useState)(false);
|
|
647
648
|
const handleChange = (record) => {
|
|
648
649
|
console.log("record", record);
|
|
@@ -665,9 +666,9 @@ var TableElement = (props) => {
|
|
|
665
666
|
render: col.render,
|
|
666
667
|
sorter: {
|
|
667
668
|
compare: (a, b) => {
|
|
668
|
-
if (typeof a[col.key] === "number" && typeof
|
|
669
|
+
if (typeof a[col.key] === "number" && typeof b[col.key] === "number") {
|
|
669
670
|
return a[col.key] - b[col.key];
|
|
670
|
-
} else if (typeof a[col.key] === "string" && typeof
|
|
671
|
+
} else if (typeof a[col.key] === "string" && typeof b[col.key] === "string") {
|
|
671
672
|
return a[col.key].localeCompare(b[col.key]);
|
|
672
673
|
}
|
|
673
674
|
}
|
|
@@ -687,6 +688,14 @@ var TableElement = (props) => {
|
|
|
687
688
|
props.onChange({ page, pageSize });
|
|
688
689
|
}
|
|
689
690
|
};
|
|
691
|
+
const onSelectChange = (selectedRowKeys2) => {
|
|
692
|
+
console.log("selectedRowKeys changed: ", selectedRowKeys2);
|
|
693
|
+
setSelectedRowKeys(selectedRowKeys2);
|
|
694
|
+
};
|
|
695
|
+
const rowSelectionConfig = {
|
|
696
|
+
selectedRowKeys,
|
|
697
|
+
onChange: onSelectChange
|
|
698
|
+
};
|
|
690
699
|
return /* @__PURE__ */ import_react20.default.createElement(import_react20.default.Fragment, null, /* @__PURE__ */ import_react20.default.createElement(
|
|
691
700
|
import_antd14.Table,
|
|
692
701
|
{
|
|
@@ -700,6 +709,7 @@ var TableElement = (props) => {
|
|
|
700
709
|
columns,
|
|
701
710
|
bordered: true,
|
|
702
711
|
size: props.size && props.size,
|
|
712
|
+
rowSelection: props.rowSelection ? rowSelectionConfig : void 0,
|
|
703
713
|
onRow: (record) => {
|
|
704
714
|
return {
|
|
705
715
|
onClick: () => {
|
|
@@ -711,7 +721,16 @@ var TableElement = (props) => {
|
|
|
711
721
|
};
|
|
712
722
|
}
|
|
713
723
|
}
|
|
714
|
-
), model && /* @__PURE__ */ import_react20.default.createElement(
|
|
724
|
+
), model && /* @__PURE__ */ import_react20.default.createElement(
|
|
725
|
+
ModelElement,
|
|
726
|
+
{
|
|
727
|
+
selectedRecord,
|
|
728
|
+
...props,
|
|
729
|
+
columns,
|
|
730
|
+
model,
|
|
731
|
+
onCancel: () => setModel(false)
|
|
732
|
+
}
|
|
733
|
+
));
|
|
715
734
|
};
|
|
716
735
|
|
|
717
736
|
// src/Components/DatePicker.tsx
|
package/dist/index.mjs
CHANGED
|
@@ -586,6 +586,7 @@ var ModelElement = (props) => {
|
|
|
586
586
|
var TableElement = (props) => {
|
|
587
587
|
const { thead, tbody } = props;
|
|
588
588
|
const [selectedRecord, setSelectedRecord] = useState5({});
|
|
589
|
+
const [selectedRowKeys, setSelectedRowKeys] = useState5([]);
|
|
589
590
|
const [model, setModel] = useState5(false);
|
|
590
591
|
const handleChange = (record) => {
|
|
591
592
|
console.log("record", record);
|
|
@@ -608,9 +609,9 @@ var TableElement = (props) => {
|
|
|
608
609
|
render: col.render,
|
|
609
610
|
sorter: {
|
|
610
611
|
compare: (a, b) => {
|
|
611
|
-
if (typeof a[col.key] === "number" && typeof
|
|
612
|
+
if (typeof a[col.key] === "number" && typeof b[col.key] === "number") {
|
|
612
613
|
return a[col.key] - b[col.key];
|
|
613
|
-
} else if (typeof a[col.key] === "string" && typeof
|
|
614
|
+
} else if (typeof a[col.key] === "string" && typeof b[col.key] === "string") {
|
|
614
615
|
return a[col.key].localeCompare(b[col.key]);
|
|
615
616
|
}
|
|
616
617
|
}
|
|
@@ -630,6 +631,14 @@ var TableElement = (props) => {
|
|
|
630
631
|
props.onChange({ page, pageSize });
|
|
631
632
|
}
|
|
632
633
|
};
|
|
634
|
+
const onSelectChange = (selectedRowKeys2) => {
|
|
635
|
+
console.log("selectedRowKeys changed: ", selectedRowKeys2);
|
|
636
|
+
setSelectedRowKeys(selectedRowKeys2);
|
|
637
|
+
};
|
|
638
|
+
const rowSelectionConfig = {
|
|
639
|
+
selectedRowKeys,
|
|
640
|
+
onChange: onSelectChange
|
|
641
|
+
};
|
|
633
642
|
return /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement(
|
|
634
643
|
Table2,
|
|
635
644
|
{
|
|
@@ -643,6 +652,7 @@ var TableElement = (props) => {
|
|
|
643
652
|
columns,
|
|
644
653
|
bordered: true,
|
|
645
654
|
size: props.size && props.size,
|
|
655
|
+
rowSelection: props.rowSelection ? rowSelectionConfig : void 0,
|
|
646
656
|
onRow: (record) => {
|
|
647
657
|
return {
|
|
648
658
|
onClick: () => {
|
|
@@ -654,7 +664,16 @@ var TableElement = (props) => {
|
|
|
654
664
|
};
|
|
655
665
|
}
|
|
656
666
|
}
|
|
657
|
-
), model && /* @__PURE__ */ React20.createElement(
|
|
667
|
+
), model && /* @__PURE__ */ React20.createElement(
|
|
668
|
+
ModelElement,
|
|
669
|
+
{
|
|
670
|
+
selectedRecord,
|
|
671
|
+
...props,
|
|
672
|
+
columns,
|
|
673
|
+
model,
|
|
674
|
+
onCancel: () => setModel(false)
|
|
675
|
+
}
|
|
676
|
+
));
|
|
658
677
|
};
|
|
659
678
|
|
|
660
679
|
// src/Components/DatePicker.tsx
|