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