@softpak/components 19.17.0-beta.4 → 19.17.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.
- package/README.md +24 -24
- package/fesm2022/softpak-components-spx-alert.mjs +6 -7
- 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 +91 -23
- package/fesm2022/softpak-components-spx-app-expiry.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-button.mjs +22 -8
- 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 +91 -20
- package/fesm2022/softpak-components-spx-card.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-change-details.mjs +64 -48
- 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 +28 -24
- 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 +33 -8
- package/fesm2022/softpak-components-spx-form-section.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-form-view.mjs +53 -39
- 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 +24 -33
- package/fesm2022/softpak-components-spx-inputs.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-navigation.mjs +89 -34
- package/fesm2022/softpak-components-spx-navigation.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-number-check.mjs +198 -91
- package/fesm2022/softpak-components-spx-number-check.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-pagination.mjs +21 -12
- package/fesm2022/softpak-components-spx-pagination.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-patch.mjs +39 -8
- 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 +22 -8
- package/fesm2022/softpak-components-spx-progress-bar.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-spinner.mjs +160 -15
- package/fesm2022/softpak-components-spx-spinner.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-stock-info.mjs +128 -71
- 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 +162 -35
- package/fesm2022/softpak-components-spx-toaster.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 +55 -56
- package/fesm2022/softpak-components-spx-validation.mjs.map +1 -1
- package/package.json +25 -25
- 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 +3 -0
- package/spx-card/spx-card-item/spx-card-item.component.d.ts +1 -0
- package/spx-card/spx-card.component.d.ts +9 -8
- package/spx-change-details/spx-change-details.component.d.ts +23 -22
- 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 +16 -15
- package/spx-form-view/spx-form-view.component.d.ts +1 -1
- package/spx-inputs/spx-input-text/spx-input-text.component.d.ts +1 -4
- package/spx-inputs/spx-input.component.d.ts +0 -1
- package/spx-navigation/public-api.d.ts +2 -2
- package/spx-navigation/spx-home-tile.component.d.ts +11 -0
- package/spx-navigation/{spx-home-tile/spx-home-tiles.component.d.ts → spx-home-tiles.component.d.ts} +2 -2
- package/spx-navigation/spx-navigation.component.d.ts +8 -11
- package/spx-navigation/store/spx-navigation/spx-navigation.actions.d.ts +3 -3
- package/spx-number-check/spx-number-check.component.d.ts +32 -26
- package/spx-pagination/spx-pagination.component.d.ts +10 -9
- 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 +49 -48
- package/spx-toaster/src/spx-toaster-message.interface.d.ts +1 -5
- package/spx-toaster/src/spx-toaster.component.d.ts +14 -6
- package/spx-update/store/spx-update-check/spx-update-check.actions.d.ts +5 -5
- package/spx-update/store/spx-update-pending/spx-update-pending.actions.d.ts +1 -1
- package/spx-validation/spx-validate-control.component.d.ts +20 -22
- package/tailwind.css +1 -1
- package/spx-navigation/spx-home-tile/spx-home-tile.component.d.ts +0 -11
|
@@ -1,83 +1,80 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { EventEmitter, Component, Input, Output, ViewChild } 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
|
|
6
|
+
import { SpxSeverityEnum } 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'); }
|
|
9
13
|
constructor(formBuilder) {
|
|
10
14
|
this.formBuilder = formBuilder;
|
|
11
|
-
this.
|
|
12
|
-
this.
|
|
13
|
-
this.
|
|
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);
|
|
15
|
+
this.spxSimpleMode = false;
|
|
16
|
+
this.spxCancel = new EventEmitter();
|
|
17
|
+
this.spxConfirm = new EventEmitter();
|
|
25
18
|
this.spxSeverity = SpxSeverityEnum;
|
|
26
|
-
this.accepted =
|
|
27
|
-
this.denied =
|
|
28
|
-
this.
|
|
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({
|
|
19
|
+
this.accepted = false;
|
|
20
|
+
this.denied = false;
|
|
21
|
+
this.form = this.formBuilder.group({
|
|
34
22
|
ctrl1: [null, []],
|
|
35
23
|
ctrl2: [null, []],
|
|
36
24
|
ctrl3: [null, []],
|
|
37
25
|
ctrl4: [null, []],
|
|
38
|
-
})
|
|
26
|
+
});
|
|
39
27
|
}
|
|
40
28
|
ngOnInit() {
|
|
41
|
-
this.
|
|
42
|
-
this.accepted
|
|
43
|
-
this.denied
|
|
44
|
-
if (this.ctrl1
|
|
29
|
+
this.listenToTyping = this.form.valueChanges.subscribe(() => {
|
|
30
|
+
this.accepted = false;
|
|
31
|
+
this.denied = false;
|
|
32
|
+
if (this.ctrl1.value && this.ctrl2.value && this.ctrl3.value && this.ctrl4.value) {
|
|
45
33
|
this.checkPincode();
|
|
46
34
|
}
|
|
47
35
|
});
|
|
48
|
-
this.
|
|
36
|
+
this.listenToCtrl1 = this.ctrl1.valueChanges.subscribe(value => {
|
|
49
37
|
if (value) {
|
|
50
|
-
this.viewChild2
|
|
38
|
+
this.viewChild2.nativeElement.focus();
|
|
51
39
|
}
|
|
52
40
|
else {
|
|
53
41
|
}
|
|
54
42
|
});
|
|
55
|
-
this.
|
|
43
|
+
this.listenToCtrl2 = this.ctrl2.valueChanges.subscribe(value => {
|
|
56
44
|
if (value) {
|
|
57
|
-
this.viewChild3
|
|
45
|
+
this.viewChild3.nativeElement.focus();
|
|
58
46
|
}
|
|
59
47
|
else {
|
|
60
48
|
}
|
|
61
49
|
});
|
|
62
|
-
this.
|
|
50
|
+
this.listenToCtrl3 = this.ctrl3.valueChanges.subscribe(value => {
|
|
63
51
|
if (value) {
|
|
64
|
-
this.viewChild4
|
|
52
|
+
this.viewChild4.nativeElement.focus();
|
|
65
53
|
}
|
|
66
54
|
else {
|
|
67
55
|
}
|
|
68
56
|
});
|
|
69
57
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
// }, 0);
|
|
78
|
-
// }
|
|
58
|
+
ngOnChanges(changes) {
|
|
59
|
+
setTimeout(() => {
|
|
60
|
+
if (this?.viewChild1?.nativeElement) {
|
|
61
|
+
this.viewChild1.nativeElement.focus();
|
|
62
|
+
}
|
|
63
|
+
}, 0);
|
|
64
|
+
}
|
|
79
65
|
ngOnDestroy() {
|
|
80
|
-
|
|
66
|
+
if (this.listenToTyping) {
|
|
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
|
+
}
|
|
81
78
|
}
|
|
82
79
|
handleCancel() {
|
|
83
80
|
this.spxCancel.emit();
|
|
@@ -86,73 +83,183 @@ class SpxNumberCheckComponent {
|
|
|
86
83
|
this.spxConfirm.emit();
|
|
87
84
|
}
|
|
88
85
|
handleReset() {
|
|
89
|
-
this.ctrl1
|
|
90
|
-
this.ctrl2
|
|
91
|
-
this.ctrl3
|
|
92
|
-
this.ctrl4
|
|
93
|
-
this.viewChild1
|
|
94
|
-
this.accepted
|
|
95
|
-
this.denied
|
|
86
|
+
this.ctrl1.reset();
|
|
87
|
+
this.ctrl2.reset();
|
|
88
|
+
this.ctrl3.reset();
|
|
89
|
+
this.ctrl4.reset();
|
|
90
|
+
this.viewChild1.nativeElement.focus();
|
|
91
|
+
this.accepted = false;
|
|
92
|
+
this.denied = false;
|
|
96
93
|
}
|
|
97
94
|
onDigitInput(event) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
// }
|
|
95
|
+
let element;
|
|
96
|
+
if (event.code === 'Digit0' ||
|
|
97
|
+
event.code === 'Digit1' ||
|
|
98
|
+
event.code === 'Digit2' ||
|
|
99
|
+
event.code === 'Digit3' ||
|
|
100
|
+
event.code === 'Digit4' ||
|
|
101
|
+
event.code === 'Digit5' ||
|
|
102
|
+
event.code === 'Digit6' ||
|
|
103
|
+
event.code === 'Digit7' ||
|
|
104
|
+
event.code === 'Digit8' ||
|
|
105
|
+
event.code === 'Digit9' ||
|
|
106
|
+
event.code === 'Numpad0' ||
|
|
107
|
+
event.code === 'Numpad1' ||
|
|
108
|
+
event.code === 'Numpad2' ||
|
|
109
|
+
event.code === 'Numpad3' ||
|
|
110
|
+
event.code === 'Numpad4' ||
|
|
111
|
+
event.code === 'Numpad5' ||
|
|
112
|
+
event.code === 'Numpad6' ||
|
|
113
|
+
event.code === 'Numpad7' ||
|
|
114
|
+
event.code === 'Numpad8' ||
|
|
115
|
+
event.code === 'Numpad9') {
|
|
116
|
+
element = event.srcElement.nextElementSibling;
|
|
117
|
+
}
|
|
118
|
+
if (element == null) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
// setTimeout(() => { element.focus(); });
|
|
123
|
+
}
|
|
128
124
|
}
|
|
129
125
|
onBackspace(event) {
|
|
130
|
-
event.
|
|
126
|
+
event.srcElement.previousElementSibling.focus();
|
|
131
127
|
}
|
|
132
128
|
checkPincode() {
|
|
133
|
-
if (this.spxPincode
|
|
134
|
-
this.accepted
|
|
129
|
+
if (this.spxPincode === `${this.ctrl1.value}${this.ctrl2.value}${this.ctrl3.value}${this.ctrl4.value}`) {
|
|
130
|
+
this.accepted = true;
|
|
135
131
|
setTimeout(() => {
|
|
136
132
|
this.spxConfirm.emit();
|
|
137
133
|
}, 500);
|
|
138
134
|
}
|
|
139
135
|
else {
|
|
140
|
-
this.denied
|
|
136
|
+
this.denied = true;
|
|
141
137
|
}
|
|
142
138
|
}
|
|
143
139
|
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 }); }
|
|
144
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: SpxNumberCheckComponent, isStandalone: true, selector: "spx-number-check", inputs: { spxAction:
|
|
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 }], usesOnChanges: true, ngImport: i0, template: `
|
|
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"] }] }); }
|
|
145
179
|
}
|
|
146
180
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxNumberCheckComponent, decorators: [{
|
|
147
181
|
type: Component,
|
|
148
|
-
args: [{
|
|
182
|
+
args: [{
|
|
183
|
+
selector: 'spx-number-check',
|
|
184
|
+
host: {
|
|
149
185
|
'(spxChange)': 'handleChangeEvent($event)'
|
|
150
|
-
},
|
|
186
|
+
},
|
|
187
|
+
imports: [
|
|
151
188
|
SpxButtonComponent,
|
|
152
189
|
FormsModule,
|
|
153
190
|
ReactiveFormsModule
|
|
154
|
-
],
|
|
155
|
-
|
|
191
|
+
],
|
|
192
|
+
template: `
|
|
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
|
+
}] } });
|
|
156
263
|
|
|
157
264
|
/**
|
|
158
265
|
* 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/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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,SAAA,EAAA,eAAA,EAAA,cAAA,EAAA,aAAA,EAAA,SAAA,EAAA,aAAA,EAAA,SAAA,CAAA,EAAA,OAAA,EAAA,CAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,WAAW,u9BACX,mBAAmB,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,oBAAA,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,aAAA,EAAA,UAAA,EAAA,SAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAA,CAAA,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
|
+
{"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,K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AQ,EAAE,kBAAkB;AAC5B,oBAAA,IAAI,EAAE;AACF,wBAAA,aAAa,EAAE;AAClB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACL,kBAAkB;wBAClB,WAAW;wBACX;AACH,qBAAA;AACD,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCT,IAAA;AACJ,iBAAA;gFAEU,SAAS,EAAA,CAAA;sBAAjB;gBACQ,aAAa,EAAA,CAAA;sBAArB;gBACQ,UAAU,EAAA,CAAA;sBAAlB;gBACQ,SAAS,EAAA,CAAA;sBAAjB;gBACQ,UAAU,EAAA,CAAA;sBAAlB;gBACQ,iBAAiB,EAAA,CAAA;sBAAzB;gBACQ,QAAQ,EAAA,CAAA;sBAAhB;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,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { EventEmitter, Component, Input, Output } 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,20 +9,13 @@ import { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';
|
|
|
9
9
|
|
|
10
10
|
class SpxPaginationComponent {
|
|
11
11
|
constructor() {
|
|
12
|
-
this.
|
|
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();
|
|
12
|
+
this.spxPageChange = new EventEmitter();
|
|
20
13
|
}
|
|
21
14
|
onPageChange(page) {
|
|
22
15
|
this.spxPageChange.emit(page);
|
|
23
16
|
}
|
|
24
17
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxPaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
25
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
18
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: SpxPaginationComponent, isStandalone: true, selector: "spx-pagination", inputs: { faArrowLeft: "faArrowLeft", faArrowRight: "faArrowRight", spxPage: "spxPage", spxMaxPages: "spxMaxPages", textNext: "textNext", textPage: "textPage", textPrevious: "textPrevious" }, outputs: { spxPageChange: "spxPageChange" }, ngImport: i0, 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>", 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" }] }); }
|
|
26
19
|
}
|
|
27
20
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxPaginationComponent, decorators: [{
|
|
28
21
|
type: Component,
|
|
@@ -31,8 +24,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
31
24
|
SpxButtonComponent,
|
|
32
25
|
SpxCapitalizePipe,
|
|
33
26
|
TranslateModule,
|
|
34
|
-
], template: "<div class=\"inline mx-auto flex gap-3 items-center font-bold\">\
|
|
35
|
-
}]
|
|
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
|
+
}], propDecorators: { faArrowLeft: [{
|
|
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
|
+
}] } });
|
|
36
45
|
|
|
37
46
|
/**
|
|
38
47
|
* 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, EventEmitter, Input, Output } from '@angular/core';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\nimport { IconProp } from '@fortawesome/angular-fontawesome/types';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\n\n@Component({\n selector: 'spx-pagination',\n templateUrl: './spx-pagination.component.html',\n imports: [\n FontAwesomeModule,\n SpxButtonComponent,\n SpxCapitalizePipe,\n TranslateModule,\n ]\n})\nexport class SpxPaginationComponent {\n @Input() faArrowLeft!: IconProp;\n @Input() faArrowRight!: IconProp;\n @Input() spxPage!: number;\n @Input() spxMaxPages!: number;\n @Input() textNext!: string;\n @Input() textPage!: string;\n @Input() textPrevious!: string;\n\n @Output() spxPageChange: EventEmitter<number> = new EventEmitter<number>();\n\n onPageChange(page: number) {\n this.spxPageChange.emit(page);\n }\n}","<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>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MAiBa,sBAAsB,CAAA;AAVnC,IAAA,WAAA,GAAA;AAmBY,QAAA,IAAA,CAAA,aAAa,GAAyB,IAAI,YAAY,EAAU;AAK3E;AAHC,IAAA,YAAY,CAAC,IAAY,EAAA;AACvB,QAAA,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;;8GAZpB,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAtB,sBAAsB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,EAAA,WAAA,EAAA,aAAA,EAAA,YAAA,EAAA,cAAA,EAAA,OAAA,EAAA,SAAA,EAAA,WAAA,EAAA,aAAA,EAAA,QAAA,EAAA,UAAA,EAAA,QAAA,EAAA,UAAA,EAAA,YAAA,EAAA,cAAA,EAAA,EAAA,OAAA,EAAA,EAAA,aAAA,EAAA,eAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECjBnC,8gBAQM,EDGE,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAiB,6PACjB,kBAAkB,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,CAAA,aAAA,EAAA,UAAA,EAAA,gBAAA,EAAA,SAAA,EAAA,eAAA,EAAA,cAAA,EAAA,aAAA,EAAA,SAAA,EAAA,aAAA,EAAA,SAAA,CAAA,EAAA,OAAA,EAAA,CAAA,UAAA,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