react-layout-builder
Advanced tools
+2
-2
| { | ||
| "name": "react-layout-builder", | ||
| "version": "1.1.7", | ||
| "version": "1.2.0", | ||
| "description": "Build form layout", | ||
@@ -28,3 +28,3 @@ "main": "build/index.js", | ||
| "object-assign": "^4.x.x", | ||
| "react-form-utils": "^1.1.7" | ||
| "react-form-utils": "^1.2.0" | ||
| }, | ||
@@ -31,0 +31,0 @@ "scripts": { |
+0
-11
@@ -5,15 +5,4 @@ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. | ||
| react-form-utils@^1.0.15: | ||
| version "1.0.15" | ||
| resolved "https://registry.yarnpkg.com/react-form-utils/-/react-form-utils-1.0.15.tgz#e1e0a19711b5572c827b3778994c750486d60cd5" | ||
| dependencies: | ||
| form-serialize alvinsj/form-serialize#export-fn | ||
| object-assign "^4.x.x" | ||
| "form-serialize@github:alvinsj/form-serialize#export-fn": | ||
| version "0.7.1" | ||
| resolved "https://codeload.github.com/alvinsj/form-serialize/tar.gz/228e1b738c3297bde5c003817fd371d7385e3c59" | ||
| object-assign@^4.x.x: | ||
| version "4.1.1" | ||
| resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" |
Sorry, the diff of this file is not supported yet
| 'use strict'; | ||
| var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
| /* | ||
| The MIT License (MIT) | ||
| Copyright (c) 2013 Roman Shtylman | ||
| Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
| this software and associated documentation files (the "Software"), to deal in | ||
| the Software without restriction, including without limitation the rights to | ||
| use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
| the Software, and to permit persons to whom the Software is furnished to do so, | ||
| subject to the following conditions: | ||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
| FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
| COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
| IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
| CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| */ | ||
| // get successful control from form and assemble into object | ||
| // http://www.w3.org/TR/html401/interact/forms.html#h-17.13.2 | ||
| // types which indicate a submit action and are not successful controls | ||
| // these will be ignored | ||
| var k_r_submitter = /^(?:submit|button|image|reset|file)$/i; | ||
| // node names which could be successful controls | ||
| var k_r_success_contrls = /^(?:input|select|textarea|keygen)/i; | ||
| // keys with brackets for hash keys | ||
| var object_brackets_regex = /\[(.+?)\]/g; | ||
| var array_brackets_regex = /\[\]$/; | ||
| var brackeks_prefix_regex = /^(.+?)\[/; | ||
| // serializes form fields | ||
| // @param form MUST be an HTMLForm element | ||
| // @param options is an optional argument to configure the serialization. Default output | ||
| // with no options specified is a url encoded string | ||
| // - hash: [true | false] Configure the output type. If true, the output will | ||
| // be a js object. | ||
| // - serializer: [function] Optional serializer function to override the default one. | ||
| // The function takes 3 arguments (result, key, value) and should return new result | ||
| // hash and url encoded str serializers are provided with this module | ||
| // - disabled: [true | false]. If true serialize disabled fields. | ||
| // - empty: [true | false]. If true serialize empty fields | ||
| function serialize(form, options) { | ||
| if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) != 'object') { | ||
| options = { hash: !!options }; | ||
| } else if (options.hash === undefined) { | ||
| options.hash = true; | ||
| } | ||
| var result = options.hash ? {} : ''; | ||
| var serializer = options.serializer || (options.hash ? hash_serializer : str_serialize); | ||
| var elements = form.elements || []; | ||
| //Object store each radio and set if it's empty or not | ||
| var radio_store = Object.create(null); | ||
| for (var i = 0; i < elements.length; ++i) { | ||
| var element = elements[i]; | ||
| // ingore disabled fields | ||
| if (!options.disabled && element.disabled || !element.name) { | ||
| continue; | ||
| } | ||
| // ignore anyhting that is not considered a success field | ||
| if (!k_r_success_contrls.test(element.nodeName) || k_r_submitter.test(element.type)) { | ||
| continue; | ||
| } | ||
| var key = element.name; | ||
| var val = element.value; | ||
| // we can't just use element.value for checkboxes cause some browsers lie to us | ||
| // they say "on" for value when the box isn't checked | ||
| if ((element.type === 'checkbox' || element.type === 'radio') && !element.checked) { | ||
| val = undefined; | ||
| } | ||
| // If we want empty elements | ||
| if (options.empty) { | ||
| // for checkbox | ||
| if (element.type === 'checkbox' && !element.checked) { | ||
| val = ''; | ||
| } | ||
| // for radio | ||
| if (element.type === 'radio') { | ||
| if (!radio_store[element.name] && !element.checked) { | ||
| radio_store[element.name] = false; | ||
| } else if (element.checked) { | ||
| radio_store[element.name] = true; | ||
| } | ||
| } | ||
| // if options empty is true, continue only if its radio | ||
| if (!val && element.type == 'radio') { | ||
| continue; | ||
| } | ||
| } else { | ||
| // value-less fields are ignored unless options.empty is true | ||
| if (!val) { | ||
| continue; | ||
| } | ||
| } | ||
| // multi select boxes | ||
| if (element.type === 'select-multiple') { | ||
| val = []; | ||
| var selectOptions = element.options; | ||
| var isSelectedOptions = false; | ||
| for (var j = 0; j < selectOptions.length; ++j) { | ||
| var option = selectOptions[j]; | ||
| if (option.selected) { | ||
| isSelectedOptions = true; | ||
| result = serializer(result, key, option.value); | ||
| } | ||
| } | ||
| // Serialize if no selected options and options.empty is true | ||
| if (!isSelectedOptions && options.empty) { | ||
| result = serializer(result, key, ''); | ||
| } | ||
| continue; | ||
| } | ||
| result = serializer(result, key, val); | ||
| } | ||
| // Check for all empty radio buttons and serialize them with key="" | ||
| if (options.empty) { | ||
| for (var key in radio_store) { | ||
| if (!radio_store[key]) { | ||
| result = serializer(result, key, ''); | ||
| } | ||
| } | ||
| } | ||
| return result; | ||
| } | ||
| // obj/hash encoding serializer | ||
| function hash_serializer(result, key, value) { | ||
| var is_array_key = has_array_brackets(key); | ||
| if (is_array_key) { | ||
| key = key.replace(array_brackets_regex, ''); | ||
| } | ||
| if (key in result) { | ||
| var existing = result[key]; | ||
| if (!Array.isArray(existing)) { | ||
| result[key] = [existing]; | ||
| } | ||
| result[key].push(value); | ||
| } else { | ||
| if (has_object_brackets(key)) { | ||
| extract_from_brackets(result, key, value); | ||
| } else { | ||
| result[key] = is_array_key ? [value] : value; | ||
| } | ||
| } | ||
| return result; | ||
| }; | ||
| // urlform encoding serializer | ||
| function str_serialize(result, key, value) { | ||
| // encode newlines as \r\n cause the html spec says so | ||
| value = value.replace(/(\r)?\n/g, '\r\n'); | ||
| value = encodeURIComponent(value); | ||
| // spaces should be '+' rather than '%20'. | ||
| value = value.replace(/%20/g, '+'); | ||
| return result + (result ? '&' : '') + encodeURIComponent(key) + '=' + value; | ||
| }; | ||
| function has_object_brackets(string) { | ||
| return string.match(object_brackets_regex); | ||
| }; | ||
| function has_array_brackets(string) { | ||
| return string.match(array_brackets_regex); | ||
| } | ||
| function matches_between_brackets(string) { | ||
| // Make sure to isolate object_brackets_regex from .exec() calls | ||
| var regex = new RegExp(object_brackets_regex); | ||
| var matches = []; | ||
| var match; | ||
| while (match = regex.exec(string)) { | ||
| matches.push(match[1]); | ||
| } | ||
| return matches; | ||
| }; | ||
| function extract_from_brackets(result, key, value) { | ||
| var prefix = key.match(brackeks_prefix_regex)[1]; | ||
| // Set the key if it doesn't exist | ||
| if (!result[prefix]) result[prefix] = {}; | ||
| var parent = result[prefix]; | ||
| var matches_between = matches_between_brackets(key); | ||
| var length = matches_between.length; | ||
| for (var i = 0; i < length; i++) { | ||
| var child = matches_between[i]; | ||
| var isLast = length === i + 1; | ||
| if (isLast) { | ||
| var existing = parent[child]; | ||
| if (existing) { | ||
| if (!Array.isArray(existing)) { | ||
| parent[child] = [existing]; | ||
| } | ||
| parent[child].push(value); | ||
| } else { | ||
| // Finally make the assignment | ||
| parent[child] = value; | ||
| } | ||
| } else { | ||
| // This is a nested key, set it properly for the next iteration | ||
| parent[child] = parent[child] || {}; | ||
| parent = parent[child]; | ||
| } | ||
| } | ||
| parent = value; | ||
| }; | ||
| serialize.hash_serializer = hash_serializer; | ||
| serialize.str_serializer = str_serialize; | ||
| module.exports = serialize; |
| lerna(info) Lerna v2.0.0-beta.28 | ||
| lerna(debug) Attempting running RunCommand.initialize | ||
| lerna(info) Scoping to packages that match 'toolbar-*' | ||
| lerna(error) Errored while running RunCommand.initialize | ||
| Error: No packages found that match 'toolbar-*' | ||
| at Function.filterPackages (/usr/local/lib/node_modules/lerna/lib/PackageUtilities.js:122:17) | ||
| at RunCommand.initialize (/usr/local/lib/node_modules/lerna/lib/commands/RunCommand.js:68:64) | ||
| at RunCommand._attempt (/usr/local/lib/node_modules/lerna/lib/Command.js:161:21) | ||
| at RunCommand.runCommand (/usr/local/lib/node_modules/lerna/lib/Command.js:145:12) | ||
| at RunCommand.run (/usr/local/lib/node_modules/lerna/lib/Command.js:69:12) | ||
| at Object.<anonymous> (/usr/local/lib/node_modules/lerna/bin/lerna.js:58:11) | ||
| at Module._compile (module.js:541:32) | ||
| at Object.Module._extensions..js (module.js:550:10) | ||
| at Module.load (module.js:458:32) | ||
| at tryModuleLoad (module.js:417:12) |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
5071
-66.27%4
-42.86%54
-78.82%1
Infinity%Updated