@vectoriox/iox-builder 2.10.3 → 2.11.0
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.
|
@@ -17,7 +17,7 @@ import { SelectModule } from 'primeng/select';
|
|
|
17
17
|
import { TooltipModule } from 'primeng/tooltip';
|
|
18
18
|
import { DialogModule } from 'primeng/dialog';
|
|
19
19
|
import * as i16 from '@vectoriox/iox-ui';
|
|
20
|
-
import { DEFAULT_WIDTH_BY_TYPE, ComponentInstanceRegistryService, buildTargetedStateSelector, compileDeclarations, composeVirtualTraits, IS_PREVIEW, planDataSource, dataSourcePlanToRequest, normalizeCollectionResult, resolveRepeaterItems, getByPath, computeRelative, IoxPageModule } from '@vectoriox/iox-ui';
|
|
20
|
+
import { DEFAULT_WIDTH_BY_TYPE, ComponentInstanceRegistryService, buildTargetedStateSelector, compileDeclarations, safeSetInput, composeVirtualTraits, IS_PREVIEW, resolvePath, planDataSource, dataSourcePlanToRequest, normalizeCollectionResult, resolveRepeaterItems, getByPath, computeRelative, IoxPageModule } from '@vectoriox/iox-ui';
|
|
21
21
|
export { ComponentInstanceRegistryService, VIRTUAL_TRAIT_KEYS, composeVirtualTraits } from '@vectoriox/iox-ui';
|
|
22
22
|
import Lenis from 'lenis';
|
|
23
23
|
import { Subject, BehaviorSubject, of, forkJoin } from 'rxjs';
|
|
@@ -74,6 +74,11 @@ const INVERSE_ACTION = {
|
|
|
74
74
|
moveDown: 'moveUp',
|
|
75
75
|
moveLeft: 'moveRight',
|
|
76
76
|
moveRight: 'moveLeft',
|
|
77
|
+
// Click-toggle only: click sets the slot, click again clears it. This map does NOT drive
|
|
78
|
+
// hover-leave — that runs the same actions on a reverse pass, whose context semantics live in
|
|
79
|
+
// `contextActionEffect` (@vectoriox/iox-ui).
|
|
80
|
+
setContext: 'clearContext',
|
|
81
|
+
clearContext: 'setContext',
|
|
77
82
|
};
|
|
78
83
|
const TRIGGER_OPTIONS = [
|
|
79
84
|
{ value: 'pageLoad', label: 'Page load', icon: 'ph-thin ph-play' },
|
|
@@ -97,6 +102,8 @@ const ACTION_TYPE_OPTIONS = [
|
|
|
97
102
|
{ value: 'show', label: 'Show' },
|
|
98
103
|
{ value: 'hide', label: 'Hide' },
|
|
99
104
|
{ value: 'toggleVisibility', label: 'Toggle visibility' },
|
|
105
|
+
{ value: 'setContext', label: 'Set context' },
|
|
106
|
+
{ value: 'clearContext', label: 'Clear context' },
|
|
100
107
|
];
|
|
101
108
|
const EASING_OPTIONS$1 = ['linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out'];
|
|
102
109
|
/** Interaction pseudo-classes — compiled to .iox-node-{id}:state */
|
|
@@ -3478,14 +3485,16 @@ class RenderDirective {
|
|
|
3478
3485
|
else {
|
|
3479
3486
|
componentRef = this.vcr.createComponent(componentClass, { injector: this.injector });
|
|
3480
3487
|
}
|
|
3481
|
-
// Apply regular trait defaults (title, image, description, etc.)
|
|
3482
|
-
//
|
|
3483
|
-
//
|
|
3484
|
-
//
|
|
3488
|
+
// Apply regular trait defaults (title, image, description, etc.). safeSetInput() uses
|
|
3489
|
+
// setInput() for declared inputs (marks the view dirty, integrates with CD + signal inputs)
|
|
3490
|
+
// and falls back to direct assignment for anything the component doesn't declare — so a
|
|
3491
|
+
// trait that has no matching @Input (e.g. `sourcePath` on a SliderContainer) never emits the
|
|
3492
|
+
// NG0303 console error that a bare setInput() would. Skip SectionLabel traits — they are
|
|
3493
|
+
// UI-only panel headers with no matching input.
|
|
3485
3494
|
Object.values(node.traits || {}).forEach((trait) => {
|
|
3486
3495
|
if (trait.type === 'sectionLabel')
|
|
3487
3496
|
return;
|
|
3488
|
-
componentRef
|
|
3497
|
+
safeSetInput(componentRef, trait.name, trait.default);
|
|
3489
3498
|
});
|
|
3490
3499
|
// Build initial style map from styleTraits defaults.
|
|
3491
3500
|
const initialStyle = {};
|
|
@@ -3659,15 +3668,6 @@ class RenderDirective {
|
|
|
3659
3668
|
this.interactionEngine.attachTo(node, nativeEl);
|
|
3660
3669
|
}
|
|
3661
3670
|
}
|
|
3662
|
-
/** Try setInput(); fall back to direct assignment for non-@Input properties. */
|
|
3663
|
-
safeSetInput(ref, name, value) {
|
|
3664
|
-
try {
|
|
3665
|
-
ref.setInput(name, value);
|
|
3666
|
-
}
|
|
3667
|
-
catch {
|
|
3668
|
-
ref.instance[name] = value;
|
|
3669
|
-
}
|
|
3670
|
-
}
|
|
3671
3671
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: RenderDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.Injector }, { token: i0.EnvironmentInjector }, { token: DOCUMENT }, { token: ComponentRegistryService }, { token: OverlayService }, { token: StyleRegistryService }, { token: InteractionEngineService }, { token: i0.ChangeDetectorRef }, { token: PanelEventService }, { token: DragEngineService }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3672
3672
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.11", type: RenderDirective, isStandalone: false, selector: "[ioxRender]", inputs: { ioxRender: "ioxRender", ioxDragSourceId: "ioxDragSourceId" }, outputs: { onClick: "onClick", onMouseEnter: "onMouseEnter", onMouseLeave: "onMouseLeave" }, ngImport: i0 }); }
|
|
3673
3673
|
}
|
|
@@ -5950,27 +5950,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
5950
5950
|
type: Output
|
|
5951
5951
|
}] } });
|
|
5952
5952
|
|
|
5953
|
-
/**
|
|
5954
|
-
* Resolves a dot-notation path (with optional array bracket notation) against an object.
|
|
5955
|
-
* Examples: 'title', 'author.name', 'tags[0]', 'items[2].title'
|
|
5956
|
-
*/
|
|
5957
|
-
function resolvePath(obj, path) {
|
|
5958
|
-
// Empty path (or `$`) means "the value itself" — used to bind to an item that IS a primitive
|
|
5959
|
-
// (e.g. a Repeater over `gallery: string[]`, where each item is the URL string). See
|
|
5960
|
-
// binding-panel-redesign-plan.md.
|
|
5961
|
-
if (path === '' || path === '$' || path == null)
|
|
5962
|
-
return obj;
|
|
5963
|
-
return path.split('.').reduce((current, key) => {
|
|
5964
|
-
if (current == null)
|
|
5965
|
-
return undefined;
|
|
5966
|
-
const bracketMatch = key.match(/^(\w+)\[(\d+)]$/);
|
|
5967
|
-
if (bracketMatch) {
|
|
5968
|
-
const arr = current[bracketMatch[1]];
|
|
5969
|
-
return Array.isArray(arr) ? arr[parseInt(bracketMatch[2], 10)] : undefined;
|
|
5970
|
-
}
|
|
5971
|
-
return current[key];
|
|
5972
|
-
}, obj);
|
|
5973
|
-
}
|
|
5974
5953
|
/**
|
|
5975
5954
|
* Deep-clones a ComponentNode tree and overrides trait defaults
|
|
5976
5955
|
* according to each node's bindings resolved against `item`.
|