@apexcura/ui-components 0.0.11-Beta13 → 0.0.11-Beta3
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 +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +5 -26
- package/dist/index.mjs +6 -27
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -363,42 +363,21 @@ 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
|
-
const [tableData, setTableData] = (0, import_react13.useState)({});
|
|
367
|
-
console.log("working");
|
|
368
|
-
const onHandleChange = (name, value) => {
|
|
369
|
-
setTableData((prev) => ({ ...prev, [name]: value }));
|
|
370
|
-
console.log(tableData);
|
|
371
|
-
};
|
|
372
366
|
const columns = thead && thead.length > 0 ? thead.map((eachHeadEl) => ({
|
|
373
367
|
title: eachHeadEl.label,
|
|
374
368
|
dataIndex: eachHeadEl.name,
|
|
375
369
|
key: eachHeadEl.id
|
|
376
370
|
})) : [];
|
|
377
|
-
const renderInputElement = (element) => {
|
|
378
|
-
const { element: type, label } = element;
|
|
379
|
-
console.log("type....", type);
|
|
380
|
-
if (type === "single-select") {
|
|
381
|
-
return /* @__PURE__ */ import_react13.default.createElement(SingleSelectElement, { onChange: (value) => onHandleChange(label, value) });
|
|
382
|
-
} else if (type === "textarea") {
|
|
383
|
-
return /* @__PURE__ */ import_react13.default.createElement(TextareaElement, { onChange: (value) => onHandleChange(label, value) });
|
|
384
|
-
} else {
|
|
385
|
-
return null;
|
|
386
|
-
}
|
|
387
|
-
};
|
|
388
371
|
const dataSource = tbody && tbody.length > 0 ? tbody.map((eachRow, index) => {
|
|
389
|
-
const variableData = eachRow.variable_data.reduce
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
console.log("....acc", acc);
|
|
393
|
-
return acc;
|
|
394
|
-
}, {});
|
|
372
|
+
const variableData = eachRow.variable_data.reduce;
|
|
373
|
+
console.log("eachRow---------", eachRow);
|
|
374
|
+
console.log("VariableData", { ...variableData });
|
|
395
375
|
return {
|
|
396
376
|
key: index.toString(),
|
|
397
|
-
...
|
|
398
|
-
...
|
|
377
|
+
...variableData,
|
|
378
|
+
...eachRow
|
|
399
379
|
};
|
|
400
380
|
}) : [];
|
|
401
|
-
console.log("dataSource.........", dataSource);
|
|
402
381
|
return /* @__PURE__ */ import_react13.default.createElement(import_react13.default.Fragment, null, /* @__PURE__ */ import_react13.default.createElement(
|
|
403
382
|
import_antd11.Table,
|
|
404
383
|
{
|
package/dist/index.mjs
CHANGED
|
@@ -312,46 +312,25 @@ import { Button as Button2, Flex as Flex2 } from "antd";
|
|
|
312
312
|
var ButtonElement = () => /* @__PURE__ */ React11.createElement(Flex2, { gap: "small" }, /* @__PURE__ */ React11.createElement(Button2, { type: "primary" }, "Primary Button"));
|
|
313
313
|
|
|
314
314
|
// src/Components/AddMoreTable.tsx
|
|
315
|
-
import React12
|
|
315
|
+
import React12 from "react";
|
|
316
316
|
import { Table } from "antd";
|
|
317
317
|
var AddMoreTable = (props) => {
|
|
318
318
|
const { thead, tbody } = props;
|
|
319
|
-
const [tableData, setTableData] = useState3({});
|
|
320
|
-
console.log("working");
|
|
321
|
-
const onHandleChange = (name, value) => {
|
|
322
|
-
setTableData((prev) => ({ ...prev, [name]: value }));
|
|
323
|
-
console.log(tableData);
|
|
324
|
-
};
|
|
325
319
|
const columns = thead && thead.length > 0 ? thead.map((eachHeadEl) => ({
|
|
326
320
|
title: eachHeadEl.label,
|
|
327
321
|
dataIndex: eachHeadEl.name,
|
|
328
322
|
key: eachHeadEl.id
|
|
329
323
|
})) : [];
|
|
330
|
-
const renderInputElement = (element) => {
|
|
331
|
-
const { element: type, label } = element;
|
|
332
|
-
console.log("type....", type);
|
|
333
|
-
if (type === "single-select") {
|
|
334
|
-
return /* @__PURE__ */ React12.createElement(SingleSelectElement, { onChange: (value) => onHandleChange(label, value) });
|
|
335
|
-
} else if (type === "textarea") {
|
|
336
|
-
return /* @__PURE__ */ React12.createElement(TextareaElement, { onChange: (value) => onHandleChange(label, value) });
|
|
337
|
-
} else {
|
|
338
|
-
return null;
|
|
339
|
-
}
|
|
340
|
-
};
|
|
341
324
|
const dataSource = tbody && tbody.length > 0 ? tbody.map((eachRow, index) => {
|
|
342
|
-
const variableData = eachRow.variable_data.reduce
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
console.log("....acc", acc);
|
|
346
|
-
return acc;
|
|
347
|
-
}, {});
|
|
325
|
+
const variableData = eachRow.variable_data.reduce;
|
|
326
|
+
console.log("eachRow---------", eachRow);
|
|
327
|
+
console.log("VariableData", { ...variableData });
|
|
348
328
|
return {
|
|
349
329
|
key: index.toString(),
|
|
350
|
-
...
|
|
351
|
-
...
|
|
330
|
+
...variableData,
|
|
331
|
+
...eachRow
|
|
352
332
|
};
|
|
353
333
|
}) : [];
|
|
354
|
-
console.log("dataSource.........", dataSource);
|
|
355
334
|
return /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement(
|
|
356
335
|
Table,
|
|
357
336
|
{
|