chore(deps): added adminlte vendored items

(this might not be entirely necessary unless we're changing everything adminlte publishes)

Signed-off-by: miguel456 <me@nogueira.codes>
This commit is contained in:
2023-02-26 02:15:25 +00:00
parent 0695262e73
commit 25fe13f091
66 changed files with 3354 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
<button type="{{ $type }}" {{ $attributes->merge(['class' => "btn btn-{$theme}"]) }}>
@isset($icon) <i class="{{ $icon }}"></i> @endisset
@isset($label) {{ $label }} @endisset
</button>

View File

@@ -0,0 +1,165 @@
@extends('adminlte::components.form.input-group-component')
{{-- Set errors bag internallly --}}
@php($setErrorsBag($errors ?? null))
{{-- Set input group item section --}}
@section('input_group_item')
{{-- Date Range Input --}}
<input id="{{ $id }}" name="{{ $name }}"
{{ $attributes->merge(['class' => $makeItemClass()]) }}>
@overwrite
{{-- Add plugin initialization and configuration code --}}
@push('js')
<script>
$(() => {
let usrCfg = _AdminLTE_DateRange.parseCfg( @json($config) );
// Add support to display a placeholder. In this situation, the related
// input won't be updated automatically and the cancel button will be
// used to clear the input.
@if($attributes->has('placeholder'))
usrCfg.autoUpdateInput = false;
$('#{{ $id }}').on('apply.daterangepicker', function(ev, picker)
{
let startDate = picker.startDate.format(picker.locale.format);
let endDate = picker.endDate.format(picker.locale.format);
let value = picker.singleDatePicker
? startDate
: startDate + picker.locale.separator + endDate;
$(this).val(value);
});
$('#{{ $id }}').on('cancel.daterangepicker', function(ev, picker)
{
$(this).val('');
});
@endif
// Check if the default set of ranges should be enabled, and if a
// default range should be set at initialization.
@isset($enableDefaultRanges)
usrCfg.ranges = usrCfg.ranges || _AdminLTE_DateRange.defaultRanges;
let range = usrCfg.ranges[ @json($enableDefaultRanges) ];
if (Array.isArray(range) && range.length > 1) {
usrCfg.startDate = range[0];
usrCfg.endDate = range[1];
}
@endisset
// Add support to auto select the previous submitted value in case
// of validation errors. Note the previous value may be a date range or
// a single date depending on the plugin configuration.
@if($errors->any() && $enableOldSupport)
let oldRange = @json($getOldValue($errorKey, ""));
let separator = " - ";
if (usrCfg.locale && usrCfg.locale.separator) {
separator = usrCfg.locale.separator;
}
// Update the related input.
if (! usrCfg.autoUpdateInput) {
$('#{{ $id }}').val(oldRange);
}
// Update the internal plugin data.
if (oldRange) {
oldRange = oldRange.split(separator);
usrCfg.startDate = oldRange.length > 0 ? oldRange[0] : null;
usrCfg.endDate = oldRange.length > 1 ? oldRange[1] : null;
}
@endif
// Setup the underlying date range plugin.
$('#{{ $id }}').daterangepicker(usrCfg);
})
</script>
@endpush
{{-- Register Javascript utility class for this component --}}
@once
@push('js')
<script>
class _AdminLTE_DateRange {
/**
* A default set of ranges options.
*/
static defaultRanges = {
'Today': [
moment().startOf('day'),
moment().endOf('day')
],
'Yesterday': [
moment().subtract(1, 'days').startOf('day'),
moment().subtract(1, 'days').endOf('day')
],
'Last 7 Days': [
moment().subtract(6, 'days'),
moment()
],
'Last 30 Days': [
moment().subtract(29, 'days'),
moment()
],
'This Month': [
moment().startOf('month'),
moment().endOf('month')
],
'Last Month': [
moment().subtract(1, 'month').startOf('month'),
moment().subtract(1, 'month').endOf('month')
]
}
/**
* Parse the php plugin configuration and eval the javascript code.
*
* cfg: A json with the php side configuration.
*/
static parseCfg(cfg)
{
for (const prop in cfg) {
let v = cfg[prop];
if (typeof v === 'string' && v.startsWith('js:')) {
cfg[prop] = eval(v.slice(3));
} else if (typeof v === 'object') {
cfg[prop] = _AdminLTE_DateRange.parseCfg(v);
}
}
return cfg;
}
}
</script>
@endpush
@endonce

View File

@@ -0,0 +1,54 @@
@extends('adminlte::components.form.input-group-component')
{{-- Set errors bag internallly --}}
@php($setErrorsBag($errors ?? null))
{{-- Set input group item section --}}
@section('input_group_item')
{{-- Input Color --}}
<input id="{{ $id }}" name="{{ $name }}"
{{ $attributes->merge(['class' => $makeItemClass()]) }}>
@overwrite
{{-- Add plugin initialization and configuration code --}}
@push('js')
<script>
$(() => {
// Create a method to set the addon color.
let setAddonColor = function()
{
let color = $('#{{ $id }}').data('colorpicker').getValue();
$('#{{ $id }}').closest('.input-group')
.find('.input-group-text > i')
.css('color', color);
}
// Init the plugin and register the change event listener.
$('#{{ $id }}').colorpicker( @json($config) )
.on('change', setAddonColor);
// Add support to auto select the previous submitted value in case
// of validation errors.
@if($errors->any() && $enableOldSupport)
let oldColor = @json($getOldValue($errorKey, ""));
$('#{{ $id }}').val(oldColor).change();
@endif
// Set the initial color for the addon.
setAddonColor();
})
</script>
@endpush

View File

@@ -0,0 +1,67 @@
@extends('adminlte::components.form.input-group-component')
{{-- Set errors bag internallly --}}
@php($setErrorsBag($errors ?? null))
{{-- Set input group item section --}}
@section('input_group_item')
{{-- Input Date --}}
<input id="{{ $id }}" name="{{ $name }}" data-target="#{{ $id }}" data-toggle="datetimepicker"
{{ $attributes->merge(['class' => $makeItemClass()]) }}>
@overwrite
{{-- Add plugin initialization and configuration code --}}
@push('js')
<script>
$(() => {
let usrCfg = _AdminLTE_InputDate.parseCfg( @json($config) );
$('#{{ $id }}').datetimepicker(usrCfg);
// Add support to auto display the old submitted value or values in case
// of validation errors.
let value = @json($getOldValue($errorKey, $attributes->get('value')));
$('#{{ $id }}').val(value || "");
})
</script>
@endpush
{{-- Register Javascript utility class for this component --}}
@once
@push('js')
<script>
class _AdminLTE_InputDate {
/**
* Parse the php plugin configuration and eval the javascript code.
*
* cfg: A json with the php side configuration.
*/
static parseCfg(cfg)
{
for (const prop in cfg) {
let v = cfg[prop];
if (typeof v === 'string' && v.startsWith('js:')) {
cfg[prop] = eval(v.slice(3));
} else if (typeof v === 'object') {
cfg[prop] = _AdminLTE_InputDate.parseCfg(v);
}
}
return cfg;
}
}
</script>
@endpush
@endonce

View File

@@ -0,0 +1,78 @@
@extends('adminlte::components.form.input-group-component')
{{-- Set errors bag internallly --}}
@php($setErrorsBag($errors ?? null))
{{-- Set input group item section --}}
@section('input_group_item')
<div class="custom-file">
{{-- Custom file input --}}
<input type="file" id="{{ $id }}" name="{{ $name }}"
{{ $attributes->merge(['class' => $makeItemClass()]) }}>
{{-- Custom file label --}}
<label class="custom-file-label text-truncate" for="{{ $id }}"
@isset($legend) data-browse="{{ $legend }}" @endisset>
{{ $placeholder }}
</label>
</div>
@overwrite
{{-- Add the plugin initialization code --}}
@once
@push('js')
<script>
$(() => {
bsCustomFileInput.init();
})
</script>
@endpush
@endonce
{{-- Setup the height and font size of the plugin when using sm/lg sizes --}}
{{-- NOTE: this may change with newer plugin or Bootstrap versions --}}
@once
@push('css')
<style type="text/css">
{{-- SM size setup --}}
.input-group-sm .custom-file-label:after {
height: 1.8125rem;
line-height: 1.25;
}
.input-group-sm .custom-file-label {
height: calc(1.8125rem + 2px);
line-height: 1.25;
}
.input-group-sm .custom-file {
height: calc(1.8125rem + 2px);
font-size: .875rem;
}
{{-- LG size setup --}}
.input-group-lg .custom-file-label:after {
height: 2.875rem;
line-height: 1.6;
}
.input-group-lg .custom-file-label {
height: calc(2.875rem + 2px);
line-height: 1.6;
}
.input-group-lg .custom-file {
height: calc(2.875rem + 2px);
font-size: 1.25rem;
}
</style>
@endpush
@endonce

View File

@@ -0,0 +1,65 @@
{{-- Setup the input group component structure --}}
<div class="{{ $makeFormGroupClass() }}">
{{-- Input label --}}
@isset($label)
<label for="{{ $id }}" @isset($labelClass) class="{{ $labelClass }}" @endisset>
{{ $label }}
</label>
@endisset
{{-- Input group --}}
<div class="{{ $makeInputGroupClass() }}">
{{-- Input prepend slot --}}
@isset($prependSlot)
<div class="input-group-prepend">{{ $prependSlot }}</div>
@endisset
{{-- Input group item --}}
@yield('input_group_item')
{{-- Input append slot --}}
@isset($appendSlot)
<div class="input-group-append">{{ $appendSlot }}</div>
@endisset
</div>
{{-- Error feedback --}}
@if($isInvalid())
<span class="invalid-feedback d-block" role="alert">
<strong>{{ $errors->first($errorKey) }}</strong>
</span>
@endif
{{-- Bottom slot --}}
@isset($bottomSlot)
{{ $bottomSlot }}
@endisset
</div>
{{-- Extra style customization for invalid input groups --}}
@once
@push('css')
<style type="text/css">
{{-- Highlight invalid input groups with a box-shadow --}}
.adminlte-invalid-igroup {
box-shadow: 0 .25rem 0.5rem rgba(0,0,0,.1);
}
{{-- Setup a red border on elements inside prepend/append add-ons --}}
.adminlte-invalid-igroup > .input-group-prepend > *,
.adminlte-invalid-igroup > .input-group-append > * {
border-color: #dc3545 !important;
}
</style>
@endpush
@endonce

View File

@@ -0,0 +1,136 @@
@extends('adminlte::components.form.input-group-component')
{{-- Set errors bag internallly --}}
@php($setErrorsBag($errors ?? null))
{{-- Set input group item section --}}
@section('input_group_item')
{{-- Input Slider --}}
<input id="{{ $id }}" name="{{ $name }}"
{{ $attributes->merge(['class' => $makeItemClass()]) }}>
@overwrite
{{-- Add plugin initialization and configuration code --}}
@push('js')
<script>
$(() => {
let usrCfg = @json($config);
// Check for disabled attribute (alternative to data-slider-enable).
@if($attributes->has('disabled'))
usrCfg.enabled = false;
@endif
// Check for min, max and step attributes (alternatives to
// data-slider-min, data-slider-max and data-slider-step).
@if($attributes->has('min'))
usrCfg.min = Number( @json($attributes['min']) );
@endif
@if($attributes->has('max'))
usrCfg.max = Number( @json($attributes['max']) );
@endif
@if($attributes->has('step'))
usrCfg.step = Number( @json($attributes['step']) );
@endif
// Check for value attribute (alternative to data-slider-value).
// Also, add support to auto select the previous submitted value.
@if($attributes->has('value') || ($errors->any() && $enableOldSupport))
let value = @json($getOldValue($errorKey, $attributes['value']));
if (value) {
value = value.split(",").map(Number);
usrCfg.value = value.length > 1 ? value : value[0];
}
@endif
// Initialize the plugin.
let slider = $('#{{ $id }}').bootstrapSlider(usrCfg);
// Fix height conflict when orientation is vertical.
let or = slider.bootstrapSlider('getAttribute', 'orientation');
if (or == 'vertical') {
$('#' + usrCfg.id).css('height', '210px');
slider.bootstrapSlider('relayout');
}
})
</script>
@endpush
{{-- Add CSS workarounds for the plugin --}}
{{-- NOTE: this may change with newer plugin versions --}}
@push('css')
<style type="text/css">
{{-- Setup plugin color --}}
@isset($color)
#{{ $config['id'] }} .slider-handle {
background: {{ $color }};
}
#{{ $config['id'] }} .slider-selection {
background: {{ $color }};
opacity: 0.5;
}
#{{ $config['id'] }} .slider-tick.in-selection {
background: {{ $color }};
opacity: 0.9;
}
@endisset
{{-- Set flex property when using addons slots --}}
@if(isset($appendSlot) || isset($prependSlot))
#{{ $config['id'] }} {
flex: 1 1 0;
align-self: center;
@isset($appendSlot) margin-right: 5px; @endisset
@isset($prependSlot) margin-left: 5px; @endisset
}
@endif
</style>
@endpush
{{-- Setup custom invalid style --}}
{{-- NOTE: this may change with newer plugin versions --}}
@once
@push('css')
<style type="text/css">
.adminlte-invalid-islgroup .slider-track,
.adminlte-invalid-islgroup > .input-group-prepend > *,
.adminlte-invalid-islgroup > .input-group-append > * {
box-shadow: 0 .25rem 0.5rem rgba(255,0,0,.25);
}
.adminlte-invalid-islgroup .slider-vertical {
margin-bottom: 1rem;
}
</style>
@endpush
@endonce

