Skip to content

Commit 747c747

Browse files
authored
Merge pull request #6 from EclipseTrading/feature/update-jsdoc-for-ts-compiler
Use TypeScript compiler for Hypergrid JS build
2 parents 0b32592 + 5b42556 commit 747c747

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+1059
-2315
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99

1010
/node_modules
1111
/lib
12+
/dist

.npmignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,4 @@ build
1919
/*.sh
2020
/*.md
2121

22-
/src/behaviors/index.js
23-
/src/lib/index.js
22+
/src

css/index.js

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
'use strict';
22

3-
exports.grid = [
4-
'.hypergrid-container {',
5-
' position: relative;',
6-
' height: 500px;',
7-
'}',
8-
'.hypergrid-container > div:first-child {',
9-
' position: absolute;',
10-
' left: 0;',
11-
' top: 0;',
12-
' right: 0;',
13-
' bottom: 0;',
14-
'}',
15-
'.hypergrid-container > div:first-child > div.info {',
16-
' position: absolute;',
17-
' display: none; /* initially hidden */',
18-
' margin-top: 150px; /* to place below headers */',
19-
' color: #eee;',
20-
' text-shadow: 1px 1px #ccc;',
21-
' font-size: 36pt;',
22-
' font-weight: bold;',
23-
' text-align: center;',
24-
' top: 0; right: 0; bottom: 0; left: 0;',
25-
'}',
26-
'.hypergrid-textfield {',
27-
' position: absolute;',
28-
' font-size: 12px;',
29-
' color: black;',
30-
' background-color: ivory;',
31-
' box-sizing: border-box;',
32-
' margin: 0;',
33-
' padding: 0 5px;',
34-
' border: 0; /*border: 1px solid #777;*/',
35-
' outline: 0;',
36-
'}',
37-
'',
38-
'.hypergrid {',
39-
' touch-action: none;',
40-
'}'
41-
].join('\n');
3+
exports.grid = `
4+
.hypergrid-container {
5+
position: relative;
6+
height: 500px;
7+
}
8+
.hypergrid-container > div:first-child {
9+
position: absolute;
10+
left: 0;
11+
top: 0;
12+
right: 0;
13+
bottom: 0;
14+
}
15+
.hypergrid-container > div:first-child > div.info {
16+
position: absolute;
17+
display: none; /* initially hidden */
18+
margin-top: 150px; /* to place below headers */
19+
color: #eee;
20+
text-shadow: 1px 1px #ccc;
21+
font-size: 36pt;
22+
font-weight: bold;
23+
text-align: center;
24+
top: 0; right: 0; bottom: 0; left: 0;
25+
}
26+
.hypergrid-textfield {
27+
position: absolute;
28+
font-size: 12px;
29+
color: black;
30+
background-color: ivory;
31+
box-sizing: border-box;
32+
margin: 0;
33+
padding: 0 5px;
34+
border: 0; /*border: 1px solid #777;*/
35+
outline: 0;
36+
}
37+
38+
.hypergrid {
39+
touch-action: none;
40+
}
41+
`;

gulpfile.js

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -91,25 +91,8 @@ function swallowImages() {
9191
function templates(src, type) {
9292
return gulp.src(src)
9393
.pipe($$.each(function(content, file, callback) {
94-
var filename = path.basename(file.path, "." + type),
95-
member = /[^\w]/.test(filename) ? "['" + filename + "']" : "." + filename;
96-
97-
// convert (groups of) 4 space chars at start of lines to tab(s)
98-
do {
99-
var len = content.length;
100-
content = content.replace(/\n(( )*) (.*)/, "\n$1\t$3");
101-
} while (content.length < len);
102-
103-
// quote each line and join them into a single string
104-
content = 'exports' + member + " = [\n'" + content
105-
.replace(/\\/g, "\\\\") // escape all backslashes
106-
.replace(/'/g, "\\'") // escape all single-quotes
107-
.replace(/\n/g, "',\n'") + "'\n].join('\\n');\n";
108-
109-
// remove possible blank line at end of each
110-
content = content.replace(/,\n''\n]/g, "\n]");
111-
112-
callback(null, content); // the first argument is an error, if you encounter one
94+
let filename = path.basename(file.path, "." + type);
95+
callback(null, `exports.${filename} = \`\n${content}\`;\n`); // the first argument is an error, if you encounter one
11396
}))
11497
.pipe($$.concat("index.js"))
11598
.pipe($$.header("'use strict';\n\n"))

images/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// @ts-nocheck
12
/* eslint-env browser */
23

34
/**
@@ -96,7 +97,7 @@ images['checkbox-off'] = images.unchecked;
9697
* Possible styles must be one of those listed in {*link https://github.com/joneit/svg-themer/blob/master/README.md#cssimagepropertynames svgThemer.cssImagePropertyNames} (which you can extend if needed).
9798
* * Will be automatically themed when the grid is themed (which is the whole point).
9899
*
99-
* @see {@link https://github.com/joneit/svg-themer}
100+
* {@link https://github.com/joneit/svg-themer}
100101
* @memberOf module:images
101102
*/
102103
function add(name, img, themeable, setSvgProps, styles) {

0 commit comments

Comments
 (0)