@vectoriox/iox-ui 4.17.1 → 4.17.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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, HostListener, Output, Input, Directive, NgModule, Injectable, ViewChild, Component, Host, Optional, inject, NgZone, Inject, InjectionToken, PLATFORM_ID, ChangeDetectionStrategy, ViewContainerRef } from '@angular/core';
2
+ import { EventEmitter, HostListener, Output, Input, Directive, NgModule, Injectable, ViewChild, Component, Host, Optional, inject, NgZone, Inject, InjectionToken, PLATFORM_ID, ChangeDetectionStrategy, ViewContainerRef, reflectComponentType } from '@angular/core';
3
3
  import * as i2 from '@angular/animations';
4
4
  import { style, animate } from '@angular/animations';
5
5
  import { Subject, fromEvent, of } from 'rxjs';
@@ -3200,6 +3200,53 @@ const PIPE_DESCRIPTORS = [
3200
3200
  { name: 'number', label: 'Number', args: [{ key: 'decimals', label: 'Decimals', control: 'number', default: null }] },
3201
3201
  ];
3202
3202
 
3203
+ /**
3204
+ * Declared-input reflection + safe input application, shared by every dynamic renderer
3205
+ * (builder `RenderDirective`, builder bindings panel, SSR `ClientTreeRendererService`).
3206
+ *
3207
+ * WHY THIS EXISTS: `ComponentRef.setInput(name, value)` for an input the component does NOT
3208
+ * declare does **not throw** — in dev mode it calls `reportUnknownPropertyError`, which
3209
+ * `console.error`s `NG0303: Can't set value of the '<name>' input ...` and returns without
3210
+ * setting anything. A `try/catch` around `setInput` is therefore dead code (nothing is thrown)
3211
+ * AND the value is silently dropped. On every (re-)render — drag, duplicate, save-triggered
3212
+ * re-render, repeater/slider clones — that spams the console and skips the write.
3213
+ *
3214
+ * The fix is to reflect the component's declared inputs ONCE (cached) and only `setInput` names
3215
+ * that exist; anything else is assigned directly on the instance (harmless for consumers that
3216
+ * read the raw property, e.g. a `sourcePath`/`source` binding pushed to a SliderContainer).
3217
+ */
3218
+ /** Per-component-class cache of declared public input names (templateName / alias). */
3219
+ const inputNameCache = new WeakMap();
3220
+ /**
3221
+ * The public input names (`@Input()` / `input()` / `model()`, honouring aliases) a component
3222
+ * class declares. Cached per class — `reflectComponentType` is not free. Returns an empty set
3223
+ * for a class Angular can't reflect (e.g. a non-component).
3224
+ */
3225
+ function declaredInputNames(type) {
3226
+ let names = inputNameCache.get(type);
3227
+ if (!names) {
3228
+ const mirror = reflectComponentType(type);
3229
+ names = new Set((mirror?.inputs ?? []).map(i => i.templateName));
3230
+ inputNameCache.set(type, names);
3231
+ }
3232
+ return names;
3233
+ }
3234
+ /**
3235
+ * Set `name` on `ref` as an Angular input **only** when the component declares it (so change
3236
+ * detection + signal inputs work); otherwise assign directly on the instance and mark it for
3237
+ * check. Never produces an NG0303 error and never silently drops the value. Returns `true` if
3238
+ * it was applied as a real input, `false` if it fell back to direct assignment.
3239
+ */
3240
+ function safeSetInput(ref, name, value) {
3241
+ if (declaredInputNames(ref.componentType).has(name)) {
3242
+ ref.setInput(name, value);
3243
+ return true;
3244
+ }
3245
+ ref.instance[name] = value;
3246
+ ref.changeDetectorRef.markForCheck();
3247
+ return false;
3248
+ }
3249
+
3203
3250
  /**
3204
3251
  * Cinematic page-transition presets — the SINGLE SOURCE OF TRUTH shared by the page builder
3205
3252
  * (preview) and the SSR client engine (production). Pure, transport-agnostic: this module only
@@ -3634,5 +3681,5 @@ function effectiveTransitionId(anim) {
3634
3681
  * Generated bundle index. Do not edit.
3635
3682
  */
3636
3683
 
