json-renderers-build 1.7.1 → 1.9.2

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.
Files changed (116) hide show
  1. package/README.md +8 -4
  2. package/docs/dist/min.js +541 -266
  3. package/docs/dist/v4/min.js +320 -320
  4. package/docs/dist/v5/min.js +312 -312
  5. package/docs/dist/v7/min.js +272 -0
  6. package/docs/dist/v8/min.js +268 -0
  7. package/docs/dist/v9/min.js +587 -0
  8. package/docs/index.html +2 -2
  9. package/package.json +1 -1
  10. package/src/index.js +2 -2
  11. package/src/v7/index.js +47 -47
  12. package/src/v7/select/index.js +20 -20
  13. package/src/v7/select/options/index.js +17 -17
  14. package/src/v7/select/options/skeleton.json +17 -17
  15. package/src/v7/table/body/cells/index.js +23 -23
  16. package/src/v7/table/body/cells/skeleton.json +17 -17
  17. package/src/v7/table/body/index.js +15 -15
  18. package/src/v7/table/body/rows/index.js +36 -36
  19. package/src/v7/table/body/rows/skeleton.json +4 -4
  20. package/src/v7/table/body/skeleton.json +4 -4
  21. package/src/v7/table/head/cells/index.js +23 -23
  22. package/src/v7/table/head/cells/skeleton.json +17 -17
  23. package/src/v7/table/head/index.js +15 -15
  24. package/src/v7/table/head/row/index.js +15 -15
  25. package/src/v7/table/head/row/skeleton.json +4 -4
  26. package/src/v7/table/head/skeleton.json +4 -4
  27. package/src/v7/table/index.js +26 -26
  28. package/src/v7/table/skeleton.json +6 -6
  29. package/src/v8/common/deriveColumnsFromData.js +20 -0
  30. package/src/v8/index.js +40 -0
  31. package/src/v8/meta.js +6 -0
  32. package/src/v8/registerGlobal.js +14 -0
  33. package/src/v8/select/index.js +21 -0
  34. package/src/v8/select/options/index.js +17 -0
  35. package/src/v8/select/options/skeleton.json +17 -0
  36. package/src/v8/select/skeleton.json +7 -0
  37. package/src/v8/table/body/cells/index.js +17 -0
  38. package/src/v8/table/body/cells/skeleton.json +17 -0
  39. package/src/v8/table/body/index.js +20 -0
  40. package/src/v8/table/body/rows/index.js +23 -0
  41. package/src/v8/table/body/rows/skeleton.json +4 -0
  42. package/src/v8/table/body/skeleton.json +4 -0
  43. package/src/v8/table/head/cells/index.js +17 -0
  44. package/src/v8/table/head/cells/skeleton.json +17 -0
  45. package/src/v8/table/head/index.js +15 -0
  46. package/src/v8/table/head/row/index.js +15 -0
  47. package/src/v8/table/head/row/skeleton.json +4 -0
  48. package/src/v8/table/head/skeleton.json +4 -0
  49. package/src/v8/table/index.js +26 -0
  50. package/src/v8/table/skeleton.json +7 -0
  51. package/src/v9/common/deriveColumnsFromData.js +20 -0
  52. package/src/v9/index.js +36 -0
  53. package/src/v9/meta.js +6 -0
  54. package/src/v9/registerGlobal.js +14 -0
  55. package/src/v9/select/index.js +21 -0
  56. package/src/v9/select/options/index.js +17 -0
  57. package/src/v9/select/options/skeleton.json +17 -0
  58. package/src/v9/select/skeleton.json +7 -0
  59. package/src/v9/table/footer/empty/cell/index.js +5 -0
  60. package/src/v9/table/footer/empty/cell/tag.json +6 -0
  61. package/src/v9/table/footer/empty/index.js +6 -0
  62. package/src/v9/table/footer/empty/row/index.js +10 -0
  63. package/src/v9/table/footer/empty/row/tag.json +7 -0
  64. package/src/v9/table/footer/index.js +28 -0
  65. package/src/v9/table/footer/inputs/cell/index.js +15 -0
  66. package/src/v9/table/footer/inputs/cell/tag.json +7 -0
  67. package/src/v9/table/footer/inputs/index.js +6 -0
  68. package/src/v9/table/footer/inputs/input/tag.json +9 -0
  69. package/src/v9/table/footer/inputs/row/index.js +10 -0
  70. package/src/v9/table/footer/inputs/row/tag.json +7 -0
  71. package/src/v9/table/footer/inputsWithSave/button/tag.json +8 -0
  72. package/src/v9/table/footer/inputsWithSave/cell/index.js +20 -0
  73. package/src/v9/table/footer/inputsWithSave/cell/tag.json +7 -0
  74. package/src/v9/table/footer/inputsWithSave/index.js +6 -0
  75. package/src/v9/table/footer/inputsWithSave/input/tag.json +9 -0
  76. package/src/v9/table/footer/inputsWithSave/row/index.js +13 -0
  77. package/src/v9/table/footer/inputsWithSave/row/tag.json +7 -0
  78. package/src/v9/table/footer/tag.json +7 -0
  79. package/src/v9/table/footer/totals/cell/index.js +21 -0
  80. package/src/v9/table/footer/totals/cell/tag.json +7 -0
  81. package/src/v9/table/footer/totals/index.js +6 -0
  82. package/src/v9/table/footer/totals/row/index.js +12 -0
  83. package/src/v9/table/footer/totals/row/tag.json +7 -0
  84. package/src/v9/table/index.js +33 -0
  85. package/src/v9/table/options/index.js +18 -0
  86. package/src/v9/table/options/showOptions/index.js +39 -0
  87. package/src/v9/table/options/showSerial/index.js +19 -0
  88. package/src/v9/table/render-requests.json +107 -0
  89. package/src/v9/table/table/body/cell/index.js +12 -0
  90. package/src/v9/table/table/body/cell/tag.json +7 -0
  91. package/src/v9/table/table/body/index.js +17 -0
  92. package/src/v9/table/table/body/row/index.js +18 -0
  93. package/src/v9/table/table/body/row/tag.json +4 -0
  94. package/src/v9/table/table/body/tag.json +4 -0
  95. package/src/v9/table/table/head/cell/index.js +12 -0
  96. package/src/v9/table/table/head/cell/tag.json +7 -0
  97. package/src/v9/table/table/head/index.js +16 -0
  98. package/src/v9/table/table/head/row/index.js +14 -0
  99. package/src/v9/table/table/head/row/tag.json +4 -0
  100. package/src/v9/table/table/head/tag.json +4 -0
  101. package/src/v9/table/table/index.js +36 -0
  102. package/src/v9/table/table/tag.json +7 -0
  103. package/src/v9/table_10oct/body/cells/index.js +17 -0
  104. package/src/v9/table_10oct/body/cells/skeleton.json +17 -0
  105. package/src/v9/table_10oct/body/index.js +20 -0
  106. package/src/v9/table_10oct/body/rows/index.js +23 -0
  107. package/src/v9/table_10oct/body/rows/skeleton.json +4 -0
  108. package/src/v9/table_10oct/body/skeleton.json +4 -0
  109. package/src/v9/table_10oct/head/cells/index.js +17 -0
  110. package/src/v9/table_10oct/head/cells/skeleton.json +17 -0
  111. package/src/v9/table_10oct/head/index.js +15 -0
  112. package/src/v9/table_10oct/head/row/index.js +15 -0
  113. package/src/v9/table_10oct/head/row/skeleton.json +4 -0
  114. package/src/v9/table_10oct/head/skeleton.json +4 -0
  115. package/src/v9/table_10oct/index.js +26 -0
  116. package/src/v9/table_10oct/skeleton.json +7 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "tagName": "td",
