Skip to content

Commit ff0d27e

Browse files
committed
Rework Fields
1 parent 388444b commit ff0d27e

37 files changed

+394
-166
lines changed

resources/views/actions/button.blade.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@component($typeForm, get_defined_vars())
1+
22
<button
33
data-controller="button"
44
data-turbo="{{ var_export($turbo) }}"
@@ -14,4 +14,3 @@
1414

1515
{{ $name ?? '' }}
1616
</button>
17-
@endcomponent

resources/views/actions/dropdown.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@component($typeForm, get_defined_vars())
1+
22
<button
33
{{ $attributes }}
44
type="button"
@@ -19,4 +19,4 @@
1919
{!! $item->build($source) !!}
2020
@endforeach
2121
</div>
22-
@endcomponent
22+
Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
@component($typeForm, get_defined_vars())
2-
<a
3-
data-turbo="{{ var_export($turbo) }}"
4-
{{ $attributes }}
5-
>
6-
@isset($icon)
7-
<x-orchid-icon :path="$icon" class="overflow-visible"/>
8-
@endisset
1+
<a
2+
data-turbo="{{ var_export($turbo) }}"
3+
{{ $attributes }}
4+
>
5+
@isset($icon)
6+
<x-orchid-icon :path="$icon" class="overflow-visible"/>
7+
@endisset
98

10-
{{ $name ?? '' }}
11-
</a>
12-
@endcomponent
9+
{{ $name ?? '' }}
10+
</a>
Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
1-
@component($typeForm, get_defined_vars())
2-
<button type="button"
3-
{{ $attributes }}
4-
data-controller="modal-toggle"
5-
data-action="click->modal-toggle#targetModal"
6-
data-modal-toggle-open-value="{{ var_export($open) }}"
7-
data-modal-toggle-title-value="{{ $modalTitle ?? $title ?? '' }}"
8-
data-modal-toggle-key-value="{{ $modal ?? '' }}"
9-
data-modal-toggle-action-value="{{ $action }}"
1+
<button type="button"
2+
{{ $attributes }}
3+
data-controller="modal-toggle"
4+
data-action="click->modal-toggle#targetModal"
5+
data-modal-toggle-open-value="{{ var_export($open) }}"
6+
data-modal-toggle-title-value="{{ $modalTitle ?? $title ?? '' }}"
7+
data-modal-toggle-key-value="{{ $modal ?? '' }}"
8+
data-modal-toggle-action-value="{{ $action }}"
109

11-
@if(!empty($parameters))
12-
data-modal-toggle-parameters-value='@json($parameters)'
13-
@endif
14-
>
10+
@if(!empty($parameters))
11+
data-modal-toggle-parameters-value='@json($parameters)'
12+
@endif
13+
>
1514

16-
@isset($icon)
17-
<x-orchid-icon :path="$icon" class="overflow-visible"/>
18-
@endisset
15+
@isset($icon)
16+
<x-orchid-icon :path="$icon" class="overflow-visible"/>
17+
@endisset
1918

20-
{{ $name ?? '' }}
21-
</button>
22-
@endcomponent
19+
{{ $name ?? '' }}
20+
</button>

resources/views/app.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<meta name="dashboard-prefix" content="{{ Dashboard::prefix() }}">
2929

3030
@if(!config('platform.turbo.cache', false))
31-
<meta name="turbo-cache-control" content="no-cache">
31+
<meta name="turbo-cache-control" content="no-preview">
3232
@endif
3333

3434
@foreach(collect(['/js/manifest.js', '/js/vendor.js', '/js/orchid.js']) as $key)

resources/views/fields/attach.blade.php

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
1-
@component($typeForm, get_defined_vars())
1+
2+
<script>
3+
console.warn(application);
4+
console.warn('Connected!');
5+
6+
function canRegisterController(name){
7+
return !application.router.modulesByIdentifier.has(name)
8+
}
9+
10+
if(canRegisterController('example')){
11+
application.register("example",
12+
class extends window.Controller {
13+
connect() {
14+
alert('Hello connected!');
15+
}
16+
}
17+
);
18+
}
19+
</script>
20+
21+
<div data-controller="example"></div>
22+
223
<div data-controller="attach"
324
class="attach"
425
data-attach-name-value="{{ $name }}"
@@ -69,4 +90,3 @@ class="attach"
6990
</template>
7091

