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

Commit 5a19cc4

Browse files
rawilkactions-user
authored andcommitted
Prettified Code!
1 parent 608d88d commit 5a19cc4

17 files changed

+264
-309
lines changed

CHANGELOG.md

Lines changed: 206 additions & 206 deletions
Large diffs are not rendered by default.

docs/advanced-usage/customizing-css.md

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ Beware: you will have to manually keep this CSS in sync with changes in future p
3333
```css
3434
/* app.css */
3535

36-
...
37-
38-
@import "custom/laravel-form-components.css";
36+
... @import "custom/laravel-form-components.css";
3937
```
4038

4139
Let's say you wanted to change the spacing in stacked checkbox groups. You could do so like this in the file you just created with the pasted in styles from the package:
@@ -97,7 +95,7 @@ module.exports = {
9795

9896
// Only necessary if you're going to use the switch-toggle component with different colors
9997
require("./vendor/rawilk/laravel-form-components/resources/js/tailwind-plugins/switch-toggle"),
100-
98+
10199
// Only necessary if you're going to support dark mode
102100
require("./vendor/rawilk/laravel-form-components/resources/js/tailwind-plugins/dark-mode"),
103101
],
@@ -153,14 +151,14 @@ module.exports = {
153151
// For checkbox/radio sizing
154152
pattern: /form-choice--*/,
155153
},
156-
154+
157155
// For dark mode...
158156
{
159157
// quill editor classes
160158
pattern: /ql--*/,
161159
},
162-
'filepond--panel-root',
163-
'filepond--root',
160+
"filepond--panel-root",
161+
"filepond--root",
164162
],
165163
};
166164
```
@@ -174,9 +172,7 @@ Some styling for components, such as text color and border colors, can be overri
174172
you could add the following to your app's CSS file:
175173

176174
```css
177-
...
178-
179-
:root {
175+
... :root {
180176
--input-border-color: theme("colors.green.300");
181177
--input-dark-border-color: theme("colors.green.500");
182178
}
@@ -200,13 +196,14 @@ pass to the plugin:
200196
module.exports = {
201197
plugins: [
202198
// ...
203-
require("./vendor/rawilk/laravel-form-components/resources/js/tailwind-plugins/dark-mode")({
204-
quill: false,
205-
filepond: false,
206-
}),
207-
]
199+
require("./vendor/rawilk/laravel-form-components/resources/js/tailwind-plugins/dark-mode")(
200+
{
201+
quill: false,
202+
filepond: false,
203+
}
204+
),
205+
],
208206
};
209207
```
210208

211209
For more information, please refer to [Tailwind's Dark Mode Documentation](https://tailwindcss.com/docs/dark-mode).
212-

docs/files/file-upload.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ This slot is completely optional, and can be omitted if you don't need to show a
5959
<x-file-upload name="avatar" wire:model="avatar">
6060
<div>
6161
@if ($avatar)
62-
<span class="block w-20 h-20">
63-
<img
64-
class="rounded-full w-full"
65-
src="{{ $avatar->temporaryUrl() }}"
66-
/>
67-
</span>
62+
<span class="block w-20 h-20">
63+
<img
64+
class="rounded-full w-full"
65+
src="{{ $avatar->temporaryUrl() }}"
66+
/>
67+
</span>
6868
@endif
6969
</div>
7070
</x-file-upload>

docs/files/filepond.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,7 @@ specify an option callbacks, such as `onaddfile`, that you need to:
113113

114114
```html
115115
<x-file-pond wire:model="avatar">
116-
<x-slot:config>
117-
onaddfile(error, file) {
118-
// do stuff
119-
},
120-
</x-slot:config>
116+
<x-slot:config> onaddfile(error, file) { // do stuff }, </x-slot:config>
121117
</x-file-pond>
122118
```
123119

docs/form/form-error.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Now we'll use the component's slot and its `messages()` method to render an unor
6363
```html
6464
<x-form-error tag="ul" name="first_name">
6565
@foreach ($component->messages($errors) as $error)
66-
<li>{{ $error }}</li>
66+
<li>{{ $error }}</li>
6767
@endforeach
6868
</x-form-error>
6969
```

docs/form/form-group.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,7 @@ optional.
9999
You can also have the component render the text `Optional` automatically for you by passing in `true` for the `optional` attribute.
100100

101101
```html
102-
<x-form-group label="First name" name="first_name" optional>
103-
...
104-
</x-form-group>
102+
<x-form-group label="First name" name="first_name" optional> ... </x-form-group>
105103
```
106104

107105
You can customize this text by modifying the config value for `optional_hint_text`.
@@ -153,9 +151,7 @@ The form-group component will now add a `mb-5` margin utility class to each form
153151
bit of breathing room from each other. The last form-group child in a container will have no margin bottom because of the `last:mb-0` utility class. If you don't want margins to be added to each form-group, you can do the following:
154152

155153
```html
156-
<x-form-group label="First name" :margin-bottom="false">
157-
...
158-
</x-form-group>
154+
<x-form-group label="First name" :margin-bottom="false"> ... </x-form-group>
159155
```
160156

161157
> {tip} To help space your form elements evenly in a form, you could also use a `space-y-*` utility class

docs/form/form.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ and CSRF directives and allows for easier to use syntax than the default HTML fo
1313
The most basic usage of the `form` component exists in encapsulating some form elements:
1414

1515
```html
16-
<x-form action="https://example.com">
17-
Form fields...
18-
</x-form>
16+
<x-form action="https://example.com"> Form fields... </x-form>
1917
```
2018

2119
This will output the following HTML:
@@ -55,9 +53,7 @@ As you can see, a `_method` input was added since HTML tags only support `POST`
5553
To enable file uploads in a form you can make use of the `has-files` attribute:
5654

5755
```html
58-
<x-form action="https://example.com" has-files>
59-
Form fields...
60-
</x-form>
56+
<x-form action="https://example.com" has-files> Form fields... </x-form>
6157
```
6258

6359
This will output the following HTML:

docs/inputs/checkbox-group.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ with each other, by setting the `stacked` attribute to `false`. This will displa
3939
By default, the checkbox-group renders checkboxes in rows with 3 columns when it is rendered inline. To render a different amount of columns, you can specify the `grid-cols` attribute:
4040

4141
```html
42-
<x-checkbox-group :stacked="false" grid-cols="5">
43-
...
44-
</x-checkbox-group>
42+
<x-checkbox-group :stacked="false" grid-cols="5"> ... </x-checkbox-group>
4543
```
4644

4745
## Sizing
@@ -50,9 +48,7 @@ For convenience, you can size all the radio or checkbox elements the same by usi
5048
the config value for radios and checkboxes.
5149

5250
```html
53-
<x-checkbox-group input-size="lg">
54-
...
55-
</x-checkbox-group>
51+
<x-checkbox-group input-size="lg"> ... </x-checkbox-group>
5652
```
5753

5854
For more information on the sizing, checkout the [Sizing](/docs/laravel-form-components/{version}/inputs/checkbox#user-content-sizing) documentation for checkboxes.

docs/inputs/checkbox.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ Via prop:
3030
Via slot:
3131

3232
```html
33-
<x-checkbox name="remember_me">
34-
Remember me
35-
</x-checkbox>
33+
<x-checkbox name="remember_me"> Remember me </x-checkbox>
3634
```
3735

3836
By default, the label will be placed on the **right** if the checkbox, however you can have it placed on the left side instead by setting the `labelLeft` attribute

docs/inputs/date-picker.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,7 @@ component JavaScript.
131131
```html
132132
<x-date-picker name="birthday">
133133
<x-slot:config>
134-
onChange: (selectedDates, dateStr, instance) => {
135-
// ...
136-
}
134+
onChange: (selectedDates, dateStr, instance) => { // ... }
137135
</x-slot:config>
138136
</x-date-picker>
139137
```
@@ -151,11 +149,8 @@ the event.
151149
```html
152150
<x-date-picker name="birthday">
153151
<x-slot:config>
154-
onOpen: [
155-
function (selectedDates, dateStr, instance) {
156-
// do something
157-
},
158-
],
152+
onOpen: [ function (selectedDates, dateStr, instance) { // do something
153+
}, ],
159154
</x-slot:config>
160155
</x-date-picker>
161156
```

docs/inputs/switch-toggle.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ This will render a label containing the text "Notifications on" to the right sid
4242
to render the label as well:
4343

4444
```html
45-
<x-switch-toggle>
46-
Notifications on
47-
</x-switch-toggle>
45+
<x-switch-toggle> Notifications on </x-switch-toggle>
4846
```
4947

5048
### Left aligned labels

docs/inputs/textarea.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ re-rendering the form, the `textarea` component will remember the old value:
4242

4343
```html
4444
<div class="form-text-container ...">
45-
<textarea name="about" id="about" class="form-input form-text ..." rows="3">About me text</textarea>
45+
<textarea name="about" id="about" class="form-input form-text ..." rows="3">
46+
About me text</textarea
47+
>
4648
</div>
4749
```
4850

docs/installation.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ Add the following before the end `body` tag in your template.
3838

3939
```html
4040
<body>
41-
...
42-
43-
@fcScripts
41+
... @fcScripts
4442
</body>
4543
```
4644

@@ -115,9 +113,9 @@ In your project's CSS, do the following for styling:
115113
Assuming your app CSS file is located in `/resources/css/app.css`, you can load in the package's styles like this:
116114

117115
```css
118-
...
119-
120-
@import "../../vendor/rawilk/laravel-form-components/resources/css/index.css";
116+
...
117+
@import
118+
"../../vendor/rawilk/laravel-form-components/resources/css/index.css";
121119
```
122120

123121
This will import all the package's styles into your stylesheet, however you are free to import only the stylesheets you need as well; they are all

docs/rich-text/quill.md

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -178,14 +178,10 @@ You will then need to utilize the `config` slot on the component to define a Jav
178178
...
179179
>
180180
<x-slot:config>
181-
toolbarHandlers: {
182-
variables: function (value) {
183-
value = `[[ ${value} ]]`;
184-
const cursorPosition = this.quill.getSelection().index;
185-
this.quill.insertText(cursorPosition, value);
186-
this.quill.setSelection(cursorPosition + value.length);
187-
},
188-
},
181+
toolbarHandlers: { variables: function (value) { value = `[[ ${value}
182+
]]`; const cursorPosition = this.quill.getSelection().index;
183+
this.quill.insertText(cursorPosition, value);
184+
this.quill.setSelection(cursorPosition + value.length); }, },
189185
</x-slot:config>
190186
</x-quill>
191187
```
@@ -217,9 +213,9 @@ This example will provide a custom dropdown menu with two options, and when each
217213
If you need to define JavaScript handlers for a [custom toolbar button](#user-content-custom-toolbar-button), you may use the `config`
218214
slot to do this. The config slot is inside a JavaScript function that returns an object and has access to the following variables:
219215

220-
| variable | description |
221-
| --- | --- |
222-
| `instance` | The Alpine data instance for the quill component |
216+
| variable | description |
217+
| -------------- | ----------------------------------------------------------- |
218+
| `instance` | The Alpine data instance for the quill component |
223219
| `quillOptions` | An object containing the options generated by the component |
224220

225221
For a complete list of quill configuration options, see [Quill Configuration](https://quilljs.com/docs/configuration/).
@@ -235,9 +231,8 @@ Here's an example of how you could hook into the `selection-change` event that Q
235231
```html
236232
<x-quill ...>
237233
<x-slot:on-init>
238-
instance.__quill.on('selection-change', function (range, oldRange, source) {
239-
// do something
240-
});
234+
instance.__quill.on('selection-change', function (range, oldRange,
235+
source) { // do something });
241236
</x-slot:on-init>
242237
</x-quill>
243238
```
@@ -254,18 +249,15 @@ editor instance, you can do so via `instance.__quill`.
254249
```html
255250
<x-quill ...>
256251
<x-slot:on-text-change>
257-
let value = instance.__quill.root.innerHTML;
258-
console.log(value);
252+
let value = instance.__quill.root.innerHTML; console.log(value);
259253
</x-slot:on-text-change>
260254
</x-quill>
261255
```
262256

263257
If you want to prevent our component from updating the value, or dispatching an `input` event, you may return `false` from the slot:
264258

265259
```html
266-
<x-slot:on-text-change>
267-
return false;
268-
</x-slot:on-text-change>
260+
<x-slot:on-text-change> return false; </x-slot:on-text-change>
269261
```
270262

271263
## API Reference

docs/selects/custom-select.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ the component will automatically render them as well while making the option an
178178
```html
179179
<x-custom-select ...>
180180
@foreach ($options as $option)
181-
<x-custom-select-option :value="$option" />
181+
<x-custom-select-option :value="$option" />
182182
@endforeach
183183
</x-custom-select>
184184
```

docs/selects/tree-select.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ the component will recursively render and children underneath the parent option.
164164
```html
165165
<x-tree-select ...>
166166
@foreach ($options as $option)'
167-
<x-tree-select-option :value="$option" />
167+
<x-tree-select-option :value="$option" />
168168
@endforeach
169169
</x-tree-select>
170170
```

docs/upgrade.md

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ If your app does not support dark mode, you don't need to worry about this chang
1717
module.exports = {
1818
plugins: [
1919
// ...
20-
require('./vendor/rawilk/laravel-form-components/resources/js/tailwind-plugins/dark-mode'),
20+
require("./vendor/rawilk/laravel-form-components/resources/js/tailwind-plugins/dark-mode"),
2121
],
2222
};
2323
```
@@ -85,11 +85,7 @@ three JS variables: `instance`, `options`, and `pondOptions`. The `instance` var
8585
options object that is passed to the component. Here's an example of how you could hook into Filepond's `oninit` callback:
8686

8787
```html
88-
<x-slot:config>
89-
oninit() {
90-
console.log('init', instance);
91-
},
92-
</x-slot:config>
88+
<x-slot:config> oninit() { console.log('init', instance); }, </x-slot:config>
9389
```
9490

9591
If you were registering plugins in the `plugins` slot, you will need to move that logic somewhere else, as we have removed this slot. See [Plugins](/docs/laravel-form-components/{version}/files/filepond#user-content-plugins) for more information.
@@ -104,13 +100,9 @@ Here is an example of how you could define a handler for a custom toolbar button
104100

105101
```html
106102
<x-slot:config>
107-
toolbarHandlers: {
108-
variables: function (value) {
109-
const cursorPosition = this.quill.getSelection().index;
110-
this.quill.insertText(cursorPosition, value);
111-
this.quill.setSelection(cursorPosition +value.length);
112-
},
113-
},
103+
toolbarHandlers: { variables: function (value) { const cursorPosition =
104+
this.quill.getSelection().index; this.quill.insertText(cursorPosition,
105+
value); this.quill.setSelection(cursorPosition +value.length); }, },
114106
</x-slot:config>
115107
```
116108

@@ -155,8 +147,7 @@ that is fired by flatpickr, you would do it like this:
155147

156148
```html
157149
<x-slot:config>
158-
onOpen: function (selectedDates, dateStr, instance) {
159-
// do something here.
150+
onOpen: function (selectedDates, dateStr, instance) { // do something here.
160151
},
161152
</x-slot:config>
162153
```

0 commit comments

Comments
 (0)