@c8y/ng1-modules 1018.0.127 → 1018.0.134

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 _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,p=[],s=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(p.push(n.value),p.length!==t);s=!0);}catch(e){c=!0,i=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return p}}function _toArray(e){return _arrayWithHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(){function e(e,s,c,u,h,f,y,m,d){return new function r(e){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},t=n.tenantId,l=this,a="x-show-if-any-available",p="title";function i(e){var t=_.cloneDeep(e),r=u.when(t),n=_.find(l.ENTITIES.values(),{staticSchemaPath:l.propertiesCfg.static.path});return n&&(r=y.list().then(function(e){var t={appliesTo:{}};return t.appliesTo[n.value]=!0,_.filter(e,t)}).then(function(e){return _.map(e,function(e){return _.get(e,"c8y_JsonSchema")})}).then(function(e){return _.forEach(e,function(e){n===l.ENTITIES.TENANTS?_.merge(t.properties.customProperties.properties,e.properties):_.merge(t.properties,e.properties)}),t})),r}function o(e,t,r,n,i){if(r===p){var o=_.has(i,"type"),a=!_.isUndefined(e);if(o&&a)return e}}this.ENTITIES=h.createEnum([{name:"MANAGED_OBJECTS",value:"MANAGED_OBJECTS",staticSchemaPath:h.dataFilePath("properties/managed-objects.json")},{name:"MEASUREMENTS",value:"MEASUREMENTS",staticSchemaPath:h.dataFilePath("properties/measurements.json")},{name:"ALARMS",value:"ALARMS",staticSchemaPath:h.dataFilePath("properties/alarms.json")},{name:"EVENTS",value:"EVENTS",staticSchemaPath:h.dataFilePath("properties/events.json")},{name:"TENANTS",value:"TENANTS",staticSchemaPath:h.dataFilePath("properties/tenants.json")}]),this.properties={},this.propertiesCfg={static:{path:e}},this.list=function(){return l.loadProperties().then(_.bind(l.getSimplifiedProperties,l))},this.getProperties=function(){return l.loadProperties().then(_.bind(l.getFullProperties,l))},this.getTenantDetails=function(){return t?d.detail(t).then(h.getResData):d.current()},this.removeKeysDependingOnAppsAvailability=function(r){return function e(t){for(var r=Object.keys(t),n=!1,i=0;i<r.length;i++){var o=r[i];_typeof(t[o])===_typeof({})&&null!==t[o]&&(n=o===a||n||e(t[o]))}return n}(r)?l.getTenantDetails().then(function(e){var t=_.flatMap(e.applications.references,"application");return function t(r,n){var e=Object.keys(r);return _.forEach(e,function(e){void 0===r[e][a]||_.some(r[e][a],function(e){return f.isAppOnTheList(n,e)})?_typeof(r[e])===_typeof({})&&null!==r[e]&&e!==a&&t(r[e],n):delete r[e]}),r}(r,t)}):r},this.loadProperties=_.throttle(function(){return l.loadStaticPropertiesSchema().then(i).then(l.removeKeysDependingOnAppsAvailability).then(_.bind(l.getPropertiesFromSchema,l)).then(_.bind(l.addProperties,l))},1e3,{leading:!0,trailing:!1}),this.loadStaticPropertiesSchema=function(){var e=l.propertiesCfg.static.path;return l.loadStaticPropertiesSchemaFromMemory()||s.get(e).then(h.getResData)},this.pathToKey=function(){var e=l.propertiesCfg.static.path;return _.last(e.split("/")).replace(/\.json$/,"")},this.loadStaticPropertiesSchemaFromMemory=function(){var e=l.pathToKey(),t=(window.c8y&&window.c8y.collections&&window.c8y.collections.properties||{})[e];return t&&u.when(t)},this.getPropertiesFromSchema=function(e,t,r){var a=3<arguments.length&&void 0!==arguments[3]?arguments[3]:["properties"],p=4<arguments.length&&void 0!==arguments[4]?arguments[4]:[],s=5<arguments.length&&void 0!==arguments[5]?arguments[5]:[],c=t||e.id||"c8yDefaultSchema",n=_.cloneDeep(r||{type:"object",properties:{}}),u=l.setObjValue(n,a,{});return _.has(e,"properties")&&_.forEach(e.properties,function(e,t){var r=_.cloneDeep(u),n=_.flattenDeep([a,t,"properties"]),i=_.flattenDeep([p,t]);r=l.setObjValue(r,a,_.cloneDeep(e),t);var o=l.getNewPropertyObj(c,i,r,e);s.push(o),l.getPropertiesFromSchema(e,c,r,n,i,s)}),s},this.getNewPropertyObj=function(e,t,r,n){var i=t.join("."),o={id:"".concat(e,"!!").concat(i),keyPath:t,type:n.type,printFormat:n.printFormat,label:l.getDefaultPropertyLabel(t,n),schema:r};return n.config&&(o.configSchema=n.config),n.computed&&(o.computed=n.computed),o},this.getFragmentName=function(e){var t=e[e.length-1],r=/_\d{9,}$/;return r.test(t)&&(t=t.replace(r,"")),t},this.getDefaultPropertyLabel=function(e,t){var r=t.title;return r||(r=(r=(r=l.getFragmentName(e)).replace(/^c8y_/i,"").replace(/([A-Z][a-z])/g," $1").replace(/([^0-9])([0-9])/g,"$1 $2").replace("_"," ").replace(/^\s*/,"").replace(/\s*$/,"")).charAt(0).toUpperCase()+r.slice(1)),r},this.setObjValue=function(e,t,r,n){var i,o=e,a=o;for(i=0;i<t.length-1;i++)a[t[i]]||(a[t[i]]={}),a=a[t[i]];return n?a[t[i]][n]=r:a[t[i]]=r,o},this.addProperties=function(e){_.forEach(e,function(e){l.properties[e.id]=e})},this.getSimplifiedProperties=function(){return _.map(l.properties,_.bind(l.simplifyProperty,l))},this.simplifyProperty=function(e){return _.pick(e,["id","keyPath","type","label","configSchema","computed","printFormat"])},this.getFullProperties=function(){return _.cloneDeep(l.properties)},this.getSchema=function(e){return l.loadProperties().then(_.bind(l.getSchemaForProperties,l,e)).catch(c.error)},this.getSchemaForProperties=function(r){var n={type:"object",properties:{}};return _.forEach(r,function(e){l.isCustomProperty(e)&&l.addCustomProperty(e),function(e,t){_.mergeWith(e.properties,l.properties[t.id].schema.properties,o)}(n,e);var t=l.findInSchema(n,e);t.id=e.id,t.title=e.label||l.properties[e.id].label,function(e,t,r){l.isComplexProperty(t)&&0<l.getChildren(t,r).length&&(e.properties={})}(t,e,r),function(e){_.forEach(_.get(e,"properties"),function(e){_.set(e,p,m.getString(e.title))})}(t),function(e,t){var r=_.last(t.id.split("!!")),n=_.last(t.keyPath);t.computed&&t.configSchema&&(r!==n&&(e.properties[n]=e.properties[r],delete e.properties[r]),t.config&&4===t.config.resultType&&(e.properties[n].type="object",e.properties[n].properties={value:{title:m.getString("Value"),type:"number"},unit:{title:m.getString("Unit"),type:"string"}}),t.config&&1===t.config.resultType&&(e.properties[n].type="number"))}(n,e)}),function(e){!function r(e,n){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:[];e.properties&&_.forEach(e.properties,function(e,t){n(e,t,[].concat(_toConsumableArray(i),[t])),r(e,n,[].concat(_toConsumableArray(i),[t]))})}(e,function(e,t,r){var n=_.isUndefined(e.title);n&&(e.title=l.getDefaultPropertyLabel(r,e))})}(n),n},this.findInSchema=function(e,t){var r=t.keyPath;return t.computed&&(r=[l.getFragmentName(r)]),l.findInSchemaByKeyPath(e,r)},this.findInSchemaById=function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:[];return _.isObjectLike(e)&&_.forOwn(e,function(e){_.isObjectLike(e)&&e.id===t?r.push(e):l.findInSchemaById(e,t,r)}),r},this.findInSchemaByKeyPath=function(e,t){if(!t.length)return e;if(e.properties){var r=_toArray(t),n=r[0],i=r.slice(1);if(_.has(e.properties,n))return this.findInSchemaByKeyPath(e.properties[n],i)}},this.getForm=function(e,t){return l.loadProperties().then(_.bind(l.getFormForProperties,l,e,t))},this.getFormForProperties=function(e,t){var r=function(e){return _(e).map(function(e){if(e.computed)return e;var t=e.id.match(/^(.+)!!/),r=_slicedToArray(t,2),n=r[1],i="".concat(n,"!!").concat(e.keyPath[0]),o=l.properties[i];return _.pick(o,["id","keyPath"])}).uniqBy("keyPath").value()}(e),n=l.getSchemaForProperties(e);return r.map(function(e){return function(e,t,r){var n=l.findInSchemaByKeyPath(r,e.keyPath),i={key:ObjectPath.stringify(l.properties[e.id].keyPath),title:n.title||e.label||l.properties[e.id].label};return i=function(e,t){return t.computed&&t.configSchema&&(e.key=_.last(t.keyPath)),e}(i,e),_.assign(i,t),i}(e,t,n)})},this.isComplexProperty=function(e){return"object"===e.type},this.isCustomProperty=function(e){return"c8yCustom"===e.id.split("!!")[0]},this.getChildren=function(t,e){return _.filter(e||l.properties,function(e){return t.id!==e.id&&_.isEqual(_.take(e.keyPath,t.keyPath.length),t.keyPath)})},this.changeActiveProperty=function(e,t){return _.map(e,function(e){return _.assign(e,{__active:t})})},this.removeDuplication=function(e){var t,r=e;return _.map(e,function(e){l.isComplexProperty(e)&&(t=_.map(l.getChildren(e),"id"),r=_.reject(r,function(e){return _.includes(t,e.id)}))}),r},this.getParent=function(t){return _.filter(l.properties,function(e){return t.keyPath.length>e.keyPath.length&&_.isEqual(_.take(t.keyPath,e.keyPath.length),e.keyPath)})},this.addCustomProperty=function(e){l.properties[e.id]||(l.properties[e.id]={}),_.merge(l.properties[e.id],e)},this.another=function(e,t){return new r(e,void 0===t?n:t)},this.paths=_.reduce(this.ENTITIES.values(),function(e,t){return e[_.startCase(_.camelCase(t.value)).replace(" ","")]=t.staticSchemaPath,e},{})}(h.dataFilePath("properties/managed-objects.json"))}e.$inject=["$filter","$http","$log","$q","c8yBase","c8yApplication","c8yJsonSchemas","gettextCatalog","c8yTenant"],angular.module("c8y.ui").provider("c8yPropertiesLibrary",function(){return{$get:e}})}();
1
+ "use strict";function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,p=[],s=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(p.push(n.value),p.length!==t);s=!0);}catch(e){c=!0,i=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return p}}function _toArray(e){return _arrayWithHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(){function e(e,s,c,u,h,f,y,m,d){return new function r(e){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},t=n.tenantId,l=this,a="x-show-if-any-available",p="title";function i(e){var t=_.cloneDeep(e),r=u.when(t),n=_.find(l.ENTITIES.values(),{staticSchemaPath:l.propertiesCfg.static.path});return n&&(r=y.list().then(function(e){var t={appliesTo:{}};return t.appliesTo[n.value]=!0,_.filter(e,t)}).then(function(e){return _.map(e,function(e){return _.get(e,"c8y_JsonSchema")})}).then(function(e){return _.forEach(e,function(e){n===l.ENTITIES.TENANTS?_.merge(t.properties.customProperties.properties,e.properties):_.merge(t.properties,e.properties)}),t})),r}function o(e,t,r,n,i){if(r===p){var o=_.has(i,"type"),a=!_.isUndefined(e);if(o&&a)return e}}this.ENTITIES=h.createEnum([{name:"MANAGED_OBJECTS",value:"MANAGED_OBJECTS",staticSchemaPath:h.dataFilePath("properties/managed-objects.json")},{name:"MEASUREMENTS",value:"MEASUREMENTS",staticSchemaPath:h.dataFilePath("properties/measurements.json")},{name:"ALARMS",value:"ALARMS",staticSchemaPath:h.dataFilePath("properties/alarms.json")},{name:"EVENTS",value:"EVENTS",staticSchemaPath:h.dataFilePath("properties/events.json")},{name:"TENANTS",value:"TENANTS",staticSchemaPath:h.dataFilePath("properties/tenants.json")}]),this.properties={},this.propertiesCfg={static:{path:e}},this.list=function(){return l.loadProperties().then(_.bind(l.getSimplifiedProperties,l))},this.getProperties=function(){return l.loadProperties().then(_.bind(l.getFullProperties,l))},this.getTenantDetails=function(){return t?d.detail(t).then(h.getResData):d.current()},this.removeKeysDependingOnAppsAvailability=function(r){return function e(t){for(var r=Object.keys(t),n=!1,i=0;i<r.length;i++){var o=r[i];_typeof(t[o])===_typeof({})&&null!==t[o]&&(n=o===a||n||e(t[o]))}return n}(r)?l.getTenantDetails().then(function(e){var t=_.flatMap(e.applications.references,"application");return function t(r,n){var e=Object.keys(r);return _.forEach(e,function(e){void 0===r[e][a]||_.some(r[e][a],function(e){return f.isAppOnTheList(n,e)})?_typeof(r[e])===_typeof({})&&null!==r[e]&&e!==a&&t(r[e],n):delete r[e]}),r}(r,t)}):r},this.loadProperties=_.throttle(function(){return l.loadStaticPropertiesSchema().then(i).then(l.removeKeysDependingOnAppsAvailability).then(_.bind(l.getPropertiesFromSchema,l)).then(_.bind(l.addProperties,l))},1e3,{leading:!0,trailing:!1}),this.loadStaticPropertiesSchema=function(){var e=l.propertiesCfg.static.path;return l.loadStaticPropertiesSchemaFromMemory()||s.get(e).then(h.getResData)},this.pathToKey=function(){var e=l.propertiesCfg.static.path;return _.last(e.split("/")).replace(/\.json$/,"")},this.loadStaticPropertiesSchemaFromMemory=function(){var e=l.pathToKey(),t=(window.c8y&&window.c8y.collections&&window.c8y.collections.properties||{})[e];return t&&u.when(t)},this.getPropertiesFromSchema=function(e,t,r){var a=3<arguments.length&&void 0!==arguments[3]?arguments[3]:["properties"],p=4<arguments.length&&void 0!==arguments[4]?arguments[4]:[],s=5<arguments.length&&void 0!==arguments[5]?arguments[5]:[],c=t||e.id||"c8yDefaultSchema",n=_.cloneDeep(r||{type:"object",properties:{}}),u=l.setObjValue(n,a,{});return _.has(e,"properties")&&_.forEach(e.properties,function(e,t){var r=_.cloneDeep(u),n=_.flattenDeep([a,t,"properties"]),i=_.flattenDeep([p,t]);r=l.setObjValue(r,a,_.cloneDeep(e),t);var o=l.getNewPropertyObj(c,i,r,e);s.push(o),l.getPropertiesFromSchema(e,c,r,n,i,s)}),s},this.getNewPropertyObj=function(e,t,r,n){var i=t.join("."),o={id:"".concat(e,"!!").concat(i),keyPath:t,type:n.type,printFormat:n.printFormat,label:l.getDefaultPropertyLabel(t,n),schema:r};return n.config&&(o.configSchema=n.config),n.computed&&(o.computed=n.computed),o},this.getFragmentName=function(e){var t=e[e.length-1],r=/_\d{9,}$/;return r.test(t)&&(t=t.replace(r,"")),t},this.getDefaultPropertyLabel=function(e,t){var r=t.title;return r||(r=(r=(r=l.getFragmentName(e)).replace(/^c8y_/i,"").replace(/([A-Z][a-z])/g," $1").replace(/([^0-9])([0-9])/g,"$1 $2").replace("_"," ").replace(/^\s*/,"").replace(/\s*$/,"")).charAt(0).toUpperCase()+r.slice(1)),r},this.setObjValue=function(e,t,r,n){var i,o=e,a=o;for(i=0;i<t.length-1;i++)a[t[i]]||(a[t[i]]={}),a=a[t[i]];return n?a[t[i]][n]=r:a[t[i]]=r,o},this.addProperties=function(e){_.forEach(e,function(e){l.properties[e.id]=e})},this.getSimplifiedProperties=function(){return _.map(l.properties,_.bind(l.simplifyProperty,l))},this.simplifyProperty=function(e){return _.pick(e,["id","keyPath","type","label","configSchema","computed","printFormat"])},this.getFullProperties=function(){return _.cloneDeep(l.properties)},this.getSchema=function(e){return l.loadProperties().then(_.bind(l.getSchemaForProperties,l,e)).catch(c.error)},this.getSchemaForProperties=function(r){var n={type:"object",properties:{}};return _.forEach(r,function(e){l.isCustomProperty(e)&&l.addCustomProperty(e),function(e,t){_.mergeWith(e.properties,l.properties[t.id].schema.properties,o)}(n,e);var t=l.findInSchema(n,e);t&&(t.id=e.id,t.title=e.label||l.properties[e.id].label,function(e,t,r){l.isComplexProperty(t)&&0<l.getChildren(t,r).length&&(e.properties={})}(t,e,r),function(e){_.forEach(_.get(e,"properties"),function(e){_.set(e,p,m.getString(e.title))})}(t),function(e,t){var r=_.last(t.id.split("!!")),n=_.last(t.keyPath);t.computed&&t.configSchema&&(r!==n&&(e.properties[n]=e.properties[r],delete e.properties[r]),t.config&&4===t.config.resultType&&(e.properties[n].type="object",e.properties[n].properties={value:{title:m.getString("Value"),type:"number"},unit:{title:m.getString("Unit"),type:"string"}}),t.config&&1===t.config.resultType&&(e.properties[n].type="number"))}(n,e))}),function(e){!function r(e,n){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:[];e.properties&&_.forEach(e.properties,function(e,t){n(e,t,[].concat(_toConsumableArray(i),[t])),r(e,n,[].concat(_toConsumableArray(i),[t]))})}(e,function(e,t,r){var n=_.isUndefined(e.title);n&&(e.title=l.getDefaultPropertyLabel(r,e))})}(n),n},this.findInSchema=function(e,t){var r=t.keyPath;return t.computed&&(r=[l.getFragmentName(r)]),l.findInSchemaByKeyPath(e,r)},this.findInSchemaById=function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:[];return _.isObjectLike(e)&&_.forOwn(e,function(e){_.isObjectLike(e)&&e.id===t?r.push(e):l.findInSchemaById(e,t,r)}),r},this.findInSchemaByKeyPath=function(e,t){if(!t.length)return e;if(e.properties){var r=_toArray(t),n=r[0],i=r.slice(1);if(_.has(e.properties,n))return this.findInSchemaByKeyPath(e.properties[n],i)}},this.getForm=function(e,t){return l.loadProperties().then(_.bind(l.getFormForProperties,l,e,t))},this.getFormForProperties=function(e,t){var r=function(e){return _(e).map(function(e){if(e.computed)return e;var t=e.id.match(/^(.+)!!/),r=_slicedToArray(t,2),n=r[1],i="".concat(n,"!!").concat(e.keyPath[0]),o=l.properties[i];return _.pick(o,["id","keyPath"])}).uniqBy("keyPath").value()}(e),n=l.getSchemaForProperties(e);return r.map(function(e){return function(e,t,r){var n=l.findInSchemaByKeyPath(r,e.keyPath),i={key:ObjectPath.stringify(l.properties[e.id].keyPath),title:n.title||e.label||l.properties[e.id].label};return i=function(e,t){return t.computed&&t.configSchema&&(e.key=_.last(t.keyPath)),e}(i,e),_.assign(i,t),i}(e,t,n)})},this.isComplexProperty=function(e){return"object"===e.type},this.isCustomProperty=function(e){return"c8yCustom"===e.id.split("!!")[0]},this.getChildren=function(t,e){return _.filter(e||l.properties,function(e){return t.id!==e.id&&_.isEqual(_.take(e.keyPath,t.keyPath.length),t.keyPath)})},this.changeActiveProperty=function(e,t){return _.map(e,function(e){return _.assign(e,{__active:t})})},this.removeDuplication=function(e){var t,r=e;return _.map(e,function(e){l.isComplexProperty(e)&&(t=_.map(l.getChildren(e),"id"),r=_.reject(r,function(e){return _.includes(t,e.id)}))}),r},this.getParent=function(t){return _.filter(l.properties,function(e){return t.keyPath.length>e.keyPath.length&&_.isEqual(_.take(t.keyPath,e.keyPath.length),e.keyPath)})},this.addCustomProperty=function(e){l.properties[e.id]||(l.properties[e.id]={}),_.merge(l.properties[e.id],e)},this.another=function(e,t){return new r(e,void 0===t?n:t)},this.paths=_.reduce(this.ENTITIES.values(),function(e,t){return e[_.startCase(_.camelCase(t.value)).replace(" ","")]=t.staticSchemaPath,e},{})}(h.dataFilePath("properties/managed-objects.json"))}e.$inject=["$filter","$http","$log","$q","c8yBase","c8yApplication","c8yJsonSchemas","gettextCatalog","c8yTenant"],angular.module("c8y.ui").provider("c8yPropertiesLibrary",function(){return{$get:e}})}();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c8y/ng1-modules",
3
- "version": "1018.0.127",
3
+ "version": "1018.0.134",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Cumulocity",
6
6
  "description": "AngularJS modules for Cumulocity IoT applications.",