View File

@@ -0,0 +1,74 @@
@extends('adminlte::components.form.input-group-component')
{{-- Set errors bag internallly --}}
@php($setErrorsBag($errors ?? null))
{{-- Set input group item section --}}
@section('input_group_item')
{{-- Input Switch --}}
<input type="checkbox" id="{{ $id }}" name="{{ $name }}" value="true"
{{ $attributes->merge(['class' => $makeItemClass()]) }}>
@overwrite
{{-- Add plugin initialization and configuration code --}}
@push('js')
<script>
$(() => {
$('#{{ $id }}').bootstrapSwitch( @json($config) );
// Add support to auto select the previous submitted value in case of
// validation errors.
@if($errors->any() && $enableOldSupport)
let oldState = @json((bool)$getOldValue($errorKey));
$('#{{ $id }}').bootstrapSwitch('state', oldState);
@endif
})
</script>
@endpush
{{-- Setup the height/font of the plugin when using sm/lg sizes --}}
{{-- NOTE: this may change with newer plugin versions --}}
@once
@push('css')
<style type="text/css">
{{-- MD (default) size setup --}}
.input-group .bootstrap-switch-handle-on,
.input-group .bootstrap-switch-handle-off {
height: 2.25rem !important;
}
{{-- LG size setup --}}
.input-group-lg .bootstrap-switch-handle-on,
.input-group-lg .bootstrap-switch-handle-off {
height: 2.875rem !important;
font-size: 1.25rem !important;
}
{{-- SM size setup --}}
.input-group-sm .bootstrap-switch-handle-on,
.input-group-sm .bootstrap-switch-handle-off {
height: 1.8125rem !important;
font-size: .875rem !important;
}
{{-- Custom invalid style setup --}}
.adminlte-invalid-iswgroup > .bootstrap-switch-wrapper,
.adminlte-invalid-iswgroup > .input-group-prepend > *,
.adminlte-invalid-iswgroup > .input-group-append > * {
box-shadow: 0 .25rem 0.5rem rgba(255,0,0,.25);
}
</style>
@endpush
@endonce

