From 34d6c827c2f056cbf529897e7d336cdad7ace6f2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Sep 2025 13:12:12 -0400 Subject: [PATCH 1/2] Bump gevent from 25.8.2 to 25.9.1 (#2917) Bumps [gevent](https://github.com/gevent/gevent) from 25.8.2 to 25.9.1. - [Release notes](https://github.com/gevent/gevent/releases) - [Changelog](https://github.com/gevent/gevent/blob/master/docs/changelog_pre.rst) - [Commits](https://github.com/gevent/gevent/compare/25.8.2...25.9.1) --- updated-dependencies: - dependency-name: gevent dependency-version: 25.9.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- poetry.lock | 91 +++++++++++++++++++++++++------------------------- pyproject.toml | 2 +- 2 files changed, 46 insertions(+), 47 deletions(-) diff --git a/poetry.lock b/poetry.lock index f72a0d222..dfe677a93 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1219,56 +1219,55 @@ files = [ [[package]] name = "gevent" -version = "25.8.2" +version = "25.9.1" description = "Coroutine-based network library" optional = false python-versions = ">=3.9" groups = ["main"] files = [ - {file = "gevent-25.8.2-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:af63a3f93f08c05aa8f4b94396686c2367c2f732adfbef69bc7032dbe7e30544"}, - {file = "gevent-25.8.2-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:fd8c8ef0647910745b2c478313398d118e3aefb5c2e2676e24bfcaa0973aa14b"}, - {file = "gevent-25.8.2-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:717c2e90a267a7b6c74a9a6e432ee86c34651313180a85f551019385fdf1cefd"}, - {file = "gevent-25.8.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:16b1688220ca33e0f37351b7ab03235fb65973e32336efd356abda0c770318c4"}, - {file = "gevent-25.8.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:fccea073cffb0204d93e5dfadbc059cf73cf97c2563d251a1157d5e3c0bbed10"}, - {file = "gevent-25.8.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:edb9faf781408d9a00741d8b85cde051d04f3c2fdd71dd106ef7db255aae4e15"}, - {file = "gevent-25.8.2-cp310-cp310-win_amd64.whl", hash = "sha256:f401539fb28a47f8608443d1051dbb0f09ac5c49f6b604f7bdf4d98fc1e7094b"}, - {file = "gevent-25.8.2-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:4b6d143b3facc930a90e263a4faebe8776f5e8493055022a493ec9de8a259690"}, - {file = "gevent-25.8.2-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:128f68c7ddb4ce55760557549ce8db0ea2f7818a963a148e7a2f22fb6ee34645"}, - {file = "gevent-25.8.2-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:d6d250ad0382135ad8bfb9cfd0c2a33a3dfd251a05657f652152e0c9084d1ddd"}, - {file = "gevent-25.8.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:59107c7a452c7a70388b350f9840e6f5761a61e7c9750c48ad10066f29ac9a56"}, - {file = "gevent-25.8.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:c4bd94b59b68058157b1632ae3488124d569b7067ad458c654cd4fb7dd2d5ade"}, - {file = "gevent-25.8.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:dead93501a7d7973294708b73d7e47b13c16f001a317094b2068730f9ab2ad39"}, - {file = "gevent-25.8.2-cp311-cp311-win_amd64.whl", hash = "sha256:f99f2587f3b99f4ddc3446cee2ef4b8dea75ea536994377881a2f50a31f43dd9"}, - {file = "gevent-25.8.2-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:0a8cf26b0852bd31761b5ac35485520657dc22eeded2a867d4fe97bc341bd338"}, - {file = "gevent-25.8.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:36cd3bb6184c44b959c918a13d33a2f533de6d3eccf03a9ea3b90a1639082c3a"}, - {file = "gevent-25.8.2-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:fa2dd9474eda6e990ec52b3ea74e0cb8713f1ef98fbaedcbcdcdef783cd7f863"}, - {file = "gevent-25.8.2-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:2c3018f3e89443e7086c905cd6da69c249d48070cc0f8d5357fdc325a9641bd2"}, - {file = "gevent-25.8.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:ef20a651139f281fa014e26bb1642b17aa46d0f7afa29b024ffb195249644925"}, - {file = "gevent-25.8.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:3358fc5bf0b960533d0ac2839fa9458fe5f6288b816b48ce7677b5e92434dad8"}, - {file = "gevent-25.8.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b3c613e128f805b85fa03d54470a57e37592d2206e95c9553bcfd6b517863003"}, - {file = "gevent-25.8.2-cp312-cp312-win_amd64.whl", hash = "sha256:647bbbeeddd69bfdbd3df1a7c864b4727bfb09e7f461f47293e3d98ded7d74d4"}, - {file = "gevent-25.8.2-cp313-cp313-macosx_11_0_universal2.whl", hash = "sha256:a30373121527feff642a7528bf674eb7b1d3cb343d6b2b3eb42e7ea76288d8f0"}, - {file = "gevent-25.8.2-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:c70ee82f417d1c94db3eb3fd2d14bfa6995a61b88f66005a69a169ad1df55b59"}, - {file = "gevent-25.8.2-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:6a1399407299c710f5fe9348cda3f16e6d6fd6e592098d8bb678d58393b5457d"}, - {file = "gevent-25.8.2-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:6513e872a365acb407c7a13e11112bbfe8b9d6f0cc138182b50ce9f4074a1f2f"}, - {file = "gevent-25.8.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:e7d586a041f13b661dbe25137d6659fe246b1b454d0c5c29be26a3d8d4ed96cf"}, - {file = "gevent-25.8.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:07717cb293684185bd5190b876d897dd8ed11d6eb707264a0541bc36a6b06ba3"}, - {file = "gevent-25.8.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:14e3ece38dcb24209a5b05dcc7ba5544514943bb7841bc5152c395c69e7ffbdc"}, - {file = "gevent-25.8.2-cp313-cp313-win_amd64.whl", hash = "sha256:791fb76294b79d5b0271b1be088d5dfb37506b7a8f4315ff939cae32b46be905"}, - {file = "gevent-25.8.2-cp314-cp314-macosx_11_0_universal2.whl", hash = "sha256:2776417181b27466b562bc47af5d20a55e2ccd4deec06a96f37e58317e1c8525"}, - {file = "gevent-25.8.2-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:9b795ea9727d873387483df4ffd31137c4859746c9c789238db483a28bfa16de"}, - {file = "gevent-25.8.2-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:98a4302cb64c3fbc1f7472b051ac79e68b3d41f9d37a08a0fc6058461079dedf"}, - {file = "gevent-25.8.2-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:5c4a99ac674d8c13459e03dcb5550a4a3639a9bd1dcda12a630ffdd1fae8d9f8"}, - {file = "gevent-25.8.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:398dc7adbcd8cf1fcb2dc8dc48aafc355790bff842c906a28b9f995bcc061bd2"}, - {file = "gevent-25.8.2-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:3535a699771f35b460026077dec946e73e4744afb5661b4e05a78eea74c120ce"}, - {file = "gevent-25.8.2-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:23383d4e50718750f44cabdf1f8d4905108da0ffc6a8bf85448fb0a68f0e1b4d"}, - {file = "gevent-25.8.2-cp314-cp314-win_amd64.whl", hash = "sha256:28a60e5f1174ac568639ab3bd12be9d620478a35acf0ad3156ef117918b4f551"}, - {file = "gevent-25.8.2-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:8a4d24f188cb0bd71096a4037c11aa5674858c00749d3dbf3ec042642d3e9b09"}, - {file = "gevent-25.8.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:6c804b0141222891310d6d15ae172a621183d2d6ecb2f2bd94c6c72af648c622"}, - {file = "gevent-25.8.2-cp39-cp39-win32.whl", hash = "sha256:59875a8533b103b7bca950bcdbbbc1456484bff1a906b9eceefaf7fd7e297a9e"}, - {file = "gevent-25.8.2-cp39-cp39-win_amd64.whl", hash = "sha256:2969cb688461de0ea04b80aa09b74b3ac18b70372206b27a445c7d727a5956af"}, - {file = "gevent-25.8.2-pp310-pypy310_pp73-macosx_11_0_universal2.whl", hash = "sha256:cf365361ab40435e3c28c7335cdeb7f6f2b9a8ce6eaced01addbba1c83e4f08f"}, - {file = "gevent-25.8.2.tar.gz", hash = "sha256:0cfab118ad5dcc55d7847dd9dccd560d9015fe671f42714b6f1ac97e3b2b9a3a"}, + {file = "gevent-25.9.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:856b990be5590e44c3a3dc6c8d48a40eaccbb42e99d2b791d11d1e7711a4297e"}, + {file = "gevent-25.9.1-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:fe1599d0b30e6093eb3213551751b24feeb43db79f07e89d98dd2f3330c9063e"}, + {file = "gevent-25.9.1-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:f0d8b64057b4bf1529b9ef9bd2259495747fba93d1f836c77bfeaacfec373fd0"}, + {file = "gevent-25.9.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:b56cbc820e3136ba52cd690bdf77e47a4c239964d5f80dc657c1068e0fe9521c"}, + {file = "gevent-25.9.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:c5fa9ce5122c085983e33e0dc058f81f5264cebe746de5c401654ab96dddfca8"}, + {file = "gevent-25.9.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:03c74fec58eda4b4edc043311fca8ba4f8744ad1632eb0a41d5ec25413581975"}, + {file = "gevent-25.9.1-cp310-cp310-win_amd64.whl", hash = "sha256:a8ae9f895e8651d10b0a8328a61c9c53da11ea51b666388aa99b0ce90f9fdc27"}, + {file = "gevent-25.9.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:18e5aff9e8342dc954adb9c9c524db56c2f3557999463445ba3d9cbe3dada7b7"}, + {file = "gevent-25.9.1-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:1cdf6db28f050ee103441caa8b0448ace545364f775059d5e2de089da975c457"}, + {file = "gevent-25.9.1-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:812debe235a8295be3b2a63b136c2474241fa5c58af55e6a0f8cfc29d4936235"}, + {file = "gevent-25.9.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:b28b61ff9216a3d73fe8f35669eefcafa957f143ac534faf77e8a19eb9e6883a"}, + {file = "gevent-25.9.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:5e4b6278b37373306fc6b1e5f0f1cf56339a1377f67c35972775143d8d7776ff"}, + {file = "gevent-25.9.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:d99f0cb2ce43c2e8305bf75bee61a8bde06619d21b9d0316ea190fc7a0620a56"}, + {file = "gevent-25.9.1-cp311-cp311-win_amd64.whl", hash = "sha256:72152517ecf548e2f838c61b4be76637d99279dbaa7e01b3924df040aa996586"}, + {file = "gevent-25.9.1-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:46b188248c84ffdec18a686fcac5dbb32365d76912e14fda350db5dc0bfd4f86"}, + {file = "gevent-25.9.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:f2b54ea3ca6f0c763281cd3f96010ac7e98c2e267feb1221b5a26e2ca0b9a692"}, + {file = "gevent-25.9.1-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:7a834804ac00ed8a92a69d3826342c677be651b1c3cd66cc35df8bc711057aa2"}, + {file = "gevent-25.9.1-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:323a27192ec4da6b22a9e51c3d9d896ff20bc53fdc9e45e56eaab76d1c39dd74"}, + {file = "gevent-25.9.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:6ea78b39a2c51d47ff0f130f4c755a9a4bbb2dd9721149420ad4712743911a51"}, + {file = "gevent-25.9.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:dc45cd3e1cc07514a419960af932a62eb8515552ed004e56755e4bf20bad30c5"}, + {file = "gevent-25.9.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:34e01e50c71eaf67e92c186ee0196a039d6e4f4b35670396baed4a2d8f1b347f"}, + {file = "gevent-25.9.1-cp312-cp312-win_amd64.whl", hash = "sha256:4acd6bcd5feabf22c7c5174bd3b9535ee9f088d2bbce789f740ad8d6554b18f3"}, + {file = "gevent-25.9.1-cp313-cp313-macosx_11_0_universal2.whl", hash = "sha256:4f84591d13845ee31c13f44bdf6bd6c3dbf385b5af98b2f25ec328213775f2ed"}, + {file = "gevent-25.9.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:9cdbb24c276a2d0110ad5c978e49daf620b153719ac8a548ce1250a7eb1b9245"}, + {file = "gevent-25.9.1-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:88b6c07169468af631dcf0fdd3658f9246d6822cc51461d43f7c44f28b0abb82"}, + {file = "gevent-25.9.1-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:b7bb0e29a7b3e6ca9bed2394aa820244069982c36dc30b70eb1004dd67851a48"}, + {file = "gevent-25.9.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:2951bb070c0ee37b632ac9134e4fdaad70d2e660c931bb792983a0837fe5b7d7"}, + {file = "gevent-25.9.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:e4e17c2d57e9a42e25f2a73d297b22b60b2470a74be5a515b36c984e1a246d47"}, + {file = "gevent-25.9.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:8d94936f8f8b23d9de2251798fcb603b84f083fdf0d7f427183c1828fb64f117"}, + {file = "gevent-25.9.1-cp313-cp313-win_amd64.whl", hash = "sha256:eb51c5f9537b07da673258b4832f6635014fee31690c3f0944d34741b69f92fa"}, + {file = "gevent-25.9.1-cp314-cp314-macosx_11_0_universal2.whl", hash = "sha256:1a3fe4ea1c312dbf6b375b416925036fe79a40054e6bf6248ee46526ea628be1"}, + {file = "gevent-25.9.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:0adb937f13e5fb90cca2edf66d8d7e99d62a299687400ce2edee3f3504009356"}, + {file = "gevent-25.9.1-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:427f869a2050a4202d93cf7fd6ab5cffb06d3e9113c10c967b6e2a0d45237cb8"}, + {file = "gevent-25.9.1-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:c049880175e8c93124188f9d926af0a62826a3b81aa6d3074928345f8238279e"}, + {file = "gevent-25.9.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:b5a67a0974ad9f24721034d1e008856111e0535f1541499f72a733a73d658d1c"}, + {file = "gevent-25.9.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:1d0f5d8d73f97e24ea8d24d8be0f51e0cf7c54b8021c1fddb580bf239474690f"}, + {file = "gevent-25.9.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:ddd3ff26e5c4240d3fbf5516c2d9d5f2a998ef87cfb73e1429cfaeaaec860fa6"}, + {file = "gevent-25.9.1-cp314-cp314-win_amd64.whl", hash = "sha256:bb63c0d6cb9950cc94036a4995b9cc4667b8915366613449236970f4394f94d7"}, + {file = "gevent-25.9.1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:f18f80aef6b1f6907219affe15b36677904f7cfeed1f6a6bc198616e507ae2d7"}, + {file = "gevent-25.9.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:b274a53e818124a281540ebb4e7a2c524778f745b7a99b01bdecf0ca3ac0ddb0"}, + {file = "gevent-25.9.1-cp39-cp39-win32.whl", hash = "sha256:c6c91f7e33c7f01237755884316110ee7ea076f5bdb9aa0982b6dc63243c0a38"}, + {file = "gevent-25.9.1-cp39-cp39-win_amd64.whl", hash = "sha256:012a44b0121f3d7c800740ff80351c897e85e76a7e4764690f35c5ad9ec17de5"}, + {file = "gevent-25.9.1.tar.gz", hash = "sha256:adf9cd552de44a4e6754c51ff2e78d9193b7fa6eab123db9578a210e657235dd"}, ] [package.dependencies] @@ -4245,4 +4244,4 @@ cffi = ["cffi (>=1.17) ; python_version >= \"3.13\" and platform_python_implemen [metadata] lock-version = "2.1" python-versions = "^3.13.2" -content-hash = "91c1c5946444d9bcfdc89eb1163a2d5deca37c1ff74f75836524ba5edee8069d" +content-hash = "68943e1d949b5d60866849a7d54fc77f1705be497d34cbe364d5262c32104588" diff --git a/pyproject.toml b/pyproject.toml index 4bd4169aa..803c792a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ python = "^3.13.2" ago = "~=0.1.0" beautifulsoup4 = "^4.13.5" blinker = "~=1.8" -gevent = "==25.8.2" +gevent = "==25.9.1" exceptiongroup = "==1.3.0" flask = "~=3.1" flask-basicauth = "~=0.2" From 8057c7f8dc2cce27f7cffcf21d71b0329158bf9f Mon Sep 17 00:00:00 2001 From: Alex Janousek Date: Thu, 18 Sep 2025 16:42:39 -0400 Subject: [PATCH 2/2] Consolidating code ql findings (#2920) * Consolidating code ql findings * Added ref files for backstop to set baseline for removing custom js file * Potential fix for code scanning alert no. 32: URL redirection from remote source Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * Removed unused large file * Fixed import order --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- .../javascripts/collapsibleCheckboxes.js | 3 +- app/assets/javascripts/radioSlider.js | 4 +- app/assets/js/uswds.js | 7072 ----------------- app/main/views/organizations.py | 14 +- app/main/views/templates.py | 15 +- app/status/views/healthcheck.py | 2 +- app/utils/login.py | 17 +- ...st_API_Guest_List_0_document_0_desktop.png | Bin 138588 -> 137982 bytes ...top_test_API_Keys_0_document_0_desktop.png | Bin 102968 -> 102482 bytes ...t_API_Keys_Create_0_document_0_desktop.png | Bin 122249 -> 121493 bytes ...ckstop_test_About_0_document_0_desktop.png | Bin 334526 -> 333360 bytes ...ibility_Statement_0_document_0_desktop.png | Bin 517145 -> 517147 bytes ...test_All_Activity_0_document_0_desktop.png | Bin 461723 -> 478700 bytes ...1_ausa-buttonhrefadd-service_0_desktop.png | Bin 2777 -> 2784 bytes ...t_Choose_Template_0_document_0_desktop.png | Bin 120704 -> 120082 bytes ...ata_Retention_Add_0_document_0_desktop.png | Bin 106183 -> 105633 bytes ...t_Delivery_Status_0_document_0_desktop.png | Bin 361378 -> 361378 bytes ...mail_Not_Received_0_document_0_desktop.png | Bin 106134 -> 139259 bytes ...top_test_Homepage_0_document_0_desktop.png | Bin 161810 -> 161815 bytes ..._test_Invite_User_0_document_0_desktop.png | Bin 225385 -> 224839 bytes ...e_to_Organization_0_document_0_desktop.png | Bin 113447 -> 112918 bytes ...ov_Service_Ending_0_document_0_desktop.png | Bin 240541 -> 240541 bytes ...Notifygov_Sign_In_0_document_0_desktop.png | Bin 106134 -> 139259 bytes ..._test_Performance_0_document_0_desktop.png | Bin 131722 -> 140740 bytes ...min_Live_Services_0_document_0_desktop.png | Bin 126436 -> 126436 bytes ...stop_test_Privacy_0_document_0_desktop.png | Bin 465092 -> 465091 bytes ..._Template_Preview_0_document_0_desktop.png | Bin 125144 -> 124669 bytes ...top_test_Security_0_document_0_desktop.png | Bin 266973 -> 266971 bytes ...nd_One_Off_Step_2_0_document_0_desktop.png | Bin 125144 -> 124669 bytes ...ervice_SMS_Prefix_0_document_0_desktop.png | Bin 109724 -> 109103 bytes ...nd_Files_By_Email_0_document_0_desktop.png | Bin 138832 -> 138202 bytes ..._Service_Settings_0_document_0_desktop.png | Bin 214733 -> 214732 bytes ...ate_Letter_Sender_0_document_0_desktop.png | Bin 98632 -> 97877 bytes ...t_Template_Sender_0_document_0_desktop.png | Bin 127847 -> 127401 bytes ...stop_test_Support_0_document_0_desktop.png | Bin 112043 -> 112043 bytes ...Text_Not_Received_0_document_0_desktop.png | Bin 106134 -> 139259 bytes ...stop_test_Uploads_0_document_0_desktop.png | Bin 432795 -> 100783 bytes ..._Profile_Timezone_0_document_0_desktop.png | Bin 114685 -> 114686 bytes ...hy_Text_Messaging_0_document_0_desktop.png | Bin 320902 -> 320902 bytes ..._Write_For_Action_0_document_0_desktop.png | Bin 462424 -> 462423 bytes package-lock.json | 29 +- tests/app/main/views/test_template_folders.py | 4 +- 42 files changed, 60 insertions(+), 7100 deletions(-) delete mode 100644 app/assets/js/uswds.js diff --git a/app/assets/javascripts/collapsibleCheckboxes.js b/app/assets/javascripts/collapsibleCheckboxes.js index aef44d734..864701d19 100644 --- a/app/assets/javascripts/collapsibleCheckboxes.js +++ b/app/assets/javascripts/collapsibleCheckboxes.js @@ -118,7 +118,8 @@ CollapsibleCheckboxes.prototype.addHeadingHideLegend = function() { const headingLevel = this.$component.data('heading-level') || '2'; - this.$heading = $(`${this.legendText}`); + this.$heading = $(``); + this.$heading.text(this.legendText); this.$fieldset.before(this.$heading); this.$fieldset.find('legend').addClass('usa-sr-only'); diff --git a/app/assets/javascripts/radioSlider.js b/app/assets/javascripts/radioSlider.js index d0dffce99..b0269843a 100644 --- a/app/assets/javascripts/radioSlider.js +++ b/app/assets/javascripts/radioSlider.js @@ -14,8 +14,8 @@ if (valuesInLabel.length === 2) { leftValue = valuesInLabel[0]; rightValue = valuesInLabel[1]; - $(this).find('.radio-slider-left-value').html(leftValue); - $(this).find('.radio-slider-right-value').html(rightValue); + $(this).find('.radio-slider-left-value').text(leftValue); + $(this).find('.radio-slider-right-value').text(rightValue); } }) diff --git a/app/assets/js/uswds.js b/app/assets/js/uswds.js deleted file mode 100644 index 8052650c7..000000000 --- a/app/assets/js/uswds.js +++ /dev/null @@ -1,7072 +0,0 @@ -(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i'], - 191: ['/', '?'], - 192: ['`', '~'], - 219: ['[', '{'], - 220: ['\\', '|'], - 221: [']', '}'], - 222: ["'", '"'], - 224: 'Meta', - 225: 'AltGraph', - 246: 'Attn', - 247: 'CrSel', - 248: 'ExSel', - 249: 'EraseEof', - 250: 'Play', - 251: 'ZoomOut' - } - }; - - // Function keys (F1-24). - var i; - for (i = 1; i < 25; i++) { - keyboardeventKeyPolyfill.keys[111 + i] = 'F' + i; - } - - // Printable ASCII characters. - var letter = ''; - for (i = 65; i < 91; i++) { - letter = String.fromCharCode(i); - keyboardeventKeyPolyfill.keys[i] = [letter.toLowerCase(), letter.toUpperCase()]; - } - function polyfill() { - if (!('KeyboardEvent' in window) || 'key' in KeyboardEvent.prototype) { - return false; - } - - // Polyfill `key` on `KeyboardEvent`. - var proto = { - get: function (x) { - var key = keyboardeventKeyPolyfill.keys[this.which || this.keyCode]; - if (Array.isArray(key)) { - key = key[+this.shiftKey]; - } - return key; - } - }; - Object.defineProperty(KeyboardEvent.prototype, 'key', proto); - return proto; - } - if (typeof define === 'function' && define.amd) { - define('keyboardevent-key-polyfill', keyboardeventKeyPolyfill); - } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') { - module.exports = keyboardeventKeyPolyfill; - } else if (window) { - window.keyboardeventKeyPolyfill = keyboardeventKeyPolyfill; - } -})(); - -},{}],4:[function(require,module,exports){ -/* -object-assign -(c) Sindre Sorhus -@license MIT -*/ - -'use strict'; - -/* eslint-disable no-unused-vars */ -var getOwnPropertySymbols = Object.getOwnPropertySymbols; -var hasOwnProperty = Object.prototype.hasOwnProperty; -var propIsEnumerable = Object.prototype.propertyIsEnumerable; -function toObject(val) { - if (val === null || val === undefined) { - throw new TypeError('Object.assign cannot be called with null or undefined'); - } - return Object(val); -} -function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } - - // Detect buggy property enumeration order in older V8 versions. - - // https://bugs.chromium.org/p/v8/issues/detail?id=4118 - var test1 = new String('abc'); // eslint-disable-line no-new-wrappers - test1[5] = 'de'; - if (Object.getOwnPropertyNames(test1)[0] === '5') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test2 = {}; - for (var i = 0; i < 10; i++) { - test2['_' + String.fromCharCode(i)] = i; - } - var order2 = Object.getOwnPropertyNames(test2).map(function (n) { - return test2[n]; - }); - if (order2.join('') !== '0123456789') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test3 = {}; - 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') { - return false; - } - return true; - } catch (err) { - // We don't expect any of the above to throw, but better to be safe. - return false; - } -} -module.exports = shouldUseNative() ? Object.assign : function (target, source) { - var from; - var to = toObject(target); - var symbols; - for (var s = 1; s < arguments.length; s++) { - from = Object(arguments[s]); - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } - } - if (getOwnPropertySymbols) { - symbols = getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } - } - } - } - return to; -}; - -},{}],5:[function(require,module,exports){ -"use strict"; - -const assign = require('object-assign'); -const delegate = require('../delegate'); -const delegateAll = require('../delegateAll'); -const DELEGATE_PATTERN = /^(.+):delegate\((.+)\)$/; -const SPACE = ' '; -const getListeners = function (type, handler) { - var match = type.match(DELEGATE_PATTERN); - var selector; - if (match) { - type = match[1]; - selector = match[2]; - } - var options; - if (typeof handler === 'object') { - options = { - capture: popKey(handler, 'capture'), - passive: popKey(handler, 'passive') - }; - } - var listener = { - selector: selector, - delegate: typeof handler === 'object' ? delegateAll(handler) : selector ? delegate(selector, handler) : handler, - options: options - }; - if (type.indexOf(SPACE) > -1) { - return type.split(SPACE).map(function (_type) { - return assign({ - type: _type - }, listener); - }); - } else { - listener.type = type; - return [listener]; - } -}; -var popKey = function (obj, key) { - var value = obj[key]; - delete obj[key]; - return value; -}; -module.exports = function behavior(events, props) { - const listeners = Object.keys(events).reduce(function (memo, type) { - var listeners = getListeners(type, events[type]); - return memo.concat(listeners); - }, []); - return assign({ - add: function addBehavior(element) { - listeners.forEach(function (listener) { - element.addEventListener(listener.type, listener.delegate, listener.options); - }); - }, - remove: function removeBehavior(element) { - listeners.forEach(function (listener) { - element.removeEventListener(listener.type, listener.delegate, listener.options); - }); - } - }, props); -}; - -},{"../delegate":7,"../delegateAll":8,"object-assign":4}],6:[function(require,module,exports){ -"use strict"; - -module.exports = function compose(functions) { - return function (e) { - return functions.some(function (fn) { - return fn.call(this, e) === false; - }, this); - }; -}; - -},{}],7:[function(require,module,exports){ -"use strict"; - -// polyfill Element.prototype.closest -require('element-closest'); -module.exports = function delegate(selector, fn) { - return function delegation(event) { - var target = event.target.closest(selector); - if (target) { - return fn.call(target, event); - } - }; -}; - -},{"element-closest":2}],8:[function(require,module,exports){ -"use strict"; - -const delegate = require('../delegate'); -const compose = require('../compose'); -const SPLAT = '*'; -module.exports = function delegateAll(selectors) { - const keys = Object.keys(selectors); - - // XXX optimization: if there is only one handler and it applies to - // all elements (the "*" CSS selector), then just return that - // handler - if (keys.length === 1 && keys[0] === SPLAT) { - return selectors[SPLAT]; - } - const delegates = keys.reduce(function (memo, selector) { - memo.push(delegate(selector, selectors[selector])); - return memo; - }, []); - return compose(delegates); -}; - -},{"../compose":6,"../delegate":7}],9:[function(require,module,exports){ -"use strict"; - -module.exports = function ignore(element, fn) { - return function ignorance(e) { - if (element !== e.target && !element.contains(e.target)) { - return fn.call(this, e); - } - }; -}; - -},{}],10:[function(require,module,exports){ -"use strict"; - -module.exports = { - behavior: require('./behavior'), - delegate: require('./delegate'), - delegateAll: require('./delegateAll'), - ignore: require('./ignore'), - keymap: require('./keymap') -}; - -},{"./behavior":5,"./delegate":7,"./delegateAll":8,"./ignore":9,"./keymap":11}],11:[function(require,module,exports){ -"use strict"; - -require('keyboardevent-key-polyfill'); - -// these are the only relevant modifiers supported on all platforms, -// according to MDN: -// -const MODIFIERS = { - 'Alt': 'altKey', - 'Control': 'ctrlKey', - 'Ctrl': 'ctrlKey', - 'Shift': 'shiftKey' -}; -const MODIFIER_SEPARATOR = '+'; -const getEventKey = function (event, hasModifiers) { - var key = event.key; - if (hasModifiers) { - for (var modifier in MODIFIERS) { - if (event[MODIFIERS[modifier]] === true) { - key = [modifier, key].join(MODIFIER_SEPARATOR); - } - } - } - return key; -}; -module.exports = function keymap(keys) { - const hasModifiers = Object.keys(keys).some(function (key) { - return key.indexOf(MODIFIER_SEPARATOR) > -1; - }); - return function (event) { - var key = getEventKey(event, hasModifiers); - return [key, key.toLowerCase()].reduce(function (result, _key) { - if (_key in keys) { - result = keys[key].call(this, event); - } - return result; - }, undefined); - }; -}; -module.exports.MODIFIERS = MODIFIERS; - -},{"keyboardevent-key-polyfill":3}],12:[function(require,module,exports){ -"use strict"; - -module.exports = function once(listener, options) { - var wrapped = function wrappedOnce(e) { - e.currentTarget.removeEventListener(e.type, wrapped, options); - return listener.call(this, e); - }; - return wrapped; -}; - -},{}],13:[function(require,module,exports){ -'use strict'; - -var RE_TRIM = /(^\s+)|(\s+$)/g; -var RE_SPLIT = /\s+/; -var trim = String.prototype.trim ? function (str) { - return str.trim(); -} : function (str) { - return str.replace(RE_TRIM, ''); -}; -var queryById = function (id) { - return this.querySelector('[id="' + id.replace(/"/g, '\\"') + '"]'); -}; -module.exports = function resolveIds(ids, doc) { - if (typeof ids !== 'string') { - throw new Error('Expected a string but got ' + typeof ids); - } - if (!doc) { - doc = window.document; - } - var getElementById = doc.getElementById ? doc.getElementById.bind(doc) : queryById.bind(doc); - ids = trim(ids).split(RE_SPLIT); - - // XXX we can short-circuit here because trimming and splitting a - // string of just whitespace produces an array containing a single, - // empty string - if (ids.length === 1 && ids[0] === '') { - return []; - } - return ids.map(function (id) { - var el = getElementById(id); - if (!el) { - throw new Error('no element with id: "' + id + '"'); - } - return el; - }); -}; - -},{}],14:[function(require,module,exports){ -"use strict"; - -const behavior = require("../../uswds-core/src/js/utils/behavior"); -const toggleFormInput = require("../../uswds-core/src/js/utils/toggle-form-input"); -const { - CLICK -} = require("../../uswds-core/src/js/events"); -const { - prefix: PREFIX -} = require("../../uswds-core/src/js/config"); -const LINK = `.${PREFIX}-show-password`; -function toggle(event) { - event.preventDefault(); - toggleFormInput(this); -} -module.exports = behavior({ - [CLICK]: { - [LINK]: toggle - } -}); - -},{"../../uswds-core/src/js/config":35,"../../uswds-core/src/js/events":36,"../../uswds-core/src/js/utils/behavior":45,"../../uswds-core/src/js/utils/toggle-form-input":55}],15:[function(require,module,exports){ -"use strict"; - -const select = require("../../uswds-core/src/js/utils/select"); -const behavior = require("../../uswds-core/src/js/utils/behavior"); -const toggle = require("../../uswds-core/src/js/utils/toggle"); -const isElementInViewport = require("../../uswds-core/src/js/utils/is-in-viewport"); -const { - CLICK -} = require("../../uswds-core/src/js/events"); -const { - prefix: PREFIX -} = require("../../uswds-core/src/js/config"); -const ACCORDION = `.${PREFIX}-accordion, .${PREFIX}-accordion--bordered`; -const BUTTON = `.${PREFIX}-accordion__button[aria-controls]`; -const EXPANDED = "aria-expanded"; -const MULTISELECTABLE = "data-allow-multiple"; - -/** - * Get an Array of button elements belonging directly to the given - * accordion element. - * @param {HTMLElement} accordion - * @return {array} - */ -const getAccordionButtons = accordion => { - const buttons = select(BUTTON, accordion); - return buttons.filter(button => button.closest(ACCORDION) === accordion); -}; - -/** - * Toggle a button's "pressed" state, optionally providing a target - * state. - * - * @param {HTMLButtonElement} button - * @param {boolean?} expanded If no state is provided, the current - * state will be toggled (from false to true, and vice-versa). - * @return {boolean} the resulting state - */ -const toggleButton = (button, expanded) => { - const accordion = button.closest(ACCORDION); - let safeExpanded = expanded; - if (!accordion) { - throw new Error(`${BUTTON} is missing outer ${ACCORDION}`); - } - safeExpanded = toggle(button, expanded); - - // XXX multiselectable is opt-in, to preserve legacy behavior - const multiselectable = accordion.hasAttribute(MULTISELECTABLE); - if (safeExpanded && !multiselectable) { - getAccordionButtons(accordion).forEach(other => { - if (other !== button) { - toggle(other, false); - } - }); - } -}; - -/** - * @param {HTMLButtonElement} button - * @return {boolean} true - */ -const showButton = button => toggleButton(button, true); - -/** - * @param {HTMLButtonElement} button - * @return {boolean} false - */ -const hideButton = button => toggleButton(button, false); -const accordion = behavior({ - [CLICK]: { - [BUTTON]() { - toggleButton(this); - if (this.getAttribute(EXPANDED) === "true") { - // We were just expanded, but if another accordion was also just - // collapsed, we may no longer be in the viewport. This ensures - // that we are still visible, so the user isn't confused. - if (!isElementInViewport(this)) this.scrollIntoView(); - } - } - } -}, { - init(root) { - select(BUTTON, root).forEach(button => { - const expanded = button.getAttribute(EXPANDED) === "true"; - toggleButton(button, expanded); - }); - }, - ACCORDION, - BUTTON, - show: showButton, - hide: hideButton, - toggle: toggleButton, - getButtons: getAccordionButtons -}); -module.exports = accordion; - -},{"../../uswds-core/src/js/config":35,"../../uswds-core/src/js/events":36,"../../uswds-core/src/js/utils/behavior":45,"../../uswds-core/src/js/utils/is-in-viewport":48,"../../uswds-core/src/js/utils/select":53,"../../uswds-core/src/js/utils/toggle":56}],16:[function(require,module,exports){ -"use strict"; - -const behavior = require("../../uswds-core/src/js/utils/behavior"); -const { - CLICK -} = require("../../uswds-core/src/js/events"); -const { - prefix: PREFIX -} = require("../../uswds-core/src/js/config"); -const HEADER = `.${PREFIX}-banner__header`; -const EXPANDED_CLASS = `${PREFIX}-banner__header--expanded`; -const toggleBanner = function toggleEl(event) { - event.preventDefault(); - this.closest(HEADER).classList.toggle(EXPANDED_CLASS); -}; -module.exports = behavior({ - [CLICK]: { - [`${HEADER} [aria-controls]`]: toggleBanner - } -}); - -},{"../../uswds-core/src/js/config":35,"../../uswds-core/src/js/events":36,"../../uswds-core/src/js/utils/behavior":45}],17:[function(require,module,exports){ -"use strict"; - -const select = require("../../uswds-core/src/js/utils/select"); -const behavior = require("../../uswds-core/src/js/utils/behavior"); -const debounce = require("../../uswds-core/src/js/utils/debounce"); -const { - prefix: PREFIX -} = require("../../uswds-core/src/js/config"); -const CHARACTER_COUNT_CLASS = `${PREFIX}-character-count`; -const CHARACTER_COUNT = `.${CHARACTER_COUNT_CLASS}`; -const INPUT = `.${PREFIX}-character-count__field`; -const MESSAGE = `.${PREFIX}-character-count__message`; -const VALIDATION_MESSAGE = "The content is too long."; -const MESSAGE_INVALID_CLASS = `${PREFIX}-character-count__status--invalid`; -const STATUS_MESSAGE_CLASS = `${CHARACTER_COUNT_CLASS}__status`; -const STATUS_MESSAGE_SR_ONLY_CLASS = `${CHARACTER_COUNT_CLASS}__sr-status`; -const STATUS_MESSAGE = `.${STATUS_MESSAGE_CLASS}`; -const STATUS_MESSAGE_SR_ONLY = `.${STATUS_MESSAGE_SR_ONLY_CLASS}`; -const DEFAULT_STATUS_LABEL = `characters allowed`; - -/** - * Returns the root and message element for an character count input - * - * @param {HTMLInputElement|HTMLTextAreaElement} inputEl The character count input element - * @returns {CharacterCountElements} elements The root and message element. - */ -const getCharacterCountElements = inputEl => { - const characterCountEl = inputEl.closest(CHARACTER_COUNT); - if (!characterCountEl) { - throw new Error(`${INPUT} is missing outer ${CHARACTER_COUNT}`); - } - const messageEl = characterCountEl.querySelector(MESSAGE); - if (!messageEl) { - throw new Error(`${CHARACTER_COUNT} is missing inner ${MESSAGE}`); - } - return { - characterCountEl, - messageEl - }; -}; - -/** - * Move maxlength attribute to a data attribute on usa-character-count - * - * @param {HTMLInputElement|HTMLTextAreaElement} inputEl The character count input element - */ -const setDataLength = inputEl => { - const { - characterCountEl - } = getCharacterCountElements(inputEl); - const maxlength = inputEl.getAttribute("maxlength"); - if (!maxlength) return; - inputEl.removeAttribute("maxlength"); - characterCountEl.setAttribute("data-maxlength", maxlength); -}; - -/** - * Create and append status messages for visual and screen readers - * - * @param {HTMLDivElement} characterCountEl - Div with `.usa-character-count` class - * @description Create two status messages for number of characters left; - * one visual status and another for screen readers - */ -const createStatusMessages = characterCountEl => { - const statusMessage = document.createElement("div"); - const srStatusMessage = document.createElement("div"); - const maxLength = characterCountEl.dataset.maxlength; - const defaultMessage = `${maxLength} ${DEFAULT_STATUS_LABEL}`; - statusMessage.classList.add(`${STATUS_MESSAGE_CLASS}`, "usa-hint"); - srStatusMessage.classList.add(`${STATUS_MESSAGE_SR_ONLY_CLASS}`, "usa-sr-only"); - statusMessage.setAttribute("aria-hidden", true); - srStatusMessage.setAttribute("aria-live", "polite"); - statusMessage.textContent = defaultMessage; - srStatusMessage.textContent = defaultMessage; - characterCountEl.append(statusMessage, srStatusMessage); -}; - -/** - * Returns message with how many characters are left - * - * @param {number} currentLength - The number of characters used - * @param {number} maxLength - The total number of characters allowed - * @returns {string} A string description of how many characters are left - */ -const getCountMessage = (currentLength, maxLength) => { - let newMessage = ""; - if (currentLength === 0) { - newMessage = `${maxLength} ${DEFAULT_STATUS_LABEL}`; - } else { - const difference = Math.abs(maxLength - currentLength); - const characters = `character${difference === 1 ? "" : "s"}`; - const guidance = currentLength > maxLength ? "over limit" : "left"; - newMessage = `${difference} ${characters} ${guidance}`; - } - return newMessage; -}; - -/** - * Updates the character count status for screen readers after a 1000ms delay. - * - * @param {HTMLElement} msgEl - The screen reader status message element - * @param {string} statusMessage - A string of the current character status - */ -const srUpdateStatus = debounce((msgEl, statusMessage) => { - const srStatusMessage = msgEl; - srStatusMessage.textContent = statusMessage; -}, 1000); - -/** - * Update the character count component - * - * @description On input, it will update visual status, screenreader - * status and update input validation (if over character length) - * @param {HTMLInputElement|HTMLTextAreaElement} inputEl The character count input element - */ -const updateCountMessage = inputEl => { - const { - characterCountEl - } = getCharacterCountElements(inputEl); - const currentLength = inputEl.value.length; - const maxLength = parseInt(characterCountEl.getAttribute("data-maxlength"), 10); - const statusMessage = characterCountEl.querySelector(STATUS_MESSAGE); - const srStatusMessage = characterCountEl.querySelector(STATUS_MESSAGE_SR_ONLY); - const currentStatusMessage = getCountMessage(currentLength, maxLength); - if (!maxLength) return; - const isOverLimit = currentLength && currentLength > maxLength; - statusMessage.textContent = currentStatusMessage; - srUpdateStatus(srStatusMessage, currentStatusMessage); - if (isOverLimit && !inputEl.validationMessage) { - inputEl.setCustomValidity(VALIDATION_MESSAGE); - } - if (!isOverLimit && inputEl.validationMessage === VALIDATION_MESSAGE) { - inputEl.setCustomValidity(""); - } - statusMessage.classList.toggle(MESSAGE_INVALID_CLASS, isOverLimit); -}; - -/** - * Initialize component - * - * @description On init this function will create elements and update any - * attributes so it can tell the user how many characters are left. - * @param {HTMLInputElement|HTMLTextAreaElement} inputEl the components input - */ -const enhanceCharacterCount = inputEl => { - const { - characterCountEl, - messageEl - } = getCharacterCountElements(inputEl); - - // Hide hint and remove aria-live for backwards compatibility - messageEl.classList.add("usa-sr-only"); - messageEl.removeAttribute("aria-live"); - setDataLength(inputEl); - createStatusMessages(characterCountEl); -}; -const characterCount = behavior({ - input: { - [INPUT]() { - updateCountMessage(this); - } - } -}, { - init(root) { - select(INPUT, root).forEach(input => enhanceCharacterCount(input)); - }, - MESSAGE_INVALID_CLASS, - VALIDATION_MESSAGE, - STATUS_MESSAGE_CLASS, - STATUS_MESSAGE_SR_ONLY_CLASS, - DEFAULT_STATUS_LABEL, - createStatusMessages, - getCountMessage, - updateCountMessage -}); -module.exports = characterCount; - -},{"../../uswds-core/src/js/config":35,"../../uswds-core/src/js/utils/behavior":45,"../../uswds-core/src/js/utils/debounce":46,"../../uswds-core/src/js/utils/select":53}],18:[function(require,module,exports){ -"use strict"; - -const keymap = require("receptor/keymap"); -const selectOrMatches = require("../../uswds-core/src/js/utils/select-or-matches"); -const behavior = require("../../uswds-core/src/js/utils/behavior"); -const Sanitizer = require("../../uswds-core/src/js/utils/sanitizer"); -const { - prefix: PREFIX -} = require("../../uswds-core/src/js/config"); -const { - CLICK -} = require("../../uswds-core/src/js/events"); -const COMBO_BOX_CLASS = `${PREFIX}-combo-box`; -const COMBO_BOX_PRISTINE_CLASS = `${COMBO_BOX_CLASS}--pristine`; -const SELECT_CLASS = `${COMBO_BOX_CLASS}__select`; -const INPUT_CLASS = `${COMBO_BOX_CLASS}__input`; -const CLEAR_INPUT_BUTTON_CLASS = `${COMBO_BOX_CLASS}__clear-input`; -const CLEAR_INPUT_BUTTON_WRAPPER_CLASS = `${CLEAR_INPUT_BUTTON_CLASS}__wrapper`; -const INPUT_BUTTON_SEPARATOR_CLASS = `${COMBO_BOX_CLASS}__input-button-separator`; -const TOGGLE_LIST_BUTTON_CLASS = `${COMBO_BOX_CLASS}__toggle-list`; -const TOGGLE_LIST_BUTTON_WRAPPER_CLASS = `${TOGGLE_LIST_BUTTON_CLASS}__wrapper`; -const LIST_CLASS = `${COMBO_BOX_CLASS}__list`; -const LIST_OPTION_CLASS = `${COMBO_BOX_CLASS}__list-option`; -const LIST_OPTION_FOCUSED_CLASS = `${LIST_OPTION_CLASS}--focused`; -const LIST_OPTION_SELECTED_CLASS = `${LIST_OPTION_CLASS}--selected`; -const STATUS_CLASS = `${COMBO_BOX_CLASS}__status`; -const COMBO_BOX = `.${COMBO_BOX_CLASS}`; -const SELECT = `.${SELECT_CLASS}`; -const INPUT = `.${INPUT_CLASS}`; -const CLEAR_INPUT_BUTTON = `.${CLEAR_INPUT_BUTTON_CLASS}`; -const TOGGLE_LIST_BUTTON = `.${TOGGLE_LIST_BUTTON_CLASS}`; -const LIST = `.${LIST_CLASS}`; -const LIST_OPTION = `.${LIST_OPTION_CLASS}`; -const LIST_OPTION_FOCUSED = `.${LIST_OPTION_FOCUSED_CLASS}`; -const LIST_OPTION_SELECTED = `.${LIST_OPTION_SELECTED_CLASS}`; -const STATUS = `.${STATUS_CLASS}`; -const DEFAULT_FILTER = ".*{{query}}.*"; -const noop = () => {}; - -/** - * set the value of the element and dispatch a change event - * - * @param {HTMLInputElement|HTMLSelectElement} el The element to update - * @param {string} value The new value of the element - */ -const changeElementValue = function (el) { - let value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ""; - const elementToChange = el; - elementToChange.value = value; - const event = new CustomEvent("change", { - bubbles: true, - cancelable: true, - detail: { - value - } - }); - elementToChange.dispatchEvent(event); -}; - -/** - * The elements within the combo box. - * @typedef {Object} ComboBoxContext - * @property {HTMLElement} comboBoxEl - * @property {HTMLSelectElement} selectEl - * @property {HTMLInputElement} inputEl - * @property {HTMLUListElement} listEl - * @property {HTMLDivElement} statusEl - * @property {HTMLLIElement} focusedOptionEl - * @property {HTMLLIElement} selectedOptionEl - * @property {HTMLButtonElement} toggleListBtnEl - * @property {HTMLButtonElement} clearInputBtnEl - * @property {boolean} isPristine - * @property {boolean} disableFiltering - */ - -/** - * Get an object of elements belonging directly to the given - * combo box component. - * - * @param {HTMLElement} el the element within the combo box - * @returns {ComboBoxContext} elements - */ -const getComboBoxContext = el => { - const comboBoxEl = el.closest(COMBO_BOX); - if (!comboBoxEl) { - throw new Error(`Element is missing outer ${COMBO_BOX}`); - } - const selectEl = comboBoxEl.querySelector(SELECT); - const inputEl = comboBoxEl.querySelector(INPUT); - const listEl = comboBoxEl.querySelector(LIST); - const statusEl = comboBoxEl.querySelector(STATUS); - const focusedOptionEl = comboBoxEl.querySelector(LIST_OPTION_FOCUSED); - const selectedOptionEl = comboBoxEl.querySelector(LIST_OPTION_SELECTED); - const toggleListBtnEl = comboBoxEl.querySelector(TOGGLE_LIST_BUTTON); - const clearInputBtnEl = comboBoxEl.querySelector(CLEAR_INPUT_BUTTON); - const isPristine = comboBoxEl.classList.contains(COMBO_BOX_PRISTINE_CLASS); - const disableFiltering = comboBoxEl.dataset.disableFiltering === "true"; - return { - comboBoxEl, - selectEl, - inputEl, - listEl, - statusEl, - focusedOptionEl, - selectedOptionEl, - toggleListBtnEl, - clearInputBtnEl, - isPristine, - disableFiltering - }; -}; - -/** - * Disable the combo-box component - * - * @param {HTMLInputElement} el An element within the combo box component - */ -const disable = el => { - const { - inputEl, - toggleListBtnEl, - clearInputBtnEl - } = getComboBoxContext(el); - clearInputBtnEl.hidden = true; - clearInputBtnEl.disabled = true; - toggleListBtnEl.disabled = true; - inputEl.disabled = true; -}; - -/** - * Enable the combo-box component - * - * @param {HTMLInputElement} el An element within the combo box component - */ -const enable = el => { - const { - inputEl, - toggleListBtnEl, - clearInputBtnEl - } = getComboBoxContext(el); - clearInputBtnEl.hidden = false; - clearInputBtnEl.disabled = false; - toggleListBtnEl.disabled = false; - inputEl.disabled = false; -}; - -/** - * Enhance a select element into a combo box component. - * - * @param {HTMLElement} _comboBoxEl The initial element of the combo box component - */ -const enhanceComboBox = _comboBoxEl => { - const comboBoxEl = _comboBoxEl.closest(COMBO_BOX); - if (comboBoxEl.dataset.enhanced) return; - const selectEl = comboBoxEl.querySelector("select"); - if (!selectEl) { - throw new Error(`${COMBO_BOX} is missing inner select`); - } - const selectId = selectEl.id; - const selectLabel = document.querySelector(`label[for="${selectId}"]`); - const listId = `${selectId}--list`; - const listIdLabel = `${selectId}-label`; - const assistiveHintID = `${selectId}--assistiveHint`; - const additionalAttributes = []; - const { - defaultValue - } = comboBoxEl.dataset; - const { - placeholder - } = comboBoxEl.dataset; - let selectedOption; - if (placeholder) { - additionalAttributes.push({ - placeholder - }); - } - if (defaultValue) { - for (let i = 0, len = selectEl.options.length; i < len; i += 1) { - const optionEl = selectEl.options[i]; - if (optionEl.value === defaultValue) { - selectedOption = optionEl; - break; - } - } - } - - /** - * Throw error if combobox is missing a label or label is missing - * `for` attribute. Otherwise, set the ID to match the