diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 145c39a..9febebb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,6 @@ on: - master jobs: release: - if: "!contains(github.event.head_commit.message, 'skip ci')" name: Release timeout-minutes: 2 runs-on: ubuntu-latest diff --git a/d2l-tspan.js b/d2l-tspan.js index a43bc75..b6abbdb 100644 --- a/d2l-tspan.js +++ b/d2l-tspan.js @@ -3,7 +3,7 @@ import './d2l-table-observer-behavior.js'; import './d2l-td.js'; import { Polymer } from '@polymer/polymer/lib/legacy/polymer-fn.js'; import { dom } from '@polymer/polymer/lib/legacy/polymer.dom.js'; -import 'd2l-resize-aware/d2l-resize-aware.js'; +import ResizeObserver from 'resize-observer-polyfill/dist/ResizeObserver.es.js'; const $_documentContainer = document.createElement('template'); $_documentContainer.innerHTML = ` @@ -67,16 +67,16 @@ $_documentContainer.innerHTML = ` border-bottom: var(--d2l-table-light-border); } - d2l-resize-aware { + #resize-detector { display: block; width: 100%; }
- +
- +
@@ -131,10 +131,11 @@ Polymer({ } }, ready: function() { - this._onSizeChanged = this._onSizeChanged.bind(this); + this._resizeObserver = new ResizeObserver(()=> this._onSizeChanged()); }, attached: function() { - this.$['resize-detector'].addEventListener('d2l-resize-aware-resized', this._onSizeChanged); + const resizeDetector = this.$['resize-detector']; + this._resizeObserver.observe(resizeDetector); var slot = dom(this.root).querySelector('#float'); if (this.focusedStyling) { slot.addEventListener('focusout', this._boundFocusOutHandler); @@ -143,7 +144,10 @@ Polymer({ this.root.host.style.height = this.$.float.offsetHeight + 'px'; }, detached: function() { - this.$['resize-detector'].removeEventListener('d2l-resize-aware-resized', this._onSizeChanged); + if (this._resizeObserver) { + this._resizeObserver.disconnect(); + this._resizeObserver = null; + } var slot = dom(this.root).querySelector('#float'); if (this.focusedStyling) { slot.removeEventListener('focusout', this._boundFocusOutHandler); diff --git a/package.json b/package.json index 61def3a..4f38bad 100644 --- a/package.json +++ b/package.json @@ -11,27 +11,21 @@ }, "name": "d2l-table", "scripts": { - "lint": "npm run lint:wc && npm run lint:js", - "lint:js": "eslint . --ext .js,.html test/**/*.js test/**/*.html demo/**/*.js demo/**/*.html", - "lint:wc": "polymer lint", - "test:polymer:local": "polymer test --skip-plugin sauce", - "test": "npm run lint && npm run test:polymer:local" + "lint": "npm run lint:js", + "lint:js": "eslint . --ext .js,.html demo/**/*.html", + "test": "npm run lint", + "start": "wds --node-resolve --watch --open demo/" }, "author": "D2L Corporation", "license": "Apache-2.0", "devDependencies": { - "@polymer/iron-component-page": "^4.0.0", "@webcomponents/webcomponentsjs": "^2.2.6", + "@web/dev-server": "^0.2", "babel-eslint": "^10.0.1", - "chromedriver": "^2.34.1", "d2l-typography": "BrightspaceUI/typography#semver:^7", "eslint": "^4.15.0", "eslint-config-brightspace": "^0.4.0", - "eslint-plugin-html": "^4.0.1", - "polymer-cli": "^1.9.5", - "sauce-connect-launcher": "^1.2.3", - "sauceconnect-runner": "git+https://github.com/Brightspace/sauceconnect-runner.git#v0.3.0", - "wct-browser-legacy": "^1.0.1" + "eslint-plugin-html": "^4.0.1" }, "version": "2.2.8", "resolutions": { @@ -42,12 +36,12 @@ }, "main": "d2l-table.js", "dependencies": { - "d2l-colors": "BrightspaceUI/colors#semver:^4", - "d2l-resize-aware": "github:BrightspaceUI/resize-aware#semver:^1", - "fastdom": "^1.0.8", - "d2l-icons": "BrightspaceUI/icons#semver:^6", "@polymer/iron-resizable-behavior": "^3.0.0", "@polymer/polymer": "^3.0.0", + "d2l-colors": "BrightspaceUI/colors#semver:^4", + "d2l-icons": "BrightspaceUI/icons#semver:^6", + "fastdom": "^1.0.8", + "resize-observer-polyfill": "^1.5.1", "stickyfilljs": "^2.1.0" } } diff --git a/test/.eslintrc b/test/.eslintrc deleted file mode 100644 index 2072cb0..0000000 --- a/test/.eslintrc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "env": { - "es6": true, - "mocha": true - }, - "rules": { - "no-invalid-this": 0 - }, - "globals": { - "fixture": true, - "flush": true, - "expect": true, - "sinon": true, - "WCT": true, - "a11ySuite": true - } -} diff --git a/test/d2l-scroll-wrapper.html b/test/d2l-scroll-wrapper.html deleted file mode 100644 index 78f1656..0000000 --- a/test/d2l-scroll-wrapper.html +++ /dev/null @@ -1,326 +0,0 @@ - - - - - wrapper tests - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/d2l-table.html b/test/d2l-table.html deleted file mode 100644 index f4a17e6..0000000 --- a/test/d2l-table.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - wrapper tests - - - - - - - - - - - - - - diff --git a/test/index.html b/test/index.html deleted file mode 100644 index c82569e..0000000 --- a/test/index.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - d2l-table tests - - - - - - -