View File

@@ -0,0 +1,16 @@
@extends('adminlte::components.form.input-group-component')
{{-- Set errors bag internallly --}}
@php($setErrorsBag($errors ?? null))
{{-- Set input group item section --}}
@section('input_group_item')
{{-- Input --}}
<input id="{{ $id }}" name="{{ $name }}"
value="{{ $getOldValue($errorKey, $attributes->get('value')) }}"
{{ $attributes->merge(['class' => $makeItemClass()]) }}>
@overwrite

View File

@@ -0,0 +1,26 @@
{{-- Empty option --}}
@if(isset($emptyOption))
<option value>
{{ is_string($emptyOption) ? $emptyOption : '' }}
</option>
{{-- Placeholder option --}}
@elseif(isset($placeholder))
<option class="d-none" value>
{{ is_string($placeholder) ? $placeholder : '' }}
</option>
@endif
{{-- Other options --}}
@foreach($options as $key => $value)
<option value="{{ $key }}"
@if($isSelected($key)) selected @endif
@if($isDisabled($key)) disabled @endif>
{{ $value }}
</option>
@endforeach

View File

@@ -0,0 +1,53 @@
@extends('adminlte::components.form.input-group-component')
{{-- Set errors bag internallly --}}
@php($setErrorsBag($errors ?? null))
{{-- Set input group item section --}}
@section('input_group_item')
{{-- Select --}}
<select id="{{ $id }}" name="{{ $name }}"
{{ $attributes->merge(['class' => $makeItemClass()]) }}>
{{ $slot }}
</select>
@overwrite
{{-- Add plugin initialization and configuration code --}}
@push('js')
<script>
$(() => {
$('#{{ $id }}').selectpicker( @json($config) );
// Add support to auto select old submitted values in case of
// validation errors.
@if($errors->any() && $enableOldSupport)
let oldOptions = @json(collect($getOldValue($errorKey)));
$('#{{ $id }}').selectpicker('val', oldOptions);
@endif
})
</script>
@endpush
{{-- Set of CSS workarounds for the plugin --}}
{{-- NOTE: this may change with newer plugin versions --}}
@once
@push('css')
<style type="text/css">
{{-- Fix the invalid visual style --}}
.bootstrap-select.is-invalid {
padding-right: 0px !important;
}
</style>
@endpush
@endonce

