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

@glideapps/glide-data-grid

Package Overview
Dependencies
Maintainers
8
Versions
294
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@glideapps/glide-data-grid - npm Package Compare versions

Comparing version 2.2.4 to 2.2.5

25

dist/js/data-grid-overlay-editor/data-grid-overlay-editor.js

@@ -102,3 +102,3 @@ "use strict";

onFinishEditing(undefined, [0, 0]);
} else if (event.key === "Enter" && !event.ctrlKey) {
} else if (event.key === "Enter") {
onFinishEditing(tempValue, [0, event.shiftKey ? -1 : 1]);

@@ -112,2 +112,16 @@ event.stopPropagation();

}
}, [onFinishEditing, tempValue]); // The only difference is that `shift + enter` enters a newline
var onKeyDownMultiline = React.useCallback(function (event) {
if (event.key === "Escape") {
onFinishEditing(undefined, [0, 0]);
} else if (event.key === "Enter" && !event.shiftKey) {
onFinishEditing(tempValue, [0, 1]);
event.stopPropagation();
event.preventDefault();
} else if (event.key === "Tab") {
onFinishEditing(tempValue, [event.shiftKey ? -1 : 1, 0]);
event.stopPropagation();
event.preventDefault();
}
}, [onFinishEditing, tempValue]);

@@ -122,4 +136,3 @@ var ImageEditor = imageEditorOverride !== null && imageEditorOverride !== void 0 ? imageEditorOverride : _imageOverlayEditor.default;

autoFocus: true,
allowCtrlEnter: true,
onKeyDown: onKeyDown,
onKeyDown: onKeyDownMultiline,
value: targetValue.data,

@@ -178,3 +191,3 @@ onChange: onStringValueChange

markdown: targetValue.data,
onKeyDown: onKeyDown,
onKeyDown: onKeyDownMultiline,
onChange: onStringValueChange,

@@ -189,7 +202,9 @@ forceEditMode: forceEditMode,

ev.stopPropagation();
};
}; // Consider imperatively creating and adding the element to the dom?
var portalElement = document.getElementById("portal");
if (portalElement === null) {
// eslint-disable-next-line no-console
console.error('Cannot open Data Grid overlay editor, because portal not found. Please add `<div id="portal" />` as the last child of your `<body>`.');

@@ -196,0 +211,0 @@ return null;

20

dist/js/growing-entry/growing-entry.js

@@ -31,6 +31,4 @@ "use strict";

value = props.value,
ref = props.ref,
onKeyDown = props.onKeyDown,
allowCtrlEnter = props.allowCtrlEnter,
rest = _objectWithoutProperties(props, ["placeholder", "value", "ref", "onKeyDown", "allowCtrlEnter"]);
rest = _objectWithoutProperties(props, ["placeholder", "value", "onKeyDown"]);

@@ -49,16 +47,2 @@ var onChange = rest.onChange,

}, []);
var onKeyDownImpl = React.useCallback(function (event) {
if (event.ctrlKey && event.key === "Enter" && allowCtrlEnter === true && inputRef.current !== null) {
var _Object$getOwnPropert;
var newValue = inputRef.current.value + "\n";
var nativeInputValueSetter = (_Object$getOwnPropert = Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype, "value")) === null || _Object$getOwnPropert === void 0 ? void 0 : _Object$getOwnPropert.set;
nativeInputValueSetter === null || nativeInputValueSetter === void 0 ? void 0 : nativeInputValueSetter.call(inputRef.current, newValue);
inputRef.current.dispatchEvent(new Event("change", {
bubbles: true
}));
}
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(event);
}, [onKeyDown, allowCtrlEnter]);
return /*#__PURE__*/React.createElement(_growingEntryStyle.GrowingEntryStyle, null, /*#__PURE__*/React.createElement(_growingEntryStyle.ShadowBox, {

@@ -68,3 +52,3 @@ className: className

ref: inputRef,
onKeyDown: onKeyDownImpl,
onKeyDown: onKeyDown,
value: useText,

@@ -71,0 +55,0 @@ placeholder: placeholder,

import * as React from "react";
interface Props extends React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement> {
readonly placeholder?: string;
readonly allowCtrlEnter?: boolean;
}
declare const GrowingEntry: React.NamedExoticComponent<Props>;
export default GrowingEntry;
{
"name": "@glideapps/glide-data-grid",
"version": "2.2.4",
"version": "2.2.5",
"description": "Super fast, pure canvas Data Grid Editor",

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

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