@apexcura/ui-components 0.0.11-Beta12 → 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 -22
- package/dist/index.mjs +6 -23
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -363,41 +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
|
-
const onHandleChange = (name, value) => {
|
|
368
|
-
setTableData((prev) => ({ ...prev, [name]: value }));
|
|
369
|
-
console.log(tableData);
|
|
370
|
-
};
|
|
371
366
|
const columns = thead && thead.length > 0 ? thead.map((eachHeadEl) => ({
|
|
372
367
|
title: eachHeadEl.label,
|
|
373
368
|
dataIndex: eachHeadEl.name,
|
|
374
369
|
key: eachHeadEl.id
|
|
375
370
|
})) : [];
|
|
376
|
-
const renderInputElement = (element) => {
|
|
377
|
-
const { element: type, label } = element;
|
|
378
|
-
console.log("type....", type);
|
|
379
|
-
if (type === "single-select") {
|
|
380
|
-
return /* @__PURE__ */ import_react13.default.createElement(SingleSelectElement, { onChange: (value) => onHandleChange(label, value) });
|
|
381
|
-
} else if (type === "textarea") {
|
|
382
|
-
return /* @__PURE__ */ import_react13.default.createElement(TextareaElement, { onChange: (value) => onHandleChange(label, value) });
|
|
383
|
-
} else {
|
|
384
|
-
return null;
|
|
385
|
-
}
|
|
386
|
-
};
|
|
387
371
|
const dataSource = tbody && tbody.length > 0 ? tbody.map((eachRow, index) => {
|
|
388
372
|
const variableData = eachRow.variable_data.reduce((acc, curr) => {
|
|
389
|
-
|
|
390
|
-
acc[curr.label] = renderInputElement(curr);
|
|
391
|
-
console.log("....acc", acc);
|
|
373
|
+
acc[curr.label] = curr.element;
|
|
392
374
|
return acc;
|
|
393
375
|
}, {});
|
|
376
|
+
console.log("eachRow---------", eachRow);
|
|
377
|
+
console.log("VariableData", { ...variableData });
|
|
394
378
|
return {
|
|
395
379
|
key: index.toString(),
|
|
396
|
-
...
|
|
397
|
-
...
|
|
380
|
+
...variableData,
|
|
381
|
+
...eachRow
|
|
398
382
|
};
|
|
399
383
|
}) : [];
|
|
400
|
-
console.log("dataSource.........", dataSource);
|
|
401
384
|
return /* @__PURE__ */ import_react13.default.createElement(import_react13.default.Fragment, null, /* @__PURE__ */ import_react13.default.createElement(
|
|
402
385
|
import_antd11.Table,
|
|
403
386
|
{
|
package/dist/index.mjs
CHANGED
|
@@ -312,45 +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
|
-
const onHandleChange = (name, value) => {
|
|
321
|
-
setTableData((prev) => ({ ...prev, [name]: value }));
|
|
322
|
-
console.log(tableData);
|
|
323
|
-
};
|
|
324
319
|
const columns = thead && thead.length > 0 ? thead.map((eachHeadEl) => ({
|
|
325
320
|
title: eachHeadEl.label,
|
|
326
321
|
dataIndex: eachHeadEl.name,
|
|
327
322
|
key: eachHeadEl.id
|
|
328
323
|
})) : [];
|
|
329
|
-
const renderInputElement = (element) => {
|
|
330
|
-
const { element: type, label } = element;
|
|
331
|
-
console.log("type....", type);
|
|
332
|
-
if (type === "single-select") {
|
|
333
|
-
return /* @__PURE__ */ React12.createElement(SingleSelectElement, { onChange: (value) => onHandleChange(label, value) });
|
|
334
|
-
} else if (type === "textarea") {
|
|
335
|
-
return /* @__PURE__ */ React12.createElement(TextareaElement, { onChange: (value) => onHandleChange(label, value) });
|
|
336
|
-
} else {
|
|
337
|
-
return null;
|
|
338
|
-
}
|
|
339
|
-
};
|
|
340
324
|
const dataSource = tbody && tbody.length > 0 ? tbody.map((eachRow, index) => {
|
|
341
325
|
const variableData = eachRow.variable_data.reduce((acc, curr) => {
|
|
342
|
-
|
|
343
|
-
acc[curr.label] = renderInputElement(curr);
|
|
344
|
-
console.log("....acc", acc);
|
|
326
|
+
acc[curr.label] = curr.element;
|
|
345
327
|
return acc;
|
|
346
328
|
}, {});
|
|
329
|
+
console.log("eachRow---------", eachRow);
|
|
330
|
+
console.log("VariableData", { ...variableData });
|
|
347
331
|
return {
|
|
348
332
|
key: index.toString(),
|
|
349
|
-
...
|
|
350
|
-
...
|
|
333
|
+
...variableData,
|
|
334
|
+
...eachRow
|
|
351
335
|
};
|
|
352
336
|
}) : [];
|
|
353
|
-
console.log("dataSource.........", dataSource);
|
|
354
337
|
return /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement(
|
|
355
338
|
Table,
|
|
356
339
|
{
|