@smilodon/core 1.1.2 → 1.1.5

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/dist/index.js CHANGED
@@ -2502,6 +2502,7 @@ class AngularEnhancedSelect extends HTMLElement {
2502
2502
  this._hasError = false;
2503
2503
  this._errorMessage = '';
2504
2504
  this._boundArrowClick = null;
2505
+ this._isReady = false;
2505
2506
  // Unique class prefix to avoid conflicts
2506
2507
  this.PREFIX = 'smilodon-ang-';
2507
2508
  this._uniqueId = `angular-select-${Math.random().toString(36).substr(2, 9)}`;
@@ -2551,6 +2552,8 @@ class AngularEnhancedSelect extends HTMLElement {
2551
2552
  if (this._config.serverSide.enabled && this._config.serverSide.initialSelectedValues) {
2552
2553
  this._loadInitialSelectedItems();
2553
2554
  }
2555
+ // Mark element as ready
2556
+ this._isReady = true;
2554
2557
  }
2555
2558
  disconnectedCallback() {
2556
2559
  // Cleanup observers
@@ -2575,7 +2578,8 @@ class AngularEnhancedSelect extends HTMLElement {
2575
2578
  // Check if styles already exist for this component type
2576
2579
  const existingStyle = document.head.querySelector('style[data-component="angular-enhanced-select-shared"]');
2577
2580
  if (existingStyle) {
2578
- // Styles already injected, skip
2581
+ // Styles already injected, reuse the existing one
2582
+ this._styleElement = existingStyle;
2579
2583
  return;
2580
2584
  }
2581
2585
  // Create scoped styles for this component type (shared across all instances)
@@ -2896,8 +2900,8 @@ class AngularEnhancedSelect extends HTMLElement {
2896
2900
  min-height: 44px;
2897
2901
  }
2898
2902
  `;
2899
- // Safely append to document head (check if document is ready)
2900
- if (document.head) {
2903
+ // Safely append to document head (check if document is ready and not already appended)
2904
+ if (document.head && !this._styleElement.parentNode) {
2901
2905
  try {
2902
2906
  document.head.appendChild(this._styleElement);
2903
2907
  }
@@ -3320,6 +3324,9 @@ class AngularEnhancedSelect extends HTMLElement {
3320
3324
  }
3321
3325
  }
3322
3326
  // Public API methods
3327
+ isReady() {
3328
+ return this._isReady;
3329
+ }
3323
3330
  setItems(items) {
3324
3331
  this._state.loadedItems = items;
3325
3332
  this._renderOptions();