This commit is contained in:
Mark Gregory
2026-06-15 17:55:36 +01:00
parent 578a977c59
commit 0a9746fa77
25 changed files with 844 additions and 106 deletions
@@ -1,7 +1,8 @@
@once
<style>
.select2-container { width: 100% !important; }
.select2-container--default .select2-selection--single {
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
min-height: 2.75rem;
border-radius: 0.75rem;
border-color: rgb(63 63 70);
@@ -10,6 +11,21 @@
display: flex;
align-items: center;
}
.select2-container--default .select2-selection--multiple {
align-items: flex-start;
padding: 0.25rem 0.5rem;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
border-color: rgb(59 130 246);
background: rgb(30 64 175);
color: rgb(255 255 255);
border-radius: 9999px;
padding: 0.15rem 0.5rem;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
color: rgb(255 255 255);
margin-right: 0.35rem;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
color: rgb(244 244 245);
line-height: 2.75rem;
@@ -76,10 +92,12 @@
select.select2('destroy');
}
const isMultiple = this.hasAttribute('multiple');
select.select2({
width: '100%',
placeholder: this.querySelector('option[value=""]')?.textContent || 'Select option',
allowClear: true
placeholder: this.querySelector('option[value=""]')?.textContent || (isMultiple ? 'Select options' : 'Select option'),
allowClear: !isMultiple
});
select.off('change.helpdesk').on('change.helpdesk', function () {