@ship-ui/core 0.14.16 → 0.14.18

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.
@@ -567,14 +567,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
567
567
 
568
568
  class ShipButtonComponent {
569
569
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ShipButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
570
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: ShipButtonComponent, isStandalone: true, selector: "[shButton]", host: { classAttribute: "sh-sheet-h" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
570
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: ShipButtonComponent, isStandalone: true, selector: "[shButton]", host: { classAttribute: "sh-sheet-h" }, ngImport: i0, template: '<ng-content />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
571
571
  }
572
572
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ShipButtonComponent, decorators: [{
573
573
  type: Component,
574
574
  args: [{
575
575
  selector: '[shButton]',
576
576
  imports: [],
577
- template: '<ng-content></ng-content>',
577
+ template: '<ng-content />',
578
578
  changeDetection: ChangeDetectionStrategy.OnPush,
579
579
  host: {
580
580
  class: 'sh-sheet-h',
@@ -613,7 +613,7 @@ class ShipCheckboxComponent {
613
613
  this.currentClassList = classMutationSignal();
614
614
  this.showClasses = computed(() => {
615
615
  const classArr = this.currentClassList().split(' ');
616
- return classArr.includes('active') ? classArr : '';
616
+ return classArr;
617
617
  }, ...(ngDevMode ? [{ debugName: "showClasses" }] : []));
618
618
  }
619
619
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ShipCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
@@ -1301,36 +1301,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
1301
1301
  args: ['click']
1302
1302
  }] } });
1303
1303
 
1304
- function contentProjectionSignal(hostElement, querySelector) {
1305
- const projectedElementsSignal = signal([], ...(ngDevMode ? [{ debugName: "projectedElementsSignal" }] : []));
1304
+ function contentProjectionSignal(querySelector) {
1305
+ const hostElement = inject((ElementRef)).nativeElement;
1306
1306
  const destroyRef = inject(DestroyRef);
1307
+ const projectedElementsSignal = signal([], ...(ngDevMode ? [{ debugName: "projectedElementsSignal" }] : []));
1307
1308
  const updateElements = () => {
1308
- let elements = [];
1309
- // If a querySelector is provided, use it to filter the children.
1310
- if (querySelector) {
1311
- elements = Array.from(hostElement.querySelectorAll(querySelector));
1312
- }
1313
- else {
1314
- // Otherwise, get all direct child elements.
1315
- elements = Array.from(hostElement.children);
1316
- }
1317
- projectedElementsSignal.set(elements);
1309
+ projectedElementsSignal.set(Array.from(hostElement.querySelectorAll(querySelector)));
1318
1310
  };
1311
+ updateElements();
1319
1312
  if (typeof MutationObserver === 'undefined')
1320
1313
  return projectedElementsSignal.asReadonly();
1321
1314
  const observer = new MutationObserver((mutations) => {
1322
- // Only update if child nodes have been added or removed.
1323
1315
  const hasChildListChanges = mutations.some((mutation) => mutation.type === 'childList');
1324
1316
  if (hasChildListChanges) {
1325
1317
  updateElements();
1326
1318
  }
1327
1319
  });
1328
- // Observe the host element for child list changes.
1329
1320
  observer.observe(hostElement, { childList: true });
1330
- // Disconnect the observer when the component is destroyed.
1331
1321
  destroyRef.onDestroy(() => observer.disconnect());
1332
- // Perform an initial update to get the current list of elements.
1333
- updateElements();
1334
1322
  return projectedElementsSignal.asReadonly();
1335
1323
  }
1336
1324
 
@@ -1668,7 +1656,6 @@ class ShipDatepickerInputComponent {
1668
1656
  this.#INIT_DATE = this.#getUTCDate(new Date());
1669
1657
  this.ngModels = contentChild(NgModel, ...(ngDevMode ? [{ debugName: "ngModels" }] : []));
1670
1658
  this.#datePipe = inject(DatePipe);
1671
- this.#elementRef = inject((ElementRef));
1672
1659
  this.#inputRef = signal(null, ...(ngDevMode ? [{ debugName: "#inputRef" }] : []));
1673
1660
  this.masking = input('mediumDate', ...(ngDevMode ? [{ debugName: "masking" }] : []));
1674
1661
  this.closed = output();
@@ -1684,7 +1671,7 @@ class ShipDatepickerInputComponent {
1684
1671
  this.internalDate = signal(this.#INIT_DATE, ...(ngDevMode ? [{ debugName: "internalDate" }] : []));
1685
1672
  this.isOpen = model(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
1686
1673
  this.currentClass = classMutationSignal();
1687
- this.#inputObserver = contentProjectionSignal(this.#elementRef.nativeElement, '#input-wrap input');
1674
+ this.#inputObserver = contentProjectionSignal('#input-wrap input');
1688
1675
  this.#inputRefEffect = effect(() => {
1689
1676
  const inputs = this.#inputObserver();
1690
1677
  if (!inputs.length)
@@ -1709,7 +1696,6 @@ class ShipDatepickerInputComponent {
1709
1696
  }
1710
1697
  #INIT_DATE;
1711
1698
  #datePipe;
1712
- #elementRef;
1713
1699
  #inputRef;
1714
1700
  #inputObserver;
1715
1701
  onDateChange(date) {