Skip to content
This repository was archived by the owner on Oct 20, 2025. It is now read-only.

Commit d7e8482

Browse files
committed
Test fix + nameless input element fix
1 parent e4d1478 commit d7e8482

File tree

9 files changed

+18
-16
lines changed

9 files changed

+18
-16
lines changed

app/package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"build": "vite build && vite build --ssr"
66
},
77
"devDependencies": {
8-
"@protonemedia/laravel-splade": "file:../protonemedia-laravel-splade-0.4.4.tgz",
8+
"@protonemedia/laravel-splade": "file:../protonemedia-laravel-splade-0.4.5.tgz",
99
"@tailwindcss/forms": "^0.5.2",
1010
"@tailwindcss/typography": "^0.5.2",
1111
"@vitejs/plugin-vue": "^3.0.0",

app/tests/Browser/Form/SimpleTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function it_shows_validation_errors_for_each_element()
2323
->assertSee('The biography field is required.')
2424
->assertSee('The options field is required.')
2525
->assertSee('The language field is required.')
26-
->assertSee('The terms field is required.');
26+
->assertSee('The terms must be accepted.');
2727
});
2828
}
2929

dist/protone-media-laravel-splade.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3291,9 +3291,9 @@ const Lf = {
32913291
mounted() {
32923292
let e = document.querySelector(`form[data-splade-id="${this.spladeId}"]`);
32933293
e || (e = document), this.missingAttributes.forEach((t) => {
3294-
let r = {};
3294+
let r = "";
32953295
const n = e.querySelector(`[name="${t}"]`);
3296-
n ? r = n.type === "checkbox" ? !1 : "" : e.querySelector(`[name="${t}[]"]`) && (r = []), this.$put(t, r);
3296+
n ? r = n.type === "checkbox" ? !1 : "" : e.querySelector(`[name="${t}[]"]`) ? r = [] : (e.querySelector(`[name^="${t}."]`) || e.querySelector(`[name^="${t}["]`)) && (r = {}), this.$put(t, r);
32973297
}), this.missingAttributes = [];
32983298
},
32993299
methods: {

dist/protone-media-laravel-splade.umd.cjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

lib/Components/Form.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,16 @@ export default {
123123
}
124124
125125
this.missingAttributes.forEach((attribute) => {
126-
let defaultValue = {};
126+
let defaultValue = "";
127127
128128
const inputElement = formElement.querySelector(`[name="${attribute}"]`);
129129
130130
if(inputElement) {
131131
defaultValue = inputElement.type === "checkbox" ? false : "";
132132
} else if(formElement.querySelector(`[name="${attribute}[]"]`)) {
133133
defaultValue = [];
134+
} else if(formElement.querySelector(`[name^="${attribute}."]`) || formElement.querySelector(`[name^="${attribute}["]`)) {
135+
defaultValue = {};
134136
}
135137
136138
this.$put(attribute, defaultValue);

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@protonemedia/laravel-splade",
3-
"version": "0.4.4",
3+
"version": "0.4.5",
44
"description": "Laravel Splade: the magic of Inertia.js with the simplicity of Blade.",
55
"private": false,
66
"author": "Pascal Baljet <[email protected]>",

src/Commands/SpladeInstallCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function handle(): int
2121
// Install NPM packages...
2222
$this->updateNodePackages(function ($packages) {
2323
return [
24-
'@protonemedia/laravel-splade' => '^0.4.4',
24+
'@protonemedia/laravel-splade' => '^0.4.5',
2525
'@tailwindcss/forms' => '^0.5.2',
2626
'@tailwindcss/typography' => '^0.5.2',
2727
'@vitejs/plugin-vue' => '^3.0.0',

0 commit comments

Comments
 (0)