select-inputs

phone-input   

please enter a valid phone number This is a hint text to help user.
Copy
Edit
<!-- components/inputs/phone-input.html --> <div class="form-group general-phone-group" id="input-name-group"> <label for="input-name" class="control-label"> Phone Input <i class="icomoon-help-circle ml-2 theme-tooltip" data-toggle="popover" data-placement="right" title="This is a tooltip" data-content="And here's some amazing content. It's very engaging. Top?"></i> </label> <input type="tel" class="general-phone-input" name="input-name" id="input-name" placeholder="olivia@untitledui.com" value="+20"> <span class="help-block"> <i class="icomoon-alert-circle mr-2"></i> please enter a valid phone number </span> <span class="text-muted">This is a hint text to help user.</span> </div>
Copy
Copy
Edit
/* scss/inputs/_phone-input.scss */ .intl-tel-input { display: flex; color: $gray-700; border: solid 1px $gray-300; border-radius: 8px; height: 44px; box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05); margin: 0; @extend .text-md; @extend .weight-r; direction: ltr; &:focus-within { box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05), 0px 0px 0px 4px #DEEFFC; border-color: $primary-300; } .flag-container { position: static; .selected-flag { position: static; display: flex; align-items: center; width: auto; padding: 0 12px 0 14px; transition: .3s; .iti-flag { position: static; flex-shrink: 0; margin-right: 4px; } .iti-arrow { position: static; border: 0; width: auto; height: 20px; line-height: 20px; &::before { content: "\e980"; font-family: 'icomoonapp'; color: $gray-500; font-size: 20px; } } } } input { border: 0; background-color: transparent; padding: 0 !important; height: 44px; outline: none; width: 100%; &::placeholder { color: $gray-500; } } .country-list { width: 100%; border: 1px solid $gray-200; box-shadow: 0px 12px 16px -4px rgba(16, 24, 40, 0.1), 0px 4px 6px -2px rgba(16, 24, 40, 0.05); top: calc(100% + 8px); border-radius: 8px; &::-webkit-scrollbar { width: 8px; border-radius: 8px; } &::-webkit-scrollbar-thumb { background-color: #d2cfe3; border-radius: 8px; } .country { padding: 10px 14px; position: relative; &:hover { background-color: $primary-25; } &.active { background-color: $primary-25; &::after { content: "\e97d"; font-family: 'icomoonapp'; color: $primary-600; font-size: 20px; position: absolute; top: 50%; right: 14px; transform: translateY(-50%); font-size: 20px; } } .flag-box { margin-right: 8px; } .country-name { @extend .text-md; } } } }
Copy
Edit
/* js/phone-input.js */ $('.general-phone-input').intlTelInput({ utilsScript: "atomic-core/js/utils.js" }) $('.general-phone-input').on('keydown', function() { $(this).parents('.general-phone-group').removeClass('has-error') }) $('.general-phone-input').on('focusout', function() { if(!$(this).intlTelInput("isValidNumber")) { $(this).parents('.general-phone-group').addClass('has-error') } })

select-input   

