💄 Enforce number inputs
This commit is contained in:
parent
89e52d0483
commit
8b8185c33f
@ -38,12 +38,13 @@
|
|||||||
</p-floatlabel>
|
</p-floatlabel>
|
||||||
|
|
||||||
<p-floatlabel variant="in">
|
<p-floatlabel variant="in">
|
||||||
<input id="duration" formControlName="duration" pInputText fluid />
|
<p-inputnumber id="duration" formControlName="duration" mode="decimal" fluid />
|
||||||
<label for="duration">Duration</label>
|
<label for="duration">Duration</label>
|
||||||
</p-floatlabel>
|
</p-floatlabel>
|
||||||
|
|
||||||
<p-floatlabel variant="in">
|
<p-floatlabel variant="in">
|
||||||
<input id="price" formControlName="price" pInputText fluid />
|
<p-inputnumber id="price" formControlName="price" mode="decimal" [minFractionDigits]="0" [maxFractionDigits]="2"
|
||||||
|
fluid />
|
||||||
<label for="price">Price</label>
|
<label for="price">Price</label>
|
||||||
</p-floatlabel>
|
</p-floatlabel>
|
||||||
|
|
||||||
|
|||||||
@ -23,12 +23,14 @@ import { Category, Place } from "../../types/poi";
|
|||||||
import { CheckboxModule } from "primeng/checkbox";
|
import { CheckboxModule } from "primeng/checkbox";
|
||||||
import { TooltipModule } from "primeng/tooltip";
|
import { TooltipModule } from "primeng/tooltip";
|
||||||
import { checkAndParseLatLng, formatLatLng } from "../../shared/latlng-parser";
|
import { checkAndParseLatLng, formatLatLng } from "../../shared/latlng-parser";
|
||||||
|
import { InputNumberModule } from "primeng/inputnumber";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "app-place-create-modal",
|
selector: "app-place-create-modal",
|
||||||
imports: [
|
imports: [
|
||||||
FloatLabelModule,
|
FloatLabelModule,
|
||||||
InputTextModule,
|
InputTextModule,
|
||||||
|
InputNumberModule,
|
||||||
ButtonModule,
|
ButtonModule,
|
||||||
SelectModule,
|
SelectModule,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
@ -90,7 +92,7 @@ export class PlaceCreateModalComponent {
|
|||||||
category: [null, Validators.required],
|
category: [null, Validators.required],
|
||||||
description: null,
|
description: null,
|
||||||
duration: [null, Validators.pattern("\\d+")],
|
duration: [null, Validators.pattern("\\d+")],
|
||||||
price: [null, Validators.pattern("[+-]?([0-9]*[.])?[0-9]+")],
|
price: null,
|
||||||
allowdog: false,
|
allowdog: false,
|
||||||
visited: false,
|
visited: false,
|
||||||
image: null,
|
image: null,
|
||||||
|
|||||||
@ -50,7 +50,8 @@
|
|||||||
</p-floatlabel>
|
</p-floatlabel>
|
||||||
|
|
||||||
<p-floatlabel variant="in">
|
<p-floatlabel variant="in">
|
||||||
<input id="price" formControlName="price" pInputText fluid />
|
<p-inputnumber id="price" formControlName="price" mode="decimal" [minFractionDigits]="0" [maxFractionDigits]="2"
|
||||||
|
fluid />
|
||||||
<label for="price">Price</label>
|
<label for="price">Price</label>
|
||||||
</p-floatlabel>
|
</p-floatlabel>
|
||||||
|
|
||||||
|
|||||||
@ -17,12 +17,14 @@ import { InputMaskModule } from "primeng/inputmask";
|
|||||||
import { UtilsService } from "../../services/utils.service";
|
import { UtilsService } from "../../services/utils.service";
|
||||||
import { checkAndParseLatLng, formatLatLng } from "../../shared/latlng-parser";
|
import { checkAndParseLatLng, formatLatLng } from "../../shared/latlng-parser";
|
||||||
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
||||||
|
import { InputNumberModule } from "primeng/inputnumber";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "app-trip-create-day-item-modal",
|
selector: "app-trip-create-day-item-modal",
|
||||||
imports: [
|
imports: [
|
||||||
FloatLabelModule,
|
FloatLabelModule,
|
||||||
InputTextModule,
|
InputTextModule,
|
||||||
|
InputNumberModule,
|
||||||
ButtonModule,
|
ButtonModule,
|
||||||
SelectModule,
|
SelectModule,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
@ -67,7 +69,7 @@ export class TripCreateDayItemModalComponent {
|
|||||||
day_id: [null, Validators.required],
|
day_id: [null, Validators.required],
|
||||||
place: null,
|
place: null,
|
||||||
status: null,
|
status: null,
|
||||||
price: [null, Validators.pattern("[+-]?([0-9]*[.])?[0-9]+")],
|
price: null,
|
||||||
lat: [
|
lat: [
|
||||||
"",
|
"",
|
||||||
{
|
{
|
||||||
|
|||||||
@ -35,7 +35,6 @@ export class TripCreateDayModalComponent {
|
|||||||
this.dayForm = this.fb.group({
|
this.dayForm = this.fb.group({
|
||||||
id: -1,
|
id: -1,
|
||||||
label: ["", Validators.required],
|
label: ["", Validators.required],
|
||||||
order: 0,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.config.data) {
|
if (this.config.data) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user