Skip to content

Commit

Permalink
feat: ✨ update hx-vals, hx-disable-elt, hx-headers and hx-include to …
Browse files Browse the repository at this point in the history
…support parameter selection
  • Loading branch information
CRBroughton committed Jan 27, 2024
1 parent 4fde24a commit 600d65b
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .changeset/soft-parents-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"htmx-attributes": minor
---

update hx-vals, hx-disable-elt, hx-headers and hx-include to support parameter selection
Binary file modified bun.lockb
Binary file not shown.
6 changes: 3 additions & 3 deletions snippets/htmx-add-html.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"hx-disable-elt": {
"prefix": "hx-disable-elt",
"body": [
"hx-disable-elt=\"this\""
"hx-disable-elt=\"${1:this}\""
],
"description": [
"adds the disabled attribute to the specified elements while a request is in flight\n",
Expand Down Expand Up @@ -72,7 +72,7 @@
"hx-headers": {
"prefix": "hx-headers",
"body": [
"hx-headers='{\"myHeader${01}\": \"My Value\"}'"
"hx-headers='{\"${1:myHeader}\": \"${2:My Value}\"}'"
],
"description": [
"adds to the headers that will be submitted with the request\n",
Expand Down Expand Up @@ -102,7 +102,7 @@
"hx-include": {
"prefix": "hx-include",
"body": [
"hx-include=\"[name='email']\""
"hx-include=\"[${1:name}='${2:email}']\""
],
"description": [
"include additional data in requests\n",
Expand Down
6 changes: 3 additions & 3 deletions snippets/htmx-add-jsx.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"hx-disable-elt": {
"prefix": "hx-disable-elt",
"body": [
"hx-disable-elt=\"this\""
"hx-disable-elt=\"${1:this}\""
],
"description": [
"adds the disabled attribute to the specified elements while a request is in flight\n",
Expand Down Expand Up @@ -72,7 +72,7 @@
"hx-headers": {
"prefix": "hx-headers",
"body": [
"hx-headers='{\"myHeader${01}\": \"My Value\"}'"
"hx-headers='{\"${1:myHeader}\": \"${2:My Value}\"}'"
],
"description": [
"adds to the headers that will be submitted with the request\n",
Expand Down Expand Up @@ -102,7 +102,7 @@
"hx-include": {
"prefix": "hx-include",
"body": [
"hx-include=\"[name='email']\""
"hx-include=\"[${1:name}='${2:email}']\""
],
"description": [
"include additional data in requests\n",
Expand Down
6 changes: 3 additions & 3 deletions snippets/htmx-add-templ.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"hx-disable-elt": {
"prefix": "hx-disable-elt",
"body": [
"hx-disable-elt=\"this\""
"hx-disable-elt=\"${1:this}\""
],
"description": [
"adds the disabled attribute to the specified elements while a request is in flight\n",
Expand Down Expand Up @@ -72,7 +72,7 @@
"hx-headers": {
"prefix": "hx-headers",
"body": [
"hx-headers='{\"myHeader${01}\": \"My Value\"}'"
"hx-headers='{\"${1:myHeader}\": \"${2:My Value}\"}'"
],
"description": [
"adds to the headers that will be submitted with the request\n",
Expand Down Expand Up @@ -102,7 +102,7 @@
"hx-include": {
"prefix": "hx-include",
"body": [
"hx-include=\"[name='email']\""
"hx-include=\"[${1:name}='${2:email}']\""
],
"description": [
"include additional data in requests\n",
Expand Down
2 changes: 1 addition & 1 deletion snippets/htmx-core-html.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"hx-vals": {
"prefix": "hx-vals",
"body": [
"hx-vals='{\"myVal${01}\": \"My Value\"}'"
"hx-vals='{\"${1:myVal$}\": \"${2:My Value}\"}'"
],
"description": [
"adds values to the parameters to submit with the request (JSON-formatted)\n",
Expand Down
2 changes: 1 addition & 1 deletion snippets/htmx-core-jsx.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"hx-vals": {
"prefix": "hx-vals",
"body": [
"hx-vals='{\"myVal${01}\": \"My Value\"}'"
"hx-vals='{\"${1:myVal$}\": \"${2:My Value}\"}'"
],
"description": [
"adds values to the parameters to submit with the request (JSON-formatted)\n",
Expand Down
2 changes: 1 addition & 1 deletion snippets/htmx-core-templ.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"hx-vals": {
"prefix": "hx-vals",
"body": [
"hx-vals='{\"myVal${01}\": \"My Value\"}'"
"hx-vals='{\"${1:myVal$}\": \"${2:My Value}\"}'"
],
"description": [
"adds values to the parameters to submit with the request (JSON-formatted)\n",
Expand Down

0 comments on commit 600d65b

Please sign in to comment.