@dmitryvim/form-builder 0.3.1 → 0.3.3
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.3.min.js} +71 -71
- package/dist/cjs/index.cjs +80 -49
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +77 -48
- package/dist/esm/index.js.map +1 -1
- package/dist/form-builder.js +71 -71
- package/dist/types/instance/FormBuilderInstance.d.ts +1 -0
- package/dist/types/types/state.d.ts +10 -0
- package/dist/types/utils/styles.d.ts +15 -0
- package/package.json +1 -1
|
@@ -13,4 +13,14 @@ export interface State {
|
|
|
13
13
|
syntheticElementIds: WeakMap<Element, string>;
|
|
14
14
|
/** Counter for generating unique synthetic IDs. */
|
|
15
15
|
syntheticElementIdCounter: number;
|
|
16
|
+
/**
|
|
17
|
+
* Pending MutationObservers from setupEnableIfListeners that are waiting for a
|
|
18
|
+
* dependency input to appear in the DOM. They must be disconnected on destroy()
|
|
19
|
+
* (and on every renderForm) — otherwise they survive the instance lifecycle and
|
|
20
|
+
* later attach orphan change/input listeners to inputs of a *new* instance that
|
|
21
|
+
* happens to mount into the same container, causing
|
|
22
|
+
* "Cannot re-evaluate enableIf: formRoot is null" once the orphan callbacks fire
|
|
23
|
+
* with a torn-down ctx. Reproducible under React StrictMode (double mount).
|
|
24
|
+
*/
|
|
25
|
+
enableIfObservers: Set<MutationObserver>;
|
|
16
26
|
}
|
|
@@ -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
|
/**
|