@glideapps/glide-data-grid
Advanced tools
Comparing version 3.0.0-beta2 to 3.0.0-beta3
@@ -276,2 +276,3 @@ "use strict"; | ||
cell: [col, row], | ||
highlight: initialValue === undefined, | ||
forceEditMode: initialValue !== undefined | ||
@@ -335,2 +336,3 @@ }); | ||
content: content, | ||
highlight: true, | ||
cell: [col, row], | ||
@@ -337,0 +339,0 @@ forceEditMode: true |
@@ -64,3 +64,4 @@ "use strict"; | ||
imageEditorOverride = p.imageEditorOverride, | ||
markdownDivCreateNode = p.markdownDivCreateNode; | ||
markdownDivCreateNode = p.markdownDivCreateNode, | ||
highlight = p.highlight; | ||
@@ -134,2 +135,3 @@ var _React$useState = React.useState(forceEditMode ? content : undefined), | ||
editor = /*#__PURE__*/React.createElement(_growingEntry.default, { | ||
highlight: highlight, | ||
autoFocus: targetValue.readonly !== true, | ||
@@ -158,2 +160,3 @@ disabled: targetValue.readonly === true, | ||
editor = /*#__PURE__*/React.createElement(_numberOverlayEditor.default, { | ||
highlight: highlight, | ||
disabled: targetValue.readonly === true, | ||
@@ -160,0 +163,0 @@ value: targetValue.data, |
@@ -65,2 +65,3 @@ "use strict"; | ||
autoFocus: true, | ||
highlight: false, | ||
onKeyDown: onKeyDown, | ||
@@ -67,0 +68,0 @@ value: markdown, |
@@ -40,7 +40,8 @@ "use strict"; | ||
onKeyDown = p.onKeyDown, | ||
disabled = p.disabled; | ||
disabled = p.disabled, | ||
highlight = p.highlight; | ||
return /*#__PURE__*/React.createElement(_numberOverlayEditorStyle.NumberOverlayEditorStyle, null, /*#__PURE__*/React.createElement(_reactNumberFormat.default, { | ||
autoFocus: true, | ||
onFocus: function onFocus(e) { | ||
return e.target.setSelectionRange(0, e.target.value.length); | ||
return e.target.setSelectionRange(highlight ? 0 : e.target.value.length, e.target.value.length); | ||
}, | ||
@@ -47,0 +48,0 @@ disabled: disabled === true, |
@@ -54,2 +54,3 @@ "use strict"; | ||
return /*#__PURE__*/React.createElement(_growingEntry.default, { | ||
highlight: true, | ||
autoFocus: true, | ||
@@ -56,0 +57,0 @@ onKeyDown: onKeyDown, |
@@ -30,3 +30,4 @@ "use strict"; | ||
onKeyDown = props.onKeyDown, | ||
rest = _objectWithoutProperties(props, ["placeholder", "value", "onKeyDown"]); | ||
highlight = props.highlight, | ||
rest = _objectWithoutProperties(props, ["placeholder", "value", "onKeyDown", "highlight"]); | ||
@@ -44,3 +45,3 @@ var onChange = rest.onChange, | ||
ta.focus(); | ||
ta.setSelectionRange(0, length); // eslint-disable-next-line react-hooks/exhaustive-deps | ||
ta.setSelectionRange(highlight ? 0 : length, length); // eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, []); | ||
@@ -47,0 +48,0 @@ return /*#__PURE__*/React.createElement(_growingEntryStyle.GrowingEntryStyle, null, /*#__PURE__*/React.createElement(_growingEntryStyle.ShadowBox, { |
@@ -10,2 +10,3 @@ import * as React from "react"; | ||
readonly forceEditMode: boolean; | ||
readonly highlight: boolean; | ||
readonly imageEditorOverride?: ImageEditorType; | ||
@@ -12,0 +13,0 @@ readonly markdownDivCreateNode?: (content: string) => DocumentFragment; |
@@ -8,4 +8,5 @@ import * as React from "react"; | ||
onChange: (values: NumberFormatValues) => void; | ||
highlight: boolean; | ||
} | ||
declare const NumberOverlayEditor: React.FunctionComponent<Props>; | ||
export default NumberOverlayEditor; |
import * as React from "react"; | ||
interface Props extends React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement> { | ||
readonly placeholder?: string; | ||
readonly highlight: boolean; | ||
} | ||
declare const GrowingEntry: React.FunctionComponent<Props>; | ||
export default GrowingEntry; |
{ | ||
"name": "@glideapps/glide-data-grid", | ||
"version": "3.0.0-beta2", | ||
"version": "3.0.0-beta3", | ||
"description": "Super fast, pure canvas Data Grid Editor", | ||
@@ -5,0 +5,0 @@ "main": "dist/js/index.js", |
412505
7210