@zag-js/editable
Advanced tools
Comparing version 0.0.0-dev-20220517103524 to 0.0.0-dev-20220518181822
@@ -109,3 +109,6 @@ import type { StateMachine as S } from "@zag-js/core"; | ||
*/ | ||
placeholder?: string; | ||
placeholder?: string | { | ||
edit: string; | ||
preview: string; | ||
}; | ||
/** | ||
@@ -112,0 +115,0 @@ * Specifies the localized strings that identifies the accessibility elements and their states |
@@ -267,2 +267,4 @@ var __defProp = Object.defineProperty; | ||
const isEditing = state.matches("edit"); | ||
const _placeholder = state.context.placeholder; | ||
const placeholder = typeof _placeholder === "string" ? { edit: _placeholder, preview: _placeholder } : _placeholder; | ||
return { | ||
@@ -325,3 +327,3 @@ isEditing, | ||
hidden: autoResize ? void 0 : !isEditing, | ||
placeholder: state.context.placeholder, | ||
placeholder: placeholder == null ? void 0 : placeholder.edit, | ||
disabled: isDisabled, | ||
@@ -380,3 +382,3 @@ "data-disabled": dataAttr(isDisabled), | ||
"data-invalid": dataAttr(isInvalid), | ||
children: isValueEmpty ? state.context.placeholder : state.context.value, | ||
children: isValueEmpty ? placeholder == null ? void 0 : placeholder.preview : state.context.value, | ||
hidden: autoResize ? void 0 : isEditing, | ||
@@ -383,0 +385,0 @@ tabIndex: isInteractive && state.context.isPreviewFocusable ? 0 : void 0, |
{ | ||
"name": "@zag-js/editable", | ||
"version": "0.0.0-dev-20220517103524", | ||
"version": "0.0.0-dev-20220518181822", | ||
"description": "Core logic for the editable widget implemented as a state machine", | ||
@@ -32,5 +32,5 @@ "keywords": [ | ||
"dependencies": { | ||
"@zag-js/core": "0.0.0-dev-20220517103524", | ||
"@zag-js/core": "0.1.4", | ||
"@zag-js/dom-utils": "0.1.1", | ||
"@zag-js/types": "0.0.0-dev-20220517103524" | ||
"@zag-js/types": "0.1.1" | ||
}, | ||
@@ -37,0 +37,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
212714
1412
+ Added@zag-js/core@0.1.4(transitive)
+ Added@zag-js/types@0.1.1(transitive)
- Removed@zag-js/core@0.0.0-dev-20220517103524(transitive)
- Removed@zag-js/types@0.0.0-dev-20220517103524(transitive)
Updated@zag-js/core@0.1.4
Updated@zag-js/types@0.1.1