@spartan-ng/brain 0.0.1-alpha.708 → 0.0.1-alpha.709
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/spartan-ng-brain-accordion.mjs +27 -28
- package/fesm2022/spartan-ng-brain-accordion.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-checkbox.mjs +5 -4
- package/fesm2022/spartan-ng-brain-checkbox.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-input-otp.mjs +12 -12
- package/fesm2022/spartan-ng-brain-input-otp.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-radio-group.mjs +5 -4
- package/fesm2022/spartan-ng-brain-radio-group.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-slider.mjs +5 -4
- package/fesm2022/spartan-ng-brain-slider.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-switch.mjs +16 -5
- package/fesm2022/spartan-ng-brain-switch.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-toggle-group.mjs +5 -6
- package/fesm2022/spartan-ng-brain-toggle-group.mjs.map +1 -1
- package/package.json +1 -1
- package/types/spartan-ng-brain-accordion.d.ts +2 -1
- package/types/spartan-ng-brain-checkbox.d.ts +4 -3
- package/types/spartan-ng-brain-input-otp.d.ts +3 -2
- package/types/spartan-ng-brain-radio-group.d.ts +3 -2
- package/types/spartan-ng-brain-slider.d.ts +3 -2
- package/types/spartan-ng-brain-switch.d.ts +12 -2
- package/types/spartan-ng-brain-toggle-group.d.ts +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spartan-ng-brain-input-otp.mjs","sources":["../../../../libs/brain/input-otp/src/lib/brn-input-otp.token.ts","../../../../libs/brain/input-otp/src/lib/brn-input-otp.ts","../../../../libs/brain/input-otp/src/lib/brn-input-otp-slot.ts","../../../../libs/brain/input-otp/src/index.ts","../../../../libs/brain/input-otp/src/spartan-ng-brain-input-otp.ts"],"sourcesContent":["import { type ExistingProvider, inject, InjectionToken, type Type } from '@angular/core';\nimport type { BrnInputOtp } from './brn-input-otp';\n\nexport const BrnInputOtpToken = new InjectionToken<BrnInputOtp>('BrnInputOtpToken');\n\nexport function injectBrnInputOtp(): BrnInputOtp {\n\treturn inject(BrnInputOtpToken) as BrnInputOtp;\n}\n\nexport function provideBrnInputOtp(inputOtp: Type<BrnInputOtp>): ExistingProvider {\n\treturn { provide: BrnInputOtpToken, useExisting: inputOtp };\n}\n","import type { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n\tafterNextRender,\n\tbooleanAttribute,\n\tChangeDetectionStrategy,\n\tComponent,\n\tcomputed,\n\tElementRef,\n\tforwardRef,\n\tinput,\n\tlinkedSignal,\n\tmodel,\n\tnumberAttribute,\n\toutput,\n\tsignal,\n\tviewChild,\n} from '@angular/core';\nimport { type ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport type { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';\nimport type { ClassValue } from 'clsx';\nimport { provideBrnInputOtp } from './brn-input-otp.token';\n\nexport const BRN_INPUT_OTP_VALUE_ACCESSOR = {\n\tprovide: NG_VALUE_ACCESSOR,\n\tuseExisting: forwardRef(() => BrnInputOtp),\n\tmulti: true,\n};\n\nexport type InputMode = 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';\n\n@Component({\n\tselector: 'brn-input-otp',\n\timports: [FormsModule],\n\tproviders: [BRN_INPUT_OTP_VALUE_ACCESSOR, provideBrnInputOtp(BrnInputOtp)],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\thost: {\n\t\t'[style]': 'hostStyles()',\n\t\t'data-input-otp-container': 'true',\n\t},\n\ttemplate: `\n\t\t<ng-content />\n\t\t<div [style]=\"containerStyles()\">\n\t\t\t<input\n\t\t\t\t#otpInput\n\t\t\t\t[id]=\"inputId()\"\n\t\t\t\t[class]=\"inputClass()\"\n\t\t\t\t[autocomplete]=\"inputAutocomplete()\"\n\t\t\t\tdata-slot=\"input-otp\"\n\t\t\t\t[style]=\"inputStyles()\"\n\t\t\t\t[disabled]=\"_disabled()\"\n\t\t\t\t[inputMode]=\"inputMode()\"\n\t\t\t\t[ngModel]=\"value()\"\n\t\t\t\t(input)=\"onInputChange($event)\"\n\t\t\t\t(paste)=\"onPaste($event)\"\n\t\t\t\t(focus)=\"_focused.set(true)\"\n\t\t\t\t(blur)=\"_focused.set(false)\"\n\t\t\t/>\n\t\t</div>\n\t`,\n})\nexport class BrnInputOtp implements ControlValueAccessor {\n\tprivate static _id = 0;\n\n\t/** Whether the input has focus. */\n\tprotected readonly _focused = signal<boolean>(false);\n\n\t/** Styles applied to the host element. */\n\tpublic readonly hostStyles = input<string>(\n\t\t'position: relative; cursor: text; user-select: none; pointer-events: none;',\n\t);\n\n\t/** Custom id applied to the input element */\n\tpublic readonly inputId = input<string>(`brn-input-otp-${++BrnInputOtp._id}`);\n\n\t/** Custom autocomplete attribute applied to the input element */\n\tpublic readonly inputAutocomplete = input<'one-time-code' | 'off'>('one-time-code');\n\n\t/** Styles applied to the input element to make it invisible and clickable. */\n\tpublic readonly inputStyles = input<string>(\n\t\t'position: absolute; inset: 0; width: 100%; height: 100%; display: flex; textAlign: left; opacity: 1; color: transparent; pointerEvents: all; background: transparent; caret-color: transparent; border: 0px solid transparent; outline: transparent solid 0px; box-shadow: none; line-height: 1; letter-spacing: -0.5em; font-family: monospace; font-variant-numeric: tabular-nums;',\n\t);\n\n\t/** Styles applied to the container element. */\n\tpublic readonly containerStyles = input<string>('position: absolute; inset: 0; pointer-events: none;');\n\n\t/** Determine if the date picker is disabled. */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\tprotected readonly _disabled = linkedSignal(this.disabled);\n\n\t/** The number of slots. */\n\tpublic readonly maxLength = input.required<number, NumberInput>({ transform: numberAttribute });\n\n\t/** Virtual keyboard appearance on mobile */\n\tpublic readonly inputMode = input<InputMode>('numeric');\n\n\tpublic readonly inputClass = input<ClassValue>('');\n\n\t/** If true, the element is focused automatically on init **/\n\tpublic readonly autofocus = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n\t/**\n\t * Defines how the pasted text should be transformed before saving to model/form.\n\t * Allows pasting text which contains extra characters like spaces, dashes, etc. and are longer than the maxLength.\n\t *\n\t * \"XXX-XXX\": (pastedText) => pastedText.replaceAll('-', '')\n\t * \"XXX XXX\": (pastedText) => pastedText.replaceAll(/\\s+/g, '')\n\t */\n\tpublic readonly transformPaste = input<(pastedText: string, maxLength: number) => string>((text) => text);\n\n\t/** The value controlling the input */\n\tpublic readonly value = model<string | null>(null);\n\n\t/** Emits when the value changes. */\n\tpublic readonly valueChange = output<string>();\n\n\tpublic readonly context = computed(() => {\n\t\tconst value = this.value() ?? '';\n\t\tconst focused = this._focused();\n\t\tconst maxLength = this.maxLength();\n\t\tconst slots = Array.from({ length: this.maxLength() }).map((_, slotIndex) => {\n\t\t\tconst char = value[slotIndex] !== undefined ? value[slotIndex] : null;\n\n\t\t\tconst isActive =\n\t\t\t\tfocused && (value.length === slotIndex || (value.length === maxLength && slotIndex === maxLength - 1));\n\n\t\t\treturn {\n\t\t\t\tchar,\n\t\t\t\tisActive,\n\t\t\t\thasFakeCaret: isActive && value.length === slotIndex,\n\t\t\t};\n\t\t});\n\n\t\treturn slots;\n\t});\n\n\t/** Emitted when the input is complete, triggered through input or paste. */\n\tpublic readonly completed = output<string>();\n\n\tprotected _onChange?: ChangeFn<string>;\n\tprotected _onTouched?: TouchFn;\n\n\tprotected readonly _inputComponentRef = viewChild.required<ElementRef>('otpInput');\n\n\tconstructor() {\n\t\tafterNextRender(() => {\n\t\t\tif (this.autofocus()) {\n\t\t\t\tthis._inputComponentRef().nativeElement.focus();\n\t\t\t}\n\t\t});\n\t}\n\n\tprotected onInputChange(event: Event) {\n\t\tlet newValue = (event.target as HTMLInputElement).value;\n\t\tconst maxLength = this.maxLength();\n\n\t\tif (newValue.length > maxLength) {\n\t\t\t// Replace the last character when max length is exceeded\n\t\t\tnewValue = newValue.slice(0, maxLength - 1) + newValue.slice(-1);\n\t\t}\n\n\t\tthis.updateValue(newValue, maxLength);\n\t}\n\n\tprotected onPaste(event: ClipboardEvent) {\n\t\tevent.preventDefault();\n\t\tconst clipboardData = event.clipboardData?.getData('text/plain') || '';\n\n\t\tconst maxLength = this.maxLength();\n\n\t\tconst content = this.transformPaste()(clipboardData, maxLength);\n\t\tconst newValue = content.slice(0, maxLength);\n\n\t\tthis.updateValue(newValue, maxLength);\n\t}\n\n\t/** CONTROL VALUE ACCESSOR */\n\twriteValue(value: string | null): void {\n\t\tthis.value.set(value);\n\t\tif (value?.length === this.maxLength()) {\n\t\t\tthis.completed.emit(value ?? '');\n\t\t}\n\t}\n\n\tregisterOnChange(fn: ChangeFn<string>): void {\n\t\tthis._onChange = fn;\n\t}\n\n\tregisterOnTouched(fn: TouchFn): void {\n\t\tthis._onTouched = fn;\n\t}\n\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis._disabled.set(isDisabled);\n\t}\n\n\tprivate isCompleted(newValue: string, previousValue: string, maxLength: number) {\n\t\treturn newValue !== previousValue && previousValue.length < maxLength && newValue.length === maxLength;\n\t}\n\n\tprivate updateValue(newValue: string, maxLength: number) {\n\t\tconst previousValue = this.value() ?? '';\n\n\t\tthis.value.set(newValue);\n\t\tthis._onChange?.(newValue);\n\n\t\tif (this.isCompleted(newValue, previousValue, maxLength)) {\n\t\t\tthis.completed.emit(newValue);\n\t\t}\n\t}\n}\n","import type { NumberInput } from '@angular/cdk/coercion';\nimport { ChangeDetectionStrategy, Component, computed, input, numberAttribute } from '@angular/core';\nimport { injectBrnInputOtp } from './brn-input-otp.token';\n\n@Component({\n\tselector: 'brn-input-otp-slot',\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\thost: {\n\t\t'[attr.data-active]': '_slot().isActive',\n\t},\n\ttemplate: `\n\t\t{{ _slot().char }}\n\n\t\t@if (_slot().hasFakeCaret) {\n\t\t\t<ng-content />\n\t\t}\n\t`,\n})\nexport class BrnInputOtpSlot {\n\t/** Access the input-otp component */\n\tprotected readonly _inputOtp = injectBrnInputOtp();\n\n\t/** The index of the slot to render the char or a fake caret */\n\tpublic readonly index = input.required<number, NumberInput>({ transform: numberAttribute });\n\n\tprotected readonly _slot = computed(() => this._inputOtp.context()[this.index()]);\n}\n","import { BrnInputOtp } from './lib/brn-input-otp';\nimport { BrnInputOtpSlot } from './lib/brn-input-otp-slot';\n\nexport * from './lib/brn-input-otp';\nexport * from './lib/brn-input-otp-slot';\n\nexport const BrnInputOtpImports = [BrnInputOtp, BrnInputOtpSlot] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAGO,MAAM,gBAAgB,GAAG,IAAI,cAAc,CAAc,kBAAkB,CAAC;SAEnE,iBAAiB,GAAA;AAChC,IAAA,OAAO,MAAM,CAAC,gBAAgB,CAAgB;AAC/C;AAEM,SAAU,kBAAkB,CAAC,QAA2B,EAAA;IAC7D,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,QAAQ,EAAE;AAC5D;;ACWO,MAAM,4BAA4B,GAAG;AAC3C,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,WAAW,EAAE,UAAU,CAAC,MAAM,WAAW,CAAC;AAC1C,IAAA,KAAK,EAAE,IAAI;;MAmCC,WAAW,CAAA;AACf,IAAA,OAAO,GAAG,GAAG,CAAC;;AAGH,IAAA,QAAQ,GAAG,MAAM,CAAU,KAAK,+EAAC;;AAGpC,IAAA,UAAU,GAAG,KAAK,CACjC,4EAA4E,iFAC5E;;IAGe,OAAO,GAAG,KAAK,CAAS,CAAA,cAAA,EAAiB,EAAE,WAAW,CAAC,GAAG,CAAA,CAAE,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,SAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAC;;AAG7D,IAAA,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AACL,wBAAA,oBAAoB,EAAE,kBAAkB;AACxC,qBAAA;AACD,oBAAA,QAAQ,EAAE;;;;;;AAMT,CAAA,CAAA;AACD,iBAAA;;;MCXY,kBAAkB,GAAG,CAAC,WAAW,EAAE,eAAe;;ACN/D;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"spartan-ng-brain-input-otp.mjs","sources":["../../../../libs/brain/input-otp/src/lib/brn-input-otp.token.ts","../../../../libs/brain/input-otp/src/lib/brn-input-otp.ts","../../../../libs/brain/input-otp/src/lib/brn-input-otp-slot.ts","../../../../libs/brain/input-otp/src/index.ts","../../../../libs/brain/input-otp/src/spartan-ng-brain-input-otp.ts"],"sourcesContent":["import { type ExistingProvider, inject, InjectionToken, type Type } from '@angular/core';\nimport type { BrnInputOtp } from './brn-input-otp';\n\nexport const BrnInputOtpToken = new InjectionToken<BrnInputOtp>('BrnInputOtpToken');\n\nexport function injectBrnInputOtp(): BrnInputOtp {\n\treturn inject(BrnInputOtpToken) as BrnInputOtp;\n}\n\nexport function provideBrnInputOtp(inputOtp: Type<BrnInputOtp>): ExistingProvider {\n\treturn { provide: BrnInputOtpToken, useExisting: inputOtp };\n}\n","import type { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport {\n\tafterNextRender,\n\tbooleanAttribute,\n\tChangeDetectionStrategy,\n\tComponent,\n\tcomputed,\n\tElementRef,\n\tforwardRef,\n\tinput,\n\tlinkedSignal,\n\tnumberAttribute,\n\toutput,\n\tsignal,\n\tviewChild,\n} from '@angular/core';\nimport { type ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport type { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';\nimport type { ClassValue } from 'clsx';\nimport { provideBrnInputOtp } from './brn-input-otp.token';\n\nexport const BRN_INPUT_OTP_VALUE_ACCESSOR = {\n\tprovide: NG_VALUE_ACCESSOR,\n\tuseExisting: forwardRef(() => BrnInputOtp),\n\tmulti: true,\n};\n\nexport type InputMode = 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';\n\n@Component({\n\tselector: 'brn-input-otp',\n\tproviders: [BRN_INPUT_OTP_VALUE_ACCESSOR, provideBrnInputOtp(BrnInputOtp)],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\thost: {\n\t\t'[style]': 'hostStyles()',\n\t\t'data-input-otp-container': 'true',\n\t},\n\ttemplate: `\n\t\t<ng-content />\n\t\t<div [style]=\"containerStyles()\">\n\t\t\t<input\n\t\t\t\t#otpInput\n\t\t\t\tdata-slot=\"input-otp\"\n\t\t\t\t[id]=\"inputId()\"\n\t\t\t\t[class]=\"inputClass()\"\n\t\t\t\t[autocomplete]=\"inputAutocomplete()\"\n\t\t\t\t[style]=\"inputStyles()\"\n\t\t\t\t[disabled]=\"_disabled()\"\n\t\t\t\t[inputMode]=\"inputMode()\"\n\t\t\t\t[value]=\"value() ?? ''\"\n\t\t\t\t(input)=\"onInputChange($event)\"\n\t\t\t\t(paste)=\"onPaste($event)\"\n\t\t\t\t(focus)=\"_focused.set(true)\"\n\t\t\t\t(blur)=\"_focused.set(false)\"\n\t\t\t/>\n\t\t</div>\n\t`,\n})\nexport class BrnInputOtp implements ControlValueAccessor {\n\tprivate static _id = 0;\n\n\t/** Whether the input has focus. */\n\tprotected readonly _focused = signal<boolean>(false);\n\n\t/** Styles applied to the host element. */\n\tpublic readonly hostStyles = input<string>(\n\t\t'position: relative; cursor: text; user-select: none; pointer-events: none;',\n\t);\n\n\t/** Custom id applied to the input element */\n\tpublic readonly inputId = input<string>(`brn-input-otp-${++BrnInputOtp._id}`);\n\n\t/** Custom autocomplete attribute applied to the input element */\n\tpublic readonly inputAutocomplete = input<'one-time-code' | 'off'>('one-time-code');\n\n\t/** Styles applied to the input element to make it invisible and clickable. */\n\tpublic readonly inputStyles = input<string>(\n\t\t'position: absolute; inset: 0; width: 100%; height: 100%; display: flex; textAlign: left; opacity: 1; color: transparent; pointerEvents: all; background: transparent; caret-color: transparent; border: 0px solid transparent; outline: transparent solid 0px; box-shadow: none; line-height: 1; letter-spacing: -0.5em; font-family: monospace; font-variant-numeric: tabular-nums;',\n\t);\n\n\t/** Styles applied to the container element. */\n\tpublic readonly containerStyles = input<string>('position: absolute; inset: 0; pointer-events: none;');\n\n\t/** Determine if the date picker is disabled. */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\tprotected readonly _disabled = linkedSignal(this.disabled);\n\n\t/** The number of slots. */\n\tpublic readonly maxLength = input.required<number, NumberInput>({ transform: numberAttribute });\n\n\t/** Virtual keyboard appearance on mobile */\n\tpublic readonly inputMode = input<InputMode>('numeric');\n\n\tpublic readonly inputClass = input<ClassValue>('');\n\n\t/** If true, the element is focused automatically on init **/\n\tpublic readonly autofocus = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n\t/**\n\t * Defines how the pasted text should be transformed before saving to model/form.\n\t * Allows pasting text which contains extra characters like spaces, dashes, etc. and are longer than the maxLength.\n\t *\n\t * \"XXX-XXX\": (pastedText) => pastedText.replaceAll('-', '')\n\t * \"XXX XXX\": (pastedText) => pastedText.replaceAll(/\\s+/g, '')\n\t */\n\tpublic readonly transformPaste = input<(pastedText: string, maxLength: number) => string>((text) => text);\n\n\t/** The value controlling the input */\n\tpublic readonly valueInput = input<string | null>(null, { alias: 'value' });\n\tpublic readonly value = linkedSignal(this.valueInput);\n\n\t/** Emits when the value changes. */\n\tpublic readonly valueChange = output<string>();\n\n\tpublic readonly context = computed(() => {\n\t\tconst value = this.value() ?? '';\n\t\tconst focused = this._focused();\n\t\tconst maxLength = this.maxLength();\n\t\tconst slots = Array.from({ length: this.maxLength() }).map((_, slotIndex) => {\n\t\t\tconst char = value[slotIndex] !== undefined ? value[slotIndex] : null;\n\n\t\t\tconst isActive =\n\t\t\t\tfocused && (value.length === slotIndex || (value.length === maxLength && slotIndex === maxLength - 1));\n\n\t\t\treturn {\n\t\t\t\tchar,\n\t\t\t\tisActive,\n\t\t\t\thasFakeCaret: isActive && value.length === slotIndex,\n\t\t\t};\n\t\t});\n\n\t\treturn slots;\n\t});\n\n\t/** Emitted when the input is complete, triggered through input or paste. */\n\tpublic readonly completed = output<string>();\n\n\tprotected _onChange?: ChangeFn<string>;\n\tprotected _onTouched?: TouchFn;\n\n\tprotected readonly _inputComponentRef = viewChild.required<ElementRef>('otpInput');\n\n\tconstructor() {\n\t\tafterNextRender(() => {\n\t\t\tif (this.autofocus()) {\n\t\t\t\tthis._inputComponentRef().nativeElement.focus();\n\t\t\t}\n\t\t});\n\t}\n\n\tprotected onInputChange(event: Event) {\n\t\tlet newValue = (event.target as HTMLInputElement).value;\n\t\tconst maxLength = this.maxLength();\n\n\t\tif (newValue.length > maxLength) {\n\t\t\t// Replace the last character when max length is exceeded\n\t\t\tnewValue = newValue.slice(0, maxLength - 1) + newValue.slice(-1);\n\t\t}\n\n\t\tthis.updateValue(newValue, maxLength);\n\t}\n\n\tprotected onPaste(event: ClipboardEvent) {\n\t\tevent.preventDefault();\n\t\tconst clipboardData = event.clipboardData?.getData('text/plain') || '';\n\n\t\tconst maxLength = this.maxLength();\n\n\t\tconst content = this.transformPaste()(clipboardData, maxLength);\n\t\tconst newValue = content.slice(0, maxLength);\n\n\t\tthis.updateValue(newValue, maxLength);\n\t}\n\n\t/** CONTROL VALUE ACCESSOR */\n\twriteValue(value: string | null): void {\n\t\tthis.value.set(value);\n\t\tif (value?.length === this.maxLength()) {\n\t\t\tthis.completed.emit(value ?? '');\n\t\t}\n\t}\n\n\tregisterOnChange(fn: ChangeFn<string>): void {\n\t\tthis._onChange = fn;\n\t}\n\n\tregisterOnTouched(fn: TouchFn): void {\n\t\tthis._onTouched = fn;\n\t}\n\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis._disabled.set(isDisabled);\n\t}\n\n\tprivate isCompleted(newValue: string, previousValue: string, maxLength: number) {\n\t\treturn newValue !== previousValue && previousValue.length < maxLength && newValue.length === maxLength;\n\t}\n\n\tprivate updateValue(newValue: string, maxLength: number) {\n\t\tconst previousValue = this.value() ?? '';\n\n\t\tthis.value.set(newValue);\n\t\tthis.valueChange.emit(newValue);\n\t\tthis._onChange?.(newValue);\n\n\t\tif (this.isCompleted(newValue, previousValue, maxLength)) {\n\t\t\tthis.completed.emit(newValue);\n\t\t}\n\t}\n}\n","import type { NumberInput } from '@angular/cdk/coercion';\nimport { ChangeDetectionStrategy, Component, computed, input, numberAttribute } from '@angular/core';\nimport { injectBrnInputOtp } from './brn-input-otp.token';\n\n@Component({\n\tselector: 'brn-input-otp-slot',\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\thost: {\n\t\t'[attr.data-active]': '_slot().isActive',\n\t},\n\ttemplate: `\n\t\t{{ _slot().char }}\n\n\t\t@if (_slot().hasFakeCaret) {\n\t\t\t<ng-content />\n\t\t}\n\t`,\n})\nexport class BrnInputOtpSlot {\n\t/** Access the input-otp component */\n\tprotected readonly _inputOtp = injectBrnInputOtp();\n\n\t/** The index of the slot to render the char or a fake caret */\n\tpublic readonly index = input.required<number, NumberInput>({ transform: numberAttribute });\n\n\tprotected readonly _slot = computed(() => this._inputOtp.context()[this.index()]);\n}\n","import { BrnInputOtp } from './lib/brn-input-otp';\nimport { BrnInputOtpSlot } from './lib/brn-input-otp-slot';\n\nexport * from './lib/brn-input-otp';\nexport * from './lib/brn-input-otp-slot';\n\nexport const BrnInputOtpImports = [BrnInputOtp, BrnInputOtpSlot] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAGO,MAAM,gBAAgB,GAAG,IAAI,cAAc,CAAc,kBAAkB,CAAC;SAEnE,iBAAiB,GAAA;AAChC,IAAA,OAAO,MAAM,CAAC,gBAAgB,CAAgB;AAC/C;AAEM,SAAU,kBAAkB,CAAC,QAA2B,EAAA;IAC7D,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,QAAQ,EAAE;AAC5D;;ACUO,MAAM,4BAA4B,GA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B,CAAC,MAAM;AAC/C,oBAAA,IAAI,EAAE;AACL,wBAAA,oBAAoB,EAAE,kBAAkB;AACxC,qBAAA;AACD,oBAAA,QAAQ,EAAE;;;;;;AAMT,CAAA,CAAA;AACD,iBAAA;;;MCXY,kBAAkB,GAAG,CAAC,WAAW,EAAE,eAAe;;ACN/D;;AAEG;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FocusMonitor } from '@angular/cdk/a11y';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { InjectionToken, inject, ElementRef, input, booleanAttribute, computed, output, viewChild, ChangeDetectionStrategy, Component, forwardRef,
|
|
3
|
+
import { InjectionToken, inject, ElementRef, input, booleanAttribute, computed, output, viewChild, ChangeDetectionStrategy, Component, forwardRef, linkedSignal, contentChildren, Directive } from '@angular/core';
|
|
4
4
|
import { Directionality } from '@angular/cdk/bidi';
|
|
5
5
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
6
6
|
import * as i1 from '@spartan-ng/brain/field';
|
|
@@ -211,7 +211,8 @@ class BrnRadioGroup {
|
|
|
211
211
|
/**
|
|
212
212
|
* The value of the selected radio button.
|
|
213
213
|
*/
|
|
214
|
-
|
|
214
|
+
valueInput = input(undefined, { ...(ngDevMode ? { debugName: "valueInput" } : /* istanbul ignore next */ {}), alias: 'value' });
|
|
215
|
+
value = linkedSignal(this.valueInput, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
215
216
|
/** Emits when the value changes. */
|
|
216
217
|
valueChange = output();
|
|
217
218
|
/**
|
|
@@ -271,7 +272,7 @@ class BrnRadioGroup {
|
|
|
271
272
|
this.change.emit(new BrnRadioChange(radioButton, value));
|
|
272
273
|
}
|
|
273
274
|
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnRadioGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
274
|
-
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.2.16", type: BrnRadioGroup, isStandalone: true, selector: "[brnRadioGroup]", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null },
|
|
275
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.2.16", type: BrnRadioGroup, isStandalone: true, selector: "[brnRadioGroup]", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, valueInput: { classPropertyName: "valueInput", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", change: "change" }, host: { attributes: { "role": "radiogroup" }, listeners: { "focusout": "onTouched()" }, properties: { "dir": "direction()", "attr.aria-invalid": "_ariaInvalid() ? \"true\" : null", "attr.data-invalid": "_ariaInvalid() ? \"true\" : null", "attr.data-dirty": "_dirty() ? \"true\" : null", "attr.data-touched": "_touched() ? \"true\" : null", "attr.data-matches-spartan-invalid": "_spartanInvalid() ? \"true\" : null" } }, providers: [BRN_RADIO_GROUP_CONTROL_VALUE_ACCESSOR, provideBrnRadioGroupToken(BrnRadioGroup)], queries: [{ propertyName: "radioButtons", predicate: BrnRadio, descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.BrnFieldControl }], ngImport: i0 });
|
|
275
276
|
}
|
|
276
277
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnRadioGroup, decorators: [{
|
|
277
278
|
type: Directive,
|
|
@@ -290,7 +291,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
290
291
|
'[attr.data-matches-spartan-invalid]': '_spartanInvalid() ? "true" : null',
|
|
291
292
|
},
|
|
292
293
|
}]
|
|
293
|
-
}], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }],
|
|
294
|
+
}], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], valueInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], change: [{ type: i0.Output, args: ["change"] }], radioButtons: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => BrnRadio), { ...{ descendants: true }, isSignal: true }] }] } });
|
|
294
295
|
|
|
295
296
|
const BrnRadioGroupImports = [BrnRadioGroup, BrnRadio];
|
|
296
297
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spartan-ng-brain-radio-group.mjs","sources":["../../../../libs/brain/radio-group/src/lib/brn-radio-group.token.ts","../../../../libs/brain/radio-group/src/lib/brn-radio.ts","../../../../libs/brain/radio-group/src/lib/brn-radio-group.ts","../../../../libs/brain/radio-group/src/index.ts","../../../../libs/brain/radio-group/src/spartan-ng-brain-radio-group.ts"],"sourcesContent":["import { type ExistingProvider, inject, InjectionToken, type Type } from '@angular/core';\nimport type { BrnRadioGroup } from './brn-radio-group';\n\nconst BrnRadioGroupToken = new InjectionToken<BrnRadioGroup<unknown>>('BrnRadioGroupToken');\n\nexport function provideBrnRadioGroupToken<T>(directive: Type<BrnRadioGroup<T>>): ExistingProvider {\n\treturn { provide: BrnRadioGroupToken, useExisting: directive };\n}\n\nexport function injectBrnRadioGroup<T = unknown>(): BrnRadioGroup<T> {\n\treturn inject(BrnRadioGroupToken) as BrnRadioGroup<T>;\n}\n","import { FocusMonitor } from '@angular/cdk/a11y';\nimport type { BooleanInput } from '@angular/cdk/coercion';\nimport {\n\tChangeDetectionStrategy,\n\tComponent,\n\tElementRef,\n\ttype OnDestroy,\n\tbooleanAttribute,\n\tcomputed,\n\tinject,\n\tinput,\n\toutput,\n\tviewChild,\n} from '@angular/core';\nimport { injectBrnRadioGroup } from './brn-radio-group.token';\n\nexport class BrnRadioChange<T> {\n\tconstructor(\n\t\tpublic source: BrnRadio<T>,\n\t\tpublic value: T,\n\t) {}\n}\n\nconst CONTAINER_POST_FIX = '-radio';\n\nconst INPUT_POST_FIX = '-input';\n\n@Component({\n\tselector: 'brn-radio',\n\texportAs: 'brnRadio',\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\thost: {\n\t\tclass: 'brn-radio',\n\t\t'[attr.id]': '_hostId()',\n\t\t'[class.brn-radio-checked]': '_checked()',\n\t\t'[class.brn-radio-disabled]': '_disabledState()',\n\t\t'[attr.data-checked]': '_checked()',\n\t\t'[attr.data-disabled]': '_disabledState()',\n\t\t'[attr.data-value]': 'value()',\n\t\t// Needs to be removed since it causes some a11y issues (see #21266).\n\t\t'[attr.tabindex]': 'null',\n\t\t'[attr.aria-label]': 'null',\n\t\t'[attr.aria-labelledby]': 'null',\n\t\t'[attr.aria-describedby]': 'null',\n\t\t// Note: under normal conditions focus shouldn't land on this element, however it may be\n\t\t// programmatically set, for example inside of a focus trap, in this case we want to forward\n\t\t// the focus to the native element.\n\t\t'(focus)': '_inputElement().nativeElement.focus()',\n\t},\n\ttemplate: `\n\t\t<div data-slot=\"indicator\" class=\"flex h-fit w-fit empty:hidden\" (click)=\"onTouchTargetClick($event)\">\n\t\t\t<ng-content select=\"[target],[indicator]\" />\n\t\t</div>\n\t\t<input\n\t\t\t#input\n\t\t\tstyle=\"position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;\"\n\t\t\ttype=\"radio\"\n\t\t\t[attr.id]=\"_inputId()\"\n\t\t\t[checked]=\"_checked()\"\n\t\t\t[disabled]=\"_disabledState()\"\n\t\t\t[tabIndex]=\"_tabIndex()\"\n\t\t\t[attr.name]=\"_radioGroup.name()\"\n\t\t\t[attr.value]=\"value()\"\n\t\t\t[required]=\"required()\"\n\t\t\t[attr.aria-checked]=\"_checked()\"\n\t\t\t[attr.aria-label]=\"ariaLabel()\"\n\t\t\t[attr.aria-labelledby]=\"ariaLabelledby()\"\n\t\t\t[attr.aria-describedby]=\"ariaDescribedby()\"\n\t\t\t[attr.aria-disabled]=\"_disabledState()\"\n\t\t\t(change)=\"onInputInteraction($event)\"\n\t\t\t(click)=\"onInputClick($event)\"\n\t\t/>\n\t\t<ng-content />\n\t`,\n})\nexport class BrnRadio<T = unknown> implements OnDestroy {\n\tprivate static _nextUniqueId = 0;\n\tprivate readonly _focusMonitor = inject(FocusMonitor);\n\tprivate readonly _elementRef = inject(ElementRef);\n\tprotected readonly _radioGroup = injectBrnRadioGroup<T>();\n\n\t/**\n\t * Whether the radio button is disabled.\n\t */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n\t/**\n\t * Whether the radio button is disabled or the radio group is disabled.\n\t */\n\tprotected readonly _disabledState = computed(() => this.disabled() || this._radioGroup.disabledState());\n\n\t/**\n\t * Whether the radio button is checked.\n\t */\n\tprotected readonly _checked = computed(() => this._radioGroup.value() === this.value());\n\n\tprotected readonly _tabIndex = computed(() => {\n\t\tconst disabled = this._disabledState();\n\t\tconst checked = this._checked();\n\t\tconst hasSelectedRadio = this._radioGroup.value() !== undefined;\n\t\tconst isFirstRadio = this._radioGroup.radioButtons()[0] === this;\n\n\t\tif (disabled || (!checked && (hasSelectedRadio || !isFirstRadio))) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn 0;\n\t});\n\n\t/**\n\t * The unique ID for the radio button input. If none is supplied, it will be auto-generated.\n\t */\n\tpublic readonly id = input<string | undefined>(undefined);\n\n\tpublic readonly ariaLabel = input<string | undefined>(undefined, { alias: 'aria-label' });\n\n\tpublic readonly ariaLabelledby = input<string | undefined>(undefined, { alias: 'aria-labelledby' });\n\n\tpublic readonly ariaDescribedby = input<string | undefined>(undefined, { alias: 'aria-describedby' });\n\n\t/**\n\t * The value this radio button represents.\n\t */\n\tpublic readonly value = input.required<T>();\n\n\t/**\n\t * Whether the radio button is required.\n\t */\n\tpublic readonly required = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/**\n\t * Event emitted when the checked state of this radio button changes.\n\t */\n\tpublic readonly change = output<BrnRadioChange<T>>();\n\n\tprotected readonly _hostId = computed(() => {\n\t\treturn this.id() ? this.id() + CONTAINER_POST_FIX : `brn-radio-${++BrnRadio._nextUniqueId}`;\n\t});\n\n\tprotected readonly _inputId = computed(() => {\n\t\treturn this.id() ?? `brn-radio${INPUT_POST_FIX}-${++BrnRadio._nextUniqueId}`;\n\t});\n\n\tprotected readonly _inputElement = viewChild.required<ElementRef<HTMLInputElement>>('input');\n\n\tconstructor() {\n\t\tthis._focusMonitor.monitor(this._elementRef, true);\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis._focusMonitor.stopMonitoring(this._elementRef);\n\t}\n\n\t/** Dispatch change event with current value. */\n\tprivate emitChangeEvent(): void {\n\t\tthis.change.emit(new BrnRadioChange(this, this.value()));\n\t}\n\n\tprotected onInputClick(event: Event): void {\n\t\t// We have to stop propagation for click events on the visual hidden input element.\n\t\t// By default, when a user clicks on a label element, a generated click event will be\n\t\t// dispatched on the associated input element. Since we are using a label element as our\n\t\t// root container, the click event on the `radio-button` will be executed twice.\n\t\t// The real click event will bubble up, and the generated click event also tries to bubble up.\n\t\t// This will lead to multiple click events.\n\t\t// Preventing bubbling for the second event will solve that issue.\n\t\tevent.stopPropagation();\n\t}\n\n\tprotected onInputInteraction(event: Event): void {\n\t\t// We always have to stop propagation on the change event.\n\t\t// Otherwise the change event, from the input element, will bubble up and\n\t\t// emit its event object to the `change` output.\n\t\tevent.stopPropagation();\n\n\t\tif (!this._checked() && !this._disabledState()) {\n\t\t\tthis.emitChangeEvent();\n\t\t\tthis._radioGroup.select(this, this.value());\n\t\t}\n\t}\n\n\t/** Triggered when the user clicks on the touch target. */\n\tprotected onTouchTargetClick(event: Event): void {\n\t\tthis.onInputInteraction(event);\n\n\t\tif (!this._disabledState()) {\n\t\t\t// Normally the input should be focused already, but if the click\n\t\t\t// comes from the touch target, then we might have to focus it ourselves.\n\t\t\tthis._inputElement().nativeElement.focus();\n\t\t}\n\t}\n}\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport { Directionality } from '@angular/cdk/bidi';\nimport type { BooleanInput } from '@angular/cdk/coercion';\nimport {\n\tbooleanAttribute,\n\tcomputed,\n\tcontentChildren,\n\tDirective,\n\tforwardRef,\n\tinject,\n\tinput,\n\tlinkedSignal,\n\tmodel,\n\toutput,\n} from '@angular/core';\nimport { type ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BrnFieldControl } from '@spartan-ng/brain/field';\nimport { type ChangeFn, type TouchFn } from '@spartan-ng/brain/forms';\nimport { BrnRadio, BrnRadioChange } from './brn-radio';\nimport { provideBrnRadioGroupToken } from './brn-radio-group.token';\n\nexport const BRN_RADIO_GROUP_CONTROL_VALUE_ACCESSOR = {\n\tprovide: NG_VALUE_ACCESSOR,\n\tuseExisting: forwardRef(() => BrnRadioGroup),\n\tmulti: true,\n};\n\n@Directive({\n\tselector: '[brnRadioGroup]',\n\tproviders: [BRN_RADIO_GROUP_CONTROL_VALUE_ACCESSOR, provideBrnRadioGroupToken(BrnRadioGroup)],\n\thostDirectives: [BrnFieldControl],\n\thost: {\n\t\trole: 'radiogroup',\n\t\t'[dir]': 'direction()',\n\t\t'(focusout)': 'onTouched()',\n\t\t'[attr.aria-invalid]': '_ariaInvalid() ? \"true\" : null',\n\t\t'[attr.data-invalid]': '_ariaInvalid() ? \"true\" : null',\n\t\t'[attr.data-dirty]': '_dirty() ? \"true\" : null',\n\t\t'[attr.data-touched]': '_touched() ? \"true\" : null',\n\t\t'[attr.data-matches-spartan-invalid]': '_spartanInvalid() ? \"true\" : null',\n\t},\n})\nexport class BrnRadioGroup<T = unknown> implements ControlValueAccessor {\n\tprivate readonly _dir = inject(Directionality);\n\tprivate readonly _fieldControl = inject(BrnFieldControl, { optional: true });\n\tprivate static _nextUniqueId = 0;\n\n\tprotected onChange: ChangeFn<T> = () => {};\n\n\tprotected onTouched: TouchFn = () => {};\n\n\tpublic readonly name = input<string>(`brn-radio-group-${++BrnRadioGroup._nextUniqueId}`);\n\n\t/**\n\t * The value of the selected radio button.\n\t */\n\tpublic readonly value = model<T>();\n\n\t/** Emits when the value changes. */\n\tpublic readonly valueChange = output<T>();\n\n\t/**\n\t * Whether the radio group is disabled.\n\t */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/**\n\t * Whether the radio group should be required.\n\t */\n\tpublic readonly required = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/**\n\t * The direction of the radio group.\n\t */\n\tpublic readonly direction = this._dir.valueSignal;\n\n\t/**\n\t * Event emitted when the group value changes.\n\t */\n\tpublic readonly change = output<BrnRadioChange<T>>();\n\n\t/**\n\t * The internal disabled state of the radio group.\n\t * @internal\n\t */\n\tpublic readonly disabledState = linkedSignal(() => this.disabled());\n\n\tpublic readonly controlState = this._fieldControl?.controlState;\n\tprotected readonly _ariaInvalid = computed(() => this._fieldControl?.invalid());\n\tprotected readonly _spartanInvalid = computed(() => this._fieldControl?.spartanInvalid());\n\tprotected readonly _dirty = computed(() => this._fieldControl?.dirty());\n\tprotected readonly _touched = computed(() => this._fieldControl?.touched());\n\n\t/**\n\t * Access the radio buttons within the group.\n\t * @internal\n\t */\n\tpublic readonly radioButtons = contentChildren(BrnRadio, { descendants: true });\n\n\twriteValue(value: T): void {\n\t\tthis.value.set(value);\n\t}\n\n\tregisterOnChange(fn: ChangeFn<T>): void {\n\t\tthis.onChange = fn;\n\t}\n\n\tregisterOnTouched(fn: TouchFn): void {\n\t\tthis.onTouched = fn;\n\t}\n\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis.disabledState.set(isDisabled);\n\t}\n\n\t/**\n\t * Select a radio button.\n\t * @internal\n\t */\n\tselect(radioButton: BrnRadio<T>, value: T): void {\n\t\tif (this.value() === value) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.value.set(value);\n\t\tthis.valueChange.emit(value);\n\t\tthis.onChange(value);\n\t\tthis.change.emit(new BrnRadioChange<T>(radioButton, value));\n\t}\n}\n","import { BrnRadio } from './lib/brn-radio';\nimport { BrnRadioGroup } from './lib/brn-radio-group';\n\nexport * from './lib/brn-radio';\nexport * from './lib/brn-radio-group';\nexport * from './lib/brn-radio-group.token';\n\nexport const BrnRadioGroupImports = [BrnRadioGroup, BrnRadio] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAGA,MAAM,kBAAkB,GAAG,IAAI,cAAc,CAAyB,oBAAoB,CAAC;AAErF,SAAU,yBAAyB,CAAI,SAAiC,EAAA;IAC7E,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,SAAS,EAAE;AAC/D;SAEgB,mBAAmB,GAAA;AAClC,IAAA,OAAO,MAAM,CAAC,kBAAkB,CAAqB;AACtD;;MCKa,cAAc,CAAA;AAElB,IAAA,MAAA;AACA,IAAA,KAAA;IAFR,WAAA,CACQ,MAAmB,EACnB,KAAQ,EAAA;QADR,IAAA,CAAA,MAAM,GAAN,MAAM;QACN,IAAA,CAAA,KAAK,GAAL,KAAK;IACV;AACH;AAED,MAAM,kBAAkB,GAAG,QAAQ;AAEnC,MAAM,cAAc,GAAG,QAAQ;MAkDlB,QAAQ,CAAA;AACZ,IAAA,OAAO,aAAa,GAAG,CAAC;AACf,IAAA,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC;AACpC,IAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;IAC9B,WAAW,GAAG,mBAAmB,EAAK;AAEzD;;AAEG;IACa,QA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KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,UAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAAA,QAAQ,CAAA,EAAA,EAAA,GAAE,EAAE,WAAW,EAAE,IAAI,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;MC9FlE,oBAAoB,GAAG,CAAC,aAAa,EAAE,QAAQ;;ACP5D;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"spartan-ng-brain-radio-group.mjs","sources":["../../../../libs/brain/radio-group/src/lib/brn-radio-group.token.ts","../../../../libs/brain/radio-group/src/lib/brn-radio.ts","../../../../libs/brain/radio-group/src/lib/brn-radio-group.ts","../../../../libs/brain/radio-group/src/index.ts","../../../../libs/brain/radio-group/src/spartan-ng-brain-radio-group.ts"],"sourcesContent":["import { type ExistingProvider, inject, InjectionToken, type Type } from '@angular/core';\nimport type { BrnRadioGroup } from './brn-radio-group';\n\nconst BrnRadioGroupToken = new InjectionToken<BrnRadioGroup<unknown>>('BrnRadioGroupToken');\n\nexport function provideBrnRadioGroupToken<T>(directive: Type<BrnRadioGroup<T>>): ExistingProvider {\n\treturn { provide: BrnRadioGroupToken, useExisting: directive };\n}\n\nexport function injectBrnRadioGroup<T = unknown>(): BrnRadioGroup<T> {\n\treturn inject(BrnRadioGroupToken) as BrnRadioGroup<T>;\n}\n","import { FocusMonitor } from '@angular/cdk/a11y';\nimport type { BooleanInput } from '@angular/cdk/coercion';\nimport {\n\tChangeDetectionStrategy,\n\tComponent,\n\tElementRef,\n\ttype OnDestroy,\n\tbooleanAttribute,\n\tcomputed,\n\tinject,\n\tinput,\n\toutput,\n\tviewChild,\n} from '@angular/core';\nimport { injectBrnRadioGroup } from './brn-radio-group.token';\n\nexport class BrnRadioChange<T> {\n\tconstructor(\n\t\tpublic source: BrnRadio<T>,\n\t\tpublic value: T,\n\t) {}\n}\n\nconst CONTAINER_POST_FIX = '-radio';\n\nconst INPUT_POST_FIX = '-input';\n\n@Component({\n\tselector: 'brn-radio',\n\texportAs: 'brnRadio',\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\thost: {\n\t\tclass: 'brn-radio',\n\t\t'[attr.id]': '_hostId()',\n\t\t'[class.brn-radio-checked]': '_checked()',\n\t\t'[class.brn-radio-disabled]': '_disabledState()',\n\t\t'[attr.data-checked]': '_checked()',\n\t\t'[attr.data-disabled]': '_disabledState()',\n\t\t'[attr.data-value]': 'value()',\n\t\t// Needs to be removed since it causes some a11y issues (see #21266).\n\t\t'[attr.tabindex]': 'null',\n\t\t'[attr.aria-label]': 'null',\n\t\t'[attr.aria-labelledby]': 'null',\n\t\t'[attr.aria-describedby]': 'null',\n\t\t// Note: under normal conditions focus shouldn't land on this element, however it may be\n\t\t// programmatically set, for example inside of a focus trap, in this case we want to forward\n\t\t// the focus to the native element.\n\t\t'(focus)': '_inputElement().nativeElement.focus()',\n\t},\n\ttemplate: `\n\t\t<div data-slot=\"indicator\" class=\"flex h-fit w-fit empty:hidden\" (click)=\"onTouchTargetClick($event)\">\n\t\t\t<ng-content select=\"[target],[indicator]\" />\n\t\t</div>\n\t\t<input\n\t\t\t#input\n\t\t\tstyle=\"position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;\"\n\t\t\ttype=\"radio\"\n\t\t\t[attr.id]=\"_inputId()\"\n\t\t\t[checked]=\"_checked()\"\n\t\t\t[disabled]=\"_disabledState()\"\n\t\t\t[tabIndex]=\"_tabIndex()\"\n\t\t\t[attr.name]=\"_radioGroup.name()\"\n\t\t\t[attr.value]=\"value()\"\n\t\t\t[required]=\"required()\"\n\t\t\t[attr.aria-checked]=\"_checked()\"\n\t\t\t[attr.aria-label]=\"ariaLabel()\"\n\t\t\t[attr.aria-labelledby]=\"ariaLabelledby()\"\n\t\t\t[attr.aria-describedby]=\"ariaDescribedby()\"\n\t\t\t[attr.aria-disabled]=\"_disabledState()\"\n\t\t\t(change)=\"onInputInteraction($event)\"\n\t\t\t(click)=\"onInputClick($event)\"\n\t\t/>\n\t\t<ng-content />\n\t`,\n})\nexport class BrnRadio<T = unknown> implements OnDestroy {\n\tprivate static _nextUniqueId = 0;\n\tprivate readonly _focusMonitor = inject(FocusMonitor);\n\tprivate readonly _elementRef = inject(ElementRef);\n\tprotected readonly _radioGroup = injectBrnRadioGroup<T>();\n\n\t/**\n\t * Whether the radio button is disabled.\n\t */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n\t/**\n\t * Whether the radio button is disabled or the radio group is disabled.\n\t */\n\tprotected readonly _disabledState = computed(() => this.disabled() || this._radioGroup.disabledState());\n\n\t/**\n\t * Whether the radio button is checked.\n\t */\n\tprotected readonly _checked = computed(() => this._radioGroup.value() === this.value());\n\n\tprotected readonly _tabIndex = computed(() => {\n\t\tconst disabled = this._disabledState();\n\t\tconst checked = this._checked();\n\t\tconst hasSelectedRadio = this._radioGroup.value() !== undefined;\n\t\tconst isFirstRadio = this._radioGroup.radioButtons()[0] === this;\n\n\t\tif (disabled || (!checked && (hasSelectedRadio || !isFirstRadio))) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn 0;\n\t});\n\n\t/**\n\t * The unique ID for the radio button input. If none is supplied, it will be auto-generated.\n\t */\n\tpublic readonly id = input<string | undefined>(undefined);\n\n\tpublic readonly ariaLabel = input<string | undefined>(undefined, { alias: 'aria-label' });\n\n\tpublic readonly ariaLabelledby = input<string | undefined>(undefined, { alias: 'aria-labelledby' });\n\n\tpublic readonly ariaDescribedby = input<string | undefined>(undefined, { alias: 'aria-describedby' });\n\n\t/**\n\t * The value this radio button represents.\n\t */\n\tpublic readonly value = input.required<T>();\n\n\t/**\n\t * Whether the radio button is required.\n\t */\n\tpublic readonly required = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/**\n\t * Event emitted when the checked state of this radio button changes.\n\t */\n\tpublic readonly change = output<BrnRadioChange<T>>();\n\n\tprotected readonly _hostId = computed(() => {\n\t\treturn this.id() ? this.id() + CONTAINER_POST_FIX : `brn-radio-${++BrnRadio._nextUniqueId}`;\n\t});\n\n\tprotected readonly _inputId = computed(() => {\n\t\treturn this.id() ?? `brn-radio${INPUT_POST_FIX}-${++BrnRadio._nextUniqueId}`;\n\t});\n\n\tprotected readonly _inputElement = viewChild.required<ElementRef<HTMLInputElement>>('input');\n\n\tconstructor() {\n\t\tthis._focusMonitor.monitor(this._elementRef, true);\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis._focusMonitor.stopMonitoring(this._elementRef);\n\t}\n\n\t/** Dispatch change event with current value. */\n\tprivate emitChangeEvent(): void {\n\t\tthis.change.emit(new BrnRadioChange(this, this.value()));\n\t}\n\n\tprotected onInputClick(event: Event): void {\n\t\t// We have to stop propagation for click events on the visual hidden input element.\n\t\t// By default, when a user clicks on a label element, a generated click event will be\n\t\t// dispatched on the associated input element. Since we are using a label element as our\n\t\t// root container, the click event on the `radio-button` will be executed twice.\n\t\t// The real click event will bubble up, and the generated click event also tries to bubble up.\n\t\t// This will lead to multiple click events.\n\t\t// Preventing bubbling for the second event will solve that issue.\n\t\tevent.stopPropagation();\n\t}\n\n\tprotected onInputInteraction(event: Event): void {\n\t\t// We always have to stop propagation on the change event.\n\t\t// Otherwise the change event, from the input element, will bubble up and\n\t\t// emit its event object to the `change` output.\n\t\tevent.stopPropagation();\n\n\t\tif (!this._checked() && !this._disabledState()) {\n\t\t\tthis.emitChangeEvent();\n\t\t\tthis._radioGroup.select(this, this.value());\n\t\t}\n\t}\n\n\t/** Triggered when the user clicks on the touch target. */\n\tprotected onTouchTargetClick(event: Event): void {\n\t\tthis.onInputInteraction(event);\n\n\t\tif (!this._disabledState()) {\n\t\t\t// Normally the input should be focused already, but if the click\n\t\t\t// comes from the touch target, then we might have to focus it ourselves.\n\t\t\tthis._inputElement().nativeElement.focus();\n\t\t}\n\t}\n}\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport { Directionality } from '@angular/cdk/bidi';\nimport type { BooleanInput } from '@angular/cdk/coercion';\nimport {\n\tbooleanAttribute,\n\tcomputed,\n\tcontentChildren,\n\tDirective,\n\tforwardRef,\n\tinject,\n\tinput,\n\tlinkedSignal,\n\toutput,\n} from '@angular/core';\nimport { type ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BrnFieldControl } from '@spartan-ng/brain/field';\nimport { type ChangeFn, type TouchFn } from '@spartan-ng/brain/forms';\nimport { BrnRadio, BrnRadioChange } from './brn-radio';\nimport { provideBrnRadioGroupToken } from './brn-radio-group.token';\n\nexport const BRN_RADIO_GROUP_CONTROL_VALUE_ACCESSOR = {\n\tprovide: NG_VALUE_ACCESSOR,\n\tuseExisting: forwardRef(() => BrnRadioGroup),\n\tmulti: true,\n};\n\n@Directive({\n\tselector: '[brnRadioGroup]',\n\tproviders: [BRN_RADIO_GROUP_CONTROL_VALUE_ACCESSOR, provideBrnRadioGroupToken(BrnRadioGroup)],\n\thostDirectives: [BrnFieldControl],\n\thost: {\n\t\trole: 'radiogroup',\n\t\t'[dir]': 'direction()',\n\t\t'(focusout)': 'onTouched()',\n\t\t'[attr.aria-invalid]': '_ariaInvalid() ? \"true\" : null',\n\t\t'[attr.data-invalid]': '_ariaInvalid() ? \"true\" : null',\n\t\t'[attr.data-dirty]': '_dirty() ? \"true\" : null',\n\t\t'[attr.data-touched]': '_touched() ? \"true\" : null',\n\t\t'[attr.data-matches-spartan-invalid]': '_spartanInvalid() ? \"true\" : null',\n\t},\n})\nexport class BrnRadioGroup<T = unknown> implements ControlValueAccessor {\n\tprivate readonly _dir = inject(Directionality);\n\tprivate readonly _fieldControl = inject(BrnFieldControl, { optional: true });\n\tprivate static _nextUniqueId = 0;\n\n\tprotected onChange: ChangeFn<T> = () => {};\n\n\tprotected onTouched: TouchFn = () => {};\n\n\tpublic readonly name = input<string>(`brn-radio-group-${++BrnRadioGroup._nextUniqueId}`);\n\n\t/**\n\t * The value of the selected radio button.\n\t */\n\tpublic readonly valueInput = input<T>(undefined, { alias: 'value' });\n\tpublic readonly value = linkedSignal(this.valueInput);\n\n\t/** Emits when the value changes. */\n\tpublic readonly valueChange = output<T>();\n\n\t/**\n\t * Whether the radio group is disabled.\n\t */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/**\n\t * Whether the radio group should be required.\n\t */\n\tpublic readonly required = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/**\n\t * The direction of the radio group.\n\t */\n\tpublic readonly direction = this._dir.valueSignal;\n\n\t/**\n\t * Event emitted when the group value changes.\n\t */\n\tpublic readonly change = output<BrnRadioChange<T>>();\n\n\t/**\n\t * The internal disabled state of the radio group.\n\t * @internal\n\t */\n\tpublic readonly disabledState = linkedSignal(() => this.disabled());\n\n\tpublic readonly controlState = this._fieldControl?.controlState;\n\tprotected readonly _ariaInvalid = computed(() => this._fieldControl?.invalid());\n\tprotected readonly _spartanInvalid = computed(() => this._fieldControl?.spartanInvalid());\n\tprotected readonly _dirty = computed(() => this._fieldControl?.dirty());\n\tprotected readonly _touched = computed(() => this._fieldControl?.touched());\n\n\t/**\n\t * Access the radio buttons within the group.\n\t * @internal\n\t */\n\tpublic readonly radioButtons = contentChildren(BrnRadio, { descendants: true });\n\n\twriteValue(value: T): void {\n\t\tthis.value.set(value);\n\t}\n\n\tregisterOnChange(fn: ChangeFn<T>): void {\n\t\tthis.onChange = fn;\n\t}\n\n\tregisterOnTouched(fn: TouchFn): void {\n\t\tthis.onTouched = fn;\n\t}\n\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis.disabledState.set(isDisabled);\n\t}\n\n\t/**\n\t * Select a radio button.\n\t * @internal\n\t */\n\tselect(radioButton: BrnRadio<T>, value: T): void {\n\t\tif (this.value() === value) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.value.set(value);\n\t\tthis.valueChange.emit(value);\n\t\tthis.onChange(value);\n\t\tthis.change.emit(new BrnRadioChange<T>(radioButton, value));\n\t}\n}\n","import { BrnRadio } from './lib/brn-radio';\nimport { BrnRadioGroup } from './lib/brn-radio-group';\n\nexport * from './lib/brn-radio';\nexport * from './lib/brn-radio-group';\nexport * from './lib/brn-radio-group.token';\n\nexport const BrnRadioGroupImports = [BrnRadioGroup, BrnRadio] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAGA,MAAM,kBAAkB,GAAG,IAAI,cAAc,CAAyB,oBAAoB,CAAC;AAErF,SAAU,yBAAyB,CAAI,SAAiC,EAAA;IAC7E,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,SAAS,EAAE;AAC/D;SAEgB,mBAAmB,GAAA;AAClC,IAAA,OAAO,MAAM,CAAC,kBAAkB,CAAqB;AACtD;;MCKa,cAAc,CAAA;AAElB,IAAA,MAAA;AACA,IAAA,KAAA;IAFR,WAAA,CACQ,MAAmB,EACnB,KAAQ,EAAA;QADR,IAAA,CAAA,MAAM,GAAN,MAAM;QACN,IAAA,CAAA,KAAK,GAAL,KAAK;IACV;AACH;AAED,MAAM,kBAAkB,GAAG,QAAQ;AAEnC,MAAM,cAAc,GAAG,QAAQ;MAkDlB,QAAQ,CAAA;AACZ,IAAA,OAAO,aAAa,GAAG,CAAC;AACf,IAAA,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC;AACpC,IAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;IAC9B,WAA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AA,KAAA,EAAA,UAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAAA,QAAQ,CAAA,EAAA,EAAA,GAAE,EAAE,WAAW,EAAE,IAAI,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;MC9FlE,oBAAoB,GAAG,CAAC,aAAa,EAAE,QAAQ;;ACP5D;;AAEG;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Directionality } from '@angular/cdk/bidi';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { InjectionToken, inject, forwardRef, Injector, input,
|
|
3
|
+
import { InjectionToken, inject, forwardRef, Injector, input, linkedSignal, numberAttribute, booleanAttribute, output, computed, signal, Directive, ElementRef, PLATFORM_ID, DestroyRef, TemplateRef, Renderer2, ViewContainerRef, effect } from '@angular/core';
|
|
4
4
|
import { NG_VALUE_ACCESSOR, NgControl, NgModel } from '@angular/forms';
|
|
5
5
|
import * as i1 from '@spartan-ng/brain/field';
|
|
6
6
|
import { BrnFieldControl } from '@spartan-ng/brain/field';
|
|
@@ -42,7 +42,8 @@ class BrnSlider {
|
|
|
42
42
|
* For single-thumb sliders, this contains one value.
|
|
43
43
|
* For range sliders, values are kept sorted in ascending order.
|
|
44
44
|
*/
|
|
45
|
-
|
|
45
|
+
valueInput = input([], { ...(ngDevMode ? { debugName: "valueInput" } : /* istanbul ignore next */ {}), alias: 'value' });
|
|
46
|
+
value = linkedSignal(this.valueInput, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
46
47
|
/** Minimum allowed slider value. */
|
|
47
48
|
min = input(0, { ...(ngDevMode ? { debugName: "min" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
48
49
|
/** Maximum allowed slider value. */
|
|
@@ -234,7 +235,7 @@ class BrnSlider {
|
|
|
234
235
|
}
|
|
235
236
|
}
|
|
236
237
|
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnSlider, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
237
|
-
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.16", type: BrnSlider, isStandalone: true, selector: "[brnSlider]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null },
|
|
238
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.16", type: BrnSlider, isStandalone: true, selector: "[brnSlider]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, valueInput: { classPropertyName: "valueInput", 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 }, minStepsBetweenThumbs: { classPropertyName: "minStepsBetweenThumbs", publicName: "minStepsBetweenThumbs", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, inverted: { classPropertyName: "inverted", publicName: "inverted", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, showTicks: { classPropertyName: "showTicks", publicName: "showTicks", isSignal: true, isRequired: false, transformFunction: null }, maxTicks: { classPropertyName: "maxTicks", publicName: "maxTicks", isSignal: true, isRequired: false, transformFunction: null }, tickLabelInterval: { classPropertyName: "tickLabelInterval", publicName: "tickLabelInterval", isSignal: true, isRequired: false, transformFunction: null }, formatTick: { classPropertyName: "formatTick", publicName: "formatTick", isSignal: true, isRequired: false, transformFunction: null }, draggableRange: { classPropertyName: "draggableRange", publicName: "draggableRange", isSignal: true, isRequired: false, transformFunction: null }, draggableRangeOnly: { classPropertyName: "draggableRangeOnly", publicName: "draggableRangeOnly", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, host: { attributes: { "data-slot": "slider" }, listeners: { "focusout": "_onFocusOut($event)" }, properties: { "attr.id": "id()", "attr.dir": "_direction()", "attr.aria-disabled": "mutableDisabled() ? \"true\" : null", "attr.data-disabled": "mutableDisabled() ? \"\" : null", "attr.data-inverted": "inverted() ? \"\" : null", "attr.data-orientation": "orientation()", "attr.aria-invalid": "_ariaInvalid() ? \"true\" : null", "attr.data-invalid": "_ariaInvalid() ? \"true\" : null", "attr.data-matches-spartan-invalid": "_ariaInvalid() ? \"true\" : null", "attr.data-dirty": "_dirty() ? \"true\" : null", "attr.data-touched": "_touched() ? \"true\" : null" } }, providers: [BRN_SLIDER_VALUE_ACCESSOR, provideBrnSlider(BrnSlider)], exportAs: ["brnSlider"], hostDirectives: [{ directive: i1.BrnFieldControl }], ngImport: i0 });
|
|
238
239
|
}
|
|
239
240
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnSlider, decorators: [{
|
|
240
241
|
type: Directive,
|
|
@@ -259,7 +260,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
259
260
|
'[attr.data-touched]': '_touched() ? "true" : null',
|
|
260
261
|
},
|
|
261
262
|
}]
|
|
262
|
-
}], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }],
|
|
263
|
+
}], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], valueInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], 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 }] }], minStepsBetweenThumbs: [{ type: i0.Input, args: [{ isSignal: true, alias: "minStepsBetweenThumbs", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], inverted: [{ type: i0.Input, args: [{ isSignal: true, alias: "inverted", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], showTicks: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTicks", required: false }] }], maxTicks: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxTicks", required: false }] }], tickLabelInterval: [{ type: i0.Input, args: [{ isSignal: true, alias: "tickLabelInterval", required: false }] }], formatTick: [{ type: i0.Input, args: [{ isSignal: true, alias: "formatTick", required: false }] }], draggableRange: [{ type: i0.Input, args: [{ isSignal: true, alias: "draggableRange", required: false }] }], draggableRangeOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "draggableRangeOnly", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
|
|
263
264
|
function areArrsEqual(arr1, arr2) {
|
|
264
265
|
return String(arr1) === String(arr2);
|
|
265
266
|
}
|