This is an error message. This is a hint text to help user.
Copy
Edit
<!-- components/inputs/select-input.html --> <div class="form-group" id="input-name-group"> <label for="input-name" class="control-label"> Select Input <i class="icomoon-help-circle ml-2 theme-tooltip" data-toggle="popover" data-placement="right" title="This is a tooltip" data-content="And here's some amazing content. It's very engaging. Top?"></i> </label> <select name="" id="select1" class="select-input" data-placeholder="select item"> <option></option> <option value="1">Egypt</option> <option value="2">canada</option> <option value="3">USa</option> </select> <span class="help-block"> <i class="icomoon-alert-circle mr-2"></i> This is an error message. </span> <span class="text-muted">This is a hint text to help user.</span> </div>
Copy
Copy
Edit
// /* scss/inputs/_select-input.scss */ .select2-hidden-accessible { display: none; } .select2-container { display: block; z-index: 9999; .selection { display: block; .select2-selection--single { cursor: pointer; display: flex; align-items: center; justify-content: space-between; height: 44px; border: 1px solid $gray-300; background-color: $white; box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05); border-radius: 8px; padding: 10px 14px; @extend .text-md; color: $gray-900; transition: .3s; i { color: $gray-500; font-size: 20px; @include dir-margin-right(8px); } .undefined { display: none; } .select2-selection__placeholder { color: $gray-500; span { display: flex; align-items: center; } } .select2-selection__rendered { span { display: flex; align-items: center; } } .select2-selection__arrow { &::before { content: "\e980"; font-family: 'icomoonapp'; color: $gray-500; font-size: 20px; transition: .3s; display: inline-block; } } &[aria-expanded="true"] { .select2-selection__arrow::before { transform: rotate(180deg); } } } .select2-selection--multiple { padding: 0 14px; display: block; cursor: text; min-height: 44px; outline: 1px solid $gray-300; border: none !important; // border: 1px solid $gray-300; background-color: $white; box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05); border-radius: 8px; @extend .text-md; color: $gray-900; transition: .3s; .select2-selection__rendered { min-height: 44px; display: flex; align-items: center; flex-wrap: wrap; padding: 5px 0; .select2-search--inline { input { max-width: 100%; outline: none; border: 0; background-color: transparent; } } .select2-selection__choice { padding: 2px 10px; @extend .text-sm; @extend .weight-m; background-color: $gray-100; border-radius: 16px; color: $gray-700; display: inline-flex; align-items: center; margin: 0; @include dir-margin-right(.5rem); margin-top: 2px; margin-bottom: 2px; transition: .3s; cursor: context-menu; flex-direction: row-reverse; height: 24px; line-height: initial; white-space: nowrap; &:hover { background-color: $gray-200; } span { font-size: 0; margin: 0; line-height: initial; &::before { content: "\e94c"; display: block; font-size: 12px; color: $gray-700; @include dir-margin-left(4px); font-family: 'icomoonapp'; cursor: pointer; @extend .weight-r; } } } } } } &.select2-container--disabled .selection { .select2-selection { background-color: $gray-50; border-color: #d0d5dd; box-shadow: none; .select2-selection__rendered { color: $gray-500; } } } .select2-dropdown { display: block; background-color: $white; margin-top: 8px; border: 1px solid $gray-200; box-sizing: border-box; box-shadow: 0px 12px 16px -4px rgba(16, 24, 40, 0.1), 0px 4px 6px -2px rgba(16, 24, 40, 0.05); border-radius: 8px; .select2-search { display: block; padding: 15px; input { color: $gray-700; border: solid 1px $gray-300; border-radius: 8px; height: 44px; box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05); padding: 0 14px; margin: 0; outline: none; display: block; width: 100%; @extend .text-md; @extend .weight-r; &::placeholder { color: $gray-500; } &:focus { box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05), 0px 0px 0px 4px #DEEFFC; border-color: $primary-300; } } } .select2-results__options { max-height: 250px; overflow: auto; } .select2-results__option { position: relative; padding: 10px 14px; color: $gray-900; @extend .text-md; cursor: pointer; transition: .3s; &:hover { background-color: $primary-25; &::before { color: $primary-600; } } &::after { content: "\e97d"; font-family: 'icomoonapp'; color: transparent; font-size: 20px; position: absolute; top: 50%; @include dir-right(14px); transform: translateY(-50%); font-size: 20px; transition: .3s; } &[aria-selected="true"] { background-color: $primary-25; &::after { color: $primary-600; } } } } &.select2-container--focus, &.select2-container--open { .select2-selection--single { border-color: $primary-300; box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05), 0px 0px 0px 4px #DEEFFC; } } }
Copy
Edit
/* js/select-input.js */ $(document).ready(function() { $("#select1").select2(); })

select-ajax   

