@c8y/ng1-modules 1018.335.0 → 1018.338.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c8y/ng1-modules",
3
- "version": "1018.335.0",
3
+ "version": "1018.338.0",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Cumulocity",
6
6
  "description": "AngularJS modules for Cumulocity IoT applications.",
@@ -8,7 +8,7 @@
8
8
  "@claviska/jquery-minicolors": "2.3.6",
9
9
  "@selectize/selectize": "0.15.2",
10
10
  "ace-builds": "1.23.4",
11
- "angular": "1.6.9",
11
+ "angular": "1.8.3",
12
12
  "angular-animate": "1.6.9",
13
13
  "angular-cron-jobs": "1.4.0",
14
14
  "angular-dynamic-locale": "0.1.31",
@@ -1 +1 @@
1
- "use strict";!function(){function e(c,t,o,a,i,n,r,d,f,s){var u=this,g="",e={c8y_Global:{}};function l(n){return u.svgFile={name:n.name,size:n.length},n instanceof Blob?i.readDataUri(n).then(i.decodeDataUri).then(p):i.downloadAsDataUri(n).then(i.decodeDataUri).then(function(e){return new File([e],n.name,{type:n.type})}).then(function(e){return s.sanitizeFileByLevel(e,c.config.sanitization)}).then(function(e){return i.readDataUri(e)}).then(i.decodeDataUri).then(p)}function p(e){return u.svgFile.data=e,function(){if(!u.svgFile)return;var n=c.config.mapping||{},i=c.config.deviceIds||{},t=c.config.device&&c.config.device.id;c.config.mapping={},c.config.deviceIds={},_.forEach(function(e){var n=[],i=/{{\s*([$\w]+?)\s*}}/g,t=i.exec(e);for(;null!==t;)n.push(t[1]),t=i.exec(e);return n}(u.svgFile.data),function(e){c.config.mapping[e]=n[e]?n[e]:null,c.config.deviceIds[e]=i[e]?i[e]:t||null}),function(e,c){if(!e||!c)return;_.forOwn(e,function(e,i){var n=v(e),t=d.generatePaths(n);f.list().then(function(e){var n=_.sortBy(e,function(e){return e.keyPath.length}).reverse();null===c[i]&&(_.forEach(n,function(e){_.last(e.keyPath).toUpperCase()===i.toUpperCase()&&(c[i]=e)}),_.forEach(t,function(e){_.last(e).toUpperCase()===i.toUpperCase()&&(c[i]=d.createProperty(e))}))})})}(c.config.deviceIds,c.config.mapping)}(),e}function v(n){return _.find(u.devices,function(e){return n===e.id})}function h(e,n){u.device&&u.device.id!==n.id||_.assign(u.device,n)}function m(){var e=function(e){return _(e).values().uniq().value().sort(function(e,n){return e-n}).join(",")}(c.config.deviceIds);e!==g&&(g.length&&n.stop(c.$id,"/managedobjects/".concat(g)),e.length&&(n.addListener(c.$id,"/managedobjects/".concat(e),"UPDATE",h),n.start(c.$id,"/managedobjects/".concat(e)),c.$on("$destroy",_.partial(n.stop,c.$id,"/managedobjects/".concat(e)))),g=e)}this.deviceDetail=function(e,n){var i=!_.isEqual(e,n);e&&a.detail(e.id).then(function(e){u.device=e.data;var n=_.union([u.device.id],_.map(_.union(u.device.childAssets.references,u.device.childDevices.references),function(e){return e.managedObject.id}));_.remove(n,_.isUndefined),t.all(_.map(n,function(e){return a.detail(e)})).then(function(e){u.devices=_.map(e,function(e){var n=e.data;return _.assign({},n,{name:o("truncate")(n.name)})}),function(i){_.forOwn(c.config.mapping,function(e,n){(1===u.devices.length||i)&&(c.config.deviceIds[n]=c.config.device.id),c.config.deviceIds[n]=c.config.deviceIds[n]||c.config.device.id})}(i),u.updateComputedProperties(c.config.deviceIds,c.config.mapping)})})},this.onSelectFile=function(n){u.loading=!0,i.upload(n,e).then(function(e){u.binaryFile=e.data,c.config.binaryId=e.data.id,l(n),c.forms.componentForm.$setDirty()}).finally(function(){u.loading=!1})},this.updateComputedProperties=function(e,c){_.isEmpty(e)||_.isEmpty(c)||_.forOwn(e,function(e,n){var i=[c[n]];if(c[n]){var t=v(e);r.attach(t,_.filter(i,function(e){return _.isObjectLike(e)}))}})},this.onMappingChange=function(){u.updateComputedProperties(c.config.deviceIds,c.config.mapping)},this.onDeviceIdsChange=function(){u.updateComputedProperties(c.config.deviceIds,c.config.mapping),m()},u.binaryFile={},c.config.mapping=c.config.mapping||{},c.config.deviceIds=c.config.deviceIds||{},c.config.devices&&delete c.config.devices,c.config.binaryId?(u.loading=!0,c.config.sanitization||(c.config.sanitization="none"),i.detail(c.config.binaryId).then(function(e){u.binaryFile=e.data,l(u.binaryFile),u.loading=!1}).then(function(){var e=[];e.push({file:u.svgFile}),u.files=e})):t.when(),m(),c.$watch("config.device",this.deviceDetail,!0),c.$watch("config.mapping",this.onMappingChange,!0),c.$on("$destroy",function(){_.forEach(c.config.deviceIds,function(e){r.detach(v(e))})})}e.$inject=["$scope","$q","$filter","c8yDevices","c8yBinary","c8yRealtime","c8yComputedProperties","fieldbusPropertyGenerator","c8yPropertiesLibrary","c8ySanitizeHtml"],angular.module("c8y.parts.scadaWidget").controller("ScadaWidgetConfigCtrl",e)}();
1
+ "use strict";!function(){function e(c,t,o,a,i,n,d,r,f,s){var u=this,g="",e={c8y_Global:{}};function p(n){return u.svgFile={name:n.name,size:n.length},n instanceof Blob?i.readDataUri(n).then(i.decodeDataUri).then(l):i.downloadAsDataUri(n).then(i.decodeDataUri).then(function(e){return new File([e],n.name,{type:n.type})}).then(function(e){return s.sanitizeFileByLevel(e,c.config.sanitization)}).then(function(e){return i.readDataUri(e)}).then(i.decodeDataUri).then(l)}function l(e){return u.svgFile.data=e,function(){if(!u.svgFile)return;var n=c.config.mapping||{},i=c.config.deviceIds||{},t=c.config.device&&c.config.device.id;c.config.mapping={},c.config.deviceIds={},_.forEach(function(e){var n=[],i=/{{\s*([$\w]+?)\s*}}/g,t=i.exec(e);for(;null!==t;)n.push(t[1]),t=i.exec(e);return n}(u.svgFile.data),function(e){c.config.mapping[e]=n[e]?n[e]:null,c.config.deviceIds[e]=i[e]?i[e]:t||null}),function(e,c){if(!e||!c)return;_.forOwn(e,function(e,i){var n=v(e),t=r.generatePaths(n);f.list().then(function(e){var n=_.sortBy(e,function(e){return e.keyPath.length}).reverse();null===c[i]&&(_.forEach(n,function(e){_.last(e.keyPath).toUpperCase()===i.toUpperCase()&&(c[i]=e)}),_.forEach(t,function(e){_.last(e).toUpperCase()===i.toUpperCase()&&(c[i]=r.createProperty(e))}))})})}(c.config.deviceIds,c.config.mapping)}(),e}function v(n){return _.find(u.devices,function(e){return n===e.id})}function h(e,n){u.device&&u.device.id!==n.id||_.assign(u.device,n)}function m(){var e=function(e){return _(e).values().uniq().value().sort(function(e,n){return e-n}).join(",")}(c.config.deviceIds);e!==g&&(g.length&&n.stop(c.$id,"/managedobjects/".concat(g)),e.length&&(n.addListener(c.$id,"/managedobjects/".concat(e),"UPDATE",h),n.start(c.$id,"/managedobjects/".concat(e)),c.$on("$destroy",_.partial(n.stop,c.$id,"/managedobjects/".concat(e)))),g=e)}this.deviceDetail=function(e,n){var i;e&&(i=!n||!(e.name===n.name&&e.id===n.id),a.detail(e.id).then(function(e){u.device=e.data;var n=_.union([u.device.id],_.map(_.union(u.device.childAssets.references,u.device.childDevices.references),function(e){return e.managedObject.id}));_.remove(n,_.isUndefined),t.all(_.map(n,function(e){return a.detail(e)})).then(function(e){u.devices=_.map(e,function(e){var n=e.data;return _.assign({},n,{name:o("truncate")(n.name)})}),function(i){_.forOwn(c.config.mapping,function(e,n){(1===u.devices.length||i)&&(c.config.deviceIds[n]=c.config.device.id),c.config.deviceIds[n]=c.config.deviceIds[n]||c.config.device.id})}(i),u.updateComputedProperties(c.config.deviceIds,c.config.mapping)})}))},this.onSelectFile=function(n){u.loading=!0,i.upload(n,e).then(function(e){u.binaryFile=e.data,c.config.binaryId=e.data.id,p(n),c.forms.componentForm.$setDirty()}).finally(function(){u.loading=!1})},this.updateComputedProperties=function(e,c){_.isEmpty(e)||_.isEmpty(c)||_.forOwn(e,function(e,n){var i=[c[n]];if(c[n]){var t=v(e);d.attach(t,_.filter(i,function(e){return _.isObjectLike(e)}))}})},this.onMappingChange=function(){u.updateComputedProperties(c.config.deviceIds,c.config.mapping)},this.onDeviceIdsChange=function(){u.updateComputedProperties(c.config.deviceIds,c.config.mapping),m()},u.binaryFile={},c.config.mapping=c.config.mapping||{},c.config.deviceIds=c.config.deviceIds||{},c.config.devices&&delete c.config.devices,c.config.binaryId?(u.loading=!0,c.config.sanitization||(c.config.sanitization="none"),i.detail(c.config.binaryId).then(function(e){u.binaryFile=e.data,p(u.binaryFile),u.loading=!1}).then(function(){var e=[];e.push({file:u.svgFile}),u.files=e})):t.when(),m(),c.$watch("config.device",this.deviceDetail,!0),c.$watch("config.mapping",this.onMappingChange,!0),c.$on("$destroy",function(){_.forEach(c.config.deviceIds,function(e){d.detach(v(e))})})}e.$inject=["$scope","$q","$filter","c8yDevices","c8yBinary","c8yRealtime","c8yComputedProperties","fieldbusPropertyGenerator","c8yPropertiesLibrary","c8ySanitizeHtml"],angular.module("c8y.parts.scadaWidget").controller("ScadaWidgetConfigCtrl",e)}();