View File

@@ -0,0 +1,38 @@
@extends('adminlte::components.form.input-group-component')
{{-- Set errors bag internallly --}}
@php($setErrorsBag($errors ?? null))
{{-- Set input group item section --}}
@section('input_group_item')
{{-- Select --}}
<select id="{{ $id }}" name="{{ $name }}"
{{ $attributes->merge(['class' => $makeItemClass()]) }}>
{{ $slot }}
</select>
@overwrite
{{-- Support to auto select the old submitted values --}}
@if($errors->any() && $enableOldSupport)
@push('js')
<script>
$(() => {
let oldOptions = @json(collect($getOldValue($errorKey)));
$('#{{ $id }} option').each(function()
{
let value = $(this).val() || $(this).text();
$(this).prop('selected', oldOptions.includes(value));
});
});
</script>
@endpush
@endif

View File

@@ -0,0 +1,106 @@
@extends('adminlte::components.form.input-group-component')
{{-- Set errors bag internallly --}}
@php($setErrorsBag($errors ?? null))
{{-- Set input group item section --}}
@section('input_group_item')
{{-- Select --}}
<select id="{{ $id }}" name="{{ $name }}"
{{ $attributes->merge(['class' => $makeItemClass()]) }}>
{{ $slot }}
</select>
@overwrite
{{-- Add plugin initialization and configuration code --}}
@push('js')
<script>
$(() => {
$('#{{ $id }}').select2( @json($config) );
// Add support to auto select old submitted values in case of
// validation errors.
@if($errors->any() && $enableOldSupport)
let oldOptions = @json(collect($getOldValue($errorKey)));
$('#{{ $id }} option').each(function()
{
let value = $(this).val() || $(this).text();
$(this).prop('selected', oldOptions.includes(value));
});
$('#{{ $id }}').trigger('change');
@endif
})
</script>
@endpush
{{-- CSS workarounds for the Select2 plugin --}}
{{-- NOTE: this may change with newer plugin versions --}}
@once
@push('css')
<style type="text/css">
{{-- SM size setup --}}
.input-group-sm .select2-selection--single {
height: calc(1.8125rem + 2px) !important
}
.input-group-sm .select2-selection--single .select2-selection__rendered,
.input-group-sm .select2-selection--single .select2-selection__placeholder {
font-size: .875rem !important;
line-height: 2.125;
}
.input-group-sm .select2-selection--multiple {
min-height: calc(1.8125rem + 2px) !important
}
.input-group-sm .select2-selection--multiple .select2-selection__rendered {
font-size: .875rem !important;
line-height: normal;
}
{{-- LG size setup --}}
.input-group-lg .select2-selection--single {
height: calc(2.875rem + 2px) !important;
}
.input-group-lg .select2-selection--single .select2-selection__rendered,
.input-group-lg .select2-selection--single .select2-selection__placeholder {
font-size: 1.25rem !important;
line-height: 2.25;
}
.input-group-lg .select2-selection--multiple {
min-height: calc(2.875rem + 2px) !important
}
.input-group-lg .select2-selection--multiple .select2-selection__rendered {
font-size: 1.25rem !important;
line-height: 1.7;
}
{{-- Enhance the plugin to support readonly attribute --}}
select[readonly].select2-hidden-accessible + .select2-container {
pointer-events: none;
touch-action: none;
}
select[readonly].select2-hidden-accessible + .select2-container .select2-selection {
background: #e9ecef;
box-shadow: none;
}
select[readonly].select2-hidden-accessible + .select2-container .select2-search__field {
display: none;
}
</style>
@endpush
@endonce

