Refactor Lucide icon rendering by replacing nodes with root across components and fix unintended character encoding issues in placeholders and text.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { api } from '../../lib/api.mjs';
|
||||
import { api } from '../../lib/api.mjs';
|
||||
|
||||
const SECTIONS = [
|
||||
{ type: 'person', label: 'People', icon: 'users', endpoint: 'people' },
|
||||
@@ -67,8 +67,8 @@ class WoResourcePanel extends HTMLElement {
|
||||
}
|
||||
|
||||
#resourceName(item, type) {
|
||||
if (type === 'vehicle') return `${item.unit_number}${item.description ? ' – ' + item.description : ''}`;
|
||||
return item.name || item.unit_number || '—';
|
||||
if (type === 'vehicle') return `${item.unit_number}${item.description ? ' – ' + item.description : ''}`;
|
||||
return item.name || item.unit_number || '—';
|
||||
}
|
||||
|
||||
#sectionHTML(section) {
|
||||
@@ -166,7 +166,7 @@ class WoResourcePanel extends HTMLElement {
|
||||
<button class="dialog-close" id="picker-close"><i data-lucide="x" style="width:16px;height:16px"></i></button>
|
||||
</div>
|
||||
<div class="dialog-body">
|
||||
<input class="picker-search" id="picker-search" placeholder="Search…" autocomplete="off">
|
||||
<input class="picker-search" id="picker-search" placeholder="Search…" autocomplete="off">
|
||||
<div class="picker-list" id="picker-list"></div>
|
||||
<div class="qty-row" id="qty-row" style="display:none">
|
||||
<label class="qty-label" for="qty-input">Quantity:</label>
|
||||
@@ -179,7 +179,7 @@ class WoResourcePanel extends HTMLElement {
|
||||
</div>
|
||||
</dialog>`;
|
||||
|
||||
if (window.lucide) lucide.createIcons({ nodes: [s] });
|
||||
if (window.lucide) lucide.createIcons({ root: s });
|
||||
this.#bindEvents();
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@ class WoResourcePanel extends HTMLElement {
|
||||
|
||||
container.innerHTML = available.map(item => {
|
||||
const name = type === 'vehicle'
|
||||
? `${item.unit_number}${item.description ? ' – ' + item.description : ''}`
|
||||
? `${item.unit_number}${item.description ? ' – ' + item.description : ''}`
|
||||
: item.name;
|
||||
const sub = item.role || item.vehicle_type || item.category || (item.part_number ? `#${item.part_number}` : '') || '';
|
||||
return `
|
||||
|
||||
Reference in New Issue
Block a user