@vectoriox/iox-builder 4.18.0 → 4.18.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.
|
@@ -264,6 +264,8 @@ function resolveTraitControllerType(type) {
|
|
|
264
264
|
case TraitInputType.FontFamily: return 'select';
|
|
265
265
|
case TraitInputType.GridTemplate: return 'gridTemplate';
|
|
266
266
|
case TraitInputType.Textarea: return 'textarea';
|
|
267
|
+
case TraitInputType.RuleList: return 'ruleList';
|
|
268
|
+
case TraitInputType.ActionList: return 'actionList';
|
|
267
269
|
default: return 'text';
|
|
268
270
|
}
|
|
269
271
|
}
|
|
@@ -2751,6 +2753,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.31", ngImpo
|
|
|
2751
2753
|
* meant only the toolbar could ever drive it. The toolbar's own switcher UI broke the header
|
|
2752
2754
|
* (`.form-state-bar` had no CSS rule — see forms-and-inputs-plan.md Part 2) and was, separately,
|
|
2753
2755
|
* the wrong home per board 3: the switcher belongs to the Form, not to global chrome.
|
|
2756
|
+
*
|
|
2757
|
+
* `setTarget` takes the real node, not just its id, and keeps it (privately) for `setState` to
|
|
2758
|
+
* use — `OverlayService.getNodeRef` matches by REFERENCE, not id (a repeater clone shares its
|
|
2759
|
+
* template's id), so a caller re-deriving "the current form" from an id alone could resolve the
|
|
2760
|
+
* wrong instance. Every consumer of this service only ever needs the id for display; the node
|
|
2761
|
+
* itself is this service's own business.
|
|
2754
2762
|
*/
|
|
2755
2763
|
class FormStateService {
|
|
2756
2764
|
constructor(_overlay) {
|
|
@@ -2760,28 +2768,33 @@ class FormStateService {
|
|
|
2760
2768
|
state: FormRenderState.Idle,
|
|
2761
2769
|
});
|
|
2762
2770
|
this.state$ = this._state$.asObservable();
|
|
2771
|
+
this._targetNode = null;
|
|
2763
2772
|
}
|
|
2764
2773
|
getSnapshot() {
|
|
2765
2774
|
return this._state$.value;
|
|
2766
2775
|
}
|
|
2767
2776
|
/** Called whenever the selection changes. A different form (or none) resets to Idle — a
|
|
2768
2777
|
* visitor never lands on a form already showing someone else's Sent/Failed block. */
|
|
2769
|
-
setTarget(
|
|
2770
|
-
const
|
|
2771
|
-
if (
|
|
2778
|
+
setTarget(form) {
|
|
2779
|
+
const formId = form?.id ?? null;
|
|
2780
|
+
if (this._state$.value.formId === formId)
|
|
2772
2781
|
return;
|
|
2782
|
+
this._targetNode = form;
|
|
2773
2783
|
this._state$.next({ formId, state: FormRenderState.Idle });
|
|
2774
2784
|
}
|
|
2775
2785
|
/**
|
|
2776
|
-
* Writes the state straight onto the live component instance
|
|
2777
|
-
* data, so it must never be persisted (a saved page
|
|
2778
|
-
* message). Two input names on purpose: the canvas
|
|
2779
|
-
*
|
|
2780
|
-
* the rendered component doesn't declare, so
|
|
2786
|
+
* Writes the state straight onto the live component instance for the CURRENT target (set via
|
|
2787
|
+
* `setTarget`) — a VIEW state, never page data, so it must never be persisted (a saved page
|
|
2788
|
+
* must not ship showing its own success message). Two input names on purpose: the canvas
|
|
2789
|
+
* renders the container twin (`formState`) while the engine renders `IoxFormComponent`
|
|
2790
|
+
* (`renderState`); `safeSetInput` drops whichever the rendered component doesn't declare, so
|
|
2791
|
+
* this works on either path unbranched. A no-op when nothing is in scope.
|
|
2781
2792
|
*/
|
|
2782
|
-
setState(
|
|
2783
|
-
this.
|
|
2784
|
-
|
|
2793
|
+
setState(state) {
|
|
2794
|
+
if (!this._targetNode)
|
|
2795
|
+
return;
|
|
2796
|
+
this._state$.next({ formId: this._targetNode.id ?? null, state });
|
|
2797
|
+
const ref = this._overlay.getNodeRef(this._targetNode)?.componentRef;
|
|
2785
2798
|
if (ref) {
|
|
2786
2799
|
safeSetInput(ref, 'formState', state);
|
|
2787
2800
|
safeSetInput(ref, 'renderState', state);
|
|
@@ -5971,7 +5984,7 @@ class BuilderComponent {
|
|
|
5971
5984
|
}
|
|
5972
5985
|
set selectedPath(path) {
|
|
5973
5986
|
this._selectedPath = path;
|
|
5974
|
-
this.formStateService.setTarget(nearestFormNode(path)
|
|
5987
|
+
this.formStateService.setTarget(nearestFormNode(path));
|
|
5975
5988
|
}
|
|
5976
5989
|
// Type-safe event forwarding for toolbar outputs
|
|
5977
5990
|
handleToolbarModeChange(mode) {
|