Skip to content

Commit 91cc372

Browse files
Merge pull request #39 from jonataswalker/update-deps
Update deps
2 parents 961a806 + 1892dcb commit 91cc372

31 files changed

+10144
-13572
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
charset = utf-8
6+
trim_trailing_whitespace = true
7+
insert_final_newline = true
8+
9+
# space indentation
10+
indent_style = space
11+
indent_size = 4
12+
13+
# tabs 2 spaces for makefiles
14+
[Makefile]
15+
indent_style = tab

.eslintignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
dist/*
2-
node_modules/*
3-
public/timepicker.js
1+
dist
2+
node_modules

.eslintrc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"root": true,
3+
"env": {
4+
"browser": true,
5+
"node": true
6+
},
7+
"extends": ["jwalker", "prettier"],
8+
"parserOptions": {
9+
"ecmaVersion": "latest",
10+
"sourceType": "module"
11+
},
12+
"reportUnusedDisableDirectives": true,
13+
"rules": {
14+
"default-case": "off",
15+
"no-prototype-builtins": "off",
16+
"unicorn/prevent-abbreviations": "off",
17+
"unicorn/prefer-query-selector": "off",
18+
"security/detect-non-literal-fs-filename": "off",
19+
"security/detect-object-injection": "off",
20+
"sonarjs/no-duplicate-string": "off"
21+
}
22+
}

.eslintrc.yaml

Lines changed: 0 additions & 129 deletions
This file was deleted.

.github/workflows/node.js.yml

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,34 @@
1-
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3-
41
name: Node.js CI
52

63
on:
7-
push:
8-
branches: [ master ]
9-
pull_request:
10-
branches: [ master ]
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
118

129
jobs:
13-
build:
10+
build:
11+
runs-on: ubuntu-latest
1412

15-
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
node-version: [14.x, 16.x]
1616

17-
strategy:
18-
matrix:
19-
node-version: [12.x, 14.x, 16.x]
20-
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
17+
steps:
18+
- name: Setup Chrome
19+
uses: browser-actions/setup-chrome@latest
2120

22-
steps:
23-
- name: Setup Chrome
24-
uses: browser-actions/setup-chrome@latest
21+
- uses: actions/checkout@v3
22+
- name: Use Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v3
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
cache: "npm"
27+
- run: npm ci
28+
- run: npm run build --if-present
29+
- run: npm run test:unit
2530

26-
- uses: actions/checkout@v3
27-
- name: Use Node.js ${{ matrix.node-version }}
28-
uses: actions/setup-node@v3
29-
with:
30-
node-version: ${{ matrix.node-version }}
31-
cache: 'npm'
32-
- run: npm ci
33-
- run: npm run build --if-present
34-
- run: npm run test:unit
35-
36-
- name: Run TestCafe tests on headless Chrome
37-
uses: DevExpress/testcafe-action@latest
38-
with:
39-
args: "chrome:headless test/e2e/*.test.js"
31+
- name: Run TestCafe tests on headless Chrome
32+
uses: DevExpress/testcafe-action@latest
33+
with:
34+
args: "chrome:headless test/e2e/*.test.js"

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"printWidth": 100,
3+
"semi": true,
4+
"singleQuote": true,
5+
"tabWidth": 4
6+
}

.prettierrc.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
{
2-
"[javascript]": {},
3-
"editor.codeActionsOnSave": {
4-
"source.fixAll": true,
5-
},
2+
"editor.rulers": [100, 120],
63
"editor.formatOnSave": true,
74
"editor.formatOnPaste": false,
8-
}
5+
"editor.codeActionsOnSave": {
6+
"source.fixAll": true
7+
},
8+
"[typescript]": {
9+
"editor.defaultFormatter": "esbenp.prettier-vscode"
10+
},
11+
"[javascript]": {
12+
"editor.defaultFormatter": "esbenp.prettier-vscode"
13+
},
14+
"[json]": {
15+
"editor.defaultFormatter": "esbenp.prettier-vscode"
16+
},
17+
"eslint.validate": ["javascript"]
18+
}

examples/example.js

Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,48 @@
11
/* global interact, ScrollWatcher */
2-
/* eslint-disable import/unambiguous */
32
const watcher = new ScrollWatcher();
43
const targets = document.getElementsByClassName('move');
54

65
let firstChild;
76

8-
[].forEach.call(targets, function (each) {
9-
const rect = watcher
10-
.watch(each)
11-
.on('enter', function (evt) {
12-
firstChild = evt.target.firstElementChild;
13-
evt.target.classList.add('enter');
14-
evt.target.classList.remove('partial-exit');
15-
firstChild.lastElementChild.textContent = 'entered';
16-
})
17-
.on('exit', function (evt) {})
18-
.on('enter:full', function (evt) {
19-
firstChild = evt.target.firstElementChild;
20-
evt.target.classList.add('fully-enter');
21-
firstChild.lastElementChild.textContent = 'fully entered';
22-
})
23-
.on('exit:partial', function (evt) {
24-
firstChild = evt.target.firstElementChild;
25-
evt.target.classList.add('partial-exit');
26-
evt.target.classList.remove('fully-enter');
27-
firstChild.lastElementChild.textContent = 'partial exited';
28-
});
7+
Array.prototype.forEach.call(targets, (each) => {
8+
const rect = watcher
9+
.watch(each)
10+
.on('enter', (evt) => {
11+
firstChild = evt.target.firstElementChild;
12+
evt.target.classList.add('enter');
13+
evt.target.classList.remove('partial-exit');
14+
firstChild.lastElementChild.textContent = 'entered';
15+
})
16+
.on('exit', () => {})
17+
.on('enter:full', (evt) => {
18+
firstChild = evt.target.firstElementChild;
19+
evt.target.classList.add('fully-enter');
20+
firstChild.lastElementChild.textContent = 'fully entered';
21+
})
22+
.on('exit:partial', (evt) => {
23+
firstChild = evt.target.firstElementChild;
24+
evt.target.classList.add('partial-exit');
25+
evt.target.classList.remove('fully-enter');
26+
firstChild.lastElementChild.textContent = 'partial exited';
27+
});
2928

30-
interact(each).draggable({
31-
inertia: true,
29+
interact(each).draggable({
30+
inertia: true,
3231

33-
onmove(event) {
34-
const target = event.target;
35-
const x = (Number.parseFloat(target.getAttribute('data-x')) || 0) + event.dx;
36-
const y = (Number.parseFloat(target.getAttribute('data-y')) || 0) + event.dy;
32+
onmove(event) {
33+
const { target, dx, dy } = event;
34+
const x = (Number.parseFloat(target.dataset.x) || 0) + dx;
35+
const y = (Number.parseFloat(target.dataset.y) || 0) + dy;
3736

38-
target.style.transform = `translate(${x}px, ${y}px)`;
39-
target.dataset.x = x;
40-
target.dataset.y = y;
41-
},
37+
target.style.transform = `translate(${x}px, ${y}px)`;
38+
target.dataset.x = x;
39+
target.dataset.y = y;
40+
},
4241

43-
onend(event) {
44-
rect.target.firstElementChild.lastElementChild.textContent = '';
45-
rect.target.classList.remove('enter', 'fully-enter', 'partial-exit');
46-
rect.update();
47-
},
48-
});
42+
onend() {
43+
rect.target.firstElementChild.lastElementChild.textContent = '';
44+
rect.target.classList.remove('enter', 'fully-enter', 'partial-exit');
45+
rect.update();
46+
},
47+
});
4948
});

0 commit comments

Comments
 (0)