@basis-ng/primitives 0.0.1-alpha.145 → 0.0.1-alpha.147
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.
|
@@ -1521,15 +1521,13 @@ class Drawer {
|
|
|
1521
1521
|
if (!this.isOpen())
|
|
1522
1522
|
return;
|
|
1523
1523
|
const target = event.target;
|
|
1524
|
-
// Check if click is inside the drawer
|
|
1525
1524
|
if (this.el.nativeElement.contains(target)) {
|
|
1526
1525
|
return;
|
|
1527
1526
|
}
|
|
1528
|
-
// Check if click is inside a CDK overlay (select dropdown, dialogs, etc.)
|
|
1529
1527
|
if (target.closest('.cdk-overlay-container')) {
|
|
1530
1528
|
return;
|
|
1531
1529
|
}
|
|
1532
|
-
this.
|
|
1530
|
+
this.requestClose();
|
|
1533
1531
|
}
|
|
1534
1532
|
/**
|
|
1535
1533
|
* Begin tracking pointer movement for drag-to-dismiss.
|
|
@@ -1579,7 +1577,7 @@ class Drawer {
|
|
|
1579
1577
|
*/
|
|
1580
1578
|
snapToOpenOrClose() {
|
|
1581
1579
|
if (this.dragProgress() > this.closeThreshold()) {
|
|
1582
|
-
this.
|
|
1580
|
+
this.requestClose();
|
|
1583
1581
|
}
|
|
1584
1582
|
else {
|
|
1585
1583
|
this.isOpen.set(true);
|
|
@@ -1588,7 +1586,7 @@ class Drawer {
|
|
|
1588
1586
|
/**
|
|
1589
1587
|
* Closes the drawer and emits the close event.
|
|
1590
1588
|
*/
|
|
1591
|
-
|
|
1589
|
+
requestClose() {
|
|
1592
1590
|
this.isOpen.set(false);
|
|
1593
1591
|
this.closeSheet.emit();
|
|
1594
1592
|
}
|
|
@@ -1633,6 +1631,7 @@ class Drawer {
|
|
|
1633
1631
|
<div class="drag-indicator"></div>
|
|
1634
1632
|
</div>
|
|
1635
1633
|
}
|
|
1634
|
+
|
|
1636
1635
|
<div class="drawer-content" (click)="$event.stopPropagation()">
|
|
1637
1636
|
<ng-content />
|
|
1638
1637
|
</div>
|
|
@@ -1650,6 +1649,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
1650
1649
|
<div class="drag-indicator"></div>
|
|
1651
1650
|
</div>
|
|
1652
1651
|
}
|
|
1652
|
+
|
|
1653
1653
|
<div class="drawer-content" (click)="$event.stopPropagation()">
|
|
1654
1654
|
<ng-content />
|
|
1655
1655
|
</div>
|
|
@@ -1684,6 +1684,71 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
1684
1684
|
}]
|
|
1685
1685
|
}] });
|
|
1686
1686
|
|
|
1687
|
+
/**
|
|
1688
|
+
* A full-viewport backdrop layer that can dim background content behind projected overlays.
|
|
1689
|
+
*/
|
|
1690
|
+
class Backdrop {
|
|
1691
|
+
/**
|
|
1692
|
+
* Whether the backdrop is active.
|
|
1693
|
+
*/
|
|
1694
|
+
isOpen = model(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
|
|
1695
|
+
/**
|
|
1696
|
+
* Optional open progress from 0 (open) to 100 (closed).
|
|
1697
|
+
*/
|
|
1698
|
+
progress = input(null, ...(ngDevMode ? [{ debugName: "progress" }] : []));
|
|
1699
|
+
/**
|
|
1700
|
+
* Maximum darkness applied when fully open.
|
|
1701
|
+
*/
|
|
1702
|
+
maxOpacity = input(0.14, ...(ngDevMode ? [{ debugName: "maxOpacity" }] : []));
|
|
1703
|
+
/**
|
|
1704
|
+
* Whether clicking the backdrop closes it automatically.
|
|
1705
|
+
*/
|
|
1706
|
+
closeOnClick = input(true, { ...(ngDevMode ? { debugName: "closeOnClick" } : {}), transform: booleanAttribute });
|
|
1707
|
+
/**
|
|
1708
|
+
* Whether opacity changes should animate.
|
|
1709
|
+
*/
|
|
1710
|
+
animated = input(true, { ...(ngDevMode ? { debugName: "animated" } : {}), transform: booleanAttribute });
|
|
1711
|
+
/**
|
|
1712
|
+
* Emitted whenever the backdrop surface is clicked.
|
|
1713
|
+
*/
|
|
1714
|
+
backdropClick = output();
|
|
1715
|
+
/**
|
|
1716
|
+
* Current effective opacity based on explicit progress or open state.
|
|
1717
|
+
*/
|
|
1718
|
+
opacity = computed(() => {
|
|
1719
|
+
const progress = this.progress();
|
|
1720
|
+
if (progress === null) {
|
|
1721
|
+
return this.isOpen() ? this.maxOpacity() : 0;
|
|
1722
|
+
}
|
|
1723
|
+
return ((100 - progress) / 100) * this.maxOpacity();
|
|
1724
|
+
}, ...(ngDevMode ? [{ debugName: "opacity" }] : []));
|
|
1725
|
+
handleBackdropClick() {
|
|
1726
|
+
this.backdropClick.emit();
|
|
1727
|
+
if (this.closeOnClick()) {
|
|
1728
|
+
this.isOpen.set(false);
|
|
1729
|
+
}
|
|
1730
|
+
}
|
|
1731
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: Backdrop, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1732
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.8", type: Backdrop, isStandalone: true, selector: "b-backdrop", inputs: { isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, progress: { classPropertyName: "progress", publicName: "progress", isSignal: true, isRequired: false, transformFunction: null }, maxOpacity: { classPropertyName: "maxOpacity", publicName: "maxOpacity", isSignal: true, isRequired: false, transformFunction: null }, closeOnClick: { classPropertyName: "closeOnClick", publicName: "closeOnClick", isSignal: true, isRequired: false, transformFunction: null }, animated: { classPropertyName: "animated", publicName: "animated", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isOpen: "isOpenChange", backdropClick: "backdropClick" }, host: { properties: { "class.b-open": "isOpen()", "class.b-animated": "animated()" } }, ngImport: i0, template: `
|
|
1733
|
+
<div class="b-backdrop-layer" [style.opacity]="opacity()" (click)="handleBackdropClick()"></div>
|
|
1734
|
+
<ng-content />
|
|
1735
|
+
`, isInline: true });
|
|
1736
|
+
}
|
|
1737
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: Backdrop, decorators: [{
|
|
1738
|
+
type: Component,
|
|
1739
|
+
args: [{
|
|
1740
|
+
selector: 'b-backdrop',
|
|
1741
|
+
template: `
|
|
1742
|
+
<div class="b-backdrop-layer" [style.opacity]="opacity()" (click)="handleBackdropClick()"></div>
|
|
1743
|
+
<ng-content />
|
|
1744
|
+
`,
|
|
1745
|
+
host: {
|
|
1746
|
+
'[class.b-open]': 'isOpen()',
|
|
1747
|
+
'[class.b-animated]': 'animated()',
|
|
1748
|
+
},
|
|
1749
|
+
}]
|
|
1750
|
+
}], propDecorators: { isOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpen", required: false }] }, { type: i0.Output, args: ["isOpenChange"] }], progress: [{ type: i0.Input, args: [{ isSignal: true, alias: "progress", required: false }] }], maxOpacity: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxOpacity", required: false }] }], closeOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnClick", required: false }] }], animated: [{ type: i0.Input, args: [{ isSignal: true, alias: "animated", required: false }] }], backdropClick: [{ type: i0.Output, args: ["backdropClick"] }] } });
|
|
1751
|
+
|
|
1687
1752
|
/**
|
|
1688
1753
|
* Root menu container that applies CDK menu behavior.
|
|
1689
1754
|
*/
|
|
@@ -3112,6 +3177,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
3112
3177
|
}]
|
|
3113
3178
|
}] });
|
|
3114
3179
|
|
|
3180
|
+
/**
|
|
3181
|
+
* A loading directive that overlays a skeleton shimmer on the host element while preserving size.
|
|
3182
|
+
*/
|
|
3183
|
+
class Skeleton {
|
|
3184
|
+
/**
|
|
3185
|
+
* Whether the host should display the skeleton state.
|
|
3186
|
+
*/
|
|
3187
|
+
loading = input(true, { ...(ngDevMode ? { debugName: "loading" } : {}), alias: 'bSkeleton', transform: booleanAttribute });
|
|
3188
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: Skeleton, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
3189
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.8", type: Skeleton, isStandalone: true, selector: "[bSkeleton]", inputs: { loading: { classPropertyName: "loading", publicName: "bSkeleton", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.aria-busy": "loading()", "class.b-skeleton": "true", "class.b-loading": "loading()" } }, ngImport: i0 });
|
|
3190
|
+
}
|
|
3191
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: Skeleton, decorators: [{
|
|
3192
|
+
type: Directive,
|
|
3193
|
+
args: [{
|
|
3194
|
+
selector: '[bSkeleton]',
|
|
3195
|
+
host: {
|
|
3196
|
+
'[attr.aria-busy]': 'loading()',
|
|
3197
|
+
'[class.b-skeleton]': 'true',
|
|
3198
|
+
'[class.b-loading]': 'loading()',
|
|
3199
|
+
},
|
|
3200
|
+
}]
|
|
3201
|
+
}], propDecorators: { loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "bSkeleton", required: false }] }] } });
|
|
3202
|
+
|
|
3115
3203
|
/**
|
|
3116
3204
|
* A spinner component to indicate loading states.
|
|
3117
3205
|
*/
|
|
@@ -4193,5 +4281,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
4193
4281
|
* Generated bundle index. Do not edit.
|
|
4194
4282
|
*/
|
|
4195
4283
|
|
|
4196
|
-
export { Alert, Badge, Button, ButtonGroup, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CommandComponent, CommandOptionsComponent, ConnectedOverlay, Dialog, DialogContent, DialogManager, Drawer, Input, InputGroup, Menu, MenuGroup, MenuItem, MenuItemCheckbox, MenuItemRadio, MenuLabel, MenuTriggerDirective, Option, Otp, OtpDigitDirective, Overlay, OverlayOrigin, OverlayTrigger, Popover, PopoverTrigger, Range, ResponsiveManager, Select, SelectContent, SelectFilter, SelectTrigger, SelectValue, Spinner, SwitchComponent, Tab, Tabs, Textarea, TextareaGroup, ThemeManager, Tooltip, TooltipContent, TooltipTrigger, TranslatePipe, TranslationManager, Tree, TreeNode, Utils };
|
|
4284
|
+
export { Alert, Backdrop, Badge, Button, ButtonGroup, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CommandComponent, CommandOptionsComponent, ConnectedOverlay, Dialog, DialogContent, DialogManager, Drawer, Input, InputGroup, Menu, MenuGroup, MenuItem, MenuItemCheckbox, MenuItemRadio, MenuLabel, MenuTriggerDirective, Option, Otp, OtpDigitDirective, Overlay, OverlayOrigin, OverlayTrigger, Popover, PopoverTrigger, Range, ResponsiveManager, Select, SelectContent, SelectFilter, SelectTrigger, SelectValue, Skeleton, Spinner, SwitchComponent, Tab, Tabs, Textarea, TextareaGroup, ThemeManager, Tooltip, TooltipContent, TooltipTrigger, TranslatePipe, TranslationManager, Tree, TreeNode, Utils };
|
|
4197
4285
|
//# sourceMappingURL=basis-ng-primitives.mjs.map
|