ng-blatui 1.16.0 → 1.18.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 +394 -1
- package/fesm2022/ng-blatui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/ng-blatui.d.ts +80 -2
package/fesm2022/ng-blatui.mjs
CHANGED
|
@@ -4811,6 +4811,399 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
4811
4811
|
}]
|
|
4812
4812
|
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
4813
4813
|
|
|
4814
|
+
/** Decorative dotted background layer. Drop inside a `relative` container. */
|
|
4815
|
+
class BuiDotPattern {
|
|
4816
|
+
size = input(1, /* @ts-ignore */
|
|
4817
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
4818
|
+
gap = input(16, /* @ts-ignore */
|
|
4819
|
+
...(ngDevMode ? [{ debugName: "gap" }] : /* istanbul ignore next */ []));
|
|
4820
|
+
mask = input(false, /* @ts-ignore */
|
|
4821
|
+
...(ngDevMode ? [{ debugName: "mask" }] : /* istanbul ignore next */ []));
|
|
4822
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
4823
|
+
bgImage = computed(() => `radial-gradient(currentColor ${this.size()}px, transparent 0)`, /* @ts-ignore */
|
|
4824
|
+
...(ngDevMode ? [{ debugName: "bgImage" }] : /* istanbul ignore next */ []));
|
|
4825
|
+
bgSize = computed(() => `${this.gap()}px ${this.gap()}px`, /* @ts-ignore */
|
|
4826
|
+
...(ngDevMode ? [{ debugName: "bgSize" }] : /* istanbul ignore next */ []));
|
|
4827
|
+
maskImage = computed(() => this.mask() ? 'radial-gradient(ellipse at center, #000 40%, transparent 75%)' : null, /* @ts-ignore */
|
|
4828
|
+
...(ngDevMode ? [{ debugName: "maskImage" }] : /* istanbul ignore next */ []));
|
|
4829
|
+
computedClass = computed(() => cn('pointer-events-none absolute inset-0 block text-foreground/15', this.userClass()), /* @ts-ignore */
|
|
4830
|
+
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
4831
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiDotPattern, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4832
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: BuiDotPattern, isStandalone: true, selector: "bui-dot-pattern", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, gap: { classPropertyName: "gap", publicName: "gap", isSignal: true, isRequired: false, transformFunction: null }, mask: { classPropertyName: "mask", publicName: "mask", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "dot-pattern", "aria-hidden": "true" }, properties: { "class": "computedClass()", "style.background-image": "bgImage()", "style.background-size": "bgSize()", "style.mask-image": "maskImage()" } }, ngImport: i0, template: '', isInline: true });
|
|
4833
|
+
}
|
|
4834
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiDotPattern, decorators: [{
|
|
4835
|
+
type: Component,
|
|
4836
|
+
args: [{
|
|
4837
|
+
selector: 'bui-dot-pattern',
|
|
4838
|
+
host: {
|
|
4839
|
+
'data-slot': 'dot-pattern',
|
|
4840
|
+
'aria-hidden': 'true',
|
|
4841
|
+
'[class]': 'computedClass()',
|
|
4842
|
+
'[style.background-image]': 'bgImage()',
|
|
4843
|
+
'[style.background-size]': 'bgSize()',
|
|
4844
|
+
'[style.mask-image]': 'maskImage()',
|
|
4845
|
+
},
|
|
4846
|
+
template: '',
|
|
4847
|
+
}]
|
|
4848
|
+
}], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], gap: [{ type: i0.Input, args: [{ isSignal: true, alias: "gap", required: false }] }], mask: [{ type: i0.Input, args: [{ isSignal: true, alias: "mask", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
4849
|
+
|
|
4850
|
+
/** Decorative grid background layer. Drop inside a `relative` container. */
|
|
4851
|
+
class BuiGridPattern {
|
|
4852
|
+
gap = input(24, /* @ts-ignore */
|
|
4853
|
+
...(ngDevMode ? [{ debugName: "gap" }] : /* istanbul ignore next */ []));
|
|
4854
|
+
lineWidth = input(1, /* @ts-ignore */
|
|
4855
|
+
...(ngDevMode ? [{ debugName: "lineWidth" }] : /* istanbul ignore next */ []));
|
|
4856
|
+
mask = input(false, /* @ts-ignore */
|
|
4857
|
+
...(ngDevMode ? [{ debugName: "mask" }] : /* istanbul ignore next */ []));
|
|
4858
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
4859
|
+
bgImage = computed(() => {
|
|
4860
|
+
const width = this.lineWidth();
|
|
4861
|
+
return `linear-gradient(to right, currentColor ${width}px, transparent ${width}px), linear-gradient(to bottom, currentColor ${width}px, transparent ${width}px)`;
|
|
4862
|
+
}, /* @ts-ignore */
|
|
4863
|
+
...(ngDevMode ? [{ debugName: "bgImage" }] : /* istanbul ignore next */ []));
|
|
4864
|
+
bgSize = computed(() => `${this.gap()}px ${this.gap()}px`, /* @ts-ignore */
|
|
4865
|
+
...(ngDevMode ? [{ debugName: "bgSize" }] : /* istanbul ignore next */ []));
|
|
4866
|
+
maskImage = computed(() => this.mask() ? 'radial-gradient(ellipse at center, #000 0%, transparent 75%)' : null, /* @ts-ignore */
|
|
4867
|
+
...(ngDevMode ? [{ debugName: "maskImage" }] : /* istanbul ignore next */ []));
|
|
4868
|
+
computedClass = computed(() => cn('pointer-events-none absolute inset-0 block text-foreground/10', this.userClass()), /* @ts-ignore */
|
|
4869
|
+
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
4870
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiGridPattern, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4871
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: BuiGridPattern, isStandalone: true, selector: "bui-grid-pattern", inputs: { gap: { classPropertyName: "gap", publicName: "gap", isSignal: true, isRequired: false, transformFunction: null }, lineWidth: { classPropertyName: "lineWidth", publicName: "lineWidth", isSignal: true, isRequired: false, transformFunction: null }, mask: { classPropertyName: "mask", publicName: "mask", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "grid-pattern", "aria-hidden": "true" }, properties: { "class": "computedClass()", "style.background-image": "bgImage()", "style.background-size": "bgSize()", "style.mask-image": "maskImage()" } }, ngImport: i0, template: '', isInline: true });
|
|
4872
|
+
}
|
|
4873
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiGridPattern, decorators: [{
|
|
4874
|
+
type: Component,
|
|
4875
|
+
args: [{
|
|
4876
|
+
selector: 'bui-grid-pattern',
|
|
4877
|
+
host: {
|
|
4878
|
+
'data-slot': 'grid-pattern',
|
|
4879
|
+
'aria-hidden': 'true',
|
|
4880
|
+
'[class]': 'computedClass()',
|
|
4881
|
+
'[style.background-image]': 'bgImage()',
|
|
4882
|
+
'[style.background-size]': 'bgSize()',
|
|
4883
|
+
'[style.mask-image]': 'maskImage()',
|
|
4884
|
+
},
|
|
4885
|
+
template: '',
|
|
4886
|
+
}]
|
|
4887
|
+
}], propDecorators: { gap: [{ type: i0.Input, args: [{ isSignal: true, alias: "gap", required: false }] }], lineWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "lineWidth", required: false }] }], mask: [{ type: i0.Input, args: [{ isSignal: true, alias: "mask", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
4888
|
+
|
|
4889
|
+
/** A single-select segmented control (`role="radiogroup"`) with arrow-key navigation. */
|
|
4890
|
+
class BuiSegmentedControl {
|
|
4891
|
+
value = model('', /* @ts-ignore */
|
|
4892
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
4893
|
+
options = input([], /* @ts-ignore */
|
|
4894
|
+
...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
4895
|
+
disabled = input(false, /* @ts-ignore */
|
|
4896
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
4897
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
4898
|
+
host = inject(ElementRef);
|
|
4899
|
+
normalized = computed(() => this.options().map((option) => typeof option === 'string' ? { value: option, label: option } : option), /* @ts-ignore */
|
|
4900
|
+
...(ngDevMode ? [{ debugName: "normalized" }] : /* istanbul ignore next */ []));
|
|
4901
|
+
computedClass = computed(() => cn('inline-flex items-center gap-1 rounded-lg bg-muted p-1', this.userClass()), /* @ts-ignore */
|
|
4902
|
+
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
4903
|
+
select(next) {
|
|
4904
|
+
if (!this.disabled()) {
|
|
4905
|
+
this.value.set(next);
|
|
4906
|
+
}
|
|
4907
|
+
}
|
|
4908
|
+
tabindexFor(optionValue) {
|
|
4909
|
+
if (this.value() === optionValue) {
|
|
4910
|
+
return 0;
|
|
4911
|
+
}
|
|
4912
|
+
return this.value() === '' && this.normalized().at(0)?.value === optionValue ? 0 : -1;
|
|
4913
|
+
}
|
|
4914
|
+
onKeydown(event) {
|
|
4915
|
+
if (this.disabled() ||
|
|
4916
|
+
!['ArrowRight', 'ArrowLeft', 'ArrowUp', 'ArrowDown'].includes(event.key)) {
|
|
4917
|
+
return;
|
|
4918
|
+
}
|
|
4919
|
+
event.preventDefault();
|
|
4920
|
+
const items = this.normalized();
|
|
4921
|
+
if (items.length === 0) {
|
|
4922
|
+
return;
|
|
4923
|
+
}
|
|
4924
|
+
const current = Math.max(0, items.findIndex((option) => option.value === this.value()));
|
|
4925
|
+
const isForward = event.key === 'ArrowRight' || event.key === 'ArrowDown';
|
|
4926
|
+
const nextIndex = (current + (isForward ? 1 : -1) + items.length) % items.length;
|
|
4927
|
+
this.value.set(items[nextIndex].value);
|
|
4928
|
+
const buttons = this.host.nativeElement.querySelectorAll('[role="radio"]');
|
|
4929
|
+
buttons[nextIndex].focus();
|
|
4930
|
+
}
|
|
4931
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiSegmentedControl, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4932
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiSegmentedControl, isStandalone: true, selector: "bui-segmented-control", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { attributes: { "data-slot": "segmented-control", "role": "radiogroup" }, listeners: { "keydown": "onKeydown($event)" }, properties: { "class": "computedClass()" } }, ngImport: i0, template: `
|
|
4933
|
+
@for (option of normalized(); track option.value) {
|
|
4934
|
+
<button
|
|
4935
|
+
type="button"
|
|
4936
|
+
role="radio"
|
|
4937
|
+
[attr.aria-checked]="value() === option.value"
|
|
4938
|
+
[attr.tabindex]="tabindexFor(option.value)"
|
|
4939
|
+
[disabled]="disabled()"
|
|
4940
|
+
class="rounded-md px-3 py-1 text-sm font-medium whitespace-nowrap transition-colors outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50"
|
|
4941
|
+
[class]="
|
|
4942
|
+
value() === option.value
|
|
4943
|
+
? 'bg-background text-foreground shadow-sm'
|
|
4944
|
+
: 'text-muted-foreground hover:text-foreground'
|
|
4945
|
+
"
|
|
4946
|
+
(click)="select(option.value)"
|
|
4947
|
+
>
|
|
4948
|
+
{{ option.label }}
|
|
4949
|
+
</button>
|
|
4950
|
+
}
|
|
4951
|
+
`, isInline: true });
|
|
4952
|
+
}
|
|
4953
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiSegmentedControl, decorators: [{
|
|
4954
|
+
type: Component,
|
|
4955
|
+
args: [{
|
|
4956
|
+
selector: 'bui-segmented-control',
|
|
4957
|
+
host: {
|
|
4958
|
+
'data-slot': 'segmented-control',
|
|
4959
|
+
role: 'radiogroup',
|
|
4960
|
+
'[class]': 'computedClass()',
|
|
4961
|
+
'(keydown)': 'onKeydown($event)',
|
|
4962
|
+
},
|
|
4963
|
+
template: `
|
|
4964
|
+
@for (option of normalized(); track option.value) {
|
|
4965
|
+
<button
|
|
4966
|
+
type="button"
|
|
4967
|
+
role="radio"
|
|
4968
|
+
[attr.aria-checked]="value() === option.value"
|
|
4969
|
+
[attr.tabindex]="tabindexFor(option.value)"
|
|
4970
|
+
[disabled]="disabled()"
|
|
4971
|
+
class="rounded-md px-3 py-1 text-sm font-medium whitespace-nowrap transition-colors outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50"
|
|
4972
|
+
[class]="
|
|
4973
|
+
value() === option.value
|
|
4974
|
+
? 'bg-background text-foreground shadow-sm'
|
|
4975
|
+
: 'text-muted-foreground hover:text-foreground'
|
|
4976
|
+
"
|
|
4977
|
+
(click)="select(option.value)"
|
|
4978
|
+
>
|
|
4979
|
+
{{ option.label }}
|
|
4980
|
+
</button>
|
|
4981
|
+
}
|
|
4982
|
+
`,
|
|
4983
|
+
}]
|
|
4984
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
4985
|
+
|
|
4986
|
+
/**
|
|
4987
|
+
* A terminal / console window (always dark). Put prompt + output lines in the content;
|
|
4988
|
+
* helper classes `.prompt .ok .dim .path .warn` colour them.
|
|
4989
|
+
*/
|
|
4990
|
+
class BuiTerminal {
|
|
4991
|
+
title = input(null, /* @ts-ignore */
|
|
4992
|
+
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
4993
|
+
buttons = input(true, /* @ts-ignore */
|
|
4994
|
+
...(ngDevMode ? [{ debugName: "buttons" }] : /* istanbul ignore next */ []));
|
|
4995
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
4996
|
+
computedClass = computed(() => cn('block overflow-hidden rounded-lg border border-zinc-800 bg-zinc-950 text-zinc-100 shadow-md', this.userClass()), /* @ts-ignore */
|
|
4997
|
+
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
4998
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiTerminal, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4999
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiTerminal, isStandalone: true, selector: "bui-terminal", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, buttons: { classPropertyName: "buttons", publicName: "buttons", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "terminal" }, properties: { "class": "computedClass()" } }, ngImport: i0, template: `
|
|
5000
|
+
<div
|
|
5001
|
+
data-slot="terminal-bar"
|
|
5002
|
+
class="flex items-center gap-2 border-b border-white/10 bg-zinc-900 px-3.5 py-2.5"
|
|
5003
|
+
>
|
|
5004
|
+
@if (buttons()) {
|
|
5005
|
+
<span class="size-3 rounded-full" style="background:#ff5f57"></span>
|
|
5006
|
+
<span class="size-3 rounded-full" style="background:#febc2e"></span>
|
|
5007
|
+
<span class="size-3 rounded-full" style="background:#28c840"></span>
|
|
5008
|
+
}
|
|
5009
|
+
@if (title()) {
|
|
5010
|
+
<span
|
|
5011
|
+
data-slot="terminal-title"
|
|
5012
|
+
class="truncate font-mono text-xs text-zinc-400"
|
|
5013
|
+
[class.ml-2]="buttons()"
|
|
5014
|
+
>{{ title() }}</span
|
|
5015
|
+
>
|
|
5016
|
+
}
|
|
5017
|
+
</div>
|
|
5018
|
+
<div
|
|
5019
|
+
data-slot="terminal-body"
|
|
5020
|
+
class="overflow-x-auto p-4 font-mono text-[13px] leading-relaxed [&_.dim]:text-zinc-400 [&_.ok]:text-emerald-400 [&_.path]:text-cyan-400 [&_.prompt]:text-emerald-400 [&_.warn]:text-amber-400"
|
|
5021
|
+
>
|
|
5022
|
+
<ng-content />
|
|
5023
|
+
</div>
|
|
5024
|
+
`, isInline: true });
|
|
5025
|
+
}
|
|
5026
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiTerminal, decorators: [{
|
|
5027
|
+
type: Component,
|
|
5028
|
+
args: [{
|
|
5029
|
+
selector: 'bui-terminal',
|
|
5030
|
+
host: { 'data-slot': 'terminal', '[class]': 'computedClass()' },
|
|
5031
|
+
template: `
|
|
5032
|
+
<div
|
|
5033
|
+
data-slot="terminal-bar"
|
|
5034
|
+
class="flex items-center gap-2 border-b border-white/10 bg-zinc-900 px-3.5 py-2.5"
|
|
5035
|
+
>
|
|
5036
|
+
@if (buttons()) {
|
|
5037
|
+
<span class="size-3 rounded-full" style="background:#ff5f57"></span>
|
|
5038
|
+
<span class="size-3 rounded-full" style="background:#febc2e"></span>
|
|
5039
|
+
<span class="size-3 rounded-full" style="background:#28c840"></span>
|
|
5040
|
+
}
|
|
5041
|
+
@if (title()) {
|
|
5042
|
+
<span
|
|
5043
|
+
data-slot="terminal-title"
|
|
5044
|
+
class="truncate font-mono text-xs text-zinc-400"
|
|
5045
|
+
[class.ml-2]="buttons()"
|
|
5046
|
+
>{{ title() }}</span
|
|
5047
|
+
>
|
|
5048
|
+
}
|
|
5049
|
+
</div>
|
|
5050
|
+
<div
|
|
5051
|
+
data-slot="terminal-body"
|
|
5052
|
+
class="overflow-x-auto p-4 font-mono text-[13px] leading-relaxed [&_.dim]:text-zinc-400 [&_.ok]:text-emerald-400 [&_.path]:text-cyan-400 [&_.prompt]:text-emerald-400 [&_.warn]:text-amber-400"
|
|
5053
|
+
>
|
|
5054
|
+
<ng-content />
|
|
5055
|
+
</div>
|
|
5056
|
+
`,
|
|
5057
|
+
}]
|
|
5058
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], buttons: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttons", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
5059
|
+
|
|
5060
|
+
/** A data-driven feature-comparison / pricing table. */
|
|
5061
|
+
class BuiComparisonTable {
|
|
5062
|
+
tiers = input([], /* @ts-ignore */
|
|
5063
|
+
...(ngDevMode ? [{ debugName: "tiers" }] : /* istanbul ignore next */ []));
|
|
5064
|
+
rows = input([], /* @ts-ignore */
|
|
5065
|
+
...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
|
|
5066
|
+
highlight = input(null, /* @ts-ignore */
|
|
5067
|
+
...(ngDevMode ? [{ debugName: "highlight" }] : /* istanbul ignore next */ []));
|
|
5068
|
+
featureLabel = input('Feature', /* @ts-ignore */
|
|
5069
|
+
...(ngDevMode ? [{ debugName: "featureLabel" }] : /* istanbul ignore next */ []));
|
|
5070
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
5071
|
+
highlightIndex = computed(() => {
|
|
5072
|
+
const highlight = this.highlight();
|
|
5073
|
+
if (typeof highlight === 'number') {
|
|
5074
|
+
return highlight;
|
|
5075
|
+
}
|
|
5076
|
+
return highlight === null ? -1 : this.tiers().indexOf(highlight);
|
|
5077
|
+
}, /* @ts-ignore */
|
|
5078
|
+
...(ngDevMode ? [{ debugName: "highlightIndex" }] : /* istanbul ignore next */ []));
|
|
5079
|
+
computedClass = computed(() => cn('w-full overflow-x-auto rounded-xl border', this.userClass()), /* @ts-ignore */
|
|
5080
|
+
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
5081
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiComparisonTable, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5082
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiComparisonTable, isStandalone: true, selector: "bui-comparison-table", inputs: { tiers: { classPropertyName: "tiers", publicName: "tiers", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, highlight: { classPropertyName: "highlight", publicName: "highlight", isSignal: true, isRequired: false, transformFunction: null }, featureLabel: { classPropertyName: "featureLabel", publicName: "featureLabel", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "comparison-table" }, properties: { "class": "computedClass()" } }, ngImport: i0, template: `
|
|
5083
|
+
<table class="w-full text-sm">
|
|
5084
|
+
<caption class="sr-only">
|
|
5085
|
+
{{
|
|
5086
|
+
featureLabel()
|
|
5087
|
+
}}
|
|
5088
|
+
comparison
|
|
5089
|
+
</caption>
|
|
5090
|
+
<thead>
|
|
5091
|
+
<tr class="border-b bg-muted/40">
|
|
5092
|
+
<th scope="col" class="px-4 py-3 text-left font-medium text-muted-foreground">
|
|
5093
|
+
{{ featureLabel() }}
|
|
5094
|
+
</th>
|
|
5095
|
+
@for (tier of tiers(); track tier) {
|
|
5096
|
+
<th
|
|
5097
|
+
scope="col"
|
|
5098
|
+
class="px-4 py-3 text-center font-semibold"
|
|
5099
|
+
[class]="$index === highlightIndex() ? 'text-primary' : ''"
|
|
5100
|
+
>
|
|
5101
|
+
{{ tier }}
|
|
5102
|
+
</th>
|
|
5103
|
+
}
|
|
5104
|
+
</tr>
|
|
5105
|
+
</thead>
|
|
5106
|
+
<tbody>
|
|
5107
|
+
@for (row of rows(); track row.feature) {
|
|
5108
|
+
<tr class="border-b last:border-0">
|
|
5109
|
+
<th scope="row" class="px-4 py-3 text-left font-medium">{{ row.feature }}</th>
|
|
5110
|
+
@for (value of row.values; track $index) {
|
|
5111
|
+
<td
|
|
5112
|
+
class="px-4 py-3 text-center"
|
|
5113
|
+
[class]="$index === highlightIndex() ? 'bg-muted/30' : ''"
|
|
5114
|
+
>
|
|
5115
|
+
@if (value === true) {
|
|
5116
|
+
<svg
|
|
5117
|
+
viewBox="0 0 24 24"
|
|
5118
|
+
fill="none"
|
|
5119
|
+
stroke="currentColor"
|
|
5120
|
+
stroke-width="2"
|
|
5121
|
+
stroke-linecap="round"
|
|
5122
|
+
stroke-linejoin="round"
|
|
5123
|
+
aria-label="Included"
|
|
5124
|
+
class="mx-auto size-4 text-primary"
|
|
5125
|
+
>
|
|
5126
|
+
<path d="M20 6 9 17l-5-5" />
|
|
5127
|
+
</svg>
|
|
5128
|
+
} @else if (value === false || value === null) {
|
|
5129
|
+
<span class="text-muted-foreground" aria-label="Not included">—</span>
|
|
5130
|
+
} @else {
|
|
5131
|
+
{{ value }}
|
|
5132
|
+
}
|
|
5133
|
+
</td>
|
|
5134
|
+
}
|
|
5135
|
+
</tr>
|
|
5136
|
+
}
|
|
5137
|
+
</tbody>
|
|
5138
|
+
</table>
|
|
5139
|
+
`, isInline: true });
|
|
5140
|
+
}
|
|
5141
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiComparisonTable, decorators: [{
|
|
5142
|
+
type: Component,
|
|
5143
|
+
args: [{
|
|
5144
|
+
selector: 'bui-comparison-table',
|
|
5145
|
+
host: { 'data-slot': 'comparison-table', '[class]': 'computedClass()' },
|
|
5146
|
+
template: `
|
|
5147
|
+
<table class="w-full text-sm">
|
|
5148
|
+
<caption class="sr-only">
|
|
5149
|
+
{{
|
|
5150
|
+
featureLabel()
|
|
5151
|
+
}}
|
|
5152
|
+
comparison
|
|
5153
|
+
</caption>
|
|
5154
|
+
<thead>
|
|
5155
|
+
<tr class="border-b bg-muted/40">
|
|
5156
|
+
<th scope="col" class="px-4 py-3 text-left font-medium text-muted-foreground">
|
|
5157
|
+
{{ featureLabel() }}
|
|
5158
|
+
</th>
|
|
5159
|
+
@for (tier of tiers(); track tier) {
|
|
5160
|
+
<th
|
|
5161
|
+
scope="col"
|
|
5162
|
+
class="px-4 py-3 text-center font-semibold"
|
|
5163
|
+
[class]="$index === highlightIndex() ? 'text-primary' : ''"
|
|
5164
|
+
>
|
|
5165
|
+
{{ tier }}
|
|
5166
|
+
</th>
|
|
5167
|
+
}
|
|
5168
|
+
</tr>
|
|
5169
|
+
</thead>
|
|
5170
|
+
<tbody>
|
|
5171
|
+
@for (row of rows(); track row.feature) {
|
|
5172
|
+
<tr class="border-b last:border-0">
|
|
5173
|
+
<th scope="row" class="px-4 py-3 text-left font-medium">{{ row.feature }}</th>
|
|
5174
|
+
@for (value of row.values; track $index) {
|
|
5175
|
+
<td
|
|
5176
|
+
class="px-4 py-3 text-center"
|
|
5177
|
+
[class]="$index === highlightIndex() ? 'bg-muted/30' : ''"
|
|
5178
|
+
>
|
|
5179
|
+
@if (value === true) {
|
|
5180
|
+
<svg
|
|
5181
|
+
viewBox="0 0 24 24"
|
|
5182
|
+
fill="none"
|
|
5183
|
+
stroke="currentColor"
|
|
5184
|
+
stroke-width="2"
|
|
5185
|
+
stroke-linecap="round"
|
|
5186
|
+
stroke-linejoin="round"
|
|
5187
|
+
aria-label="Included"
|
|
5188
|
+
class="mx-auto size-4 text-primary"
|
|
5189
|
+
>
|
|
5190
|
+
<path d="M20 6 9 17l-5-5" />
|
|
5191
|
+
</svg>
|
|
5192
|
+
} @else if (value === false || value === null) {
|
|
5193
|
+
<span class="text-muted-foreground" aria-label="Not included">—</span>
|
|
5194
|
+
} @else {
|
|
5195
|
+
{{ value }}
|
|
5196
|
+
}
|
|
5197
|
+
</td>
|
|
5198
|
+
}
|
|
5199
|
+
</tr>
|
|
5200
|
+
}
|
|
5201
|
+
</tbody>
|
|
5202
|
+
</table>
|
|
5203
|
+
`,
|
|
5204
|
+
}]
|
|
5205
|
+
}], propDecorators: { tiers: [{ type: i0.Input, args: [{ isSignal: true, alias: "tiers", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], highlight: [{ type: i0.Input, args: [{ isSignal: true, alias: "highlight", required: false }] }], featureLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "featureLabel", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
5206
|
+
|
|
4814
5207
|
/*
|
|
4815
5208
|
* Public API Surface of ng-blatui
|
|
4816
5209
|
*/
|
|
@@ -4819,5 +5212,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
4819
5212
|
* Generated bundle index. Do not edit.
|
|
4820
5213
|
*/
|
|
4821
5214
|
|
|
4822
|
-
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, BuiMenubar, BuiMenubarTrigger, 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, BuiTypography, BuiVisuallyHidden, THEME_TOKENS, ThemeStore, buttonVariants, cn, toggleVariants };
|
|
5215
|
+
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, BuiComparisonTable, BuiContainer, BuiCopyButton, BuiDialogContent, BuiDialogDescription, BuiDialogFooter, BuiDialogHeader, BuiDialogTitle, BuiDotPattern, BuiDropdownMenu, BuiDropdownMenuItem, BuiDropdownMenuLabel, BuiDropdownMenuSeparator, BuiEmpty, BuiEmptyContent, BuiEmptyDescription, BuiEmptyHeader, BuiEmptyMedia, BuiEmptyTitle, BuiField, BuiFieldContent, BuiFieldDescription, BuiFieldError, BuiFieldGroup, BuiFieldLabel, BuiFieldLegend, BuiFieldSeparator, BuiFieldSet, BuiFieldTitle, BuiGridPattern, BuiHoverCard, BuiHoverCardContent, BuiInput, BuiInputGroup, BuiInputGroupAddon, BuiInputGroupButton, BuiInputGroupInput, BuiInputGroupText, BuiItem, BuiItemActions, BuiItemContent, BuiItemDescription, BuiItemGroup, BuiItemMedia, BuiItemTitle, BuiKbd, BuiLabel, BuiMenubar, BuiMenubarTrigger, BuiMeter, BuiPagination, BuiPaginationContent, BuiPaginationEllipsis, BuiPaginationItem, BuiPaginationLink, BuiPopover, BuiPopoverContent, BuiProgress, BuiQuantitySelector, BuiRadioGroup, BuiRadioGroupItem, BuiRating, BuiScrollArea, BuiSegmentedControl, BuiSeparator, BuiSkeleton, BuiSlider, BuiSpinner, BuiStat, BuiSwitch, BuiTabList, BuiTabPanel, BuiTabTrigger, BuiTable, BuiTableBody, BuiTableCaption, BuiTableCell, BuiTableContainer, BuiTableFooter, BuiTableHead, BuiTableHeader, BuiTableRow, BuiTabs, BuiTerminal, BuiTextarea, BuiThemeCustomizer, BuiToggle, BuiTooltip, BuiTooltipContent, BuiTypography, BuiVisuallyHidden, THEME_TOKENS, ThemeStore, buttonVariants, cn, toggleVariants };
|
|
4823
5216
|
//# sourceMappingURL=ng-blatui.mjs.map
|