@softpak/components 19.19.0 → 19.21.0-beta.2
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/README.md +24 -24
- package/fesm2022/softpak-components-spx-404-page.mjs +2 -2
- package/fesm2022/softpak-components-spx-404-page.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-alert.mjs +7 -6
- package/fesm2022/softpak-components-spx-alert.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-app-configuration.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-app-expiry.mjs +23 -91
- package/fesm2022/softpak-components-spx-app-expiry.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-button.mjs +8 -22
- package/fesm2022/softpak-components-spx-button.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-capitalize.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-card.mjs +20 -91
- package/fesm2022/softpak-components-spx-card.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-change-details.mjs +59 -104
- package/fesm2022/softpak-components-spx-change-details.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-channel-selection.mjs +52 -52
- package/fesm2022/softpak-components-spx-channel-selection.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-check-digit.mjs +24 -28
- package/fesm2022/softpak-components-spx-check-digit.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-confirm.mjs +4 -4
- package/fesm2022/softpak-components-spx-confirm.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-form-section.mjs +8 -33
- package/fesm2022/softpak-components-spx-form-section.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-form-view.mjs +39 -53
- package/fesm2022/softpak-components-spx-form-view.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-helpers.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-inputs.mjs +33 -24
- package/fesm2022/softpak-components-spx-inputs.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-navigation.mjs +34 -89
- package/fesm2022/softpak-components-spx-navigation.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-number-check.mjs +91 -198
- package/fesm2022/softpak-components-spx-number-check.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-pagination.mjs +12 -21
- package/fesm2022/softpak-components-spx-pagination.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-patch.mjs +8 -39
- package/fesm2022/softpak-components-spx-patch.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-pipes.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-progress-bar.mjs +8 -22
- package/fesm2022/softpak-components-spx-progress-bar.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-spinner.mjs +15 -160
- package/fesm2022/softpak-components-spx-spinner.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-stock-info.mjs +71 -128
- package/fesm2022/softpak-components-spx-stock-info.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-storage.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-suggestion.mjs +2 -2
- package/fesm2022/softpak-components-spx-suggestion.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-toaster.mjs +35 -162
- package/fesm2022/softpak-components-spx-toaster.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-toggle.mjs +2 -2
- package/fesm2022/softpak-components-spx-toggle.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-translate.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-update.mjs +5 -5
- package/fesm2022/softpak-components-spx-update.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-validation.mjs +56 -55
- package/fesm2022/softpak-components-spx-validation.mjs.map +1 -1
- package/package.json +24 -24
- package/spx-alert/spx-alert.component.d.ts +1 -1
- package/spx-app-expiry/spx-app-expiry.component.d.ts +14 -14
- package/spx-button/spx-button.component.d.ts +0 -3
- package/spx-card/spx-card-item/spx-card-item.component.d.ts +0 -1
- package/spx-card/spx-card.component.d.ts +8 -9
- package/spx-change-details/spx-change-details.component.d.ts +23 -25
- package/spx-check-digit/spx-check-digit.component.d.ts +9 -9
- package/spx-form-section/spx-form-section.component.d.ts +5 -5
- package/spx-form-view/spx-autocomplete-search.component.d.ts +15 -16
- package/spx-form-view/spx-form-view.component.d.ts +1 -1
- package/spx-inputs/spx-input-text/spx-input-text.component.d.ts +4 -1
- package/spx-inputs/spx-input.component.d.ts +1 -0
- package/spx-navigation/public-api.d.ts +2 -2
- package/spx-navigation/spx-home-tile/spx-home-tile.component.d.ts +11 -0
- package/spx-navigation/{spx-home-tiles.component.d.ts → spx-home-tile/spx-home-tiles.component.d.ts} +2 -2
- package/spx-navigation/spx-navigation.component.d.ts +11 -8
- package/spx-number-check/spx-number-check.component.d.ts +26 -32
- package/spx-pagination/spx-pagination.component.d.ts +9 -10
- package/spx-patch/spx-patch.component.d.ts +4 -4
- package/spx-progress-bar/spx-progress-bar.component.d.ts +3 -3
- package/spx-spinner/spx-spinner.component.d.ts +3 -3
- package/spx-stock-info/spx-stock-info.component.d.ts +48 -49
- package/spx-toaster/src/spx-toaster-message.interface.d.ts +5 -1
- package/spx-toaster/src/spx-toaster.component.d.ts +6 -14
- package/spx-validation/spx-validate-control.component.d.ts +22 -20
- package/tailwind.css +1 -1
- package/spx-navigation/spx-home-tile.component.d.ts +0 -11
|
@@ -1,80 +1,83 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { input, output, viewChild, signal, computed, Component, ChangeDetectionStrategy } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
5
|
import { SpxButtonComponent } from '@softpak/components/spx-button';
|
|
6
|
-
import { SpxSeverityEnum } from '@softpak/components/spx-helpers';
|
|
6
|
+
import { SpxSeverityEnum, unsubscribeSubscriptions } from '@softpak/components/spx-helpers';
|
|
7
7
|
|
|
8
8
|
class SpxNumberCheckComponent {
|
|
9
|
-
get ctrl1() { return this.form.get('ctrl1'); }
|
|
10
|
-
get ctrl2() { return this.form.get('ctrl2'); }
|
|
11
|
-
get ctrl3() { return this.form.get('ctrl3'); }
|
|
12
|
-
get ctrl4() { return this.form.get('ctrl4'); }
|
|
13
9
|
constructor(formBuilder) {
|
|
14
10
|
this.formBuilder = formBuilder;
|
|
15
|
-
this.
|
|
16
|
-
this.
|
|
17
|
-
this.
|
|
11
|
+
this.spxAction = input.required();
|
|
12
|
+
this.spxSimpleMode = input(false);
|
|
13
|
+
this.spxPincode = input.required();
|
|
14
|
+
this.txtCancel = input.required();
|
|
15
|
+
this.txtConfirm = input.required();
|
|
16
|
+
this.txtConfirmMessage = input.required();
|
|
17
|
+
this.txtReset = input.required();
|
|
18
|
+
this.spxCancel = output();
|
|
19
|
+
this.spxConfirm = output();
|
|
20
|
+
this.viewChild1 = viewChild.required('viewChild1');
|
|
21
|
+
this.viewChild2 = viewChild.required('viewChild2');
|
|
22
|
+
this.viewChild3 = viewChild.required('viewChild3');
|
|
23
|
+
this.viewChild4 = viewChild.required('viewChild4');
|
|
24
|
+
this.form = signal(null);
|
|
18
25
|
this.spxSeverity = SpxSeverityEnum;
|
|
19
|
-
this.accepted = false;
|
|
20
|
-
this.denied = false;
|
|
21
|
-
this.
|
|
26
|
+
this.accepted = signal(false);
|
|
27
|
+
this.denied = signal(false);
|
|
28
|
+
this.subscription = {};
|
|
29
|
+
this.ctrl1 = computed(() => this.form()?.get('ctrl1'));
|
|
30
|
+
this.ctrl2 = computed(() => this.form()?.get('ctrl2'));
|
|
31
|
+
this.ctrl3 = computed(() => this.form()?.get('ctrl3'));
|
|
32
|
+
this.ctrl4 = computed(() => this.form()?.get('ctrl4'));
|
|
33
|
+
this.form.set(this.formBuilder.group({
|
|
22
34
|
ctrl1: [null, []],
|
|
23
35
|
ctrl2: [null, []],
|
|
24
36
|
ctrl3: [null, []],
|
|
25
37
|
ctrl4: [null, []],
|
|
26
|
-
});
|
|
38
|
+
}));
|
|
27
39
|
}
|
|
28
40
|
ngOnInit() {
|
|
29
|
-
this.listenToTyping = this.form.valueChanges.subscribe(() => {
|
|
30
|
-
this.accepted
|
|
31
|
-
this.denied
|
|
32
|
-
if (this.ctrl1.value && this.ctrl2.value && this.ctrl3.value && this.ctrl4.value) {
|
|
41
|
+
this.subscription.listenToTyping = this.form().valueChanges.subscribe(() => {
|
|
42
|
+
this.accepted.set(false);
|
|
43
|
+
this.denied.set(false);
|
|
44
|
+
if (this.ctrl1().value && this.ctrl2().value && this.ctrl3().value && this.ctrl4().value) {
|
|
33
45
|
this.checkPincode();
|
|
34
46
|
}
|
|
35
47
|
});
|
|
36
|
-
this.listenToCtrl1 = this.ctrl1.valueChanges.subscribe(value => {
|
|
48
|
+
this.subscription.listenToCtrl1 = this.ctrl1().valueChanges.subscribe(value => {
|
|
37
49
|
if (value) {
|
|
38
|
-
this.viewChild2.nativeElement.focus();
|
|
50
|
+
this.viewChild2().nativeElement.focus();
|
|
39
51
|
}
|
|
40
52
|
else {
|
|
41
53
|
}
|
|
42
54
|
});
|
|
43
|
-
this.listenToCtrl2 = this.ctrl2.valueChanges.subscribe(value => {
|
|
55
|
+
this.subscription.listenToCtrl2 = this.ctrl2().valueChanges.subscribe(value => {
|
|
44
56
|
if (value) {
|
|
45
|
-
this.viewChild3.nativeElement.focus();
|
|
57
|
+
this.viewChild3().nativeElement.focus();
|
|
46
58
|
}
|
|
47
59
|
else {
|
|
48
60
|
}
|
|
49
61
|
});
|
|
50
|
-
this.listenToCtrl3 = this.ctrl3.valueChanges.subscribe(value => {
|
|
62
|
+
this.subscription.listenToCtrl3 = this.ctrl3().valueChanges.subscribe(value => {
|
|
51
63
|
if (value) {
|
|
52
|
-
this.viewChild4.nativeElement.focus();
|
|
64
|
+
this.viewChild4().nativeElement.focus();
|
|
53
65
|
}
|
|
54
66
|
else {
|
|
55
67
|
}
|
|
56
68
|
});
|
|
57
69
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
70
|
+
//TODO CHECK THIS
|
|
71
|
+
// ngOnChanges(changes: SimpleChanges): void {
|
|
72
|
+
// setTimeout(() => {
|
|
73
|
+
// const viewChild1 = this?.viewChild1();
|
|
74
|
+
// if (viewChild1?) {
|
|
75
|
+
// viewChild1.focus();
|
|
76
|
+
// }
|
|
77
|
+
// }, 0);
|
|
78
|
+
// }
|
|
65
79
|
ngOnDestroy() {
|
|
66
|
-
|
|
67
|
-
this.listenToTyping.unsubscribe();
|
|
68
|
-
}
|
|
69
|
-
if (this.listenToCtrl1) {
|
|
70
|
-
this.listenToCtrl1.unsubscribe();
|
|
71
|
-
}
|
|
72
|
-
if (this.listenToCtrl2) {
|
|
73
|
-
this.listenToCtrl2.unsubscribe();
|
|
74
|
-
}
|
|
75
|
-
if (this.listenToCtrl3) {
|
|
76
|
-
this.listenToCtrl3.unsubscribe();
|
|
77
|
-
}
|
|
80
|
+
unsubscribeSubscriptions(this.subscription);
|
|
78
81
|
}
|
|
79
82
|
handleCancel() {
|
|
80
83
|
this.spxCancel.emit();
|
|
@@ -83,183 +86,73 @@ class SpxNumberCheckComponent {
|
|
|
83
86
|
this.spxConfirm.emit();
|
|
84
87
|
}
|
|
85
88
|
handleReset() {
|
|
86
|
-
this.ctrl1.reset();
|
|
87
|
-
this.ctrl2.reset();
|
|
88
|
-
this.ctrl3.reset();
|
|
89
|
-
this.ctrl4.reset();
|
|
90
|
-
this.viewChild1.
|
|
91
|
-
this.accepted
|
|
92
|
-
this.denied
|
|
89
|
+
this.ctrl1().reset();
|
|
90
|
+
this.ctrl2().reset();
|
|
91
|
+
this.ctrl3().reset();
|
|
92
|
+
this.ctrl4().reset();
|
|
93
|
+
this.viewChild1().focus();
|
|
94
|
+
this.accepted.set(false);
|
|
95
|
+
this.denied.set(false);
|
|
93
96
|
}
|
|
94
97
|
onDigitInput(event) {
|
|
95
|
-
let element;
|
|
96
|
-
if (
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
if (element
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
|
|
123
|
-
}
|
|
98
|
+
// let element: HTMLElement | null;
|
|
99
|
+
// if (
|
|
100
|
+
// event.code === 'Digit0' ||
|
|
101
|
+
// event.code === 'Digit1' ||
|
|
102
|
+
// event.code === 'Digit2' ||
|
|
103
|
+
// event.code === 'Digit3' ||
|
|
104
|
+
// event.code === 'Digit4' ||
|
|
105
|
+
// event.code === 'Digit5' ||
|
|
106
|
+
// event.code === 'Digit6' ||
|
|
107
|
+
// event.code === 'Digit7' ||
|
|
108
|
+
// event.code === 'Digit8' ||
|
|
109
|
+
// event.code === 'Digit9' ||
|
|
110
|
+
// event.code === 'Numpad0' ||
|
|
111
|
+
// event.code === 'Numpad1' ||
|
|
112
|
+
// event.code === 'Numpad2' ||
|
|
113
|
+
// event.code === 'Numpad3' ||
|
|
114
|
+
// event.code === 'Numpad4' ||
|
|
115
|
+
// event.code === 'Numpad5' ||
|
|
116
|
+
// event.code === 'Numpad6' ||
|
|
117
|
+
// event.code === 'Numpad7' ||
|
|
118
|
+
// event.code === 'Numpad8' ||
|
|
119
|
+
// event.code === 'Numpad9') {
|
|
120
|
+
// element = event.srcElement.nextElementSibling;
|
|
121
|
+
// if (element === null) {
|
|
122
|
+
// return;
|
|
123
|
+
// }
|
|
124
|
+
// else {
|
|
125
|
+
// // setTimeout(() => { element.focus(); });
|
|
126
|
+
// }
|
|
127
|
+
// }
|
|
124
128
|
}
|
|
125
129
|
onBackspace(event) {
|
|
126
|
-
event.
|
|
130
|
+
event.target?.focus();
|
|
127
131
|
}
|
|
128
132
|
checkPincode() {
|
|
129
|
-
if (this.spxPincode === `${this.ctrl1.value}${this.ctrl2.value}${this.ctrl3.value}${this.ctrl4.value}`) {
|
|
130
|
-
this.accepted
|
|
133
|
+
if (this.spxPincode() === `${this.ctrl1().value}${this.ctrl2().value}${this.ctrl3().value}${this.ctrl4().value}`) {
|
|
134
|
+
this.accepted.set(true);
|
|
131
135
|
setTimeout(() => {
|
|
132
136
|
this.spxConfirm.emit();
|
|
133
137
|
}, 500);
|
|
134
138
|
}
|
|
135
139
|
else {
|
|
136
|
-
this.denied
|
|
140
|
+
this.denied.set(true);
|
|
137
141
|
}
|
|
138
142
|
}
|
|
139
143
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxNumberCheckComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
140
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: SpxNumberCheckComponent, isStandalone: true, selector: "spx-number-check", inputs: { spxAction: "spxAction", spxSimpleMode: "spxSimpleMode", spxPincode: "spxPincode", txtCancel: "txtCancel", txtConfirm: "txtConfirm", txtConfirmMessage: "txtConfirmMessage", txtReset: "txtReset" }, outputs: { spxCancel: "spxCancel", spxConfirm: "spxConfirm" }, host: { listeners: { "spxChange": "handleChangeEvent($event)" } }, viewQueries: [{ propertyName: "viewChild1", first: true, predicate: ["viewChild1"], descendants: true }, { propertyName: "viewChild2", first: true, predicate: ["viewChild2"], descendants: true }, { propertyName: "viewChild3", first: true, predicate: ["viewChild3"], descendants: true }, { propertyName: "viewChild4", first: true, predicate: ["viewChild4"], descendants: true
|
|
141
|
-
<div class="fixed top-0 left-0 right-0 bottom-0 z-40 bg-black">
|
|
142
|
-
<div class="mx-auto mt-32 max-w-96 bg-black rounded-lg">
|
|
143
|
-
<div class="flex flex-col gap-3 p-3">
|
|
144
|
-
<div class="bg-yellow-300 text-black text-center rounded p-3 text-xl">
|
|
145
|
-
<div class="font-bold">{{ this.spxAction }}</div>
|
|
146
|
-
{{ this.txtConfirmMessage }}
|
|
147
|
-
</div>
|
|
148
|
-
@if (!this.spxSimpleMode) {
|
|
149
|
-
<form class="block grid grid-cols-4 gap-3" [formGroup]="this.form" (ngSubmit)="null">
|
|
150
|
-
<input #viewChild1 [formControl]="ctrl1" type="text" autofocus class="w-full text-center font-bold text-2xl p-3 rounded-lg focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 text-white bg-neutral-700" [class.bg-red-700]="this.denied" [class.bg-teal-700]="this.accepted" maxlength="1" (keypress)="onDigitInput($event)" pattern="[0-9]*" inputmode="numeric" />
|
|
151
|
-
<input #viewChild2 [formControl]="ctrl2" type="text" class="w-full text-center font-bold text-2xl p-3 rounded-lg focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 text-white bg-neutral-700" [class.bg-red-700]="this.denied" [class.bg-teal-700]="this.accepted" maxlength="1" (keypress)="onDigitInput($event)" (keyup.backspace)="onBackspace($event)" pattern="[0-9]*" inputmode="numeric" />
|
|
152
|
-
<input #viewChild3 [formControl]="ctrl3" type="text" class="w-full text-center font-bold text-2xl p-3 rounded-lg focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 text-white bg-neutral-700" [class.bg-red-700]="this.denied" [class.bg-teal-700]="this.accepted" maxlength="1" (keypress)="onDigitInput($event)" (keyup.backspace)="onBackspace($event)" pattern="[0-9]*" inputmode="numeric" />
|
|
153
|
-
<input #viewChild4 [formControl]="ctrl4" type="text" class="w-full text-center font-bold text-2xl p-3 rounded-lg focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 text-white bg-neutral-700" [class.bg-red-700]="this.denied" [class.bg-teal-700]="this.accepted" maxlength="1" (keypress)="onDigitInput($event)" (keyup.backspace)="onBackspace($event)" pattern="[0-9]*" inputmode="numeric" />
|
|
154
|
-
</form>
|
|
155
|
-
}
|
|
156
|
-
@if (this.spxSimpleMode) {
|
|
157
|
-
<spx-button
|
|
158
|
-
[spxFullWidth]="true"
|
|
159
|
-
[spxSeverity]="spxSeverity.success"
|
|
160
|
-
(spxClick)="this.handleConfirm()"
|
|
161
|
-
>{{ this.txtConfirm }}</spx-button>
|
|
162
|
-
}
|
|
163
|
-
@if (!this.spxSimpleMode) {
|
|
164
|
-
<spx-button
|
|
165
|
-
[spxFullWidth]="true"
|
|
166
|
-
[spxSeverity]="spxSeverity.warning"
|
|
167
|
-
(spxClick)="this.handleReset()"
|
|
168
|
-
>{{ this.txtReset }}</spx-button>
|
|
169
|
-
}
|
|
170
|
-
<spx-button
|
|
171
|
-
[spxFullWidth]="true"
|
|
172
|
-
[spxSeverity]="spxSeverity.error"
|
|
173
|
-
(spxClick)="this.handleCancel()"
|
|
174
|
-
>{{ this.txtCancel }}</spx-button>
|
|
175
|
-
</div>
|
|
176
|
-
</div>
|
|
177
|
-
</div>
|
|
178
|
-
`, isInline: true, dependencies: [{ kind: "component", type: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType"], outputs: ["spxClick"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] }); }
|
|
144
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: SpxNumberCheckComponent, isStandalone: true, selector: "spx-number-check", inputs: { spxAction: { classPropertyName: "spxAction", publicName: "spxAction", isSignal: true, isRequired: true, transformFunction: null }, spxSimpleMode: { classPropertyName: "spxSimpleMode", publicName: "spxSimpleMode", isSignal: true, isRequired: false, transformFunction: null }, spxPincode: { classPropertyName: "spxPincode", publicName: "spxPincode", isSignal: true, isRequired: true, transformFunction: null }, txtCancel: { classPropertyName: "txtCancel", publicName: "txtCancel", isSignal: true, isRequired: true, transformFunction: null }, txtConfirm: { classPropertyName: "txtConfirm", publicName: "txtConfirm", isSignal: true, isRequired: true, transformFunction: null }, txtConfirmMessage: { classPropertyName: "txtConfirmMessage", publicName: "txtConfirmMessage", isSignal: true, isRequired: true, transformFunction: null }, txtReset: { classPropertyName: "txtReset", publicName: "txtReset", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { spxCancel: "spxCancel", spxConfirm: "spxConfirm" }, host: { listeners: { "spxChange": "handleChangeEvent($event)" } }, viewQueries: [{ propertyName: "viewChild1", first: true, predicate: ["viewChild1"], descendants: true, isSignal: true }, { propertyName: "viewChild2", first: true, predicate: ["viewChild2"], descendants: true, isSignal: true }, { propertyName: "viewChild3", first: true, predicate: ["viewChild3"], descendants: true, isSignal: true }, { propertyName: "viewChild4", first: true, predicate: ["viewChild4"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"fixed top-0 left-0 right-0 bottom-0 z-40 bg-black\">\r\n <div class=\"mx-auto mt-32 max-w-96 bg-black rounded-lg\">\r\n <div class=\"flex flex-col gap-3 p-3\">\r\n <div class=\"bg-yellow-300 text-black text-center rounded p-3 text-xl\">\r\n <div class=\"font-bold\">{{ this.spxAction() }}</div>\r\n {{ this.txtConfirmMessage() }}\r\n </div>\r\n @if (!this.spxSimpleMode()) {\r\n <form class=\"block grid grid-cols-4 gap-3\" [formGroup]=\"this.form()!\" (ngSubmit)=\"null\">\r\n <input #viewChild1 [formControl]=\"ctrl1()\" type=\"text\" autofocus class=\"w-full text-center font-bold text-2xl p-3 rounded-lg focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 text-white bg-neutral-700\" [class.bg-red-700]=\"this.denied()\" [class.bg-teal-700]=\"this.accepted()\" maxlength=\"1\" (keypress)=\"onDigitInput($event)\" pattern=\"[0-9]*\" inputmode=\"numeric\" />\r\n <input #viewChild2 [formControl]=\"ctrl2()\" type=\"text\" class=\"w-full text-center font-bold text-2xl p-3 rounded-lg focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 text-white bg-neutral-700\" [class.bg-red-700]=\"this.denied()\" [class.bg-teal-700]=\"this.accepted()\" maxlength=\"1\" (keypress)=\"onDigitInput($event)\" (keyup.backspace)=\"onBackspace($event)\" pattern=\"[0-9]*\" inputmode=\"numeric\" />\r\n <input #viewChild3 [formControl]=\"ctrl3()\" type=\"text\" class=\"w-full text-center font-bold text-2xl p-3 rounded-lg focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 text-white bg-neutral-700\" [class.bg-red-700]=\"this.denied()\" [class.bg-teal-700]=\"this.accepted()\" maxlength=\"1\" (keypress)=\"onDigitInput($event)\" (keyup.backspace)=\"onBackspace($event)\" pattern=\"[0-9]*\" inputmode=\"numeric\" />\r\n <input #viewChild4 [formControl]=\"ctrl4()\" type=\"text\" class=\"w-full text-center font-bold text-2xl p-3 rounded-lg focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 text-white bg-neutral-700\" [class.bg-red-700]=\"this.denied()\" [class.bg-teal-700]=\"this.accepted()\" maxlength=\"1\" (keypress)=\"onDigitInput($event)\" (keyup.backspace)=\"onBackspace($event)\" pattern=\"[0-9]*\" inputmode=\"numeric\" />\r\n </form>\r\n }\r\n @if (this.spxSimpleMode()) {\r\n <spx-button\r\n [spxFullWidth]=\"true\"\r\n [spxSeverity]=\"spxSeverity.success\"\r\n (spxClick)=\"this.handleConfirm()\"\r\n >{{ this.txtConfirm() }}</spx-button>\r\n }\r\n @if (!this.spxSimpleMode()) {\r\n <spx-button\r\n [spxFullWidth]=\"true\"\r\n [spxSeverity]=\"spxSeverity.warning\"\r\n (spxClick)=\"this.handleReset()\"\r\n >{{ this.txtReset() }}</spx-button>\r\n }\r\n <spx-button\r\n [spxFullWidth]=\"true\"\r\n [spxSeverity]=\"spxSeverity.error\"\r\n (spxClick)=\"this.handleCancel()\"\r\n >{{ this.txtCancel() }}</spx-button>\r\n </div>\r\n </div>\r\n</div>", dependencies: [{ kind: "component", type: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType"], outputs: ["spxClick"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
179
145
|
}
|
|
180
146
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxNumberCheckComponent, decorators: [{
|
|
181
147
|
type: Component,
|
|
182
|
-
args: [{
|
|
183
|
-
selector: 'spx-number-check',
|
|
184
|
-
host: {
|
|
148
|
+
args: [{ selector: 'spx-number-check', host: {
|
|
185
149
|
'(spxChange)': 'handleChangeEvent($event)'
|
|
186
|
-
},
|
|
187
|
-
imports: [
|
|
150
|
+
}, imports: [
|
|
188
151
|
SpxButtonComponent,
|
|
189
152
|
FormsModule,
|
|
190
153
|
ReactiveFormsModule
|
|
191
|
-
],
|
|
192
|
-
|
|
193
|
-
<div class="fixed top-0 left-0 right-0 bottom-0 z-40 bg-black">
|
|
194
|
-
<div class="mx-auto mt-32 max-w-96 bg-black rounded-lg">
|
|
195
|
-
<div class="flex flex-col gap-3 p-3">
|
|
196
|
-
<div class="bg-yellow-300 text-black text-center rounded p-3 text-xl">
|
|
197
|
-
<div class="font-bold">{{ this.spxAction }}</div>
|
|
198
|
-
{{ this.txtConfirmMessage }}
|
|
199
|
-
</div>
|
|
200
|
-
@if (!this.spxSimpleMode) {
|
|
201
|
-
<form class="block grid grid-cols-4 gap-3" [formGroup]="this.form" (ngSubmit)="null">
|
|
202
|
-
<input #viewChild1 [formControl]="ctrl1" type="text" autofocus class="w-full text-center font-bold text-2xl p-3 rounded-lg focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 text-white bg-neutral-700" [class.bg-red-700]="this.denied" [class.bg-teal-700]="this.accepted" maxlength="1" (keypress)="onDigitInput($event)" pattern="[0-9]*" inputmode="numeric" />
|
|
203
|
-
<input #viewChild2 [formControl]="ctrl2" type="text" class="w-full text-center font-bold text-2xl p-3 rounded-lg focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 text-white bg-neutral-700" [class.bg-red-700]="this.denied" [class.bg-teal-700]="this.accepted" maxlength="1" (keypress)="onDigitInput($event)" (keyup.backspace)="onBackspace($event)" pattern="[0-9]*" inputmode="numeric" />
|
|
204
|
-
<input #viewChild3 [formControl]="ctrl3" type="text" class="w-full text-center font-bold text-2xl p-3 rounded-lg focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 text-white bg-neutral-700" [class.bg-red-700]="this.denied" [class.bg-teal-700]="this.accepted" maxlength="1" (keypress)="onDigitInput($event)" (keyup.backspace)="onBackspace($event)" pattern="[0-9]*" inputmode="numeric" />
|
|
205
|
-
<input #viewChild4 [formControl]="ctrl4" type="text" class="w-full text-center font-bold text-2xl p-3 rounded-lg focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 text-white bg-neutral-700" [class.bg-red-700]="this.denied" [class.bg-teal-700]="this.accepted" maxlength="1" (keypress)="onDigitInput($event)" (keyup.backspace)="onBackspace($event)" pattern="[0-9]*" inputmode="numeric" />
|
|
206
|
-
</form>
|
|
207
|
-
}
|
|
208
|
-
@if (this.spxSimpleMode) {
|
|
209
|
-
<spx-button
|
|
210
|
-
[spxFullWidth]="true"
|
|
211
|
-
[spxSeverity]="spxSeverity.success"
|
|
212
|
-
(spxClick)="this.handleConfirm()"
|
|
213
|
-
>{{ this.txtConfirm }}</spx-button>
|
|
214
|
-
}
|
|
215
|
-
@if (!this.spxSimpleMode) {
|
|
216
|
-
<spx-button
|
|
217
|
-
[spxFullWidth]="true"
|
|
218
|
-
[spxSeverity]="spxSeverity.warning"
|
|
219
|
-
(spxClick)="this.handleReset()"
|
|
220
|
-
>{{ this.txtReset }}</spx-button>
|
|
221
|
-
}
|
|
222
|
-
<spx-button
|
|
223
|
-
[spxFullWidth]="true"
|
|
224
|
-
[spxSeverity]="spxSeverity.error"
|
|
225
|
-
(spxClick)="this.handleCancel()"
|
|
226
|
-
>{{ this.txtCancel }}</spx-button>
|
|
227
|
-
</div>
|
|
228
|
-
</div>
|
|
229
|
-
</div>
|
|
230
|
-
`
|
|
231
|
-
}]
|
|
232
|
-
}], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { spxAction: [{
|
|
233
|
-
type: Input
|
|
234
|
-
}], spxSimpleMode: [{
|
|
235
|
-
type: Input
|
|
236
|
-
}], spxPincode: [{
|
|
237
|
-
type: Input
|
|
238
|
-
}], txtCancel: [{
|
|
239
|
-
type: Input
|
|
240
|
-
}], txtConfirm: [{
|
|
241
|
-
type: Input
|
|
242
|
-
}], txtConfirmMessage: [{
|
|
243
|
-
type: Input
|
|
244
|
-
}], txtReset: [{
|
|
245
|
-
type: Input
|
|
246
|
-
}], spxCancel: [{
|
|
247
|
-
type: Output
|
|
248
|
-
}], spxConfirm: [{
|
|
249
|
-
type: Output
|
|
250
|
-
}], viewChild1: [{
|
|
251
|
-
type: ViewChild,
|
|
252
|
-
args: ['viewChild1']
|
|
253
|
-
}], viewChild2: [{
|
|
254
|
-
type: ViewChild,
|
|
255
|
-
args: ['viewChild2']
|
|
256
|
-
}], viewChild3: [{
|
|
257
|
-
type: ViewChild,
|
|
258
|
-
args: ['viewChild3']
|
|
259
|
-
}], viewChild4: [{
|
|
260
|
-
type: ViewChild,
|
|
261
|
-
args: ['viewChild4']
|
|
262
|
-
}] } });
|
|
154
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<div class=\"fixed top-0 left-0 right-0 bottom-0 z-40 bg-black\">\r\n <div class=\"mx-auto mt-32 max-w-96 bg-black rounded-lg\">\r\n <div class=\"flex flex-col gap-3 p-3\">\r\n <div class=\"bg-yellow-300 text-black text-center rounded p-3 text-xl\">\r\n <div class=\"font-bold\">{{ this.spxAction() }}</div>\r\n {{ this.txtConfirmMessage() }}\r\n </div>\r\n @if (!this.spxSimpleMode()) {\r\n <form class=\"block grid grid-cols-4 gap-3\" [formGroup]=\"this.form()!\" (ngSubmit)=\"null\">\r\n <input #viewChild1 [formControl]=\"ctrl1()\" type=\"text\" autofocus class=\"w-full text-center font-bold text-2xl p-3 rounded-lg focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 text-white bg-neutral-700\" [class.bg-red-700]=\"this.denied()\" [class.bg-teal-700]=\"this.accepted()\" maxlength=\"1\" (keypress)=\"onDigitInput($event)\" pattern=\"[0-9]*\" inputmode=\"numeric\" />\r\n <input #viewChild2 [formControl]=\"ctrl2()\" type=\"text\" class=\"w-full text-center font-bold text-2xl p-3 rounded-lg focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 text-white bg-neutral-700\" [class.bg-red-700]=\"this.denied()\" [class.bg-teal-700]=\"this.accepted()\" maxlength=\"1\" (keypress)=\"onDigitInput($event)\" (keyup.backspace)=\"onBackspace($event)\" pattern=\"[0-9]*\" inputmode=\"numeric\" />\r\n <input #viewChild3 [formControl]=\"ctrl3()\" type=\"text\" class=\"w-full text-center font-bold text-2xl p-3 rounded-lg focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 text-white bg-neutral-700\" [class.bg-red-700]=\"this.denied()\" [class.bg-teal-700]=\"this.accepted()\" maxlength=\"1\" (keypress)=\"onDigitInput($event)\" (keyup.backspace)=\"onBackspace($event)\" pattern=\"[0-9]*\" inputmode=\"numeric\" />\r\n <input #viewChild4 [formControl]=\"ctrl4()\" type=\"text\" class=\"w-full text-center font-bold text-2xl p-3 rounded-lg focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 text-white bg-neutral-700\" [class.bg-red-700]=\"this.denied()\" [class.bg-teal-700]=\"this.accepted()\" maxlength=\"1\" (keypress)=\"onDigitInput($event)\" (keyup.backspace)=\"onBackspace($event)\" pattern=\"[0-9]*\" inputmode=\"numeric\" />\r\n </form>\r\n }\r\n @if (this.spxSimpleMode()) {\r\n <spx-button\r\n [spxFullWidth]=\"true\"\r\n [spxSeverity]=\"spxSeverity.success\"\r\n (spxClick)=\"this.handleConfirm()\"\r\n >{{ this.txtConfirm() }}</spx-button>\r\n }\r\n @if (!this.spxSimpleMode()) {\r\n <spx-button\r\n [spxFullWidth]=\"true\"\r\n [spxSeverity]=\"spxSeverity.warning\"\r\n (spxClick)=\"this.handleReset()\"\r\n >{{ this.txtReset() }}</spx-button>\r\n }\r\n <spx-button\r\n [spxFullWidth]=\"true\"\r\n [spxSeverity]=\"spxSeverity.error\"\r\n (spxClick)=\"this.handleCancel()\"\r\n >{{ this.txtCancel() }}</spx-button>\r\n </div>\r\n </div>\r\n</div>" }]
|
|
155
|
+
}], ctorParameters: () => [{ type: i1.FormBuilder }] });
|
|
263
156
|
|
|
264
157
|
/**
|
|
265
158
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"softpak-components-spx-number-check.mjs","sources":["../../../../projects/softpak/components/spx-number-check/spx-number-check.component.ts","../../../../projects/softpak/components/spx-number-check/softpak-components-spx-number-check.ts"],"sourcesContent":["\nimport { Component, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { SpxSeverityEnum } from '@softpak/components/spx-helpers';\nimport { Subscription } from 'rxjs';\n\n@Component({\n selector: 'spx-number-check',\n host: {\n '(spxChange)': 'handleChangeEvent($event)'\n },\n imports: [\n SpxButtonComponent,\n FormsModule,\n ReactiveFormsModule\n ],\n template: `\n <div class=\"fixed top-0 left-0 right-0 bottom-0 z-40 bg-black\">\n <div class=\"mx-auto mt-32 max-w-96 bg-black rounded-lg\">\n <div class=\"flex flex-col gap-3 p-3\">\n <div class=\"bg-yellow-300 text-black text-center rounded p-3 text-xl\">\n <div class=\"font-bold\">{{ this.spxAction }}</div>\n {{ this.txtConfirmMessage }}\n </div>\n @if (!this.spxSimpleMode) {\n <form class=\"block grid grid-cols-4 gap-3\" [formGroup]=\"this.form\" (ngSubmit)=\"null\">\n <input #viewChild1 [formControl]=\"ctrl1\" type=\"text\" autofocus class=\"w-full text-center font-bold text-2xl p-3 rounded-lg focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 text-white bg-neutral-700\" [class.bg-red-700]=\"this.denied\" [class.bg-teal-700]=\"this.accepted\" maxlength=\"1\" (keypress)=\"onDigitInput($event)\" pattern=\"[0-9]*\" inputmode=\"numeric\" />\n <input #viewChild2 [formControl]=\"ctrl2\" type=\"text\" class=\"w-full text-center font-bold text-2xl p-3 rounded-lg focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 text-white bg-neutral-700\" [class.bg-red-700]=\"this.denied\" [class.bg-teal-700]=\"this.accepted\" maxlength=\"1\" (keypress)=\"onDigitInput($event)\" (keyup.backspace)=\"onBackspace($event)\" pattern=\"[0-9]*\" inputmode=\"numeric\" />\n <input #viewChild3 [formControl]=\"ctrl3\" type=\"text\" class=\"w-full text-center font-bold text-2xl p-3 rounded-lg focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 text-white bg-neutral-700\" [class.bg-red-700]=\"this.denied\" [class.bg-teal-700]=\"this.accepted\" maxlength=\"1\" (keypress)=\"onDigitInput($event)\" (keyup.backspace)=\"onBackspace($event)\" pattern=\"[0-9]*\" inputmode=\"numeric\" />\n <input #viewChild4 [formControl]=\"ctrl4\" type=\"text\" class=\"w-full text-center font-bold text-2xl p-3 rounded-lg focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 text-white bg-neutral-700\" [class.bg-red-700]=\"this.denied\" [class.bg-teal-700]=\"this.accepted\" maxlength=\"1\" (keypress)=\"onDigitInput($event)\" (keyup.backspace)=\"onBackspace($event)\" pattern=\"[0-9]*\" inputmode=\"numeric\" />\n </form>\n }\n @if (this.spxSimpleMode) {\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxSeverity.success\"\n (spxClick)=\"this.handleConfirm()\"\n >{{ this.txtConfirm }}</spx-button>\n }\n @if (!this.spxSimpleMode) {\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxSeverity.warning\"\n (spxClick)=\"this.handleReset()\"\n >{{ this.txtReset }}</spx-button>\n }\n <spx-button\n [spxFullWidth]=\"true\"\n [spxSeverity]=\"spxSeverity.error\"\n (spxClick)=\"this.handleCancel()\"\n >{{ this.txtCancel }}</spx-button>\n </div>\n </div>\n </div>\n `\n})\nexport class SpxNumberCheckComponent implements OnChanges, OnInit, OnDestroy {\n @Input() spxAction!: string;\n @Input() spxSimpleMode = false;\n @Input() spxPincode!: string;\n @Input() txtCancel!: string;\n @Input() txtConfirm!: string;\n @Input() txtConfirmMessage!: string;\n @Input() txtReset!: string;\n @Output() spxCancel: EventEmitter<void> = new EventEmitter<void>();\n @Output() spxConfirm: EventEmitter<void> = new EventEmitter<void>();\n @ViewChild('viewChild1') viewChild1!: ElementRef<HTMLInputElement>;\n @ViewChild('viewChild2') viewChild2!: ElementRef<HTMLInputElement>;\n @ViewChild('viewChild3') viewChild3!: ElementRef<HTMLInputElement>;\n @ViewChild('viewChild4') viewChild4!: ElementRef<HTMLInputElement>;\n form!: FormGroup;\n spxSeverity = SpxSeverityEnum;\n accepted = false;\n denied = false;\n listenToCtrl1?: Subscription;\n listenToCtrl2?: Subscription;\n listenToCtrl3?: Subscription;\n listenToCtrl4?: Subscription;\n listenToTyping?: Subscription;\n\n get ctrl1(): FormControl { return this.form.get('ctrl1') as FormControl; }\n get ctrl2(): FormControl { return this.form.get('ctrl2') as FormControl; }\n get ctrl3(): FormControl { return this.form.get('ctrl3') as FormControl; }\n get ctrl4(): FormControl { return this.form.get('ctrl4') as FormControl; }\n\n constructor(private readonly formBuilder: FormBuilder) {\n this.form = this.formBuilder.group({\n ctrl1: [null, []],\n ctrl2: [null, []],\n ctrl3: [null, []],\n ctrl4: [null, []],\n });\n }\n\n ngOnInit(): void {\n this.listenToTyping = this.form.valueChanges.subscribe(() => {\n this.accepted = false;\n this.denied = false;\n if (this.ctrl1.value && this.ctrl2.value && this.ctrl3.value && this.ctrl4.value) {\n this.checkPincode();\n }\n });\n\n this.listenToCtrl1 = this.ctrl1.valueChanges.subscribe(value => {\n if (value) {\n this.viewChild2.nativeElement.focus();\n } else {\n\n }\n });\n\n this.listenToCtrl2 = this.ctrl2.valueChanges.subscribe(value => {\n if (value) {\n this.viewChild3.nativeElement.focus();\n } else {\n\n }\n });\n\n this.listenToCtrl3 = this.ctrl3.valueChanges.subscribe(value => {\n if (value) {\n this.viewChild4.nativeElement.focus();\n } else {\n\n }\n });\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n setTimeout(() => {\n if (this?.viewChild1?.nativeElement) {\n this.viewChild1.nativeElement.focus();\n }\n }, 0);\n }\n\n ngOnDestroy(): void {\n if (this.listenToTyping) {\n this.listenToTyping.unsubscribe();\n }\n if (this.listenToCtrl1) {\n this.listenToCtrl1.unsubscribe();\n } \n if (this.listenToCtrl2) {\n this.listenToCtrl2.unsubscribe();\n } \n if (this.listenToCtrl3) {\n this.listenToCtrl3.unsubscribe();\n } \n }\n\n handleCancel(): void {\n this.spxCancel.emit();\n }\n\n handleConfirm(): void {\n this.spxConfirm.emit();\n }\n\n handleReset(): void {\n this.ctrl1.reset();\n this.ctrl2.reset();\n this.ctrl3.reset();\n this.ctrl4.reset();\n this.viewChild1.nativeElement.focus();\n this.accepted = false;\n this.denied = false;\n }\n\n onDigitInput(event: any) {\n let element: any;\n if (\n event.code === 'Digit0' ||\n event.code === 'Digit1' ||\n event.code === 'Digit2' ||\n event.code === 'Digit3' ||\n event.code === 'Digit4' ||\n event.code === 'Digit5' ||\n event.code === 'Digit6' ||\n event.code === 'Digit7' ||\n event.code === 'Digit8' ||\n event.code === 'Digit9' ||\n event.code === 'Numpad0' ||\n event.code === 'Numpad1' ||\n event.code === 'Numpad2' ||\n event.code === 'Numpad3' ||\n event.code === 'Numpad4' ||\n event.code === 'Numpad5' ||\n event.code === 'Numpad6' ||\n event.code === 'Numpad7' ||\n event.code === 'Numpad8' ||\n event.code === 'Numpad9') {\n element = event.srcElement.nextElementSibling;\n }\n if (element == null) {\n return;\n }\n else {\n // setTimeout(() => { element.focus(); });\n }\n }\n\n onBackspace(event: any) {\n event.srcElement.previousElementSibling.focus();\n }\n\n private checkPincode(): void {\n if (this.spxPincode === `${this.ctrl1.value}${this.ctrl2.value}${this.ctrl3.value}${this.ctrl4.value}`) {\n this.accepted = true;\n setTimeout(() => {\n this.spxConfirm.emit();\n }, 500);\n } else {\n this.denied = true;\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MAyDa,uBAAuB,CAAA;AAwBlC,IAAA,IAAI,KAAK,GAAA,EAAkB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAgB,CAAC;AACxE,IAAA,IAAI,KAAK,GAAA,EAAkB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAgB,CAAC;AACxE,IAAA,IAAI,KAAK,GAAA,EAAkB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAgB,CAAC;AACxE,IAAA,IAAI,KAAK,GAAA,EAAkB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAgB,CAAC;AAExE,IAAA,WAAA,CAA6B,WAAwB,EAAA;QAAxB,IAAW,CAAA,WAAA,GAAX,WAAW;QA3B/B,IAAa,CAAA,aAAA,GAAG,KAAK;AAMpB,QAAA,IAAA,CAAA,SAAS,GAAuB,IAAI,YAAY,EAAQ;AACxD,QAAA,IAAA,CAAA,UAAU,GAAuB,IAAI,YAAY,EAAQ;QAMnE,IAAW,CAAA,WAAA,GAAG,eAAe;QAC7B,IAAQ,CAAA,QAAA,GAAG,KAAK;Q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hB;gBACS,SAAS,EAAA,CAAA;sBAAlB;gBACS,UAAU,EAAA,CAAA;sBAAnB;gBACwB,UAAU,EAAA,CAAA;sBAAlC,SAAS;uBAAC,YAAY;gBACE,UAAU,EAAA,CAAA;sBAAlC,SAAS;uBAAC,YAAY;gBACE,UAAU,EAAA,CAAA;sBAAlC,SAAS;uBAAC,YAAY;gBACE,UAAU,EAAA,CAAA;sBAAlC,SAAS;uBAAC,YAAY;;;ACtEzB;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"softpak-components-spx-number-check.mjs","sources":["../../../../projects/softpak/components/spx-number-check/spx-number-check.component.ts","../../../../projects/softpak/components/spx-number-check/spx-number-check.component.html","../../../../projects/softpak/components/spx-number-check/softpak-components-spx-number-check.ts"],"sourcesContent":["\r\nimport { ChangeDetectionStrategy, Component, ElementRef, OnDestroy, OnInit, computed, input, output, signal, viewChild } from '@angular/core';\r\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\r\nimport { SpxSeverityEnum, unsubscribeSubscriptions } from '@softpak/components/spx-helpers';\r\nimport { Subscription } from 'rxjs';\r\n\r\n@Component({\r\n selector: 'spx-number-check',\r\n host: {\r\n '(spxChange)': 'handleChangeEvent($event)'\r\n },\r\n imports: [\r\n SpxButtonComponent,\r\n FormsModule,\r\n ReactiveFormsModule\r\n ],\r\n templateUrl: './spx-number-check.component.html',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n standalone: true,\r\n})\r\nexport class SpxNumberCheckComponent implements OnInit, OnDestroy {\r\n readonly spxAction = input.required<string>();\r\n readonly spxSimpleMode = input(false);\r\n readonly spxPincode = input.required<string>();\r\n readonly txtCancel = input.required<string>();\r\n readonly txtConfirm = input.required<string>();\r\n readonly txtConfirmMessage = input.required<string>();\r\n readonly txtReset = input.required<string>();\r\n spxCancel = output();\r\n spxConfirm = output();\r\n readonly viewChild1 = viewChild.required<HTMLInputElement>('viewChild1');\r\n readonly viewChild2 = viewChild.required<ElementRef<HTMLInputElement>>('viewChild2');\r\n readonly viewChild3 = viewChild.required<ElementRef<HTMLInputElement>>('viewChild3');\r\n readonly viewChild4 = viewChild.required<ElementRef<HTMLInputElement>>('viewChild4');\r\n form = signal<FormGroup| null>(null);\r\n spxSeverity = SpxSeverityEnum;\r\n accepted = signal<boolean>(false);\r\n denied = signal<boolean>(false);\r\n private subscription: {\r\n listenToCtrl1?: Subscription;\r\n listenToCtrl2?: Subscription;\r\n listenToCtrl3?: Subscription;\r\n listenToCtrl4?: Subscription;\r\n listenToTyping?: Subscription;\r\n } = {};\r\n\r\n readonly ctrl1 = computed(() => this.form()?.get('ctrl1') as FormControl);\r\n readonly ctrl2 = computed(() => this.form()?.get('ctrl2') as FormControl);\r\n readonly ctrl3 = computed(() => this.form()?.get('ctrl3') as FormControl);\r\n readonly ctrl4 = computed(() => this.form()?.get('ctrl4') as FormControl);\r\n\r\n constructor(private readonly formBuilder: FormBuilder) {\r\n this.form.set(this.formBuilder.group({\r\n ctrl1: [null, []],\r\n ctrl2: [null, []],\r\n ctrl3: [null, []],\r\n ctrl4: [null, []],\r\n }));\r\n }\r\n\r\n ngOnInit(): void {\r\n this.subscription.listenToTyping = this.form()!.valueChanges.subscribe(() => {\r\n this.accepted.set(false);\r\n this.denied.set(false);\r\n if (this.ctrl1().value && this.ctrl2().value && this.ctrl3().value && this.ctrl4().value) {\r\n this.checkPincode();\r\n }\r\n });\r\n\r\n this.subscription.listenToCtrl1 = this.ctrl1().valueChanges.subscribe(value => {\r\n if (value) {\r\n this.viewChild2().nativeElement.focus();\r\n } else {\r\n\r\n }\r\n });\r\n\r\n this.subscription.listenToCtrl2 = this.ctrl2().valueChanges.subscribe(value => {\r\n if (value) {\r\n this.viewChild3().nativeElement.focus();\r\n } else {\r\n\r\n }\r\n });\r\n\r\n this.subscription.listenToCtrl3 = this.ctrl3().valueChanges.subscribe(value => {\r\n if (value) {\r\n this.viewChild4().nativeElement.focus();\r\n } else {\r\n\r\n }\r\n });\r\n }\r\n\r\n //TODO CHECK THIS\r\n // ngOnChanges(changes: SimpleChanges): void {\r\n // setTimeout(() => {\r\n // const viewChild1 = this?.viewChild1();\r\n // if (viewChild1?) {\r\n // viewChild1.focus();\r\n // }\r\n // }, 0);\r\n // }\r\n\r\n ngOnDestroy(): void {\r\n unsubscribeSubscriptions(this.subscription);\r\n }\r\n\r\n handleCancel(): void {\r\n this.spxCancel.emit();\r\n }\r\n\r\n handleConfirm(): void {\r\n this.spxConfirm.emit();\r\n }\r\n\r\n handleReset(): void {\r\n this.ctrl1().reset();\r\n this.ctrl2().reset();\r\n this.ctrl3().reset();\r\n this.ctrl4().reset();\r\n this.viewChild1().focus();\r\n this.accepted.set(false);\r\n this.denied.set(false);\r\n }\r\n\r\n onDigitInput(event: KeyboardEvent) {\r\n // let element: HTMLElement | null;\r\n // if (\r\n // event.code === 'Digit0' ||\r\n // event.code === 'Digit1' ||\r\n // event.code === 'Digit2' ||\r\n // event.code === 'Digit3' ||\r\n // event.code === 'Digit4' ||\r\n // event.code === 'Digit5' ||\r\n // event.code === 'Digit6' ||\r\n // event.code === 'Digit7' ||\r\n // event.code === 'Digit8' ||\r\n // event.code === 'Digit9' ||\r\n // event.code === 'Numpad0' ||\r\n // event.code === 'Numpad1' ||\r\n // event.code === 'Numpad2' ||\r\n // event.code === 'Numpad3' ||\r\n // event.code === 'Numpad4' ||\r\n // event.code === 'Numpad5' ||\r\n // event.code === 'Numpad6' ||\r\n // event.code === 'Numpad7' ||\r\n // event.code === 'Numpad8' ||\r\n // event.code === 'Numpad9') {\r\n // element = event.srcElement.nextElementSibling;\r\n\r\n // if (element === null) {\r\n // return;\r\n // }\r\n // else {\r\n // // setTimeout(() => { element.focus(); });\r\n // }\r\n // }\r\n \r\n }\r\n\r\n onBackspace(event: Event) {\r\n (event.target as HTMLElement)?.focus();\r\n }\r\n\r\n private checkPincode(): void {\r\n if (this.spxPincode() === `${this.ctrl1().value}${this.ctrl2().value}${this.ctrl3().value}${this.ctrl4().value}`) {\r\n this.accepted.set(true);\r\n setTimeout(() => {\r\n this.spxConfirm.emit();\r\n }, 500);\r\n } else {\r\n this.denied.set(true);\r\n }\r\n }\r\n}\r\n","<div class=\"fixed top-0 left-0 right-0 bottom-0 z-40 bg-black\">\r\n <div class=\"mx-auto mt-32 max-w-96 bg-black rounded-lg\">\r\n <div class=\"flex flex-col gap-3 p-3\">\r\n <div class=\"bg-yellow-300 text-black text-center rounded p-3 text-xl\">\r\n <div class=\"font-bold\">{{ this.spxAction() }}</div>\r\n {{ this.txtConfirmMessage() }}\r\n </div>\r\n @if (!this.spxSimpleMode()) {\r\n <form class=\"block grid grid-cols-4 gap-3\" [formGroup]=\"this.form()!\" (ngSubmit)=\"null\">\r\n <input #viewChild1 [formControl]=\"ctrl1()\" type=\"text\" autofocus class=\"w-full text-center font-bold text-2xl p-3 rounded-lg focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 text-white bg-neutral-700\" [class.bg-red-700]=\"this.denied()\" [class.bg-teal-700]=\"this.accepted()\" maxlength=\"1\" (keypress)=\"onDigitInput($event)\" pattern=\"[0-9]*\" inputmode=\"numeric\" />\r\n <input #viewChild2 [formControl]=\"ctrl2()\" type=\"text\" class=\"w-full text-center font-bold text-2xl p-3 rounded-lg focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 text-white bg-neutral-700\" [class.bg-red-700]=\"this.denied()\" [class.bg-teal-700]=\"this.accepted()\" maxlength=\"1\" (keypress)=\"onDigitInput($event)\" (keyup.backspace)=\"onBackspace($event)\" pattern=\"[0-9]*\" inputmode=\"numeric\" />\r\n <input #viewChild3 [formControl]=\"ctrl3()\" type=\"text\" class=\"w-full text-center font-bold text-2xl p-3 rounded-lg focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 text-white bg-neutral-700\" [class.bg-red-700]=\"this.denied()\" [class.bg-teal-700]=\"this.accepted()\" maxlength=\"1\" (keypress)=\"onDigitInput($event)\" (keyup.backspace)=\"onBackspace($event)\" pattern=\"[0-9]*\" inputmode=\"numeric\" />\r\n <input #viewChild4 [formControl]=\"ctrl4()\" type=\"text\" class=\"w-full text-center font-bold text-2xl p-3 rounded-lg focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 text-white bg-neutral-700\" [class.bg-red-700]=\"this.denied()\" [class.bg-teal-700]=\"this.accepted()\" maxlength=\"1\" (keypress)=\"onDigitInput($event)\" (keyup.backspace)=\"onBackspace($event)\" pattern=\"[0-9]*\" inputmode=\"numeric\" />\r\n </form>\r\n }\r\n @if (this.spxSimpleMode()) {\r\n <spx-button\r\n [spxFullWidth]=\"true\"\r\n [spxSeverity]=\"spxSeverity.success\"\r\n (spxClick)=\"this.handleConfirm()\"\r\n >{{ this.txtConfirm() }}</spx-button>\r\n }\r\n @if (!this.spxSimpleMode()) {\r\n <spx-button\r\n [spxFullWidth]=\"true\"\r\n [spxSeverity]=\"spxSeverity.warning\"\r\n (spxClick)=\"this.handleReset()\"\r\n >{{ this.txtReset() }}</spx-button>\r\n }\r\n <spx-button\r\n [spxFullWidth]=\"true\"\r\n [spxSeverity]=\"spxSeverity.error\"\r\n (spxClick)=\"this.handleCancel()\"\r\n >{{ this.txtCancel() }}</spx-button>\r\n </div>\r\n </div>\r\n</div>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MAqBa,uBAAuB,CAAA;AA+BlC,IAAA,WAAA,CAA6B,WAAwB,EAAA;QAAxB,IAAW,CAAA,WAAA,GAAX,WAAW;AA9B/B,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,QAAQ,EAAU;AACpC,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC;AAC5B,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAC,QAAQ,EAAU;AACrC,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,QAAQ,EAAU;AACpC,QAAA,IAAA,CA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EAAA,QAAA,EAAA,CAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,kBAAA,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,CAAA,WAAA,CAAA,EAAA,OAAA,EAAA,CAAA,UAAA,CAAA,EAAA,QAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAMd,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAdnC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,EACtB,IAAA,EAAA;AACF,wBAAA,aAAa,EAAE;qBAClB,EACQ,OAAA,EAAA;wBACL,kBAAkB;wBAClB,WAAW;wBACX;AACH,qBAAA,EAAA,eAAA,EAEgB,uBAAuB,CAAC,MAAM,EAAA,UAAA,EACnC,IAAI,EAAA,QAAA,EAAA,26FAAA,EAAA;;;AEnBpB;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { input, output, Component } from '@angular/core';
|
|
3
3
|
import { SpxButtonComponent } from '@softpak/components/spx-button';
|
|
4
4
|
import * as i1 from '@fortawesome/angular-fontawesome';
|
|
5
5
|
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
@@ -9,13 +9,20 @@ import { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';
|
|
|
9
9
|
|
|
10
10
|
class SpxPaginationComponent {
|
|
11
11
|
constructor() {
|
|
12
|
-
this.
|
|
12
|
+
this.faArrowLeft = input.required();
|
|
13
|
+
this.faArrowRight = input.required();
|
|
14
|
+
this.spxPage = input.required();
|
|
15
|
+
this.spxMaxPages = input.required();
|
|
16
|
+
this.textNext = input.required();
|
|
17
|
+
this.textPage = input.required();
|
|
18
|
+
this.textPrevious = input.required();
|
|
19
|
+
this.spxPageChange = output();
|
|
13
20
|
}
|
|
14
21
|
onPageChange(page) {
|
|
15
22
|
this.spxPageChange.emit(page);
|
|
16
23
|
}
|
|
17
24
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxPaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
18
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
25
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: SpxPaginationComponent, isStandalone: true, selector: "spx-pagination", inputs: { faArrowLeft: { classPropertyName: "faArrowLeft", publicName: "faArrowLeft", isSignal: true, isRequired: true, transformFunction: null }, faArrowRight: { classPropertyName: "faArrowRight", publicName: "faArrowRight", isSignal: true, isRequired: true, transformFunction: null }, spxPage: { classPropertyName: "spxPage", publicName: "spxPage", isSignal: true, isRequired: true, transformFunction: null }, spxMaxPages: { classPropertyName: "spxMaxPages", publicName: "spxMaxPages", isSignal: true, isRequired: true, transformFunction: null }, textNext: { classPropertyName: "textNext", publicName: "textNext", isSignal: true, isRequired: true, transformFunction: null }, textPage: { classPropertyName: "textPage", publicName: "textPage", isSignal: true, isRequired: true, transformFunction: null }, textPrevious: { classPropertyName: "textPrevious", publicName: "textPrevious", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { spxPageChange: "spxPageChange" }, ngImport: i0, template: "<div class=\"inline mx-auto flex gap-3 items-center font-bold\">\r\n <spx-button (click)=\"onPageChange(spxPage() - 1)\" [spxDisabled]=\"spxPage() === 1\">\r\n <fa-icon [icon]=\"faArrowLeft()\"></fa-icon> {{ textPrevious() | translate | capitalize }}\r\n </spx-button>\r\n {{ textPage() | translate | capitalize }} {{ spxPage() }}\r\n <spx-button [spxDisabled]=\"spxMaxPages() > spxPage()\" (click)=\"onPageChange(spxPage() + 1)\">\r\n {{ textNext() | translate | capitalize }} <fa-icon [icon]=\"faArrowRight()\"></fa-icon>\r\n </spx-button>\r\n</div>", dependencies: [{ kind: "ngmodule", type: FontAwesomeModule }, { kind: "component", type: i1.FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "animation", "mask", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { kind: "component", type: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType"], outputs: ["spxClick"] }, { kind: "pipe", type: SpxCapitalizePipe, name: "capitalize" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
|
|
19
26
|
}
|
|
20
27
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxPaginationComponent, decorators: [{
|
|
21
28
|
type: Component,
|
|
@@ -24,24 +31,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
24
31
|
SpxButtonComponent,
|
|
25
32
|
SpxCapitalizePipe,
|
|
26
33
|
TranslateModule,
|
|
27
|
-
], template: "<div class=\"inline mx-auto flex gap-3 items-center font-bold\">\n <spx-button (click)=\"onPageChange(spxPage - 1)\" [spxDisabled]=\"spxPage === 1\">\n <fa-icon [icon]=\"faArrowLeft\"></fa-icon> {{ textPrevious | translate | capitalize }}\n </spx-button>\n {{ textPage | translate | capitalize }} {{ spxPage }}\n <spx-button [spxDisabled]=\"spxMaxPages > spxPage\" (click)=\"onPageChange(spxPage + 1)\">\n {{ textNext | translate | capitalize }} <fa-icon [icon]=\"faArrowRight\"></fa-icon>\n </spx-button>\n</div>" }]
|
|
28
|
-
}]
|
|
29
|
-
type: Input
|
|
30
|
-
}], faArrowRight: [{
|
|
31
|
-
type: Input
|
|
32
|
-
}], spxPage: [{
|
|
33
|
-
type: Input
|
|
34
|
-
}], spxMaxPages: [{
|
|
35
|
-
type: Input
|
|
36
|
-
}], textNext: [{
|
|
37
|
-
type: Input
|
|
38
|
-
}], textPage: [{
|
|
39
|
-
type: Input
|
|
40
|
-
}], textPrevious: [{
|
|
41
|
-
type: Input
|
|
42
|
-
}], spxPageChange: [{
|
|
43
|
-
type: Output
|
|
44
|
-
}] } });
|
|
34
|
+
], template: "<div class=\"inline mx-auto flex gap-3 items-center font-bold\">\r\n <spx-button (click)=\"onPageChange(spxPage() - 1)\" [spxDisabled]=\"spxPage() === 1\">\r\n <fa-icon [icon]=\"faArrowLeft()\"></fa-icon> {{ textPrevious() | translate | capitalize }}\r\n </spx-button>\r\n {{ textPage() | translate | capitalize }} {{ spxPage() }}\r\n <spx-button [spxDisabled]=\"spxMaxPages() > spxPage()\" (click)=\"onPageChange(spxPage() + 1)\">\r\n {{ textNext() | translate | capitalize }} <fa-icon [icon]=\"faArrowRight()\"></fa-icon>\r\n </spx-button>\r\n</div>" }]
|
|
35
|
+
}] });
|
|
45
36
|
|
|
46
37
|
/**
|
|
47
38
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"softpak-components-spx-pagination.mjs","sources":["../../../../projects/softpak/components/spx-pagination/spx-pagination.component.ts","../../../../projects/softpak/components/spx-pagination/spx-pagination.component.html","../../../../projects/softpak/components/spx-pagination/softpak-components-spx-pagination.ts"],"sourcesContent":["import { Component,
|
|
1
|
+
{"version":3,"file":"softpak-components-spx-pagination.mjs","sources":["../../../../projects/softpak/components/spx-pagination/spx-pagination.component.ts","../../../../projects/softpak/components/spx-pagination/spx-pagination.component.html","../../../../projects/softpak/components/spx-pagination/softpak-components-spx-pagination.ts"],"sourcesContent":["import { Component, input, output } from '@angular/core';\r\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\r\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\r\nimport { IconProp } from '@fortawesome/angular-fontawesome/types';\r\nimport { TranslateModule } from '@ngx-translate/core';\r\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\r\n\r\n@Component({\r\n selector: 'spx-pagination',\r\n templateUrl: './spx-pagination.component.html',\r\n imports: [\r\n FontAwesomeModule,\r\n SpxButtonComponent,\r\n SpxCapitalizePipe,\r\n TranslateModule,\r\n ]\r\n})\r\nexport class SpxPaginationComponent {\r\n readonly faArrowLeft = input.required<IconProp>();\r\n readonly faArrowRight = input.required<IconProp>();\r\n readonly spxPage = input.required<number>();\r\n readonly spxMaxPages = input.required<number>();\r\n readonly textNext = input.required<string>();\r\n readonly textPage = input.required<string>();\r\n readonly textPrevious = input.required<string>();\r\n spxPageChange = output<number>();\r\n\r\n onPageChange(page: number) {\r\n this.spxPageChange.emit(page);\r\n }\r\n}","<div class=\"inline mx-auto flex gap-3 items-center font-bold\">\r\n <spx-button (click)=\"onPageChange(spxPage() - 1)\" [spxDisabled]=\"spxPage() === 1\">\r\n <fa-icon [icon]=\"faArrowLeft()\"></fa-icon> {{ textPrevious() | translate | capitalize }}\r\n </spx-button>\r\n {{ textPage() | translate | capitalize }} {{ spxPage() }}\r\n <spx-button [spxDisabled]=\"spxMaxPages() > spxPage()\" (click)=\"onPageChange(spxPage() + 1)\">\r\n {{ textNext() | translate | capitalize }} <fa-icon [icon]=\"faArrowRight()\"></fa-icon>\r\n </spx-button>\r\n</div>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MAiBa,sBAAsB,CAAA;AAVnC,IAAA,WAAA,GAAA;AAWW,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAC,QAAQ,EAAY;AACxC,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAC,QAAQ,EAAY;AACzC,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,EAAU;AAClC,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAC,QAAQ,EAAU;AACtC,QAAA,IAAA,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