angular-json-edit
Advanced tools
Comparing version 0.2.0 to 0.2.1
{ | ||
"name": "angular-json-edit", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"homepage": "https://github.com/Rleahy22/angularJsonEditor", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -52,4 +52,4 @@ (function() { | ||
'<i ng-show="isNested(value) && !isCollapsed(key, parent)" class="json-arrow" ng-click="collapse(key, parent)">⇓</i>' + | ||
'<label ng-hide="isArray(parent)" class="json-form-element">' + | ||
'<span class="key-span">{{key}}:</span>' + | ||
'<label class="json-form-element">' + | ||
'<span class="key-span" ng-hide="isArray(parent)">{{key}}:</span>' + | ||
'<span ng-show="isNested(value) && isArray(value)"> [</span>' + | ||
@@ -61,3 +61,2 @@ '<span ng-show="isNested(value) && !isArray(value)"> {</span>' + | ||
'</div>' + | ||
'<label ng-show="isNested(value) && !isArray(value) && isArray(parent)" class="json-form-element">{</label>' + | ||
'</div>' + | ||
@@ -176,4 +175,4 @@ '<div ng-if="isNested(value)" ng-show="!isCollapsed(key, parent)" class="nested-json">' + | ||
'</select>' + | ||
'<input type="text" placeholder="value" name="newPropertyValue" ng-model="newProperty.value" ng-show="showValueField()">' + | ||
'<button class="json-button" ng-click="addProperty()" ng-disabled="!newProperty.type">Add</button>' + | ||
'<input type="text" 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">+</button>' + | ||
'</div>' + | ||
@@ -180,0 +179,0 @@ '<div class="new-property-button-div" ng-show="!showForm">' + |
@@ -1,1 +0,1 @@ | ||
!function(){"use strict";angular.module("angular-json-edit",[])}(),function(){"use strict";function e(){function e(e){function n(n,o){var r={};r[n]=o,e.collapsed.push(r)}function o(n,o){e.isArray(o)?o.splice(n,1):delete o[n]}function r(n,o){var r={};r[n]=o,e.collapsed.forEach(function(o,t){angular.equals(o[n],r[n])&&e.collapsed.splice(t,1)})}function t(e){return"number"==typeof e?"number":"text"}function a(e){return Array.isArray(e)}function s(n,o){var r={},t=!1;return r[n]=o,e.collapsed.forEach(function(e){angular.equals(e[n],r[n])&&(t=!0)}),t}function i(e){return"object"==typeof e?!0:!1}e.collapse=n,e.collapsed=[],e.deleteProperty=o,e.expand=r,e.getInputType=t,e.isArray=a,e.isCollapsed=s,e.isNested=i,e.nest='<button class="json-delete json-button" ng-click="deleteProperty(key, parent)">×</button><div class="label-wrapper" ng-class="{\'padded-row\': !isNested(value)}"><i ng-show="isNested(value) && isCollapsed(key, parent)" class="json-arrow" ng-click="expand(key, parent)">⇒</i><i ng-show="isNested(value) && !isCollapsed(key, parent)" class="json-arrow" ng-click="collapse(key, parent)">⇓</i><label ng-hide="isArray(parent)" class="json-form-element"><span class="key-span">{{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-form-element"><input type="{{getInputType(value)}}" name="{{key}}" ng-model="parent[key]" class="json-input" required></div><label ng-show="isNested(value) && !isArray(value) && isArray(parent)" class="json-form-element">{</label></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"></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>',e.$watch("showModal",function(n){n===!0&&(e.savedConfig=angular.merge({},e.config))})}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"</div><div json-editor-add-property class="json-new-property" object="config" newProperty="{}"></div></form></div></div>',o={link:e,template:n,restrict:"EA",scope:{config:"=",showModal:"="}};return o}function n(e){return function(n,o,r){n.$watch(function(e){return e.$eval(r.compile)},function(r){o.html(r),e(o.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 o(){return Array.isArray(e.object)}function r(){return e.newProperty?"string"===e.newProperty.type||"number"===e.newProperty.type||"boolean"===e.newProperty.type:void 0}e.addProperty=n,e.isParentArray=o,e.showValueField=r}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="text" placeholder="value" name="newPropertyValue" ng-model="newProperty.value" ng-show="showValueField()"><button class="json-button" ng-click="addProperty()" ng-disabled="!newProperty.type">Add</button></div><div class="new-property-button-div" ng-show="!showForm"><button class="json-button padded-row" ng-click="showForm = true">+</button></div>',o={link:e,template:n,restrict:"EA",scope:{object:"=",newProperty:"="}};return o}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,o){var r={};r[n]=o,e.collapsed.push(r)}function o(n,o){e.isArray(o)?o.splice(n,1):delete o[n]}function r(n,o){var r={};r[n]=o,e.collapsed.forEach(function(o,t){angular.equals(o[n],r[n])&&e.collapsed.splice(t,1)})}function t(e){return"number"==typeof e?"number":"text"}function a(e){return Array.isArray(e)}function s(n,o){var r={},t=!1;return r[n]=o,e.collapsed.forEach(function(e){angular.equals(e[n],r[n])&&(t=!0)}),t}function i(e){return"object"==typeof e?!0:!1}e.collapse=n,e.collapsed=[],e.deleteProperty=o,e.expand=r,e.getInputType=t,e.isArray=a,e.isCollapsed=s,e.isNested=i,e.nest='<button class="json-delete json-button" ng-click="deleteProperty(key, parent)">×</button><div class="label-wrapper" ng-class="{\'padded-row\': !isNested(value)}"><i ng-show="isNested(value) && isCollapsed(key, parent)" class="json-arrow" ng-click="expand(key, parent)">⇒</i><i ng-show="isNested(value) && !isCollapsed(key, parent)" class="json-arrow" ng-click="collapse(key, parent)">⇓</i><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-form-element"><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"></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>',e.$watch("showModal",function(n){n===!0&&(e.savedConfig=angular.merge({},e.config))})}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"</div><div json-editor-add-property class="json-new-property" object="config" newProperty="{}"></div></form></div></div>',o={link:e,template:n,restrict:"EA",scope:{config:"=",showModal:"="}};return o}function n(e){return function(n,o,r){n.$watch(function(e){return e.$eval(r.compile)},function(r){o.html(r),e(o.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 o(){return Array.isArray(e.object)}function r(){return e.newProperty?"string"===e.newProperty.type||"number"===e.newProperty.type||"boolean"===e.newProperty.type:void 0}e.addProperty=n,e.isParentArray=o,e.showValueField=r}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="text" 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">+</button></div><div class="new-property-button-div" ng-show="!showForm"><button class="json-button padded-row" ng-click="showForm = true">+</button></div>',o={link:e,template:n,restrict:"EA",scope:{object:"=",newProperty:"="}};return o}angular.module("angular-json-edit").directive("jsonEditorAddProperty",e)}(); |
{ | ||
"name": "angular-json-edit", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Infinitely nesting JSON editor for Angular with no dependencies", | ||
@@ -5,0 +5,0 @@ "main": "dist/angularJsonEdit.js", |
# angularJsonEdit | ||
An infinitely nesting, dependency free interactive JSON editor for Angular. Can support an infinitely nested object without the need to install jQuery, bootstrap, or any ui dependencies. All changes occur within the digest cycle with no manual calls of $scope.$digest or $scope.$apply. 100% test covered. | ||
An infinitely nesting, dependency free interactive JSON editor for Angular. Can support an infinitely nested object without the need to install jQuery, bootstrap, or any ui dependencies. All changes occur within the digest cycle. 100% test covered. | ||
@@ -5,0 +5,0 @@ # Usage |
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
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1482
120396