@softpak/components 20.12.19 → 20.13.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,8 +1,9 @@
|
|
|
1
|
-
import { NgClass } from '@angular/common';
|
|
2
1
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { input, computed, output, viewChild, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
|
-
import {
|
|
2
|
+
import { input, computed, output, viewChild, HostListener, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { Haptics, ImpactStyle } from '@capacitor/haptics';
|
|
5
4
|
import { IsSeverityPipe } from '@softpak/components/spx-pipes';
|
|
5
|
+
import { NgClass } from '@angular/common';
|
|
6
|
+
import { SpxSeverityEnum } from '@softpak/components/spx-helpers';
|
|
6
7
|
|
|
7
8
|
class SpxButtonComponent {
|
|
8
9
|
constructor() {
|
|
@@ -18,6 +19,7 @@ class SpxButtonComponent {
|
|
|
18
19
|
this.spxType = input('submit', ...(ngDevMode ? [{ debugName: "spxType" }] : []));
|
|
19
20
|
this.mappedName = computed(() => this.spxName() ?? undefined, ...(ngDevMode ? [{ debugName: "mappedName" }] : []));
|
|
20
21
|
this.spxName = input(...(ngDevMode ? [undefined, { debugName: "spxName" }] : []));
|
|
22
|
+
this.isPressing = false;
|
|
21
23
|
this.spxClick = output();
|
|
22
24
|
this.buttonRef = viewChild('buttonRef', ...(ngDevMode ? [{ debugName: "buttonRef" }] : []));
|
|
23
25
|
this.SpxSeverity = SpxSeverityEnum;
|
|
@@ -29,12 +31,49 @@ class SpxButtonComponent {
|
|
|
29
31
|
this.spxClick.emit();
|
|
30
32
|
}
|
|
31
33
|
};
|
|
34
|
+
this.handlePress = async () => {
|
|
35
|
+
if (this.spxDisabled()) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
this.isPressing = true;
|
|
39
|
+
try {
|
|
40
|
+
await Haptics.impact({ style: ImpactStyle.Medium });
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
// silence if haptics is not available
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
// global pointerup: check of de release binnen of buiten de knop is
|
|
47
|
+
this.onDocumentPointerUp = async (event) => {
|
|
48
|
+
if (!this.isPressing || this.spxDisabled()) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
this.isPressing = false;
|
|
52
|
+
const btn = this.buttonRef()?.nativeElement;
|
|
53
|
+
if (!btn) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const inside = btn.contains(event.target);
|
|
57
|
+
try {
|
|
58
|
+
if (inside) {
|
|
59
|
+
// OK haptic
|
|
60
|
+
await Haptics.impact({ style: ImpactStyle.Heavy });
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
// Cancel haptic
|
|
64
|
+
await Haptics.impact({ style: ImpactStyle.Light });
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
// ignore
|
|
69
|
+
}
|
|
70
|
+
};
|
|
32
71
|
}
|
|
33
72
|
spxSetFocus() {
|
|
34
73
|
this.buttonRef()?.nativeElement?.focus();
|
|
35
74
|
}
|
|
36
75
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: SpxButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
37
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.2.3", type: SpxButtonComponent, isStandalone: true, selector: "spx-button", inputs: { spxDisabled: { classPropertyName: "spxDisabled", publicName: "spxDisabled", isSignal: true, isRequired: false, transformFunction: null }, spxClass: { classPropertyName: "spxClass", publicName: "spxClass", isSignal: true, isRequired: false, transformFunction: null }, spxClassObject: { classPropertyName: "spxClassObject", publicName: "spxClassObject", isSignal: true, isRequired: false, transformFunction: null }, spxForm: { classPropertyName: "spxForm", publicName: "spxForm", isSignal: true, isRequired: false, transformFunction: null }, spxFullHeight: { classPropertyName: "spxFullHeight", publicName: "spxFullHeight", isSignal: true, isRequired: false, transformFunction: null }, spxFullWidth: { classPropertyName: "spxFullWidth", publicName: "spxFullWidth", isSignal: true, isRequired: false, transformFunction: null }, spxSeverity: { classPropertyName: "spxSeverity", publicName: "spxSeverity", isSignal: true, isRequired: false, transformFunction: null }, spxSize: { classPropertyName: "spxSize", publicName: "spxSize", isSignal: true, isRequired: false, transformFunction: null }, spxTabIndex: { classPropertyName: "spxTabIndex", publicName: "spxTabIndex", isSignal: true, isRequired: false, transformFunction: null }, spxType: { classPropertyName: "spxType", publicName: "spxType", isSignal: true, isRequired: false, transformFunction: null }, spxName: { classPropertyName: "spxName", publicName: "spxName", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { spxClick: "spxClick" }, host: { properties: { "class.block": "spxFullWidth()", "class.h-full": "spxFullHeight()", "class.w-full": "spxFullWidth()" } }, viewQueries: [{ propertyName: "buttonRef", first: true, predicate: ["buttonRef"], descendants: true, isSignal: true }], ngImport: i0, template: "<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 (click)=\"this.handleClick()\"\n part=\"button\">\n <ng-content></ng-content>\n </button>", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: IsSeverityPipe, name: "isSeverity" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
76
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.2.3", type: SpxButtonComponent, isStandalone: true, selector: "spx-button", inputs: { spxDisabled: { classPropertyName: "spxDisabled", publicName: "spxDisabled", isSignal: true, isRequired: false, transformFunction: null }, spxClass: { classPropertyName: "spxClass", publicName: "spxClass", isSignal: true, isRequired: false, transformFunction: null }, spxClassObject: { classPropertyName: "spxClassObject", publicName: "spxClassObject", isSignal: true, isRequired: false, transformFunction: null }, spxForm: { classPropertyName: "spxForm", publicName: "spxForm", isSignal: true, isRequired: false, transformFunction: null }, spxFullHeight: { classPropertyName: "spxFullHeight", publicName: "spxFullHeight", isSignal: true, isRequired: false, transformFunction: null }, spxFullWidth: { classPropertyName: "spxFullWidth", publicName: "spxFullWidth", isSignal: true, isRequired: false, transformFunction: null }, spxSeverity: { classPropertyName: "spxSeverity", publicName: "spxSeverity", isSignal: true, isRequired: false, transformFunction: null }, spxSize: { classPropertyName: "spxSize", publicName: "spxSize", isSignal: true, isRequired: false, transformFunction: null }, spxTabIndex: { classPropertyName: "spxTabIndex", publicName: "spxTabIndex", isSignal: true, isRequired: false, transformFunction: null }, spxType: { classPropertyName: "spxType", publicName: "spxType", isSignal: true, isRequired: false, transformFunction: null }, spxName: { classPropertyName: "spxName", publicName: "spxName", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { spxClick: "spxClick" }, host: { listeners: { "document:pointerup": "onDocumentPointerUp($event)" }, properties: { "class.block": "spxFullWidth()", "class.h-full": "spxFullHeight()", "class.w-full": "spxFullWidth()" } }, viewQueries: [{ propertyName: "buttonRef", first: true, predicate: ["buttonRef"], descendants: true, isSignal: true }], ngImport: i0, template: "<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>", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: IsSeverityPipe, name: "isSeverity" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
38
77
|
}
|
|
39
78
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: SpxButtonComponent, decorators: [{
|
|
40
79
|
type: Component,
|
|
@@ -42,8 +81,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImpor
|
|
|
42
81
|
'[class.block]': 'spxFullWidth()',
|
|
43
82
|
'[class.h-full]': 'spxFullHeight()',
|
|
44
83
|
'[class.w-full]': 'spxFullWidth()',
|
|
45
|
-
}, standalone: true, template: "<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 (click)=\"this.handleClick()\"\n part=\"button\">\n <ng-content></ng-content>\n </button>" }]
|
|
46
|
-
}]
|
|
84
|
+
}, standalone: true, template: "<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>" }]
|
|
85
|
+
}], propDecorators: { onDocumentPointerUp: [{
|
|
86
|
+
type: HostListener,
|
|
87
|
+
args: ['document:pointerup', ['$event']]
|
|
88
|
+
}] } });
|
|
47
89
|
|
|
48
90
|
/**
|
|
49
91
|
* Generated bundle index. Do not edit.
|
|
@@ -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 { NgClass } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n input,\n output,\n viewChild,\n} from '@angular/core';\nimport { SpxSeverityEnum } from '@softpak/components/spx-helpers';\nimport { IsSeverityPipe } from '@softpak/components/spx-pipes';\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 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","<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 (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":";;;;;;MAyBa,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,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,gBAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;QAChC,IAAA,CAAA,OAAO,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,SAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;QACzB,IAAA,CAAA,aAAa,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,S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,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDlBC,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,koEAAA,EAAA;;;AEvBlB;;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 isPressing = false;\n spxClick = output();\n buttonRef = viewChild<ElementRef<HTMLInputElement>>('buttonRef');\n SpxSeverity = SpxSeverityEnum;\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 handlePress = async () => {\n if (this.spxDisabled()) {\n return;\n }\n this.isPressing = true;\n try {\n await Haptics.impact({ style: ImpactStyle.Medium });\n } catch {\n // silence if haptics is not available\n }\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 Haptics.impact({ style: ImpactStyle.Heavy });\n } else {\n // Cancel haptic\n await Haptics.impact({ style: ImpactStyle.Light });\n }\n } catch {\n // ignore\n }\n };\n\n spxSetFocus(): void {\n this.buttonRef()?.nativeElement?.focus();\n }\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,KA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AAA,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;8BA2ChB,mBAAmB,EAAA,CAAA;sBADlB,YAAY;uBAAC,oBAAoB,EAAE,CAAC,QAAQ,CAAC;;;AEpEhD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softpak/components",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.13.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/common": "20.x.x",
|
|
@@ -36,54 +36,54 @@
|
|
|
36
36
|
"types": "./spx-404-page/index.d.ts",
|
|
37
37
|
"default": "./fesm2022/softpak-components-spx-404-page.mjs"
|
|
38
38
|
},
|
|
39
|
-
"./spx-
|
|
40
|
-
"types": "./spx-
|
|
41
|
-
"default": "./fesm2022/softpak-components-spx-
|
|
39
|
+
"./spx-alert": {
|
|
40
|
+
"types": "./spx-alert/index.d.ts",
|
|
41
|
+
"default": "./fesm2022/softpak-components-spx-alert.mjs"
|
|
42
42
|
},
|
|
43
43
|
"./spx-button": {
|
|
44
44
|
"types": "./spx-button/index.d.ts",
|
|
45
45
|
"default": "./fesm2022/softpak-components-spx-button.mjs"
|
|
46
46
|
},
|
|
47
|
-
"./spx-app-expiry": {
|
|
48
|
-
"types": "./spx-app-expiry/index.d.ts",
|
|
49
|
-
"default": "./fesm2022/softpak-components-spx-app-expiry.mjs"
|
|
50
|
-
},
|
|
51
47
|
"./spx-capitalize": {
|
|
52
48
|
"types": "./spx-capitalize/index.d.ts",
|
|
53
49
|
"default": "./fesm2022/softpak-components-spx-capitalize.mjs"
|
|
54
50
|
},
|
|
55
|
-
"./spx-
|
|
56
|
-
"types": "./spx-
|
|
57
|
-
"default": "./fesm2022/softpak-components-spx-
|
|
51
|
+
"./spx-app-configuration": {
|
|
52
|
+
"types": "./spx-app-configuration/index.d.ts",
|
|
53
|
+
"default": "./fesm2022/softpak-components-spx-app-configuration.mjs"
|
|
54
|
+
},
|
|
55
|
+
"./spx-app-expiry": {
|
|
56
|
+
"types": "./spx-app-expiry/index.d.ts",
|
|
57
|
+
"default": "./fesm2022/softpak-components-spx-app-expiry.mjs"
|
|
58
58
|
},
|
|
59
59
|
"./spx-card": {
|
|
60
60
|
"types": "./spx-card/index.d.ts",
|
|
61
61
|
"default": "./fesm2022/softpak-components-spx-card.mjs"
|
|
62
62
|
},
|
|
63
|
-
"./spx-change-details": {
|
|
64
|
-
"types": "./spx-change-details/index.d.ts",
|
|
65
|
-
"default": "./fesm2022/softpak-components-spx-change-details.mjs"
|
|
66
|
-
},
|
|
67
63
|
"./spx-channel-selection": {
|
|
68
64
|
"types": "./spx-channel-selection/index.d.ts",
|
|
69
65
|
"default": "./fesm2022/softpak-components-spx-channel-selection.mjs"
|
|
70
66
|
},
|
|
71
|
-
"./spx-
|
|
72
|
-
"types": "./spx-
|
|
73
|
-
"default": "./fesm2022/softpak-components-spx-
|
|
67
|
+
"./spx-change-details": {
|
|
68
|
+
"types": "./spx-change-details/index.d.ts",
|
|
69
|
+
"default": "./fesm2022/softpak-components-spx-change-details.mjs"
|
|
74
70
|
},
|
|
75
71
|
"./spx-check-digit": {
|
|
76
72
|
"types": "./spx-check-digit/index.d.ts",
|
|
77
73
|
"default": "./fesm2022/softpak-components-spx-check-digit.mjs"
|
|
78
74
|
},
|
|
79
|
-
"./spx-
|
|
80
|
-
"types": "./spx-
|
|
81
|
-
"default": "./fesm2022/softpak-components-spx-
|
|
75
|
+
"./spx-confirm": {
|
|
76
|
+
"types": "./spx-confirm/index.d.ts",
|
|
77
|
+
"default": "./fesm2022/softpak-components-spx-confirm.mjs"
|
|
82
78
|
},
|
|
83
79
|
"./spx-form-section": {
|
|
84
80
|
"types": "./spx-form-section/index.d.ts",
|
|
85
81
|
"default": "./fesm2022/softpak-components-spx-form-section.mjs"
|
|
86
82
|
},
|
|
83
|
+
"./spx-form-view": {
|
|
84
|
+
"types": "./spx-form-view/index.d.ts",
|
|
85
|
+
"default": "./fesm2022/softpak-components-spx-form-view.mjs"
|
|
86
|
+
},
|
|
87
87
|
"./spx-helpers": {
|
|
88
88
|
"types": "./spx-helpers/index.d.ts",
|
|
89
89
|
"default": "./fesm2022/softpak-components-spx-helpers.mjs"
|
|
@@ -96,14 +96,14 @@
|
|
|
96
96
|
"types": "./spx-navigation/index.d.ts",
|
|
97
97
|
"default": "./fesm2022/softpak-components-spx-navigation.mjs"
|
|
98
98
|
},
|
|
99
|
-
"./spx-pagination": {
|
|
100
|
-
"types": "./spx-pagination/index.d.ts",
|
|
101
|
-
"default": "./fesm2022/softpak-components-spx-pagination.mjs"
|
|
102
|
-
},
|
|
103
99
|
"./spx-number-check": {
|
|
104
100
|
"types": "./spx-number-check/index.d.ts",
|
|
105
101
|
"default": "./fesm2022/softpak-components-spx-number-check.mjs"
|
|
106
102
|
},
|
|
103
|
+
"./spx-pagination": {
|
|
104
|
+
"types": "./spx-pagination/index.d.ts",
|
|
105
|
+
"default": "./fesm2022/softpak-components-spx-pagination.mjs"
|
|
106
|
+
},
|
|
107
107
|
"./spx-patch": {
|
|
108
108
|
"types": "./spx-patch/index.d.ts",
|
|
109
109
|
"default": "./fesm2022/softpak-components-spx-patch.mjs"
|
|
@@ -112,10 +112,6 @@
|
|
|
112
112
|
"types": "./spx-pipes/index.d.ts",
|
|
113
113
|
"default": "./fesm2022/softpak-components-spx-pipes.mjs"
|
|
114
114
|
},
|
|
115
|
-
"./spx-spinner": {
|
|
116
|
-
"types": "./spx-spinner/index.d.ts",
|
|
117
|
-
"default": "./fesm2022/softpak-components-spx-spinner.mjs"
|
|
118
|
-
},
|
|
119
115
|
"./spx-progress-bar": {
|
|
120
116
|
"types": "./spx-progress-bar/index.d.ts",
|
|
121
117
|
"default": "./fesm2022/softpak-components-spx-progress-bar.mjs"
|
|
@@ -128,6 +124,10 @@
|
|
|
128
124
|
"types": "./spx-stock-info/index.d.ts",
|
|
129
125
|
"default": "./fesm2022/softpak-components-spx-stock-info.mjs"
|
|
130
126
|
},
|
|
127
|
+
"./spx-spinner": {
|
|
128
|
+
"types": "./spx-spinner/index.d.ts",
|
|
129
|
+
"default": "./fesm2022/softpak-components-spx-spinner.mjs"
|
|
130
|
+
},
|
|
131
131
|
"./spx-storage": {
|
|
132
132
|
"types": "./spx-storage/index.d.ts",
|
|
133
133
|
"default": "./fesm2022/softpak-components-spx-storage.mjs"
|
|
@@ -140,22 +140,26 @@
|
|
|
140
140
|
"types": "./spx-tabs/index.d.ts",
|
|
141
141
|
"default": "./fesm2022/softpak-components-spx-tabs.mjs"
|
|
142
142
|
},
|
|
143
|
-
"./spx-
|
|
144
|
-
"types": "./spx-
|
|
145
|
-
"default": "./fesm2022/softpak-components-spx-
|
|
143
|
+
"./spx-toaster": {
|
|
144
|
+
"types": "./spx-toaster/index.d.ts",
|
|
145
|
+
"default": "./fesm2022/softpak-components-spx-toaster.mjs"
|
|
146
146
|
},
|
|
147
147
|
"./spx-toggle": {
|
|
148
148
|
"types": "./spx-toggle/index.d.ts",
|
|
149
149
|
"default": "./fesm2022/softpak-components-spx-toggle.mjs"
|
|
150
150
|
},
|
|
151
|
-
"./spx-
|
|
152
|
-
"types": "./spx-
|
|
153
|
-
"default": "./fesm2022/softpak-components-spx-
|
|
151
|
+
"./spx-translate": {
|
|
152
|
+
"types": "./spx-translate/index.d.ts",
|
|
153
|
+
"default": "./fesm2022/softpak-components-spx-translate.mjs"
|
|
154
154
|
},
|
|
155
155
|
"./spx-update": {
|
|
156
156
|
"types": "./spx-update/index.d.ts",
|
|
157
157
|
"default": "./fesm2022/softpak-components-spx-update.mjs"
|
|
158
158
|
},
|
|
159
|
+
"./spx-validation": {
|
|
160
|
+
"types": "./spx-validation/index.d.ts",
|
|
161
|
+
"default": "./fesm2022/softpak-components-spx-validation.mjs"
|
|
162
|
+
},
|
|
159
163
|
"./spx-validation-messages": {
|
|
160
164
|
"types": "./spx-validation-messages/index.d.ts",
|
|
161
165
|
"default": "./fesm2022/softpak-components-spx-validation-messages.mjs"
|
|
@@ -163,10 +167,6 @@
|
|
|
163
167
|
"./spx-welcome": {
|
|
164
168
|
"types": "./spx-welcome/index.d.ts",
|
|
165
169
|
"default": "./fesm2022/softpak-components-spx-welcome.mjs"
|
|
166
|
-
},
|
|
167
|
-
"./spx-validation": {
|
|
168
|
-
"types": "./spx-validation/index.d.ts",
|
|
169
|
-
"default": "./fesm2022/softpak-components-spx-validation.mjs"
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
}
|
package/spx-alert/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _fortawesome_fontawesome_common_types from '@fortawesome/fontawesome-common-types';
|
|
2
2
|
import * as _angular_core from '@angular/core';
|
|
3
3
|
import { SpxSeverityEnum } from '@softpak/components/spx-helpers';
|
|
4
4
|
|
|
@@ -12,10 +12,10 @@ declare class SpxAlertComponent {
|
|
|
12
12
|
readonly spxMarginTop: _angular_core.InputSignal<boolean>;
|
|
13
13
|
readonly spxSeverity: _angular_core.InputSignal<SpxSeverityEnum | undefined>;
|
|
14
14
|
SpxSeverity: typeof SpxSeverityEnum;
|
|
15
|
-
faCheck:
|
|
16
|
-
faCircleInfo:
|
|
17
|
-
faTriangleExclamation:
|
|
18
|
-
faTimes:
|
|
15
|
+
faCheck: _fortawesome_fontawesome_common_types.IconDefinition;
|
|
16
|
+
faCircleInfo: _fortawesome_fontawesome_common_types.IconDefinition;
|
|
17
|
+
faTriangleExclamation: _fortawesome_fontawesome_common_types.IconDefinition;
|
|
18
|
+
faTimes: _fortawesome_fontawesome_common_types.IconDefinition;
|
|
19
19
|
componentDidLoad(): void;
|
|
20
20
|
private prepareAutoClose;
|
|
21
21
|
private _assignDefaultTitle;
|
package/spx-button/index.d.ts
CHANGED
|
@@ -15,11 +15,14 @@ declare class SpxButtonComponent {
|
|
|
15
15
|
readonly spxType: _angular_core.InputSignal<"button" | "submit">;
|
|
16
16
|
protected mappedName: _angular_core.Signal<string | undefined>;
|
|
17
17
|
readonly spxName: _angular_core.InputSignal<string | undefined>;
|
|
18
|
+
isPressing: boolean;
|
|
18
19
|
spxClick: _angular_core.OutputEmitterRef<void>;
|
|
19
20
|
buttonRef: _angular_core.Signal<ElementRef<HTMLInputElement> | undefined>;
|
|
20
21
|
SpxSeverity: typeof SpxSeverityEnum;
|
|
21
22
|
hasShadowDom: (el: HTMLElement) => boolean;
|
|
22
23
|
handleClick: () => void;
|
|
24
|
+
handlePress: () => Promise<void>;
|
|
25
|
+
onDocumentPointerUp: (event: PointerEvent) => Promise<void>;
|
|
23
26
|
spxSetFocus(): void;
|
|
24
27
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SpxButtonComponent, never>;
|
|
25
28
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SpxButtonComponent, "spx-button", never, { "spxDisabled": { "alias": "spxDisabled"; "required": false; "isSignal": true; }; "spxClass": { "alias": "spxClass"; "required": false; "isSignal": true; }; "spxClassObject": { "alias": "spxClassObject"; "required": false; "isSignal": true; }; "spxForm": { "alias": "spxForm"; "required": false; "isSignal": true; }; "spxFullHeight": { "alias": "spxFullHeight"; "required": false; "isSignal": true; }; "spxFullWidth": { "alias": "spxFullWidth"; "required": false; "isSignal": true; }; "spxSeverity": { "alias": "spxSeverity"; "required": false; "isSignal": true; }; "spxSize": { "alias": "spxSize"; "required": false; "isSignal": true; }; "spxTabIndex": { "alias": "spxTabIndex"; "required": false; "isSignal": true; }; "spxType": { "alias": "spxType"; "required": false; "isSignal": true; }; "spxName": { "alias": "spxName"; "required": false; "isSignal": true; }; }, { "spxClick": "spxClick"; }, never, ["*"], true, never>;
|
package/spx-confirm/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _fortawesome_fontawesome_common_types from '@fortawesome/fontawesome-common-types';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { OnInit, OnDestroy } from '@angular/core';
|
|
4
4
|
import { SpxSeverityEnum } from '@softpak/components/spx-helpers';
|
|
@@ -11,7 +11,7 @@ declare class SpxConfirmComponent {
|
|
|
11
11
|
id: i0.InputSignal<string>;
|
|
12
12
|
spxCancel: i0.OutputEmitterRef<string>;
|
|
13
13
|
spxConfirm: i0.OutputEmitterRef<string>;
|
|
14
|
-
faTimes:
|
|
14
|
+
faTimes: _fortawesome_fontawesome_common_types.IconDefinition;
|
|
15
15
|
severityError: SpxSeverityEnum;
|
|
16
16
|
severityInfo: SpxSeverityEnum;
|
|
17
17
|
severitySuccess: SpxSeverityEnum;
|
package/spx-inputs/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { ElementRef, ChangeDetectorRef, EventEmitter, QueryList, OnInit, SimpleChanges } from '@angular/core';
|
|
3
|
-
import * as
|
|
3
|
+
import * as _fortawesome_fontawesome_common_types from '@fortawesome/fontawesome-common-types';
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
5
|
import { SpxSeverityEnum, SpxInputAlertI as SpxInputAlertI$1 } from '@softpak/components/spx-helpers';
|
|
6
6
|
import { ModalController } from '@ionic/angular/standalone';
|
|
@@ -28,10 +28,10 @@ interface SpxInputAlertI {
|
|
|
28
28
|
|
|
29
29
|
declare class SpxInputBoxComponent {
|
|
30
30
|
selectedInputService: SelectedInputService;
|
|
31
|
-
faEdit:
|
|
32
|
-
faSearch:
|
|
33
|
-
faQuestion:
|
|
34
|
-
faTimes:
|
|
31
|
+
faEdit: _fortawesome_fontawesome_common_types.IconDefinition;
|
|
32
|
+
faSearch: _fortawesome_fontawesome_common_types.IconDefinition;
|
|
33
|
+
faQuestion: _fortawesome_fontawesome_common_types.IconDefinition;
|
|
34
|
+
faTimes: _fortawesome_fontawesome_common_types.IconDefinition;
|
|
35
35
|
SpxSeverity: typeof SpxSeverityEnum;
|
|
36
36
|
clearButtonName: _angular_core.Signal<string | undefined>;
|
|
37
37
|
searchButtonName: _angular_core.Signal<string | undefined>;
|