View File

@@ -0,0 +1,74 @@
@extends('adminlte::components.form.input-group-component')
{{-- Set errors bag internallly --}}
@php($setErrorsBag($errors ?? null))
{{-- Set input group item section --}}
@section('input_group_item')
{{-- Summernote Textarea --}}
<textarea id="{{ $id }}" name="{{ $name }}"
{{ $attributes->merge(['class' => $makeItemClass()]) }}
>{{ $getOldValue($errorKey, $slot) }}</textarea>
@overwrite
{{-- Add plugin initialization and configuration code --}}
@push('js')
<script>
$(() => {
let usrCfg = @json($config);
// Check for placeholder attribute.
@isset($attributes['placeholder'])
usrCfg['placeholder'] = "{{ $attributes['placeholder'] }}";
@endisset
// Initialize the plugin.
$('#{{ $id }}').summernote(usrCfg);
// Check for disabled attribute.
@isset($attributes['disabled'])
$('#{{ $id }}').summernote('disable');
@endisset
})
</script>
@endpush
{{-- Setup the font size of the plugin when using sm/lg sizes --}}
{{-- NOTE: this may change with newer plugin versions --}}
@once
@push('css')
<style type="text/css">
{{-- SM size setup --}}
.input-group-sm .note-editor {
font-size: .875rem;
line-height: 1;
}
{{-- LG size setup --}}
.input-group-lg .note-editor {
font-size: 1.25rem;
line-height: 1.5;
}
{{-- Setup custom invalid style --}}
.adminlte-invalid-itegroup .note-editor {
box-shadow: 0 .25rem 0.5rem rgba(0,0,0,.25);
border-color: #dc3545 !important;
}
</style>
@endpush
@endonce

View File

@@ -0,0 +1,16 @@
@extends('adminlte::components.form.input-group-component')
{{-- Set errors bag internallly --}}
@php($setErrorsBag($errors ?? null))
{{-- Set input group item section --}}
@section('input_group_item')
{{-- Textarea --}}
<textarea id="{{ $id }}" name="{{ $name }}"
{{ $attributes->merge(['class' => $makeItemClass()]) }}
>{{ $getOldValue($errorKey, $slot) }}</textarea>
@overwrite

View File

@@ -0,0 +1,65 @@
{{-- Navbar darkmode widget --}}
<li class="nav-item adminlte-darkmode-widget">
<a class="nav-link" href="#" role="button">
<i class="{{ $makeIconClass() }}"></i>
</a>
</li>
{{-- Add Javascript listener for the click event --}}
@once
@push('js')
<script>
$(() => {
const body = document.querySelector('body');
const widget = document.querySelector('li.adminlte-darkmode-widget');
const widgetIcon = widget.querySelector('i');
// Get the set of classes to be toggled on the widget icon.
const iconClasses = [
...@json($makeIconEnabledClass()),
...@json($makeIconDisabledClass())
];
// Add 'click' event listener for the darkmode widget.
widget.addEventListener('click', () => {
// Toggle dark-mode class on the body tag.
body.classList.toggle('dark-mode');
// Toggle the classes on the widget icon.
iconClasses.forEach((c) => widgetIcon.classList.toggle(c));
// Notify the server. The server will be in charge to persist
// the dark mode configuration over multiple request.
const fetchCfg = {
headers: {'X-CSRF-TOKEN': '{{ csrf_token() }}'},
method: 'POST',
};
fetch(
"{{ route('adminlte.darkmode.toggle') }}",
fetchCfg
)
.catch((error) => {
console.log(
'Failed to notify server that dark mode was toggled',
error
);
});
});
})
</script>
@endpush
@endonce

View File

