diff --git a/config/asset_compress.ini b/config/asset_compress.ini index df092ae..a54b68e 100644 --- a/config/asset_compress.ini +++ b/config/asset_compress.ini @@ -1,5 +1,4 @@ [crudview.css] -files[]=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.13/css/all.min.css files[]=https://cdn.jsdelivr.net/npm/bootstrap@^4.5/dist/css/bootstrap.min.css files[]=https://cdn.jsdelivr.net/npm/flatpickr@4.6/dist/flatpickr.min.css files[]=https://cdn.jsdelivr.net/npm/select2@4.0/dist/css/select2.min.css diff --git a/src/View/Widget/DateTimeWidget.php b/src/View/Widget/DateTimeWidget.php index 3a58e96..37ffd18 100644 --- a/src/View/Widget/DateTimeWidget.php +++ b/src/View/Widget/DateTimeWidget.php @@ -15,10 +15,33 @@ class DateTimeWidget extends \BootstrapUI\View\Widget\DateTimeWidget protected $defaultTemplate = '
' . '{{input}}' . '
' - . '' - . '' + . '' + . '' . '
' . '
'; + + /** + * @var string + */ + protected $calendarIcon = '' + . '' + . ''; + + /** + * @var string + */ + protected $clockIcon = '' + . '' + . '' + . ''; + + /** + * @var string + */ + protected $clearIcon = '' + . '' + . '' + . ''; // phpcs:enable /** @@ -85,13 +108,13 @@ public function render(array $data, ContextInterface $context): string $datetimePicker += ['data-enable-seconds' => 'true']; } - $clearIconClass = 'fas fa-times'; - $toggleIconClass = 'fas fa-calendar-alt'; + $clearIcon = $this->clearIcon; + $toggleIcon = $this->calendarIcon; if (isset($datetimePicker['iconClass'])) { - $toggleIconClass = $datetimePicker['iconClass']; + $toggleIcon = $datetimePicker['iconClass']; unset($datetimePicker['iconClass']); } elseif ($data['type'] === 'time') { - $toggleIconClass = 'fas fa-clock'; + $toggleIcon = $this->clockIcon; } if ($this->_templates->get('datetimePicker') === null) { @@ -135,12 +158,12 @@ public function render(array $data, ContextInterface $context): string /** @psalm-suppress PossiblyInvalidArrayOffset */ return $this->_templates->format('datetimePicker', [ 'input' => $input, - 'toggleIconClass' => $toggleIconClass, - 'clearIconClass' => $clearIconClass, + 'toggleIcon' => $toggleIcon, + 'clearIcon' => $clearIcon, 'templateVars' => $data['templateVars'], 'attrs' => $this->_templates->formatAttributes( $datetimePicker, - ['toggleIconClass', 'clearIconClass'] + ['toggleIcon', 'clearIcon'] ), ]); }