angular-json-edit
Advanced tools
Comparing version 0.5.2 to 1.0.0
{ | ||
"name": "angular-json-edit", | ||
"version": "0.5.2", | ||
"version": "1.0.0", | ||
"homepage": "https://github.com/Rleahy22/angularJsonEditor", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -57,2 +57,3 @@ (function() { | ||
'<label class="json-form-element">' + | ||
'<span class="json-arrow"></span>' + | ||
'<span class="key-span" ng-click="to(key, parent)" ng-if="!isArray(parent)">{{key}}: ' + | ||
@@ -59,0 +60,0 @@ '{{isNested(value) && isArray(value) ? "[" : "" }}' + |
@@ -1,1 +0,1 @@ | ||
!function(){"use strict";angular.module("angular-json-edit",[])}(),function(){"use strict";function e(){function e(e){function t(t,n,r){i(r)||"object"!=typeof r[n]?e.focusInput(t,n,r):e.toggleExpandCollapse(n,r)}function n(t,n){e.isArray(n)?n.splice(t,1):delete n[t]}function r(t,n,r){var o=t.target||t.srcElement;if("INPUT"!=o.tagName&&o.children.length>0)for(var a=0;a<o.children.length;a++)e.focusInput({target:o.children[a]},n,r);"INPUT"==o.tagName&&o.focus()}function o(e){return"number"==typeof e?"number":"text"}function a(t,n){var r={};r[t]=n,e.highlighted.push(r)}function i(e){return Array.isArray(e)}function s(e,t){return t[e].$$collapsed}function l(t,n){var r={},o=!1;return r[t]=n,e.highlighted.forEach(function(e){angular.equals(e[t],r[t])&&(o=!0)}),o}function p(e){return"object"==typeof e?!0:!1}function c(e,t){"undefined"==typeof t[e].$$collapsed?Object.defineProperty(t[e],"$$collapsed",{value:!0,writable:!0,enumerable:!1}):t[e].$$collapsed=!t[e].$$collapsed}function u(t,n){var r={};r[t]=n,e.highlighted.forEach(function(n,o){angular.equals(n[t],r[t])&&e.highlighted.splice(o,1)})}e.clickAction=t,e.collapsed=[],e.deleteProperty=n,e.focusInput=r,e.getInputType=o,e.highlight=a,e.highlighted=[],e.isArray=i,e.isCollapsed=s,e.isHighlighted=l,e.isNested=p,e.toggleExpandCollapse=c,e.unHighlight=u,e.nest='<div class="label-wrapper" ng-class="{\'padded-row\': !isNested(value), \'json-delete-highlight\' : isHighlighted(key, parent), \'json-collapsed-row\' : !isArray(parent) && parent[key].$$collapsed}" ng-click="clickAction($event, key, parent)"><label class="json-form-element"><span class="key-span" ng-click="to(key, parent)" ng-if="!isArray(parent)">{{key}}: {{isNested(value) && isArray(value) ? "[" : "" }}{{isNested(value) && !isArray(value) ? "{" : "" }}{{isNested(value) && isArray(value) && isCollapsed(key, parent) ? " ... ]" : "" }}{{isNested(value) && !isArray(value) && isCollapsed(key, parent) ? " ... }" : "" }}</span><div ng-if="!isNested(value)" class="json-input-div"><input type="{{getInputType(value)}}" name="{{key}}" ng-model="parent[key]" class="json-input" required></div></label><button class="json-delete json-button" type="button" ng-click="deleteProperty(key, parent)" ng-mouseover="highlight(key, parent)" ng-mouseleave="unHighlight(key, parent)">×</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"></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) && !isCollapsed(key, parent)" class="json-closing-brace label-wrapper padded-row">{{isArray(value) ? \']\' : \'}\'}}</label>'}var t='<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>',n={link:e,template:t,restrict:"EA",scope:{config:"="}};return n}function t(e){return function(t,n,r){t.$watch(function(e){return e.$eval(r.compile)},function(r){n.html(r),e(n.contents())(t)})}}angular.module("angular-json-edit").directive("jsonEditor",e).directive("compile",t),t.$inject=["$compile"]}(),function(){"use strict";function e(){function e(e){function t(){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 n(t){var n=t.keyCode||t.which;13===n&&e.addProperty()}function r(){return e.newProperty&&"number"===e.newProperty.type?"number":"text"}function o(){return Array.isArray(e.object)}function a(){return e.newProperty?"string"===e.newProperty.type||"number"===e.newProperty.type:void 0}e.addProperty=t,e.checkKeydown=n,e.getInputType=r,e.isParentArray=o,e.showValueField=a}var t='<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()" ng-keydown="checkKeydown($event)"><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">add property</button></div><div class="new-property-button-div" ng-show="!showForm"><button class="json-button padded-row" ng-click="showForm = true">+ add property</button></div>',n={link:e,template:t,restrict:"EA",scope:{object:"=",newProperty:"="}};return n}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,r){i(r)||"object"!=typeof r[t]?e.focusInput(n,t,r):e.toggleExpandCollapse(t,r)}function t(n,t){e.isArray(t)?t.splice(n,1):delete t[n]}function r(n,t,r){var o=n.target||n.srcElement;if("INPUT"!=o.tagName&&o.children.length>0)for(var a=0;a<o.children.length;a++)e.focusInput({target:o.children[a]},t,r);"INPUT"==o.tagName&&o.focus()}function o(e){return"number"==typeof e?"number":"text"}function a(n,t){var r={};r[n]=t,e.highlighted.push(r)}function i(e){return Array.isArray(e)}function s(e,n){return n[e].$$collapsed}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(e,n){"undefined"==typeof n[e].$$collapsed?Object.defineProperty(n[e],"$$collapsed",{value:!0,writable:!0,enumerable:!1}):n[e].$$collapsed=!n[e].$$collapsed}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.clickAction=n,e.collapsed=[],e.deleteProperty=t,e.focusInput=r,e.getInputType=o,e.highlight=a,e.highlighted=[],e.isArray=i,e.isCollapsed=s,e.isHighlighted=l,e.isNested=p,e.toggleExpandCollapse=c,e.unHighlight=u,e.nest='<div class="label-wrapper" ng-class="{\'padded-row\': !isNested(value), \'json-delete-highlight\' : isHighlighted(key, parent), \'json-collapsed-row\' : !isArray(parent) && parent[key].$$collapsed}" ng-click="clickAction($event, key, parent)"><label class="json-form-element"><span class="json-arrow"></span><span class="key-span" ng-click="to(key, parent)" ng-if="!isArray(parent)">{{key}}: {{isNested(value) && isArray(value) ? "[" : "" }}{{isNested(value) && !isArray(value) ? "{" : "" }}{{isNested(value) && isArray(value) && isCollapsed(key, parent) ? " ... ]" : "" }}{{isNested(value) && !isArray(value) && isCollapsed(key, parent) ? " ... }" : "" }}</span><div ng-if="!isNested(value)" class="json-input-div"><input type="{{getInputType(value)}}" name="{{key}}" ng-model="parent[key]" class="json-input" required></div></label><button class="json-delete json-button" type="button" ng-click="deleteProperty(key, parent)" ng-mouseover="highlight(key, parent)" ng-mouseleave="unHighlight(key, parent)">×</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"></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) && !isCollapsed(key, parent)" class="json-closing-brace label-wrapper 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(n){var t=n.keyCode||n.which;13===t&&e.addProperty()}function r(){return e.newProperty&&"number"===e.newProperty.type?"number":"text"}function o(){return Array.isArray(e.object)}function a(){return e.newProperty?"string"===e.newProperty.type||"number"===e.newProperty.type:void 0}e.addProperty=n,e.checkKeydown=t,e.getInputType=r,e.isParentArray=o,e.showValueField=a}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()" ng-keydown="checkKeydown($event)"><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">add property</button></div><div class="new-property-button-div" ng-show="!showForm"><button class="json-button padded-row" ng-click="showForm = true">+ add property</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.5.2", | ||
"version": "1.0.0", | ||
"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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
124890
1559
1