@zohodesk/components 1.0.0-temp-235 → 1.0.0-temp-238

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 (31) hide show
  1. package/README.md +23 -0
  2. package/es/TextBox/TextBox.js +4 -4
  3. package/es/Typography/Typography.js +2 -9
  4. package/es/Typography/props/defaultProps.js +1 -2
  5. package/es/Typography/props/propTypes.js +1 -26
  6. package/es/common/common.module.css +7 -0
  7. package/es/v1/Switch/css/Switch_v1.module.css +7 -1
  8. package/lib/TextBox/TextBox.js +4 -4
  9. package/lib/Typography/Typography.js +2 -9
  10. package/lib/Typography/props/defaultProps.js +1 -2
  11. package/lib/Typography/props/propTypes.js +1 -31
  12. package/lib/common/common.module.css +7 -0
  13. package/lib/v1/Switch/css/Switch_v1.module.css +7 -1
  14. package/package.json +6 -5
  15. package/.cli/MissedPropType_Keys.html +0 -101
  16. package/.cli/PropLessFiles.html +0 -101
  17. package/.cli/PropUnificationExcludeFilesArray.js +0 -231
  18. package/.cli/PropValidationExcludeFilesArray.js +0 -1
  19. package/.cli/ThemeValidationExcludeFiles.js +0 -1
  20. package/.cli/UnValidatedFiles.html +0 -101
  21. package/.cli/config/variables/variableMapping.json +0 -13
  22. package/.cli/propValidation_report.html +0 -182
  23. package/.cli/themeValidate/stringContains.js +0 -1
  24. package/PropValidationExcludeFilesArray.js +0 -1
  25. package/es/Typography/__tests__/Typography.spec.js +0 -334
  26. package/es/Typography/__tests__/__snapshots__/Typography.spec.js.snap +0 -451
  27. package/es/Typography/highlight.js +0 -144
  28. package/lib/Typography/__tests__/Typography.spec.js +0 -342
  29. package/lib/Typography/__tests__/__snapshots__/Typography.spec.js.snap +0 -451
  30. package/lib/Typography/highlight.js +0 -151
  31. package/propValidationArg.json +0 -12
package/README.md CHANGED
@@ -2,6 +2,29 @@
2
2
 
3
3
  Dot UI is a customizable React component library built to deliver a clean, accessible, and developer-friendly UI experience. It offers a growing set of reusable components designed to align with modern design systems and streamline application development across projects.
4
4
 
5
+ # 1.4.17
6
+
7
+ - `Switch_v1 css` - RTL issue on thumb position fixed.
8
+
9
+ # 1.4.15 , 1.4.16
10
+
11
+ - `Common Css`
12
+ - added ltr class renamed to ltr-zone.
13
+
14
+
15
+ # 1.4.13
16
+
17
+ - `Common Css`
18
+ - added ltr-dir class for change direction to ltr in rtl mode.
19
+
20
+
21
+ # 1.4.12
22
+
23
+ - `TextBox`
24
+ - The event is passed as the 4th argument to both handleBlur and handleFocus
25
+ - `Common Css`
26
+ - added ltr class for change direction to ltr in rtl mode.
27
+
5
28
  # 1.4.11
6
29
 
7
30
  - `@zohodesk/virtualizer` version updated from **1.0.3** to **1.0.13**
@@ -15,24 +15,24 @@ export default class TextBox extends React.PureComponent {
15
15
  this.handlePreventTextBoxScroll = this.handlePreventTextBoxScroll.bind(this);
16
16
  }
17
17
 
