From 8fd6af8c2673138f667738dda07b45b614da5304 Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Wed, 27 Sep 2023 20:31:56 -0400 Subject: [PATCH] Add support for hx-disabled-elt - Update script tag to 1.9.6 --- src/Common/README.md | 2 +- src/Directory.Build.props | 4 ++-- src/Htmx/README.md | 2 +- src/Tests/ViewEngine.fs | 7 +++++-- src/ViewEngine.Htmx/Htmx.fs | 11 +++++++---- src/ViewEngine.Htmx/README.md | 2 +- 6 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/Common/README.md b/src/Common/README.md index b9248a9..5a10abb 100644 --- a/src/Common/README.md +++ b/src/Common/README.md @@ -2,4 +2,4 @@ This package contains common code shared between [`Giraffe.Htmx`](https://www.nuget.org/packages/Giraffe.Htmx) and [`Giraffe.ViewEngine.Htmx`](https://www.nuget.org/packages/Giraffe.ViewEngine.Htmx), and will be automatically installed when you install either one. -**htmx version: 1.9.5** +**htmx version: 1.9.6** diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 07e9cc3..5b48cc8 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -2,8 +2,8 @@ net6.0;net7.0 - 1.9.5 - Update script tags to pull htmx 1.9.5 + 1.9.6 + Add support for hx-disabled-elt attribute; update script tags to pull htmx 1.9.6 danieljsummers Bit Badger Solutions https://github.com/bit-badger/Giraffe.Htmx diff --git a/src/Htmx/README.md b/src/Htmx/README.md index acb438a..dbbdca4 100644 --- a/src/Htmx/README.md +++ b/src/Htmx/README.md @@ -2,7 +2,7 @@ This package enables server-side support for [htmx](https://htmx.org) within [Giraffe](https://giraffe.wiki) and ASP.NET's `HttpContext`. -**htmx version: 1.9.5** +**htmx version: 1.9.6** ### Setup diff --git a/src/Tests/ViewEngine.fs b/src/Tests/ViewEngine.fs index c62eb8e..aed484d 100644 --- a/src/Tests/ViewEngine.fs +++ b/src/Tests/ViewEngine.fs @@ -313,6 +313,9 @@ let attributes = test "_hxDisable succeeds" { p [ _hxDisable ] [] |> shouldRender """

""" } + test "_hxDisabledElt succeeds" { + button [ _hxDiabledElt "this" ] [] |> shouldRender """""" + } test "_hxDisinherit succeeds" { strong [ _hxDisinherit "*" ] [] |> shouldRender """""" } @@ -422,14 +425,14 @@ let script = let html = RenderView.AsString.htmlNode Script.minified Expect.equal html - """""" + """""" "Minified script tag is incorrect" } test "unminified succeeds" { let html = RenderView.AsString.htmlNode Script.unminified Expect.equal html - """""" + """""" "Unminified script tag is incorrect" } ] diff --git a/src/ViewEngine.Htmx/Htmx.fs b/src/ViewEngine.Htmx/Htmx.fs index 25c388b..1401054 100644 --- a/src/ViewEngine.Htmx/Htmx.fs +++ b/src/ViewEngine.Htmx/Htmx.fs @@ -193,6 +193,9 @@ module HtmxAttrs = /// Disables htmx processing for the given node and any children nodes let _hxDisable = flag "hx-disable" + /// Specifies elements that should be disabled when an htmx request is in flight + let _hxDiabledElt = attr "hx-disabled-elt" + /// Disinherit all ("*") or specific htmx attributes let _hxDisinherit = attr "hx-disinherit" @@ -296,14 +299,14 @@ module Script = /// Script tag to load the minified version from unpkg.com let minified = - script [ _src "https://unpkg.com/htmx.org@1.9.5" - _integrity "sha384-xcuj3WpfgjlKF+FXhSQFQ0ZNr39ln+hwjN3npfM9VBnUskLolQAcN80McRIVOPuO" + script [ _src "https://unpkg.com/htmx.org@1.9.6" + _integrity "sha384-FhXw7b6AlE/jyjlZH5iHa/tTe9EpJ1Y55RjcgPbjeWMskSxZt1v9qkxLJWNJaGni" _crossorigin "anonymous" ] [] /// Script tag to load the unminified version from unpkg.com let unminified = - script [ _src "https://unpkg.com/htmx.org@1.9.5/dist/htmx.js" - _integrity "sha384-7PsmARhgPhXF9ahyuTafz8AWfM9ZfXE9qZJeagUhWAYK632LixPUVjGRZnHP9ylN" + script [ _src "https://unpkg.com/htmx.org@1.9.6/dist/htmx.js" + _integrity "sha384-DyaDHx3hlXQ3QqTsQbNECvRW/A/B+4OtEWLCHbsDRPI3oJ98ekMiWJ4Yyrrqimog" _crossorigin "anonymous" ] [] diff --git a/src/ViewEngine.Htmx/README.md b/src/ViewEngine.Htmx/README.md index c63c586..0ae10b4 100644 --- a/src/ViewEngine.Htmx/README.md +++ b/src/ViewEngine.Htmx/README.md @@ -2,7 +2,7 @@ This package enables [htmx](https://htmx.org) support within the [Giraffe](https://giraffe.wiki) view engine. -**htmx version: 1.9.5** +**htmx version: 1.9.6** ### Setup