ng-blatui 1.25.0 → 1.27.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 +599 -90
- package/fesm2022/ng-blatui.mjs.map +1 -1
- package/package.json +2 -1
- package/types/ng-blatui.d.ts +178 -50
package/fesm2022/ng-blatui.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
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, afterNextRender, output, linkedSignal, ViewEncapsulation, DestroyRef } from '@angular/core';
|
|
4
|
+
import { input, computed, Directive, Component, signal, model, forwardRef, inject, PLATFORM_ID, effect, Injectable, ElementRef, ViewContainerRef, viewChild, afterNextRender, output, linkedSignal, ViewEncapsulation, DestroyRef } from '@angular/core';
|
|
5
5
|
import { cva } from 'class-variance-authority';
|
|
6
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
6
7
|
export { AccordionContent, AccordionGroup, AccordionPanel, AccordionTrigger, ɵɵDeferredContent, ɵɵDeferredContentAware } from '@angular/aria/accordion';
|
|
7
8
|
export { Tab, TabContent, TabList, TabPanel, Tabs } from '@angular/aria/tabs';
|
|
8
9
|
export { DIALOG_DATA, Dialog, DialogModule, DialogRef } from '@angular/cdk/dialog';
|
|
@@ -677,6 +678,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
677
678
|
}]
|
|
678
679
|
}], propDecorators: { src: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: false }] }], alt: [{ type: i0.Input, args: [{ isSignal: true, alias: "alt", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
679
680
|
|
|
681
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
682
|
+
const noop$i = () => { };
|
|
680
683
|
const CHECKBOX_BASE = 'peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground data-[state=indeterminate]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 flex items-center justify-center';
|
|
681
684
|
/**
|
|
682
685
|
* BlatUI checkbox. A native `<button role="checkbox">` (Space/Enter toggle for free)
|
|
@@ -687,9 +690,11 @@ class BuiCheckbox {
|
|
|
687
690
|
...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
688
691
|
indeterminate = model(false, /* @ts-ignore */
|
|
689
692
|
...(ngDevMode ? [{ debugName: "indeterminate" }] : /* istanbul ignore next */ []));
|
|
690
|
-
disabled =
|
|
693
|
+
disabled = model(false, /* @ts-ignore */
|
|
691
694
|
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
692
695
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
696
|
+
onChange = noop$i;
|
|
697
|
+
onTouched = noop$i;
|
|
693
698
|
state = computed(() => {
|
|
694
699
|
if (this.indeterminate()) {
|
|
695
700
|
return 'indeterminate';
|
|
@@ -712,9 +717,25 @@ class BuiCheckbox {
|
|
|
712
717
|
else {
|
|
713
718
|
this.checked.update((value) => !value);
|
|
714
719
|
}
|
|
720
|
+
this.onChange(this.checked());
|
|
721
|
+
this.onTouched();
|
|
722
|
+
}
|
|
723
|
+
writeValue(isChecked) {
|
|
724
|
+
this.checked.set(!!isChecked);
|
|
725
|
+
}
|
|
726
|
+
registerOnChange(callback) {
|
|
727
|
+
this.onChange = callback;
|
|
728
|
+
}
|
|
729
|
+
registerOnTouched(callback) {
|
|
730
|
+
this.onTouched = callback;
|
|
731
|
+
}
|
|
732
|
+
setDisabledState(isDisabled) {
|
|
733
|
+
this.disabled.set(isDisabled);
|
|
715
734
|
}
|
|
716
735
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiCheckbox, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
717
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiCheckbox, isStandalone: true, selector: "button[buiCheckbox]", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", 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: { checked: "checkedChange", indeterminate: "indeterminateChange" }, host: { attributes: { "type": "button", "role": "checkbox", "data-slot": "checkbox" }, listeners: { "click": "toggle()" }, properties: { "attr.aria-checked": "ariaChecked()", "attr.data-state": "state()", "disabled": "disabled()", "class": "computedClass()" } },
|
|
736
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiCheckbox, isStandalone: true, selector: "button[buiCheckbox]", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", 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: { checked: "checkedChange", indeterminate: "indeterminateChange", disabled: "disabledChange" }, host: { attributes: { "type": "button", "role": "checkbox", "data-slot": "checkbox" }, listeners: { "click": "toggle()", "blur": "onTouched()" }, properties: { "attr.aria-checked": "ariaChecked()", "attr.data-state": "state()", "disabled": "disabled()", "class": "computedClass()" } }, providers: [
|
|
737
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiCheckbox), multi: true },
|
|
738
|
+
], ngImport: i0, template: `
|
|
718
739
|
@if (checked() || indeterminate()) {
|
|
719
740
|
<span data-slot="checkbox-indicator" class="flex items-center justify-center text-current">
|
|
720
741
|
@if (indeterminate()) {
|
|
@@ -763,7 +784,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
763
784
|
'[disabled]': 'disabled()',
|
|
764
785
|
'[class]': 'computedClass()',
|
|
765
786
|
'(click)': 'toggle()',
|
|
787
|
+
'(blur)': 'onTouched()',
|
|
766
788
|
},
|
|
789
|
+
providers: [
|
|
790
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiCheckbox), multi: true },
|
|
791
|
+
],
|
|
767
792
|
template: `
|
|
768
793
|
@if (checked() || indeterminate()) {
|
|
769
794
|
<span data-slot="checkbox-indicator" class="flex items-center justify-center text-current">
|
|
@@ -800,8 +825,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
800
825
|
}
|
|
801
826
|
`,
|
|
802
827
|
}]
|
|
803
|
-
}], propDecorators: { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }, { type: i0.Output, args: ["indeterminateChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
828
|
+
}], propDecorators: { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }, { type: i0.Output, args: ["indeterminateChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
804
829
|
|
|
830
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
831
|
+
const noop$h = () => { };
|
|
805
832
|
const SWITCH_BASE = 'peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50';
|
|
806
833
|
const SWITCH_TRACK = {
|
|
807
834
|
sm: 'h-4 w-7',
|
|
@@ -821,7 +848,7 @@ const THUMB_BASE = 'bg-background dark:data-[state=unchecked]:bg-foreground dark
|
|
|
821
848
|
class BuiSwitch {
|
|
822
849
|
checked = model(false, /* @ts-ignore */
|
|
823
850
|
...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
824
|
-
disabled =
|
|
851
|
+
disabled = model(false, /* @ts-ignore */
|
|
825
852
|
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
826
853
|
size = input('default', /* @ts-ignore */
|
|
827
854
|
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
@@ -832,6 +859,8 @@ class BuiSwitch {
|
|
|
832
859
|
iconOff = input('', /* @ts-ignore */
|
|
833
860
|
...(ngDevMode ? [{ debugName: "iconOff" }] : /* istanbul ignore next */ []));
|
|
834
861
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
862
|
+
onChange = noop$h;
|
|
863
|
+
onTouched = noop$h;
|
|
835
864
|
state = computed(() => (this.checked() ? 'checked' : 'unchecked'), /* @ts-ignore */
|
|
836
865
|
...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
|
|
837
866
|
activeIcon = computed(() => (this.checked() ? this.iconOn() : this.iconOff()), /* @ts-ignore */
|
|
@@ -845,9 +874,25 @@ class BuiSwitch {
|
|
|
845
874
|
return;
|
|
846
875
|
}
|
|
847
876
|
this.checked.update((value) => !value);
|
|
877
|
+
this.onChange(this.checked());
|
|
878
|
+
this.onTouched();
|
|
879
|
+
}
|
|
880
|
+
writeValue(isChecked) {
|
|
881
|
+
this.checked.set(!!isChecked);
|
|
882
|
+
}
|
|
883
|
+
registerOnChange(callback) {
|
|
884
|
+
this.onChange = callback;
|
|
885
|
+
}
|
|
886
|
+
registerOnTouched(callback) {
|
|
887
|
+
this.onTouched = callback;
|
|
888
|
+
}
|
|
889
|
+
setDisabledState(isDisabled) {
|
|
890
|
+
this.disabled.set(isDisabled);
|
|
848
891
|
}
|
|
849
892
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiSwitch, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
850
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiSwitch, isStandalone: true, selector: "button[buiSwitch]", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, iconOn: { classPropertyName: "iconOn", publicName: "iconOn", isSignal: true, isRequired: false, transformFunction: null }, iconOff: { classPropertyName: "iconOff", publicName: "iconOff", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange" }, host: { attributes: { "type": "button", "role": "switch", "data-slot": "switch" }, listeners: { "click": "toggle()" }, properties: { "attr.aria-checked": "checked()", "attr.data-state": "state()", "disabled": "disabled()", "class": "computedClass()" } },
|
|
893
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiSwitch, isStandalone: true, selector: "button[buiSwitch]", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, iconOn: { classPropertyName: "iconOn", publicName: "iconOn", isSignal: true, isRequired: false, transformFunction: null }, iconOff: { classPropertyName: "iconOff", publicName: "iconOff", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", disabled: "disabledChange" }, host: { attributes: { "type": "button", "role": "switch", "data-slot": "switch" }, listeners: { "click": "toggle()", "blur": "onTouched()" }, properties: { "attr.aria-checked": "checked()", "attr.data-state": "state()", "disabled": "disabled()", "class": "computedClass()" } }, providers: [
|
|
894
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiSwitch), multi: true },
|
|
895
|
+
], ngImport: i0, template: `
|
|
851
896
|
<span data-slot="switch-thumb" [attr.data-state]="state()" [class]="thumbClass()">
|
|
852
897
|
@if (activeIcon(); as icon) {
|
|
853
898
|
<svg
|
|
@@ -879,7 +924,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
879
924
|
'[disabled]': 'disabled()',
|
|
880
925
|
'[class]': 'computedClass()',
|
|
881
926
|
'(click)': 'toggle()',
|
|
927
|
+
'(blur)': 'onTouched()',
|
|
882
928
|
},
|
|
929
|
+
providers: [
|
|
930
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiSwitch), multi: true },
|
|
931
|
+
],
|
|
883
932
|
template: `
|
|
884
933
|
<span data-slot="switch-thumb" [attr.data-state]="state()" [class]="thumbClass()">
|
|
885
934
|
@if (activeIcon(); as icon) {
|
|
@@ -899,7 +948,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
899
948
|
</span>
|
|
900
949
|
`,
|
|
901
950
|
}]
|
|
902
|
-
}], propDecorators: { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], iconOn: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconOn", required: false }] }], iconOff: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconOff", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
951
|
+
}], propDecorators: { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], iconOn: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconOn", required: false }] }], iconOff: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconOff", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
903
952
|
|
|
904
953
|
const TRIGGER = 'focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&>svg]:text-muted-foreground [&>svg]:pointer-events-none [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:translate-y-0.5 [&>svg]:transition-transform [&>svg]:duration-200 [&[aria-expanded=true]>svg]:rotate-180';
|
|
905
954
|
class BuiAccordion {
|
|
@@ -1939,6 +1988,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
1939
1988
|
}]
|
|
1940
1989
|
}] });
|
|
1941
1990
|
|
|
1991
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1992
|
+
const noop$g = () => { };
|
|
1942
1993
|
/**
|
|
1943
1994
|
* BlatUI radio group. `role="radiogroup"` with arrow-key roving focus across the
|
|
1944
1995
|
* `buiRadioItem` buttons; `[(value)]` two-way binds the selected value.
|
|
@@ -1946,12 +1997,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
1946
1997
|
class BuiRadioGroup {
|
|
1947
1998
|
value = model(null, /* @ts-ignore */
|
|
1948
1999
|
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
2000
|
+
disabled = model(false, /* @ts-ignore */
|
|
2001
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
1949
2002
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
2003
|
+
onChange = noop$g;
|
|
2004
|
+
onTouched = noop$g;
|
|
1950
2005
|
host = inject(ElementRef);
|
|
1951
2006
|
computedClass = computed(() => cn('grid gap-3', this.userClass()), /* @ts-ignore */
|
|
1952
2007
|
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
1953
2008
|
select(next) {
|
|
1954
2009
|
this.value.set(next);
|
|
2010
|
+
this.onChange(next);
|
|
2011
|
+
}
|
|
2012
|
+
writeValue(value) {
|
|
2013
|
+
this.value.set(typeof value === 'string' ? value : null);
|
|
2014
|
+
}
|
|
2015
|
+
registerOnChange(callback) {
|
|
2016
|
+
this.onChange = callback;
|
|
2017
|
+
}
|
|
2018
|
+
registerOnTouched(callback) {
|
|
2019
|
+
this.onTouched = callback;
|
|
2020
|
+
}
|
|
2021
|
+
setDisabledState(isDisabled) {
|
|
2022
|
+
this.disabled.set(isDisabled);
|
|
1955
2023
|
}
|
|
1956
2024
|
onKeydown(event) {
|
|
1957
2025
|
if (!['ArrowDown', 'ArrowRight', 'ArrowUp', 'ArrowLeft'].includes(event.key)) {
|
|
@@ -1971,7 +2039,9 @@ class BuiRadioGroup {
|
|
|
1971
2039
|
next.click();
|
|
1972
2040
|
}
|
|
1973
2041
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiRadioGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1974
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: BuiRadioGroup, isStandalone: true, selector: "[buiRadioGroup]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { attributes: { "role": "radiogroup", "data-slot": "radio-group" }, listeners: { "keydown": "onKeydown($event)" }, properties: { "class": "computedClass()" } },
|
|
2042
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: BuiRadioGroup, isStandalone: true, selector: "[buiRadioGroup]", inputs: { value: { classPropertyName: "value", publicName: "value", 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", disabled: "disabledChange" }, host: { attributes: { "role": "radiogroup", "data-slot": "radio-group" }, listeners: { "keydown": "onKeydown($event)", "focusout": "onTouched()" }, properties: { "class": "computedClass()" } }, providers: [
|
|
2043
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiRadioGroup), multi: true },
|
|
2044
|
+
], exportAs: ["buiRadioGroup"], ngImport: i0 });
|
|
1975
2045
|
}
|
|
1976
2046
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiRadioGroup, decorators: [{
|
|
1977
2047
|
type: Directive,
|
|
@@ -1983,9 +2053,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
1983
2053
|
'data-slot': 'radio-group',
|
|
1984
2054
|
'[class]': 'computedClass()',
|
|
1985
2055
|
'(keydown)': 'onKeydown($event)',
|
|
2056
|
+
'(focusout)': 'onTouched()',
|
|
1986
2057
|
},
|
|
2058
|
+
providers: [
|
|
2059
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiRadioGroup), multi: true },
|
|
2060
|
+
],
|
|
1987
2061
|
}]
|
|
1988
|
-
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
2062
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
1989
2063
|
const ITEM = 'border-input text-primary dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex aspect-square size-4 shrink-0 items-center justify-center rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50';
|
|
1990
2064
|
class BuiRadioGroupItem {
|
|
1991
2065
|
value = input.required(/* @ts-ignore */
|
|
@@ -1996,17 +2070,19 @@ class BuiRadioGroupItem {
|
|
|
1996
2070
|
group = inject(BuiRadioGroup);
|
|
1997
2071
|
checked = computed(() => this.group.value() === this.value(), /* @ts-ignore */
|
|
1998
2072
|
...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
2073
|
+
isDisabled = computed(() => this.disabled() || this.group.disabled(), /* @ts-ignore */
|
|
2074
|
+
...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
1999
2075
|
tabIndex = computed(() => this.checked() || this.group.value() === null ? 0 : -1, /* @ts-ignore */
|
|
2000
2076
|
...(ngDevMode ? [{ debugName: "tabIndex" }] : /* istanbul ignore next */ []));
|
|
2001
2077
|
computedClass = computed(() => cn(ITEM, this.userClass()), /* @ts-ignore */
|
|
2002
2078
|
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
2003
2079
|
select() {
|
|
2004
|
-
if (!this.
|
|
2080
|
+
if (!this.isDisabled()) {
|
|
2005
2081
|
this.group.select(this.value());
|
|
2006
2082
|
}
|
|
2007
2083
|
}
|
|
2008
2084
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiRadioGroupItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2009
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiRadioGroupItem, isStandalone: true, selector: "button[buiRadioItem]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "button", "role": "radio", "data-slot": "radio-group-item" }, listeners: { "click": "select()" }, properties: { "attr.aria-checked": "checked()", "attr.data-state": "checked() ? 'checked' : 'unchecked'", "attr.tabindex": "tabIndex()", "disabled": "
|
|
2085
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiRadioGroupItem, isStandalone: true, selector: "button[buiRadioItem]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "button", "role": "radio", "data-slot": "radio-group-item" }, listeners: { "click": "select()" }, properties: { "attr.aria-checked": "checked()", "attr.data-state": "checked() ? 'checked' : 'unchecked'", "attr.tabindex": "tabIndex()", "disabled": "isDisabled()", "class": "computedClass()" } }, ngImport: i0, template: `
|
|
2010
2086
|
@if (checked()) {
|
|
2011
2087
|
<span data-slot="radio-group-indicator" class="flex items-center justify-center">
|
|
2012
2088
|
<svg viewBox="0 0 24 24" fill="currentColor" class="size-2" aria-hidden="true">
|
|
@@ -2027,7 +2103,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
2027
2103
|
'[attr.aria-checked]': 'checked()',
|
|
2028
2104
|
'[attr.data-state]': "checked() ? 'checked' : 'unchecked'",
|
|
2029
2105
|
'[attr.tabindex]': 'tabIndex()',
|
|
2030
|
-
'[disabled]': '
|
|
2106
|
+
'[disabled]': 'isDisabled()',
|
|
2031
2107
|
'[class]': 'computedClass()',
|
|
2032
2108
|
'(click)': 'select()',
|
|
2033
2109
|
},
|
|
@@ -2758,6 +2834,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
2758
2834
|
}]
|
|
2759
2835
|
}] });
|
|
2760
2836
|
|
|
2837
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
2838
|
+
const noop$f = () => { };
|
|
2761
2839
|
const toggleVariants = cva("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
2762
2840
|
variants: {
|
|
2763
2841
|
variant: {
|
|
@@ -2776,18 +2854,41 @@ const toggleVariants = cva("inline-flex items-center justify-center gap-2 rounde
|
|
|
2776
2854
|
class BuiToggle {
|
|
2777
2855
|
pressed = model(false, /* @ts-ignore */
|
|
2778
2856
|
...(ngDevMode ? [{ debugName: "pressed" }] : /* istanbul ignore next */ []));
|
|
2857
|
+
disabled = model(false, /* @ts-ignore */
|
|
2858
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
2779
2859
|
variant = input('default', /* @ts-ignore */
|
|
2780
2860
|
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
2781
2861
|
size = input('default', /* @ts-ignore */
|
|
2782
2862
|
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
2783
2863
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
2864
|
+
onChange = noop$f;
|
|
2865
|
+
onTouched = noop$f;
|
|
2784
2866
|
computedClass = computed(() => cn(toggleVariants({ variant: this.variant(), size: this.size() }), this.userClass()), /* @ts-ignore */
|
|
2785
2867
|
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
2786
2868
|
toggle() {
|
|
2869
|
+
if (this.disabled()) {
|
|
2870
|
+
return;
|
|
2871
|
+
}
|
|
2787
2872
|
this.pressed.update((value) => !value);
|
|
2873
|
+
this.onChange(this.pressed());
|
|
2874
|
+
this.onTouched();
|
|
2875
|
+
}
|
|
2876
|
+
writeValue(isPressed) {
|
|
2877
|
+
this.pressed.set(!!isPressed);
|
|
2878
|
+
}
|
|
2879
|
+
registerOnChange(callback) {
|
|
2880
|
+
this.onChange = callback;
|
|
2881
|
+
}
|
|
2882
|
+
registerOnTouched(callback) {
|
|
2883
|
+
this.onTouched = callback;
|
|
2884
|
+
}
|
|
2885
|
+
setDisabledState(isDisabled) {
|
|
2886
|
+
this.disabled.set(isDisabled);
|
|
2788
2887
|
}
|
|
2789
2888
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiToggle, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2790
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: BuiToggle, isStandalone: true, selector: "button[buiToggle]", inputs: { pressed: { classPropertyName: "pressed", publicName: "pressed", 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 }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pressed: "pressedChange" }, host: { attributes: { "type": "button", "data-slot": "toggle" }, listeners: { "click": "toggle()" }, properties: { "attr.aria-pressed": "pressed()", "attr.data-state": "pressed() ? 'on' : 'off'", "class": "computedClass()" } },
|
|
2889
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: BuiToggle, isStandalone: true, selector: "button[buiToggle]", inputs: { pressed: { classPropertyName: "pressed", publicName: "pressed", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", 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 }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pressed: "pressedChange", disabled: "disabledChange" }, host: { attributes: { "type": "button", "data-slot": "toggle" }, listeners: { "click": "toggle()", "blur": "onTouched()" }, properties: { "attr.aria-pressed": "pressed()", "attr.data-state": "pressed() ? 'on' : 'off'", "disabled": "disabled()", "class": "computedClass()" } }, providers: [
|
|
2890
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiToggle), multi: true },
|
|
2891
|
+
], ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
2791
2892
|
}
|
|
2792
2893
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiToggle, decorators: [{
|
|
2793
2894
|
type: Component,
|
|
@@ -2798,12 +2899,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
2798
2899
|
'data-slot': 'toggle',
|
|
2799
2900
|
'[attr.aria-pressed]': 'pressed()',
|
|
2800
2901
|
'[attr.data-state]': "pressed() ? 'on' : 'off'",
|
|
2902
|
+
'[disabled]': 'disabled()',
|
|
2801
2903
|
'[class]': 'computedClass()',
|
|
2802
2904
|
'(click)': 'toggle()',
|
|
2905
|
+
'(blur)': 'onTouched()',
|
|
2803
2906
|
},
|
|
2907
|
+
providers: [
|
|
2908
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiToggle), multi: true },
|
|
2909
|
+
],
|
|
2804
2910
|
template: `<ng-content />`,
|
|
2805
2911
|
}]
|
|
2806
|
-
}], propDecorators: { pressed: [{ type: i0.Input, args: [{ isSignal: true, alias: "pressed", required: false }] }, { type: i0.Output, args: ["pressedChange"] }], 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 }] }] } });
|
|
2912
|
+
}], propDecorators: { pressed: [{ type: i0.Input, args: [{ isSignal: true, alias: "pressed", required: false }] }, { type: i0.Output, args: ["pressedChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], 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 }] }] } });
|
|
2807
2913
|
|
|
2808
2914
|
/** A spinning loading indicator (`role="status"`). */
|
|
2809
2915
|
class BuiSpinner {
|
|
@@ -4234,6 +4340,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
4234
4340
|
}]
|
|
4235
4341
|
}], propDecorators: { code: [{ type: i0.Input, args: [{ isSignal: true, alias: "code", required: false }] }], filename: [{ type: i0.Input, args: [{ isSignal: true, alias: "filename", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
4236
4342
|
|
|
4343
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
4344
|
+
const noop$e = () => { };
|
|
4237
4345
|
/**
|
|
4238
4346
|
* A slider (`role="slider"`) with pointer drag and full keyboard support
|
|
4239
4347
|
* (arrows, Home/End, PageUp/PageDown). Single value, or a two-thumb `range`
|
|
@@ -4254,13 +4362,15 @@ class BuiSlider {
|
|
|
4254
4362
|
...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
|
|
4255
4363
|
step = input(1, /* @ts-ignore */
|
|
4256
4364
|
...(ngDevMode ? [{ debugName: "step" }] : /* istanbul ignore next */ []));
|
|
4257
|
-
disabled =
|
|
4365
|
+
disabled = model(false, /* @ts-ignore */
|
|
4258
4366
|
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
4259
4367
|
orientation = input('horizontal', /* @ts-ignore */
|
|
4260
4368
|
...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
4261
4369
|
ariaLabel = input('Value', /* @ts-ignore */
|
|
4262
4370
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
4263
4371
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
4372
|
+
onChange = noop$e;
|
|
4373
|
+
onTouched = noop$e;
|
|
4264
4374
|
track = viewChild.required('track');
|
|
4265
4375
|
active = signal('start', /* @ts-ignore */
|
|
4266
4376
|
...(ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []));
|
|
@@ -4350,6 +4460,7 @@ class BuiSlider {
|
|
|
4350
4460
|
}
|
|
4351
4461
|
else {
|
|
4352
4462
|
this.value.set(next);
|
|
4463
|
+
this.onChange(next);
|
|
4353
4464
|
}
|
|
4354
4465
|
}
|
|
4355
4466
|
toPct(value) {
|
|
@@ -4370,8 +4481,22 @@ class BuiSlider {
|
|
|
4370
4481
|
clamp(value) {
|
|
4371
4482
|
return Math.max(this.min(), Math.min(this.max(), value));
|
|
4372
4483
|
}
|
|
4484
|
+
writeValue(value) {
|
|
4485
|
+
this.value.set(typeof value === 'number' ? value : 0);
|
|
4486
|
+
}
|
|
4487
|
+
registerOnChange(callback) {
|
|
4488
|
+
this.onChange = callback;
|
|
4489
|
+
}
|
|
4490
|
+
registerOnTouched(callback) {
|
|
4491
|
+
this.onTouched = callback;
|
|
4492
|
+
}
|
|
4493
|
+
setDisabledState(isDisabled) {
|
|
4494
|
+
this.disabled.set(isDisabled);
|
|
4495
|
+
}
|
|
4373
4496
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiSlider, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4374
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiSlider, isStandalone: true, selector: "bui-slider", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, range: { classPropertyName: "range", publicName: "range", isSignal: true, isRequired: false, transformFunction: null }, endValue: { classPropertyName: "endValue", publicName: "endValue", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", endValue: "endValueChange" }, host: { attributes: { "data-slot": "slider" }, listeners: { "document:pointermove": "onMove($event)", "document:pointerup": "onUp()" }, properties: { "attr.data-orientation": "orientation()", "attr.data-disabled": "disabled() ? '' : null", "class": "computedClass()" } },
|
|
4497
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiSlider, isStandalone: true, selector: "bui-slider", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, range: { classPropertyName: "range", publicName: "range", isSignal: true, isRequired: false, transformFunction: null }, endValue: { classPropertyName: "endValue", publicName: "endValue", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", endValue: "endValueChange", disabled: "disabledChange" }, host: { attributes: { "data-slot": "slider" }, listeners: { "document:pointermove": "onMove($event)", "document:pointerup": "onUp()", "focusout": "onTouched()" }, properties: { "attr.data-orientation": "orientation()", "attr.data-disabled": "disabled() ? '' : null", "class": "computedClass()" } }, providers: [
|
|
4498
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiSlider), multi: true },
|
|
4499
|
+
], viewQueries: [{ propertyName: "track", first: true, predicate: ["track"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
4375
4500
|
<span
|
|
4376
4501
|
#track
|
|
4377
4502
|
data-slot="slider-track"
|
|
@@ -4434,7 +4559,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
4434
4559
|
'[class]': 'computedClass()',
|
|
4435
4560
|
'(document:pointermove)': 'onMove($event)',
|
|
4436
4561
|
'(document:pointerup)': 'onUp()',
|
|
4562
|
+
'(focusout)': 'onTouched()',
|
|
4437
4563
|
},
|
|
4564
|
+
providers: [
|
|
4565
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiSlider), multi: true },
|
|
4566
|
+
],
|
|
4438
4567
|
template: `
|
|
4439
4568
|
<span
|
|
4440
4569
|
#track
|
|
@@ -4487,8 +4616,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
4487
4616
|
}
|
|
4488
4617
|
`,
|
|
4489
4618
|
}]
|
|
4490
|
-
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], range: [{ type: i0.Input, args: [{ isSignal: true, alias: "range", required: false }] }], endValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "endValue", required: false }] }, { type: i0.Output, args: ["endValueChange"] }], 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 }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], track: [{ type: i0.ViewChild, args: ['track', { isSignal: true }] }] } });
|
|
4619
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], range: [{ type: i0.Input, args: [{ isSignal: true, alias: "range", required: false }] }], endValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "endValue", required: false }] }, { type: i0.Output, args: ["endValueChange"] }], 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 }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], track: [{ type: i0.ViewChild, args: ['track', { isSignal: true }] }] } });
|
|
4491
4620
|
|
|
4621
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
4622
|
+
const noop$d = () => { };
|
|
4492
4623
|
const STAR_SIZE = { sm: 'size-4', default: 'size-5', lg: 'size-6' };
|
|
4493
4624
|
/** A star rating (`role="radiogroup"`) with hover preview and keyboard support. */
|
|
4494
4625
|
class BuiRating {
|
|
@@ -4498,6 +4629,8 @@ class BuiRating {
|
|
|
4498
4629
|
...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
|
|
4499
4630
|
readonly = input(false, /* @ts-ignore */
|
|
4500
4631
|
...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
4632
|
+
disabled = model(false, /* @ts-ignore */
|
|
4633
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
4501
4634
|
size = input('default', /* @ts-ignore */
|
|
4502
4635
|
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
4503
4636
|
color = input('text-amber-500', /* @ts-ignore */
|
|
@@ -4505,6 +4638,10 @@ class BuiRating {
|
|
|
4505
4638
|
ariaLabel = input(null, /* @ts-ignore */
|
|
4506
4639
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
4507
4640
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
4641
|
+
onChange = noop$d;
|
|
4642
|
+
onTouched = noop$d;
|
|
4643
|
+
inactive = computed(() => this.readonly() || this.disabled(), /* @ts-ignore */
|
|
4644
|
+
...(ngDevMode ? [{ debugName: "inactive" }] : /* istanbul ignore next */ []));
|
|
4508
4645
|
hover = signal(0, /* @ts-ignore */
|
|
4509
4646
|
...(ngDevMode ? [{ debugName: "hover" }] : /* istanbul ignore next */ []));
|
|
4510
4647
|
current = computed(() => this.hover() || this.value(), /* @ts-ignore */
|
|
@@ -4516,23 +4653,25 @@ class BuiRating {
|
|
|
4516
4653
|
computedClass = computed(() => cn('inline-flex items-center gap-0.5', this.userClass()), /* @ts-ignore */
|
|
4517
4654
|
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
4518
4655
|
set(next) {
|
|
4519
|
-
if (
|
|
4520
|
-
|
|
4656
|
+
if (this.inactive()) {
|
|
4657
|
+
return;
|
|
4521
4658
|
}
|
|
4659
|
+
this.value.set(next);
|
|
4660
|
+
this.onChange(next);
|
|
4522
4661
|
}
|
|
4523
4662
|
onHover(next) {
|
|
4524
|
-
if (!this.
|
|
4663
|
+
if (!this.inactive()) {
|
|
4525
4664
|
this.hover.set(next);
|
|
4526
4665
|
}
|
|
4527
4666
|
}
|
|
4528
4667
|
tabindexFor(star) {
|
|
4529
|
-
if (this.
|
|
4668
|
+
if (this.inactive()) {
|
|
4530
4669
|
return -1;
|
|
4531
4670
|
}
|
|
4532
4671
|
return star === (this.value() || 1) ? 0 : -1;
|
|
4533
4672
|
}
|
|
4534
4673
|
onKeydown(event) {
|
|
4535
|
-
if (this.
|
|
4674
|
+
if (this.inactive()) {
|
|
4536
4675
|
return;
|
|
4537
4676
|
}
|
|
4538
4677
|
if (event.key === 'ArrowRight' || event.key === 'ArrowUp') {
|
|
@@ -4544,8 +4683,22 @@ class BuiRating {
|
|
|
4544
4683
|
this.set(Math.max(0, this.value() - 1));
|
|
4545
4684
|
}
|
|
4546
4685
|
}
|
|
4686
|
+
writeValue(value) {
|
|
4687
|
+
this.value.set(typeof value === 'number' ? value : 0);
|
|
4688
|
+
}
|
|
4689
|
+
registerOnChange(callback) {
|
|
4690
|
+
this.onChange = callback;
|
|
4691
|
+
}
|
|
4692
|
+
registerOnTouched(callback) {
|
|
4693
|
+
this.onTouched = callback;
|
|
4694
|
+
}
|
|
4695
|
+
setDisabledState(isDisabled) {
|
|
4696
|
+
this.disabled.set(isDisabled);
|
|
4697
|
+
}
|
|
4547
4698
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiRating, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4548
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiRating, isStandalone: true, selector: "bui-rating", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { attributes: { "data-slot": "rating", "role": "radiogroup" }, listeners: { "mouseleave": "hover.set(0)", "keydown": "onKeydown($event)" }, properties: { "attr.aria-label": "ariaLabel()", "class": "computedClass()" } },
|
|
4699
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiRating, isStandalone: true, selector: "bui-rating", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", disabled: "disabledChange" }, host: { attributes: { "data-slot": "rating", "role": "radiogroup" }, listeners: { "mouseleave": "hover.set(0)", "keydown": "onKeydown($event)", "focusout": "onTouched()" }, properties: { "attr.aria-label": "ariaLabel()", "class": "computedClass()" } }, providers: [
|
|
4700
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiRating), multi: true },
|
|
4701
|
+
], ngImport: i0, template: `
|
|
4549
4702
|
@for (star of stars(); track star) {
|
|
4550
4703
|
<button
|
|
4551
4704
|
type="button"
|
|
@@ -4553,7 +4706,7 @@ class BuiRating {
|
|
|
4553
4706
|
[attr.aria-checked]="value() === star"
|
|
4554
4707
|
[attr.aria-label]="star + ' / ' + max()"
|
|
4555
4708
|
[attr.tabindex]="tabindexFor(star)"
|
|
4556
|
-
[disabled]="
|
|
4709
|
+
[disabled]="inactive()"
|
|
4557
4710
|
class="rounded-sm transition-colors outline-none not-disabled:cursor-pointer focus-visible:ring-[3px] focus-visible:ring-ring/50"
|
|
4558
4711
|
[class]="current() >= star ? color() : 'text-muted-foreground/30'"
|
|
4559
4712
|
(click)="set(star)"
|
|
@@ -4589,7 +4742,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
4589
4742
|
'[class]': 'computedClass()',
|
|
4590
4743
|
'(mouseleave)': 'hover.set(0)',
|
|
4591
4744
|
'(keydown)': 'onKeydown($event)',
|
|
4745
|
+
'(focusout)': 'onTouched()',
|
|
4592
4746
|
},
|
|
4747
|
+
providers: [
|
|
4748
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiRating), multi: true },
|
|
4749
|
+
],
|
|
4593
4750
|
template: `
|
|
4594
4751
|
@for (star of stars(); track star) {
|
|
4595
4752
|
<button
|
|
@@ -4598,7 +4755,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
4598
4755
|
[attr.aria-checked]="value() === star"
|
|
4599
4756
|
[attr.aria-label]="star + ' / ' + max()"
|
|
4600
4757
|
[attr.tabindex]="tabindexFor(star)"
|
|
4601
|
-
[disabled]="
|
|
4758
|
+
[disabled]="inactive()"
|
|
4602
4759
|
class="rounded-sm transition-colors outline-none not-disabled:cursor-pointer focus-visible:ring-[3px] focus-visible:ring-ring/50"
|
|
4603
4760
|
[class]="current() >= star ? color() : 'text-muted-foreground/30'"
|
|
4604
4761
|
(click)="set(star)"
|
|
@@ -4623,7 +4780,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
4623
4780
|
}
|
|
4624
4781
|
`,
|
|
4625
4782
|
}]
|
|
4626
|
-
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
4783
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
4627
4784
|
|
|
4628
4785
|
const FIELD_HEIGHT = { sm: 'h-7 text-xs', default: 'h-8 text-sm', lg: 'h-9 text-base' };
|
|
4629
4786
|
const BTN_SIZE$1 = {
|
|
@@ -5188,24 +5345,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
5188
5345
|
}]
|
|
5189
5346
|
}], 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 }] }] } });
|
|
5190
5347
|
|
|
5348
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
5349
|
+
const noop$c = () => { };
|
|
5191
5350
|
/** A single-select segmented control (`role="radiogroup"`) with arrow-key navigation. */
|
|
5192
5351
|
class BuiSegmentedControl {
|
|
5193
5352
|
value = model('', /* @ts-ignore */
|
|
5194
5353
|
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
5195
5354
|
options = input([], /* @ts-ignore */
|
|
5196
5355
|
...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
5197
|
-
disabled =
|
|
5356
|
+
disabled = model(false, /* @ts-ignore */
|
|
5198
5357
|
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
5199
5358
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
5359
|
+
onChange = noop$c;
|
|
5360
|
+
onTouched = noop$c;
|
|
5200
5361
|
host = inject(ElementRef);
|
|
5201
5362
|
normalized = computed(() => this.options().map((option) => typeof option === 'string' ? { value: option, label: option } : option), /* @ts-ignore */
|
|
5202
5363
|
...(ngDevMode ? [{ debugName: "normalized" }] : /* istanbul ignore next */ []));
|
|
5203
5364
|
computedClass = computed(() => cn('inline-flex items-center gap-1 rounded-lg bg-muted p-1', this.userClass()), /* @ts-ignore */
|
|
5204
5365
|
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
5205
5366
|
select(next) {
|
|
5206
|
-
if (
|
|
5207
|
-
|
|
5367
|
+
if (this.disabled()) {
|
|
5368
|
+
return;
|
|
5208
5369
|
}
|
|
5370
|
+
this.value.set(next);
|
|
5371
|
+
this.onChange(next);
|
|
5209
5372
|
}
|
|
5210
5373
|
tabindexFor(optionValue) {
|
|
5211
5374
|
if (this.value() === optionValue) {
|
|
@@ -5227,11 +5390,26 @@ class BuiSegmentedControl {
|
|
|
5227
5390
|
const isForward = event.key === 'ArrowRight' || event.key === 'ArrowDown';
|
|
5228
5391
|
const nextIndex = (current + (isForward ? 1 : -1) + items.length) % items.length;
|
|
5229
5392
|
this.value.set(items[nextIndex].value);
|
|
5393
|
+
this.onChange(items[nextIndex].value);
|
|
5230
5394
|
const buttons = this.host.nativeElement.querySelectorAll('[role="radio"]');
|
|
5231
5395
|
buttons[nextIndex].focus();
|
|
5232
5396
|
}
|
|
5397
|
+
writeValue(value) {
|
|
5398
|
+
this.value.set(typeof value === 'string' ? value : '');
|
|
5399
|
+
}
|
|
5400
|
+
registerOnChange(callback) {
|
|
5401
|
+
this.onChange = callback;
|
|
5402
|
+
}
|
|
5403
|
+
registerOnTouched(callback) {
|
|
5404
|
+
this.onTouched = callback;
|
|
5405
|
+
}
|
|
5406
|
+
setDisabledState(isDisabled) {
|
|
5407
|
+
this.disabled.set(isDisabled);
|
|
5408
|
+
}
|
|
5233
5409
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiSegmentedControl, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5234
|
-
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()" } },
|
|
5410
|
+
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", disabled: "disabledChange" }, host: { attributes: { "data-slot": "segmented-control", "role": "radiogroup" }, listeners: { "keydown": "onKeydown($event)", "focusout": "onTouched()" }, properties: { "class": "computedClass()" } }, providers: [
|
|
5411
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiSegmentedControl), multi: true },
|
|
5412
|
+
], ngImport: i0, template: `
|
|
5235
5413
|
@for (option of normalized(); track option.value) {
|
|
5236
5414
|
<button
|
|
5237
5415
|
type="button"
|
|
@@ -5261,7 +5439,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
5261
5439
|
role: 'radiogroup',
|
|
5262
5440
|
'[class]': 'computedClass()',
|
|
5263
5441
|
'(keydown)': 'onKeydown($event)',
|
|
5442
|
+
'(focusout)': 'onTouched()',
|
|
5264
5443
|
},
|
|
5444
|
+
providers: [
|
|
5445
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiSegmentedControl), multi: true },
|
|
5446
|
+
],
|
|
5265
5447
|
template: `
|
|
5266
5448
|
@for (option of normalized(); track option.value) {
|
|
5267
5449
|
<button
|
|
@@ -5283,7 +5465,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
5283
5465
|
}
|
|
5284
5466
|
`,
|
|
5285
5467
|
}]
|
|
5286
|
-
}], 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 }] }] } });
|
|
5468
|
+
}], 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 }] }, { type: i0.Output, args: ["disabledChange"] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
5287
5469
|
|
|
5288
5470
|
/**
|
|
5289
5471
|
* A terminal / console window (always dark). Put prompt + output lines in the content;
|
|
@@ -5727,6 +5909,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
5727
5909
|
}]
|
|
5728
5910
|
}], propDecorators: { max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], scaleTo: [{ type: i0.Input, args: [{ isSignal: true, alias: "scaleTo", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
5729
5911
|
|
|
5912
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
5913
|
+
const noop$b = () => { };
|
|
5730
5914
|
/**
|
|
5731
5915
|
* An accessible select (combobox + listbox) using the `aria-activedescendant` pattern:
|
|
5732
5916
|
* focus stays on the trigger while arrows move the active option. Full keyboard support
|
|
@@ -5744,9 +5928,11 @@ class BuiSelect {
|
|
|
5744
5928
|
...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
5745
5929
|
placeholder = input('Select…', /* @ts-ignore */
|
|
5746
5930
|
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
5747
|
-
disabled =
|
|
5931
|
+
disabled = model(false, /* @ts-ignore */
|
|
5748
5932
|
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
5749
5933
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
5934
|
+
onChange = noop$b;
|
|
5935
|
+
onTouched = noop$b;
|
|
5750
5936
|
listId = inject(_IdGenerator).getId('bui-select-');
|
|
5751
5937
|
host = inject(ElementRef);
|
|
5752
5938
|
open = signal(false, /* @ts-ignore */
|
|
@@ -5792,9 +5978,11 @@ class BuiSelect {
|
|
|
5792
5978
|
next.add(option.value);
|
|
5793
5979
|
}
|
|
5794
5980
|
this.values.set([...next]);
|
|
5981
|
+
this.onChange([...next]);
|
|
5795
5982
|
return;
|
|
5796
5983
|
}
|
|
5797
5984
|
this.value.set(option.value);
|
|
5985
|
+
this.onChange(option.value);
|
|
5798
5986
|
this.close();
|
|
5799
5987
|
}
|
|
5800
5988
|
onKeydown(event) {
|
|
@@ -5859,10 +6047,32 @@ class BuiSelect {
|
|
|
5859
6047
|
this.open.set(true);
|
|
5860
6048
|
}
|
|
5861
6049
|
close() {
|
|
6050
|
+
if (this.open()) {
|
|
6051
|
+
this.onTouched();
|
|
6052
|
+
}
|
|
5862
6053
|
this.open.set(false);
|
|
5863
6054
|
}
|
|
6055
|
+
writeValue(value) {
|
|
6056
|
+
if (this.multiple()) {
|
|
6057
|
+
this.values.set(Array.isArray(value) ? [...value] : []);
|
|
6058
|
+
}
|
|
6059
|
+
else {
|
|
6060
|
+
this.value.set(typeof value === 'string' ? value : '');
|
|
6061
|
+
}
|
|
6062
|
+
}
|
|
6063
|
+
registerOnChange(callback) {
|
|
6064
|
+
this.onChange = callback;
|
|
6065
|
+
}
|
|
6066
|
+
registerOnTouched(callback) {
|
|
6067
|
+
this.onTouched = callback;
|
|
6068
|
+
}
|
|
6069
|
+
setDisabledState(isDisabled) {
|
|
6070
|
+
this.disabled.set(isDisabled);
|
|
6071
|
+
}
|
|
5864
6072
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiSelect, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5865
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiSelect, isStandalone: true, selector: "bui-select", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, values: { classPropertyName: "values", publicName: "values", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", 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", values: "valuesChange" }, host: { attributes: { "data-slot": "select" }, listeners: { "document:click": "onDocumentClick($event)" }, properties: { "class": "computedClass()" } },
|
|
6073
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiSelect, isStandalone: true, selector: "bui-select", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, values: { classPropertyName: "values", publicName: "values", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", 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", values: "valuesChange", disabled: "disabledChange" }, host: { attributes: { "data-slot": "select" }, listeners: { "document:click": "onDocumentClick($event)" }, properties: { "class": "computedClass()" } }, providers: [
|
|
6074
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiSelect), multi: true },
|
|
6075
|
+
], ngImport: i0, template: `
|
|
5866
6076
|
<button
|
|
5867
6077
|
type="button"
|
|
5868
6078
|
role="combobox"
|
|
@@ -5975,6 +6185,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
5975
6185
|
'[class]': 'computedClass()',
|
|
5976
6186
|
'(document:click)': 'onDocumentClick($event)',
|
|
5977
6187
|
},
|
|
6188
|
+
providers: [
|
|
6189
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiSelect), multi: true },
|
|
6190
|
+
],
|
|
5978
6191
|
template: `
|
|
5979
6192
|
<button
|
|
5980
6193
|
type="button"
|
|
@@ -6079,7 +6292,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
6079
6292
|
}
|
|
6080
6293
|
`,
|
|
6081
6294
|
}]
|
|
6082
|
-
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], values: [{ type: i0.Input, args: [{ isSignal: true, alias: "values", required: false }] }, { type: i0.Output, args: ["valuesChange"] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
6295
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], values: [{ type: i0.Input, args: [{ isSignal: true, alias: "values", required: false }] }, { type: i0.Output, args: ["valuesChange"] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
6083
6296
|
|
|
6084
6297
|
const VARIANTS$1 = {
|
|
6085
6298
|
primary: 'bg-primary text-primary-foreground hover:bg-primary/90',
|
|
@@ -6173,6 +6386,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
6173
6386
|
}]
|
|
6174
6387
|
}], ctorParameters: () => [], propDecorators: { threshold: [{ type: i0.Input, args: [{ isSignal: true, alias: "threshold", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
6175
6388
|
|
|
6389
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
6390
|
+
const noop$a = () => { };
|
|
6176
6391
|
/**
|
|
6177
6392
|
* A filterable combobox: a text input (`role="combobox"`, `aria-autocomplete="list"`) over a
|
|
6178
6393
|
* filtered listbox, using the `aria-activedescendant` pattern. Full keyboard + outside-click.
|
|
@@ -6189,12 +6404,14 @@ class BuiCombobox {
|
|
|
6189
6404
|
...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
6190
6405
|
placeholder = input('Search…', /* @ts-ignore */
|
|
6191
6406
|
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
6192
|
-
disabled =
|
|
6407
|
+
disabled = model(false, /* @ts-ignore */
|
|
6193
6408
|
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
6194
6409
|
/** When false, the field can't be typed in — it just opens the full list (select-like). */
|
|
6195
6410
|
searchable = input(true, /* @ts-ignore */
|
|
6196
6411
|
...(ngDevMode ? [{ debugName: "searchable" }] : /* istanbul ignore next */ []));
|
|
6197
6412
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
6413
|
+
onChange = noop$a;
|
|
6414
|
+
onTouched = noop$a;
|
|
6198
6415
|
listId = inject(_IdGenerator).getId('bui-combobox-');
|
|
6199
6416
|
host = inject(ElementRef);
|
|
6200
6417
|
open = signal(false, /* @ts-ignore */
|
|
@@ -6254,12 +6471,15 @@ class BuiCombobox {
|
|
|
6254
6471
|
next.add(option.value);
|
|
6255
6472
|
}
|
|
6256
6473
|
this.values.set([...next]);
|
|
6474
|
+
this.onChange([...next]);
|
|
6257
6475
|
this.query.set('');
|
|
6258
6476
|
return;
|
|
6259
6477
|
}
|
|
6260
6478
|
this.value.set(option.value);
|
|
6479
|
+
this.onChange(option.value);
|
|
6261
6480
|
this.query.set('');
|
|
6262
6481
|
this.open.set(false);
|
|
6482
|
+
this.onTouched();
|
|
6263
6483
|
}
|
|
6264
6484
|
onKeydown(event) {
|
|
6265
6485
|
if (this.disabled()) {
|
|
@@ -6304,9 +6524,29 @@ class BuiCombobox {
|
|
|
6304
6524
|
}
|
|
6305
6525
|
this.open.set(false);
|
|
6306
6526
|
this.query.set('');
|
|
6527
|
+
this.onTouched();
|
|
6528
|
+
}
|
|
6529
|
+
writeValue(value) {
|
|
6530
|
+
if (this.multiple()) {
|
|
6531
|
+
this.values.set(Array.isArray(value) ? [...value] : []);
|
|
6532
|
+
}
|
|
6533
|
+
else {
|
|
6534
|
+
this.value.set(typeof value === 'string' ? value : '');
|
|
6535
|
+
}
|
|
6536
|
+
}
|
|
6537
|
+
registerOnChange(callback) {
|
|
6538
|
+
this.onChange = callback;
|
|
6539
|
+
}
|
|
6540
|
+
registerOnTouched(callback) {
|
|
6541
|
+
this.onTouched = callback;
|
|
6542
|
+
}
|
|
6543
|
+
setDisabledState(isDisabled) {
|
|
6544
|
+
this.disabled.set(isDisabled);
|
|
6307
6545
|
}
|
|
6308
6546
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiCombobox, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6309
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiCombobox, isStandalone: true, selector: "bui-combobox", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, values: { classPropertyName: "values", publicName: "values", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", values: "valuesChange" }, host: { attributes: { "data-slot": "combobox" }, listeners: { "document:click": "onDocumentClick($event)" }, properties: { "class": "computedClass()" } },
|
|
6547
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiCombobox, isStandalone: true, selector: "bui-combobox", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, values: { classPropertyName: "values", publicName: "values", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", values: "valuesChange", disabled: "disabledChange" }, host: { attributes: { "data-slot": "combobox" }, listeners: { "document:click": "onDocumentClick($event)" }, properties: { "class": "computedClass()" } }, providers: [
|
|
6548
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiCombobox), multi: true },
|
|
6549
|
+
], ngImport: i0, template: `
|
|
6310
6550
|
<input
|
|
6311
6551
|
type="text"
|
|
6312
6552
|
role="combobox"
|
|
@@ -6387,6 +6627,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
6387
6627
|
'[class]': 'computedClass()',
|
|
6388
6628
|
'(document:click)': 'onDocumentClick($event)',
|
|
6389
6629
|
},
|
|
6630
|
+
providers: [
|
|
6631
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiCombobox), multi: true },
|
|
6632
|
+
],
|
|
6390
6633
|
template: `
|
|
6391
6634
|
<input
|
|
6392
6635
|
type="text"
|
|
@@ -6459,7 +6702,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
6459
6702
|
}
|
|
6460
6703
|
`,
|
|
6461
6704
|
}]
|
|
6462
|
-
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], values: [{ type: i0.Input, args: [{ isSignal: true, alias: "values", required: false }] }, { type: i0.Output, args: ["valuesChange"] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], searchable: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchable", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
6705
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], values: [{ type: i0.Input, args: [{ isSignal: true, alias: "values", required: false }] }, { type: i0.Output, args: ["valuesChange"] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], searchable: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchable", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
6463
6706
|
|
|
6464
6707
|
/** A live countdown to a target time (`role="timer"`). SSR-safe — ticks only in the browser. */
|
|
6465
6708
|
class BuiCountdown {
|
|
@@ -7491,6 +7734,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
7491
7734
|
}]
|
|
7492
7735
|
}], propDecorators: { show: [{ type: i0.Input, args: [{ isSignal: true, alias: "show", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }], blur: [{ type: i0.Input, args: [{ isSignal: true, alias: "blur", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
7493
7736
|
|
|
7737
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
7738
|
+
const noop$9 = () => { };
|
|
7494
7739
|
const BTN = 'border-input text-foreground hover:bg-accent inline-flex items-center justify-center border bg-transparent outline-none transition-colors disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4';
|
|
7495
7740
|
const INPUT = 'w-16 [appearance:textfield] border-y border-input bg-transparent text-center tabular-nums outline-none focus-visible:relative focus-visible:z-10 focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none';
|
|
7496
7741
|
const BTN_SIZE = {
|
|
@@ -7512,13 +7757,15 @@ class BuiNumberInput {
|
|
|
7512
7757
|
max = input(null, /* @ts-ignore */
|
|
7513
7758
|
...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
|
|
7514
7759
|
stepBy = input(1, { ...(ngDevMode ? { debugName: "stepBy" } : /* istanbul ignore next */ {}), alias: 'step' });
|
|
7515
|
-
disabled =
|
|
7760
|
+
disabled = model(false, /* @ts-ignore */
|
|
7516
7761
|
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
7517
7762
|
size = input('default', /* @ts-ignore */
|
|
7518
7763
|
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
7519
7764
|
ariaLabel = input('', /* @ts-ignore */
|
|
7520
7765
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
7521
7766
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
7767
|
+
onChange = noop$9;
|
|
7768
|
+
onTouched = noop$9;
|
|
7522
7769
|
btnClass = computed(() => cn(BTN, BTN_SIZE[this.size()]), /* @ts-ignore */
|
|
7523
7770
|
...(ngDevMode ? [{ debugName: "btnClass" }] : /* istanbul ignore next */ []));
|
|
7524
7771
|
inputClass = computed(() => cn(INPUT, INPUT_SIZE[this.size()]), /* @ts-ignore */
|
|
@@ -7553,9 +7800,24 @@ class BuiNumberInput {
|
|
|
7553
7800
|
value = max;
|
|
7554
7801
|
}
|
|
7555
7802
|
this.value.set(value);
|
|
7803
|
+
this.onChange(value);
|
|
7804
|
+
}
|
|
7805
|
+
writeValue(value) {
|
|
7806
|
+
this.value.set(typeof value === 'number' ? value : 0);
|
|
7807
|
+
}
|
|
7808
|
+
registerOnChange(callback) {
|
|
7809
|
+
this.onChange = callback;
|
|
7810
|
+
}
|
|
7811
|
+
registerOnTouched(callback) {
|
|
7812
|
+
this.onTouched = callback;
|
|
7813
|
+
}
|
|
7814
|
+
setDisabledState(isDisabled) {
|
|
7815
|
+
this.disabled.set(isDisabled);
|
|
7556
7816
|
}
|
|
7557
7817
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiNumberInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7558
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: BuiNumberInput, isStandalone: true, selector: "bui-number-input", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, stepBy: { classPropertyName: "stepBy", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { attributes: { "data-slot": "number-input" }, properties: { "class": "computedClass()" } },
|
|
7818
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: BuiNumberInput, isStandalone: true, selector: "bui-number-input", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, stepBy: { classPropertyName: "stepBy", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", disabled: "disabledChange" }, host: { attributes: { "data-slot": "number-input" }, properties: { "class": "computedClass()" } }, providers: [
|
|
7819
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiNumberInput), multi: true },
|
|
7820
|
+
], ngImport: i0, template: `
|
|
7559
7821
|
<button
|
|
7560
7822
|
type="button"
|
|
7561
7823
|
[class]="btnClass() + ' rounded-l-md'"
|
|
@@ -7587,6 +7849,7 @@ class BuiNumberInput {
|
|
|
7587
7849
|
[class]="inputClass()"
|
|
7588
7850
|
(input)="onInput($event)"
|
|
7589
7851
|
(change)="onInput($event)"
|
|
7852
|
+
(blur)="onTouched()"
|
|
7590
7853
|
/>
|
|
7591
7854
|
<button
|
|
7592
7855
|
type="button"
|
|
@@ -7615,6 +7878,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
7615
7878
|
args: [{
|
|
7616
7879
|
selector: 'bui-number-input',
|
|
7617
7880
|
host: { 'data-slot': 'number-input', '[class]': 'computedClass()' },
|
|
7881
|
+
providers: [
|
|
7882
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiNumberInput), multi: true },
|
|
7883
|
+
],
|
|
7618
7884
|
template: `
|
|
7619
7885
|
<button
|
|
7620
7886
|
type="button"
|
|
@@ -7647,6 +7913,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
7647
7913
|
[class]="inputClass()"
|
|
7648
7914
|
(input)="onInput($event)"
|
|
7649
7915
|
(change)="onInput($event)"
|
|
7916
|
+
(blur)="onTouched()"
|
|
7650
7917
|
/>
|
|
7651
7918
|
<button
|
|
7652
7919
|
type="button"
|
|
@@ -7670,7 +7937,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
7670
7937
|
</button>
|
|
7671
7938
|
`,
|
|
7672
7939
|
}]
|
|
7673
|
-
}], 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 }] }], stepBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
7940
|
+
}], 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 }] }], stepBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
7674
7941
|
|
|
7675
7942
|
/** A radio-group of product variants, rendered as pills or colour swatches. */
|
|
7676
7943
|
class BuiVariantSelector {
|
|
@@ -9167,6 +9434,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
9167
9434
|
}]
|
|
9168
9435
|
}], ctorParameters: () => [], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
9169
9436
|
|
|
9437
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
9438
|
+
const noop$8 = () => { };
|
|
9170
9439
|
const SELECT_CLASS = 'h-9 rounded-md border border-input bg-background px-2 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50';
|
|
9171
9440
|
/** A styled time field: a native `<input type="time">`, or hour/minute selects in `select` mode. */
|
|
9172
9441
|
class BuiTimeField {
|
|
@@ -9182,7 +9451,7 @@ class BuiTimeField {
|
|
|
9182
9451
|
...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
|
|
9183
9452
|
seconds = input(false, /* @ts-ignore */
|
|
9184
9453
|
...(ngDevMode ? [{ debugName: "seconds" }] : /* istanbul ignore next */ []));
|
|
9185
|
-
disabled =
|
|
9454
|
+
disabled = model(false, /* @ts-ignore */
|
|
9186
9455
|
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
9187
9456
|
/** `select` renders hour + minute dropdowns instead of a native time input. */
|
|
9188
9457
|
mode = input('input', /* @ts-ignore */
|
|
@@ -9193,6 +9462,8 @@ class BuiTimeField {
|
|
|
9193
9462
|
ariaLabel = input('', /* @ts-ignore */
|
|
9194
9463
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
9195
9464
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
9465
|
+
onChange = noop$8;
|
|
9466
|
+
onTouched = noop$8;
|
|
9196
9467
|
selectClass = SELECT_CLASS;
|
|
9197
9468
|
hourPart = computed(() => (this.value().split(':', 1)[0] || '12').padStart(2, '0'), /* @ts-ignore */
|
|
9198
9469
|
...(ngDevMode ? [{ debugName: "hourPart" }] : /* istanbul ignore next */ []));
|
|
@@ -9209,15 +9480,32 @@ class BuiTimeField {
|
|
|
9209
9480
|
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
9210
9481
|
onInput(event) {
|
|
9211
9482
|
this.value.set(event.target.value);
|
|
9483
|
+
this.onChange(this.value());
|
|
9212
9484
|
}
|
|
9213
9485
|
setHour(event) {
|
|
9214
9486
|
this.value.set(`${event.target.value}:${this.minutePart()}`);
|
|
9487
|
+
this.onChange(this.value());
|
|
9215
9488
|
}
|
|
9216
9489
|
setMinute(event) {
|
|
9217
9490
|
this.value.set(`${this.hourPart()}:${event.target.value}`);
|
|
9491
|
+
this.onChange(this.value());
|
|
9492
|
+
}
|
|
9493
|
+
writeValue(value) {
|
|
9494
|
+
this.value.set(typeof value === 'string' ? value : '');
|
|
9495
|
+
}
|
|
9496
|
+
registerOnChange(callback) {
|
|
9497
|
+
this.onChange = callback;
|
|
9498
|
+
}
|
|
9499
|
+
registerOnTouched(callback) {
|
|
9500
|
+
this.onTouched = callback;
|
|
9501
|
+
}
|
|
9502
|
+
setDisabledState(isDisabled) {
|
|
9503
|
+
this.disabled.set(isDisabled);
|
|
9218
9504
|
}
|
|
9219
9505
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiTimeField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9220
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiTimeField, isStandalone: true, selector: "bui-time-field", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, seconds: { classPropertyName: "seconds", publicName: "seconds", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, minuteStep: { classPropertyName: "minuteStep", publicName: "minuteStep", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { attributes: { "data-slot": "time-field" }, properties: { "class": "computedClass()" } },
|
|
9506
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiTimeField, isStandalone: true, selector: "bui-time-field", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, seconds: { classPropertyName: "seconds", publicName: "seconds", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, minuteStep: { classPropertyName: "minuteStep", publicName: "minuteStep", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", disabled: "disabledChange" }, host: { attributes: { "data-slot": "time-field" }, listeners: { "focusout": "onTouched()" }, properties: { "class": "computedClass()" } }, providers: [
|
|
9507
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiTimeField), multi: true },
|
|
9508
|
+
], ngImport: i0, template: `
|
|
9221
9509
|
@if (mode() === 'select') {
|
|
9222
9510
|
<div class="inline-flex items-center gap-1">
|
|
9223
9511
|
<select
|
|
@@ -9265,7 +9553,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
9265
9553
|
type: Component,
|
|
9266
9554
|
args: [{
|
|
9267
9555
|
selector: 'bui-time-field',
|
|
9268
|
-
host: {
|
|
9556
|
+
host: {
|
|
9557
|
+
'data-slot': 'time-field',
|
|
9558
|
+
'[class]': 'computedClass()',
|
|
9559
|
+
'(focusout)': 'onTouched()',
|
|
9560
|
+
},
|
|
9561
|
+
providers: [
|
|
9562
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiTimeField), multi: true },
|
|
9563
|
+
],
|
|
9269
9564
|
template: `
|
|
9270
9565
|
@if (mode() === 'select') {
|
|
9271
9566
|
<div class="inline-flex items-center gap-1">
|
|
@@ -9310,7 +9605,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
9310
9605
|
}
|
|
9311
9606
|
`,
|
|
9312
9607
|
}]
|
|
9313
|
-
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], seconds: [{ type: i0.Input, args: [{ isSignal: true, alias: "seconds", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], minuteStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "minuteStep", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
9608
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], seconds: [{ type: i0.Input, args: [{ isSignal: true, alias: "seconds", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], minuteStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "minuteStep", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
9314
9609
|
|
|
9315
9610
|
/** A group of toggle buttons (single or multiple selection). Use `button[buiToggleGroupItem]`. */
|
|
9316
9611
|
class BuiToggleGroup {
|
|
@@ -9393,6 +9688,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
9393
9688
|
}]
|
|
9394
9689
|
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
9395
9690
|
|
|
9691
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
9692
|
+
const noop$7 = () => { };
|
|
9396
9693
|
/** A free-text tags input: type and press Enter (or comma) to add chips; Backspace removes. */
|
|
9397
9694
|
class BuiTagsInput {
|
|
9398
9695
|
tags = model([], /* @ts-ignore */
|
|
@@ -9401,9 +9698,11 @@ class BuiTagsInput {
|
|
|
9401
9698
|
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
9402
9699
|
max = input(null, /* @ts-ignore */
|
|
9403
9700
|
...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
|
|
9404
|
-
disabled =
|
|
9701
|
+
disabled = model(false, /* @ts-ignore */
|
|
9405
9702
|
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
9406
9703
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
9704
|
+
onChange = noop$7;
|
|
9705
|
+
onTouched = noop$7;
|
|
9407
9706
|
draft = signal('', /* @ts-ignore */
|
|
9408
9707
|
...(ngDevMode ? [{ debugName: "draft" }] : /* istanbul ignore next */ []));
|
|
9409
9708
|
atMax = computed(() => {
|
|
@@ -9430,6 +9729,7 @@ class BuiTagsInput {
|
|
|
9430
9729
|
const next = [...this.tags()];
|
|
9431
9730
|
next.splice(index, 1);
|
|
9432
9731
|
this.tags.set(next);
|
|
9732
|
+
this.onChange(next);
|
|
9433
9733
|
}
|
|
9434
9734
|
add() {
|
|
9435
9735
|
const value = this.draft().trim();
|
|
@@ -9437,10 +9737,26 @@ class BuiTagsInput {
|
|
|
9437
9737
|
if (value === '' || this.atMax() || this.tags().includes(value)) {
|
|
9438
9738
|
return;
|
|
9439
9739
|
}
|
|
9440
|
-
|
|
9740
|
+
const next = [...this.tags(), value];
|
|
9741
|
+
this.tags.set(next);
|
|
9742
|
+
this.onChange(next);
|
|
9743
|
+
}
|
|
9744
|
+
writeValue(value) {
|
|
9745
|
+
this.tags.set(Array.isArray(value) ? [...value] : []);
|
|
9746
|
+
}
|
|
9747
|
+
registerOnChange(callback) {
|
|
9748
|
+
this.onChange = callback;
|
|
9749
|
+
}
|
|
9750
|
+
registerOnTouched(callback) {
|
|
9751
|
+
this.onTouched = callback;
|
|
9752
|
+
}
|
|
9753
|
+
setDisabledState(isDisabled) {
|
|
9754
|
+
this.disabled.set(isDisabled);
|
|
9441
9755
|
}
|
|
9442
9756
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiTagsInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9443
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiTagsInput, isStandalone: true, selector: "bui-tags-input", inputs: { tags: { classPropertyName: "tags", publicName: "tags", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", 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: { tags: "tagsChange" }, host: { attributes: { "data-slot": "tags-input" }, properties: { "class": "computedClass()" } },
|
|
9757
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiTagsInput, isStandalone: true, selector: "bui-tags-input", inputs: { tags: { classPropertyName: "tags", publicName: "tags", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", 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: { tags: "tagsChange", disabled: "disabledChange" }, host: { attributes: { "data-slot": "tags-input" }, listeners: { "focusout": "onTouched()" }, properties: { "class": "computedClass()" } }, providers: [
|
|
9758
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiTagsInput), multi: true },
|
|
9759
|
+
], ngImport: i0, template: `
|
|
9444
9760
|
@for (tag of tags(); track tag; let i = $index) {
|
|
9445
9761
|
<span
|
|
9446
9762
|
class="inline-flex items-center gap-1 rounded bg-secondary px-2 py-0.5 text-sm text-secondary-foreground"
|
|
@@ -9471,7 +9787,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
9471
9787
|
type: Component,
|
|
9472
9788
|
args: [{
|
|
9473
9789
|
selector: 'bui-tags-input',
|
|
9474
|
-
host: { 'data-slot': 'tags-input', '[class]': 'computedClass()' },
|
|
9790
|
+
host: { 'data-slot': 'tags-input', '[class]': 'computedClass()', '(focusout)': 'onTouched()' },
|
|
9791
|
+
providers: [
|
|
9792
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiTagsInput), multi: true },
|
|
9793
|
+
],
|
|
9475
9794
|
template: `
|
|
9476
9795
|
@for (tag of tags(); track tag; let i = $index) {
|
|
9477
9796
|
<span
|
|
@@ -9499,7 +9818,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
9499
9818
|
/>
|
|
9500
9819
|
`,
|
|
9501
9820
|
}]
|
|
9502
|
-
}], propDecorators: { tags: [{ type: i0.Input, args: [{ isSignal: true, alias: "tags", required: false }] }, { type: i0.Output, args: ["tagsChange"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
9821
|
+
}], propDecorators: { tags: [{ type: i0.Input, args: [{ isSignal: true, alias: "tags", required: false }] }, { type: i0.Output, args: ["tagsChange"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
9503
9822
|
|
|
9504
9823
|
/** Click-to-edit inline text: shows a value, swaps to an input on click. Enter commits, Escape cancels. */
|
|
9505
9824
|
class BuiEditable {
|
|
@@ -9755,6 +10074,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
9755
10074
|
}]
|
|
9756
10075
|
}], propDecorators: { actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: false }] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
9757
10076
|
|
|
10077
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
10078
|
+
const noop$6 = () => { };
|
|
9758
10079
|
const DIMS = {
|
|
9759
10080
|
sm: { box: 'size-16', text: 'text-sm' },
|
|
9760
10081
|
default: { box: 'size-24', text: 'text-base' },
|
|
@@ -9777,9 +10098,11 @@ class BuiKnob {
|
|
|
9777
10098
|
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
9778
10099
|
label = input('Value', /* @ts-ignore */
|
|
9779
10100
|
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
9780
|
-
disabled =
|
|
10101
|
+
disabled = model(false, /* @ts-ignore */
|
|
9781
10102
|
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
9782
10103
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
10104
|
+
onChange = noop$6;
|
|
10105
|
+
onTouched = noop$6;
|
|
9783
10106
|
radius = RADIUS;
|
|
9784
10107
|
dashArray = `${ARC} ${CIRC}`;
|
|
9785
10108
|
dragging = false;
|
|
@@ -9840,19 +10163,19 @@ class BuiKnob {
|
|
|
9840
10163
|
break;
|
|
9841
10164
|
}
|
|
9842
10165
|
case 'Home': {
|
|
9843
|
-
this.
|
|
10166
|
+
this.commit(this.min());
|
|
9844
10167
|
break;
|
|
9845
10168
|
}
|
|
9846
10169
|
case 'End': {
|
|
9847
|
-
this.
|
|
10170
|
+
this.commit(this.max());
|
|
9848
10171
|
break;
|
|
9849
10172
|
}
|
|
9850
10173
|
case 'PageUp': {
|
|
9851
|
-
this.
|
|
10174
|
+
this.commit(this.clamp(this.value() + this.bigStep()));
|
|
9852
10175
|
break;
|
|
9853
10176
|
}
|
|
9854
10177
|
case 'PageDown': {
|
|
9855
|
-
this.
|
|
10178
|
+
this.commit(this.clamp(this.value() - this.bigStep()));
|
|
9856
10179
|
break;
|
|
9857
10180
|
}
|
|
9858
10181
|
default: {
|
|
@@ -9873,10 +10196,10 @@ class BuiKnob {
|
|
|
9873
10196
|
const cy = rect.top + rect.height / 2;
|
|
9874
10197
|
const angle = (Math.atan2(event.clientX - cx, cy - event.clientY) * 180) / Math.PI;
|
|
9875
10198
|
const ratio = Math.min(1, Math.max(0, (angle + 135) / 270));
|
|
9876
|
-
this.
|
|
10199
|
+
this.commit(this.snap(this.min() + ratio * (this.max() - this.min())));
|
|
9877
10200
|
}
|
|
9878
10201
|
bump(direction) {
|
|
9879
|
-
this.
|
|
10202
|
+
this.commit(this.clamp(this.value() + direction * this.step()));
|
|
9880
10203
|
}
|
|
9881
10204
|
bigStep() {
|
|
9882
10205
|
return Math.max(this.step(), (this.max() - this.min()) / 10);
|
|
@@ -9888,8 +10211,24 @@ class BuiKnob {
|
|
|
9888
10211
|
const snapped = Math.round((value - this.min()) / this.step()) * this.step() + this.min();
|
|
9889
10212
|
return Number.parseFloat(this.clamp(snapped).toFixed(6));
|
|
9890
10213
|
}
|
|
10214
|
+
commit(value) {
|
|
10215
|
+
this.value.set(value);
|
|
10216
|
+
this.onChange(value);
|
|
10217
|
+
}
|
|
10218
|
+
writeValue(value) {
|
|
10219
|
+
this.value.set(typeof value === 'number' ? value : 0);
|
|
10220
|
+
}
|
|
10221
|
+
registerOnChange(callback) {
|
|
10222
|
+
this.onChange = callback;
|
|
10223
|
+
}
|
|
10224
|
+
registerOnTouched(callback) {
|
|
10225
|
+
this.onTouched = callback;
|
|
10226
|
+
}
|
|
10227
|
+
setDisabledState(isDisabled) {
|
|
10228
|
+
this.disabled.set(isDisabled);
|
|
10229
|
+
}
|
|
9891
10230
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiKnob, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9892
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: BuiKnob, isStandalone: true, selector: "bui-knob", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", 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": "knob" }, listeners: { "document:pointermove": "onMove($event)", "document:pointerup": "onUp()" }, properties: { "class": "computedClass()" } }, ngImport: i0, template: `
|
|
10231
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: BuiKnob, isStandalone: true, selector: "bui-knob", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", 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", disabled: "disabledChange" }, host: { attributes: { "data-slot": "knob" }, listeners: { "document:pointermove": "onMove($event)", "document:pointerup": "onUp()", "focusout": "onTouched()" }, properties: { "class": "computedClass()" } }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiKnob), multi: true }], ngImport: i0, template: `
|
|
9893
10232
|
<div
|
|
9894
10233
|
role="slider"
|
|
9895
10234
|
[attr.aria-valuemin]="min()"
|
|
@@ -9947,7 +10286,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
9947
10286
|
'[class]': 'computedClass()',
|
|
9948
10287
|
'(document:pointermove)': 'onMove($event)',
|
|
9949
10288
|
'(document:pointerup)': 'onUp()',
|
|
10289
|
+
'(focusout)': 'onTouched()',
|
|
9950
10290
|
},
|
|
10291
|
+
providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiKnob), multi: true }],
|
|
9951
10292
|
template: `
|
|
9952
10293
|
<div
|
|
9953
10294
|
role="slider"
|
|
@@ -9997,7 +10338,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
9997
10338
|
</div>
|
|
9998
10339
|
`,
|
|
9999
10340
|
}]
|
|
10000
|
-
}], 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 }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
10341
|
+
}], 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 }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
10001
10342
|
|
|
10002
10343
|
/** A lazy image with a blurred placeholder / skeleton and a graceful error state. */
|
|
10003
10344
|
class BuiImage {
|
|
@@ -10686,13 +11027,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
10686
11027
|
}]
|
|
10687
11028
|
}], propDecorators: { step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
10688
11029
|
|
|
11030
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
11031
|
+
const noop$5 = () => { };
|
|
10689
11032
|
/** A one-time-password input: a row of single-character boxes with focus management + paste. */
|
|
10690
11033
|
class BuiInputOtp {
|
|
10691
11034
|
value = model('', /* @ts-ignore */
|
|
10692
11035
|
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
10693
11036
|
maxlength = input(6, /* @ts-ignore */
|
|
10694
11037
|
...(ngDevMode ? [{ debugName: "maxlength" }] : /* istanbul ignore next */ []));
|
|
10695
|
-
disabled =
|
|
11038
|
+
disabled = model(false, /* @ts-ignore */
|
|
10696
11039
|
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
10697
11040
|
alphanumeric = input(false, /* @ts-ignore */
|
|
10698
11041
|
...(ngDevMode ? [{ debugName: "alphanumeric" }] : /* istanbul ignore next */ []));
|
|
@@ -10702,6 +11045,8 @@ class BuiInputOtp {
|
|
|
10702
11045
|
ariaLabel = input('One-time password', /* @ts-ignore */
|
|
10703
11046
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
10704
11047
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
11048
|
+
onChange = noop$5;
|
|
11049
|
+
onTouched = noop$5;
|
|
10705
11050
|
host = inject(ElementRef);
|
|
10706
11051
|
slots = computed(() => Array.from({ length: this.maxlength() }, (_, index) => index), /* @ts-ignore */
|
|
10707
11052
|
...(ngDevMode ? [{ debugName: "slots" }] : /* istanbul ignore next */ []));
|
|
@@ -10719,6 +11064,7 @@ class BuiInputOtp {
|
|
|
10719
11064
|
const char = this.sanitize(element.value).slice(-1);
|
|
10720
11065
|
const next = (this.value().slice(0, index) + char + this.value().slice(index + 1)).slice(0, this.maxlength());
|
|
10721
11066
|
this.value.set(next);
|
|
11067
|
+
this.onChange(next);
|
|
10722
11068
|
element.value = char;
|
|
10723
11069
|
if (char !== '' && index < this.maxlength() - 1) {
|
|
10724
11070
|
this.focusBox(index + 1);
|
|
@@ -10741,11 +11087,24 @@ class BuiInputOtp {
|
|
|
10741
11087
|
event.preventDefault();
|
|
10742
11088
|
const text = this.sanitize(event.clipboardData?.getData('text') ?? '').slice(0, this.maxlength());
|
|
10743
11089
|
this.value.set(text);
|
|
11090
|
+
this.onChange(text);
|
|
10744
11091
|
this.focusBox(Math.min(text.length, this.maxlength() - 1));
|
|
10745
11092
|
}
|
|
10746
11093
|
onFocus(event) {
|
|
10747
11094
|
event.target.select();
|
|
10748
11095
|
}
|
|
11096
|
+
writeValue(value) {
|
|
11097
|
+
this.value.set(typeof value === 'string' ? value : '');
|
|
11098
|
+
}
|
|
11099
|
+
registerOnChange(callback) {
|
|
11100
|
+
this.onChange = callback;
|
|
11101
|
+
}
|
|
11102
|
+
registerOnTouched(callback) {
|
|
11103
|
+
this.onTouched = callback;
|
|
11104
|
+
}
|
|
11105
|
+
setDisabledState(isDisabled) {
|
|
11106
|
+
this.disabled.set(isDisabled);
|
|
11107
|
+
}
|
|
10749
11108
|
sanitize(raw) {
|
|
10750
11109
|
return this.alphanumeric() ? raw.replaceAll(/[^a-zA-Z0-9]/g, '') : raw.replaceAll(/\D/g, '');
|
|
10751
11110
|
}
|
|
@@ -10754,7 +11113,9 @@ class BuiInputOtp {
|
|
|
10754
11113
|
boxes.item(index).focus();
|
|
10755
11114
|
}
|
|
10756
11115
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiInputOtp, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10757
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiInputOtp, isStandalone: true, selector: "bui-input-otp", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, maxlength: { classPropertyName: "maxlength", publicName: "maxlength", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, alphanumeric: { classPropertyName: "alphanumeric", publicName: "alphanumeric", isSignal: true, isRequired: false, transformFunction: null }, groupSize: { classPropertyName: "groupSize", publicName: "groupSize", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { attributes: { "data-slot": "input-otp" }, properties: { "class": "computedClass()" } },
|
|
11116
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiInputOtp, isStandalone: true, selector: "bui-input-otp", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, maxlength: { classPropertyName: "maxlength", publicName: "maxlength", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, alphanumeric: { classPropertyName: "alphanumeric", publicName: "alphanumeric", isSignal: true, isRequired: false, transformFunction: null }, groupSize: { classPropertyName: "groupSize", publicName: "groupSize", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", disabled: "disabledChange" }, host: { attributes: { "data-slot": "input-otp" }, listeners: { "focusout": "onTouched()" }, properties: { "class": "computedClass()" } }, providers: [
|
|
11117
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiInputOtp), multi: true },
|
|
11118
|
+
], ngImport: i0, template: `
|
|
10758
11119
|
@for (slot of slots(); track slot) {
|
|
10759
11120
|
<input
|
|
10760
11121
|
type="text"
|
|
@@ -10780,7 +11141,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
10780
11141
|
type: Component,
|
|
10781
11142
|
args: [{
|
|
10782
11143
|
selector: 'bui-input-otp',
|
|
10783
|
-
host: { 'data-slot': 'input-otp', '[class]': 'computedClass()' },
|
|
11144
|
+
host: { 'data-slot': 'input-otp', '[class]': 'computedClass()', '(focusout)': 'onTouched()' },
|
|
11145
|
+
providers: [
|
|
11146
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiInputOtp), multi: true },
|
|
11147
|
+
],
|
|
10784
11148
|
template: `
|
|
10785
11149
|
@for (slot of slots(); track slot) {
|
|
10786
11150
|
<input
|
|
@@ -10803,7 +11167,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
10803
11167
|
}
|
|
10804
11168
|
`,
|
|
10805
11169
|
}]
|
|
10806
|
-
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], maxlength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxlength", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], alphanumeric: [{ type: i0.Input, args: [{ isSignal: true, alias: "alphanumeric", required: false }] }], groupSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupSize", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
11170
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], maxlength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxlength", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], alphanumeric: [{ type: i0.Input, args: [{ isSignal: true, alias: "alphanumeric", required: false }] }], groupSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupSize", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
10807
11171
|
|
|
10808
11172
|
const COUNTRIES = [
|
|
10809
11173
|
{ code: 'US', name: 'United States', dial: '+1', flag: '🇺🇸' },
|
|
@@ -13839,6 +14203,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
13839
14203
|
}]
|
|
13840
14204
|
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
13841
14205
|
|
|
14206
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
14207
|
+
const noop$4 = () => { };
|
|
13842
14208
|
const WEEKDAYS = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'];
|
|
13843
14209
|
function pad(value) {
|
|
13844
14210
|
return String(value).padStart(2, '0');
|
|
@@ -13886,7 +14252,11 @@ class BuiCalendar {
|
|
|
13886
14252
|
/** Hide days that fall outside the current month. */
|
|
13887
14253
|
hideOutsideDays = input(false, /* @ts-ignore */
|
|
13888
14254
|
...(ngDevMode ? [{ debugName: "hideOutsideDays" }] : /* istanbul ignore next */ []));
|
|
14255
|
+
disabled = model(false, /* @ts-ignore */
|
|
14256
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
13889
14257
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
14258
|
+
onChange = noop$4;
|
|
14259
|
+
onTouched = noop$4;
|
|
13890
14260
|
view = signal(new Date(new Date().getFullYear(), new Date().getMonth(), 1), /* @ts-ignore */
|
|
13891
14261
|
...(ngDevMode ? [{ debugName: "view" }] : /* istanbul ignore next */ []));
|
|
13892
14262
|
weekdays = computed(() => {
|
|
@@ -13971,6 +14341,19 @@ class BuiCalendar {
|
|
|
13971
14341
|
return;
|
|
13972
14342
|
}
|
|
13973
14343
|
this.value.set(iso);
|
|
14344
|
+
this.onChange(iso);
|
|
14345
|
+
}
|
|
14346
|
+
writeValue(value) {
|
|
14347
|
+
this.value.set(typeof value === 'string' ? value : '');
|
|
14348
|
+
}
|
|
14349
|
+
registerOnChange(callback) {
|
|
14350
|
+
this.onChange = callback;
|
|
14351
|
+
}
|
|
14352
|
+
registerOnTouched(callback) {
|
|
14353
|
+
this.onTouched = callback;
|
|
14354
|
+
}
|
|
14355
|
+
setDisabledState(isDisabled) {
|
|
14356
|
+
this.disabled.set(isDisabled);
|
|
13974
14357
|
}
|
|
13975
14358
|
isSelected(iso) {
|
|
13976
14359
|
if (iso === '') {
|
|
@@ -14038,7 +14421,9 @@ class BuiCalendar {
|
|
|
14038
14421
|
return false;
|
|
14039
14422
|
}
|
|
14040
14423
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiCalendar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
14041
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiCalendar, isStandalone: true, selector: "bui-calendar", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, range: { classPropertyName: "range", publicName: "range", isSignal: true, isRequired: false, transformFunction: null }, values: { classPropertyName: "values", publicName: "values", isSignal: true, isRequired: false, transformFunction: null }, months: { classPropertyName: "months", publicName: "months", isSignal: true, isRequired: false, transformFunction: null }, weekStart: { classPropertyName: "weekStart", publicName: "weekStart", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, disabledDates: { classPropertyName: "disabledDates", publicName: "disabledDates", isSignal: true, isRequired: false, transformFunction: null }, disableWeekends: { classPropertyName: "disableWeekends", publicName: "disableWeekends", isSignal: true, isRequired: false, transformFunction: null }, showWeekNumbers: { classPropertyName: "showWeekNumbers", publicName: "showWeekNumbers", isSignal: true, isRequired: false, transformFunction: null }, captionLayout: { classPropertyName: "captionLayout", publicName: "captionLayout", isSignal: true, isRequired: false, transformFunction: null }, hideOutsideDays: { classPropertyName: "hideOutsideDays", publicName: "hideOutsideDays", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", range: "rangeChange", values: "valuesChange" }, host: { attributes: { "data-slot": "calendar" }, properties: { "class": "computedClass()" } },
|
|
14424
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiCalendar, isStandalone: true, selector: "bui-calendar", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, range: { classPropertyName: "range", publicName: "range", isSignal: true, isRequired: false, transformFunction: null }, values: { classPropertyName: "values", publicName: "values", isSignal: true, isRequired: false, transformFunction: null }, months: { classPropertyName: "months", publicName: "months", isSignal: true, isRequired: false, transformFunction: null }, weekStart: { classPropertyName: "weekStart", publicName: "weekStart", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, disabledDates: { classPropertyName: "disabledDates", publicName: "disabledDates", isSignal: true, isRequired: false, transformFunction: null }, disableWeekends: { classPropertyName: "disableWeekends", publicName: "disableWeekends", isSignal: true, isRequired: false, transformFunction: null }, showWeekNumbers: { classPropertyName: "showWeekNumbers", publicName: "showWeekNumbers", isSignal: true, isRequired: false, transformFunction: null }, captionLayout: { classPropertyName: "captionLayout", publicName: "captionLayout", isSignal: true, isRequired: false, transformFunction: null }, hideOutsideDays: { classPropertyName: "hideOutsideDays", publicName: "hideOutsideDays", 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", range: "rangeChange", values: "valuesChange", disabled: "disabledChange" }, host: { attributes: { "data-slot": "calendar" }, listeners: { "focusout": "onTouched()" }, properties: { "class": "computedClass()" } }, providers: [
|
|
14425
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiCalendar), multi: true },
|
|
14426
|
+
], ngImport: i0, template: `
|
|
14042
14427
|
<div class="flex items-center justify-between pb-2">
|
|
14043
14428
|
<button
|
|
14044
14429
|
type="button"
|
|
@@ -14145,7 +14530,7 @@ class BuiCalendar {
|
|
|
14145
14530
|
[class]="dayClass(day)"
|
|
14146
14531
|
[attr.aria-pressed]="isSelected(day.iso)"
|
|
14147
14532
|
[attr.aria-current]="day.isToday ? 'date' : null"
|
|
14148
|
-
[disabled]="day.disabled"
|
|
14533
|
+
[disabled]="day.disabled || disabled()"
|
|
14149
14534
|
(click)="select(day.iso)"
|
|
14150
14535
|
>
|
|
14151
14536
|
{{ day.num }}
|
|
@@ -14168,7 +14553,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
14168
14553
|
type: Component,
|
|
14169
14554
|
args: [{
|
|
14170
14555
|
selector: 'bui-calendar',
|
|
14171
|
-
host: { 'data-slot': 'calendar', '[class]': 'computedClass()' },
|
|
14556
|
+
host: { 'data-slot': 'calendar', '[class]': 'computedClass()', '(focusout)': 'onTouched()' },
|
|
14557
|
+
providers: [
|
|
14558
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiCalendar), multi: true },
|
|
14559
|
+
],
|
|
14172
14560
|
template: `
|
|
14173
14561
|
<div class="flex items-center justify-between pb-2">
|
|
14174
14562
|
<button
|
|
@@ -14276,7 +14664,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
14276
14664
|
[class]="dayClass(day)"
|
|
14277
14665
|
[attr.aria-pressed]="isSelected(day.iso)"
|
|
14278
14666
|
[attr.aria-current]="day.isToday ? 'date' : null"
|
|
14279
|
-
[disabled]="day.disabled"
|
|
14667
|
+
[disabled]="day.disabled || disabled()"
|
|
14280
14668
|
(click)="select(day.iso)"
|
|
14281
14669
|
>
|
|
14282
14670
|
{{ day.num }}
|
|
@@ -14295,8 +14683,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
14295
14683
|
</div>
|
|
14296
14684
|
`,
|
|
14297
14685
|
}]
|
|
14298
|
-
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], range: [{ type: i0.Input, args: [{ isSignal: true, alias: "range", required: false }] }, { type: i0.Output, args: ["rangeChange"] }], values: [{ type: i0.Input, args: [{ isSignal: true, alias: "values", required: false }] }, { type: i0.Output, args: ["valuesChange"] }], months: [{ type: i0.Input, args: [{ isSignal: true, alias: "months", required: false }] }], weekStart: [{ type: i0.Input, args: [{ isSignal: true, alias: "weekStart", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], disabledDates: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledDates", required: false }] }], disableWeekends: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableWeekends", required: false }] }], showWeekNumbers: [{ type: i0.Input, args: [{ isSignal: true, alias: "showWeekNumbers", required: false }] }], captionLayout: [{ type: i0.Input, args: [{ isSignal: true, alias: "captionLayout", required: false }] }], hideOutsideDays: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideOutsideDays", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
14686
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], range: [{ type: i0.Input, args: [{ isSignal: true, alias: "range", required: false }] }, { type: i0.Output, args: ["rangeChange"] }], values: [{ type: i0.Input, args: [{ isSignal: true, alias: "values", required: false }] }, { type: i0.Output, args: ["valuesChange"] }], months: [{ type: i0.Input, args: [{ isSignal: true, alias: "months", required: false }] }], weekStart: [{ type: i0.Input, args: [{ isSignal: true, alias: "weekStart", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], disabledDates: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledDates", required: false }] }], disableWeekends: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableWeekends", required: false }] }], showWeekNumbers: [{ type: i0.Input, args: [{ isSignal: true, alias: "showWeekNumbers", required: false }] }], captionLayout: [{ type: i0.Input, args: [{ isSignal: true, alias: "captionLayout", required: false }] }], hideOutsideDays: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideOutsideDays", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
14299
14687
|
|
|
14688
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
14689
|
+
const noop$3 = () => { };
|
|
14300
14690
|
/** A date input that opens a calendar popover. */
|
|
14301
14691
|
class BuiDatePicker {
|
|
14302
14692
|
value = model('', /* @ts-ignore */
|
|
@@ -14328,7 +14718,11 @@ class BuiDatePicker {
|
|
|
14328
14718
|
...(ngDevMode ? [{ debugName: "captionLayout" }] : /* istanbul ignore next */ []));
|
|
14329
14719
|
hideOutsideDays = input(false, /* @ts-ignore */
|
|
14330
14720
|
...(ngDevMode ? [{ debugName: "hideOutsideDays" }] : /* istanbul ignore next */ []));
|
|
14721
|
+
disabled = model(false, /* @ts-ignore */
|
|
14722
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
14331
14723
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
14724
|
+
onChange = noop$3;
|
|
14725
|
+
onTouched = noop$3;
|
|
14332
14726
|
host = inject(ElementRef);
|
|
14333
14727
|
open = signal(false, /* @ts-ignore */
|
|
14334
14728
|
...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
@@ -14350,7 +14744,9 @@ class BuiDatePicker {
|
|
|
14350
14744
|
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
14351
14745
|
onPick(iso) {
|
|
14352
14746
|
this.value.set(iso);
|
|
14747
|
+
this.onChange(iso);
|
|
14353
14748
|
this.open.set(false);
|
|
14749
|
+
this.onTouched();
|
|
14354
14750
|
}
|
|
14355
14751
|
onRange(range) {
|
|
14356
14752
|
this.range.set(range);
|
|
@@ -14366,16 +14762,33 @@ class BuiDatePicker {
|
|
|
14366
14762
|
});
|
|
14367
14763
|
}
|
|
14368
14764
|
onDocumentClick(event) {
|
|
14369
|
-
if (this.open() && !this.host.nativeElement.contains(event.target)) {
|
|
14370
|
-
|
|
14765
|
+
if (!(this.open() && !this.host.nativeElement.contains(event.target))) {
|
|
14766
|
+
return;
|
|
14371
14767
|
}
|
|
14768
|
+
this.open.set(false);
|
|
14769
|
+
this.onTouched();
|
|
14770
|
+
}
|
|
14771
|
+
writeValue(value) {
|
|
14772
|
+
this.value.set(typeof value === 'string' ? value : '');
|
|
14773
|
+
}
|
|
14774
|
+
registerOnChange(callback) {
|
|
14775
|
+
this.onChange = callback;
|
|
14776
|
+
}
|
|
14777
|
+
registerOnTouched(callback) {
|
|
14778
|
+
this.onTouched = callback;
|
|
14779
|
+
}
|
|
14780
|
+
setDisabledState(isDisabled) {
|
|
14781
|
+
this.disabled.set(isDisabled);
|
|
14372
14782
|
}
|
|
14373
14783
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiDatePicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
14374
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiDatePicker, isStandalone: true, selector: "bui-date-picker", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, range: { classPropertyName: "range", publicName: "range", isSignal: true, isRequired: false, transformFunction: null }, months: { classPropertyName: "months", publicName: "months", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, weekStart: { classPropertyName: "weekStart", publicName: "weekStart", isSignal: true, isRequired: false, transformFunction: null }, disabledDates: { classPropertyName: "disabledDates", publicName: "disabledDates", isSignal: true, isRequired: false, transformFunction: null }, disableWeekends: { classPropertyName: "disableWeekends", publicName: "disableWeekends", isSignal: true, isRequired: false, transformFunction: null }, showWeekNumbers: { classPropertyName: "showWeekNumbers", publicName: "showWeekNumbers", isSignal: true, isRequired: false, transformFunction: null }, captionLayout: { classPropertyName: "captionLayout", publicName: "captionLayout", isSignal: true, isRequired: false, transformFunction: null }, hideOutsideDays: { classPropertyName: "hideOutsideDays", publicName: "hideOutsideDays", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", range: "rangeChange" }, host: { attributes: { "data-slot": "date-picker" }, listeners: { "document:click": "onDocumentClick($event)" }, properties: { "class": "computedClass()" } },
|
|
14784
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiDatePicker, isStandalone: true, selector: "bui-date-picker", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, range: { classPropertyName: "range", publicName: "range", isSignal: true, isRequired: false, transformFunction: null }, months: { classPropertyName: "months", publicName: "months", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, weekStart: { classPropertyName: "weekStart", publicName: "weekStart", isSignal: true, isRequired: false, transformFunction: null }, disabledDates: { classPropertyName: "disabledDates", publicName: "disabledDates", isSignal: true, isRequired: false, transformFunction: null }, disableWeekends: { classPropertyName: "disableWeekends", publicName: "disableWeekends", isSignal: true, isRequired: false, transformFunction: null }, showWeekNumbers: { classPropertyName: "showWeekNumbers", publicName: "showWeekNumbers", isSignal: true, isRequired: false, transformFunction: null }, captionLayout: { classPropertyName: "captionLayout", publicName: "captionLayout", isSignal: true, isRequired: false, transformFunction: null }, hideOutsideDays: { classPropertyName: "hideOutsideDays", publicName: "hideOutsideDays", 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", range: "rangeChange", disabled: "disabledChange" }, host: { attributes: { "data-slot": "date-picker" }, listeners: { "document:click": "onDocumentClick($event)" }, properties: { "class": "computedClass()" } }, providers: [
|
|
14785
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiDatePicker), multi: true },
|
|
14786
|
+
], ngImport: i0, template: `
|
|
14375
14787
|
<button
|
|
14376
14788
|
type="button"
|
|
14377
|
-
class="flex h-9 w-full items-center gap-2 rounded-md border border-input bg-transparent px-3 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50"
|
|
14789
|
+
class="flex h-9 w-full items-center gap-2 rounded-md border border-input bg-transparent px-3 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50"
|
|
14378
14790
|
[attr.aria-expanded]="open()"
|
|
14791
|
+
[disabled]="disabled()"
|
|
14379
14792
|
(click)="open.set(!open())"
|
|
14380
14793
|
>
|
|
14381
14794
|
<svg
|
|
@@ -14413,7 +14826,7 @@ class BuiDatePicker {
|
|
|
14413
14826
|
/>
|
|
14414
14827
|
</div>
|
|
14415
14828
|
}
|
|
14416
|
-
`, isInline: true, dependencies: [{ kind: "component", type: BuiCalendar, selector: "bui-calendar", inputs: ["value", "mode", "range", "values", "months", "weekStart", "minDate", "maxDate", "disabledDates", "disableWeekends", "showWeekNumbers", "captionLayout", "hideOutsideDays", "class"], outputs: ["valueChange", "rangeChange", "valuesChange"] }] });
|
|
14829
|
+
`, isInline: true, dependencies: [{ kind: "component", type: BuiCalendar, selector: "bui-calendar", inputs: ["value", "mode", "range", "values", "months", "weekStart", "minDate", "maxDate", "disabledDates", "disableWeekends", "showWeekNumbers", "captionLayout", "hideOutsideDays", "disabled", "class"], outputs: ["valueChange", "rangeChange", "valuesChange", "disabledChange"] }] });
|
|
14417
14830
|
}
|
|
14418
14831
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiDatePicker, decorators: [{
|
|
14419
14832
|
type: Component,
|
|
@@ -14425,11 +14838,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
14425
14838
|
'[class]': 'computedClass()',
|
|
14426
14839
|
'(document:click)': 'onDocumentClick($event)',
|
|
14427
14840
|
},
|
|
14841
|
+
providers: [
|
|
14842
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiDatePicker), multi: true },
|
|
14843
|
+
],
|
|
14428
14844
|
template: `
|
|
14429
14845
|
<button
|
|
14430
14846
|
type="button"
|
|
14431
|
-
class="flex h-9 w-full items-center gap-2 rounded-md border border-input bg-transparent px-3 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50"
|
|
14847
|
+
class="flex h-9 w-full items-center gap-2 rounded-md border border-input bg-transparent px-3 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50"
|
|
14432
14848
|
[attr.aria-expanded]="open()"
|
|
14849
|
+
[disabled]="disabled()"
|
|
14433
14850
|
(click)="open.set(!open())"
|
|
14434
14851
|
>
|
|
14435
14852
|
<svg
|
|
@@ -14469,7 +14886,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
14469
14886
|
}
|
|
14470
14887
|
`,
|
|
14471
14888
|
}]
|
|
14472
|
-
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], range: [{ type: i0.Input, args: [{ isSignal: true, alias: "range", required: false }] }, { type: i0.Output, args: ["rangeChange"] }], months: [{ type: i0.Input, args: [{ isSignal: true, alias: "months", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], weekStart: [{ type: i0.Input, args: [{ isSignal: true, alias: "weekStart", required: false }] }], disabledDates: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledDates", required: false }] }], disableWeekends: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableWeekends", required: false }] }], showWeekNumbers: [{ type: i0.Input, args: [{ isSignal: true, alias: "showWeekNumbers", required: false }] }], captionLayout: [{ type: i0.Input, args: [{ isSignal: true, alias: "captionLayout", required: false }] }], hideOutsideDays: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideOutsideDays", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
14889
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], range: [{ type: i0.Input, args: [{ isSignal: true, alias: "range", required: false }] }, { type: i0.Output, args: ["rangeChange"] }], months: [{ type: i0.Input, args: [{ isSignal: true, alias: "months", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], weekStart: [{ type: i0.Input, args: [{ isSignal: true, alias: "weekStart", required: false }] }], disabledDates: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledDates", required: false }] }], disableWeekends: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableWeekends", required: false }] }], showWeekNumbers: [{ type: i0.Input, args: [{ isSignal: true, alias: "showWeekNumbers", required: false }] }], captionLayout: [{ type: i0.Input, args: [{ isSignal: true, alias: "captionLayout", required: false }] }], hideOutsideDays: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideOutsideDays", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
14473
14890
|
|
|
14474
14891
|
/** A slide carousel. Project slides as direct children; arrows + dots navigate. SSR-safe. */
|
|
14475
14892
|
class BuiCarousel {
|
|
@@ -15647,6 +16064,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
15647
16064
|
}]
|
|
15648
16065
|
}], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], series: [{ type: i0.Input, args: [{ isSignal: true, alias: "series", required: false }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
15649
16066
|
|
|
16067
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
16068
|
+
const noop$2 = () => { };
|
|
15650
16069
|
/** A combined date + time picker in a popover. Value is `YYYY-MM-DDTHH:mm`. */
|
|
15651
16070
|
class BuiDatetimePicker {
|
|
15652
16071
|
value = model('', /* @ts-ignore */
|
|
@@ -15670,7 +16089,11 @@ class BuiDatetimePicker {
|
|
|
15670
16089
|
...(ngDevMode ? [{ debugName: "captionLayout" }] : /* istanbul ignore next */ []));
|
|
15671
16090
|
seconds = input(false, /* @ts-ignore */
|
|
15672
16091
|
...(ngDevMode ? [{ debugName: "seconds" }] : /* istanbul ignore next */ []));
|
|
16092
|
+
disabled = model(false, /* @ts-ignore */
|
|
16093
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
15673
16094
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
16095
|
+
onChange = noop$2;
|
|
16096
|
+
onTouched = noop$2;
|
|
15674
16097
|
host = inject(ElementRef);
|
|
15675
16098
|
open = signal(false, /* @ts-ignore */
|
|
15676
16099
|
...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
@@ -15704,6 +16127,7 @@ class BuiDatetimePicker {
|
|
|
15704
16127
|
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
15705
16128
|
onDate(iso) {
|
|
15706
16129
|
this.value.set(`${iso}T${this.timePart()}`);
|
|
16130
|
+
this.onChange(this.value());
|
|
15707
16131
|
}
|
|
15708
16132
|
onRange(range) {
|
|
15709
16133
|
const time = this.timePart();
|
|
@@ -15723,6 +16147,7 @@ class BuiDatetimePicker {
|
|
|
15723
16147
|
}
|
|
15724
16148
|
const date = this.datePart();
|
|
15725
16149
|
this.value.set(`${date === '' ? this.todayIso() : date}T${time}`);
|
|
16150
|
+
this.onChange(this.value());
|
|
15726
16151
|
}
|
|
15727
16152
|
fmt(value) {
|
|
15728
16153
|
return new Date(value).toLocaleString('en-US', {
|
|
@@ -15733,20 +16158,37 @@ class BuiDatetimePicker {
|
|
|
15733
16158
|
});
|
|
15734
16159
|
}
|
|
15735
16160
|
onDocumentClick(event) {
|
|
15736
|
-
if (this.open() && !this.host.nativeElement.contains(event.target)) {
|
|
15737
|
-
|
|
16161
|
+
if (!(this.open() && !this.host.nativeElement.contains(event.target))) {
|
|
16162
|
+
return;
|
|
15738
16163
|
}
|
|
16164
|
+
this.open.set(false);
|
|
16165
|
+
this.onTouched();
|
|
16166
|
+
}
|
|
16167
|
+
writeValue(value) {
|
|
16168
|
+
this.value.set(typeof value === 'string' ? value : '');
|
|
16169
|
+
}
|
|
16170
|
+
registerOnChange(callback) {
|
|
16171
|
+
this.onChange = callback;
|
|
16172
|
+
}
|
|
16173
|
+
registerOnTouched(callback) {
|
|
16174
|
+
this.onTouched = callback;
|
|
16175
|
+
}
|
|
16176
|
+
setDisabledState(isDisabled) {
|
|
16177
|
+
this.disabled.set(isDisabled);
|
|
15739
16178
|
}
|
|
15740
16179
|
todayIso() {
|
|
15741
16180
|
const now = new Date();
|
|
15742
16181
|
return `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')}`;
|
|
15743
16182
|
}
|
|
15744
16183
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiDatetimePicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
15745
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiDatetimePicker, isStandalone: true, selector: "bui-datetime-picker", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, range: { classPropertyName: "range", publicName: "range", isSignal: true, isRequired: false, transformFunction: null }, months: { classPropertyName: "months", publicName: "months", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, captionLayout: { classPropertyName: "captionLayout", publicName: "captionLayout", isSignal: true, isRequired: false, transformFunction: null }, seconds: { classPropertyName: "seconds", publicName: "seconds", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", range: "rangeChange" }, host: { attributes: { "data-slot": "datetime-picker" }, listeners: { "document:click": "onDocumentClick($event)" }, properties: { "class": "computedClass()" } },
|
|
16184
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiDatetimePicker, isStandalone: true, selector: "bui-datetime-picker", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, range: { classPropertyName: "range", publicName: "range", isSignal: true, isRequired: false, transformFunction: null }, months: { classPropertyName: "months", publicName: "months", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, captionLayout: { classPropertyName: "captionLayout", publicName: "captionLayout", isSignal: true, isRequired: false, transformFunction: null }, seconds: { classPropertyName: "seconds", publicName: "seconds", 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", range: "rangeChange", disabled: "disabledChange" }, host: { attributes: { "data-slot": "datetime-picker" }, listeners: { "document:click": "onDocumentClick($event)" }, properties: { "class": "computedClass()" } }, providers: [
|
|
16185
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiDatetimePicker), multi: true },
|
|
16186
|
+
], ngImport: i0, template: `
|
|
15746
16187
|
<button
|
|
15747
16188
|
type="button"
|
|
15748
|
-
class="flex h-9 w-full items-center gap-2 rounded-md border border-input bg-transparent px-3 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50"
|
|
16189
|
+
class="flex h-9 w-full items-center gap-2 rounded-md border border-input bg-transparent px-3 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50"
|
|
15749
16190
|
[attr.aria-expanded]="open()"
|
|
16191
|
+
[disabled]="disabled()"
|
|
15750
16192
|
(click)="open.set(!open())"
|
|
15751
16193
|
>
|
|
15752
16194
|
<svg
|
|
@@ -15795,7 +16237,7 @@ class BuiDatetimePicker {
|
|
|
15795
16237
|
</div>
|
|
15796
16238
|
</div>
|
|
15797
16239
|
}
|
|
15798
|
-
`, isInline: true, dependencies: [{ kind: "component", type: BuiCalendar, selector: "bui-calendar", inputs: ["value", "mode", "range", "values", "months", "weekStart", "minDate", "maxDate", "disabledDates", "disableWeekends", "showWeekNumbers", "captionLayout", "hideOutsideDays", "class"], outputs: ["valueChange", "rangeChange", "valuesChange"] }, { kind: "component", type: BuiTimeField, selector: "bui-time-field", inputs: ["value", "name", "id", "min", "max", "seconds", "disabled", "mode", "minuteStep", "ariaLabel", "class"], outputs: ["valueChange"] }] });
|
|
16240
|
+
`, isInline: true, dependencies: [{ kind: "component", type: BuiCalendar, selector: "bui-calendar", inputs: ["value", "mode", "range", "values", "months", "weekStart", "minDate", "maxDate", "disabledDates", "disableWeekends", "showWeekNumbers", "captionLayout", "hideOutsideDays", "disabled", "class"], outputs: ["valueChange", "rangeChange", "valuesChange", "disabledChange"] }, { kind: "component", type: BuiTimeField, selector: "bui-time-field", inputs: ["value", "name", "id", "min", "max", "seconds", "disabled", "mode", "minuteStep", "ariaLabel", "class"], outputs: ["valueChange", "disabledChange"] }] });
|
|
15799
16241
|
}
|
|
15800
16242
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiDatetimePicker, decorators: [{
|
|
15801
16243
|
type: Component,
|
|
@@ -15807,11 +16249,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
15807
16249
|
'[class]': 'computedClass()',
|
|
15808
16250
|
'(document:click)': 'onDocumentClick($event)',
|
|
15809
16251
|
},
|
|
16252
|
+
providers: [
|
|
16253
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiDatetimePicker), multi: true },
|
|
16254
|
+
],
|
|
15810
16255
|
template: `
|
|
15811
16256
|
<button
|
|
15812
16257
|
type="button"
|
|
15813
|
-
class="flex h-9 w-full items-center gap-2 rounded-md border border-input bg-transparent px-3 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50"
|
|
16258
|
+
class="flex h-9 w-full items-center gap-2 rounded-md border border-input bg-transparent px-3 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50"
|
|
15814
16259
|
[attr.aria-expanded]="open()"
|
|
16260
|
+
[disabled]="disabled()"
|
|
15815
16261
|
(click)="open.set(!open())"
|
|
15816
16262
|
>
|
|
15817
16263
|
<svg
|
|
@@ -15862,8 +16308,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
15862
16308
|
}
|
|
15863
16309
|
`,
|
|
15864
16310
|
}]
|
|
15865
|
-
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], range: [{ type: i0.Input, args: [{ isSignal: true, alias: "range", required: false }] }, { type: i0.Output, args: ["rangeChange"] }], months: [{ type: i0.Input, args: [{ isSignal: true, alias: "months", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], captionLayout: [{ type: i0.Input, args: [{ isSignal: true, alias: "captionLayout", required: false }] }], seconds: [{ type: i0.Input, args: [{ isSignal: true, alias: "seconds", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
16311
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], range: [{ type: i0.Input, args: [{ isSignal: true, alias: "range", required: false }] }, { type: i0.Output, args: ["rangeChange"] }], months: [{ type: i0.Input, args: [{ isSignal: true, alias: "months", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], captionLayout: [{ type: i0.Input, args: [{ isSignal: true, alias: "captionLayout", required: false }] }], seconds: [{ type: i0.Input, args: [{ isSignal: true, alias: "seconds", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
15866
16312
|
|
|
16313
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
16314
|
+
const noop$1 = () => { };
|
|
15867
16315
|
const AC_SIZE = {
|
|
15868
16316
|
sm: 'h-8 text-xs',
|
|
15869
16317
|
default: 'h-9 text-sm',
|
|
@@ -15884,7 +16332,7 @@ class BuiAutocomplete {
|
|
|
15884
16332
|
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
15885
16333
|
empty = input('No results found.', /* @ts-ignore */
|
|
15886
16334
|
...(ngDevMode ? [{ debugName: "empty" }] : /* istanbul ignore next */ []));
|
|
15887
|
-
disabled =
|
|
16335
|
+
disabled = model(false, /* @ts-ignore */
|
|
15888
16336
|
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
15889
16337
|
name = input('', /* @ts-ignore */
|
|
15890
16338
|
...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
@@ -15898,6 +16346,8 @@ class BuiAutocomplete {
|
|
|
15898
16346
|
...(ngDevMode ? [{ debugName: "inputClass" }] : /* istanbul ignore next */ []));
|
|
15899
16347
|
boxClass = computed(() => cn('flex min-h-9 w-full flex-wrap items-center gap-1 rounded-md border border-input bg-transparent px-2 py-1 shadow-xs focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/50'), /* @ts-ignore */
|
|
15900
16348
|
...(ngDevMode ? [{ debugName: "boxClass" }] : /* istanbul ignore next */ []));
|
|
16349
|
+
onChange = noop$1;
|
|
16350
|
+
onTouched = noop$1;
|
|
15901
16351
|
host = inject(ElementRef);
|
|
15902
16352
|
listId = inject(_IdGenerator).getId('bui-autocomplete-');
|
|
15903
16353
|
open = signal(false, /* @ts-ignore */
|
|
@@ -15922,6 +16372,9 @@ class BuiAutocomplete {
|
|
|
15922
16372
|
this.value.set(event.target.value);
|
|
15923
16373
|
this.open.set(true);
|
|
15924
16374
|
this.active.set(0);
|
|
16375
|
+
if (!this.multiple()) {
|
|
16376
|
+
this.onChange(this.value());
|
|
16377
|
+
}
|
|
15925
16378
|
}
|
|
15926
16379
|
onKeydown(event) {
|
|
15927
16380
|
const options = this.filtered();
|
|
@@ -15945,6 +16398,7 @@ class BuiAutocomplete {
|
|
|
15945
16398
|
const picked = this.values();
|
|
15946
16399
|
if (picked.length > 0) {
|
|
15947
16400
|
this.values.set(picked.slice(0, -1));
|
|
16401
|
+
this.onChange(this.values());
|
|
15948
16402
|
}
|
|
15949
16403
|
}
|
|
15950
16404
|
}
|
|
@@ -15955,21 +16409,45 @@ class BuiAutocomplete {
|
|
|
15955
16409
|
}
|
|
15956
16410
|
this.value.set('');
|
|
15957
16411
|
this.active.set(0);
|
|
16412
|
+
this.onChange(this.values());
|
|
15958
16413
|
return;
|
|
15959
16414
|
}
|
|
15960
16415
|
this.value.set(option);
|
|
15961
16416
|
this.open.set(false);
|
|
16417
|
+
this.onChange(option);
|
|
15962
16418
|
}
|
|
15963
16419
|
removeChip(chip) {
|
|
15964
16420
|
this.values.set(this.values().filter((value) => value !== chip));
|
|
16421
|
+
this.onChange(this.values());
|
|
15965
16422
|
}
|
|
15966
16423
|
onDocumentClick(event) {
|
|
15967
|
-
if (this.open() && !this.host.nativeElement.contains(event.target)) {
|
|
15968
|
-
|
|
16424
|
+
if (!(this.open() && !this.host.nativeElement.contains(event.target))) {
|
|
16425
|
+
return;
|
|
15969
16426
|
}
|
|
16427
|
+
this.open.set(false);
|
|
16428
|
+
this.onTouched();
|
|
16429
|
+
}
|
|
16430
|
+
writeValue(value) {
|
|
16431
|
+
if (this.multiple()) {
|
|
16432
|
+
this.values.set(Array.isArray(value) ? [...value] : []);
|
|
16433
|
+
}
|
|
16434
|
+
else {
|
|
16435
|
+
this.value.set(typeof value === 'string' ? value : '');
|
|
16436
|
+
}
|
|
16437
|
+
}
|
|
16438
|
+
registerOnChange(callback) {
|
|
16439
|
+
this.onChange = callback;
|
|
16440
|
+
}
|
|
16441
|
+
registerOnTouched(callback) {
|
|
16442
|
+
this.onTouched = callback;
|
|
16443
|
+
}
|
|
16444
|
+
setDisabledState(isDisabled) {
|
|
16445
|
+
this.disabled.set(isDisabled);
|
|
15970
16446
|
}
|
|
15971
16447
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiAutocomplete, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
15972
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiAutocomplete, isStandalone: true, selector: "bui-autocomplete", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, values: { classPropertyName: "values", publicName: "values", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, empty: { classPropertyName: "empty", publicName: "empty", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", values: "valuesChange" }, host: { attributes: { "data-slot": "autocomplete" }, listeners: { "document:click": "onDocumentClick($event)" }, properties: { "class": "computedClass()" } },
|
|
16448
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: BuiAutocomplete, isStandalone: true, selector: "bui-autocomplete", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, values: { classPropertyName: "values", publicName: "values", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, empty: { classPropertyName: "empty", publicName: "empty", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", values: "valuesChange", disabled: "disabledChange" }, host: { attributes: { "data-slot": "autocomplete" }, listeners: { "document:click": "onDocumentClick($event)" }, properties: { "class": "computedClass()" } }, providers: [
|
|
16449
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiAutocomplete), multi: true },
|
|
16450
|
+
], ngImport: i0, template: `
|
|
15973
16451
|
@if (multiple()) {
|
|
15974
16452
|
<div [class]="boxClass()">
|
|
15975
16453
|
@for (chip of values(); track chip) {
|
|
@@ -16082,6 +16560,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
16082
16560
|
'[class]': 'computedClass()',
|
|
16083
16561
|
'(document:click)': 'onDocumentClick($event)',
|
|
16084
16562
|
},
|
|
16563
|
+
providers: [
|
|
16564
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiAutocomplete), multi: true },
|
|
16565
|
+
],
|
|
16085
16566
|
template: `
|
|
16086
16567
|
@if (multiple()) {
|
|
16087
16568
|
<div [class]="boxClass()">
|
|
@@ -16186,7 +16667,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
16186
16667
|
}
|
|
16187
16668
|
`,
|
|
16188
16669
|
}]
|
|
16189
|
-
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], values: [{ type: i0.Input, args: [{ isSignal: true, alias: "values", required: false }] }, { type: i0.Output, args: ["valuesChange"] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], empty: [{ type: i0.Input, args: [{ isSignal: true, alias: "empty", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
16670
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], values: [{ type: i0.Input, args: [{ isSignal: true, alias: "values", required: false }] }, { type: i0.Output, args: ["valuesChange"] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], empty: [{ type: i0.Input, args: [{ isSignal: true, alias: "empty", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
16190
16671
|
|
|
16191
16672
|
/** A before/after image comparison with a draggable, keyboard-operable divider. */
|
|
16192
16673
|
class BuiComparisonSlider {
|
|
@@ -16661,6 +17142,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
16661
17142
|
}]
|
|
16662
17143
|
}], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
16663
17144
|
|
|
17145
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
17146
|
+
const noop = () => { };
|
|
16664
17147
|
const PLACEHOLDERS = new Set(['9', 'a', '*']);
|
|
16665
17148
|
function isTokenChar(char, token) {
|
|
16666
17149
|
if (token === '9') {
|
|
@@ -16714,7 +17197,11 @@ class BuiInputMask {
|
|
|
16714
17197
|
...(ngDevMode ? [{ debugName: "inputmode" }] : /* istanbul ignore next */ []));
|
|
16715
17198
|
name = input('', /* @ts-ignore */
|
|
16716
17199
|
...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
17200
|
+
disabled = model(false, /* @ts-ignore */
|
|
17201
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
16717
17202
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
17203
|
+
onChange = noop;
|
|
17204
|
+
onTouched = noop;
|
|
16718
17205
|
computedClass = computed(() => cn('block', this.userClass()), /* @ts-ignore */
|
|
16719
17206
|
...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
|
|
16720
17207
|
onInput(event) {
|
|
@@ -16722,16 +17209,33 @@ class BuiInputMask {
|
|
|
16722
17209
|
const masked = this.mask() === '' ? target.value : applyMask$1(target.value, this.mask());
|
|
16723
17210
|
target.value = masked;
|
|
16724
17211
|
this.value.set(masked);
|
|
17212
|
+
this.onChange(masked);
|
|
17213
|
+
}
|
|
17214
|
+
writeValue(value) {
|
|
17215
|
+
this.value.set(typeof value === 'string' ? value : '');
|
|
17216
|
+
}
|
|
17217
|
+
registerOnChange(callback) {
|
|
17218
|
+
this.onChange = callback;
|
|
17219
|
+
}
|
|
17220
|
+
registerOnTouched(callback) {
|
|
17221
|
+
this.onTouched = callback;
|
|
17222
|
+
}
|
|
17223
|
+
setDisabledState(isDisabled) {
|
|
17224
|
+
this.disabled.set(isDisabled);
|
|
16725
17225
|
}
|
|
16726
17226
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BuiInputMask, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
16727
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: BuiInputMask, isStandalone: true, selector: "bui-input-mask", inputs: { mask: { classPropertyName: "mask", publicName: "mask", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, inputmode: { classPropertyName: "inputmode", publicName: "inputmode", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { attributes: { "data-slot": "input-mask" }, properties: { "class": "computedClass()" } },
|
|
17227
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: BuiInputMask, isStandalone: true, selector: "bui-input-mask", inputs: { mask: { classPropertyName: "mask", publicName: "mask", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, inputmode: { classPropertyName: "inputmode", publicName: "inputmode", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", 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", disabled: "disabledChange" }, host: { attributes: { "data-slot": "input-mask" }, properties: { "class": "computedClass()" } }, providers: [
|
|
17228
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiInputMask), multi: true },
|
|
17229
|
+
], ngImport: i0, template: `
|
|
16728
17230
|
<input
|
|
16729
17231
|
[value]="value()"
|
|
16730
17232
|
[placeholder]="placeholder()"
|
|
16731
17233
|
[attr.inputmode]="inputmode() || null"
|
|
16732
17234
|
[attr.name]="name() || null"
|
|
16733
|
-
|
|
17235
|
+
[disabled]="disabled()"
|
|
17236
|
+
class="h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50"
|
|
16734
17237
|
(input)="onInput($event)"
|
|
17238
|
+
(blur)="onTouched()"
|
|
16735
17239
|
/>
|
|
16736
17240
|
`, isInline: true });
|
|
16737
17241
|
}
|
|
@@ -16740,18 +17244,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
|
|
|
16740
17244
|
args: [{
|
|
16741
17245
|
selector: 'bui-input-mask',
|
|
16742
17246
|
host: { 'data-slot': 'input-mask', '[class]': 'computedClass()' },
|
|
17247
|
+
providers: [
|
|
17248
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => BuiInputMask), multi: true },
|
|
17249
|
+
],
|
|
16743
17250
|
template: `
|
|
16744
17251
|
<input
|
|
16745
17252
|
[value]="value()"
|
|
16746
17253
|
[placeholder]="placeholder()"
|
|
16747
17254
|
[attr.inputmode]="inputmode() || null"
|
|
16748
17255
|
[attr.name]="name() || null"
|
|
16749
|
-
|
|
17256
|
+
[disabled]="disabled()"
|
|
17257
|
+
class="h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50"
|
|
16750
17258
|
(input)="onInput($event)"
|
|
17259
|
+
(blur)="onTouched()"
|
|
16751
17260
|
/>
|
|
16752
17261
|
`,
|
|
16753
17262
|
}]
|
|
16754
|
-
}], propDecorators: { mask: [{ type: i0.Input, args: [{ isSignal: true, alias: "mask", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], inputmode: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputmode", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
17263
|
+
}], propDecorators: { mask: [{ type: i0.Input, args: [{ isSignal: true, alias: "mask", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], inputmode: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputmode", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
16755
17264
|
|
|
16756
17265
|
const SIDE = {
|
|
16757
17266
|
right: 'inset-y-0 right-0 h-full w-80 max-w-[85vw] border-l',
|