@@ -0,0 +1,154 @@
{{-- Navbar notification --}}
<li class="{{ $makeListItemClass() }}" id="{{ $id }}">
{{-- Link --}}
<a @if($enableDropdownMode) href="" @endif {{ $attributes->merge($makeAnchorDefaultAttrs()) }}>
{{-- Icon --}}
<i class="{{ $makeIconClass() }}"></i>
{{-- Badge --}}
<span class="{{ $makeBadgeClass() }}">{{ $badgeLabel }}</span>
</a>
{{-- Dropdown Menu --}}
@if($enableDropdownMode)
<div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
{{-- Custom dropdown content provided by external source --}}
<div class="adminlte-dropdown-content"></div>
{{-- Dropdown divider --}}
<div class="dropdown-divider"></div>
{{-- Dropdown footer with link --}}
<a href="{{ $attributes->get('href') }}" class="dropdown-item dropdown-footer">
@isset($dropdownFooterLabel)
{{ $dropdownFooterLabel }}
@else
<i class="fas fa-lg fa-search-plus"></i>
@endisset
</a>
</div>
@endif
</li>
{{-- If required, update the notification periodically --}}
@if (! is_null($makeUpdateUrl()) && $makeUpdatePeriod() > 0)
@push('js')
<script>
$(() => {
// Method to get new notification data from the configured url.
let updateNotification = (nLink) =>
{
// Make an ajax call to the configured url. The response should be
// an object with the new data. The supported properties are:
// 'label', 'label_color', 'icon_color' and 'dropdown'.
$.ajax({
url: "{{ $makeUpdateUrl() }}"
})
.done((data) => {
nLink.update(data);
})
.fail(function(jqXHR, textStatus, errorThrown) {
console.log(jqXHR, textStatus, errorThrown);
});
};
// First load of the notification data.
let nLink = new _AdminLTE_NavbarNotification("{{ $id }}");
updateNotification(nLink);
// Periodically update the notification.
setInterval(updateNotification, {{ $makeUpdatePeriod() }}, nLink);
})
</script>
@endpush
@endif
{{-- Register Javascript utility class for this component --}}
@once
@push('js')
<script>
class _AdminLTE_NavbarNotification {
/**
* Constructor.
*
* target: The id of the target notification link.
*/
constructor(target)
{
this.target = target;
}
/**
* Update the notification link.
*
* data: An object with the new data.
*/
update(data)
{
// Check if target and data exists.
let t = $(`li#${this.target}`);
if (t.length <= 0 || ! data) {
return;
}
let badge = t.find(".navbar-badge");
let icon = t.find(".nav-link > i");
let dropdown = t.find(".adminlte-dropdown-content");
// Update the badge label.
if (data.label && data.label > 0) {
badge.html(data.label);
} else {
badge.empty();
}
// Update the badge color.
if (data.label_color) {
badge.removeClass((idx, classes) => {
return (classes.match(/(^|\s)badge-\S+/g) || []).join(' ');
}).addClass(`badge-${data.label_color} badge-pill`);
}
// Update the icon color.
if (data.icon_color) {
icon.removeClass((idx, classes) => {
return (classes.match(/(^|\s)text-\S+/g) || []).join(' ');
}).addClass(`text-${data.icon_color}`);
}
// Update the dropdown content.
if (data.dropdown && dropdown.length > 0) {
dropdown.html(data.dropdown);
}
}
}
</script>
@endpush
@endonce

View File

@@ -0,0 +1,61 @@
{{-- Table --}}
<div class="table-responsive">
<table id="{{ $id }}" style="width:100%" {{ $attributes->merge(['class' => $makeTableClass()]) }}>
{{-- Table head --}}
<thead @isset($headTheme) class="thead-{{ $headTheme }}" @endisset>
<tr>
@foreach($heads as $th)
<th @isset($th['classes']) class="{{ $th['classes'] }}" @endisset
@isset($th['width']) style="width:{{ $th['width'] }}%" @endisset
@isset($th['no-export']) dt-no-export @endisset>
{{ is_array($th) ? ($th['label'] ?? '') : $th }}
</th>
@endforeach
</tr>
</thead>
{{-- Table body --}}
<tbody>{{ $slot }}</tbody>
{{-- Table footer --}}
@isset($withFooter)
<tfoot @isset($footerTheme) class="thead-{{ $footerTheme }}" @endisset>
<tr>
@foreach($heads as $th)
<th>{{ is_array($th) ? ($th['label'] ?? '') : $th }}</th>
@endforeach
</tr>
</tfoot>
@endisset
</table>
</div>
{{-- Add plugin initialization and configuration code --}}
@push('js')
<script>
$(() => {
$('#{{ $id }}').DataTable( @json($config) );
})
</script>
@endpush
{{-- Add CSS styling --}}
@isset($beautify)
@push('css')
<style type="text/css">
#{{ $id }} tr td, #{{ $id }} tr th {
vertical-align: middle;
text-align: center;
}
</style>
@endpush
@endisset

View File

@@ -0,0 +1,36 @@
<div {{ $attributes->merge(['class' => $makeModalClass(), 'id' => $id]) }}
@isset($staticBackdrop) data-backdrop="static" data-keyboard="false" @endisset>
<div class="{{ $makeModalDialogClass() }}">
<div class="modal-content">
{{--Modal header --}}
<div class="{{ $makeModalHeaderClass() }}">
<h4 class="modal-title">
@isset($icon)<i class="{{ $icon }} mr-2"></i>@endisset
@isset($title){{ $title }}@endisset
</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
{{-- Modal body --}}
@if(! $slot->isEmpty())
<div class="modal-body">{{ $slot }}</div>
@endif
{{-- Modal footer --}}
<div class="modal-footer">
@isset($footerSlot)
{{ $footerSlot }}
@else
<x-adminlte-button class="{{ $makeCloseButtonClass }}"
data-dismiss="modal" label="Close"/>
@endisset
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,26 @@
<div {{ $attributes->merge(['class' => $makeAlertClass()]) }}>
{{-- Dismiss button --}}
@isset($dismissable)
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">
&times;
</button>
@endisset
{{-- Alert header --}}
@if(! empty($title) || ! empty($icon))
<h5>
@if(! empty($icon))
<i class="icon {{ $icon }}"></i>
@endif
@if(! empty($title))
{{ $title }}
@endif
</h5>
@endif
{{-- Alert content --}}
{{ $slot }}
</div>