7192
</div>
72-
@endcomponent

resources/views/fields/checkbox.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@component($typeForm, get_defined_vars())
1+
22
<div data-controller="checkbox"
33
data-checkbox-indeterminate="{{$indeterminate}}">
44
@isset($sendTrueOrFalse)
@@ -19,4 +19,4 @@
1919
</div>
2020
@endisset
2121
</div>
22-
@endcomponent
22+

resources/views/fields/code.blade.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@component($typeForm, get_defined_vars())
1+
22
<div
33
data-controller="code"
44
data-code-language="{{$language}}"
@@ -8,4 +8,3 @@
88
<div class="code border position-relative w-100" style="min-height: {{ $attributes['height'] }}"></div>
99
<input type="hidden" {{ $attributes }}>
1010
</div>
11-
@endcomponent

resources/views/fields/cropper.blade.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@component($typeForm, get_defined_vars())
1+
22
<div data-controller="cropper"
33
data-cropper-value="{{ $attributes['value'] }}"
44
data-cropper-storage="{{ $storage ?? config('platform.attachment.disk', 'public') }}"
@@ -83,4 +83,3 @@ class="btn btn-default"
8383
</div>
8484
</div>
8585
</div>
86-
@endcomponent

resources/views/fields/dataRange.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@component($typeForm, get_defined_vars())
1+
22
<div class="row" data-controller="datetime"
33
data-datetime-allow-input="true"
44
data-datetime-range="#end_{{ $attributes['id'] }}"
@@ -27,4 +27,4 @@ class="form-control">
2727
</div>
2828
</div>
2929
</div>
30-
@endcomponent
30+

resources/views/fields/datetime.blade.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@component($typeForm, get_defined_vars())
1+
22
<div
33
data-controller="datetime"
44
class="input-group"
@@ -26,7 +26,6 @@ class="input-group"
2626
</label>
2727
@endforeach
2828
</div>
29-
@endcomponent
3029

3130

3231

resources/views/fields/input.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@component($typeForm, get_defined_vars())
1+
22
<div data-controller="input"
33
data-input-mask="{{$mask ?? ''}}"
44
>
@@ -12,4 +12,4 @@
1212
@endforeach
1313
</datalist>
1414
@endempty
15-
@endcomponent
15+
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
@component($typeForm, get_defined_vars())
1+
22
@if(strlen($value) > 0)
33
<p {{ $attributes }}>
44
{{ $value }}
55
</p>
66
@endif
7-
@endcomponent
7+

resources/views/fields/map.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@component($typeForm, get_defined_vars())
1+
22
<div data-controller="map"
33
data-map-id="{{$id}}"
44
data-map-zoom="{{$zoom}}"
@@ -38,4 +38,4 @@
3838
<div class="marker-results"></div>
3939

4040
</div>
41-
@endcomponent
41+

resources/views/fields/matrix.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@component($typeForm, get_defined_vars())
1+
22
<table class="matrix table table-bordered border-right-0 overflow-y-auto"
33
data-controller="matrix"
44
data-matrix-index="{{ $index }}"
@@ -35,4 +35,4 @@
3535
</template>
3636
</tbody>
3737
</table>
38-
@endcomponent
38+

resources/views/fields/numberRange.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@component($typeForm, get_defined_vars())
1+
22
<div class="row">
33
<div class="col-md-6 pe-1">
44
<div class="form-group">
@@ -24,4 +24,4 @@
2424
</div>
2525
</div>
2626
</div>
27-
@endcomponent
27+

resources/views/fields/password.blade.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
@component($typeForm, get_defined_vars())
2-
3-
<div data-controller="password"
1+
<div data-controller="password"
42
class="input-icon"
53
>
64
<input {{ $attributes }} data-password-target="password">
@@ -15,5 +13,3 @@ class="input-icon"
1513
</span>
1614
</div>
1715
</div>
18-
19-
@endcomponent

