@vectoriox/iox-builder 2.1.0 → 2.1.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.
|
@@ -5972,8 +5972,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
5972
5972
|
type: Input
|
|
5973
5973
|
}] } });
|
|
5974
5974
|
|
|
5975
|
+
/**
|
|
5976
|
+
* Directive-host ButtonBlock (wrapper collapse, task 9c). The real `<button>`/`<a>` IS the host —
|
|
5977
|
+
* chosen by RenderDirective via `hostElement` from the `tag` trait (`variableTag`), NOT an internal
|
|
5978
|
+
* `<button>` in the template. This matches the SSR engine's `button[iox-button-block]` component and
|
|
5979
|
+
* every other collapsed builder component (Container/Section/List/…): ONE element per node carrying
|
|
5980
|
+
* BOTH `iox-outer-{id}` (margin/width) + `iox-node-{id}` (visual props). Previously this component
|
|
5981
|
+
* kept the OLD pattern — a custom-element selector plus a template that rendered its own
|
|
5982
|
+
* `<button class="button-block-root">` — so RenderDirective's host `<button>` (iox-outer) wrapped a
|
|
5983
|
+
* second `<button>` (iox-node): button-in-button, and width (outer) + aspect-ratio (inner) split
|
|
5984
|
+
* across two elements so aspect-ratio never resolved. Collapsing to the single host fixes both.
|
|
5985
|
+
*
|
|
5986
|
+
* The `button`/`a` UA resets (border, background, text-decoration) live in the builder app's global
|
|
5987
|
+
* styles.scss, kept OFF `:host` so styleProps (`.iox-node-{id}`) can override them.
|
|
5988
|
+
*/
|
|
5975
5989
|
class BuilderButtonBlockComponent {
|
|
5976
|
-
constructor(dragEngine, cdr) {
|
|
5990
|
+
constructor(elRef, dragEngine, cdr) {
|
|
5991
|
+
this.elRef = elRef;
|
|
5977
5992
|
this.dragEngine = dragEngine;
|
|
5978
5993
|
this.cdr = cdr;
|
|
5979
5994
|
this.children = [];
|
|
@@ -5988,58 +6003,52 @@ class BuilderButtonBlockComponent {
|
|
|
5988
6003
|
this.childMouseEnter = new EventEmitter();
|
|
5989
6004
|
this.childMouseLeave = new EventEmitter();
|
|
5990
6005
|
}
|
|
5991
|
-
ngOnInit() {
|
|
5992
|
-
|
|
6006
|
+
ngOnInit() {
|
|
6007
|
+
// Register the HOST as the dropzone (was the ioxDropzone directive on the inner button).
|
|
6008
|
+
this.dragEngine.registerDropzone(this.dropListId, this.elRef.nativeElement, this.children, this.cdr, (evt) => this.onDrop(evt));
|
|
6009
|
+
}
|
|
6010
|
+
ngOnDestroy() {
|
|
6011
|
+
this.dragEngine.unregisterDropzone(this.dropListId, this.elRef.nativeElement);
|
|
6012
|
+
}
|
|
5993
6013
|
onDrop(event) {
|
|
5994
6014
|
this.dragEngine.handleDrop(this.children, event, this.dropListId, this.cdr);
|
|
5995
6015
|
}
|
|
5996
|
-
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 }); }
|
|
5997
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.11", type: BuilderButtonBlockComponent, isStandalone: false, selector: "
|
|
5998
|
-
<
|
|
5999
|
-
|
|
6000
|
-
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
[ioxRender]="child"
|
|
6011
|
-
[ioxDragSourceId]="dropListId"
|
|
6012
|
-
(onClick)="childClick.emit($event)"
|
|
6013
|
-
(onMouseEnter)="childMouseEnter.emit($event)"
|
|
6014
|
-
(onMouseLeave)="childMouseLeave.emit()">
|
|
6015
|
-
</ng-container>
|
|
6016
|
-
</button>
|
|
6017
|
-
`, isInline: true, styles: [".button-block-root{width:100%;font:inherit;color:inherit;text-decoration:none;box-sizing:border-box}.button-block-placeholder{flex:1;display:flex;align-items:center;justify-content:center;color:#64748b66;font-size:12px;pointer-events:none;-webkit-user-select:none;user-select:none}:host ::ng-deep .button-block-root>[class*=iox-outer-]{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", "ioxDragSourceId"], outputs: ["onClick", "onMouseEnter", "onMouseLeave"] }, { kind: "directive", type: IoxDropzoneDirective, selector: "[ioxDropzone]", inputs: ["ioxDropzoneId", "ioxDropzoneData", "ioxDropzonePostDrop"], outputs: ["ioxDrop"] }] }); }
|
|
6016
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: BuilderButtonBlockComponent, deps: [{ token: i0.ElementRef }, { token: DragEngineService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
6017
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.11", type: BuilderButtonBlockComponent, isStandalone: false, selector: "button[iox-button-block],a[iox-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" }, host: { properties: { "class": "'button-block-root iox-node-' + nodeId", "attr.href": "tag === 'a' ? (href || null) : null", "attr.target": "tag === 'a' ? (target || null) : null", "attr.type": "tag === 'a' ? null : type" } }, ngImport: i0, template: `
|
|
6018
|
+
<span *ngIf="!children.length" class="button-block-placeholder">Button</span>
|
|
6019
|
+
|
|
6020
|
+
<!-- WRAPPER COLLAPSE (task 9c): render children directly into the host; iox-outer + drag land
|
|
6021
|
+
on each child's host (via ioxDragSourceId), matching the SSR engine. -->
|
|
6022
|
+
<ng-container *ngFor="let child of children"
|
|
6023
|
+
[ioxRender]="child"
|
|
6024
|
+
[ioxDragSourceId]="dropListId"
|
|
6025
|
+
(onClick)="childClick.emit($event)"
|
|
6026
|
+
(onMouseEnter)="childMouseEnter.emit($event)"
|
|
6027
|
+
(onMouseLeave)="childMouseLeave.emit()">
|
|
6028
|
+
</ng-container>
|
|
6029
|
+
`, isInline: true, styles: [":host{box-sizing:border-box}.button-block-placeholder{flex:1;display:flex;align-items:center;justify-content:center;color:#64748b66;font-size:12px;pointer-events:none;-webkit-user-select:none;user-select:none}:host ::ng-deep>[class*=iox-outer-]{min-width:0}\n"], dependencies: [{ 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", "ioxDragSourceId"], outputs: ["onClick", "onMouseEnter", "onMouseLeave"] }] }); }
|
|
6018
6030
|
}
|
|
6019
6031
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: BuilderButtonBlockComponent, decorators: [{
|
|
6020
6032
|
type: Component,
|
|
6021
|
-
args: [{ selector: '
|
|
6022
|
-
<
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
|
|
6040
|
-
</button>
|
|
6041
|
-
`, standalone: false, styles: [".button-block-root{width:100%;font:inherit;color:inherit;text-decoration:none;box-sizing:border-box}.button-block-placeholder{flex:1;display:flex;align-items:center;justify-content:center;color:#64748b66;font-size:12px;pointer-events:none;-webkit-user-select:none;user-select:none}:host ::ng-deep .button-block-root>[class*=iox-outer-]{min-width:0}\n"] }]
|
|
6042
|
-
}], ctorParameters: () => [{ type: DragEngineService }, { type: i0.ChangeDetectorRef }], propDecorators: { children: [{
|
|
6033
|
+
args: [{ selector: 'button[iox-button-block],a[iox-button-block]', template: `
|
|
6034
|
+
<span *ngIf="!children.length" class="button-block-placeholder">Button</span>
|
|
6035
|
+
|
|
6036
|
+
<!-- WRAPPER COLLAPSE (task 9c): render children directly into the host; iox-outer + drag land
|
|
6037
|
+
on each child's host (via ioxDragSourceId), matching the SSR engine. -->
|
|
6038
|
+
<ng-container *ngFor="let child of children"
|
|
6039
|
+
[ioxRender]="child"
|
|
6040
|
+
[ioxDragSourceId]="dropListId"
|
|
6041
|
+
(onClick)="childClick.emit($event)"
|
|
6042
|
+
(onMouseEnter)="childMouseEnter.emit($event)"
|
|
6043
|
+
(onMouseLeave)="childMouseLeave.emit()">
|
|
6044
|
+
</ng-container>
|
|
6045
|
+
`, host: {
|
|
6046
|
+
'[class]': "'button-block-root iox-node-' + nodeId",
|
|
6047
|
+
'[attr.href]': "tag === 'a' ? (href || null) : null",
|
|
6048
|
+
'[attr.target]': "tag === 'a' ? (target || null) : null",
|
|
6049
|
+
'[attr.type]': "tag === 'a' ? null : type",
|
|
6050
|
+
}, standalone: false, styles: [":host{box-sizing:border-box}.button-block-placeholder{flex:1;display:flex;align-items:center;justify-content:center;color:#64748b66;font-size:12px;pointer-events:none;-webkit-user-select:none;user-select:none}:host ::ng-deep>[class*=iox-outer-]{min-width:0}\n"] }]
|
|
6051
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: DragEngineService }, { type: i0.ChangeDetectorRef }], propDecorators: { children: [{
|
|
6043
6052
|
type: Input
|
|
6044
6053
|
}], style: [{
|
|
6045
6054
|
type: Input
|