@spartan-ng/brain 1.1.2 → 1.2.0-beta.1
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-input-otp.mjs +49 -26
- package/fesm2022/spartan-ng-brain-input-otp.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-tooltip.mjs +63 -5
- package/fesm2022/spartan-ng-brain-tooltip.mjs.map +1 -1
- package/package.json +1 -1
- package/types/spartan-ng-brain-input-otp.d.ts +19 -5
- package/types/spartan-ng-brain-tooltip.d.ts +20 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { InjectionToken, inject, forwardRef, signal, input, booleanAttribute, linkedSignal, numberAttribute, output, computed, viewChild, afterNextRender, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
|
+
import * as i1 from '@spartan-ng/brain/field';
|
|
5
|
+
import { BrnFieldControl, provideBrnLabelable } from '@spartan-ng/brain/field';
|
|
4
6
|
|
|
5
7
|
const BrnInputOtpToken = new InjectionToken('BrnInputOtpToken');
|
|
6
8
|
function injectBrnInputOtp() {
|
|
@@ -17,12 +19,18 @@ const BRN_INPUT_OTP_VALUE_ACCESSOR = {
|
|
|
17
19
|
};
|
|
18
20
|
class BrnInputOtp {
|
|
19
21
|
static _id = 0;
|
|
22
|
+
_fieldControl = inject(BrnFieldControl, { optional: true });
|
|
23
|
+
invalid = this._fieldControl?.invalid;
|
|
24
|
+
touched = this._fieldControl?.touched;
|
|
25
|
+
dirty = this._fieldControl?.dirty;
|
|
26
|
+
spartanInvalid = this._fieldControl?.spartanInvalid;
|
|
20
27
|
/** Whether the input has focus. */
|
|
21
28
|
_focused = signal(false, ...(ngDevMode ? [{ debugName: "_focused" }] : /* istanbul ignore next */ []));
|
|
22
29
|
/** Styles applied to the host element. */
|
|
23
30
|
hostStyles = input('position: relative; cursor: text; user-select: none; pointer-events: none;', ...(ngDevMode ? [{ debugName: "hostStyles" }] : /* istanbul ignore next */ []));
|
|
24
31
|
/** Custom id applied to the input element */
|
|
25
32
|
inputId = input(`brn-input-otp-${++BrnInputOtp._id}`, ...(ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []));
|
|
33
|
+
labelableId = this.inputId;
|
|
26
34
|
/** Custom autocomplete attribute applied to the input element */
|
|
27
35
|
inputAutocomplete = input('one-time-code', ...(ngDevMode ? [{ debugName: "inputAutocomplete" }] : /* istanbul ignore next */ []));
|
|
28
36
|
/** Styles applied to the input element to make it invisible and clickable. */
|
|
@@ -33,7 +41,7 @@ class BrnInputOtp {
|
|
|
33
41
|
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
34
42
|
_disabled = linkedSignal(this.disabled, ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
35
43
|
/** The number of slots. */
|
|
36
|
-
|
|
44
|
+
length = input.required({ ...(ngDevMode ? { debugName: "length" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
37
45
|
/** Virtual keyboard appearance on mobile */
|
|
38
46
|
inputMode = input('numeric', ...(ngDevMode ? [{ debugName: "inputMode" }] : /* istanbul ignore next */ []));
|
|
39
47
|
inputClass = input('', ...(ngDevMode ? [{ debugName: "inputClass" }] : /* istanbul ignore next */ []));
|
|
@@ -41,7 +49,7 @@ class BrnInputOtp {
|
|
|
41
49
|
autofocus = input(false, { ...(ngDevMode ? { debugName: "autofocus" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
42
50
|
/**
|
|
43
51
|
* Defines how the pasted text should be transformed before saving to model/form.
|
|
44
|
-
* Allows pasting text which contains extra characters like spaces, dashes, etc. and are longer than the
|
|
52
|
+
* Allows pasting text which contains extra characters like spaces, dashes, etc. and are longer than the length.
|
|
45
53
|
*
|
|
46
54
|
* "XXX-XXX": (pastedText) => pastedText.replaceAll('-', '')
|
|
47
55
|
* "XXX XXX": (pastedText) => pastedText.replaceAll(/\s+/g, '')
|
|
@@ -55,10 +63,10 @@ class BrnInputOtp {
|
|
|
55
63
|
context = computed(() => {
|
|
56
64
|
const value = this.value() ?? '';
|
|
57
65
|
const focused = this._focused();
|
|
58
|
-
const
|
|
59
|
-
const slots = Array.from({ length: this.
|
|
66
|
+
const length = this.length();
|
|
67
|
+
const slots = Array.from({ length: this.length() }).map((_, slotIndex) => {
|
|
60
68
|
const char = value[slotIndex] !== undefined ? value[slotIndex] : null;
|
|
61
|
-
const isActive = focused && (value.length === slotIndex || (value.length ===
|
|
69
|
+
const isActive = focused && (value.length === slotIndex || (value.length === length && slotIndex === length - 1));
|
|
62
70
|
return {
|
|
63
71
|
char,
|
|
64
72
|
isActive,
|
|
@@ -79,27 +87,31 @@ class BrnInputOtp {
|
|
|
79
87
|
}
|
|
80
88
|
});
|
|
81
89
|
}
|
|
90
|
+
onBlur() {
|
|
91
|
+
this._focused.set(false);
|
|
92
|
+
this._onTouched?.();
|
|
93
|
+
}
|
|
82
94
|
onInputChange(event) {
|
|
83
95
|
let newValue = event.target.value;
|
|
84
|
-
const
|
|
85
|
-
if (newValue.length >
|
|
86
|
-
// Replace the last character when
|
|
87
|
-
newValue = newValue.slice(0,
|
|
96
|
+
const length = this.length();
|
|
97
|
+
if (newValue.length > length) {
|
|
98
|
+
// Replace the last character when length is exceeded
|
|
99
|
+
newValue = newValue.slice(0, length - 1) + newValue.slice(-1);
|
|
88
100
|
}
|
|
89
|
-
this.updateValue(newValue,
|
|
101
|
+
this.updateValue(newValue, length);
|
|
90
102
|
}
|
|
91
103
|
onPaste(event) {
|
|
92
104
|
event.preventDefault();
|
|
93
105
|
const clipboardData = event.clipboardData?.getData('text/plain') || '';
|
|
94
|
-
const
|
|
95
|
-
const content = this.transformPaste()(clipboardData,
|
|
96
|
-
const newValue = content.slice(0,
|
|
97
|
-
this.updateValue(newValue,
|
|
106
|
+
const length = this.length();
|
|
107
|
+
const content = this.transformPaste()(clipboardData, length);
|
|
108
|
+
const newValue = content.slice(0, length);
|
|
109
|
+
this.updateValue(newValue, length);
|
|
98
110
|
}
|
|
99
111
|
/** CONTROL VALUE ACCESSOR */
|
|
100
112
|
writeValue(value) {
|
|
101
113
|
this.value.set(value);
|
|
102
|
-
if (value?.length === this.
|
|
114
|
+
if (value?.length === this.length()) {
|
|
103
115
|
this.completed.emit(value ?? '');
|
|
104
116
|
}
|
|
105
117
|
}
|
|
@@ -112,20 +124,20 @@ class BrnInputOtp {
|
|
|
112
124
|
setDisabledState(isDisabled) {
|
|
113
125
|
this._disabled.set(isDisabled);
|
|
114
126
|
}
|
|
115
|
-
isCompleted(newValue, previousValue,
|
|
116
|
-
return newValue !== previousValue && previousValue.length <
|
|
127
|
+
isCompleted(newValue, previousValue, length) {
|
|
128
|
+
return newValue !== previousValue && previousValue.length < length && newValue.length === length;
|
|
117
129
|
}
|
|
118
|
-
updateValue(newValue,
|
|
130
|
+
updateValue(newValue, length) {
|
|
119
131
|
const previousValue = this.value() ?? '';
|
|
120
132
|
this.value.set(newValue);
|
|
121
133
|
this.valueChange.emit(newValue);
|
|
122
134
|
this._onChange?.(newValue);
|
|
123
|
-
if (this.isCompleted(newValue, previousValue,
|
|
135
|
+
if (this.isCompleted(newValue, previousValue, length)) {
|
|
124
136
|
this.completed.emit(newValue);
|
|
125
137
|
}
|
|
126
138
|
}
|
|
127
139
|
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnInputOtp, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
128
|
-
/** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.16", type: BrnInputOtp, isStandalone: true, selector: "brn-input-otp", inputs: { hostStyles: { classPropertyName: "hostStyles", publicName: "hostStyles", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, inputAutocomplete: { classPropertyName: "inputAutocomplete", publicName: "inputAutocomplete", isSignal: true, isRequired: false, transformFunction: null }, inputStyles: { classPropertyName: "inputStyles", publicName: "inputStyles", isSignal: true, isRequired: false, transformFunction: null }, containerStyles: { classPropertyName: "containerStyles", publicName: "containerStyles", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null },
|
|
140
|
+
/** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.16", type: BrnInputOtp, isStandalone: true, selector: "brn-input-otp", inputs: { hostStyles: { classPropertyName: "hostStyles", publicName: "hostStyles", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, inputAutocomplete: { classPropertyName: "inputAutocomplete", publicName: "inputAutocomplete", isSignal: true, isRequired: false, transformFunction: null }, inputStyles: { classPropertyName: "inputStyles", publicName: "inputStyles", isSignal: true, isRequired: false, transformFunction: null }, containerStyles: { classPropertyName: "containerStyles", publicName: "containerStyles", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, length: { classPropertyName: "length", publicName: "length", isSignal: true, isRequired: true, transformFunction: null }, inputMode: { classPropertyName: "inputMode", publicName: "inputMode", isSignal: true, isRequired: false, transformFunction: null }, inputClass: { classPropertyName: "inputClass", publicName: "inputClass", isSignal: true, isRequired: false, transformFunction: null }, autofocus: { classPropertyName: "autofocus", publicName: "autofocus", isSignal: true, isRequired: false, transformFunction: null }, transformPaste: { classPropertyName: "transformPaste", publicName: "transformPaste", isSignal: true, isRequired: false, transformFunction: null }, valueInput: { classPropertyName: "valueInput", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", completed: "completed" }, host: { attributes: { "data-input-otp-container": "true" }, properties: { "style": "hostStyles()" } }, providers: [BRN_INPUT_OTP_VALUE_ACCESSOR, provideBrnInputOtp(BrnInputOtp), provideBrnLabelable(BrnInputOtp)], viewQueries: [{ propertyName: "_inputComponentRef", first: true, predicate: ["otpInput"], descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.BrnFieldControl }], ngImport: i0, template: `
|
|
129
141
|
<ng-content />
|
|
130
142
|
<div [style]="containerStyles()">
|
|
131
143
|
<input
|
|
@@ -141,7 +153,7 @@ class BrnInputOtp {
|
|
|
141
153
|
(input)="onInputChange($event)"
|
|
142
154
|
(paste)="onPaste($event)"
|
|
143
155
|
(focus)="_focused.set(true)"
|
|
144
|
-
(blur)="
|
|
156
|
+
(blur)="onBlur()"
|
|
145
157
|
/>
|
|
146
158
|
</div>
|
|
147
159
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
@@ -150,8 +162,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
150
162
|
type: Component,
|
|
151
163
|
args: [{
|
|
152
164
|
selector: 'brn-input-otp',
|
|
153
|
-
providers: [BRN_INPUT_OTP_VALUE_ACCESSOR, provideBrnInputOtp(BrnInputOtp)],
|
|
165
|
+
providers: [BRN_INPUT_OTP_VALUE_ACCESSOR, provideBrnInputOtp(BrnInputOtp), provideBrnLabelable(BrnInputOtp)],
|
|
154
166
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
167
|
+
hostDirectives: [BrnFieldControl],
|
|
155
168
|
host: {
|
|
156
169
|
'[style]': 'hostStyles()',
|
|
157
170
|
'data-input-otp-container': 'true',
|
|
@@ -172,21 +185,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
172
185
|
(input)="onInputChange($event)"
|
|
173
186
|
(paste)="onPaste($event)"
|
|
174
187
|
(focus)="_focused.set(true)"
|
|
175
|
-
(blur)="
|
|
188
|
+
(blur)="onBlur()"
|
|
176
189
|
/>
|
|
177
190
|
</div>
|
|
178
191
|
`,
|
|
179
192
|
}]
|
|
180
|
-
}], ctorParameters: () => [], propDecorators: { hostStyles: [{ type: i0.Input, args: [{ isSignal: true, alias: "hostStyles", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], inputAutocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputAutocomplete", required: false }] }], inputStyles: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputStyles", required: false }] }], containerStyles: [{ type: i0.Input, args: [{ isSignal: true, alias: "containerStyles", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }],
|
|
193
|
+
}], ctorParameters: () => [], propDecorators: { hostStyles: [{ type: i0.Input, args: [{ isSignal: true, alias: "hostStyles", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], inputAutocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputAutocomplete", required: false }] }], inputStyles: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputStyles", required: false }] }], containerStyles: [{ type: i0.Input, args: [{ isSignal: true, alias: "containerStyles", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], length: [{ type: i0.Input, args: [{ isSignal: true, alias: "length", required: true }] }], inputMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputMode", required: false }] }], inputClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputClass", required: false }] }], autofocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autofocus", required: false }] }], transformPaste: [{ type: i0.Input, args: [{ isSignal: true, alias: "transformPaste", required: false }] }], valueInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], completed: [{ type: i0.Output, args: ["completed"] }], _inputComponentRef: [{ type: i0.ViewChild, args: ['otpInput', { isSignal: true }] }] } });
|
|
181
194
|
|
|
182
195
|
class BrnInputOtpSlot {
|
|
183
196
|
/** Access the input-otp component */
|
|
184
197
|
_inputOtp = injectBrnInputOtp();
|
|
185
198
|
/** The index of the slot to render the char or a fake caret */
|
|
186
199
|
index = input.required({ ...(ngDevMode ? { debugName: "index" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
200
|
+
/** Whether to force the input into an invalid state. */
|
|
201
|
+
forceInvalid = input(false, { ...(ngDevMode ? { debugName: "forceInvalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
187
202
|
_slot = computed(() => this._inputOtp.context()[this.index()], ...(ngDevMode ? [{ debugName: "_slot" }] : /* istanbul ignore next */ []));
|
|
203
|
+
_ariaInvalid = this._inputOtp.invalid;
|
|
204
|
+
_touched = this._inputOtp.touched;
|
|
205
|
+
_dirty = this._inputOtp.dirty;
|
|
206
|
+
_spartanInvalid = computed(() => this.forceInvalid() || this._inputOtp.spartanInvalid?.(), ...(ngDevMode ? [{ debugName: "_spartanInvalid" }] : /* istanbul ignore next */ []));
|
|
188
207
|
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnInputOtpSlot, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
189
|
-
/** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: BrnInputOtpSlot, isStandalone: true, selector: "brn-input-otp-slot", inputs: { index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "attr.data-active": "_slot().isActive" } }, ngImport: i0, template: `
|
|
208
|
+
/** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: BrnInputOtpSlot, isStandalone: true, selector: "brn-input-otp-slot", inputs: { index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: true, transformFunction: null }, forceInvalid: { classPropertyName: "forceInvalid", publicName: "forceInvalid", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-active": "_slot().isActive", "attr.data-invalid": "_ariaInvalid?.() ? \"true\" : null", "attr.data-touched": "_touched?.() ? \"true\" : null", "attr.data-dirty": "_dirty?.() ? \"true\" : null", "attr.data-matches-spartan-invalid": "_spartanInvalid() ? \"true\" : null" } }, ngImport: i0, template: `
|
|
190
209
|
{{ _slot().char }}
|
|
191
210
|
|
|
192
211
|
@if (_slot().hasFakeCaret) {
|
|
@@ -201,6 +220,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
201
220
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
202
221
|
host: {
|
|
203
222
|
'[attr.data-active]': '_slot().isActive',
|
|
223
|
+
'[attr.data-invalid]': '_ariaInvalid?.() ? "true" : null',
|
|
224
|
+
'[attr.data-touched]': '_touched?.() ? "true" : null',
|
|
225
|
+
'[attr.data-dirty]': '_dirty?.() ? "true" : null',
|
|
226
|
+
'[attr.data-matches-spartan-invalid]': '_spartanInvalid() ? "true" : null',
|
|
204
227
|
},
|
|
205
228
|
template: `
|
|
206
229
|
{{ _slot().char }}
|
|
@@ -210,7 +233,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
210
233
|
}
|
|
211
234
|
`,
|
|
212
235
|
}]
|
|
213
|
-
}], propDecorators: { index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: true }] }] } });
|
|
236
|
+
}], propDecorators: { index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: true }] }], forceInvalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "forceInvalid", required: false }] }] } });
|
|
214
237
|
|
|
215
238
|
const BrnInputOtpImports = [BrnInputOtp, BrnInputOtpSlot];
|
|
216
239
|
|
|
@@ -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\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,GAAG;AAC3C,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,WAAW,EAAE,UAAU,CAAC,MAAM,WAAW,CAAC;AAC1C,IAAA,KAAK,EAAE,IAAI;;MAkCC,WAAW,CAAA;AACf,IAAA,OAAO,GAAG,GAAG,CAAC;;AAGH,IAAA,QAAQ,GAAG,MAAM,CA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;;"}
|
|
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\tinject,\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 { BrnFieldControl, provideBrnLabelable } from '@spartan-ng/brain/field';\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), provideBrnLabelable(BrnInputOtp)],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\thostDirectives: [BrnFieldControl],\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)=\"onBlur()\"\n\t\t\t/>\n\t\t</div>\n\t`,\n})\nexport class BrnInputOtp implements ControlValueAccessor {\n\tprivate static _id = 0;\n\n\tprivate readonly _fieldControl = inject(BrnFieldControl, { optional: true });\n\n\tpublic readonly invalid = this._fieldControl?.invalid;\n\tpublic readonly touched = this._fieldControl?.touched;\n\tpublic readonly dirty = this._fieldControl?.dirty;\n\tpublic readonly spartanInvalid = this._fieldControl?.spartanInvalid;\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\tpublic readonly labelableId = this.inputId;\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 length = 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 length.\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, length: 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 length = this.length();\n\t\tconst slots = Array.from({ length: this.length() }).map((_, slotIndex) => {\n\t\t\tconst char = value[slotIndex] !== undefined ? value[slotIndex] : null;\n\n\t\t\tconst isActive = focused && (value.length === slotIndex || (value.length === length && slotIndex === length - 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 onBlur() {\n\t\tthis._focused.set(false);\n\t\tthis._onTouched?.();\n\t}\n\n\tprotected onInputChange(event: Event) {\n\t\tlet newValue = (event.target as HTMLInputElement).value;\n\t\tconst length = this.length();\n\n\t\tif (newValue.length > length) {\n\t\t\t// Replace the last character when length is exceeded\n\t\t\tnewValue = newValue.slice(0, length - 1) + newValue.slice(-1);\n\t\t}\n\n\t\tthis.updateValue(newValue, length);\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 length = this.length();\n\n\t\tconst content = this.transformPaste()(clipboardData, length);\n\t\tconst newValue = content.slice(0, length);\n\n\t\tthis.updateValue(newValue, length);\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.length()) {\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, length: number) {\n\t\treturn newValue !== previousValue && previousValue.length < length && newValue.length === length;\n\t}\n\n\tprivate updateValue(newValue: string, length: 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, length)) {\n\t\t\tthis.completed.emit(newValue);\n\t\t}\n\t}\n}\n","import type { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, 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\t'[attr.data-invalid]': '_ariaInvalid?.() ? \"true\" : null',\n\t\t'[attr.data-touched]': '_touched?.() ? \"true\" : null',\n\t\t'[attr.data-dirty]': '_dirty?.() ? \"true\" : null',\n\t\t'[attr.data-matches-spartan-invalid]': '_spartanInvalid() ? \"true\" : null',\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\t/** Whether to force the input into an invalid state. */\n\tpublic readonly forceInvalid = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n\tprotected readonly _slot = computed(() => this._inputOtp.context()[this.index()]);\n\n\tprotected readonly _ariaInvalid = this._inputOtp.invalid;\n\tprotected readonly _touched = this._inputOtp.touched;\n\tprotected readonly _dirty = this._inputOtp.dirty;\n\tprotected readonly _spartanInvalid = computed(() => this.forceInvalid() || this._inputOtp.spartanInvalid?.());\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;;ACYO,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;IAEL,aAAa,GAAG,MAAM,CAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAE5D,IAAA,OAAO,GAAG,IAAI,CAAC,aAAa,EAAE,OAAO;AACrC,IAAA,OAAO,GAAG,IAAI,CAAC,aAAa,EAAE,OAAO;AACrC,IAAA,KAAK,GAAG,IAAI,CAAC,aAAa,EAAE,KAAK;AACjC,IAAA,cAAc,GAAG,IAAI,CAAC,aAAa,EAAE,cAAc;;AAGhD,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,IA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this._renderer.listen(this._overlayRef.hostElement, 'pointerenter', (event) => {
|
|
340
|
+
if (this._isHoverPointer(event))
|
|
341
|
+
this._tooltipHovered = true;
|
|
342
|
+
}),
|
|
343
|
+
this._renderer.listen(this._overlayRef.hostElement, 'pointerleave', (event) => {
|
|
344
|
+
if (!this._isHoverPointer(event))
|
|
345
|
+
return;
|
|
341
346
|
this._tooltipHovered = false;
|
|
342
347
|
this.delay(false, this.hideDelay());
|
|
343
348
|
}),
|
|
@@ -371,24 +376,75 @@ class BrnTooltip {
|
|
|
371
376
|
_getAdjustedPositionFor(pos) {
|
|
372
377
|
const position = BRN_TOOLTIP_POSITIONS_MAP[pos];
|
|
373
378
|
const isLtr = this._dir.value !== 'rtl';
|
|
379
|
+
const baseOffsetX = position.offsetX != null ? (isLtr ? position.offsetX : -position.offsetX) : 0;
|
|
380
|
+
const baseOffsetY = position.offsetY ?? 0;
|
|
381
|
+
const { x: compensationX, y: compensationY } = this._getVisualViewportCompensation(position, isLtr);
|
|
382
|
+
// CDK renders offsetX/offsetY as a transform on the pane, so fold the viewport compensation in here.
|
|
374
383
|
return {
|
|
375
384
|
...position,
|
|
376
|
-
offsetX:
|
|
385
|
+
offsetX: baseOffsetX + compensationX,
|
|
386
|
+
offsetY: baseOffsetY + compensationY,
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Corrects overlay placement for the layout-vs-visual viewport mismatch on mobile browsers.
|
|
391
|
+
*
|
|
392
|
+
* Tooltips only open on hover/focus, but a hovering pen (e.g. Apple Pencil on iOS Safari) can open
|
|
393
|
+
* one on a phone/tablet where this bites: as the browser's toolbars collapse the visual viewport
|
|
394
|
+
* grows, yet `documentElement.clientHeight`/`clientWidth` stay frozen at the toolbar-expanded size.
|
|
395
|
+
* CDK anchors bottom/right overlays from those stale dimensions (top/left overlays measure from the
|
|
396
|
+
* pinned top-left edge and are unaffected), so a `position: 'top'` tooltip lands shifted by the delta.
|
|
397
|
+
*
|
|
398
|
+
* We fold that delta back in as an offset. It is 0 whenever the viewports match (desktop, or toolbar
|
|
399
|
+
* expanded), so this is a no-op everywhere except the collapsed-toolbar case it targets.
|
|
400
|
+
*/
|
|
401
|
+
_getVisualViewportCompensation(position, isLtr) {
|
|
402
|
+
const visualViewport = this._document.defaultView?.visualViewport;
|
|
403
|
+
if (!visualViewport)
|
|
404
|
+
return { x: 0, y: 0 };
|
|
405
|
+
// Only the collapsing-toolbar case is a pure height/width change with the viewport top-left still
|
|
406
|
+
// pinned (scale 1, offset 0). Pinch-zoom (scale != 1) and the software keyboard (offset != 0)
|
|
407
|
+
// shrink the visual viewport for unrelated reasons, so the delta below would shift the tooltip
|
|
408
|
+
// wrongly - bail and let CDK position normally.
|
|
409
|
+
const pinnedToTopLeft = Math.abs(visualViewport.offsetTop) < 1 && Math.abs(visualViewport.offsetLeft) < 1;
|
|
410
|
+
if (Math.abs(visualViewport.scale - 1) > 0.01 || !pinnedToTopLeft)
|
|
411
|
+
return { x: 0, y: 0 };
|
|
412
|
+
const docEl = this._document.documentElement;
|
|
413
|
+
const anchorsFromBottom = position.overlayY === 'bottom';
|
|
414
|
+
const anchorsFromRight = isLtr ? position.overlayX === 'end' : position.overlayX === 'start';
|
|
415
|
+
return {
|
|
416
|
+
x: anchorsFromRight ? docEl.clientWidth - visualViewport.width : 0,
|
|
417
|
+
y: anchorsFromBottom ? docEl.clientHeight - visualViewport.height : 0,
|
|
377
418
|
};
|
|
378
419
|
}
|
|
379
420
|
_initTriggers() {
|
|
380
421
|
this._initScrollListener();
|
|
381
422
|
this._initHoverListeners();
|
|
382
423
|
}
|
|
424
|
+
/**
|
|
425
|
+
* Tooltips are supplementary labels for a trigger that already has its own action, so - like Radix
|
|
426
|
+
* and Base UI - they open only on mouse/pen hover and keyboard focus, never on touch (a touch tap
|
|
427
|
+
* would both fire the trigger's action and the tooltip). Touch pointers are ignored via
|
|
428
|
+
* `_isHoverPointer`; use a popover when touch users need to see the content.
|
|
429
|
+
*/
|
|
383
430
|
_initHoverListeners() {
|
|
384
431
|
this._listenersRefs = [
|
|
385
432
|
...this._listenersRefs,
|
|
386
|
-
this._renderer.listen(this._elementRef.nativeElement, '
|
|
387
|
-
|
|
433
|
+
this._renderer.listen(this._elementRef.nativeElement, 'pointerenter', (event) => {
|
|
434
|
+
if (this._isHoverPointer(event))
|
|
435
|
+
this._requestShow();
|
|
436
|
+
}),
|
|
437
|
+
this._renderer.listen(this._elementRef.nativeElement, 'pointerleave', (event) => {
|
|
438
|
+
if (this._isHoverPointer(event))
|
|
439
|
+
this.delay(false, this.hideDelay());
|
|
440
|
+
}),
|
|
388
441
|
this._renderer.listen(this._elementRef.nativeElement, 'focus', () => this._requestShow()),
|
|
389
442
|
this._renderer.listen(this._elementRef.nativeElement, 'blur', () => this.delay(false, this.hideDelay())),
|
|
390
443
|
];
|
|
391
444
|
}
|
|
445
|
+
_isHoverPointer(event) {
|
|
446
|
+
return event.pointerType === 'mouse' || event.pointerType === 'pen';
|
|
447
|
+
}
|
|
392
448
|
/** Snapshot the group skip decision once, so the delay and the instant-open state agree even if a
|
|
393
449
|
* sibling flips the window during the show delay. */
|
|
394
450
|
_requestShow() {
|
|
@@ -428,6 +484,8 @@ class BrnTooltip {
|
|
|
428
484
|
if (!this._tooltipText() || this.mutableTooltipDisabled()) {
|
|
429
485
|
return;
|
|
430
486
|
}
|
|
487
|
+
// Recompute positions against the current viewport before attaching (see _getVisualViewportCompensation).
|
|
488
|
+
this._updatePosition();
|
|
431
489
|
// 'instant-open' suppresses the enter animation. Decided with the delay at request time so a sibling
|
|
432
490
|
// flipping the group window mid-delay can't desync the animation from the wait that actually happened.
|
|
433
491
|
const openState = instant ? 'instant-open' : 'open';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spartan-ng-brain-tooltip.mjs","sources":["../../../../libs/brain/tooltip/src/lib/brn-tooltip-string-template-outlet.ts","../../../../libs/brain/tooltip/src/lib/brn-tooltip-content.ts","../../../../libs/brain/tooltip/src/lib/brn-tooltip-group.ts","../../../../libs/brain/tooltip/src/lib/brn-tooltip-position.ts","../../../../libs/brain/tooltip/src/lib/brn-tooltip.token.ts","../../../../libs/brain/tooltip/src/lib/brn-tooltip.ts","../../../../libs/brain/tooltip/src/index.ts","../../../../libs/brain/tooltip/src/spartan-ng-brain-tooltip.ts"],"sourcesContent":["import {\n\tDirective,\n\teffect,\n\ttype EffectRef,\n\ttype EmbeddedViewRef,\n\tinject,\n\tinput,\n\ttype OnDestroy,\n\tTemplateRef,\n\tViewContainerRef,\n} from '@angular/core';\n\nexport function isTemplateRef<C = unknown>(value: unknown): value is TemplateRef<C> {\n\treturn value instanceof TemplateRef;\n}\n\nexport interface BrnTemplateOutletContext {\n\t$implicit: unknown;\n\t[key: string]: unknown;\n}\n\n@Directive({\n\tselector: '[brnTooltipStringTemplateOutlet]',\n\texportAs: 'brnTooltipStringTemplateOutlet',\n})\nexport class BrnTooltipStringTemplateOutlet<T = unknown> implements OnDestroy {\n\tprivate readonly _viewContainer = inject(ViewContainerRef);\n\tprivate readonly _templateRef = inject(TemplateRef<void>);\n\n\tprivate _embeddedViewRef: EmbeddedViewRef<BrnTemplateOutletContext> | null = null;\n\tprivate readonly _context = {} as BrnTemplateOutletContext;\n\n\tprivate _isFirstChange = true;\n\tprivate _lastOutletWasTemplate = false;\n\tprivate _lastTemplateRef: TemplateRef<void> | null = null;\n\tprivate _lastContext?: BrnTemplateOutletContext;\n\n\tpublic readonly brnTooltipStringTemplateOutletContext = input<BrnTemplateOutletContext | undefined>(undefined);\n\tpublic readonly brnTooltipStringTemplateOutlet = input.required<T | TemplateRef<void>>();\n\n\t_hasContextShapeChanged(context: BrnTemplateOutletContext | undefined): boolean {\n\t\tif (!context) {\n\t\t\treturn false;\n\t\t}\n\t\tconst prevCtxKeys = Object.keys(this._lastContext || {});\n\t\tconst currCtxKeys = Object.keys(context || {});\n\n\t\tif (prevCtxKeys.length === currCtxKeys.length) {\n\t\t\tfor (const propName of currCtxKeys) {\n\t\t\t\tif (!prevCtxKeys.includes(propName)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t_shouldViewBeRecreated(\n\t\tstringTemplateOutlet: TemplateRef<void> | T,\n\t\tstringTemplateOutletContext: BrnTemplateOutletContext | undefined,\n\t): boolean {\n\t\tconst isTemplate = isTemplateRef(stringTemplateOutlet);\n\n\t\tconst shouldOutletRecreate =\n\t\t\tthis._isFirstChange ||\n\t\t\tisTemplate !== this._lastOutletWasTemplate ||\n\t\t\t(isTemplate && stringTemplateOutlet !== this._lastTemplateRef);\n\n\t\tconst shouldContextRecreate = this._hasContextShapeChanged(stringTemplateOutletContext);\n\t\treturn shouldContextRecreate || shouldOutletRecreate;\n\t}\n\n\t_updateTrackingState(\n\t\tstringTemplateOutlet: TemplateRef<void> | T,\n\t\tstringTemplateOutletContext: BrnTemplateOutletContext | undefined,\n\t): void {\n\t\tconst isTemplate = isTemplateRef(stringTemplateOutlet);\n\t\tif (this._isFirstChange && !isTemplate) {\n\t\t\tthis._isFirstChange = false;\n\t\t}\n\n\t\tif (stringTemplateOutletContext !== undefined) {\n\t\t\tthis._lastContext = stringTemplateOutletContext;\n\t\t}\n\n\t\tthis._lastOutletWasTemplate = isTemplate;\n\t\tthis._lastTemplateRef = isTemplate ? stringTemplateOutlet : null;\n\t}\n\n\tprivate readonly _viewEffect: EffectRef = effect(() => {\n\t\tconst stringTemplateOutlet = this.brnTooltipStringTemplateOutlet();\n\t\tconst stringTemplateOutletContext = this.brnTooltipStringTemplateOutletContext();\n\n\t\tif (!this._isFirstChange && isTemplateRef(stringTemplateOutlet)) {\n\t\t\tthis._isFirstChange = true;\n\t\t}\n\n\t\tif (!isTemplateRef(stringTemplateOutlet)) {\n\t\t\tthis._context['$implicit'] = stringTemplateOutlet as T;\n\t\t}\n\n\t\tconst recreateView = this._shouldViewBeRecreated(stringTemplateOutlet, stringTemplateOutletContext);\n\t\tthis._updateTrackingState(stringTemplateOutlet, stringTemplateOutletContext);\n\n\t\tif (recreateView) {\n\t\t\tthis._recreateView(stringTemplateOutlet as TemplateRef<BrnTemplateOutletContext>, stringTemplateOutletContext);\n\t\t} else {\n\t\t\tthis._updateContext(stringTemplateOutlet, stringTemplateOutletContext);\n\t\t}\n\t});\n\n\tprivate _recreateView(\n\t\toutlet: TemplateRef<BrnTemplateOutletContext>,\n\t\tcontext: BrnTemplateOutletContext | undefined,\n\t): void {\n\t\tthis._viewContainer.clear();\n\t\tif (isTemplateRef(outlet)) {\n\t\t\tthis._embeddedViewRef = this._viewContainer.createEmbeddedView(outlet, context);\n\t\t} else {\n\t\t\tthis._embeddedViewRef = this._viewContainer.createEmbeddedView(this._templateRef, this._context);\n\t\t}\n\t}\n\n\tprivate _updateContext(outlet: TemplateRef<void> | T, context: BrnTemplateOutletContext | undefined): void {\n\t\tconst newCtx = isTemplateRef(outlet) ? context : this._context;\n\t\tlet oldCtx = this._embeddedViewRef?.context;\n\n\t\tif (!oldCtx) {\n\t\t\toldCtx = newCtx;\n\t\t} else if (newCtx && typeof newCtx === 'object') {\n\t\t\tfor (const propName of Object.keys(newCtx)) {\n\t\t\t\toldCtx[propName] = newCtx[propName];\n\t\t\t}\n\t\t}\n\t\tthis._lastContext = oldCtx;\n\t}\n\n\tstatic ngTemplateContextGuard<T>(\n\t\t_dir: BrnTooltipStringTemplateOutlet<T>,\n\t\t_ctx: unknown,\n\t): _ctx is BrnTemplateOutletContext {\n\t\treturn true;\n\t}\n\n\tpublic ngOnDestroy(): void {\n\t\tthis._viewEffect.destroy();\n\t\tthis._viewContainer.clear();\n\t\tthis._embeddedViewRef = null;\n\t}\n}\n","import { ChangeDetectionStrategy, Component, input, signal } from '@angular/core';\nimport { ClassValue } from 'clsx';\nimport { BrnTooltipPosition } from './brn-tooltip-position';\nimport { BrnTooltipStringTemplateOutlet } from './brn-tooltip-string-template-outlet';\nimport { BrnTooltipType } from './brn-tooltip-type';\n\nlet uniqueId = 0;\n\n@Component({\n\timports: [BrnTooltipStringTemplateOutlet],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\thost: {\n\t\t'[class]': '_tooltipClass()',\n\t\t'[attr.id]': 'id()',\n\t\t'[attr.data-side]': '_position()',\n\t\t'[attr.data-state]': 'state()',\n\t\trole: 'tooltip',\n\t},\n\ttemplate: `\n\t\t<ng-container *brnTooltipStringTemplateOutlet=\"_tooltipText()\">{{ _tooltipText() }}</ng-container>\n\n\t\t<span [class]=\"_arrowClass()\">\n\t\t\t<svg [class]=\"_svgClass()\" width=\"10\" height=\"5\" viewBox=\"0 0 30 10\" preserveAspectRatio=\"none\">\n\t\t\t\t<polygon points=\"0,0 30,0 15,10\" />\n\t\t\t</svg>\n\t\t</span>\n\t`,\n})\nexport class BrnTooltipContent {\n\tpublic readonly id = input<string>(`brn-tooltip-${++uniqueId}`);\n\tpublic readonly state = signal<'closed' | 'open' | 'instant-open'>('closed');\n\n\tprotected readonly _tooltipClass = signal<ClassValue>('');\n\tprotected readonly _arrowClass = signal<ClassValue>('');\n\tprotected readonly _svgClass = signal<ClassValue>('');\n\n\tprotected readonly _position = signal<BrnTooltipPosition>('top');\n\tprotected readonly _tooltipText = signal<BrnTooltipType>(null);\n\n\tpublic setProps(\n\t\ttooltipText: BrnTooltipType,\n\t\tposition: BrnTooltipPosition,\n\t\ttooltipClasses: ClassValue,\n\t\tarrowClasses: ClassValue,\n\t\tsvgClasses: ClassValue,\n\t): void {\n\t\tif (tooltipText) {\n\t\t\tthis._tooltipText.set(tooltipText);\n\t\t}\n\t\tthis._position.set(position);\n\n\t\tthis._tooltipClass.set(tooltipClasses);\n\t\tthis._arrowClass.set(arrowClasses);\n\t\tthis._svgClass.set(svgClasses);\n\t}\n}\n","import { inject, Injectable, InjectionToken, type Provider } from '@angular/core';\nimport { injectSkipDelay } from '@spartan-ng/brain/core';\n\nexport interface BrnTooltipGroupOptions {\n\t/** Time (ms) after the last tooltip closes during which others open instantly. `0` disables it. */\n\tskipDelayDuration: number;\n}\n\nconst defaultGroupOptions: BrnTooltipGroupOptions = { skipDelayDuration: 300 };\n\nconst BRN_TOOLTIP_GROUP_OPTIONS = new InjectionToken<BrnTooltipGroupOptions>('BrnTooltipGroupOptions');\n\n/** Skip-delay coordinator for grouped tooltips; provide via `provideBrnTooltipGroup` on the wrapper. */\n@Injectable()\nexport class BrnTooltipGroup {\n\tprivate readonly _options = inject(BRN_TOOLTIP_GROUP_OPTIONS);\n\tprivate readonly _skipDelay = injectSkipDelay(() => this._options.skipDelayDuration);\n\n\t/** Whether the next tooltip waits for its show delay, or opens instantly within the skip window. */\n\tpublic readonly isOpenDelayed = this._skipDelay.isOpenDelayed;\n\n\tpublic onOpen(): void {\n\t\tthis._skipDelay.open();\n\t}\n\n\tpublic onClose(): void {\n\t\tthis._skipDelay.close();\n\t}\n}\n\nexport function provideBrnTooltipGroup(options?: Partial<BrnTooltipGroupOptions>): Provider[] {\n\treturn [{ provide: BRN_TOOLTIP_GROUP_OPTIONS, useValue: { ...defaultGroupOptions, ...options } }, BrnTooltipGroup];\n}\n","import type { ConnectedPosition } from '@angular/cdk/overlay';\n\nexport type BrnTooltipPosition = 'top' | 'bottom' | 'left' | 'right';\n\nexport const BRN_TOOLTIP_POSITIONS_MAP: Record<BrnTooltipPosition, ConnectedPosition> = {\n\ttop: {\n\t\toriginX: 'center',\n\t\toriginY: 'top',\n\t\toverlayX: 'center',\n\t\toverlayY: 'bottom',\n\t\toffsetY: -8,\n\t},\n\tbottom: {\n\t\toriginX: 'center',\n\t\toriginY: 'bottom',\n\t\toverlayX: 'center',\n\t\toverlayY: 'top',\n\t\toffsetY: 8,\n\t},\n\tleft: {\n\t\toriginX: 'start',\n\t\toriginY: 'center',\n\t\toverlayX: 'end',\n\t\toverlayY: 'center',\n\t\toffsetX: -8,\n\t},\n\tright: {\n\t\toriginX: 'end',\n\t\toriginY: 'center',\n\t\toverlayX: 'start',\n\t\toverlayY: 'center',\n\t\toffsetX: 8,\n\t},\n};\n\n/** Fallback order for each preferred position when it doesn't fit in the viewport. */\nexport const BRN_TOOLTIP_FALLBACK_POSITIONS: Record<BrnTooltipPosition, BrnTooltipPosition[]> = {\n\ttop: ['bottom', 'right', 'left'],\n\tbottom: ['top', 'right', 'left'],\n\tleft: ['right', 'top', 'bottom'],\n\tright: ['left', 'top', 'bottom'],\n};\n\n/** Map a resolved CDK ConnectedPosition back to a BrnTooltipPosition, or null if no match. */\nexport function resolveTooltipPosition(pair: ConnectedPosition): BrnTooltipPosition | null {\n\tfor (const [pos, config] of Object.entries(BRN_TOOLTIP_POSITIONS_MAP)) {\n\t\tif (\n\t\t\tpair.originX === config.originX &&\n\t\t\tpair.originY === config.originY &&\n\t\t\tpair.overlayX === config.overlayX &&\n\t\t\tpair.overlayY === config.overlayY\n\t\t) {\n\t\t\treturn pos as BrnTooltipPosition;\n\t\t}\n\t}\n\treturn null;\n}\n","import { inject, InjectionToken, type ValueProvider } from '@angular/core';\nimport { type ClassValue } from 'clsx';\nimport { type BrnTooltipPosition } from './brn-tooltip-position';\n\nexport interface BrnTooltipOptions {\n\t/** Default delay when the tooltip is shown. */\n\tshowDelay: number;\n\t/** Default delay when the tooltip is hidden. */\n\thideDelay: number;\n\t/** Default position for tooltips. */\n\tposition?: BrnTooltipPosition;\n\t/** Additional classes for the SVG element in the tooltip arrow. */\n\tsvgClasses: ClassValue;\n\t/** Additional classes for the tooltip arrow element based on position. */\n\tarrowClasses: (position: BrnTooltipPosition) => ClassValue;\n\t/** Additional classes for the tooltip content element. */\n\ttooltipContentClasses: ClassValue;\n}\n\nexport const defaultOptions: BrnTooltipOptions = {\n\tshowDelay: 150,\n\thideDelay: 100,\n\tsvgClasses: '',\n\tarrowClasses: () => '',\n\ttooltipContentClasses: '',\n};\n\nconst BRN_TOOLTIP_DEFAULT_OPTIONS = new InjectionToken<BrnTooltipOptions>('brn-tooltip-default-options', {\n\tprovidedIn: 'root',\n\tfactory: () => defaultOptions,\n});\n\nexport function provideBrnTooltipDefaultOptions(options: Partial<BrnTooltipOptions>): ValueProvider {\n\treturn { provide: BRN_TOOLTIP_DEFAULT_OPTIONS, useValue: { ...defaultOptions, ...options } };\n}\n\nexport function injectBrnTooltipDefaultOptions(): BrnTooltipOptions {\n\treturn inject(BRN_TOOLTIP_DEFAULT_OPTIONS, { optional: true }) ?? defaultOptions;\n}\n","import {\n\tConnectedPosition,\n\tFlexibleConnectedPositionStrategy,\n\tOverlay,\n\tOverlayPositionBuilder,\n\ttype OverlayRef,\n} from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { DOCUMENT } from '@angular/common';\nimport {\n\tafterNextRender,\n\tbooleanAttribute,\n\ttype ComponentRef,\n\tcomputed,\n\tDestroyRef,\n\tDirective,\n\teffect,\n\tElementRef,\n\tinject,\n\tInjector,\n\tinput,\n\tlinkedSignal,\n\tnumberAttribute,\n\toutput,\n\tRenderer2,\n\trunInInjectionContext,\n\ttype TemplateRef,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { Directionality } from '@angular/cdk/bidi';\nimport { waitForElementAnimations } from '@spartan-ng/brain/core';\nimport { of, Subject, Subscription, timer } from 'rxjs';\nimport { map, switchMap } from 'rxjs/operators';\nimport { BrnTooltipContent } from './brn-tooltip-content';\nimport { BrnTooltipGroup } from './brn-tooltip-group';\nimport {\n\tBRN_TOOLTIP_FALLBACK_POSITIONS,\n\tBRN_TOOLTIP_POSITIONS_MAP,\n\tBrnTooltipPosition,\n\tresolveTooltipPosition,\n} from './brn-tooltip-position';\nimport { BrnTooltipType } from './brn-tooltip-type';\nimport { injectBrnTooltipDefaultOptions } from './brn-tooltip.token';\n\ninterface DelayConfig {\n\tisShow: boolean;\n\tdelay: number;\n\t/** Snapshotted at request time: open instantly (no enter animation) because the group window was open. */\n\tinstant: boolean;\n}\n\n@Directive({ selector: '[brnTooltip]', exportAs: 'brnTooltip' })\nexport class BrnTooltip {\n\tprivate readonly _config = injectBrnTooltipDefaultOptions();\n\n\tprivate readonly _destroyRef = inject(DestroyRef);\n\tprivate readonly _document = inject(DOCUMENT);\n\tprivate readonly _elementRef = inject(ElementRef<HTMLElement>);\n\tprivate readonly _injector = inject(Injector);\n\tprivate readonly _overlay = inject(Overlay);\n\tprivate readonly _overlayPositionBuilder = inject(OverlayPositionBuilder);\n\tprivate readonly _renderer = inject(Renderer2);\n\tprivate readonly _dir = inject(Directionality);\n\tprivate readonly _group = inject(BrnTooltipGroup, { optional: true });\n\n\tprivate _tooltipHovered = false;\n\tprivate _listenersRefs: (() => void)[] = [];\n\tprivate _delaySubject: Subject<DelayConfig> | undefined = undefined;\n\tprivate _componentRef: ComponentRef<BrnTooltipContent> | undefined = undefined;\n\tprivate _overlayRef: OverlayRef | undefined = undefined;\n\tprivate _ariaEffectRef: ReturnType<typeof effect> | undefined = undefined;\n\tprivate _positionChangeSub: Subscription | undefined = undefined;\n\t/** Bumped on every close/show so a pending exit-animation teardown can detect it was superseded. */\n\tprivate _closeGeneration = 0;\n\t/** The position currently applied to the content - the CDK-resolved one after a flip, not the raw input. */\n\tprivate _activePosition: BrnTooltipPosition | undefined = undefined;\n\n\tpublic readonly tooltipDisabled = input<boolean, boolean>(false, { transform: booleanAttribute });\n\tpublic readonly mutableTooltipDisabled = linkedSignal(this.tooltipDisabled);\n\n\tpublic readonly position = input<BrnTooltipPosition>(this._config.position ?? 'top');\n\tpublic readonly brnTooltip = input<BrnTooltipType>(null);\n\tpublic readonly showDelay = input<number, number>(this._config.showDelay, { transform: numberAttribute });\n\tpublic readonly hideDelay = input<number, number>(this._config.hideDelay, { transform: numberAttribute });\n\n\tpublic readonly show = output<void>();\n\tpublic readonly hide = output<void>();\n\n\tprivate readonly _tooltipText = computed<string | TemplateRef<void>>(() => {\n\t\tlet tooltipText = this.brnTooltip();\n\t\tif (!tooltipText) {\n\t\t\treturn '';\n\t\t} else if (typeof tooltipText === 'string') {\n\t\t\ttooltipText = tooltipText.trim();\n\t\t}\n\t\treturn tooltipText;\n\t});\n\n\tconstructor() {\n\t\tafterNextRender(() => {\n\t\t\tthis._overlayRef = this._overlay.create({\n\t\t\t\tdirection: this._dir,\n\t\t\t\tpositionStrategy: this._buildPositionStrategy(),\n\t\t\t});\n\n\t\t\tthis._dir.change.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => {\n\t\t\t\tif (this._overlayRef) {\n\t\t\t\t\tthis._updatePosition();\n\t\t\t\t\tif (this._overlayRef.hasAttached()) {\n\t\t\t\t\t\tthis._overlayRef.updatePosition();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\trunInInjectionContext(this._injector, () => {\n\t\t\t\tif (!this._overlayRef) return;\n\t\t\t\tthis._setupDelayMechanism();\n\t\t\t\tthis._cleanupTriggerEvents();\n\t\t\t\tthis._initTriggers();\n\n\t\t\t\t/**\n\t\t\t\t * This effect is used to update the tooltip content when the tooltip text changes.\n\t\t\t\t * It's the reactive bridge between the tooltip text and the tooltip content.\n\t\t\t\t */\n\t\t\t\teffect(() => {\n\t\t\t\t\tconst text = this._tooltipText();\n\t\t\t\t\tif (this._componentRef) {\n\t\t\t\t\t\tthis._applyContentProps(this._componentRef.instance, this._activePosition ?? this.position(), text);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tthis._listenersRefs = [\n\t\t\t\t\t...this._listenersRefs,\n\t\t\t\t\tthis._renderer.listen(this._overlayRef.hostElement, 'mouseenter', () => (this._tooltipHovered = true)),\n\t\t\t\t\tthis._renderer.listen(this._overlayRef.hostElement, 'mouseleave', () => {\n\t\t\t\t\t\tthis._tooltipHovered = false;\n\t\t\t\t\t\tthis.delay(false, this.hideDelay());\n\t\t\t\t\t}),\n\t\t\t\t];\n\t\t\t});\n\t\t});\n\n\t\tthis._destroyRef.onDestroy(() => {\n\t\t\tthis._clearAriaDescribedBy();\n\t\t\tthis._delaySubject?.complete();\n\t\t\tthis._cleanupTriggerEvents();\n\t\t\tthis._overlayRef?.dispose();\n\t\t});\n\t}\n\n\tprivate _updatePosition(): void {\n\t\tconst strategy = this._overlayRef?.getConfig().positionStrategy as FlexibleConnectedPositionStrategy;\n\n\t\tif (strategy) {\n\t\t\tstrategy.withPositions(this._getAllPositions());\n\t\t}\n\t}\n\n\tprivate _buildPositionStrategy() {\n\t\treturn this._overlayPositionBuilder\n\t\t\t.flexibleConnectedTo(this._elementRef)\n\t\t\t.withPositions(this._getAllPositions())\n\t\t\t.withViewportMargin(8);\n\t}\n\n\t/** Build [preferred, ...fallbacks] position array for viewport-aware auto-flip. */\n\tprivate _getAllPositions(): ConnectedPosition[] {\n\t\tconst preferred = this.position();\n\t\treturn [preferred, ...BRN_TOOLTIP_FALLBACK_POSITIONS[preferred]].map((pos) => this._getAdjustedPositionFor(pos));\n\t}\n\n\tprivate _getAdjustedPositionFor(pos: BrnTooltipPosition): ConnectedPosition {\n\t\tconst position = BRN_TOOLTIP_POSITIONS_MAP[pos];\n\t\tconst isLtr = this._dir.value !== 'rtl';\n\n\t\treturn {\n\t\t\t...position,\n\t\t\toffsetX: position.offsetX != null ? (isLtr ? position.offsetX : -position.offsetX) : undefined,\n\t\t};\n\t}\n\n\tprivate _initTriggers() {\n\t\tthis._initScrollListener();\n\t\tthis._initHoverListeners();\n\t}\n\n\tprivate _initHoverListeners(): void {\n\t\tthis._listenersRefs = [\n\t\t\t...this._listenersRefs,\n\t\t\tthis._renderer.listen(this._elementRef.nativeElement, 'mouseenter', () => this._requestShow()),\n\t\t\tthis._renderer.listen(this._elementRef.nativeElement, 'mouseleave', () => this.delay(false, this.hideDelay())),\n\t\t\tthis._renderer.listen(this._elementRef.nativeElement, 'focus', () => this._requestShow()),\n\t\t\tthis._renderer.listen(this._elementRef.nativeElement, 'blur', () => this.delay(false, this.hideDelay())),\n\t\t];\n\t}\n\n\t/** Snapshot the group skip decision once, so the delay and the instant-open state agree even if a\n\t * sibling flips the window during the show delay. */\n\tprivate _requestShow(): void {\n\t\tconst skip = !!this._group && !this._group.isOpenDelayed();\n\t\tthis.delay(true, skip ? 0 : this.showDelay(), skip);\n\t}\n\n\tprivate _initScrollListener(): void {\n\t\tthis._listenersRefs = [\n\t\t\t...this._listenersRefs,\n\t\t\tthis._renderer.listen(this._document.defaultView, 'scroll', () => this._hide()),\n\t\t];\n\t}\n\n\tprivate _cleanupTriggerEvents(): void {\n\t\tfor (const eventRef of this._listenersRefs) {\n\t\t\teventRef();\n\t\t}\n\t\tthis._listenersRefs = [];\n\t}\n\n\tprivate delay(isShow: boolean, delay = -1, instant = false): void {\n\t\tthis._delaySubject?.next({ isShow, delay, instant });\n\t}\n\n\tprivate _setupDelayMechanism(): void {\n\t\tthis._delaySubject?.complete();\n\t\tthis._delaySubject = new Subject<DelayConfig>();\n\n\t\tthis._delaySubject\n\t\t\t.pipe(\n\t\t\t\tswitchMap((config) => (config.delay < 0 ? of(config) : timer(config.delay).pipe(map(() => config)))),\n\t\t\t\ttakeUntilDestroyed(this._destroyRef),\n\t\t\t)\n\t\t\t.subscribe((config) => {\n\t\t\t\tif (config.isShow) {\n\t\t\t\t\tthis._show(config.instant);\n\t\t\t\t} else {\n\t\t\t\t\tthis._hide();\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\tprivate _show(instant = false): void {\n\t\tif (!this._tooltipText() || this.mutableTooltipDisabled()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// 'instant-open' suppresses the enter animation. Decided with the delay at request time so a sibling\n\t\t// flipping the group window mid-delay can't desync the animation from the wait that actually happened.\n\t\tconst openState = instant ? 'instant-open' : 'open';\n\n\t\t// Already attached: revive only if it is mid-close (exit animation playing). Cancel the\n\t\t// pending teardown and flip it back open instead of letting it fade out and detach.\n\t\tif (this._componentRef) {\n\t\t\tif (this._componentRef.instance.state() === 'closed') {\n\t\t\t\tthis._closeGeneration++;\n\t\t\t\tthis._componentRef.instance.state.set(openState);\n\t\t\t\t// Re-apply props so a programmatic text change during the close is reflected on revive.\n\t\t\t\t// Keep the live (possibly flipped) position rather than resetting to the raw input.\n\t\t\t\tthis._applyContentProps(this._componentRef.instance, this._activePosition ?? this.position());\n\t\t\t\tthis._group?.onOpen();\n\t\t\t\tthis.show.emit();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst tooltipPortal = new ComponentPortal(BrnTooltipContent);\n\t\tthis._componentRef = this._overlayRef?.attach(tooltipPortal);\n\t\tthis._componentRef?.onDestroy(() => {\n\t\t\tthis._componentRef = undefined;\n\t\t});\n\t\tthis._componentRef?.instance.state.set(openState);\n\t\tthis._group?.onOpen();\n\t\tif (this._componentRef) {\n\t\t\tthis._applyContentProps(this._componentRef.instance, this.position());\n\t\t}\n\n\t\t// Subscribe to position changes for the lifetime of the tooltip so that\n\t\t// arrow direction and CSS classes stay in sync when the CDK flips the\n\t\t// overlay (initial show, viewport resize, scroll, etc.).\n\t\tconst strategy = this._overlayRef?.getConfig().positionStrategy as FlexibleConnectedPositionStrategy | undefined;\n\t\tif (strategy && this._componentRef) {\n\t\t\tconst compRef = this._componentRef;\n\t\t\tthis._positionChangeSub = strategy.positionChanges\n\t\t\t\t.pipe(takeUntilDestroyed(this._destroyRef))\n\t\t\t\t.subscribe((change) => {\n\t\t\t\t\tconst resolved = resolveTooltipPosition(change.connectionPair);\n\t\t\t\t\tif (resolved) {\n\t\t\t\t\t\tthis._applyContentProps(compRef.instance, resolved, null);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\n\t\trunInInjectionContext(this._injector, () => {\n\t\t\tthis._ariaEffectRef = effect(() => {\n\t\t\t\tconst tooltipId = this._componentRef?.instance.id();\n\t\t\t\tif (tooltipId) {\n\t\t\t\t\tthis._renderer.setAttribute(this._elementRef.nativeElement, 'aria-describedby', tooltipId);\n\t\t\t\t\tthis._ariaEffectRef?.destroy();\n\t\t\t\t\tthis._ariaEffectRef = undefined;\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t\tthis.show.emit();\n\t}\n\n\t/** Apply text + position (and the position-derived classes) to the content, recording the position as\n\t * active. Pass `text = null` for a position-only update that keeps the content's existing text. */\n\tprivate _applyContentProps(\n\t\tcontent: BrnTooltipContent,\n\t\tposition: BrnTooltipPosition,\n\t\ttext: BrnTooltipType = this._tooltipText(),\n\t): void {\n\t\tthis._activePosition = position;\n\t\tcontent.setProps(\n\t\t\ttext,\n\t\t\tposition,\n\t\t\tthis._config.tooltipContentClasses,\n\t\t\tthis._config.arrowClasses(position),\n\t\t\tthis._config.svgClasses,\n\t\t);\n\t}\n\n\tprivate _hide(): void {\n\t\tif (!this._componentRef || this._tooltipHovered) return;\n\t\t// Already closing (exit animation in flight): nothing to do.\n\t\tif (this._componentRef.instance.state() === 'closed') return;\n\t\tthis._componentRef.instance.state.set('closed');\n\t\tthis._group?.onClose();\n\t\tthis.hide.emit();\n\t\tthis._scheduleDetach(this._componentRef);\n\t}\n\n\t/**\n\t * Keep the content mounted until its `data-[state=closed]` exit animation finishes, then tear it\n\t * down. A re-show (revive) bumps `_closeGeneration`, which cancels the pending detach.\n\t */\n\tprivate _scheduleDetach(componentRef: ComponentRef<BrnTooltipContent>): void {\n\t\tconst generation = ++this._closeGeneration;\n\t\tconst content = componentRef.location.nativeElement as HTMLElement;\n\t\tafterNextRender(\n\t\t\t() => {\n\t\t\t\tvoid waitForElementAnimations(content).then(() => {\n\t\t\t\t\tif (generation === this._closeGeneration) this._detach();\n\t\t\t\t});\n\t\t\t},\n\t\t\t{ injector: this._injector },\n\t\t);\n\t}\n\n\tprivate _detach(): void {\n\t\tthis._clearAriaDescribedBy();\n\t\tthis._positionChangeSub?.unsubscribe();\n\t\tthis._positionChangeSub = undefined;\n\t\tthis._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');\n\t\tthis._overlayRef?.detach();\n\t}\n\n\tprivate _clearAriaDescribedBy(): void {\n\t\tif (this._ariaEffectRef) {\n\t\t\tthis._ariaEffectRef.destroy();\n\t\t\tthis._ariaEffectRef = undefined;\n\t\t}\n\t}\n}\n","import { BrnTooltip } from './lib/brn-tooltip';\nimport { BrnTooltipContent } from './lib/brn-tooltip-content';\n\nexport * from './lib/brn-tooltip';\nexport * from './lib/brn-tooltip-content';\nexport * from './lib/brn-tooltip-group';\nexport { BRN_TOOLTIP_FALLBACK_POSITIONS, BrnTooltipPosition, resolveTooltipPosition } from './lib/brn-tooltip-position';\nexport * from './lib/brn-tooltip-type';\nexport * from './lib/brn-tooltip.token';\n\nexport const BrnTooltipImports = [BrnTooltip, BrnTooltipContent] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAYM,SAAU,aAAa,CAAc,KAAc,EAAA;IACxD,OAAO,KAAK,YAAY,WAAW;AACpC;MAWa,8BAA8B,CAAA;AACzB,IAAA,cAAc,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAA,YAAY,GAAG,MAAM,EAAC,WAAiB,EAAC;IAEjD,gBAAgB,GAAqD,IAAI;IAChE,QAAQ,GAAG,EAA8B;IAElD,cAAc,GAAG,IAAI;IACrB,sBAAsB,GAAG,KAAK;IAC9B,gBAAgB,GAA6B,IAAI;AACjD,IAAA,YAAY;AAEJ,IAAA,qCAAqC,GAAG,KAAK,CAAuC,SAAS,4GAAC;AAC9F,IAAA,8BAA8B,GAAG,KAAK,CAAC,QAAQ,oGAAyB;AAExF,IAAA,uBAAuB,CAAC,OAA6C,EAAA;QACpE,IAAI,CAAC,OAAO,EAAE;AACb,YAAA,OAAO,KAAK;QACb;AACA,QAAA,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,EAAE,CAAC;QACxD,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC;QAE9C,IAAI,WAAW,CAAC,MAAM,KAAK,WAAW,CAAC,MAAM,EAAE;AAC9C,YAAA,KAAK,MAAM,QAAQ,IAAI,WAAW,EAAE;gBACnC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,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,QAAQ,EAAE,YAAY,EAAE;;;MC1ClD,iBAAiB,GAAG,CAAC,UAAU,EAAE,iBAAiB;;ACV/D;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"spartan-ng-brain-tooltip.mjs","sources":["../../../../libs/brain/tooltip/src/lib/brn-tooltip-string-template-outlet.ts","../../../../libs/brain/tooltip/src/lib/brn-tooltip-content.ts","../../../../libs/brain/tooltip/src/lib/brn-tooltip-group.ts","../../../../libs/brain/tooltip/src/lib/brn-tooltip-position.ts","../../../../libs/brain/tooltip/src/lib/brn-tooltip.token.ts","../../../../libs/brain/tooltip/src/lib/brn-tooltip.ts","../../../../libs/brain/tooltip/src/index.ts","../../../../libs/brain/tooltip/src/spartan-ng-brain-tooltip.ts"],"sourcesContent":["import {\n\tDirective,\n\teffect,\n\ttype EffectRef,\n\ttype EmbeddedViewRef,\n\tinject,\n\tinput,\n\ttype OnDestroy,\n\tTemplateRef,\n\tViewContainerRef,\n} from '@angular/core';\n\nexport function isTemplateRef<C = unknown>(value: unknown): value is TemplateRef<C> {\n\treturn value instanceof TemplateRef;\n}\n\nexport interface BrnTemplateOutletContext {\n\t$implicit: unknown;\n\t[key: string]: unknown;\n}\n\n@Directive({\n\tselector: '[brnTooltipStringTemplateOutlet]',\n\texportAs: 'brnTooltipStringTemplateOutlet',\n})\nexport class BrnTooltipStringTemplateOutlet<T = unknown> implements OnDestroy {\n\tprivate readonly _viewContainer = inject(ViewContainerRef);\n\tprivate readonly _templateRef = inject(TemplateRef<void>);\n\n\tprivate _embeddedViewRef: EmbeddedViewRef<BrnTemplateOutletContext> | null = null;\n\tprivate readonly _context = {} as BrnTemplateOutletContext;\n\n\tprivate _isFirstChange = true;\n\tprivate _lastOutletWasTemplate = false;\n\tprivate _lastTemplateRef: TemplateRef<void> | null = null;\n\tprivate _lastContext?: BrnTemplateOutletContext;\n\n\tpublic readonly brnTooltipStringTemplateOutletContext = input<BrnTemplateOutletContext | undefined>(undefined);\n\tpublic readonly brnTooltipStringTemplateOutlet = input.required<T | TemplateRef<void>>();\n\n\t_hasContextShapeChanged(context: BrnTemplateOutletContext | undefined): boolean {\n\t\tif (!context) {\n\t\t\treturn false;\n\t\t}\n\t\tconst prevCtxKeys = Object.keys(this._lastContext || {});\n\t\tconst currCtxKeys = Object.keys(context || {});\n\n\t\tif (prevCtxKeys.length === currCtxKeys.length) {\n\t\t\tfor (const propName of currCtxKeys) {\n\t\t\t\tif (!prevCtxKeys.includes(propName)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t_shouldViewBeRecreated(\n\t\tstringTemplateOutlet: TemplateRef<void> | T,\n\t\tstringTemplateOutletContext: BrnTemplateOutletContext | undefined,\n\t): boolean {\n\t\tconst isTemplate = isTemplateRef(stringTemplateOutlet);\n\n\t\tconst shouldOutletRecreate =\n\t\t\tthis._isFirstChange ||\n\t\t\tisTemplate !== this._lastOutletWasTemplate ||\n\t\t\t(isTemplate && stringTemplateOutlet !== this._lastTemplateRef);\n\n\t\tconst shouldContextRecreate = this._hasContextShapeChanged(stringTemplateOutletContext);\n\t\treturn shouldContextRecreate || shouldOutletRecreate;\n\t}\n\n\t_updateTrackingState(\n\t\tstringTemplateOutlet: TemplateRef<void> | T,\n\t\tstringTemplateOutletContext: BrnTemplateOutletContext | undefined,\n\t): void {\n\t\tconst isTemplate = isTemplateRef(stringTemplateOutlet);\n\t\tif (this._isFirstChange && !isTemplate) {\n\t\t\tthis._isFirstChange = false;\n\t\t}\n\n\t\tif (stringTemplateOutletContext !== undefined) {\n\t\t\tthis._lastContext = stringTemplateOutletContext;\n\t\t}\n\n\t\tthis._lastOutletWasTemplate = isTemplate;\n\t\tthis._lastTemplateRef = isTemplate ? stringTemplateOutlet : null;\n\t}\n\n\tprivate readonly _viewEffect: EffectRef = effect(() => {\n\t\tconst stringTemplateOutlet = this.brnTooltipStringTemplateOutlet();\n\t\tconst stringTemplateOutletContext = this.brnTooltipStringTemplateOutletContext();\n\n\t\tif (!this._isFirstChange && isTemplateRef(stringTemplateOutlet)) {\n\t\t\tthis._isFirstChange = true;\n\t\t}\n\n\t\tif (!isTemplateRef(stringTemplateOutlet)) {\n\t\t\tthis._context['$implicit'] = stringTemplateOutlet as T;\n\t\t}\n\n\t\tconst recreateView = this._shouldViewBeRecreated(stringTemplateOutlet, stringTemplateOutletContext);\n\t\tthis._updateTrackingState(stringTemplateOutlet, stringTemplateOutletContext);\n\n\t\tif (recreateView) {\n\t\t\tthis._recreateView(stringTemplateOutlet as TemplateRef<BrnTemplateOutletContext>, stringTemplateOutletContext);\n\t\t} else {\n\t\t\tthis._updateContext(stringTemplateOutlet, stringTemplateOutletContext);\n\t\t}\n\t});\n\n\tprivate _recreateView(\n\t\toutlet: TemplateRef<BrnTemplateOutletContext>,\n\t\tcontext: BrnTemplateOutletContext | undefined,\n\t): void {\n\t\tthis._viewContainer.clear();\n\t\tif (isTemplateRef(outlet)) {\n\t\t\tthis._embeddedViewRef = this._viewContainer.createEmbeddedView(outlet, context);\n\t\t} else {\n\t\t\tthis._embeddedViewRef = this._viewContainer.createEmbeddedView(this._templateRef, this._context);\n\t\t}\n\t}\n\n\tprivate _updateContext(outlet: TemplateRef<void> | T, context: BrnTemplateOutletContext | undefined): void {\n\t\tconst newCtx = isTemplateRef(outlet) ? context : this._context;\n\t\tlet oldCtx = this._embeddedViewRef?.context;\n\n\t\tif (!oldCtx) {\n\t\t\toldCtx = newCtx;\n\t\t} else if (newCtx && typeof newCtx === 'object') {\n\t\t\tfor (const propName of Object.keys(newCtx)) {\n\t\t\t\toldCtx[propName] = newCtx[propName];\n\t\t\t}\n\t\t}\n\t\tthis._lastContext = oldCtx;\n\t}\n\n\tstatic ngTemplateContextGuard<T>(\n\t\t_dir: BrnTooltipStringTemplateOutlet<T>,\n\t\t_ctx: unknown,\n\t): _ctx is BrnTemplateOutletContext {\n\t\treturn true;\n\t}\n\n\tpublic ngOnDestroy(): void {\n\t\tthis._viewEffect.destroy();\n\t\tthis._viewContainer.clear();\n\t\tthis._embeddedViewRef = null;\n\t}\n}\n","import { ChangeDetectionStrategy, Component, input, signal } from '@angular/core';\nimport { ClassValue } from 'clsx';\nimport { BrnTooltipPosition } from './brn-tooltip-position';\nimport { BrnTooltipStringTemplateOutlet } from './brn-tooltip-string-template-outlet';\nimport { BrnTooltipType } from './brn-tooltip-type';\n\nlet uniqueId = 0;\n\n@Component({\n\timports: [BrnTooltipStringTemplateOutlet],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\thost: {\n\t\t'[class]': '_tooltipClass()',\n\t\t'[attr.id]': 'id()',\n\t\t'[attr.data-side]': '_position()',\n\t\t'[attr.data-state]': 'state()',\n\t\trole: 'tooltip',\n\t},\n\ttemplate: `\n\t\t<ng-container *brnTooltipStringTemplateOutlet=\"_tooltipText()\">{{ _tooltipText() }}</ng-container>\n\n\t\t<span [class]=\"_arrowClass()\">\n\t\t\t<svg [class]=\"_svgClass()\" width=\"10\" height=\"5\" viewBox=\"0 0 30 10\" preserveAspectRatio=\"none\">\n\t\t\t\t<polygon points=\"0,0 30,0 15,10\" />\n\t\t\t</svg>\n\t\t</span>\n\t`,\n})\nexport class BrnTooltipContent {\n\tpublic readonly id = input<string>(`brn-tooltip-${++uniqueId}`);\n\tpublic readonly state = signal<'closed' | 'open' | 'instant-open'>('closed');\n\n\tprotected readonly _tooltipClass = signal<ClassValue>('');\n\tprotected readonly _arrowClass = signal<ClassValue>('');\n\tprotected readonly _svgClass = signal<ClassValue>('');\n\n\tprotected readonly _position = signal<BrnTooltipPosition>('top');\n\tprotected readonly _tooltipText = signal<BrnTooltipType>(null);\n\n\tpublic setProps(\n\t\ttooltipText: BrnTooltipType,\n\t\tposition: BrnTooltipPosition,\n\t\ttooltipClasses: ClassValue,\n\t\tarrowClasses: ClassValue,\n\t\tsvgClasses: ClassValue,\n\t): void {\n\t\tif (tooltipText) {\n\t\t\tthis._tooltipText.set(tooltipText);\n\t\t}\n\t\tthis._position.set(position);\n\n\t\tthis._tooltipClass.set(tooltipClasses);\n\t\tthis._arrowClass.set(arrowClasses);\n\t\tthis._svgClass.set(svgClasses);\n\t}\n}\n","import { inject, Injectable, InjectionToken, type Provider } from '@angular/core';\nimport { injectSkipDelay } from '@spartan-ng/brain/core';\n\nexport interface BrnTooltipGroupOptions {\n\t/** Time (ms) after the last tooltip closes during which others open instantly. `0` disables it. */\n\tskipDelayDuration: number;\n}\n\nconst defaultGroupOptions: BrnTooltipGroupOptions = { skipDelayDuration: 300 };\n\nconst BRN_TOOLTIP_GROUP_OPTIONS = new InjectionToken<BrnTooltipGroupOptions>('BrnTooltipGroupOptions');\n\n/** Skip-delay coordinator for grouped tooltips; provide via `provideBrnTooltipGroup` on the wrapper. */\n@Injectable()\nexport class BrnTooltipGroup {\n\tprivate readonly _options = inject(BRN_TOOLTIP_GROUP_OPTIONS);\n\tprivate readonly _skipDelay = injectSkipDelay(() => this._options.skipDelayDuration);\n\n\t/** Whether the next tooltip waits for its show delay, or opens instantly within the skip window. */\n\tpublic readonly isOpenDelayed = this._skipDelay.isOpenDelayed;\n\n\tpublic onOpen(): void {\n\t\tthis._skipDelay.open();\n\t}\n\n\tpublic onClose(): void {\n\t\tthis._skipDelay.close();\n\t}\n}\n\nexport function provideBrnTooltipGroup(options?: Partial<BrnTooltipGroupOptions>): Provider[] {\n\treturn [{ provide: BRN_TOOLTIP_GROUP_OPTIONS, useValue: { ...defaultGroupOptions, ...options } }, BrnTooltipGroup];\n}\n","import type { ConnectedPosition } from '@angular/cdk/overlay';\n\nexport type BrnTooltipPosition = 'top' | 'bottom' | 'left' | 'right';\n\nexport const BRN_TOOLTIP_POSITIONS_MAP: Record<BrnTooltipPosition, ConnectedPosition> = {\n\ttop: {\n\t\toriginX: 'center',\n\t\toriginY: 'top',\n\t\toverlayX: 'center',\n\t\toverlayY: 'bottom',\n\t\toffsetY: -8,\n\t},\n\tbottom: {\n\t\toriginX: 'center',\n\t\toriginY: 'bottom',\n\t\toverlayX: 'center',\n\t\toverlayY: 'top',\n\t\toffsetY: 8,\n\t},\n\tleft: {\n\t\toriginX: 'start',\n\t\toriginY: 'center',\n\t\toverlayX: 'end',\n\t\toverlayY: 'center',\n\t\toffsetX: -8,\n\t},\n\tright: {\n\t\toriginX: 'end',\n\t\toriginY: 'center',\n\t\toverlayX: 'start',\n\t\toverlayY: 'center',\n\t\toffsetX: 8,\n\t},\n};\n\n/** Fallback order for each preferred position when it doesn't fit in the viewport. */\nexport const BRN_TOOLTIP_FALLBACK_POSITIONS: Record<BrnTooltipPosition, BrnTooltipPosition[]> = {\n\ttop: ['bottom', 'right', 'left'],\n\tbottom: ['top', 'right', 'left'],\n\tleft: ['right', 'top', 'bottom'],\n\tright: ['left', 'top', 'bottom'],\n};\n\n/** Map a resolved CDK ConnectedPosition back to a BrnTooltipPosition, or null if no match. */\nexport function resolveTooltipPosition(pair: ConnectedPosition): BrnTooltipPosition | null {\n\tfor (const [pos, config] of Object.entries(BRN_TOOLTIP_POSITIONS_MAP)) {\n\t\tif (\n\t\t\tpair.originX === config.originX &&\n\t\t\tpair.originY === config.originY &&\n\t\t\tpair.overlayX === config.overlayX &&\n\t\t\tpair.overlayY === config.overlayY\n\t\t) {\n\t\t\treturn pos as BrnTooltipPosition;\n\t\t}\n\t}\n\treturn null;\n}\n","import { inject, InjectionToken, type ValueProvider } from '@angular/core';\nimport { type ClassValue } from 'clsx';\nimport { type BrnTooltipPosition } from './brn-tooltip-position';\n\nexport interface BrnTooltipOptions {\n\t/** Default delay when the tooltip is shown. */\n\tshowDelay: number;\n\t/** Default delay when the tooltip is hidden. */\n\thideDelay: number;\n\t/** Default position for tooltips. */\n\tposition?: BrnTooltipPosition;\n\t/** Additional classes for the SVG element in the tooltip arrow. */\n\tsvgClasses: ClassValue;\n\t/** Additional classes for the tooltip arrow element based on position. */\n\tarrowClasses: (position: BrnTooltipPosition) => ClassValue;\n\t/** Additional classes for the tooltip content element. */\n\ttooltipContentClasses: ClassValue;\n}\n\nexport const defaultOptions: BrnTooltipOptions = {\n\tshowDelay: 150,\n\thideDelay: 100,\n\tsvgClasses: '',\n\tarrowClasses: () => '',\n\ttooltipContentClasses: '',\n};\n\nconst BRN_TOOLTIP_DEFAULT_OPTIONS = new InjectionToken<BrnTooltipOptions>('brn-tooltip-default-options', {\n\tprovidedIn: 'root',\n\tfactory: () => defaultOptions,\n});\n\nexport function provideBrnTooltipDefaultOptions(options: Partial<BrnTooltipOptions>): ValueProvider {\n\treturn { provide: BRN_TOOLTIP_DEFAULT_OPTIONS, useValue: { ...defaultOptions, ...options } };\n}\n\nexport function injectBrnTooltipDefaultOptions(): BrnTooltipOptions {\n\treturn inject(BRN_TOOLTIP_DEFAULT_OPTIONS, { optional: true }) ?? defaultOptions;\n}\n","import {\n\tConnectedPosition,\n\tFlexibleConnectedPositionStrategy,\n\tOverlay,\n\tOverlayPositionBuilder,\n\ttype OverlayRef,\n} from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { DOCUMENT } from '@angular/common';\nimport {\n\tafterNextRender,\n\tbooleanAttribute,\n\ttype ComponentRef,\n\tcomputed,\n\tDestroyRef,\n\tDirective,\n\teffect,\n\tElementRef,\n\tinject,\n\tInjector,\n\tinput,\n\tlinkedSignal,\n\tnumberAttribute,\n\toutput,\n\tRenderer2,\n\trunInInjectionContext,\n\ttype TemplateRef,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { Directionality } from '@angular/cdk/bidi';\nimport { waitForElementAnimations } from '@spartan-ng/brain/core';\nimport { of, Subject, Subscription, timer } from 'rxjs';\nimport { map, switchMap } from 'rxjs/operators';\nimport { BrnTooltipContent } from './brn-tooltip-content';\nimport { BrnTooltipGroup } from './brn-tooltip-group';\nimport {\n\tBRN_TOOLTIP_FALLBACK_POSITIONS,\n\tBRN_TOOLTIP_POSITIONS_MAP,\n\tBrnTooltipPosition,\n\tresolveTooltipPosition,\n} from './brn-tooltip-position';\nimport { BrnTooltipType } from './brn-tooltip-type';\nimport { injectBrnTooltipDefaultOptions } from './brn-tooltip.token';\n\ninterface DelayConfig {\n\tisShow: boolean;\n\tdelay: number;\n\t/** Snapshotted at request time: open instantly (no enter animation) because the group window was open. */\n\tinstant: boolean;\n}\n\n@Directive({ selector: '[brnTooltip]', exportAs: 'brnTooltip' })\nexport class BrnTooltip {\n\tprivate readonly _config = injectBrnTooltipDefaultOptions();\n\n\tprivate readonly _destroyRef = inject(DestroyRef);\n\tprivate readonly _document = inject(DOCUMENT);\n\tprivate readonly _elementRef = inject(ElementRef<HTMLElement>);\n\tprivate readonly _injector = inject(Injector);\n\tprivate readonly _overlay = inject(Overlay);\n\tprivate readonly _overlayPositionBuilder = inject(OverlayPositionBuilder);\n\tprivate readonly _renderer = inject(Renderer2);\n\tprivate readonly _dir = inject(Directionality);\n\tprivate readonly _group = inject(BrnTooltipGroup, { optional: true });\n\n\tprivate _tooltipHovered = false;\n\tprivate _listenersRefs: (() => void)[] = [];\n\tprivate _delaySubject: Subject<DelayConfig> | undefined = undefined;\n\tprivate _componentRef: ComponentRef<BrnTooltipContent> | undefined = undefined;\n\tprivate _overlayRef: OverlayRef | undefined = undefined;\n\tprivate _ariaEffectRef: ReturnType<typeof effect> | undefined = undefined;\n\tprivate _positionChangeSub: Subscription | undefined = undefined;\n\t/** Bumped on every close/show so a pending exit-animation teardown can detect it was superseded. */\n\tprivate _closeGeneration = 0;\n\t/** The position currently applied to the content - the CDK-resolved one after a flip, not the raw input. */\n\tprivate _activePosition: BrnTooltipPosition | undefined = undefined;\n\n\tpublic readonly tooltipDisabled = input<boolean, boolean>(false, { transform: booleanAttribute });\n\tpublic readonly mutableTooltipDisabled = linkedSignal(this.tooltipDisabled);\n\n\tpublic readonly position = input<BrnTooltipPosition>(this._config.position ?? 'top');\n\tpublic readonly brnTooltip = input<BrnTooltipType>(null);\n\tpublic readonly showDelay = input<number, number>(this._config.showDelay, { transform: numberAttribute });\n\tpublic readonly hideDelay = input<number, number>(this._config.hideDelay, { transform: numberAttribute });\n\n\tpublic readonly show = output<void>();\n\tpublic readonly hide = output<void>();\n\n\tprivate readonly _tooltipText = computed<string | TemplateRef<void>>(() => {\n\t\tlet tooltipText = this.brnTooltip();\n\t\tif (!tooltipText) {\n\t\t\treturn '';\n\t\t} else if (typeof tooltipText === 'string') {\n\t\t\ttooltipText = tooltipText.trim();\n\t\t}\n\t\treturn tooltipText;\n\t});\n\n\tconstructor() {\n\t\tafterNextRender(() => {\n\t\t\tthis._overlayRef = this._overlay.create({\n\t\t\t\tdirection: this._dir,\n\t\t\t\tpositionStrategy: this._buildPositionStrategy(),\n\t\t\t});\n\n\t\t\tthis._dir.change.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => {\n\t\t\t\tif (this._overlayRef) {\n\t\t\t\t\tthis._updatePosition();\n\t\t\t\t\tif (this._overlayRef.hasAttached()) {\n\t\t\t\t\t\tthis._overlayRef.updatePosition();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\trunInInjectionContext(this._injector, () => {\n\t\t\t\tif (!this._overlayRef) return;\n\t\t\t\tthis._setupDelayMechanism();\n\t\t\t\tthis._cleanupTriggerEvents();\n\t\t\t\tthis._initTriggers();\n\n\t\t\t\t/**\n\t\t\t\t * This effect is used to update the tooltip content when the tooltip text changes.\n\t\t\t\t * It's the reactive bridge between the tooltip text and the tooltip content.\n\t\t\t\t */\n\t\t\t\teffect(() => {\n\t\t\t\t\tconst text = this._tooltipText();\n\t\t\t\t\tif (this._componentRef) {\n\t\t\t\t\t\tthis._applyContentProps(this._componentRef.instance, this._activePosition ?? this.position(), text);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tthis._listenersRefs = [\n\t\t\t\t\t...this._listenersRefs,\n\t\t\t\t\tthis._renderer.listen(this._overlayRef.hostElement, 'pointerenter', (event: PointerEvent) => {\n\t\t\t\t\t\tif (this._isHoverPointer(event)) this._tooltipHovered = true;\n\t\t\t\t\t}),\n\t\t\t\t\tthis._renderer.listen(this._overlayRef.hostElement, 'pointerleave', (event: PointerEvent) => {\n\t\t\t\t\t\tif (!this._isHoverPointer(event)) return;\n\t\t\t\t\t\tthis._tooltipHovered = false;\n\t\t\t\t\t\tthis.delay(false, this.hideDelay());\n\t\t\t\t\t}),\n\t\t\t\t];\n\t\t\t});\n\t\t});\n\n\t\tthis._destroyRef.onDestroy(() => {\n\t\t\tthis._clearAriaDescribedBy();\n\t\t\tthis._delaySubject?.complete();\n\t\t\tthis._cleanupTriggerEvents();\n\t\t\tthis._overlayRef?.dispose();\n\t\t});\n\t}\n\n\tprivate _updatePosition(): void {\n\t\tconst strategy = this._overlayRef?.getConfig().positionStrategy as FlexibleConnectedPositionStrategy;\n\n\t\tif (strategy) {\n\t\t\tstrategy.withPositions(this._getAllPositions());\n\t\t}\n\t}\n\n\tprivate _buildPositionStrategy() {\n\t\treturn this._overlayPositionBuilder\n\t\t\t.flexibleConnectedTo(this._elementRef)\n\t\t\t.withPositions(this._getAllPositions())\n\t\t\t.withViewportMargin(8);\n\t}\n\n\t/** Build [preferred, ...fallbacks] position array for viewport-aware auto-flip. */\n\tprivate _getAllPositions(): ConnectedPosition[] {\n\t\tconst preferred = this.position();\n\t\treturn [preferred, ...BRN_TOOLTIP_FALLBACK_POSITIONS[preferred]].map((pos) => this._getAdjustedPositionFor(pos));\n\t}\n\n\tprivate _getAdjustedPositionFor(pos: BrnTooltipPosition): ConnectedPosition {\n\t\tconst position = BRN_TOOLTIP_POSITIONS_MAP[pos];\n\t\tconst isLtr = this._dir.value !== 'rtl';\n\t\tconst baseOffsetX = position.offsetX != null ? (isLtr ? position.offsetX : -position.offsetX) : 0;\n\t\tconst baseOffsetY = position.offsetY ?? 0;\n\t\tconst { x: compensationX, y: compensationY } = this._getVisualViewportCompensation(position, isLtr);\n\n\t\t// CDK renders offsetX/offsetY as a transform on the pane, so fold the viewport compensation in here.\n\t\treturn {\n\t\t\t...position,\n\t\t\toffsetX: baseOffsetX + compensationX,\n\t\t\toffsetY: baseOffsetY + compensationY,\n\t\t};\n\t}\n\n\t/**\n\t * Corrects overlay placement for the layout-vs-visual viewport mismatch on mobile browsers.\n\t *\n\t * Tooltips only open on hover/focus, but a hovering pen (e.g. Apple Pencil on iOS Safari) can open\n\t * one on a phone/tablet where this bites: as the browser's toolbars collapse the visual viewport\n\t * grows, yet `documentElement.clientHeight`/`clientWidth` stay frozen at the toolbar-expanded size.\n\t * CDK anchors bottom/right overlays from those stale dimensions (top/left overlays measure from the\n\t * pinned top-left edge and are unaffected), so a `position: 'top'` tooltip lands shifted by the delta.\n\t *\n\t * We fold that delta back in as an offset. It is 0 whenever the viewports match (desktop, or toolbar\n\t * expanded), so this is a no-op everywhere except the collapsed-toolbar case it targets.\n\t */\n\tprivate _getVisualViewportCompensation(position: ConnectedPosition, isLtr: boolean): { x: number; y: number } {\n\t\tconst visualViewport = this._document.defaultView?.visualViewport;\n\t\tif (!visualViewport) return { x: 0, y: 0 };\n\n\t\t// Only the collapsing-toolbar case is a pure height/width change with the viewport top-left still\n\t\t// pinned (scale 1, offset 0). Pinch-zoom (scale != 1) and the software keyboard (offset != 0)\n\t\t// shrink the visual viewport for unrelated reasons, so the delta below would shift the tooltip\n\t\t// wrongly - bail and let CDK position normally.\n\t\tconst pinnedToTopLeft = Math.abs(visualViewport.offsetTop) < 1 && Math.abs(visualViewport.offsetLeft) < 1;\n\t\tif (Math.abs(visualViewport.scale - 1) > 0.01 || !pinnedToTopLeft) return { x: 0, y: 0 };\n\n\t\tconst docEl = this._document.documentElement;\n\t\tconst anchorsFromBottom = position.overlayY === 'bottom';\n\t\tconst anchorsFromRight = isLtr ? position.overlayX === 'end' : position.overlayX === 'start';\n\n\t\treturn {\n\t\t\tx: anchorsFromRight ? docEl.clientWidth - visualViewport.width : 0,\n\t\t\ty: anchorsFromBottom ? docEl.clientHeight - visualViewport.height : 0,\n\t\t};\n\t}\n\n\tprivate _initTriggers() {\n\t\tthis._initScrollListener();\n\t\tthis._initHoverListeners();\n\t}\n\n\t/**\n\t * Tooltips are supplementary labels for a trigger that already has its own action, so - like Radix\n\t * and Base UI - they open only on mouse/pen hover and keyboard focus, never on touch (a touch tap\n\t * would both fire the trigger's action and the tooltip). Touch pointers are ignored via\n\t * `_isHoverPointer`; use a popover when touch users need to see the content.\n\t */\n\tprivate _initHoverListeners(): void {\n\t\tthis._listenersRefs = [\n\t\t\t...this._listenersRefs,\n\t\t\tthis._renderer.listen(this._elementRef.nativeElement, 'pointerenter', (event: PointerEvent) => {\n\t\t\t\tif (this._isHoverPointer(event)) this._requestShow();\n\t\t\t}),\n\t\t\tthis._renderer.listen(this._elementRef.nativeElement, 'pointerleave', (event: PointerEvent) => {\n\t\t\t\tif (this._isHoverPointer(event)) this.delay(false, this.hideDelay());\n\t\t\t}),\n\t\t\tthis._renderer.listen(this._elementRef.nativeElement, 'focus', () => this._requestShow()),\n\t\t\tthis._renderer.listen(this._elementRef.nativeElement, 'blur', () => this.delay(false, this.hideDelay())),\n\t\t];\n\t}\n\n\tprivate _isHoverPointer(event: PointerEvent): boolean {\n\t\treturn event.pointerType === 'mouse' || event.pointerType === 'pen';\n\t}\n\n\t/** Snapshot the group skip decision once, so the delay and the instant-open state agree even if a\n\t * sibling flips the window during the show delay. */\n\tprivate _requestShow(): void {\n\t\tconst skip = !!this._group && !this._group.isOpenDelayed();\n\t\tthis.delay(true, skip ? 0 : this.showDelay(), skip);\n\t}\n\n\tprivate _initScrollListener(): void {\n\t\tthis._listenersRefs = [\n\t\t\t...this._listenersRefs,\n\t\t\tthis._renderer.listen(this._document.defaultView, 'scroll', () => this._hide()),\n\t\t];\n\t}\n\n\tprivate _cleanupTriggerEvents(): void {\n\t\tfor (const eventRef of this._listenersRefs) {\n\t\t\teventRef();\n\t\t}\n\t\tthis._listenersRefs = [];\n\t}\n\n\tprivate delay(isShow: boolean, delay = -1, instant = false): void {\n\t\tthis._delaySubject?.next({ isShow, delay, instant });\n\t}\n\n\tprivate _setupDelayMechanism(): void {\n\t\tthis._delaySubject?.complete();\n\t\tthis._delaySubject = new Subject<DelayConfig>();\n\n\t\tthis._delaySubject\n\t\t\t.pipe(\n\t\t\t\tswitchMap((config) => (config.delay < 0 ? of(config) : timer(config.delay).pipe(map(() => config)))),\n\t\t\t\ttakeUntilDestroyed(this._destroyRef),\n\t\t\t)\n\t\t\t.subscribe((config) => {\n\t\t\t\tif (config.isShow) {\n\t\t\t\t\tthis._show(config.instant);\n\t\t\t\t} else {\n\t\t\t\t\tthis._hide();\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\tprivate _show(instant = false): void {\n\t\tif (!this._tooltipText() || this.mutableTooltipDisabled()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Recompute positions against the current viewport before attaching (see _getVisualViewportCompensation).\n\t\tthis._updatePosition();\n\n\t\t// 'instant-open' suppresses the enter animation. Decided with the delay at request time so a sibling\n\t\t// flipping the group window mid-delay can't desync the animation from the wait that actually happened.\n\t\tconst openState = instant ? 'instant-open' : 'open';\n\n\t\t// Already attached: revive only if it is mid-close (exit animation playing). Cancel the\n\t\t// pending teardown and flip it back open instead of letting it fade out and detach.\n\t\tif (this._componentRef) {\n\t\t\tif (this._componentRef.instance.state() === 'closed') {\n\t\t\t\tthis._closeGeneration++;\n\t\t\t\tthis._componentRef.instance.state.set(openState);\n\t\t\t\t// Re-apply props so a programmatic text change during the close is reflected on revive.\n\t\t\t\t// Keep the live (possibly flipped) position rather than resetting to the raw input.\n\t\t\t\tthis._applyContentProps(this._componentRef.instance, this._activePosition ?? this.position());\n\t\t\t\tthis._group?.onOpen();\n\t\t\t\tthis.show.emit();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst tooltipPortal = new ComponentPortal(BrnTooltipContent);\n\t\tthis._componentRef = this._overlayRef?.attach(tooltipPortal);\n\t\tthis._componentRef?.onDestroy(() => {\n\t\t\tthis._componentRef = undefined;\n\t\t});\n\t\tthis._componentRef?.instance.state.set(openState);\n\t\tthis._group?.onOpen();\n\t\tif (this._componentRef) {\n\t\t\tthis._applyContentProps(this._componentRef.instance, this.position());\n\t\t}\n\n\t\t// Subscribe to position changes for the lifetime of the tooltip so that\n\t\t// arrow direction and CSS classes stay in sync when the CDK flips the\n\t\t// overlay (initial show, viewport resize, scroll, etc.).\n\t\tconst strategy = this._overlayRef?.getConfig().positionStrategy as FlexibleConnectedPositionStrategy | undefined;\n\t\tif (strategy && this._componentRef) {\n\t\t\tconst compRef = this._componentRef;\n\t\t\tthis._positionChangeSub = strategy.positionChanges\n\t\t\t\t.pipe(takeUntilDestroyed(this._destroyRef))\n\t\t\t\t.subscribe((change) => {\n\t\t\t\t\tconst resolved = resolveTooltipPosition(change.connectionPair);\n\t\t\t\t\tif (resolved) {\n\t\t\t\t\t\tthis._applyContentProps(compRef.instance, resolved, null);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\n\t\trunInInjectionContext(this._injector, () => {\n\t\t\tthis._ariaEffectRef = effect(() => {\n\t\t\t\tconst tooltipId = this._componentRef?.instance.id();\n\t\t\t\tif (tooltipId) {\n\t\t\t\t\tthis._renderer.setAttribute(this._elementRef.nativeElement, 'aria-describedby', tooltipId);\n\t\t\t\t\tthis._ariaEffectRef?.destroy();\n\t\t\t\t\tthis._ariaEffectRef = undefined;\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t\tthis.show.emit();\n\t}\n\n\t/** Apply text + position (and the position-derived classes) to the content, recording the position as\n\t * active. Pass `text = null` for a position-only update that keeps the content's existing text. */\n\tprivate _applyContentProps(\n\t\tcontent: BrnTooltipContent,\n\t\tposition: BrnTooltipPosition,\n\t\ttext: BrnTooltipType = this._tooltipText(),\n\t): void {\n\t\tthis._activePosition = position;\n\t\tcontent.setProps(\n\t\t\ttext,\n\t\t\tposition,\n\t\t\tthis._config.tooltipContentClasses,\n\t\t\tthis._config.arrowClasses(position),\n\t\t\tthis._config.svgClasses,\n\t\t);\n\t}\n\n\tprivate _hide(): void {\n\t\tif (!this._componentRef || this._tooltipHovered) return;\n\t\t// Already closing (exit animation in flight): nothing to do.\n\t\tif (this._componentRef.instance.state() === 'closed') return;\n\t\tthis._componentRef.instance.state.set('closed');\n\t\tthis._group?.onClose();\n\t\tthis.hide.emit();\n\t\tthis._scheduleDetach(this._componentRef);\n\t}\n\n\t/**\n\t * Keep the content mounted until its `data-[state=closed]` exit animation finishes, then tear it\n\t * down. A re-show (revive) bumps `_closeGeneration`, which cancels the pending detach.\n\t */\n\tprivate _scheduleDetach(componentRef: ComponentRef<BrnTooltipContent>): void {\n\t\tconst generation = ++this._closeGeneration;\n\t\tconst content = componentRef.location.nativeElement as HTMLElement;\n\t\tafterNextRender(\n\t\t\t() => {\n\t\t\t\tvoid waitForElementAnimations(content).then(() => {\n\t\t\t\t\tif (generation === this._closeGeneration) this._detach();\n\t\t\t\t});\n\t\t\t},\n\t\t\t{ injector: this._injector },\n\t\t);\n\t}\n\n\tprivate _detach(): void {\n\t\tthis._clearAriaDescribedBy();\n\t\tthis._positionChangeSub?.unsubscribe();\n\t\tthis._positionChangeSub = undefined;\n\t\tthis._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');\n\t\tthis._overlayRef?.detach();\n\t}\n\n\tprivate _clearAriaDescribedBy(): void {\n\t\tif (this._ariaEffectRef) {\n\t\t\tthis._ariaEffectRef.destroy();\n\t\t\tthis._ariaEffectRef = undefined;\n\t\t}\n\t}\n}\n","import { BrnTooltip } from './lib/brn-tooltip';\nimport { BrnTooltipContent } from './lib/brn-tooltip-content';\n\nexport * from './lib/brn-tooltip';\nexport * from './lib/brn-tooltip-content';\nexport * from './lib/brn-tooltip-group';\nexport { BRN_TOOLTIP_FALLBACK_POSITIONS, BrnTooltipPosition, resolveTooltipPosition } from './lib/brn-tooltip-position';\nexport * from './lib/brn-tooltip-type';\nexport * from './lib/brn-tooltip.token';\n\nexport const BrnTooltipImports = [BrnTooltip, BrnTooltipContent] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n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,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;4FAAV,UAAU,EAAA,UAAA,EAAA,CAAA;kBADtB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA,EAAE,QAAQ,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,EAAE;;;MC1ClD,iBAAiB,GAAG,CAAC,UAAU,EAAE,iBAAiB;;ACV/D;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ import { BooleanInput, NumberInput } from '@angular/cdk/coercion';
|
|
|
4
4
|
import { ControlValueAccessor } from '@angular/forms';
|
|
5
5
|
import { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';
|
|
6
6
|
import { ClassValue } from 'clsx';
|
|
7
|
+
import * as i1 from '@spartan-ng/brain/field';
|
|
7
8
|
import * as _spartan_ng_brain_input_otp from '@spartan-ng/brain/input-otp';
|
|
8
9
|
|
|
9
10
|
declare const BRN_INPUT_OTP_VALUE_ACCESSOR: {
|
|
@@ -14,12 +15,18 @@ declare const BRN_INPUT_OTP_VALUE_ACCESSOR: {
|
|
|
14
15
|
type InputMode = 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
|
|
15
16
|
declare class BrnInputOtp implements ControlValueAccessor {
|
|
16
17
|
private static _id;
|
|
18
|
+
private readonly _fieldControl;
|
|
19
|
+
readonly invalid: _angular_core.Signal<boolean | null> | undefined;
|
|
20
|
+
readonly touched: _angular_core.Signal<boolean | null> | undefined;
|
|
21
|
+
readonly dirty: _angular_core.Signal<boolean | null> | undefined;
|
|
22
|
+
readonly spartanInvalid: _angular_core.Signal<boolean | null> | undefined;
|
|
17
23
|
/** Whether the input has focus. */
|
|
18
24
|
protected readonly _focused: _angular_core.WritableSignal<boolean>;
|
|
19
25
|
/** Styles applied to the host element. */
|
|
20
26
|
readonly hostStyles: _angular_core.InputSignal<string>;
|
|
21
27
|
/** Custom id applied to the input element */
|
|
22
28
|
readonly inputId: _angular_core.InputSignal<string>;
|
|
29
|
+
readonly labelableId: _angular_core.InputSignal<string>;
|
|
23
30
|
/** Custom autocomplete attribute applied to the input element */
|
|
24
31
|
readonly inputAutocomplete: _angular_core.InputSignal<"one-time-code" | "off">;
|
|
25
32
|
/** Styles applied to the input element to make it invisible and clickable. */
|
|
@@ -30,7 +37,7 @@ declare class BrnInputOtp implements ControlValueAccessor {
|
|
|
30
37
|
readonly disabled: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
31
38
|
protected readonly _disabled: _angular_core.WritableSignal<boolean>;
|
|
32
39
|
/** The number of slots. */
|
|
33
|
-
readonly
|
|
40
|
+
readonly length: _angular_core.InputSignalWithTransform<number, NumberInput>;
|
|
34
41
|
/** Virtual keyboard appearance on mobile */
|
|
35
42
|
readonly inputMode: _angular_core.InputSignal<InputMode>;
|
|
36
43
|
readonly inputClass: _angular_core.InputSignal<ClassValue>;
|
|
@@ -38,12 +45,12 @@ declare class BrnInputOtp implements ControlValueAccessor {
|
|
|
38
45
|
readonly autofocus: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
39
46
|
/**
|
|
40
47
|
* Defines how the pasted text should be transformed before saving to model/form.
|
|
41
|
-
* Allows pasting text which contains extra characters like spaces, dashes, etc. and are longer than the
|
|
48
|
+
* Allows pasting text which contains extra characters like spaces, dashes, etc. and are longer than the length.
|
|
42
49
|
*
|
|
43
50
|
* "XXX-XXX": (pastedText) => pastedText.replaceAll('-', '')
|
|
44
51
|
* "XXX XXX": (pastedText) => pastedText.replaceAll(/\s+/g, '')
|
|
45
52
|
*/
|
|
46
|
-
readonly transformPaste: _angular_core.InputSignal<(pastedText: string,
|
|
53
|
+
readonly transformPaste: _angular_core.InputSignal<(pastedText: string, length: number) => string>;
|
|
47
54
|
/** The value controlling the input */
|
|
48
55
|
readonly valueInput: _angular_core.InputSignal<string | null>;
|
|
49
56
|
readonly value: _angular_core.WritableSignal<string | null>;
|
|
@@ -60,6 +67,7 @@ declare class BrnInputOtp implements ControlValueAccessor {
|
|
|
60
67
|
protected _onTouched?: TouchFn;
|
|
61
68
|
protected readonly _inputComponentRef: _angular_core.Signal<ElementRef<any>>;
|
|
62
69
|
constructor();
|
|
70
|
+
protected onBlur(): void;
|
|
63
71
|
protected onInputChange(event: Event): void;
|
|
64
72
|
protected onPaste(event: ClipboardEvent): void;
|
|
65
73
|
/** CONTROL VALUE ACCESSOR */
|
|
@@ -70,7 +78,7 @@ declare class BrnInputOtp implements ControlValueAccessor {
|
|
|
70
78
|
private isCompleted;
|
|
71
79
|
private updateValue;
|
|
72
80
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrnInputOtp, never>;
|
|
73
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<BrnInputOtp, "brn-input-otp", never, { "hostStyles": { "alias": "hostStyles"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "inputAutocomplete": { "alias": "inputAutocomplete"; "required": false; "isSignal": true; }; "inputStyles": { "alias": "inputStyles"; "required": false; "isSignal": true; }; "containerStyles": { "alias": "containerStyles"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "
|
|
81
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<BrnInputOtp, "brn-input-otp", never, { "hostStyles": { "alias": "hostStyles"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "inputAutocomplete": { "alias": "inputAutocomplete"; "required": false; "isSignal": true; }; "inputStyles": { "alias": "inputStyles"; "required": false; "isSignal": true; }; "containerStyles": { "alias": "containerStyles"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "length": { "alias": "length"; "required": true; "isSignal": true; }; "inputMode": { "alias": "inputMode"; "required": false; "isSignal": true; }; "inputClass": { "alias": "inputClass"; "required": false; "isSignal": true; }; "autofocus": { "alias": "autofocus"; "required": false; "isSignal": true; }; "transformPaste": { "alias": "transformPaste"; "required": false; "isSignal": true; }; "valueInput": { "alias": "value"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; "completed": "completed"; }, never, ["*"], true, [{ directive: typeof i1.BrnFieldControl; inputs: {}; outputs: {}; }]>;
|
|
74
82
|
}
|
|
75
83
|
|
|
76
84
|
declare class BrnInputOtpSlot {
|
|
@@ -78,13 +86,19 @@ declare class BrnInputOtpSlot {
|
|
|
78
86
|
protected readonly _inputOtp: _spartan_ng_brain_input_otp.BrnInputOtp;
|
|
79
87
|
/** The index of the slot to render the char or a fake caret */
|
|
80
88
|
readonly index: _angular_core.InputSignalWithTransform<number, NumberInput>;
|
|
89
|
+
/** Whether to force the input into an invalid state. */
|
|
90
|
+
readonly forceInvalid: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
81
91
|
protected readonly _slot: _angular_core.Signal<{
|
|
82
92
|
char: string | null;
|
|
83
93
|
isActive: boolean;
|
|
84
94
|
hasFakeCaret: boolean;
|
|
85
95
|
}>;
|
|
96
|
+
protected readonly _ariaInvalid: _angular_core.Signal<boolean | null> | undefined;
|
|
97
|
+
protected readonly _touched: _angular_core.Signal<boolean | null> | undefined;
|
|
98
|
+
protected readonly _dirty: _angular_core.Signal<boolean | null> | undefined;
|
|
99
|
+
protected readonly _spartanInvalid: _angular_core.Signal<boolean | null | undefined>;
|
|
86
100
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BrnInputOtpSlot, never>;
|
|
87
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<BrnInputOtpSlot, "brn-input-otp-slot", never, { "index": { "alias": "index"; "required": true; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
101
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<BrnInputOtpSlot, "brn-input-otp-slot", never, { "index": { "alias": "index"; "required": true; "isSignal": true; }; "forceInvalid": { "alias": "forceInvalid"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
88
102
|
}
|
|
89
103
|
|
|
90
104
|
declare const BrnInputOtpImports: readonly [typeof BrnInputOtp, typeof BrnInputOtpSlot];
|
|
@@ -48,8 +48,28 @@ declare class BrnTooltip {
|
|
|
48
48
|
/** Build [preferred, ...fallbacks] position array for viewport-aware auto-flip. */
|
|
49
49
|
private _getAllPositions;
|
|
50
50
|
private _getAdjustedPositionFor;
|
|
51
|
+
/**
|
|
52
|
+
* Corrects overlay placement for the layout-vs-visual viewport mismatch on mobile browsers.
|
|
53
|
+
*
|
|
54
|
+
* Tooltips only open on hover/focus, but a hovering pen (e.g. Apple Pencil on iOS Safari) can open
|
|
55
|
+
* one on a phone/tablet where this bites: as the browser's toolbars collapse the visual viewport
|
|
56
|
+
* grows, yet `documentElement.clientHeight`/`clientWidth` stay frozen at the toolbar-expanded size.
|
|
57
|
+
* CDK anchors bottom/right overlays from those stale dimensions (top/left overlays measure from the
|
|
58
|
+
* pinned top-left edge and are unaffected), so a `position: 'top'` tooltip lands shifted by the delta.
|
|
59
|
+
*
|
|
60
|
+
* We fold that delta back in as an offset. It is 0 whenever the viewports match (desktop, or toolbar
|
|
61
|
+
* expanded), so this is a no-op everywhere except the collapsed-toolbar case it targets.
|
|
62
|
+
*/
|
|
63
|
+
private _getVisualViewportCompensation;
|
|
51
64
|
private _initTriggers;
|
|
65
|
+
/**
|
|
66
|
+
* Tooltips are supplementary labels for a trigger that already has its own action, so - like Radix
|
|
67
|
+
* and Base UI - they open only on mouse/pen hover and keyboard focus, never on touch (a touch tap
|
|
68
|
+
* would both fire the trigger's action and the tooltip). Touch pointers are ignored via
|
|
69
|
+
* `_isHoverPointer`; use a popover when touch users need to see the content.
|
|
70
|
+
*/
|
|
52
71
|
private _initHoverListeners;
|
|
72
|
+
private _isHoverPointer;
|
|
53
73
|
/** Snapshot the group skip decision once, so the delay and the instant-open state agree even if a
|
|
54
74
|
* sibling flips the window during the show delay. */
|
|
55
75
|
private _requestShow;
|