18
- handleFocus() {
18
+ handleFocus(e) {
19
19
  let {
20
20
  id,
21
21
  value,
22
22
  name,
23
23
  onFocus
24
24
  } = this.props;
25
- onFocus && onFocus(id, value, name);
25
+ onFocus && onFocus(id, value, name, e);
26
26
  }
27
27
 
28
- handleBlur() {
28
+ handleBlur(e) {
29
29
  let {
30
30
  id,
31
31
  value,
32
32
  name,
33
33
  onBlur
34
34
  } = this.props;
35
- onBlur && onBlur(id, value, name);
35
+ onBlur && onBlur(id, value, name, e);
36
36
  }
37
37
 
38
38
  inputRef(ref) {
@@ -3,7 +3,6 @@ import { defaultProps } from "./props/defaultProps";
3
3
  import { propTypes } from "./props/propTypes";
4
4
  import cssJSLogic from "./css/cssJSLogic";
5
5
  import { mergeStyle } from '@zohodesk/utils';
6
- import { highlight } from "./highlight";
7
6
  import defaultStyle from "./css/Typography.module.css";
8
7
 
9
8
  const Typography = props => {
@@ -15,12 +14,8 @@ const Typography = props => {
15
14
  customId,
16
15
  $tagAttributes_text,
17
16
  $a11yAttributes_text,
18
- customStyle,
19
- highlights
17
+ customStyle
20
18
  } = props;
21
- const {
22
- highlightData = []
23
- } = highlights;
24
19
  const style = mergeStyle(defaultStyle, customStyle);
25
20
  const {
26
21
  typographyClass
@@ -35,9 +30,7 @@ const Typography = props => {
35
30
  'data-test-id': testId,
36
31
  ...$tagAttributes_text,
37
32
  ...$a11yAttributes_text
38
- }, highlightData.length > 0 && typeof children === 'string' ? highlight({ ...highlights,
39
- text: children
40
- }) : children);
33
+ }, children);
41
34
  };
42
35
 
43
36
  Typography.propTypes = propTypes;
@@ -4,6 +4,5 @@ export const defaultProps = {
4
4
  $flag_reset: false,
5
5
  $flag_dotted: false,
6
6
  $tagAttributes_text: {},
7
- $a11yAttributes_text: {},
8
- highlights: {}
7
+ $a11yAttributes_text: {}
9
8
  };
@@ -1,20 +1,4 @@
1
1
  import PropTypes from 'prop-types';
2
- const highlightsStyleShape = PropTypes.shape({
3
- weight: PropTypes.oneOf(['regular', 'light', 'semibold', 'bold']),
4
- transform: PropTypes.oneOf(['default', 'upper', 'lower', 'capital']),
5
- decoration: PropTypes.oneOf(['default', 'underline', 'strike', 'overline']),
6
- typeFace: PropTypes.oneOf(['normal', 'italic']),
7
- customClass: PropTypes.object
8
- });
9
- const commonHighlightProps = {
10
- customStyle: PropTypes.object,
11
- isExcludedIndex: PropTypes.bool,
12
- isCaseSensitive: PropTypes.bool,
13
- isWholeWord: PropTypes.bool,
14
- tagName: PropTypes.string,
15
- render: PropTypes.element,
16
- highlightsStyle: PropTypes.objectOf(highlightsStyleShape)
17
- };
18
2
  export const propTypes = {
19
3
  children: PropTypes.node,
20
4
  $ui_className: PropTypes.string,
@@ -39,14 +23,5 @@ export const propTypes = {
39
23
  customId: PropTypes.string,
40
24
  customStyle: PropTypes.object,
41
25
  $a11yAttributes_text: PropTypes.object,
42
- $tagAttributes_text: PropTypes.object,
43
- highlights: PropTypes.objectOf(PropTypes.shape({
44
- text: PropTypes.string,
45
- highlightData: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.shape({
46
- highlightText: PropTypes.string,
47
- index: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number]),
48
- ...commonHighlightProps
49
- })])),
50
- ...commonHighlightProps
51
- }))
26
+ $tagAttributes_text: PropTypes.object
52
27
  };
@@ -556,4 +556,11 @@
556
556
 
557
557
  .whiteSpace_breakSpaces {
558
558
  white-space: break-spaces
559
+ }
560
+
561
+ /*This Lines added to handle mobile number with mixed symbols in rtl case ex : (050)991-881*/
562
+ [dir=rtl] .ltr-zone input, [dir=rtl] .ltr-dir {
563
+ direction: ltr;
564
+ /* unicode-bidi: bidi-override; */
565
+ text-align: end;
559
566
  }
@@ -126,7 +126,13 @@
126
126
  }
