barsa-develop-components 1.0.288 → 1.0.289
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/esm2020/lib/barsa-develop-components.module.mjs +8 -4
- package/esm2020/lib/geographic-location/geographic-location.component.mjs +193 -0
- package/esm2020/public-api.mjs +2 -1
- package/fesm2015/barsa-develop-components.mjs +194 -4
- package/fesm2015/barsa-develop-components.mjs.map +1 -1
- package/fesm2020/barsa-develop-components.mjs +194 -4
- package/fesm2020/barsa-develop-components.mjs.map +1 -1
- package/lib/barsa-develop-components.module.d.ts +16 -14
- package/lib/geographic-location/geographic-location.component.d.ts +27 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -57,6 +57,7 @@ import * as i2$6 from '@fundamental-ngx/core/menu';
|
|
|
57
57
|
import * as i3$7 from '@fundamental-ngx/core/split-button';
|
|
58
58
|
import * as i4$b from '@fundamental-ngx/core/action-sheet';
|
|
59
59
|
import * as i7$4 from '@fundamental-ngx/core/file-uploader';
|
|
60
|
+
import * as L from 'leaflet';
|
|
60
61
|
import { FundamentalNgxPlatformModule } from '@fundamental-ngx/platform';
|
|
61
62
|
|
|
62
63
|
class UiTextFieldSearchComponent extends DeviceInfoFieldBaseComponent {
|
|
@@ -2900,6 +2901,192 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImpor
|
|
|
2900
2901
|
type: Input
|
|
2901
2902
|
}] } });
|
|
2902
2903
|
|
|
2904
|
+
const defaults = {
|
|
2905
|
+
iconColor: '#1EB300',
|
|
2906
|
+
iconAnchor: {
|
|
2907
|
+
marker: [14, 36],
|
|
2908
|
+
circle: [11, 10],
|
|
2909
|
+
'circle-dot': [5, 5],
|
|
2910
|
+
'rectangle-dot': [5, 6],
|
|
2911
|
+
doughnut: [8, 8]
|
|
2912
|
+
},
|
|
2913
|
+
popupAnchor: {
|
|
2914
|
+
marker: [0, -25],
|
|
2915
|
+
circle: [-3, -76],
|
|
2916
|
+
'circle-dot': [0, -2],
|
|
2917
|
+
'rectangle-dot': [0, -2],
|
|
2918
|
+
doughnut: [0, -2]
|
|
2919
|
+
},
|
|
2920
|
+
innerIconAnchor: {
|
|
2921
|
+
marker: [-2, 5],
|
|
2922
|
+
circle: [0, 2]
|
|
2923
|
+
},
|
|
2924
|
+
iconSize: {
|
|
2925
|
+
marker: [28, 28],
|
|
2926
|
+
circle: [22, 22],
|
|
2927
|
+
'circle-dot': [2, 2],
|
|
2928
|
+
'rectangle-dot': [2, 2],
|
|
2929
|
+
doughnut: [15, 15]
|
|
2930
|
+
}
|
|
2931
|
+
};
|
|
2932
|
+
L.BeautifyIcon = {
|
|
2933
|
+
Icon: L.Icon.extend({
|
|
2934
|
+
options: {
|
|
2935
|
+
icon: 'leaf',
|
|
2936
|
+
iconSize: defaults.iconSize.circle,
|
|
2937
|
+
iconAnchor: defaults.iconAnchor.circle,
|
|
2938
|
+
iconShape: 'circle',
|
|
2939
|
+
iconStyle: '',
|
|
2940
|
+
innerIconAnchor: [0, 3],
|
|
2941
|
+
innerIconStyle: '',
|
|
2942
|
+
isAlphaNumericIcon: false,
|
|
2943
|
+
text: 1,
|
|
2944
|
+
borderColor: defaults.iconColor,
|
|
2945
|
+
borderWidth: 2,
|
|
2946
|
+
borderStyle: 'solid',
|
|
2947
|
+
backgroundColor: 'white',
|
|
2948
|
+
textColor: defaults.iconColor,
|
|
2949
|
+
customClasses: '',
|
|
2950
|
+
spin: false,
|
|
2951
|
+
prefix: 'sap-icon--',
|
|
2952
|
+
html: ''
|
|
2953
|
+
},
|
|
2954
|
+
createIconInnerHtml() {
|
|
2955
|
+
const options = this.options;
|
|
2956
|
+
if (options.iconShape === 'circle-dot' ||
|
|
2957
|
+
options.iconShape === 'rectangle-dot' ||
|
|
2958
|
+
options.iconShape === 'doughnut') {
|
|
2959
|
+
return '';
|
|
2960
|
+
}
|
|
2961
|
+
const innerIconStyle = this.getInnerIconStyle(options);
|
|
2962
|
+
if (options.isAlphaNumericIcon) {
|
|
2963
|
+
return '<div style="' + innerIconStyle + '">' + options.text + '</div>';
|
|
2964
|
+
}
|
|
2965
|
+
let spinClass = '';
|
|
2966
|
+
if (options.spin) {
|
|
2967
|
+
spinClass = ' fa-spin';
|
|
2968
|
+
}
|
|
2969
|
+
return ('<fd-icon class="' +
|
|
2970
|
+
options.prefix +
|
|
2971
|
+
' ' +
|
|
2972
|
+
options.prefix +
|
|
2973
|
+
'-' +
|
|
2974
|
+
options.icon +
|
|
2975
|
+
spinClass +
|
|
2976
|
+
'" style="' +
|
|
2977
|
+
innerIconStyle +
|
|
2978
|
+
'"></fd-icon>');
|
|
2979
|
+
},
|
|
2980
|
+
getInnerIconStyle(options) {
|
|
2981
|
+
const innerAnchor = L.point(options.innerIconAnchor);
|
|
2982
|
+
return ('color:' +
|
|
2983
|
+
options.textColor +
|
|
2984
|
+
';margin-top:' +
|
|
2985
|
+
innerAnchor.y +
|
|
2986
|
+
'px; margin-left:' +
|
|
2987
|
+
innerAnchor.x +
|
|
2988
|
+
'px;' +
|
|
2989
|
+
options.innerIconStyle);
|
|
2990
|
+
}
|
|
2991
|
+
})
|
|
2992
|
+
};
|
|
2993
|
+
class GeographicLocationComponent extends UiMoInfoSubFormUiComponent {
|
|
2994
|
+
constructor() {
|
|
2995
|
+
super(...arguments);
|
|
2996
|
+
this.id = getUniqueId(3);
|
|
2997
|
+
this.applied = false;
|
|
2998
|
+
this._navigatorOptions = {
|
|
2999
|
+
enableHighAccuracy: true,
|
|
3000
|
+
timeout: 5000,
|
|
3001
|
+
maximumAge: 0
|
|
3002
|
+
};
|
|
3003
|
+
}
|
|
3004
|
+
ngAfterViewInit() {
|
|
3005
|
+
super.ngAfterViewInit();
|
|
3006
|
+
this._initilaize();
|
|
3007
|
+
}
|
|
3008
|
+
_setGeoLocation(position) {
|
|
3009
|
+
const { coords: { latitude, longitude } } = position;
|
|
3010
|
+
this._map.setView([latitude, longitude], 16);
|
|
3011
|
+
L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
|
|
3012
|
+
attribution: '',
|
|
3013
|
+
maxZoom: 18,
|
|
3014
|
+
id: 'mapbox/streets-v11',
|
|
3015
|
+
tileSize: 512,
|
|
3016
|
+
zoomOffset: -1,
|
|
3017
|
+
accessToken: 'pk.eyJ1IjoibXJlemFkZXZlbG9wZXIiLCJhIjoiY2p6anlrdTE2MDBxdjNtczZtYWFqbHFmdiJ9.SzniRy2KH6U3gdbOFnwA7Q'
|
|
3018
|
+
}).addTo(this._map);
|
|
3019
|
+
const marker = this._createMarker('0', { mo: 'test' }, latitude, longitude, 'my location', 'assets/images/UploadTarget_32.png', true);
|
|
3020
|
+
marker.addTo(this._map);
|
|
3021
|
+
}
|
|
3022
|
+
_initilaize() {
|
|
3023
|
+
const defaultLatLng = [35.7568, 51.412];
|
|
3024
|
+
if (this.latitudeUi && this.latitudeUi.value) {
|
|
3025
|
+
defaultLatLng[0] = this.latitudeUi.value;
|
|
3026
|
+
defaultLatLng[1] = this.longitudeUi.value;
|
|
3027
|
+
}
|
|
3028
|
+
this._map = L.map(this._el.nativeElement);
|
|
3029
|
+
this._setGeoLocation({ coords: { latitude: defaultLatLng[0], longitude: defaultLatLng[1] } });
|
|
3030
|
+
this._getNavigatorCurrentPosition();
|
|
3031
|
+
}
|
|
3032
|
+
_onErrorNavigatorLocation(err) {
|
|
3033
|
+
console.error(err);
|
|
3034
|
+
}
|
|
3035
|
+
_getNavigatorCurrentPosition() {
|
|
3036
|
+
if (navigator.geolocation) {
|
|
3037
|
+
navigator.geolocation.getCurrentPosition((position) => this._setGeoLocation(position), (err) => this._onErrorNavigatorLocation(err), this._navigatorOptions);
|
|
3038
|
+
}
|
|
3039
|
+
}
|
|
3040
|
+
_createMarker(id, mo, lat, lng, text, icon, draggable) {
|
|
3041
|
+
const markerCfg = {
|
|
3042
|
+
Id: id,
|
|
3043
|
+
Data: mo,
|
|
3044
|
+
title: text,
|
|
3045
|
+
draggable,
|
|
3046
|
+
icon: new L.BeautifyIcon.Icon({
|
|
3047
|
+
icon: 'functional-location',
|
|
3048
|
+
iconSize: [24, 24] // size of the icon
|
|
3049
|
+
})
|
|
3050
|
+
};
|
|
3051
|
+
// var marker = L.BeautifyMarker.marker([Number(lat), Number(lng)], {
|
|
3052
|
+
const marker = L.marker([Number(lat), Number(lng)], markerCfg);
|
|
3053
|
+
// marker.on('click', function (e) { this.fireEvent('ItemClick', this, e); });
|
|
3054
|
+
marker.on('dblclick', (e) => {
|
|
3055
|
+
this._dbleClickOnMarker(e);
|
|
3056
|
+
});
|
|
3057
|
+
marker.on('moveend', (e) => {
|
|
3058
|
+
this._onMoveEnd(e, marker);
|
|
3059
|
+
});
|
|
3060
|
+
marker.on('move', (e) => {
|
|
3061
|
+
this._onMove(e, marker);
|
|
3062
|
+
});
|
|
3063
|
+
return marker;
|
|
3064
|
+
}
|
|
3065
|
+
get latitudeUi() {
|
|
3066
|
+
return this.customFormPanelUi._dictFieldUi.Latitude;
|
|
3067
|
+
}
|
|
3068
|
+
get longitudeUi() {
|
|
3069
|
+
return this.customFormPanelUi._dictFieldUi.Longitude;
|
|
3070
|
+
}
|
|
3071
|
+
_onMove(e, marker) {
|
|
3072
|
+
this.latitudeUi.value = e.latlng.lat;
|
|
3073
|
+
this.longitudeUi.value = e.latlng.lng;
|
|
3074
|
+
}
|
|
3075
|
+
_onMoveEnd(e, marker) {
|
|
3076
|
+
this.latitudeUi.fireEvent('change', this.latitudeUi, this.latitudeUi.value);
|
|
3077
|
+
this.longitudeUi.fireEvent('change', this.longitudeUi, this.longitudeUi.value);
|
|
3078
|
+
}
|
|
3079
|
+
_dbleClickOnMarker(e) {
|
|
3080
|
+
// debugger;
|
|
3081
|
+
}
|
|
3082
|
+
}
|
|
3083
|
+
GeographicLocationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: GeographicLocationComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
3084
|
+
GeographicLocationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: GeographicLocationComponent, selector: "bdc-geographic-location", usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"customFormPanelUi\">\n <bnrc-form *untilInView=\"el\" [customFormPanelUi]=\"customFormPanelUi\"></bnrc-form>\n</ng-container>\n", styles: [":host{display:block;min-height:300px}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1$2.FormComponent, selector: "bnrc-form", inputs: ["params", "customFormPanelUi", "formPanelCtrl", "formPanelCtrlId"], outputs: ["titleChanged", "moChanged", "formClose", "formRendered"] }, { kind: "directive", type: i1$2.UntilInViewDirective, selector: "[untilInView]", inputs: ["untilInView", "intersectionDebounce"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3085
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: GeographicLocationComponent, decorators: [{
|
|
3086
|
+
type: Component,
|
|
3087
|
+
args: [{ selector: 'bdc-geographic-location', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"customFormPanelUi\">\n <bnrc-form *untilInView=\"el\" [customFormPanelUi]=\"customFormPanelUi\"></bnrc-form>\n</ng-container>\n", styles: [":host{display:block;min-height:300px}\n"] }]
|
|
3088
|
+
}] });
|
|
3089
|
+
|
|
2903
3090
|
const components = [
|
|
2904
3091
|
LoginFormComponent,
|
|
2905
3092
|
LoginSocialConncetionsComponent,
|
|
@@ -2948,7 +3135,8 @@ const components = [
|
|
|
2948
3135
|
BarsaDocumentsComponent,
|
|
2949
3136
|
BarsaDocumentListItemComponent,
|
|
2950
3137
|
AcceptRejectComponent,
|
|
2951
|
-
FooterComponent
|
|
3138
|
+
FooterComponent,
|
|
3139
|
+
GeographicLocationComponent
|
|
2952
3140
|
];
|
|
2953
3141
|
const pipes = [UiPersonPipe, BarcodeFormatPipe, MoListToFlowItemPipe, DataSourceToFlowItemPipe];
|
|
2954
3142
|
class BarsaDevelopComponentsModule extends BaseModule {
|
|
@@ -3007,7 +3195,8 @@ BarsaDevelopComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.
|
|
|
3007
3195
|
BarsaDocumentsComponent,
|
|
3008
3196
|
BarsaDocumentListItemComponent,
|
|
3009
3197
|
AcceptRejectComponent,
|
|
3010
|
-
FooterComponent,
|
|
3198
|
+
FooterComponent,
|
|
3199
|
+
GeographicLocationComponent, UiPersonPipe, BarcodeFormatPipe, MoListToFlowItemPipe, DataSourceToFlowItemPipe], imports: [CommonModule,
|
|
3011
3200
|
BarsaNovinRayCoreModule,
|
|
3012
3201
|
ReactiveFormsModule,
|
|
3013
3202
|
BarsaSapUiModule,
|
|
@@ -3062,7 +3251,8 @@ BarsaDevelopComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.
|
|
|
3062
3251
|
BarsaDocumentsComponent,
|
|
3063
3252
|
BarsaDocumentListItemComponent,
|
|
3064
3253
|
AcceptRejectComponent,
|
|
3065
|
-
FooterComponent
|
|
3254
|
+
FooterComponent,
|
|
3255
|
+
GeographicLocationComponent] });
|
|
3066
3256
|
BarsaDevelopComponentsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: BarsaDevelopComponentsModule, providers: [UserMediaBaseService, WebBarcodeService], imports: [CommonModule,
|
|
3067
3257
|
BarsaNovinRayCoreModule,
|
|
3068
3258
|
ReactiveFormsModule,
|
|
@@ -3097,5 +3287,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImpor
|
|
|
3097
3287
|
* Generated bundle index. Do not edit.
|
|
3098
3288
|
*/
|
|
3099
3289
|
|
|
3100
|
-
export { AcceptRejectComponent, AvatarComponent, BarcodeFormatPipe, BarcodeReaderComponent, BarcodeReaderDialogComponent, BarcodeReaderVideoComponent, BarsaDevelopComponentsModule, BarsaDocumentListItemComponent, BarsaDocumentsComponent, CardContentImageAndTitleComponent, CardContentLineChartComponent, CardHeaderBigImageTitleAndSubtitleComponent, CardHeaderKpiComponent, CardHeaderLogoTitleSubtitleComponent, CheckboxButtonComponent, EnumInfoMicroProccessFlowComponent, FooterComponent, FormChartContentComponent, FormContentQuickViewComponent, G4bDetailsComponent, G4bEstelamComponent, LoginFormComponent, LoginSocialConncetionsComponent, MasterDetailCardFormComponent, MediaFileUploaderComponent, MicroProccessFlowComponent, MicroProcessFlowViewComponent, MoInfoMicroProccessFlowComponent, QueryStringFormObservableComponent, QueryStringObservableComponent, ReportButtonViewComponent, ReportLineChartViewComponent, ReportTabViewComponent, ResendVerificationCodeComponent, ServiceDeskCardContentMojavezhayAkhzShodeComponent, ServiceDeskFormLayoutContentMojavezComponent, ServiceDeskHeaderComponent, ServiceDeskServcieDetailComponent, ServiceDeskViewOfServicesComponent, SettingFormComponent, SubformInRowReportComponent, TabProcessViewComponent, TableViewVerticalColumnsComponent, TimerCountDownComponent, UiEnumSegmentedButtonComponent, UiNumRateComponent, UiPersonComponent, UiPicturesCarouselComponent, UiTextFieldSearchComponent, UlvContextMenuItemShowFileContentComponent };
|
|
3290
|
+
export { AcceptRejectComponent, AvatarComponent, BarcodeFormatPipe, BarcodeReaderComponent, BarcodeReaderDialogComponent, BarcodeReaderVideoComponent, BarsaDevelopComponentsModule, BarsaDocumentListItemComponent, BarsaDocumentsComponent, CardContentImageAndTitleComponent, CardContentLineChartComponent, CardHeaderBigImageTitleAndSubtitleComponent, CardHeaderKpiComponent, CardHeaderLogoTitleSubtitleComponent, CheckboxButtonComponent, EnumInfoMicroProccessFlowComponent, FooterComponent, FormChartContentComponent, FormContentQuickViewComponent, G4bDetailsComponent, G4bEstelamComponent, GeographicLocationComponent, LoginFormComponent, LoginSocialConncetionsComponent, MasterDetailCardFormComponent, MediaFileUploaderComponent, MicroProccessFlowComponent, MicroProcessFlowViewComponent, MoInfoMicroProccessFlowComponent, QueryStringFormObservableComponent, QueryStringObservableComponent, ReportButtonViewComponent, ReportLineChartViewComponent, ReportTabViewComponent, ResendVerificationCodeComponent, ServiceDeskCardContentMojavezhayAkhzShodeComponent, ServiceDeskFormLayoutContentMojavezComponent, ServiceDeskHeaderComponent, ServiceDeskServcieDetailComponent, ServiceDeskViewOfServicesComponent, SettingFormComponent, SubformInRowReportComponent, TabProcessViewComponent, TableViewVerticalColumnsComponent, TimerCountDownComponent, UiEnumSegmentedButtonComponent, UiNumRateComponent, UiPersonComponent, UiPicturesCarouselComponent, UiTextFieldSearchComponent, UlvContextMenuItemShowFileContentComponent };
|
|
3101
3291
|
//# sourceMappingURL=barsa-develop-components.mjs.map
|