palistor 0.0.25 → 0.0.27
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 +609 -542
- package/README.ru.md +1015 -0
- package/dist/index.d.ts +16 -27
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -28
- package/dist/index.js.map +1 -1
- package/dist/react/createTrackingProxy.d.ts +27 -27
- package/dist/react/createTrackingProxy.d.ts.map +1 -1
- package/dist/react/createTrackingProxy.js +54 -53
- package/dist/react/createTrackingProxy.js.map +1 -1
- package/dist/react/useForm.d.ts +42 -43
- package/dist/react/useForm.d.ts.map +1 -1
- package/dist/react/useForm.js +38 -38
- package/dist/react/useForm.js.map +1 -1
- package/dist/react/usePersist.d.ts +14 -14
- package/dist/react/usePersist.js +18 -18
- package/dist/react/usePersist.js.map +1 -1
- package/dist/react/useStoreContext.d.ts +11 -11
- package/dist/react/useStoreContext.js +11 -11
- package/dist/react/useTranslator.d.ts +12 -12
- package/dist/react/useTranslator.js +12 -12
- package/dist/store/applyPatch/applyPatch.d.ts +8 -8
- package/dist/store/applyPatch/applyPatch.js +12 -12
- package/dist/store/applyPatch/applyPatch.js.map +1 -1
- package/dist/store/buildProxy/buildEntityProjectionProxy.js +6 -6
- package/dist/store/buildProxy/buildEntityProjectionProxy.js.map +1 -1
- package/dist/store/buildProxy/buildListProxy.d.ts +8 -8
- package/dist/store/buildProxy/buildListProxy.js +30 -30
- package/dist/store/buildProxy/buildListProxy.js.map +1 -1
- package/dist/store/buildProxy/buildProxy.d.ts +8 -8
- package/dist/store/buildProxy/buildProxy.js +39 -39
- package/dist/store/buildProxy/buildProxy.js.map +1 -1
- package/dist/store/buildProxy/computeProxyKeys.d.ts +8 -8
- package/dist/store/buildProxy/computeProxyKeys.js +9 -9
- package/dist/store/buildProxy/computeProxyKeys.js.map +1 -1
- package/dist/store/buildProxy/handleLazyResolve.d.ts +3 -3
- package/dist/store/buildProxy/handleLazyResolve.js +3 -3
- package/dist/store/buildProxy/initProxyCaches.d.ts +5 -5
- package/dist/store/buildProxy/initProxyCaches.js +5 -5
- package/dist/store/compute/computeFieldState.d.ts +3 -3
- package/dist/store/compute/computeFieldState.js +8 -8
- package/dist/store/compute/computeFieldState.js.map +1 -1
- package/dist/store/compute/fieldStateChanged.d.ts +1 -1
- package/dist/store/compute/fieldStateChanged.js +1 -1
- package/dist/store/compute/recompute/collectGroupComputeNodes.d.ts +4 -4
- package/dist/store/compute/recompute/collectGroupComputeNodes.js +7 -7
- package/dist/store/compute/recompute/collectGroupComputeNodes.js.map +1 -1
- package/dist/store/compute/recompute/recomputeAndNotify.d.ts +3 -3
- package/dist/store/compute/recompute/recomputeAndNotify.js +3 -3
- package/dist/store/compute/recompute/recomputeLeaves.d.ts +11 -10
- package/dist/store/compute/recompute/recomputeLeaves.d.ts.map +1 -1
- package/dist/store/compute/recompute/recomputeLeaves.js +26 -27
- package/dist/store/compute/recompute/recomputeLeaves.js.map +1 -1
- package/dist/store/compute/recompute/recomputeTargeted.d.ts +7 -7
- package/dist/store/compute/recompute/recomputeTargeted.js +12 -12
- package/dist/store/compute/recompute/recomputeTargeted.js.map +1 -1
- package/dist/store/compute/recompute/topologicalSortComputed.d.ts +4 -4
- package/dist/store/compute/recompute/topologicalSortComputed.d.ts.map +1 -1
- package/dist/store/compute/recompute/topologicalSortComputed.js +11 -13
- package/dist/store/compute/recompute/topologicalSortComputed.js.map +1 -1
- package/dist/store/compute/recompute/types.d.ts +4 -4
- package/dist/store/compute/resolveFlag.d.ts +2 -2
- package/dist/store/compute/resolveFlag.js +2 -2
- package/dist/store/compute/resolveString.d.ts +5 -5
- package/dist/store/compute/resolveString.js +6 -6
- package/dist/store/compute/resolveString.js.map +1 -1
- package/dist/store/compute/types.d.ts +3 -3
- package/dist/store/constants.d.ts +48 -48
- package/dist/store/constants.d.ts.map +1 -1
- package/dist/store/constants.js +45 -45
- package/dist/store/defineFieldMapping.d.ts +21 -19
- package/dist/store/defineFieldMapping.d.ts.map +1 -1
- package/dist/store/defineFieldMapping.js +21 -19
- package/dist/store/defineFieldMapping.js.map +1 -1
- package/dist/store/dirtyTracking/collectInitialSnapshot.js +1 -1
- package/dist/store/dirtyTracking/collectInitialSnapshot.js.map +1 -1
- package/dist/store/dirtyTracking/recomputeDirtyTargeted.d.ts +3 -3
- package/dist/store/dirtyTracking/recomputeDirtyTargeted.js +11 -11
- package/dist/store/dirtyTracking/recomputeDirtyTargeted.js.map +1 -1
- package/dist/store/dirtyTracking/setGroupRevalidate.d.ts +6 -6
- package/dist/store/dirtyTracking/setGroupRevalidate.js +7 -7
- package/dist/store/dirtyTracking/setGroupRevalidate.js.map +1 -1
- package/dist/store/entityRegistry/entityRegistry.d.ts +72 -72
- package/dist/store/entityRegistry/entityRegistry.d.ts.map +1 -1
- package/dist/store/entityRegistry/entityRegistry.js +91 -91
- package/dist/store/entityRegistry/entityRegistry.js.map +1 -1
- package/dist/store/entityRegistry/generateId.d.ts +3 -3
- package/dist/store/entityRegistry/generateId.js +3 -3
- package/dist/store/entityRegistry/types.d.ts +17 -17
- package/dist/store/entityRegistry/types.d.ts.map +1 -1
- package/dist/store/flow/buildFlowStepsProxy.d.ts +9 -9
- package/dist/store/flow/buildFlowStepsProxy.js +13 -13
- package/dist/store/flow/buildFlowStepsProxy.js.map +1 -1
- package/dist/store/flow/defineFlow.d.ts +27 -25
- package/dist/store/flow/defineFlow.d.ts.map +1 -1
- package/dist/store/flow/defineFlow.js +15 -13
- package/dist/store/flow/defineFlow.js.map +1 -1
- package/dist/store/flow/flowApi.d.ts +3 -2
- package/dist/store/flow/flowApi.d.ts.map +1 -1
- package/dist/store/flow/flowApi.js +1 -1
- package/dist/store/flow/flowApi.js.map +1 -1
- package/dist/store/flow/flowNavigation.d.ts +65 -63
- package/dist/store/flow/flowNavigation.d.ts.map +1 -1
- package/dist/store/flow/flowNavigation.js +74 -72
- package/dist/store/flow/flowNavigation.js.map +1 -1
- package/dist/store/flow/flowState.d.ts +16 -16
- package/dist/store/flow/flowState.d.ts.map +1 -1
- package/dist/store/flow/flowState.js +5 -5
- package/dist/store/flow/flowState.js.map +1 -1
- package/dist/store/groupDeps/createGroupDeps.d.ts +3 -3
- package/dist/store/groupDeps/createGroupDeps.js +6 -6
- package/dist/store/groupDeps/createGroupDeps.js.map +1 -1
- package/dist/store/groupDeps/createTrackingValues.d.ts +9 -9
- package/dist/store/groupDeps/createTrackingValues.js +11 -11
- package/dist/store/groupDeps/createTrackingValues.js.map +1 -1
- package/dist/store/groupDeps/getNodeGroupPath.d.ts +3 -3
- package/dist/store/groupDeps/getNodeGroupPath.js +5 -5
- package/dist/store/groupDeps/getNodeGroupPath.js.map +1 -1
- package/dist/store/groupDeps/getRecipientGroups.d.ts +1 -1
- package/dist/store/groupDeps/getRecipientGroups.js +1 -1
- package/dist/store/groupDeps/groupDeps.d.ts +7 -7
- package/dist/store/groupDeps/groupDeps.js +7 -7
- package/dist/store/groupDeps/pairKey.d.ts +3 -3
- package/dist/store/groupDeps/pairKey.d.ts.map +1 -1
- package/dist/store/groupDeps/pairKey.js +4 -4
- package/dist/store/groupDeps/pairKey.js.map +1 -1
- package/dist/store/groupDeps/resolveGroupByPath.d.ts +3 -3
- package/dist/store/groupDeps/resolveGroupByPath.js +3 -3
- package/dist/store/init/createNotificationHub.d.ts +31 -31
- package/dist/store/init/createNotificationHub.d.ts.map +1 -1
- package/dist/store/init/createNotificationHub.js +36 -37
- package/dist/store/init/createNotificationHub.js.map +1 -1
- package/dist/store/init/createResolveManager.d.ts +72 -69
- package/dist/store/init/createResolveManager.d.ts.map +1 -1
- package/dist/store/init/createResolveManager.js +101 -98
- package/dist/store/init/createResolveManager.js.map +1 -1
- package/dist/store/init/initGroupSubmitting.d.ts +2 -2
- package/dist/store/init/initGroupSubmitting.js +4 -4
- package/dist/store/init/initGroupSubmitting.js.map +1 -1
- package/dist/store/normalizeConfig.d.ts +20 -18
- package/dist/store/normalizeConfig.d.ts.map +1 -1
- package/dist/store/normalizeConfig.js +31 -29
- package/dist/store/normalizeConfig.js.map +1 -1
- package/dist/store/onChangePipeline/computeFieldKey.d.ts +2 -2
- package/dist/store/onChangePipeline/computeFieldKey.js +2 -2
- package/dist/store/onChangePipeline/findOnChangeAncestors.d.ts +2 -2
- package/dist/store/onChangePipeline/findOnChangeAncestors.js +4 -4
- package/dist/store/onChangePipeline/findOnChangeAncestors.js.map +1 -1
- package/dist/store/onChangePipeline/onChangePipeline.d.ts +13 -12
- package/dist/store/onChangePipeline/onChangePipeline.d.ts.map +1 -1
- package/dist/store/onChangePipeline/onChangePipeline.js +14 -13
- package/dist/store/onChangePipeline/onChangePipeline.js.map +1 -1
- package/dist/store/persist/drivers.d.ts +7 -7
- package/dist/store/persist/drivers.js +8 -8
- package/dist/store/persist/drivers.js.map +1 -1
- package/dist/store/persist/index.d.ts +1 -1
- package/dist/store/persist/persistManager.d.ts +23 -23
- package/dist/store/persist/persistManager.d.ts.map +1 -1
- package/dist/store/persist/persistManager.js +51 -51
- package/dist/store/persist/persistManager.js.map +1 -1
- package/dist/store/persist/types.d.ts +23 -23
- package/dist/store/persist/types.d.ts.map +1 -1
- package/dist/store/persist/types.js +4 -4
- package/dist/store/resetPipeline/buildResetPatch.d.ts +5 -5
- package/dist/store/resetPipeline/buildResetPatch.js +5 -5
- package/dist/store/resetPipeline/collectDefaults.d.ts +5 -5
- package/dist/store/resetPipeline/collectDefaults.js +6 -6
- package/dist/store/resetPipeline/collectDefaults.js.map +1 -1
- package/dist/store/resetPipeline/resetPipeline.d.ts +7 -7
- package/dist/store/resetPipeline/resetPipeline.js +15 -15
- package/dist/store/resetPipeline/resetPipeline.js.map +1 -1
- package/dist/store/resolvePipeline/applyPendingWrites.d.ts +10 -10
- package/dist/store/resolvePipeline/applyPendingWrites.d.ts.map +1 -1
- package/dist/store/resolvePipeline/applyPendingWrites.js +35 -38
- package/dist/store/resolvePipeline/applyPendingWrites.js.map +1 -1
- package/dist/store/resolvePipeline/createContextTrackingProxy.d.ts +8 -7
- package/dist/store/resolvePipeline/createContextTrackingProxy.d.ts.map +1 -1
- package/dist/store/resolvePipeline/createContextTrackingProxy.js +6 -5
- package/dist/store/resolvePipeline/createContextTrackingProxy.js.map +1 -1
- package/dist/store/resolvePipeline/createValuesTrackingProxy.d.ts +43 -43
- package/dist/store/resolvePipeline/createValuesTrackingProxy.d.ts.map +1 -1
- package/dist/store/resolvePipeline/createValuesTrackingProxy.js +70 -70
- package/dist/store/resolvePipeline/createValuesTrackingProxy.js.map +1 -1
- package/dist/store/resolvePipeline/executeListResolve.d.ts +14 -14
- package/dist/store/resolvePipeline/executeListResolve.js +27 -27
- package/dist/store/resolvePipeline/executeListResolve.js.map +1 -1
- package/dist/store/resolvePipeline/executeResolve.d.ts +15 -15
- package/dist/store/resolvePipeline/executeResolve.js +46 -46
- package/dist/store/resolvePipeline/executeResolve.js.map +1 -1
- package/dist/store/store/NodeRegistry/nodeRegistry.d.ts +61 -61
- package/dist/store/store/NodeRegistry/nodeRegistry.d.ts.map +1 -1
- package/dist/store/store/NodeRegistry/nodeRegistry.js +85 -86
- package/dist/store/store/NodeRegistry/nodeRegistry.js.map +1 -1
- package/dist/store/store/NodeRegistry/nodeUtils.d.ts +5 -5
- package/dist/store/store/NodeRegistry/nodeUtils.d.ts.map +1 -1
- package/dist/store/store/NodeRegistry/nodeUtils.js +5 -5
- package/dist/store/store/NodeRegistry/nodeUtils.js.map +1 -1
- package/dist/store/store/groupDepsMap.d.ts +23 -23
- package/dist/store/store/groupDepsMap.d.ts.map +1 -1
- package/dist/store/store/groupDepsMap.js +35 -34
- package/dist/store/store/groupDepsMap.js.map +1 -1
- package/dist/store/store/hasComputedProps.d.ts +2 -2
- package/dist/store/store/hasComputedProps.js +2 -2
- package/dist/store/store/nodeMap.d.ts +5 -5
- package/dist/store/store/nodeMap.js +7 -7
- package/dist/store/store/nodeMap.js.map +1 -1
- package/dist/store/store/palistor.d.ts +80 -80
- package/dist/store/store/palistor.d.ts.map +1 -1
- package/dist/store/store/palistor.js +149 -169
- package/dist/store/store/palistor.js.map +1 -1
- package/dist/store/store/registerNodes.d.ts +10 -10
- package/dist/store/store/registerNodes.js +15 -15
- package/dist/store/store/registerNodes.js.map +1 -1
- package/dist/store/store/serviceRegistry.d.ts +8 -8
- package/dist/store/store/serviceRegistry.d.ts.map +1 -1
- package/dist/store/store/serviceRegistry.js +8 -8
- package/dist/store/store/serviceRegistry.js.map +1 -1
- package/dist/store/store/types.d.ts +236 -234
- package/dist/store/store/types.d.ts.map +1 -1
- package/dist/store/submitPipeline/applyLeafBeforeSubmit.d.ts +2 -2
- package/dist/store/submitPipeline/applyLeafBeforeSubmit.js +2 -2
- package/dist/store/submitPipeline/collectLeafStates.d.ts +2 -2
- package/dist/store/submitPipeline/collectLeafStates.js +2 -2
- package/dist/store/submitPipeline/submitPipeline.d.ts +8 -8
- package/dist/store/submitPipeline/submitPipeline.js +12 -12
- package/dist/store/submitPipeline/submitPipeline.js.map +1 -1
- package/dist/store/submitPipeline/types.d.ts +1 -1
- package/dist/store/submitPipeline/types.d.ts.map +1 -1
- package/dist/store/traversal/nodeClassifier.d.ts +9 -9
- package/dist/store/traversal/nodeClassifier.d.ts.map +1 -1
- package/dist/store/traversal/nodeClassifier.js +11 -11
- package/dist/store/traversal/nodeClassifier.js.map +1 -1
- package/dist/store/traversal/walkFull.d.ts +14 -14
- package/dist/store/traversal/walkFull.js +2 -2
- package/dist/store/valuesCache/valuesCache.d.ts +9 -9
- package/dist/store/valuesCache/valuesCache.d.ts.map +1 -1
- package/dist/store/valuesCache/valuesCache.js +6 -6
- package/dist/store/writePipeline/formatPatch.d.ts +5 -5
- package/dist/store/writePipeline/formatPatch.js +7 -7
- package/dist/store/writePipeline/formatPatch.js.map +1 -1
- package/dist/store/writePipeline/formatValue.d.ts +5 -5
- package/dist/store/writePipeline/formatValue.js +5 -5
- package/dist/store/writePipeline/mergeChanged.d.ts +4 -4
- package/dist/store/writePipeline/mergeChanged.js +4 -4
- package/dist/store/writePipeline/runSetter.d.ts +6 -6
- package/dist/store/writePipeline/runSetter.js +8 -8
- package/dist/store/writePipeline/storeValue.d.ts +3 -3
- package/dist/store/writePipeline/storeValue.js +3 -3
- package/dist/store/writePipeline/types.d.ts +4 -4
- package/dist/store/writePipeline/types.d.ts.map +1 -1
- package/dist/store/writePipeline/writePipeline.d.ts +7 -7
- package/dist/store/writePipeline/writePipeline.d.ts.map +1 -1
- package/dist/store/writePipeline/writePipeline.js +15 -15
- package/dist/store/writePipeline/writePipeline.js.map +1 -1
- package/package.json +11 -4
|
@@ -4,20 +4,21 @@ import type { ComputeEntry } from "../../store/registerNodes";
|
|
|
4
4
|
import { type ValuesCache } from "../../valuesCache/valuesCache";
|
|
5
5
|
import type { TrackingWrap } from "./types";
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Recompute the computed state for a given list of leaf nodes.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* Phase 1: recompute computed values (value is a function) in topological order.
|
|
10
|
+
* Phase 2: recompute FieldState (isVisible, isRequired, error…) for all fields.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
12
|
+
* Each node receives group-scoped values — the parent group's values from
|
|
13
|
+
* nodeSlot. This lets a config write functions in terms of its own group
|
|
14
|
+
* (no navigation from the root), even when the config is nested inside a
|
|
15
|
+
* global store. Cross-group dependencies use explicit navigation through the
|
|
16
|
+
* parent object.
|
|
16
17
|
*
|
|
17
|
-
* @param trackingWrap —
|
|
18
|
-
*
|
|
18
|
+
* @param trackingWrap — optional wrapper for tracking cross-group dependencies.
|
|
19
|
+
* When provided, group-scoped values are wrapped by it.
|
|
19
20
|
*
|
|
20
|
-
*
|
|
21
|
+
* Returns the Set of nodes whose state changed (for notify).
|
|
21
22
|
*/
|
|
22
23
|
export declare function recomputeLeaves(computeNodes: ComputeEntry[], nodeState: WeakMap<object, FieldState>, valuesCache: ValuesCache, translate: TranslateFn, trackingWrap?: TrackingWrap): Set<object>;
|
|
23
24
|
//# sourceMappingURL=recomputeLeaves.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recomputeLeaves.d.ts","sourceRoot":"","sources":["../../../../store/compute/recompute/recomputeLeaves.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAwC,MAAM,UAAU,CAAC;AACjF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAA0B,KAAK,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEzF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C
|
|
1
|
+
{"version":3,"file":"recomputeLeaves.d.ts","sourceRoot":"","sources":["../../../../store/compute/recompute/recomputeLeaves.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAwC,MAAM,UAAU,CAAC;AACjF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAA0B,KAAK,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEzF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAC7B,YAAY,EAAE,YAAY,EAAE,EAC5B,SAAS,EAAE,OAAO,CAAC,MAAM,EAAE,UAAU,CAAC,EACtC,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,WAAW,EACtB,YAAY,CAAC,EAAE,YAAY,GAC1B,GAAG,CAAC,MAAM,CAAC,CA4Db"}
|
|
@@ -2,60 +2,60 @@ import { computeFieldState, fieldStateChanged } from "../index";
|
|
|
2
2
|
import { updateValuesCacheEntry } from "../../valuesCache/valuesCache";
|
|
3
3
|
import { topologicalSortComputed } from "./topologicalSortComputed";
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Recompute the computed state for a given list of leaf nodes.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* Phase 1: recompute computed values (value is a function) in topological order.
|
|
8
|
+
* Phase 2: recompute FieldState (isVisible, isRequired, error…) for all fields.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
10
|
+
* Each node receives group-scoped values — the parent group's values from
|
|
11
|
+
* nodeSlot. This lets a config write functions in terms of its own group
|
|
12
|
+
* (no navigation from the root), even when the config is nested inside a
|
|
13
|
+
* global store. Cross-group dependencies use explicit navigation through the
|
|
14
|
+
* parent object.
|
|
14
15
|
*
|
|
15
|
-
* @param trackingWrap —
|
|
16
|
-
*
|
|
16
|
+
* @param trackingWrap — optional wrapper for tracking cross-group dependencies.
|
|
17
|
+
* When provided, group-scoped values are wrapped by it.
|
|
17
18
|
*
|
|
18
|
-
*
|
|
19
|
+
* Returns the Set of nodes whose state changed (for notify).
|
|
19
20
|
*/
|
|
20
21
|
export function recomputeLeaves(computeNodes, nodeState, valuesCache, translate, trackingWrap) {
|
|
21
|
-
// ──
|
|
22
|
+
// ── Phase 1: recompute computed values ───────────────────────────────────
|
|
22
23
|
const computedEntries = computeNodes.filter(({ node }) => typeof node.value === "function");
|
|
23
24
|
const changed = new Set();
|
|
24
25
|
if (computedEntries.length > 0) {
|
|
25
26
|
const sorted = topologicalSortComputed(computedEntries);
|
|
26
27
|
for (const { node } of sorted) {
|
|
27
|
-
//
|
|
28
|
-
//
|
|
28
|
+
// Group-scoped values: the parent object from nodeSlot, so the computed
|
|
29
|
+
// function works in terms of its group rather than the global root.
|
|
29
30
|
const groupValues = valuesCache.nodeSlot.get(node)?.parent ?? valuesCache.values;
|
|
30
31
|
const currentValues = trackingWrap ? trackingWrap(node, groupValues) : groupValues;
|
|
31
32
|
const state = nodeState.get(node);
|
|
32
33
|
if (!state)
|
|
33
|
-
continue; //
|
|
34
|
-
//
|
|
35
|
-
// node.value
|
|
34
|
+
continue; // Node not initialized yet — skip silently; Phase 2 falls back to prev?.value ?? "".
|
|
35
|
+
// Compute the new value from the current snapshot.
|
|
36
|
+
// node.value here is a selector like (values) => values.a + values.b.
|
|
36
37
|
const computedValue = node.value(currentValues);
|
|
37
|
-
//
|
|
38
|
-
//
|
|
39
|
-
//
|
|
40
|
-
// Phase 2 всё равно возьмёт prev?.value ?? "".
|
|
38
|
+
// Reference comparison (===): the computed function must return a stable
|
|
39
|
+
// reference when the content is unchanged; otherwise Phase 2 needlessly
|
|
40
|
+
// recomputes downstream nodes.
|
|
41
41
|
if (state && state.value !== computedValue) {
|
|
42
42
|
nodeState.set(node, { ...state, value: computedValue });
|
|
43
|
-
//
|
|
44
|
-
//
|
|
43
|
+
// Mutate valuesCache.values in place via the slot (O(1)) so nodes later
|
|
44
|
+
// in the topological order already see the updated value.
|
|
45
45
|
updateValuesCacheEntry(valuesCache, node, computedValue);
|
|
46
46
|
changed.add(node);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
// ──
|
|
50
|
+
// ── Phase 2: recompute FieldState (flags, validation, strings) ───────────
|
|
51
51
|
for (const { node } of computeNodes) {
|
|
52
52
|
const prev = nodeState.get(node);
|
|
53
53
|
const currentValue = prev?.value ?? "";
|
|
54
54
|
// Preserve revalidate flag: skip validation when revalidate is false
|
|
55
55
|
const revalidate = prev?.revalidate ?? false;
|
|
56
|
-
// Group-scoped values: config functions
|
|
57
|
-
//
|
|
58
|
-
//
|
|
56
|
+
// Group-scoped values: config functions see their own group's values, not
|
|
57
|
+
// the global root — isVisible/validate/value are written in terms of the
|
|
58
|
+
// current context regardless of nesting depth.
|
|
59
59
|
const groupValues = valuesCache.nodeSlot.get(node)?.parent ?? valuesCache.values;
|
|
60
60
|
const allValues = trackingWrap ? trackingWrap(node, groupValues) : groupValues;
|
|
61
61
|
const next = computeFieldState(node, currentValue, allValues, revalidate, translate);
|
|
@@ -66,7 +66,6 @@ export function recomputeLeaves(computeNodes, nodeState, valuesCache, translate,
|
|
|
66
66
|
next.dirty = prev.dirty;
|
|
67
67
|
if (prev?.revalidate !== undefined)
|
|
68
68
|
next.revalidate = prev.revalidate;
|
|
69
|
-
// Проверяем, изменилось ли что-то
|
|
70
69
|
if (prev && !fieldStateChanged(prev, next))
|
|
71
70
|
continue;
|
|
72
71
|
nodeState.set(node, next);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recomputeLeaves.js","sourceRoot":"","sources":["../../../../store/compute/recompute/recomputeLeaves.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAGjF,OAAO,EAAE,sBAAsB,EAAoB,MAAM,+BAA+B,CAAC;AACzF,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAGpE
|
|
1
|
+
{"version":3,"file":"recomputeLeaves.js","sourceRoot":"","sources":["../../../../store/compute/recompute/recomputeLeaves.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAGjF,OAAO,EAAE,sBAAsB,EAAoB,MAAM,+BAA+B,CAAC;AACzF,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAGpE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,eAAe,CAC7B,YAA4B,EAC5B,SAAsC,EACtC,WAAwB,EACxB,SAAsB,EACtB,YAA2B;IAE3B,4EAA4E;IAC5E,MAAM,eAAe,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,OAAO,IAAI,CAAC,KAAK,KAAK,UAAU,CAAC,CAAC;IAC5F,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC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,EAAE,CAAC;QACvC,qEAAqE;QACrE,MAAM,UAAU,GAAG,IAAI,EAAE,UAAU,IAAI,KAAK,CAAC;QAC7C,0EAA0E;QAC1E,yEAAyE;QACzE,+CAA+C;QAC/C,MAAM,WAAW,GAAG,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,IAAI,WAAW,CAAC,MAAM,CAAC;QACjF,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;QAC/E,MAAM,IAAI,GAAG,iBAAiB,CAAC,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;QAErF,mEAAmE;QACnE,IAAI,IAAI,EAAE,UAAU,KAAK,SAAS;YAAE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QACtE,IAAI,IAAI,EAAE,KAAK,KAAK,SAAS;YAAE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACvD,IAAI,IAAI,EAAE,UAAU,KAAK,SAAS;YAAE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QAEtE,IAAI,IAAI,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC;YAAE,SAAS;QAErD,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC1B,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { RecomputeTargetedDeps } from "./types";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* Targeted recompute: instead of recomputing ALL groups,
|
|
4
|
+
* recomputes only the affected groups + their recipients.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* 1.
|
|
8
|
-
* 2. BFS
|
|
9
|
-
* 3.
|
|
6
|
+
* Algorithm:
|
|
7
|
+
* 1. Determine the groups of the changed nodes (source groups).
|
|
8
|
+
* 2. BFS over the dependency map: collect all recipient groups in topological order.
|
|
9
|
+
* 3. For each affected group, recompute only its OWN leaves (non-recursively).
|
|
10
10
|
*
|
|
11
|
-
* @param changedNodes —
|
|
11
|
+
* @param changedNodes — nodes whose values changed (the written node + setter targets)
|
|
12
12
|
*/
|
|
13
13
|
export declare function recomputeTargeted(changedNodes: Set<object>, deps: RecomputeTargetedDeps): Set<object>;
|
|
14
14
|
//# sourceMappingURL=recomputeTargeted.d.ts.map
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { getNodeGroupPath, getRecipientGroups, resolveGroupByPath, } from "../../groupDeps/groupDeps";
|
|
2
2
|
import { recomputeLeaves } from "./recomputeLeaves";
|
|
3
|
-
// ───
|
|
3
|
+
// ─── Targeted recompute ──────────────────────────────────────────────────────
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Targeted recompute: instead of recomputing ALL groups,
|
|
6
|
+
* recomputes only the affected groups + their recipients.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
* 1.
|
|
10
|
-
* 2. BFS
|
|
11
|
-
* 3.
|
|
8
|
+
* Algorithm:
|
|
9
|
+
* 1. Determine the groups of the changed nodes (source groups).
|
|
10
|
+
* 2. BFS over the dependency map: collect all recipient groups in topological order.
|
|
11
|
+
* 3. For each affected group, recompute only its OWN leaves (non-recursively).
|
|
12
12
|
*
|
|
13
|
-
* @param changedNodes —
|
|
13
|
+
* @param changedNodes — nodes whose values changed (the written node + setter targets)
|
|
14
14
|
*/
|
|
15
15
|
export function recomputeTargeted(changedNodes, deps) {
|
|
16
16
|
const { rootConfig, groupComputeMap, nodeState, nodeParents, nodePaths, groupDeps, valuesCache, translate, } = deps;
|
|
17
|
-
// 1.
|
|
17
|
+
// 1. Find the source groups of the changes
|
|
18
18
|
const sourceGroups = new Set();
|
|
19
19
|
for (const node of changedNodes) {
|
|
20
20
|
sourceGroups.add(getNodeGroupPath(node, nodeParents, nodePaths));
|
|
21
21
|
}
|
|
22
|
-
// 2. BFS —
|
|
22
|
+
// 2. BFS — collect all affected groups in "donors first, then recipients" order
|
|
23
23
|
const orderedGroups = [...sourceGroups];
|
|
24
24
|
const visited = new Set(sourceGroups);
|
|
25
25
|
let i = 0;
|
|
@@ -33,11 +33,11 @@ export function recomputeTargeted(changedNodes, deps) {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
// 3.
|
|
36
|
+
// 3. Recompute each group (only its OWN leaves, non-recursively)
|
|
37
37
|
const allChanged = new Set();
|
|
38
38
|
for (const groupPath of orderedGroups) {
|
|
39
39
|
const groupNode = resolveGroupByPath(rootConfig, groupPath);
|
|
40
|
-
// Entity
|
|
40
|
+
// Entity groups ("_entity_.*" paths) don't exist in rootConfig — skip
|
|
41
41
|
if (!groupNode)
|
|
42
42
|
continue;
|
|
43
43
|
const ownEntries = groupComputeMap.get(groupNode) ?? [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recomputeTargeted.js","sourceRoot":"","sources":["../../../../store/compute/recompute/recomputeTargeted.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,gFAAgF;AAEhF;;;;;;;;;;GAUG;AACH,MAAM,UAAU,iBAAiB,CAC/B,YAAyB,EACzB,IAA2B;IAG3B,MAAM,EACJ,UAAU,EAAE,eAAe,EAC3B,SAAS,EAAE,WAAW,EAAE,SAAS,EACjC,SAAS,EAAE,WAAW,EAAE,SAAS,GAClC,GAAG,IAAI,CAAC;IAET,
|
|
1
|
+
{"version":3,"file":"recomputeTargeted.js","sourceRoot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iE;IACjE,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;IAErC,KAAK,MAAM,SAAS,IAAI,aAAa,EAAE,CAAC;QACtC,MAAM,SAAS,GAAG,kBAAkB,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;QAC5D,sEAAsE;QACtE,IAAI,CAAC,SAAS;YAAE,SAAS;QACzB,MAAM,UAAU,GAAG,eAAe,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;QACxD,MAAM,OAAO,GAAG,eAAe,CAAC,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;QAC/E,KAAK,MAAM,CAAC,IAAI,OAAO;YAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { AnyConfigNode } from "../../store/types";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Topological sort of computed nodes by dependencies.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* B
|
|
7
|
-
*
|
|
5
|
+
* If computed A depends on computed B (B.path ∈ A.dependencies),
|
|
6
|
+
* B is evaluated before A. This guarantees the correct order for
|
|
7
|
+
* computation chains (subtotal → tax → total).
|
|
8
8
|
*/
|
|
9
9
|
export declare function topologicalSortComputed(computedEntries: Array<{
|
|
10
10
|
node: AnyConfigNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"topologicalSortComputed.d.ts","sourceRoot":"","sources":["../../../../store/compute/recompute/topologicalSortComputed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,GAC5D,KAAK,CAAC;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"topologicalSortComputed.d.ts","sourceRoot":"","sources":["../../../../store/compute/recompute/topologicalSortComputed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,GAC5D,KAAK,CAAC;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CA0D9C"}
|
|
@@ -1,32 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Topological sort of computed nodes by dependencies.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* B
|
|
6
|
-
*
|
|
4
|
+
* If computed A depends on computed B (B.path ∈ A.dependencies),
|
|
5
|
+
* B is evaluated before A. This guarantees the correct order for
|
|
6
|
+
* computation chains (subtotal → tax → total).
|
|
7
7
|
*/
|
|
8
8
|
export function topologicalSortComputed(computedEntries) {
|
|
9
9
|
if (computedEntries.length <= 1)
|
|
10
10
|
return computedEntries;
|
|
11
|
-
//
|
|
11
|
+
// Set of computed node paths for fast lookup
|
|
12
12
|
const computedPaths = new Set(computedEntries.map((e) => e.path));
|
|
13
|
-
//
|
|
13
|
+
// Build the graph: path → dependencies (only those that are computed themselves)
|
|
14
14
|
const deps = new Map();
|
|
15
15
|
const entryByPath = new Map();
|
|
16
16
|
for (const entry of computedEntries) {
|
|
17
17
|
entryByPath.set(entry.path, entry);
|
|
18
18
|
const nodeDeps = entry.node.dependencies ?? [];
|
|
19
|
-
//
|
|
19
|
+
// Keep only dependencies on other computed nodes
|
|
20
20
|
deps.set(entry.path, nodeDeps.filter((d) => computedPaths.has(d)));
|
|
21
21
|
}
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
// inDeg считает входящие рёбра: если A зависит от B, то A имеет inDeg += кол-во зависимостей.
|
|
22
|
+
// Kahn's algorithm (BFS topological sort).
|
|
23
|
+
// inDeg counts incoming edges: if A depends on B, A's inDeg equals its dependency count.
|
|
25
24
|
const inDeg = new Map();
|
|
26
25
|
for (const path of computedPaths)
|
|
27
26
|
inDeg.set(path, 0);
|
|
28
27
|
for (const [path, d] of deps) {
|
|
29
|
-
// path зависит от каждого d[i] → path имеет inDeg += кол-во зависимостей
|
|
30
28
|
inDeg.set(path, d.length);
|
|
31
29
|
}
|
|
32
30
|
const queue = [];
|
|
@@ -38,7 +36,7 @@ export function topologicalSortComputed(computedEntries) {
|
|
|
38
36
|
while (queue.length > 0) {
|
|
39
37
|
const current = queue.shift();
|
|
40
38
|
sorted.push(entryByPath.get(current));
|
|
41
|
-
//
|
|
39
|
+
// Decrease inDeg for everything that depends on current
|
|
42
40
|
for (const [path, d] of deps) {
|
|
43
41
|
if (d.includes(current)) {
|
|
44
42
|
const newDeg = (inDeg.get(path) ?? 0) - 1;
|
|
@@ -48,7 +46,7 @@ export function topologicalSortComputed(computedEntries) {
|
|
|
48
46
|
}
|
|
49
47
|
}
|
|
50
48
|
}
|
|
51
|
-
//
|
|
49
|
+
// Leftover nodes (cyclic dependency) — appended as-is
|
|
52
50
|
if (sorted.length < computedEntries.length) {
|
|
53
51
|
for (const entry of computedEntries) {
|
|
54
52
|
if (!sorted.includes(entry))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"topologicalSortComputed.js","sourceRoot":"","sources":["../../../../store/compute/recompute/topologicalSortComputed.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CACrC,eAA6D;IAE7D,IAAI,eAAe,CAAC,MAAM,IAAI,CAAC;QAAE,OAAO,eAAe,CAAC;IAExD,
|
|
1
|
+
{"version":3,"file":"topologicalSortComputed.js","sourceRoot":"","sources":["../../../../store/compute/recompute/topologicalSortComputed.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CACrC,eAA6D;IAE7D,IAAI,eAAe,CAAC,MAAM,IAAI,CAAC;QAAE,OAAO,eAAe,CAAC;IAExD,6CAA6C;IAC7C,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAElE,iFAAiF;IACjF,MAAM,IAAI,GAAG,IAAI,GAAG,EAAoB,CAAC;IACzC,MAAM,WAAW,GAAG,IAAI,GAAG,EAAiD,CAAC;IAE7E,KAAK,MAAM,KAAK,IAAI,eAAe,EAAE,CAAC;QACpC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACnC,MAAM,QAAQ,GAAI,KAAK,CAAC,IAAI,CAAC,YAAqC,IAAI,EAAE,CAAC;QACzE,iDAAiD;QACjD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACrE,CAAC;IAED,2CAA2C;IAC3C,yFAAyF;IACzF,MAAM,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;IAExC,KAAK,MAAM,IAAI,IAAI,aAAa;QAAE,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAGrD,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC;QAC7B,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;IAED,MAAM,KAAK,GAAa,EA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4
|
import type { ValuesCache } from "../../valuesCache/valuesCache";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* Wrapper for tracking cross-group dependencies.
|
|
7
|
+
* Takes a node (to determine the recipient group) and raw values,
|
|
8
|
+
* returns the same values wrapped in a tracking proxy.
|
|
9
9
|
*/
|
|
10
10
|
export type TrackingWrap = (node: object, values: Record<string, unknown>) => Record<string, unknown>;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Dependencies for a targeted recompute.
|
|
13
13
|
*/
|
|
14
14
|
export interface RecomputeTargetedDeps {
|
|
15
15
|
rootConfig: AnyConfigNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TranslateFn } from "../store/types";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* Resolves a single flag property from the config: a function is called with
|
|
4
|
+
* the values, anything else is returned as-is. undefined → defaultValue.
|
|
5
5
|
*/
|
|
6
6
|
export declare function resolveFlag(configValue: boolean | ((values: any, translate: TranslateFn) => boolean) | undefined, values: Record<string, any>, defaultValue: boolean, translate: TranslateFn): boolean;
|
|
7
7
|
//# sourceMappingURL=resolveFlag.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Resolves a single flag property from the config: a function is called with
|
|
3
|
+
* the values, anything else is returned as-is. undefined → defaultValue.
|
|
4
4
|
*/
|
|
5
5
|
export function resolveFlag(configValue, values, defaultValue, translate) {
|
|
6
6
|
if (configValue === undefined)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { TranslateFn } from "../store/types";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* Resolves a string property (label, placeholder, description) from the config.
|
|
4
|
+
* Can be a string or a `(t: TranslateFn, values) => string` function.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* When a translator is registered, the real resolution happens lazily in the
|
|
7
|
+
* proxy GET trap (buildProxy.ts). Here we keep the fallback: functions are
|
|
8
|
+
* called with identity → the translation key is returned.
|
|
9
9
|
*/
|
|
10
10
|
export declare function resolveString(configValue: string | ((t: TranslateFn, values: Record<string, any>) => string) | undefined, values?: Record<string, any>): string | undefined;
|
|
11
11
|
//# sourceMappingURL=resolveString.d.ts.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Resolves a string property (label, placeholder, description) from the config.
|
|
3
|
+
* Can be a string or a `(t: TranslateFn, values) => string` function.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* When a translator is registered, the real resolution happens lazily in the
|
|
6
|
+
* proxy GET trap (buildProxy.ts). Here we keep the fallback: functions are
|
|
7
|
+
* called with identity → the translation key is returned.
|
|
8
8
|
*/
|
|
9
9
|
export function resolveString(configValue, values = {}) {
|
|
10
10
|
if (configValue === undefined)
|
|
11
11
|
return undefined;
|
|
12
12
|
if (typeof configValue === "function") {
|
|
13
|
-
// identity —
|
|
13
|
+
// identity — returns the key as-is (fallback until a translator is registered)
|
|
14
14
|
return configValue((v) => v, values);
|
|
15
15
|
}
|
|
16
16
|
return configValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveString.js","sourceRoot":"","sources":["../../../store/compute/resolveString.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAC3B,WAA2F,EAC3F,SAA8B,EAAE;IAEhC,IAAI,WAAW,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAChD,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE,CAAC;QACtC
|
|
1
|
+
{"version":3,"file":"resolveString.js","sourceRoot":"","sources":["../../../store/compute/resolveString.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAC3B,WAA2F,EAC3F,SAA8B,EAAE;IAEhC,IAAI,WAAW,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAChD,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE,CAAC;QACtC,+EAA+E;QAC/E,OAAO,WAAW,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IAC/C,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* The full computed state of a single field.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* (isVisible, isRequired, validate…)
|
|
4
|
+
* Stored in WeakMap<configNode, FieldState>. All config functions
|
|
5
|
+
* (isVisible, isRequired, validate…) have been called; only plain values remain.
|
|
6
6
|
*/
|
|
7
7
|
export interface FieldState {
|
|
8
8
|
value: unknown;
|