diff --git a/package-lock.json b/package-lock.json index e096f1f2e1f..d0fb7899a41 100644 --- a/package-lock.json +++ b/package-lock.json @@ -711,9 +711,9 @@ }, "dependencies": { "bl": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.0.2.tgz", - "integrity": "sha512-j4OH8f6Qg2bGuWfRiltT2HYGx0e1QcBTrK9KAHNMwMZdQnDZFk0ZSYIpADjYCB3U12nicC5tVJwSIhwOWjb4RQ==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.0.3.tgz", + "integrity": "sha512-fs4G6/Hu4/EE+F75J8DuN/0IpQqNjAdC7aEQv7Qt8MHGUH7Ckv2MwTEEeN9QehD0pfIDkMI1bkHYkKy7xHyKIg==", "dev": true, "requires": { "buffer": "^5.5.0", @@ -2359,16 +2359,6 @@ "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", "dev": true }, - "compare-func": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-1.3.4.tgz", - "integrity": "sha512-sq2sWtrqKPkEXAC8tEJA1+BqAH9GbFkGBtUOqrUX57VSfwp8xyktctk+uLoRy5eccTdxzDcVIztlYDpKs3Jv1Q==", - "dev": true, - "requires": { - "array-ify": "^1.0.0", - "dot-prop": "^3.0.0" - } - }, "component-bind": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", @@ -2569,13 +2559,40 @@ } }, "conventional-changelog-angular": { - "version": "5.0.10", - "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.10.tgz", - "integrity": "sha512-k7RPPRs0vp8+BtPsM9uDxRl6KcgqtCJmzRD1wRtgqmhQ96g8ifBGo9O/TZBG23jqlXS/rg8BKRDELxfnQQGiaA==", + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.11.tgz", + "integrity": "sha512-nSLypht/1yEflhuTogC03i7DX7sOrXGsRn14g131Potqi6cbGbGEE9PSDEHKldabB6N76HiSyw9Ph+kLmC04Qw==", "dev": true, "requires": { - "compare-func": "^1.3.1", + "compare-func": "^2.0.0", "q": "^1.5.1" + }, + "dependencies": { + "compare-func": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", + "integrity": "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==", + "dev": true, + "requires": { + "array-ify": "^1.0.0", + "dot-prop": "^5.1.0" + } + }, + "dot-prop": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "dev": true, + "requires": { + "is-obj": "^2.0.0" + } + }, + "is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "dev": true + } } }, "conventional-changelog-atom": { @@ -2597,30 +2614,57 @@ } }, "conventional-changelog-conventionalcommits": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.3.0.tgz", - "integrity": "sha512-oYHydvZKU+bS8LnGqTMlNrrd7769EsuEHKy4fh1oMdvvDi7fem8U+nvfresJ1IDB8K00Mn4LpiA/lR+7Gs6rgg==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.4.0.tgz", + "integrity": "sha512-ybvx76jTh08tpaYrYn/yd0uJNLt5yMrb1BphDe4WBredMlvPisvMghfpnJb6RmRNcqXeuhR6LfGZGewbkRm9yA==", "dev": true, "requires": { - "compare-func": "^1.3.1", + "compare-func": "^2.0.0", "lodash": "^4.17.15", "q": "^1.5.1" + }, + "dependencies": { + "compare-func": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", + "integrity": "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==", + "dev": true, + "requires": { + "array-ify": "^1.0.0", + "dot-prop": "^5.1.0" + } + }, + "dot-prop": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "dev": true, + "requires": { + "is-obj": "^2.0.0" + } + }, + "is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "dev": true + } } }, "conventional-changelog-core": { - "version": "4.1.7", - "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-4.1.7.tgz", - "integrity": "sha512-UBvSrQR2RdKbSQKh7RhueiiY4ZAIOW3+CSWdtKOwRv+KxIMNFKm1rOcGBFx0eA8AKhGkkmmacoTWJTqyz7Q0VA==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-4.2.0.tgz", + "integrity": "sha512-8+xMvN6JvdDtPbGBqA7oRNyZD4od1h/SIzrWqHcKZjitbVXrFpozEeyn4iI4af1UwdrabQpiZMaV07fPUTGd4w==", "dev": true, "requires": { "add-stream": "^1.0.0", - "conventional-changelog-writer": "^4.0.16", + "conventional-changelog-writer": "^4.0.17", "conventional-commits-parser": "^3.1.0", "dateformat": "^3.0.0", "get-pkg-repo": "^1.0.0", "git-raw-commits": "2.0.0", "git-remote-origin-url": "^2.0.0", - "git-semver-tags": "^4.0.0", + "git-semver-tags": "^4.1.0", "lodash": "^4.17.15", "normalize-package-data": "^2.3.5", "q": "^1.5.1", @@ -2630,12 +2674,71 @@ "through2": "^3.0.0" }, "dependencies": { + "compare-func": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", + "integrity": "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==", + "dev": true, + "requires": { + "array-ify": "^1.0.0", + "dot-prop": "^5.1.0" + } + }, + "conventional-changelog-writer": { + "version": "4.0.17", + "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-4.0.17.tgz", + "integrity": "sha512-IKQuK3bib/n032KWaSb8YlBFds+aLmzENtnKtxJy3+HqDq5kohu3g/UdNbIHeJWygfnEbZjnCKFxAW0y7ArZAw==", + "dev": true, + "requires": { + "compare-func": "^2.0.0", + "conventional-commits-filter": "^2.0.6", + "dateformat": "^3.0.0", + "handlebars": "^4.7.6", + "json-stringify-safe": "^5.0.1", + "lodash": "^4.17.15", + "meow": "^7.0.0", + "semver": "^6.0.0", + "split": "^1.0.0", + "through2": "^3.0.0" + } + }, + "dot-prop": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "dev": true, + "requires": { + "is-obj": "^2.0.0" + } + }, + "git-semver-tags": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-4.1.0.tgz", + "integrity": "sha512-TcxAGeo03HdErzKzi4fDD+xEL7gi8r2Y5YSxH6N2XYdVSV5UkBwfrt7Gqo1b+uSHCjy/sa9Y6BBBxxFLxfbhTg==", + "dev": true, + "requires": { + "meow": "^7.0.0", + "semver": "^6.0.0" + } + }, "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, + "is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, "through2": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz", @@ -2685,63 +2788,48 @@ } }, "conventional-changelog-jshint": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/conventional-changelog-jshint/-/conventional-changelog-jshint-2.0.7.tgz", - "integrity": "sha512-qHA8rmwUnLiIxANJbz650+NVzqDIwNtc0TcpIa0+uekbmKHttidvQ1dGximU3vEDdoJVKFgR3TXFqYuZmYy9ZQ==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/conventional-changelog-jshint/-/conventional-changelog-jshint-2.0.8.tgz", + "integrity": "sha512-hB/iI0IiZwnZ+seYI+qEQ4b+EMQSEC8jGIvhO2Vpz1E5p8FgLz75OX8oB1xJWl+s4xBMB6f8zJr0tC/BL7YOjw==", "dev": true, "requires": { - "compare-func": "^1.3.1", + "compare-func": "^2.0.0", "q": "^1.5.1" - } - }, - "conventional-changelog-preset-loader": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.3.4.tgz", - "integrity": "sha512-GEKRWkrSAZeTq5+YjUZOYxdHq+ci4dNwHvpaBC3+ENalzFWuCWa9EZXSuZBpkr72sMdKB+1fyDV4takK1Lf58g==", - "dev": true - }, - "conventional-changelog-writer": { - "version": "4.0.16", - "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-4.0.16.tgz", - "integrity": "sha512-jmU1sDJDZpm/dkuFxBeRXvyNcJQeKhGtVcFFkwTphUAzyYWcwz2j36Wcv+Mv2hU3tpvLMkysOPXJTLO55AUrYQ==", - "dev": true, - "requires": { - "compare-func": "^1.3.1", - "conventional-commits-filter": "^2.0.6", - "dateformat": "^3.0.0", - "handlebars": "^4.7.6", - "json-stringify-safe": "^5.0.1", - "lodash": "^4.17.15", - "meow": "^7.0.0", - "semver": "^6.0.0", - "split": "^1.0.0", - "through2": "^3.0.0" }, "dependencies": { - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true + "compare-func": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", + "integrity": "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==", + "dev": true, + "requires": { + "array-ify": "^1.0.0", + "dot-prop": "^5.1.0" + } }, - "through2": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz", - "integrity": "sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==", + "dot-prop": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", "dev": true, "requires": { - "inherits": "^2.0.4", - "readable-stream": "2 || 3" + "is-obj": "^2.0.0" } + }, + "is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "dev": true } } }, + "conventional-changelog-preset-loader": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.3.4.tgz", + "integrity": "sha512-GEKRWkrSAZeTq5+YjUZOYxdHq+ci4dNwHvpaBC3+ENalzFWuCWa9EZXSuZBpkr72sMdKB+1fyDV4takK1Lf58g==", + "dev": true + }, "conventional-commits-filter": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.6.tgz", @@ -3598,15 +3686,6 @@ "no-case": "^2.2.0" } }, - "dot-prop": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-3.0.0.tgz", - "integrity": "sha1-G3CK8JSknJoOfbyteQq6U52sEXc=", - "dev": true, - "requires": { - "is-obj": "^1.0.0" - } - }, "download": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/download/-/download-7.1.0.tgz", @@ -5067,6 +5146,15 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", "dev": true + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } } } }, @@ -5501,24 +5589,6 @@ "pify": "^2.3.0" } }, - "git-semver-tags": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-4.0.0.tgz", - "integrity": "sha512-LajaAWLYVBff+1NVircURJFL8TQ3EMIcLAfHisWYX/nPoMwnTYfWAznQDmMujlLqoD12VtLmoSrF1sQ5MhimEQ==", - "dev": true, - "requires": { - "meow": "^7.0.0", - "semver": "^6.0.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, "gitconfiglocal": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz", @@ -7599,9 +7669,9 @@ } }, "hast-util-is-element": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/hast-util-is-element/-/hast-util-is-element-1.0.4.tgz", - "integrity": "sha512-NFR6ljJRvDcyPP5SbV7MyPBgF47X3BsskLnmw1U34yL+X6YC0MoBx9EyMg8Jtx4FzGH95jw8+c1VPLHaRA0wDQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/hast-util-is-element/-/hast-util-is-element-1.1.0.tgz", + "integrity": "sha512-oUmNua0bFbdrD/ELDSSEadRVtWZOf3iF6Lbv81naqsIV99RnSCieTbWuWCY8BAeEfKJTKl0gRdokv+dELutHGQ==", "dev": true }, "hast-util-parse-selector": { @@ -8169,12 +8239,6 @@ "kind-of": "^3.0.2" } }, - "is-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", - "dev": true - }, "is-object": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz", @@ -9845,9 +9909,9 @@ } }, "node-fetch": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", - "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", "dev": true }, "node-gyp": { @@ -9876,6 +9940,15 @@ "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", "dev": true }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, "semver": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", @@ -13959,9 +14032,9 @@ }, "dependencies": { "bl": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.0.2.tgz", - "integrity": "sha512-j4OH8f6Qg2bGuWfRiltT2HYGx0e1QcBTrK9KAHNMwMZdQnDZFk0ZSYIpADjYCB3U12nicC5tVJwSIhwOWjb4RQ==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.0.3.tgz", + "integrity": "sha512-fs4G6/Hu4/EE+F75J8DuN/0IpQqNjAdC7aEQv7Qt8MHGUH7Ckv2MwTEEeN9QehD0pfIDkMI1bkHYkKy7xHyKIg==", "dev": true, "requires": { "buffer": "^5.5.0", @@ -15491,6 +15564,17 @@ "dev": true, "requires": { "mkdirp": "^0.5.1" + }, + "dependencies": { + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + } } }, "ws": { diff --git a/src/components/dialog/demoBasicUsage/script.js b/src/components/dialog/demoBasicUsage/script.js index 0c6ec050999..baa7d8245aa 100644 --- a/src/components/dialog/demoBasicUsage/script.js +++ b/src/components/dialog/demoBasicUsage/script.js @@ -1,13 +1,9 @@ angular.module('dialogDemo1', ['ngMaterial']) - .controller('AppCtrl', function($scope, $mdDialog) { $scope.status = ' '; $scope.customFullscreen = false; - $scope.showAlert = function(ev) { - // Appending dialog to document.body to cover sidenav in docs app - // Modal dialogs should fully cover application - // to prevent interaction outside of dialog + $scope.showAlert = function (ev) { $mdDialog.show( $mdDialog.alert() .parent(angular.element(document.querySelector('#popupContainer'))) @@ -21,23 +17,22 @@ angular.module('dialogDemo1', ['ngMaterial']) }; $scope.showConfirm = function(ev) { - // Appending dialog to document.body to cover sidenav in docs app var confirm = $mdDialog.confirm() - .title('Would you like to delete your debt?') - .textContent('All of the banks have agreed to forgive you your debts.') - .ariaLabel('Lucky day') - .targetEvent(ev) - .ok('Please do it!') - .cancel('Sounds like a scam'); + .title('Would you like to delete your debt?') + .textContent('All of the banks have agreed to forgive you your debts.') + .ariaLabel('Lucky day') + .targetEvent(ev) + .ok('Please do it!') + .cancel('Sounds like a scam'); - $mdDialog.show(confirm).then(function() { + $mdDialog.show(confirm).then(function () { $scope.status = 'You decided to get rid of your debt.'; - }, function() { + }, function () { $scope.status = 'You decided to keep your debt.'; }); }; - $scope.showPrompt = function(ev) { + $scope.showPrompt = function (ev) { // Appending dialog to document.body to cover sidenav in docs app var confirm = $mdDialog.prompt() .title('What would you name your dog?') @@ -50,47 +45,51 @@ angular.module('dialogDemo1', ['ngMaterial']) .ok('Okay!') .cancel('I\'m a cat person'); - $mdDialog.show(confirm).then(function(result) { + $mdDialog.show(confirm).then(function (result) { $scope.status = 'You decided to name your dog ' + result + '.'; - }, function() { + }, function () { $scope.status = 'You didn\'t name your dog.'; }); }; - $scope.showAdvanced = function(ev) { + $scope.showAdvanced = function (ev) { $mdDialog.show({ controller: DialogController, templateUrl: 'dialog1.tmpl.html', + // Appending dialog to document.body to cover sidenav in docs app + // Modal dialogs should fully cover application to prevent interaction outside of dialog parent: angular.element(document.body), targetEvent: ev, - clickOutsideToClose:true, + clickOutsideToClose: true, fullscreen: $scope.customFullscreen // Only for -xs, -sm breakpoints. - }) - .then(function(answer) { + }).then(function (answer) { $scope.status = 'You said the information was "' + answer + '".'; - }, function() { + }, function () { $scope.status = 'You cancelled the dialog.'; }); }; - $scope.showTabDialog = function(ev) { + $scope.showTabDialog = function (ev) { $mdDialog.show({ controller: DialogController, templateUrl: 'tabDialog.tmpl.html', + // Appending dialog to document.body to cover sidenav in docs app + // Modal dialogs should fully cover application to prevent interaction outside of dialog parent: angular.element(document.body), targetEvent: ev, clickOutsideToClose: true - }) - .then(function(answer) { - $scope.status = 'You said the information was "' + answer + '".'; - }, function() { - $scope.status = 'You cancelled the dialog.'; - }); + }).then(function (answer) { + $scope.status = 'You said the information was "' + answer + '".'; + }, function () { + $scope.status = 'You cancelled the dialog.'; + }); }; - $scope.showPrerenderedDialog = function(ev) { + $scope.showPrerenderedDialog = function (ev) { $mdDialog.show({ contentElement: '#myDialog', + // Appending dialog to document.body to cover sidenav in docs app + // Modal dialogs should fully cover application to prevent interaction outside of dialog parent: angular.element(document.body), targetEvent: ev, clickOutsideToClose: true @@ -98,15 +97,15 @@ angular.module('dialogDemo1', ['ngMaterial']) }; function DialogController($scope, $mdDialog) { - $scope.hide = function() { + $scope.hide = function () { $mdDialog.hide(); }; - $scope.cancel = function() { + $scope.cancel = function () { $mdDialog.cancel(); }; - $scope.answer = function(answer) { + $scope.answer = function (answer) { $mdDialog.hide(answer); }; } diff --git a/src/components/dialog/dialog.js b/src/components/dialog/dialog.js index 3c4dbe59f7e..ac545fffb42 100644 --- a/src/components/dialog/dialog.js +++ b/src/components/dialog/dialog.js @@ -552,6 +552,7 @@ function MdDialogDirective($$rAF, $mdTheming, $mdDialog) { function MdDialogProvider($$interimElementProvider) { // Elements to capture and redirect focus when the user presses tab at the dialog boundary. var topFocusTrap, bottomFocusTrap; + var removeFocusTrap; return $$interimElementProvider('$mdDialog') .setDefaults({ @@ -641,9 +642,9 @@ function MdDialogProvider($$interimElementProvider) { } /* @ngInject */ - function dialogDefaultOptions($mdDialog, $mdAria, $mdUtil, $mdConstant, $animate, $document, $window, $rootElement, - $log, $injector, $mdTheming, $interpolate, $mdInteraction) { - + function dialogDefaultOptions($mdDialog, $mdAria, $mdUtil, $mdConstant, $animate, $document, + $window, $rootElement, $log, $injector, $mdTheming, $interpolate, + $mdInteraction) { return { hasBackdrop: true, isolateScope: true, @@ -768,12 +769,9 @@ function MdDialogProvider($$interimElementProvider) { options.hideBackdrop(options.$destroy); // Remove the focus traps that we added earlier for keeping focus within the dialog. - if (topFocusTrap && topFocusTrap.parentNode) { - topFocusTrap.parentNode.removeChild(topFocusTrap); - } - - if (bottomFocusTrap && bottomFocusTrap.parentNode) { - bottomFocusTrap.parentNode.removeChild(bottomFocusTrap); + if (removeFocusTrap) { + removeFocusTrap(); + removeFocusTrap = null; } // For navigation $destroy events, do a quick, non-animated removal, @@ -936,10 +934,8 @@ function MdDialogProvider($$interimElementProvider) { // Queue remove listeners function removeListeners.push(function() { - element.off('keydown', keyHandlerFn); parentTarget.off('keydown', keyHandlerFn); - }); } @@ -1015,11 +1011,13 @@ function MdDialogProvider($$interimElementProvider) { */ options.hideBackdrop = function hideBackdrop($destroy) { if (options.backdrop) { - if ($destroy) options.backdrop.remove(); - else $animate.leave(options.backdrop); + if ($destroy) { + options.backdrop.remove(); + } else { + $animate.leave(options.backdrop); + } } - if (options.disableParentScroll) { options.restoreScroll && options.restoreScroll(); delete options.restoreScroll; @@ -1088,15 +1086,27 @@ function MdDialogProvider($$interimElementProvider) { topFocusTrap.addEventListener('focus', focusHandler); bottomFocusTrap.addEventListener('focus', focusHandler); - // The top focus trap inserted immeidately before the md-dialog element (as a sibling). + removeFocusTrap = function () { + topFocusTrap.removeEventListener('focus', focusHandler); + bottomFocusTrap.removeEventListener('focus', focusHandler); + + if (topFocusTrap && topFocusTrap.parentNode) { + topFocusTrap.parentNode.removeChild(topFocusTrap); + } + + if (bottomFocusTrap && bottomFocusTrap.parentNode) { + bottomFocusTrap.parentNode.removeChild(bottomFocusTrap); + } + }; + + // The top focus trap inserted immediately before the md-dialog element (as a sibling). // The bottom focus trap is inserted at the very end of the md-dialog element (as a child). element[0].parentNode.insertBefore(topFocusTrap, element[0]); element.after(bottomFocusTrap); } /** - * Prevents screen reader interaction behind modal window - * on swipe interfaces + * Prevents screen reader interaction behind modal window on swipe interfaces. */ function lockScreenReader(element, options) { var isHidden = true; @@ -1112,8 +1122,9 @@ function MdDialogProvider($$interimElementProvider) { }; /** - * Get all of an element's parent elements up the DOM tree - * @return {Array} The parent elements + * Get all of an element's parent elements up the DOM tree. + * @param {Node & ParentNode} element the element to start from + * @return {Element[]} The parent elements */ function getParents(element) { var parents = []; @@ -1137,8 +1148,9 @@ function MdDialogProvider($$interimElementProvider) { } /** - * Walk DOM to apply or remove aria-hidden on sibling nodes - * and parent sibling nodes + * Walk DOM to apply or remove aria-hidden on sibling nodes and parent sibling nodes. + * @param {Element} element the element to start from when walking up the DOM + * @returns {void} */ function walkDOM(element) { var elements = getParents(element); @@ -1149,12 +1161,17 @@ function MdDialogProvider($$interimElementProvider) { } /** - * Ensure the dialog container fill-stretches to the viewport + * Ensure the dialog container fill-stretches to the viewport. + * @param {JQLite} container dialog container + * @param {Object} options + * @returns {function(): void} function that reverts the modified styles */ function stretchDialogContainerToViewport(container, options) { var isFixed = $window.getComputedStyle($document[0].body).position === 'fixed'; var backdrop = options.backdrop ? $window.getComputedStyle(options.backdrop[0]) : null; - var height = backdrop ? Math.min($document[0].body.clientHeight, Math.ceil(Math.abs(parseInt(backdrop.height, 10)))) : 0; + var height = backdrop ? + Math.min($document[0].body.clientHeight, Math.ceil(Math.abs(parseInt(backdrop.height, 10)))) + : 0; var previousStyles = { top: container.css('top'), @@ -1178,7 +1195,10 @@ function MdDialogProvider($$interimElementProvider) { } /** - * Dialog open and pop-in animation + * Dialog open and pop-in animation. + * @param {JQLite} container dialog container + * @param {Object} options + * @returns {*} */ function dialogPopIn(container, options) { // Add the `md-dialog-container` to the DOM @@ -1219,7 +1239,6 @@ function MdDialogProvider($$interimElementProvider) { buildTranslateToOrigin(dialogEl, options.origin) ) ); - }; // Function to revert the generated animation styles on the dialog element. @@ -1243,7 +1262,10 @@ function MdDialogProvider($$interimElementProvider) { } /** - * Dialog close and pop-out animation + * Dialog close and pop-out animation. + * @param {JQLite} container dialog container + * @param {Object} options + * @returns {*} */ function dialogPopOut(container, options) { return options.reverseAnimate().then(function() { @@ -1256,13 +1278,13 @@ function MdDialogProvider($$interimElementProvider) { } /** - * Utility function to filter out raw DOM nodes + * Utility function to filter out raw DOM nodes. + * @param {Node} elem + * @param {string[]} nodeTypeArray + * @returns {boolean} */ function isNodeOneOf(elem, nodeTypeArray) { - if (nodeTypeArray.indexOf(elem.nodeName) !== -1) { - return true; - } + return nodeTypeArray.indexOf(elem.nodeName) !== -1; } - } } diff --git a/src/core/util/animation/animate.js b/src/core/util/animation/animate.js index d1c4985000c..c816bd2b4cb 100644 --- a/src/core/util/animation/animate.js +++ b/src/core/util/animation/animate.js @@ -1,11 +1,9 @@ // Polyfill angular < 1.4 (provide $animateCss) angular .module('material.core') - .factory('$$mdAnimate', function($q, $timeout, $mdConstant, $animateCss){ - + .factory('$$mdAnimate', function($q, $timeout, $mdConstant, $animateCss) { // Since $$mdAnimate is injected into $mdUtil... use a wrapper function // to subsequently inject $mdUtil as an argument to the AnimateDomUtils - return function($mdUtil) { return AnimateDomUtils($mdUtil, $q, $timeout, $mdConstant, $animateCss); }; @@ -17,9 +15,6 @@ angular function AnimateDomUtils($mdUtil, $q, $timeout, $mdConstant, $animateCss) { var self; return self = { - /** - * - */ translate3d : function(target, from, to, options) { return $animateCss(target, { from: from, @@ -44,7 +39,6 @@ function AnimateDomUtils($mdUtil, $q, $timeout, $mdConstant, $animateCss) { removeClass: options.transitionInClass, duration: options.duration }).start(); - } }, @@ -80,7 +74,6 @@ function AnimateDomUtils($mdUtil, $q, $timeout, $mdConstant, $animateCss) { // Never reject since ngAnimate may cause timeouts due missed transitionEnd events resolve(); - } /** @@ -94,9 +87,9 @@ function AnimateDomUtils($mdUtil, $q, $timeout, $mdConstant, $animateCss) { function noTransitionFound(styles) { styles = styles || window.getComputedStyle(element[0]); - return styles.transitionDuration == '0s' || (!styles.transition && !styles.transitionProperty); + return styles.transitionDuration === '0s' || + (!styles.transition && !styles.transitionProperty); } - }); }, @@ -121,11 +114,12 @@ function AnimateDomUtils($mdUtil, $q, $timeout, $mdConstant, $animateCss) { /** * This is a fallback if the origin information is no longer valid, then the - * origin bounds simply becomes the current bounds for the dialogContainer's parent + * origin bounds simply becomes the current bounds for the dialogContainer's parent. + * @returns {null|DOMRect} */ function currentBounds() { - var cntr = element ? element.parent() : null; - var parent = cntr ? cntr.parent() : null; + var container = element ? element.parent() : null; + var parent = container ? container.parent() : null; return parent ? self.clientRect(parent) : null; } @@ -219,7 +213,10 @@ function AnimateDomUtils($mdUtil, $q, $timeout, $mdConstant, $animateCss) { }, /** - * Clone the Rect and calculate the height/width if needed + * Clone the Rect and calculate the height/width if needed. + * @param {DOMRect} source + * @param {DOMRect=} destination + * @returns {null|DOMRect} */ copyRect: function (source, destination) { if (!source) return null; @@ -237,7 +234,9 @@ function AnimateDomUtils($mdUtil, $q, $timeout, $mdConstant, $animateCss) { }, /** - * Calculate ClientRect of element; return null if hidden or zero size + * Calculate ClientRect of element; return null if hidden or zero size. + * @param {Element|string} element + * @returns {null|DOMRect} */ clientRect: function (element) { var bounds = angular.element(element)[0].getBoundingClientRect(); @@ -250,7 +249,9 @@ function AnimateDomUtils($mdUtil, $q, $timeout, $mdConstant, $animateCss) { }, /** - * Calculate 'rounded' center point of Rect + * Calculate 'rounded' center point of Rect + * @param {DOMRect} targetRect + * @returns {{x: number, y: number}} */ centerPointFor: function (targetRect) { return targetRect ? { @@ -258,7 +259,6 @@ function AnimateDomUtils($mdUtil, $q, $timeout, $mdConstant, $animateCss) { y: Math.round(targetRect.top + (targetRect.height / 2)) } : { x : 0, y : 0 }; } - }; }