127
127
  .checked {
128
128
  --local-switch-track-background-color: var(--zdt_v1_switch_track_on_bg);
129
- --local-switch-thumb-translateX: calc(var(--local-switch-track-width) - var(--local-switch-thumb-size) - 2px)
129
+ }
130
+ [dir=ltr] .checked {
131
+ --local-switch-thumb-translateX: calc(var(--local-switch-track-width) - var(--local-switch-thumb-size) - 2px)
132
+ /*rtl: calc(-1 * (var(--local-switch-track-width) - var(--local-switch-thumb-size) - 2px))*/;
133
+ }
134
+ [dir=rtl] .checked {
135
+ --local-switch-thumb-translateX: calc(-1 * (var(--local-switch-track-width) - var(--local-switch-thumb-size) - 2px));
130
136
  }
131
137
  .unChecked {
132
138
  --local-switch-track-background-color: var(--zdt_v1_switch_track_off_bg);
@@ -61,23 +61,23 @@ var TextBox = /*#__PURE__*/function (_React$PureComponent) {
61
61
 
62
62
  _createClass(TextBox, [{
63
63
  key: "handleFocus",
64
- value: function handleFocus() {
64
+ value: function handleFocus(e) {
65
65
  var _this$props = this.props,
66
66
  id = _this$props.id,
67
67
  value = _this$props.value,
68
68
  name = _this$props.name,
69
69
  onFocus = _this$props.onFocus;
70
- onFocus && onFocus(id, value, name);
70
+ onFocus && onFocus(id, value, name, e);
71
71
  }
72
72
  }, {
73
73
  key: "handleBlur",
74
- value: function handleBlur() {
74
+ value: function handleBlur(e) {
75
75
  var _this$props2 = this.props,
76
76
  id = _this$props2.id,
77
77
  value = _this$props2.value,
78
78
  name = _this$props2.name,
79
79
  onBlur = _this$props2.onBlur;
80
- onBlur && onBlur(id, value, name);
80
+ onBlur && onBlur(id, value, name, e);
81
81
  }
82
82
  }, {
83
83
  key: "inputRef",
@@ -15,8 +15,6 @@ var _cssJSLogic2 = _interopRequireDefault(require("./css/cssJSLogic"));
15
15
 
16
16
  var _utils = require("@zohodesk/utils");
17
17
 
18
- var _highlight = require("./highlight");
19
-
20
18
  var _TypographyModule = _interopRequireDefault(require("./css/Typography.module.css"));
21
19
 
22
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -35,10 +33,7 @@ var Typography = function Typography(props) {
35
33
  customId = props.customId,
36
34
  $tagAttributes_text = props.$tagAttributes_text,
37
35
  $a11yAttributes_text = props.$a11yAttributes_text,
38
- customStyle = props.customStyle,
39
- highlights = props.highlights;
40
- var _highlights$highlight = highlights.highlightData,
41
- highlightData = _highlights$highlight === void 0 ? [] : _highlights$highlight;
36
+ customStyle = props.customStyle;
42
37
  var style = (0, _utils.mergeStyle)(_TypographyModule["default"], customStyle);
43
38
 
44
39
  var _cssJSLogic = (0, _cssJSLogic2["default"])({
@@ -52,9 +47,7 @@ var Typography = function Typography(props) {
52
47
  'data-title': $i18n_dataTitle,
53
48
  'data-id': customId,
54
49
  'data-test-id': testId
55
- }, $tagAttributes_text), $a11yAttributes_text), highlightData.length > 0 && typeof children === 'string' ? (0, _highlight.highlight)(_objectSpread(_objectSpread({}, highlights), {}, {
56
- text: children
57
- })) : children);
50
+ }, $tagAttributes_text), $a11yAttributes_text), children);
58
51
  };
59
52
 
60
53
  Typography.propTypes = _propTypes.propTypes;
@@ -10,7 +10,6 @@ var defaultProps = {
10
10
  $flag_reset: false,
11
11
  $flag_dotted: false,
12
12
  $tagAttributes_text: {},
13
- $a11yAttributes_text: {},
14
- highlights: {}
13
+ $a11yAttributes_text: {}
15
14
  };
16
15
  exports.defaultProps = defaultProps;
@@ -9,29 +9,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
 
10
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
11
 
12
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
13
-
14
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
15
-
16
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
17
-
18
- var highlightsStyleShape = _propTypes["default"].shape({
19
- weight: _propTypes["default"].oneOf(['regular', 'light', 'semibold', 'bold']),
20
- transform: _propTypes["default"].oneOf(['default', 'upper', 'lower', 'capital']),
21
- decoration: _propTypes["default"].oneOf(['default', 'underline', 'strike', 'overline']),
22
- typeFace: _propTypes["default"].oneOf(['normal', 'italic']),
23
- customClass: _propTypes["default"].object
24
- });
25
-
26
- var commonHighlightProps = {
27
- customStyle: _propTypes["default"].object,
28
- isExcludedIndex: _propTypes["default"].bool,
29
- isCaseSensitive: _propTypes["default"].bool,
30
- isWholeWord: _propTypes["default"].bool,
31
- tagName: _propTypes["default"].string,
32
- render: _propTypes["default"].element,
33
- highlightsStyle: _propTypes["default"].objectOf(highlightsStyleShape)
34
- };
35
12
  var propTypes = {
36
13
  children: _propTypes["default"].node,
37
14
  $ui_className: _propTypes["default"].string,
@@ -56,13 +33,6 @@ var propTypes = {
56
33
  customId: _propTypes["default"].string,
57
34
  customStyle: _propTypes["default"].object,
58
35
  $a11yAttributes_text: _propTypes["default"].object,
59
- $tagAttributes_text: _propTypes["default"].object,
60
- highlights: _propTypes["default"].objectOf(_propTypes["default"].shape(_objectSpread({
61
- text: _propTypes["default"].string,
62
- highlightData: _propTypes["default"].arrayOf(_propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].shape(_objectSpread({
63
- highlightText: _propTypes["default"].string,
64
- index: _propTypes["default"].oneOfType([_propTypes["default"].arrayOf(_propTypes["default"].number), _propTypes["default"].number])
65
- }, commonHighlightProps))]))
66
- }, commonHighlightProps)))
36
+ $tagAttributes_text: _propTypes["default"].object
67
37
  };
