@c8y/ng1-modules 1018.0.208 → 1018.0.213

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.
@@ -1 +1 @@
1
- "use strict";!function(){function t(t){var n=t.resourceUrlWhitelist();n.push(/^http(s?):\/\/www\.mapquestapi\.com\/geocoding\/v1\/address/),t.resourceUrlWhitelist(n)}function n(o,t){var a="c8y_Position",r="com_nsn_startups_vendme_fragments_GPSCoordinates",s="//www.mapquestapi.com/geocoding/v1/address?key=".concat(t.get("MAPQUESTAPI"));function e(){return this.points=[],this}return e.prototype.add=function(t){var n=this;return _.isArray(t)?_.forEach(t,function(t){n.points.push(t)}):t instanceof e?n.add(t.points):this.points.push(t),n},e.prototype.reset=function(){this.points.length=0},e.prototype.get=function(){var n={southWest:{},northEast:{}};return this.points.length||(n=null),this.points.forEach(function(t){t.lat<(n.southWest.lat||1/0)&&(n.southWest.lat=t.lat),t.lng<(n.southWest.lng||1/0)&&(n.southWest.lng=t.lng),t.lat>(n.northEast.lat||-1/0)&&(n.northEast.lat=t.lat),t.lng>(n.northEast.lng||-1/0)&&(n.northEast.lng=t.lng)}),n},{geoCode:function(t){var n={params:{format:"json",location:t}};return o.get(s,n)},Bounds:e,getLocationFragment:function(t){var n=t[a]||t[r];if(n){var o=Number(n.lat),s=Number(n.lng);if(!_.isNaN(o)&&!_.isNaN(s)&&Math.abs(n.lng)<=180&&Math.abs(n.lat)<=90)return{lat:o,lng:s};var e=t.name||t.source&&t.source.name;console.warn("Device ".concat(e," has an invalid location."))}},c8y_Position:a,v4e_Position:r}}n.$inject=["$http","c8yKeys"],t.$inject=["$sceDelegateProvider"],angular.module("c8y.core").config(t).factory("c8yGeo",n)}();
1
+ "use strict";!function(){function t(t){var n=t.resourceUrlWhitelist();n.push(/^http(s?):\/\/www\.mapquestapi\.com\/geocoding\/v1\/address/),t.resourceUrlWhitelist(n)}function n(o){var e="c8y_Position",r="com_nsn_startups_vendme_fragments_GPSCoordinates",s=window.C8Y_APP.mapNominatimUrl||"//nominatim.openstreetmap.org/search";function a(){return this.points=[],this}return a.prototype.add=function(t){var n=this;return _.isArray(t)?_.forEach(t,function(t){n.points.push(t)}):t instanceof a?n.add(t.points):this.points.push(t),n},a.prototype.reset=function(){this.points.length=0},a.prototype.get=function(){var n={southWest:{},northEast:{}};return this.points.length||(n=null),this.points.forEach(function(t){t.lat<(n.southWest.lat||1/0)&&(n.southWest.lat=t.lat),t.lng<(n.southWest.lng||1/0)&&(n.southWest.lng=t.lng),t.lat>(n.northEast.lat||-1/0)&&(n.northEast.lat=t.lat),t.lng>(n.northEast.lng||-1/0)&&(n.northEast.lng=t.lng)}),n},{geoCode:function(t){var n={params:{format:"json",q:t}};return o.get(s,n)},Bounds:a,getLocationFragment:function(t){var n=t[e]||t[r];if(n){var o=Number(n.lat),s=Number(n.lng);if(!_.isNaN(o)&&!_.isNaN(s)&&Math.abs(n.lng)<=180&&Math.abs(n.lat)<=90)return{lat:o,lng:s};var a=t.name||t.source&&t.source.name;console.warn("Device ".concat(a," has an invalid location."))}},c8y_Position:e,v4e_Position:r}}n.$inject=["$http"],t.$inject=["$sceDelegateProvider"],angular.module("c8y.core").config(t).factory("c8yGeo",n)}();
@@ -1 +1 @@
1
- "use strict";!function(){function e(t,n,e,a,i,o,l,c,r){var d,s,u="c8y_Position",g="com_nsn_startups_vendme_fragments_GPSCoordinates",f={},m={icon:{type:"div",className:"normal-marker-icon",iconSize:[25,41],iconAnchor:[12.5,41]},focus:!0,draggable:!0},v={lat:0,lng:0,zoom:11};function b(e){r.getMap("locationId").then(function(e){setTimeout(function(){e.invalidateSize(!0)},500)}),d=e,t.location=D(e)||{};var n=t.location;h(t.location),s=_.clone(n),function(e){return!(!e.lat||!e.lng)}(n)&&C(n)}function h(e){var n=_.get(e,"lat"),t=_.get(e,"lng"),a=_.get(e,"alt");_.set(e,"lat",_.toNumber(n)),_.set(e,"lng",_.toNumber(t)),_.isUndefined(a)||_.set(e,"alt",_.toNumber(a))}function p(e){var n=e&&e.latLng;if(n){var t={lat:Number(n.lat),lng:Number(n.lng),zoom:17};C(t),y(t),N(t)}}function $(){i.detailCached(function(){var e=_.get(t,"child.config.device");return e&&(m.draggable=!1),_.get(e,"id",n.deviceId)}()).then(function(e){return _.cloneDeep(e.data)}).then(b)}function C(e){_.assign(m,{lat:parseFloat(e.lat),lng:parseFloat(e.lng)}),N(f.main=m)}function y(e){_.assign(t.location,{lat:parseFloat(e.lat),lng:function(e){var n=e%360;return n<-180?360+n:180<n?n-360:n}(parseFloat(e.lng))})}function A(e){return i.isVendme(e)?g:u}function D(e){return e[A(e)]}function N(e){var n=e||m;_.assign(t.center,n)}_.assign(t,{settings:{},markers:f,mapDefaults:{scrollWheelZoom:!1},centerMap:N,center:v,pattern:{latitude:/^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?)$/,longitude:/^[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)$/,altitude:/^[-+]?(0|([1-9]\d*))(\.\d+)?$/},events:{markers:{enable:["dragend"]}},gotoAddress:function(e){a.geoCode(e).then(function(e){var n=_.get(e,"data.results[0].locations[0]");return n||l.warning(c("Address could not be found.")),n||null}).then(p)},cancel:function(){t.noeditable=!t.noeditable,_.isEqual(t.location,s)||(t.location=_.clone(s))},save:function(){t.noeditable=!t.noeditable;var e={id:d.id},n=_.clone(D(d));delete n.address,e[A(d)]=n,h(e[A(d)]),i.save(e).then(function(){l.success(c("Location saved."))}).then($)},realtimeChannel:"/managedobjects/".concat(void 0!==n.deviceId?n.deviceId:"*"),invalid:angular.bind(e,e.invalid,t),id:t.$id}),t.$on("leafletDirectiveMarker.locationId.dragend",function(e,n){y(n.model)}),t.$watch("child.config.device",$),o.addListener(t.$id,t.realtimeChannel,"".concat(t.$id,"-subscribed"),function(){$()}),o.addListener(t.$id,t.realtimeChannel,"CREATE",function(e,n){b(n)}),o.addListener(t.$id,t.realtimeChannel,"UPDATE",function(e,n){b(n)}),$()}e.$inject=["$scope","$routeParams","c8yBase","c8yGeo","c8yDevices","c8yRealtime","c8yAlert","gettext","leafletData"],angular.module("c8y.parts.location").controller("locationCtrl",e)}();
1
+ "use strict";!function(){function n(t,e,n,a,i,o,l,c,d){var r,s,u="c8y_Position",g="com_nsn_startups_vendme_fragments_GPSCoordinates",f={},m={icon:{type:"div",className:"normal-marker-icon",iconSize:[25,41],iconAnchor:[12.5,41]},focus:!0,draggable:!0},v={lat:0,lng:0,zoom:11};function b(n){d.getMap("locationId").then(function(n){setTimeout(function(){n.invalidateSize(!0)},500)}),r=n,t.location=D(n)||{};var e=t.location;h(t.location),s=_.clone(e),function(n){return!(!n.lat||!n.lng)}(e)&&C(e)}function h(n){var e=_.get(n,"lat"),t=_.get(n,"lng"),a=_.get(n,"alt");_.set(n,"lat",_.toNumber(e)),_.set(n,"lng",_.toNumber(t)),_.isUndefined(a)||_.set(n,"alt",_.toNumber(a))}function p(n){if(n){var e={lat:Number(n.lat),lng:Number(n.lng),zoom:17};C(e),y(e),N(e)}}function $(){i.detailCached(function(){var n=_.get(t,"child.config.device");return n&&(m.draggable=!1),_.get(n,"id",e.deviceId)}()).then(function(n){return _.cloneDeep(n.data)}).then(b)}function C(n){_.assign(m,{lat:parseFloat(n.lat),lng:parseFloat(n.lng)}),N(f.main=m)}function y(n){_.assign(t.location,{lat:parseFloat(n.lat),lng:function(n){var e=n%360;return e<-180?360+e:180<e?e-360:e}(parseFloat(n.lng))})}function A(n){return i.isVendme(n)?g:u}function D(n){return n[A(n)]}function N(n){var e=n||m;_.assign(t.center,e)}_.assign(t,{settings:{},markers:f,mapDefaults:{scrollWheelZoom:!1},centerMap:N,center:v,pattern:{latitude:/^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?)$/,longitude:/^[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)$/,altitude:/^[-+]?(0|([1-9]\d*))(\.\d+)?$/},events:{markers:{enable:["dragend"]}},gotoAddress:function(n){a.geoCode(n).then(function(n){var e=_.get(n,"data[0]");return e?(e.lng=e.lon,e):(l.warning(c("Address could not be found.")),null)}).then(p)},cancel:function(){t.noeditable=!t.noeditable,_.isEqual(t.location,s)||(t.location=_.clone(s))},save:function(){t.noeditable=!t.noeditable;var n={id:r.id},e=_.clone(D(r));delete e.address,n[A(r)]=e,h(n[A(r)]),i.save(n).then(function(){l.success(c("Location saved."))}).then($)},realtimeChannel:"/managedobjects/".concat(void 0!==e.deviceId?e.deviceId:"*"),invalid:angular.bind(n,n.invalid,t),id:t.$id}),t.$on("leafletDirectiveMarker.locationId.dragend",function(n,e){y(e.model)}),t.$watch("child.config.device",$),o.addListener(t.$id,t.realtimeChannel,"".concat(t.$id,"-subscribed"),function(){$()}),o.addListener(t.$id,t.realtimeChannel,"CREATE",function(n,e){b(e)}),o.addListener(t.$id,t.realtimeChannel,"UPDATE",function(n,e){b(e)}),$()}n.$inject=["$scope","$routeParams","c8yBase","c8yGeo","c8yDevices","c8yRealtime","c8yAlert","gettext","leafletData"],angular.module("c8y.parts.location").controller("locationCtrl",n)}();
@@ -1 +1 @@
1
- "use strict";!function(){function e(e,n,t,l,a,o,r){var c,g=new l.Bounds,s=[],i={type:"polygon",stroke:!0,weight:1,color:"#2e3974",fillColor:"#2e3974",latlngs:[]},d={center:{},events:{},defaults:{doubleClickZoom:!1},bounds:g.get(),markers:s,paths:{geofencePath:i}};function u(e){var n=e&&e.latLng;n&&(d.center=_.assign(d.center,{lat:Number(n.lat),lng:Number(n.lng),zoom:17}))}function f(){0<i.latlngs.length&&(g.reset(),_.forEach(i.latlngs,function(e){g.add(e)}),d.bounds=g.get())}function h(){i.latlngs.length=0,s.length=0}function m(e,n){switch(e.name){case"leafletDirectiveMarker.dragstart":c={lat:n.model.lat,lng:n.model.lng,draggable:!0};break;case"leafletDirectiveMarker.dragend":i.latlngs[_.findIndex(i.latlngs,c)]={lat:n.model.lat,lng:n.model.lng,draggable:!0}}}e.gotoAddress=function(e){l.geoCode(e).then(function(e){var n=_.get(e,"data.results[0].locations[0]");return n||o.warning(r("Address could not be found.")),n||null}).then(u)},e.centerMap=f,e.clearGeofence=h,e.chooseGeofence=function(){n.close(function(e){return _.map(e,function(e){return{lat:e.lat,lng:e.lng}})}(i.latlngs))},e.cancel=n.dismiss,e.map=d,e.$on("leafletDirectiveMap.click",function(e,n){var t={lat:n.leafletEvent.latlng.lat,lng:n.leafletEvent.latlng.lng,draggable:!0,icon:{type:"div",className:"normal-marker-icon",iconSize:[25,41],iconAnchor:[12.5,41]}};d.markers.push(t),i.latlngs.push(t),1===i.latlngs.length&&(d.paths={geofencePath:i})}),e.$on("leafletDirectiveMarker.dragend",m),e.$on("leafletDirectiveMarker.dragstart",m),h(),_.forEach(a,function(e){e.draggable=!0,e.icon={type:"div",className:"normal-marker-icon",iconSize:[25,41],iconAnchor:[12.5,41]},s.push(e),i.latlngs.push(e)}),0<i.latlngs.length?d.paths={geofencePath:i}:d.paths={},t(f,0)}e.$inject=["$scope","$uibModalInstance","$timeout","c8yGeo","geofenceLatLngs","c8yAlert","gettext"],angular.module("c8y.cockpit.map").controller("GeofenceEditCtrl",e)}();
1
+ "use strict";!function(){function e(e,n,t,l,a,o,c){var r,g=new l.Bounds,s=[],i={type:"polygon",stroke:!0,weight:1,color:"#2e3974",fillColor:"#2e3974",latlngs:[]},d={center:{},events:{},defaults:{doubleClickZoom:!1},bounds:g.get(),markers:s,paths:{geofencePath:i}};function u(e){e&&(d.center=_.assign(d.center,{lat:Number(e.lat),lng:Number(e.lng),zoom:17}))}function f(){0<i.latlngs.length&&(g.reset(),_.forEach(i.latlngs,function(e){g.add(e)}),d.bounds=g.get())}function h(){i.latlngs.length=0,s.length=0}function m(e,n){switch(e.name){case"leafletDirectiveMarker.dragstart":r={lat:n.model.lat,lng:n.model.lng,draggable:!0};break;case"leafletDirectiveMarker.dragend":i.latlngs[_.findIndex(i.latlngs,r)]={lat:n.model.lat,lng:n.model.lng,draggable:!0}}}e.gotoAddress=function(e){l.geoCode(e).then(function(e){var n=_.get(e,"data[0]");return n?(n.lng=n.lon,n):(o.warning(c("Address could not be found.")),null)}).then(u)},e.centerMap=f,e.clearGeofence=h,e.chooseGeofence=function(){n.close(function(e){return _.map(e,function(e){return{lat:e.lat,lng:e.lng}})}(i.latlngs))},e.cancel=n.dismiss,e.map=d,e.$on("leafletDirectiveMap.click",function(e,n){var t={lat:n.leafletEvent.latlng.lat,lng:n.leafletEvent.latlng.lng,draggable:!0,icon:{type:"div",className:"normal-marker-icon",iconSize:[25,41],iconAnchor:[12.5,41]}};d.markers.push(t),i.latlngs.push(t),1===i.latlngs.length&&(d.paths={geofencePath:i})}),e.$on("leafletDirectiveMarker.dragend",m),e.$on("leafletDirectiveMarker.dragstart",m),h(),_.forEach(a,function(e){e.draggable=!0,e.icon={type:"div",className:"normal-marker-icon",iconSize:[25,41],iconAnchor:[12.5,41]},s.push(e),i.latlngs.push(e)}),0<i.latlngs.length?d.paths={geofencePath:i}:d.paths={},t(f,0)}e.$inject=["$scope","$uibModalInstance","$timeout","c8yGeo","geofenceLatLngs","c8yAlert","gettext"],angular.module("c8y.cockpit.map").controller("GeofenceEditCtrl",e)}();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c8y/ng1-modules",
3
- "version": "1018.0.208",
3
+ "version": "1018.0.213",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Cumulocity",
6
6
  "description": "AngularJS modules for Cumulocity IoT applications.",