@vectoriox/iox-builder 1.1.9 → 1.2.1

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.
@@ -3581,6 +3581,167 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
3581
3581
  type: Input
3582
3582
  }] } });
3583
3583
 
3584
+ class BuilderButtonBlockComponent {
3585
+ constructor(dragEngine, cdr) {
3586
+ this.dragEngine = dragEngine;
3587
+ this.cdr = cdr;
3588
+ this.children = [];
3589
+ this.style = {};
3590
+ this.tag = 'button';
3591
+ this.href = '';
3592
+ this.target = '_self';
3593
+ this.type = 'button';
3594
+ this.nodeId = '';
3595
+ this.dropListId = '';
3596
+ this.childClick = new EventEmitter();
3597
+ this.childMouseEnter = new EventEmitter();
3598
+ this.childMouseLeave = new EventEmitter();
3599
+ }
3600
+ ngOnInit() { }
3601
+ ngOnDestroy() { }
3602
+ onDrop(event) {
3603
+ this.dragEngine.handleDrop(this.children, event, this.dropListId, this.cdr);
3604
+ }
3605
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: BuilderButtonBlockComponent, deps: [{ token: DragEngineService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
3606
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.11", type: BuilderButtonBlockComponent, isStandalone: false, selector: "app-builder-button-block", inputs: { children: "children", style: "style", tag: "tag", href: "href", target: "target", type: "type", nodeId: "nodeId", dropListId: "dropListId" }, outputs: { childClick: "childClick", childMouseEnter: "childMouseEnter", childMouseLeave: "childMouseLeave" }, ngImport: i0, template: `
3607
+ <button *ngIf="tag !== 'a'"
3608
+ class="button-block-root"
3609
+ [ngClass]="'iox-node-' + nodeId"
3610
+ [attr.type]="type"
3611
+ (click)="$event.preventDefault()"
3612
+ ioxDropzone
3613
+ [ioxDropzoneId]="dropListId"
3614
+ [ioxDropzoneData]="children"
3615
+ (ioxDrop)="onDrop($event)">
3616
+ <ng-container *ngIf="!children.length">
3617
+ <span class="button-block-placeholder">Button</span>
3618
+ </ng-container>
3619
+ <div *ngFor="let child of children"
3620
+ class="button-block-child"
3621
+ [ngClass]="'iox-outer-' + (child.styleId ?? child.id)"
3622
+ ioxDraggable
3623
+ [ioxDragData]="child"
3624
+ [ioxDragSourceId]="dropListId">
3625
+ <ng-container
3626
+ [ioxRender]="child"
3627
+ (onClick)="childClick.emit($event)"
3628
+ (onMouseEnter)="childMouseEnter.emit($event)"
3629
+ (onMouseLeave)="childMouseLeave.emit()">
3630
+ </ng-container>
3631
+ </div>
3632
+ </button>
3633
+
3634
+ <a *ngIf="tag === 'a'"
3635
+ class="button-block-root"
3636
+ [ngClass]="'iox-node-' + nodeId"
3637
+ [attr.href]="href || null"
3638
+ [attr.target]="target || null"
3639
+ (click)="$event.preventDefault()"
3640
+ ioxDropzone
3641
+ [ioxDropzoneId]="dropListId"
3642
+ [ioxDropzoneData]="children"
3643
+ (ioxDrop)="onDrop($event)">
3644
+ <ng-container *ngIf="!children.length">
3645
+ <span class="button-block-placeholder">Button</span>
3646
+ </ng-container>
3647
+ <div *ngFor="let child of children"
3648
+ class="button-block-child"
3649
+ [ngClass]="'iox-outer-' + (child.styleId ?? child.id)"
3650
+ ioxDraggable
3651
+ [ioxDragData]="child"
3652
+ [ioxDragSourceId]="dropListId">
3653
+ <ng-container
3654
+ [ioxRender]="child"
3655
+ (onClick)="childClick.emit($event)"
3656
+ (onMouseEnter)="childMouseEnter.emit($event)"
3657
+ (onMouseLeave)="childMouseLeave.emit()">
3658
+ </ng-container>
3659
+ </div>
3660
+ </a>
3661
+ `, isInline: true, styles: [".button-block-root{display:inline-flex;align-items:center;gap:8px;cursor:pointer;text-decoration:none;border:none;background:none;padding:0;font:inherit;color:inherit;box-sizing:border-box;width:100%;height:100%;position:relative}.button-block-placeholder{display:flex;align-items:center;justify-content:center;width:100%;color:#64748b80;font-size:12px;pointer-events:none;-webkit-user-select:none;user-select:none}.button-block-child{min-width:0}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: RenderDirective, selector: "[ioxRender]", inputs: ["ioxRender"], outputs: ["onClick", "onMouseEnter", "onMouseLeave"] }, { kind: "directive", type: IoxDraggableDirective, selector: "[ioxDraggable]", inputs: ["ioxDragData", "ioxDragSourceId"] }, { kind: "directive", type: IoxDropzoneDirective, selector: "[ioxDropzone]", inputs: ["ioxDropzoneId", "ioxDropzoneData", "ioxDropzonePostDrop"], outputs: ["ioxDrop"] }] }); }
3662
+ }
3663
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: BuilderButtonBlockComponent, decorators: [{
3664
+ type: Component,
3665
+ args: [{ selector: 'app-builder-button-block', template: `
3666
+ <button *ngIf="tag !== 'a'"
3667
+ class="button-block-root"
3668
+ [ngClass]="'iox-node-' + nodeId"
3669
+ [attr.type]="type"
3670
+ (click)="$event.preventDefault()"
3671
+ ioxDropzone
3672
+ [ioxDropzoneId]="dropListId"
3673
+ [ioxDropzoneData]="children"
3674
+ (ioxDrop)="onDrop($event)">
3675
+ <ng-container *ngIf="!children.length">
3676
+ <span class="button-block-placeholder">Button</span>
3677
+ </ng-container>
3678
+ <div *ngFor="let child of children"
3679
+ class="button-block-child"
3680
+ [ngClass]="'iox-outer-' + (child.styleId ?? child.id)"
3681
+ ioxDraggable
3682
+ [ioxDragData]="child"
3683
+ [ioxDragSourceId]="dropListId">
3684
+ <ng-container
3685
+ [ioxRender]="child"
3686
+ (onClick)="childClick.emit($event)"
3687
+ (onMouseEnter)="childMouseEnter.emit($event)"
3688
+ (onMouseLeave)="childMouseLeave.emit()">
3689
+ </ng-container>
3690
+ </div>
3691
+ </button>
3692
+
3693
+ <a *ngIf="tag === 'a'"
3694
+ class="button-block-root"
3695
+ [ngClass]="'iox-node-' + nodeId"
3696
+ [attr.href]="href || null"
3697
+ [attr.target]="target || null"
3698
+ (click)="$event.preventDefault()"
3699
+ ioxDropzone
3700
+ [ioxDropzoneId]="dropListId"
3701
+ [ioxDropzoneData]="children"
3702
+ (ioxDrop)="onDrop($event)">
3703
+ <ng-container *ngIf="!children.length">
3704
+ <span class="button-block-placeholder">Button</span>
3705
+ </ng-container>
3706
+ <div *ngFor="let child of children"
3707
+ class="button-block-child"
3708
+ [ngClass]="'iox-outer-' + (child.styleId ?? child.id)"
3709
+ ioxDraggable
3710
+ [ioxDragData]="child"
3711
+ [ioxDragSourceId]="dropListId">
3712
+ <ng-container
3713
+ [ioxRender]="child"
3714
+ (onClick)="childClick.emit($event)"
3715
+ (onMouseEnter)="childMouseEnter.emit($event)"
3716
+ (onMouseLeave)="childMouseLeave.emit()">
3717
+ </ng-container>
3718
+ </div>
3719
+ </a>
3720
+ `, standalone: false, styles: [".button-block-root{display:inline-flex;align-items:center;gap:8px;cursor:pointer;text-decoration:none;border:none;background:none;padding:0;font:inherit;color:inherit;box-sizing:border-box;width:100%;height:100%;position:relative}.button-block-placeholder{display:flex;align-items:center;justify-content:center;width:100%;color:#64748b80;font-size:12px;pointer-events:none;-webkit-user-select:none;user-select:none}.button-block-child{min-width:0}\n"] }]
3721
+ }], ctorParameters: () => [{ type: DragEngineService }, { type: i0.ChangeDetectorRef }], propDecorators: { children: [{
3722
+ type: Input
3723
+ }], style: [{
3724
+ type: Input
3725
+ }], tag: [{
3726
+ type: Input
3727
+ }], href: [{
3728
+ type: Input
3729
+ }], target: [{
3730
+ type: Input
3731
+ }], type: [{
3732
+ type: Input
3733
+ }], nodeId: [{
3734
+ type: Input
3735
+ }], dropListId: [{
3736
+ type: Input
3737
+ }], childClick: [{
3738
+ type: Output
3739
+ }], childMouseEnter: [{
3740
+ type: Output
3741
+ }], childMouseLeave: [{
3742
+ type: Output
3743
+ }] } });
3744
+
3584
3745
  class PanelChildComponent {
3585
3746
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: PanelChildComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3586
3747
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.11", type: PanelChildComponent, isStandalone: false, selector: "panel-child", inputs: { name: "name" }, viewQueries: [{ propertyName: "template", first: true, predicate: ["tpl"], descendants: true, static: true }], ngImport: i0, template: '<ng-template #tpl><ng-content></ng-content></ng-template>', isInline: true }); }
@@ -4097,6 +4258,7 @@ const DECLARATIONS = [
4097
4258
  BuilderContainerComponent,
4098
4259
  BuilderLinkedContainerComponent,
4099
4260
  BuilderRepeaterComponent,
4261
+ BuilderButtonBlockComponent,
4100
4262
  PanelComponent,
4101
4263
  PanelChildComponent,
4102
4264
  LayerTreeComponent,
@@ -4114,6 +4276,7 @@ class IoxBuilderModule {
4114
4276
  BuilderContainerComponent,
4115
4277
  BuilderLinkedContainerComponent,
4116
4278
  BuilderRepeaterComponent,
4279
+ BuilderButtonBlockComponent,
4117
4280
  PanelComponent,
4118
4281
  PanelChildComponent,
4119
4282
  LayerTreeComponent,
@@ -4151,6 +4314,7 @@ class IoxBuilderModule {
4151
4314
  BuilderContainerComponent,
4152
4315
  BuilderLinkedContainerComponent,
4153
4316
  BuilderRepeaterComponent,
4317
+ BuilderButtonBlockComponent,
4154
4318
  PanelComponent,
4155
4319
  PanelChildComponent,
4156
4320
  LayerTreeComponent,
@@ -4241,6 +4405,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
4241
4405
  BuilderContainerComponent,
4242
4406
  BuilderLinkedContainerComponent,
4243
4407
  BuilderRepeaterComponent,
4408
+ BuilderButtonBlockComponent,
4244
4409
  PanelComponent,
4245
4410
  PanelChildComponent,
4246
4411
  LayerTreeComponent,
@@ -4276,6 +4441,45 @@ class BuilderButtonComponentConfig extends ComponentConfig {
4276
4441
  }
4277
4442
  }
4278
4443
 
4444
+ class ButtonBlockComponentConfig extends ComponentConfig {
4445
+ constructor() {
4446
+ super('Button', 'app-builder-button-block', 'ph-thin ph-cursor-click', 'Basic');
4447
+ this.children = [];
4448
+ this.inputs = {
4449
+ tag: 'select',
4450
+ href: 'text',
4451
+ target: 'select',
4452
+ type: 'select',
4453
+ };
4454
+ this.traits = [
4455
+ new TraitConfig('tag', 'Tag', TraitInputType.Select, ['button', 'a'], 'button'),
4456
+ new TraitConfig('href', 'URL', TraitInputType.Text, undefined, '', false, { trait: 'tag', values: 'a' }),
4457
+ new TraitConfig('target', 'Target', TraitInputType.Select, ['_self', '_blank'], '_self', false, { trait: 'tag', values: 'a' }),
4458
+ new TraitConfig('type', 'Type', TraitInputType.Select, ['button', 'submit', 'reset'], 'button', false, { trait: 'tag', values: 'button' }),
4459
+ ];
4460
+ this.styleTraits = [
4461
+ new PositionGroupStyleConfig(),
4462
+ new LayoutGroupStyleConfig(),
4463
+ new SizeGroupStyleConfig(),
4464
+ new SpacingGroupStyleConfig(),
4465
+ new BorderGroupStyleConfig(),
4466
+ new BackgroundGroupStyleConfig(),
4467
+ new EffectsGroupStyleConfig(),
4468
+ ];
4469
+ this.applyStyleDefaults({
4470
+ display: 'inline-flex',
4471
+ alignItems: 'center',
4472
+ justifyContent: 'center',
4473
+ gap: '8px',
4474
+ width: 'auto',
4475
+ height: 'auto',
4476
+ padding: '10px 20px',
4477
+ borderRadius: '6px',
4478
+ cursor: 'pointer',
4479
+ });
4480
+ }
4481
+ }
4482
+
4279
4483
  class CardComponentConfig extends ComponentConfig {
4280
4484
  constructor() {
4281
4485
  super('Card', 'app-card', 'ph-thin ph-cards', 'Content');
@@ -4612,5 +4816,5 @@ class TextBlockComponentConfig extends ComponentConfig {
4612
4816
  * Generated bundle index. Do not edit.
4613
4817
  */
4614
4818
 
4615
- export { ACTION_TYPE_OPTIONS, BuilderButtonComponentConfig, BuilderComponent, BuilderContainerComponent, BuilderContainerComponentConfig, BuilderDividerComponentConfig, BuilderHeadingComponentConfig, BuilderIconComponentConfig, BuilderImageComponentConfig, BuilderLinkComponentConfig, BuilderLinkedContainerComponent, BuilderLinkedContainerConfig, BuilderMode, BuilderRepeaterComponent, BuilderSpacerComponentConfig, CardComponentConfig, ComponentConfig, ComponentRegistryService, DEVICE_OPTIONS, DataSourceRegistryService, DeviceMode, DragEngineService, EASING_OPTIONS$1 as EASING_OPTIONS, GroupStyleConfig, IOX_CONTENT_SERVICE, IOX_FONT_MANAGER, InteractionEngineService, InteractionsPanelComponent, IoxBuilderModule, IoxDraggableDirective, IoxDropzoneDirective, LayerTreeComponent, NodeAction, OverlayComponent, OverlayService, PanelChildComponent, PanelComponent, PanelEventService, PanelEventTypes, PanelTypes, PresetRegistryService, ROUTE_ANIMATION_OPTIONS, RenderDirective, RepeaterComponentConfig, SCREEN_WIDTH_OPTIONS, SectionComponent, SectionComponentConfig, StyleCategory, StyleRegistryService, TraitConfig as StyleTraitConfig, TRIGGER_OPTIONS, TextBlockComponentConfig, ToolbarAction, ToolbarComponent, TraitConfig, TraitInputType, UNITS_ALL, UNITS_DEG, UNITS_FIXED, UNITS_NO_VW, ViewportService, ZOOM_OPTIONS, buildPresetStyleTraits, defaultPageSettings, generateNodeId, resolveTraitControllerType, resolveTraitOptions };
4819
+ export { ACTION_TYPE_OPTIONS, BuilderButtonBlockComponent, BuilderButtonComponentConfig, BuilderComponent, BuilderContainerComponent, BuilderContainerComponentConfig, BuilderDividerComponentConfig, BuilderHeadingComponentConfig, BuilderIconComponentConfig, BuilderImageComponentConfig, BuilderLinkComponentConfig, BuilderLinkedContainerComponent, BuilderLinkedContainerConfig, BuilderMode, BuilderRepeaterComponent, BuilderSpacerComponentConfig, ButtonBlockComponentConfig, CardComponentConfig, ComponentConfig, ComponentRegistryService, DEVICE_OPTIONS, DataSourceRegistryService, DeviceMode, DragEngineService, EASING_OPTIONS$1 as EASING_OPTIONS, GroupStyleConfig, IOX_CONTENT_SERVICE, IOX_FONT_MANAGER, InteractionEngineService, InteractionsPanelComponent, IoxBuilderModule, IoxDraggableDirective, IoxDropzoneDirective, LayerTreeComponent, NodeAction, OverlayComponent, OverlayService, PanelChildComponent, PanelComponent, PanelEventService, PanelEventTypes, PanelTypes, PresetRegistryService, ROUTE_ANIMATION_OPTIONS, RenderDirective, RepeaterComponentConfig, SCREEN_WIDTH_OPTIONS, SectionComponent, SectionComponentConfig, StyleCategory, StyleRegistryService, TraitConfig as StyleTraitConfig, TRIGGER_OPTIONS, TextBlockComponentConfig, ToolbarAction, ToolbarComponent, TraitConfig, TraitInputType, UNITS_ALL, UNITS_DEG, UNITS_FIXED, UNITS_NO_VW, ViewportService, ZOOM_OPTIONS, buildPresetStyleTraits, defaultPageSettings, generateNodeId, resolveTraitControllerType, resolveTraitOptions };
4616
4820
  //# sourceMappingURL=vectoriox-iox-builder.mjs.map