@chakra-ui/editable
Advanced tools
Comparing version 0.0.0-dev-20220919061024 to 0.0.0-dev-20220919124959
@@ -61,2 +61,3 @@ "use strict"; | ||
var import_react_use_merge_refs = require("@chakra-ui/react-use-merge-refs"); | ||
var import_react_use_callback_ref = require("@chakra-ui/react-use-callback-ref"); | ||
var import_shared_utils = require("@chakra-ui/shared-utils"); | ||
@@ -82,5 +83,6 @@ var import_react2 = require("react"); | ||
placeholder, | ||
onEdit: onEditProp, | ||
onEdit: onEditCallback, | ||
...htmlProps | ||
} = props; | ||
const onEditProp = (0, import_react_use_callback_ref.useCallbackRef)(onEditCallback); | ||
const defaultIsEditing = Boolean(startWithEditView && !isDisabled); | ||
@@ -120,4 +122,5 @@ const [isEditing, setIsEditing] = (0, import_react2.useState)(defaultIsEditing); | ||
(_b = inputRef.current) == null ? void 0 : _b.focus(); | ||
if (selectAllOnFocus) | ||
if (selectAllOnFocus) { | ||
(_c = inputRef.current) == null ? void 0 : _c.select(); | ||
} | ||
onEditProp == null ? void 0 : onEditProp(); | ||
@@ -124,0 +127,0 @@ }, [isEditing, onEditProp, selectAllOnFocus]); |
@@ -30,2 +30,3 @@ // ../../../react-shim.js | ||
import { mergeRefs } from "@chakra-ui/react-use-merge-refs"; | ||
import { useCallbackRef } from "@chakra-ui/react-use-callback-ref"; | ||
import { ariaAttr, callAllHandlers } from "@chakra-ui/shared-utils"; | ||
@@ -51,5 +52,6 @@ import { useCallback, useRef, useState } from "react"; | ||
placeholder, | ||
onEdit: onEditProp, | ||
onEdit: onEditCallback, | ||
...htmlProps | ||
} = props; | ||
const onEditProp = useCallbackRef(onEditCallback); | ||
const defaultIsEditing = Boolean(startWithEditView && !isDisabled); | ||
@@ -89,4 +91,5 @@ const [isEditing, setIsEditing] = useState(defaultIsEditing); | ||
(_b = inputRef.current) == null ? void 0 : _b.focus(); | ||
if (selectAllOnFocus) | ||
if (selectAllOnFocus) { | ||
(_c = inputRef.current) == null ? void 0 : _c.select(); | ||
} | ||
onEditProp == null ? void 0 : onEditProp(); | ||
@@ -93,0 +96,0 @@ }, [isEditing, onEditProp, selectAllOnFocus]); |
{ | ||
"name": "@chakra-ui/editable", | ||
"version": "0.0.0-dev-20220919061024", | ||
"version": "0.0.0-dev-20220919124959", | ||
"description": "React component used to build inline-editable components", | ||
@@ -41,4 +41,5 @@ "keywords": [ | ||
"@chakra-ui/react-use-merge-refs": "2.0.3", | ||
"@chakra-ui/react-use-controllable-state": "0.0.0-dev-20220919061024", | ||
"@chakra-ui/react-use-focus-on-pointer-down": "0.0.0-dev-20220919061024", | ||
"@chakra-ui/react-use-controllable-state": "2.0.4", | ||
"@chakra-ui/react-use-focus-on-pointer-down": "2.0.2", | ||
"@chakra-ui/react-use-callback-ref": "2.0.3", | ||
"@chakra-ui/react-context": "2.0.3", | ||
@@ -49,8 +50,8 @@ "@chakra-ui/react-types": "2.0.3", | ||
"devDependencies": { | ||
"@chakra-ui/system": "0.0.0-dev-20220919061024", | ||
"@chakra-ui/layout": "0.0.0-dev-20220919061024", | ||
"@chakra-ui/system": "0.0.0-dev-20220919124959", | ||
"@chakra-ui/layout": "2.1.7", | ||
"react": "^18.0.0" | ||
}, | ||
"peerDependencies": { | ||
"@chakra-ui/system": "0.0.0-dev-20220919061024", | ||
"@chakra-ui/system": "0.0.0-dev-20220919124959", | ||
"react": ">=18" | ||
@@ -57,0 +58,0 @@ }, |
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
36187
946
11
+ Added@chakra-ui/color-mode@2.1.8(transitive)
+ Added@chakra-ui/react-use-controllable-state@2.0.4(transitive)
+ Added@chakra-ui/react-use-focus-on-pointer-down@2.0.2(transitive)
+ Added@chakra-ui/react-utils@2.0.7(transitive)
+ Added@chakra-ui/styled-system@0.0.0-dev-20220919124959(transitive)
+ Added@chakra-ui/system@0.0.0-dev-20220919124959(transitive)
+ Added@chakra-ui/utils@2.0.10(transitive)
- Removed@chakra-ui/color-mode@0.0.0-dev-20220919061024(transitive)
- Removed@chakra-ui/react-use-controllable-state@0.0.0-dev-20220919061024(transitive)
- Removed@chakra-ui/react-use-focus-on-pointer-down@0.0.0-dev-20220919061024(transitive)
- Removed@chakra-ui/react-utils@0.0.0-dev-20220919061024(transitive)
- Removed@chakra-ui/styled-system@0.0.0-dev-20220919061024(transitive)
- Removed@chakra-ui/system@0.0.0-dev-20220919061024(transitive)
- Removed@chakra-ui/utils@0.0.0-dev-20220919061024(transitive)