@zag-js/collapsible
Advanced tools
Comparing version 0.77.1 to 0.78.0
@@ -71,2 +71,6 @@ import * as _zag_js_anatomy from '@zag-js/anatomy'; | ||
setOpen(open: boolean): void; | ||
/** | ||
* Function to measure the size of the content. | ||
*/ | ||
measureSize(): void; | ||
getRootProps(): T["element"]; | ||
@@ -73,0 +77,0 @@ getTriggerProps(): T["button"]; |
@@ -33,2 +33,5 @@ 'use strict'; | ||
open, | ||
measureSize() { | ||
send("SIZE.MEASURE"); | ||
}, | ||
setOpen(nextOpen) { | ||
@@ -49,2 +52,3 @@ if (nextOpen === open) return; | ||
...parts.content.attrs, | ||
"data-collapsible": "", | ||
"data-state": skip ? void 0 : open ? "open" : "closed", | ||
@@ -96,3 +100,3 @@ id: dom.getContentId(state.context), | ||
}, | ||
exit: ["clearInitial"], | ||
exit: ["clearInitial", "cleanupNode"], | ||
states: { | ||
@@ -160,3 +164,6 @@ closed: { | ||
} | ||
] | ||
], | ||
"SIZE.MEASURE": { | ||
actions: ["measureSize"] | ||
} | ||
} | ||
@@ -208,2 +215,12 @@ } | ||
}, | ||
cleanupNode(ctx2) { | ||
ctx2.stylesRef = null; | ||
}, | ||
measureSize(ctx2) { | ||
const contentEl = dom.getContentEl(ctx2); | ||
if (!contentEl) return; | ||
const { height, width } = contentEl.getBoundingClientRect(); | ||
ctx2.height = height; | ||
ctx2.width = width; | ||
}, | ||
computeSize(ctx2, evt) { | ||
@@ -210,0 +227,0 @@ ctx2._rafCleanup?.(); |
{ | ||
"name": "@zag-js/collapsible", | ||
"version": "0.77.1", | ||
"version": "0.78.0", | ||
"description": "Core logic for the collapsible widget implemented as a state machine", | ||
@@ -30,7 +30,7 @@ "keywords": [ | ||
"dependencies": { | ||
"@zag-js/anatomy": "0.77.1", | ||
"@zag-js/core": "0.77.1", | ||
"@zag-js/dom-query": "0.77.1", | ||
"@zag-js/utils": "0.77.1", | ||
"@zag-js/types": "0.77.1" | ||
"@zag-js/anatomy": "0.78.0", | ||
"@zag-js/core": "0.78.0", | ||
"@zag-js/dom-query": "0.78.0", | ||
"@zag-js/utils": "0.78.0", | ||
"@zag-js/types": "0.78.0" | ||
}, | ||
@@ -37,0 +37,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
26802
630
+ Added@zag-js/anatomy@0.78.0(transitive)
+ Added@zag-js/core@0.78.0(transitive)
+ Added@zag-js/dom-query@0.78.0(transitive)
+ Added@zag-js/store@0.78.0(transitive)
+ Added@zag-js/types@0.78.0(transitive)
+ Added@zag-js/utils@0.78.0(transitive)
+ Addedproxy-compare@3.0.1(transitive)
- Removed@zag-js/anatomy@0.77.1(transitive)
- Removed@zag-js/core@0.77.1(transitive)
- Removed@zag-js/dom-query@0.77.1(transitive)
- Removed@zag-js/store@0.77.1(transitive)
- Removed@zag-js/types@0.77.1(transitive)
- Removed@zag-js/utils@0.77.1(transitive)
- Removedproxy-compare@3.0.0(transitive)
Updated@zag-js/anatomy@0.78.0
Updated@zag-js/core@0.78.0
Updated@zag-js/dom-query@0.78.0
Updated@zag-js/types@0.78.0
Updated@zag-js/utils@0.78.0