codexly-ui 0.6.6 → 0.6.8
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.
- package/fesm2022/codexly-ui.mjs +54 -21
- package/fesm2022/codexly-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/codexly-ui.d.ts +16 -6
package/fesm2022/codexly-ui.mjs
CHANGED
|
@@ -12367,13 +12367,14 @@ class ClxFabComponent {
|
|
|
12367
12367
|
position = input(undefined, ...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
|
|
12368
12368
|
/** Initial corner used only when the user hasn't dragged/saved a position yet. */
|
|
12369
12369
|
defaultPosition = input(DEFAULT_POSITION, ...(ngDevMode ? [{ debugName: "defaultPosition" }] : /* istanbul ignore next */ []));
|
|
12370
|
+
/** Direction the shortcut stack expands toward. */
|
|
12371
|
+
expandDirection = input('up', ...(ngDevMode ? [{ debugName: "expandDirection" }] : /* istanbul ignore next */ []));
|
|
12370
12372
|
// ── Outputs ─────────────────────────────────────────────────────────────────
|
|
12371
12373
|
itemClick = output();
|
|
12372
12374
|
/** Emitted once, after a drag ends, with the new position to persist. */
|
|
12373
12375
|
positionChange = output();
|
|
12374
12376
|
_themeSvc = inject(ClxThemeService);
|
|
12375
12377
|
_document = inject(DOCUMENT$1);
|
|
12376
|
-
_elementRef = inject((ElementRef));
|
|
12377
12378
|
_color = computed(() => this.color() ?? this._themeSvc.config().primaryColor, ...(ngDevMode ? [{ debugName: "_color" }] : /* istanbul ignore next */ []));
|
|
12378
12379
|
_draggedPosition = signal(null, ...(ngDevMode ? [{ debugName: "_draggedPosition" }] : /* istanbul ignore next */ []));
|
|
12379
12380
|
_position = computed(() => this._draggedPosition() ?? this.position() ?? this.defaultPosition(), ...(ngDevMode ? [{ debugName: "_position" }] : /* istanbul ignore next */ []));
|
|
@@ -12388,10 +12389,46 @@ class ClxFabComponent {
|
|
|
12388
12389
|
// ── CDK Overlay ─────────────────────────────────────────────────────────────
|
|
12389
12390
|
_sso = inject(ScrollStrategyOptions);
|
|
12390
12391
|
_scrollStrategy = this._sso.reposition();
|
|
12391
|
-
|
|
12392
|
-
|
|
12393
|
-
|
|
12394
|
-
|
|
12392
|
+
static POSITIONS_BY_DIRECTION = {
|
|
12393
|
+
up: [
|
|
12394
|
+
{ originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom', offsetY: -8 },
|
|
12395
|
+
{ originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top', offsetY: 8 },
|
|
12396
|
+
],
|
|
12397
|
+
down: [
|
|
12398
|
+
{ originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top', offsetY: 8 },
|
|
12399
|
+
{ originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom', offsetY: -8 },
|
|
12400
|
+
],
|
|
12401
|
+
left: [
|
|
12402
|
+
{ originX: 'start', originY: 'center', overlayX: 'end', overlayY: 'center', offsetX: -8 },
|
|
12403
|
+
{ originX: 'end', originY: 'center', overlayX: 'start', overlayY: 'center', offsetX: 8 },
|
|
12404
|
+
],
|
|
12405
|
+
right: [
|
|
12406
|
+
{ originX: 'end', originY: 'center', overlayX: 'start', overlayY: 'center', offsetX: 8 },
|
|
12407
|
+
{ originX: 'start', originY: 'center', overlayX: 'end', overlayY: 'center', offsetX: -8 },
|
|
12408
|
+
],
|
|
12409
|
+
};
|
|
12410
|
+
_positions = computed(() => ClxFabComponent.POSITIONS_BY_DIRECTION[this.expandDirection()], ...(ngDevMode ? [{ debugName: "_positions" }] : /* istanbul ignore next */ []));
|
|
12411
|
+
static STACK_CLASS_BY_DIRECTION = {
|
|
12412
|
+
up: 'flex-col items-end mb-2',
|
|
12413
|
+
down: 'flex-col-reverse items-end mt-2',
|
|
12414
|
+
left: 'flex-row items-center mr-2',
|
|
12415
|
+
right: 'flex-row-reverse items-center ml-2',
|
|
12416
|
+
};
|
|
12417
|
+
_stackClass = computed(() => `flex gap-2 ${ClxFabComponent.STACK_CLASS_BY_DIRECTION[this.expandDirection()]}`, ...(ngDevMode ? [{ debugName: "_stackClass" }] : /* istanbul ignore next */ []));
|
|
12418
|
+
static ITEM_CLASS_BY_DIRECTION = {
|
|
12419
|
+
up: 'flex items-center gap-2',
|
|
12420
|
+
down: 'flex items-center gap-2',
|
|
12421
|
+
left: 'flex items-center gap-2 flex-row-reverse',
|
|
12422
|
+
right: 'flex items-center gap-2',
|
|
12423
|
+
};
|
|
12424
|
+
_itemClass = computed(() => ClxFabComponent.ITEM_CLASS_BY_DIRECTION[this.expandDirection()], ...(ngDevMode ? [{ debugName: "_itemClass" }] : /* istanbul ignore next */ []));
|
|
12425
|
+
static ANIMATION_BY_DIRECTION = {
|
|
12426
|
+
up: 'fadeInUp',
|
|
12427
|
+
down: 'fadeInDown',
|
|
12428
|
+
left: 'fadeInLeft',
|
|
12429
|
+
right: 'fadeInRight',
|
|
12430
|
+
};
|
|
12431
|
+
_itemAnimation = computed(() => ClxFabComponent.ANIMATION_BY_DIRECTION[this.expandDirection()], ...(ngDevMode ? [{ debugName: "_itemAnimation" }] : /* istanbul ignore next */ []));
|
|
12395
12432
|
// ── State ────────────────────────────────────────────────────────────────────
|
|
12396
12433
|
_isOpen = signal(false, ...(ngDevMode ? [{ debugName: "_isOpen" }] : /* istanbul ignore next */ []));
|
|
12397
12434
|
// ── Drag ─────────────────────────────────────────────────────────────────────
|
|
@@ -12411,8 +12448,6 @@ class ClxFabComponent {
|
|
|
12411
12448
|
const current = this._position();
|
|
12412
12449
|
this._dragStartRight = current.right;
|
|
12413
12450
|
this._dragStartBottom = current.bottom;
|
|
12414
|
-
const wrapper = this._elementRef.nativeElement.querySelector('[cdkOverlayOrigin]');
|
|
12415
|
-
wrapper?.setPointerCapture(event.pointerId);
|
|
12416
12451
|
const onMove = (e) => this._onPointerMove(e);
|
|
12417
12452
|
const onUp = (e) => {
|
|
12418
12453
|
this._onPointerUp(e);
|
|
@@ -12460,10 +12495,9 @@ class ClxFabComponent {
|
|
|
12460
12495
|
this._close();
|
|
12461
12496
|
}
|
|
12462
12497
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ClxFabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
12463
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.15", type: ClxFabComponent, isStandalone: true, selector: "clx-fab", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, shadow: { classPropertyName: "shadow", publicName: "shadow", isSignal: true, isRequired: false, transformFunction: null }, triggerLabel: { classPropertyName: "triggerLabel", publicName: "triggerLabel", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, defaultPosition: { classPropertyName: "defaultPosition", publicName: "defaultPosition", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemClick: "itemClick", positionChange: "positionChange" }, ngImport: i0, template: `
|
|
12498
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.15", type: ClxFabComponent, isStandalone: true, selector: "clx-fab", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, shadow: { classPropertyName: "shadow", publicName: "shadow", isSignal: true, isRequired: false, transformFunction: null }, triggerLabel: { classPropertyName: "triggerLabel", publicName: "triggerLabel", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, defaultPosition: { classPropertyName: "defaultPosition", publicName: "defaultPosition", isSignal: true, isRequired: false, transformFunction: null }, expandDirection: { classPropertyName: "expandDirection", publicName: "expandDirection", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemClick: "itemClick", positionChange: "positionChange" }, ngImport: i0, template: `
|
|
12464
12499
|
<!-- ── Trigger (this wrapper owns the fixed positioning + drag; the button inside stays a plain clx-button) ── -->
|
|
12465
12500
|
<div
|
|
12466
|
-
#wrapper
|
|
12467
12501
|
#origin="cdkOverlayOrigin"
|
|
12468
12502
|
cdkOverlayOrigin
|
|
12469
12503
|
class="fixed z-40 select-none"
|
|
@@ -12487,25 +12521,25 @@ class ClxFabComponent {
|
|
|
12487
12521
|
</button>
|
|
12488
12522
|
</div>
|
|
12489
12523
|
|
|
12490
|
-
<!-- ── Overlay panel:
|
|
12524
|
+
<!-- ── Overlay panel: stack expanding toward expandDirection() ────────────────── -->
|
|
12491
12525
|
<ng-template
|
|
12492
12526
|
cdkConnectedOverlay
|
|
12493
12527
|
[cdkConnectedOverlayOrigin]="origin"
|
|
12494
12528
|
[cdkConnectedOverlayOpen]="_isOpen()"
|
|
12495
|
-
[cdkConnectedOverlayPositions]="_positions"
|
|
12529
|
+
[cdkConnectedOverlayPositions]="_positions()"
|
|
12496
12530
|
[cdkConnectedOverlayScrollStrategy]="_scrollStrategy"
|
|
12497
12531
|
[cdkConnectedOverlayPush]="true"
|
|
12498
12532
|
(overlayOutsideClick)="_close()"
|
|
12499
12533
|
(overlayKeydown)="_onKeydown($event)">
|
|
12500
12534
|
|
|
12501
|
-
<div class="
|
|
12535
|
+
<div [class]="_stackClass()" role="menu">
|
|
12502
12536
|
@for (item of items(); track item.key; let i = $index) {
|
|
12503
12537
|
<div
|
|
12504
|
-
clxAnimate="
|
|
12538
|
+
[clxAnimate]="_itemAnimation()"
|
|
12505
12539
|
trigger="onEnter"
|
|
12506
12540
|
[delay]="i * 60"
|
|
12507
12541
|
[duration]="220"
|
|
12508
|
-
class="
|
|
12542
|
+
[class]="_itemClass()">
|
|
12509
12543
|
<span class="px-2.5 py-1 rounded-lg bg-clx-surface border border-clx-border shadow-sm text-xs font-medium text-clx-text-label whitespace-nowrap">
|
|
12510
12544
|
{{ item.label }}
|
|
12511
12545
|
</span>
|
|
@@ -12529,7 +12563,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
12529
12563
|
template: `
|
|
12530
12564
|
<!-- ── Trigger (this wrapper owns the fixed positioning + drag; the button inside stays a plain clx-button) ── -->
|
|
12531
12565
|
<div
|
|
12532
|
-
#wrapper
|
|
12533
12566
|
#origin="cdkOverlayOrigin"
|
|
12534
12567
|
cdkOverlayOrigin
|
|
12535
12568
|
class="fixed z-40 select-none"
|
|
@@ -12553,25 +12586,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
12553
12586
|
</button>
|
|
12554
12587
|
</div>
|
|
12555
12588
|
|
|
12556
|
-
<!-- ── Overlay panel:
|
|
12589
|
+
<!-- ── Overlay panel: stack expanding toward expandDirection() ────────────────── -->
|
|
12557
12590
|
<ng-template
|
|
12558
12591
|
cdkConnectedOverlay
|
|
12559
12592
|
[cdkConnectedOverlayOrigin]="origin"
|
|
12560
12593
|
[cdkConnectedOverlayOpen]="_isOpen()"
|
|
12561
|
-
[cdkConnectedOverlayPositions]="_positions"
|
|
12594
|
+
[cdkConnectedOverlayPositions]="_positions()"
|
|
12562
12595
|
[cdkConnectedOverlayScrollStrategy]="_scrollStrategy"
|
|
12563
12596
|
[cdkConnectedOverlayPush]="true"
|
|
12564
12597
|
(overlayOutsideClick)="_close()"
|
|
12565
12598
|
(overlayKeydown)="_onKeydown($event)">
|
|
12566
12599
|
|
|
12567
|
-
<div class="
|
|
12600
|
+
<div [class]="_stackClass()" role="menu">
|
|
12568
12601
|
@for (item of items(); track item.key; let i = $index) {
|
|
12569
12602
|
<div
|
|
12570
|
-
clxAnimate="
|
|
12603
|
+
[clxAnimate]="_itemAnimation()"
|
|
12571
12604
|
trigger="onEnter"
|
|
12572
12605
|
[delay]="i * 60"
|
|
12573
12606
|
[duration]="220"
|
|
12574
|
-
class="
|
|
12607
|
+
[class]="_itemClass()">
|
|
12575
12608
|
<span class="px-2.5 py-1 rounded-lg bg-clx-surface border border-clx-border shadow-sm text-xs font-medium text-clx-text-label whitespace-nowrap">
|
|
12576
12609
|
{{ item.label }}
|
|
12577
12610
|
</span>
|
|
@@ -12588,7 +12621,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
12588
12621
|
encapsulation: ViewEncapsulation.None,
|
|
12589
12622
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12590
12623
|
}]
|
|
12591
|
-
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], shadow: [{ type: i0.Input, args: [{ isSignal: true, alias: "shadow", required: false }] }], triggerLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "triggerLabel", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], defaultPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultPosition", required: false }] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }], positionChange: [{ type: i0.Output, args: ["positionChange"] }] } });
|
|
12624
|
+
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], shadow: [{ type: i0.Input, args: [{ isSignal: true, alias: "shadow", required: false }] }], triggerLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "triggerLabel", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], defaultPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultPosition", required: false }] }], expandDirection: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandDirection", required: false }] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }], positionChange: [{ type: i0.Output, args: ["positionChange"] }] } });
|
|
12592
12625
|
|
|
12593
12626
|
// ── Base classes ─────────────────────────────────────────────────────────────
|
|
12594
12627
|
const TABLE_BASE_CLASS = 'w-full text-left border-collapse text-sm';
|