@c8y/ng1-modules 1018.0.248 → 1018.0.249

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 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
+ "use strict";!function(){function n(t,e,n,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(n){r.getMap("locationId").then(function(n){setTimeout(function(){n.invalidateSize(!0)},500)}),d=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){!function(n,e){return-90<=n&&n<=90&&-180<=e&&e<=180}(n.lat,n.lng)?l.danger(c("Location is incorrect.")):(_.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:d.id},e=_.clone(D(d));delete e.address,n[A(d)]=e,h(n[A(d)]),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)}();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c8y/ng1-modules",
3
- "version": "1018.0.248",
3
+ "version": "1018.0.249",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Cumulocity",
6
6
  "description": "AngularJS modules for Cumulocity IoT applications.",