@dmitryvim/form-builder 0.3.1 → 0.3.2
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/README.md +32 -6
- package/dist/browser/formbuilder.min.js +71 -71
- package/dist/browser/{formbuilder.v0.3.1.min.js → formbuilder.v0.3.2.min.js} +71 -71
- package/dist/cjs/index.cjs +68 -48
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +65 -47
- package/dist/esm/index.js.map +1 -1
- package/dist/form-builder.js +71 -71
- package/dist/types/utils/styles.d.ts +15 -0
- package/package.json +1 -1
|
@@ -37,6 +37,21 @@ export declare function ensureThemingHooks(doc: Document): void;
|
|
|
37
37
|
* makes the total box (border + padding + content) equal scrollHeight, which
|
|
38
38
|
* leaves the content area short by `2 * border-width` — at compact density
|
|
39
39
|
* (8px padding, 21px line-height) that's enough to clip a single line.
|
|
40
|
+
*
|
|
41
|
+
* Deferred-layout recovery (v0.3.2):
|
|
42
|
+
* A `ResizeObserver` re-runs `resize()` whenever the textarea's content-box
|
|
43
|
+
* WIDTH changes. Two host patterns the one-shot `setTimeout(0)` below can't
|
|
44
|
+
* survive on its own:
|
|
45
|
+
* 1. Form mounted inside a still-hidden / 0-width container (e.g. inactive
|
|
46
|
+
* tab, collapsed accordion, modal that isn't open yet). At setTimeout
|
|
47
|
+
* firing time `scrollHeight === 0` → height collapses to ~borderY (~2px).
|
|
48
|
+
* Once the host reveals the container, width transitions 0 → real and we
|
|
49
|
+
* re-measure.
|
|
50
|
+
* 2. Responsive width changes (host resizes the column). Wrapped content
|
|
51
|
+
* re-flows so the textarea grows/shrinks to fit.
|
|
52
|
+
* Loop guard: `resize()` only writes the HEIGHT, so we ignore observer fires
|
|
53
|
+
* where width hasn't moved — otherwise our own height writes would feed back
|
|
54
|
+
* into the observer.
|
|
40
55
|
*/
|
|
41
56
|
export declare function applyAutoExpand(textarea: HTMLTextAreaElement): void;
|
|
42
57
|
/**
|