From 7c188967e7a467b19b2757bc3326f9cf3ccae327 Mon Sep 17 00:00:00 2001 From: Mathijs van Veluw Date: Mon, 5 Oct 2026 14:39:21 +0200 Subject: [PATCH] Update crates, Rust and other dependencies (#7814) - Update Rust to v1.99.0 - Updated GitHub Actions - Updated DataTables Signed-off-by: BlackDex --- .github/workflows/trivy.yml | 2 +- .github/workflows/typos.yml | 2 +- .pre-commit-config.yaml | 2 +- Cargo.lock | 360 ++++++++--------- Cargo.toml | 22 +- docker/Dockerfile.alpine | 8 +- docker/Dockerfile.debian | 2 +- rust-toolchain.toml | 2 +- src/static/scripts/datatables.css | 4 +- src/static/scripts/datatables.js | 650 ++++++++++++++++++------------ 10 files changed, 583 insertions(+), 471 deletions(-) diff --git a/.github/workflows/trivy.yml b/.github/workflows/trivy.yml index f0fbf192..81c51847 100644 --- a/.github/workflows/trivy.yml +++ b/.github/workflows/trivy.yml @@ -50,6 +50,6 @@ jobs: severity: CRITICAL,HIGH - name: Upload Trivy scan results to GitHub Security tab - uses: github/codeql-action/upload-sarif@1c5b675653bb5c22dbe9b12b556ec555138e09fd # v4.38.1 + uses: github/codeql-action/upload-sarif@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2 with: sarif_file: 'trivy-results.sarif' diff --git a/.github/workflows/typos.yml b/.github/workflows/typos.yml index 3c880e91..45f90bb9 100644 --- a/.github/workflows/typos.yml +++ b/.github/workflows/typos.yml @@ -23,4 +23,4 @@ jobs: # When this version is updated, do not forget to update this in `.pre-commit-config.yaml` too - name: Spell Check Repo - uses: crate-ci/typos@512fc24f32f44ab01972217aaaf3dc86ec234d53 # v1.50.2 + uses: crate-ci/typos@00f422f3b19c57bc6338715ebfe3316d38768461 # v1.50.3 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d2a509e2..ab96a84f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,7 +18,7 @@ repos: # When this version is updated, do not forget to update this in `.github/workflows/typos.yaml` too - repo: https://github.com/crate-ci/typos - rev: 512fc24f32f44ab01972217aaaf3dc86ec234d53 # v1.50.2 + rev: 00f422f3b19c57bc6338715ebfe3316d38768461 # v1.50.3 hooks: - id: typos always_run: true diff --git a/Cargo.lock b/Cargo.lock index 2ccd4b1a..6c9d9237 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -32,15 +32,15 @@ dependencies = [ [[package]] name = "alloc-no-stdlib" -version = "2.0.4" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" +checksum = "c2fb6cfd47bf496ff64095c20eaba0c201404ee38714d4142fcfa1dc334fcc7a" [[package]] name = "alloc-stdlib" -version = "0.2.4" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e76a019e91224d279006ff972f1e984179a6e9feb050adba6ce8274aef23195" +checksum = "0b5c1865780388bfa186411ab5f247819487fc4864c6e9c3106611fa347586e1" dependencies = [ "alloc-no-stdlib", ] @@ -151,9 +151,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.48" +version = "0.4.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb61aea1a7def73ee7c350a184f0e70b32c182344e2e75bf70c9b621b83417fd" +checksum = "ee19bd99b43e3691acbad4e840420a4881cea6c0b66a208125a824f8fd53f5a1" dependencies = [ "compression-codecs", "compression-core", @@ -323,9 +323,9 @@ dependencies = [ [[package]] name = "asyncband" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2d85fd3d291fabcc40c7232c92c280ec1754fd7b5d7ea769f143222143e179a" +checksum = "5161fb43cb8f231f06983cb2b8f9ee9cee14be0b1356d8383398cc0f312800d1" [[package]] name = "atomic" @@ -399,9 +399,9 @@ dependencies = [ [[package]] name = "aws-runtime" -version = "1.9.4" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25b43ad47adc2517efe3d706559d94b97e50e80e0321b3cadbc9f77cee88adcd" +checksum = "2b8a9911551b4ea6ca13805ef52ed96f7d2bbb43cc3b4a14cb0776a71f33cfaa" dependencies = [ "aws-credential-types", "aws-sigv4", @@ -424,9 +424,9 @@ dependencies = [ [[package]] name = "aws-sdk-sso" -version = "1.111.0" +version = "1.114.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65700d75f6da78c89a61a49f1539979400a4609d3329376b1dc2133d7a1b2b90" +checksum = "12be2f9c8eef7f5fc919c96d538e629698469a02b4cb75408b26b1bd984ebe79" dependencies = [ "arc-swap", "aws-credential-types", @@ -442,7 +442,6 @@ dependencies = [ "aws-types", "bytes", "fastrand", - "http 0.2.12", "http 1.5.0", "regex-lite", "tracing", @@ -450,9 +449,9 @@ dependencies = [ [[package]] name = "aws-sdk-ssooidc" -version = "1.113.0" +version = "1.116.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1147c254af7b6cee3ace90ae7da6f21366ce9a9b899035fa8a0fdf586eb75a" +checksum = "d7645db8724ea3b82fdccfb67e1b0f637c9d8ab0e7ef29d84884d8d8d73f805d" dependencies = [ "arc-swap", "aws-credential-types", @@ -468,7 +467,6 @@ dependencies = [ "aws-types", "bytes", "fastrand", - "http 0.2.12", "http 1.5.0", "regex-lite", "tracing", @@ -476,9 +474,9 @@ dependencies = [ [[package]] name = "aws-sdk-sts" -version = "1.116.0" +version = "1.119.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "035c7392e751d20bf1060d625d023587eb14099646110a9cff7c697bfe4b253a" +checksum = "03e490aa904849b38e770922faac779dd245f5cf8be81f19065acf18d276e4ad" dependencies = [ "arc-swap", "aws-credential-types", @@ -495,7 +493,6 @@ dependencies = [ "aws-smithy-xml", "aws-types", "fastrand", - "http 0.2.12", "http 1.5.0", "regex-lite", "tracing", @@ -503,9 +500,9 @@ dependencies = [ [[package]] name = "aws-sigv4" -version = "1.5.3" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31d955e76ff96acd555bf06fa0fa6d5bf9335fa84ae7c64481b20ae61d231f70" +checksum = "2312577f088c9fbf4206dfdb884cf1de9407b43e1a923cbed5237775116fc24b" dependencies = [ "aws-credential-types", "aws-smithy-http", @@ -515,7 +512,6 @@ dependencies = [ "form_urlencoded", "hex", "hmac 0.13.0", - "http 0.2.12", "http 1.5.0", "percent-encoding", "sha2 0.11.0", @@ -536,9 +532,9 @@ dependencies = [ [[package]] name = "aws-smithy-http" -version = "0.64.0" +version = "0.64.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37843d9add67c3aff5856f409c6dc315d3cdff60f9c0cb5b670dab1e9920306d" +checksum = "639b4d8f8555f24a9be649811c3eb0b4d4616f4d61daf0c32e28873bc1ea9af1" dependencies = [ "aws-smithy-runtime-api", "aws-smithy-types", @@ -590,9 +586,9 @@ dependencies = [ [[package]] name = "aws-smithy-runtime" -version = "1.14.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3296253d3a91b3f938a3f2bcce4daebadcb4aa4228153fcec90f9d23532b4484" +checksum = "d6e302ac1d88b99652489df31abdec6ac42a2ab2ac3982ad0ac49f64dfaf28ba" dependencies = [ "aws-smithy-async", "aws-smithy-http", @@ -602,9 +598,7 @@ dependencies = [ "aws-smithy-types", "bytes", "fastrand", - "http 0.2.12", "http 1.5.0", - "http-body 0.4.6", "http-body 1.1.0", "http-body-util", "pin-project-lite", @@ -615,15 +609,14 @@ dependencies = [ [[package]] name = "aws-smithy-runtime-api" -version = "1.16.2" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d881a7b7ad179fd6611680c9de89f716fb00ab40299a9a7b8c6913e8f7511a8" +checksum = "c0730c16f91124c6a2abb4932c77e299288b3dd9f967ea2e9ec48cc6731e87a4" dependencies = [ "aws-smithy-async", "aws-smithy-runtime-api-macros", "aws-smithy-types", "bytes", - "http 0.2.12", "http 1.5.0", "pin-project-lite", "tokio", @@ -655,16 +648,14 @@ dependencies = [ [[package]] name = "aws-smithy-types" -version = "1.6.4" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b791f3ac597193fe1d08b82366986eb1f5bc31f2ac6c194c0855276116c76cd" +checksum = "69bb407740a197147da48238ecc94498493c9e85445732360cec180296ca45f1" dependencies = [ "base64-simd", "bytes", "bytes-utils", - "http 0.2.12", "http 1.5.0", - "http-body 0.4.6", "http-body 1.1.0", "http-body-util", "itoa", @@ -756,9 +747,9 @@ dependencies = [ [[package]] name = "bigdecimal" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d6867f1565b3aad85681f1015055b087fcfd840d6aeee6eee7f2da317603695" +checksum = "8fa3f3d8cbf4dffcfe4991de61d012bef509a409ecbe9dd41049bfe32b4d4653" dependencies = [ "autocfg", "libm", @@ -827,9 +818,9 @@ dependencies = [ [[package]] name = "brotli" -version = "8.0.4" +version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc91aac060a7a1e25823bdccbfb6af1875b88f17c6daac97894eed8207166b3" +checksum = "f8b851b75c23ca7873623d612fe49bd1989aeb03d08fb9432187eb253d3d4c6b" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -838,9 +829,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "5.0.3" +version = "6.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a32acac15fe1967bc3986b2a6347dffc965602354ea6f450ad07e8bfd253583" +checksum = "941cd9bd4ddab83cb46fa5a2d428f1c857b24ac78cb876cf7beb710840934bd7" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -891,9 +882,9 @@ dependencies = [ [[package]] name = "cached" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5a6cf8262820194a1488ece477f5fb5ba9256ef25229d525470e71d6e9a5835" +checksum = "292f39b5c459538e148825347c400cb2005a618b897d0e6be183bad677d460b7" dependencies = [ "ahash", "async-lock", @@ -901,7 +892,7 @@ dependencies = [ "cached_proc_macro_types", "hashbrown 0.17.1", "parking_lot", - "thiserror 2.0.20", + "thiserror 2.0.21", "web-time", ] @@ -926,9 +917,9 @@ checksum = "f5813789573ae815c8b4be58c4428e0e7ae05f0227678ba9de332ded585b9159" [[package]] name = "cc" -version = "1.4.7" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54413ede23c2daf518f35156dfde027feb2374004d63bd497f983c8db9c0e313" +checksum = "f74872d07caf508b30a21f6836e7d7016a2eaf7d9ff4f48deaa58cd8a0407630" dependencies = [ "find-msvc-tools", "jobserver", @@ -1007,9 +998,9 @@ dependencies = [ [[package]] name = "compression-codecs" -version = "0.4.43" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef16c47ba2797aa6a909cc37d39911f3a6743811fe7408ac0b0cc0276b656e9" +checksum = "98fc98460ba0ad5317075d3632b8dfc45d0be8c4a49347c2a38272019717614a" dependencies = [ "brotli", "compression-core", @@ -1446,7 +1437,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" dependencies = [ - "thiserror 2.0.20", + "thiserror 2.0.21", ] [[package]] @@ -1811,13 +1802,12 @@ dependencies = [ [[package]] name = "encoding_rs" -version = "0.8.41" +version = "0.8.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5ef0006ac9ab233c38522f5ae99cae3625151de8f706cacee1cba4b8e2832a" +checksum = "8e985e0451871ad22fb8d2b6b076e2028a502a0d3950998c2c5c0a4f9b5d9679" dependencies = [ "cfg-if", "core_detect", - "multiversion", "multiversion_no_op", "rustversion", "scopeguard", @@ -1916,9 +1906,9 @@ dependencies = [ [[package]] name = "find-msvc-tools" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef25905e51abafe4dcea6c15fec58c57b601cdbd0ee53d22ea1d3016c587d39b" +checksum = "aedcfb3409746eddb02b9e19ebda1c3394f759a152e48ee875a0844d1b955484" [[package]] name = "flate2" @@ -2245,7 +2235,7 @@ dependencies = [ "pest_derive", "serde", "serde_json", - "thiserror 2.0.20", + "thiserror 2.0.21", "walkdir", ] @@ -2321,8 +2311,8 @@ dependencies = [ "idna", "ipnet", "jni", - "rand 0.10.2", - "thiserror 2.0.20", + "rand 0.10.3", + "thiserror 2.0.21", "tinyvec", "tokio", "tracing", @@ -2341,9 +2331,9 @@ dependencies = [ "jni", "once_cell", "prefix-trie", - "rand 0.10.2", + "rand 0.10.3", "ring", - "thiserror 2.0.20", + "thiserror 2.0.21", "tinyvec", "tracing", "url", @@ -2366,11 +2356,11 @@ dependencies = [ "ndk-context", "once_cell", "parking_lot", - "rand 0.10.2", + "rand 0.10.3", "resolv-conf", "smallvec", "system-configuration", - "thiserror 2.0.20", + "thiserror 2.0.21", "tokio", "tracing", ] @@ -2544,31 +2534,32 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.9" +version = "0.27.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ca68d021ef39cf6463ab54c1d0f5daf03377b70561305bb89a8f83aab66e0f" +checksum = "dfa8e654703247911e29c23fbeaa261834bd9bb74efba2f9acddc37bfb127f53" dependencies = [ "http 1.5.0", "hyper 1.11.1", "hyper-util", "rustls 0.23.45", "tokio", - "tokio-rustls 0.26.5", + "tokio-rustls 0.26.6", "tower-service", ] [[package]] name = "hyper-util" -version = "0.1.20" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" +checksum = "ddc03d96684f9226b8a787cdb71488417b53ab5ea8fdb1dac946cb9431cc8bff" dependencies = [ - "base64 0.22.1", + "base64 0.23.1", "bytes", "futures-channel", "futures-util", "http 1.5.0", "http-body 1.1.0", + "httparse", "hyper 1.11.1", "ipnet", "libc", @@ -2867,7 +2858,7 @@ dependencies = [ "jni-sys", "log", "simd_cesu8", - "thiserror 2.0.20", + "thiserror 2.0.21", "walkdir", "windows-link", ] @@ -2927,9 +2918,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.105" +version = "0.3.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce57d20d1ea864ce2ac172ab472d409214f4fd359f0b2a2775abdf522e2af99e" +checksum = "7883d941dae510fb2d978fc3fe018c71c9e2892fd38854de3e8b92c2e5ad9cc5" dependencies = [ "cfg-if", "futures-util", @@ -2980,9 +2971,9 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +checksum = "20870f649af7073d53e38067b2a84312175d56ea15217e1b15bc83506ec50afb" dependencies = [ "spin 0.9.9", ] @@ -3013,16 +3004,16 @@ dependencies = [ "serde", "socket2 0.6.5", "tokio", - "tokio-rustls 0.26.5", + "tokio-rustls 0.26.6", "tracing", "url", ] [[package]] name = "libc" -version = "0.2.189" +version = "0.2.190" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" +checksum = "ce5d3ddc6d3fa000eb1536d85e147bfe31aacaba692ed6a876f95cb7c855be78" [[package]] name = "libm" @@ -3128,16 +3119,6 @@ dependencies = [ "digest 0.11.3", ] -[[package]] -name = "mea" -version = "0.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c709842c4ce65cb91e2666ad5319dfc1efc3af0d34f02075eddca9000d9f8afb" -dependencies = [ - "hashbrown 0.17.1", - "slab", -] - [[package]] name = "memchr" version = "2.8.3" @@ -3198,9 +3179,9 @@ dependencies = [ [[package]] name = "mio" -version = "1.2.3" +version = "1.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b18443e9c262bfe8fa82f51666e2642c53393f7e5c27b3e1aeab922cff5b9d8" +checksum = "1788edb87fdc09c7e26304471e2f5be8cdefb1b6930d6e3985fc02ff53bf86ee" dependencies = [ "libc", "wasi", @@ -3246,27 +3227,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "multiversion" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ca4bea16ffc3f443cf7d866912118196bfef4c6a1556ca00f9f9b00bb43f7c" -dependencies = [ - "multiversion-macros", -] - -[[package]] -name = "multiversion-macros" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d416831a7317ef4b08bee00b69cbbb9c8763da7959a7026244d6266869f9c83" -dependencies = [ - "proc-macro2", - "quote", - "rustversion", - "syn 3.0.6", -] - [[package]] name = "multiversion_no_op" version = "1.0.0" @@ -3400,9 +3360,9 @@ dependencies = [ [[package]] name = "num-modular" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd8e500409e6cd603b03e477c26a6caecdc27ac58979a53e881c75eafc079f44" +checksum = "26ac76200f74e658124f95fa63e1a82b2fd2181c5b2fdde80b3d89d2d3f905e7" [[package]] name = "num-order" @@ -3482,9 +3442,9 @@ dependencies = [ [[package]] name = "opendal" -version = "0.59.2" +version = "0.59.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fe43e16d96bed57937eb7c4a28559bf4c5fc4a3951656505d1fdd4f856349b4" +checksum = "3cbd193aec6d62efaff87611dfae52c132aed650bb3cb0c684c0a9394f09a42a" dependencies = [ "opendal-core", "opendal-service-fs", @@ -3493,9 +3453,9 @@ dependencies = [ [[package]] name = "opendal-core" -version = "0.59.2" +version = "0.59.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de4566a412776e3f65d53dd9fceced5b432a0a9c9a1e8d50ccf58823795e5c5b" +checksum = "54b5555d753dd6a6383dc0891254b72f3cdc40c011ba0372b560e0ae5aa29f5c" dependencies = [ "anyhow", "asyncband", @@ -3507,7 +3467,7 @@ dependencies = [ "log", "md-5", "percent-encoding", - "quick-xml", + "quick-xml 0.41.0", "reqsign-core", "serde", "serde_json", @@ -3519,9 +3479,9 @@ dependencies = [ [[package]] name = "opendal-http-transport-reqwest" -version = "0.59.2" +version = "0.59.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f772ce6c137ab43647726116d505a649a88d41928fcd813438eb30b02312bcbb" +checksum = "4d6588678f3040a3eab1819364dcbc6a746a8286d1ceb23a70a6614faa01dc6c" dependencies = [ "bytes", "futures", @@ -3533,9 +3493,9 @@ dependencies = [ [[package]] name = "opendal-service-fs" -version = "0.59.2" +version = "0.59.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0e7d8974aebd33be899200c9d0d50b2141fd5fa5c462b29e20653e3ddbfe339" +checksum = "ec5c16fe91b77c0364f66546a1c32b2999e9c3c3c75c2e908a282268e0890bac" dependencies = [ "bytes", "log", @@ -3547,9 +3507,9 @@ dependencies = [ [[package]] name = "opendal-service-s3" -version = "0.59.2" +version = "0.59.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2942f2d8d3d4953c0e8d07cd1244879628d084948e48ce6b6d808c5938f7858d" +checksum = "1d83e716c25a81fe2ca701894b8e14b9966acca3812af250e50132accb19da02" dependencies = [ "base64 0.23.1", "bytes", @@ -3558,7 +3518,7 @@ dependencies = [ "log", "md-5", "opendal-core", - "quick-xml", + "quick-xml 0.41.0", "reqsign-aws-v4", "reqsign-core", "reqsign-file-read-tokio", @@ -3800,9 +3760,9 @@ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "pest" -version = "2.9.1" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d45aeb61b4bf818e12d4205f2466f8c4748f85f4fce0146d1c03d69d753f0ad" +checksum = "45d3aca230fad2e6f6317ca0a72724338c4960cb97168a85cdee66df4a9a21a8" dependencies = [ "memchr", "ucd-trie", @@ -3810,9 +3770,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.9.1" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89cc5a242e25ed4e7704d0be240f2cfbe20a8c27e7e252d94835be93d92dc39f" +checksum = "284b60557f2c4a2e72ad3f2d34d42685a2fa4a6a61d0d2a10c0ae2a5e916c2cf" dependencies = [ "pest", "pest_generator", @@ -3820,9 +3780,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.9.1" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abf21475cc3820fe4b2ca2dc2142902f67a02189f3b5b3a229f4febc01a43e5" +checksum = "1d9d1f08a115309ee99268cf85e5228e0e56aa9caf8841ec12866b6be07c3109" dependencies = [ "pest", "pest_meta", @@ -3833,9 +3793,9 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.9.1" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adba4db388f687393c18c51348d44a41d870ca9df71a2c98172ea3035dc6936e" +checksum = "ed93ba1a9ffcca32130a5188701c81c0c49cf00d4b7c5007d5148951d743adcb" dependencies = [ "pest", ] @@ -3925,9 +3885,9 @@ checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" [[package]] name = "pin-utils" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +checksum = "13bee6c73da26345c729282832b60b0363cf3dd9f4bfd81d8551b7a1c889a113" [[package]] name = "piper" @@ -4007,9 +3967,9 @@ dependencies = [ [[package]] name = "powerfmt" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" +checksum = "4a6394b9e965e73d0a289ee54f589087e2c676aedf60885baf52c76b771e4958" [[package]] name = "ppv-lite86" @@ -4022,9 +3982,9 @@ dependencies = [ [[package]] name = "pq-sys" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "574ddd6a267294433f140b02a726b0640c43cf7c6f717084684aaa3b285aba61" +checksum = "9152654059e4fb5b66a4052acf3ee43a7a7132332e44cdb72a81ee93bd038950" dependencies = [ "libc", "pkg-config", @@ -4129,6 +4089,16 @@ dependencies = [ "serde", ] +[[package]] +name = "quick-xml" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41b1177fdf999d2321d3fb46ff47159d9c1fb9ad66a4879f8c50a0b504615e9b" +dependencies = [ + "memchr", + "serde", +] + [[package]] name = "quote" version = "1.0.47" @@ -4190,9 +4160,9 @@ dependencies = [ [[package]] name = "rand" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f5fa3a058cd35567ef9bfa5e75732bee0f9e4c55fa90477bef2dfcdbc4be80" +checksum = "65c9fb96cbc91e3478eaae79a69fcd3f1ae4ad052e471fe6732fff548984b4af" dependencies = [ "chacha20", "getrandom 0.4.3", @@ -4329,9 +4299,9 @@ dependencies = [ [[package]] name = "reqsign-aws-core" -version = "3.1.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bac4749b7dfa7bfaccd01eb03e9dc795ed37e3f20d6f0f38e2c67ee85ad6bc86" +checksum = "d38c902d8ec745bd9eadd1abbcbe227f4c1fc2926b2ec8929f89234af3114500" dependencies = [ "bytes", "form_urlencoded", @@ -4339,7 +4309,7 @@ dependencies = [ "http 1.5.0", "log", "percent-encoding", - "quick-xml", + "quick-xml 0.42.0", "reqsign-core", "rust-ini", "serde", @@ -4350,14 +4320,14 @@ dependencies = [ [[package]] name = "reqsign-aws-v4" -version = "3.3.0" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff250f0fd0b913fbd565e405acc553da0f13bde30bfb5403178c9d0313cdc15f" +checksum = "906bfd028f96bfe73fdb892ce26f3b3f99b4f30feb9bd024be58bd6657f68b2b" dependencies = [ "bytes", "http 1.5.0", "log", - "quick-xml", + "quick-xml 0.42.0", "reqsign-aws-core", "reqsign-core", "serde", @@ -4365,20 +4335,19 @@ dependencies = [ [[package]] name = "reqsign-core" -version = "3.3.1" +version = "3.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff052daffb0599681c50f85c59e7236438976efe991ab864edd9f3b235501a0f" +checksum = "85fed85c436b6b920e4b36310f699a77771a91e38ae483df48447bd7d162671c" dependencies = [ "anyhow", + "asyncband", "base64 0.23.1", "bytes", - "futures", "hex", "hmac 0.13.0", "http 1.5.0", "jiff", "log", - "mea", "percent-encoding", "sha1 0.11.0", "sha2 0.11.0", @@ -4387,9 +4356,9 @@ dependencies = [ [[package]] name = "reqsign-file-read-tokio" -version = "3.0.6" +version = "3.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3235df90a6bca681aa47dd86f2393d122a6d77042aa8a7c81e218cd45c5bfc0" +checksum = "586a8e198057773f9616901fd723a4bc186812b9765bc0f20368661d6169d906" dependencies = [ "anyhow", "reqsign-core", @@ -4429,7 +4398,7 @@ dependencies = [ "serde_urlencoded", "sync_wrapper", "tokio", - "tokio-rustls 0.26.5", + "tokio-rustls 0.26.6", "tokio-util", "tower", "tower-http", @@ -4622,7 +4591,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c51c9ae4df8a7fba42103df5c621fa3c37eccf3a3c650879e90fc48b11cc192c" dependencies = [ "hashbrown 0.16.1", - "thiserror 2.0.20", + "thiserror 2.0.21", ] [[package]] @@ -4735,9 +4704,9 @@ dependencies = [ [[package]] name = "rustls-platform-verifier" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d1e2536ce4f35f4846aa13bff16bd0ff40157cdb14cc056c7b14ba41233ba0" +checksum = "1167586491e2b18b8bfbb293e8180ec17c201c4f076d7cb3070ca964e7598f98" dependencies = [ "core-foundation 0.10.1", "core-foundation-sys", @@ -4756,9 +4725,9 @@ dependencies = [ [[package]] name = "rustls-platform-verifier-android" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" +checksum = "eec689c0bc40ff2458a5977b6619cb718087084a18e02a131c599b62d05e1a5f" [[package]] name = "rustls-webpki" @@ -5024,9 +4993,9 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.23.0" +version = "3.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "935177bb8c0cd8ca1a4e6d1a2ac8988bea69cab4f9d3a31311e012ad27868ea4" +checksum = "df9adc193c780ef8f159aee8b61e2d5801aaa555e6eb0947fe45530ec506296f" dependencies = [ "base64 0.23.1", "bs58", @@ -5045,9 +5014,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.23.0" +version = "3.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d607aa01a3cb0ad757d6fd216136910db3c97b102fe686585689615a02dbcdc" +checksum = "3e17bbc68e28663bbbb90df47e058aa7eda4fb445b89fe70457bb94fbccf6e49" dependencies = [ "darling 0.24.1", "proc-macro2", @@ -5174,15 +5143,15 @@ checksum = "0d585997b0ac10be3c5ee635f1bab02d512760d14b7c468801ac8a01d9ae5f1d" dependencies = [ "num-bigint", "num-traits", - "thiserror 2.0.20", + "thiserror 2.0.21", "time", ] [[package]] name = "siphasher" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ee5873ec9cce0195efcb7a4e9507a04cd49aec9c83d0389df45b1ef7ba2e649" +checksum = "33f4fe9184a62d842c9ef383018f3306d8ba224fd9d836f56d7288308847c256" [[package]] name = "slab" @@ -5192,9 +5161,9 @@ checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" [[package]] name = "smallvec" -version = "1.16.1" +version = "1.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba467056f1b547ed52077911161fc86985becbc60e8e1857c8a144dab0def891" +checksum = "f9395f0f0eee849a9b707b2f06bb92a6a422090e2123bb2ef8e87a0e61892a8e" [[package]] name = "socket2" @@ -5424,11 +5393,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.20" +version = "2.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec86235f5fcc2a73650310756d2ac5b138a5780bbbdfae3eeccec992c435ba4f" +checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e" dependencies = [ - "thiserror-impl 2.0.20", + "thiserror-impl 2.0.21", ] [[package]] @@ -5444,9 +5413,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.20" +version = "2.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc04cd3e1236dd4a98afca4569f2deb3f120e5422a4023be2cb683f8486292af" +checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524" dependencies = [ "proc-macro2", "quote", @@ -5521,9 +5490,9 @@ checksum = "fd3ca314f692efd6c868f8408f53fe444634a845f96c028b97d35f6a1f79f0ee" [[package]] name = "tokio" -version = "1.53.1" +version = "1.53.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed" +checksum = "e95f91fcc7a621e8b030f6aa23c71fe9838ae2fb4d8118b75602a328f5144044" dependencies = [ "bytes", "libc", @@ -5559,9 +5528,9 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.26.5" +version = "0.26.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c85f2c3ef0b1cd58b36682f4b17aaa995f0e5db534d85692b4903abce21f67" +checksum = "c9cc2678c2cdd569ef8215e2afd7954ada2ae20b4fdd2c5fe6139a3b02d105db" dependencies = [ "rustls 0.23.45", "tokio", @@ -5935,9 +5904,9 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "uuid" -version = "1.26.1" +version = "1.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ef6dac1e96601b4fb3acccccff2139741fcb757cb9a36089bf5be91cfb285ce" +checksum = "97277d36b9c3ace13e58fa6e753f8b0bbbf302a18dd193240d70f9e29681059a" dependencies = [ "getrandom 0.4.3", "js-sys", @@ -6008,7 +5977,7 @@ dependencies = [ "pastey 0.2.3", "percent-encoding", "pico-args", - "rand 0.10.2", + "rand 0.10.3", "regex", "reqsign-aws-v4", "reqsign-core", @@ -6093,9 +6062,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.128" +version = "0.2.129" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aecb87a33d3b0c5e3b7aa46336eaf486cffafbd281b195e4c8b80d50df2351bf" +checksum = "9bb54f33acc68fd454578d9820b0bde1a1a3d17aa17bb7b6595806d02886d409" dependencies = [ "cfg-if", "once_cell", @@ -6106,19 +6075,20 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.78" +version = "0.4.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef4c5d3d2cdf5c54f4231181768f5510842e350db025faf1f7163b1030ed928" +checksum = "3cbab34de2d982e9b48e18d216d04c4a6f641066ff19ffb699980f591ee3610e" dependencies = [ "js-sys", + "tokio", "wasm-bindgen", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.128" +version = "0.2.129" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a690d511e3c1a8b3a55e33511e3c2c00c78415cd23650f32b808627f5696b9ed" +checksum = "2e29d0c35b16e224a7eeb5cd2d25e3e1968fbd65604117b44d3b789d00ee8535" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -6126,9 +6096,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.128" +version = "0.2.129" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "411e4887f0071ef2d2164a9d5fdf2d20efbef78fccd3a78b0c10a1dc5295e48a" +checksum = "6f501a8bc3719dba86ef8ae4728879c08001bea749eb1333ac5b91e040e2a6b7" dependencies = [ "bumpalo", "proc-macro2", @@ -6139,9 +6109,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.128" +version = "0.2.129" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81941cd78d0c92026c33e5e01312845a4cb1e9af3407f9134b100dd03144103e" +checksum = "23f0c9c52aa7cd7d77769a4cfe2a9adb1b331f489a41d912ce14513d5ab995c6" dependencies = [ "unicode-ident", ] @@ -6161,9 +6131,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.105" +version = "0.3.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fbddc4a036f00ec4f18c83445bd3115cb306a91da554919a099d9222fe4a7f8" +checksum = "88261b9deccee56594c11a3460c462c41f58d148598fe70ad77070126a68aba4" dependencies = [ "js-sys", "wasm-bindgen", @@ -6611,9 +6581,9 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33811428bee40dbceb6d545e95754741d17a6aef9a4849f0fd62e2ba4f412a78" +checksum = "ec8ebde2db3681e8c9980cc27822030e68752690ddfa9473e739aeb4dbde6d71" dependencies = [ "proc-macro2", "quote", @@ -6636,18 +6606,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.57" +version = "0.8.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d35102a9f36d089ccae9e4c6802bc118be4487b80aaffc0ab4e0cf5ce92d2873" +checksum = "6df92bf3d9227be3d53173901ddbffac2babc27ae50f397776ffd6dc33f800cb" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.57" +version = "0.8.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146c01f5ab44258da43cf276c74a2763db2ff3969c9c652c3f2de07041d0b2bc" +checksum = "ac4f328cf2f05d084e496c3e9c3f33ed0a183656a16e1fcec4d464d8373aec82" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 7dcae503..764fbd53 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [workspace.package] edition = "2024" -rust-version = "1.96.1" +rust-version = "1.97.1" license = "AGPL-3.0-only" repository = "https://github.com/dani-garcia/vaultwarden" publish = false @@ -77,7 +77,7 @@ dotenvy = { version = "0.15.7", default-features = false } # Numerical libraries num-traits = "0.2.19" num-derive = "0.5.1" -bigdecimal = "0.4.10" +bigdecimal = "0.4.11" # Web framework rocket = { version = "0.5.1", default-features = false, features = ["json", "tls"] } @@ -91,7 +91,7 @@ dashmap = "6.2.1" # Async futures futures = "0.3.34" -tokio = { version = "1.53.1", features = [ +tokio = { version = "1.53.2", features = [ "fs", "io-util", "net", @@ -123,13 +123,13 @@ diesel-derive-newtype = "2.1.3" libsqlite3-sys = { version = "0.38.2", optional = true } # Crypto-related libraries -rand = "0.10.2" +rand = "0.10.3" ring = "0.17.14" rustls = { version = "0.23.45", features = ["ring", "std"], default-features = false } subtle = "2.6.1" # UUID generation -uuid = { version = "1.26.1", features = ["v4"] } +uuid = { version = "1.27.0", features = ["v4"] } # Date and time libraries chrono = { version = "0.4.45", default-features = false, features = ["clock", "serde"] } @@ -215,7 +215,7 @@ bytes = "1.12.1" svg-hush = "0.9.7" # Cache function results (Used for version check and favicon fetching) -cached = { version = "4.0.0", features = ["async"] } +cached = { version = "4.0.1", features = ["async"] } # Used for custom short lived cookie jar during favicon extraction cookie = "0.18.2" @@ -257,8 +257,8 @@ rpassword = "7.5.4" grass_compiler = { version = "0.13.4", default-features = false } # File are accessed through Apache OpenDAL -opendal = { version = "0.59.2", default-features = false, features = ["services-fs"] } -opendal-http-transport-reqwest = { version = "0.59.2", default-features = false, features = ["rustls-no-provider"], optional = true } +opendal = { version = "0.59.4", default-features = false, features = ["services-fs"] } +opendal-http-transport-reqwest = { version = "0.59.4", default-features = false, features = ["rustls-no-provider"], optional = true } # For retrieving AWS credentials, including temporary SSO credentials aws-config = { version = "1.12.0", optional = true, default-features = false, features = [ @@ -268,10 +268,10 @@ aws-config = { version = "1.12.0", optional = true, default-features = false, fe "sso", ] } aws-credential-types = { version = "1.3.0", optional = true } -aws-smithy-runtime-api = { version = "1.16.2", optional = true } +aws-smithy-runtime-api = { version = "1.19.0", optional = true } http = { version = "1.5.0", optional = true } -reqsign-aws-v4 = { version = "3.3.0", optional = true } -reqsign-core = { version = "3.3.1", optional = true } +reqsign-aws-v4 = { version = "3.3.1", optional = true } +reqsign-core = { version = "3.3.2", optional = true } # Strip debuginfo from the release builds # The debug symbols are to provide better panic traces diff --git a/docker/Dockerfile.alpine b/docker/Dockerfile.alpine index a91deb07..6e6a79a3 100644 --- a/docker/Dockerfile.alpine +++ b/docker/Dockerfile.alpine @@ -32,10 +32,10 @@ FROM --platform=linux/amd64 docker.io/vaultwarden/web-vault@sha256:ba8bab66d4330 ########################## ALPINE BUILD IMAGES ########################## ## NOTE: The Alpine Base Images do not support other platforms then linux/amd64 and linux/arm64 ## And for Alpine we define all build images here, they will only be loaded when actually used -FROM --platform=$BUILDPLATFORM ghcr.io/blackdex/rust-musl:x86_64-musl-stable-1.98.1 AS build_amd64 -FROM --platform=$BUILDPLATFORM ghcr.io/blackdex/rust-musl:aarch64-musl-stable-1.98.1 AS build_arm64 -FROM --platform=$BUILDPLATFORM ghcr.io/blackdex/rust-musl:armv7-musleabihf-stable-1.98.1 AS build_armv7 -FROM --platform=$BUILDPLATFORM ghcr.io/blackdex/rust-musl:arm-musleabi-stable-1.98.1 AS build_armv6 +FROM --platform=$BUILDPLATFORM ghcr.io/blackdex/rust-musl:x86_64-musl-stable-1.99.0 AS build_amd64 +FROM --platform=$BUILDPLATFORM ghcr.io/blackdex/rust-musl:aarch64-musl-stable-1.99.0 AS build_arm64 +FROM --platform=$BUILDPLATFORM ghcr.io/blackdex/rust-musl:armv7-musleabihf-stable-1.99.0 AS build_armv7 +FROM --platform=$BUILDPLATFORM ghcr.io/blackdex/rust-musl:arm-musleabi-stable-1.99.0 AS build_armv6 ########################## BUILD IMAGE ########################## # hadolint ignore=DL3006 diff --git a/docker/Dockerfile.debian b/docker/Dockerfile.debian index 62dff072..44d068ef 100644 --- a/docker/Dockerfile.debian +++ b/docker/Dockerfile.debian @@ -36,7 +36,7 @@ FROM --platform=linux/amd64 docker.io/tonistiigi/xx@sha256:c64defb9ed5a91eacb37f ########################## BUILD IMAGE ########################## # hadolint ignore=DL3006 -FROM --platform=$BUILDPLATFORM docker.io/library/rust:1.98.1-slim-trixie AS build +FROM --platform=$BUILDPLATFORM docker.io/library/rust:1.99.0-slim-trixie AS build # hadolint ignore=DL3067 COPY --from=xx / / ARG TARGETARCH diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 2be20926..a66db95c 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.98.1" +channel = "1.99.0" components = [ "rustfmt", "clippy" ] profile = "minimal" diff --git a/src/static/scripts/datatables.css b/src/static/scripts/datatables.css index 3a32d7ed..20f6d63f 100644 --- a/src/static/scripts/datatables.css +++ b/src/static/scripts/datatables.css @@ -4,10 +4,10 @@ * * To rebuild or modify this file with the latest versions of the included * software please visit: - * https://datatables.net/download/#bs5/dt-3.0.4 + * https://datatables.net/download/#bs5/dt-3.1.3 * * Included libraries: - * DataTables 3.0.4 + * DataTables 3.1.3 */ /*! DataTables Bootstrap 5 integration diff --git a/src/static/scripts/datatables.js b/src/static/scripts/datatables.js index 3d4c727d..b0502a69 100644 --- a/src/static/scripts/datatables.js +++ b/src/static/scripts/datatables.js @@ -4,13 +4,13 @@ * * To rebuild or modify this file with the latest versions of the included * software please visit: - * https://datatables.net/download/#bs5/dt-3.0.4 + * https://datatables.net/download/#bs5/dt-3.1.3 * * Included libraries: - * DataTables 3.0.4 + * DataTables 3.1.3 */ -/*! DataTables 3.0.4 +/*! DataTables 3.1.3 * Copyright (c) SpryMedia Ltd - datatables.net/license */ @@ -318,7 +318,7 @@ function htmlNum(d, decimalPoint, formatted, allowEmpty) { } return !html(d) ? null - : num$1(stripHtml(d), decimalPoint, formatted, allowEmpty) + : num(stripHtml(d), decimalPoint, formatted, allowEmpty) ? true : null; } @@ -341,7 +341,7 @@ function jquery(input) { * @param allowEmpty Allow an empty value to be considered a number * @returns `true` if numeric */ -function num$1(d, decimalPoint, formatted, allowEmpty) { +function num(d, decimalPoint, formatted, allowEmpty) { let type = typeof d; if (type === 'number' || type === 'bigint') { return true; @@ -383,7 +383,7 @@ var is = /*#__PURE__*/Object.freeze({ html: html, htmlNum: htmlNum, jquery: jquery, - num: num$1, + num: num, plainObject: plainObject }); @@ -534,12 +534,134 @@ var object = /*#__PURE__*/Object.freeze({ map: map$1 }); +// Can be assigned in DateTable.use() +var __win; +var __bootstrap; +var __foundation; +var __luxon$1; +var __moment$1; +var __dateTime; +var __dataTable; +var __jquery; +function getWin() { + if (__win) { + return __win; + } + if (typeof globalThis !== 'undefined' && globalThis.window) { + return globalThis.window; + } + if (typeof window !== 'undefined') { + return window; + } + return {}; +} +/** + * Set the libraries that DataTables uses, or the global objects. + * Note that the arguments can be either way around (legacy support) + * and the second is optional. See docs. + */ +function external (arg1, arg2) { + // Reverse arguments for legacy support + var module = typeof arg1 === 'string' ? arg2 : arg1; + var type = typeof arg2 === 'string' ? arg2 : arg1; + // Getter + if (module === undefined && typeof type === 'string') { + switch (type) { + case 'lib': + case 'jq': + if (__jquery) { + return __jquery; + } + let local = getWin().jQuery; + if (local && local.fn) { + return local; + } + return null; + case 'win': + return getWin(); + case 'doc': + return getWin().document; + case 'datatable': + return __dataTable; + case 'datetime': + return __dateTime; + case 'luxon': + return __luxon$1 || getWin().luxon || null; + case 'moment': + return __moment$1 || getWin().moment || null; + case 'bootstrap': + // Use local if set, otherwise try window, which could be undefined + return __bootstrap || getWin().bootstrap || null; + case 'foundation': + // Ditto + return __foundation || getWin().Foundation || null; + default: + return null; + } + } + // Setter + if (type === 'lib' || + type === 'jq' || + (module && module.fn && module.fn.jquery)) { + __jquery = module; + jQuerySetup(); + } + else if (type === 'datatable' || (module && module.isDataTable)) { + __dataTable = module; + } + else if (type === 'win' || (module && module.document)) { + __win = module; + } + else if (type === 'datetime' || (module && module.type === 'DateTime')) { + __dateTime = module; + } + else if (type === 'luxon' || (module && module.FixedOffsetZone)) { + __luxon$1 = module; + } + else if (type === 'moment' || (module && module.isMoment)) { + __moment$1 = module; + } + else if (type === 'bootstrap' || + (module && module.Modal && module.Modal.NAME === 'modal')) { + // This is currently for BS5 only. BS3/4 attach to jQuery, so no need to use `.use()` + __bootstrap = module; + } + else if (type === 'foundation' || (module && module.Reveal)) { + __foundation = module; + } +} +/** + * Attach jQuery to DataTables + */ +function jQuerySetup() { + if (!__dataTable || !__jquery) { + return; + } + // Provide access to the host jQuery object (circular reference) + __dataTable.$ = __jquery; + // jQuery integration - expose the core function. + __jquery.fn.dataTable = __dataTable; + // jQuery wrapper - returning a DataTable instance + __jquery.fn.DataTable = function (options) { + let table = new __dataTable(this.toArray(), options); + return table; + }; + // Legacy aliases + __jquery.fn.dataTableSettings = __dataTable.ext.settings; + __jquery.fn.dataTableExt = __dataTable.ext; + // All properties that are available to $.fn.dataTable should also be available + // on $.fn.DataTable + each(__dataTable, function (prop, val) { + __jquery.fn.DataTable[prop] = val; + }); +} + const defaults$5 = { cache: true, contentType: 'application/x-www-form-urlencoded; charset=UTF-8', headers: {}, traditional: false, - url: location.href + url: '' }; /** * Trigger an Ajax call to the server based on the configuration parameters @@ -698,8 +820,9 @@ function convertSpaces(sendData, options) { */ function isCrossDomain(url) { // Use the current page as the base to handle relative URLs correctly - const target = new URL(url, window.location.origin); - return target.origin !== window.location.origin; + const win = external('win'); + const target = new URL(url, win.location.origin); + return target.origin !== win.location.origin; } /** * Get the HTTP method from the Ajax request options @@ -1238,107 +1361,6 @@ var data = /*#__PURE__*/Object.freeze({ set: set$1 }); -// Can be assigned in DateTable.use() -var __bootstrap; -var __foundation; -var __luxon$1; -var __moment$1; -var __dateTime; -var __dataTable; -var __jquery; -/** - * Set the libraries that DataTables uses, or the global objects. - * Note that the arguments can be either way around (legacy support) - * and the second is optional. See docs. - */ -function external (arg1, arg2) { - // Reverse arguments for legacy support - var module = typeof arg1 === 'string' ? arg2 : arg1; - var type = typeof arg2 === 'string' ? arg2 : arg1; - // Getter - if (module === undefined && typeof type === 'string') { - switch (type) { - case 'lib': - case 'jq': - return __jquery !== undefined ? __jquery : window.jQuery || null; - case 'win': - return window; - case 'datatable': - return __dataTable; - case 'datetime': - return __dateTime; - case 'luxon': - return __luxon$1 || window.luxon || null; - case 'moment': - return __moment$1 || window.moment || null; - case 'bootstrap': - // Use local if set, otherwise try window, which could be undefined - return __bootstrap || window.bootstrap || null; - case 'foundation': - // Ditto - return __foundation || window.Foundation || null; - default: - return null; - } - } - // Setter - if (type === 'lib' || - type === 'jq' || - (module && module.fn && module.fn.jquery)) { - __jquery = module; - jQuerySetup(); - } - else if (type === 'datatable' || (module && module.isDataTable)) { - __dataTable = module; - } - else if (type === 'win' || (module && module.document)) { - window = module; - document = module.document; - } - else if (type === 'datetime' || (module && module.type === 'DateTime')) { - __dateTime = module; - } - else if (type === 'luxon' || (module && module.FixedOffsetZone)) { - __luxon$1 = module; - } - else if (type === 'moment' || (module && module.isMoment)) { - __moment$1 = module; - } - else if (type === 'bootstrap' || - (module && module.Modal && module.Modal.NAME === 'modal')) { - // This is currently for BS5 only. BS3/4 attach to jQuery, so no need to use `.use()` - __bootstrap = module; - } - else if (type === 'foundation' || (module && module.Reveal)) { - __foundation = module; - } -} -/** - * Attach jQuery to DataTables - */ -function jQuerySetup() { - if (!__dataTable || !__jquery) { - return; - } - // Provide access to the host jQuery object (circular reference) - __dataTable.$ = __jquery; - // jQuery integration - expose the core function. - __jquery.fn.dataTable = __dataTable; - // jQuery wrapper - returning a DataTable instance - __jquery.fn.DataTable = function (options) { - let table = new __dataTable(this.toArray(), options); - return table; - }; - // Legacy aliases - __jquery.fn.dataTableSettings = __dataTable.ext.settings; - __jquery.fn.dataTableExt = __dataTable.ext; - // All properties that are available to $.fn.dataTable should also be available - // on $.fn.DataTable - each(__dataTable, function (prop, val) { - __jquery.fn.DataTable[prop] = val; - }); -} - function debounce(fn, timeout = 250) { let timer; return function (...args) { @@ -1648,7 +1670,8 @@ function parseEventName(original) { */ function add(el, nameFull, handler, selector, one) { let jq = external('jq'); - if (jq) { + let doc = external('doc'); + if (jq && el.constructor !== EventTarget) { let method = one ? 'one' : 'on'; if (selector) { jq(el)[method](nameFull, selector, handler); @@ -1665,8 +1688,8 @@ function add(el, nameFull, handler, selector, one) { } // Special handling for the "ready" event - it will trigger when the content // is ready, but also if it is already ready, when added. - if (el === document && eventName === 'DOMContentLoaded' && nameFull.includes('ready')) { - if (document.readyState === 'complete') { + if (el === doc && eventName === 'DOMContentLoaded' && nameFull.includes('ready')) { + if (doc.readyState === 'complete') { handler(new Event('DOMContentLoaded')); return; } @@ -1737,7 +1760,7 @@ function add(el, nameFull, handler, selector, one) { */ function remove(el, nameFull, handler, selector) { let jq = external('jq'); - if (jq) { + if (jq && el.constructor !== EventTarget) { if (selector) { jq(el).off(nameFull, selector, handler); } @@ -1805,7 +1828,8 @@ function remove(el, nameFull, handler, selector) { */ function trigger(el, nameFull, bubbles = false, args = [], eventProps = null, returnEvent = false) { let jq = external('jq'); - if (jq) { + let win = external('win'); + if (jq && el.constructor !== EventTarget) { let method = bubbles ? 'trigger' : 'triggerHandler'; let ev = jq.Event(nameFull); each(eventProps, (key, val) => { @@ -1824,10 +1848,19 @@ function trigger(el, nameFull, bubbles = false, args = [], eventProps = null, re if (!eventName) { return false; } - let isMouseEvent = _mouseEvents.includes(eventName.toLowerCase()); - let event = isMouseEvent - ? new MouseEvent(eventName, { bubbles, cancelable: true }) - : new Event(eventName, { bubbles, cancelable: true }); + let event; + // If running in Node, we might be using JSDom which has its own event + // classes. The EventTarget is always the global, separate from the window + // events. 99% of the time, they will be the same. + if (el.constructor === EventTarget) { + event = new Event(eventName, { bubbles, cancelable: true }); + } + else { + let isMouseEvent = _mouseEvents.includes(eventName.toLowerCase()); + event = isMouseEvent + ? new win.MouseEvent(eventName, { bubbles, cancelable: true }) + : new win.Event(eventName, { bubbles, cancelable: true }); + } // Set the extra properties for the event setEventProp(event, 'namespace', namespaces.join('.')); setEventProp(event, '_args', args || []); @@ -1849,7 +1882,7 @@ var win = { */ height() { var _a; - return ((_a = document.querySelector('html')) === null || _a === void 0 ? void 0 : _a.clientHeight) || 0; + return ((_a = external('doc').querySelector('html')) === null || _a === void 0 ? void 0 : _a.clientHeight) || 0; }, /** * Remove an event handler from the window @@ -1910,17 +1943,21 @@ var win = { */ width() { var _a; - return ((_a = document.querySelector('html')) === null || _a === void 0 ? void 0 : _a.clientWidth) || 0; + return ((_a = external('doc').querySelector('html')) === null || _a === void 0 ? void 0 : _a.clientWidth) || 0; } }; function create$3(name) { - let el = document.createElement(name); + let el = external('doc').createElement(name); return new Dom(el); } function select(selector) { return new Dom(selector); } +/** + * Event target for events which don't use the document + */ +const _staticEventTarget = new EventTarget(); /** * `Dom` is a class that provides a chaining UI for simple DOM manipulation and * selection. @@ -1951,7 +1988,7 @@ class Dom { add(selector, sort = true) { if (selector) { if (typeof selector === 'string') { - let elements = Array.from(document.querySelectorAll(selector)); + let elements = Array.from(external('doc').querySelectorAll(selector)); addArray(this, elements); } else if (selector instanceof Dom) { @@ -2387,7 +2424,7 @@ class Dom { include === 'inner' || include === 'outer') { let el = this[0]; - let computed = window.getComputedStyle(this[0]); + let computed = external('win').getComputedStyle(this[0]); let rectHeight = el.getBoundingClientRect().height; if (!include || include === 'content') { // Content. Minus scrollbar if there is one. This is basically @@ -2465,7 +2502,7 @@ class Dom { if (this.count() === 0) { return false; } - return document.body.contains(this[0]); + return external('doc').body.contains(this[0]); } /** * Determine if the first element in the result set is visible or not. @@ -2575,10 +2612,10 @@ class Dom { }; } let box = this[0].getBoundingClientRect(); - let docElem = document.documentElement; + let docElem = external('doc').documentElement; return { - top: box.top + window.pageYOffset - docElem.clientTop, - left: box.left + window.pageXOffset - docElem.clientLeft + top: box.top + external('win').pageYOffset - docElem.clientTop, + left: box.left + external('win').pageXOffset - docElem.clientLeft }; } /** @@ -2589,7 +2626,7 @@ class Dom { * @returns Instance with the result set as the offset parents */ offsetParent() { - return this.map(el => el.offsetParent || document.body); + return this.map(el => el.offsetParent || external('doc').body); } on(arg1, arg2, arg3) { let { handler, names, selector } = normaliseEventParams(arg1, arg2, arg3); @@ -2885,7 +2922,7 @@ class Dom { include === 'inner' || include === 'outer') { let el = this[0]; - let computed = window.getComputedStyle(el); + let computed = external('win').getComputedStyle(el); let rectWidth = el.getBoundingClientRect().width; if (!include || include === 'content') { // Content. Minus scrollbar if there is one. This is basically @@ -2938,6 +2975,15 @@ Dom.c = create$3; * @returns Dom instance for manipulating the new element */ Dom.create = create$3; +/** + * Non-DOM event listener. Add an event listener with no document. + * + * @param name Event name + * @param fn Event callback + */ +Dom.on = function (name, fn) { + add(_staticEventTarget, name, fn, null, false); +}; /** * Select items from the document and wrap in a `Dom` instance (alias of * `select`) @@ -2959,6 +3005,20 @@ Dom.select = select; * false to disable and have it jump to the end. */ Dom.transitions = true; +/** + * Trigger an event non-DOM events. + * + * @param name Event name. This can optionally include period separated + * namespaces. Multiple events can be added by space separation of the + * names. + * @param args Arguments to pass to the event handlers (after the event + * object, which is always the first parameter). + * @param props An object of key/value pairs which should be added to the + * event object that is created and fired for the events. + */ +Dom.trigger = function (name, args, props) { + trigger(_staticEventTarget, name, true, args, props); +}; /** * Window object methods */ @@ -3010,10 +3070,10 @@ function documentOrder(a, b) { let position = a.compareDocumentPosition(b); if (position & Node.DOCUMENT_POSITION_DISCONNECTED) { // One is disconnected - find which - if (document.body.contains(a)) { + if (external('doc').body.contains(a)) { return -1; } - else if (document.body.contains(b)) { + else if (external('doc').body.contains(b)) { return 1; } return 0; @@ -3475,7 +3535,7 @@ function invalidateRow(settings, rowIdx, src, colIdx) { else { // Reading from data object, update the DOM var cells = row.cells; - var display = getRowDisplay(settings, rowIdx); + var display = getDisplay(settings, rowIdx); if (cells.length) { if (colIdx !== undefined) { writeCell(cells[colIdx], display[colIdx]); @@ -3734,8 +3794,7 @@ function calculateColumnWidths(settings) { // Construct a worst case table with the widest, assign any user defined // widths, then insert it into the DOM and allow the browser to do all // the hard work of calculating table widths - var tmpTable = Dom - .s(table.cloneNode()) + var tmpTable = Dom.s(table.cloneNode()) .css('visibility', 'hidden') .css('margin', '0') .attrRemove('id'); @@ -3781,7 +3840,7 @@ function calculateColumnWidths(settings) { } if (longestData.length) { for (i = 0; i < longestData[0].length; i++) { - var tr = Dom.c('tr').appendTo(tmpTable.find('tbody')); + var tr = Dom.c('tr').appendTo(tmpTable.children('tbody')); for (j = 0; j < visibleColumns.length; j++) { columnIdx = visibleColumns[j]; column = columns[columnIdx]; @@ -3789,8 +3848,7 @@ function calculateColumnWidths(settings) { var autoClass = ext.type.className[column.type]; var padding = column.contentPadding || (scrollX ? '-' : ''); var text = longest + padding; - var cell = Dom - .c('td') + var cell = Dom.c('td') .classAdd(autoClass) .classAdd(column.className) .appendTo(tr); @@ -3812,8 +3870,7 @@ function calculateColumnWidths(settings) { // with minimal height, so it has no effect on if the container scrolls // or not. Otherwise it might trigger scrolling when it actually isn't // needed - var holder = Dom - .c('div') + var holder = Dom.c('div') .css(scrollX || scrollY ? { position: 'absolute', @@ -3883,8 +3940,7 @@ function calculateColumnWidths(settings) { // This flag allows the above to be satisfied. var first = Dom.s(settings.tableWrapper).isVisible(); // Use an empty div to attach the observer so it isn't impacted by height changes - var resizer = Dom - .c('div') + var resizer = Dom.c('div') .css({ width: '100%', height: '0' @@ -3937,14 +3993,19 @@ function wrapperWidth(settings) { */ function getWideStrings(settings, colIdx) { var column = settings.columns[colIdx]; - // Do we need to recalculate (i.e. was invalidated), or just use the cached data? - if (!column.wideStrings) { + // Do we need to recalculate (i.e. was invalidated), or just use the cached + // data? Recalculate if display based for the column. + if (!column.wideStrings || column.widthCalc === 'display') { var allStrings = []; var collection = []; + let rows = settings.displayMaster; + if (column.widthCalc === 'display') { + rows = settings.display.slice(settings.displayStart, settings.displayStart + settings.pageLength); + } // Create an array with the string information for the column - for (var i = 0, iLen = settings.displayMaster.length; i < iLen; i++) { - var rowIdx = settings.displayMaster[i]; - var data = getRowDisplay(settings, rowIdx)[colIdx]; + for (var i = 0, len = rows.length; i < len; i++) { + var rowIdx = rows[i]; + var data = getDisplay(settings, rowIdx, colIdx); var cellString = data && typeof data === 'object' && data.nodeType ? data.innerHTML : data + ''; @@ -4123,20 +4184,20 @@ function featureTable(settings) { let scrollBody = children.eq(1); let scrollFoot = children.eq(2); // When the body is scrolled, then we also want to scroll the header and - // footer. Note that each element has its own scroll listener, and that in - // turn sets the scroll for the other elements. However this doesn't lead to - // an infinite loop as `scroll` is only triggered if the value changes. + // footer. Equally we want changes in the header / footer to transition the + // body. The header and footer are `overflow: hidden`, so the user can't + // scroll those elements other than triggering a focus action in them. scrollBody.on('scroll.DT', () => { let scrollLeft = scrollBody.scrollLeft(); scrollHead.scrollLeft(scrollLeft); scrollFoot.scrollLeft(scrollLeft); }); - scrollHead.on('scroll.DT', () => { + scrollHead.on('focusin.DT', () => { let scrollLeft = scrollHead.scrollLeft(); scrollBody.scrollLeft(scrollLeft); scrollFoot.scrollLeft(scrollLeft); }); - scrollFoot.on('scroll.DT', () => { + scrollFoot.on('focusin.DT', () => { let scrollLeft = scrollFoot.scrollLeft(); scrollHead.scrollLeft(scrollLeft); scrollBody.scrollLeft(scrollLeft); @@ -4310,7 +4371,9 @@ function scrollDraw(settings) { .find('[role]') .attrRemove('role'); table.find('tbody tr:not([role])').attr('role', 'row'); - table.find('tbody td:not([role]), tbody th:not([role])').attr('role', 'cell'); + table + .find('tbody td:not([role]), tbody th:not([role])') + .attr('role', 'cell'); scrollAria(headerCopy); scrollAria(footerCopy); // Adjust the position of the header in case we loose the y-scrollbar @@ -5756,8 +5819,12 @@ function ajaxDataSrcParam(settings, param, json) { return json[old] !== undefined ? json[old] : json[param]; } -const __filter_div = Dom.c('div').get(0); -const __filter_div_textContent = __filter_div.textContent !== undefined; +let __filter_div; +let __filter_div_textContent; +function createFilterDiv() { + __filter_div = Dom.c('div').get(0); + __filter_div_textContent = __filter_div.textContent !== undefined; +} /** * Filter the table using both the global filter and column based filtering * @@ -5945,6 +6012,9 @@ function filterData(settings) { let column; let j, jen, cellData, row; let wasInvalidated = false; + if (!__filter_div) { + createFilterDiv(); + } for (let rowIdx = 0; rowIdx < data.length; rowIdx++) { if (!data[rowIdx]) { continue; @@ -5991,14 +6061,7 @@ function filterData(settings) { return wasInvalidated; } -/** - * Render and cache a row's display data for the columns, if required - * - * @param settings DataTables settings object - * @param rowIdx Row index - * @returns Array with display information - */ -function getRowDisplay(settings, rowIdx) { +function getDisplay(settings, rowIdx, colIdx = null) { var rowModal = settings.data[rowIdx]; var columns = settings.columns; if (!rowModal) { @@ -6007,11 +6070,29 @@ function getRowDisplay(settings, rowIdx) { if (!rowModal.displayData) { // Need to render and cache rowModal.displayData = []; - for (var colIdx = 0, len = columns.length; colIdx < len; colIdx++) { - rowModal.displayData.push(getCellData(settings, rowIdx, colIdx, 'display')); + } + const displayData = rowModal.displayData; + // Check if we need to actually perform the render to get the display data + if (!displayData._complete) { + if (colIdx !== null) { + // Single cell + if (!displayData[colIdx]) { + displayData[colIdx] = getCellData(settings, rowIdx, colIdx, 'display'); + } + } + else { + // Whole row + for (var i = 0, len = columns.length; i < len; i++) { + if (!displayData[i]) { + displayData[i] = getCellData(settings, rowIdx, i, 'display'); + displayData._complete = true; + } + } } } - return rowModal.displayData; + // At this point the item(s) we want will have been created - possibly all, + // but that doesn't matter, as long as we've got the one we want. + return colIdx !== null ? displayData[colIdx] : displayData; } /** * Create a new TR element (and it's TD children) for a row @@ -6023,10 +6104,10 @@ function getRowDisplay(settings, rowIdx) { * @param tds Array of TD|TH elements for the row - must be given if trIn is. */ function createTr(settings, rowIdx, trIn, tds) { - var row = settings.data[rowIdx], cells = [], tr, td, column, i, iLen, create, trClass = settings.classes.tbody.row; + var row = settings.data[rowIdx], cells = [], tr, td, column, i, iLen, create, trClass = settings.classes.tbody.row, doc = external('doc'); if (row && row.tr === null) { let rowData = row.data; - tr = trIn || document.createElement('tr'); + tr = trIn || doc.createElement('tr'); row.tr = tr; row.cells = cells; Dom.s(tr).classAdd(trClass); @@ -6041,7 +6122,7 @@ function createTr(settings, rowIdx, trIn, tds) { column = settings.columns[i]; create = trIn && tds && tds[i] ? false : true; td = create - ? document.createElement(column.cellType) + ? doc.createElement(column.cellType) : tds[i]; if (!td) { log(settings, 0, 'Incorrect column count', 18); @@ -6051,7 +6132,7 @@ function createTr(settings, rowIdx, trIn, tds) { column: i }; cells.push(td); - var display = getRowDisplay(settings, rowIdx); + var display = getDisplay(settings, rowIdx); // Need to create the HTML if new, or if a rendering function is // defined if (create || @@ -6444,10 +6525,8 @@ function _emptyRow(settings) { else if (lang.emptyTable && recordsTotal(settings) === 0) { zero = lang.emptyTable; } - return Dom - .c('tr') - .append(Dom - .c('td') + return Dom.c('tr') + .append(Dom.c('td') .attr('colSpan', visibleColumns(settings)) .classAdd(settings.classes.empty.row) .html(zero)) @@ -6574,15 +6653,12 @@ function detectHeader(settings, thead, write) { cell.parent(':not([data-dt-order=disable])').count() !== 0 && cell.find('div.dt-column-order').count() === 0) { - Dom.c('div') - .classAdd('dt-column-order') - .appendTo(cell); + Dom.c('div').classAdd('dt-column-order').appendTo(cell); } // We need to wrap the elements in the header in another // element to use flexbox layout for those elements var headerFooter = isHeader ? 'header' : 'footer'; - if (cell.find('div.dt-column-' + headerFooter).count() === - 0) { + if (cell.find('div.dt-column-' + headerFooter).count() === 0) { Dom.c('div') .classAdd('dt-column-' + headerFooter) .append(Array.from(cell.get(0).childNodes)) @@ -6792,6 +6868,12 @@ function callbackFire(ctx, callbackArr, eventName, args, bubbles = false) { }); } if (eventName !== null) { + // Non-DOM events + if (bubbles) { + Dom.trigger(eventName + '.dt', args, { + dt: ctx.api + }); + } let table = Dom.s(ctx.table); let result = table.trigger(eventName + '.dt', bubbles, args, { dt: ctx.api @@ -7417,24 +7499,29 @@ function __mlHelper(localeString) { }; }; } -// Based on locale, determine standard number formatting -// Fallback for legacy browsers is US English -var __thousands = ','; -var __decimal = '.'; -if (window.Intl !== undefined) { - try { - var num = new Intl.NumberFormat().formatToParts(100000.1); - for (var i = 0; i < num.length; i++) { - if (num[i].type === 'group') { - __thousands = num[i].value; - } - else if (num[i].type === 'decimal') { - __decimal = num[i].value; +var __thousands; +var __decimal; +function detectIntl() { + let win = DataTable.use('win'); + // Based on locale, determine standard number formatting + // Fallback for legacy browsers is US English + __thousands = ','; + __decimal = '.'; + if (win.Intl !== undefined) { + try { + var num = new Intl.NumberFormat().formatToParts(100000.1); + for (var i = 0; i < num.length; i++) { + if (num[i].type === 'group') { + __thousands = num[i].value; + } + else if (num[i].type === 'decimal') { + __decimal = num[i].value; + } } } - } - catch (e) { - // noop + catch (e) { + // noop + } } } /** @@ -7475,6 +7562,9 @@ var helpers = { datetime: __mlHelper('toLocaleString'), time: __mlHelper('toLocaleTimeString'), number: function (thousands, decimal, precision, prefix, postfix) { + if (!__thousands && !__decimal) { + detectIntl(); + } // Auto locale detection if (thousands === null || thousands === undefined) { thousands = __thousands; @@ -7556,7 +7646,8 @@ const defaults$2 = { title: null, type: null, visible: true, - width: null + width: null, + widthCalc: 'all' }; /** @@ -7657,6 +7748,10 @@ class Settings { * Width of the column */ this.width = null; + /** + * Which cells to use when calculating the column width + */ + this.widthCalc = 'all'; /** * Width of the column when it was first "encountered" */ @@ -7824,7 +7919,7 @@ function browserDetect(ctx) { .css({ position: 'fixed', top: '0', - left: -1 * window.pageXOffset + 'px', // allow for scrolling + left: -1 * external('win').pageXOffset + 'px', // allow for scrolling height: '1px', width: '1px', overflow: 'hidden' @@ -7868,9 +7963,7 @@ function addColumn(settings) { data: defaults$2.data ? defaults$2.data : columnIdx, idx: columnIdx, searchFixed: {}, - colEl: Dom - .c('col') - .attr('data-dt-column', columnIdx) + colEl: Dom.c('col').attr('data-dt-column', columnIdx) }); settings.columns.push(column); // Legacy support for `searchCols` property. If set, and there is a value @@ -7878,9 +7971,7 @@ function addColumn(settings) { // specific `search` option is applied in `columnOptions`, but we always // want the search object for the column to exist. let searchCols = settings.searchCols; - settings.searches[columnIdx] = create$1(searchCols[columnIdx] - ? hungarianToCamel(searchCols[columnIdx]) - : {}); + settings.searches[columnIdx] = create$1(searchCols[columnIdx] ? hungarianToCamel(searchCols[columnIdx]) : {}); settings.searches[columnIdx].columns = [columnIdx]; } /** @@ -8370,12 +8461,18 @@ function columnsFromHeader(cell) { */ function columnCells(header, row = null, column = null) { var out = []; + var included = []; for (var i = 0; i < header.length; i++) { if (row === null || row === i) { for (var j = 0; j < header[i].length; j++) { var cell = header[i][j].cell; - if ((column === null || column === j) && !out.includes(cell)) { - out.push(cell); + if ((column === null || column === j) && + !included.includes(cell)) { + included.push(cell); + out.push({ + cell, + row: header[i].row + }); } } } @@ -8390,31 +8487,35 @@ function columnCells(header, row = null, column = null) { * @returns Array of selected elements */ function columnOrderingCells(settings, notSelector) { - var cells = []; - var titleRow = settings.titleRow; + let combined = []; + let titleRow = settings.titleRow; if (titleRow === true) { // Top row (legacy `orderCellsTop`) - cells = columnCells(settings.header, 0); + combined = columnCells(settings.header, 0); } else if (titleRow === false) { // Bottom row (legacy `orderCellsTop`) - cells = columnCells(settings.header, settings.header.length - 1); + combined = columnCells(settings.header, settings.header.length - 1); } else if (titleRow !== null) { // Specific row - cells = columnCells(settings.header, titleRow); + combined = columnCells(settings.header, titleRow); } else { // All - cells = columnCells(settings.header); + combined = columnCells(settings.header); } + let cells = combined.map(c => c.cell); + let rows = combined.map(c => c.row); return Dom.s(cells) .filter('th' + notSelector + ', td' + notSelector) .filter(el => { - return (Dom.s(el) - .parent() - .filter(notSelector) - .length !== 0); + let idx = cells.indexOf(el); + if (idx >= 0) { + return Dom.s(rows[idx]).filter(notSelector).length !== 0; + } + // Shouldn't be able to get here! + return true; }); } @@ -8613,7 +8714,7 @@ const ext = { /** * DataTables build type (expanded by the download builder) */ - builder: 'bs5/dt-3.0.4', + builder: 'bs5/dt-3.1.3', /** * Buttons. For use with the Buttons extension for DataTables. This is * defined here so other extensions can define buttons regardless of load @@ -8759,7 +8860,7 @@ const ext = { * Software version * @type string */ - version: '3.0.4' + version: '3.1.3' }; // // Backwards compatibility. Alias to pre 1.10 Hungarian notation counter parts @@ -9171,9 +9272,6 @@ const properties = {}; const classes = { Api }; -// TODO debug -window.classes = classes; -window.properties = properties; /** * Create a new API "class" (function), used for nested levels of the API - e.g. * `ApiRows` and `ApiColumn`. @@ -9958,7 +10056,7 @@ function selectColumns(settings, selector, opts) { } // Selector if (match && match[1]) { - let columnElements = columnCells(settings.header, null, col.idx); + let columnElements = columnCells(settings.header, null, col.idx).map(c => c.cell); return Dom.s(columnElements) .filter(match[1]) .count() > 0 @@ -9995,7 +10093,7 @@ function selectColumns(settings, selector, opts) { return [s._DT_CellIndex.column]; } // Selector on the TH elements for the columns - var result = Dom.s(columnCells(settings.header)) + var result = Dom.s(columnCells(settings.header).map(c => c.cell)) .filter(s) .mapTo(el => { return columnsFromHeader(el); @@ -10205,11 +10303,14 @@ registerPlural('columns().widths()', 'column().width()', function () { // Injects a fake row into the table for just a moment so the widths can // be read, regardless of colspan in the header and rows being present // in the body - var columns = this.columns(':visible'); - var row = Dom.c('tr').html('' + Array(columns.count()).join('') + ''); + let columns = this.columns(':visible'); + let row = Dom.c('tr'); + for (let i = 0; i < columns.count(); i++) { + Dom.c('td').appendTo(row); + } Dom.s(this.table().body()).append(row); - var widths = []; - var indexes = columns.indexes(); + let widths = []; + let indexes = columns.indexes(); row.children().each((el, idx) => { widths[indexes[idx]] = Dom.s(el).width('outer'); }); @@ -10389,7 +10490,7 @@ register('processing()', function (show) { }); // Add the state event handler in time for the initial draw to save state -Dom.s(document).on('preInit.dt', function (e, context) { +Dom.on('preInit.dt', function (e, context) { var api = new Api(context); api.on('stateSaveParams.DT', function (ev, settings, d) { // This could be more compact with the API, but it is a lot faster as a @@ -10412,7 +10513,7 @@ Dom.s(document).on('preInit.dt', function (e, context) { }); }); // But initial details can wait until the end -Dom.s(document).on('plugin-init.dt', function (e, context) { +Dom.on('plugin-init.dt', function (e, context) { var api = context.api; // And the initial load state detailsStateLoad(api, api.state.loaded()); @@ -11225,7 +11326,7 @@ const _licenseInfo = { expires: null, valid: null }; -const _wm = Dom.c('div'); +let _wm; const _publicKey = 'BE1A9w9D9U/4s4/TogY+1sW/dLJ8IquzK1PmV70J93ZTIvXMZ0eV2NAb52ntpgwVFySSB2fOI7geLNO737rQAyo='; /** * Convert a base64 string to a binary array @@ -11254,7 +11355,7 @@ function check(releaseDate, software) { noticeDisplay(); } else if (_licenseInfo.valid === false) { - noticePrep('License key invalid'); + noticePrep('Invalid license key'); noticeDisplay(); } else if (_licenseInfo.type === 'trial') { @@ -11264,7 +11365,7 @@ function check(releaseDate, software) { : -1; if (remaining < 0) { // Trial expires - consoleMsg('Your trial has now expired - https://datatables.net/plus', 'warn'); + consoleMsg('Your trial has now expired. Please visit https://datatables.net/plus to purchase a license', 'warn'); noticePrep('Trial expired'); noticeDisplay(); return false; @@ -11339,7 +11440,15 @@ const key = function (key) { * @returns */ function noticePrep(text) { + // Already prep-ed. Rather than possibly showing multiple messages, just + // let the first one show. + if (_ready) { + return; + } if (!_ready) { + if (!_wm) { + _wm = Dom.c('div'); + } let shadow = _wm[0].attachShadow({ mode: 'closed' }); let notice = Dom.c('div').css({ position: 'fixed', @@ -11351,37 +11460,59 @@ function noticePrep(text) { padding: '0.5em 1em', 'font-family': 'sans-serif', 'font-size': '12px', + 'line-height': '1.4em', + 'text-align': 'center', 'border-radius': '4px', 'z-index': '10000', - 'box-shadow': '0 2px 5px rgba(0,0,0,0.2)' + 'box-shadow': '1px 3px 5px rgba(0, 0, 0, 0.333)' }); - Dom.c('a') - .attr('href', 'https://datatables.net/tn/25') - .attr('target', '_blank') - .css({ - color: 'inherit', - 'text-decoration': 'none' - }) - .appendTo(notice); - if (!text) { - text = 'License key required'; - } shadow.appendChild(notice[0]); _notice = notice; _ready = true; } + _notice.empty(); if (text) { + // Specific notice + _notice + .append(Dom.c('span').text('DataTables Plus')) + .append(Dom.c('br')) + .append(Dom.c('span').text(text + ' - ')) + .append(Dom.c('a') + .attr('href', 'https://datatables.net/tn/25') + .attr('target', '_blank') + .css({ + color: 'inherit' + }) + .html('learn more »')); + } + else { _notice - .find('a') - .html('DataTables Plus: ' + text + ' - learn more »'); + .append(Dom.c('span').text('DataTables Plus - Evaluation Mode')) + .append(Dom.c('br')) + .append(Dom.c('a') + .attr('href', 'https://datatables.net/plus/trial') + .attr('target', '_blank') + .css({ + color: 'inherit' + }) + .text('Start a Free Trial')) + .append(Dom.c('span').text(' - ')) + .append(Dom.c('a') + .attr('href', 'https://datatables.net/plus') + .attr('target', '_blank') + .css({ + color: 'inherit' + }) + .text('Purchase a License')); } } /** * Display the license notice */ function noticeDisplay() { - if (!_processingKey && document.body && !document.body.contains(_wm[0])) { - document.body.appendChild(_wm[0]); + let doc = external('doc'); + if (!_processingKey && doc.body && !doc.body.contains(_wm[0])) { + doc.body.appendChild(_wm[0]); } } /** @@ -11455,7 +11586,7 @@ function plus (DataTable) { value: function (releaseDate, software = '') { // Unsecure sites are only useful for development, so allow there // and on the site. - let host = window.location.hostname; + let host = external('win').location.hostname; let isDev = host === '192.168.234.234' || host.endsWith('.datatables.net') || host === 'datatables.net'; @@ -11479,7 +11610,8 @@ function plus (DataTable) { } function getSubtle() { // Backwards compat for old browsers - let cryptoObj = window.crypto || window.msCrypto; + let win = external('win'); + let cryptoObj = win.crypto || win.msCrypto; let subtle = cryptoObj.subtle || cryptoObj.webkitSubtle; return subtle; } @@ -11565,7 +11697,7 @@ function _divProp(el, prop, val) { } } register$2('div', function (settings, opts) { - var n = document.createElement('div'); + var n = Dom.c('div').get(0); if (opts) { _divProp(n, 'className', opts.className); _divProp(n, 'id', opts.id); @@ -11723,7 +11855,7 @@ function _pagingDraw(settings, host, opts) { buttonEls.push(btn.display); } let wrapped = renderer(settings, 'pagingContainer')(settings, buttonEls); - let activeEl = host.find(document.activeElement).attr('data-dt-idx'); + let activeEl = host.find(external('doc').activeElement).attr('data-dt-idx'); host.empty().append(wrapped); if (activeEl) { host.find('[data-dt-idx="' + activeEl + '"]').trigger('focus'); @@ -12330,7 +12462,10 @@ const defaults = { stateDuration: 7200, stateLoadCallback: function (settings) { try { - const state = (settings.stateDuration === -1 ? sessionStorage : localStorage).getItem('DataTables_' + settings.unique + '_' + location.pathname); + const state = (settings.stateDuration === -1 ? sessionStorage : localStorage).getItem('DataTables_' + + settings.unique + + '_' + + external('win').location.pathname); return state ? JSON.parse(state) : {}; } catch (e) { @@ -12344,7 +12479,10 @@ const defaults = { try { (settings.stateDuration === -1 ? sessionStorage - : localStorage).setItem('DataTables_' + settings.unique + '_' + location.pathname, JSON.stringify(data)); + : localStorage).setItem('DataTables_' + + settings.unique + + '_' + + external('win').location.pathname, JSON.stringify(data)); } catch (e) { // noop @@ -12400,6 +12538,8 @@ const DataTable = function (selector, options) { if (init.on && init.on.options) { listener(table, 'options', init.on.options); } + // Don't have the settings object here, so can't use `callbackFire` + Dom.trigger('options.dt', [init]); table.trigger('options.dt', true, [init]); // Backwards compatibility parameter mapping compatOpts(defaults, true); @@ -12794,7 +12934,9 @@ DataTable.feature = { }; // Register the libraries util.external(DataTable); -if (window.jQuery) { +// If jQuery is present on the global, let DataTables know about it. This is +// required as it registers the plugin functions on the .fn object. +if (typeof window !== 'undefined' && window.jQuery) { util.external(window.jQuery); }