@softpak/components 0.0.0-beta.12 → 0.0.0-beta.121
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 +72 -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 +30 -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 +305 -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 +29 -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 +36 -18
- 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 +4 -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", "spxTabbable"] }] }); }
|
|
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,95 @@ 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
|
+
[spxTabbable]="this.focusPosition === i"
|
|
1070
|
+
(click)="this.spxReadonly ? undefined : this.handleSuggestionClick(valuePair)">
|
|
1071
|
+
{{this.valuePair?.description}}
|
|
1072
|
+
</spx-suggestion>
|
|
1073
|
+
</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", "spxTabbable"] }] }); }
|
|
938
1074
|
}
|
|
939
1075
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputRadioComponent, decorators: [{
|
|
940
1076
|
type: Component,
|
|
941
|
-
args: [{
|
|
1077
|
+
args: [{
|
|
1078
|
+
selector: 'spx-input-radio',
|
|
1079
|
+
standalone: true,
|
|
1080
|
+
imports: [
|
|
942
1081
|
NgFor,
|
|
943
1082
|
SpxSuggestionComponent,
|
|
944
|
-
],
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
1083
|
+
],
|
|
1084
|
+
template: `<div class="grid grid-cols-2 gap-2"
|
|
1085
|
+
[class.mt-3]="this.spxShowLabel">
|
|
1086
|
+
<spx-suggestion
|
|
1087
|
+
*ngFor="let valuePair of this.spxSuggestions; let i = index"
|
|
1088
|
+
[spxDisabled]="this.spxReadonly"
|
|
1089
|
+
[spxFocused]="this.spxFocused && i === this.focusPosition"
|
|
1090
|
+
[spxSelected]="this.value?.value === this.valuePair?.value"
|
|
1091
|
+
[spxTabbable]="this.focusPosition === i"
|
|
1092
|
+
(click)="this.spxReadonly ? undefined : this.handleSuggestionClick(valuePair)">
|
|
1093
|
+
{{this.valuePair?.description}}
|
|
1094
|
+
</spx-suggestion>
|
|
1095
|
+
</div>`,
|
|
1096
|
+
}]
|
|
953
1097
|
}], propDecorators: { spxName: [{
|
|
954
1098
|
type: Input
|
|
955
1099
|
}], spxValidators: [{
|
|
956
1100
|
type: Input
|
|
957
1101
|
}], spxFocused: [{
|
|
958
1102
|
type: Input
|
|
1103
|
+
}], spxShowLabel: [{
|
|
1104
|
+
type: Input
|
|
959
1105
|
}], spxReadonly: [{
|
|
960
1106
|
type: Input
|
|
961
1107
|
}], spxSuggestions: [{
|
|
@@ -968,6 +1114,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
968
1114
|
type: Output
|
|
969
1115
|
}] } });
|
|
970
1116
|
|
|
1117
|
+
var SpxInputTypeEnum;
|
|
1118
|
+
(function (SpxInputTypeEnum) {
|
|
1119
|
+
SpxInputTypeEnum["autocomplete"] = "autocomplete";
|
|
1120
|
+
SpxInputTypeEnum["date"] = "date";
|
|
1121
|
+
SpxInputTypeEnum["float"] = "float";
|
|
1122
|
+
SpxInputTypeEnum["overlay"] = "overlay";
|
|
1123
|
+
SpxInputTypeEnum["overlayNumber"] = "overlaynumber";
|
|
1124
|
+
SpxInputTypeEnum["radio"] = "radio";
|
|
1125
|
+
SpxInputTypeEnum["number"] = "number";
|
|
1126
|
+
SpxInputTypeEnum["password"] = "password";
|
|
1127
|
+
SpxInputTypeEnum["text"] = "text";
|
|
1128
|
+
SpxInputTypeEnum["textNumericKeyboard"] = "textNumericKeyboard";
|
|
1129
|
+
})(SpxInputTypeEnum || (SpxInputTypeEnum = {}));
|
|
1130
|
+
|
|
971
1131
|
class SpxInputComponent {
|
|
972
1132
|
constructor() {
|
|
973
1133
|
this.spxLabel = 'label';
|
|
@@ -978,12 +1138,13 @@ class SpxInputComponent {
|
|
|
978
1138
|
this.spxSelectDay = true;
|
|
979
1139
|
this.spxShowEdit = false;
|
|
980
1140
|
this.spxShowHelp = false;
|
|
1141
|
+
this.spxShowLabel = true;
|
|
981
1142
|
this.spxCompact = false;
|
|
982
1143
|
this.spxShowClear = true;
|
|
983
1144
|
this.spxShowSearch = false;
|
|
984
1145
|
this.spxShowValidationMessages = false;
|
|
985
1146
|
this.spxSuggestions = [];
|
|
986
|
-
this.spxType =
|
|
1147
|
+
this.spxType = SpxInputTypeEnum.text;
|
|
987
1148
|
this.spxCapitalize = false;
|
|
988
1149
|
this.spxBlur = new EventEmitter();
|
|
989
1150
|
this.spxClear = new EventEmitter();
|
|
@@ -996,9 +1157,6 @@ class SpxInputComponent {
|
|
|
996
1157
|
this.onChange = () => { };
|
|
997
1158
|
this.onTouched = () => { };
|
|
998
1159
|
}
|
|
999
|
-
async spxSetFocus() {
|
|
1000
|
-
this.passFocusToControl();
|
|
1001
|
-
}
|
|
1002
1160
|
handleBlur() {
|
|
1003
1161
|
this.spxBlur.emit();
|
|
1004
1162
|
}
|
|
@@ -1019,17 +1177,19 @@ class SpxInputComponent {
|
|
|
1019
1177
|
handleFocus() {
|
|
1020
1178
|
this.spxFocus.emit();
|
|
1021
1179
|
this.spxFocused = true;
|
|
1022
|
-
// this.elBox.spxSetFocus();
|
|
1023
1180
|
}
|
|
1024
1181
|
handleSearch() {
|
|
1025
1182
|
this.spxSearch.emit();
|
|
1026
1183
|
}
|
|
1027
|
-
|
|
1184
|
+
setFocusIn() {
|
|
1028
1185
|
this.spxFocused = true;
|
|
1029
1186
|
this.passFocusToControl();
|
|
1030
1187
|
}
|
|
1031
1188
|
setFocusOut() {
|
|
1032
1189
|
this.spxFocused = false;
|
|
1190
|
+
if (this.spxType === SpxInputTypeEnum.radio) {
|
|
1191
|
+
this.radioInput?.spxFocusOut();
|
|
1192
|
+
}
|
|
1033
1193
|
}
|
|
1034
1194
|
handleEdit() {
|
|
1035
1195
|
this.spxEdit.emit();
|
|
@@ -1040,9 +1200,19 @@ class SpxInputComponent {
|
|
|
1040
1200
|
this.spxFocused = true;
|
|
1041
1201
|
}
|
|
1042
1202
|
passFocusToControl() {
|
|
1203
|
+
switch (this.spxType) {
|
|
1204
|
+
case SpxInputTypeEnum.autocomplete:
|
|
1205
|
+
case SpxInputTypeEnum.text:
|
|
1206
|
+
case SpxInputTypeEnum.overlayNumber:
|
|
1207
|
+
this.textInput?.spxSetFocus();
|
|
1208
|
+
break;
|
|
1209
|
+
case SpxInputTypeEnum.radio:
|
|
1210
|
+
this.radioInput?.spxFocusIn();
|
|
1211
|
+
break;
|
|
1212
|
+
}
|
|
1043
1213
|
}
|
|
1044
1214
|
writeValue(value) {
|
|
1045
|
-
this.value = this.lastValue = value
|
|
1215
|
+
this.value = this.lastValue = value;
|
|
1046
1216
|
}
|
|
1047
1217
|
handleChangeEvent(value) {
|
|
1048
1218
|
if (value !== this.lastValue) {
|
|
@@ -1060,13 +1230,14 @@ class SpxInputComponent {
|
|
|
1060
1230
|
this.onTouched = fn;
|
|
1061
1231
|
}
|
|
1062
1232
|
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: [
|
|
1233
|
+
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
1234
|
{
|
|
1065
1235
|
provide: NG_VALUE_ACCESSOR,
|
|
1066
1236
|
useExisting: SpxInputComponent,
|
|
1067
1237
|
multi: true
|
|
1068
1238
|
}
|
|
1069
|
-
], ngImport: i0, template: `<spx-input-box
|
|
1239
|
+
], viewQueries: [{ propertyName: "textInput", first: true, predicate: SpxInputTextComponent, descendants: true }, { propertyName: "radioInput", first: true, predicate: SpxInputRadioComponent, descendants: true }], ngImport: i0, template: `<spx-input-box
|
|
1240
|
+
[spxFocused]="this.spxFocused"
|
|
1070
1241
|
[spxLabel]="this.spxLabel"
|
|
1071
1242
|
[spxReadonly]="this.spxReadonly"
|
|
1072
1243
|
[spxRequired]="this.spxRequired"
|
|
@@ -1075,14 +1246,15 @@ class SpxInputComponent {
|
|
|
1075
1246
|
[spxCompact]="this.spxCompact"
|
|
1076
1247
|
[spxShowClear]="this.spxShowClear"
|
|
1077
1248
|
[spxShowEdit]="this.spxShowEdit"
|
|
1249
|
+
[spxShowLabel]="this.spxShowLabel"
|
|
1078
1250
|
[spxShowSearch]="this.spxShowSearch ? this.spxShowSearch : this.spxType === 'autocomplete'"
|
|
1079
1251
|
[spxShowValidationMessages]="this.spxShowValidationMessages"
|
|
1080
1252
|
(spxClear)="this.handleClear()"
|
|
1081
1253
|
(spxEdit)="this.handleEdit()"
|
|
1082
1254
|
(spxHelp)="this.handleHelp()"
|
|
1083
|
-
(spxFocus)="this.
|
|
1255
|
+
(spxFocus)="this.setFocusIn()"
|
|
1084
1256
|
(spxFocusOut)="this.setFocusOut()"
|
|
1085
|
-
(
|
|
1257
|
+
(spxSearch)="this.handleSearch()">
|
|
1086
1258
|
<div controls>
|
|
1087
1259
|
<spx-input-text
|
|
1088
1260
|
*ngIf="this.spxType === 'autocomplete' || this.spxType === 'overlay' || this.spxType === 'overlaynumber' || this.spxType === 'text' || this.spxType === 'password'"
|
|
@@ -1141,12 +1313,14 @@ class SpxInputComponent {
|
|
|
1141
1313
|
[value]="this.value"
|
|
1142
1314
|
></spx-input-number>
|
|
1143
1315
|
<spx-input-radio
|
|
1316
|
+
#radioInput
|
|
1144
1317
|
*ngIf="this.spxType === 'radio'"
|
|
1145
1318
|
(spxChange)="this.handleChange($event)"
|
|
1146
1319
|
(spxFocus)="this.handleFocus()"
|
|
1147
1320
|
[spxFocused]="this.spxFocused"
|
|
1148
1321
|
[spxName]="this.spxName"
|
|
1149
1322
|
[spxReadonly]="this.spxReadonly"
|
|
1323
|
+
[spxShowLabel]="this.spxShowLabel"
|
|
1150
1324
|
[spxSuggestions]="this.spxSuggestions"
|
|
1151
1325
|
[spxValidators]="this.spxValidators"
|
|
1152
1326
|
[value]="this.value"
|
|
@@ -1155,7 +1329,7 @@ class SpxInputComponent {
|
|
|
1155
1329
|
<div validation-messages>
|
|
1156
1330
|
<ng-content></ng-content>
|
|
1157
1331
|
</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: ["
|
|
1332
|
+
</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
1333
|
}
|
|
1160
1334
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputComponent, decorators: [{
|
|
1161
1335
|
type: Component,
|
|
@@ -1182,6 +1356,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
1182
1356
|
}
|
|
1183
1357
|
],
|
|
1184
1358
|
template: `<spx-input-box
|
|
1359
|
+
[spxFocused]="this.spxFocused"
|
|
1185
1360
|
[spxLabel]="this.spxLabel"
|
|
1186
1361
|
[spxReadonly]="this.spxReadonly"
|
|
1187
1362
|
[spxRequired]="this.spxRequired"
|
|
@@ -1190,14 +1365,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
1190
1365
|
[spxCompact]="this.spxCompact"
|
|
1191
1366
|
[spxShowClear]="this.spxShowClear"
|
|
1192
1367
|
[spxShowEdit]="this.spxShowEdit"
|
|
1368
|
+
[spxShowLabel]="this.spxShowLabel"
|
|
1193
1369
|
[spxShowSearch]="this.spxShowSearch ? this.spxShowSearch : this.spxType === 'autocomplete'"
|
|
1194
1370
|
[spxShowValidationMessages]="this.spxShowValidationMessages"
|
|
1195
1371
|
(spxClear)="this.handleClear()"
|
|
1196
1372
|
(spxEdit)="this.handleEdit()"
|
|
1197
1373
|
(spxHelp)="this.handleHelp()"
|
|
1198
|
-
(spxFocus)="this.
|
|
1374
|
+
(spxFocus)="this.setFocusIn()"
|
|
1199
1375
|
(spxFocusOut)="this.setFocusOut()"
|
|
1200
|
-
(
|
|
1376
|
+
(spxSearch)="this.handleSearch()">
|
|
1201
1377
|
<div controls>
|
|
1202
1378
|
<spx-input-text
|
|
1203
1379
|
*ngIf="this.spxType === 'autocomplete' || this.spxType === 'overlay' || this.spxType === 'overlaynumber' || this.spxType === 'text' || this.spxType === 'password'"
|
|
@@ -1256,12 +1432,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
1256
1432
|
[value]="this.value"
|
|
1257
1433
|
></spx-input-number>
|
|
1258
1434
|
<spx-input-radio
|
|
1435
|
+
#radioInput
|
|
1259
1436
|
*ngIf="this.spxType === 'radio'"
|
|
1260
1437
|
(spxChange)="this.handleChange($event)"
|
|
1261
1438
|
(spxFocus)="this.handleFocus()"
|
|
1262
1439
|
[spxFocused]="this.spxFocused"
|
|
1263
1440
|
[spxName]="this.spxName"
|
|
1264
1441
|
[spxReadonly]="this.spxReadonly"
|
|
1442
|
+
[spxShowLabel]="this.spxShowLabel"
|
|
1265
1443
|
[spxSuggestions]="this.spxSuggestions"
|
|
1266
1444
|
[spxValidators]="this.spxValidators"
|
|
1267
1445
|
[value]="this.value"
|
|
@@ -1298,6 +1476,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
1298
1476
|
type: Input
|
|
1299
1477
|
}], spxShowHelp: [{
|
|
1300
1478
|
type: Input
|
|
1479
|
+
}], spxShowLabel: [{
|
|
1480
|
+
type: Input
|
|
1301
1481
|
}], spxCompact: [{
|
|
1302
1482
|
type: Input
|
|
1303
1483
|
}], spxShowClear: [{
|
|
@@ -1332,6 +1512,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
1332
1512
|
type: Output
|
|
1333
1513
|
}], spxSearch: [{
|
|
1334
1514
|
type: Output
|
|
1515
|
+
}], textInput: [{
|
|
1516
|
+
type: ViewChild,
|
|
1517
|
+
args: [SpxInputTextComponent]
|
|
1518
|
+
}], radioInput: [{
|
|
1519
|
+
type: ViewChild,
|
|
1520
|
+
args: [SpxInputRadioComponent]
|
|
1335
1521
|
}], spxFocused: [{
|
|
1336
1522
|
type: Input
|
|
1337
1523
|
}], _handleBlurEvent: [{
|
|
@@ -1343,5 +1529,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
|
1343
1529
|
* Generated bundle index. Do not edit.
|
|
1344
1530
|
*/
|
|
1345
1531
|
|
|
1346
|
-
export { SpxInputBoxComponent, SpxInputComponent, SpxInputTextComponent };
|
|
1532
|
+
export { SpxInputBoxComponent, SpxInputComponent, SpxInputTextComponent, SpxInputTypeEnum };
|
|
1347
1533
|
//# sourceMappingURL=softpak-components-spx-inputs.mjs.map
|