diff --git a/package-lock.json b/package-lock.json index 22295bdc4..09b10e7b7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,23 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/runtime": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.3.4.tgz", + "integrity": "sha512-IvfvnMdSaLBateu0jfsYIpZTxAc2cKEXEMiezGGN75QcBcecDUKd3PgLAncT0oOgxKy8dd8hrJKj9MfzgfZd6g==", + "dev": true, + "requires": { + "regenerator-runtime": "^0.12.0" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz", + "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==", + "dev": true + } + } + }, "@dcos/eslint-config": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/@dcos/eslint-config/-/eslint-config-0.3.1.tgz", @@ -3294,12 +3311,6 @@ } } }, - "chain-function": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/chain-function/-/chain-function-1.0.0.tgz", - "integrity": "sha1-DUqzfn4Y6tC9xHuSB2QRjOWHM9w=", - "dev": true - }, "chalk": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.1.tgz", @@ -4900,10 +4911,13 @@ } }, "dom-helpers": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-3.2.1.tgz", - "integrity": "sha1-MgPgf+0he9H0JLAZc1WC/Deyglo=", - "dev": true + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-3.4.0.tgz", + "integrity": "sha512-LnuPJ+dwqKDIyotW1VzmOZ5TONUN7CwkCR5hrgawTUbkBGYdeoNLZo6nNfGkCrjtE1nXXaj7iMMpDa8/d9WoIA==", + "dev": true, + "requires": { + "@babel/runtime": "^7.1.2" + } }, "domain-browser": { "version": "1.2.0", @@ -7025,8 +7039,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true, - "optional": true + "dev": true }, "aproba": { "version": "1.1.1", @@ -7085,8 +7098,7 @@ "version": "0.4.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=", - "dev": true, - "optional": true + "dev": true }, "bcrypt-pbkdf": { "version": "1.0.1", @@ -7103,7 +7115,6 @@ "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", "dev": true, - "optional": true, "requires": { "inherits": "~2.0.0" } @@ -7113,7 +7124,6 @@ "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", "dev": true, - "optional": true, "requires": { "hoek": "2.x.x" } @@ -7123,7 +7133,6 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.7.tgz", "integrity": "sha1-Pv/DxQ4ABTH7cg6v+A8K6O8jz1k=", "dev": true, - "optional": true, "requires": { "balanced-match": "^0.4.1", "concat-map": "0.0.1" @@ -7133,8 +7142,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", "integrity": "sha1-mXjOMXOIxkmth5MCjDR37wRKi1E=", - "dev": true, - "optional": true + "dev": true }, "caseless": { "version": "0.12.0", @@ -7154,15 +7162,13 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true, - "optional": true + "dev": true }, "combined-stream": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=", "dev": true, - "optional": true, "requires": { "delayed-stream": "~1.0.0" } @@ -7171,29 +7177,25 @@ "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true, - "optional": true + "dev": true }, "console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", - "dev": true, - "optional": true + "dev": true }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true, - "optional": true + "dev": true }, "cryptiles": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", "dev": true, - "optional": true, "requires": { "boom": "2.x.x" } @@ -7238,8 +7240,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true, - "optional": true + "dev": true }, "delegates": { "version": "1.0.0", @@ -7276,8 +7277,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz", "integrity": "sha1-4QgOBljjALBilJkMxw4VAiNf1VA=", - "dev": true, - "optional": true + "dev": true }, "forever-agent": { "version": "0.6.1", @@ -7302,15 +7302,13 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true, - "optional": true + "dev": true }, "fstream": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", "dev": true, - "optional": true, "requires": { "graceful-fs": "^4.1.2", "inherits": "~2.0.0", @@ -7371,7 +7369,6 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, - "optional": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -7385,8 +7382,7 @@ "version": "4.1.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true, - "optional": true + "dev": true }, "har-schema": { "version": "1.0.5", @@ -7418,7 +7414,6 @@ "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", "dev": true, - "optional": true, "requires": { "boom": "2.x.x", "cryptiles": "2.x.x", @@ -7430,8 +7425,7 @@ "version": "2.16.3", "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", - "dev": true, - "optional": true + "dev": true }, "http-signature": { "version": "1.1.1", @@ -7450,7 +7444,6 @@ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, - "optional": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -7460,8 +7453,7 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true, - "optional": true + "dev": true }, "ini": { "version": "1.3.4", @@ -7475,7 +7467,6 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -7491,8 +7482,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true, - "optional": true + "dev": true }, "isstream": { "version": "0.1.2", @@ -7575,15 +7565,13 @@ "version": "1.27.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.27.0.tgz", "integrity": "sha1-gg9XIpa70g7CXtVeW13oaeVDbrE=", - "dev": true, - "optional": true + "dev": true }, "mime-types": { "version": "2.1.15", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.15.tgz", "integrity": "sha1-pOv1BkCUVpI3uM9wBGd20J/JKu0=", "dev": true, - "optional": true, "requires": { "mime-db": "~1.27.0" } @@ -7593,7 +7581,6 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -7602,15 +7589,13 @@ "version": "0.0.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true, - "optional": true + "dev": true }, "mkdirp": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -7670,8 +7655,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true, - "optional": true + "dev": true }, "oauth-sign": { "version": "0.8.2", @@ -7692,7 +7676,6 @@ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, - "optional": true, "requires": { "wrappy": "1" } @@ -7726,8 +7709,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true, - "optional": true + "dev": true }, "performance-now": { "version": "0.2.0", @@ -7740,8 +7722,7 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", - "dev": true, - "optional": true + "dev": true }, "punycode": { "version": "1.4.1", @@ -7784,7 +7765,6 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.9.tgz", "integrity": "sha1-z3jsb0ptHrQ9JkiMrJfwQudLf8g=", "dev": true, - "optional": true, "requires": { "buffer-shims": "~1.0.0", "core-util-is": "~1.0.0", @@ -7831,7 +7811,6 @@ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz", "integrity": "sha1-wjOOxkPfeht/5cVPqG9XQopV8z0=", "dev": true, - "optional": true, "requires": { "glob": "^7.0.5" } @@ -7840,8 +7819,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.0.1.tgz", "integrity": "sha1-0mPKVGls2KMGtcplUekt5XkY++c=", - "dev": true, - "optional": true + "dev": true }, "semver": { "version": "5.3.0", @@ -7869,7 +7847,6 @@ "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", "dev": true, - "optional": true, "requires": { "hoek": "2.x.x" } @@ -7906,7 +7883,6 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -7918,7 +7894,6 @@ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.1.tgz", "integrity": "sha1-YuIA8DmVWmgQ2N8KM//A8BNmLZg=", "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.0.1" } @@ -7935,7 +7910,6 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, - "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -7952,7 +7926,6 @@ "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", "dev": true, - "optional": true, "requires": { "block-stream": "*", "fstream": "^1.0.2", @@ -8014,8 +7987,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true, - "optional": true + "dev": true }, "uuid": { "version": "3.0.1", @@ -8048,8 +8020,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true, - "optional": true + "dev": true } } }, @@ -8997,7 +8968,6 @@ "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", "dev": true, - "optional": true, "requires": { "hoek": "2.x.x" } @@ -9059,8 +9029,7 @@ "version": "2.16.3", "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", - "dev": true, - "optional": true + "dev": true }, "http-signature": { "version": "1.1.1", @@ -17318,17 +17287,44 @@ "integrity": "sha512-ioMCzVDWvCvKD8eeT+iukyWrBGrA3DiFYkXfBsVYIRdaREZuBjENG+KjrikavCLasozqRWTwFUagU/O4vPpRMA==", "dev": true }, + "react-lifecycles-compat": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz", + "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==", + "dev": true + }, "react-transition-group": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-1.2.1.tgz", - "integrity": "sha1-4R9yslf5IbITIpp3TfRmEjRsfKY=", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-2.5.0.tgz", + "integrity": "sha512-qYB3JBF+9Y4sE4/Mg/9O6WFpdoYjeeYqx0AFb64PTazVy8RPMiE3A47CG9QmM4WJ/mzDiZYslV+Uly6O1Erlgw==", "dev": true, "requires": { - "chain-function": "^1.0.0", - "dom-helpers": "^3.2.0", - "loose-envify": "^1.3.1", - "prop-types": "^15.5.6", - "warning": "^3.0.0" + "dom-helpers": "^3.3.1", + "loose-envify": "^1.4.0", + "prop-types": "^15.6.2", + "react-lifecycles-compat": "^3.0.4" + }, + "dependencies": { + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "prop-types": { + "version": "15.7.2", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", + "integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==", + "dev": true, + "requires": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.8.1" + } + } } }, "read-file-stdin": { @@ -20579,15 +20575,6 @@ "makeerror": "1.0.x" } }, - "warning": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/warning/-/warning-3.0.0.tgz", - "integrity": "sha1-MuU3fLVy3kqwR1O9+IIcAe1gW3w=", - "dev": true, - "requires": { - "loose-envify": "^1.0.0" - } - }, "watch": { "version": "0.10.0", "resolved": "https://registry.npmjs.org/watch/-/watch-0.10.0.tgz", diff --git a/package.json b/package.json index 2bc06f460..b19555937 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "react": "^16.8.1", "react-dom": "^16.8.1", "react-gemini-scrollbar": "2.3.x", - "react-transition-group": "1.2.x", + "react-transition-group": "2.5.0", "semantic-release": "^15.13.3", "source-map-loader": "0.1.5", "stylelint": "7.10.1", @@ -84,7 +84,7 @@ "cnvs": "1.1.14", "react": ">= 16.8.0", "react-dom": ">= 16.8.0", - "react-transition-group": "1.2.x", + "react-transition-group": ">= 2.5.0", "react-gemini-scrollbar": "^2.1.5 || ^2.3.0" }, "scripts": { diff --git a/src/Dropdown/Dropdown.js b/src/Dropdown/Dropdown.js index 04d474310..8cb62dcfb 100644 --- a/src/Dropdown/Dropdown.js +++ b/src/Dropdown/Dropdown.js @@ -2,7 +2,7 @@ import classNames from "classnames"; import GeminiScrollbar from "react-gemini-scrollbar"; import React from "react"; import PropTypes from "prop-types"; -import { CSSTransitionGroup } from "react-transition-group"; +import { CSSTransition } from "react-transition-group"; import ReactDOM from "react-dom"; import BindMixin from "../Mixin/BindMixin"; @@ -20,9 +20,7 @@ class Dropdown extends Util.mixin(BindMixin) { "handleExternalClick", "handleKeyDown", "handleMenuRender", - "handleWrapperBlur", - "setDropdownMenuRef", - "setDropdownWrapperRef" + "handleWrapperBlur" ]; } @@ -38,6 +36,8 @@ class Dropdown extends Util.mixin(BindMixin) { renderHidden: false, selectedID: null }; + this.dropdownMenuRef = React.createRef(); + this.dropdownWrapperRef = React.createRef(); } componentWillMount() { @@ -161,7 +161,7 @@ class Dropdown extends Util.mixin(BindMixin) { let menuDirection = this.state.menuDirection; const menuPositionStyle = {}; const spaceAroundDropdownButton = DOMUtil.getNodeClearance( - this.dropdownWrapperRef + this.dropdownWrapperRef.current ); const dropdownChildHeight = this.dropdownMenuRef && this.dropdownMenuRef.current @@ -174,7 +174,6 @@ class Dropdown extends Util.mixin(BindMixin) { const isMenuShorterThanTop = !isMenuTallerThanTop; const isTopTallerThanBottom = spaceAroundDropdownButton.top > spaceAroundDropdownButton.bottom; - // If the menu height is larger than the space available on the bottom and // less than the space available on top, then render it up. If the height // of the menu exceeds the space below and above, but there is more space @@ -317,14 +316,6 @@ class Dropdown extends Util.mixin(BindMixin) { ); } - setDropdownMenuRef(element) { - this.dropdownMenuRef = element; - } - - setDropdownWrapperRef(element) { - this.dropdownWrapperRef = element; - } - render() { // Set a key based on the menu height so that React knows to keep the // the DOM element around while we are measuring it. @@ -383,9 +374,10 @@ class Dropdown extends Util.mixin(BindMixin) { dropdownMenu = (
@@ -401,17 +393,18 @@ class Dropdown extends Util.mixin(BindMixin) { {dropdownMenu}
); - } - - if (props.transition) { + } else if (props.transition) { dropdownMenu = ( - {dropdownMenu} - + ); } @@ -420,7 +413,7 @@ class Dropdown extends Util.mixin(BindMixin) { className={wrapperClassSet} tabIndex="1" onBlur={this.handleWrapperBlur} - ref={this.setDropdownWrapperRef} + ref={this.dropdownWrapperRef} > {React.cloneElement(trigger, { selectedItem: this.getSelectedItem(this.getSelectedID(), items), @@ -442,7 +435,7 @@ Dropdown.defaultProps = { transition: false, transitionName: "dropdown-menu", transitionEnterTimeout: 250, - transitionLeaveTimeout: 250, + transitionExitTimeout: 250, onItemSelection: () => {}, useGemini: true, trigger: , @@ -491,7 +484,7 @@ Dropdown.propTypes = { transitionName: PropTypes.string, // Transition lengths transitionEnterTimeout: PropTypes.number, - transitionLeaveTimeout: PropTypes.number, + transitionExitTimeout: PropTypes.number, trigger: PropTypes.element, // Option to use Gemini scrollbar. Defaults to true. useGemini: PropTypes.bool, diff --git a/src/Dropdown/styles.less b/src/Dropdown/styles.less index 014028574..d4befed9d 100644 --- a/src/Dropdown/styles.less +++ b/src/Dropdown/styles.less @@ -9,7 +9,7 @@ } } -@keyframes dropdown-down-leave { +@keyframes dropdown-down-exit { 0% { transform: translateY(0); @@ -31,7 +31,7 @@ } } -@keyframes dropdown-up-leave { +@keyframes dropdown-up-exit { 0% { transform: translateY(0); @@ -153,8 +153,8 @@ animation: dropdown-fade-in 250ms both, dropdown-down-enter 250ms both; } -.dropdown-menu-down-leave { - animation: dropdown-fade-out 250ms both, dropdown-down-leave 250ms both; +.dropdown-menu-down-exit { + animation: dropdown-fade-out 250ms both, dropdown-down-exit 250ms both; z-index: 3; } @@ -162,8 +162,8 @@ animation: dropdown-fade-in 250ms both, dropdown-up-enter 250ms both; } -.dropdown-menu-up-leave { - animation: dropdown-fade-out 250ms both, dropdown-up-leave 250ms both; +.dropdown-menu-up-exit { + animation: dropdown-fade-out 250ms both, dropdown-up-exit 250ms both; z-index: 3; } diff --git a/src/List/List.js b/src/List/List.js index d1a942ac5..73ba86c92 100644 --- a/src/List/List.js +++ b/src/List/List.js @@ -1,35 +1,20 @@ import React from "react"; import PropTypes from "prop-types"; -import { CSSTransitionGroup } from "react-transition-group"; import ListItem from "./ListItem"; import Util from "../Util/Util"; class List extends React.Component { getListItems(list, childIndex = 0) { - const { props } = this; const items = list.map((item, parentIndex) => { const key = `${parentIndex}.${childIndex}`; childIndex++; - const htmlAttributes = Util.exclude(item, [ - "content", - "transitionName", - "transitionEnterTimeout", - "transitionLeaveTimeout" - ]); + const htmlAttributes = Util.exclude(item, ["content"]); if (Util.isArrayLike(item.content)) { return ( - + {this.getListItems(item.content, childIndex)} ); @@ -52,21 +37,6 @@ class List extends React.Component { // Uses all passed properties as attributes, excluding propTypes const htmlAttributes = Util.exclude(props, Object.keys(List.propTypes)); - if (props.transition) { - return ( - - {this.getListItems(props.content)} - - ); - } - return ( {this.getListItems(props.content)} @@ -77,11 +47,7 @@ class List extends React.Component { List.defaultProps = { className: "list", - tag: "ul", - transition: true, - transitionName: "list-item", - transitionEnterTimeout: 500, - transitionLeaveTimeout: 500 + tag: "ul" }; List.propTypes = { @@ -104,12 +70,7 @@ List.propTypes = { PropTypes.string ]).isRequired, // Optional tag for the container of the list - tag: PropTypes.string, - transition: PropTypes.bool, - transitionName: PropTypes.string, - // Transition lengths - transitionEnterTimeout: PropTypes.number, - transitionLeaveTimeout: PropTypes.number + tag: PropTypes.string }; module.exports = List; diff --git a/src/List/ListItem.js b/src/List/ListItem.js index ddc1815bd..00b808ee4 100644 --- a/src/List/ListItem.js +++ b/src/List/ListItem.js @@ -1,6 +1,5 @@ import React from "react"; import PropTypes from "prop-types"; -import { CSSTransitionGroup } from "react-transition-group"; import Util from "../Util/Util"; @@ -12,18 +11,6 @@ class ListItem extends React.Component { // Uses all passed properties as attributes, excluding propTypes const htmlAttributes = Util.exclude(props, Object.keys(ListItem.propTypes)); - if (props.transition) { - return ( - - {props.children} - - ); - } - return ( {props.children} @@ -40,8 +27,7 @@ ListItem.defaultProps = { ListItem.propTypes = { children: PropTypes.node, className: PropTypes.string, - tag: PropTypes.string, - transition: PropTypes.bool + tag: PropTypes.string }; module.exports = ListItem; diff --git a/src/List/styles.less b/src/List/styles.less index 3ab4d983d..c7fc7db54 100644 --- a/src/List/styles.less +++ b/src/List/styles.less @@ -28,6 +28,6 @@ animation: list-fade-in-left 500ms; } -.list-item-leave { +.list-item-exit { animation: list-fade-out-right 500ms; } diff --git a/src/Modal/ModalContents.js b/src/Modal/ModalContents.js index a41251d9c..97dedcbf4 100644 --- a/src/Modal/ModalContents.js +++ b/src/Modal/ModalContents.js @@ -6,11 +6,12 @@ import React from "react"; import PropTypes from "prop-types"; /** * Lifecycle of a Modal: - * initial page load -> empty ReactCSSTransitionGroup + * initial page load -> empty TransitionGroup * interaction changes open to true -> render modal content without scrollbars * get height of content -> rerender modal content and cap the height */ -import { CSSTransitionGroup } from "react-transition-group"; + +import { CSSTransition } from "react-transition-group"; import BindMixin from "../Mixin/BindMixin"; import DOMUtil from "../Util/DOMUtil"; @@ -380,18 +381,20 @@ class ModalContents extends Util.mixin(BindMixin) { } return ( - - {modalContent} - +
{modalContent}
+ ); } } @@ -409,10 +412,10 @@ ModalContents.defaultProps = { transitionNameModal: "modal", transitionAppearTimeoutModal: 300, transitionEnterTimeoutModal: 300, - transitionLeaveTimeoutModal: 300, + transitionExitTimeoutModal: 300, transitionAppear: true, transitionEnter: true, - transitionLeave: true, + transitionExit: true, useGemini: true, // Default classes. @@ -455,11 +458,11 @@ ModalContents.propTypes = { // Transition lengths, must be non-zero transitionAppearTimeoutModal: PropTypes.number, transitionEnterTimeoutModal: PropTypes.number, - transitionLeaveTimeoutModal: PropTypes.number, + transitionExitTimeoutModal: PropTypes.number, // Optionally disable transitions transitionAppear: PropTypes.bool, transitionEnter: PropTypes.bool, - transitionLeave: PropTypes.bool, + transitionExit: PropTypes.bool, // Option to use Gemini scrollbar. Defaults to true. useGemini: PropTypes.bool, diff --git a/src/Modal/styles.less b/src/Modal/styles.less index 8b2b5f8f8..9c9aab76b 100644 --- a/src/Modal/styles.less +++ b/src/Modal/styles.less @@ -69,7 +69,7 @@ } } - .modal-leave { + .modal-exit { .modal { opacity: 1; @@ -80,7 +80,7 @@ opacity: 1; } - &.modal-leave-active { + &.modal-exit-active { .modal { opacity: 0; diff --git a/src/Table/Table.js b/src/Table/Table.js index 307c22036..e2f97b69d 100644 --- a/src/Table/Table.js +++ b/src/Table/Table.js @@ -56,6 +56,8 @@ class Table extends React.Component { this.cachedIDs = []; this.container = window; + this.containerRef = React.createRef(); + this.headersRef = React.createRef(); this.itemHeightContainer = React.createRef(); } @@ -316,8 +318,8 @@ class Table extends React.Component { const itemHeight = state.itemHeight || props.itemHeight || 0; return ( -
- +
+
{props.colGroup} {this.getHeaders(columns, sortBy)} diff --git a/src/Table/styles.less b/src/Table/styles.less index 2bb060d31..af3343f40 100644 --- a/src/Table/styles.less +++ b/src/Table/styles.less @@ -66,6 +66,6 @@ animation: table-fade-in-left 0.5s; } -.table-row-leave { +.table-row-exit { animation: table-fade-out-right 0.5s; } diff --git a/src/VirtualList/__tests__/VirtualList-test.js b/src/VirtualList/__tests__/VirtualList-test.js index 8a1829d7d..ee2d2157e 100644 --- a/src/VirtualList/__tests__/VirtualList-test.js +++ b/src/VirtualList/__tests__/VirtualList-test.js @@ -23,10 +23,10 @@ describe("VirtualList", function() { items={[1]} itemHeight={10} renderItem={function(item) { - return item; + return item; }} renderBufferItem={function(item) { - return item; + return item; }} />, this.container