@softpak/components 0.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/esm2022/placeholder.mjs +2 -0
- package/esm2022/public_api.mjs +2 -0
- package/esm2022/softpak-components.mjs +5 -0
- package/esm2022/spx-alert/public-api.mjs +3 -0
- package/esm2022/spx-alert/softpak-components-spx-alert.mjs +5 -0
- package/esm2022/spx-alert/spx-alert.component.mjs +191 -0
- package/esm2022/spx-alert/spx-alert.interface.mjs +3 -0
- package/esm2022/spx-app-configuration/public-api.mjs +8 -0
- package/esm2022/spx-app-configuration/softpak-components-spx-app-configuration.mjs +5 -0
- package/esm2022/spx-app-configuration/spx-app-alert.interface.mjs +2 -0
- package/esm2022/spx-app-configuration/spx-app-bundle-set.interface.mjs +2 -0
- package/esm2022/spx-app-configuration/spx-app-channel-type.enum.mjs +8 -0
- package/esm2022/spx-app-configuration/spx-app-channel.interface.mjs +2 -0
- package/esm2022/spx-app-configuration/spx-app-config.interface.mjs +2 -0
- package/esm2022/spx-app-configuration/spx-app-id.enum.mjs +8 -0
- package/esm2022/spx-app-configuration/spx-app-lang.enum.mjs +6 -0
- package/esm2022/spx-app-configuration/spx-app-release-note.interface.mjs +2 -0
- package/esm2022/spx-button/public-api.mjs +2 -0
- package/esm2022/spx-button/softpak-components-spx-button.mjs +5 -0
- package/esm2022/spx-button/spx-button.component.mjs +129 -0
- package/esm2022/spx-capitalize/public-api.mjs +2 -0
- package/esm2022/spx-capitalize/softpak-components-spx-capitalize.mjs +5 -0
- package/esm2022/spx-capitalize/spx-capitalize.pipe.mjs +20 -0
- package/esm2022/spx-channel-selection/public-api.mjs +5 -0
- package/esm2022/spx-channel-selection/softpak-components-spx-channel-selection.mjs +5 -0
- package/esm2022/spx-channel-selection/src/spx-channel-indicator.component.mjs +45 -0
- package/esm2022/spx-channel-selection/src/spx-channel-selection.component.mjs +40 -0
- package/esm2022/spx-channel-selection/src/spx-company-selection.component.mjs +48 -0
- package/esm2022/spx-channel-selection/src/spx-welcome.component.mjs +43 -0
- package/esm2022/spx-check-digit/public-api.mjs +2 -0
- package/esm2022/spx-check-digit/softpak-components-spx-check-digit.mjs +5 -0
- package/esm2022/spx-check-digit/spx-check-digit.component.mjs +85 -0
- package/esm2022/spx-form-section/public-api.mjs +2 -0
- package/esm2022/spx-form-section/softpak-components-spx-form-section.mjs +5 -0
- package/esm2022/spx-form-section/spx-form-section.component.mjs +37 -0
- package/esm2022/spx-helpers/calc-check-digit.function.mjs +21 -0
- package/esm2022/spx-helpers/public-api.mjs +4 -0
- package/esm2022/spx-helpers/softpak-components-spx-helpers.mjs +5 -0
- package/esm2022/spx-helpers/spx-severity.enum.mjs +8 -0
- package/esm2022/spx-helpers/value-pair-to-value.function.mjs +7 -0
- package/esm2022/spx-inputs/public-api.mjs +5 -0
- package/esm2022/spx-inputs/softpak-components-spx-inputs.mjs +5 -0
- package/esm2022/spx-inputs/spx-input-box.component.mjs +231 -0
- package/esm2022/spx-inputs/spx-input-date.component.mjs +294 -0
- package/esm2022/spx-inputs/spx-input-float.component.mjs +154 -0
- package/esm2022/spx-inputs/spx-input-number.component.mjs +82 -0
- package/esm2022/spx-inputs/spx-input-radio.component.mjs +63 -0
- package/esm2022/spx-inputs/spx-input-text.component.mjs +156 -0
- package/esm2022/spx-inputs/spx-input.component.mjs +380 -0
- package/esm2022/spx-inputs/spx-value-interface.mjs +2 -0
- package/esm2022/spx-navigation/public-api.mjs +5 -0
- package/esm2022/spx-navigation/softpak-components-spx-navigation.mjs +5 -0
- package/esm2022/spx-navigation/spx-home-tile.component.mjs +33 -0
- package/esm2022/spx-navigation/spx-home-tiles.component.mjs +17 -0
- package/esm2022/spx-navigation/spx-navigation-item.interface.mjs +2 -0
- package/esm2022/spx-navigation/spx-navigation.component.mjs +42 -0
- package/esm2022/spx-patch/patch-check.function.mjs +9 -0
- package/esm2022/spx-patch/public-api.mjs +4 -0
- package/esm2022/spx-patch/release-check.function.mjs +11 -0
- package/esm2022/spx-patch/softpak-components-spx-patch.mjs +5 -0
- package/esm2022/spx-patch/spx-patch.component.mjs +46 -0
- package/esm2022/spx-progress-bar/public-api.mjs +2 -0
- package/esm2022/spx-progress-bar/softpak-components-spx-progress-bar.mjs +5 -0
- package/esm2022/spx-progress-bar/spx-progress-bar.component.mjs +29 -0
- package/esm2022/spx-spinner/public-api.mjs +2 -0
- package/esm2022/spx-spinner/softpak-components-spx-spinner.mjs +5 -0
- package/esm2022/spx-spinner/spx-spinner.component.mjs +157 -0
- package/esm2022/spx-storage/public-api.mjs +3 -0
- package/esm2022/spx-storage/softpak-components-spx-storage.mjs +5 -0
- package/esm2022/spx-storage/src/spx-storage-key.enum.mjs +13 -0
- package/esm2022/spx-storage/src/spx-storage.class.mjs +45 -0
- package/esm2022/spx-suggestion/public-api.mjs +2 -0
- package/esm2022/spx-suggestion/softpak-components-spx-suggestion.mjs +5 -0
- package/esm2022/spx-suggestion/spx-suggestion.component.mjs +47 -0
- package/esm2022/spx-toaster/public-api.mjs +4 -0
- package/esm2022/spx-toaster/softpak-components-spx-toaster.mjs +5 -0
- package/esm2022/spx-toaster/src/spx-toaster-autoclose-speed.mjs +23 -0
- package/esm2022/spx-toaster/src/spx-toaster-message.interface.mjs +3 -0
- package/esm2022/spx-toaster/src/spx-toaster.component.mjs +46 -0
- package/esm2022/spx-update/public-api.mjs +3 -0
- package/esm2022/spx-update/softpak-components-spx-update.mjs +5 -0
- package/esm2022/spx-update/src/spx-update-info.component.mjs +88 -0
- package/esm2022/spx-update/src/spx-update-progress.component.mjs +46 -0
- package/esm2022/spx-validation/max.validator.mjs +17 -0
- package/esm2022/spx-validation/maxlength.validator.mjs +20 -0
- package/esm2022/spx-validation/min.validator.mjs +17 -0
- package/esm2022/spx-validation/minlength.validator.mjs +20 -0
- package/esm2022/spx-validation/pattern.validator.mjs +12 -0
- package/esm2022/spx-validation/public-api.mjs +10 -0
- package/esm2022/spx-validation/required.validator.mjs +12 -0
- package/esm2022/spx-validation/softpak-components-spx-validation.mjs +5 -0
- package/esm2022/spx-validation/spx-validate-control.component.mjs +63 -0
- package/esm2022/spx-validation/spx-validation.module.mjs +28 -0
- package/esm2022/spx-validation/year-and-month.validator.mjs +42 -0
- package/fesm2022/softpak-components-spx-alert.mjs +201 -0
- package/fesm2022/softpak-components-spx-alert.mjs.map +1 -0
- package/fesm2022/softpak-components-spx-app-configuration.mjs +28 -0
- package/fesm2022/softpak-components-spx-app-configuration.mjs.map +1 -0
- package/fesm2022/softpak-components-spx-button.mjs +136 -0
- package/fesm2022/softpak-components-spx-button.mjs.map +1 -0
- package/fesm2022/softpak-components-spx-capitalize.mjs +27 -0
- package/fesm2022/softpak-components-spx-capitalize.mjs.map +1 -0
- package/fesm2022/softpak-components-spx-channel-selection.mjs +171 -0
- package/fesm2022/softpak-components-spx-channel-selection.mjs.map +1 -0
- package/fesm2022/softpak-components-spx-check-digit.mjs +92 -0
- package/fesm2022/softpak-components-spx-check-digit.mjs.map +1 -0
- package/fesm2022/softpak-components-spx-form-section.mjs +44 -0
- package/fesm2022/softpak-components-spx-form-section.mjs.map +1 -0
- package/fesm2022/softpak-components-spx-helpers.mjs +42 -0
- package/fesm2022/softpak-components-spx-helpers.mjs.map +1 -0
- package/fesm2022/softpak-components-spx-inputs.mjs +1340 -0
- package/fesm2022/softpak-components-spx-inputs.mjs.map +1 -0
- package/fesm2022/softpak-components-spx-navigation.mjs +93 -0
- package/fesm2022/softpak-components-spx-navigation.mjs.map +1 -0
- package/fesm2022/softpak-components-spx-patch.mjs +72 -0
- package/fesm2022/softpak-components-spx-patch.mjs.map +1 -0
- package/fesm2022/softpak-components-spx-progress-bar.mjs +36 -0
- package/fesm2022/softpak-components-spx-progress-bar.mjs.map +1 -0
- package/fesm2022/softpak-components-spx-spinner.mjs +164 -0
- package/fesm2022/softpak-components-spx-spinner.mjs.map +1 -0
- package/fesm2022/softpak-components-spx-storage.mjs +63 -0
- package/fesm2022/softpak-components-spx-storage.mjs.map +1 -0
- package/fesm2022/softpak-components-spx-suggestion.mjs +54 -0
- package/fesm2022/softpak-components-spx-suggestion.mjs.map +1 -0
- package/fesm2022/softpak-components-spx-toaster.mjs +79 -0
- package/fesm2022/softpak-components-spx-toaster.mjs.map +1 -0
- package/fesm2022/softpak-components-spx-update.mjs +138 -0
- package/fesm2022/softpak-components-spx-update.mjs.map +1 -0
- package/fesm2022/softpak-components-spx-validation.mjs +223 -0
- package/fesm2022/softpak-components-spx-validation.mjs.map +1 -0
- package/fesm2022/softpak-components.mjs +8 -0
- package/fesm2022/softpak-components.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/package.json +135 -0
- package/placeholder.d.ts +1 -0
- package/public_api.d.ts +1 -0
- package/spx-alert/index.d.ts +5 -0
- package/spx-alert/public-api.d.ts +2 -0
- package/spx-alert/spx-alert.component.d.ts +28 -0
- package/spx-alert/spx-alert.interface.d.ts +7 -0
- package/spx-app-configuration/index.d.ts +5 -0
- package/spx-app-configuration/public-api.d.ts +7 -0
- package/spx-app-configuration/spx-app-alert.interface.d.ts +7 -0
- package/spx-app-configuration/spx-app-bundle-set.interface.d.ts +4 -0
- package/spx-app-configuration/spx-app-channel-type.enum.d.ts +6 -0
- package/spx-app-configuration/spx-app-channel.interface.d.ts +10 -0
- package/spx-app-configuration/spx-app-config.interface.d.ts +19 -0
- package/spx-app-configuration/spx-app-id.enum.d.ts +6 -0
- package/spx-app-configuration/spx-app-lang.enum.d.ts +4 -0
- package/spx-app-configuration/spx-app-release-note.interface.d.ts +8 -0
- package/spx-button/index.d.ts +5 -0
- package/spx-button/public-api.d.ts +1 -0
- package/spx-button/spx-button.component.d.ts +23 -0
- package/spx-capitalize/index.d.ts +5 -0
- package/spx-capitalize/public-api.d.ts +1 -0
- package/spx-capitalize/spx-capitalize.pipe.d.ts +8 -0
- package/spx-channel-selection/index.d.ts +5 -0
- package/spx-channel-selection/public-api.d.ts +4 -0
- package/spx-channel-selection/src/spx-channel-indicator.component.d.ts +13 -0
- package/spx-channel-selection/src/spx-channel-selection.component.d.ts +11 -0
- package/spx-channel-selection/src/spx-company-selection.component.d.ts +12 -0
- package/spx-channel-selection/src/spx-welcome.component.d.ts +12 -0
- package/spx-check-digit/index.d.ts +5 -0
- package/spx-check-digit/public-api.d.ts +1 -0
- package/spx-check-digit/spx-check-digit.component.d.ts +19 -0
- package/spx-form-section/index.d.ts +5 -0
- package/spx-form-section/public-api.d.ts +1 -0
- package/spx-form-section/spx-form-section.component.d.ts +9 -0
- package/spx-helpers/calc-check-digit.function.d.ts +1 -0
- package/spx-helpers/index.d.ts +5 -0
- package/spx-helpers/public-api.d.ts +3 -0
- package/spx-helpers/spx-severity.enum.d.ts +6 -0
- package/spx-helpers/value-pair-to-value.function.d.ts +1 -0
- package/spx-inputs/index.d.ts +5 -0
- package/spx-inputs/public-api.d.ts +4 -0
- package/spx-inputs/spx-input-box.component.d.ts +33 -0
- package/spx-inputs/spx-input-date.component.d.ts +50 -0
- package/spx-inputs/spx-input-float.component.d.ts +28 -0
- package/spx-inputs/spx-input-number.component.d.ts +22 -0
- package/spx-inputs/spx-input-radio.component.d.ts +18 -0
- package/spx-inputs/spx-input-text.component.d.ts +29 -0
- package/spx-inputs/spx-input.component.d.ts +58 -0
- package/spx-inputs/spx-value-interface.d.ts +4 -0
- package/spx-navigation/index.d.ts +5 -0
- package/spx-navigation/public-api.d.ts +4 -0
- package/spx-navigation/spx-home-tile.component.d.ts +6 -0
- package/spx-navigation/spx-home-tiles.component.d.ts +5 -0
- package/spx-navigation/spx-navigation-item.interface.d.ts +19 -0
- package/spx-navigation/spx-navigation.component.d.ts +12 -0
- package/spx-patch/index.d.ts +5 -0
- package/spx-patch/patch-check.function.d.ts +4 -0
- package/spx-patch/public-api.d.ts +3 -0
- package/spx-patch/release-check.function.d.ts +1 -0
- package/spx-patch/spx-patch.component.d.ts +10 -0
- package/spx-progress-bar/index.d.ts +5 -0
- package/spx-progress-bar/public-api.d.ts +1 -0
- package/spx-progress-bar/spx-progress-bar.component.d.ts +7 -0
- package/spx-spinner/index.d.ts +5 -0
- package/spx-spinner/public-api.d.ts +1 -0
- package/spx-spinner/spx-spinner.component.d.ts +7 -0
- package/spx-storage/index.d.ts +5 -0
- package/spx-storage/public-api.d.ts +2 -0
- package/spx-storage/src/spx-storage-key.enum.d.ts +10 -0
- package/spx-storage/src/spx-storage.class.d.ts +9 -0
- package/spx-suggestion/index.d.ts +5 -0
- package/spx-suggestion/public-api.d.ts +1 -0
- package/spx-suggestion/spx-suggestion.component.d.ts +7 -0
- package/spx-toaster/index.d.ts +5 -0
- package/spx-toaster/public-api.d.ts +3 -0
- package/spx-toaster/src/spx-toaster-autoclose-speed.d.ts +11 -0
- package/spx-toaster/src/spx-toaster-message.interface.d.ts +9 -0
- package/spx-toaster/src/spx-toaster.component.d.ts +11 -0
- package/spx-update/index.d.ts +5 -0
- package/spx-update/public-api.d.ts +2 -0
- package/spx-update/src/spx-update-info.component.d.ts +18 -0
- package/spx-update/src/spx-update-progress.component.d.ts +14 -0
- package/spx-validation/index.d.ts +5 -0
- package/spx-validation/max.validator.d.ts +7 -0
- package/spx-validation/maxlength.validator.d.ts +7 -0
- package/spx-validation/min.validator.d.ts +7 -0
- package/spx-validation/minlength.validator.d.ts +7 -0
- package/spx-validation/pattern.validator.d.ts +2 -0
- package/spx-validation/public-api.d.ts +9 -0
- package/spx-validation/required.validator.d.ts +2 -0
- package/spx-validation/spx-validate-control.component.d.ts +24 -0
- package/spx-validation/spx-validation.module.d.ts +9 -0
- package/spx-validation/year-and-month.validator.d.ts +2 -0
- package/tailwind.css +1 -0
|
@@ -0,0 +1,1340 @@
|
|
|
1
|
+
import { NgIf, NgFor } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { EventEmitter, Component, Input, Output, HostListener } from '@angular/core';
|
|
4
|
+
import { SpxButtonComponent } from '@softpak/components/spx-button';
|
|
5
|
+
import * as i1 from '@fortawesome/angular-fontawesome';
|
|
6
|
+
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
7
|
+
import { faEdit, faSearch, faQuestion, faTimes } from '@fortawesome/free-solid-svg-icons';
|
|
8
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
9
|
+
import { SpxSuggestionComponent } from '@softpak/components/spx-suggestion';
|
|
10
|
+
import { DateTime } from 'luxon';
|
|
11
|
+
|
|
12
|
+
class SpxInputBoxComponent {
|
|
13
|
+
constructor() {
|
|
14
|
+
this.faEdit = faEdit;
|
|
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() {
|
|
45
|
+
this.spxFocused = true;
|
|
46
|
+
}
|
|
47
|
+
onClear() {
|
|
48
|
+
this.spxClear.emit();
|
|
49
|
+
}
|
|
50
|
+
onSearch() {
|
|
51
|
+
this.spxSearchOutput.emit();
|
|
52
|
+
}
|
|
53
|
+
onEdit() {
|
|
54
|
+
this.spxEdit.emit();
|
|
55
|
+
}
|
|
56
|
+
onHelp() {
|
|
57
|
+
this.spxHelp.emit();
|
|
58
|
+
}
|
|
59
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
60
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: SpxInputBoxComponent, isStandalone: true, selector: "spx-input-box", inputs: { spxLabel: "spxLabel", spxRequired: "spxRequired", spxReadonly: "spxReadonly", spxShowHelp: "spxShowHelp", spxCompact: "spxCompact", spxShowClear: "spxShowClear", spxShowEdit: "spxShowEdit", spxShowSearch: "spxShowSearch", spxShowValidationMessages: "spxShowValidationMessages", spxValue: "spxValue", spxFocused: "spxFocused" }, outputs: { spxClear: "spxClear", spxSearchOutput: "spxSearchOutput", spxFocus: "spxFocus", spxFocusOut: "spxFocusOut", spxEdit: "spxEdit", spxHelp: "spxHelp" }, ngImport: i0, template: `<div class="flex rounded w-full"
|
|
61
|
+
[class.rounded-none]="this.spxShowValidationMessages"
|
|
62
|
+
[class.rounded-t]="this.spxShowValidationMessages"
|
|
63
|
+
[class.outline-none]="this.spxFocused && !this.spxReadonly"
|
|
64
|
+
[class.ring-2]="this.spxFocused && !this.spxReadonly"
|
|
65
|
+
[class.ring-offset-2]="this.spxFocused && !this.spxReadonly"
|
|
66
|
+
[class.ring-blue-500]="this.spxFocused && !this.spxReadonly"
|
|
67
|
+
[class.bg-white]="!this.spxReadonly"
|
|
68
|
+
[class.bg-gray-300]="this.spxReadonly"
|
|
69
|
+
[class.cursor-not-allowed]="this.spxReadonly">
|
|
70
|
+
<div class="flex-auto p-3"
|
|
71
|
+
[class.p-0]="this.spxCompact"
|
|
72
|
+
[class.flex]="this.spxCompact"
|
|
73
|
+
[class.items-center]="this.spxCompact">
|
|
74
|
+
<div class="text-sm mb-1 text-gray-800"
|
|
75
|
+
[class.mb-0]="this.spxCompact"
|
|
76
|
+
[class.px-3]="this.spxCompact">
|
|
77
|
+
{{this.spxLabel}} <span *ngIf="spxRequired" class="text-red-800">*</span>
|
|
78
|
+
</div>
|
|
79
|
+
<ng-content select="[controls]"></ng-content>
|
|
80
|
+
</div>
|
|
81
|
+
<div class="flex-none p-0.5 gap-3">
|
|
82
|
+
<spx-button
|
|
83
|
+
*ngIf="this.spxShowEdit"
|
|
84
|
+
(spxClick)="onEdit()"
|
|
85
|
+
[spxFullHeight]="true"
|
|
86
|
+
[spxSize]="'xl'"
|
|
87
|
+
[spxTabIndex]="-1"
|
|
88
|
+
[spxType]="'button'">
|
|
89
|
+
<fa-icon [icon]="faEdit" class="block h-4 w-4 text-xl"></fa-icon>
|
|
90
|
+
</spx-button>
|
|
91
|
+
<spx-button
|
|
92
|
+
*ngIf="this.spxShowHelp"
|
|
93
|
+
(spxClick)="onHelp()"
|
|
94
|
+
[spxFullHeight]="true"
|
|
95
|
+
[spxSize]="'xl'"
|
|
96
|
+
[spxTabIndex]="-1"
|
|
97
|
+
[spxType]="'button'">
|
|
98
|
+
<fa-icon [icon]="faQuestion" class="block h-4 w-4 text-xl"></fa-icon>
|
|
99
|
+
</spx-button>
|
|
100
|
+
<spx-button
|
|
101
|
+
*ngIf="this.spxShowSearch"
|
|
102
|
+
(spxClick)="onSearch()"
|
|
103
|
+
[spxFullHeight]="true"
|
|
104
|
+
[spxSize]="'xl'"
|
|
105
|
+
[spxTabIndex]="-1"
|
|
106
|
+
[spxType]="'button'">
|
|
107
|
+
<fa-icon [icon]="faSearch" class="block h-4 w-4 text-xl"></fa-icon>
|
|
108
|
+
</spx-button>
|
|
109
|
+
<spx-button
|
|
110
|
+
*ngIf="this.spxShowClear"
|
|
111
|
+
(spxClick)="onClear()"
|
|
112
|
+
[spxDisabled]="this.spxReadonly || !this.spxValue?.value"
|
|
113
|
+
[spxFullHeight]="true"
|
|
114
|
+
[spxSize]="'xl'"
|
|
115
|
+
[spxTabIndex]="-1"
|
|
116
|
+
[spxType]="'button'">
|
|
117
|
+
<fa-icon [icon]="faTimes" class="block h-4 w-4 text-xl"></fa-icon>
|
|
118
|
+
</spx-button>
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
<div class="bg-red-600 rounded-b text-white p-3">
|
|
122
|
+
<ng-content select="[validation-messages]"></ng-content>
|
|
123
|
+
</div>`, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType"], outputs: ["spxClick"] }, { kind: "ngmodule", type: FontAwesomeModule }, { kind: "component", type: i1.FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "animation", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "classes", "transform", "a11yRole"] }] }); }
|
|
124
|
+
}
|
|
125
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputBoxComponent, decorators: [{
|
|
126
|
+
type: Component,
|
|
127
|
+
args: [{
|
|
128
|
+
selector: 'spx-input-box',
|
|
129
|
+
standalone: true,
|
|
130
|
+
imports: [
|
|
131
|
+
NgIf,
|
|
132
|
+
SpxButtonComponent,
|
|
133
|
+
FontAwesomeModule,
|
|
134
|
+
],
|
|
135
|
+
template: `<div class="flex rounded w-full"
|
|
136
|
+
[class.rounded-none]="this.spxShowValidationMessages"
|
|
137
|
+
[class.rounded-t]="this.spxShowValidationMessages"
|
|
138
|
+
[class.outline-none]="this.spxFocused && !this.spxReadonly"
|
|
139
|
+
[class.ring-2]="this.spxFocused && !this.spxReadonly"
|
|
140
|
+
[class.ring-offset-2]="this.spxFocused && !this.spxReadonly"
|
|
141
|
+
[class.ring-blue-500]="this.spxFocused && !this.spxReadonly"
|
|
142
|
+
[class.bg-white]="!this.spxReadonly"
|
|
143
|
+
[class.bg-gray-300]="this.spxReadonly"
|
|
144
|
+
[class.cursor-not-allowed]="this.spxReadonly">
|
|
145
|
+
<div class="flex-auto p-3"
|
|
146
|
+
[class.p-0]="this.spxCompact"
|
|
147
|
+
[class.flex]="this.spxCompact"
|
|
148
|
+
[class.items-center]="this.spxCompact">
|
|
149
|
+
<div class="text-sm mb-1 text-gray-800"
|
|
150
|
+
[class.mb-0]="this.spxCompact"
|
|
151
|
+
[class.px-3]="this.spxCompact">
|
|
152
|
+
{{this.spxLabel}} <span *ngIf="spxRequired" class="text-red-800">*</span>
|
|
153
|
+
</div>
|
|
154
|
+
<ng-content select="[controls]"></ng-content>
|
|
155
|
+
</div>
|
|
156
|
+
<div class="flex-none p-0.5 gap-3">
|
|
157
|
+
<spx-button
|
|
158
|
+
*ngIf="this.spxShowEdit"
|
|
159
|
+
(spxClick)="onEdit()"
|
|
160
|
+
[spxFullHeight]="true"
|
|
161
|
+
[spxSize]="'xl'"
|
|
162
|
+
[spxTabIndex]="-1"
|
|
163
|
+
[spxType]="'button'">
|
|
164
|
+
<fa-icon [icon]="faEdit" class="block h-4 w-4 text-xl"></fa-icon>
|
|
165
|
+
</spx-button>
|
|
166
|
+
<spx-button
|
|
167
|
+
*ngIf="this.spxShowHelp"
|
|
168
|
+
(spxClick)="onHelp()"
|
|
169
|
+
[spxFullHeight]="true"
|
|
170
|
+
[spxSize]="'xl'"
|
|
171
|
+
[spxTabIndex]="-1"
|
|
172
|
+
[spxType]="'button'">
|
|
173
|
+
<fa-icon [icon]="faQuestion" class="block h-4 w-4 text-xl"></fa-icon>
|
|
174
|
+
</spx-button>
|
|
175
|
+
<spx-button
|
|
176
|
+
*ngIf="this.spxShowSearch"
|
|
177
|
+
(spxClick)="onSearch()"
|
|
178
|
+
[spxFullHeight]="true"
|
|
179
|
+
[spxSize]="'xl'"
|
|
180
|
+
[spxTabIndex]="-1"
|
|
181
|
+
[spxType]="'button'">
|
|
182
|
+
<fa-icon [icon]="faSearch" class="block h-4 w-4 text-xl"></fa-icon>
|
|
183
|
+
</spx-button>
|
|
184
|
+
<spx-button
|
|
185
|
+
*ngIf="this.spxShowClear"
|
|
186
|
+
(spxClick)="onClear()"
|
|
187
|
+
[spxDisabled]="this.spxReadonly || !this.spxValue?.value"
|
|
188
|
+
[spxFullHeight]="true"
|
|
189
|
+
[spxSize]="'xl'"
|
|
190
|
+
[spxTabIndex]="-1"
|
|
191
|
+
[spxType]="'button'">
|
|
192
|
+
<fa-icon [icon]="faTimes" class="block h-4 w-4 text-xl"></fa-icon>
|
|
193
|
+
</spx-button>
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
<div class="bg-red-600 rounded-b text-white p-3">
|
|
197
|
+
<ng-content select="[validation-messages]"></ng-content>
|
|
198
|
+
</div>`,
|
|
199
|
+
}]
|
|
200
|
+
}], propDecorators: { spxLabel: [{
|
|
201
|
+
type: Input
|
|
202
|
+
}], spxRequired: [{
|
|
203
|
+
type: Input
|
|
204
|
+
}], spxReadonly: [{
|
|
205
|
+
type: Input
|
|
206
|
+
}], spxShowHelp: [{
|
|
207
|
+
type: Input
|
|
208
|
+
}], spxCompact: [{
|
|
209
|
+
type: Input
|
|
210
|
+
}], spxShowClear: [{
|
|
211
|
+
type: Input
|
|
212
|
+
}], spxShowEdit: [{
|
|
213
|
+
type: Input
|
|
214
|
+
}], spxShowSearch: [{
|
|
215
|
+
type: Input
|
|
216
|
+
}], spxShowValidationMessages: [{
|
|
217
|
+
type: Input
|
|
218
|
+
}], spxValue: [{
|
|
219
|
+
type: Input
|
|
220
|
+
}], spxClear: [{
|
|
221
|
+
type: Output
|
|
222
|
+
}], spxSearchOutput: [{
|
|
223
|
+
type: Output
|
|
224
|
+
}], spxFocus: [{
|
|
225
|
+
type: Output
|
|
226
|
+
}], spxFocusOut: [{
|
|
227
|
+
type: Output
|
|
228
|
+
}], spxEdit: [{
|
|
229
|
+
type: Output
|
|
230
|
+
}], spxHelp: [{
|
|
231
|
+
type: Output
|
|
232
|
+
}], spxFocused: [{
|
|
233
|
+
type: Input
|
|
234
|
+
}] } });
|
|
235
|
+
|
|
236
|
+
class SpxInputTextComponent {
|
|
237
|
+
constructor() {
|
|
238
|
+
this.spxAutofocus = false;
|
|
239
|
+
this.spxSuggestions = [];
|
|
240
|
+
this.spxReadonly = false;
|
|
241
|
+
this.spxCapitalize = false;
|
|
242
|
+
this.spxFocused = true;
|
|
243
|
+
this.spxType = 'text';
|
|
244
|
+
this.spxBlurFromChild = new EventEmitter();
|
|
245
|
+
this.spxChange = new EventEmitter();
|
|
246
|
+
this.spxFocus = new EventEmitter();
|
|
247
|
+
this.spxWasInternalUpdate = false;
|
|
248
|
+
}
|
|
249
|
+
async spxSetFocus() {
|
|
250
|
+
// this.elInput.focus();
|
|
251
|
+
}
|
|
252
|
+
componentDidLoad() {
|
|
253
|
+
if (this.spxAutofocus) {
|
|
254
|
+
this.spxFocus.emit();
|
|
255
|
+
this.spxSetFocus();
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
handleBlur() {
|
|
259
|
+
this.spxBlurFromChild.emit();
|
|
260
|
+
}
|
|
261
|
+
handleFocus() {
|
|
262
|
+
this.spxFocus.emit();
|
|
263
|
+
}
|
|
264
|
+
handleDescriptionInput(event) {
|
|
265
|
+
this.value = {
|
|
266
|
+
description: event.target ? event.target.value : null,
|
|
267
|
+
value: event.target ? event.target.value : null,
|
|
268
|
+
};
|
|
269
|
+
this.spxChange.emit(this.value);
|
|
270
|
+
}
|
|
271
|
+
handleSuggestionClick(value) {
|
|
272
|
+
if (!this.spxReadonly) {
|
|
273
|
+
this.value = value;
|
|
274
|
+
this.spxChange.emit(this.value);
|
|
275
|
+
this.spxFocused = false;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
handleKeyUp() {
|
|
279
|
+
this.spxFocused = true;
|
|
280
|
+
}
|
|
281
|
+
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">
|
|
283
|
+
<input
|
|
284
|
+
class="font-bold text-lg w-full outline-none"
|
|
285
|
+
[class.uppercase]="this.spxCapitalize"
|
|
286
|
+
[attr.autofocus]="this.spxAutofocus ? this.spxAutofocus : undefined"
|
|
287
|
+
[attr.disabled]="this.spxReadonly ? this.spxReadonly : undefined"
|
|
288
|
+
[attr.inputMode]="this.spxInputMode ? this.spxInputMode : undefined"
|
|
289
|
+
[attr.pattern]="this.spxPattern ? this.spxPattern : undefined"
|
|
290
|
+
[attr.name]="this.spxName"
|
|
291
|
+
[attr.type]="this.spxType"
|
|
292
|
+
[attr.value]="this.value?.description ? this.value?.description : this.value?.value"
|
|
293
|
+
(blur)="this.handleBlur()"
|
|
294
|
+
(keyUp)="this.handleKeyUp()"
|
|
295
|
+
(focus)="this.handleFocus()"
|
|
296
|
+
(input)="this.handleDescriptionInput($event)"
|
|
297
|
+
/>
|
|
298
|
+
<span *ngIf="this.value?.description && this.value?.value && this.value?.description?.valueOf() !== this.value?.value?.valueOf()">{{this.value?.value}}</span>
|
|
299
|
+
<div
|
|
300
|
+
*ngIf="this.spxFocused && (this.spxType === 'overlay' || this.spxType === 'overlaynumber')"
|
|
301
|
+
class="absolute bg-gray-100 left-0 right-0 z-20">
|
|
302
|
+
<div
|
|
303
|
+
*ngFor="let valuePair of this.spxSuggestions"
|
|
304
|
+
class="text-black block w-full p-2 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-100 flex items-center"
|
|
305
|
+
(click)="this.handleSuggestionClick($event)"
|
|
306
|
+
[attr.tabindex]="0"
|
|
307
|
+
>
|
|
308
|
+
<div class="flex-1 p-1 font-bold text-lg">{{valuePair?.description}}</div>
|
|
309
|
+
<spx-button spxType="button">Select</spx-button>
|
|
310
|
+
</div>
|
|
311
|
+
</div>
|
|
312
|
+
</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"] }] }); }
|
|
313
|
+
}
|
|
314
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputTextComponent, decorators: [{
|
|
315
|
+
type: Component,
|
|
316
|
+
args: [{
|
|
317
|
+
selector: 'spx-input-text',
|
|
318
|
+
standalone: true,
|
|
319
|
+
imports: [
|
|
320
|
+
NgIf,
|
|
321
|
+
NgFor,
|
|
322
|
+
SpxButtonComponent,
|
|
323
|
+
],
|
|
324
|
+
template: `<div class="relative">
|
|
325
|
+
<input
|
|
326
|
+
class="font-bold text-lg w-full outline-none"
|
|
327
|
+
[class.uppercase]="this.spxCapitalize"
|
|
328
|
+
[attr.autofocus]="this.spxAutofocus ? this.spxAutofocus : undefined"
|
|
329
|
+
[attr.disabled]="this.spxReadonly ? this.spxReadonly : undefined"
|
|
330
|
+
[attr.inputMode]="this.spxInputMode ? this.spxInputMode : undefined"
|
|
331
|
+
[attr.pattern]="this.spxPattern ? this.spxPattern : undefined"
|
|
332
|
+
[attr.name]="this.spxName"
|
|
333
|
+
[attr.type]="this.spxType"
|
|
334
|
+
[attr.value]="this.value?.description ? this.value?.description : this.value?.value"
|
|
335
|
+
(blur)="this.handleBlur()"
|
|
336
|
+
(keyUp)="this.handleKeyUp()"
|
|
337
|
+
(focus)="this.handleFocus()"
|
|
338
|
+
(input)="this.handleDescriptionInput($event)"
|
|
339
|
+
/>
|
|
340
|
+
<span *ngIf="this.value?.description && this.value?.value && this.value?.description?.valueOf() !== this.value?.value?.valueOf()">{{this.value?.value}}</span>
|
|
341
|
+
<div
|
|
342
|
+
*ngIf="this.spxFocused && (this.spxType === 'overlay' || this.spxType === 'overlaynumber')"
|
|
343
|
+
class="absolute bg-gray-100 left-0 right-0 z-20">
|
|
344
|
+
<div
|
|
345
|
+
*ngFor="let valuePair of this.spxSuggestions"
|
|
346
|
+
class="text-black block w-full p-2 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-100 flex items-center"
|
|
347
|
+
(click)="this.handleSuggestionClick($event)"
|
|
348
|
+
[attr.tabindex]="0"
|
|
349
|
+
>
|
|
350
|
+
<div class="flex-1 p-1 font-bold text-lg">{{valuePair?.description}}</div>
|
|
351
|
+
<spx-button spxType="button">Select</spx-button>
|
|
352
|
+
</div>
|
|
353
|
+
</div>
|
|
354
|
+
</div>`,
|
|
355
|
+
}]
|
|
356
|
+
}], propDecorators: { spxName: [{
|
|
357
|
+
type: Input
|
|
358
|
+
}], spxAutofocus: [{
|
|
359
|
+
type: Input
|
|
360
|
+
}], spxInputMode: [{
|
|
361
|
+
type: Input
|
|
362
|
+
}], spxPattern: [{
|
|
363
|
+
type: Input
|
|
364
|
+
}], spxSuggestions: [{
|
|
365
|
+
type: Input
|
|
366
|
+
}], spxReadonly: [{
|
|
367
|
+
type: Input
|
|
368
|
+
}], spxValidators: [{
|
|
369
|
+
type: Input
|
|
370
|
+
}], spxCapitalize: [{
|
|
371
|
+
type: Input
|
|
372
|
+
}], spxFocused: [{
|
|
373
|
+
type: Input
|
|
374
|
+
}], spxType: [{
|
|
375
|
+
type: Input
|
|
376
|
+
}], value: [{
|
|
377
|
+
type: Input
|
|
378
|
+
}], spxBlurFromChild: [{
|
|
379
|
+
type: Output
|
|
380
|
+
}], spxChange: [{
|
|
381
|
+
type: Output
|
|
382
|
+
}], spxFocus: [{
|
|
383
|
+
type: Output
|
|
384
|
+
}], spxWasInternalUpdate: [{
|
|
385
|
+
type: Input
|
|
386
|
+
}] } });
|
|
387
|
+
|
|
388
|
+
class SpxInputDateComponent {
|
|
389
|
+
async spxSetFocus() {
|
|
390
|
+
// this.elYear.focus();
|
|
391
|
+
}
|
|
392
|
+
// @Watch('spxValidators') watchSpxValidators(newValue) {
|
|
393
|
+
// console.log('validators', newValue);
|
|
394
|
+
// }
|
|
395
|
+
// @Watch('value') watchValue(newValue) {
|
|
396
|
+
// if (this.spxWasInternalUpdate) {
|
|
397
|
+
// this.spxWasInternalUpdate = false;
|
|
398
|
+
// } else {
|
|
399
|
+
// const parsedValue = DateTime.fromISO(newValue?.value);
|
|
400
|
+
// this.spxInternalValue.years = parsedValue.year;
|
|
401
|
+
// this.spxInternalValue.months = parsedValue.month;
|
|
402
|
+
// this.spxInternalValue.days = parsedValue.day;
|
|
403
|
+
// this.spxSelectStep = 'years';
|
|
404
|
+
// }
|
|
405
|
+
// }
|
|
406
|
+
constructor() {
|
|
407
|
+
this.spxReadonly = false;
|
|
408
|
+
this.spxFocused = true;
|
|
409
|
+
this.spxSelectMonth = true;
|
|
410
|
+
this.spxSelectDay = true;
|
|
411
|
+
this.spxChange = new EventEmitter();
|
|
412
|
+
this.spxFocus = new EventEmitter();
|
|
413
|
+
this.spxSelectStep = 'years';
|
|
414
|
+
this.spxInternalValue = {};
|
|
415
|
+
this.spxSuggestions = {
|
|
416
|
+
years: [],
|
|
417
|
+
months: [{
|
|
418
|
+
description: 'Jan',
|
|
419
|
+
value: 1,
|
|
420
|
+
}, {
|
|
421
|
+
description: 'Feb',
|
|
422
|
+
value: 2,
|
|
423
|
+
}, {
|
|
424
|
+
description: 'Mar',
|
|
425
|
+
value: 3,
|
|
426
|
+
}, {
|
|
427
|
+
description: 'Apr',
|
|
428
|
+
value: 4,
|
|
429
|
+
}, {
|
|
430
|
+
description: 'May',
|
|
431
|
+
value: 5,
|
|
432
|
+
}, {
|
|
433
|
+
description: 'Jun',
|
|
434
|
+
value: 6,
|
|
435
|
+
}, {
|
|
436
|
+
description: 'Jul',
|
|
437
|
+
value: 7,
|
|
438
|
+
}, {
|
|
439
|
+
description: 'Aug',
|
|
440
|
+
value: 8,
|
|
441
|
+
}, {
|
|
442
|
+
description: 'Sep',
|
|
443
|
+
value: 9,
|
|
444
|
+
}, {
|
|
445
|
+
description: 'Oct',
|
|
446
|
+
value: 10,
|
|
447
|
+
}, {
|
|
448
|
+
description: 'Nov',
|
|
449
|
+
value: 11,
|
|
450
|
+
}, {
|
|
451
|
+
description: 'Dec',
|
|
452
|
+
value: 12,
|
|
453
|
+
}],
|
|
454
|
+
days: [],
|
|
455
|
+
};
|
|
456
|
+
this.spxWasInternalUpdate = false;
|
|
457
|
+
this.suggestYears();
|
|
458
|
+
}
|
|
459
|
+
componentWillLoad() {
|
|
460
|
+
const parsedValue = this.value ? DateTime.fromISO(this.value.value) : DateTime.now();
|
|
461
|
+
this.spxInternalValue.years = parsedValue.year;
|
|
462
|
+
this.spxInternalValue.months = parsedValue.month;
|
|
463
|
+
this.spxInternalValue.days = parsedValue.day;
|
|
464
|
+
}
|
|
465
|
+
handleDayInput(event) {
|
|
466
|
+
this.spxInternalValue.days = event.target ? event.target.value : null;
|
|
467
|
+
this.updateValue();
|
|
468
|
+
}
|
|
469
|
+
handleMonthInput(event) {
|
|
470
|
+
this.spxInternalValue.months = event.target ? event.target.value : null;
|
|
471
|
+
this.afterMonthChange();
|
|
472
|
+
}
|
|
473
|
+
afterMonthChange() {
|
|
474
|
+
if (this.spxInternalValue.months.toString().length === 2 && this.spxSelectDay && this.spxLastKeyPressed !== 38 && this.spxLastKeyPressed !== 40) {
|
|
475
|
+
// this.elDay!.focus();
|
|
476
|
+
}
|
|
477
|
+
this.updateValue();
|
|
478
|
+
}
|
|
479
|
+
handleYearInput(event) {
|
|
480
|
+
this.spxInternalValue.years = event.target ? event.target.value : null;
|
|
481
|
+
this.afterYearChange();
|
|
482
|
+
}
|
|
483
|
+
afterYearChange() {
|
|
484
|
+
if (this.spxInternalValue.years.toString().length === 4 && this.spxSelectMonth && this.spxLastKeyPressed !== 38 && this.spxLastKeyPressed !== 40) {
|
|
485
|
+
// this.elMonth!.focus();
|
|
486
|
+
}
|
|
487
|
+
this.updateValue();
|
|
488
|
+
}
|
|
489
|
+
handleInput(event) {
|
|
490
|
+
this.setValue(event.target ? event.target.value : null);
|
|
491
|
+
}
|
|
492
|
+
handleFocus(step) {
|
|
493
|
+
this.spxSelectStep = step;
|
|
494
|
+
this.spxFocus.emit();
|
|
495
|
+
}
|
|
496
|
+
handleKeyDown(event) {
|
|
497
|
+
this.spxLastKeyPressed = event.which;
|
|
498
|
+
}
|
|
499
|
+
handleSuggestionClick(value) {
|
|
500
|
+
this.spxLastKeyPressed = null;
|
|
501
|
+
this.spxInternalValue[this.spxSelectStep] = value;
|
|
502
|
+
this.updateValue();
|
|
503
|
+
this.doneWithField();
|
|
504
|
+
}
|
|
505
|
+
updateValue() {
|
|
506
|
+
const concatenatedValue = `${this.spxInternalValue.years ? this.spxInternalValue.years : ``}${this.spxInternalValue.months ? `-${this.spxInternalValue.months < 10 ? `0${this.spxInternalValue.months}` : this.spxInternalValue.months}` : ``}${this.spxInternalValue.days ? `-${this.spxInternalValue.days < 10 ? `0${this.spxInternalValue.days}` : this.spxInternalValue.days}` : ``}`;
|
|
507
|
+
const parsedValue = DateTime.fromISO(concatenatedValue);
|
|
508
|
+
this.spxWasInternalUpdate = true;
|
|
509
|
+
this.value = {
|
|
510
|
+
description: parsedValue.toISO(),
|
|
511
|
+
value: parsedValue.toISO(),
|
|
512
|
+
};
|
|
513
|
+
this.spxChange.emit(this.value);
|
|
514
|
+
}
|
|
515
|
+
doneWithField() {
|
|
516
|
+
if (this.spxSelectStep === 'days') {
|
|
517
|
+
this.spxSelectStep = 'years';
|
|
518
|
+
}
|
|
519
|
+
else if (this.spxSelectStep === 'months') {
|
|
520
|
+
this.spxSelectStep = this.spxSelectDay ? 'days' : 'years';
|
|
521
|
+
this.afterMonthChange();
|
|
522
|
+
}
|
|
523
|
+
else if (this.spxSelectStep === 'years') {
|
|
524
|
+
this.afterYearChange();
|
|
525
|
+
this.spxSelectStep = this.spxSelectMonth ? 'months' : 'years';
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
setValue(value) {
|
|
529
|
+
this.spxInternalValue = value;
|
|
530
|
+
const parsed = DateTime.fromISO(value);
|
|
531
|
+
this.value = {
|
|
532
|
+
description: parsed.toISO(),
|
|
533
|
+
value: parsed.toISO(),
|
|
534
|
+
};
|
|
535
|
+
this.spxChange.emit(this.value);
|
|
536
|
+
this.spxWasInternalUpdate = true;
|
|
537
|
+
}
|
|
538
|
+
suggestYears() {
|
|
539
|
+
this.spxSuggestions.years = [];
|
|
540
|
+
for (let year = DateTime.fromISO(this.spxMin).year; year <= DateTime.fromISO(this.spxMax).year; year++) {
|
|
541
|
+
this.spxSuggestions.years.push({
|
|
542
|
+
description: `'${year.toString().substring(2, 4)}`,
|
|
543
|
+
value: year,
|
|
544
|
+
});
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputDateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
548
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: SpxInputDateComponent, isStandalone: true, selector: "spx-input-date", inputs: { spxMax: "spxMax", spxMin: "spxMin", spxName: "spxName", spxReadonly: "spxReadonly", spxValidators: "spxValidators", spxFocused: "spxFocused", spxSelectMonth: "spxSelectMonth", spxSelectDay: "spxSelectDay", value: "value", spxLastKeyPressed: "spxLastKeyPressed", spxSelectStep: "spxSelectStep", spxInternalValue: "spxInternalValue", spxSuggestions: "spxSuggestions", spxWasInternalUpdate: "spxWasInternalUpdate" }, outputs: { spxChange: "spxChange", spxFocus: "spxFocus" }, ngImport: i0, template: `<div class='spx-input-date__controls'>
|
|
549
|
+
<input
|
|
550
|
+
class='spx-input-date__input'
|
|
551
|
+
[attr.value]="this.spxInternalValue.years"
|
|
552
|
+
(focus)="this.handleFocus('years')"
|
|
553
|
+
(input)="this.handleYearInput($event)"
|
|
554
|
+
(keyDown)="this.handleKeyDown($event)"
|
|
555
|
+
[attr.type]="'number'"
|
|
556
|
+
[attr.min]="1900"
|
|
557
|
+
[attr.max]="2100"
|
|
558
|
+
[attr.step]="1"
|
|
559
|
+
/>
|
|
560
|
+
<div class='spx-input-date__control-label'>Year</div>
|
|
561
|
+
<input
|
|
562
|
+
*ngIf="this.spxSelectMonth"
|
|
563
|
+
class='spx-input-date__input'
|
|
564
|
+
[attr.value]="this.spxInternalValue.months"
|
|
565
|
+
(focus)="this.handleFocus('months')"
|
|
566
|
+
(input)="this.handleMonthInput($event)"
|
|
567
|
+
(keyDown)="this.handleKeyDown($event)"
|
|
568
|
+
[attr.type]="'number'"
|
|
569
|
+
[attr.min]="1"
|
|
570
|
+
[attr.max]="12"
|
|
571
|
+
[attr.step]="1" />
|
|
572
|
+
<div class='spx-input-date__control-label'>Month</div>
|
|
573
|
+
<input
|
|
574
|
+
*ngIf="this.spxSelectDay"
|
|
575
|
+
class='spx-input-date__input'
|
|
576
|
+
[attr.value]="this.spxInternalValue.days"
|
|
577
|
+
(focus)="this.handleFocus('days')"
|
|
578
|
+
(input)="this.handleDayInput($event)"
|
|
579
|
+
(keyDown)="this.handleKeyDown($event)"
|
|
580
|
+
[attr.type]="'number'"
|
|
581
|
+
[attr.min]="1"
|
|
582
|
+
[attr.max]="31"
|
|
583
|
+
[attr.step]="1" />
|
|
584
|
+
<div class='spx-input-date__control-label'>Days</div>
|
|
585
|
+
</div>
|
|
586
|
+
<div class='spx-input-date__suggestions'>
|
|
587
|
+
<spx-suggestion
|
|
588
|
+
*ngFor="let valuePair of spxSuggestions[spxSelectStep]"
|
|
589
|
+
(click)="this.handleSuggestionClick(valuePair.value)">{{valuePair?.description}}</spx-suggestion>
|
|
590
|
+
</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"] }] }); }
|
|
591
|
+
}
|
|
592
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputDateComponent, decorators: [{
|
|
593
|
+
type: Component,
|
|
594
|
+
args: [{ selector: 'spx-input-date', standalone: true, imports: [
|
|
595
|
+
NgIf,
|
|
596
|
+
NgFor,
|
|
597
|
+
SpxButtonComponent,
|
|
598
|
+
SpxSuggestionComponent
|
|
599
|
+
], template: `<div class='spx-input-date__controls'>
|
|
600
|
+
<input
|
|
601
|
+
class='spx-input-date__input'
|
|
602
|
+
[attr.value]="this.spxInternalValue.years"
|
|
603
|
+
(focus)="this.handleFocus('years')"
|
|
604
|
+
(input)="this.handleYearInput($event)"
|
|
605
|
+
(keyDown)="this.handleKeyDown($event)"
|
|
606
|
+
[attr.type]="'number'"
|
|
607
|
+
[attr.min]="1900"
|
|
608
|
+
[attr.max]="2100"
|
|
609
|
+
[attr.step]="1"
|
|
610
|
+
/>
|
|
611
|
+
<div class='spx-input-date__control-label'>Year</div>
|
|
612
|
+
<input
|
|
613
|
+
*ngIf="this.spxSelectMonth"
|
|
614
|
+
class='spx-input-date__input'
|
|
615
|
+
[attr.value]="this.spxInternalValue.months"
|
|
616
|
+
(focus)="this.handleFocus('months')"
|
|
617
|
+
(input)="this.handleMonthInput($event)"
|
|
618
|
+
(keyDown)="this.handleKeyDown($event)"
|
|
619
|
+
[attr.type]="'number'"
|
|
620
|
+
[attr.min]="1"
|
|
621
|
+
[attr.max]="12"
|
|
622
|
+
[attr.step]="1" />
|
|
623
|
+
<div class='spx-input-date__control-label'>Month</div>
|
|
624
|
+
<input
|
|
625
|
+
*ngIf="this.spxSelectDay"
|
|
626
|
+
class='spx-input-date__input'
|
|
627
|
+
[attr.value]="this.spxInternalValue.days"
|
|
628
|
+
(focus)="this.handleFocus('days')"
|
|
629
|
+
(input)="this.handleDayInput($event)"
|
|
630
|
+
(keyDown)="this.handleKeyDown($event)"
|
|
631
|
+
[attr.type]="'number'"
|
|
632
|
+
[attr.min]="1"
|
|
633
|
+
[attr.max]="31"
|
|
634
|
+
[attr.step]="1" />
|
|
635
|
+
<div class='spx-input-date__control-label'>Days</div>
|
|
636
|
+
</div>
|
|
637
|
+
<div class='spx-input-date__suggestions'>
|
|
638
|
+
<spx-suggestion
|
|
639
|
+
*ngFor="let valuePair of spxSuggestions[spxSelectStep]"
|
|
640
|
+
(click)="this.handleSuggestionClick(valuePair.value)">{{valuePair?.description}}</spx-suggestion>
|
|
641
|
+
</div>`, 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"] }]
|
|
642
|
+
}], ctorParameters: () => [], propDecorators: { spxMax: [{
|
|
643
|
+
type: Input
|
|
644
|
+
}], spxMin: [{
|
|
645
|
+
type: Input
|
|
646
|
+
}], spxName: [{
|
|
647
|
+
type: Input
|
|
648
|
+
}], spxReadonly: [{
|
|
649
|
+
type: Input
|
|
650
|
+
}], spxValidators: [{
|
|
651
|
+
type: Input
|
|
652
|
+
}], spxFocused: [{
|
|
653
|
+
type: Input
|
|
654
|
+
}], spxSelectMonth: [{
|
|
655
|
+
type: Input
|
|
656
|
+
}], spxSelectDay: [{
|
|
657
|
+
type: Input
|
|
658
|
+
}], value: [{
|
|
659
|
+
type: Input
|
|
660
|
+
}], spxChange: [{
|
|
661
|
+
type: Output
|
|
662
|
+
}], spxFocus: [{
|
|
663
|
+
type: Output
|
|
664
|
+
}], spxLastKeyPressed: [{
|
|
665
|
+
type: Input
|
|
666
|
+
}], spxSelectStep: [{
|
|
667
|
+
type: Input
|
|
668
|
+
}], spxInternalValue: [{
|
|
669
|
+
type: Input
|
|
670
|
+
}], spxSuggestions: [{
|
|
671
|
+
type: Input
|
|
672
|
+
}], spxWasInternalUpdate: [{
|
|
673
|
+
type: Input
|
|
674
|
+
}] } });
|
|
675
|
+
|
|
676
|
+
class SpxInputFloatComponent {
|
|
677
|
+
constructor() {
|
|
678
|
+
// private elFirstInput?: HTMLElement;
|
|
679
|
+
// private elSecondInput?: HTMLElement;
|
|
680
|
+
this.internalValue = {
|
|
681
|
+
first: null,
|
|
682
|
+
second: null,
|
|
683
|
+
};
|
|
684
|
+
this.spxAutofocus = false;
|
|
685
|
+
this.spxReadonly = false;
|
|
686
|
+
this.spxFocused = true;
|
|
687
|
+
this.spxChange = new EventEmitter();
|
|
688
|
+
this.spxFocus = new EventEmitter();
|
|
689
|
+
this.spxWasInternalUpdate = false;
|
|
690
|
+
this.tick = {};
|
|
691
|
+
}
|
|
692
|
+
async spxSetFocus() {
|
|
693
|
+
// this.elFirstInput.focus();
|
|
694
|
+
}
|
|
695
|
+
// @Watch('value') onValueChanged(newValue: SpxValuePair<any>, _oldValue: SpxValuePair<any>) {
|
|
696
|
+
// this.handleSetValue(newValue);
|
|
697
|
+
// }
|
|
698
|
+
componentDidLoad() {
|
|
699
|
+
if (this.spxAutofocus) {
|
|
700
|
+
this.spxFocus.emit();
|
|
701
|
+
this.spxSetFocus();
|
|
702
|
+
}
|
|
703
|
+
this.handleSetValue(this.value);
|
|
704
|
+
}
|
|
705
|
+
handleFocus() {
|
|
706
|
+
this.spxFocus.emit();
|
|
707
|
+
}
|
|
708
|
+
handleSetValue(newValue) {
|
|
709
|
+
if (this.isNumeric(newValue?.value)) {
|
|
710
|
+
this.internalValue = {
|
|
711
|
+
first: Math.floor(parseFloat(newValue?.value)),
|
|
712
|
+
second: newValue?.value?.split ? newValue?.value.split('.')[1] : 0,
|
|
713
|
+
};
|
|
714
|
+
}
|
|
715
|
+
else {
|
|
716
|
+
this.internalValue = {
|
|
717
|
+
first: null,
|
|
718
|
+
second: null,
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
this.tick = {};
|
|
722
|
+
}
|
|
723
|
+
handleInput(event, position) {
|
|
724
|
+
this.internalValue = {
|
|
725
|
+
first: position === 1 ? (event.target ? event.target.value : null) : this.internalValue.first,
|
|
726
|
+
second: position === 2 ? (event.target ? event.target.value : null) : this.internalValue.second,
|
|
727
|
+
};
|
|
728
|
+
let result;
|
|
729
|
+
if (this.internalValue.first === null && this.internalValue.second === null) {
|
|
730
|
+
result = null;
|
|
731
|
+
}
|
|
732
|
+
else {
|
|
733
|
+
result = `${this.internalValue.first ? this.internalValue.first : 0}.${this.internalValue.second ? this.internalValue.second : 0}`;
|
|
734
|
+
}
|
|
735
|
+
this.value = {
|
|
736
|
+
description: result,
|
|
737
|
+
value: result,
|
|
738
|
+
};
|
|
739
|
+
this.spxChange.emit(this.value);
|
|
740
|
+
}
|
|
741
|
+
isNumeric(value) {
|
|
742
|
+
return /^[+-]?\d+(\.\d+)?$/.test(value);
|
|
743
|
+
}
|
|
744
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputFloatComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
745
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: SpxInputFloatComponent, isStandalone: true, selector: "spx-input-float", inputs: { spxName: "spxName", spxAutofocus: "spxAutofocus", spxReadonly: "spxReadonly", spxValidators: "spxValidators", spxFocused: "spxFocused", spxStep: "spxStep", value: "value", spxWasInternalUpdate: "spxWasInternalUpdate", tick: "tick" }, outputs: { spxChange: "spxChange", spxFocus: "spxFocus" }, ngImport: i0, template: `<div class="flex items-end">
|
|
746
|
+
<input
|
|
747
|
+
class="spx-input-float__input"
|
|
748
|
+
[attr.autofocus]="this.spxAutofocus ? this.spxAutofocus : undefined"
|
|
749
|
+
[attr.disabled]="this.spxReadonly ? this.spxReadonly : undefined"
|
|
750
|
+
[attr.pattern]="'[0-9]*'"
|
|
751
|
+
[attr.step]="1"
|
|
752
|
+
[attr.type]="'text'"
|
|
753
|
+
[attr.value]="this.internalValue?.first ? this.internalValue?.first : undefined"
|
|
754
|
+
[class.spx-input-float--readonly]="this.spxReadonly ? this.spxReadonly : undefined"
|
|
755
|
+
(focus)="this.handleFocus()"
|
|
756
|
+
(input)="this.handleInput($event, 1)" />
|
|
757
|
+
<span class="text-black font-bold text-2xl mx-4">,</span>
|
|
758
|
+
<input
|
|
759
|
+
[attr.autofocus]="this.spxAutofocus ? this.spxAutofocus : undefined"
|
|
760
|
+
class="spx-input-float__input"
|
|
761
|
+
[class.spx-input-float--readonly]="this.spxReadonly ? this.spxReadonly : undefined"
|
|
762
|
+
[attr.disabled]="this.spxReadonly ? this.spxReadonly : undefined"
|
|
763
|
+
[attr.value]="this.internalValue?.second ? this.internalValue?.second : undefined"
|
|
764
|
+
(focus)="this.handleFocus()"
|
|
765
|
+
(input)="this.handleInput($event, 2)"
|
|
766
|
+
[attr.step]="1"
|
|
767
|
+
[attr.type]="'text'"
|
|
768
|
+
[attr.pattern]="'[0-9]*'" />
|
|
769
|
+
</div>`, isInline: true, styles: [":host{display:block}.spx-input-float__input{border:1px solid #333333;border-radius:8px;background-color:transparent;box-sizing:border-box;color:var(--spx-input--color, rgba(0, 0, 0, .9));flex:1;font-size:20px;font-weight:700;padding:8px;width:100%}.spx-input-float__input:focus{outline:none}\n"] }); }
|
|
770
|
+
}
|
|
771
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputFloatComponent, decorators: [{
|
|
772
|
+
type: Component,
|
|
773
|
+
args: [{ selector: 'spx-input-float', standalone: true, imports: [
|
|
774
|
+
NgIf,
|
|
775
|
+
NgFor,
|
|
776
|
+
SpxButtonComponent,
|
|
777
|
+
], template: `<div class="flex items-end">
|
|
778
|
+
<input
|
|
779
|
+
class="spx-input-float__input"
|
|
780
|
+
[attr.autofocus]="this.spxAutofocus ? this.spxAutofocus : undefined"
|
|
781
|
+
[attr.disabled]="this.spxReadonly ? this.spxReadonly : undefined"
|
|
782
|
+
[attr.pattern]="'[0-9]*'"
|
|
783
|
+
[attr.step]="1"
|
|
784
|
+
[attr.type]="'text'"
|
|
785
|
+
[attr.value]="this.internalValue?.first ? this.internalValue?.first : undefined"
|
|
786
|
+
[class.spx-input-float--readonly]="this.spxReadonly ? this.spxReadonly : undefined"
|
|
787
|
+
(focus)="this.handleFocus()"
|
|
788
|
+
(input)="this.handleInput($event, 1)" />
|
|
789
|
+
<span class="text-black font-bold text-2xl mx-4">,</span>
|
|
790
|
+
<input
|
|
791
|
+
[attr.autofocus]="this.spxAutofocus ? this.spxAutofocus : undefined"
|
|
792
|
+
class="spx-input-float__input"
|
|
793
|
+
[class.spx-input-float--readonly]="this.spxReadonly ? this.spxReadonly : undefined"
|
|
794
|
+
[attr.disabled]="this.spxReadonly ? this.spxReadonly : undefined"
|
|
795
|
+
[attr.value]="this.internalValue?.second ? this.internalValue?.second : undefined"
|
|
796
|
+
(focus)="this.handleFocus()"
|
|
797
|
+
(input)="this.handleInput($event, 2)"
|
|
798
|
+
[attr.step]="1"
|
|
799
|
+
[attr.type]="'text'"
|
|
800
|
+
[attr.pattern]="'[0-9]*'" />
|
|
801
|
+
</div>`, styles: [":host{display:block}.spx-input-float__input{border:1px solid #333333;border-radius:8px;background-color:transparent;box-sizing:border-box;color:var(--spx-input--color, rgba(0, 0, 0, .9));flex:1;font-size:20px;font-weight:700;padding:8px;width:100%}.spx-input-float__input:focus{outline:none}\n"] }]
|
|
802
|
+
}], propDecorators: { spxName: [{
|
|
803
|
+
type: Input
|
|
804
|
+
}], spxAutofocus: [{
|
|
805
|
+
type: Input
|
|
806
|
+
}], spxReadonly: [{
|
|
807
|
+
type: Input
|
|
808
|
+
}], spxValidators: [{
|
|
809
|
+
type: Input
|
|
810
|
+
}], spxFocused: [{
|
|
811
|
+
type: Input
|
|
812
|
+
}], spxStep: [{
|
|
813
|
+
type: Input
|
|
814
|
+
}], value: [{
|
|
815
|
+
type: Input
|
|
816
|
+
}], spxChange: [{
|
|
817
|
+
type: Output
|
|
818
|
+
}], spxFocus: [{
|
|
819
|
+
type: Output
|
|
820
|
+
}], spxWasInternalUpdate: [{
|
|
821
|
+
type: Input
|
|
822
|
+
}], tick: [{
|
|
823
|
+
type: Input
|
|
824
|
+
}] } });
|
|
825
|
+
|
|
826
|
+
class SpxInputNumberComponent {
|
|
827
|
+
constructor() {
|
|
828
|
+
this.spxAutofocus = false;
|
|
829
|
+
this.spxReadonly = false;
|
|
830
|
+
this.spxFocused = true;
|
|
831
|
+
this.spxChange = new EventEmitter();
|
|
832
|
+
this.spxFocus = new EventEmitter();
|
|
833
|
+
this.spxWasInternalUpdate = false;
|
|
834
|
+
}
|
|
835
|
+
async spxSetFocus() {
|
|
836
|
+
// this.elInput.focus();
|
|
837
|
+
}
|
|
838
|
+
componentDidLoad() {
|
|
839
|
+
if (this.spxAutofocus) {
|
|
840
|
+
this.spxFocus.emit();
|
|
841
|
+
this.spxSetFocus();
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
handleFocus() {
|
|
845
|
+
this.spxFocus.emit();
|
|
846
|
+
}
|
|
847
|
+
handleInput(event) {
|
|
848
|
+
this.value = {
|
|
849
|
+
description: event.target ? event.target.value : null,
|
|
850
|
+
value: event.target ? event.target.value : null,
|
|
851
|
+
};
|
|
852
|
+
this.spxChange.emit(this.value);
|
|
853
|
+
}
|
|
854
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputNumberComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
855
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: SpxInputNumberComponent, isStandalone: true, selector: "spx-input-number", inputs: { spxName: "spxName", spxAutofocus: "spxAutofocus", spxInputMode: "spxInputMode", spxReadonly: "spxReadonly", spxValidators: "spxValidators", spxFocused: "spxFocused", spxStep: "spxStep", value: "value" }, outputs: { spxChange: "spxChange", spxFocus: "spxFocus" }, ngImport: i0, template: `<div class="spx-input-number__controls">
|
|
856
|
+
<input
|
|
857
|
+
class="spx-input-number__input"
|
|
858
|
+
[attr.autofocus]="this.spxAutofocus ? this.spxAutofocus : undefined"
|
|
859
|
+
[class.spx-input-number--readonly]="this.spxReadonly ? this.spxReadonly : undefined"
|
|
860
|
+
[attr.disabled]="this.spxReadonly ? this.spxReadonly : undefined"
|
|
861
|
+
[attr.inputMode]="this.spxInputMode ? this.spxInputMode : undefined"
|
|
862
|
+
[attr.value]="this.value?.value ? this.value?.value : undefined"
|
|
863
|
+
[attr.step]="this.spxStep ? this.spxStep : undefined"
|
|
864
|
+
[attr.type]="'number'"
|
|
865
|
+
(focus)="this.handleFocus()"
|
|
866
|
+
(input)="this.handleInput($event)" />
|
|
867
|
+
</div>`, isInline: true, styles: [":host{display:block}.spx-input-number__input{border:0;background-color:transparent;box-sizing:border-box;color:var(--spx-input--color, rgba(0, 0, 0, .9));font-size:20px;font-weight:700;margin-right:10px;padding:0;width:100%}.spx-input-number__input:focus{outline:none}.spx-input-number__value{color:#0009;font-size:14px}\n"] }); }
|
|
868
|
+
}
|
|
869
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputNumberComponent, decorators: [{
|
|
870
|
+
type: Component,
|
|
871
|
+
args: [{ selector: 'spx-input-number', standalone: true, imports: [], template: `<div class="spx-input-number__controls">
|
|
872
|
+
<input
|
|
873
|
+
class="spx-input-number__input"
|
|
874
|
+
[attr.autofocus]="this.spxAutofocus ? this.spxAutofocus : undefined"
|
|
875
|
+
[class.spx-input-number--readonly]="this.spxReadonly ? this.spxReadonly : undefined"
|
|
876
|
+
[attr.disabled]="this.spxReadonly ? this.spxReadonly : undefined"
|
|
877
|
+
[attr.inputMode]="this.spxInputMode ? this.spxInputMode : undefined"
|
|
878
|
+
[attr.value]="this.value?.value ? this.value?.value : undefined"
|
|
879
|
+
[attr.step]="this.spxStep ? this.spxStep : undefined"
|
|
880
|
+
[attr.type]="'number'"
|
|
881
|
+
(focus)="this.handleFocus()"
|
|
882
|
+
(input)="this.handleInput($event)" />
|
|
883
|
+
</div>`, styles: [":host{display:block}.spx-input-number__input{border:0;background-color:transparent;box-sizing:border-box;color:var(--spx-input--color, rgba(0, 0, 0, .9));font-size:20px;font-weight:700;margin-right:10px;padding:0;width:100%}.spx-input-number__input:focus{outline:none}.spx-input-number__value{color:#0009;font-size:14px}\n"] }]
|
|
884
|
+
}], propDecorators: { spxName: [{
|
|
885
|
+
type: Input
|
|
886
|
+
}], spxAutofocus: [{
|
|
887
|
+
type: Input
|
|
888
|
+
}], spxInputMode: [{
|
|
889
|
+
type: Input
|
|
890
|
+
}], spxReadonly: [{
|
|
891
|
+
type: Input
|
|
892
|
+
}], spxValidators: [{
|
|
893
|
+
type: Input
|
|
894
|
+
}], spxFocused: [{
|
|
895
|
+
type: Input
|
|
896
|
+
}], spxStep: [{
|
|
897
|
+
type: Input
|
|
898
|
+
}], value: [{
|
|
899
|
+
type: Input
|
|
900
|
+
}], spxChange: [{
|
|
901
|
+
type: Output
|
|
902
|
+
}], spxFocus: [{
|
|
903
|
+
type: Output
|
|
904
|
+
}] } });
|
|
905
|
+
|
|
906
|
+
class SpxInputRadioComponent {
|
|
907
|
+
constructor() {
|
|
908
|
+
this.spxFocused = true;
|
|
909
|
+
this.spxReadonly = false;
|
|
910
|
+
this.spxSuggestions = [];
|
|
911
|
+
this.spxChange = new EventEmitter();
|
|
912
|
+
this.spxFocus = new EventEmitter();
|
|
913
|
+
this.spxWasInternalUpdate = false;
|
|
914
|
+
}
|
|
915
|
+
async spxSetFocus() {
|
|
916
|
+
// this.elYear.focus();
|
|
917
|
+
}
|
|
918
|
+
handleSuggestionClick(value) {
|
|
919
|
+
this.value = value;
|
|
920
|
+
this.spxChange.emit(this.value);
|
|
921
|
+
}
|
|
922
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputRadioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
923
|
+
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="spx-input-radio__suggestions">
|
|
924
|
+
<spx-suggestion
|
|
925
|
+
*ngFor="let valuePair of this.spxSuggestions"
|
|
926
|
+
[spxDisabled]="this.spxReadonly"
|
|
927
|
+
[spxSelected]="this.value?.value === this.valuePair?.value"
|
|
928
|
+
(click)="this.spxReadonly ? undefined : this.handleSuggestionClick(valuePair)">
|
|
929
|
+
{{this.valuePair?.description}}
|
|
930
|
+
</spx-suggestion>
|
|
931
|
+
</div>`, isInline: true, styles: [":host{display:block}.spx-input-radio__suggestions{display:grid;grid-gap:8px;grid-template-columns:repeat(2,1fr);margin-top:8px}.spx-input-radio--readonly{background-color:transparent;border:0;box-sizing:border-box;font-size:20px;font-weight:700;margin-right:10px;padding:0;width:100%}\n"], dependencies: [{ kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: SpxSuggestionComponent, selector: "spx-suggestion", inputs: ["spxDisabled", "spxSelected"] }] }); }
|
|
932
|
+
}
|
|
933
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputRadioComponent, decorators: [{
|
|
934
|
+
type: Component,
|
|
935
|
+
args: [{ selector: 'spx-input-radio', standalone: true, imports: [
|
|
936
|
+
NgFor,
|
|
937
|
+
SpxSuggestionComponent,
|
|
938
|
+
], template: `<div class="spx-input-radio__suggestions">
|
|
939
|
+
<spx-suggestion
|
|
940
|
+
*ngFor="let valuePair of this.spxSuggestions"
|
|
941
|
+
[spxDisabled]="this.spxReadonly"
|
|
942
|
+
[spxSelected]="this.value?.value === this.valuePair?.value"
|
|
943
|
+
(click)="this.spxReadonly ? undefined : this.handleSuggestionClick(valuePair)">
|
|
944
|
+
{{this.valuePair?.description}}
|
|
945
|
+
</spx-suggestion>
|
|
946
|
+
</div>`, styles: [":host{display:block}.spx-input-radio__suggestions{display:grid;grid-gap:8px;grid-template-columns:repeat(2,1fr);margin-top:8px}.spx-input-radio--readonly{background-color:transparent;border:0;box-sizing:border-box;font-size:20px;font-weight:700;margin-right:10px;padding:0;width:100%}\n"] }]
|
|
947
|
+
}], propDecorators: { spxName: [{
|
|
948
|
+
type: Input
|
|
949
|
+
}], spxValidators: [{
|
|
950
|
+
type: Input
|
|
951
|
+
}], spxFocused: [{
|
|
952
|
+
type: Input
|
|
953
|
+
}], spxReadonly: [{
|
|
954
|
+
type: Input
|
|
955
|
+
}], spxSuggestions: [{
|
|
956
|
+
type: Input
|
|
957
|
+
}], value: [{
|
|
958
|
+
type: Input
|
|
959
|
+
}], spxChange: [{
|
|
960
|
+
type: Output
|
|
961
|
+
}], spxFocus: [{
|
|
962
|
+
type: Output
|
|
963
|
+
}] } });
|
|
964
|
+
|
|
965
|
+
class SpxInputComponent {
|
|
966
|
+
constructor() {
|
|
967
|
+
this.spxLabel = 'label';
|
|
968
|
+
this.spxReadonly = false;
|
|
969
|
+
this.spxAutofocus = false;
|
|
970
|
+
this.spxRequired = false;
|
|
971
|
+
this.spxSelectMonth = true;
|
|
972
|
+
this.spxSelectDay = true;
|
|
973
|
+
this.spxShowEdit = false;
|
|
974
|
+
this.spxShowHelp = false;
|
|
975
|
+
this.spxCompact = false;
|
|
976
|
+
this.spxShowClear = true;
|
|
977
|
+
this.spxShowSearch = false;
|
|
978
|
+
this.spxShowValidationMessages = false;
|
|
979
|
+
this.spxSuggestions = [];
|
|
980
|
+
this.spxType = 'text';
|
|
981
|
+
this.spxCapitalize = false;
|
|
982
|
+
this.spxBlur = new EventEmitter();
|
|
983
|
+
this.spxClear = new EventEmitter();
|
|
984
|
+
this.spxChange = new EventEmitter();
|
|
985
|
+
this.spxFocus = new EventEmitter();
|
|
986
|
+
this.spxEdit = new EventEmitter();
|
|
987
|
+
this.spxHelp = new EventEmitter();
|
|
988
|
+
this.spxSearch = new EventEmitter();
|
|
989
|
+
this.spxFocused = false;
|
|
990
|
+
this.onChange = () => { };
|
|
991
|
+
this.onTouched = () => { };
|
|
992
|
+
}
|
|
993
|
+
async spxSetFocus() {
|
|
994
|
+
this.passFocusToControl();
|
|
995
|
+
}
|
|
996
|
+
handleBlur() {
|
|
997
|
+
this.spxBlur.emit();
|
|
998
|
+
}
|
|
999
|
+
handleChange(event) {
|
|
1000
|
+
this.value = event;
|
|
1001
|
+
this.spxChange.emit(this.value);
|
|
1002
|
+
}
|
|
1003
|
+
handleClear() {
|
|
1004
|
+
this.spxFocused = true;
|
|
1005
|
+
this.passFocusToControl();
|
|
1006
|
+
this.value = {
|
|
1007
|
+
description: null,
|
|
1008
|
+
value: null,
|
|
1009
|
+
};
|
|
1010
|
+
this.spxChange.emit(this.value);
|
|
1011
|
+
}
|
|
1012
|
+
handleFocus() {
|
|
1013
|
+
this.spxFocused = true;
|
|
1014
|
+
// this.elBox.spxSetFocus();
|
|
1015
|
+
}
|
|
1016
|
+
handleSearch() {
|
|
1017
|
+
this.spxSearch.emit();
|
|
1018
|
+
}
|
|
1019
|
+
setFocus() {
|
|
1020
|
+
this.spxFocused = true;
|
|
1021
|
+
this.passFocusToControl();
|
|
1022
|
+
}
|
|
1023
|
+
setFocusOut() {
|
|
1024
|
+
this.spxFocused = false;
|
|
1025
|
+
}
|
|
1026
|
+
handleEdit() {
|
|
1027
|
+
this.spxFocused = true;
|
|
1028
|
+
}
|
|
1029
|
+
handleHelp() {
|
|
1030
|
+
this.spxFocused = true;
|
|
1031
|
+
}
|
|
1032
|
+
passFocusToControl() {
|
|
1033
|
+
}
|
|
1034
|
+
writeValue(value) {
|
|
1035
|
+
this.value = this.lastValue = value == null ? '' : value;
|
|
1036
|
+
}
|
|
1037
|
+
handleChangeEvent(value) {
|
|
1038
|
+
if (value !== this.lastValue) {
|
|
1039
|
+
this.lastValue = value;
|
|
1040
|
+
this.onChange(value);
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
_handleBlurEvent() {
|
|
1044
|
+
this.onTouched();
|
|
1045
|
+
}
|
|
1046
|
+
registerOnChange(fn) {
|
|
1047
|
+
this.onChange = fn;
|
|
1048
|
+
}
|
|
1049
|
+
registerOnTouched(fn) {
|
|
1050
|
+
this.onTouched = fn;
|
|
1051
|
+
}
|
|
1052
|
+
setDisabledState(isDisabled) {
|
|
1053
|
+
this.spxReadonly = isDisabled;
|
|
1054
|
+
}
|
|
1055
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1056
|
+
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: [
|
|
1057
|
+
{
|
|
1058
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1059
|
+
useExisting: SpxInputComponent,
|
|
1060
|
+
multi: true
|
|
1061
|
+
}
|
|
1062
|
+
], ngImport: i0, template: `<spx-input-box
|
|
1063
|
+
[spxLabel]="this.spxLabel"
|
|
1064
|
+
[spxReadonly]="this.spxReadonly"
|
|
1065
|
+
[spxRequired]="this.spxRequired"
|
|
1066
|
+
[spxValue]="this.value"
|
|
1067
|
+
[spxShowHelp]="this.spxShowHelp"
|
|
1068
|
+
[spxCompact]="this.spxCompact"
|
|
1069
|
+
[spxShowClear]="this.spxShowClear"
|
|
1070
|
+
[spxShowEdit]="this.spxShowEdit"
|
|
1071
|
+
[spxShowSearch]="this.spxShowSearch ? this.spxShowSearch : this.spxType === 'autocomplete'"
|
|
1072
|
+
[spxShowValidationMessages]="this.spxShowValidationMessages"
|
|
1073
|
+
(spxClear)="this.handleClear()"
|
|
1074
|
+
(spxEdit)="this.handleEdit()"
|
|
1075
|
+
(spxHelp)="this.handleHelp()"
|
|
1076
|
+
(spxFocus)="this.setFocus()"
|
|
1077
|
+
(spxFocusOut)="this.setFocusOut()"
|
|
1078
|
+
(spxSearchOutput)="this.handleSearch()">
|
|
1079
|
+
<div controls>
|
|
1080
|
+
<spx-input-text
|
|
1081
|
+
*ngIf="this.spxType === 'autocomplete' || this.spxType === 'overlay' || this.spxType === 'overlaynumber' || this.spxType === 'text' || this.spxType === 'password'"
|
|
1082
|
+
[spxAutofocus]="this.spxAutofocus"
|
|
1083
|
+
[spxCapitalize]="this.spxCapitalize"
|
|
1084
|
+
[spxFocused]="this.spxFocused"
|
|
1085
|
+
[spxInputMode]="this.spxType === 'overlaynumber' ? 'numeric' : this.spxInputMode"
|
|
1086
|
+
[spxName]="this.spxName"
|
|
1087
|
+
[spxPattern]="this.spxType === 'overlaynumber' ? '[0-9]*' : this.spxPattern"
|
|
1088
|
+
[spxReadonly]="this.spxReadonly"
|
|
1089
|
+
[spxSuggestions]="this.spxSuggestions"
|
|
1090
|
+
[spxType]="this.spxType"
|
|
1091
|
+
[spxValidators]="this.spxValidators"
|
|
1092
|
+
[value]="this.value"
|
|
1093
|
+
(spxBlurFromChild)="this.handleBlur()"
|
|
1094
|
+
(spxChange)="this.handleChange($event)"
|
|
1095
|
+
(spxFocus)="this.handleFocus()"
|
|
1096
|
+
></spx-input-text>
|
|
1097
|
+
<spx-input-date
|
|
1098
|
+
*ngIf="this.spxType === 'date'"
|
|
1099
|
+
[spxFocused]="this.spxFocused"
|
|
1100
|
+
[spxMax]="this.spxMax"
|
|
1101
|
+
[spxMin]="this.spxMin"
|
|
1102
|
+
[spxName]="this.spxName"
|
|
1103
|
+
[spxReadonly]="this.spxReadonly"
|
|
1104
|
+
[spxSelectDay]="this.spxSelectDay"
|
|
1105
|
+
[spxSelectMonth]="this.spxSelectMonth"
|
|
1106
|
+
[spxValidators]="this.spxValidators"
|
|
1107
|
+
[value]="this.value"
|
|
1108
|
+
(spxChange)="this.handleChange($event)"
|
|
1109
|
+
(spxFocus)="this.handleFocus()"
|
|
1110
|
+
></spx-input-date>
|
|
1111
|
+
<spx-input-float
|
|
1112
|
+
*ngIf="this.spxType === 'float'"
|
|
1113
|
+
[spxAutofocus]="this.spxAutofocus"
|
|
1114
|
+
[spxFocused]="this.spxFocused"
|
|
1115
|
+
[spxName]="this.spxName"
|
|
1116
|
+
[spxReadonly]="this.spxReadonly"
|
|
1117
|
+
[spxStep]="this.spxStep"
|
|
1118
|
+
[spxValidators]="this.spxValidators"
|
|
1119
|
+
[value]="this.value"
|
|
1120
|
+
(spxChange)="this.handleChange($event)"
|
|
1121
|
+
(spxFocus)="this.handleFocus()"
|
|
1122
|
+
></spx-input-float>
|
|
1123
|
+
<spx-input-number
|
|
1124
|
+
*ngIf="this.spxType === 'number'"
|
|
1125
|
+
[spxStep]="this.spxStep"
|
|
1126
|
+
[spxAutofocus]="this.spxAutofocus"
|
|
1127
|
+
[spxFocused]="this.spxFocused"
|
|
1128
|
+
[spxInputMode]="this.spxInputMode"
|
|
1129
|
+
[spxName]="this.spxName"
|
|
1130
|
+
[spxValidators]="this.spxValidators"
|
|
1131
|
+
(spxChange)="this.handleChange($event)"
|
|
1132
|
+
(spxFocus)="this.handleFocus()"
|
|
1133
|
+
(spxReadonly)="this.spxReadonly"
|
|
1134
|
+
[value]="this.value"
|
|
1135
|
+
></spx-input-number>
|
|
1136
|
+
<spx-input-radio
|
|
1137
|
+
*ngIf="this.spxType === 'radio'"
|
|
1138
|
+
[spxFocused]="this.spxFocused"
|
|
1139
|
+
[spxName]="this.spxName"
|
|
1140
|
+
[spxSuggestions]="this.spxSuggestions"
|
|
1141
|
+
[spxValidators]="this.spxValidators"
|
|
1142
|
+
(spxChange)="this.handleChange($event)"
|
|
1143
|
+
(spxFocus)="this.handleFocus()"
|
|
1144
|
+
(spxReadonly)="this.spxReadonly"
|
|
1145
|
+
[value]="this.value"
|
|
1146
|
+
></spx-input-radio>
|
|
1147
|
+
</div>
|
|
1148
|
+
<div validation-messages>
|
|
1149
|
+
<ng-content></ng-content>
|
|
1150
|
+
</div>
|
|
1151
|
+
</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: ["spxLabel", "spxRequired", "spxReadonly", "spxShowHelp", "spxCompact", "spxShowClear", "spxShowEdit", "spxShowSearch", "spxShowValidationMessages", "spxValue", "spxFocused"], outputs: ["spxClear", "spxSearchOutput", "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", "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"] }] }); }
|
|
1152
|
+
}
|
|
1153
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SpxInputComponent, decorators: [{
|
|
1154
|
+
type: Component,
|
|
1155
|
+
args: [{
|
|
1156
|
+
selector: 'spx-input',
|
|
1157
|
+
standalone: true,
|
|
1158
|
+
host: {
|
|
1159
|
+
'(spxChange)': 'handleChangeEvent($event)'
|
|
1160
|
+
},
|
|
1161
|
+
imports: [
|
|
1162
|
+
NgIf,
|
|
1163
|
+
SpxInputBoxComponent,
|
|
1164
|
+
SpxInputDateComponent,
|
|
1165
|
+
SpxInputFloatComponent,
|
|
1166
|
+
SpxInputNumberComponent,
|
|
1167
|
+
SpxInputRadioComponent,
|
|
1168
|
+
SpxInputTextComponent,
|
|
1169
|
+
],
|
|
1170
|
+
providers: [
|
|
1171
|
+
{
|
|
1172
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1173
|
+
useExisting: SpxInputComponent,
|
|
1174
|
+
multi: true
|
|
1175
|
+
}
|
|
1176
|
+
],
|
|
1177
|
+
template: `<spx-input-box
|
|
1178
|
+
[spxLabel]="this.spxLabel"
|
|
1179
|
+
[spxReadonly]="this.spxReadonly"
|
|
1180
|
+
[spxRequired]="this.spxRequired"
|
|
1181
|
+
[spxValue]="this.value"
|
|
1182
|
+
[spxShowHelp]="this.spxShowHelp"
|
|
1183
|
+
[spxCompact]="this.spxCompact"
|
|
1184
|
+
[spxShowClear]="this.spxShowClear"
|
|
1185
|
+
[spxShowEdit]="this.spxShowEdit"
|
|
1186
|
+
[spxShowSearch]="this.spxShowSearch ? this.spxShowSearch : this.spxType === 'autocomplete'"
|
|
1187
|
+
[spxShowValidationMessages]="this.spxShowValidationMessages"
|
|
1188
|
+
(spxClear)="this.handleClear()"
|
|
1189
|
+
(spxEdit)="this.handleEdit()"
|
|
1190
|
+
(spxHelp)="this.handleHelp()"
|
|
1191
|
+
(spxFocus)="this.setFocus()"
|
|
1192
|
+
(spxFocusOut)="this.setFocusOut()"
|
|
1193
|
+
(spxSearchOutput)="this.handleSearch()">
|
|
1194
|
+
<div controls>
|
|
1195
|
+
<spx-input-text
|
|
1196
|
+
*ngIf="this.spxType === 'autocomplete' || this.spxType === 'overlay' || this.spxType === 'overlaynumber' || this.spxType === 'text' || this.spxType === 'password'"
|
|
1197
|
+
[spxAutofocus]="this.spxAutofocus"
|
|
1198
|
+
[spxCapitalize]="this.spxCapitalize"
|
|
1199
|
+
[spxFocused]="this.spxFocused"
|
|
1200
|
+
[spxInputMode]="this.spxType === 'overlaynumber' ? 'numeric' : this.spxInputMode"
|
|
1201
|
+
[spxName]="this.spxName"
|
|
1202
|
+
[spxPattern]="this.spxType === 'overlaynumber' ? '[0-9]*' : this.spxPattern"
|
|
1203
|
+
[spxReadonly]="this.spxReadonly"
|
|
1204
|
+
[spxSuggestions]="this.spxSuggestions"
|
|
1205
|
+
[spxType]="this.spxType"
|
|
1206
|
+
[spxValidators]="this.spxValidators"
|
|
1207
|
+
[value]="this.value"
|
|
1208
|
+
(spxBlurFromChild)="this.handleBlur()"
|
|
1209
|
+
(spxChange)="this.handleChange($event)"
|
|
1210
|
+
(spxFocus)="this.handleFocus()"
|
|
1211
|
+
></spx-input-text>
|
|
1212
|
+
<spx-input-date
|
|
1213
|
+
*ngIf="this.spxType === 'date'"
|
|
1214
|
+
[spxFocused]="this.spxFocused"
|
|
1215
|
+
[spxMax]="this.spxMax"
|
|
1216
|
+
[spxMin]="this.spxMin"
|
|
1217
|
+
[spxName]="this.spxName"
|
|
1218
|
+
[spxReadonly]="this.spxReadonly"
|
|
1219
|
+
[spxSelectDay]="this.spxSelectDay"
|
|
1220
|
+
[spxSelectMonth]="this.spxSelectMonth"
|
|
1221
|
+
[spxValidators]="this.spxValidators"
|
|
1222
|
+
[value]="this.value"
|
|
1223
|
+
(spxChange)="this.handleChange($event)"
|
|
1224
|
+
(spxFocus)="this.handleFocus()"
|
|
1225
|
+
></spx-input-date>
|
|
1226
|
+
<spx-input-float
|
|
1227
|
+
*ngIf="this.spxType === 'float'"
|
|
1228
|
+
[spxAutofocus]="this.spxAutofocus"
|
|
1229
|
+
[spxFocused]="this.spxFocused"
|
|
1230
|
+
[spxName]="this.spxName"
|
|
1231
|
+
[spxReadonly]="this.spxReadonly"
|
|
1232
|
+
[spxStep]="this.spxStep"
|
|
1233
|
+
[spxValidators]="this.spxValidators"
|
|
1234
|
+
[value]="this.value"
|
|
1235
|
+
(spxChange)="this.handleChange($event)"
|
|
1236
|
+
(spxFocus)="this.handleFocus()"
|
|
1237
|
+
></spx-input-float>
|
|
1238
|
+
<spx-input-number
|
|
1239
|
+
*ngIf="this.spxType === 'number'"
|
|
1240
|
+
[spxStep]="this.spxStep"
|
|
1241
|
+
[spxAutofocus]="this.spxAutofocus"
|
|
1242
|
+
[spxFocused]="this.spxFocused"
|
|
1243
|
+
[spxInputMode]="this.spxInputMode"
|
|
1244
|
+
[spxName]="this.spxName"
|
|
1245
|
+
[spxValidators]="this.spxValidators"
|
|
1246
|
+
(spxChange)="this.handleChange($event)"
|
|
1247
|
+
(spxFocus)="this.handleFocus()"
|
|
1248
|
+
(spxReadonly)="this.spxReadonly"
|
|
1249
|
+
[value]="this.value"
|
|
1250
|
+
></spx-input-number>
|
|
1251
|
+
<spx-input-radio
|
|
1252
|
+
*ngIf="this.spxType === 'radio'"
|
|
1253
|
+
[spxFocused]="this.spxFocused"
|
|
1254
|
+
[spxName]="this.spxName"
|
|
1255
|
+
[spxSuggestions]="this.spxSuggestions"
|
|
1256
|
+
[spxValidators]="this.spxValidators"
|
|
1257
|
+
(spxChange)="this.handleChange($event)"
|
|
1258
|
+
(spxFocus)="this.handleFocus()"
|
|
1259
|
+
(spxReadonly)="this.spxReadonly"
|
|
1260
|
+
[value]="this.value"
|
|
1261
|
+
></spx-input-radio>
|
|
1262
|
+
</div>
|
|
1263
|
+
<div validation-messages>
|
|
1264
|
+
<ng-content></ng-content>
|
|
1265
|
+
</div>
|
|
1266
|
+
</spx-input-box>`,
|
|
1267
|
+
}]
|
|
1268
|
+
}], propDecorators: { spxLabel: [{
|
|
1269
|
+
type: Input
|
|
1270
|
+
}], spxMax: [{
|
|
1271
|
+
type: Input
|
|
1272
|
+
}], spxMin: [{
|
|
1273
|
+
type: Input
|
|
1274
|
+
}], spxName: [{
|
|
1275
|
+
type: Input
|
|
1276
|
+
}], spxReadonly: [{
|
|
1277
|
+
type: Input
|
|
1278
|
+
}], spxAutofocus: [{
|
|
1279
|
+
type: Input
|
|
1280
|
+
}], spxInputMode: [{
|
|
1281
|
+
type: Input
|
|
1282
|
+
}], spxPattern: [{
|
|
1283
|
+
type: Input
|
|
1284
|
+
}], spxRequired: [{
|
|
1285
|
+
type: Input
|
|
1286
|
+
}], spxSelectMonth: [{
|
|
1287
|
+
type: Input
|
|
1288
|
+
}], spxSelectDay: [{
|
|
1289
|
+
type: Input
|
|
1290
|
+
}], spxShowEdit: [{
|
|
1291
|
+
type: Input
|
|
1292
|
+
}], spxShowHelp: [{
|
|
1293
|
+
type: Input
|
|
1294
|
+
}], spxCompact: [{
|
|
1295
|
+
type: Input
|
|
1296
|
+
}], spxShowClear: [{
|
|
1297
|
+
type: Input
|
|
1298
|
+
}], spxShowSearch: [{
|
|
1299
|
+
type: Input
|
|
1300
|
+
}], spxShowValidationMessages: [{
|
|
1301
|
+
type: Input
|
|
1302
|
+
}], spxStep: [{
|
|
1303
|
+
type: Input
|
|
1304
|
+
}], spxSuggestions: [{
|
|
1305
|
+
type: Input
|
|
1306
|
+
}], spxType: [{
|
|
1307
|
+
type: Input
|
|
1308
|
+
}], spxValidators: [{
|
|
1309
|
+
type: Input
|
|
1310
|
+
}], value: [{
|
|
1311
|
+
type: Input
|
|
1312
|
+
}], spxCapitalize: [{
|
|
1313
|
+
type: Input
|
|
1314
|
+
}], spxBlur: [{
|
|
1315
|
+
type: Output
|
|
1316
|
+
}], spxClear: [{
|
|
1317
|
+
type: Output
|
|
1318
|
+
}], spxChange: [{
|
|
1319
|
+
type: Output
|
|
1320
|
+
}], spxFocus: [{
|
|
1321
|
+
type: Output
|
|
1322
|
+
}], spxEdit: [{
|
|
1323
|
+
type: Output
|
|
1324
|
+
}], spxHelp: [{
|
|
1325
|
+
type: Output
|
|
1326
|
+
}], spxSearch: [{
|
|
1327
|
+
type: Output
|
|
1328
|
+
}], spxFocused: [{
|
|
1329
|
+
type: Input
|
|
1330
|
+
}], _handleBlurEvent: [{
|
|
1331
|
+
type: HostListener,
|
|
1332
|
+
args: ['focusout']
|
|
1333
|
+
}] } });
|
|
1334
|
+
|
|
1335
|
+
/**
|
|
1336
|
+
* Generated bundle index. Do not edit.
|
|
1337
|
+
*/
|
|
1338
|
+
|
|
1339
|
+
export { SpxInputBoxComponent, SpxInputComponent, SpxInputTextComponent };
|
|
1340
|
+
//# sourceMappingURL=softpak-components-spx-inputs.mjs.map
|