Skip to content

Commit 600d65b

Browse files
committed
feat: ✨ update hx-vals, hx-disable-elt, hx-headers and hx-include to support parameter selection
1 parent 4fde24a commit 600d65b

8 files changed

+17
-12
lines changed

.changeset/soft-parents-lie.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"htmx-attributes": minor
3+
---
4+
5+
update hx-vals, hx-disable-elt, hx-headers and hx-include to support parameter selection

bun.lockb

0 Bytes
Binary file not shown.

snippets/htmx-add-html.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"hx-disable-elt": {
3333
"prefix": "hx-disable-elt",
3434
"body": [
35-
"hx-disable-elt=\"this\""
35+
"hx-disable-elt=\"${1:this}\""
3636
],
3737
"description": [
3838
"adds the disabled attribute to the specified elements while a request is in flight\n",
@@ -72,7 +72,7 @@
7272
"hx-headers": {
7373
"prefix": "hx-headers",
7474
"body": [
75-
"hx-headers='{\"myHeader${01}\": \"My Value\"}'"
75+
"hx-headers='{\"${1:myHeader}\": \"${2:My Value}\"}'"
7676
],
7777
"description": [
7878
"adds to the headers that will be submitted with the request\n",
@@ -102,7 +102,7 @@
102102
"hx-include": {
103103
"prefix": "hx-include",
104104
"body": [
105-
"hx-include=\"[name='email']\""
105+
"hx-include=\"[${1:name}='${2:email}']\""
106106
],
107107
"description": [
108108
"include additional data in requests\n",

snippets/htmx-add-jsx.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"hx-disable-elt": {
3333
"prefix": "hx-disable-elt",
3434
"body": [
35-
"hx-disable-elt=\"this\""
35+
"hx-disable-elt=\"${1:this}\""
3636
],
3737
"description": [
3838
"adds the disabled attribute to the specified elements while a request is in flight\n",
@@ -72,7 +72,7 @@
7272
"hx-headers": {
7373
"prefix": "hx-headers",
7474
"body": [
75-
"hx-headers='{\"myHeader${01}\": \"My Value\"}'"
75+
"hx-headers='{\"${1:myHeader}\": \"${2:My Value}\"}'"
7676
],
7777
"description": [
7878
"adds to the headers that will be submitted with the request\n",
@@ -102,7 +102,7 @@
102102
"hx-include": {
103103
"prefix": "hx-include",
104104
"body": [
105-
"hx-include=\"[name='email']\""
105+
"hx-include=\"[${1:name}='${2:email}']\""
106106
],
107107
"description": [
108108
"include additional data in requests\n",

snippets/htmx-add-templ.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"hx-disable-elt": {
3333
"prefix": "hx-disable-elt",
3434
"body": [
35-
"hx-disable-elt=\"this\""
35+
"hx-disable-elt=\"${1:this}\""
3636
],
3737
"description": [
3838
"adds the disabled attribute to the specified elements while a request is in flight\n",
@@ -72,7 +72,7 @@
7272
"hx-headers": {
7373
"prefix": "hx-headers",
7474
"body": [
75-
"hx-headers='{\"myHeader${01}\": \"My Value\"}'"
75+
"hx-headers='{\"${1:myHeader}\": \"${2:My Value}\"}'"
7676
],
7777
"description": [
7878
"adds to the headers that will be submitted with the request\n",
@@ -102,7 +102,7 @@
102102
"hx-include": {
103103
"prefix": "hx-include",
104104
"body": [
105-
"hx-include=\"[name='email']\""
105+
"hx-include=\"[${1:name}='${2:email}']\""
106106
],
107107
"description": [
108108
"include additional data in requests\n",

snippets/htmx-core-html.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
"hx-vals": {
105105
"prefix": "hx-vals",
106106
"body": [
107-
"hx-vals='{\"myVal${01}\": \"My Value\"}'"
107+
"hx-vals='{\"${1:myVal$}\": \"${2:My Value}\"}'"
108108
],
109109
"description": [
110110
"adds values to the parameters to submit with the request (JSON-formatted)\n",

snippets/htmx-core-jsx.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
"hx-vals": {
105105
"prefix": "hx-vals",
106106
"body": [
107-
"hx-vals='{\"myVal${01}\": \"My Value\"}'"
107+
"hx-vals='{\"${1:myVal$}\": \"${2:My Value}\"}'"
108108
],
109109
"description": [
110110
"adds values to the parameters to submit with the request (JSON-formatted)\n",

snippets/htmx-core-templ.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
"hx-vals": {
105105
"prefix": "hx-vals",
106106
"body": [
107-
"hx-vals='{\"myVal${01}\": \"My Value\"}'"
107+
"hx-vals='{\"${1:myVal$}\": \"${2:My Value}\"}'"
108108
],
109109
"description": [
110110
"adds values to the parameters to submit with the request (JSON-formatted)\n",

0 commit comments

Comments
 (0)