@softpak/components 20.13.2 → 21.0.0

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.
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { input, computed, output, viewChild, HostListener, ChangeDetectionStrategy, Component } from '@angular/core';
3
- import { ImpactStyle, Haptics } from '@capacitor/haptics';
3
+ import { ImpactStyle } from '@capacitor/haptics';
4
4
  import { IsSeverityPipe } from '@softpak/components/spx-pipes';
5
5
  import { NgClass } from '@angular/common';
6
6
  import { SpxSeverityEnum } from '@softpak/components/spx-helpers';
@@ -79,7 +79,7 @@ class SpxButtonComponent {
79
79
  }
80
80
  this.lastHaptic = now;
81
81
  try {
82
- await Haptics.impact({ style });
82
+ // await Haptics.impact({ style });
83
83
  }
84
84
  catch {
85
85
  // Silence if no haptics
@@ -1 +1 @@
1
- {"version":3,"file":"softpak-components-spx-button.mjs","sources":["../../../../projects/softpak/components/spx-button/spx-button.component.ts","../../../../projects/softpak/components/spx-button/spx-button.component.html","../../../../projects/softpak/components/spx-button/softpak-components-spx-button.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostListener,\n computed,\n input,\n output,\n viewChild,\n} from '@angular/core';\nimport { Haptics, ImpactStyle } from '@capacitor/haptics';\n\nimport { IsSeverityPipe } from '@softpak/components/spx-pipes';\nimport { NgClass } from '@angular/common';\nimport { SpxSeverityEnum } from '@softpak/components/spx-helpers';\n\n@Component({\n selector: 'spx-button',\n imports: [NgClass, IsSeverityPipe],\n templateUrl: './spx-button.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class.block]': 'spxFullWidth()',\n '[class.h-full]': 'spxFullHeight()',\n '[class.w-full]': 'spxFullWidth()',\n },\n standalone: true,\n})\nexport class SpxButtonComponent {\n readonly spxDisabled = input(false);\n readonly spxClass = input<string>();\n readonly spxClassObject = input<object>();\n readonly spxForm = input<string>();\n readonly spxFullHeight = input<boolean>();\n readonly spxFullWidth = input<boolean>();\n readonly spxSeverity = input<SpxSeverityEnum | undefined>(SpxSeverityEnum.info);\n readonly spxSize = input<'lg' | 'xl'>('lg');\n readonly spxTabIndex = input<number>();\n readonly spxType = input<'button' | 'submit'>('submit');\n protected mappedName = computed(() => this.spxName() ?? undefined);\n readonly spxName = input<string>();\n spxClick = output();\n buttonRef = viewChild<ElementRef<HTMLInputElement>>('buttonRef');\n SpxSeverity = SpxSeverityEnum;\n\n // For haptics\n private isPressing = false;\n private lastHaptic = 0;\n private hapticCooldown = 120;\n //\n\n hasShadowDom = (el: HTMLElement) => {\n return !!el.shadowRoot && !!(el as any).attachShadow;\n };\n handleClick = () => {\n if (!this.spxDisabled()) {\n this.spxClick.emit();\n }\n };\n\n spxSetFocus(): void {\n this.buttonRef()?.nativeElement?.focus();\n }\n\n // For haptics\n handlePress = async () => {\n if (this.spxDisabled()) {\n return;\n }\n this.isPressing = true;\n await this.safeHaptic(ImpactStyle.Medium);\n };\n\n // global pointerup: check of de release binnen of buiten de knop is\n @HostListener('document:pointerup', ['$event'])\n onDocumentPointerUp = async (event: PointerEvent) => {\n if (!this.isPressing || this.spxDisabled()) {\n return;\n }\n this.isPressing = false;\n\n const btn = this.buttonRef()?.nativeElement;\n if (!btn) {\n return;\n }\n\n const inside = btn.contains(event.target as Node);\n\n try {\n if (inside) {\n // OK haptic\n await this.safeHaptic(ImpactStyle.Heavy);\n } else {\n // Cancel haptic\n await this.safeHaptic(ImpactStyle.Light);\n }\n } catch {\n // Silence if no haptics\n }\n };\n\n private async safeHaptic(style: ImpactStyle) {\n const now = performance.now();\n if (now - this.lastHaptic < this.hapticCooldown) {\n return;\n }\n this.lastHaptic = now;\n\n try {\n await Haptics.impact({ style });\n } catch {\n // Silence if no haptics\n }\n }\n // End haptics\n}\n","<button\n #buttonRef\n class=\"border border-transparent font-bold px-4 relative rounded text-center text-white focus:outline-none focus:ring-2 focus:ring-offset-2 bg-gradient-to-r\"\n [class.h-full]=\"this.spxFullHeight()\"\n [class.w-full]=\"this.spxFullWidth()\"\n [class.bg-blue-600]=\"!this.spxSeverity() || (this.spxSeverity() | isSeverity: SpxSeverity.info)\"\n [class.focus:ring-blue-600]=\"!this.spxSeverity() || (this.spxSeverity() | isSeverity: SpxSeverity.info)\"\n [class.from-red-400]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.to-red-600]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.focus:ring-red-600]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.from-lime-400]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.to-lime-600]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.focus:ring-lime-600]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.from-amber-400]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.to-amber-600]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.focus:ring-amber-600]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.py-2]=\"!this.spxSize() || this.spxSize() === 'lg'\"\n [class.py-4]=\"!this.spxSize() || this.spxSize() === 'xl'\"\n [class.text-xl]=\"this.spxSize() === 'xl'\"\n [class.text-lg]=\"this.spxSize() === 'lg'\"\n [class.cursor-pointer]=\"!this.spxDisabled()\"\n [class.cursor-not-allowed]=\"this.spxDisabled()\"\n [class.opacity-50]=\"this.spxDisabled()\"\n [class.focus:ring-0]=\"this.spxDisabled()\"\n [ngClass]=\"this.spxClass() ? this.spxClass() : undefined\"\n [attr.disabled]=\"this.spxDisabled() ? this.spxDisabled() : undefined\"\n [attr.form]=\"this.spxForm() ? this.spxForm() : undefined\"\n [attr.name]=\"this.mappedName()\"\n [attr.tabindex]=\"this.spxTabIndex() ? this.spxTabIndex() : undefined\"\n [attr.type]=\"this.spxType() ? this.spxType() : undefined\"\n (pointerdown)=\"this.handlePress()\"\n (click)=\"this.handleClick()\"\n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BAAA,EAAA,UAAA,EACW,IAAI,EAAA,QAAA,EAAA,4qEAAA,EAAA;8BAiDhB,mBAAmB,EAAA,CAAA;sBADlB,YAAY;uBAAC,oBAAoB,EAAE,CAAC,QAAQ,CAAC;;;AE1EhD;;AAEG;;;;"}
1
+ {"version":3,"file":"softpak-components-spx-button.mjs","sources":["../../../../projects/softpak/components/spx-button/spx-button.component.ts","../../../../projects/softpak/components/spx-button/spx-button.component.html","../../../../projects/softpak/components/spx-button/softpak-components-spx-button.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostListener,\n computed,\n input,\n output,\n viewChild,\n} from '@angular/core';\nimport { Haptics, ImpactStyle } from '@capacitor/haptics';\n\nimport { IsSeverityPipe } from '@softpak/components/spx-pipes';\nimport { NgClass } from '@angular/common';\nimport { SpxSeverityEnum } from '@softpak/components/spx-helpers';\n\n@Component({\n selector: 'spx-button',\n imports: [NgClass, IsSeverityPipe],\n templateUrl: './spx-button.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class.block]': 'spxFullWidth()',\n '[class.h-full]': 'spxFullHeight()',\n '[class.w-full]': 'spxFullWidth()',\n },\n standalone: true,\n})\nexport class SpxButtonComponent {\n readonly spxDisabled = input(false);\n readonly spxClass = input<string>();\n readonly spxClassObject = input<object>();\n readonly spxForm = input<string>();\n readonly spxFullHeight = input<boolean>();\n readonly spxFullWidth = input<boolean>();\n readonly spxSeverity = input<SpxSeverityEnum | undefined>(SpxSeverityEnum.info);\n readonly spxSize = input<'lg' | 'xl'>('lg');\n readonly spxTabIndex = input<number>();\n readonly spxType = input<'button' | 'submit'>('submit');\n protected mappedName = computed(() => this.spxName() ?? undefined);\n readonly spxName = input<string>();\n spxClick = output();\n buttonRef = viewChild<ElementRef<HTMLInputElement>>('buttonRef');\n SpxSeverity = SpxSeverityEnum;\n\n // For haptics\n private isPressing = false;\n private lastHaptic = 0;\n private hapticCooldown = 120;\n //\n\n hasShadowDom = (el: HTMLElement) => {\n return !!el.shadowRoot && !!(el as any).attachShadow;\n };\n handleClick = () => {\n if (!this.spxDisabled()) {\n this.spxClick.emit();\n }\n };\n\n spxSetFocus(): void {\n this.buttonRef()?.nativeElement?.focus();\n }\n\n // For haptics\n handlePress = async () => {\n if (this.spxDisabled()) {\n return;\n }\n this.isPressing = true;\n await this.safeHaptic(ImpactStyle.Medium);\n };\n\n // global pointerup: check of de release binnen of buiten de knop is\n @HostListener('document:pointerup', ['$event'])\n onDocumentPointerUp = async (event: PointerEvent) => {\n if (!this.isPressing || this.spxDisabled()) {\n return;\n }\n this.isPressing = false;\n\n const btn = this.buttonRef()?.nativeElement;\n if (!btn) {\n return;\n }\n\n const inside = btn.contains(event.target as Node);\n\n try {\n if (inside) {\n // OK haptic\n await this.safeHaptic(ImpactStyle.Heavy);\n } else {\n // Cancel haptic\n await this.safeHaptic(ImpactStyle.Light);\n }\n } catch {\n // Silence if no haptics\n }\n };\n\n private async safeHaptic(style: ImpactStyle) {\n const now = performance.now();\n if (now - this.lastHaptic < this.hapticCooldown) {\n return;\n }\n this.lastHaptic = now;\n\n try {\n // await Haptics.impact({ style });\n } catch {\n // Silence if no haptics\n }\n }\n // End haptics\n}\n","<button\n #buttonRef\n class=\"border border-transparent font-bold px-4 relative rounded text-center text-white focus:outline-none focus:ring-2 focus:ring-offset-2 bg-gradient-to-r\"\n [class.h-full]=\"this.spxFullHeight()\"\n [class.w-full]=\"this.spxFullWidth()\"\n [class.bg-blue-600]=\"!this.spxSeverity() || (this.spxSeverity() | isSeverity: SpxSeverity.info)\"\n [class.focus:ring-blue-600]=\"!this.spxSeverity() || (this.spxSeverity() | isSeverity: SpxSeverity.info)\"\n [class.from-red-400]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.to-red-600]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.focus:ring-red-600]=\"this.spxSeverity() | isSeverity: SpxSeverity.error\"\n [class.from-lime-400]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.to-lime-600]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.focus:ring-lime-600]=\"this.spxSeverity() | isSeverity: SpxSeverity.success\"\n [class.from-amber-400]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.to-amber-600]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.focus:ring-amber-600]=\"this.spxSeverity() | isSeverity: SpxSeverity.warning\"\n [class.py-2]=\"!this.spxSize() || this.spxSize() === 'lg'\"\n [class.py-4]=\"!this.spxSize() || this.spxSize() === 'xl'\"\n [class.text-xl]=\"this.spxSize() === 'xl'\"\n [class.text-lg]=\"this.spxSize() === 'lg'\"\n [class.cursor-pointer]=\"!this.spxDisabled()\"\n [class.cursor-not-allowed]=\"this.spxDisabled()\"\n [class.opacity-50]=\"this.spxDisabled()\"\n [class.focus:ring-0]=\"this.spxDisabled()\"\n [ngClass]=\"this.spxClass() ? this.spxClass() : undefined\"\n [attr.disabled]=\"this.spxDisabled() ? this.spxDisabled() : undefined\"\n [attr.form]=\"this.spxForm() ? this.spxForm() : undefined\"\n [attr.name]=\"this.mappedName()\"\n [attr.tabindex]=\"this.spxTabIndex() ? this.spxTabIndex() : undefined\"\n [attr.type]=\"this.spxType() ? this.spxType() : undefined\"\n (pointerdown)=\"this.handlePress()\"\n (click)=\"this.handleClick()\"\n part=\"button\">\n <ng-content></ng-content>\n </button>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MA4Ba,kBAAkB,CAAA;AAZ/B,IAAA,WAAA,GAAA;AAaW,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAC,KAAK,uDAAC;QAC1B,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,UAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;QAC1B,IAAA,CAAA,cAAc,GAAG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,EAAA,EAAA,aAAA,EAAA,gBAAA,EAAA,cAAA,EAAA,iBAAA,EAAA,cAAA,EAAA,gBAAA,EAAA,EAAA,EAAA,WAAA,EAAA,CAAA,EAAA,YAAA,EAAA,WAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,WAAA,CAAA,EAAA,WAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EC5B/B,4qEAkCW,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDhBC,OAAO,+EAAE,cAAc,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAUtB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAZ9B,SAAS;+BACE,YAAY,EAAA,OAAA,EACb,CAAC,OAAO,EAAE,cAAc,CAAC,EAAA,eAAA,EAEjB,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,eAAe,EAAE,gBAAgB;AACjC,wBAAA,gBAAgB,EAAE,iBAAiB;AACnC,wBAAA,gBAAgB,EAAE,gBAAgB;AACnC,qBAAA,EAAA,UAAA,EACW,IAAI,EAAA,QAAA,EAAA,4qEAAA,EAAA;8BAiDhB,mBAAmB,EAAA,CAAA;sBADlB,YAAY;uBAAC,oBAAoB,EAAE,CAAC,QAAQ,CAAC;;;AE1EhD;;AAEG;;;;"}
@@ -1,6 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { input, viewChild, HostListener, ChangeDetectionStrategy, Component } from '@angular/core';
3
- import { Haptics, ImpactStyle } from '@capacitor/haptics';
4
3
 
5
4
  class SpxSuggestionComponent {
6
5
  constructor() {
@@ -13,7 +12,7 @@ class SpxSuggestionComponent {
13
12
  this.handlePress = async () => {
14
13
  this.isPressing = true;
15
14
  try {
16
- await Haptics.impact({ style: ImpactStyle.Light });
15
+ // await Haptics.impact({ style: ImpactStyle.Light });
17
16
  }
18
17
  catch {
19
18
  // silence if haptics is not available
@@ -32,11 +31,11 @@ class SpxSuggestionComponent {
32
31
  try {
33
32
  if (inside) {
34
33
  // OK haptic
35
- await Haptics.impact({ style: ImpactStyle.Medium });
34
+ // await Haptics.impact({ style: ImpactStyle.Medium });
36
35
  }
37
36
  else {
38
37
  // Cancel haptic
39
- await Haptics.impact({ style: ImpactStyle.Light });
38
+ // await Haptics.impact({ style: ImpactStyle.Light });
40
39
  }
41
40
  }
42
41
  catch {
@@ -1 +1 @@
1
- {"version":3,"file":"softpak-components-spx-suggestion.mjs","sources":["../../../../projects/softpak/components/spx-suggestion/spx-suggestion.component.ts","../../../../projects/softpak/components/spx-suggestion/spx-suggestion.component.html","../../../../projects/softpak/components/spx-suggestion/softpak-components-spx-suggestion.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, ElementRef, HostListener, input, viewChild } from '@angular/core';\nimport { Haptics, ImpactStyle } from '@capacitor/haptics';\n\n@Component({\n selector: 'spx-suggestion',\n standalone: true,\n templateUrl: './spx-suggestion.component.html',\n styleUrl: './spx-suggestion.component.css',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SpxSuggestionComponent {\n spxDisabled = input<boolean>();\n spxFocused = input<boolean>();\n spxSelected = input<boolean>();\n spxTabbable = input<boolean>();\n private isPressing = false;\n suggestionRef = viewChild<ElementRef<HTMLButtonElement>>('suggestionRef');\n\n handlePress = async () => {\n this.isPressing = true;\n try {\n await Haptics.impact({ style: ImpactStyle.Light });\n } catch {\n // silence if haptics is not available\n }\n };\n\n @HostListener('document:pointerup', ['$event'])\n onDocumentPointerUp = async (event: PointerEvent) => {\n if (!this.isPressing) {\n return;\n }\n this.isPressing = false;\n\n const btn = this.suggestionRef()?.nativeElement;\n if (!btn) {\n return;\n }\n\n const inside = btn.contains(event.target as Node);\n\n try {\n if (inside) {\n // OK haptic\n await Haptics.impact({ style: ImpactStyle.Medium });\n } else {\n // Cancel haptic\n await Haptics.impact({ style: ImpactStyle.Light });\n }\n } catch {\n // ignore\n }\n };\n}\n","<button\n #suggestionRef\n type=\"button\"\n class=\"spx-suggestion block rounded text-gray-900 text-sm p-3 w-full text-left truncate outline-none\"\n [class.bg-sky-100]=\"!this.spxSelected() && !this.spxDisabled()\"\n [class.focus:ring-sky-300]=\"!this.spxSelected() && !this.spxDisabled()\"\n [class.hover:bg-sky-300]=\"!this.spxSelected() && !this.spxDisabled()\"\n [class.active:bg-sky-300]=\"!this.spxSelected() && !this.spxDisabled()\"\n [class.bg-gray-200]=\"this.spxDisabled() && !this.spxSelected()\"\n [class.bg-gray-400]=\"this.spxDisabled() && this.spxSelected()\"\n [class.cursor-not-allowed]=\"this.spxDisabled()\"\n [class.opacity-60]=\"this.spxDisabled()\"\n [class.bg-gradient-to-r]=\"this.spxSelected() && !this.spxDisabled()\"\n [class.from-teal-400]=\"this.spxSelected() && !this.spxDisabled()\"\n [class.to-teal-600]=\"this.spxSelected() && !this.spxDisabled()\"\n [class.font-bold]=\"this.spxSelected()\"\n [attr.tabindex]=\"this.spxTabbable() && !this.spxDisabled() ? 0 : -1\"\n [class.ring-2]=\"this.spxFocused() && this.spxTabbable() && !this.spxDisabled()\"\n [class.ring-offset-2]=\"this.spxFocused() && this.spxTabbable() && !this.spxDisabled()\"\n [class.ring-blue-500]=\"this.spxFocused() && this.spxTabbable() && !this.spxDisabled()\"\n (pointerdown)=\"this.handlePress()\">\n <div class=\"text-ellipsis overflow-hidden whitespace-nowrap\"><ng-content></ng-content></div>\n </button>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAUa,sBAAsB,CAAA;AAPnC,IAAA,WAAA,GAAA;QAQE,IAAA,CAAA,WAAW,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,aAAA,EAAA,CAAA,GAAA,EA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E,CAAC;gBACrD;qBAAO;;AAEL,oBAAA,MAAM,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,KAAK,EAAE,CAAC;gBACpD;YACF;AAAE,YAAA,MAAM;;YAER;AACF,QAAA,CAAC;AACF,IAAA;8GA3CY,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAtB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,y0BCVnC,s8CAsBW,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FDZE,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAPlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,EAAA,UAAA,EACd,IAAI,EAAA,eAAA,EAGC,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,s8CAAA,EAAA;8BAoB/C,mBAAmB,EAAA,CAAA;sBADlB,YAAY;uBAAC,oBAAoB,EAAE,CAAC,QAAQ,CAAC;;;AE3BhD;;AAEG;;;;"}
1
+ {"version":3,"file":"softpak-components-spx-suggestion.mjs","sources":["../../../../projects/softpak/components/spx-suggestion/spx-suggestion.component.ts","../../../../projects/softpak/components/spx-suggestion/spx-suggestion.component.html","../../../../projects/softpak/components/spx-suggestion/softpak-components-spx-suggestion.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, ElementRef, HostListener, input, viewChild } from '@angular/core';\nimport { Haptics, ImpactStyle } from '@capacitor/haptics';\n\n@Component({\n selector: 'spx-suggestion',\n standalone: true,\n templateUrl: './spx-suggestion.component.html',\n styleUrl: './spx-suggestion.component.css',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SpxSuggestionComponent {\n spxDisabled = input<boolean>();\n spxFocused = input<boolean>();\n spxSelected = input<boolean>();\n spxTabbable = input<boolean>();\n private isPressing = false;\n suggestionRef = viewChild<ElementRef<HTMLButtonElement>>('suggestionRef');\n\n handlePress = async () => {\n this.isPressing = true;\n try {\n // await Haptics.impact({ style: ImpactStyle.Light });\n } catch {\n // silence if haptics is not available\n }\n };\n\n @HostListener('document:pointerup', ['$event'])\n onDocumentPointerUp = async (event: PointerEvent) => {\n if (!this.isPressing) {\n return;\n }\n this.isPressing = false;\n\n const btn = this.suggestionRef()?.nativeElement;\n if (!btn) {\n return;\n }\n\n const inside = btn.contains(event.target as Node);\n\n try {\n if (inside) {\n // OK haptic\n // await Haptics.impact({ style: ImpactStyle.Medium });\n } else {\n // Cancel haptic\n // await Haptics.impact({ style: ImpactStyle.Light });\n }\n } catch {\n // ignore\n }\n };\n}\n","<button\n #suggestionRef\n type=\"button\"\n class=\"spx-suggestion block rounded text-gray-900 text-sm p-3 w-full text-left truncate outline-none\"\n [class.bg-sky-100]=\"!this.spxSelected() && !this.spxDisabled()\"\n [class.focus:ring-sky-300]=\"!this.spxSelected() && !this.spxDisabled()\"\n [class.hover:bg-sky-300]=\"!this.spxSelected() && !this.spxDisabled()\"\n [class.active:bg-sky-300]=\"!this.spxSelected() && !this.spxDisabled()\"\n [class.bg-gray-200]=\"this.spxDisabled() && !this.spxSelected()\"\n [class.bg-gray-400]=\"this.spxDisabled() && this.spxSelected()\"\n [class.cursor-not-allowed]=\"this.spxDisabled()\"\n [class.opacity-60]=\"this.spxDisabled()\"\n [class.bg-gradient-to-r]=\"this.spxSelected() && !this.spxDisabled()\"\n [class.from-teal-400]=\"this.spxSelected() && !this.spxDisabled()\"\n [class.to-teal-600]=\"this.spxSelected() && !this.spxDisabled()\"\n [class.font-bold]=\"this.spxSelected()\"\n [attr.tabindex]=\"this.spxTabbable() && !this.spxDisabled() ? 0 : -1\"\n [class.ring-2]=\"this.spxFocused() && this.spxTabbable() && !this.spxDisabled()\"\n [class.ring-offset-2]=\"this.spxFocused() && this.spxTabbable() && !this.spxDisabled()\"\n [class.ring-blue-500]=\"this.spxFocused() && this.spxTabbable() && !this.spxDisabled()\"\n (pointerdown)=\"this.handlePress()\">\n <div class=\"text-ellipsis overflow-hidden whitespace-nowrap\"><ng-content></ng-content></div>\n </button>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAUa,sBAAsB,CAAA;AAPnC,IAAA,WAAA,GAAA;QAQE,IAAA,CAAA,WAAW,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,aAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAW;QAC9B,IAAA,CAAA,UAAU,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,YAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAW;QAC7B,IAAA,CAAA,WAAW,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,aAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAW;QAC9B,IAAA,CAAA,WAAW,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,aAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAW;QACtB,IAAA,CAAA,UAAU,GAAG,KAAK;AAC1B,QAAA,IAAA,CAAA,aAAa,GAAG,SAAS,CAAgC,eAAe,yDAAC;QAEzE,IAAA,CAAA,WAAW,GAAG,YAAW;AACvB,YAAA,IAAI,CAAC,UAAU,GAAG,IAAI;AACtB,YAAA,IAAI;;YAEJ;AAAE,YAAA,MAAM;;YAER;AACF,QAAA,CAAC;AAGD,QAAA,IAAA,CAAA,mBAAmB,GAAG,OAAO,KAAmB,KAAI;AAClD,YAAA,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;gBACpB;YACF;AACA,YAAA,IAAI,CAAC,UAAU,GAAG,KAAK;YAEvB,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,EAAE,EAAE,aAAa;YAC/C,IAAI,CAAC,GAAG,EAAE;gBACR;YACF;YAEA,MAAM,MAAM,GAAG,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAc,CAAC;AAEjD,YAAA,IAAI;gBACF,IAAI,MAAM,EAAE;;;gBAGZ;qBAAO;;;gBAGP;YACF;AAAE,YAAA,MAAM;;YAER;AACF,QAAA,CAAC;AACF,IAAA;8GA3CY,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAtB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,y0BCVnC,s8CAsBW,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FDZE,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAPlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,EAAA,UAAA,EACd,IAAI,EAAA,eAAA,EAGC,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,s8CAAA,EAAA;8BAoB/C,mBAAmB,EAAA,CAAA;sBADlB,YAAY;uBAAC,oBAAoB,EAAE,CAAC,QAAQ,CAAC;;;AE3BhD;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,19 +1,20 @@
1
1
  {
2
2
  "name": "@softpak/components",
3
- "version": "20.13.2",
3
+ "version": "21.0.0",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
- "@angular/common": "20.x.x",
7
- "@angular/core": "20.x.x",
6
+ "@angular/common": "21.x.x",
7
+ "@angular/core": "21.x.x",
8
8
  "@capacitor/app": "7.x.x",
9
9
  "@capacitor/device": "7.x.x",
10
+ "@capacitor/haptics": "7.x.x",
10
11
  "@capacitor/live-updates": "0.4.x",
11
- "@fortawesome/free-solid-svg-icons": "6.x.x",
12
+ "@fortawesome/free-solid-svg-icons": "7.x.x",
12
13
  "@ionic/angular": "8.x.x",
13
- "@ngrx/effects": "19.x.x || 20.x.x || 20.0.0-rc.x",
14
- "@ngrx/store": "19.x.x || 20.x.x || 20.0.0-rc.x",
15
- "@ngx-translate/core": "16.x.x",
16
- "@sentry/angular": "9.x.x"
14
+ "@ngrx/effects": "20.x.x || 21.x.x",
15
+ "@ngrx/store": "20.x.x || 21.x.x",
16
+ "@ngx-translate/core": "17.x.x",
17
+ "@sentry/angular": "10.x.x"
17
18
  },
18
19
  "dependencies": {
19
20
  "tslib": "^2.3.0"
@@ -36,21 +37,25 @@
36
37
  "types": "./spx-404-page/index.d.ts",
37
38
  "default": "./fesm2022/softpak-components-spx-404-page.mjs"
38
39
  },
39
- "./spx-app-expiry": {
40
- "types": "./spx-app-expiry/index.d.ts",
41
- "default": "./fesm2022/softpak-components-spx-app-expiry.mjs"
42
- },
43
40
  "./spx-alert": {
44
41
  "types": "./spx-alert/index.d.ts",
45
42
  "default": "./fesm2022/softpak-components-spx-alert.mjs"
46
43
  },
44
+ "./spx-app-configuration": {
45
+ "types": "./spx-app-configuration/index.d.ts",
46
+ "default": "./fesm2022/softpak-components-spx-app-configuration.mjs"
47
+ },
47
48
  "./spx-button": {
48
49
  "types": "./spx-button/index.d.ts",
49
50
  "default": "./fesm2022/softpak-components-spx-button.mjs"
50
51
  },
51
- "./spx-app-configuration": {
52
- "types": "./spx-app-configuration/index.d.ts",
53
- "default": "./fesm2022/softpak-components-spx-app-configuration.mjs"
52
+ "./spx-capitalize": {
53
+ "types": "./spx-capitalize/index.d.ts",
54
+ "default": "./fesm2022/softpak-components-spx-capitalize.mjs"
55
+ },
56
+ "./spx-app-expiry": {
57
+ "types": "./spx-app-expiry/index.d.ts",
58
+ "default": "./fesm2022/softpak-components-spx-app-expiry.mjs"
54
59
  },
55
60
  "./spx-change-details": {
56
61
  "types": "./spx-change-details/index.d.ts",
@@ -64,18 +69,18 @@
64
69
  "types": "./spx-channel-selection/index.d.ts",
65
70
  "default": "./fesm2022/softpak-components-spx-channel-selection.mjs"
66
71
  },
67
- "./spx-capitalize": {
68
- "types": "./spx-capitalize/index.d.ts",
69
- "default": "./fesm2022/softpak-components-spx-capitalize.mjs"
70
- },
71
- "./spx-form-view": {
72
- "types": "./spx-form-view/index.d.ts",
73
- "default": "./fesm2022/softpak-components-spx-form-view.mjs"
72
+ "./spx-form-section": {
73
+ "types": "./spx-form-section/index.d.ts",
74
+ "default": "./fesm2022/softpak-components-spx-form-section.mjs"
74
75
  },
75
76
  "./spx-confirm": {
76
77
  "types": "./spx-confirm/index.d.ts",
77
78
  "default": "./fesm2022/softpak-components-spx-confirm.mjs"
78
79
  },
80
+ "./spx-form-view": {
81
+ "types": "./spx-form-view/index.d.ts",
82
+ "default": "./fesm2022/softpak-components-spx-form-view.mjs"
83
+ },
79
84
  "./spx-check-digit": {
80
85
  "types": "./spx-check-digit/index.d.ts",
81
86
  "default": "./fesm2022/softpak-components-spx-check-digit.mjs"
@@ -84,14 +89,6 @@
84
89
  "types": "./spx-helpers/index.d.ts",
85
90
  "default": "./fesm2022/softpak-components-spx-helpers.mjs"
86
91
  },
87
- "./spx-form-section": {
88
- "types": "./spx-form-section/index.d.ts",
89
- "default": "./fesm2022/softpak-components-spx-form-section.mjs"
90
- },
91
- "./spx-inputs": {
92
- "types": "./spx-inputs/index.d.ts",
93
- "default": "./fesm2022/softpak-components-spx-inputs.mjs"
94
- },
95
92
  "./spx-navigation": {
96
93
  "types": "./spx-navigation/index.d.ts",
97
94
  "default": "./fesm2022/softpak-components-spx-navigation.mjs"
@@ -100,17 +97,17 @@
100
97
  "types": "./spx-number-check/index.d.ts",
101
98
  "default": "./fesm2022/softpak-components-spx-number-check.mjs"
102
99
  },
103
- "./spx-patch": {
104
- "types": "./spx-patch/index.d.ts",
105
- "default": "./fesm2022/softpak-components-spx-patch.mjs"
106
- },
107
100
  "./spx-pagination": {
108
101
  "types": "./spx-pagination/index.d.ts",
109
102
  "default": "./fesm2022/softpak-components-spx-pagination.mjs"
110
103
  },
111
- "./spx-redux": {
112
- "types": "./spx-redux/index.d.ts",
113
- "default": "./fesm2022/softpak-components-spx-redux.mjs"
104
+ "./spx-inputs": {
105
+ "types": "./spx-inputs/index.d.ts",
106
+ "default": "./fesm2022/softpak-components-spx-inputs.mjs"
107
+ },
108
+ "./spx-patch": {
109
+ "types": "./spx-patch/index.d.ts",
110
+ "default": "./fesm2022/softpak-components-spx-patch.mjs"
114
111
  },
115
112
  "./spx-pipes": {
116
113
  "types": "./spx-pipes/index.d.ts",
@@ -120,14 +117,22 @@
120
117
  "types": "./spx-progress-bar/index.d.ts",
121
118
  "default": "./fesm2022/softpak-components-spx-progress-bar.mjs"
122
119
  },
123
- "./spx-storage": {
124
- "types": "./spx-storage/index.d.ts",
125
- "default": "./fesm2022/softpak-components-spx-storage.mjs"
120
+ "./spx-redux": {
121
+ "types": "./spx-redux/index.d.ts",
122
+ "default": "./fesm2022/softpak-components-spx-redux.mjs"
126
123
  },
127
124
  "./spx-spinner": {
128
125
  "types": "./spx-spinner/index.d.ts",
129
126
  "default": "./fesm2022/softpak-components-spx-spinner.mjs"
130
127
  },
128
+ "./spx-stock-info": {
129
+ "types": "./spx-stock-info/index.d.ts",
130
+ "default": "./fesm2022/softpak-components-spx-stock-info.mjs"
131
+ },
132
+ "./spx-storage": {
133
+ "types": "./spx-storage/index.d.ts",
134
+ "default": "./fesm2022/softpak-components-spx-storage.mjs"
135
+ },
131
136
  "./spx-suggestion": {
132
137
  "types": "./spx-suggestion/index.d.ts",
133
138
  "default": "./fesm2022/softpak-components-spx-suggestion.mjs"
@@ -136,30 +141,22 @@
136
141
  "types": "./spx-tabs/index.d.ts",
137
142
  "default": "./fesm2022/softpak-components-spx-tabs.mjs"
138
143
  },
139
- "./spx-stock-info": {
140
- "types": "./spx-stock-info/index.d.ts",
141
- "default": "./fesm2022/softpak-components-spx-stock-info.mjs"
142
- },
143
- "./spx-toggle": {
144
- "types": "./spx-toggle/index.d.ts",
145
- "default": "./fesm2022/softpak-components-spx-toggle.mjs"
144
+ "./spx-toaster": {
145
+ "types": "./spx-toaster/index.d.ts",
146
+ "default": "./fesm2022/softpak-components-spx-toaster.mjs"
146
147
  },
147
148
  "./spx-translate": {
148
149
  "types": "./spx-translate/index.d.ts",
149
150
  "default": "./fesm2022/softpak-components-spx-translate.mjs"
150
151
  },
151
- "./spx-toaster": {
152
- "types": "./spx-toaster/index.d.ts",
153
- "default": "./fesm2022/softpak-components-spx-toaster.mjs"
152
+ "./spx-toggle": {
153
+ "types": "./spx-toggle/index.d.ts",
154
+ "default": "./fesm2022/softpak-components-spx-toggle.mjs"
154
155
  },
155
156
  "./spx-update": {
156
157
  "types": "./spx-update/index.d.ts",
157
158
  "default": "./fesm2022/softpak-components-spx-update.mjs"
158
159
  },
159
- "./spx-welcome": {
160
- "types": "./spx-welcome/index.d.ts",
161
- "default": "./fesm2022/softpak-components-spx-welcome.mjs"
162
- },
163
160
  "./spx-validation": {
164
161
  "types": "./spx-validation/index.d.ts",
165
162
  "default": "./fesm2022/softpak-components-spx-validation.mjs"
@@ -167,6 +164,10 @@
167
164
  "./spx-validation-messages": {
168
165
  "types": "./spx-validation-messages/index.d.ts",
169
166
  "default": "./fesm2022/softpak-components-spx-validation-messages.mjs"
167
+ },
168
+ "./spx-welcome": {
169
+ "types": "./spx-welcome/index.d.ts",
170
+ "default": "./fesm2022/softpak-components-spx-welcome.mjs"
170
171
  }
171
172
  }
172
173
  }
@@ -141,7 +141,7 @@ declare const hasBeenDownloaded: _ngrx_store.ActionCreator<"[SPX / Update Pendin
141
141
  declare const hasBeenInstalled: _ngrx_store.ActionCreator<"[SPX / Update Pending] Has been installed", (props: Record<string, unknown>) => Record<string, unknown> & _ngrx_store.Action<"[SPX / Update Pending] Has been installed">>;
142
142
  declare const postpone: _ngrx_store.ActionCreator<"[SPX / Update Pending] Postpone", (props: Record<string, unknown>) => Record<string, unknown> & _ngrx_store.Action<"[SPX / Update Pending] Postpone">>;
143
143
  declare const postponeExpired: _ngrx_store.ActionCreator<"[SPX / Update Pending] Postpone expired", (props: Record<string, unknown>) => Record<string, unknown> & _ngrx_store.Action<"[SPX / Update Pending] Postpone expired">>;
144
- declare const all: (Record<string, unknown> & _ngrx_store.Action<"[SPX / Update Pending] Has been downloaded">) | (Record<string, unknown> & _ngrx_store.Action<"[SPX / Update Pending] Has been installed">) | (Record<string, unknown> & _ngrx_store.Action<"[SPX / Update Pending] Postpone">) | (Record<string, unknown> & _ngrx_store.Action<"[SPX / Update Pending] Postpone expired">) | (Record<string, unknown> & _ngrx_store.Action<"[SPX / Update Pending] Accept update">);
144
+ declare const all: (Record<string, unknown> & _ngrx_store.Action<"[SPX / Update Pending] Accept update">) | (Record<string, unknown> & _ngrx_store.Action<"[SPX / Update Pending] Has been downloaded">) | (Record<string, unknown> & _ngrx_store.Action<"[SPX / Update Pending] Has been installed">) | (Record<string, unknown> & _ngrx_store.Action<"[SPX / Update Pending] Postpone">) | (Record<string, unknown> & _ngrx_store.Action<"[SPX / Update Pending] Postpone expired">);
145
145
  type Actions = typeof all;
146
146
 
147
147
  type spxUpdatePending_actions_d_Actions = Actions;