Compare commits

..

3 Commits
9.2.5 ... 9.2.8

Author SHA1 Message Date
Deon George
9db703d88f Added validation, debounce and highcharts funnel/solidguage 2022-10-20 10:30:21 +11:00
Deon George
05d3caddf4 Added toggle form helper 2022-08-20 23:27:00 +10:00
Deon George
e3ebef90d9 Added file form helper 2022-08-19 15:11:09 +10:00
3 changed files with 81 additions and 3 deletions

View File

@@ -0,0 +1,39 @@
<div class="form-group">
<label for="{{ $id }}">{{ $label }}</label>
<div class="input-group has-validation">
@empty($icon)
@else
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa-fw {{ $icon }}"></i></span>
</div>
@endempty()
<div class="custom-file">
<input type="file" class="custom-file-input @error($id) is-invalid @enderror" id="{{ $id }}" name="{{ $name ?? $id}}">
<label class="custom-file-label input-group-text" for="{{ $id }}">Choose file</label>
</div>
{{--
<div class="input-group-append">
<button type="submit" class="input-group-text btn btn-success" id="">Upload</button>
</div>
--}}
<span class="invalid-feedback @error($id) d-block @enderror" role="alert">
@error($id)
{{ $message }}
@enderror
</span>
</div>
</div>
@section('page-scripts')
<script>
$(document).ready(function() {
$('#{{ $id }}').on('change',function(){
//get the file name
var fileName = $(this).val();
//replace the "Choose a file" label
$(this).next('.custom-file-label').html(fileName);
})
});
</script>
@append

View File

@@ -0,0 +1,11 @@
<div class="form-group">
<div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
<input type="checkbox" class="custom-control-input" id="{{ $id }}" name="{{ $name ?: $id }}" {{ old($old ?? $name,$value) ? 'checked' : '' }}>
<label class="custom-control-label" for="{{ $id }}">{{ $label }}</label>
</div>
<span class="invalid-feedback @error($id) d-block @enderror" role="alert">
@error($id)
{{ $message }}
@enderror
</span>
</div>

View File

@@ -146,6 +146,14 @@ class CustomBladeServiceProvider extends ServiceProvider
break;
case 'debounce':
switch ($content) {
case 'js':
$urls->put($type,'js/debounce.js');
}
break;
case 'highcharts':
switch ($content) {
case 'js':
@@ -172,13 +180,23 @@ class CustomBladeServiceProvider extends ServiceProvider
$urls->put($key,'https://code.highcharts.com/modules/drilldown.js');
break;
case 'export':
$urls->put($key,'https://code.highcharts.com/modules/exporting.js');
$urls->put($key.'data','https://code.highcharts.com/modules/export-data.js');
break;
case 'funnel':
$urls->put($key,'https://code.highcharts.com/modules/funnel.js');
break;
case 'heatmap':
$urls->put($key,'https://code.highcharts.com/modules/heatmap.js');
break;
case 'export':
$urls->put($key,'https://code.highcharts.com/modules/exporting.js');
$urls->put($key.'data','https://code.highcharts.com/modules/export-data.js');
case 'solidguage':
$urls->put($key,'https://code.highcharts.com/highcharts-more.js');
$urls->put($key.'accessiblity','https://code.highcharts.com/modules/accessibility.js');
$urls->put($key.'solid-guage','https://code.highcharts.com/modules/solid-gauge.js');
break;
case 'theme-dark':
@@ -275,6 +293,16 @@ class CustomBladeServiceProvider extends ServiceProvider
break;
case 'validation':
switch ($content) {
case 'js':
// Base
$urls->put('validate','https://cdn.jsdelivr.net/npm/jquery-validation@1.19.3/dist/jquery.validate.min.js');
$urls->put('validate.additional','https://cdn.jsdelivr.net/npm/jquery-validation@1.19.3/dist/additional-methods.min.js');
}
break;
default:
throw new \Exception(sprintf('Unknown Expression: [%s]',$expression));
}