68
38
  exports.propTypes = propTypes;
@@ -556,4 +556,11 @@
556
556
 
557
557
  .whiteSpace_breakSpaces {
558
558
  white-space: break-spaces
559
+ }
560
+
561
+ /*This Lines added to handle mobile number with mixed symbols in rtl case ex : (050)991-881*/
562
+ [dir=rtl] .ltr-zone input, [dir=rtl] .ltr-dir {
563
+ direction: ltr;
564
+ /* unicode-bidi: bidi-override; */
565
+ text-align: end;
559
566
  }
@@ -126,7 +126,13 @@
126
126
  }
127
127
  .checked {
128
128
  --local-switch-track-background-color: var(--zdt_v1_switch_track_on_bg);
129
- --local-switch-thumb-translateX: calc(var(--local-switch-track-width) - var(--local-switch-thumb-size) - 2px)
129
+ }
130
+ [dir=ltr] .checked {
131
+ --local-switch-thumb-translateX: calc(var(--local-switch-track-width) - var(--local-switch-thumb-size) - 2px)
132
+ /*rtl: calc(-1 * (var(--local-switch-track-width) - var(--local-switch-thumb-size) - 2px))*/;
133
+ }
134
+ [dir=rtl] .checked {
135
+ --local-switch-thumb-translateX: calc(-1 * (var(--local-switch-track-width) - var(--local-switch-thumb-size) - 2px));
130
136
  }