This is an error message. This is a hint text to help user.
Copy
Edit
<!-- components/inputs/select-ajax.html --> <div class="form-group" id="input-name-group"> <label for="input-name" class="control-label"> Select Ajax <i class="icomoon-help-circle ml-2 theme-tooltip" data-toggle="popover" data-placement="right" title="This is a tooltip" data-content="And here's some amazing content. It's very engaging. Top?"></i> </label> <select name="" id="select2" class="select-input" data-placeholder="Select team member"> <option></option> </select> <span class="help-block"> <i class="icomoon-alert-circle mr-2"></i> This is an error message. </span> <span class="text-muted">This is a hint text to help user.</span> </div>
Copy
Copy
Edit
/* scss/inputs/_select-ajax.scss */
Copy
Edit
/* js/select-ajax.js */ $("#select2").select2({ ajax: { url: "http://localhost:3000/posts", processResults: function (data) { // Transforms the top-level key of the response object from 'items' to 'results' const results = data.map((item) => { return { id: item.id, text: item.text, icon: item.icon, }; }); return { results: results, }; }, }, });

select-btn-icon   

This is an error message. This is a hint text to help user.
Copy
Edit
<!-- components/inputs/select-btn-icon.html --> <div class="form-group" id="input-name-group"> <label for="input-name" class="control-label"> Select Btn Icon <i class="icomoon-help-circle ml-2 theme-tooltip" data-toggle="popover" data-placement="right" title="This is a tooltip" data-content="And here's some amazing content. It's very engaging. Top?"></i> </label> <select name="" id="select5" class="select-input" data-icon="icomoon-user" data-placeholder="select item"> <option></option> <option value="1">Egypt</option> <option value="2">canada</option> <option value="3">USa</option> </select> <span class="help-block"> <i class="icomoon-alert-circle mr-2"></i> This is an error message. </span> <span class="text-muted">This is a hint text to help user.</span> </div>
Copy
Copy
Edit
/* scss/inputs/_select-btn-icon.scss */ .select2-hidden-accessible { display: none; } .select2-container { display: block; z-index: 9999; .selection { display: block; .select2-selection--single { cursor: pointer; display: flex; align-items: center; justify-content: space-between; height: 44px; border: 1px solid $gray-300; background-color: $white; box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05); border-radius: 8px; padding: 10px 14px; @extend .text-md; color: $gray-900; transition: .3s; i { color: $gray-500; font-size: 20px; @include dir-margin-right(8px); } .undefined { display: none; } .select2-selection__placeholder { color: $gray-500; span { display: flex; align-items: center; } } .select2-selection__rendered { span { display: flex; align-items: center; } } .select2-selection__arrow { &::before { content: "\e980"; font-family: 'icomoonapp'; color: $gray-500; font-size: 20px; transition: .3s; display: inline-block; } } &[aria-expanded="true"] { .select2-selection__arrow::before { transform: rotate(180deg); } } } .select2-selection--multiple { padding: 0 14px; display: block; cursor: text; min-height: 44px; outline: 1px solid $gray-300; border: none !important; // border: 1px solid $gray-300; background-color: $white; box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05); border-radius: 8px; @extend .text-md; color: $gray-900; transition: .3s; .select2-selection__rendered { min-height: 44px; display: flex; align-items: center; flex-wrap: wrap; padding: 5px 0; .select2-search--inline { input { max-width: 100%; outline: none; border: 0; background-color: transparent; } } .select2-selection__choice { padding: 2px 10px; @extend .text-sm; @extend .weight-m; background-color: $gray-100; border-radius: 16px; color: $gray-700; display: inline-flex; align-items: center; margin: 0; @include dir-margin-right(.5rem); margin-top: 2px; margin-bottom: 2px; transition: .3s; cursor: context-menu; flex-direction: row-reverse; height: 24px; line-height: initial; white-space: nowrap; &:hover { background-color: $gray-200; } span { font-size: 0; margin: 0; line-height: initial; &::before { content: "\e94c"; display: block; font-size: 12px; color: $gray-700; @include dir-margin-left(4px); font-family: 'icomoonapp'; cursor: pointer; @extend .weight-r; } } } } } } .select2-dropdown { display: block; background-color: $white; margin-top: 8px; border: 1px solid $gray-200; box-sizing: border-box; box-shadow: 0px 12px 16px -4px rgba(16, 24, 40, 0.1), 0px 4px 6px -2px rgba(16, 24, 40, 0.05); border-radius: 8px; .select2-search { display: block; padding: 15px; input { color: $gray-700; border: solid 1px $gray-300; border-radius: 8px; height: 44px; box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05); padding: 0 14px; margin: 0; outline: none; display: block; width: 100%; @extend .text-md; @extend .weight-r; &::placeholder { color: $gray-500; } &:focus { box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05), 0px 0px 0px 4px #DEEFFC; border-color: $primary-300; } } } .select2-results__option { position: relative; padding: 10px 14px; color: $gray-900; @extend .text-md; cursor: pointer; transition: .3s; &:hover { background-color: $primary-25; &::before { color: $primary-600; } } &::after { content: "\e97d"; font-family: 'icomoonapp'; color: transparent; font-size: 20px; position: absolute; top: 50%; @include dir-right(14px); transform: translateY(-50%); font-size: 20px; transition: .3s; } &[aria-selected="true"] { background-color: $primary-25; &::after { color: $primary-600; } } } } &.select2-container--focus, &.select2-container--open { .select2-selection--single { border-color: $primary-300; box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05), 0px 0px 0px 4px #DEEFFC; } } }
Copy
Edit
/* js/select-btn-icon.js */ $(document).ready(function() { $('#select5').select2({ templateSelection: formatState }); function formatState (opt) { var opticon = $('#select5').data('icon'); console.log(opticon) var $opt = $( '<span><i class="' + opticon + '" /> ' + opt.text + '</span>' ); return $opt; }; })

select-option-icons   

This is an error message. This is a hint text to help user.
Copy
Edit
<!-- components/inputs/select-option-icons.html --> <div class="form-group" id="input-name-group"> <label for="input-name" class="control-label"> Select Options Icons <i class="icomoon-help-circle ml-2 theme-tooltip" data-toggle="popover" data-placement="right" title="This is a tooltip" data-content="And here's some amazing content. It's very engaging. Top?"></i> </label> <select name="" id="select3" class="select-input" data-placeholder="select item"> <option></option> <option value="1" data-icon="icomoon-trending-down">Egypt</option> <option value="2" data-icon="icomoon-rewind">canada</option> <option value="3" data-icon="icomoon-rss">USa</option> </select> <span class="help-block"> <i class="icomoon-alert-circle mr-2"></i> This is an error message. </span> <span class="text-muted">This is a hint text to help user.</span> </div>
Copy
Copy
Edit
/* scss/inputs/_select-option-icons.scss */
Copy
Edit
/* js/select-option-icons.js */ $('#select3').select2({ templateResult: formatState, templateSelection: formatState }); function formatState (opt) { // console.log('ssssss') var opticon = $(opt.element).data('icon'); if(!opticon){ return opt.text; } else { var $opt = $( '<span><i class="' + opticon + '" /> ' + opt.text + '</span>' ); return $opt; } };

select-icons-ajax   

This is an error message. This is a hint text to help user.
Copy
Edit
<!-- components/inputs/select-icons-ajax.html --> <div class="form-group" id="input-name-group"> <label for="input-name" class="control-label"> Select Icon Ajax <i class="icomoon-help-circle ml-2 theme-tooltip" data-toggle="popover" data-placement="right" title="This is a tooltip" data-content="And here's some amazing content. It's very engaging. Top?"></i> </label> <select name="" id="select4" class="select-input" data-placeholder="select item"> <option value="" data-icon="icomoon-trending-down">Egypt</option> </select> <span class="help-block"> <i class="icomoon-alert-circle mr-2"></i> This is an error message. </span> <span class="text-muted">This is a hint text to help user.</span> </div>
Copy
Copy
Edit
/* scss/inputs/_select-icons-ajax.scss */
Copy
Edit
/* js/select-icons-ajax.js */ $("#select4").select2({ ajax: { url: "http://localhost:3000/posts", processResults: function (data) { // Transforms the top-level key of the response object from 'items' to 'results' const results = data.map((item) => { return { id: item.id, text: item.text, icon: item.icon, }; }); return { results: results, }; }, }, templateResult: function (option) { var opticon = $(option.element).data('icon'); if(opticon) { return $('<span><i class="' + opticon + '" /> ' + option.text + "</span>"); } else { return $('<span><i class="' + option.icon + '" /> ' + option.text + "</span>"); } }, templateSelection: function (option) { var opticon = $(option.element).data('icon'); if(opticon) { return $('<span><i class="' + opticon + '" /> ' + option.text + "</span>"); } else { return $('<span><i class="' + option.icon + '" /> ' + option.text + "</span>"); } }, });

multi-select   

This is an error message. This is a hint text to help user.
Copy
Edit
<!-- components/inputs/multi-select.html --> <div class="form-group" id="input-name-group"> <label for="input-name" class="control-label"> Multi Select <i class="icomoon-help-circle ml-2 theme-tooltip" data-toggle="popover" data-placement="right" title="This is a tooltip" data-content="And here's some amazing content. It's very engaging. Top?"></i> </label> <select name="" id="select66" class="multi-select-input" multiple="multiple" data-placeholder="Please select an skill"> <option></option> <option value="1">Egypt</option> <option value="2">canada</option> <option value="3">USa</option> </select> <span class="help-block"> <i class="icomoon-alert-circle mr-2"></i> This is an error message. </span> <span class="text-muted">This is a hint text to help user.</span> </div>
Copy
Copy
Edit
// /* scss/inputs/_multi-select.scss */
Copy
Edit
/* js/multi-select.js */ // $(document).ready(function() { $("#select66").select2(); // })