View File

@@ -0,0 +1,14 @@
<div {{ $attributes->merge(['class' => $makeCalloutClass()]) }}>
{{-- Callout title --}}
@if(! empty($title) || ! empty($icon))
<h5 @isset($titleClass) class="{{ $titleClass }}" @endisset>
@isset($icon) <i class="{{ $icon }} mr-2"></i> @endisset
@isset($title) {{ $title }} @endisset
</h5>
@endif
{{-- Callout content --}}
{{ $slot }}
</div>

View File

@@ -0,0 +1,62 @@
<div {{ $attributes->merge(['class' => $makeCardClass()]) }}>
{{-- Card header --}}
@if(! $isCardHeaderEmpty(isset($toolsSlot)))
<div class="{{ $makeCardHeaderClass() }}">
{{-- Title --}}
<h3 class="{{ $makeCardTitleClass() }}">
@isset($icon)<i class="{{ $icon }} mr-1"></i>@endisset
@isset($title){{ $title }}@endisset
</h3>
{{-- Tools --}}
<div class="card-tools">
{{-- Extra tools slot --}}
@isset($toolsSlot)
{{ $toolsSlot }}
@endisset
{{-- Default tools --}}
@isset($maximizable)
<x-adminlte-button theme="tool" data-card-widget="maximize" icon="fas fa-lg fa-expand"/>
@endisset
@if($collapsible === 'collapsed')
<x-adminlte-button theme="tool" data-card-widget="collapse" icon="fas fa-lg fa-plus"/>
@elseif(isset($collapsible))
<x-adminlte-button theme="tool" data-card-widget="collapse" icon="fas fa-lg fa-minus"/>
@endif
@isset($removable)
<x-adminlte-button theme="tool" data-card-widget="remove" icon="fas fa-lg fa-times"/>
@endisset
</div>
</div>
@endif
{{-- Card body --}}
@if(! $slot->isEmpty())
<div class="{{ $makeCardBodyClass() }}">
{{ $slot }}
</div>
@endif
{{-- Card footer --}}
@isset($footerSlot)
<div class="{{ $makeCardFooterClass() }}">
{{ $footerSlot }}
</div>
@endisset
{{-- Card overlay --}}
@if($disabled)
<div class="overlay">
<i class="fas fa-2x fa-ban text-gray"></i>
</div>
@endif
</div>

View File

@@ -0,0 +1,102 @@
<div {{ $attributes->merge(['class' => $makeBoxClass()]) }}>
{{-- Box icon --}}
@isset($icon)
<span class="{{ $makeIconClass() }}">
<i class="{{ $icon }}"></i>
</span>
@endisset
{{-- Box content --}}
<div class="info-box-content">
{{-- Box title --}}
@isset($title)
<span class="info-box-text">{{ $title }}</span>
@endisset
{{-- Box short text --}}
@isset($text)
<span class="info-box-number">{{ $text }}</span>
@endisset
{{-- Box progress bar --}}
@if(isset($progress) && isset($attributes['id']))
<x-adminlte-progress value="{{ $progress }}" theme="{{ $progressTheme }}"
id="progress-{{ $attributes['id'] }}"/>
@elseif(isset($progress))
<x-adminlte-progress value="{{ $progress }}" theme="{{ $progressTheme }}"/>
@endif
{{-- Box long description --}}
@isset($description)
<span class="progress-description">{{ $description }}</span>
@endisset
</div>
</div>
{{-- Register Javascript utility class for this component --}}
@once
@push('js')
<script>
class _AdminLTE_InfoBox {
/**
* Constructor.
*
* target: The id of the target info box.
*/
constructor(target)
{
this.target = target;
}
/**
* Update the info box.
*
* data: An object with the new data.
*/
update(data)
{
// Check if target and data exists.
let t = $(`#${this.target}`);
if (t.length <= 0 || ! data) {
return;
}
// Update available data.
if (data.title) {
t.find('.info-box-text').html(data.title);
}
if (data.text) {
t.find('.info-box-number').html(data.text);
}
if (data.icon) {
t.find('.info-box-icon i').attr('class', data.icon);
}
if (data.description) {
t.find('.progress-description').html(data.description);
}
// Update progress bar.
if (data.progress) {
let pBar = new _AdminLTE_Progress(`progress-${this.target}`);
pBar.setValue(data.progress);
}
}
}
</script>
@endpush
@endonce

View File

@@ -0,0 +1,32 @@
<div {{ $attributes->merge(['class' => "col-{$size}"]) }}>
<div class="description-block">
{{-- Icon --}}
@isset($icon)
<i class="{{ $icon }}"></i>
@endisset
{{-- Header --}}
@isset($title)
<h5 class="description-header">
@if(! empty($url))
<a href="{{ $url }}">{{ $title }}</a>
@else
{{ $title }}
@endif
</h5>
@endisset
{{-- Text --}}
@isset($text)
<p class="description-text">
<span class="{{ $makeTextWrapperClass() }}">
{{ $text }}
</span>
</p>
@endisset
</div>
</div>

View File