131
137
  .unChecked {
132
138
  --local-switch-track-background-color: var(--zdt_v1_switch_track_off_bg);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/components",
3
- "version": "1.0.0-temp-235",
3
+ "version": "1.0.0-temp-238",
4
4
  "main": "es/index.js",
5
5
  "module": "es/index.js",
6
6
  "private": false,
@@ -39,7 +39,7 @@
39
39
  "build:css:umd": "npm run clean && npm run init && react-cli build:css:umd",
40
40
  "coverage": "react-cli coverage",
41
41
  "prepare": "npm run init && npm run css:build ",
42
- "prepublishOnly": "node prePublish.js && npm run css:review",
42
+ "prepublishOnly": "node prePublish.js && npm run download_only",
43
43
  "postpublish": "node postPublish.js",
44
44
  "report": "react-cli publish:report",
45
45
  "test": "react-cli test",
@@ -48,7 +48,8 @@
48
48
  "snap-update": "npm run test-clean && npm run test -- -u",
49
49
  "sstest": "npm run init && react-cli sstest",
50
50
  "build:external": "npm run clean && npm run init && npm run docsjs:build && npm run build:externalDocCopy && react-cli build:component:umd && npm run externalDocHTMLChange",
51
- "download": "react-cli clean ./node_modules ./package-lock.json && npm install && cd ../ && npm run download",
51
+ "download": "npm run download_only && cd ../ && npm run download",
52
+ "download_only": "react-cli clean ./node_modules ./package-lock.json && npm install",
52
53
  "expublish": "npm publish --tag experimental-version",
53
54
  "css:lineheight:validate": "node ./node_modules/@zohodesk-private/node-plugins/es/lineheight_automation/lineHeightErrorCheck.js ./src/",
54
55
  "cssVariableConvert": "react-cli variableConverter ./lib ./lib && react-cli variableConverter ./es ./es",
@@ -77,7 +78,7 @@
77
78
  "@zohodesk-private/css-variable-migrator": "1.0.9",
78
79
  "@zohodesk-private/node-plugins": "1.1.13",
79
80
  "@zohodesk-private/react-prop-validator": "1.2.3",
80
- "@zohodesk/a11y": "2.3.7",
81
+ "@zohodesk/a11y": "2.3.8",
81
82
  "@zohodesk/docstool": "1.0.0-alpha-2",
82
83
  "@zohodesk/dotkit": "1.0.3",
83
84
  "@zohodesk/hooks": "2.0.5",
@@ -106,7 +107,7 @@
106
107
  "react-sortable-hoc": "^0.8.3",
107
108
  "@zohodesk/hooks": "2.0.5",
108
109
  "@zohodesk/utils": "1.3.14",
109
- "@zohodesk/a11y": "2.3.7",
110
+ "@zohodesk/a11y": "2.3.8",
110
111
  "@zohodesk/layout": "3.1.0",
111
112
  "@zohodesk/dotkit": "1.0.3"
112
113
  }
