@apexcura/ui-components 0.0.11-Beta7 → 0.0.12-Beta0
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 +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -4
- package/dist/index.mjs +6 -4
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -363,9 +363,8 @@ var import_react13 = __toESM(require("react"));
|
|
|
363
363
|
var import_antd11 = require("antd");
|
|
364
364
|
var AddMoreTable = (props) => {
|
|
365
365
|
const { thead, tbody } = props;
|
|
366
|
-
console.log("-----------tbody", tbody);
|
|
367
|
-
console.log("..........thead", thead);
|
|
368
366
|
const [tableData, setTableData] = (0, import_react13.useState)({});
|
|
367
|
+
console.log("working");
|
|
369
368
|
const onHandleChange = (name, value) => {
|
|
370
369
|
setTableData((prev) => ({ ...prev, [name]: value }));
|
|
371
370
|
console.log(tableData);
|
|
@@ -376,7 +375,8 @@ var AddMoreTable = (props) => {
|
|
|
376
375
|
key: eachHeadEl.id
|
|
377
376
|
})) : [];
|
|
378
377
|
const renderInputElement = (element) => {
|
|
379
|
-
const { type, label } = element;
|
|
378
|
+
const { element: type, label } = element;
|
|
379
|
+
console.log("type....", type);
|
|
380
380
|
if (type === "single-select") {
|
|
381
381
|
return /* @__PURE__ */ import_react13.default.createElement(SingleSelectElement, { onChange: (value) => onHandleChange(label, value) });
|
|
382
382
|
} else if (type === "textarea") {
|
|
@@ -386,9 +386,10 @@ var AddMoreTable = (props) => {
|
|
|
386
386
|
}
|
|
387
387
|
};
|
|
388
388
|
const dataSource = tbody && tbody.length > 0 ? tbody.map((eachRow, index) => {
|
|
389
|
-
console.log("eachRow---------", eachRow);
|
|
390
389
|
const variableData = eachRow.variable_data.reduce((acc, curr) => {
|
|
390
|
+
console.log("curr", curr);
|
|
391
391
|
acc[curr.label] = renderInputElement(curr);
|
|
392
|
+
console.log("....acc", acc);
|
|
392
393
|
return acc;
|
|
393
394
|
}, {});
|
|
394
395
|
return {
|
|
@@ -397,6 +398,7 @@ var AddMoreTable = (props) => {
|
|
|
397
398
|
...variableData
|
|
398
399
|
};
|
|
399
400
|
}) : [];
|
|
401
|
+
console.log("dataSource.........", dataSource);
|
|
400
402
|
return /* @__PURE__ */ import_react13.default.createElement(import_react13.default.Fragment, null, /* @__PURE__ */ import_react13.default.createElement(
|
|
401
403
|
import_antd11.Table,
|
|
402
404
|
{
|
package/dist/index.mjs
CHANGED
|
@@ -316,9 +316,8 @@ import React12, { useState as useState3 } from "react";
|
|
|
316
316
|
import { Table } from "antd";
|
|
317
317
|
var AddMoreTable = (props) => {
|
|
318
318
|
const { thead, tbody } = props;
|
|
319
|
-
console.log("-----------tbody", tbody);
|
|
320
|
-
console.log("..........thead", thead);
|
|
321
319
|
const [tableData, setTableData] = useState3({});
|
|
320
|
+
console.log("working");
|
|
322
321
|
const onHandleChange = (name, value) => {
|
|
323
322
|
setTableData((prev) => ({ ...prev, [name]: value }));
|
|
324
323
|
console.log(tableData);
|
|
@@ -329,7 +328,8 @@ var AddMoreTable = (props) => {
|
|
|
329
328
|
key: eachHeadEl.id
|
|
330
329
|
})) : [];
|
|
331
330
|
const renderInputElement = (element) => {
|
|
332
|
-
const { type, label } = element;
|
|
331
|
+
const { element: type, label } = element;
|
|
332
|
+
console.log("type....", type);
|
|
333
333
|
if (type === "single-select") {
|
|
334
334
|
return /* @__PURE__ */ React12.createElement(SingleSelectElement, { onChange: (value) => onHandleChange(label, value) });
|
|
335
335
|
} else if (type === "textarea") {
|
|
@@ -339,9 +339,10 @@ var AddMoreTable = (props) => {
|
|
|
339
339
|
}
|
|
340
340
|
};
|
|
341
341
|
const dataSource = tbody && tbody.length > 0 ? tbody.map((eachRow, index) => {
|
|
342
|
-
console.log("eachRow---------", eachRow);
|
|
343
342
|
const variableData = eachRow.variable_data.reduce((acc, curr) => {
|
|
343
|
+
console.log("curr", curr);
|
|
344
344
|
acc[curr.label] = renderInputElement(curr);
|
|
345
|
+
console.log("....acc", acc);
|
|
345
346
|
return acc;
|
|
346
347
|
}, {});
|
|
347
348
|
return {
|
|
@@ -350,6 +351,7 @@ var AddMoreTable = (props) => {
|
|
|
350
351
|
...variableData
|
|
351
352
|
};
|
|
352
353
|
}) : [];
|
|
354
|
+
console.log("dataSource.........", dataSource);
|
|
353
355
|
return /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement(
|
|
354
356
|
Table,
|
|
355
357
|
{
|