ng-blatui 1.13.0 → 1.15.0
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/ng-blatui.mjs +243 -10
- package/fesm2022/ng-blatui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/ng-blatui.d.ts +94 -1
package/fesm2022/ng-blatui.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
2
|
import { twMerge } from 'tailwind-merge';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { input, computed, Directive, Component, signal, model, inject, PLATFORM_ID, effect, Injectable, ElementRef, ViewContainerRef, viewChild } from '@angular/core';
|
|
4
|
+
import { input, computed, Directive, Component, signal, model, inject, PLATFORM_ID, effect, Injectable, ElementRef, ViewContainerRef, viewChild, afterNextRender } from '@angular/core';
|
|
5
5
|
import { cva } from 'class-variance-authority';
|
|
6
6
|
export { AccordionContent, AccordionGroup, AccordionPanel, AccordionTrigger, ɵɵDeferredContent, ɵɵDeferredContentAware } from '@angular/aria/accordion';
|
|
7
7
|
export { Tab, TabContent, TabList, TabPanel, Tabs } from '@angular/aria/tabs';
|
|
@@ -10,6 +10,8 @@ import { isPlatformBrowser } from '@angular/common';
|
|
|
10
10
|
import { _IdGenerator } from '@angular/cdk/a11y';
|
|
11
11
|
import { Overlay } from '@angular/cdk/overlay';
|
|
12
12
|
import { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';
|
|
13
|
+
import { Menu } from '@angular/aria/menu';
|
|
14
|
+
export { Menu, MenuBar, MenuContent, MenuItem, MenuTrigger } from '@angular/aria/menu';
|
|
13
15
|
|
|
14
16
|
/**
|
|
15
17
|
* Merge class names with `clsx` semantics and resolve Tailwind conflicts with
|
|
@@ -69,8 +71,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
69
71
|
}]
|
|
70
72
|
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
71
73
|
|
|
72
|
-
const BASE = 'inline-flex items-center justify-center rounded-md border font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden';
|
|
73
|
-
const SIZES$
|
|
74
|
+
const BASE$1 = 'inline-flex items-center justify-center rounded-md border font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden';
|
|
75
|
+
const SIZES$3 = {
|
|
74
76
|
sm: 'px-1.5 py-px text-[0.625rem]',
|
|
75
77
|
default: 'px-2 py-0.5 text-xs',
|
|
76
78
|
lg: 'px-3 py-1 text-sm [&>svg]:size-3.5',
|
|
@@ -144,7 +146,7 @@ class BuiBadge {
|
|
|
144
146
|
computedClass = computed(() => {
|
|
145
147
|
const tone = this.tone();
|
|
146
148
|
const toneOrVariant = tone === null ? brandClass(this.variant()) : TONES$2[tone][intensityFor(this.variant())];
|
|
147
|
-
return cn(BASE, SIZES$
|
|
149
|
+
return cn(BASE$1, SIZES$3[this.size()], toneOrVariant, this.userClass());
|
|
148
150
|
}, /* @ts-ignore */
|
|
149
151
|
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
150
152
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiBadge, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -2343,7 +2345,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
2343
2345
|
}]
|
|
2344
2346
|
}], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
2345
2347
|
|
|
2346
|
-
const SIZES$
|
|
2348
|
+
const SIZES$2 = {
|
|
2347
2349
|
sm: 'max-w-3xl',
|
|
2348
2350
|
md: 'max-w-5xl',
|
|
2349
2351
|
lg: 'max-w-6xl',
|
|
@@ -2356,7 +2358,7 @@ class BuiContainer {
|
|
|
2356
2358
|
size = input('lg', /* @ts-ignore */
|
|
2357
2359
|
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
2358
2360
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
2359
|
-
computedClass = computed(() => cn('mx-auto w-full px-4 sm:px-6 lg:px-8', SIZES$
|
|
2361
|
+
computedClass = computed(() => cn('mx-auto w-full px-4 sm:px-6 lg:px-8', SIZES$2[this.size()], this.userClass()), /* @ts-ignore */
|
|
2360
2362
|
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
2361
2363
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiContainer, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2362
2364
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: BuiContainer, isStandalone: true, selector: "[buiContainer]", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "container" }, properties: { "class": "computedClass()" } }, ngImport: i0 });
|
|
@@ -3043,7 +3045,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
3043
3045
|
}]
|
|
3044
3046
|
}], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
3045
3047
|
|
|
3046
|
-
const SIZES = {
|
|
3048
|
+
const SIZES$1 = {
|
|
3047
3049
|
sm: { box: 'size-6', overlap: '-ms-2', ring: 'ring-1', text: 'text-xs' },
|
|
3048
3050
|
default: { box: 'size-8', overlap: '-ms-2.5', ring: 'ring-2', text: 'text-sm' },
|
|
3049
3051
|
lg: { box: 'size-12', overlap: '-ms-3', ring: 'ring-2', text: 'text-base' },
|
|
@@ -3075,11 +3077,11 @@ class BuiAvatarGroup {
|
|
|
3075
3077
|
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
3076
3078
|
toInitials = initials;
|
|
3077
3079
|
itemClass(index) {
|
|
3078
|
-
const size = SIZES[this.size()];
|
|
3080
|
+
const size = SIZES$1[this.size()];
|
|
3079
3081
|
return cn(size.box, size.ring, 'ring-background', index > 0 && size.overlap);
|
|
3080
3082
|
}
|
|
3081
3083
|
moreClass() {
|
|
3082
|
-
const size = SIZES[this.size()];
|
|
3084
|
+
const size = SIZES$1[this.size()];
|
|
3083
3085
|
return cn('relative z-10 flex shrink-0 items-center justify-center rounded-full bg-muted font-medium text-foreground', size.box, size.ring, 'ring-background', size.text, this.shown().length > 0 && size.overlap);
|
|
3084
3086
|
}
|
|
3085
3087
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiAvatarGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -4498,6 +4500,237 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
4498
4500
|
}]
|
|
4499
4501
|
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
4500
4502
|
|
|
4503
|
+
/**
|
|
4504
|
+
* Confirm dialog styling (`role="alertdialog"`). Open it with the CDK `Dialog` service
|
|
4505
|
+
* (re-exported from `ng-blatui`) on a template whose root carries `buiAlertDialogContent`.
|
|
4506
|
+
*/
|
|
4507
|
+
class BuiAlertDialogContent {
|
|
4508
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
4509
|
+
computedClass = computed(() => cn('relative grid w-full max-w-[calc(100%-2rem)] gap-4 rounded-lg border bg-background p-6 shadow-lg sm:max-w-lg', this.userClass()), /* @ts-ignore */
|
|
4510
|
+
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
4511
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiAlertDialogContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4512
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: BuiAlertDialogContent, isStandalone: true, selector: "[buiAlertDialogContent]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "alert-dialog-content", "role": "alertdialog" }, properties: { "class": "computedClass()" } }, ngImport: i0 });
|
|
4513
|
+
}
|
|
4514
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiAlertDialogContent, decorators: [{
|
|
4515
|
+
type: Directive,
|
|
4516
|
+
args: [{
|
|
4517
|
+
selector: '[buiAlertDialogContent]',
|
|
4518
|
+
host: { 'data-slot': 'alert-dialog-content', role: 'alertdialog', '[class]': 'computedClass()' },
|
|
4519
|
+
}]
|
|
4520
|
+
}], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
4521
|
+
class BuiAlertDialogHeader {
|
|
4522
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
4523
|
+
computedClass = computed(() => cn('flex flex-col gap-2 text-center sm:text-left', this.userClass()), /* @ts-ignore */
|
|
4524
|
+
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
4525
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiAlertDialogHeader, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4526
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: BuiAlertDialogHeader, isStandalone: true, selector: "[buiAlertDialogHeader]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "alert-dialog-header" }, properties: { "class": "computedClass()" } }, ngImport: i0 });
|
|
4527
|
+
}
|
|
4528
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiAlertDialogHeader, decorators: [{
|
|
4529
|
+
type: Directive,
|
|
4530
|
+
args: [{
|
|
4531
|
+
selector: '[buiAlertDialogHeader]',
|
|
4532
|
+
host: { 'data-slot': 'alert-dialog-header', '[class]': 'computedClass()' },
|
|
4533
|
+
}]
|
|
4534
|
+
}], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
4535
|
+
class BuiAlertDialogTitle {
|
|
4536
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
4537
|
+
computedClass = computed(() => cn('text-lg font-semibold', this.userClass()), /* @ts-ignore */
|
|
4538
|
+
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
4539
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiAlertDialogTitle, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4540
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: BuiAlertDialogTitle, isStandalone: true, selector: "[buiAlertDialogTitle]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "alert-dialog-title" }, properties: { "class": "computedClass()" } }, ngImport: i0 });
|
|
4541
|
+
}
|
|
4542
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiAlertDialogTitle, decorators: [{
|
|
4543
|
+
type: Directive,
|
|
4544
|
+
args: [{
|
|
4545
|
+
selector: '[buiAlertDialogTitle]',
|
|
4546
|
+
host: { 'data-slot': 'alert-dialog-title', '[class]': 'computedClass()' },
|
|
4547
|
+
}]
|
|
4548
|
+
}], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
4549
|
+
class BuiAlertDialogDescription {
|
|
4550
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
4551
|
+
computedClass = computed(() => cn('text-sm text-muted-foreground', this.userClass()), /* @ts-ignore */
|
|
4552
|
+
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
4553
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiAlertDialogDescription, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4554
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: BuiAlertDialogDescription, isStandalone: true, selector: "[buiAlertDialogDescription]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "alert-dialog-description" }, properties: { "class": "computedClass()" } }, ngImport: i0 });
|
|
4555
|
+
}
|
|
4556
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiAlertDialogDescription, decorators: [{
|
|
4557
|
+
type: Directive,
|
|
4558
|
+
args: [{
|
|
4559
|
+
selector: '[buiAlertDialogDescription]',
|
|
4560
|
+
host: { 'data-slot': 'alert-dialog-description', '[class]': 'computedClass()' },
|
|
4561
|
+
}]
|
|
4562
|
+
}], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
4563
|
+
class BuiAlertDialogFooter {
|
|
4564
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
4565
|
+
computedClass = computed(() => cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', this.userClass()), /* @ts-ignore */
|
|
4566
|
+
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
4567
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiAlertDialogFooter, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4568
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: BuiAlertDialogFooter, isStandalone: true, selector: "[buiAlertDialogFooter]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "alert-dialog-footer" }, properties: { "class": "computedClass()" } }, ngImport: i0 });
|
|
4569
|
+
}
|
|
4570
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiAlertDialogFooter, decorators: [{
|
|
4571
|
+
type: Directive,
|
|
4572
|
+
args: [{
|
|
4573
|
+
selector: '[buiAlertDialogFooter]',
|
|
4574
|
+
host: { 'data-slot': 'alert-dialog-footer', '[class]': 'computedClass()' },
|
|
4575
|
+
}]
|
|
4576
|
+
}], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
4577
|
+
/** Primary confirm action button. */
|
|
4578
|
+
class BuiAlertDialogAction {
|
|
4579
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
4580
|
+
computedClass = computed(() => cn(buttonVariants(), this.userClass()), /* @ts-ignore */
|
|
4581
|
+
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
4582
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiAlertDialogAction, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4583
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: BuiAlertDialogAction, isStandalone: true, selector: "button[buiAlertDialogAction]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "button", "data-slot": "alert-dialog-action" }, properties: { "class": "computedClass()" } }, ngImport: i0 });
|
|
4584
|
+
}
|
|
4585
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiAlertDialogAction, decorators: [{
|
|
4586
|
+
type: Directive,
|
|
4587
|
+
args: [{
|
|
4588
|
+
selector: 'button[buiAlertDialogAction]',
|
|
4589
|
+
host: { type: 'button', 'data-slot': 'alert-dialog-action', '[class]': 'computedClass()' },
|
|
4590
|
+
}]
|
|
4591
|
+
}], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
4592
|
+
/** Cancel (dismiss) button. */
|
|
4593
|
+
class BuiAlertDialogCancel {
|
|
4594
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
4595
|
+
computedClass = computed(() => cn(buttonVariants({ variant: 'outline' }), this.userClass()), /* @ts-ignore */
|
|
4596
|
+
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
4597
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiAlertDialogCancel, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4598
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: BuiAlertDialogCancel, isStandalone: true, selector: "button[buiAlertDialogCancel]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "button", "data-slot": "alert-dialog-cancel" }, properties: { "class": "computedClass()" } }, ngImport: i0 });
|
|
4599
|
+
}
|
|
4600
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiAlertDialogCancel, decorators: [{
|
|
4601
|
+
type: Directive,
|
|
4602
|
+
args: [{
|
|
4603
|
+
selector: 'button[buiAlertDialogCancel]',
|
|
4604
|
+
host: { type: 'button', 'data-slot': 'alert-dialog-cancel', '[class]': 'computedClass()' },
|
|
4605
|
+
}]
|
|
4606
|
+
}], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
4607
|
+
|
|
4608
|
+
const BASE = 'border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 flex w-full resize-none overflow-hidden rounded-md border bg-transparent shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50';
|
|
4609
|
+
const SIZES = {
|
|
4610
|
+
sm: 'min-h-14 px-2.5 py-1.5 text-sm',
|
|
4611
|
+
default: 'min-h-16 px-3 py-2 text-base md:text-sm',
|
|
4612
|
+
lg: 'min-h-20 px-4 py-2.5 text-base',
|
|
4613
|
+
};
|
|
4614
|
+
/**
|
|
4615
|
+
* A textarea that grows with its content. SSR-safe — the height is measured only in the
|
|
4616
|
+
* browser (via `afterNextRender` and the `input` event).
|
|
4617
|
+
*/
|
|
4618
|
+
class BuiAutosizeTextarea {
|
|
4619
|
+
size = input('default', /* @ts-ignore */
|
|
4620
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
4621
|
+
maxRows = input(null, /* @ts-ignore */
|
|
4622
|
+
...(ngDevMode ? [{ debugName: "maxRows" }] : /* istanbul ignore next */ []));
|
|
4623
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
4624
|
+
host = inject(ElementRef);
|
|
4625
|
+
computedClass = computed(() => cn(BASE, SIZES[this.size()], this.userClass()), /* @ts-ignore */
|
|
4626
|
+
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
4627
|
+
constructor() {
|
|
4628
|
+
afterNextRender(() => {
|
|
4629
|
+
this.resize();
|
|
4630
|
+
});
|
|
4631
|
+
}
|
|
4632
|
+
resize() {
|
|
4633
|
+
const element = this.host.nativeElement;
|
|
4634
|
+
element.style.height = 'auto';
|
|
4635
|
+
let target = element.scrollHeight;
|
|
4636
|
+
const maxRows = this.maxRows();
|
|
4637
|
+
if (maxRows !== null) {
|
|
4638
|
+
const styles = getComputedStyle(element);
|
|
4639
|
+
let lineHeight = Number.parseFloat(styles.lineHeight);
|
|
4640
|
+
if (Number.isNaN(lineHeight)) {
|
|
4641
|
+
lineHeight = Number.parseFloat(styles.fontSize) * 1.2;
|
|
4642
|
+
}
|
|
4643
|
+
const padding = Number.parseFloat(styles.paddingTop) + Number.parseFloat(styles.paddingBottom);
|
|
4644
|
+
const border = Number.parseFloat(styles.borderTopWidth) + Number.parseFloat(styles.borderBottomWidth);
|
|
4645
|
+
const cap = lineHeight * maxRows + padding + border;
|
|
4646
|
+
if (target > cap) {
|
|
4647
|
+
target = cap;
|
|
4648
|
+
element.style.overflowY = 'auto';
|
|
4649
|
+
}
|
|
4650
|
+
else {
|
|
4651
|
+
element.style.overflowY = 'hidden';
|
|
4652
|
+
}
|
|
4653
|
+
}
|
|
4654
|
+
element.style.height = `${target}px`;
|
|
4655
|
+
}
|
|
4656
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiAutosizeTextarea, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4657
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: BuiAutosizeTextarea, isStandalone: true, selector: "textarea[buiAutosizeTextarea]", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, maxRows: { classPropertyName: "maxRows", publicName: "maxRows", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "autosize-textarea" }, listeners: { "input": "resize()" }, properties: { "attr.data-size": "size()", "class": "computedClass()" } }, ngImport: i0 });
|
|
4658
|
+
}
|
|
4659
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiAutosizeTextarea, decorators: [{
|
|
4660
|
+
type: Directive,
|
|
4661
|
+
args: [{
|
|
4662
|
+
selector: 'textarea[buiAutosizeTextarea]',
|
|
4663
|
+
host: {
|
|
4664
|
+
'data-slot': 'autosize-textarea',
|
|
4665
|
+
'[attr.data-size]': 'size()',
|
|
4666
|
+
'[class]': 'computedClass()',
|
|
4667
|
+
'(input)': 'resize()',
|
|
4668
|
+
},
|
|
4669
|
+
}]
|
|
4670
|
+
}], ctorParameters: () => [], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], maxRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxRows", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
4671
|
+
|
|
4672
|
+
class BuiDropdownMenu {
|
|
4673
|
+
menu = inject(Menu);
|
|
4674
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
4675
|
+
computedClass = computed(() => cn('absolute z-50 mt-1 min-w-[8rem] rounded-md border bg-popover p-1 text-popover-foreground shadow-md', this.userClass()), /* @ts-ignore */
|
|
4676
|
+
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
4677
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiDropdownMenu, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4678
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: BuiDropdownMenu, isStandalone: true, selector: "[buiDropdownMenu]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "dropdown-menu" }, properties: { "hidden": "!menu.visible()", "class": "computedClass()" } }, ngImport: i0 });
|
|
4679
|
+
}
|
|
4680
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiDropdownMenu, decorators: [{
|
|
4681
|
+
type: Directive,
|
|
4682
|
+
args: [{
|
|
4683
|
+
selector: '[buiDropdownMenu]',
|
|
4684
|
+
host: {
|
|
4685
|
+
'data-slot': 'dropdown-menu',
|
|
4686
|
+
'[hidden]': '!menu.visible()',
|
|
4687
|
+
'[class]': 'computedClass()',
|
|
4688
|
+
},
|
|
4689
|
+
}]
|
|
4690
|
+
}], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
4691
|
+
class BuiDropdownMenuItem {
|
|
4692
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
4693
|
+
computedClass = computed(() => cn('relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', this.userClass()), /* @ts-ignore */
|
|
4694
|
+
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
4695
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiDropdownMenuItem, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4696
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: BuiDropdownMenuItem, isStandalone: true, selector: "[buiDropdownMenuItem]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "dropdown-menu-item" }, properties: { "class": "computedClass()" } }, ngImport: i0 });
|
|
4697
|
+
}
|
|
4698
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiDropdownMenuItem, decorators: [{
|
|
4699
|
+
type: Directive,
|
|
4700
|
+
args: [{
|
|
4701
|
+
selector: '[buiDropdownMenuItem]',
|
|
4702
|
+
host: { 'data-slot': 'dropdown-menu-item', '[class]': 'computedClass()' },
|
|
4703
|
+
}]
|
|
4704
|
+
}], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
4705
|
+
class BuiDropdownMenuLabel {
|
|
4706
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
4707
|
+
computedClass = computed(() => cn('px-2 py-1.5 text-sm font-medium', this.userClass()), /* @ts-ignore */
|
|
4708
|
+
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
4709
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiDropdownMenuLabel, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4710
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: BuiDropdownMenuLabel, isStandalone: true, selector: "[buiDropdownMenuLabel]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "dropdown-menu-label" }, properties: { "class": "computedClass()" } }, ngImport: i0 });
|
|
4711
|
+
}
|
|
4712
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiDropdownMenuLabel, decorators: [{
|
|
4713
|
+
type: Directive,
|
|
4714
|
+
args: [{
|
|
4715
|
+
selector: '[buiDropdownMenuLabel]',
|
|
4716
|
+
host: { 'data-slot': 'dropdown-menu-label', '[class]': 'computedClass()' },
|
|
4717
|
+
}]
|
|
4718
|
+
}], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
4719
|
+
class BuiDropdownMenuSeparator {
|
|
4720
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
4721
|
+
computedClass = computed(() => cn('-mx-1 my-1 h-px bg-border', this.userClass()), /* @ts-ignore */
|
|
4722
|
+
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
4723
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiDropdownMenuSeparator, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4724
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: BuiDropdownMenuSeparator, isStandalone: true, selector: "[buiDropdownMenuSeparator]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "dropdown-menu-separator", "role": "separator" }, properties: { "class": "computedClass()" } }, ngImport: i0 });
|
|
4725
|
+
}
|
|
4726
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiDropdownMenuSeparator, decorators: [{
|
|
4727
|
+
type: Directive,
|
|
4728
|
+
args: [{
|
|
4729
|
+
selector: '[buiDropdownMenuSeparator]',
|
|
4730
|
+
host: { 'data-slot': 'dropdown-menu-separator', role: 'separator', '[class]': 'computedClass()' },
|
|
4731
|
+
}]
|
|
4732
|
+
}], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
4733
|
+
|
|
4501
4734
|
/*
|
|
4502
4735
|
* Public API Surface of ng-blatui
|
|
4503
4736
|
*/
|
|
@@ -4506,5 +4739,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
4506
4739
|
* Generated bundle index. Do not edit.
|
|
4507
4740
|
*/
|
|
4508
4741
|
|
|
4509
|
-
export { BuiAccordion, BuiAccordionContent, BuiAccordionItem, BuiAccordionTrigger, BuiAlert, BuiAlertDescription, BuiAlertTitle, BuiAspectRatio, BuiAvatar, BuiAvatarGroup, BuiBadge, BuiBanner, BuiBreadcrumb, BuiBreadcrumbEllipsis, BuiBreadcrumbItem, BuiBreadcrumbLink, BuiBreadcrumbList, BuiBreadcrumbPage, BuiBreadcrumbSeparator, BuiButton, BuiButtonGroup, BuiButtonGroupText, BuiCard, BuiCardAction, BuiCardContent, BuiCardDescription, BuiCardFooter, BuiCardHeader, BuiCardTitle, BuiCheckbox, BuiCodeBlock, BuiCollapsible, BuiCollapsibleContent, BuiCollapsibleTrigger, BuiContainer, BuiCopyButton, BuiDialogContent, BuiDialogDescription, BuiDialogFooter, BuiDialogHeader, BuiDialogTitle, BuiEmpty, BuiEmptyContent, BuiEmptyDescription, BuiEmptyHeader, BuiEmptyMedia, BuiEmptyTitle, BuiField, BuiFieldContent, BuiFieldDescription, BuiFieldError, BuiFieldGroup, BuiFieldLabel, BuiFieldLegend, BuiFieldSeparator, BuiFieldSet, BuiFieldTitle, BuiHoverCard, BuiHoverCardContent, BuiInput, BuiInputGroup, BuiInputGroupAddon, BuiInputGroupButton, BuiInputGroupInput, BuiInputGroupText, BuiItem, BuiItemActions, BuiItemContent, BuiItemDescription, BuiItemGroup, BuiItemMedia, BuiItemTitle, BuiKbd, BuiLabel, BuiMeter, BuiPagination, BuiPaginationContent, BuiPaginationEllipsis, BuiPaginationItem, BuiPaginationLink, BuiPopover, BuiPopoverContent, BuiProgress, BuiQuantitySelector, BuiRadioGroup, BuiRadioGroupItem, BuiRating, BuiScrollArea, BuiSeparator, BuiSkeleton, BuiSlider, BuiSpinner, BuiStat, BuiSwitch, BuiTabList, BuiTabPanel, BuiTabTrigger, BuiTable, BuiTableBody, BuiTableCaption, BuiTableCell, BuiTableContainer, BuiTableFooter, BuiTableHead, BuiTableHeader, BuiTableRow, BuiTabs, BuiTextarea, BuiThemeCustomizer, BuiToggle, BuiTooltip, BuiTooltipContent, BuiVisuallyHidden, THEME_TOKENS, ThemeStore, buttonVariants, cn, toggleVariants };
|
|
4742
|
+
export { BuiAccordion, BuiAccordionContent, BuiAccordionItem, BuiAccordionTrigger, BuiAlert, BuiAlertDescription, BuiAlertDialogAction, BuiAlertDialogCancel, BuiAlertDialogContent, BuiAlertDialogDescription, BuiAlertDialogFooter, BuiAlertDialogHeader, BuiAlertDialogTitle, BuiAlertTitle, BuiAspectRatio, BuiAutosizeTextarea, BuiAvatar, BuiAvatarGroup, BuiBadge, BuiBanner, BuiBreadcrumb, BuiBreadcrumbEllipsis, BuiBreadcrumbItem, BuiBreadcrumbLink, BuiBreadcrumbList, BuiBreadcrumbPage, BuiBreadcrumbSeparator, BuiButton, BuiButtonGroup, BuiButtonGroupText, BuiCard, BuiCardAction, BuiCardContent, BuiCardDescription, BuiCardFooter, BuiCardHeader, BuiCardTitle, BuiCheckbox, BuiCodeBlock, BuiCollapsible, BuiCollapsibleContent, BuiCollapsibleTrigger, BuiContainer, BuiCopyButton, BuiDialogContent, BuiDialogDescription, BuiDialogFooter, BuiDialogHeader, BuiDialogTitle, BuiDropdownMenu, BuiDropdownMenuItem, BuiDropdownMenuLabel, BuiDropdownMenuSeparator, BuiEmpty, BuiEmptyContent, BuiEmptyDescription, BuiEmptyHeader, BuiEmptyMedia, BuiEmptyTitle, BuiField, BuiFieldContent, BuiFieldDescription, BuiFieldError, BuiFieldGroup, BuiFieldLabel, BuiFieldLegend, BuiFieldSeparator, BuiFieldSet, BuiFieldTitle, BuiHoverCard, BuiHoverCardContent, BuiInput, BuiInputGroup, BuiInputGroupAddon, BuiInputGroupButton, BuiInputGroupInput, BuiInputGroupText, BuiItem, BuiItemActions, BuiItemContent, BuiItemDescription, BuiItemGroup, BuiItemMedia, BuiItemTitle, BuiKbd, BuiLabel, BuiMeter, BuiPagination, BuiPaginationContent, BuiPaginationEllipsis, BuiPaginationItem, BuiPaginationLink, BuiPopover, BuiPopoverContent, BuiProgress, BuiQuantitySelector, BuiRadioGroup, BuiRadioGroupItem, BuiRating, BuiScrollArea, BuiSeparator, BuiSkeleton, BuiSlider, BuiSpinner, BuiStat, BuiSwitch, BuiTabList, BuiTabPanel, BuiTabTrigger, BuiTable, BuiTableBody, BuiTableCaption, BuiTableCell, BuiTableContainer, BuiTableFooter, BuiTableHead, BuiTableHeader, BuiTableRow, BuiTabs, BuiTextarea, BuiThemeCustomizer, BuiToggle, BuiTooltip, BuiTooltipContent, BuiVisuallyHidden, THEME_TOKENS, ThemeStore, buttonVariants, cn, toggleVariants };
|
|
4510
4743
|
//# sourceMappingURL=ng-blatui.mjs.map
|