Skip to content

Commit

Permalink
Apply prettier changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-to authored and github-actions[bot] committed Jul 2, 2024
1 parent 420e5d5 commit c0afb30
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
4 changes: 2 additions & 2 deletions resources/css/components/dropdowns.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
&-content {
@apply flex max-h-64 max-w-[280px] flex-col divide-y divide-gray-200 overflow-y-auto dark:divide-dark-200 xs:max-w-[320px] sm:w-max;

.dropdown-input-search{
@apply mb-0 border-0 rounded-none;
.dropdown-input-search {
@apply mb-0 rounded-none border-0;
}
}

Expand Down
23 changes: 10 additions & 13 deletions resources/js/Components/Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export default () => ({
this.dropdownBtn = this.$root.querySelector('.dropdown-btn')
this.dropdownBody = this.$root.querySelector('.dropdown-body')

if(this.$root.dataset.searchable) {
this.dropdownItems = this.$el.querySelectorAll('.dropdown-menu-item');
if (this.$root.dataset.searchable) {
this.dropdownItems = this.$el.querySelectorAll('.dropdown-menu-item')
this.$watch('dropdownSearch', value => this.search(value))
}

Expand All @@ -42,19 +42,16 @@ export default () => ({
})
},

search(searchVal){
if(!searchVal || typeof searchVal !== 'string'){
this.dropdownItems.forEach((item) => item.hidden = false)
return;
search(searchVal) {
if (!searchVal || typeof searchVal !== 'string') {
this.dropdownItems.forEach(item => (item.hidden = false))
return
}


const search = searchVal.toLowerCase();
this.dropdownItems.forEach(
(item) => {
item.innerText.toLowerCase().includes(search) ? item.hidden = false : item.hidden = true
}
)
const search = searchVal.toLowerCase()
this.dropdownItems.forEach(item => {
item.innerText.toLowerCase().includes(search) ? (item.hidden = false) : (item.hidden = true)
})
},

toggleDropdown() {
Expand Down
4 changes: 3 additions & 1 deletion resources/js/Components/FormBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ export default (name = '', initData = {}, reactive = {}) => ({
focused !== document.body &&
isTextInput(focused) &&
!containsAttribute(focused, 'x-model.lazy')
? t.$root.querySelector(`[data-reactive-column='${focused.getAttribute('data-reactive-column')}']`)
? t.$root.querySelector(
`[data-reactive-column='${focused.getAttribute('data-reactive-column')}']`,
)
: null

if (input) {
Expand Down

0 comments on commit c0afb30

Please sign in to comment.