@yamada-ui/editable 0.2.6 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-VFULS7K5.mjs → chunk-HAHPWESJ.mjs} +24 -4
- package/dist/editable.js +24 -4
- package/dist/editable.mjs +1 -1
- package/dist/index.js +24 -4
- package/dist/index.mjs +1 -1
- package/package.json +6 -6
|
@@ -46,7 +46,9 @@ var useEditable = (props) => {
|
|
|
46
46
|
...rest
|
|
47
47
|
} = useFormControlProps(props);
|
|
48
48
|
rest.onEdit = useCallbackRef(rest.onEdit);
|
|
49
|
-
const [isEditing, setIsEditing] = useState(
|
|
49
|
+
const [isEditing, setIsEditing] = useState(
|
|
50
|
+
!!startWithEditView && !disabled
|
|
51
|
+
);
|
|
50
52
|
const [value, setValue] = useControllableState({
|
|
51
53
|
defaultValue: defaultValue || "",
|
|
52
54
|
value: rest.value,
|
|
@@ -246,7 +248,13 @@ var useEditable = (props) => {
|
|
|
246
248
|
const getEditProps = useCallback(
|
|
247
249
|
(props2 = {}, ref = null) => ({
|
|
248
250
|
...props2,
|
|
249
|
-
...omitObject(rest, [
|
|
251
|
+
...omitObject(rest, [
|
|
252
|
+
"value",
|
|
253
|
+
"onChange",
|
|
254
|
+
"onCancel",
|
|
255
|
+
"onSubmit",
|
|
256
|
+
"onEdit"
|
|
257
|
+
]),
|
|
250
258
|
ref: mergeRefs(ref, editRef),
|
|
251
259
|
type: "button",
|
|
252
260
|
disabled,
|
|
@@ -258,7 +266,13 @@ var useEditable = (props) => {
|
|
|
258
266
|
const getSubmitProps = useCallback(
|
|
259
267
|
(props2 = {}, ref = null) => ({
|
|
260
268
|
...props2,
|
|
261
|
-
...omitObject(rest, [
|
|
269
|
+
...omitObject(rest, [
|
|
270
|
+
"value",
|
|
271
|
+
"onChange",
|
|
272
|
+
"onCancel",
|
|
273
|
+
"onSubmit",
|
|
274
|
+
"onEdit"
|
|
275
|
+
]),
|
|
262
276
|
ref: mergeRefs(submitRef, ref),
|
|
263
277
|
type: "button",
|
|
264
278
|
disabled,
|
|
@@ -270,7 +284,13 @@ var useEditable = (props) => {
|
|
|
270
284
|
const getCancelProps = useCallback(
|
|
271
285
|
(props2 = {}, ref = null) => ({
|
|
272
286
|
...props2,
|
|
273
|
-
...omitObject(rest, [
|
|
287
|
+
...omitObject(rest, [
|
|
288
|
+
"value",
|
|
289
|
+
"onChange",
|
|
290
|
+
"onCancel",
|
|
291
|
+
"onSubmit",
|
|
292
|
+
"onEdit"
|
|
293
|
+
]),
|
|
274
294
|
ref: mergeRefs(cancelRef, ref),
|
|
275
295
|
type: "button",
|
|
276
296
|
disabled,
|
package/dist/editable.js
CHANGED
|
@@ -50,7 +50,9 @@ var useEditable = (props) => {
|
|
|
50
50
|
...rest
|
|
51
51
|
} = (0, import_form_control.useFormControlProps)(props);
|
|
52
52
|
rest.onEdit = (0, import_utils.useCallbackRef)(rest.onEdit);
|
|
53
|
-
const [isEditing, setIsEditing] = (0, import_react.useState)(
|
|
53
|
+
const [isEditing, setIsEditing] = (0, import_react.useState)(
|
|
54
|
+
!!startWithEditView && !disabled
|
|
55
|
+
);
|
|
54
56
|
const [value, setValue] = (0, import_use_controllable_state.useControllableState)({
|
|
55
57
|
defaultValue: defaultValue || "",
|
|
56
58
|
value: rest.value,
|
|
@@ -250,7 +252,13 @@ var useEditable = (props) => {
|
|
|
250
252
|
const getEditProps = (0, import_react.useCallback)(
|
|
251
253
|
(props2 = {}, ref = null) => ({
|
|
252
254
|
...props2,
|
|
253
|
-
...(0, import_utils.omitObject)(rest, [
|
|
255
|
+
...(0, import_utils.omitObject)(rest, [
|
|
256
|
+
"value",
|
|
257
|
+
"onChange",
|
|
258
|
+
"onCancel",
|
|
259
|
+
"onSubmit",
|
|
260
|
+
"onEdit"
|
|
261
|
+
]),
|
|
254
262
|
ref: (0, import_utils.mergeRefs)(ref, editRef),
|
|
255
263
|
type: "button",
|
|
256
264
|
disabled,
|
|
@@ -262,7 +270,13 @@ var useEditable = (props) => {
|
|
|
262
270
|
const getSubmitProps = (0, import_react.useCallback)(
|
|
263
271
|
(props2 = {}, ref = null) => ({
|
|
264
272
|
...props2,
|
|
265
|
-
...(0, import_utils.omitObject)(rest, [
|
|
273
|
+
...(0, import_utils.omitObject)(rest, [
|
|
274
|
+
"value",
|
|
275
|
+
"onChange",
|
|
276
|
+
"onCancel",
|
|
277
|
+
"onSubmit",
|
|
278
|
+
"onEdit"
|
|
279
|
+
]),
|
|
266
280
|
ref: (0, import_utils.mergeRefs)(submitRef, ref),
|
|
267
281
|
type: "button",
|
|
268
282
|
disabled,
|
|
@@ -274,7 +288,13 @@ var useEditable = (props) => {
|
|
|
274
288
|
const getCancelProps = (0, import_react.useCallback)(
|
|
275
289
|
(props2 = {}, ref = null) => ({
|
|
276
290
|
...props2,
|
|
277
|
-
...(0, import_utils.omitObject)(rest, [
|
|
291
|
+
...(0, import_utils.omitObject)(rest, [
|
|
292
|
+
"value",
|
|
293
|
+
"onChange",
|
|
294
|
+
"onCancel",
|
|
295
|
+
"onSubmit",
|
|
296
|
+
"onEdit"
|
|
297
|
+
]),
|
|
278
298
|
ref: (0, import_utils.mergeRefs)(cancelRef, ref),
|
|
279
299
|
type: "button",
|
|
280
300
|
disabled,
|
package/dist/editable.mjs
CHANGED
package/dist/index.js
CHANGED
|
@@ -52,7 +52,9 @@ var useEditable = (props) => {
|
|
|
52
52
|
...rest
|
|
53
53
|
} = (0, import_form_control.useFormControlProps)(props);
|
|
54
54
|
rest.onEdit = (0, import_utils.useCallbackRef)(rest.onEdit);
|
|
55
|
-
const [isEditing, setIsEditing] = (0, import_react.useState)(
|
|
55
|
+
const [isEditing, setIsEditing] = (0, import_react.useState)(
|
|
56
|
+
!!startWithEditView && !disabled
|
|
57
|
+
);
|
|
56
58
|
const [value, setValue] = (0, import_use_controllable_state.useControllableState)({
|
|
57
59
|
defaultValue: defaultValue || "",
|
|
58
60
|
value: rest.value,
|
|
@@ -252,7 +254,13 @@ var useEditable = (props) => {
|
|
|
252
254
|
const getEditProps = (0, import_react.useCallback)(
|
|
253
255
|
(props2 = {}, ref = null) => ({
|
|
254
256
|
...props2,
|
|
255
|
-
...(0, import_utils.omitObject)(rest, [
|
|
257
|
+
...(0, import_utils.omitObject)(rest, [
|
|
258
|
+
"value",
|
|
259
|
+
"onChange",
|
|
260
|
+
"onCancel",
|
|
261
|
+
"onSubmit",
|
|
262
|
+
"onEdit"
|
|
263
|
+
]),
|
|
256
264
|
ref: (0, import_utils.mergeRefs)(ref, editRef),
|
|
257
265
|
type: "button",
|
|
258
266
|
disabled,
|
|
@@ -264,7 +272,13 @@ var useEditable = (props) => {
|
|
|
264
272
|
const getSubmitProps = (0, import_react.useCallback)(
|
|
265
273
|
(props2 = {}, ref = null) => ({
|
|
266
274
|
...props2,
|
|
267
|
-
...(0, import_utils.omitObject)(rest, [
|
|
275
|
+
...(0, import_utils.omitObject)(rest, [
|
|
276
|
+
"value",
|
|
277
|
+
"onChange",
|
|
278
|
+
"onCancel",
|
|
279
|
+
"onSubmit",
|
|
280
|
+
"onEdit"
|
|
281
|
+
]),
|
|
268
282
|
ref: (0, import_utils.mergeRefs)(submitRef, ref),
|
|
269
283
|
type: "button",
|
|
270
284
|
disabled,
|
|
@@ -276,7 +290,13 @@ var useEditable = (props) => {
|
|
|
276
290
|
const getCancelProps = (0, import_react.useCallback)(
|
|
277
291
|
(props2 = {}, ref = null) => ({
|
|
278
292
|
...props2,
|
|
279
|
-
...(0, import_utils.omitObject)(rest, [
|
|
293
|
+
...(0, import_utils.omitObject)(rest, [
|
|
294
|
+
"value",
|
|
295
|
+
"onChange",
|
|
296
|
+
"onCancel",
|
|
297
|
+
"onSubmit",
|
|
298
|
+
"onEdit"
|
|
299
|
+
]),
|
|
280
300
|
ref: (0, import_utils.mergeRefs)(cancelRef, ref),
|
|
281
301
|
type: "button",
|
|
282
302
|
disabled,
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yamada-ui/editable",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"description": "Yamada UI editable component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yamada",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"url": "https://github.com/hirotomoyamada/yamada-ui/issues"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@yamada-ui/core": "0.5.
|
|
39
|
-
"@yamada-ui/utils": "0.1.
|
|
40
|
-
"@yamada-ui/form-control": "0.2.
|
|
41
|
-
"@yamada-ui/use-controllable-state": "0.1.
|
|
42
|
-
"@yamada-ui/use-focus": "0.1.
|
|
38
|
+
"@yamada-ui/core": "0.5.3",
|
|
39
|
+
"@yamada-ui/utils": "0.1.4",
|
|
40
|
+
"@yamada-ui/form-control": "0.2.8",
|
|
41
|
+
"@yamada-ui/use-controllable-state": "0.1.5",
|
|
42
|
+
"@yamada-ui/use-focus": "0.1.4"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"react": "^18.0.0",
|