diff --git a/docs/articles/migrate-to-v2.md b/docs/articles/migrate-to-v2.md index 9d43a74..e5e6263 100644 --- a/docs/articles/migrate-to-v2.md +++ b/docs/articles/migrate-to-v2.md @@ -408,8 +408,8 @@ See [History updates](responses.md#history-updates). | `Target` | `Target` | | `Swap` | `Swap` for a swap style; `SwapExpression` for a style with modifiers | | `Select` | `Select` | -| `Values` (`object`) | `Values` (`IDictionary`) | -| `Headers` (`object`) | `Headers` (`IDictionary`) | +| `Values` (`object`) | `Values` (`IReadOnlyDictionary`) | +| `Headers` (`object`) | `Headers` (`IReadOnlyDictionary`) | | `Event`, `Handler` | Removed: HTMX expects a live browser event and a JavaScript function, which JSON cannot carry | | — | New: `SelectOob`, `HistoryUrl`, `HistoryAction` | diff --git a/src/Ramstack.HtmxToolkit/HtmxLocationOptions.cs b/src/Ramstack.HtmxToolkit/HtmxLocationOptions.cs index d5a19af..51eba05 100644 --- a/src/Ramstack.HtmxToolkit/HtmxLocationOptions.cs +++ b/src/Ramstack.HtmxToolkit/HtmxLocationOptions.cs @@ -52,7 +52,7 @@ public HtmxSwap? Swap /// HTMX 4.0.0 converts an array to a single comma-separated field value. /// /// - public IDictionary? Values { get; set; } + public IReadOnlyDictionary? Values { get; set; } /// /// Gets or sets the headers to include with the request. @@ -66,7 +66,7 @@ public HtmxSwap? Swap /// Pass complex data as a pre-serialized JSON string. /// /// - public IDictionary? Headers { get; set; } + public IReadOnlyDictionary? Headers { get; set; } /// /// Gets or sets a CSS selector used to filter the content to swap from the response. diff --git a/src/Ramstack.HtmxToolkit/Serialization/HtmxLocationOptionsJsonView.cs b/src/Ramstack.HtmxToolkit/Serialization/HtmxLocationOptionsJsonView.cs index e29a0ec..7e7f901 100644 --- a/src/Ramstack.HtmxToolkit/Serialization/HtmxLocationOptionsJsonView.cs +++ b/src/Ramstack.HtmxToolkit/Serialization/HtmxLocationOptionsJsonView.cs @@ -32,12 +32,12 @@ internal readonly struct HtmxLocationOptionsJsonView(string path, HtmxLocationOp /// /// Gets the form field values. /// - public IDictionary? Values => options.Values; + public IReadOnlyDictionary? Values => options.Values; /// /// Gets the request headers. /// - public IDictionary? Headers => options.Headers; + public IReadOnlyDictionary? Headers => options.Headers; /// /// Gets the content selector.