Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular-json-edit

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-json-edit - npm Package Compare versions

Comparing version 0.4.1 to 0.4.3

2

bower.json
{
"name": "angular-json-edit",
"version": "0.4.1",
"version": "0.4.3",
"homepage": "https://github.com/Rleahy22/angularJsonEditor",

@@ -5,0 +5,0 @@ "authors": [

@@ -31,4 +31,3 @@ (function() {

scope: {
config: '=',
showModal: '='
config: '='
}

@@ -53,4 +52,3 @@ };

scope.nest = '<button class="json-delete json-button" ng-click="deleteProperty(key, parent)" ng-mouseover="highlight(key, parent)" ng-mouseleave="unHighlight(key, parent)">&times;</button>' +
'<div class="label-wrapper" ng-class="{\'padded-row\': !isNested(value)}">' +
scope.nest = '<div class="label-wrapper" ng-class="{\'padded-row\': !isNested(value)}">' +
'<span ng-show="isNested(value) && isCollapsed(key, parent)" class="json-arrow" ng-click="expand(key, parent)">&#8658;</span>' +

@@ -66,2 +64,3 @@ '<span ng-show="isNested(value) && !isCollapsed(key, parent)" class="json-arrow" ng-click="collapse(key, parent)">&#8659;</span>' +

'</div>' +
'<button class="json-delete json-button" type="button" ng-click="deleteProperty(key, parent)" ng-mouseover="highlight(key, parent)" ng-mouseleave="unHighlight(key, parent)">&times;</button>' +
'</div>' +

@@ -205,2 +204,6 @@ '<div ng-if="isNested(value)" ng-show="!isCollapsed(key, parent)" class="nested-json">' +

'<input type="{{getInputType()}}" class="value-field" placeholder="value" name="newPropertyValue" ng-model="newProperty.value" ng-show="showValueField()">' +
'<select name="newPropertyType" ng-model="newProperty.value" ng-show="newProperty.type === \'boolean\'">' +
'<option value="true">true</option>' +
'<option value="">false</option>' +
'</select>' +
'<button class="json-button" ng-click="addProperty()" ng-show="newProperty.type">&#43;</button>' +

@@ -231,3 +234,3 @@ '</div>' +

function addProperty() {
if (scope.isParentArray()) {
if (scope.isParentArray() && scope.newProperty) {
switch (scope.newProperty.type) {

@@ -250,3 +253,3 @@ case 'array':

}
} else {
} else if (scope.newProperty) {
switch (scope.newProperty.type) {

@@ -290,4 +293,3 @@ case 'array':

return (scope.newProperty.type === 'string' ||
scope.newProperty.type === 'number' ||
scope.newProperty.type === 'boolean');
scope.newProperty.type === 'number');
}

@@ -294,0 +296,0 @@ }

@@ -1,1 +0,1 @@

!function(){"use strict";angular.module("angular-json-edit",[])}(),function(){"use strict";function e(){function e(e){function n(n,t){var r={};r[n]=t,e.collapsed.push(r)}function t(n,t){e.isArray(t)?t.splice(n,1):delete t[n]}function r(n,t){var r={};r[n]=t,e.collapsed.forEach(function(t,o){angular.equals(t[n],r[n])&&e.collapsed.splice(o,1)})}function o(e){return"number"==typeof e?"number":"text"}function a(n,t){var r={};r[n]=t,e.highlighted.push(r)}function s(e){return Array.isArray(e)}function i(n,t){var r={},o=!1;return r[n]=t,e.collapsed.forEach(function(e){angular.equals(e[n],r[n])&&(o=!0)}),o}function l(n,t){var r={},o=!1;return r[n]=t,e.highlighted.forEach(function(e){angular.equals(e[n],r[n])&&(o=!0)}),o}function p(e){return"object"==typeof e?!0:!1}function c(n,t){var r={};r[n]=t,e.highlighted.forEach(function(t,o){angular.equals(t[n],r[n])&&e.highlighted.splice(o,1)})}e.collapse=n,e.collapsed=[],e.deleteProperty=t,e.expand=r,e.getInputType=o,e.highlight=a,e.highlighted=[],e.isArray=s,e.isCollapsed=i,e.isHighlighted=l,e.isNested=p,e.unHighlight=c,e.nest='<button class="json-delete json-button" ng-click="deleteProperty(key, parent)" ng-mouseover="highlight(key, parent)" ng-mouseleave="unHighlight(key, parent)">&times;</button><div class="label-wrapper" ng-class="{\'padded-row\': !isNested(value)}"><span ng-show="isNested(value) && isCollapsed(key, parent)" class="json-arrow" ng-click="expand(key, parent)">&#8658;</span><span ng-show="isNested(value) && !isCollapsed(key, parent)" class="json-arrow" ng-click="collapse(key, parent)">&#8659;</span><label class="json-form-element"><span class="key-span" ng-hide="isArray(parent)">{{key}}:</span><span ng-show="isNested(value) && isArray(value)"> [</span><span ng-show="isNested(value) && !isArray(value)"> {</span></label><div ng-if="!isNested(value)" class="json-input-div"><input type="{{getInputType(value)}}" name="{{key}}" ng-model="parent[key]" class="json-input" required></div></div><div ng-if="isNested(value)" ng-show="!isCollapsed(key, parent)" class="nested-json"><div ng-repeat="(key, value) in parent[key] track by key" ng-init="parent = child; child = value" class="json-form-row" compile="nest" ng-class="{\'json-highlight\' : isHighlighted(key, parent)}"></div><div json-editor-add-property class="json-new-property padded-row" object="value" newProperty="{}" class="" ng-show="isNested(value)"></div></div><label ng-show="isNested(value)" class="json-form-element padded-row">{{isArray(value) ? \']\' : \'}\'}}</label>'}var n='<div class="json-container"><div class="json-form-div"><form name="jsonEditorForm" ng-submit="" role="form"><div ng-repeat="(key, value) in config track by key" ng-init="parent = config; child = value" class="json-form" compile="nest" ng-class="{\'json-highlight\' : isHighlighted(key, parent)}"></div><div json-editor-add-property class="json-new-property" object="config" newProperty="{}"></div></form></div></div>',t={link:e,template:n,restrict:"EA",scope:{config:"=",showModal:"="}};return t}function n(e){return function(n,t,r){n.$watch(function(e){return e.$eval(r.compile)},function(r){t.html(r),e(t.contents())(n)})}}angular.module("angular-json-edit").directive("jsonEditor",e).directive("compile",n),n.$inject=["$compile"]}(),function(){"use strict";function e(){function e(e){function n(){if(e.isParentArray())switch(e.newProperty.type){case"array":e.object.push([]);break;case"object":e.object.push({});break;case"string":e.object.push(e.newProperty.value||"");break;case"number":e.object.push(parseInt(e.newProperty.value)||0);break;case"boolean":e.object.push(Boolean(e.newProperty.value))}else switch(e.newProperty.type){case"array":e.object[e.newProperty.name]=[];break;case"object":e.object[e.newProperty.name]={};break;case"string":e.object[e.newProperty.name]=e.newProperty.value||"";break;case"number":e.object[e.newProperty.name]=parseInt(e.newProperty.value)||0;break;case"boolean":e.object[e.newProperty.name]=Boolean(e.newProperty.value)}e.newProperty={},e.showForm=!1}function t(){return e.newProperty&&"number"===e.newProperty.type?"number":"text"}function r(){return Array.isArray(e.object)}function o(){return e.newProperty?"string"===e.newProperty.type||"number"===e.newProperty.type||"boolean"===e.newProperty.type:void 0}e.addProperty=n,e.getInputType=t,e.isParentArray=r,e.showValueField=o}var n='<div class="new-property-div padded-row" ng-show="showForm"><input type="text" placeholder="key" name="newPropertyName" ng-model="newProperty.name" ng-show="!isParentArray()"><select name="newPropertyType" ng-model="newProperty.type"><option value="" ng-disabled="true">Type</option><option value="array">Array</option><option value="object">Object</option><option value="string">String</option><option value="number">Number</option><option value="boolean">Boolean</option></select><input type="{{getInputType()}}" class="value-field" placeholder="value" name="newPropertyValue" ng-model="newProperty.value" ng-show="showValueField()"><button class="json-button" ng-click="addProperty()" ng-show="newProperty.type">&#43;</button></div><div class="new-property-button-div" ng-show="!showForm"><button class="json-button padded-row" ng-click="showForm = true">&#43;</button></div>',t={link:e,template:n,restrict:"EA",scope:{object:"=",newProperty:"="}};return t}angular.module("angular-json-edit").directive("jsonEditorAddProperty",e)}();
!function(){"use strict";angular.module("angular-json-edit",[])}(),function(){"use strict";function e(){function e(e){function n(n,t){var r={};r[n]=t,e.collapsed.push(r)}function t(n,t){e.isArray(t)?t.splice(n,1):delete t[n]}function r(n,t){var r={};r[n]=t,e.collapsed.forEach(function(t,o){angular.equals(t[n],r[n])&&e.collapsed.splice(o,1)})}function o(e){return"number"==typeof e?"number":"text"}function a(n,t){var r={};r[n]=t,e.highlighted.push(r)}function s(e){return Array.isArray(e)}function i(n,t){var r={},o=!1;return r[n]=t,e.collapsed.forEach(function(e){angular.equals(e[n],r[n])&&(o=!0)}),o}function l(n,t){var r={},o=!1;return r[n]=t,e.highlighted.forEach(function(e){angular.equals(e[n],r[n])&&(o=!0)}),o}function p(e){return"object"==typeof e?!0:!1}function u(n,t){var r={};r[n]=t,e.highlighted.forEach(function(t,o){angular.equals(t[n],r[n])&&e.highlighted.splice(o,1)})}e.collapse=n,e.collapsed=[],e.deleteProperty=t,e.expand=r,e.getInputType=o,e.highlight=a,e.highlighted=[],e.isArray=s,e.isCollapsed=i,e.isHighlighted=l,e.isNested=p,e.unHighlight=u,e.nest='<div class="label-wrapper" ng-class="{\'padded-row\': !isNested(value)}"><span ng-show="isNested(value) && isCollapsed(key, parent)" class="json-arrow" ng-click="expand(key, parent)">&#8658;</span><span ng-show="isNested(value) && !isCollapsed(key, parent)" class="json-arrow" ng-click="collapse(key, parent)">&#8659;</span><label class="json-form-element"><span class="key-span" ng-hide="isArray(parent)">{{key}}:</span><span ng-show="isNested(value) && isArray(value)"> [</span><span ng-show="isNested(value) && !isArray(value)"> {</span></label><div ng-if="!isNested(value)" class="json-input-div"><input type="{{getInputType(value)}}" name="{{key}}" ng-model="parent[key]" class="json-input" required></div><button class="json-delete json-button" type="button" ng-click="deleteProperty(key, parent)" ng-mouseover="highlight(key, parent)" ng-mouseleave="unHighlight(key, parent)">&times;</button></div><div ng-if="isNested(value)" ng-show="!isCollapsed(key, parent)" class="nested-json"><div ng-repeat="(key, value) in parent[key] track by key" ng-init="parent = child; child = value" class="json-form-row" compile="nest" ng-class="{\'json-highlight\' : isHighlighted(key, parent)}"></div><div json-editor-add-property class="json-new-property padded-row" object="value" newProperty="{}" class="" ng-show="isNested(value)"></div></div><label ng-show="isNested(value)" class="json-form-element padded-row">{{isArray(value) ? \']\' : \'}\'}}</label>'}var n='<div class="json-container"><div class="json-form-div"><form name="jsonEditorForm" ng-submit="" role="form"><div ng-repeat="(key, value) in config track by key" ng-init="parent = config; child = value" class="json-form" compile="nest" ng-class="{\'json-highlight\' : isHighlighted(key, parent)}"></div><div json-editor-add-property class="json-new-property" object="config" newProperty="{}"></div></form></div></div>',t={link:e,template:n,restrict:"EA",scope:{config:"="}};return t}function n(e){return function(n,t,r){n.$watch(function(e){return e.$eval(r.compile)},function(r){t.html(r),e(t.contents())(n)})}}angular.module("angular-json-edit").directive("jsonEditor",e).directive("compile",n),n.$inject=["$compile"]}(),function(){"use strict";function e(){function e(e){function n(){if(e.isParentArray()&&e.newProperty)switch(e.newProperty.type){case"array":e.object.push([]);break;case"object":e.object.push({});break;case"string":e.object.push(e.newProperty.value||"");break;case"number":e.object.push(parseInt(e.newProperty.value)||0);break;case"boolean":e.object.push(Boolean(e.newProperty.value))}else if(e.newProperty)switch(e.newProperty.type){case"array":e.object[e.newProperty.name]=[];break;case"object":e.object[e.newProperty.name]={};break;case"string":e.object[e.newProperty.name]=e.newProperty.value||"";break;case"number":e.object[e.newProperty.name]=parseInt(e.newProperty.value)||0;break;case"boolean":e.object[e.newProperty.name]=Boolean(e.newProperty.value)}e.newProperty={},e.showForm=!1}function t(){return e.newProperty&&"number"===e.newProperty.type?"number":"text"}function r(){return Array.isArray(e.object)}function o(){return e.newProperty?"string"===e.newProperty.type||"number"===e.newProperty.type:void 0}e.addProperty=n,e.getInputType=t,e.isParentArray=r,e.showValueField=o}var n='<div class="new-property-div padded-row" ng-show="showForm"><input type="text" placeholder="key" name="newPropertyName" ng-model="newProperty.name" ng-show="!isParentArray()"><select name="newPropertyType" ng-model="newProperty.type"><option value="" ng-disabled="true">Type</option><option value="array">Array</option><option value="object">Object</option><option value="string">String</option><option value="number">Number</option><option value="boolean">Boolean</option></select><input type="{{getInputType()}}" class="value-field" placeholder="value" name="newPropertyValue" ng-model="newProperty.value" ng-show="showValueField()"><select name="newPropertyType" ng-model="newProperty.value" ng-show="newProperty.type === \'boolean\'"><option value="true">true</option><option value="">false</option></select><button class="json-button" ng-click="addProperty()" ng-show="newProperty.type">&#43;</button></div><div class="new-property-button-div" ng-show="!showForm"><button class="json-button padded-row" ng-click="showForm = true">&#43;</button></div>',t={link:e,template:n,restrict:"EA",scope:{object:"=",newProperty:"="}};return t}angular.module("angular-json-edit").directive("jsonEditorAddProperty",e)}();
{
"name": "angular-json-edit",
"version": "0.4.1",
"version": "0.4.3",
"description": "Infinitely nesting JSON editor for Angular with no dependencies",

@@ -5,0 +5,0 @@ "main": "dist/angularJsonEdit.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc