@softpak/components 0.0.0-beta.12 → 0.0.0-beta.120
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/esm2022/spx-alert/spx-alert.component.mjs +5 -2
- package/esm2022/spx-change-details/public-api.mjs +2 -0
- package/esm2022/spx-change-details/softpak-components-spx-change-details.mjs +5 -0
- package/esm2022/spx-change-details/spx-change-details-value.interface.mjs +2 -0
- package/esm2022/spx-change-details/spx-change-details.component.mjs +118 -0
- package/esm2022/spx-channel-selection/src/spx-channel-selection.component.mjs +6 -5
- package/esm2022/spx-channel-selection/src/spx-company-selection.component.mjs +6 -5
- package/esm2022/spx-check-digit/spx-check-digit.component.mjs +6 -4
- package/esm2022/spx-form-section/spx-form-section.component.mjs +7 -7
- package/esm2022/spx-form-view/public-api.mjs +4 -0
- package/esm2022/spx-form-view/softpak-components-spx-form-view.mjs +5 -0
- package/esm2022/spx-form-view/spx-form-field.interface.mjs +2 -0
- package/esm2022/spx-form-view/spx-form-section.interface.mjs +2 -0
- package/esm2022/spx-form-view/spx-form-view.component.mjs +163 -0
- package/esm2022/spx-inputs/public-api.mjs +2 -1
- package/esm2022/spx-inputs/spx-dropdown.component.mjs +94 -0
- package/esm2022/spx-inputs/spx-input-box.component.mjs +74 -50
- package/esm2022/spx-inputs/spx-input-date.component.mjs +1 -1
- package/esm2022/spx-inputs/spx-input-radio.component.mjs +70 -27
- package/esm2022/spx-inputs/spx-input-text.component.mjs +20 -31
- package/esm2022/spx-inputs/spx-input-type.enum.mjs +14 -0
- package/esm2022/spx-inputs/spx-input.component.mjs +43 -16
- package/esm2022/spx-navigation/spx-home-tile.component.mjs +29 -10
- package/esm2022/spx-navigation/spx-navigation-item.interface.mjs +1 -1
- package/esm2022/spx-navigation/spx-navigation.component.mjs +11 -5
- package/esm2022/spx-number-check/public-api.mjs +2 -0
- package/esm2022/spx-number-check/softpak-components-spx-number-check.mjs +5 -0
- package/esm2022/spx-number-check/spx-number-check.component.mjs +262 -0
- package/esm2022/spx-spinner/spx-spinner.component.mjs +5 -5
- package/esm2022/spx-suggestion/spx-suggestion.component.mjs +27 -16
- package/esm2022/spx-toaster/src/spx-toaster.component.mjs +3 -3
- package/esm2022/spx-update/src/spx-update-info.component.mjs +1 -1
- package/fesm2022/softpak-components-spx-alert.mjs +4 -1
- package/fesm2022/softpak-components-spx-alert.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-change-details.mjs +125 -0
- package/fesm2022/softpak-components-spx-change-details.mjs.map +1 -0
- package/fesm2022/softpak-components-spx-channel-selection.mjs +9 -7
- package/fesm2022/softpak-components-spx-channel-selection.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-check-digit.mjs +5 -3
- package/fesm2022/softpak-components-spx-check-digit.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-form-section.mjs +6 -6
- package/fesm2022/softpak-components-spx-form-section.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-form-view.mjs +170 -0
- package/fesm2022/softpak-components-spx-form-view.mjs.map +1 -0
- package/fesm2022/softpak-components-spx-inputs.mjs +303 -119
- package/fesm2022/softpak-components-spx-inputs.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-navigation.mjs +37 -12
- package/fesm2022/softpak-components-spx-navigation.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-number-check.mjs +269 -0
- package/fesm2022/softpak-components-spx-number-check.mjs.map +1 -0
- package/fesm2022/softpak-components-spx-spinner.mjs +4 -4
- package/fesm2022/softpak-components-spx-spinner.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-suggestion.mjs +26 -15
- package/fesm2022/softpak-components-spx-suggestion.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-toaster.mjs +2 -2
- package/fesm2022/softpak-components-spx-toaster.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-update.mjs +1 -1
- package/fesm2022/softpak-components-spx-update.mjs.map +1 -1
- package/package.json +37 -19
- package/spx-change-details/index.d.ts +5 -0
- package/spx-change-details/public-api.d.ts +1 -0
- package/spx-change-details/spx-change-details-value.interface.d.ts +7 -0
- package/spx-change-details/spx-change-details.component.d.ts +40 -0
- package/spx-channel-selection/src/spx-channel-selection.component.d.ts +2 -1
- package/spx-channel-selection/src/spx-company-selection.component.d.ts +2 -1
- package/spx-check-digit/spx-check-digit.component.d.ts +3 -0
- package/spx-form-view/index.d.ts +5 -0
- package/spx-form-view/public-api.d.ts +3 -0
- package/spx-form-view/spx-form-field.interface.d.ts +16 -0
- package/spx-form-view/spx-form-section.interface.d.ts +9 -0
- package/spx-form-view/spx-form-view.component.d.ts +27 -0
- package/spx-inputs/public-api.d.ts +1 -0
- package/spx-inputs/spx-dropdown.component.d.ts +18 -0
- package/spx-inputs/spx-input-box.component.d.ts +13 -8
- package/spx-inputs/spx-input-radio.component.d.ts +11 -5
- package/spx-inputs/spx-input-text.component.d.ts +2 -1
- package/spx-inputs/spx-input-type.enum.d.ts +12 -0
- package/spx-inputs/spx-input.component.d.ts +9 -4
- package/spx-navigation/spx-home-tile.component.d.ts +5 -1
- package/spx-navigation/spx-navigation-item.interface.d.ts +1 -0
- package/spx-navigation/spx-navigation.component.d.ts +4 -1
- package/spx-number-check/index.d.ts +5 -0
- package/spx-number-check/public-api.d.ts +1 -0
- package/spx-number-check/spx-number-check.component.d.ts +48 -0
- package/spx-suggestion/spx-suggestion.component.d.ts +3 -1
- package/tailwind.css +1 -1
|
@@ -1,54 +1,48 @@
|
|
|
1
1
|
import { NgIf, NgFor } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { EventEmitter, Component, Input, Output, HostListener } from '@angular/core';
|
|
3
|
+
import { EventEmitter, Component, Input, Output, HostListener, ViewChild } from '@angular/core';
|
|
4
4
|
import { SpxButtonComponent } from '@softpak/components/spx-button';
|
|
5
5
|
import * as i1 from '@fortawesome/angular-fontawesome';
|
|
6
6
|
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
7
|
-
import { faEdit
|
|
7
|
+
import { faEdit } from '@fortawesome/free-solid-svg-icons/faEdit';
|
|
8
|
+
import { faQuestion } from '@fortawesome/free-solid-svg-icons/faQuestion';
|
|
9
|
+
import { faSearch } from '@fortawesome/free-solid-svg-icons/faSearch';
|
|
10
|
+
import { faTimes } from '@fortawesome/free-solid-svg-icons/faTimes';
|
|
11
|
+
import { fromEvent } from 'rxjs';
|
|
8
12
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
9
13
|
import { SpxSuggestionComponent } from '@softpak/components/spx-suggestion';
|
|
10
14
|
import { DateTime } from 'luxon';
|
|
11
15
|
|
|
12
16
|
class SpxInputBoxComponent {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
this.faSearch = faSearch;
|
|
16
|
-
this.faQuestion = faQuestion;
|
|
17
|
-
this.faTimes = faTimes;
|
|
18
|
-
this.spxReadonly = false;
|
|
19
|
-
this.spxShowClear = true;
|
|
20
|
-
this.spxClear = new EventEmitter();
|
|
21
|
-
this.spxSearchOutput = new EventEmitter();
|
|
22
|
-
this.spxFocus = new EventEmitter();
|
|
23
|
-
this.spxFocusOut = new EventEmitter();
|
|
24
|
-
this.spxEdit = new EventEmitter();
|
|
25
|
-
this.spxHelp = new EventEmitter();
|
|
26
|
-
this.spxFocused = false;
|
|
27
|
-
}
|
|
28
|
-
// @Listen('focusout', { capture: true })
|
|
29
|
-
// handleFocusOut() {
|
|
30
|
-
// this.spxFocused = false;
|
|
31
|
-
// this.spxFocusOut.emit();
|
|
32
|
-
// }
|
|
33
|
-
// @Listen('click', { target: 'window' })
|
|
34
|
-
// handleWindowClick(ev) {
|
|
35
|
-
// if (ev.composedPath().includes(this.el)) {
|
|
36
|
-
// if (!this.spxFocused) {
|
|
37
|
-
// this.spxFocused = true;
|
|
38
|
-
// this.spxFocus.emit();
|
|
39
|
-
// }
|
|
40
|
-
// } else {
|
|
41
|
-
// this.spxFocused = false;
|
|
42
|
-
// }
|
|
43
|
-
// }
|
|
44
|
-
async spxSetFocus() {
|
|
17
|
+
handleFocusIn(ev) {
|
|
18
|
+
console.log('spx-input-box: focusIn');
|
|
45
19
|
this.spxFocused = true;
|
|
46
20
|
}
|
|
21
|
+
handleFocusOut(ev) {
|
|
22
|
+
console.log('spx-input-box: focusOut');
|
|
23
|
+
const thisEl = this.elRef.nativeElement;
|
|
24
|
+
const relatedElement = ev.relatedTarget;
|
|
25
|
+
if (!relatedElement || !thisEl.contains(relatedElement)) {
|
|
26
|
+
this.spxFocusOut.emit();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
handleWindowClick(ev) {
|
|
30
|
+
if (ev.composedPath().includes(this.elRef.nativeElement)) {
|
|
31
|
+
console.log('spx-input-box: clickIn');
|
|
32
|
+
if (!this.spxFocused) {
|
|
33
|
+
this.spxFocus.emit();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
console.log('spx-input-box: clickOutside');
|
|
38
|
+
this.spxFocused = false;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
47
41
|
onClear() {
|
|
48
42
|
this.spxClear.emit();
|
|
49
43
|
}
|
|
50
44
|
onSearch() {
|
|
51
|
-
this.
|
|
45
|
+
this.spxSearch.emit();
|
|
52
46
|
}
|
|
53
47
|
onEdit() {
|
|
54
48
|
this.spxEdit.emit();
|
|
@@ -56,8 +50,26 @@ class SpxInputBoxComponent {
|
|
|
56
50
|
onHelp() {
|
|
57
51
|
this.spxHelp.emit();
|
|
58
52
|
}
|
|
59
|
-
|
|
60
|
-
|
|
53
|
+
constructor(elRef) {
|
|
54
|
+
this.elRef = elRef;
|
|
55
|
+
this.faEdit = faEdit;
|
|
56
|
+
this.faSearch = faSearch;
|
|
57
|
+
this.faQuestion = faQuestion;
|
|
58
|
+
this.faTimes = faTimes;
|
|
59
|
+
this.spxFocused = false;
|
|
60
|
+
this.spxReadonly = false;
|
|
61
|
+
this.spxShowClear = true;
|
|
62
|
+
this.spxShowLabel = true;
|
|
63
|
+
this.spxClear = new EventEmitter();
|
|
64
|
+
this.spxSearch = new EventEmitter();
|
|
65
|
+
this.spxFocus = new EventEmitter();
|
|
66
|
+
this.spxFocusOut = new EventEmitter();
|
|
67
|
+
this.spxEdit = new EventEmitter();
|
|
68
|
+
this.spxHelp = new EventEmitter();
|
|
69
|
+
console.log('spx-input-box: constructor');
|
|
70
|
+
}
|
|
71
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputBoxComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
72
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: SpxInputBoxComponent, isStandalone: true, selector: "spx-input-box", inputs: { spxCompact: "spxCompact", spxFocused: "spxFocused", spxLabel: "spxLabel", spxReadonly: "spxReadonly", spxRequired: "spxRequired", spxShowClear: "spxShowClear", spxShowEdit: "spxShowEdit", spxShowHelp: "spxShowHelp", spxShowLabel: "spxShowLabel", spxShowSearch: "spxShowSearch", spxShowValidationMessages: "spxShowValidationMessages", spxValue: "spxValue" }, outputs: { spxClear: "spxClear", spxSearch: "spxSearch", spxFocus: "spxFocus", spxFocusOut: "spxFocusOut", spxEdit: "spxEdit", spxHelp: "spxHelp" }, host: { listeners: { "focusin": "handleFocusIn($event)", "focusout": "handleFocusOut($event)", "document:click": "handleWindowClick($event)" } }, ngImport: i0, template: `<div class="flex rounded w-full gap-3"
|
|
61
73
|
[class.rounded-none]="this.spxShowValidationMessages"
|
|
62
74
|
[class.rounded-t]="this.spxShowValidationMessages"
|
|
63
75
|
[class.outline-none]="this.spxFocused && !this.spxReadonly"
|
|
@@ -71,7 +83,7 @@ class SpxInputBoxComponent {
|
|
|
71
83
|
[class.p-0]="this.spxCompact"
|
|
72
84
|
[class.flex]="this.spxCompact"
|
|
73
85
|
[class.items-center]="this.spxCompact">
|
|
74
|
-
<div class="text-sm mb-1 text-gray-800"
|
|
86
|
+
<div *ngIf="this.spxShowLabel" class="font-bold text-sm mb-1 text-gray-800"
|
|
75
87
|
[class.mb-0]="this.spxCompact"
|
|
76
88
|
[class.px-3]="this.spxCompact">
|
|
77
89
|
{{this.spxLabel}} <span *ngIf="spxRequired" class="text-red-800">*</span>
|
|
@@ -84,7 +96,6 @@ class SpxInputBoxComponent {
|
|
|
84
96
|
(spxClick)="onEdit()"
|
|
85
97
|
[spxFullHeight]="true"
|
|
86
98
|
[spxSize]="'xl'"
|
|
87
|
-
[spxTabIndex]="-1"
|
|
88
99
|
[spxType]="'button'">
|
|
89
100
|
<fa-icon [icon]="faEdit" class="block text-xl"></fa-icon>
|
|
90
101
|
</spx-button>
|
|
@@ -92,6 +103,7 @@ class SpxInputBoxComponent {
|
|
|
92
103
|
*ngIf="this.spxShowHelp"
|
|
93
104
|
(spxClick)="onHelp()"
|
|
94
105
|
[spxFullHeight]="true"
|
|
106
|
+
[spxDisabled]="this.spxReadonly"
|
|
95
107
|
[spxSize]="'xl'"
|
|
96
108
|
[spxTabIndex]="-1"
|
|
97
109
|
[spxType]="'button'">
|
|
@@ -101,6 +113,7 @@ class SpxInputBoxComponent {
|
|
|
101
113
|
*ngIf="this.spxShowSearch"
|
|
102
114
|
(spxClick)="onSearch()"
|
|
103
115
|
[spxFullHeight]="true"
|
|
116
|
+
[spxDisabled]="this.spxReadonly"
|
|
104
117
|
[spxSize]="'xl'"
|
|
105
118
|
[spxTabIndex]="-1"
|
|
106
119
|
[spxType]="'button'">
|
|
@@ -146,7 +159,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
146
159
|
[class.p-0]="this.spxCompact"
|
|
147
160
|
[class.flex]="this.spxCompact"
|
|
148
161
|
[class.items-center]="this.spxCompact">
|
|
149
|
-
<div class="text-sm mb-1 text-gray-800"
|
|
162
|
+
<div *ngIf="this.spxShowLabel" class="font-bold text-sm mb-1 text-gray-800"
|
|
150
163
|
[class.mb-0]="this.spxCompact"
|
|
151
164
|
[class.px-3]="this.spxCompact">
|
|
152
165
|
{{this.spxLabel}} <span *ngIf="spxRequired" class="text-red-800">*</span>
|
|
@@ -159,7 +172,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
159
172
|
(spxClick)="onEdit()"
|
|
160
173
|
[spxFullHeight]="true"
|
|
161
174
|
[spxSize]="'xl'"
|
|
162
|
-
[spxTabIndex]="-1"
|
|
163
175
|
[spxType]="'button'">
|
|
164
176
|
<fa-icon [icon]="faEdit" class="block text-xl"></fa-icon>
|
|
165
177
|
</spx-button>
|
|
@@ -167,6 +179,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
167
179
|
*ngIf="this.spxShowHelp"
|
|
168
180
|
(spxClick)="onHelp()"
|
|
169
181
|
[spxFullHeight]="true"
|
|
182
|
+
[spxDisabled]="this.spxReadonly"
|
|
170
183
|
[spxSize]="'xl'"
|
|
171
184
|
[spxTabIndex]="-1"
|
|
172
185
|
[spxType]="'button'">
|
|
@@ -176,6 +189,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
176
189
|
*ngIf="this.spxShowSearch"
|
|
177
190
|
(spxClick)="onSearch()"
|
|
178
191
|
[spxFullHeight]="true"
|
|
192
|
+
[spxDisabled]="this.spxReadonly"
|
|
179
193
|
[spxSize]="'xl'"
|
|
180
194
|
[spxTabIndex]="-1"
|
|
181
195
|
[spxType]="'button'">
|
|
@@ -197,20 +211,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
197
211
|
<ng-content select="[validation-messages]"></ng-content>
|
|
198
212
|
</div>`,
|
|
199
213
|
}]
|
|
200
|
-
}], propDecorators: {
|
|
214
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { spxCompact: [{
|
|
201
215
|
type: Input
|
|
202
|
-
}],
|
|
216
|
+
}], spxFocused: [{
|
|
203
217
|
type: Input
|
|
204
|
-
}],
|
|
218
|
+
}], spxLabel: [{
|
|
205
219
|
type: Input
|
|
206
|
-
}],
|
|
220
|
+
}], spxReadonly: [{
|
|
207
221
|
type: Input
|
|
208
|
-
}],
|
|
222
|
+
}], spxRequired: [{
|
|
209
223
|
type: Input
|
|
210
224
|
}], spxShowClear: [{
|
|
211
225
|
type: Input
|
|
212
226
|
}], spxShowEdit: [{
|
|
213
227
|
type: Input
|
|
228
|
+
}], spxShowHelp: [{
|
|
229
|
+
type: Input
|
|
230
|
+
}], spxShowLabel: [{
|
|
231
|
+
type: Input
|
|
214
232
|
}], spxShowSearch: [{
|
|
215
233
|
type: Input
|
|
216
234
|
}], spxShowValidationMessages: [{
|
|
@@ -219,7 +237,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
219
237
|
type: Input
|
|
220
238
|
}], spxClear: [{
|
|
221
239
|
type: Output
|
|
222
|
-
}],
|
|
240
|
+
}], spxSearch: [{
|
|
223
241
|
type: Output
|
|
224
242
|
}], spxFocus: [{
|
|
225
243
|
type: Output
|
|
@@ -229,8 +247,104 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
229
247
|
type: Output
|
|
230
248
|
}], spxHelp: [{
|
|
231
249
|
type: Output
|
|
232
|
-
}],
|
|
250
|
+
}], handleFocusIn: [{
|
|
251
|
+
type: HostListener,
|
|
252
|
+
args: ['focusin', ["$event"]]
|
|
253
|
+
}], handleFocusOut: [{
|
|
254
|
+
type: HostListener,
|
|
255
|
+
args: ['focusout', ["$event"]]
|
|
256
|
+
}], handleWindowClick: [{
|
|
257
|
+
type: HostListener,
|
|
258
|
+
args: ['document:click', ["$event"]]
|
|
259
|
+
}] } });
|
|
260
|
+
|
|
261
|
+
class SpxDropdownComponent {
|
|
262
|
+
constructor() {
|
|
263
|
+
this.focusPosition = 0;
|
|
264
|
+
this.spxSuggestions = [];
|
|
265
|
+
this.spxSelect = new EventEmitter();
|
|
266
|
+
}
|
|
267
|
+
ngOnInit() {
|
|
268
|
+
this.listenToKeyUp();
|
|
269
|
+
}
|
|
270
|
+
ngOnChanges(changes) {
|
|
271
|
+
this.focusPosition = 0;
|
|
272
|
+
}
|
|
273
|
+
ngOnDestroy() {
|
|
274
|
+
this.subscriptionKeyUp?.unsubscribe();
|
|
275
|
+
}
|
|
276
|
+
handleSuggestionClick(valuePair) {
|
|
277
|
+
this.select(valuePair);
|
|
278
|
+
}
|
|
279
|
+
listenToKeyUp() {
|
|
280
|
+
this.subscriptionKeyUp = fromEvent(window, 'keyup').subscribe((event) => {
|
|
281
|
+
if (event.key === 'ArrowUp' && this.focusPosition > 0) {
|
|
282
|
+
this.focusPosition = this.focusPosition - 1;
|
|
283
|
+
event.preventDefault();
|
|
284
|
+
}
|
|
285
|
+
if (event.key === 'ArrowDown' && this.focusPosition < this.spxSuggestions.length - 1) {
|
|
286
|
+
this.focusPosition = this.focusPosition + 1;
|
|
287
|
+
event.preventDefault();
|
|
288
|
+
}
|
|
289
|
+
if (event.key === 'Enter' && this.spxSuggestions.length > 0) {
|
|
290
|
+
this.select(this.spxSuggestions.at(this.focusPosition));
|
|
291
|
+
event.preventDefault();
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
select(valuePair) {
|
|
296
|
+
this.focusPosition = 0;
|
|
297
|
+
this.spxSelect.emit(valuePair);
|
|
298
|
+
}
|
|
299
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
300
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: SpxDropdownComponent, isStandalone: true, selector: "spx-dropdown", inputs: { spxSuggestions: "spxSuggestions" }, outputs: { spxSelect: "spxSelect" }, usesOnChanges: true, ngImport: i0, template: `<div class="relative text-black">
|
|
301
|
+
<div
|
|
302
|
+
class="absolute bg-gray-100 left-0 right-0 z-20">
|
|
303
|
+
<button
|
|
304
|
+
*ngFor="let valuePair of this.spxSuggestions; let i = index"
|
|
305
|
+
class="text-black block w-full p-2 border border-gray-200 rounded-lg shadow hover:bg-gray-200 flex items-center text-left"
|
|
306
|
+
[class.bg-gray-100]="i === this.focusPosition"
|
|
307
|
+
[class.bg-white]="i !== this.focusPosition"
|
|
308
|
+
(click)="this.handleSuggestionClick(valuePair)"
|
|
309
|
+
[attr.tabindex]="-1"
|
|
310
|
+
[attr.type]="'button'">
|
|
311
|
+
<div class="flex-1 p-1 font-bold text-lg">{{valuePair?.description}}</div>
|
|
312
|
+
<spx-button (spxClick)="this.handleSuggestionClick(valuePair)" [spxType]="'button'" [spxTabIndex]="-1">Select</spx-button>
|
|
313
|
+
</button>
|
|
314
|
+
</div>
|
|
315
|
+
</div>`, isInline: true, dependencies: [{ kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType"], outputs: ["spxClick"] }] }); }
|
|
316
|
+
}
|
|
317
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxDropdownComponent, decorators: [{
|
|
318
|
+
type: Component,
|
|
319
|
+
args: [{
|
|
320
|
+
selector: 'spx-dropdown',
|
|
321
|
+
standalone: true,
|
|
322
|
+
imports: [
|
|
323
|
+
NgIf,
|
|
324
|
+
NgFor,
|
|
325
|
+
SpxButtonComponent,
|
|
326
|
+
],
|
|
327
|
+
template: `<div class="relative text-black">
|
|
328
|
+
<div
|
|
329
|
+
class="absolute bg-gray-100 left-0 right-0 z-20">
|
|
330
|
+
<button
|
|
331
|
+
*ngFor="let valuePair of this.spxSuggestions; let i = index"
|
|
332
|
+
class="text-black block w-full p-2 border border-gray-200 rounded-lg shadow hover:bg-gray-200 flex items-center text-left"
|
|
333
|
+
[class.bg-gray-100]="i === this.focusPosition"
|
|
334
|
+
[class.bg-white]="i !== this.focusPosition"
|
|
335
|
+
(click)="this.handleSuggestionClick(valuePair)"
|
|
336
|
+
[attr.tabindex]="-1"
|
|
337
|
+
[attr.type]="'button'">
|
|
338
|
+
<div class="flex-1 p-1 font-bold text-lg">{{valuePair?.description}}</div>
|
|
339
|
+
<spx-button (spxClick)="this.handleSuggestionClick(valuePair)" [spxType]="'button'" [spxTabIndex]="-1">Select</spx-button>
|
|
340
|
+
</button>
|
|
341
|
+
</div>
|
|
342
|
+
</div>`,
|
|
343
|
+
}]
|
|
344
|
+
}], propDecorators: { spxSuggestions: [{
|
|
233
345
|
type: Input
|
|
346
|
+
}], spxSelect: [{
|
|
347
|
+
type: Output
|
|
234
348
|
}] } });
|
|
235
349
|
|
|
236
350
|
class SpxInputTextComponent {
|
|
@@ -247,7 +361,7 @@ class SpxInputTextComponent {
|
|
|
247
361
|
this.spxWasInternalUpdate = false;
|
|
248
362
|
}
|
|
249
363
|
async spxSetFocus() {
|
|
250
|
-
|
|
364
|
+
this.inputRef?.nativeElement?.focus();
|
|
251
365
|
}
|
|
252
366
|
componentDidLoad() {
|
|
253
367
|
if (this.spxAutofocus) {
|
|
@@ -279,8 +393,9 @@ class SpxInputTextComponent {
|
|
|
279
393
|
this.spxFocused = true;
|
|
280
394
|
}
|
|
281
395
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputTextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
282
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: SpxInputTextComponent, isStandalone: true, selector: "spx-input-text", inputs: { spxName: "spxName", spxAutofocus: "spxAutofocus", spxInputMode: "spxInputMode", spxPattern: "spxPattern", spxSuggestions: "spxSuggestions", spxReadonly: "spxReadonly", spxValidators: "spxValidators", spxCapitalize: "spxCapitalize", spxFocused: "spxFocused", spxType: "spxType", value: "value", spxWasInternalUpdate: "spxWasInternalUpdate" }, outputs: { spxBlurFromChild: "spxBlurFromChild", spxChange: "spxChange", spxFocus: "spxFocus" }, ngImport: i0, template: `<div class="relative text-black">
|
|
396
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: SpxInputTextComponent, isStandalone: true, selector: "spx-input-text", inputs: { spxName: "spxName", spxAutofocus: "spxAutofocus", spxInputMode: "spxInputMode", spxPattern: "spxPattern", spxSuggestions: "spxSuggestions", spxReadonly: "spxReadonly", spxValidators: "spxValidators", spxCapitalize: "spxCapitalize", spxFocused: "spxFocused", spxType: "spxType", value: "value", spxWasInternalUpdate: "spxWasInternalUpdate" }, outputs: { spxBlurFromChild: "spxBlurFromChild", spxChange: "spxChange", spxFocus: "spxFocus" }, viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["input"], descendants: true, static: true }], ngImport: i0, template: `<div class="relative text-black">
|
|
283
397
|
<input
|
|
398
|
+
#input
|
|
284
399
|
class="font-bold text-lg w-full outline-none"
|
|
285
400
|
[class.bg-white]="!this.spxReadonly"
|
|
286
401
|
[class.bg-gray-300]="this.spxReadonly"
|
|
@@ -292,27 +407,18 @@ class SpxInputTextComponent {
|
|
|
292
407
|
[attr.pattern]="this.spxPattern ? this.spxPattern : undefined"
|
|
293
408
|
[attr.name]="this.spxName"
|
|
294
409
|
[attr.type]="this.spxType"
|
|
295
|
-
[
|
|
410
|
+
[value]="this.value?.description ? this.value?.description : this.value?.value"
|
|
296
411
|
(blur)="this.handleBlur()"
|
|
297
412
|
(keyUp)="this.handleKeyUp()"
|
|
298
413
|
(focus)="this.handleFocus()"
|
|
299
414
|
(input)="this.handleDescriptionInput($event)"
|
|
300
415
|
/>
|
|
301
416
|
<span *ngIf="this.value?.description && this.value?.value && this.value?.description?.valueOf() !== this.value?.value?.valueOf()">{{this.value?.value}}</span>
|
|
302
|
-
<
|
|
417
|
+
<spx-dropdown
|
|
303
418
|
*ngIf="this.spxFocused && (this.spxType === 'overlay' || this.spxType === 'overlaynumber')"
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
class="text-black block w-full p-2 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-100 flex items-center"
|
|
308
|
-
(click)="this.handleSuggestionClick($event)"
|
|
309
|
-
[attr.tabindex]="0"
|
|
310
|
-
>
|
|
311
|
-
<div class="flex-1 p-1 font-bold text-lg">{{valuePair?.description}}</div>
|
|
312
|
-
<spx-button spxType="button">Select</spx-button>
|
|
313
|
-
</div>
|
|
314
|
-
</div>
|
|
315
|
-
</div>`, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType"], outputs: ["spxClick"] }] }); }
|
|
419
|
+
[spxSuggestions]="this.spxSuggestions" (spxSelect)="this.handleSuggestionClick($event)">
|
|
420
|
+
</spx-dropdown>
|
|
421
|
+
</div>`, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SpxDropdownComponent, selector: "spx-dropdown", inputs: ["spxSuggestions"], outputs: ["spxSelect"] }] }); }
|
|
316
422
|
}
|
|
317
423
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputTextComponent, decorators: [{
|
|
318
424
|
type: Component,
|
|
@@ -323,9 +429,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
323
429
|
NgIf,
|
|
324
430
|
NgFor,
|
|
325
431
|
SpxButtonComponent,
|
|
432
|
+
SpxDropdownComponent,
|
|
326
433
|
],
|
|
327
434
|
template: `<div class="relative text-black">
|
|
328
435
|
<input
|
|
436
|
+
#input
|
|
329
437
|
class="font-bold text-lg w-full outline-none"
|
|
330
438
|
[class.bg-white]="!this.spxReadonly"
|
|
331
439
|
[class.bg-gray-300]="this.spxReadonly"
|
|
@@ -337,26 +445,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
337
445
|
[attr.pattern]="this.spxPattern ? this.spxPattern : undefined"
|
|
338
446
|
[attr.name]="this.spxName"
|
|
339
447
|
[attr.type]="this.spxType"
|
|
340
|
-
[
|
|
448
|
+
[value]="this.value?.description ? this.value?.description : this.value?.value"
|
|
341
449
|
(blur)="this.handleBlur()"
|
|
342
450
|
(keyUp)="this.handleKeyUp()"
|
|
343
451
|
(focus)="this.handleFocus()"
|
|
344
452
|
(input)="this.handleDescriptionInput($event)"
|
|
345
453
|
/>
|
|
346
454
|
<span *ngIf="this.value?.description && this.value?.value && this.value?.description?.valueOf() !== this.value?.value?.valueOf()">{{this.value?.value}}</span>
|
|
347
|
-
<
|
|
455
|
+
<spx-dropdown
|
|
348
456
|
*ngIf="this.spxFocused && (this.spxType === 'overlay' || this.spxType === 'overlaynumber')"
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
*ngFor="let valuePair of this.spxSuggestions"
|
|
352
|
-
class="text-black block w-full p-2 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-100 flex items-center"
|
|
353
|
-
(click)="this.handleSuggestionClick($event)"
|
|
354
|
-
[attr.tabindex]="0"
|
|
355
|
-
>
|
|
356
|
-
<div class="flex-1 p-1 font-bold text-lg">{{valuePair?.description}}</div>
|
|
357
|
-
<spx-button spxType="button">Select</spx-button>
|
|
358
|
-
</div>
|
|
359
|
-
</div>
|
|
457
|
+
[spxSuggestions]="this.spxSuggestions" (spxSelect)="this.handleSuggestionClick($event)">
|
|
458
|
+
</spx-dropdown>
|
|
360
459
|
</div>`,
|
|
361
460
|
}]
|
|
362
461
|
}], propDecorators: { spxName: [{
|
|
@@ -389,6 +488,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
389
488
|
type: Output
|
|
390
489
|
}], spxWasInternalUpdate: [{
|
|
391
490
|
type: Input
|
|
491
|
+
}], inputRef: [{
|
|
492
|
+
type: ViewChild,
|
|
493
|
+
args: ['input', { static: true }]
|
|
392
494
|
}] } });
|
|
393
495
|
|
|
394
496
|
class SpxInputDateComponent {
|
|
@@ -593,7 +695,7 @@ class SpxInputDateComponent {
|
|
|
593
695
|
<spx-suggestion
|
|
594
696
|
*ngFor="let valuePair of spxSuggestions[spxSelectStep]"
|
|
595
697
|
(click)="this.handleSuggestionClick(valuePair.value)">{{valuePair?.description}}</spx-suggestion>
|
|
596
|
-
</div>`, isInline: true, styles: [":host{display:block}.spx-input-date__input{background-color:transparent;border:1px solid #979797;border-radius:4px;color:var(--spx-input--color, rgba(0, 0, 0, .9));box-sizing:border-box;font-size:16px;margin-right:10px;padding:6px;text-align:center;width:100%}.spx-input-date__input:active{transform:scale(.95)}.spx-input-date__input:focus{border:var(--spx-input-box--focus--border, 1px solid rgb(115, 168, 210));border-radius:4px;outline:none}.spx-input-date__control-label{align-items:center;color:#000000b3;display:inline-grid;font-size:13px;letter-spacing:1px}.spx-input-date__input::-webkit-outer-spin-button,.spx-input-date__input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.spx-input-date__input[type=number]{-moz-appearance:textfield}.spx-input-date__suggestions,.spx-input-date__controls{display:grid;grid-gap:8px;grid-template-columns:repeat(4,1fr);margin-top:8px}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: SpxSuggestionComponent, selector: "spx-suggestion", inputs: ["spxDisabled", "spxSelected"] }] }); }
|
|
698
|
+
</div>`, isInline: true, styles: [":host{display:block}.spx-input-date__input{background-color:transparent;border:1px solid #979797;border-radius:4px;color:var(--spx-input--color, rgba(0, 0, 0, .9));box-sizing:border-box;font-size:16px;margin-right:10px;padding:6px;text-align:center;width:100%}.spx-input-date__input:active{transform:scale(.95)}.spx-input-date__input:focus{border:var(--spx-input-box--focus--border, 1px solid rgb(115, 168, 210));border-radius:4px;outline:none}.spx-input-date__control-label{align-items:center;color:#000000b3;display:inline-grid;font-size:13px;letter-spacing:1px}.spx-input-date__input::-webkit-outer-spin-button,.spx-input-date__input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.spx-input-date__input[type=number]{-moz-appearance:textfield}.spx-input-date__suggestions,.spx-input-date__controls{display:grid;grid-gap:8px;grid-template-columns:repeat(4,1fr);margin-top:8px}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: SpxSuggestionComponent, selector: "spx-suggestion", inputs: ["spxDisabled", "spxFocused", "spxSelected"] }] }); }
|
|
597
699
|
}
|
|
598
700
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputDateComponent, decorators: [{
|
|
599
701
|
type: Component,
|
|
@@ -911,51 +1013,93 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
911
1013
|
|
|
912
1014
|
class SpxInputRadioComponent {
|
|
913
1015
|
constructor() {
|
|
914
|
-
this.
|
|
1016
|
+
this.focusPosition = 0;
|
|
1017
|
+
this.spxFocused = false;
|
|
1018
|
+
this.spxShowLabel = true;
|
|
915
1019
|
this.spxReadonly = false;
|
|
916
1020
|
this.spxSuggestions = [];
|
|
917
1021
|
this.spxChange = new EventEmitter();
|
|
918
1022
|
this.spxFocus = new EventEmitter();
|
|
919
|
-
this.spxWasInternalUpdate = false;
|
|
920
1023
|
}
|
|
921
|
-
|
|
922
|
-
|
|
1024
|
+
spxFocusIn() {
|
|
1025
|
+
console.log('spx-input-radio: focusIn');
|
|
1026
|
+
this.listenToKeyUp();
|
|
1027
|
+
this.focusPosition = 0;
|
|
923
1028
|
}
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
this.
|
|
1029
|
+
spxFocusOut() {
|
|
1030
|
+
console.log('spx-input-radio: focusOut');
|
|
1031
|
+
this.subscriptionKeyUp?.unsubscribe();
|
|
1032
|
+
}
|
|
1033
|
+
ngOnChanges(changes) {
|
|
1034
|
+
this.focusPosition = 0;
|
|
1035
|
+
}
|
|
1036
|
+
handleSuggestionClick(valuePair) {
|
|
1037
|
+
this.select(valuePair);
|
|
1038
|
+
}
|
|
1039
|
+
select(valuePair) {
|
|
1040
|
+
this.focusPosition = 0;
|
|
1041
|
+
this.value = valuePair;
|
|
1042
|
+
this.spxChange.emit(valuePair);
|
|
1043
|
+
}
|
|
1044
|
+
listenToKeyUp() {
|
|
1045
|
+
console.log('listenToKeyUp');
|
|
1046
|
+
this.subscriptionKeyUp = fromEvent(window, 'keyup').subscribe((event) => {
|
|
1047
|
+
if (event.key === 'ArrowUp' && this.focusPosition > 0) {
|
|
1048
|
+
this.focusPosition = this.focusPosition - 1;
|
|
1049
|
+
event.preventDefault();
|
|
1050
|
+
}
|
|
1051
|
+
if (event.key === 'ArrowDown' && this.focusPosition < this.spxSuggestions.length - 1) {
|
|
1052
|
+
this.focusPosition = this.focusPosition + 1;
|
|
1053
|
+
event.preventDefault();
|
|
1054
|
+
}
|
|
1055
|
+
if (event.key === 'Enter' && this.spxSuggestions.length > 0) {
|
|
1056
|
+
this.select(this.spxSuggestions.at(this.focusPosition));
|
|
1057
|
+
event.preventDefault();
|
|
1058
|
+
}
|
|
1059
|
+
});
|
|
927
1060
|
}
|
|
928
1061
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputRadioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
929
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: SpxInputRadioComponent, isStandalone: true, selector: "spx-input-radio", inputs: { spxName: "spxName", spxValidators: "spxValidators", spxFocused: "spxFocused", spxReadonly: "spxReadonly", spxSuggestions: "spxSuggestions", value: "value" }, outputs: { spxChange: "spxChange", spxFocus: "spxFocus" }, ngImport: i0, template: `<div class="
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
1062
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: SpxInputRadioComponent, isStandalone: true, selector: "spx-input-radio", inputs: { spxName: "spxName", spxValidators: "spxValidators", spxFocused: "spxFocused", spxShowLabel: "spxShowLabel", spxReadonly: "spxReadonly", spxSuggestions: "spxSuggestions", value: "value" }, outputs: { spxChange: "spxChange", spxFocus: "spxFocus" }, usesOnChanges: true, ngImport: i0, template: `<div class="grid grid-cols-2 gap-2"
|
|
1063
|
+
[class.mt-3]="this.spxShowLabel">
|
|
1064
|
+
<spx-suggestion
|
|
1065
|
+
*ngFor="let valuePair of this.spxSuggestions; let i = index"
|
|
1066
|
+
[spxDisabled]="this.spxReadonly"
|
|
1067
|
+
[spxFocused]="this.spxFocused && i === this.focusPosition"
|
|
1068
|
+
[spxSelected]="this.value?.value === this.valuePair?.value"
|
|
1069
|
+
(click)="this.spxReadonly ? undefined : this.handleSuggestionClick(valuePair)">
|
|
1070
|
+
{{this.valuePair?.description}}
|
|
1071
|
+
</spx-suggestion>
|
|
1072
|
+
</div>`, isInline: true, dependencies: [{ kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: SpxSuggestionComponent, selector: "spx-suggestion", inputs: ["spxDisabled", "spxFocused", "spxSelected"] }] }); }
|
|
938
1073
|
}
|
|
939
1074
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputRadioComponent, decorators: [{
|
|
940
1075
|
type: Component,
|
|
941
|
-
args: [{
|
|
1076
|
+
args: [{
|
|
1077
|
+
selector: 'spx-input-radio',
|
|
1078
|
+
standalone: true,
|
|
1079
|
+
imports: [
|
|
942
1080
|
NgFor,
|
|
943
1081
|
SpxSuggestionComponent,
|
|
944
|
-
],
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
1082
|
+
],
|
|
1083
|
+
template: `<div class="grid grid-cols-2 gap-2"
|
|
1084
|
+
[class.mt-3]="this.spxShowLabel">
|
|
1085
|
+
<spx-suggestion
|
|
1086
|
+
*ngFor="let valuePair of this.spxSuggestions; let i = index"
|
|
1087
|
+
[spxDisabled]="this.spxReadonly"
|
|
1088
|
+
[spxFocused]="this.spxFocused && i === this.focusPosition"
|
|
1089
|
+
[spxSelected]="this.value?.value === this.valuePair?.value"
|
|
1090
|
+
(click)="this.spxReadonly ? undefined : this.handleSuggestionClick(valuePair)">
|
|
1091
|
+
{{this.valuePair?.description}}
|
|
1092
|
+
</spx-suggestion>
|
|
1093
|
+
</div>`,
|
|
1094
|
+
}]
|
|
953
1095
|
}], propDecorators: { spxName: [{
|
|
954
1096
|
type: Input
|
|
955
1097
|
}], spxValidators: [{
|
|
956
1098
|
type: Input
|
|
957
1099
|
}], spxFocused: [{
|
|
958
1100
|
type: Input
|
|
1101
|
+
}], spxShowLabel: [{
|
|
1102
|
+
type: Input
|
|
959
1103
|
}], spxReadonly: [{
|
|
960
1104
|
type: Input
|
|
961
1105
|
}], spxSuggestions: [{
|
|
@@ -968,6 +1112,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
968
1112
|
type: Output
|
|
969
1113
|
}] } });
|
|
970
1114
|
|
|
1115
|
+
var SpxInputTypeEnum;
|
|
1116
|
+
(function (SpxInputTypeEnum) {
|
|
1117
|
+
SpxInputTypeEnum["autocomplete"] = "autocomplete";
|
|
1118
|
+
SpxInputTypeEnum["date"] = "date";
|
|
1119
|
+
SpxInputTypeEnum["float"] = "float";
|
|
1120
|
+
SpxInputTypeEnum["overlay"] = "overlay";
|
|
1121
|
+
SpxInputTypeEnum["overlayNumber"] = "overlaynumber";
|
|
1122
|
+
SpxInputTypeEnum["radio"] = "radio";
|
|
1123
|
+
SpxInputTypeEnum["number"] = "number";
|
|
1124
|
+
SpxInputTypeEnum["password"] = "password";
|
|
1125
|
+
SpxInputTypeEnum["text"] = "text";
|
|
1126
|
+
SpxInputTypeEnum["textNumericKeyboard"] = "textNumericKeyboard";
|
|
1127
|
+
})(SpxInputTypeEnum || (SpxInputTypeEnum = {}));
|
|
1128
|
+
|
|
971
1129
|
class SpxInputComponent {
|
|
972
1130
|
constructor() {
|
|
973
1131
|
this.spxLabel = 'label';
|
|
@@ -978,12 +1136,13 @@ class SpxInputComponent {
|
|
|
978
1136
|
this.spxSelectDay = true;
|
|
979
1137
|
this.spxShowEdit = false;
|
|
980
1138
|
this.spxShowHelp = false;
|
|
1139
|
+
this.spxShowLabel = true;
|
|
981
1140
|
this.spxCompact = false;
|
|
982
1141
|
this.spxShowClear = true;
|
|
983
1142
|
this.spxShowSearch = false;
|
|
984
1143
|
this.spxShowValidationMessages = false;
|
|
985
1144
|
this.spxSuggestions = [];
|
|
986
|
-
this.spxType =
|
|
1145
|
+
this.spxType = SpxInputTypeEnum.text;
|
|
987
1146
|
this.spxCapitalize = false;
|
|
988
1147
|
this.spxBlur = new EventEmitter();
|
|
989
1148
|
this.spxClear = new EventEmitter();
|
|
@@ -996,9 +1155,6 @@ class SpxInputComponent {
|
|
|
996
1155
|
this.onChange = () => { };
|
|
997
1156
|
this.onTouched = () => { };
|
|
998
1157
|
}
|
|
999
|
-
async spxSetFocus() {
|
|
1000
|
-
this.passFocusToControl();
|
|
1001
|
-
}
|
|
1002
1158
|
handleBlur() {
|
|
1003
1159
|
this.spxBlur.emit();
|
|
1004
1160
|
}
|
|
@@ -1019,17 +1175,19 @@ class SpxInputComponent {
|
|
|
1019
1175
|
handleFocus() {
|
|
1020
1176
|
this.spxFocus.emit();
|
|
1021
1177
|
this.spxFocused = true;
|
|
1022
|
-
// this.elBox.spxSetFocus();
|
|
1023
1178
|
}
|
|
1024
1179
|
handleSearch() {
|
|
1025
1180
|
this.spxSearch.emit();
|
|
1026
1181
|
}
|
|
1027
|
-
|
|
1182
|
+
setFocusIn() {
|
|
1028
1183
|
this.spxFocused = true;
|
|
1029
1184
|
this.passFocusToControl();
|
|
1030
1185
|
}
|
|
1031
1186
|
setFocusOut() {
|
|
1032
1187
|
this.spxFocused = false;
|
|
1188
|
+
if (this.spxType === SpxInputTypeEnum.radio) {
|
|
1189
|
+
this.radioInput?.spxFocusOut();
|
|
1190
|
+
}
|
|
1033
1191
|
}
|
|
1034
1192
|
handleEdit() {
|
|
1035
1193
|
this.spxEdit.emit();
|
|
@@ -1040,9 +1198,19 @@ class SpxInputComponent {
|
|
|
1040
1198
|
this.spxFocused = true;
|
|
1041
1199
|
}
|
|
1042
1200
|
passFocusToControl() {
|
|
1201
|
+
switch (this.spxType) {
|
|
1202
|
+
case SpxInputTypeEnum.autocomplete:
|
|
1203
|
+
case SpxInputTypeEnum.text:
|
|
1204
|
+
case SpxInputTypeEnum.overlayNumber:
|
|
1205
|
+
this.textInput?.spxSetFocus();
|
|
1206
|
+
break;
|
|
1207
|
+
case SpxInputTypeEnum.radio:
|
|
1208
|
+
this.radioInput?.spxFocusIn();
|
|
1209
|
+
break;
|
|
1210
|
+
}
|
|
1043
1211
|
}
|
|
1044
1212
|
writeValue(value) {
|
|
1045
|
-
this.value = this.lastValue = value
|
|
1213
|
+
this.value = this.lastValue = value;
|
|
1046
1214
|
}
|
|
1047
1215
|
handleChangeEvent(value) {
|
|
1048
1216
|
if (value !== this.lastValue) {
|
|
@@ -1060,13 +1228,14 @@ class SpxInputComponent {
|
|
|
1060
1228
|
this.onTouched = fn;
|
|
1061
1229
|
}
|
|
1062
1230
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1063
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: SpxInputComponent, isStandalone: true, selector: "spx-input", inputs: { spxLabel: "spxLabel", spxMax: "spxMax", spxMin: "spxMin", spxName: "spxName", spxReadonly: "spxReadonly", spxAutofocus: "spxAutofocus", spxInputMode: "spxInputMode", spxPattern: "spxPattern", spxRequired: "spxRequired", spxSelectMonth: "spxSelectMonth", spxSelectDay: "spxSelectDay", spxShowEdit: "spxShowEdit", spxShowHelp: "spxShowHelp", spxCompact: "spxCompact", spxShowClear: "spxShowClear", spxShowSearch: "spxShowSearch", spxShowValidationMessages: "spxShowValidationMessages", spxStep: "spxStep", spxSuggestions: "spxSuggestions", spxType: "spxType", spxValidators: "spxValidators", value: "value", spxCapitalize: "spxCapitalize", spxFocused: "spxFocused" }, outputs: { spxBlur: "spxBlur", spxClear: "spxClear", spxChange: "spxChange", spxFocus: "spxFocus", spxEdit: "spxEdit", spxHelp: "spxHelp", spxSearch: "spxSearch" }, host: { listeners: { "spxChange": "handleChangeEvent($event)", "focusout": "_handleBlurEvent()" } }, providers: [
|
|
1231
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: SpxInputComponent, isStandalone: true, selector: "spx-input", inputs: { spxLabel: "spxLabel", spxMax: "spxMax", spxMin: "spxMin", spxName: "spxName", spxReadonly: "spxReadonly", spxAutofocus: "spxAutofocus", spxInputMode: "spxInputMode", spxPattern: "spxPattern", spxRequired: "spxRequired", spxSelectMonth: "spxSelectMonth", spxSelectDay: "spxSelectDay", spxShowEdit: "spxShowEdit", spxShowHelp: "spxShowHelp", spxShowLabel: "spxShowLabel", spxCompact: "spxCompact", spxShowClear: "spxShowClear", spxShowSearch: "spxShowSearch", spxShowValidationMessages: "spxShowValidationMessages", spxStep: "spxStep", spxSuggestions: "spxSuggestions", spxType: "spxType", spxValidators: "spxValidators", value: "value", spxCapitalize: "spxCapitalize", spxFocused: "spxFocused" }, outputs: { spxBlur: "spxBlur", spxClear: "spxClear", spxChange: "spxChange", spxFocus: "spxFocus", spxEdit: "spxEdit", spxHelp: "spxHelp", spxSearch: "spxSearch" }, host: { listeners: { "spxChange": "handleChangeEvent($event)", "focusout": "_handleBlurEvent()" } }, providers: [
|
|
1064
1232
|
{
|
|
1065
1233
|
provide: NG_VALUE_ACCESSOR,
|
|
1066
1234
|
useExisting: SpxInputComponent,
|
|
1067
1235
|
multi: true
|
|
1068
1236
|
}
|
|
1069
|
-
], ngImport: i0, template: `<spx-input-box
|
|
1237
|
+
], viewQueries: [{ propertyName: "textInput", first: true, predicate: SpxInputTextComponent, descendants: true }, { propertyName: "radioInput", first: true, predicate: SpxInputRadioComponent, descendants: true }], ngImport: i0, template: `<spx-input-box
|
|
1238
|
+
[spxFocused]="this.spxFocused"
|
|
1070
1239
|
[spxLabel]="this.spxLabel"
|
|
1071
1240
|
[spxReadonly]="this.spxReadonly"
|
|
1072
1241
|
[spxRequired]="this.spxRequired"
|
|
@@ -1075,14 +1244,15 @@ class SpxInputComponent {
|
|
|
1075
1244
|
[spxCompact]="this.spxCompact"
|
|
1076
1245
|
[spxShowClear]="this.spxShowClear"
|
|
1077
1246
|
[spxShowEdit]="this.spxShowEdit"
|
|
1247
|
+
[spxShowLabel]="this.spxShowLabel"
|
|
1078
1248
|
[spxShowSearch]="this.spxShowSearch ? this.spxShowSearch : this.spxType === 'autocomplete'"
|
|
1079
1249
|
[spxShowValidationMessages]="this.spxShowValidationMessages"
|
|
1080
1250
|
(spxClear)="this.handleClear()"
|
|
1081
1251
|
(spxEdit)="this.handleEdit()"
|
|
1082
1252
|
(spxHelp)="this.handleHelp()"
|
|
1083
|
-
(spxFocus)="this.
|
|
1253
|
+
(spxFocus)="this.setFocusIn()"
|
|
1084
1254
|
(spxFocusOut)="this.setFocusOut()"
|
|
1085
|
-
(
|
|
1255
|
+
(spxSearch)="this.handleSearch()">
|
|
1086
1256
|
<div controls>
|
|
1087
1257
|
<spx-input-text
|
|
1088
1258
|
*ngIf="this.spxType === 'autocomplete' || this.spxType === 'overlay' || this.spxType === 'overlaynumber' || this.spxType === 'text' || this.spxType === 'password'"
|
|
@@ -1141,12 +1311,14 @@ class SpxInputComponent {
|
|
|
1141
1311
|
[value]="this.value"
|
|
1142
1312
|
></spx-input-number>
|
|
1143
1313
|
<spx-input-radio
|
|
1314
|
+
#radioInput
|
|
1144
1315
|
*ngIf="this.spxType === 'radio'"
|
|
1145
1316
|
(spxChange)="this.handleChange($event)"
|
|
1146
1317
|
(spxFocus)="this.handleFocus()"
|
|
1147
1318
|
[spxFocused]="this.spxFocused"
|
|
1148
1319
|
[spxName]="this.spxName"
|
|
1149
1320
|
[spxReadonly]="this.spxReadonly"
|
|
1321
|
+
[spxShowLabel]="this.spxShowLabel"
|
|
1150
1322
|
[spxSuggestions]="this.spxSuggestions"
|
|
1151
1323
|
[spxValidators]="this.spxValidators"
|
|
1152
1324
|
[value]="this.value"
|
|
@@ -1155,7 +1327,7 @@ class SpxInputComponent {
|
|
|
1155
1327
|
<div validation-messages>
|
|
1156
1328
|
<ng-content></ng-content>
|
|
1157
1329
|
</div>
|
|
1158
|
-
</spx-input-box>`, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SpxInputBoxComponent, selector: "spx-input-box", inputs: ["
|
|
1330
|
+
</spx-input-box>`, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SpxInputBoxComponent, selector: "spx-input-box", inputs: ["spxCompact", "spxFocused", "spxLabel", "spxReadonly", "spxRequired", "spxShowClear", "spxShowEdit", "spxShowHelp", "spxShowLabel", "spxShowSearch", "spxShowValidationMessages", "spxValue"], outputs: ["spxClear", "spxSearch", "spxFocus", "spxFocusOut", "spxEdit", "spxHelp"] }, { kind: "component", type: SpxInputDateComponent, selector: "spx-input-date", inputs: ["spxMax", "spxMin", "spxName", "spxReadonly", "spxValidators", "spxFocused", "spxSelectMonth", "spxSelectDay", "value", "spxLastKeyPressed", "spxSelectStep", "spxInternalValue", "spxSuggestions", "spxWasInternalUpdate"], outputs: ["spxChange", "spxFocus"] }, { kind: "component", type: SpxInputFloatComponent, selector: "spx-input-float", inputs: ["spxName", "spxAutofocus", "spxReadonly", "spxValidators", "spxFocused", "spxStep", "value", "spxWasInternalUpdate", "tick"], outputs: ["spxChange", "spxFocus"] }, { kind: "component", type: SpxInputNumberComponent, selector: "spx-input-number", inputs: ["spxName", "spxAutofocus", "spxInputMode", "spxReadonly", "spxValidators", "spxFocused", "spxStep", "value"], outputs: ["spxChange", "spxFocus"] }, { kind: "component", type: SpxInputRadioComponent, selector: "spx-input-radio", inputs: ["spxName", "spxValidators", "spxFocused", "spxShowLabel", "spxReadonly", "spxSuggestions", "value"], outputs: ["spxChange", "spxFocus"] }, { kind: "component", type: SpxInputTextComponent, selector: "spx-input-text", inputs: ["spxName", "spxAutofocus", "spxInputMode", "spxPattern", "spxSuggestions", "spxReadonly", "spxValidators", "spxCapitalize", "spxFocused", "spxType", "value", "spxWasInternalUpdate"], outputs: ["spxBlurFromChild", "spxChange", "spxFocus"] }] }); }
|
|
1159
1331
|
}
|
|
1160
1332
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputComponent, decorators: [{
|
|
1161
1333
|
type: Component,
|
|
@@ -1182,6 +1354,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
1182
1354
|
}
|
|
1183
1355
|
],
|
|
1184
1356
|
template: `<spx-input-box
|
|
1357
|
+
[spxFocused]="this.spxFocused"
|
|
1185
1358
|
[spxLabel]="this.spxLabel"
|
|
1186
1359
|
[spxReadonly]="this.spxReadonly"
|
|
1187
1360
|
[spxRequired]="this.spxRequired"
|
|
@@ -1190,14 +1363,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
1190
1363
|
[spxCompact]="this.spxCompact"
|
|
1191
1364
|
[spxShowClear]="this.spxShowClear"
|
|
1192
1365
|
[spxShowEdit]="this.spxShowEdit"
|
|
1366
|
+
[spxShowLabel]="this.spxShowLabel"
|
|
1193
1367
|
[spxShowSearch]="this.spxShowSearch ? this.spxShowSearch : this.spxType === 'autocomplete'"
|
|
1194
1368
|
[spxShowValidationMessages]="this.spxShowValidationMessages"
|
|
1195
1369
|
(spxClear)="this.handleClear()"
|
|
1196
1370
|
(spxEdit)="this.handleEdit()"
|
|
1197
1371
|
(spxHelp)="this.handleHelp()"
|
|
1198
|
-
(spxFocus)="this.
|
|
1372
|
+
(spxFocus)="this.setFocusIn()"
|
|
1199
1373
|
(spxFocusOut)="this.setFocusOut()"
|
|
1200
|
-
(
|
|
1374
|
+
(spxSearch)="this.handleSearch()">
|
|
1201
1375
|
<div controls>
|
|
1202
1376
|
<spx-input-text
|
|
1203
1377
|
*ngIf="this.spxType === 'autocomplete' || this.spxType === 'overlay' || this.spxType === 'overlaynumber' || this.spxType === 'text' || this.spxType === 'password'"
|
|
@@ -1256,12 +1430,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
1256
1430
|
[value]="this.value"
|
|
1257
1431
|
></spx-input-number>
|
|
1258
1432
|
<spx-input-radio
|
|
1433
|
+
#radioInput
|
|
1259
1434
|
*ngIf="this.spxType === 'radio'"
|
|
1260
1435
|
(spxChange)="this.handleChange($event)"
|
|
1261
1436
|
(spxFocus)="this.handleFocus()"
|
|
1262
1437
|
[spxFocused]="this.spxFocused"
|
|
1263
1438
|
[spxName]="this.spxName"
|
|
1264
1439
|
[spxReadonly]="this.spxReadonly"
|
|
1440
|
+
[spxShowLabel]="this.spxShowLabel"
|
|
1265
1441
|
[spxSuggestions]="this.spxSuggestions"
|
|
1266
1442
|
[spxValidators]="this.spxValidators"
|
|
1267
1443
|
[value]="this.value"
|
|
@@ -1298,6 +1474,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
1298
1474
|
type: Input
|
|
1299
1475
|
}], spxShowHelp: [{
|
|
1300
1476
|
type: Input
|
|
1477
|
+
}], spxShowLabel: [{
|
|
1478
|
+
type: Input
|
|
1301
1479
|
}], spxCompact: [{
|
|
1302
1480
|
type: Input
|
|
1303
1481
|
}], spxShowClear: [{
|
|
@@ -1332,6 +1510,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
1332
1510
|
type: Output
|
|
1333
1511
|
}], spxSearch: [{
|
|
1334
1512
|
type: Output
|
|
1513
|
+
}], textInput: [{
|
|
1514
|
+
type: ViewChild,
|
|
1515
|
+
args: [SpxInputTextComponent]
|
|
1516
|
+
}], radioInput: [{
|
|
1517
|
+
type: ViewChild,
|
|
1518
|
+
args: [SpxInputRadioComponent]
|
|
1335
1519
|
}], spxFocused: [{
|
|
1336
1520
|
type: Input
|
|
1337
1521
|
}], _handleBlurEvent: [{
|
|
@@ -1343,5 +1527,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
1343
1527
|
* Generated bundle index. Do not edit.
|
|
1344
1528
|
*/
|
|
1345
1529
|
|
|
1346
|
-
export { SpxInputBoxComponent, SpxInputComponent, SpxInputTextComponent };
|
|
1530
|
+
export { SpxInputBoxComponent, SpxInputComponent, SpxInputTextComponent, SpxInputTypeEnum };
|
|
1347
1531
|
//# sourceMappingURL=softpak-components-spx-inputs.mjs.map
|