@@ -0,0 +1,28 @@
<div {{ $attributes->merge(['class' => "p-0 col-{$size}"]) }}>
<span class="nav-link">
{{-- Icon --}}
@isset($icon)
<i class="{{ $icon }}"></i>
@endisset
{{-- Header --}}
@isset($title)
@if(! empty($url))
<a href="{{ $url }}">{{ $title }}</a>
@else
{{ $title }}
@endif
@endisset
{{-- Text --}}
@isset($text)
<span class="{{ $makeTextWrapperClass() }}">
{{ $text }}
</span>
@endisset
</span>
</div>

View File

@@ -0,0 +1,40 @@
<div {{ $attributes->merge(['class' => $makeCardClass()]) }}>
{{-- Profile header --}}
<div class="{{ $makeHeaderClass() }}" style="{{ $makeHeaderStyle() }}">
{{-- User image --}}
<div class="widget-user-image">
@if(isset($img))
<img class="img-circle elevation-2" src="{{ $img }}" alt="User avatar: {{ $name }}">
@elseif($layoutType === 'modern')
<div class="img-circle elevation-2 d-flex bg-dark" style="width:90px;height:90px;">
<i class="fas fa-3x fa-user text-silver m-auto"></i>
</div>
@elseif($layoutType === 'classic')
<div class="img-circle elevation-2 float-left d-flex bg-dark" style="width:65px;height:65px;">
<i class="fas fa-2x fa-user text-silver m-auto"></i>
</div>
@endisset
</div>
{{-- User name --}}
@isset($name)
<h3 class="widget-user-username mb-0">{{ $name }}</h3>
@endisset
{{-- User description --}}
@isset($desc)
<h5 class="widget-user-desc">{{ $desc }}</h5>
@endisset
</div>
{{-- Profile footer / Profile Items --}}
@if(! $slot->isEmpty())
<div class="{{ $makeFooterClass() }}">
<div class="row">{{ $slot }}</div>
</div>
@endif
</div>

View File

@@ -0,0 +1,85 @@
<div {{ $attributes->merge(['class' => $makeProgressClass()]) }}>
{{-- Progress bar --}}
<div class="{{ $makeProgressBarClass() }}" role="progressbar"
aria-valuenow="{{ $value }}" aria-valuemin="0" aria-valuemax="100"
style="{{ $makeProgressBarStyle() }}">
{{-- Progress bar label --}}
@isset($withLabel)
{{ $value }}%
@else
<span class="sr-only">{{ $value }}% Progress</span>
@endisset
</div>
</div>
{{-- Register Javascript utility class for this component --}}
@once
@push('js')
<script>
class _AdminLTE_Progress {
/**
* Constructor.
*
* target: The id of the target progress bar.
*/
constructor(target)
{
this.target = target;
}
/**
* Get the current progress bar value.
*/
getValue()
{
// Check if target exists.
let t = $(`#${this.target}`);
if (t.length <= 0) {
return;
}
// Return the progress bar current value (casted to number).
return +(t.find('.progress-bar').attr('aria-valuenow'));
}
/**
* Set the new progress bar value.
*/
setValue(value)
{
// Check if target exists.
let t = $(`#${this.target}`);
if (t.length <= 0) {
return;
}
// Update progress bar.
value = +value;
t.find('.progress-bar').css('width', value + '%')
.attr('aria-valuenow', value);
if (t.find('span.sr-only').length > 0) {
t.find('span.sr-only').text(value + '% Progress');
} else {
t.find('.progress-bar').text(value + '%');
}
}
}
</script>
@endpush
@endonce

View File

@@ -0,0 +1,113 @@
<div {{ $attributes->merge(['class' => $makeBoxClass()]) }}>
{{-- Box title and description --}}
<div class="inner">
@isset($title)
<h3>{{ $title }}</h3>
@endisset
@isset($text)
<h5>{{ $text }}</h5>
@endisset
</div>
{{-- Box icon --}}
@isset($icon)
<div class="icon">
<i class="{{ $icon }}"></i>
</div>
@endisset
{{-- Box link --}}
@isset($url)
<a href="{{ $url }}" class="small-box-footer">
@if(! empty($urlText))
{{ $urlText }}
@endif
<i class="fas fa-lg fa-arrow-circle-right"></i>
</a>
@endisset
{{-- Box overlay --}}
<div class="{{ $makeOverlayClass() }}">
<i class="fas fa-2x fa-spin fa-sync-alt text-gray"></i>
</div>
</div>
{{-- Register Javascript utility class for this component --}}
@once
@push('js')
<script>
class _AdminLTE_SmallBox {
/**
* Constructor.
*
* target: The id of the target small box.
*/
constructor(target)
{
this.target = target;
}
/**
* Update the small box.
*
* data: An object with the new data.
*/
update(data)
{
// Check if target and data exists.
let t = $(`#${this.target}`);
if (t.length <= 0 || ! data) {
return;
}
// Update available data.
if (data.title) {
t.find('.inner h3').html(data.title);
}
if (data.text) {
t.find('.inner h5').html(data.text);
}
if (data.icon) {
t.find('.icon i').attr('class', data.icon);
}
if (data.url) {
t.find('.small-box-footer').attr('href', data.url);
}
}
/**
* Toggle the loading animation of the small box.
*/
toggleLoading()
{
// Check if target exists.
let t = $(`#${this.target}`);
if (t.length <= 0) {
return;
}
// Toggle the loading overlay.
t.find('.overlay').toggleClass('d-none');
}
}
</script>
@endpush
@endonce