diff --git a/package-lock.json b/package-lock.json index 22825162c..58f8905dd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -424,36 +424,112 @@ } }, "@material/chips": { - "version": "0.41.0", - "resolved": "https://registry.npmjs.org/@material/chips/-/chips-0.41.0.tgz", - "integrity": "sha512-Z2q01n4JdRR2f2fdYNCftmgu0M8wu8PZUeQTK3e3zVkQyRdmXcbqMbLHRawVWuXORC8/mIA6tuTtOEqle/Qj9w==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@material/chips/-/chips-1.0.1.tgz", + "integrity": "sha512-UcCEkuFEE8c3zdzAnv7kdU7hG6QNOJpVgmrphWBgoPG92+yFFb8b5Wo+3MWT+SIF/wKNSNAo8a+BER9DsCOOjw==", "dev": true, "requires": { - "@material/animation": "^0.41.0", - "@material/base": "^0.41.0", - "@material/checkbox": "^0.41.0", - "@material/elevation": "^0.41.0", - "@material/ripple": "^0.41.0", - "@material/shape": "^0.41.0", - "@material/theme": "^0.41.0", - "@material/typography": "^0.41.0" + "@material/animation": "^1.0.0", + "@material/base": "^1.0.0", + "@material/checkbox": "^1.0.1", + "@material/elevation": "^1.0.0", + "@material/ripple": "^1.0.1", + "@material/shape": "^1.0.0", + "@material/theme": "^1.0.0", + "@material/typography": "^1.0.0", + "tslib": "^1.9.3" }, "dependencies": { - "@material/base": { - "version": "0.41.0", - "resolved": "https://registry.npmjs.org/@material/base/-/base-0.41.0.tgz", - "integrity": "sha512-tEyzwBRu3d1H120SfKsDVYZHcqT5lKohh/7cWKR93aAaPDkSvjpKJIjyu2yuSkjpDduVZGzVocYbOvhUKhhzXQ==", - "dev": true + "@material/animation": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@material/animation/-/animation-1.0.0.tgz", + "integrity": "sha512-Ed5/vggn6ZhSJ87yn3ZS1d826VJNFz73jHF2bSsgRtHDoB8KCuOwQMfdgAgDa4lKDF6CDIPCKBZPKrs2ubehdw==", + "dev": true, + "requires": { + "tslib": "^1.9.3" + } + }, + "@material/checkbox": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@material/checkbox/-/checkbox-1.0.1.tgz", + "integrity": "sha512-/FMQEM5aT3S63Rp2gWgq0/WnMl9tNpSBs222r/3YT9Aqesbdp56mcDG9rk9rq2Ph74sWxlI5+9MVwL4CZ3nCyg==", + "dev": true, + "requires": { + "@material/animation": "^1.0.0", + "@material/base": "^1.0.0", + "@material/dom": "^1.0.1", + "@material/feature-targeting": "^0.44.1", + "@material/ripple": "^1.0.1", + "@material/rtl": "^0.42.0", + "@material/theme": "^1.0.0", + "tslib": "^1.9.3" + } + }, + "@material/dom": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@material/dom/-/dom-1.0.1.tgz", + "integrity": "sha512-7gb9Tk8YBn2fLEa5fJfvDexG0QxvRGDb8c6uZEhvK4bTd2ZHCfHg9KrO+smC6Trbn5jC+FsBvdRZBbMjtS/E4g==", + "dev": true, + "requires": { + "tslib": "^1.9.3" + } + }, + "@material/elevation": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@material/elevation/-/elevation-1.0.0.tgz", + "integrity": "sha512-TqmvEXmZDYLm2X5lEnjKCsZMDkCXpxFFxL22AfCAQB5L4d0gAS7vqDEE797y4Rp+BBKEcOP71mum1l56RI3NBQ==", + "dev": true, + "requires": { + "@material/animation": "^1.0.0", + "@material/feature-targeting": "^0.44.1", + "@material/theme": "^1.0.0" + } }, "@material/ripple": { - "version": "0.41.0", - "resolved": "https://registry.npmjs.org/@material/ripple/-/ripple-0.41.0.tgz", - "integrity": "sha512-rxEUVWM4AByDlTCH0kkthZQmUuY6eeN0X6cOHBoioFN2vUDk0D0Nfzz/N9FF2AlAf8C2lDDLrTuqnJPVIn+NHA==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@material/ripple/-/ripple-1.0.1.tgz", + "integrity": "sha512-aBigRoVMjIU2lLDq7TMocI2H2YFbO1hICs5FTdSRp4Yis/QFTrgaW32q8yuHdZI56j+b2BWIWapqA2xpSmCMXQ==", "dev": true, "requires": { - "@material/animation": "^0.41.0", - "@material/base": "^0.41.0", - "@material/theme": "^0.41.0" + "@material/animation": "^1.0.0", + "@material/base": "^1.0.0", + "@material/dom": "^1.0.1", + "@material/feature-targeting": "^0.44.1", + "@material/theme": "^1.0.0", + "tslib": "^1.9.3" + } + }, + "@material/rtl": { + "version": "0.42.0", + "resolved": "https://registry.npmjs.org/@material/rtl/-/rtl-0.42.0.tgz", + "integrity": "sha512-VrnrKJzhmspsN8WXHuxxBZ69yM5IwhCUqWr1t1eNfw3ZEvEj7i1g3P31HGowKThIN1dc1Wh4LE14rCISWCtv5w==", + "dev": true + }, + "@material/shape": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@material/shape/-/shape-1.0.0.tgz", + "integrity": "sha512-zfXEacPQZmH+ujVtaFyfAsYiF46j1QCcFzJeZVouG4pznrbA7XD6614Ywg0wbyWX5iB6hD52ld/IN+R/6oxKqA==", + "dev": true, + "requires": { + "@material/feature-targeting": "^0.44.1" + } + }, + "@material/theme": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@material/theme/-/theme-1.0.0.tgz", + "integrity": "sha512-Bg/BQLU5MmCwtQ3DHcSs9DodZB8PTvuItv1wXrP54S/wBVwryIB5uMDmERhnItbNnAFbkKhlAuhn1asMmMzfkQ==", + "dev": true, + "requires": { + "@material/feature-targeting": "^0.44.1" + } + }, + "@material/typography": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@material/typography/-/typography-1.0.0.tgz", + "integrity": "sha512-Oeqbjci1cC7jTE8/n3dwnkqKe9ZeWiaE+rgMtRYtRFw1HvAw14SpGA5EEAS/Li2Hu2KZ50FYCe3HYqShfxtChA==", + "dev": true, + "requires": { + "@material/feature-targeting": "^0.44.1" } } } @@ -17370,7 +17446,7 @@ }, "ts-loader": { "version": "3.5.0", - "resolved": "http://registry.npmjs.org/ts-loader/-/ts-loader-3.5.0.tgz", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-3.5.0.tgz", "integrity": "sha512-JTia3kObhTk36wPFgy0RnkZReiusYx7Le9IhcUWRrCTcFcr6Dy1zGsFd3x8DG4gevlbN65knI8W50FfoykXcng==", "dev": true, "requires": { @@ -18394,28 +18470,28 @@ "dependencies": { "abbrev": { "version": "1.1.1", - "resolved": false, + "resolved": "", "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true, "optional": true }, "ansi-regex": { "version": "2.1.1", - "resolved": false, + "resolved": "", "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true, "optional": true }, "aproba": { "version": "1.2.0", - "resolved": false, + "resolved": "", "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "dev": true, "optional": true }, "are-we-there-yet": { "version": "1.1.4", - "resolved": false, + "resolved": "", "integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=", "dev": true, "optional": true, @@ -18426,14 +18502,14 @@ }, "balanced-match": { "version": "1.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true, "optional": true }, "brace-expansion": { "version": "1.1.11", - "resolved": false, + "resolved": "", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "optional": true, @@ -18444,28 +18520,28 @@ }, "chownr": { "version": "1.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=", "dev": true, "optional": true }, "code-point-at": { "version": "1.1.0", - "resolved": false, + "resolved": "", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true, "optional": true }, "concat-map": { "version": "0.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true, "optional": true }, "console-control-strings": { "version": "1.1.0", - "resolved": false, + "resolved": "", "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", "dev": true, "optional": true @@ -18479,7 +18555,7 @@ }, "debug": { "version": "2.6.9", - "resolved": false, + "resolved": "", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "optional": true, @@ -18489,28 +18565,28 @@ }, "deep-extend": { "version": "0.5.1", - "resolved": false, + "resolved": "", "integrity": "sha512-N8vBdOa+DF7zkRrDCsaOXoCs/E2fJfx9B9MrKnnSiHNh4ws7eSys6YQE4KvT1cecKmOASYQBhbKjeuDD9lT81w==", "dev": true, "optional": true }, "delegates": { "version": "1.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "dev": true, "optional": true }, "detect-libc": { "version": "1.0.3", - "resolved": false, + "resolved": "", "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", "dev": true, "optional": true }, "fs-minipass": { "version": "1.2.5", - "resolved": false, + "resolved": "", "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", "dev": true, "optional": true, @@ -18520,14 +18596,14 @@ }, "fs.realpath": { "version": "1.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true, "optional": true }, "gauge": { "version": "2.7.4", - "resolved": false, + "resolved": "", "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "dev": true, "optional": true, @@ -18544,7 +18620,7 @@ }, "glob": { "version": "7.1.2", - "resolved": false, + "resolved": "", "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "optional": true, @@ -18559,14 +18635,14 @@ }, "has-unicode": { "version": "2.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "dev": true, "optional": true }, "iconv-lite": { "version": "0.4.21", - "resolved": false, + "resolved": "", "integrity": "sha512-En5V9za5mBt2oUA03WGD3TwDv0MKAruqsuxstbMUZaj9W9k/m1CV/9py3l0L5kw9Bln8fdHQmzHSYtvpvTLpKw==", "dev": true, "optional": true, @@ -18576,7 +18652,7 @@ }, "ignore-walk": { "version": "3.0.1", - "resolved": false, + "resolved": "", "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", "dev": true, "optional": true, @@ -18586,7 +18662,7 @@ }, "inflight": { "version": "1.0.6", - "resolved": false, + "resolved": "", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "optional": true, @@ -18597,21 +18673,21 @@ }, "inherits": { "version": "2.0.3", - "resolved": false, + "resolved": "", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true, "optional": true }, "ini": { "version": "1.3.5", - "resolved": false, + "resolved": "", "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true, "optional": true }, "is-fullwidth-code-point": { "version": "1.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "optional": true, @@ -18628,7 +18704,7 @@ }, "minimatch": { "version": "3.0.4", - "resolved": false, + "resolved": "", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "optional": true, @@ -18638,14 +18714,14 @@ }, "minimist": { "version": "0.0.8", - "resolved": false, + "resolved": "", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true, "optional": true }, "minipass": { "version": "2.2.4", - "resolved": false, + "resolved": "", "integrity": "sha512-hzXIWWet/BzWhYs2b+u7dRHlruXhwdgvlTMDKC6Cb1U7ps6Ac6yQlR39xsbjWJE377YTCtKwIXIpJ5oP+j5y8g==", "dev": true, "optional": true, @@ -18656,7 +18732,7 @@ }, "minizlib": { "version": "1.1.0", - "resolved": false, + "resolved": "", "integrity": "sha512-4T6Ur/GctZ27nHfpt9THOdRZNgyJ9FZchYO1ceg5S8Q3DNLCKYy44nCZzgCJgcvx2UM8czmqak5BCxJMrq37lA==", "dev": true, "optional": true, @@ -18666,7 +18742,7 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": false, + "resolved": "", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "optional": true, @@ -18676,14 +18752,14 @@ }, "ms": { "version": "2.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true, "optional": true }, "needle": { "version": "2.2.0", - "resolved": false, + "resolved": "", "integrity": "sha512-eFagy6c+TYayorXw/qtAdSvaUpEbBsDwDyxYFgLZ0lTojfH7K+OdBqAF7TAFwDokJaGpubpSGG0wO3iC0XPi8w==", "dev": true, "optional": true, @@ -18695,7 +18771,7 @@ }, "node-pre-gyp": { "version": "0.10.0", - "resolved": false, + "resolved": "", "integrity": "sha512-G7kEonQLRbcA/mOoFoxvlMrw6Q6dPf92+t/l0DFSMuSlDoWaI9JWIyPwK0jyE1bph//CUEL65/Fz1m2vJbmjQQ==", "dev": true, "optional": true, @@ -18714,7 +18790,7 @@ }, "nopt": { "version": "4.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", "dev": true, "optional": true, @@ -18725,14 +18801,14 @@ }, "npm-bundled": { "version": "1.0.3", - "resolved": false, + "resolved": "", "integrity": "sha512-ByQ3oJ/5ETLyglU2+8dBObvhfWXX8dtPZDMePCahptliFX2iIuhyEszyFk401PZUNQH20vvdW5MLjJxkwU80Ow==", "dev": true, "optional": true }, "npm-packlist": { "version": "1.1.10", - "resolved": false, + "resolved": "", "integrity": "sha512-AQC0Dyhzn4EiYEfIUjCdMl0JJ61I2ER9ukf/sLxJUcZHfo+VyEfz2rMJgLZSS1v30OxPQe1cN0LZA1xbcaVfWA==", "dev": true, "optional": true, @@ -18743,7 +18819,7 @@ }, "npmlog": { "version": "4.1.2", - "resolved": false, + "resolved": "", "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "dev": true, "optional": true, @@ -18756,21 +18832,21 @@ }, "number-is-nan": { "version": "1.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true, "optional": true }, "object-assign": { "version": "4.1.1", - "resolved": false, + "resolved": "", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true, "optional": true }, "once": { "version": "1.4.0", - "resolved": false, + "resolved": "", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "optional": true, @@ -18780,21 +18856,21 @@ }, "os-homedir": { "version": "1.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true, "optional": true }, "os-tmpdir": { "version": "1.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true, "optional": true }, "osenv": { "version": "0.1.5", - "resolved": false, + "resolved": "", "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "dev": true, "optional": true, @@ -18805,7 +18881,7 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true, "optional": true @@ -18819,7 +18895,7 @@ }, "rc": { "version": "1.2.7", - "resolved": false, + "resolved": "", "integrity": "sha512-LdLD8xD4zzLsAT5xyushXDNscEjB7+2ulnl8+r1pnESlYtlJtVSoCMBGr30eDRJ3+2Gq89jK9P9e4tCEH1+ywA==", "dev": true, "optional": true, @@ -18832,7 +18908,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": false, + "resolved": "", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true, "optional": true @@ -18857,7 +18933,7 @@ }, "rimraf": { "version": "2.6.2", - "resolved": false, + "resolved": "", "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", "dev": true, "optional": true, @@ -18867,49 +18943,49 @@ }, "safe-buffer": { "version": "5.1.1", - "resolved": false, + "resolved": "", "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", "dev": true, "optional": true }, "safer-buffer": { "version": "2.1.2", - "resolved": false, + "resolved": "", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true, "optional": true }, "sax": { "version": "1.2.4", - "resolved": false, + "resolved": "", "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "dev": true, "optional": true }, "semver": { "version": "5.5.0", - "resolved": false, + "resolved": "", "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", "dev": true, "optional": true }, "set-blocking": { "version": "2.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true, "optional": true }, "signal-exit": { "version": "3.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true, "optional": true }, "string-width": { "version": "1.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "optional": true, @@ -18931,7 +19007,7 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "optional": true, @@ -18941,14 +19017,14 @@ }, "strip-json-comments": { "version": "2.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true, "optional": true }, "tar": { "version": "4.4.1", - "resolved": false, + "resolved": "", "integrity": "sha512-O+v1r9yN4tOsvl90p5HAP4AEqbYhx4036AGMm075fH9F8Qwi3oJ+v4u50FkT/KkvywNGtwkk0zRI+8eYm1X/xg==", "dev": true, "optional": true, @@ -18971,7 +19047,7 @@ }, "wide-align": { "version": "1.1.2", - "resolved": false, + "resolved": "", "integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==", "dev": true, "optional": true, @@ -18981,14 +19057,14 @@ }, "wrappy": { "version": "1.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true, "optional": true }, "yallist": { "version": "3.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k=", "dev": true, "optional": true @@ -19451,21 +19527,21 @@ "dependencies": { "abbrev": { "version": "1.1.1", - "resolved": false, + "resolved": "", "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true, "optional": true }, "ansi-regex": { "version": "2.1.1", - "resolved": false, + "resolved": "", "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true, "optional": true }, "aproba": { "version": "1.2.0", - "resolved": false, + "resolved": "", "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "dev": true, "optional": true @@ -19483,14 +19559,14 @@ }, "balanced-match": { "version": "1.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true, "optional": true }, "brace-expansion": { "version": "1.1.11", - "resolved": false, + "resolved": "", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "optional": true, @@ -19501,35 +19577,35 @@ }, "chownr": { "version": "1.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=", "dev": true, "optional": true }, "code-point-at": { "version": "1.1.0", - "resolved": false, + "resolved": "", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true, "optional": true }, "concat-map": { "version": "0.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true, "optional": true }, "console-control-strings": { "version": "1.1.0", - "resolved": false, + "resolved": "", "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", "dev": true, "optional": true }, "core-util-is": { "version": "1.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true, "optional": true @@ -19546,21 +19622,21 @@ }, "deep-extend": { "version": "0.5.1", - "resolved": false, + "resolved": "", "integrity": "sha512-N8vBdOa+DF7zkRrDCsaOXoCs/E2fJfx9B9MrKnnSiHNh4ws7eSys6YQE4KvT1cecKmOASYQBhbKjeuDD9lT81w==", "dev": true, "optional": true }, "delegates": { "version": "1.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "dev": true, "optional": true }, "detect-libc": { "version": "1.0.3", - "resolved": false, + "resolved": "", "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", "dev": true, "optional": true @@ -19577,7 +19653,7 @@ }, "fs.realpath": { "version": "1.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true, "optional": true @@ -19616,7 +19692,7 @@ }, "has-unicode": { "version": "2.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "dev": true, "optional": true @@ -19633,7 +19709,7 @@ }, "ignore-walk": { "version": "3.0.1", - "resolved": false, + "resolved": "", "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", "dev": true, "optional": true, @@ -19654,14 +19730,14 @@ }, "inherits": { "version": "2.0.3", - "resolved": false, + "resolved": "", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true, "optional": true }, "ini": { "version": "1.3.5", - "resolved": false, + "resolved": "", "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true, "optional": true @@ -19678,14 +19754,14 @@ }, "isarray": { "version": "1.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true, "optional": true }, "minimatch": { "version": "3.0.4", - "resolved": false, + "resolved": "", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "optional": true, diff --git a/package.json b/package.json index 0c0ab3168..857389824 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "@material/button": "^0.43.0", "@material/card": "^0.41.0", "@material/checkbox": "^0.41.0", - "@material/chips": "^0.41.0", + "@material/chips": "^1.0.0", "@material/dialog": "^0.43.0", "@material/dom": "^0.41.0", "@material/drawer": "^0.41.0", @@ -162,4 +162,3 @@ "webpack-dev-server": "^2.11.2" } } - diff --git a/packages/chips/Chip.tsx b/packages/chips/Chip.tsx index 398203e1f..55304729f 100644 --- a/packages/chips/Chip.tsx +++ b/packages/chips/Chip.tsx @@ -22,8 +22,8 @@ import * as React from 'react'; import * as classnames from 'classnames'; import * as Ripple from '@material/react-ripple'; -// @ts-ignore no mdc .d.ts file -import {MDCChipFoundation} from '@material/chips/dist/mdc.chips'; +import {MDCChipFoundation} from '@material/chips/chip/foundation'; +import {MDCChipAdapter} from '@material/chips/chip/adapter'; export interface ChipProps extends Ripple.InjectedProps { id?: string; @@ -51,7 +51,7 @@ type ChipState = { export class Chip extends React.Component { chipElement: HTMLDivElement | null = null; - foundation?: MDCChipFoundation; + foundation!: MDCChipFoundation; static defaultProps: Partial = { id: '', @@ -78,9 +78,9 @@ export class Chip extends React.Component { const {selected, shouldRemoveOnTrailingIconClick} = this.props; this.foundation = new MDCChipFoundation(this.adapter); this.foundation.init(); - this.foundation.setSelected(selected); + this.foundation.setSelected(selected!); if (shouldRemoveOnTrailingIconClick !== this.foundation.getShouldRemoveOnTrailingIconClick()) { - this.foundation.setShouldRemoveOnTrailingIconClick(shouldRemoveOnTrailingIconClick); + this.foundation.setShouldRemoveOnTrailingIconClick(shouldRemoveOnTrailingIconClick!); } } @@ -88,11 +88,11 @@ export class Chip extends React.Component { const {selected, shouldRemoveOnTrailingIconClick} = this.props; if (selected !== prevProps.selected) { - this.foundation.setSelected(selected); + this.foundation.setSelected(selected!); } if (shouldRemoveOnTrailingIconClick !== prevProps.shouldRemoveOnTrailingIconClick) { - this.foundation.setShouldRemoveOnTrailingIconClick(shouldRemoveOnTrailingIconClick); + this.foundation.setShouldRemoveOnTrailingIconClick(shouldRemoveOnTrailingIconClick!); } } @@ -111,7 +111,7 @@ export class Chip extends React.Component { return classnames('mdc-chip', Array.from(classList), className); } - get adapter() { + get adapter(): MDCChipAdapter { return { addClass: (className: string) => { const classList = new Set(this.state.classList); @@ -124,14 +124,24 @@ export class Chip extends React.Component { this.setState({classList}); }, hasClass: (className: string) => this.classes.split(' ').includes(className), + hasLeadingIcon: () => Boolean(this.props.leadingIcon), eventTargetHasClass: (target: HTMLElement, className: string) => target.classList.contains(className), getComputedStyleValue: (propertyName: string) => { - if (!this.chipElement) return; + if (!this.chipElement) return ''; return window .getComputedStyle(this.chipElement) .getPropertyValue(propertyName); }, + getRootBoundingClientRect: () => { + if (!this.chipElement) return new ClientRect(); + return this.chipElement.getBoundingClientRect(); + }, + getCheckmarkBoundingClientRect: () => { + const {chipCheckmark} = this.props; + if (!chipCheckmark) return new ClientRect(); + return chipCheckmark.props.getBoundingClientRect(); + }, setStyleProperty: (propertyName: keyof React.CSSProperties, value: string | null) => { if (!this.chipElement) return; this.chipElement.style.setProperty(propertyName, value); @@ -156,19 +166,19 @@ export class Chip extends React.Component { onClick = (e: React.MouseEvent) => { this.props.onClick!(e); - this.foundation.handleInteraction(e); + this.foundation.handleInteraction(e.nativeEvent); }; onKeyDown = (e: React.KeyboardEvent) => { this.props.onKeyDown!(e); - this.foundation.handleInteraction(e); + this.foundation.handleInteraction(e.nativeEvent); }; - handleTrailingIconClick = (e: React.MouseEvent) => this.foundation.handleTrailingIconInteraction(e); + handleTrailingIconClick = (e: React.MouseEvent) => this.foundation.handleTrailingIconInteraction(e.nativeEvent); handleTransitionEnd = (e: React.TransitionEvent) => { this.props.onTransitionEnd!(e); - this.foundation.handleTransitionEnd(e); + this.foundation.handleTransitionEnd(e.nativeEvent); }; renderLeadingIcon = (leadingIcon: React.ReactElement) => { diff --git a/packages/chips/ChipSet.tsx b/packages/chips/ChipSet.tsx index 826093d90..8ff6f3a7a 100644 --- a/packages/chips/ChipSet.tsx +++ b/packages/chips/ChipSet.tsx @@ -21,8 +21,7 @@ // THE SOFTWARE. import * as React from 'react'; import classnames from 'classnames'; -// @ts-ignore no mdc .d.ts file -import {MDCChipSetFoundation} from '@material/chips/dist/mdc.chips'; +import {MDCChipSetFoundation} from '@material/chips/chip-set/foundation'; import ChipCheckmark from './ChipCheckmark'; import {ChipProps} from './Chip'; // eslint-disable-line no-unused-vars @@ -40,7 +39,7 @@ export interface ChipSetProps { }; interface ChipSetState { - foundation: MDCChipSetFoundation; + foundation: MDCChipSetFoundation | null; selectedChipIds: string[]; hasInitialized: boolean; }; @@ -83,7 +82,7 @@ export default class ChipSet extends React.Component } componentWillUnmount() { - this.state.foundation.destroy(); + this.state.foundation!.destroy(); } get classes() { @@ -99,7 +98,7 @@ export default class ChipSet extends React.Component return { hasClass: (className: string) => this.classes.split(' ').includes(className), setSelected: () => { - const selectedChipIds = this.state.foundation.getSelectedChipIds().slice(); + const selectedChipIds = this.state.foundation!.getSelectedChipIds().slice(); this.setState({selectedChipIds}, () => { this.props.handleSelect!(selectedChipIds); }); @@ -113,22 +112,22 @@ export default class ChipSet extends React.Component const {id} = (child as ChipType).props; const selected = this.state.selectedChipIds.indexOf(id!) > -1; if (selected) { - this.state.foundation.select(id); + this.state.foundation!.select(id!); } }); this.setState({hasInitialized: true}); } handleInteraction = (chipId: string) => { - this.state.foundation.handleChipInteraction(chipId); + this.state.foundation!.handleChipInteraction(chipId); }; handleSelect = (chipId: string, selected: boolean) => { - this.state.foundation.handleChipSelection(chipId, selected); + this.state.foundation!.handleChipSelection(chipId, selected); }; handleRemove = (chipId: string) => { - this.state.foundation.handleChipRemoval(chipId); + this.state.foundation!.handleChipRemoval(chipId); }; removeChip = (chipId: string) => { diff --git a/packages/chips/package.json b/packages/chips/package.json index 6049472c6..3d736a326 100644 --- a/packages/chips/package.json +++ b/packages/chips/package.json @@ -19,7 +19,7 @@ "url": "https://github.com/material-components/material-components-web-react.git" }, "dependencies": { - "@material/chips": "^0.41.0", + "@material/chips": "^1.0.0", "@material/react-ripple": "^0.10.0", "classnames": "^2.2.6", "react": "^16.4.2" diff --git a/test/unit/chips/Chip.test.tsx b/test/unit/chips/Chip.test.tsx index 45f976796..49545696d 100644 --- a/test/unit/chips/Chip.test.tsx +++ b/test/unit/chips/Chip.test.tsx @@ -5,9 +5,16 @@ import * as td from 'testdouble'; import {Chip} from '../../../packages/chips/Chip'; import ChipCheckmark from '../../../packages/chips/ChipCheckmark'; import {coerceForTesting} from '../helpers/types'; +import {MDCChipAdapter} from '@material/chips/chip/adapter'; + suite('Chip'); +function getAdapter(instance: Chip): MDCChipAdapter { + // @ts-ignore adapter_ is protected property, we need to override it + return instance.foundation.adapter_; +} + test('creates foundation', () => { const wrapper = mount(); assert.exists(wrapper.instance().foundation); @@ -16,7 +23,7 @@ test('creates foundation', () => { test('#componentWillUnmount destroys foundation', () => { const wrapper = shallow(); const foundation = wrapper.instance().foundation; - foundation.destroy = td.func(); + foundation.destroy = td.func<() => void>(); wrapper.unmount(); td.verify(foundation.destroy(), {times: 1}); }); @@ -45,7 +52,8 @@ test('when props.shouldRemoveOnTrailingIconClick updates to false, ' + ' #foundation.setShouldRemoveOnTrailingIconClick is called ', () => { const wrapper = shallow(); assert.isTrue(wrapper.instance().foundation.getShouldRemoveOnTrailingIconClick()); - wrapper.instance().foundation.setShouldRemoveOnTrailingIconClick = td.func(); + wrapper.instance().foundation.setShouldRemoveOnTrailingIconClick = + td.func<(shouldRemove: boolean) => void>(); wrapper.setProps({shouldRemoveOnTrailingIconClick: false}); td.verify(wrapper.instance().foundation.setShouldRemoveOnTrailingIconClick(false), {times: 1}); }); @@ -55,7 +63,8 @@ test('when props.shouldRemoveOnTrailingIconClick updates to true, ' + ' #foundation.setShouldRemoveOnTrailingIconClick is called ', () => { const wrapper = shallow(); assert.isFalse(wrapper.instance().foundation.getShouldRemoveOnTrailingIconClick()); - wrapper.instance().foundation.setShouldRemoveOnTrailingIconClick = td.func(); + wrapper.instance().foundation.setShouldRemoveOnTrailingIconClick = + td.func<(shouldRemove: boolean) => void>(); wrapper.setProps({shouldRemoveOnTrailingIconClick: true}); td.verify(wrapper.instance().foundation.setShouldRemoveOnTrailingIconClick(true), {times: 1}); }); @@ -126,9 +135,7 @@ test('#adapter.setStyleProperty should add styles to chip', () => { test('#adapter.addClassToLeadingIcon adds to state.leadingIconClassList', () => { const wrapper = shallow(); - wrapper - .instance() - .foundation.adapter_.addClassToLeadingIcon('test-leading-icon-class'); + getAdapter(wrapper.instance()).addClassToLeadingIcon('test-leading-icon-class'); assert.isTrue( wrapper.state().leadingIconClassList.has('test-leading-icon-class') ); @@ -139,9 +146,7 @@ test('#adapter.removeClassFromLeadingIcon removes from state.leadingIconClassLis wrapper.setState({ leadingIconClassList: new Set('test-leading-icon-class'), }); - wrapper - .instance() - .foundation.adapter_.removeClassFromLeadingIcon('test-leading-icon-class'); + getAdapter(wrapper.instance()).removeClassFromLeadingIcon('test-leading-icon-class'); assert.isFalse( wrapper.state().leadingIconClassList.has('test-leading-icon-class') ); @@ -152,52 +157,56 @@ test('#adapter.notifyInteraction calls #props.handleInteraction w/ chipId', () = const wrapper = shallow( ); - wrapper.instance().foundation.adapter_.notifyInteraction(); + getAdapter(wrapper.instance()).notifyInteraction(); td.verify(handleInteraction('123'), {times: 1}); }); test('#adapter.notifyRemoval calls #props.handleRemove w/ chipId', () => { const handleRemove = coerceForTesting<(id: string) => void>(td.func()); const wrapper = shallow(); - wrapper.instance().foundation.adapter_.notifyRemoval(); + getAdapter(wrapper.instance()).notifyRemoval(); td.verify(handleRemove('123'), {times: 1}); }); test('#adapter.notifySelection calls #props.handleSelect w/ chipId and selected false', () => { const handleSelect = coerceForTesting<(id: string, selected: boolean) => void>(td.func()); const wrapper = shallow(); - wrapper.instance().foundation.adapter_.notifySelection(false); + getAdapter(wrapper.instance()).notifySelection(false); td.verify(handleSelect('123', false), {times: 2}); }); test('#adapter.notifySelection calls #props.handleSelect w/ chipId and selected true', () => { const handleSelect = coerceForTesting<(id: string, selected: boolean) => void>(td.func()); const wrapper = shallow(); - wrapper.instance().foundation.adapter_.notifySelection(true); + getAdapter(wrapper.instance()).notifySelection(true); td.verify(handleSelect('123', true), {times: 1}); }); test('#adapter.notifyTrailingIconInteraction calls #props.handleTrailingIconInteraction w/ chipId', () => { const handleTrailingIconInteraction = coerceForTesting<(id: string) => void>(td.func()); const wrapper = shallow(); - wrapper.instance().foundation.adapter_.notifyTrailingIconInteraction(); + getAdapter(wrapper.instance()).notifyTrailingIconInteraction(); td.verify(handleTrailingIconInteraction('123'), {times: 1}); }); test('on click calls #props.onClick', () => { const onClick = coerceForTesting<(event: React.MouseEvent) => void>(td.func()); const wrapper = shallow(); - const evt = coerceForTesting({}); + const evt = coerceForTesting({ + nativeEvent: {}, + }); wrapper.simulate('click', evt); td.verify(onClick(evt), {times: 1}); }); test('on click calls #foudation.handleInteraction', () => { const wrapper = shallow(); - wrapper.instance().foundation.handleInteraction = td.func(); - const evt = {}; + wrapper.instance().foundation.handleInteraction = td.func<(evt: MouseEvent | KeyboardEvent) => null>(); + const evt = coerceForTesting({ + nativeEvent: {}, + }); wrapper.simulate('click', evt); - td.verify(wrapper.instance().foundation.handleInteraction(evt), { + td.verify(wrapper.instance().foundation.handleInteraction(evt.nativeEvent), { times: 1, }); }); @@ -205,17 +214,21 @@ test('on click calls #foudation.handleInteraction', () => { test('on keydown calls #props.onKeyDown', () => { const onKeyDown = coerceForTesting<(event: React.KeyboardEvent) => void>(td.func()); const wrapper = shallow(); - const evt = coerceForTesting({}); + const evt = coerceForTesting({ + nativeEvent: {}, + }); wrapper.simulate('keydown', evt); td.verify(onKeyDown(evt), {times: 1}); }); test('on keydown calls #foudation.handleInteraction', () => { const wrapper = shallow(); - wrapper.instance().foundation.handleInteraction = td.func(); - const evt = {}; + wrapper.instance().foundation.handleInteraction = td.func<(evt: MouseEvent | KeyboardEvent) => null>(); + const evt = coerceForTesting({ + nativeEvent: {}, + }); wrapper.simulate('keydown', evt); - td.verify(wrapper.instance().foundation.handleInteraction(evt), { + td.verify(wrapper.instance().foundation.handleInteraction(evt.nativeEvent), { times: 1, }); }); @@ -317,13 +330,16 @@ test('renders trailing icon with base class names', () => { test('trailing icon click calls #foundation.handleTrailingIconInteraction', () => { const trailingIcon = ; const wrapper = shallow(); - wrapper.instance().foundation.handleTrailingIconInteraction = td.func(); - const evt = {}; + wrapper.instance().foundation.handleTrailingIconInteraction = + td.func<(evt: MouseEvent | KeyboardEvent) => null>(); + const evt = coerceForTesting({ + nativeEvent: {}, + }); wrapper .children() .last() .simulate('click', evt); - td.verify(wrapper.instance().foundation.handleTrailingIconInteraction(evt), { + td.verify(wrapper.instance().foundation.handleTrailingIconInteraction(evt.nativeEvent), { times: 1, }); }); @@ -331,13 +347,16 @@ test('trailing icon click calls #foundation.handleTrailingIconInteraction', () = test('trailing icon keydown calls #foundation.handleTrailingIconInteraction', () => { const trailingIcon = ; const wrapper = shallow(); - wrapper.instance().foundation.handleTrailingIconInteraction = td.func(); - const evt = {}; + wrapper.instance().foundation.handleTrailingIconInteraction = + td.func<(evt: MouseEvent | KeyboardEvent) => null>(); + const evt = coerceForTesting({ + nativeEvent: {}, + }); wrapper .children() .last() .simulate('keydown', evt); - td.verify(wrapper.instance().foundation.handleTrailingIconInteraction(evt), { + td.verify(wrapper.instance().foundation.handleTrailingIconInteraction(evt.nativeEvent), { times: 1, }); }); @@ -345,10 +364,12 @@ test('trailing icon keydown calls #foundation.handleTrailingIconInteraction', () test('calls #foundation.handleTransitionEnd on transitionend event', () => { const wrapper = shallow(); - wrapper.instance().foundation.handleTransitionEnd = td.func(); - const evt = {target: {}}; + wrapper.instance().foundation.handleTransitionEnd = td.func<(evt: TransitionEvent) => null>(); + const evt = coerceForTesting({ + nativeEvent: { + target: {}}}); wrapper.simulate('transitionend', evt); - td.verify(wrapper.instance().foundation.handleTransitionEnd(evt), { + td.verify(wrapper.instance().foundation.handleTransitionEnd(evt.nativeEvent), { times: 1, }); }); @@ -358,7 +379,7 @@ test('calls #props.onTransitionEnd on transitionend event', () => { const wrapper = shallow(); // need to remove foundation, since React.TransitionEvent does not have classList on EventTarget // see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/12239 - wrapper.instance().foundation = {handleTransitionEnd: () => {}}; + wrapper.instance().foundation = coerceForTesting({handleTransitionEnd: () => {}}); const evt = coerceForTesting({}); wrapper.simulate('transitionend', evt); td.verify(onTransitionEnd(evt), {times: 1}); @@ -394,7 +415,7 @@ test('renders label text', () => { test('#componentWillUnmount destroys foundation', () => { const wrapper = shallow(); const foundation = wrapper.instance().foundation; - foundation.destroy = td.func(); + foundation.destroy = td.func<() => void>(); wrapper.unmount(); td.verify(foundation.destroy()); }); diff --git a/test/unit/chips/ChipSet.test.tsx b/test/unit/chips/ChipSet.test.tsx index e10e24674..2409b1364 100644 --- a/test/unit/chips/ChipSet.test.tsx +++ b/test/unit/chips/ChipSet.test.tsx @@ -74,7 +74,7 @@ test('#adapter.hasClass returns false if component does not contains class', () test('#adapter.setSelected adds selectedChipId to state', () => { const getSelectedChipIds = td.func(); const handleSelect = coerceForTesting<(selectedChipIds: string[]) => void>(td.func()); - const foundation = {getSelectedChipIds}; + const foundation = coerceForTesting({getSelectedChipIds}); const wrapper = shallow(
@@ -120,22 +120,22 @@ test(
); - wrapper.state().foundation.select = td.func(); + wrapper.state().foundation!.select = td.func<(chipId: string) => null>(); const selectedChipIds = ['1']; wrapper.setState({selectedChipIds}); wrapper.instance().initChipSelection(); - td.verify(wrapper.state().foundation.select('1'), {times: 1}); + td.verify(wrapper.state().foundation!.select('1'), {times: 1}); } ); test('#handleSelect calls foundation.handleChipSelection with selectedChipId and selected=true', () => { const handleChipSelection = td.func(); - const foundation = {handleChipSelection}; const wrapper = shallow(
); + const foundation = coerceForTesting({handleChipSelection}); wrapper.setState({foundation}); wrapper.instance().handleSelect('1', true); td.verify(handleChipSelection('1', true), {times: 1}); @@ -143,7 +143,7 @@ test('#handleSelect calls foundation.handleChipSelection with selectedChipId and test('#handleSelect calls foundation.handleChipSelection with selectedChipId and selected=false', () => { const handleChipSelection = td.func(); - const foundation = {handleChipSelection}; + const foundation = coerceForTesting({handleChipSelection}); const wrapper = shallow(
@@ -211,7 +211,7 @@ test('#chip.props.handleInteraction calls both #chip.handleInteraction calls #fo test('#handleInteraction calls #foundation.handleChipInteraction', () => { const handleChipInteraction = td.func(); - const foundation = {handleChipInteraction}; + const foundation = coerceForTesting({handleChipInteraction}); const wrapper = shallow(
@@ -224,7 +224,7 @@ test('#handleInteraction calls #foundation.handleChipInteraction', () => { test('#handleRemove calls foundation.handleChipRemoval with chipId', () => { const handleChipRemoval = td.func(); - const foundation = {handleChipRemoval}; + const foundation = coerceForTesting({handleChipRemoval}); const wrapper = shallow(
@@ -447,8 +447,8 @@ test('input variant of ChipSet will throw error if chip missing id', () => { test('#componentWillUnmount destroys foundation', () => { const wrapper = shallow(); - const foundation = wrapper.state().foundation; - foundation.destroy = td.func(); + const foundation = wrapper.state().foundation!; + foundation.destroy = td.func<() => null>(); wrapper.unmount(); td.verify(foundation.destroy()); });