Add live search to admin licenses overview

- Add AJAX handler for real-time license search
- Create admin-licenses.js with debounced search and keyboard navigation
- Display search results with highlighted matches
- Support navigation with arrow keys and Enter to select
- Add CSS for dropdown results styling

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-21 22:52:51 +01:00
parent fa639dfbaa
commit bfb24f078d
3 changed files with 412 additions and 0 deletions

View File

@@ -468,3 +468,114 @@
.licenses-table .license-actions {
width: 220px;
}
/* Live Search Styles */
.wclp-live-search-results {
position: absolute;
top: 100%;
left: 0;
right: 0;
min-width: 400px;
max-width: 600px;
max-height: 400px;
overflow-y: auto;
background: #fff;
border: 1px solid #c3c4c7;
border-radius: 0 0 4px 4px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
z-index: 1000;
}
.wclp-live-search-results:empty {
display: none;
}
.wclp-search-result-item {
padding: 12px 15px;
border-bottom: 1px solid #f0f0f0;
cursor: pointer;
transition: background-color 0.15s ease;
}
.wclp-search-result-item:last-child {
border-bottom: none;
}
.wclp-search-result-item:hover,
.wclp-search-result-item.active {
background-color: #f0f6fc;
}
.wclp-result-main {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
margin-bottom: 4px;
}
.wclp-result-key code {
font-size: 13px;
background: #f0f0f0;
padding: 2px 6px;
border-radius: 3px;
}
.wclp-result-key mark {
background-color: #fff8c5;
padding: 0;
}
.wclp-result-details {
display: flex;
gap: 15px;
font-size: 12px;
color: #646970;
margin-bottom: 2px;
}
.wclp-result-domain mark {
background-color: #fff8c5;
padding: 0;
}
.wclp-result-product {
color: #2271b1;
}
.wclp-result-customer {
font-size: 11px;
color: #8c8f94;
}
.wclp-result-customer small {
opacity: 0.8;
}
.wclp-search-loading,
.wclp-search-no-results,
.wclp-search-error {
padding: 15px;
text-align: center;
color: #646970;
font-size: 13px;
}
.wclp-search-loading .spinner {
float: none;
margin: 0 5px 0 0;
vertical-align: middle;
}
.wclp-search-error {
color: #d63638;
}
/* Search box positioning */
.wclp-filter-form .search-box {
position: relative;
}
#license-search-input {
width: 280px;
}