@tft/crispr-forms 21.0.2 → 21.0.4
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/fesm2022/tft-crispr-forms-autocomplete-field.component-CpEWI7bT.mjs +95 -0
- package/fesm2022/tft-crispr-forms-autocomplete-field.component-CpEWI7bT.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-BICpK-GR.mjs +2 -0
- package/fesm2022/tft-crispr-forms-index-BICpK-GR.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-CG3cLos3.mjs +88 -0
- package/fesm2022/tft-crispr-forms-index-CG3cLos3.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-CLJ89Dev.mjs +73 -0
- package/fesm2022/tft-crispr-forms-index-CLJ89Dev.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-CvTUJeC6.mjs +39 -0
- package/fesm2022/tft-crispr-forms-index-CvTUJeC6.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-D6cKptyg.mjs +36 -0
- package/fesm2022/tft-crispr-forms-index-D6cKptyg.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-DAx6Am4i.mjs +40 -0
- package/fesm2022/tft-crispr-forms-index-DAx6Am4i.mjs.map +1 -0
- package/fesm2022/{tft-crispr-forms-index-BQFuEW6x.mjs → tft-crispr-forms-index-DEu5NqmR.mjs} +3 -3
- package/fesm2022/tft-crispr-forms-index-DEu5NqmR.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-DOpDpDdt.mjs +179 -0
- package/fesm2022/tft-crispr-forms-index-DOpDpDdt.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-DW1QGkrv.mjs +137 -0
- package/fesm2022/tft-crispr-forms-index-DW1QGkrv.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-DuvnSHLl.mjs +39 -0
- package/fesm2022/tft-crispr-forms-index-DuvnSHLl.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-DvrD-Lli.mjs +190 -0
- package/fesm2022/tft-crispr-forms-index-DvrD-Lli.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms-index-usD7jUs3.mjs +68 -0
- package/fesm2022/tft-crispr-forms-index-usD7jUs3.mjs.map +1 -0
- package/fesm2022/tft-crispr-forms.mjs +60 -53
- package/fesm2022/tft-crispr-forms.mjs.map +1 -1
- package/package.json +1 -1
- package/types/tft-crispr-forms.d.ts +14 -14
- package/fesm2022/tft-crispr-forms-autocomplete-field.component-ChocHy3F.mjs +0 -95
- package/fesm2022/tft-crispr-forms-autocomplete-field.component-ChocHy3F.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-BQFuEW6x.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-BZ9V1Ec-.mjs +0 -39
- package/fesm2022/tft-crispr-forms-index-BZ9V1Ec-.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-BkCdLt5V.mjs +0 -40
- package/fesm2022/tft-crispr-forms-index-BkCdLt5V.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-Bypm5YtY.mjs +0 -137
- package/fesm2022/tft-crispr-forms-index-Bypm5YtY.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-C9gYJRzb.mjs +0 -182
- package/fesm2022/tft-crispr-forms-index-C9gYJRzb.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-CFwkbxFk.mjs +0 -88
- package/fesm2022/tft-crispr-forms-index-CFwkbxFk.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-DEctfeGr.mjs +0 -2
- package/fesm2022/tft-crispr-forms-index-DEctfeGr.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-DcrZSpdk.mjs +0 -73
- package/fesm2022/tft-crispr-forms-index-DcrZSpdk.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-DmaDlaNf.mjs +0 -68
- package/fesm2022/tft-crispr-forms-index-DmaDlaNf.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-Hsgr_WHO.mjs +0 -190
- package/fesm2022/tft-crispr-forms-index-Hsgr_WHO.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-gORcx6V1.mjs +0 -36
- package/fesm2022/tft-crispr-forms-index-gORcx6V1.mjs.map +0 -1
- package/fesm2022/tft-crispr-forms-index-lrhnilye.mjs +0 -39
- package/fesm2022/tft-crispr-forms-index-lrhnilye.mjs.map +0 -1
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, Renderer2, viewChild, signal, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { CrisprControlComponent, ControlType, FieldContainerComponent } from './tft-crispr-forms.mjs';
|
|
4
|
+
import { MapGeocoder, MapInfoWindow, GoogleMap, MapMarker } from '@angular/google-maps';
|
|
5
|
+
import * as i1 from '@angular/forms';
|
|
6
|
+
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
|
7
|
+
import { filter, switchMap, map, startWith, merge, BehaviorSubject, of, debounceTime } from 'rxjs';
|
|
8
|
+
import { AsyncPipe } from '@angular/common';
|
|
9
|
+
import { toSignal, toObservable } from '@angular/core/rxjs-interop';
|
|
10
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
11
|
+
import { A as AutocompleteFieldComponent } from './tft-crispr-forms-autocomplete-field.component-CpEWI7bT.mjs';
|
|
12
|
+
import * as i2 from '@angular/cdk/overlay';
|
|
13
|
+
import { OverlayModule } from '@angular/cdk/overlay';
|
|
14
|
+
import { MatFormField, MatLabel } from '@angular/material/form-field';
|
|
15
|
+
import { MatButton } from '@angular/material/button';
|
|
16
|
+
import { MatInput } from '@angular/material/input';
|
|
17
|
+
|
|
18
|
+
const defaultConfig = {
|
|
19
|
+
debounceTime: 500,
|
|
20
|
+
};
|
|
21
|
+
class MapFieldComponent extends CrisprControlComponent {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
/**
|
|
25
|
+
* The overlay is positioned to align the top-right corner with the origin's bottom-right corner,
|
|
26
|
+
* and the top-left corner with the origin's bottom-left corner.
|
|
27
|
+
*/
|
|
28
|
+
this.overlayPositions = [
|
|
29
|
+
{
|
|
30
|
+
originX: 'start',
|
|
31
|
+
originY: 'bottom',
|
|
32
|
+
overlayX: 'start',
|
|
33
|
+
overlayY: 'top',
|
|
34
|
+
offsetY: -26
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
originX: 'end',
|
|
38
|
+
originY: 'bottom',
|
|
39
|
+
overlayX: 'end',
|
|
40
|
+
overlayY: 'top',
|
|
41
|
+
}
|
|
42
|
+
];
|
|
43
|
+
this.geoCoder = inject(MapGeocoder);
|
|
44
|
+
this.renderer = inject(Renderer2);
|
|
45
|
+
this.domSanitizer = inject(DomSanitizer);
|
|
46
|
+
this.infoWindow = viewChild(MapInfoWindow, ...(ngDevMode ? [{ debugName: "infoWindow" }] : []));
|
|
47
|
+
this.selectedMarker = signal(null, ...(ngDevMode ? [{ debugName: "selectedMarker" }] : []));
|
|
48
|
+
this.mapOpen = signal(false, ...(ngDevMode ? [{ debugName: "mapOpen" }] : []));
|
|
49
|
+
this.mapComponent = viewChild(GoogleMap, ...(ngDevMode ? [{ debugName: "mapComponent" }] : []));
|
|
50
|
+
this.defaultConfig = defaultConfig;
|
|
51
|
+
this.locationControl = new FormControl(this.config()?.location);
|
|
52
|
+
this.locationGroup = new FormGroup({
|
|
53
|
+
location: this.locationControl,
|
|
54
|
+
});
|
|
55
|
+
this.locationConfig = {
|
|
56
|
+
controlType: ControlType.AUTOCOMPLETE,
|
|
57
|
+
controlName: 'location',
|
|
58
|
+
label: 'Location',
|
|
59
|
+
placeholder: 'Enter a location',
|
|
60
|
+
options: async (group, searchTerm) => {
|
|
61
|
+
// Add an initial request body.
|
|
62
|
+
if (searchTerm) {
|
|
63
|
+
return new Promise((resolve) => {
|
|
64
|
+
const request = {
|
|
65
|
+
input: searchTerm,
|
|
66
|
+
// locationRestriction: { west: -122.44, north: 37.8, east: -122.39, south: 37.78 },
|
|
67
|
+
// origin: { lat: 37.7893, lng: -122.4039 },
|
|
68
|
+
includedPrimaryTypes: [
|
|
69
|
+
'postal_code',
|
|
70
|
+
'administrative_area_level_2',
|
|
71
|
+
'administrative_area_level_3',
|
|
72
|
+
// 'locality',
|
|
73
|
+
// 'sublocality',
|
|
74
|
+
],
|
|
75
|
+
language: "en-US",
|
|
76
|
+
region: "us",
|
|
77
|
+
// sessionToken: token,
|
|
78
|
+
};
|
|
79
|
+
const options = google.maps.places.AutocompleteSuggestion.fetchAutocompleteSuggestions(request)
|
|
80
|
+
.then((response) => response.suggestions.map(suggestion => {
|
|
81
|
+
const option = {
|
|
82
|
+
value: suggestion,
|
|
83
|
+
label: suggestion.placePrediction.text.text
|
|
84
|
+
};
|
|
85
|
+
return option;
|
|
86
|
+
}));
|
|
87
|
+
resolve(options);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
return [];
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
this.inputCenter = this.locationControl.valueChanges.pipe(filter(value => !!value && typeof value !== 'string'), switchMap((value) => {
|
|
94
|
+
const request = {
|
|
95
|
+
address: value.placePrediction.text.text,
|
|
96
|
+
};
|
|
97
|
+
return this.geoCoder.geocode(request);
|
|
98
|
+
}), map((res) => {
|
|
99
|
+
const { geometry } = res.results?.[0] || {};
|
|
100
|
+
const { location } = geometry || {};
|
|
101
|
+
const center = location?.toJSON();
|
|
102
|
+
return center;
|
|
103
|
+
}), startWith(this.config()?.center || undefined));
|
|
104
|
+
this.center = merge;
|
|
105
|
+
this.currentMap = new BehaviorSubject(null);
|
|
106
|
+
this.displayValue = toSignal(toObservable(this.control).pipe(switchMap(control => control
|
|
107
|
+
? control.valueChanges.pipe(startWith(control.value))
|
|
108
|
+
: of('')), map(value => this.getDisplay(value))));
|
|
109
|
+
this.currentMarkers = toSignal(this.currentMap.pipe(debounceTime(500), switchMap((map) => {
|
|
110
|
+
return this.config()?.markers?.(map, this.group()) || of([]);
|
|
111
|
+
})));
|
|
112
|
+
}
|
|
113
|
+
onMapInit(event) {
|
|
114
|
+
this.currentMap.next(event);
|
|
115
|
+
}
|
|
116
|
+
ngOnInit() {
|
|
117
|
+
super.ngOnInit();
|
|
118
|
+
}
|
|
119
|
+
onMarkerClick(clickedMarker) {
|
|
120
|
+
const clickedPosition = clickedMarker.getPosition();
|
|
121
|
+
if (!clickedPosition)
|
|
122
|
+
return;
|
|
123
|
+
// A simple title match is less prone to float precision issues than position
|
|
124
|
+
const originalMarker = this.currentMarkers().find(m => m.title === clickedMarker.getTitle());
|
|
125
|
+
if (originalMarker) {
|
|
126
|
+
this.selectedMarker.set(originalMarker);
|
|
127
|
+
this.infoWindow().open(clickedMarker);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
selectMarker(marker) {
|
|
131
|
+
const valueToSet = marker.value || marker.title;
|
|
132
|
+
this.control().setValue(valueToSet);
|
|
133
|
+
this.closeMap();
|
|
134
|
+
this.infoWindow()?.close();
|
|
135
|
+
}
|
|
136
|
+
onBoundsChanged(bounds) {
|
|
137
|
+
console.log({ bounds });
|
|
138
|
+
}
|
|
139
|
+
onMove(map, group) {
|
|
140
|
+
this.config()?.onMove?.(map, group);
|
|
141
|
+
this.currentMap.next(map);
|
|
142
|
+
}
|
|
143
|
+
async onSelectLocation(suggestion) {
|
|
144
|
+
if (!google.maps.places || !suggestion.place_id)
|
|
145
|
+
return;
|
|
146
|
+
const place = new google.maps.places.Place({ id: suggestion.place_id });
|
|
147
|
+
const location = await place.fetchFields({ fields: ['location'] });
|
|
148
|
+
console.log({ suggestion, location });
|
|
149
|
+
}
|
|
150
|
+
openMap() {
|
|
151
|
+
this.mapOpen.set(true);
|
|
152
|
+
}
|
|
153
|
+
closeMap() {
|
|
154
|
+
this.mapOpen.set(false);
|
|
155
|
+
}
|
|
156
|
+
getDisplay(value) {
|
|
157
|
+
if (typeof value !== 'object' || value === null) {
|
|
158
|
+
return value;
|
|
159
|
+
}
|
|
160
|
+
const displayKey = this.config()?.valueDisplayKey;
|
|
161
|
+
console.log({ value, displayKey, displayValue: value[displayKey] });
|
|
162
|
+
if (displayKey && value[displayKey]) {
|
|
163
|
+
return value[displayKey];
|
|
164
|
+
}
|
|
165
|
+
// Attempt to find a sensible display property
|
|
166
|
+
return value.name || value.title || 'Selected Location';
|
|
167
|
+
}
|
|
168
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: MapFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
169
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.6", type: MapFieldComponent, isStandalone: true, selector: "crispr-map", viewQueries: [{ propertyName: "infoWindow", first: true, predicate: MapInfoWindow, descendants: true, isSignal: true }, { propertyName: "mapComponent", first: true, predicate: GoogleMap, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<crispr-field-container [config]=\"config()\" [group]=\"group()\">\n\n <mat-form-field [attr.data-testid]=\"testId()\" [color]=\"config().color\" [appearance]=\"config().appearance\" [formGroup]=\"group()\"\n #trigger=\"cdkOverlayOrigin\" (click)=\"openMap()\" cdkOverlayOrigin>\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n <input matInput [formControlName]=\"config().controlName\" style=\"display:none\">\n <input matInput readonly [value]=\"displayValue() || ''\" [placeholder]=\"config().placeholder\">\n </mat-form-field>\n\n <ng-template cdkConnectedOverlay (overlayOutsideClick)=\"closeMap()\" [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"mapOpen()\" [cdkConnectedOverlayPositions]=\"overlayPositions\"\n [cdkConnectedOverlayWidth]=\"trigger.elementRef.nativeElement.offsetWidth\"\n [cdkConnectedOverlayMinWidth]=\"trigger.elementRef.nativeElement.offsetWidth\" (detach)=\"closeMap()\"\n (backdropClick)=\"closeMap()\">\n <crispr-autocomplete-field class=\"search-field\" [config]=\"locationConfig\" [group]=\"locationGroup\"\n (valueChanges)=\"onSelectLocation($event)\" aria-label=\"Search for a location\">\n </crispr-autocomplete-field>\n <google-map [center]=\"(inputCenter | async) || config().center\" [zoom]=\"11\" [options]=\"config().options\"\n (mapInitialized)=\"onMapInit($event)\" (idle)=\"onMove(map, group())\" #map>\n\n @for (marker of currentMarkers() || []; track $index) {\n <map-marker #markerRef=\"mapMarker\" [position]=\"marker.position\" [title]=\"marker.title\"\n (mapClick)=\"onMarkerClick(markerRef)\">\n </map-marker>\n\n }\n <map-info-window>\n @if(selectedMarker(); as marker) {\n <div class=\"info-window-content\">\n <p>{{ marker.title }}</p>\n <button mat-button (click)=\"selectMarker(marker)\">Select</button>\n </div>\n }\n </map-info-window>\n\n </google-map>\n </ng-template>\n</crispr-field-container>", styles: [":host .marker{background-color:#0ff}.search-field{position:absolute;top:.4rem;left:.4rem;z-index:1000}\n"], dependencies: [{ kind: "component", type: GoogleMap, selector: "google-map", inputs: ["height", "width", "mapId", "mapTypeId", "center", "zoom", "options"], outputs: ["mapInitialized", "authFailure", "boundsChanged", "centerChanged", "mapClick", "mapDblclick", "mapDrag", "mapDragend", "mapDragstart", "headingChanged", "idle", "maptypeidChanged", "mapMousemove", "mapMouseout", "mapMouseover", "projectionChanged", "mapRightclick", "tilesloaded", "tiltChanged", "zoomChanged"], exportAs: ["googleMap"] }, { kind: "directive", type: MapInfoWindow, selector: "map-info-window", inputs: ["options", "position"], outputs: ["closeclick", "contentChanged", "domready", "positionChanged", "zindexChanged", "infoWindowInitialized"], exportAs: ["mapInfoWindow"] }, { kind: "directive", type: MapMarker, selector: "map-marker", inputs: ["title", "position", "label", "clickable", "options", "icon", "visible"], outputs: ["animationChanged", "mapClick", "clickableChanged", "cursorChanged", "mapDblclick", "mapDrag", "mapDragend", "draggableChanged", "mapDragstart", "flatChanged", "iconChanged", "mapMousedown", "mapMouseout", "mapMouseover", "mapMouseup", "positionChanged", "mapRightclick", "shapeChanged", "titleChanged", "visibleChanged", "zindexChanged", "markerInitialized"], exportAs: ["mapMarker"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "component", type: AutocompleteFieldComponent, selector: "crispr-autocomplete-field" }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i2.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation", "cdkConnectedOverlayUsePopover", "cdkConnectedOverlayMatchWidth", "cdkConnectedOverlay"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i2.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true }); }
|
|
170
|
+
}
|
|
171
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: MapFieldComponent, decorators: [{
|
|
172
|
+
type: Component,
|
|
173
|
+
args: [{ selector: 'crispr-map', imports: [
|
|
174
|
+
GoogleMap,
|
|
175
|
+
MapInfoWindow,
|
|
176
|
+
MapMarker,
|
|
177
|
+
ReactiveFormsModule,
|
|
178
|
+
MatFormField,
|
|
179
|
+
MatInput,
|
|
180
|
+
MatLabel,
|
|
181
|
+
AsyncPipe,
|
|
182
|
+
AutocompleteFieldComponent,
|
|
183
|
+
FieldContainerComponent,
|
|
184
|
+
MatButton,
|
|
185
|
+
OverlayModule
|
|
186
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<crispr-field-container [config]=\"config()\" [group]=\"group()\">\n\n <mat-form-field [attr.data-testid]=\"testId()\" [color]=\"config().color\" [appearance]=\"config().appearance\" [formGroup]=\"group()\"\n #trigger=\"cdkOverlayOrigin\" (click)=\"openMap()\" cdkOverlayOrigin>\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n <input matInput [formControlName]=\"config().controlName\" style=\"display:none\">\n <input matInput readonly [value]=\"displayValue() || ''\" [placeholder]=\"config().placeholder\">\n </mat-form-field>\n\n <ng-template cdkConnectedOverlay (overlayOutsideClick)=\"closeMap()\" [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"mapOpen()\" [cdkConnectedOverlayPositions]=\"overlayPositions\"\n [cdkConnectedOverlayWidth]=\"trigger.elementRef.nativeElement.offsetWidth\"\n [cdkConnectedOverlayMinWidth]=\"trigger.elementRef.nativeElement.offsetWidth\" (detach)=\"closeMap()\"\n (backdropClick)=\"closeMap()\">\n <crispr-autocomplete-field class=\"search-field\" [config]=\"locationConfig\" [group]=\"locationGroup\"\n (valueChanges)=\"onSelectLocation($event)\" aria-label=\"Search for a location\">\n </crispr-autocomplete-field>\n <google-map [center]=\"(inputCenter | async) || config().center\" [zoom]=\"11\" [options]=\"config().options\"\n (mapInitialized)=\"onMapInit($event)\" (idle)=\"onMove(map, group())\" #map>\n\n @for (marker of currentMarkers() || []; track $index) {\n <map-marker #markerRef=\"mapMarker\" [position]=\"marker.position\" [title]=\"marker.title\"\n (mapClick)=\"onMarkerClick(markerRef)\">\n </map-marker>\n\n }\n <map-info-window>\n @if(selectedMarker(); as marker) {\n <div class=\"info-window-content\">\n <p>{{ marker.title }}</p>\n <button mat-button (click)=\"selectMarker(marker)\">Select</button>\n </div>\n }\n </map-info-window>\n\n </google-map>\n </ng-template>\n</crispr-field-container>", styles: [":host .marker{background-color:#0ff}.search-field{position:absolute;top:.4rem;left:.4rem;z-index:1000}\n"] }]
|
|
187
|
+
}], propDecorators: { infoWindow: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MapInfoWindow), { isSignal: true }] }], mapComponent: [{ type: i0.ViewChild, args: [i0.forwardRef(() => GoogleMap), { isSignal: true }] }] } });
|
|
188
|
+
|
|
189
|
+
export { MapFieldComponent };
|
|
190
|
+
//# sourceMappingURL=tft-crispr-forms-index-DvrD-Lli.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tft-crispr-forms-index-DvrD-Lli.mjs","sources":["../../../../libs/crispr-forms/src/lib/ui/map/map-field.component.ts","../../../../libs/crispr-forms/src/lib/ui/map/map-field.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, OnInit, Renderer2, computed, inject, signal, viewChild } from '@angular/core';\nimport { AutocompleteFieldConfig, ControlType, MapFieldConfig, TftMapMarker } from '../../utils';\nimport { GoogleMap, MapInfoWindow, MapMarker, MapGeocoder, } from '@angular/google-maps';\nimport { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';\nimport { BehaviorSubject, debounceTime, filter, map, merge, of, startWith, switchMap } from 'rxjs';\nimport { AsyncPipe, } from '@angular/common';\nimport { toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { CrisprControlComponent } from '../../utils/abstracts/crispr-control.abstract';\nimport { AutocompleteFieldComponent } from \"../autocomplete-field/autocomplete-field.component\";\nimport { ConnectionPositionPair, OverlayModule } from '@angular/cdk/overlay';\nimport { MatFormField, MatLabel } from '@angular/material/form-field';\nimport { FieldContainerComponent } from '../field-container';\nimport { MatButton } from '@angular/material/button';\nimport { MatInput } from '@angular/material/input';\n\nconst defaultConfig: Partial<MapFieldConfig> = {\n debounceTime: 500,\n};\n\n@Component({\n selector: 'crispr-map',\n imports: [\n GoogleMap,\n MapInfoWindow,\n MapMarker,\n ReactiveFormsModule,\n MatFormField,\n MatInput,\n MatLabel,\n AsyncPipe,\n AutocompleteFieldComponent,\n FieldContainerComponent,\n MatButton,\n OverlayModule\n ],\n templateUrl: './map-field.component.html',\n styleUrl: './map-field.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class MapFieldComponent\n extends CrisprControlComponent<MapFieldConfig>\n implements OnInit\n{\n\n /**\n * The overlay is positioned to align the top-right corner with the origin's bottom-right corner,\n * and the top-left corner with the origin's bottom-left corner.\n */\n overlayPositions: ConnectionPositionPair[] = [\n {\n originX: 'start',\n originY: 'bottom',\n overlayX: 'start',\n overlayY: 'top',\n offsetY: -26\n },\n {\n originX: 'end',\n originY: 'bottom',\n overlayX: 'end',\n overlayY: 'top',\n }\n ];\n geoCoder = inject(MapGeocoder);\n renderer = inject(Renderer2);\n domSanitizer = inject(DomSanitizer);\n \n infoWindow = viewChild(MapInfoWindow);\n selectedMarker = signal<TftMapMarker | null>(null);\n\n mapOpen = signal(false);\n mapComponent = viewChild(GoogleMap);\n defaultConfig = defaultConfig;\n\n locationControl = new FormControl(this.config()?.location);\n locationGroup = new FormGroup({\n location: this.locationControl,\n });\n \n\n locationConfig: AutocompleteFieldConfig = { \n controlType: ControlType.AUTOCOMPLETE,\n controlName: 'location',\n label: 'Location',\n placeholder: 'Enter a location',\n options: async (group, searchTerm) => {\n // Add an initial request body.\n if (searchTerm) {\n return new Promise((resolve) => {\n const request: google.maps.places.AutocompleteRequest = {\n input: searchTerm,\n // locationRestriction: { west: -122.44, north: 37.8, east: -122.39, south: 37.78 },\n // origin: { lat: 37.7893, lng: -122.4039 },\n includedPrimaryTypes: [\n 'postal_code', \n 'administrative_area_level_2', \n 'administrative_area_level_3',\n // 'locality',\n // 'sublocality',\n ],\n language: \"en-US\",\n region: \"us\",\n // sessionToken: token,\n };\n const options = google.maps.places.AutocompleteSuggestion.fetchAutocompleteSuggestions(request)\n .then((response) => response.suggestions.map(suggestion => {\n const option = {\n value: suggestion,\n label: suggestion.placePrediction.text.text\n }\n return option;\n }))\n resolve(options)\n })\n }\n return []\n }\n }\n\n inputCenter = this.locationControl.valueChanges.pipe(\n filter(value => !!value && typeof value !== 'string'),\n switchMap((value: google.maps.places.AutocompleteSuggestion) => {\n\n const request: google.maps.GeocoderRequest = {\n address: value.placePrediction.text.text,\n };\n return this.geoCoder.geocode(request);\n }),\n map((res) => {\n const { geometry } = res.results?.[0] || {};\n const { location }= geometry || {};\n const center = location?.toJSON();\n return center;\n }),\n startWith(this.config()?.center || undefined)\n )\n\n center = merge\n\n currentMap = new BehaviorSubject<GoogleMap | null>(null);\n\n displayValue = toSignal(\n toObservable(this.control).pipe(\n switchMap(control => control\n ? control.valueChanges.pipe(startWith(control.value))\n : of('')\n ),\n map(value => this.getDisplay(value))\n )\n ) \n \n currentMarkers = toSignal<TftMapMarker[]>(\n this.currentMap.pipe( \n debounceTime(500),\n switchMap((map) => {\n return this.config()?.markers?.(map, this.group()) || of([]);\n })\n )\n );\n\n\n onMapInit(event: GoogleMap) {\n this.currentMap.next(event);\n }\n ngOnInit() {\n super.ngOnInit();\n }\n\n onMarkerClick(clickedMarker: MapMarker) {\n const clickedPosition = clickedMarker.getPosition();\n if (!clickedPosition) return;\n // A simple title match is less prone to float precision issues than position\n const originalMarker = this.currentMarkers().find(m => m.title === clickedMarker.getTitle());\n\n if (originalMarker) {\n this.selectedMarker.set(originalMarker);\n this.infoWindow().open(clickedMarker);\n } \n }\n\n selectMarker(marker: TftMapMarker) {\n const valueToSet = marker.value || marker.title;\n this.control().setValue(valueToSet);\n this.closeMap();\n this.infoWindow()?.close();\n }\n\n onBoundsChanged(bounds: google.maps.LatLngBounds) {\n console.log({bounds});\n }\n\n onMove(map: GoogleMap, group: FormGroup) {\n this.config()?.onMove?.(map, group);\n this.currentMap.next(map);\n }\n\n async onSelectLocation(suggestion: google.maps.places.AutocompletePrediction) { \n if(!google.maps.places || !suggestion.place_id) return;\n const place = new google.maps.places.Place({id: suggestion.place_id })\n const location = await place.fetchFields({fields: ['location']});\n \n console.log({suggestion, location});\n }\n\n openMap() {\n this.mapOpen.set(true);\n }\n\n closeMap() {\n this.mapOpen.set(false);\n }\n\n getDisplay(value: any): string {\n if (typeof value !== 'object' || value === null) {\n return value;\n }\n const displayKey = this.config()?.valueDisplayKey;\n console.log({value, displayKey, displayValue: value[displayKey]})\n if (displayKey && value[displayKey]) {\n return value[displayKey];\n }\n // Attempt to find a sensible display property\n return value.name || value.title || 'Selected Location';\n }\n}\n\n\ninterface Station {\n location: {\n lat: number;\n lng: number;\n };\n selectedProbability: number;\n selectedFrostTemperature: number;\n averageLastFrostDate: string;\n averageFirstFrostDate: string;\n averageAnnualRainfall: number;\n\n hardinessZone: number;\n}\n","<crispr-field-container [config]=\"config()\" [group]=\"group()\">\n\n <mat-form-field [attr.data-testid]=\"testId()\" [color]=\"config().color\" [appearance]=\"config().appearance\" [formGroup]=\"group()\"\n #trigger=\"cdkOverlayOrigin\" (click)=\"openMap()\" cdkOverlayOrigin>\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n <input matInput [formControlName]=\"config().controlName\" style=\"display:none\">\n <input matInput readonly [value]=\"displayValue() || ''\" [placeholder]=\"config().placeholder\">\n </mat-form-field>\n\n <ng-template cdkConnectedOverlay (overlayOutsideClick)=\"closeMap()\" [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"mapOpen()\" [cdkConnectedOverlayPositions]=\"overlayPositions\"\n [cdkConnectedOverlayWidth]=\"trigger.elementRef.nativeElement.offsetWidth\"\n [cdkConnectedOverlayMinWidth]=\"trigger.elementRef.nativeElement.offsetWidth\" (detach)=\"closeMap()\"\n (backdropClick)=\"closeMap()\">\n <crispr-autocomplete-field class=\"search-field\" [config]=\"locationConfig\" [group]=\"locationGroup\"\n (valueChanges)=\"onSelectLocation($event)\" aria-label=\"Search for a location\">\n </crispr-autocomplete-field>\n <google-map [center]=\"(inputCenter | async) || config().center\" [zoom]=\"11\" [options]=\"config().options\"\n (mapInitialized)=\"onMapInit($event)\" (idle)=\"onMove(map, group())\" #map>\n\n @for (marker of currentMarkers() || []; track $index) {\n <map-marker #markerRef=\"mapMarker\" [position]=\"marker.position\" [title]=\"marker.title\"\n (mapClick)=\"onMarkerClick(markerRef)\">\n </map-marker>\n\n }\n <map-info-window>\n @if(selectedMarker(); as marker) {\n <div class=\"info-window-content\">\n <p>{{ marker.title }}</p>\n <button mat-button (click)=\"selectMarker(marker)\">Select</button>\n </div>\n }\n </map-info-window>\n\n </google-map>\n </ng-template>\n</crispr-field-container>"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAgBA,MAAM,aAAa,GAA4B;AAC7C,IAAA,YAAY,EAAE,GAAG;CAClB;AAuBK,MAAO,iBACX,SAAQ,sBAAsC,CAAA;AAtBhD,IAAA,WAAA,GAAA;;AA0BI;;;AAGC;AACH,QAAA,IAAA,CAAA,gBAAgB,GAA6B;AAC3C,YAAA;AACE,gBAAA,OAAO,EAAE,OAAO;AAChB,gBAAA,OAAO,EAAE,QAAQ;AACjB,gBAAA,QAAQ,EAAE,OAAO;AACjB,gBAAA,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE,CAAC;AACX,aAAA;AACD,YAAA;AACE,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE,QAAQ;AACjB,gBAAA,QAAQ,EAAE,KAAK;AACf,gBAAA,QAAQ,EAAE,KAAK;AAChB;SACF;AACD,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,WAAW,CAAC;AAC9B,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC;AAC5B,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;AAEnC,QAAA,IAAA,CAAA,UAAU,GAAG,SAAS,CAAC,aAAa,sDAAC;AACrC,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAsB,IAAI,0DAAC;AAElD,QAAA,IAAA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CAAA,QAAA,EAAA,OAAA,EAAA,aAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACvB,SAAS,EAAA,QAAA,EAAA,iOAAA,EAAA,MAAA,EAAA,CAAA,WAAA,CAAA,EAAA,QAAA,EAAA,CAAA,WAAA,EAAA,WAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACT,aAAa,+wCAJb,SAAS,EAAA,IAAA,EAAA,OAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,mBAAA,EAAA,IAAA,EAAA,CAAA,CAAA;;2FAWJ,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBArB7B,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,YAAY,EAAA,OAAA,EACb;wBACL,SAAS;wBACT,aAAa;wBACb,SAAS;wBACT,mBAAmB;wBACnB,YAAY;wBACZ,QAAQ;wBACR,QAAQ;wBACR,SAAS;wBACT,0BAA0B;wBAC1B,uBAAuB;wBACvB,SAAS;wBACT;AACH,qBAAA,EAAA,eAAA,EAGgB,uBAAuB,CAAC,MAAM,EAAA,UAAA,EACnC,IAAI,EAAA,QAAA,EAAA,g/DAAA,EAAA,MAAA,EAAA,CAAA,0GAAA,CAAA,EAAA;AA8BK,SAAA,CAAA,EAAA,cAAA,EAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAAA,aAAa,2FAIX,SAAS,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;;;"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/material/datepicker';
|
|
4
|
+
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
5
|
+
import { MatDateFnsModule } from '@angular/material-date-fns-adapter';
|
|
6
|
+
import { of } from 'rxjs';
|
|
7
|
+
import * as i5 from '@angular/cdk/portal';
|
|
8
|
+
import { ComponentPortal, PortalModule } from '@angular/cdk/portal';
|
|
9
|
+
import * as i2 from '@angular/material/form-field';
|
|
10
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
11
|
+
import * as i1$2 from '@angular/common';
|
|
12
|
+
import { CommonModule } from '@angular/common';
|
|
13
|
+
import * as i1$1 from '@angular/forms';
|
|
14
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
15
|
+
import * as i3 from '@angular/material/input';
|
|
16
|
+
import { MatInputModule } from '@angular/material/input';
|
|
17
|
+
import * as i6 from '@tft/form-validation-handler';
|
|
18
|
+
import { FormValidationHandlerModule } from '@tft/form-validation-handler';
|
|
19
|
+
import { CrisprControlComponent, FieldContainerComponent } from './tft-crispr-forms.mjs';
|
|
20
|
+
|
|
21
|
+
/* eslint-disable @nx/enforce-module-boundaries */
|
|
22
|
+
const defaultConfig = {
|
|
23
|
+
startView: 'month',
|
|
24
|
+
};
|
|
25
|
+
class DatepickerFieldComponent extends CrisprControlComponent {
|
|
26
|
+
constructor() {
|
|
27
|
+
super(...arguments);
|
|
28
|
+
this.defaultConfig = defaultConfig;
|
|
29
|
+
}
|
|
30
|
+
ngOnInit() {
|
|
31
|
+
super.ngOnInit();
|
|
32
|
+
const config = this.config();
|
|
33
|
+
this.startAt$ =
|
|
34
|
+
config.startAt instanceof Date
|
|
35
|
+
? of(config.startAt)
|
|
36
|
+
: config.startAt instanceof Function
|
|
37
|
+
? config.startAt(this.group())
|
|
38
|
+
: of(null);
|
|
39
|
+
this.dateClass = config?.cellClassFunction || null;
|
|
40
|
+
this.dateClass$ = config.dateClass
|
|
41
|
+
? config?.dateClass(this.group())
|
|
42
|
+
: of(() => '');
|
|
43
|
+
}
|
|
44
|
+
ngAfterContentInit() {
|
|
45
|
+
if (this.config().datepickerActions) {
|
|
46
|
+
this.calendarFooterPortal = new ComponentPortal(this.config().datepickerActions);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: DatepickerFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
50
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.6", type: DatepickerFieldComponent, isStandalone: true, selector: "crispr-datepicker-field", usesInheritance: true, ngImport: i0, template: "<crispr-field-container\n [config]=\"config()\"\n [group]=\"group()\">\n <mat-form-field\n [attr.data-testid]=\"testId()\"\n [color]=\"config().color\"\n [appearance]=\"config().appearance\"\n [formGroup]=\"group()\">\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n <input\n matInput\n [formControlName]=\"config().controlName\"\n [min]=\"config().min\"\n [max]=\"config().max\"\n [matDatepicker]=\"picker\"\n [matDatepickerFilter]=\"config().datepickerFilter\">\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker\n [touchUi]=\"config().touchUi\"\n [startView]=\"config().startView\"\n [startAt]=\"startAt$ | async\"\n [dateClass]=\"dateClass || (dateClass$ | async)\"\n #picker>\n @if (calendarFooterPortal) {\n <mat-datepicker-actions>\n <ng-template [cdkPortalOutlet]=\"calendarFooterPortal\"></ng-template>\n </mat-datepicker-actions>\n }\n </mat-datepicker>\n\n @if (config().hint && (control().valid || !control().touched)) {<mat-hint>{{config().hint}}</mat-hint>}\n\n </mat-form-field>\n</crispr-field-container>\n\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: FieldContainerComponent, selector: "crispr-field-container", inputs: ["config", "group", "inlineField"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i1.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i1.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i1.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i1.MatDatepickerActions, selector: "mat-datepicker-actions, mat-date-range-picker-actions" }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatDateFnsModule }, { kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i5.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "ngmodule", type: FormValidationHandlerModule }, { kind: "directive", type: i6.ControlErrorsDirective, selector: "[formControl], [formControlName]" }, { kind: "directive", type: i6.ControlErrorContainerDirective, selector: "[controlErrorContainer], [formGroup]" }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, preserveWhitespaces: true }); }
|
|
51
|
+
}
|
|
52
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: DatepickerFieldComponent, decorators: [{
|
|
53
|
+
type: Component,
|
|
54
|
+
args: [{ selector: 'crispr-datepicker-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
55
|
+
CommonModule,
|
|
56
|
+
FieldContainerComponent,
|
|
57
|
+
MatDatepickerModule,
|
|
58
|
+
MatFormFieldModule,
|
|
59
|
+
ReactiveFormsModule,
|
|
60
|
+
MatInputModule,
|
|
61
|
+
MatDateFnsModule,
|
|
62
|
+
PortalModule,
|
|
63
|
+
FormValidationHandlerModule,
|
|
64
|
+
], standalone: true, template: "<crispr-field-container\n [config]=\"config()\"\n [group]=\"group()\">\n <mat-form-field\n [attr.data-testid]=\"testId()\"\n [color]=\"config().color\"\n [appearance]=\"config().appearance\"\n [formGroup]=\"group()\">\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n <input\n matInput\n [formControlName]=\"config().controlName\"\n [min]=\"config().min\"\n [max]=\"config().max\"\n [matDatepicker]=\"picker\"\n [matDatepickerFilter]=\"config().datepickerFilter\">\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker\n [touchUi]=\"config().touchUi\"\n [startView]=\"config().startView\"\n [startAt]=\"startAt$ | async\"\n [dateClass]=\"dateClass || (dateClass$ | async)\"\n #picker>\n @if (calendarFooterPortal) {\n <mat-datepicker-actions>\n <ng-template [cdkPortalOutlet]=\"calendarFooterPortal\"></ng-template>\n </mat-datepicker-actions>\n }\n </mat-datepicker>\n\n @if (config().hint && (control().valid || !control().touched)) {<mat-hint>{{config().hint}}</mat-hint>}\n\n </mat-form-field>\n</crispr-field-container>\n\n" }]
|
|
65
|
+
}] });
|
|
66
|
+
|
|
67
|
+
export { DatepickerFieldComponent };
|
|
68
|
+
//# sourceMappingURL=tft-crispr-forms-index-usD7jUs3.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tft-crispr-forms-index-usD7jUs3.mjs","sources":["../../../../libs/crispr-forms/src/lib/ui/datepicker-field/datepicker-field.component.ts","../../../../libs/crispr-forms/src/lib/ui/datepicker-field/datepicker-field.component.html"],"sourcesContent":["/* eslint-disable @nx/enforce-module-boundaries */\nimport {\n Component,\n OnInit,\n ChangeDetectionStrategy,\n AfterContentInit,\n} from '@angular/core';\nimport {\n MatCalendarCellClassFunction,\n MatDatepickerModule,\n} from '@angular/material/datepicker';\nimport { MatDateFnsModule } from '@angular/material-date-fns-adapter';\nimport { Observable, of } from 'rxjs';\nimport { ComponentPortal, Portal, PortalModule } from '@angular/cdk/portal';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { MatInputModule } from '@angular/material/input';\nimport { FormValidationHandlerModule } from '@tft/form-validation-handler';\nimport { FieldContainerComponent } from '../field-container';\nimport {\n DatepickerFieldConfig,\n} from '../../utils';\nimport { CrisprControlComponent } from '../../utils/abstracts/crispr-control.abstract';\n\nconst defaultConfig: Partial<DatepickerFieldConfig> = {\n startView: 'month',\n};\n\n@Component({\n selector: 'crispr-datepicker-field',\n templateUrl: './datepicker-field.component.html',\n styleUrls: ['./datepicker-field.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n CommonModule,\n FieldContainerComponent,\n MatDatepickerModule,\n MatFormFieldModule,\n ReactiveFormsModule,\n MatInputModule,\n MatDateFnsModule,\n PortalModule,\n FormValidationHandlerModule,\n ],\n standalone: true\n})\nexport class DatepickerFieldComponent\n extends CrisprControlComponent<DatepickerFieldConfig>\n implements OnInit, AfterContentInit\n{\n defaultConfig = defaultConfig;\n\n dateClass: MatCalendarCellClassFunction<Date>;\n dateClass$: Observable<MatCalendarCellClassFunction<Date>>;\n startAt$: Observable<Date>;\n\n /** A portal containing the footer component type for this calendar. */\n calendarFooterPortal: Portal<any>;\n\n ngOnInit() {\n super.ngOnInit();\n const config = this.config();\n this.startAt$ =\n config.startAt instanceof Date\n ? of(config.startAt)\n : config.startAt instanceof Function\n ? config.startAt(this.group())\n : of(null);\n this.dateClass = config?.cellClassFunction || null;\n this.dateClass$ = config.dateClass\n ? config?.dateClass(this.group())\n : of(() => '');\n }\n\n ngAfterContentInit() {\n if (this.config().datepickerActions) {\n this.calendarFooterPortal = new ComponentPortal(\n this.config().datepickerActions\n );\n }\n }\n\n // handleSelectedChange(event, picker: MatDatepicker<unknown>) {\n // console.log({event, picker})\n // if(this.config.selectedChange) {\n // this.config.selectedChange(event, picker);\n // }\n // }\n}\n","<crispr-field-container\n [config]=\"config()\"\n [group]=\"group()\">\n <mat-form-field\n [attr.data-testid]=\"testId()\"\n [color]=\"config().color\"\n [appearance]=\"config().appearance\"\n [formGroup]=\"group()\">\n @if (config().label) {<mat-label>{{config().label}}</mat-label>}\n <input\n matInput\n [formControlName]=\"config().controlName\"\n [min]=\"config().min\"\n [max]=\"config().max\"\n [matDatepicker]=\"picker\"\n [matDatepickerFilter]=\"config().datepickerFilter\">\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker\n [touchUi]=\"config().touchUi\"\n [startView]=\"config().startView\"\n [startAt]=\"startAt$ | async\"\n [dateClass]=\"dateClass || (dateClass$ | async)\"\n #picker>\n @if (calendarFooterPortal) {\n <mat-datepicker-actions>\n <ng-template [cdkPortalOutlet]=\"calendarFooterPortal\"></ng-template>\n </mat-datepicker-actions>\n }\n </mat-datepicker>\n\n @if (config().hint && (control().valid || !control().touched)) {<mat-hint>{{config().hint}}</mat-hint>}\n\n </mat-form-field>\n</crispr-field-container>\n\n"],"names":["i4","i7"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAyBA,MAAM,aAAa,GAAmC;AACpD,IAAA,SAAS,EAAE,OAAO;CACnB;AAoBK,MAAO,wBACX,SAAQ,sBAA6C,CAAA;AAnBvD,IAAA,WAAA,GAAA;;QAsBE,IAAA,CAAA,aAAa,GAAG,aAAa;AAsC9B,IAAA;IA7BC,QAAQ,GAAA;QACN,KAAK,CAAC,QAAQ,EAAE;AAChB,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE;AAC5B,QAAA,IAAI,CAAC,QAAQ;YACX,MAAM,CAAC,OAAO,YAAY;AACxB,kBAAE,EAAE,CAAC,MAAM,CAAC,OAAO;AACnB,kBAAE,MAAM,CAAC,OAAO,YAAY;sBAC1B,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE;AAC7B,sBAAE,EAAE,CAAC,IAAI,CAAC;QACd,IAAI,CAAC,SAAS,GAAG,MAAM,EAAE,iBAAiB,IAAI,IAAI;AAClD,QAAA,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC;cACrB,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE;cAC9B,EAAE,CAAC,MAAM,EAAE,CAAC;IAClB;IAEA,kBAAkB,GAAA;AAChB,QAAA,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,iBAAiB,EAAE;AACnC,YAAA,IAAI,CAAC,oBAAoB,GAAG,IAAI,eAAe,CAC7C,IAAI,CAAC,MA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