3
+ "attributes": {
4
+ "class": "align-middle py-2"
5
+ },
6
+ "textContent": ""
7
+ }
@@ -0,0 +1,6 @@
1
+ import renderRow from "./row/index.js";
2
+
3
+ const renderTotals = ({ inColumns = [], inData = [] } = {}) =>
4
+ renderRow({ inColumns, inData });
5
+
6
+ export default renderTotals;
@@ -0,0 +1,12 @@
1
+ import tagJson from "./tag.json" with { type: "json" };
2
+ import renderCell from "../cell/index.js";
3
+
4
+ const renderRow = ({ inColumns = [], inData = [] } = {}) => {
5
+ const row = structuredClone(tagJson);
6
+ row.children = inColumns.map((inColumn, inIndex) =>
7
+ renderCell({ inColumn, inIndex, inData })
8
+ );
9
+ return row;
10
+ };
11
+
12
+ export default renderRow;
@@ -0,0 +1,7 @@
1
+ {
2
+ "tagName": "tr",
3
+ "attributes": {
4
+ "class": "fw-semibold align-middle"
5
+ },
6
+ "children": []
7
+ }
@@ -0,0 +1,33 @@
1
+ import renderTable from "./table/index.js";
2
+
3
+ import applyOptions from "./options/index.js";
4
+ import renderRequests from "./render-requests.json" with { type: "json" };
5
+
6
+ const render = ({
7
+ type = "table",
8
+ inData,
9
+ inColumns,
10
+ footer = [],
11
+ options = {}
12
+ } = {}) => {
13
+ if (type === "table") {
14
+ const spec = renderTable({
15
+ inColumns,
16
+ inData,
17
+ inFooter: footer
18
+ });
19
+
20
+ return applyOptions(spec, options);
21
+ };
22
+
23
+ throw new Error(`Unknown table renderer type "${type}".`);
24
+ };
25
+
26
+ render.requests = renderRequests;
27
+
28
+ export {
29
+ render,
30
+ renderRequests
31
+ };
32
+
33
+ export default render;
@@ -0,0 +1,18 @@
1
+ import applyShowSerial from "./showSerial/index.js";
2
+ import applyShowOptions from "./showOptions/index.js";
3
+
4
+ const applyOptions = (inSpec, inOptions = {}) => {
5
+ // console.log("inOptions : ", inOptions);
6
+
7
+ if (inOptions.showSerial) {
8
+ applyShowSerial(inSpec);
9
+ }
10
+
11
+ if (inOptions.showOptions) {
12
+ applyShowOptions(inSpec, inOptions.showOptions);
13
+ }
14
+
15
+ return inSpec;
16
+ };
17
+
18
+ export default applyOptions;
@@ -0,0 +1,39 @@
1
+ const resolveButtons = (inShowOptions) => {
2
+ if (inShowOptions === true) {
3
+ return [{ label: "Apply", type: "button" }];
4
+ }
5
+
6
+ if (Array.isArray(inShowOptions)) {
7
+ return inShowOptions;
8
+ }
9
+
10
+ return [];
11
+ };
12
+
13
+ const applyShowOptions = (inSpec, inShowOptions) => {
14
+ const buttons = resolveButtons(inShowOptions);
15
+
16
+ if (buttons.length === 0) return;
17
+
18
+ const [thead, tbody] = inSpec.children;
19
+
20
+ // append <th>Actions</th> to head row
21
+ thead.children[0].children.push({
22
+ tagName: "th",
23
+ textContent: "Actions"
24
+ });
25
+
26
+ // append <td> with buttons to each body row
27
+ tbody.children.forEach(tr => {
28
+ tr.children.push({
29
+ tagName: "td",
30
+ children: buttons.map(btn => ({
31
+ tagName: "button",
32
+ attributes: { type: btn.type || "button" },
33
+ textContent: btn.label
34
+ }))
35
+ });
36
+ });
37
+ };
38
+
39
+ export default applyShowOptions;
@@ -0,0 +1,19 @@
1
+ const applyShowSerial = (inSpec) => {
2
+ const [thead, tbody] = inSpec.children;
3
+
4
+ // prepend <th>#</th> to head row
5
+ thead.children[0].children.unshift({
6
+ tagName: "th",
7
+ textContent: "#"
8
+ });
9
+
10
+ // prepend <td>{rowIndex}</td> to each body row
11
+ tbody.children.forEach((tr, index) => {
12
+ tr.children.unshift({
13
+ tagName: "td",
14
+ textContent: String(index + 1)
15
+ });
16
+ });
17
+ };
18
+
19
+ export default applyShowSerial;
@@ -0,0 +1,107 @@
1
+ {
2
+ "table": {
3
+ "type": "table",
4
+ "data": [
5
+ { "itemName": "0.09/30mm", "baseUnit": "kgs" }
6
+ ],
7
+ "columns": ["itemName", "baseUnit"],
8
+ "options": {}
9
+ },
10
+ "tableWithSerial": {
11
+ "type": "table",
12
+ "data": [
13
+ { "itemName": "0.09/30mm", "baseUnit": "kgs" }
14
+ ],
15
+ "columns": ["itemName", "baseUnit"],
16
+ "options": {
17
+ "showSerial": true
18
+ }
19
+ },
20
+ "tableWithDefaultAction": {
21
+ "type": "table",
22
+ "data": [
23
+ { "itemName": "0.09/30mm", "baseUnit": "kgs" }
24
+ ],
25
+ "columns": ["itemName", "baseUnit"],
26
+ "options": {
27
+ "showOptions": true
28
+ }
29
+ },
30
+ "tableWithCustomActions": {
31
+ "type": "table",
32
+ "data": [
33
+ { "itemName": "0.09/30mm", "baseUnit": "kgs" }
34
+ ],
35
+ "columns": ["itemName", "baseUnit"],
36
+ "options": {
37
+ "showOptions": [
38
+ { "label": "Show", "type": "button" },
39
+ { "label": "Edit", "type": "button" }
40
+ ]
41
+ }
42
+ },
43
+ "tableWithSerialAndActions": {
44
+ "type": "table",
45
+ "data": [
46
+ { "itemName": "0.09/30mm", "baseUnit": "kgs" }
47
+ ],
48
+ "columns": ["itemName", "baseUnit"],
49
+ "options": {
50
+ "showSerial": true,
51
+ "showOptions": [
52
+ { "label": "Show", "type": "button" }
53
+ ]
54
+ }
55
+ },
56
+ "tableWithFooter": {
57
+ "type": "table",
58
+ "data": [
59
+ { "itemName": "0.09/30mm", "baseUnit": "kgs" }
60
+ ],
61
+ "columns": ["itemName", "baseUnit"],
62
+ "footer": ["inputs"],
63
+ "options": {}
64
+ },
65
+ "tableWithFooterSave": {
66
+ "type": "table",
67
+ "data": [
68
+ { "itemName": "0.09/30mm", "baseUnit": "kgs" }
69
+ ],
70
+ "columns": ["itemName", "baseUnit"],
71
+ "footer": ["inputsWithSave"],
72
+ "options": {}
73
+ },
74
+ "tableWithTotals": {
75
+ "type": "table",
76
+ "data": [
77
+ { "itemName": "0.09/30mm", "baseUnit": "2" },
78
+ { "itemName": "0.11-25", "baseUnit": "3" }
79
+ ],
80
+ "columns": ["itemName", "baseUnit"],
81
+ "footer": ["totals"],
82
+ "options": {}
83
+ },
84
+ "tableWithMultipleFooters": {
85
+ "type": "table",
86
+ "data": [
87
+ { "itemName": "0.09/30mm", "baseUnit": "2" }
88
+ ],
89
+ "columns": ["itemName", "baseUnit"],
90
+ "footer": ["inputs", "totals", "inputsWithSave", "empty"],
91
+ "options": {}
92
+ },
93
+ "tableHead": {
94
+ "type": "tableHead",
95
+ "data": [],
96
+ "columns": ["itemName", "baseUnit"],
97
+ "options": {}
98
+ },
99
+ "tableBody": {
100
+ "type": "tableBody",
101
+ "data": [
102
+ { "itemName": "0.09/30mm", "baseUnit": "kgs" }
103
+ ],
104
+ "columns": ["itemName", "baseUnit"],
105
+ "options": {}
106
+ }
107
+ }
@@ -0,0 +1,12 @@
1
+ import tagJson from "./tag.json" with { type: "json" };
2
+
3
+ const buildBodyCell = ({ inValue } = {}) => {
4
+ const td = structuredClone(tagJson);
5
+
6
+ td.attributes.value = inValue;
7
+ td.textContent = inValue;
8
+
9
+ return td;
10
+ };
11
+
12
+ export default buildBodyCell;
@@ -0,0 +1,7 @@
1
+ {
2
+ "tagName": "td",
3
+ "attributes": {
4
+ "value": ""
5
+ },
6
+ "textContent": ""
7
+ }
@@ -0,0 +1,17 @@
1
+ import tagJson from "./tag.json" with { type: "json" };
2
+ import buildBodyRow from "./row/index.js";
3
+
4
+ const renderTableBody = ({ inData = [], inColumns = [] } = {}) => {
5
+ const tbody = structuredClone(tagJson);
6
+
7
+ const children = inData.map(row => buildBodyRow({
8
+ inRow: row,
9
+ inColumns
10
+ }));
11
+
12
+ tbody.children = children;
13
+
14
+ return tbody;
15
+ };
16
+
17
+ export default renderTableBody;
@@ -0,0 +1,18 @@
1
+ import tagJson from "./tag.json" with { type: "json" };
2
+ import buildBodyCell from "../cell/index.js";
3
+
4
+ const buildBodyRow = ({ inRow, inColumns = [] } = {}) => {
5
+ const tr = structuredClone(tagJson);
6
+
7
+ const children = inColumns.map(column => {
8
+ const value = Array.isArray(inRow) ? inRow[column] : inRow?.[column];
9
+
10
+ return buildBodyCell({ inValue: value });
11
+ });
12
+
13
+ tr.children = children;
14
+
15
+ return tr;
16
+ };
17
+
18
+ export default buildBodyRow;
@@ -0,0 +1,4 @@
1
+ {
2
+ "tagName": "tr",
3
+ "children": []
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "tagName": "tbody",
3
+ "children": []
4
+ }
@@ -0,0 +1,12 @@
1
+ import tagJson from "./tag.json" with { type: "json" };
2
+
3
+ const buildHeadCell = ({ inColumn } = {}) => {
4
+ const th = structuredClone(tagJson);
5
+
6
+ th.attributes.value = inColumn;
7
+ th.textContent = inColumn;
8
+
9
+ return th;
10
+ };
11
+
12
+ export default buildHeadCell;
@@ -0,0 +1,7 @@
1
+ {
2
+ "tagName": "th",
3
+ "attributes": {
4
+ "value": ""
5
+ },
6
+ "textContent": ""
7
+ }
@@ -0,0 +1,16 @@
1
+ import tagJson from "./tag.json" with { type: "json" };
2
+ import buildHeadRow from "./row/index.js";
3
+
4
+ const renderTableHead = ({ inColumns = [] } = {}) => {
5
+ const thead = structuredClone(tagJson);
6
+
7
+ const children = [
8
+ buildHeadRow({ inColumns })
9
+ ];
10
+
11
+ thead.children = children;
12
+
13
+ return thead;
14
+ };
15
+
16
+ export default renderTableHead;
@@ -0,0 +1,14 @@
1
+ import tagJson from "./tag.json" with { type: "json" };
2
+ import buildHeadCell from "../cell/index.js";
3
+
4
+ const buildHeadRow = ({ inColumns = [] } = {}) => {
5
+ const tr = structuredClone(tagJson);
6
+
7
+ const children = inColumns.map(column => buildHeadCell({ inColumn: column }));
8
+
9
+ tr.children = children;
10
+
11
+ return tr;
12
+ };
13
+
14
+ export default buildHeadRow;
@@ -0,0 +1,4 @@
1
+ {
2
+ "tagName": "tr",
3
+ "children": []
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "tagName": "thead",
3
+ "children": []
4
+ }
@@ -0,0 +1,36 @@
1
+ import tagJson from "./tag.json" with { type: "json" };
2
+ import renderTableHead from "./head/index.js";
3
+ import renderTableBody from "./body/index.js";
4
+ import renderTableFooter from "../footer/index.js";
5
+
6
+ const renderTable = ({
7
+ inColumns = [],
8
+ inData = [],
9
+ inFooter = []
10
+ } = {}) => {
11
+ const table = structuredClone(tagJson);
12
+
13
+ const children = [
14
+ renderTableHead({ inColumns }),
15
+ renderTableBody({ inData, inColumns })
16
+ ];
17
+
18
+ if (!Array.isArray(inFooter)) {
19
+ throw new TypeError("The footer property must be an array of footer names.");
20
+ }
21
+
22
+ if (inFooter.length > 0) {
23
+ children.push(renderTableFooter({
24
+ inFooter,
25
+ inColumns,
26
+ inData
27
+ }));
28
+ }
29
+
30
+ table.children = children;
31
+
32
+ return table;
33
+ };
34
+
35
+ export { renderTableHead, renderTableBody };
36
+ export default renderTable;
@@ -0,0 +1,7 @@
1
+ {
2
+ "tagName": "table",
3
+ "attributes": {
4
+ "class": "table table-hover table-striped mb-0"
5
+ },
6
+ "children": []
7
+ }
@@ -0,0 +1,17 @@
1
+ import jsonTransform from "@keshavsoft/json-transformer";
2
+
3
+ import skeletonJson from './skeleton.json' with { type: 'json' };
4
+
5
+ const startFunc = ({
6
+ inData,
7
+ }) => {
8
+ const localData = inData;
9
+
10
+ let tdAsArray = jsonTransform({
11
+ children: localData
12
+ }, skeletonJson);
13
+
14
+ return tdAsArray?.children;
15
+ };
16
+
17
+ export default startFunc;
@@ -0,0 +1,17 @@
1
+ {
2
+ "transform": {
3
+ "children": ""
4
+ },
5
+ "operation": {
6
+ "children": {
7
+ "operationType": "loopArray",
8
+ "template": {
9
+ "tagName": "td",
10
+ "attributes": {
11
+ "value": "${}"
12
+ },
13
+ "textContent": "${}"
14
+ }
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,20 @@
1
+ import bodyRows from "./rows/index.js";
2
+ import skeletonJson from './skeleton.json' with { type: 'json' };
3
+
4
+ const startFunc = ({
5
+ inData,
6
+ inColumns
7
+ }) => {
8
+ const localData = inData;
9
+ const localColumns = inColumns;
10
+ const tbody = structuredClone(skeletonJson);
11
+
12
+ tbody.children = bodyRows({
13
+ inData: localData,
14
+ inColumns: localColumns
15
+ });
16
+
17
+ return tbody;
18
+ };
19
+
20
+ export default startFunc;
@@ -0,0 +1,23 @@
1
+ import bodyCells from "../cells/index.js";
2
+ import skeletonJson from './skeleton.json' with { type: 'json' };
3
+
4
+ const startFunc = ({
5
+ inData,
6
+ inColumns
7
+ }) => {
8
+ const localData = inData;
9
+ const localColumns = inColumns;
10
+
11
+ return localData.map(row => {
12
+ const cellValues = Array.isArray(row)
13
+ ? row
14
+ : localColumns.map(col => row[col]);
15
+
16
+ const tr = structuredClone(skeletonJson);
17
+ tr.children = bodyCells({ inData: cellValues });
18
+
19
+ return tr;
20
+ });
21
+ };
22
+
23
+ export default startFunc;
@@ -0,0 +1,4 @@
1
+ {
2
+ "tagName": "tr",
3
+ "children": []
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "tagName": "tbody",
3
+ "children": []
4
+ }
@@ -0,0 +1,17 @@
1
+ import jsonTransform from "@keshavsoft/json-transformer";
2
+
3
+ import skeletonJson from './skeleton.json' with { type: 'json' };
4
+
5
+ const startFunc = ({
6
+ inData,
7
+ }) => {
8
+ const localData = inData;
9
+
10
+ let thAsArray = jsonTransform({
11
+ children: localData
12
+ }, skeletonJson);
13
+
14
+ return thAsArray?.children;
15
+ };
16
+
17
+ export default startFunc;
@@ -0,0 +1,17 @@
1
+ {
2
+ "transform": {
3
+ "children": ""
4
+ },
5
+ "operation": {
6
+ "children": {
7
+ "operationType": "loopArray",
8
+ "template": {
9
+ "tagName": "th",
10
+ "attributes": {
11
+ "value": "${}"
12
+ },
13
+ "textContent": "${}"
14
+ }
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,15 @@
1
+ import headRow from "./row/index.js";
2
+ import skeletonJson from './skeleton.json' with { type: 'json' };
3
+
4
+ const startFunc = ({
5
+ inData,
6
+ }) => {
7
+ const localData = inData;
8
+ const thead = structuredClone(skeletonJson);
9
+
10
+ thead.children = [headRow({ inData: localData })];
11
+
12
+ return thead;
13
+ };
14
+
15
+ export default startFunc;
@@ -0,0 +1,15 @@
1
+ import headCells from "../cells/index.js";
2
+ import skeletonJson from './skeleton.json' with { type: 'json' };
3
+
4
+ const startFunc = ({
5
+ inData,
6
+ }) => {
7
+ const localData = inData;
8
+ const row = structuredClone(skeletonJson);
9
+
10
+ row.children = headCells({ inData: localData });
11
+
12
+ return row;
13
+ };
14
+
15
+ export default startFunc;
@@ -0,0 +1,4 @@
1
+ {
2
+ "tagName": "tr",
3
+ "children": []
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "tagName": "thead",
3
+ "children": []
4
+ }
@@ -0,0 +1,26 @@
1
+ import renderTableHead from "./head/index.js";
2
+ import renderTableBody from "./body/index.js";
3
+ import skeletonJson from './skeleton.json' with { type: 'json' };
4
+
5
+ const startFunc = ({
6
+ inColumns,
7
+ inData
8
+ }) => {
9
+ const localColumns = inColumns;
10
+ const localData = inData;
11
+
12
+ const table = structuredClone(skeletonJson);
13
+
14
+ table.children = [
15
+ renderTableHead({ inData: localColumns }),
16
+ renderTableBody({ inData: localData, inColumns: localColumns })
17
+ ];
18
+
19
+ return table;
20
+ };
21
+
22
+ export {
23
+ renderTableHead,
24
+ renderTableBody
25
+ };
26
+ export default startFunc;
@@ -0,0 +1,7 @@
1
+ {
2
+ "tagName": "table",
3
+ "attributes": {
4
+ "class": "table table-hover table-striped mb-0"
5
+ },
6
+ "children": []
7
+ }