resources/views/fields/picture.blade.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@component($typeForm, get_defined_vars())
1+
22
<div data-controller="picture"
33
data-picture-value="{{ $attributes['value'] }}"
44
data-picture-storage="{{ $storage ?? config('platform.attachment.disk', 'public') }}"
@@ -44,4 +44,3 @@ class="d-none">
4444
{{ $attributes }}
4545
>
4646
</div>
47-
@endcomponent

resources/views/fields/quill.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@component($typeForm, get_defined_vars())
1+
22
<div data-controller="quill"
33
data-quill-toolbar='@json($toolbar)'
44
data-quill-base64='@json($base64)'
@@ -12,4 +12,4 @@
1212
</div>
1313
<textarea class="d-none" {{ $attributes }}></textarea>
1414
</div>
15-
@endcomponent
15+
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
@component($typeForm, get_defined_vars())
1+
22
<div class="form-check">
33
<input id="{{$id}}" {{ $attributes }}>
44
<label class="form-check-label" for="{{$id}}">{{$placeholder ?? ''}}</label>
55
</div>
6-
@endcomponent
6+

resources/views/fields/radiobutton.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@component($typeForm, get_defined_vars())
1+
22
<div data-controller="radiobutton">
33
<div class="btn-group btn-group-toggle p-0" data-toggle="buttons">
44

@@ -13,4 +13,4 @@
1313
@endforeach
1414
</div>
1515
</div>
16-
@endcomponent
16+
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
@component($typeForm, get_defined_vars())
1+
22
<input type="range" class="form-range" {{ $attributes }}>
3-
@endcomponent
3+

resources/views/fields/relation.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@component($typeForm, get_defined_vars())
1+
22
<div data-controller="relation"
33
data-relation-id="{{$id}}"
44
data-relation-placeholder="{{$attributes['placeholder'] ?? ''}}"
@@ -21,4 +21,4 @@
2121
@endforeach
2222
</select>
2323
</div>
24-
@endcomponent
24+

resources/views/fields/select.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@component($typeForm, get_defined_vars())
1+
22
<div data-controller="select"
33
data-select-placeholder="{{$attributes['placeholder'] ?? ''}}"
44
data-select-allow-empty="{{ $allowEmpty }}"
@@ -19,4 +19,4 @@
1919
@endforeach
2020
</select>
2121
</div>
22-
@endcomponent
22+
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
@component($typeForm, get_defined_vars())
1+
22
<div class="simplemde-wrapper" data-controller="simplemde"
33
data-simplemde-text-value='{!! \Illuminate\Support\Js::encode($value) !!}'>
44
<textarea {{ $attributes }}></textarea>
55
<input class="d-none upload" type="file" data-action="simplemde#upload">
66
</div>
7-
@endcomponent
7+

resources/views/fields/switch.blade.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@component($typeForm, get_defined_vars())
1+
22
@isset($sendTrueOrFalse)
33
<input hidden name="{{$attributes['name']}}" value="{{$attributes['novalue']}}">
44
<div class="form-check form-switch">
@@ -18,4 +18,3 @@
1818
<label class="form-check-label" for="{{$id}}">{{$placeholder ?? ''}}</label>
1919
</div>
2020
@endisset
21-
@endcomponent
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
@component($typeForm, get_defined_vars())
1+
22
<textarea {{ $attributes }}>{{ $value ?? '' }}</textarea>
3-
@endcomponent
3+

resources/views/fields/upload.blade.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@component($typeForm, get_defined_vars())
1+
22
<div
33
data-controller="upload"
44
data-upload-storage="{{$storage ?? config('platform.attachment.disk', 'public')}}"
@@ -189,4 +189,3 @@ class="form-control"
189189

190190
</div>
191191
</div>
192-
@endcomponent

resources/views/fields/utm.blade.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@component($typeForm, get_defined_vars())
21

32
<div data-controller="utm">
43
<div class="input-group mb-3">
@@ -76,5 +75,3 @@ class="btn btn-default">{{__('Generate URL')}}</button>
7675
</div>
7776
</div>
7877

79-
@endcomponent
80-

0 commit comments

Comments
 (0)