Skip to content

Commit

Permalink
Merge pull request #39 from jonataswalker/update-deps
Browse files Browse the repository at this point in the history
Update deps
  • Loading branch information
jonataswalker authored Apr 11, 2022
2 parents 961a806 + 1892dcb commit 91cc372
Show file tree
Hide file tree
Showing 31 changed files with 10,144 additions and 13,572 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

# space indentation
indent_style = space
indent_size = 4

# tabs 2 spaces for makefiles
[Makefile]
indent_style = tab
5 changes: 2 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
dist/*
node_modules/*
public/timepicker.js
dist
node_modules
22 changes: 22 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"root": true,
"env": {
"browser": true,
"node": true
},
"extends": ["jwalker", "prettier"],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"reportUnusedDisableDirectives": true,
"rules": {
"default-case": "off",
"no-prototype-builtins": "off",
"unicorn/prevent-abbreviations": "off",
"unicorn/prefer-query-selector": "off",
"security/detect-non-literal-fs-filename": "off",
"security/detect-object-injection": "off",
"sonarjs/no-duplicate-string": "off"
}
}
129 changes: 0 additions & 129 deletions .eslintrc.yaml

This file was deleted.

55 changes: 25 additions & 30 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,34 @@
# 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
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build:
build:
runs-on: ubuntu-latest

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

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

steps:
- name: Setup Chrome
uses: browser-actions/setup-chrome@latest
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm ci
- run: npm run build --if-present
- run: npm run test:unit

- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm run test:unit

- name: Run TestCafe tests on headless Chrome
uses: DevExpress/testcafe-action@latest
with:
args: "chrome:headless test/e2e/*.test.js"
- name: Run TestCafe tests on headless Chrome
uses: DevExpress/testcafe-action@latest
with:
args: "chrome:headless test/e2e/*.test.js"
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"printWidth": 100,
"semi": true,
"singleQuote": true,
"tabWidth": 4
}
12 changes: 0 additions & 12 deletions .prettierrc.yaml

This file was deleted.

20 changes: 15 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
{
"[javascript]": {},
"editor.codeActionsOnSave": {
"source.fixAll": true,
},
"editor.rulers": [100, 120],
"editor.formatOnSave": true,
"editor.formatOnPaste": false,
}
"editor.codeActionsOnSave": {
"source.fixAll": true
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"eslint.validate": ["javascript"]
}
75 changes: 37 additions & 38 deletions examples/example.js
Original file line number Diff line number Diff line change
@@ -1,49 +1,48 @@
/* global interact, ScrollWatcher */
/* eslint-disable import/unambiguous */
const watcher = new ScrollWatcher();
const targets = document.getElementsByClassName('move');

let firstChild;

[].forEach.call(targets, function (each) {
const rect = watcher
.watch(each)
.on('enter', function (evt) {
firstChild = evt.target.firstElementChild;
evt.target.classList.add('enter');
evt.target.classList.remove('partial-exit');
firstChild.lastElementChild.textContent = 'entered';
})
.on('exit', function (evt) {})
.on('enter:full', function (evt) {
firstChild = evt.target.firstElementChild;
evt.target.classList.add('fully-enter');
firstChild.lastElementChild.textContent = 'fully entered';
})
.on('exit:partial', function (evt) {
firstChild = evt.target.firstElementChild;
evt.target.classList.add('partial-exit');
evt.target.classList.remove('fully-enter');
firstChild.lastElementChild.textContent = 'partial exited';
});
Array.prototype.forEach.call(targets, (each) => {
const rect = watcher
.watch(each)
.on('enter', (evt) => {
firstChild = evt.target.firstElementChild;
evt.target.classList.add('enter');
evt.target.classList.remove('partial-exit');
firstChild.lastElementChild.textContent = 'entered';
})
.on('exit', () => {})
.on('enter:full', (evt) => {
firstChild = evt.target.firstElementChild;
evt.target.classList.add('fully-enter');
firstChild.lastElementChild.textContent = 'fully entered';
})
.on('exit:partial', (evt) => {
firstChild = evt.target.firstElementChild;
evt.target.classList.add('partial-exit');
evt.target.classList.remove('fully-enter');
firstChild.lastElementChild.textContent = 'partial exited';
});

interact(each).draggable({
inertia: true,
interact(each).draggable({
inertia: true,

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

target.style.transform = `translate(${x}px, ${y}px)`;
target.dataset.x = x;
target.dataset.y = y;
},
target.style.transform = `translate(${x}px, ${y}px)`;
target.dataset.x = x;
target.dataset.y = y;
},

onend(event) {
rect.target.firstElementChild.lastElementChild.textContent = '';
rect.target.classList.remove('enter', 'fully-enter', 'partial-exit');
rect.update();
},
});
onend() {
rect.target.firstElementChild.lastElementChild.textContent = '';
rect.target.classList.remove('enter', 'fully-enter', 'partial-exit');
rect.update();
},
});
});
Loading

0 comments on commit 91cc372

Please sign in to comment.