@aj-shadow/z-abs-complayer-markup-client 0.0.0-aj-beta.221
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/.gitattributes +26 -0
- package/LICENSE.txt +96 -0
- package/README.md +5 -0
- package/npm-shrinkwrap.json +13 -0
- package/package.json +10 -0
- package/project/client/_build/Bundle-CompLayer-Markup-client.bld +40 -0
- package/project/client/_build/Client-CompLayer-Markup-client-jsx.bld +10 -0
- package/project/client/_build/Client-CompLayer-Markup-client.bld +10 -0
- package/project/client/_build/Client-css-CompLayer-Markup-bundle.bld +9 -0
- package/project/client/_build/z-abs-complayer-markup-client.prj +36 -0
- package/project/client/actions/action-style.js +17 -0
- package/project/client/actions/data-action-style.js +13 -0
- package/project/client/css/markup_addressing.css +30 -0
- package/project/client/css/markup_flowchart.css +53 -0
- package/project/client/css/markup_general.css +4 -0
- package/project/client/css/markup_image.css +10 -0
- package/project/client/css/markup_license.css +107 -0
- package/project/client/css/markup_login.css +201 -0
- package/project/client/css/markup_node_diagram.css +51 -0
- package/project/client/css/markup_sequence_diagram.css +6 -0
- package/project/client/css/markup_state.css +5 -0
- package/project/client/css/markup_table.css +57 -0
- package/project/client/css/markup_tc.css +32 -0
- package/project/client/css/markup_ts.css +36 -0
- package/project/client/data/addresses/data-addresses-client-address-global.js +20 -0
- package/project/client/data/addresses/data-addresses-client-address-local.js +20 -0
- package/project/client/data/addresses/data-addresses-client-interface-global.js +17 -0
- package/project/client/data/addresses/data-addresses-client-interface-local.js +17 -0
- package/project/client/data/addresses/data-addresses-dns-global.js +18 -0
- package/project/client/data/addresses/data-addresses-dns-local.js +19 -0
- package/project/client/data/addresses/data-addresses-dst-global.js +20 -0
- package/project/client/data/addresses/data-addresses-dst-local.js +20 -0
- package/project/client/data/addresses/data-addresses-network-interface-global.js +17 -0
- package/project/client/data/addresses/data-addresses-network-interface-local.js +17 -0
- package/project/client/data/addresses/data-addresses-ports-global.js +18 -0
- package/project/client/data/addresses/data-addresses-ports-local.js +18 -0
- package/project/client/data/addresses/data-addresses-server-address-global.js +20 -0
- package/project/client/data/addresses/data-addresses-server-address-local.js +20 -0
- package/project/client/data/addresses/data-addresses-server-interface-global.js +17 -0
- package/project/client/data/addresses/data-addresses-server-interface-local.js +17 -0
- package/project/client/data/addresses/data-addresses-src-global.js +21 -0
- package/project/client/data/addresses/data-addresses-src-local.js +21 -0
- package/project/client/data/addresses/data-addresses-srv-global.js +20 -0
- package/project/client/data/addresses/data-addresses-srv-local.js +20 -0
- package/project/client/data/addresses/data-addresses-sut-address-global.js +20 -0
- package/project/client/data/addresses/data-addresses-sut-address-local.js +20 -0
- package/project/client/data/addresses/data-addresses-sut-interface-global.js +19 -0
- package/project/client/data/addresses/data-addresses-sut-interface-local.js +19 -0
- package/project/client/data/data-chart/data-chart-axis.js +13 -0
- package/project/client/data/data-chart/data-chart-grid.js +14 -0
- package/project/client/data/data-chart/data-chart-line/data-chart-line-config.js +17 -0
- package/project/client/data/data-chart/data-chart-line/data-chart-line.js +41 -0
- package/project/client/data/data-config.js +14 -0
- package/project/client/data/data-constructor.js +18 -0
- package/project/client/data/data-content/data-content-audio-global.js +18 -0
- package/project/client/data/data-content/data-content-audio-local.js +18 -0
- package/project/client/data/data-content/data-content-documents-global.js +18 -0
- package/project/client/data/data-content/data-content-documents-local.js +18 -0
- package/project/client/data/data-content/data-content-image-global.js +21 -0
- package/project/client/data/data-content/data-content-image-local.js +21 -0
- package/project/client/data/data-content/data-content-other-global.js +20 -0
- package/project/client/data/data-content/data-content-other-local.js +20 -0
- package/project/client/data/data-content/data-content-text-global.js +20 -0
- package/project/client/data/data-content/data-content-text-local.js +20 -0
- package/project/client/data/data-content/data-content-video-global.js +20 -0
- package/project/client/data/data-content/data-content-video-local.js +20 -0
- package/project/client/data/data-data.js +28 -0
- package/project/client/data/data-dependencies/data-dependencies.js +17 -0
- package/project/client/data/data-documentation/data-documentation-navigation.js +15 -0
- package/project/client/data/data-documentation/data-documentation.js +20 -0
- package/project/client/data/data-flowchart/data-flowchart-block.js +33 -0
- package/project/client/data/data-flowchart/data-flowchart-connection.js +17 -0
- package/project/client/data/data-flowchart/data-flowchart.js +30 -0
- package/project/client/data/data-html/data-html-anchor.js +12 -0
- package/project/client/data/data-html/data-html-br.js +11 -0
- package/project/client/data/data-html/data-html-button.js +15 -0
- package/project/client/data/data-html/data-html-log-start.js +12 -0
- package/project/client/data/data-html/data-html-log-stop.js +13 -0
- package/project/client/data/data-html/data-html-log.js +16 -0
- package/project/client/data/data-html/data-html-toolbar.js +19 -0
- package/project/client/data/data-image/data-image.js +20 -0
- package/project/client/data/data-lab/data-lab-interface-client.js +19 -0
- package/project/client/data/data-lab/data-lab-interface-server.js +19 -0
- package/project/client/data/data-lab/data-lab-interface-sut.js +20 -0
- package/project/client/data/data-lab/data-lab-network.js +31 -0
- package/project/client/data/data-lab/data-lab.js +21 -0
- package/project/client/data/data-licenses/data-licenses.js +16 -0
- package/project/client/data/data-node-diagram/data-node-diagram-config.js +21 -0
- package/project/client/data/data-node-diagram/data-node-diagram-connection.js +18 -0
- package/project/client/data/data-node-diagram/data-node-diagram-group.js +16 -0
- package/project/client/data/data-node-diagram/data-node-diagram-node.js +22 -0
- package/project/client/data/data-node-diagram/data-node-diagram.js +47 -0
- package/project/client/data/data-repos/data-repos-content-local.js +15 -0
- package/project/client/data/data-repos/data-repos-data-local.js +15 -0
- package/project/client/data/data-sequence-diagram/data-sequence-diagram-config.js +22 -0
- package/project/client/data/data-sequence-diagram/data-sequence-diagram-message.js +17 -0
- package/project/client/data/data-sequence-diagram/data-sequence-diagram-node.js +11 -0
- package/project/client/data/data-sequence-diagram/data-sequence-diagram.js +32 -0
- package/project/client/data/data-state-machine/data-state-machine-config.js +17 -0
- package/project/client/data/data-state-machine/data-state-machine-state.js +29 -0
- package/project/client/data/data-state-machine/data-state-machine-transition.js +18 -0
- package/project/client/data/data-state-machine/data-state-machine.js +37 -0
- package/project/client/data/data-system-under-test/data-system-under-test-instances.js +15 -0
- package/project/client/data/data-system-under-test/data-system-under-test-nodes.js +18 -0
- package/project/client/data/data-table/data-table-config.js +21 -0
- package/project/client/data/data-table-key-value.js +56 -0
- package/project/client/data/data-test-case/data-actor.js +282 -0
- package/project/client/data/data-test-case/data-test-case-settings.js +49 -0
- package/project/client/data/data-test-case/data-test-case.js +19 -0
- package/project/client/data/data-test-case/data-test-data-iteration.js +54 -0
- package/project/client/data/data-test-case/data-test-data-test-case.js +16 -0
- package/project/client/data/data-test-case/data-verification-test-case.js +24 -0
- package/project/client/data/data-test-data/data-test-data-environment-global.js +18 -0
- package/project/client/data/data-test-data/data-test-data-environment-local.js +18 -0
- package/project/client/data/data-test-data/data-test-data-environment-static.js +16 -0
- package/project/client/data/data-test-data/data-test-data-general-global.js +18 -0
- package/project/client/data/data-test-data/data-test-data-general-local.js +18 -0
- package/project/client/data/data-test-data/data-test-data-output-global.js +18 -0
- package/project/client/data/data-test-data/data-test-data-output-local.js +18 -0
- package/project/client/data/data-test-data/data-test-data-system-global.js +18 -0
- package/project/client/data/data-test-data/data-test-data-system-local.js +18 -0
- package/project/client/data/data-test-suite/data-test-suite-abstraction.js +72 -0
- package/project/client/data/data-test-suite/data-test-suite.js +15 -0
- package/project/client/data/data-tree/data-tree-node.js +17 -0
- package/project/client/data/data-tree/data-tree.js +13 -0
- package/project/client/markup/markup-addresses/markup-addresses-client-address.js +31 -0
- package/project/client/markup/markup-addresses/markup-addresses-client-interface.js +31 -0
- package/project/client/markup/markup-addresses/markup-addresses-dns.js +32 -0
- package/project/client/markup/markup-addresses/markup-addresses-dst.js +31 -0
- package/project/client/markup/markup-addresses/markup-addresses-network-interface.js +31 -0
- package/project/client/markup/markup-addresses/markup-addresses-ports.js +31 -0
- package/project/client/markup/markup-addresses/markup-addresses-server-address.js +31 -0
- package/project/client/markup/markup-addresses/markup-addresses-server-interface.js +31 -0
- package/project/client/markup/markup-addresses/markup-addresses-src.js +31 -0
- package/project/client/markup/markup-addresses/markup-addresses-srv.js +31 -0
- package/project/client/markup/markup-addresses/markup-addresses-sut-address.js +31 -0
- package/project/client/markup/markup-addresses/markup-addresses-sut-interface.js +31 -0
- package/project/client/markup/markup-chart/markup-chart-line.js +92 -0
- package/project/client/markup/markup-content/markup-content-audio.js +31 -0
- package/project/client/markup/markup-content/markup-content-documents.js +31 -0
- package/project/client/markup/markup-content/markup-content-image.js +31 -0
- package/project/client/markup/markup-content/markup-content-other.js +31 -0
- package/project/client/markup/markup-content/markup-content-text.js +31 -0
- package/project/client/markup/markup-content/markup-content-video.js +31 -0
- package/project/client/markup/markup-dependencies/markup-dependencies.js +30 -0
- package/project/client/markup/markup-documentation/markup-documentation-anchor.js +37 -0
- package/project/client/markup/markup-documentation/markup-documentation-api-status.js +67 -0
- package/project/client/markup/markup-documentation/markup-documentation-code.js +20 -0
- package/project/client/markup/markup-documentation/markup-documentation-div.js +34 -0
- package/project/client/markup/markup-documentation/markup-documentation-documentation-status.js +67 -0
- package/project/client/markup/markup-documentation/markup-documentation-embed.js +23 -0
- package/project/client/markup/markup-documentation/markup-documentation-html.js +139 -0
- package/project/client/markup/markup-documentation/markup-documentation-ie.js +21 -0
- package/project/client/markup/markup-documentation/markup-documentation-image.js +46 -0
- package/project/client/markup/markup-documentation/markup-documentation-lab.js +19 -0
- package/project/client/markup/markup-documentation/markup-documentation-local-note.js +33 -0
- package/project/client/markup/markup-documentation/markup-documentation-navigation.js +109 -0
- package/project/client/markup/markup-documentation/markup-documentation-page.js +262 -0
- package/project/client/markup/markup-documentation/markup-documentation-ref.js +28 -0
- package/project/client/markup/markup-documentation/markup-documentation-result.js +21 -0
- package/project/client/markup/markup-documentation/markup-documentation-state-machine.js +194 -0
- package/project/client/markup/markup-documentation/markup-documentation.js +74 -0
- package/project/client/markup/markup-flowchart.js +264 -0
- package/project/client/markup/markup-lab.js +116 -0
- package/project/client/markup/markup-licenses/markup-licenses.js +29 -0
- package/project/client/markup/markup-node-diagram.js +435 -0
- package/project/client/markup/markup-parse-helper.js +26 -0
- package/project/client/markup/markup-pattern-config.js +53 -0
- package/project/client/markup/markup-pattern-data.js +50 -0
- package/project/client/markup/markup-pattern-function.js +47 -0
- package/project/client/markup/markup-repos/markup-repos.js +31 -0
- package/project/client/markup/markup-sequence-diagram.js +466 -0
- package/project/client/markup/markup-system-under-test/markup-system-under-test-instances.js +29 -0
- package/project/client/markup/markup-system-under-test/markup-system-under-test-nodes.js +30 -0
- package/project/client/markup/markup-table-key-value-parse.js +25 -0
- package/project/client/markup/markup-table-key-value-stringify.js +91 -0
- package/project/client/markup/markup-table-key-value.js +18 -0
- package/project/client/markup/markup-table-name-value.js +101 -0
- package/project/client/markup/markup-table.js +85 -0
- package/project/client/markup/markup-tables-parser.js +122 -0
- package/project/client/markup/markup-test-case/markup-test-case.js +67 -0
- package/project/client/markup/markup-test-data/markup-test-data-environment.js +31 -0
- package/project/client/markup/markup-test-data/markup-test-data-general.js +31 -0
- package/project/client/markup/markup-test-data/markup-test-data-output.js +31 -0
- package/project/client/markup/markup-test-data/markup-test-data-system.js +31 -0
- package/project/client/markup/markup-test-suite/markup-test-suite.js +40 -0
- package/project/client/react-components/helper/line-data.js +16 -0
- package/project/client/react-components/helper/line-object.js +22 -0
- package/project/client/react-components/helper/scroll-data.js +74 -0
- package/project/client/react-components/markup/component-chart/component-image-chart-line.jsx +203 -0
- package/project/client/react-components/markup/component-code.jsx +50 -0
- package/project/client/react-components/markup/component-document.jsx +105 -0
- package/project/client/react-components/markup/component-documentation-anchor.jsx +47 -0
- package/project/client/react-components/markup/component-embed.jsx +48 -0
- package/project/client/react-components/markup/component-image-flowchart.jsx +389 -0
- package/project/client/react-components/markup/component-image-image.jsx +32 -0
- package/project/client/react-components/markup/component-image-lab.jsx +696 -0
- package/project/client/react-components/markup/component-image-node-diagram.jsx +506 -0
- package/project/client/react-components/markup/component-image-result.jsx +22 -0
- package/project/client/react-components/markup/component-image-sequence-diagram.jsx +645 -0
- package/project/client/react-components/markup/component-image-state-machine.jsx +633 -0
- package/project/client/react-components/markup/component-image-table.jsx +96 -0
- package/project/client/react-components/markup/component-local-note.jsx +99 -0
- package/project/client/react-components/markup/component-markup-remarkable.jsx +79 -0
- package/project/client/react-components/markup/component-markup.jsx +1036 -0
- package/project/client/react-components/markup/component-table-data-table.jsx +146 -0
- package/project/client/stores/style-store.js +96 -0
- package/project/z-abs-complayer-markup-client.tree +239 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const MarkupTablesParser = require('./markup-tables-parser');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class MarkupTableNameValue {
|
|
8
|
+
stringify(tables) {
|
|
9
|
+
let markup = '';
|
|
10
|
+
tables.forEach((table, index) => {
|
|
11
|
+
let sizes = this._calculateSizes(table.rows);
|
|
12
|
+
markup += `${this._generateMarkup(table.name, table.rows, sizes)}${index === tables.length - 1 ? '' : '\n\n'}`;
|
|
13
|
+
});
|
|
14
|
+
return markup;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
parse(markup) {
|
|
18
|
+
let objectTables = MarkupTablesParser.parse(markup);
|
|
19
|
+
if(objectTables.success) {
|
|
20
|
+
let tables = objectTables.objects.map((tableRows) => {
|
|
21
|
+
let name = tableRows[0].columns[0];
|
|
22
|
+
tableRows.shift();
|
|
23
|
+
let rows = tableRows.map((tableRow) => {
|
|
24
|
+
return {
|
|
25
|
+
name: tableRow.columns[0],
|
|
26
|
+
value: tableRow.columns[1]
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
return {
|
|
30
|
+
name: name,
|
|
31
|
+
rows: rows
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
return {
|
|
35
|
+
success: true,
|
|
36
|
+
tables: tables
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
return {
|
|
41
|
+
success: false,
|
|
42
|
+
rows: objectTables.rows
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
_calculateSizes(rows) {
|
|
48
|
+
let sizes = [0, 0];
|
|
49
|
+
rows.forEach((row) => {
|
|
50
|
+
this._calculateSize(sizes, row);
|
|
51
|
+
});
|
|
52
|
+
return sizes;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
_calculateSize(sizes, row) {
|
|
56
|
+
if(undefined !== row.name) {
|
|
57
|
+
if(sizes[0] < row.name.length) {
|
|
58
|
+
sizes[0] = row.name.length;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if(undefined !== row.value) {
|
|
62
|
+
if(sizes[1] < row.value.length) {
|
|
63
|
+
sizes[1] = row.value.length;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
_generateMarkup(tableName, tableRows, sizes) {
|
|
69
|
+
let totalColumnSize = sizes.length - 1 + sizes.reduce((prev, curr) => prev + curr);
|
|
70
|
+
let formattedtableRows = [];
|
|
71
|
+
if(tableName.length <= totalColumnSize) {
|
|
72
|
+
tableName += ' '.repeat(totalColumnSize - tableName.length);
|
|
73
|
+
formattedtableRows = tableRows.map((row) => {
|
|
74
|
+
return this._generateMarkupRow(row, sizes);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
let markup = `|${tableName}|`;
|
|
78
|
+
formattedtableRows.forEach((row, index) => {
|
|
79
|
+
markup += `\n|${row.name}|${row.value}|`;
|
|
80
|
+
});
|
|
81
|
+
return markup;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
_generateMarkupRow(row, sizes) {
|
|
85
|
+
return {
|
|
86
|
+
name: this._generateMarkupColumn(row.name, 0, sizes),
|
|
87
|
+
value: this._generateMarkupColumn(row.value, 1, sizes)
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
_generateMarkupColumn(column, index, sizes) {
|
|
92
|
+
if(undefined !== column) {
|
|
93
|
+
return column + ' '.repeat(sizes[index] - column.length);
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
return ' '.repeat(sizes[index]);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
module.exports = new MarkupTableNameValue();
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const MarkupTablesParser = require('./markup-tables-parser');
|
|
5
|
+
const MarkupPatternConfig = require('./markup-pattern-config');
|
|
6
|
+
const DataTableConfig = require('../data/data-table/data-table-config');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class MarkupTable {
|
|
10
|
+
markupName() {
|
|
11
|
+
return 'table';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
stringify(data) {
|
|
15
|
+
let stringified = '';
|
|
16
|
+
stringified += MarkupPatternConfig.stringify(data.config);
|
|
17
|
+
data.objects.forEach((objects, index) => {
|
|
18
|
+
const sizes = this._calculateSizes(objects);
|
|
19
|
+
stringified += `${this._generateMarkup(objects, sizes)}`;
|
|
20
|
+
});
|
|
21
|
+
return stringified;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
parse(markup) {
|
|
25
|
+
const dataTableConfig = new DataTableConfig();
|
|
26
|
+
const table = MarkupTablesParser.parse(markup, (rows) => {
|
|
27
|
+
rows.forEach((row) => {
|
|
28
|
+
const trimRow = row.trim();
|
|
29
|
+
if(trimRow.startsWith('Config')) {
|
|
30
|
+
MarkupPatternConfig.parse(trimRow, dataTableConfig);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
return rows;
|
|
34
|
+
});
|
|
35
|
+
table.config = dataTableConfig;
|
|
36
|
+
return table;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
_calculateSizes(objects) {
|
|
40
|
+
const sizes = [];
|
|
41
|
+
for(let i = 1; i < objects.length; ++i) {
|
|
42
|
+
const object = objects[i];
|
|
43
|
+
const columns = object.columns.length;
|
|
44
|
+
for(let j = sizes.length; j < columns; ++j) {
|
|
45
|
+
sizes.push(0);
|
|
46
|
+
}
|
|
47
|
+
for(let j = 0; j < columns; ++j) {
|
|
48
|
+
if(sizes[j] < object.columns[j].length) {
|
|
49
|
+
sizes[j] = object.columns[j].length;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return sizes;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
_generateMarkup(objects, sizes) {
|
|
57
|
+
const totalColumnSize = sizes.length - 1 + sizes.reduce((prev, curr) => prev + curr);
|
|
58
|
+
let markupTableName = 1 <= objects.length ? (1 <= objects[0].columns.length ? objects[0].columns[0] : '') : '';
|
|
59
|
+
const markupTableHeadings = 2 <= objects.length ? objects[1].columns : [];
|
|
60
|
+
if(markupTableName.length <= totalColumnSize) {
|
|
61
|
+
markupTableName += ' '.repeat(totalColumnSize - markupTableName.length);
|
|
62
|
+
}
|
|
63
|
+
this._generateMarkupRow(markupTableHeadings, sizes);
|
|
64
|
+
let markup = `|${markupTableName}|\n|${markupTableHeadings.join('|')}|`;
|
|
65
|
+
for(let i = 2; i < objects.length; ++i) {
|
|
66
|
+
this._generateMarkupRow(objects[i].columns, sizes);
|
|
67
|
+
markup += `\n|${objects[i].columns.join('|')}|`;
|
|
68
|
+
}
|
|
69
|
+
return markup;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
_generateMarkupRow(row, sizes) {
|
|
73
|
+
row.forEach((value, index, array) => {
|
|
74
|
+
if(undefined !== value) {
|
|
75
|
+
array[index] = value + ' '.repeat(sizes[index] - value.length);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
array[index] = ' '.repeat(sizes[index]);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
module.exports = new MarkupTable();
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class MarkupTablesParser {
|
|
6
|
+
parse(markup, cbRows) {
|
|
7
|
+
const rows = this._getRows(markup);
|
|
8
|
+
if(undefined !== cbRows) {
|
|
9
|
+
cbRows = cbRows(rows);
|
|
10
|
+
}
|
|
11
|
+
const formattedRows = this._formatRows(rows);
|
|
12
|
+
const objectTables = this._getObjectTables(formattedRows);
|
|
13
|
+
return {
|
|
14
|
+
success: objectTables.success,
|
|
15
|
+
rows: formattedRows,
|
|
16
|
+
objects: objectTables.objects,
|
|
17
|
+
config: undefined
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
_getRows(markup) {
|
|
22
|
+
let index = 0;
|
|
23
|
+
let nextIndex = 0;
|
|
24
|
+
const rows = [];
|
|
25
|
+
const length = markup.length;
|
|
26
|
+
while(index < length) {
|
|
27
|
+
nextIndex = markup.indexOf('\n', index);
|
|
28
|
+
if(-1 !== nextIndex) {
|
|
29
|
+
rows.push(markup.substring(index, nextIndex));
|
|
30
|
+
index = nextIndex + 1;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
rows.push(markup.substring(index, length));
|
|
34
|
+
index = length;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return rows;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
_formatRows(rows) {
|
|
41
|
+
const formattedRows = [];
|
|
42
|
+
rows.forEach((row, rowIndex) => {
|
|
43
|
+
let trimmedRow = row.trim();
|
|
44
|
+
const commentOut = trimmedRow.startsWith('#');
|
|
45
|
+
if(commentOut) {
|
|
46
|
+
trimmedRow = trimmedRow.substring(1).trim();
|
|
47
|
+
}
|
|
48
|
+
const columns = trimmedRow.split('|');
|
|
49
|
+
if(1 === columns.length) {
|
|
50
|
+
formattedRows.push({
|
|
51
|
+
object: false,
|
|
52
|
+
empty: true,
|
|
53
|
+
commentOut: commentOut,
|
|
54
|
+
row: rowIndex,
|
|
55
|
+
columns: [],
|
|
56
|
+
success: 0 === columns[0].length
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
else if(columns.length >= 2) {
|
|
60
|
+
const success = 0 === columns[0].length && 0 === columns[columns.length - 1].length;
|
|
61
|
+
columns.splice(columns.length - 1, 1);
|
|
62
|
+
columns.splice(0, 1);
|
|
63
|
+
let empty = true;
|
|
64
|
+
columns.forEach((column, columnIndex, array) => {
|
|
65
|
+
const value = column.trim();
|
|
66
|
+
array[columnIndex] = value;
|
|
67
|
+
empty &&= 0 === value.length;
|
|
68
|
+
});
|
|
69
|
+
formattedRows.push({
|
|
70
|
+
object: true,
|
|
71
|
+
empty: empty,
|
|
72
|
+
commentOut: commentOut,
|
|
73
|
+
row: rowIndex,
|
|
74
|
+
columns: columns,
|
|
75
|
+
success: success
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
return formattedRows;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
_getObjectTables(rows) {
|
|
83
|
+
const objectTables = {
|
|
84
|
+
success: true,
|
|
85
|
+
objects: []
|
|
86
|
+
};
|
|
87
|
+
let objectRows = undefined;
|
|
88
|
+
let rowlength = 0;
|
|
89
|
+
rows.forEach((row) => {
|
|
90
|
+
if(row.object) {
|
|
91
|
+
if(undefined === objectRows) {
|
|
92
|
+
objectRows = [];
|
|
93
|
+
objectRows.push(row);
|
|
94
|
+
objectTables.objects.push(objectRows);
|
|
95
|
+
if(1 !== row.columns.length) {
|
|
96
|
+
row.success = false;
|
|
97
|
+
objectTables.success = false;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
if(!row.empty) {
|
|
102
|
+
objectRows.push(row);
|
|
103
|
+
}
|
|
104
|
+
if(0 === rowlength) {
|
|
105
|
+
rowlength = row.columns.length;
|
|
106
|
+
}
|
|
107
|
+
else if(row.columns.length != rowlength) {
|
|
108
|
+
row.success = false;
|
|
109
|
+
objectTables.success = false;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
objectRows = undefined;
|
|
115
|
+
rowlength = 0;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
return objectTables;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
module.exports = new MarkupTablesParser();
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const DataConstructor = require('../../data/data-constructor');
|
|
5
|
+
const DataTestCase = require('../../data/data-test-case/data-test-case');
|
|
6
|
+
const DataTestCaseSettings = require('../../data/data-test-case/data-test-case-settings');
|
|
7
|
+
const DataActor = require('../../data/data-test-case/data-actor');
|
|
8
|
+
const DataTestDataTestCase = require('../../data/data-test-case/data-test-data-test-case');
|
|
9
|
+
const DataTestDataIteration = require('../../data/data-test-case/data-test-data-iteration');
|
|
10
|
+
const DataVerificationTestCase = require('../../data/data-test-case/data-verification-test-case');
|
|
11
|
+
const MarkupTableKeyValue = require('../markup-table-key-value');
|
|
12
|
+
const MarkupTablesParser = require('../markup-tables-parser');
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class MarkupTestCase {
|
|
16
|
+
markupName() {
|
|
17
|
+
return 'tc';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
stringify(dataTestCase, stringifyEmptyTables = true) {
|
|
21
|
+
const dataTestCaseTc = dataTestCase.tc;
|
|
22
|
+
let markup = '';
|
|
23
|
+
markup += this._stringifyMarkupPart(markup.length, MarkupTableKeyValue.stringify(new DataTestCaseSettings(), dataTestCaseTc.settings, stringifyEmptyTables));
|
|
24
|
+
markup += this._stringifyMarkupPart(markup.length, MarkupTableKeyValue.stringify(new DataActor(), dataTestCaseTc.actors, stringifyEmptyTables));
|
|
25
|
+
markup += this._stringifyMarkupPart(markup.length, MarkupTableKeyValue.stringify(new DataTestDataTestCase(), dataTestCaseTc.testDataTestCases, stringifyEmptyTables));
|
|
26
|
+
markup += this._stringifyMarkupPart(markup.length, MarkupTableKeyValue.stringify(new DataTestDataIteration(), dataTestCaseTc.testDataIteration, stringifyEmptyTables));
|
|
27
|
+
markup += this._stringifyMarkupPart(markup.length, MarkupTableKeyValue.stringify(new DataVerificationTestCase(), dataTestCaseTc.verificationTestCases, stringifyEmptyTables));
|
|
28
|
+
return markup;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
parse(markup) {
|
|
32
|
+
const objectTables = MarkupTablesParser.parse(markup);
|
|
33
|
+
if(!objectTables.success) {
|
|
34
|
+
return {
|
|
35
|
+
success: false,
|
|
36
|
+
rows: objectTables.rows
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
const settings = MarkupTableKeyValue.parse(DataTestCaseSettings, objectTables.objects);
|
|
40
|
+
const actors = MarkupTableKeyValue.parse(DataActor, objectTables.objects);
|
|
41
|
+
const testDataTestCases = MarkupTableKeyValue.parse(DataTestDataTestCase, objectTables.objects);
|
|
42
|
+
const testDataIteration = MarkupTableKeyValue.parse(DataTestDataIteration, objectTables.objects);
|
|
43
|
+
const verificationTestCases = MarkupTableKeyValue.parse(DataVerificationTestCase, objectTables.objects);
|
|
44
|
+
const dataTestCase = new DataTestCase(DataConstructor.create(settings), DataConstructor.create(actors), DataConstructor.create(testDataTestCases), DataConstructor.create(testDataIteration), DataConstructor.create(verificationTestCases));
|
|
45
|
+
return {
|
|
46
|
+
success: true,
|
|
47
|
+
tc: dataTestCase
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
_stringifyMarkupPart(markupLength, markupPart) {
|
|
52
|
+
if(0 !== markupPart.length) {
|
|
53
|
+
if(0 !== markupLength) {
|
|
54
|
+
return `\n\n${markupPart}`;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
return `${markupPart}`;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
return '';
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
module.exports = new MarkupTestCase();
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const DataTestDataEnvironmentGlobal = require('../../data/data-test-data/data-test-data-environment-global');
|
|
5
|
+
const DataTestDataEnvironmentLocal = require('../../data/data-test-data/data-test-data-environment-local');
|
|
6
|
+
const MarkupTableKeyValue = require('../markup-table-key-value');
|
|
7
|
+
const MarkupTablesParser = require('../markup-tables-parser');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class MarkupTestDataEnvironment {
|
|
11
|
+
stringify(dataTestDataGlobals, dataTestDataLocals) {
|
|
12
|
+
return `\n${MarkupTableKeyValue.stringify(new DataTestDataEnvironmentLocal(), dataTestDataLocals, true)}\n\n${MarkupTableKeyValue.stringify(new DataTestDataEnvironmentGlobal(), dataTestDataGlobals, true)}\n`;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
parse(markup) {
|
|
16
|
+
let objectTables = MarkupTablesParser.parse(markup);
|
|
17
|
+
if(!objectTables.success) {
|
|
18
|
+
return {
|
|
19
|
+
success: false,
|
|
20
|
+
rows: objectTables.rows
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
success: true,
|
|
25
|
+
globals: MarkupTableKeyValue.parse(DataTestDataEnvironmentGlobal, objectTables.objects),
|
|
26
|
+
locals: MarkupTableKeyValue.parse(DataTestDataEnvironmentLocal, objectTables.objects)
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
module.exports = new MarkupTestDataEnvironment();
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const DataTestDataGeneralGlobal = require('../../data/data-test-data/data-test-data-general-global');
|
|
5
|
+
const DataTestDataGeneralLocal = require('../../data/data-test-data/data-test-data-general-local');
|
|
6
|
+
const MarkupTableKeyValue = require('../markup-table-key-value');
|
|
7
|
+
const MarkupTablesParser = require('../markup-tables-parser');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class MarkupTestDataGeneral {
|
|
11
|
+
stringify(dataTestDataGlobals, dataTestDataLocals) {
|
|
12
|
+
return `\n${MarkupTableKeyValue.stringify(new DataTestDataGeneralLocal(), dataTestDataLocals, true)}\n\n${MarkupTableKeyValue.stringify(new DataTestDataGeneralGlobal(), dataTestDataGlobals, true)}\n`;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
parse(markup) {
|
|
16
|
+
let objectTables = MarkupTablesParser.parse(markup);
|
|
17
|
+
if(!objectTables.success) {
|
|
18
|
+
return {
|
|
19
|
+
success: false,
|
|
20
|
+
rows: objectTables.rows
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
success: true,
|
|
25
|
+
globals: MarkupTableKeyValue.parse(DataTestDataGeneralGlobal, objectTables.objects),
|
|
26
|
+
locals: MarkupTableKeyValue.parse(DataTestDataGeneralLocal, objectTables.objects)
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
module.exports = new MarkupTestDataGeneral();
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const DataTestDataOutputGlobal = require('../../data/data-test-data/data-test-data-output-global');
|
|
5
|
+
const DataTestDataOutputLocal = require('../../data/data-test-data/data-test-data-output-local');
|
|
6
|
+
const MarkupTableKeyValue = require('../markup-table-key-value');
|
|
7
|
+
const MarkupTablesParser = require('../markup-tables-parser');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class MarkupTestDataOutput {
|
|
11
|
+
stringify(dataTestDataGlobals, dataTestDataLocals) {
|
|
12
|
+
return `\n${MarkupTableKeyValue.stringify(new DataTestDataOutputLocal(), dataTestDataLocals, true)}\n\n${MarkupTableKeyValue.stringify(new DataTestDataOutputGlobal(), dataTestDataGlobals, true)}\n`;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
parse(markup) {
|
|
16
|
+
let objectTables = MarkupTablesParser.parse(markup);
|
|
17
|
+
if(!objectTables.success) {
|
|
18
|
+
return {
|
|
19
|
+
success: false,
|
|
20
|
+
rows: objectTables.rows
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
success: true,
|
|
25
|
+
globals: MarkupTableKeyValue.parse(DataTestDataOutputGlobal, objectTables.objects),
|
|
26
|
+
locals: MarkupTableKeyValue.parse(DataTestDataOutputLocal, objectTables.objects)
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
module.exports = new MarkupTestDataOutput();
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const DataTestDataSystemGlobal = require('../../data/data-test-data/data-test-data-system-global');
|
|
5
|
+
const DataTestDataSystemLocal = require('../../data/data-test-data/data-test-data-system-local');
|
|
6
|
+
const MarkupTableKeyValue = require('../markup-table-key-value');
|
|
7
|
+
const MarkupTablesParser = require('../markup-tables-parser');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class MarkupTestDataSystem {
|
|
11
|
+
stringify(dataTestDataGlobals, dataTestDataLocals) {
|
|
12
|
+
return `\n${MarkupTableKeyValue.stringify(new DataTestDataSystemLocal(), dataTestDataLocals, true)}\n\n${MarkupTableKeyValue.stringify(new DataTestDataSystemGlobal(), dataTestDataGlobals, true)}\n`;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
parse(markup) {
|
|
16
|
+
let objectTables = MarkupTablesParser.parse(markup);
|
|
17
|
+
if(!objectTables.success) {
|
|
18
|
+
return {
|
|
19
|
+
success: false,
|
|
20
|
+
rows: objectTables.rows
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
success: true,
|
|
25
|
+
globals: MarkupTableKeyValue.parse(DataTestDataSystemGlobal, objectTables.objects),
|
|
26
|
+
locals: MarkupTableKeyValue.parse(DataTestDataSystemLocal, objectTables.objects)
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
module.exports = new MarkupTestDataSystem();
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const DataConstructor = require('../../data/data-constructor');
|
|
5
|
+
const DataTestSuite = require('../../data/data-test-suite/data-test-suite');
|
|
6
|
+
const DataTestSuiteAbstraction = require('../../data/data-test-suite/data-test-suite-abstraction');
|
|
7
|
+
const MarkupTableKeyValue = require('../markup-table-key-value');
|
|
8
|
+
const MarkupTablesParser = require('../markup-tables-parser');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class MarkupTestSuite {
|
|
12
|
+
markupName() {
|
|
13
|
+
return 'ts';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
stringify(dataTestSuite, stringifyEmptyTables = true) {
|
|
17
|
+
const dataTestSuiteTs = dataTestSuite.ts;
|
|
18
|
+
const markup = MarkupTableKeyValue.stringify(new DataTestSuiteAbstraction(), dataTestSuiteTs.abstractions, stringifyEmptyTables);
|
|
19
|
+
return markup;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
parse(markup) {
|
|
23
|
+
const objectTables = MarkupTablesParser.parse(markup);
|
|
24
|
+
if(!objectTables.success) {
|
|
25
|
+
return {
|
|
26
|
+
success: false,
|
|
27
|
+
rows: objectTables.rows
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
const abstractions = MarkupTableKeyValue.parse(DataTestSuiteAbstraction, objectTables.objects);
|
|
31
|
+
const dataTestSuite = new DataTestSuite(DataConstructor.create(abstractions));
|
|
32
|
+
return {
|
|
33
|
+
success: true,
|
|
34
|
+
ts: dataTestSuite
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
module.exports = new MarkupTestSuite();
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class LineData {
|
|
6
|
+
constructor(line, lineObject = null) {
|
|
7
|
+
this.line = line;
|
|
8
|
+
this.objects = lineObject ? [lineObject] : [];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
addObject(lineObject) {
|
|
12
|
+
this.objects.push(lineObject);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
module.exports = LineData;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class LineObject {
|
|
6
|
+
constructor(id, type, start, stop, element, top, line, linePosition, delta, percent, previousRealObject, nextRealObject) {
|
|
7
|
+
this.id = id;
|
|
8
|
+
this.type = type;
|
|
9
|
+
this.start = start;
|
|
10
|
+
this.stop = stop;
|
|
11
|
+
this.element = element;
|
|
12
|
+
this.top = top;
|
|
13
|
+
this.line = line;
|
|
14
|
+
this.linePosition = linePosition;
|
|
15
|
+
this.delta = delta;
|
|
16
|
+
this.percent = percent;
|
|
17
|
+
this.previousRealObject = previousRealObject;
|
|
18
|
+
this.nextRealObject = nextRealObject;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
module.exports = LineObject;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class ScrollData {
|
|
6
|
+
constructor(line = 0, delta = 0.0, top = 0.0, length = Number.MAX_SAFE_INTEGER) {
|
|
7
|
+
this.line = line;
|
|
8
|
+
this.delta = delta;
|
|
9
|
+
this.top = top;
|
|
10
|
+
this.length = length;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
setLength(length) {
|
|
14
|
+
this.length = length + 2;
|
|
15
|
+
this.setLine(this.line, this.delta);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
setLineFirst() {
|
|
19
|
+
this.line = 0
|
|
20
|
+
this.delta = 0.0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
setLineLast() {
|
|
24
|
+
this.line = this.length ;
|
|
25
|
+
this.delta = 0.0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
setLine(line = 0, delta = 0.0) {
|
|
29
|
+
if(line < 0) {
|
|
30
|
+
this.line = 0;
|
|
31
|
+
this.delta = 0;
|
|
32
|
+
}
|
|
33
|
+
else if(line >= 0 && line < this.length) {
|
|
34
|
+
this.line = line;
|
|
35
|
+
this.delta = delta;
|
|
36
|
+
}
|
|
37
|
+
else if(line >= this.length) {
|
|
38
|
+
this.line = this.length;
|
|
39
|
+
this.delta = 0;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
setScroll(top) {
|
|
44
|
+
this.top = top;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
increment(delta = 0.0) {
|
|
48
|
+
if(this.line < this.length) {
|
|
49
|
+
++this.line;
|
|
50
|
+
}
|
|
51
|
+
this.delta = delta;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
stepLines(lines) {
|
|
55
|
+
if(this.line + lines > this.length) {
|
|
56
|
+
this.line = this.length;
|
|
57
|
+
}
|
|
58
|
+
else if(this.line + lines < 0) {
|
|
59
|
+
this.line = 0;
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
this.line += lines;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
decrement(delta = 0.0) {
|
|
67
|
+
if(1 <= this.line) {
|
|
68
|
+
--this.line;
|
|
69
|
+
}
|
|
70
|
+
this.delta = delta;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
module.exports = ScrollData;
|