@@ -1,101 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
-
4
- <head>
5
- <link rel="preconnect" href="https://fonts.googleapis.com">
6
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
7
- <link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet">
8
-
9
- <title>Missed PropType Key</title>
10
- <style>
11
- body {
12
- margin: 0;
13
- padding: 0;
14
- font-family: 'Asap Condensed', sans-serif;
15
- }
16
-
17
- table {
18
- width: 100%;
19
- border-collapse: collapse;
20
- }
21
-
22
- th {
23
- position: sticky;
24
- top: 0;
25
- background-color: #001C30;
26
- color: #F5F5F5;
27
- }
28
-
29
- th,
30
- td {
31
- border: 1px solid black;
32
- padding: 8px;
33
- }
34
-
35
- tr:nth-child(even) {
36
- background-color: #EDEEF7;
37
- }
38
-
39
- .table-container {
40
- margin-bottom: 20px;
41
- }
42
- </style>
43
- </head>
44
-
45
- <body>
46
- <div id="table-container"></div>
47
- <script>
48
- const jsonData = {}
49
- const tableContainer = document.getElementById('table-container');
50
- const table = document.createElement('table');
51
- const thead = document.createElement('thead');
52
- const tbody = document.createElement('tbody');
53
-
54
- const headerRow = document.createElement('tr');
55
- const headers = ['No', 'Component', 'FilePath'];
56
- headers.forEach(header => {
57
- const th = document.createElement('th');
58
- th.textContent = header;
59
- headerRow.appendChild(th);
60
- });
61
- thead.appendChild(headerRow);
62
- table.appendChild(thead);
63
- var componentCount = 1;
64
- function generateRows(component, data, innerComponent = '') {
65
-
66
- const filePath = data.filePath ? data.filePath : '';
67
-
68
- const row = document.createElement('tr');
69
- const numbers = document.createElement('td');
70
- const componentCell = document.createElement('td');
71
- const filePathCell = document.createElement('td');
72
-
73
- numbers.textContent = componentCount;
74
- componentCell.textContent = component;
75
- filePathCell.textContent = filePath;
76
-
77
- row.appendChild(numbers);
78
- row.appendChild(componentCell);
79
- row.appendChild(filePathCell);
80
- tbody.appendChild(row);
81
-
82
- if (data.innerComponent) {
83
- Object.entries(data.innerComponent).forEach(([innerComp, innerData]) => {
84
- generateRows(innerComp, innerData, component);
85
- });
86
- }
87
- componentCount++;
88
- }
89
-
90
- Object.entries(jsonData).forEach(([component, data]) => {
91
- generateRows(component, data);
92
- });
93
-
94
- table.appendChild(tbody);
95
- tableContainer.appendChild(table);
96
-
97
- generateTable(jsonData);
98
- </script>
99
- </body>
100
-
101
- </html>
@@ -1,101 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
-
4
- <head>
5
- <link rel="preconnect" href="https://fonts.googleapis.com">
6
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
7
- <link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet">
8
-
9
- <title>Prop Less components</title>
10
- <style>
11
- body {
12
- margin: 0;
13
- padding: 0;
14
- font-family: 'Asap Condensed', sans-serif;
15
- }
16
-
17
- table {
18
- width: 100%;
19
- border-collapse: collapse;
20
- }
21
-
22
- th {
23
- position: sticky;
24
- top: 0;
25
- background-color: #001C30;
26
- color: #F5F5F5;
27
- }
28
-
29
- th,
30
- td {
31
- border: 1px solid black;
32
- padding: 8px;
33
- }
34
-
35
- tr:nth-child(even) {
36
- background-color: #EDEEF7;
37
- }
38
-
39
- .table-container {
40
- margin-bottom: 20px;
41
- }
42
- </style>
43
- </head>
44
-
45
- <body>
46
- <div id="table-container"></div>
47
- <script>
48
- const jsonData = {"Popup":{"filePath":"src/v1/Popup/Popup.js"},"LibraryContext":{"filePath":"src/Provider/LibraryContextInit.js"},"addGlobalId":{"filePath":"src/Provider/NumberGenerator/NumberGenerator.js"},"decreaseGlobalIds":{"filePath":"src/Provider/NumberGenerator/NumberGenerator.js"}}
49
- const tableContainer = document.getElementById('table-container');
50
- const table = document.createElement('table');
51
- const thead = document.createElement('thead');
52
- const tbody = document.createElement('tbody');
53
-
54
- const headerRow = document.createElement('tr');
55
- const headers = ['No', 'Component', 'FilePath'];
56
- headers.forEach(header => {
57
- const th = document.createElement('th');
58
- th.textContent = header;
59
- headerRow.appendChild(th);
60
- });
61
- thead.appendChild(headerRow);
62
- table.appendChild(thead);
63
- var componentCount = 1;
64
- function generateRows(component, data, innerComponent = '') {
65
-
66
- const filePath = data.filePath ? data.filePath : '';
67
-
68
- const row = document.createElement('tr');
69
- const numbers = document.createElement('td');
70
- const componentCell = document.createElement('td');
71
- const filePathCell = document.createElement('td');
72
-
73
- numbers.textContent = componentCount;
74
- componentCell.textContent = component;
75
- filePathCell.textContent = filePath;
76
-
77
- row.appendChild(numbers);
78
- row.appendChild(componentCell);
79
- row.appendChild(filePathCell);
80
- tbody.appendChild(row);
81
-
82
- if (data.innerComponent) {
83
- Object.entries(data.innerComponent).forEach(([innerComp, innerData]) => {
84
- generateRows(innerComp, innerData, component);
85
- });
86
- }
87
- componentCount++;
88
- }
89
-
90
- Object.entries(jsonData).forEach(([component, data]) => {
91
- generateRows(component, data);
92
- });
93
-
94
- table.appendChild(tbody);
95
- tableContainer.appendChild(table);
96
-
97
- generateTable(jsonData);
98
- </script>
99
- </body>
100
-
101
- </html>