Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions Core/Assets/CSS/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,28 @@ select[required].form-select.select2 + .select2-container--bootstrap-5 .select2-
box-shadow: 0 0 0 0.2rem rgba(253, 253, 150, 0.4) !important;
}

select[required][data-campo-requerido-no-seleccionado].form-select.select2 + .select2-container--bootstrap-5 .select2-selection {
box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.4) !important;
border-color: #dc3545 !important;
}

.marquee-container {
overflow: hidden;
white-space: nowrap;
position: relative;
}

.marquee-text {
display: inline-block;
padding-left: 100%;
animation: cartel-rotativo 5s linear infinite;
}

@keyframes cartel-rotativo {
0% { transform: translateX(0); }
100% { transform: translateX(-100%); }
}

/* pace customizations */
.pace {
-webkit-pointer-events: none;
Expand Down
15 changes: 15 additions & 0 deletions Core/Lib/Widget/WidgetSelect.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,11 @@ protected function assets(): void
*/
protected function inputHtml($type = 'text', $extraClass = '')
{
$campoRequeridoNoSeleccionado = false;
if($this->required && empty($this->value)){
$campoRequeridoNoSeleccionado = true;
}

$class = $this->combineClasses($this->css('form-select select2'), $this->class, $extraClass);

if ($this->parent) {
Expand Down Expand Up @@ -293,6 +298,7 @@ protected function inputHtml($type = 'text', $extraClass = '')
. ' data-fieldtitle="' . $this->fieldtitle . '"'
. ' data-fieldfilter="' . $this->fieldfilter . '"'
. ' data-limit="' . $this->limit . '"'
. ($campoRequeridoNoSeleccionado ? ' data-campo-requerido-no-seleccionado="true"' : '')
. '>';

$found = false;
Expand All @@ -317,6 +323,15 @@ protected function inputHtml($type = 'text', $extraClass = '')
}

$html .= '</select>';

if($campoRequeridoNoSeleccionado){
$html .= '<div class="form-text marquee-container">
<span class="marquee-text text-danger fw-bold text-uppercase">
' . Tools::trans("required") . '
</span>
</div';
}

return $html;
}

Expand Down
Loading