@zohodesk/dot 1.7.21 → 1.7.23
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/README.md +10 -0
- package/assets/Appearance/dark/mode/Dot_DarkMode.module.css +7 -0
- package/assets/Appearance/light/mode/Dot_LightMode.module.css +7 -0
- package/assets/Appearance/pureDark/mode/Dot_PureDarkMode.module.css +7 -0
- package/es/AudioPlayer/AudioPlayer.js +580 -0
- package/es/AudioPlayer/AudioPlayer.module.css +146 -0
- package/es/AudioPlayer/Timer/Timer.js +67 -0
- package/es/AudioPlayer/Timer/Timer.module.css +5 -0
- package/es/AudioPlayer/Timer/__tests__/Timer.spec.js +20 -0
- package/es/AudioPlayer/Timer/__tests__/__snapshots__/Timer.spec.js.snap +14 -0
- package/es/AudioPlayer/Timer/propTypes/defaultProps.js +4 -0
- package/es/AudioPlayer/Timer/propTypes/propTypes.js +11 -0
- package/es/AudioPlayer/__tests__/AudioPlayer.spec.js +44 -0
- package/es/AudioPlayer/__tests__/__snapshots__/AudioPlayer.spec.js.snap +145 -0
- package/es/AudioPlayer/propTypes/defaultProps.js +14 -0
- package/es/AudioPlayer/propTypes/propTypes.js +33 -0
- package/es/AudioPlayer/utils/utils.js +24 -0
- package/es/Hooks/Dragger/useDragger.js +52 -33
- package/es/dot_layer.module.css +1 -0
- package/es/form/fields/ValidationMessage/ValidationMessage.module.css +1 -0
- package/es/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.module.css +1 -0
- package/lib/AudioPlayer/AudioPlayer.js +662 -0
- package/lib/AudioPlayer/AudioPlayer.module.css +146 -0
- package/lib/AudioPlayer/Timer/Timer.js +117 -0
- package/lib/AudioPlayer/Timer/Timer.module.css +5 -0
- package/lib/AudioPlayer/Timer/__tests__/Timer.spec.js +26 -0
- package/lib/AudioPlayer/Timer/__tests__/__snapshots__/Timer.spec.js.snap +14 -0
- package/lib/AudioPlayer/Timer/propTypes/defaultProps.js +11 -0
- package/lib/AudioPlayer/Timer/propTypes/propTypes.js +22 -0
- package/lib/AudioPlayer/__tests__/AudioPlayer.spec.js +50 -0
- package/lib/AudioPlayer/__tests__/__snapshots__/AudioPlayer.spec.js.snap +145 -0
- package/lib/AudioPlayer/propTypes/defaultProps.js +24 -0
- package/lib/AudioPlayer/propTypes/propTypes.js +44 -0
- package/lib/AudioPlayer/utils/utils.js +33 -0
- package/lib/Hooks/Dragger/useDragger.js +51 -28
- package/lib/dot_layer.module.css +1 -0
- package/lib/form/fields/ValidationMessage/ValidationMessage.module.css +1 -0
- package/lib/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.module.css +1 -0
- package/package.json +14 -6
- package/.cli/MissedPropType_Keys.html +0 -101
- package/.cli/PropLessFiles.html +0 -101
- package/.cli/PropUnificationExcludeFilesArray.js +0 -345
- package/.cli/PropValidationExcludeFilesArray.js +0 -8
- package/.cli/ThemeValidationExcludeFiles.js +0 -1
- package/.cli/UnValidatedFiles.html +0 -101
- package/.cli/propValidation_report.html +0 -182
- package/.cli/stringContains.js +0 -1
- package/css_error.log +0 -1
- package/images/audio_thumbnail.png +0 -0
- package/install.md +0 -12
- package/postPublish.js +0 -8
- package/prePublish.js +0 -70
- package/propValidationArg.json +0 -12
- package/react-cli.config.js +0 -27
- package/result.json +0 -1
- package/unittest/index.html +0 -37
|
@@ -36,6 +36,12 @@ function useDragger(_ref) {
|
|
|
36
36
|
y: 0
|
|
37
37
|
});
|
|
38
38
|
var draggable = (0, _react.useRef)(false);
|
|
39
|
+
var dragStarted = (0, _react.useRef)(false);
|
|
40
|
+
var initialMouse = (0, _react.useRef)({
|
|
41
|
+
x: 0,
|
|
42
|
+
y: 0
|
|
43
|
+
});
|
|
44
|
+
var DRAG_DISTANCE_THRESHOLD = 4;
|
|
39
45
|
(0, _react.useEffect)(function () {
|
|
40
46
|
if (isActive) {
|
|
41
47
|
parentEle.current = ChildRef.current.closest('[data-drag-parent=true]') || (0, _Config.getDotLibraryConfig)('draggerBoundary') || document.body;
|
|
@@ -62,46 +68,63 @@ function useDragger(_ref) {
|
|
|
62
68
|
e = e || window.event;
|
|
63
69
|
e.preventDefault();
|
|
64
70
|
|
|
65
|
-
if (draggable.current) {
|
|
66
|
-
|
|
67
|
-
|
|
71
|
+
if (!draggable.current) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (!dragStarted.current) {
|
|
76
|
+
var dx = Math.abs(e.clientX - initialMouse.current.x);
|
|
77
|
+
var dy = Math.abs(e.clientY - initialMouse.current.y);
|
|
68
78
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
79
|
+
if (dx < DRAG_DISTANCE_THRESHOLD && dy < DRAG_DISTANCE_THRESHOLD) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
72
82
|
|
|
73
|
-
draggableEle.current.
|
|
74
|
-
|
|
83
|
+
var draggableEleRect = draggableEle.current.getBoundingClientRect();
|
|
84
|
+
var parentEleRect = parentEle ? parentEle.current.getBoundingClientRect() : {
|
|
85
|
+
left: 0,
|
|
86
|
+
top: 0
|
|
87
|
+
};
|
|
88
|
+
offset.current.x = draggableEleRect.left - e.clientX;
|
|
89
|
+
offset.current.y = draggableEleRect.top - e.clientY;
|
|
90
|
+
var relativeRect = {
|
|
91
|
+
left: draggableEleRect.left - parentEleRect.left,
|
|
92
|
+
top: draggableEleRect.top - parentEleRect.top
|
|
93
|
+
};
|
|
94
|
+
var styleRef = draggableEle.current.style;
|
|
95
|
+
styleRef.top = "".concat(relativeRect.top, "px");
|
|
96
|
+
styleRef.left = "".concat(relativeRect.left, "px");
|
|
97
|
+
styleRef.width = "".concat(draggableEleRect.width, "px");
|
|
98
|
+
styleRef.position = "fixed";
|
|
99
|
+
styleRef.bottom = "initial";
|
|
100
|
+
styleRef.right = "initial";
|
|
101
|
+
dragStarted.current = true;
|
|
75
102
|
}
|
|
103
|
+
|
|
104
|
+
var left = offset.current.x + e.clientX;
|
|
105
|
+
var top = offset.current.y + e.clientY;
|
|
106
|
+
|
|
107
|
+
var _calculateDragPositio = calculateDragPosition(left, top),
|
|
108
|
+
x = _calculateDragPositio.x,
|
|
109
|
+
y = _calculateDragPositio.y;
|
|
110
|
+
|
|
111
|
+
draggableEle.current.style.left = "".concat(x, "px");
|
|
112
|
+
draggableEle.current.style.top = "".concat(y, "px");
|
|
76
113
|
}, [calculateDragPosition]);
|
|
77
114
|
var closeDragElement = (0, _react.useCallback)(function () {
|
|
78
115
|
document.removeEventListener('mouseup', closeDragElement);
|
|
79
116
|
document.removeEventListener('mousemove', elementDrag);
|
|
117
|
+
dragStarted.current = false;
|
|
118
|
+
draggable.current = false;
|
|
80
119
|
}, []);
|
|
81
120
|
var dragMouseDown = (0, _react.useCallback)(function (e) {
|
|
82
121
|
e = e || window.event; // e.preventDefault();
|
|
83
122
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
var parentEleRect = parentEle ? parentEle.current.getBoundingClientRect() : {
|
|
88
|
-
left: 0,
|
|
89
|
-
top: 0
|
|
90
|
-
};
|
|
91
|
-
var relativeRect = {
|
|
92
|
-
left: draggableEleRect.left - parentEleRect.left,
|
|
93
|
-
top: draggableEleRect.top - parentEleRect.top
|
|
123
|
+
initialMouse.current = {
|
|
124
|
+
x: e.clientX,
|
|
125
|
+
y: e.clientY
|
|
94
126
|
};
|
|
95
|
-
|
|
96
|
-
left = relativeRect.left;
|
|
97
|
-
style.top = "".concat(top, "px");
|
|
98
|
-
style.left = "".concat(left, "px");
|
|
99
|
-
style.width = "".concat(width, "px");
|
|
100
|
-
style.bottom = 'initial';
|
|
101
|
-
style.right = 'initial';
|
|
102
|
-
style.position = 'fixed';
|
|
103
|
-
offset.current.x = draggableEle.current.offsetLeft - e.clientX;
|
|
104
|
-
offset.current.y = draggableEle.current.offsetTop - e.clientY;
|
|
127
|
+
dragStarted.current = false;
|
|
105
128
|
draggable.current = true;
|
|
106
129
|
document.addEventListener('mouseup', closeDragElement);
|
|
107
130
|
document.addEventListener('mousemove', elementDrag);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer dot-core, dot-core.ActionButton, dot-core.AlphabeticList, dot-core.Attachment, dot-core.AttachmentViewer, dot-core.ChannelIcon, dot-core.Drawer, dot-core.ExternalLink, dot-core.FlipCard, dot-core.FormAction, dot-core.css, dot-core.IconButton, dot-core.Image, dot-core.ImportantNotes, dot-core.Link, dot-core.Loader, dot-core.Message, dot-core.MessageBanner, dot-core.NewStar, dot-core.PlusIcon, dot-core.Separator, dot-core.TagWithIcon, dot-core.ToastMessage, dot-core.Upload, dot-core.AlertHeader, dot-core.AlertLookup, dot-core.AvatarClose, dot-core.AvatarCollision, dot-core.AvatarIcon, dot-core.AvatarStatus, dot-core.AvatarThread, dot-core.AvatarUser, dot-core.AvatarWithTeam, dot-core.common, dot-core.FreezeLayer, dot-core.SelectDropdown, dot-core.ToggleDropDown, dot-core.CommonEmptyState, dot-core.EditionPage, dot-core.errorstate, dot-core.Inconvenience, dot-core.LinkText, dot-core.NoRequestFound, dot-core.PermissionPlay, dot-core.RequestUrlNotFound, dot-core.UnableToProcess, dot-core.UnauthorizedLogin, dot-core.WillBack, dot-core.fields, dot-core.TagsMultiSelect, dot-core.TagsMultiSelectField, dot-core.TextEditor, dot-core.TextEditorWrapper, dot-core.ValidationMessage, dot-core.Field, dot-core.Section, dot-core.SetupDetailLayout, dot-core.SubtabLayout, dot-core.AvatarFlip, dot-core.BluePrintStatus, dot-core.Comment, dot-core.DepartmentDropDown, dot-core.Dot, dot-core.DotNew, dot-core.GridStencils, dot-core.Icons, dot-core.ListLayout, dot-core.ListStencils, dot-core.SecondaryText, dot-core.SecondryPanel, dot-core.SentimentStatus, dot-core.Subject, dot-core.TagNew, dot-core.Thread, dot-core.list, dot-core.StatusDropdown, dot-core.StatusListItem, dot-core.EmptyPage, dot-core.Lookup, dot-core.Close, dot-core.Search, dot-core.TicketHeader, dot-core.Title, dot-core.ViewDropDown, dot-core.header, dot-core.Button, dot-core.Views, dot-core.Description, dot-core.ListGroup, dot-core.TableData, dot-core.TableHead, dot-core.TableRow, dot-core.Text, dot-core.AlertClose, dot-core.GlobalNotification, dot-core.alertIcons, dot-core.lookup, dot-core.DesktopNotification, dot-core.DesktopNotificationHeader, dot-core.mode, dot-core.blue, dot-core.green, dot-core.orange, dot-core.red, dot-core.yellow;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/dot",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.23",
|
|
4
4
|
"main": "lib/index",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"private": false,
|
|
@@ -26,22 +26,23 @@
|
|
|
26
26
|
"build:watch": "npm run build:variables && npm run build && npm run build:es --module:mode=dev -- -w",
|
|
27
27
|
"rtl:watch": "react-cli rtl ./src ./es -w",
|
|
28
28
|
"rtl": "react-cli rtl ./src ./lib && react-cli rtl ./src ./es",
|
|
29
|
-
"prepare": "react-cli clean assets && npm run init &&
|
|
29
|
+
"prepare": "react-cli clean assets && npm run init && npm run css:build ",
|
|
30
30
|
"init": "npm run clean && npm run build:variables",
|
|
31
31
|
"build:variables": "react-cli clean ./assets && node ./preprocess/index",
|
|
32
32
|
"lint": "react-cli lint",
|
|
33
33
|
"lintAll": "react-cli lint ./src",
|
|
34
34
|
"lintAllFix": "npm run lintAll --eslint:fix=true",
|
|
35
|
+
"customTest": "node ./__testUtils__/runTest.js",
|
|
35
36
|
"test": "react-cli test",
|
|
36
37
|
"_test": "",
|
|
37
38
|
"snap-update": "npm run test-clean && npm run test -- -u",
|
|
38
39
|
"sstest": "react-cli sstest",
|
|
39
40
|
"common_package_build": "cd ../common && npm run build && cd ../dot",
|
|
40
41
|
"docs": "npm run css:review && review:props && react-cli docs",
|
|
41
|
-
"prepublishOnly": "node prePublish.js && npm run downloadOnly
|
|
42
|
+
"prepublishOnly": "node prePublish.js && npm run downloadOnly && npm run css:review && npm run review:props",
|
|
42
43
|
"postpublish": "node postPublish.js",
|
|
43
44
|
"test-clean": "react-cli clean ./coverage && react-cli clean ./unittest react-cli clean ./es && react-cli clean ./lib && react-cli clean ./package-lock.json && react-cli clean ./result.json",
|
|
44
|
-
"download": "
|
|
45
|
+
"download": "npm run downloadOnly && cd ../ && npm run download",
|
|
45
46
|
"downloadOnly": "react-cli clean ./node_modules ./package-lock.json && npm install",
|
|
46
47
|
"expublish": "npm publish --tag experimental-version",
|
|
47
48
|
"css:lineheight:validate": "node ./node_modules/@zohodesk-private/node-plugins/es/lineheight_automation/lineHeightErrorCheck.js ./src/",
|
|
@@ -53,7 +54,14 @@
|
|
|
53
54
|
"theme:validate": "node ./node_modules/@zohodesk-private/node-plugins/es/appearance_theme_validation validate ./src ./.cli ./.cli/stringContains.js",
|
|
54
55
|
"theme:addignore": "node ./node_modules/@zohodesk-private/node-plugins/es/appearance_theme_validation addignore ./src ./.cli ./.cli/stringContains.js",
|
|
55
56
|
"theme:removeignore": "node ./node_modules/@zohodesk-private/node-plugins/es/appearance_theme_validation removeignore ./src ./.cli",
|
|
56
|
-
"review:props": "node ./node_modules/@zohodesk-private/react-prop-validator/es/propValidation.js propValidationArg.json"
|
|
57
|
+
"review:props": "node ./node_modules/@zohodesk-private/react-prop-validator/es/propValidation.js propValidationArg.json",
|
|
58
|
+
"css:layer_config_generate": "node ./node_modules/@zohodesk-private/node-plugins/es/css_layer_generator/scan_css_generate_json.js ./src ./assets css_layer_config.json",
|
|
59
|
+
"css:layer_wrap_es": "node ./node_modules/@zohodesk-private/node-plugins/es/css_layer_generator/write_layer_in_css.js ./es ./assets css_layer_config.json --rewrite=src=es --rewrite=assets=assets --skip-existing-layer",
|
|
60
|
+
"css:layer_wrap_lib": "node ./node_modules/@zohodesk-private/node-plugins/es/css_layer_generator/write_layer_in_css.js ./lib ./assets css_layer_config.json --rewrite=src=lib --rewrite=assets=assets --skip-existing-layer",
|
|
61
|
+
"css:layer_generate_order": "node ./node_modules/@zohodesk-private/node-plugins/es/css_layer_generator/generate_layer_order.js css_layer_config.json ./src/dot_layer.module.css",
|
|
62
|
+
"css:layer_config_validate": "node ./node_modules/@zohodesk-private/node-plugins/es/css_layer_generator/validate.js css_layer_config.json ./src/ ./assets",
|
|
63
|
+
"css:build": "npm run css:layer_config_validate && npm run css:layer_generate_order && npm run build && npm run rtl && npm run cssVariableConvert ",
|
|
64
|
+
"css:layer_remove": "node ./node_modules/@zohodesk-private/node-plugins/es/css_layer_generator/remove_layer.js ./es ./assets css_layer_config.json --rewrite=src=es --rewrite=assets=assets"
|
|
57
65
|
},
|
|
58
66
|
"devDependencies": {
|
|
59
67
|
"@testing-library/jest-dom": "^5.11.9",
|
|
@@ -62,7 +70,7 @@
|
|
|
62
70
|
"@testing-library/user-event": "^13.0.10",
|
|
63
71
|
"@zohodesk-private/color-variable-preprocessor": "1.2.0",
|
|
64
72
|
"@zohodesk-private/css-variable-migrator": "1.0.9",
|
|
65
|
-
"@zohodesk-private/node-plugins": "1.1.
|
|
73
|
+
"@zohodesk-private/node-plugins": "1.1.13",
|
|
66
74
|
"@zohodesk-private/react-prop-validator": "1.2.3",
|
|
67
75
|
"@zohodesk/a11y": "2.3.7",
|
|
68
76
|
"@zohodesk/components": "1.4.12",
|
|
@@ -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>
|
package/.cli/PropLessFiles.html
DELETED
|
@@ -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 = {"LinkContext":{"filePath":"src/Link/LinkContext.js"},"Loader":{"filePath":"src/v1/Loader/Loader.js"},"MessageNew":{"filePath":"src/v1/Message/Message.js"},"GlobalNotificationNew":{"filePath":"src/version2/GlobalNotification/GlobalNotification.js"},"DesktopNotification":{"filePath":"src/version2/notification/DesktopNotification/DesktopNotification.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>
|