@smilodon/core 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -7
- package/dist/index.cjs +0 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +0 -25
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/index.umd.js +0 -25
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1479,7 +1479,6 @@ class EnhancedSelect extends HTMLElement {
|
|
|
1479
1479
|
this._input.addEventListener('input', (e) => {
|
|
1480
1480
|
if (!this._config.searchable)
|
|
1481
1481
|
return;
|
|
1482
|
-
console.log('[EnhancedSelect] Input event fired', e.target.value);
|
|
1483
1482
|
const query = e.target.value;
|
|
1484
1483
|
this._handleSearch(query);
|
|
1485
1484
|
});
|
|
@@ -1505,7 +1504,6 @@ class EnhancedSelect extends HTMLElement {
|
|
|
1505
1504
|
this._intersectionObserver = new IntersectionObserver((entries) => {
|
|
1506
1505
|
entries.forEach((entry) => {
|
|
1507
1506
|
if (entry.isIntersecting) {
|
|
1508
|
-
console.log('[InfiniteScroll] Sentinel intersected. isBusy:', this._state.isBusy);
|
|
1509
1507
|
if (!this._state.isBusy) {
|
|
1510
1508
|
this._loadMoreItems();
|
|
1511
1509
|
}
|
|
@@ -1597,7 +1595,6 @@ class EnhancedSelect extends HTMLElement {
|
|
|
1597
1595
|
}
|
|
1598
1596
|
}
|
|
1599
1597
|
_handleSearch(query) {
|
|
1600
|
-
console.log('[EnhancedSelect] _handleSearch called with:', JSON.stringify(query));
|
|
1601
1598
|
this._state.searchQuery = query;
|
|
1602
1599
|
// Clear previous search timeout
|
|
1603
1600
|
if (this._searchTimeout) {
|
|
@@ -1608,12 +1605,10 @@ class EnhancedSelect extends HTMLElement {
|
|
|
1608
1605
|
this._state.isSearching = false;
|
|
1609
1606
|
// Ensure dropdown is open when searching
|
|
1610
1607
|
if (!this._state.isOpen) {
|
|
1611
|
-
console.log('[EnhancedSelect] Opening dropdown for search');
|
|
1612
1608
|
this._handleOpen();
|
|
1613
1609
|
}
|
|
1614
1610
|
else {
|
|
1615
1611
|
// Filter and render options immediately
|
|
1616
|
-
console.log('[EnhancedSelect] Dropdown already open, re-rendering options');
|
|
1617
1612
|
this._renderOptions();
|
|
1618
1613
|
}
|
|
1619
1614
|
// Get filtered items based on search query - searches ENTIRE phrase
|
|
@@ -1633,7 +1628,6 @@ class EnhancedSelect extends HTMLElement {
|
|
|
1633
1628
|
})
|
|
1634
1629
|
: this._state.loadedItems;
|
|
1635
1630
|
const count = filteredItems.length;
|
|
1636
|
-
console.log(`[EnhancedSelect] Search results: ${count} items found for query "${searchQuery}"`);
|
|
1637
1631
|
// Announce search results for accessibility
|
|
1638
1632
|
if (searchQuery) {
|
|
1639
1633
|
this._announce(`${count} result${count !== 1 ? 's' : ''} found for "${query}"`);
|
|
@@ -1939,7 +1933,6 @@ class EnhancedSelect extends HTMLElement {
|
|
|
1939
1933
|
async _loadMoreItems() {
|
|
1940
1934
|
if (this._state.isBusy)
|
|
1941
1935
|
return;
|
|
1942
|
-
console.log('[InfiniteScroll] _loadMoreItems triggered');
|
|
1943
1936
|
this._setBusy(true);
|
|
1944
1937
|
// Save scroll position before loading
|
|
1945
1938
|
if (this._dropdown) {
|
|
@@ -1953,7 +1946,6 @@ class EnhancedSelect extends HTMLElement {
|
|
|
1953
1946
|
try {
|
|
1954
1947
|
// Emit event for parent to handle
|
|
1955
1948
|
this._state.currentPage++;
|
|
1956
|
-
console.log(`[InfiniteScroll] Emitting loadMore event for page ${this._state.currentPage}`);
|
|
1957
1949
|
this._emit('loadMore', { page: this._state.currentPage, items: [] });
|
|
1958
1950
|
this._config.callbacks.onLoadMore?.(this._state.currentPage);
|
|
1959
1951
|
// NOTE: We do NOT set isBusy = false here.
|
|
@@ -2008,14 +2000,6 @@ class EnhancedSelect extends HTMLElement {
|
|
|
2008
2000
|
// we need to maintain scroll position during the update
|
|
2009
2001
|
if (this._state.preserveScrollPosition && this._dropdown) {
|
|
2010
2002
|
const targetScrollTop = this._state.lastScrollPosition;
|
|
2011
|
-
console.log('[InfiniteScroll] setItems: before render', {
|
|
2012
|
-
previousLength,
|
|
2013
|
-
newLength,
|
|
2014
|
-
lastScrollPosition: this._state.lastScrollPosition,
|
|
2015
|
-
scrollTop: this._dropdown.scrollTop,
|
|
2016
|
-
scrollHeight: this._dropdown.scrollHeight,
|
|
2017
|
-
clientHeight: this._dropdown.clientHeight
|
|
2018
|
-
});
|
|
2019
2003
|
// Only clear loading if we actually got more items
|
|
2020
2004
|
if (newLength > previousLength) {
|
|
2021
2005
|
this._state.isBusy = false;
|
|
@@ -2029,13 +2013,6 @@ class EnhancedSelect extends HTMLElement {
|
|
|
2029
2013
|
requestAnimationFrame(() => {
|
|
2030
2014
|
if (this._dropdown) {
|
|
2031
2015
|
this._dropdown.scrollTop = targetScrollTop;
|
|
2032
|
-
console.log('[InfiniteScroll] setItems: after render', {
|
|
2033
|
-
newLength,
|
|
2034
|
-
lastScrollPosition: this._state.lastScrollPosition,
|
|
2035
|
-
scrollTop: this._dropdown.scrollTop,
|
|
2036
|
-
scrollHeight: this._dropdown.scrollHeight,
|
|
2037
|
-
clientHeight: this._dropdown.clientHeight
|
|
2038
|
-
});
|
|
2039
2016
|
}
|
|
2040
2017
|
});
|
|
2041
2018
|
// Only clear preserveScrollPosition if we got new items
|
|
@@ -2211,7 +2188,6 @@ class EnhancedSelect extends HTMLElement {
|
|
|
2211
2188
|
* Render options based on current state
|
|
2212
2189
|
*/
|
|
2213
2190
|
_renderOptions() {
|
|
2214
|
-
console.log('[EnhancedSelect] _renderOptions called');
|
|
2215
2191
|
// Cleanup observer
|
|
2216
2192
|
if (this._loadMoreTrigger && this._intersectionObserver) {
|
|
2217
2193
|
this._intersectionObserver.unobserve(this._loadMoreTrigger);
|
|
@@ -2367,7 +2343,6 @@ class EnhancedSelect extends HTMLElement {
|
|
|
2367
2343
|
this._optionsContainer.appendChild(container);
|
|
2368
2344
|
// Setup intersection observer for auto-load
|
|
2369
2345
|
if (this._intersectionObserver && this._loadMoreTrigger) {
|
|
2370
|
-
console.log('[InfiniteScroll] Observing sentinel');
|
|
2371
2346
|
this._intersectionObserver.observe(this._loadMoreTrigger);
|
|
2372
2347
|
}
|
|
2373
2348
|
}
|