@apexcura/ui-components 0.0.9-Beta9 → 0.0.11-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 +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +19 -23
- package/dist/index.mjs +19 -23
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -20,6 +20,8 @@ type ElementType = {
|
|
|
20
20
|
onChange?: (value: string | number | boolean | any[]) => void;
|
|
21
21
|
dropDownOptions?: any[];
|
|
22
22
|
id?: number;
|
|
23
|
+
thead?: any[];
|
|
24
|
+
tbody?: any[];
|
|
23
25
|
};
|
|
24
26
|
|
|
25
27
|
interface ElementExecuterProps$3 extends ElementType {
|
|
@@ -66,6 +68,6 @@ declare const MultipleSelectElement: (props: ElementType) => React$1.JSX.Element
|
|
|
66
68
|
|
|
67
69
|
declare const ButtonElement: () => React$1.JSX.Element;
|
|
68
70
|
|
|
69
|
-
declare const AddMoreTable: () => React$1.JSX.Element;
|
|
71
|
+
declare const AddMoreTable: (props: ElementType) => React$1.JSX.Element;
|
|
70
72
|
|
|
71
73
|
export { AddMoreTable, ButtonElement, CheckboxElement, CkEditor, MultipleSelectElement, NumberElement, PasswordElement, RadioElement, SelectElement, SingleSelectElement, TextElement, TextareaElement };
|
package/dist/index.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ type ElementType = {
|
|
|
20
20
|
onChange?: (value: string | number | boolean | any[]) => void;
|
|
21
21
|
dropDownOptions?: any[];
|
|
22
22
|
id?: number;
|
|
23
|
+
thead?: any[];
|
|
24
|
+
tbody?: any[];
|
|
23
25
|
};
|
|
24
26
|
|
|
25
27
|
interface ElementExecuterProps$3 extends ElementType {
|
|
@@ -66,6 +68,6 @@ declare const MultipleSelectElement: (props: ElementType) => React$1.JSX.Element
|
|
|
66
68
|
|
|
67
69
|
declare const ButtonElement: () => React$1.JSX.Element;
|
|
68
70
|
|
|
69
|
-
declare const AddMoreTable: () => React$1.JSX.Element;
|
|
71
|
+
declare const AddMoreTable: (props: ElementType) => React$1.JSX.Element;
|
|
70
72
|
|
|
71
73
|
export { AddMoreTable, ButtonElement, CheckboxElement, CkEditor, MultipleSelectElement, NumberElement, PasswordElement, RadioElement, SelectElement, SingleSelectElement, TextElement, TextareaElement };
|
package/dist/index.js
CHANGED
|
@@ -361,34 +361,30 @@ var ButtonElement = () => /* @__PURE__ */ import_react12.default.createElement(i
|
|
|
361
361
|
// src/Components/AddMoreTable.tsx
|
|
362
362
|
var import_react13 = __toESM(require("react"));
|
|
363
363
|
var import_antd11 = require("antd");
|
|
364
|
-
var AddMoreTable = () => {
|
|
365
|
-
const
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
key:
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
creator: "Jack",
|
|
383
|
-
createdAt: "2014-12-24 23:12:00"
|
|
384
|
-
});
|
|
385
|
-
}
|
|
364
|
+
var AddMoreTable = (props) => {
|
|
365
|
+
const { thead, tbody } = props;
|
|
366
|
+
const columns = thead && thead.length > 0 ? thead.map((eachHeadEl) => ({
|
|
367
|
+
title: eachHeadEl.label,
|
|
368
|
+
dataIndex: eachHeadEl.name,
|
|
369
|
+
key: eachHeadEl.id
|
|
370
|
+
})) : [];
|
|
371
|
+
const dataSource = tbody && tbody.length > 0 ? tbody.map((eachRow, index) => {
|
|
372
|
+
const variableData = eachRow.variable_data.reduce((acc, curr) => {
|
|
373
|
+
acc[curr.label] = curr.element;
|
|
374
|
+
return acc;
|
|
375
|
+
}, {});
|
|
376
|
+
return {
|
|
377
|
+
key: index.toString(),
|
|
378
|
+
...variableData,
|
|
379
|
+
...eachRow
|
|
380
|
+
};
|
|
381
|
+
}) : [];
|
|
386
382
|
return /* @__PURE__ */ import_react13.default.createElement(import_react13.default.Fragment, null, /* @__PURE__ */ import_react13.default.createElement(
|
|
387
383
|
import_antd11.Table,
|
|
388
384
|
{
|
|
389
385
|
columns,
|
|
390
386
|
expandable: { defaultExpandedRowKeys: ["0"] },
|
|
391
|
-
dataSource
|
|
387
|
+
dataSource
|
|
392
388
|
}
|
|
393
389
|
));
|
|
394
390
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -314,34 +314,30 @@ var ButtonElement = () => /* @__PURE__ */ React11.createElement(Flex2, { gap: "s
|
|
|
314
314
|
// src/Components/AddMoreTable.tsx
|
|
315
315
|
import React12 from "react";
|
|
316
316
|
import { Table } from "antd";
|
|
317
|
-
var AddMoreTable = () => {
|
|
318
|
-
const
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
key:
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
creator: "Jack",
|
|
336
|
-
createdAt: "2014-12-24 23:12:00"
|
|
337
|
-
});
|
|
338
|
-
}
|
|
317
|
+
var AddMoreTable = (props) => {
|
|
318
|
+
const { thead, tbody } = props;
|
|
319
|
+
const columns = thead && thead.length > 0 ? thead.map((eachHeadEl) => ({
|
|
320
|
+
title: eachHeadEl.label,
|
|
321
|
+
dataIndex: eachHeadEl.name,
|
|
322
|
+
key: eachHeadEl.id
|
|
323
|
+
})) : [];
|
|
324
|
+
const dataSource = tbody && tbody.length > 0 ? tbody.map((eachRow, index) => {
|
|
325
|
+
const variableData = eachRow.variable_data.reduce((acc, curr) => {
|
|
326
|
+
acc[curr.label] = curr.element;
|
|
327
|
+
return acc;
|
|
328
|
+
}, {});
|
|
329
|
+
return {
|
|
330
|
+
key: index.toString(),
|
|
331
|
+
...variableData,
|
|
332
|
+
...eachRow
|
|
333
|
+
};
|
|
334
|
+
}) : [];
|
|
339
335
|
return /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement(
|
|
340
336
|
Table,
|
|
341
337
|
{
|
|
342
338
|
columns,
|
|
343
339
|
expandable: { defaultExpandedRowKeys: ["0"] },
|
|
344
|
-
dataSource
|
|
340
|
+
dataSource
|
|
345
341
|
}
|
|
346
342
|
));
|
|
347
343
|
};
|