@apexcura/ui-components 0.0.11-Beta13 → 0.0.11-Beta2
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 -23
- package/dist/index.mjs +6 -24
- 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,24 @@ 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
372
|
const variableData = eachRow.variable_data.reduce((acc, curr) => {
|
|
390
|
-
|
|
391
|
-
acc[curr.label] = renderInputElement(curr);
|
|
392
|
-
console.log("....acc", acc);
|
|
373
|
+
acc[curr.label] = curr.element;
|
|
393
374
|
return acc;
|
|
394
375
|
}, {});
|
|
376
|
+
console.log("eachRow---------", eachRow);
|
|
377
|
+
console.log("VariableData", { ...variableData });
|
|
395
378
|
return {
|
|
396
379
|
key: index.toString(),
|
|
397
|
-
...
|
|
398
|
-
...
|
|
380
|
+
...variableData,
|
|
381
|
+
...eachRow
|
|
399
382
|
};
|
|
400
383
|
}) : [];
|
|
401
|
-
console.log("dataSource.........", dataSource);
|
|
402
384
|
return /* @__PURE__ */ import_react13.default.createElement(import_react13.default.Fragment, null, /* @__PURE__ */ import_react13.default.createElement(
|
|
403
385
|
import_antd11.Table,
|
|
404
386
|
{
|
package/dist/index.mjs
CHANGED
|
@@ -312,46 +312,28 @@ 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
325
|
const variableData = eachRow.variable_data.reduce((acc, curr) => {
|
|
343
|
-
|
|
344
|
-
acc[curr.label] = renderInputElement(curr);
|
|
345
|
-
console.log("....acc", acc);
|
|
326
|
+
acc[curr.label] = curr.element;
|
|
346
327
|
return acc;
|
|
347
328
|
}, {});
|
|
329
|
+
console.log("eachRow---------", eachRow);
|
|
330
|
+
console.log("VariableData", { ...variableData });
|
|
348
331
|
return {
|
|
349
332
|
key: index.toString(),
|
|
350
|
-
...
|
|
351
|
-
...
|
|
333
|
+
...variableData,
|
|
334
|
+
...eachRow
|
|
352
335
|
};
|
|
353
336
|
}) : [];
|
|
354
|
-
console.log("dataSource.........", dataSource);
|
|
355
337
|
return /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement(
|
|
356
338
|
Table,
|
|
357
339
|
{
|