@apexcura/ui-components 0.0.11-Beta247 → 0.0.11-Beta249
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 +8 -2
- package/dist/index.mjs +8 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -619,7 +619,7 @@ var import_antd13 = require("antd");
|
|
|
619
619
|
// src/Components/ModelBody.tsx
|
|
620
620
|
var import_react19 = __toESM(require("react"));
|
|
621
621
|
var ModelBody = (props) => {
|
|
622
|
-
return /* @__PURE__ */ import_react19.default.createElement("div", { className: props.modalContent.className }, props.modalContent && props.modalContent.fields.map((eachField) => {
|
|
622
|
+
return props.modelContent && /* @__PURE__ */ import_react19.default.createElement("div", { className: props.modalContent.className }, props.modalContent && props.modalContent.fields.map((eachField) => {
|
|
623
623
|
if (eachField.element === "div") {
|
|
624
624
|
return /* @__PURE__ */ import_react19.default.createElement("div", { className: eachField.className }, eachField.label);
|
|
625
625
|
} else if (eachField.element === "input-radio") {
|
|
@@ -656,7 +656,7 @@ var ModelElement = (props) => {
|
|
|
656
656
|
},
|
|
657
657
|
Object.entries(selectedRecord).map(([key, value]) => {
|
|
658
658
|
const record = columns.filter((eachColumn) => eachColumn.key === key);
|
|
659
|
-
return /* @__PURE__ */ import_react20.default.createElement("p", { style: { fontWeight: "500", padding: "10px" }, key }, /* @__PURE__ */ import_react20.default.createElement("span", { style: { fontWeight: "200", color: "gray", paddingRight: "10px" } }, record[0].title), String(value));
|
|
659
|
+
return record.length > 0 ? /* @__PURE__ */ import_react20.default.createElement("p", { style: { fontWeight: "500", padding: "10px" }, key }, /* @__PURE__ */ import_react20.default.createElement("span", { style: { fontWeight: "200", color: "gray", paddingRight: "10px" } }, record[0].title), String(value)) : "";
|
|
660
660
|
})
|
|
661
661
|
)
|
|
662
662
|
},
|
|
@@ -669,6 +669,11 @@ var TableElement = (props) => {
|
|
|
669
669
|
const { thead, tbody } = props;
|
|
670
670
|
const [selectedRecord, setSelectedRecord] = (0, import_react21.useState)({});
|
|
671
671
|
const [model, setModel] = (0, import_react21.useState)(false);
|
|
672
|
+
const handleChange = (record) => {
|
|
673
|
+
if (props.onChange) {
|
|
674
|
+
props.onChange(record);
|
|
675
|
+
}
|
|
676
|
+
};
|
|
672
677
|
let columns = [];
|
|
673
678
|
if (thead) {
|
|
674
679
|
columns = [
|
|
@@ -708,6 +713,7 @@ var TableElement = (props) => {
|
|
|
708
713
|
return {
|
|
709
714
|
onClick: () => {
|
|
710
715
|
setSelectedRecord(record);
|
|
716
|
+
handleChange(record);
|
|
711
717
|
setModel(true);
|
|
712
718
|
}
|
|
713
719
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -567,7 +567,7 @@ import { Modal } from "antd";
|
|
|
567
567
|
// src/Components/ModelBody.tsx
|
|
568
568
|
import React18 from "react";
|
|
569
569
|
var ModelBody = (props) => {
|
|
570
|
-
return /* @__PURE__ */ React18.createElement("div", { className: props.modalContent.className }, props.modalContent && props.modalContent.fields.map((eachField) => {
|
|
570
|
+
return props.modelContent && /* @__PURE__ */ React18.createElement("div", { className: props.modalContent.className }, props.modalContent && props.modalContent.fields.map((eachField) => {
|
|
571
571
|
if (eachField.element === "div") {
|
|
572
572
|
return /* @__PURE__ */ React18.createElement("div", { className: eachField.className }, eachField.label);
|
|
573
573
|
} else if (eachField.element === "input-radio") {
|
|
@@ -604,7 +604,7 @@ var ModelElement = (props) => {
|
|
|
604
604
|
},
|
|
605
605
|
Object.entries(selectedRecord).map(([key, value]) => {
|
|
606
606
|
const record = columns.filter((eachColumn) => eachColumn.key === key);
|
|
607
|
-
return /* @__PURE__ */ React19.createElement("p", { style: { fontWeight: "500", padding: "10px" }, key }, /* @__PURE__ */ React19.createElement("span", { style: { fontWeight: "200", color: "gray", paddingRight: "10px" } }, record[0].title), String(value));
|
|
607
|
+
return record.length > 0 ? /* @__PURE__ */ React19.createElement("p", { style: { fontWeight: "500", padding: "10px" }, key }, /* @__PURE__ */ React19.createElement("span", { style: { fontWeight: "200", color: "gray", paddingRight: "10px" } }, record[0].title), String(value)) : "";
|
|
608
608
|
})
|
|
609
609
|
)
|
|
610
610
|
},
|
|
@@ -617,6 +617,11 @@ var TableElement = (props) => {
|
|
|
617
617
|
const { thead, tbody } = props;
|
|
618
618
|
const [selectedRecord, setSelectedRecord] = useState5({});
|
|
619
619
|
const [model, setModel] = useState5(false);
|
|
620
|
+
const handleChange = (record) => {
|
|
621
|
+
if (props.onChange) {
|
|
622
|
+
props.onChange(record);
|
|
623
|
+
}
|
|
624
|
+
};
|
|
620
625
|
let columns = [];
|
|
621
626
|
if (thead) {
|
|
622
627
|
columns = [
|
|
@@ -656,6 +661,7 @@ var TableElement = (props) => {
|
|
|
656
661
|
return {
|
|
657
662
|
onClick: () => {
|
|
658
663
|
setSelectedRecord(record);
|
|
664
|
+
handleChange(record);
|
|
659
665
|
setModel(true);
|
|
660
666
|
}
|
|
661
667
|
};
|