diff --git a/.gitignore b/.gitignore index ee7cd60..4bb5e54 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ -bower_components -node_modules/ +bower_components +bower_components-1.x +bower-1.x.json +node_modules/ diff --git a/bower.json b/bower.json index 2da3a46..77edf55 100644 --- a/bower.json +++ b/bower.json @@ -10,10 +10,21 @@ "package.json" ], "dependencies": { - "polymer": "^1.5.0" + "polymer": "Polymer/polymer#1.9 - 2.0" }, "devDependencies": { - "iron-test-helpers": "PolymerElements/iron-test-helpers#^1.1.5", - "web-component-tester": "^4.2.2" + "iron-test-helpers": "PolymerElements/iron-test-helpers#1 - 2", + "web-component-tester": "^6.0.0" + }, + "variants": { + "1.x": { + "dependencies": { + "polymer": "Polymer/polymer#^1.9.1" + }, + "devDependencies": { + "iron-test-helpers": "PolymerElements/iron-test-helpers#^1.4.1", + "web-component-tester": "^5.0.0" + } + } } } diff --git a/d2l-dom.html b/d2l-dom.html index 21b9055..636e4de 100644 --- a/d2l-dom.html +++ b/d2l-dom.html @@ -27,6 +27,8 @@ if (node.tagName === 'CONTENT') { nodes = node.getDistributedNodes(); + } else if (node.tagName === 'SLOT') { + nodes = node.assignedNodes({flatten: true}); } else { if (node.shadowRoot) { node = node.shadowRoot; @@ -53,6 +55,10 @@ } } + if (node.assignedSlot) { + return node.assignedSlot; + } + if (node.parentNode) { return node.parentNode; } else if (node.host) { diff --git a/demo/dom-focus-demo.html b/demo/dom-focus-demo.html new file mode 100644 index 0000000..94e5e85 --- /dev/null +++ b/demo/dom-focus-demo.html @@ -0,0 +1,27 @@ + + + + + + diff --git a/demo/dom-focus.html b/demo/dom-focus.html index 2e4a734..10851a9 100644 --- a/demo/dom-focus.html +++ b/demo/dom-focus.html @@ -1,7 +1,7 @@ D2L DOM Focus - + - -

d2l-dom-focus

focus order

diff --git a/package.json b/package.json index 78c42a1..98f35e4 100644 --- a/package.json +++ b/package.json @@ -3,11 +3,11 @@ "private": true, "description": "Shared Polymer behaviors for use in web components", "scripts": { - "postinstall": "bower install", + "postinstall": "polymer install --variants", "test": "npm run test:lint:js && npm run test:lint:wc", "test:lint:js": "eslint *.html", - "test:lint:wc": "polylint --input *.html", - "test:unit:local": "wct --skip-plugin sauce" + "test:lint:wc": "polymer lint --input *.html", + "test:unit:local": "polymer test --skip-plugin sauce" }, "repository": { "type": "git", @@ -16,11 +16,9 @@ "author": "D2L Corporation", "license": "Apache-2.0", "devDependencies": { - "bower": "^1.7.7", - "eslint": "^2.10.2", - "eslint-config-brightspace": "^0.2.1", - "eslint-plugin-html": "^1.4.0", - "polylint": "^2.10.0", - "web-component-tester": "^4.2.2" + "eslint": "^3.19.0", + "eslint-config-brightspace": "^0.2.4", + "eslint-plugin-html": "^3.0.0", + "polymer-cli": "^1.2.0" } } diff --git a/polymer.json b/polymer.json new file mode 100644 index 0000000..3d0892e --- /dev/null +++ b/polymer.json @@ -0,0 +1,7 @@ +{ + "lint": { + "rules": [ + "polymer-2-hybrid" + ] + } +} diff --git a/test/dom-focus.html b/test/dom-focus.html index 90c8180..b15e99d 100644 --- a/test/dom-focus.html +++ b/test/dom-focus.html @@ -18,7 +18,7 @@
- +
diff --git a/test/dom-visibility.html b/test/dom-visibility.html index 31c785c..ca6f516 100644 --- a/test/dom-visibility.html +++ b/test/dom-visibility.html @@ -22,7 +22,7 @@ }
- +