3637
- export { AOSService, AnalyticsService, BuilderButtonComponent, BuilderDividerComponent, BuilderHeadingComponent, BuilderIconComponent, BuilderImageComponent, BuilderLinkComponent, BuilderSpacerComponent, ButtonBlockComponent, CMSClientInfraModule, CardComponent, ClientGalleryComponent, ClientListComponent, ClientListItemComponent, ClientRepeaterComponent, ClientSliderContainerComponent, ClientSliderSlideComponent, ComponentInstanceRegistryService, ConsentService, ContainerComponent, ContentService, DEFAULT_GALLERY_SCHEDULER, DEFAULT_PAGE_TRANSITION, DEFAULT_PAGE_TRANSITION_DURATION, DEFAULT_PAGE_TRANSITION_EASING, DEFAULT_PAGE_TRANSITION_PERSPECTIVE, DEFAULT_WIDTH_BY_TYPE, ENVIRONMENT, GALLERY_EFFECTS, GALLERY_EFFECT_DESCRIPTORS, GalleryLoop, IOX_BUILDER_EVENTS, IS_PREVIEW, IoxAnimateContainer, IoxAosDirective, IoxAosModule, IoxBuilderComponentsModule, IoxComponentRegistryService, IoxPageComponent, IoxPageModule, IoxUiModule, LinkedContainerComponent, PAGE_TRANSITION_CATEGORIES, PAGE_TRANSITION_PRESETS, PIPE_DESCRIPTORS, PIPE_REGISTRY, PageScrollProvider, PrivacyModalComponent, PrivacyModalService, PrivacyModelEvent, RESERVED_ALIAS_PREFIX, SUPPRESSED_STYLE_PROPS_BY_TYPE, SectionComponent, TRANSITION_FEELS, TextBlockComponent, VIRTUAL_TRAIT_KEYS, ViewPositionDirective, ViewPositionModule, WebSettingsService, applyBindingPipes, applyFeel, buildDataSourceFilter, buildRelatedFilter, buildTargetedStateSelector, buildTransitionTimeline, collectReferencedAliases, compileDeclarations, composeVirtualTraits, computeRelative, dataSourcePlanToRequest, effectiveTransitionId, excludeSelf, feelFor, getByPath, isReservedAlias, legacyEnterToTransition, matchRouteParams, nearestCommonAncestorId, nodeCssId, normalizeCollectionResult, parseUrlList, planDataSource, referencedDataSources, referencedDataSourcesDeep, renderDefaultDeclarations, resolveDerivedInto, resolveGalleryEffect, resolveGalleryUrls, resolvePageTransition, resolveRelativeInto, resolveRepeaterItems, resolveSiblings, resolveSingleItemId, rewriteViewportUnits, stripSuppressedProps, styleKeyToKebab };
3684
+ export { AOSService, AnalyticsService, BuilderButtonComponent, BuilderDividerComponent, BuilderHeadingComponent, BuilderIconComponent, BuilderImageComponent, BuilderLinkComponent, BuilderSpacerComponent, ButtonBlockComponent, CMSClientInfraModule, CardComponent, ClientGalleryComponent, ClientListComponent, ClientListItemComponent, ClientRepeaterComponent, ClientSliderContainerComponent, ClientSliderSlideComponent, ComponentInstanceRegistryService, ConsentService, ContainerComponent, ContentService, DEFAULT_GALLERY_SCHEDULER, DEFAULT_PAGE_TRANSITION, DEFAULT_PAGE_TRANSITION_DURATION, DEFAULT_PAGE_TRANSITION_EASING, DEFAULT_PAGE_TRANSITION_PERSPECTIVE, DEFAULT_WIDTH_BY_TYPE, ENVIRONMENT, GALLERY_EFFECTS, GALLERY_EFFECT_DESCRIPTORS, GalleryLoop, IOX_BUILDER_EVENTS, IS_PREVIEW, IoxAnimateContainer, IoxAosDirective, IoxAosModule, IoxBuilderComponentsModule, IoxComponentRegistryService, IoxPageComponent, IoxPageModule, IoxUiModule, LinkedContainerComponent, PAGE_TRANSITION_CATEGORIES, PAGE_TRANSITION_PRESETS, PIPE_DESCRIPTORS, PIPE_REGISTRY, PageScrollProvider, PrivacyModalComponent, PrivacyModalService, PrivacyModelEvent, RESERVED_ALIAS_PREFIX, SUPPRESSED_STYLE_PROPS_BY_TYPE, SectionComponent, TRANSITION_FEELS, TextBlockComponent, VIRTUAL_TRAIT_KEYS, ViewPositionDirective, ViewPositionModule, WebSettingsService, applyBindingPipes, applyFeel, buildDataSourceFilter, buildRelatedFilter, buildTargetedStateSelector, buildTransitionTimeline, collectReferencedAliases, compileDeclarations, composeVirtualTraits, computeRelative, dataSourcePlanToRequest, declaredInputNames, effectiveTransitionId, excludeSelf, feelFor, getByPath, isReservedAlias, legacyEnterToTransition, matchRouteParams, nearestCommonAncestorId, nodeCssId, normalizeCollectionResult, parseUrlList, planDataSource, referencedDataSources, referencedDataSourcesDeep, renderDefaultDeclarations, resolveDerivedInto, resolveGalleryEffect, resolveGalleryUrls, resolvePageTransition, resolveRelativeInto, resolveRepeaterItems, resolveSiblings, resolveSingleItemId, rewriteViewportUnits, safeSetInput, stripSuppressedProps, styleKeyToKebab };
3638
3685
  //# sourceMappingURL=vectoriox-iox-ui.mjs.map