@spartan-ng/brain 0.0.1-alpha.713 → 0.0.1-alpha.714
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/drawer/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# @spartan-ng/brain/drawer
|
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, linkedSignal, effect, untracked, forwardRef, Directive, inject, ElementRef, DestroyRef } from '@angular/core';
|
|
3
|
+
import * as i1 from '@spartan-ng/brain/dialog';
|
|
4
|
+
import { BrnDialog, BrnDialogClose, BrnDialogContent, BrnDialogDescription, BrnDialogRef, BrnDialogOverlay, BrnDialogTitle, BrnDialogTrigger } from '@spartan-ng/brain/dialog';
|
|
5
|
+
import { provideExposesStateProviderExisting, provideExposedSideProviderExisting, provideCustomClassSettableExisting } from '@spartan-ng/brain/core';
|
|
6
|
+
import { DOCUMENT } from '@angular/common';
|
|
7
|
+
|
|
8
|
+
class BrnDrawer extends BrnDialog {
|
|
9
|
+
direction = input('bottom', ...(ngDevMode ? [{ debugName: "direction" }] : /* istanbul ignore next */ []));
|
|
10
|
+
directionState = linkedSignal(() => this.direction(), ...(ngDevMode ? [{ debugName: "directionState" }] : /* istanbul ignore next */ []));
|
|
11
|
+
constructor() {
|
|
12
|
+
super();
|
|
13
|
+
effect(() => {
|
|
14
|
+
const direction = this.directionState();
|
|
15
|
+
untracked(() => {
|
|
16
|
+
if (direction === 'bottom') {
|
|
17
|
+
this.mutablePositionStrategy.set(this.positionBuilder.global().bottom());
|
|
18
|
+
}
|
|
19
|
+
if (direction === 'top') {
|
|
20
|
+
this.mutablePositionStrategy.set(this.positionBuilder.global().top());
|
|
21
|
+
}
|
|
22
|
+
if (direction === 'left') {
|
|
23
|
+
this.mutablePositionStrategy.set(this.positionBuilder.global().left());
|
|
24
|
+
}
|
|
25
|
+
if (direction === 'right') {
|
|
26
|
+
this.mutablePositionStrategy.set(this.positionBuilder.global().right());
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnDrawer, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
32
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.16", type: BrnDrawer, isStandalone: true, selector: "[brnDrawer],brn-drawer", inputs: { direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
33
|
+
{
|
|
34
|
+
provide: BrnDialog,
|
|
35
|
+
useExisting: forwardRef((() => BrnDrawer)),
|
|
36
|
+
},
|
|
37
|
+
], exportAs: ["brnDrawer"], usesInheritance: true, ngImport: i0 });
|
|
38
|
+
}
|
|
39
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnDrawer, decorators: [{
|
|
40
|
+
type: Directive,
|
|
41
|
+
args: [{
|
|
42
|
+
selector: '[brnDrawer],brn-drawer',
|
|
43
|
+
exportAs: 'brnDrawer',
|
|
44
|
+
providers: [
|
|
45
|
+
{
|
|
46
|
+
provide: BrnDialog,
|
|
47
|
+
useExisting: forwardRef((() => BrnDrawer)),
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
}]
|
|
51
|
+
}], ctorParameters: () => [], propDecorators: { direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }] } });
|
|
52
|
+
|
|
53
|
+
class BrnDrawerClose extends BrnDialogClose {
|
|
54
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnDrawerClose, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
55
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: BrnDrawerClose, isStandalone: true, selector: "button[brnDrawerClose]", usesInheritance: true, ngImport: i0 });
|
|
56
|
+
}
|
|
57
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnDrawerClose, decorators: [{
|
|
58
|
+
type: Directive,
|
|
59
|
+
args: [{
|
|
60
|
+
selector: 'button[brnDrawerClose]',
|
|
61
|
+
}]
|
|
62
|
+
}] });
|
|
63
|
+
|
|
64
|
+
class BrnDrawerContent extends BrnDialogContent {
|
|
65
|
+
side = inject(BrnDrawer).directionState;
|
|
66
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnDrawerContent, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
67
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: BrnDrawerContent, isStandalone: true, selector: "[brnDrawerContent]", providers: [
|
|
68
|
+
provideExposesStateProviderExisting((() => BrnDrawerContent)),
|
|
69
|
+
provideExposedSideProviderExisting((() => BrnDrawerContent)),
|
|
70
|
+
], usesInheritance: true, ngImport: i0 });
|
|
71
|
+
}
|
|
72
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnDrawerContent, decorators: [{
|
|
73
|
+
type: Directive,
|
|
74
|
+
args: [{
|
|
75
|
+
selector: '[brnDrawerContent]',
|
|
76
|
+
providers: [
|
|
77
|
+
provideExposesStateProviderExisting((() => BrnDrawerContent)),
|
|
78
|
+
provideExposedSideProviderExisting((() => BrnDrawerContent)),
|
|
79
|
+
],
|
|
80
|
+
}]
|
|
81
|
+
}] });
|
|
82
|
+
|
|
83
|
+
class BrnDrawerDescription {
|
|
84
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnDrawerDescription, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
85
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: BrnDrawerDescription, isStandalone: true, selector: "[brnDrawerDescription]", hostDirectives: [{ directive: i1.BrnDialogDescription }], ngImport: i0 });
|
|
86
|
+
}
|
|
87
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnDrawerDescription, decorators: [{
|
|
88
|
+
type: Directive,
|
|
89
|
+
args: [{
|
|
90
|
+
selector: '[brnDrawerDescription]',
|
|
91
|
+
hostDirectives: [BrnDialogDescription],
|
|
92
|
+
}]
|
|
93
|
+
}] });
|
|
94
|
+
|
|
95
|
+
const VELOCITY_THRESHOLD = 0.4;
|
|
96
|
+
const DEFAULT_CLOSE_THRESHOLD = 0.25;
|
|
97
|
+
const SCROLL_LOCK_TIMEOUT = 100;
|
|
98
|
+
const TOUCH_SWIPE_THRESHOLD = 10;
|
|
99
|
+
const MOUSE_SWIPE_THRESHOLD = 2;
|
|
100
|
+
const OPEN_TIME_COOLDOWN = 500;
|
|
101
|
+
const TRANSITION = 'transform 0.5s cubic-bezier(0.32, 0.72, 0, 1)';
|
|
102
|
+
const OVERLAY_TRANSITION = 'opacity 0.5s cubic-bezier(0.32, 0.72, 0, 1)';
|
|
103
|
+
function dampenValue(v) {
|
|
104
|
+
return 8 * (Math.log(v + 1) - 2);
|
|
105
|
+
}
|
|
106
|
+
class BrnDrawerHandle {
|
|
107
|
+
_brnDialogRef = inject(BrnDialogRef, { optional: true });
|
|
108
|
+
_brnDrawer = inject(BrnDrawer, { optional: true });
|
|
109
|
+
_element = inject(ElementRef);
|
|
110
|
+
_document = inject(DOCUMENT);
|
|
111
|
+
_destroyRef = inject(DestroyRef);
|
|
112
|
+
_pointerId = -1;
|
|
113
|
+
constructor() {
|
|
114
|
+
this._destroyRef.onDestroy(() => this._cleanup());
|
|
115
|
+
effect(() => {
|
|
116
|
+
const state = this._brnDialogRef?.state();
|
|
117
|
+
untracked(() => {
|
|
118
|
+
if (state === 'open') {
|
|
119
|
+
this._openTime = Date.now();
|
|
120
|
+
}
|
|
121
|
+
else if (state === 'closed') {
|
|
122
|
+
this._openTime = null;
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
_drawerEl = null;
|
|
128
|
+
_backdropEl = null;
|
|
129
|
+
_direction = 'bottom';
|
|
130
|
+
_initialBackdropOpacity = 1;
|
|
131
|
+
_pointerStartX = 0;
|
|
132
|
+
_pointerStartY = 0;
|
|
133
|
+
_pointerStart = 0;
|
|
134
|
+
_pointerType = '';
|
|
135
|
+
_isDragging = false;
|
|
136
|
+
_isAllowedToDrag = false;
|
|
137
|
+
_wasBeyondThreshold = false;
|
|
138
|
+
_openTime = null;
|
|
139
|
+
_lastTimeDragPrevented = null;
|
|
140
|
+
_dragStartTime = null;
|
|
141
|
+
closeThreshold = input(DEFAULT_CLOSE_THRESHOLD, ...(ngDevMode ? [{ debugName: "closeThreshold" }] : /* istanbul ignore next */ []));
|
|
142
|
+
get _isVertical() {
|
|
143
|
+
return this._direction === 'bottom' || this._direction === 'top';
|
|
144
|
+
}
|
|
145
|
+
get _isPositive() {
|
|
146
|
+
return this._direction === 'bottom' || this._direction === 'right';
|
|
147
|
+
}
|
|
148
|
+
get _dimensionMultiplier() {
|
|
149
|
+
return this._isPositive ? 1 : -1;
|
|
150
|
+
}
|
|
151
|
+
get _swipeThreshold() {
|
|
152
|
+
return this._pointerType === 'touch' ? TOUCH_SWIPE_THRESHOLD : MOUSE_SWIPE_THRESHOLD;
|
|
153
|
+
}
|
|
154
|
+
_onPointerDown(event) {
|
|
155
|
+
if (!this._brnDialogRef || !this._brnDrawer || this._isDragging)
|
|
156
|
+
return;
|
|
157
|
+
this._direction = this._brnDrawer.directionState();
|
|
158
|
+
this._drawerEl = this._element.nativeElement.closest('[data-vaul-drawer-direction]');
|
|
159
|
+
if (!this._drawerEl)
|
|
160
|
+
return;
|
|
161
|
+
this._pointerType = event.pointerType;
|
|
162
|
+
this._pointerStartX = event.pageX;
|
|
163
|
+
this._pointerStartY = event.pageY;
|
|
164
|
+
this._pointerStart = this._isVertical ? event.pageY : event.pageX;
|
|
165
|
+
this._isDragging = true;
|
|
166
|
+
this._isAllowedToDrag = false;
|
|
167
|
+
this._wasBeyondThreshold = false;
|
|
168
|
+
this._dragStartTime = Date.now();
|
|
169
|
+
this._drawerEl.style.transition = 'none';
|
|
170
|
+
if (!this._findScrollableAncestor(event.target)) {
|
|
171
|
+
this._drawerEl.style.touchAction = 'none';
|
|
172
|
+
}
|
|
173
|
+
const overlayWrapper = this._drawerEl.closest('.cdk-global-overlay-wrapper');
|
|
174
|
+
this._backdropEl = overlayWrapper?.querySelector('.cdk-overlay-backdrop');
|
|
175
|
+
if (this._backdropEl) {
|
|
176
|
+
this._initialBackdropOpacity = parseFloat(getComputedStyle(this._backdropEl).opacity) || 1;
|
|
177
|
+
}
|
|
178
|
+
this._pointerId = event.pointerId;
|
|
179
|
+
this._document.addEventListener('pointermove', this._onPointerMove, { passive: false });
|
|
180
|
+
this._document.addEventListener('pointerup', this._onPointerUp, { once: true });
|
|
181
|
+
this._document.addEventListener('pointercancel', this._onPointerCancel, { once: true });
|
|
182
|
+
}
|
|
183
|
+
_onPointerMove = (e) => {
|
|
184
|
+
if (!this._isDragging || !this._drawerEl)
|
|
185
|
+
return;
|
|
186
|
+
const currentX = e.pageX;
|
|
187
|
+
const currentY = e.pageY;
|
|
188
|
+
const xDelta = currentX - this._pointerStartX;
|
|
189
|
+
const yDelta = currentY - this._pointerStartY;
|
|
190
|
+
if (!this._wasBeyondThreshold) {
|
|
191
|
+
const absX = Math.abs(xDelta);
|
|
192
|
+
const absY = Math.abs(yDelta);
|
|
193
|
+
if (this._isVertical) {
|
|
194
|
+
if (absY < this._swipeThreshold) {
|
|
195
|
+
if (absX >= this._swipeThreshold) {
|
|
196
|
+
this._pointerStartX = currentX;
|
|
197
|
+
this._pointerStartY = currentY;
|
|
198
|
+
}
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
if (absX > absY)
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
if (absX < this._swipeThreshold) {
|
|
206
|
+
if (absY >= this._swipeThreshold) {
|
|
207
|
+
this._pointerStartX = currentX;
|
|
208
|
+
this._pointerStartY = currentY;
|
|
209
|
+
}
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
if (absY > absX)
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
this._wasBeyondThreshold = true;
|
|
216
|
+
}
|
|
217
|
+
const currentPosition = this._isVertical ? currentY : currentX;
|
|
218
|
+
const draggedDistance = (this._pointerStart - currentPosition) * this._dimensionMultiplier;
|
|
219
|
+
const isDraggingInDirection = draggedDistance > 0;
|
|
220
|
+
const absDraggedDistance = Math.abs(draggedDistance);
|
|
221
|
+
if (!this._isAllowedToDrag && !this._shouldDrag(e.target ?? this._element.nativeElement, isDraggingInDirection))
|
|
222
|
+
return;
|
|
223
|
+
this._isAllowedToDrag = true;
|
|
224
|
+
try {
|
|
225
|
+
this._element.nativeElement.setPointerCapture(e.pointerId);
|
|
226
|
+
}
|
|
227
|
+
catch {
|
|
228
|
+
/* empty - pointer capture not supported */
|
|
229
|
+
}
|
|
230
|
+
this._drawerEl.classList.add('vaul-dragging');
|
|
231
|
+
const dimension = this._isVertical ? this._drawerEl.offsetHeight : this._drawerEl.offsetWidth;
|
|
232
|
+
const progress = dimension > 0 ? Math.min(absDraggedDistance / dimension, 1) : 0;
|
|
233
|
+
if (isDraggingInDirection) {
|
|
234
|
+
const dampened = dampenValue(draggedDistance);
|
|
235
|
+
const translateValue = Math.min(dampened * -1, 0) * this._dimensionMultiplier;
|
|
236
|
+
const prop = this._isVertical ? 'translateY' : 'translateX';
|
|
237
|
+
this._drawerEl.style.transform = `${prop}(${translateValue}px)`;
|
|
238
|
+
if (this._backdropEl) {
|
|
239
|
+
this._backdropEl.style.opacity = String(Math.max(this._initialBackdropOpacity - progress * 0.3, 0));
|
|
240
|
+
}
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
e.preventDefault();
|
|
244
|
+
const translateValue = absDraggedDistance * this._dimensionMultiplier;
|
|
245
|
+
const prop = this._isVertical ? 'translateY' : 'translateX';
|
|
246
|
+
this._drawerEl.style.transform = `${prop}(${translateValue}px)`;
|
|
247
|
+
if (this._backdropEl) {
|
|
248
|
+
this._backdropEl.style.opacity = String(Math.max(this._initialBackdropOpacity - progress, 0));
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
_onPointerUp = (e) => {
|
|
252
|
+
if (!this._isDragging || !this._drawerEl) {
|
|
253
|
+
this._cleanup();
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
this._drawerEl.classList.remove('vaul-dragging');
|
|
257
|
+
const swipeAmount = this._getTranslate();
|
|
258
|
+
if (!this._isAllowedToDrag || swipeAmount === null || Number.isNaN(swipeAmount)) {
|
|
259
|
+
this._resetDrawer(true);
|
|
260
|
+
this._cleanup();
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
const currentPosition = this._isVertical ? e.pageY : e.pageX;
|
|
264
|
+
const distMoved = this._pointerStart - currentPosition;
|
|
265
|
+
const timeTaken = Date.now() - (this._dragStartTime ?? Date.now());
|
|
266
|
+
const velocity = timeTaken > 0 ? Math.abs(distMoved) / timeTaken : 0;
|
|
267
|
+
if (this._isPositive ? distMoved > 0 : distMoved < 0) {
|
|
268
|
+
this._resetDrawer(true);
|
|
269
|
+
this._cleanup();
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
if (velocity > VELOCITY_THRESHOLD) {
|
|
273
|
+
this._animateAndClose();
|
|
274
|
+
this._cleanup();
|
|
275
|
+
this._brnDialogRef?.close();
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
const dimension = this._isVertical ? this._drawerEl.offsetHeight : this._drawerEl.offsetWidth;
|
|
279
|
+
if (Math.abs(swipeAmount) >= dimension * this.closeThreshold()) {
|
|
280
|
+
this._animateAndClose();
|
|
281
|
+
this._cleanup();
|
|
282
|
+
this._brnDialogRef?.close();
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
this._resetDrawer(true);
|
|
286
|
+
this._cleanup();
|
|
287
|
+
};
|
|
288
|
+
_onPointerCancel = () => {
|
|
289
|
+
this._resetDrawer(true);
|
|
290
|
+
this._cleanup();
|
|
291
|
+
};
|
|
292
|
+
_shouldDrag(el, isDraggingInDirection) {
|
|
293
|
+
if (this._direction === 'left' || this._direction === 'right')
|
|
294
|
+
return true;
|
|
295
|
+
const now = Date.now();
|
|
296
|
+
if (this._openTime !== null && now - this._openTime < OPEN_TIME_COOLDOWN)
|
|
297
|
+
return false;
|
|
298
|
+
const currentTranslate = this._getTranslate();
|
|
299
|
+
if (this._isPositive ? currentTranslate > 0 : currentTranslate < 0)
|
|
300
|
+
return true;
|
|
301
|
+
if (this._lastTimeDragPrevented !== null &&
|
|
302
|
+
now - this._lastTimeDragPrevented < SCROLL_LOCK_TIMEOUT &&
|
|
303
|
+
currentTranslate === 0) {
|
|
304
|
+
this._lastTimeDragPrevented = now;
|
|
305
|
+
return false;
|
|
306
|
+
}
|
|
307
|
+
if (isDraggingInDirection) {
|
|
308
|
+
this._lastTimeDragPrevented = now;
|
|
309
|
+
return false;
|
|
310
|
+
}
|
|
311
|
+
let element = el;
|
|
312
|
+
while (element) {
|
|
313
|
+
if (element.scrollHeight > element.clientHeight) {
|
|
314
|
+
if (element.scrollTop !== 0) {
|
|
315
|
+
this._lastTimeDragPrevented = now;
|
|
316
|
+
return false;
|
|
317
|
+
}
|
|
318
|
+
if (element.getAttribute('role') === 'dialog')
|
|
319
|
+
return true;
|
|
320
|
+
}
|
|
321
|
+
element = element.parentElement;
|
|
322
|
+
}
|
|
323
|
+
return true;
|
|
324
|
+
}
|
|
325
|
+
_getTranslate() {
|
|
326
|
+
if (!this._drawerEl)
|
|
327
|
+
return 0;
|
|
328
|
+
const style = getComputedStyle(this._drawerEl);
|
|
329
|
+
const transform = style.transform || style.webkitTransform;
|
|
330
|
+
if (!transform || transform === 'none')
|
|
331
|
+
return 0;
|
|
332
|
+
let mat = transform.match(/^matrix3d\((.+)\)$/);
|
|
333
|
+
if (mat) {
|
|
334
|
+
return parseFloat(mat[1].split(', ')[this._isVertical ? 13 : 12]);
|
|
335
|
+
}
|
|
336
|
+
mat = transform.match(/^matrix\((.+)\)$/);
|
|
337
|
+
if (mat) {
|
|
338
|
+
return parseFloat(mat[1].split(', ')[this._isVertical ? 5 : 4]);
|
|
339
|
+
}
|
|
340
|
+
return 0;
|
|
341
|
+
}
|
|
342
|
+
_resetDrawer(animate = true) {
|
|
343
|
+
if (this._drawerEl) {
|
|
344
|
+
this._drawerEl.style.transition = animate ? TRANSITION : 'none';
|
|
345
|
+
this._drawerEl.style.transform = '';
|
|
346
|
+
}
|
|
347
|
+
if (this._backdropEl) {
|
|
348
|
+
this._backdropEl.style.transition = animate ? OVERLAY_TRANSITION : 'none';
|
|
349
|
+
this._backdropEl.style.opacity = String(this._initialBackdropOpacity);
|
|
350
|
+
}
|
|
351
|
+
setTimeout(() => {
|
|
352
|
+
if (this._drawerEl)
|
|
353
|
+
this._drawerEl.style.transition = '';
|
|
354
|
+
if (this._backdropEl)
|
|
355
|
+
this._backdropEl.style.transition = '';
|
|
356
|
+
}, 500);
|
|
357
|
+
}
|
|
358
|
+
_animateAndClose() {
|
|
359
|
+
if (!this._drawerEl)
|
|
360
|
+
return;
|
|
361
|
+
const dimension = this._isVertical ? this._drawerEl.offsetHeight : this._drawerEl.offsetWidth;
|
|
362
|
+
const targetClose = this._isPositive ? dimension : -dimension;
|
|
363
|
+
const prop = this._isVertical ? 'translateY' : 'translateX';
|
|
364
|
+
this._drawerEl.style.transition = 'transform 0.3s cubic-bezier(0.32, 0.72, 0, 1)';
|
|
365
|
+
this._drawerEl.style.transform = `${prop}(${targetClose}px)`;
|
|
366
|
+
this._drawerEl.style.animation = 'none';
|
|
367
|
+
if (this._backdropEl) {
|
|
368
|
+
this._backdropEl.style.transition = 'opacity 0.3s cubic-bezier(0.32, 0.72, 0, 1)';
|
|
369
|
+
this._backdropEl.style.opacity = '0';
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
_cleanup() {
|
|
373
|
+
this._isDragging = false;
|
|
374
|
+
this._isAllowedToDrag = false;
|
|
375
|
+
if (this._drawerEl) {
|
|
376
|
+
this._drawerEl.style.touchAction = '';
|
|
377
|
+
}
|
|
378
|
+
if (this._pointerId !== -1) {
|
|
379
|
+
try {
|
|
380
|
+
this._element.nativeElement.releasePointerCapture(this._pointerId);
|
|
381
|
+
}
|
|
382
|
+
catch {
|
|
383
|
+
/* empty */
|
|
384
|
+
}
|
|
385
|
+
this._pointerId = -1;
|
|
386
|
+
}
|
|
387
|
+
this._document.removeEventListener('pointermove', this._onPointerMove);
|
|
388
|
+
}
|
|
389
|
+
_findScrollableAncestor(element) {
|
|
390
|
+
if (!element)
|
|
391
|
+
return null;
|
|
392
|
+
const scrollProp = this._isVertical ? 'overflow-y' : 'overflow-x';
|
|
393
|
+
const sizeProp = this._isVertical ? 'scrollHeight' : 'scrollWidth';
|
|
394
|
+
const clientProp = this._isVertical ? 'clientHeight' : 'clientWidth';
|
|
395
|
+
let el = element.parentElement;
|
|
396
|
+
while (el) {
|
|
397
|
+
const overflow = getComputedStyle(el)[scrollProp];
|
|
398
|
+
if ((overflow === 'auto' || overflow === 'scroll') && el[sizeProp] > el[clientProp]) {
|
|
399
|
+
return el;
|
|
400
|
+
}
|
|
401
|
+
el = el.parentElement;
|
|
402
|
+
}
|
|
403
|
+
return null;
|
|
404
|
+
}
|
|
405
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnDrawerHandle, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
406
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.16", type: BrnDrawerHandle, isStandalone: true, selector: "[brnDrawerHandle]", inputs: { closeThreshold: { classPropertyName: "closeThreshold", publicName: "closeThreshold", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "presentation" }, listeners: { "pointerdown": "_onPointerDown($event)" } }, ngImport: i0 });
|
|
407
|
+
}
|
|
408
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnDrawerHandle, decorators: [{
|
|
409
|
+
type: Directive,
|
|
410
|
+
args: [{
|
|
411
|
+
selector: '[brnDrawerHandle]',
|
|
412
|
+
host: {
|
|
413
|
+
role: 'presentation',
|
|
414
|
+
'(pointerdown)': '_onPointerDown($event)',
|
|
415
|
+
},
|
|
416
|
+
}]
|
|
417
|
+
}], ctorParameters: () => [], propDecorators: { closeThreshold: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeThreshold", required: false }] }] } });
|
|
418
|
+
|
|
419
|
+
class BrnDrawerOverlay extends BrnDialogOverlay {
|
|
420
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnDrawerOverlay, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
421
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: BrnDrawerOverlay, isStandalone: true, selector: "[brnDrawerOverlay],brn-drawer-overlay", providers: [provideCustomClassSettableExisting((() => BrnDrawerOverlay))], usesInheritance: true, ngImport: i0 });
|
|
422
|
+
}
|
|
423
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnDrawerOverlay, decorators: [{
|
|
424
|
+
type: Directive,
|
|
425
|
+
args: [{
|
|
426
|
+
selector: '[brnDrawerOverlay],brn-drawer-overlay',
|
|
427
|
+
providers: [provideCustomClassSettableExisting((() => BrnDrawerOverlay))],
|
|
428
|
+
}]
|
|
429
|
+
}] });
|
|
430
|
+
|
|
431
|
+
class BrnDrawerTitle {
|
|
432
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnDrawerTitle, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
433
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: BrnDrawerTitle, isStandalone: true, selector: "[brnDrawerTitle]", hostDirectives: [{ directive: i1.BrnDialogTitle }], ngImport: i0 });
|
|
434
|
+
}
|
|
435
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnDrawerTitle, decorators: [{
|
|
436
|
+
type: Directive,
|
|
437
|
+
args: [{
|
|
438
|
+
selector: '[brnDrawerTitle]',
|
|
439
|
+
hostDirectives: [BrnDialogTitle],
|
|
440
|
+
}]
|
|
441
|
+
}] });
|
|
442
|
+
|
|
443
|
+
class BrnDrawerTrigger extends BrnDialogTrigger {
|
|
444
|
+
_drawer = inject(BrnDrawer, { optional: true });
|
|
445
|
+
direction = input(undefined, ...(ngDevMode ? [{ debugName: "direction" }] : /* istanbul ignore next */ []));
|
|
446
|
+
open() {
|
|
447
|
+
const direction = this.direction();
|
|
448
|
+
if (this._drawer && direction) {
|
|
449
|
+
this._drawer.directionState.set(direction);
|
|
450
|
+
}
|
|
451
|
+
super.open();
|
|
452
|
+
}
|
|
453
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnDrawerTrigger, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
454
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.16", type: BrnDrawerTrigger, isStandalone: true, selector: "button[brnDrawerTrigger]", inputs: { direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 });
|
|
455
|
+
}
|
|
456
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnDrawerTrigger, decorators: [{
|
|
457
|
+
type: Directive,
|
|
458
|
+
args: [{
|
|
459
|
+
selector: 'button[brnDrawerTrigger]',
|
|
460
|
+
}]
|
|
461
|
+
}], propDecorators: { direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }] } });
|
|
462
|
+
|
|
463
|
+
const BrnDrawerImports = [
|
|
464
|
+
BrnDrawer,
|
|
465
|
+
BrnDrawerOverlay,
|
|
466
|
+
BrnDrawerTrigger,
|
|
467
|
+
BrnDrawerClose,
|
|
468
|
+
BrnDrawerContent,
|
|
469
|
+
BrnDrawerTitle,
|
|
470
|
+
BrnDrawerDescription,
|
|
471
|
+
BrnDrawerHandle,
|
|
472
|
+
];
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* Generated bundle index. Do not edit.
|
|
476
|
+
*/
|
|
477
|
+
|
|
478
|
+
export { BrnDrawer, BrnDrawerClose, BrnDrawerContent, BrnDrawerDescription, BrnDrawerHandle, BrnDrawerImports, BrnDrawerOverlay, BrnDrawerTitle, BrnDrawerTrigger };
|
|
479
|
+
//# sourceMappingURL=spartan-ng-brain-drawer.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spartan-ng-brain-drawer.mjs","sources":["../../../../libs/brain/drawer/src/lib/brn-drawer.ts","../../../../libs/brain/drawer/src/lib/brn-drawer-close.ts","../../../../libs/brain/drawer/src/lib/brn-drawer-content.ts","../../../../libs/brain/drawer/src/lib/brn-drawer-description.ts","../../../../libs/brain/drawer/src/lib/brn-drawer-handle.ts","../../../../libs/brain/drawer/src/lib/brn-drawer-overlay.ts","../../../../libs/brain/drawer/src/lib/brn-drawer-title.ts","../../../../libs/brain/drawer/src/lib/brn-drawer-trigger.ts","../../../../libs/brain/drawer/src/index.ts","../../../../libs/brain/drawer/src/spartan-ng-brain-drawer.ts"],"sourcesContent":["import { Directive, effect, forwardRef, input, linkedSignal, untracked } from '@angular/core';\nimport { BrnDialog } from '@spartan-ng/brain/dialog';\n\n@Directive({\n\tselector: '[brnDrawer],brn-drawer',\n\texportAs: 'brnDrawer',\n\tproviders: [\n\t\t{\n\t\t\tprovide: BrnDialog,\n\t\t\tuseExisting: forwardRef(() => BrnDrawer),\n\t\t},\n\t],\n})\nexport class BrnDrawer extends BrnDialog {\n\tpublic readonly direction = input<'bottom' | 'top' | 'left' | 'right'>('bottom');\n\tpublic readonly directionState = linkedSignal(() => this.direction());\n\n\tconstructor() {\n\t\tsuper();\n\t\teffect(() => {\n\t\t\tconst direction = this.directionState();\n\t\t\tuntracked(() => {\n\t\t\t\tif (direction === 'bottom') {\n\t\t\t\t\tthis.mutablePositionStrategy.set(this.positionBuilder.global().bottom());\n\t\t\t\t}\n\t\t\t\tif (direction === 'top') {\n\t\t\t\t\tthis.mutablePositionStrategy.set(this.positionBuilder.global().top());\n\t\t\t\t}\n\t\t\t\tif (direction === 'left') {\n\t\t\t\t\tthis.mutablePositionStrategy.set(this.positionBuilder.global().left());\n\t\t\t\t}\n\t\t\t\tif (direction === 'right') {\n\t\t\t\t\tthis.mutablePositionStrategy.set(this.positionBuilder.global().right());\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n}\n","import { Directive } from '@angular/core';\nimport { BrnDialogClose } from '@spartan-ng/brain/dialog';\n\n@Directive({\n\tselector: 'button[brnDrawerClose]',\n})\nexport class BrnDrawerClose extends BrnDialogClose {}\n","import { Directive, inject } from '@angular/core';\nimport {\n\ttype ExposesSide,\n\tprovideExposedSideProviderExisting,\n\tprovideExposesStateProviderExisting,\n} from '@spartan-ng/brain/core';\nimport { BrnDialogContent } from '@spartan-ng/brain/dialog';\nimport { BrnDrawer } from './brn-drawer';\n\n@Directive({\n\tselector: '[brnDrawerContent]',\n\tproviders: [\n\t\tprovideExposesStateProviderExisting(() => BrnDrawerContent),\n\t\tprovideExposedSideProviderExisting(() => BrnDrawerContent),\n\t],\n})\nexport class BrnDrawerContent<T> extends BrnDialogContent<T> implements ExposesSide {\n\tpublic readonly side = inject(BrnDrawer).directionState;\n}\n","import { Directive } from '@angular/core';\nimport { BrnDialogDescription } from '@spartan-ng/brain/dialog';\n\n@Directive({\n\tselector: '[brnDrawerDescription]',\n\thostDirectives: [BrnDialogDescription],\n})\nexport class BrnDrawerDescription {}\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, effect, ElementRef, inject, input, untracked } from '@angular/core';\nimport { BrnDialogRef } from '@spartan-ng/brain/dialog';\nimport { BrnDrawer } from './brn-drawer';\n\nconst VELOCITY_THRESHOLD = 0.4;\nconst DEFAULT_CLOSE_THRESHOLD = 0.25;\nconst SCROLL_LOCK_TIMEOUT = 100;\nconst TOUCH_SWIPE_THRESHOLD = 10;\nconst MOUSE_SWIPE_THRESHOLD = 2;\nconst OPEN_TIME_COOLDOWN = 500;\nconst TRANSITION = 'transform 0.5s cubic-bezier(0.32, 0.72, 0, 1)';\nconst OVERLAY_TRANSITION = 'opacity 0.5s cubic-bezier(0.32, 0.72, 0, 1)';\n\nfunction dampenValue(v: number): number {\n\treturn 8 * (Math.log(v + 1) - 2);\n}\n\n@Directive({\n\tselector: '[brnDrawerHandle]',\n\thost: {\n\t\trole: 'presentation',\n\t\t'(pointerdown)': '_onPointerDown($event)',\n\t},\n})\nexport class BrnDrawerHandle {\n\tprivate readonly _brnDialogRef = inject(BrnDialogRef, { optional: true });\n\tprivate readonly _brnDrawer = inject(BrnDrawer, { optional: true });\n\tprivate readonly _element: ElementRef<HTMLElement> = inject(ElementRef);\n\tprivate readonly _document = inject(DOCUMENT);\n\tprivate readonly _destroyRef = inject(DestroyRef);\n\tprivate _pointerId = -1;\n\n\tconstructor() {\n\t\tthis._destroyRef.onDestroy(() => this._cleanup());\n\t\teffect(() => {\n\t\t\tconst state = this._brnDialogRef?.state();\n\t\t\tuntracked(() => {\n\t\t\t\tif (state === 'open') {\n\t\t\t\t\tthis._openTime = Date.now();\n\t\t\t\t} else if (state === 'closed') {\n\t\t\t\t\tthis._openTime = null;\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\tprivate _drawerEl: HTMLElement | null = null;\n\tprivate _backdropEl: HTMLElement | null = null;\n\tprivate _direction: 'bottom' | 'top' | 'left' | 'right' = 'bottom';\n\tprivate _initialBackdropOpacity = 1;\n\n\tprivate _pointerStartX = 0;\n\tprivate _pointerStartY = 0;\n\tprivate _pointerStart = 0;\n\tprivate _pointerType = '';\n\tprivate _isDragging = false;\n\tprivate _isAllowedToDrag = false;\n\tprivate _wasBeyondThreshold = false;\n\n\tprivate _openTime: number | null = null;\n\tprivate _lastTimeDragPrevented: number | null = null;\n\tprivate _dragStartTime: number | null = null;\n\n\tpublic readonly closeThreshold = input<number>(DEFAULT_CLOSE_THRESHOLD);\n\n\tprivate get _isVertical(): boolean {\n\t\treturn this._direction === 'bottom' || this._direction === 'top';\n\t}\n\n\tprivate get _isPositive(): boolean {\n\t\treturn this._direction === 'bottom' || this._direction === 'right';\n\t}\n\n\tprivate get _dimensionMultiplier(): number {\n\t\treturn this._isPositive ? 1 : -1;\n\t}\n\n\tprivate get _swipeThreshold(): number {\n\t\treturn this._pointerType === 'touch' ? TOUCH_SWIPE_THRESHOLD : MOUSE_SWIPE_THRESHOLD;\n\t}\n\n\tprotected _onPointerDown(event: PointerEvent): void {\n\t\tif (!this._brnDialogRef || !this._brnDrawer || this._isDragging) return;\n\n\t\tthis._direction = this._brnDrawer.directionState();\n\t\tthis._drawerEl = this._element.nativeElement.closest('[data-vaul-drawer-direction]');\n\t\tif (!this._drawerEl) return;\n\n\t\tthis._pointerType = event.pointerType;\n\t\tthis._pointerStartX = event.pageX;\n\t\tthis._pointerStartY = event.pageY;\n\t\tthis._pointerStart = this._isVertical ? event.pageY : event.pageX;\n\t\tthis._isDragging = true;\n\t\tthis._isAllowedToDrag = false;\n\t\tthis._wasBeyondThreshold = false;\n\t\tthis._dragStartTime = Date.now();\n\n\t\tthis._drawerEl.style.transition = 'none';\n\n\t\tif (!this._findScrollableAncestor(event.target as HTMLElement)) {\n\t\t\tthis._drawerEl.style.touchAction = 'none';\n\t\t}\n\n\t\tconst overlayWrapper = this._drawerEl.closest('.cdk-global-overlay-wrapper');\n\t\tthis._backdropEl = overlayWrapper?.querySelector('.cdk-overlay-backdrop') as HTMLElement | null;\n\t\tif (this._backdropEl) {\n\t\t\tthis._initialBackdropOpacity = parseFloat(getComputedStyle(this._backdropEl).opacity) || 1;\n\t\t}\n\n\t\tthis._pointerId = event.pointerId;\n\n\t\tthis._document.addEventListener('pointermove', this._onPointerMove, { passive: false });\n\t\tthis._document.addEventListener('pointerup', this._onPointerUp, { once: true });\n\t\tthis._document.addEventListener('pointercancel', this._onPointerCancel, { once: true });\n\t}\n\n\tprivate readonly _onPointerMove = (e: PointerEvent) => {\n\t\tif (!this._isDragging || !this._drawerEl) return;\n\n\t\tconst currentX = e.pageX;\n\t\tconst currentY = e.pageY;\n\t\tconst xDelta = currentX - this._pointerStartX;\n\t\tconst yDelta = currentY - this._pointerStartY;\n\n\t\tif (!this._wasBeyondThreshold) {\n\t\t\tconst absX = Math.abs(xDelta);\n\t\t\tconst absY = Math.abs(yDelta);\n\t\t\tif (this._isVertical) {\n\t\t\t\tif (absY < this._swipeThreshold) {\n\t\t\t\t\tif (absX >= this._swipeThreshold) {\n\t\t\t\t\t\tthis._pointerStartX = currentX;\n\t\t\t\t\t\tthis._pointerStartY = currentY;\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (absX > absY) return;\n\t\t\t} else {\n\t\t\t\tif (absX < this._swipeThreshold) {\n\t\t\t\t\tif (absY >= this._swipeThreshold) {\n\t\t\t\t\t\tthis._pointerStartX = currentX;\n\t\t\t\t\t\tthis._pointerStartY = currentY;\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (absY > absX) return;\n\t\t\t}\n\t\t\tthis._wasBeyondThreshold = true;\n\t\t}\n\n\t\tconst currentPosition = this._isVertical ? currentY : currentX;\n\t\tconst draggedDistance = (this._pointerStart - currentPosition) * this._dimensionMultiplier;\n\t\tconst isDraggingInDirection = draggedDistance > 0;\n\t\tconst absDraggedDistance = Math.abs(draggedDistance);\n\n\t\tif (!this._isAllowedToDrag && !this._shouldDrag(e.target ?? this._element.nativeElement, isDraggingInDirection))\n\t\t\treturn;\n\n\t\tthis._isAllowedToDrag = true;\n\t\ttry {\n\t\t\tthis._element.nativeElement.setPointerCapture(e.pointerId);\n\t\t} catch {\n\t\t\t/* empty - pointer capture not supported */\n\t\t}\n\t\tthis._drawerEl.classList.add('vaul-dragging');\n\n\t\tconst dimension = this._isVertical ? this._drawerEl.offsetHeight : this._drawerEl.offsetWidth;\n\n\t\tconst progress = dimension > 0 ? Math.min(absDraggedDistance / dimension, 1) : 0;\n\n\t\tif (isDraggingInDirection) {\n\t\t\tconst dampened = dampenValue(draggedDistance);\n\t\t\tconst translateValue = Math.min(dampened * -1, 0) * this._dimensionMultiplier;\n\t\t\tconst prop = this._isVertical ? 'translateY' : 'translateX';\n\t\t\tthis._drawerEl.style.transform = `${prop}(${translateValue}px)`;\n\t\t\tif (this._backdropEl) {\n\t\t\t\tthis._backdropEl.style.opacity = String(Math.max(this._initialBackdropOpacity - progress * 0.3, 0));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\te.preventDefault();\n\n\t\tconst translateValue = absDraggedDistance * this._dimensionMultiplier;\n\t\tconst prop = this._isVertical ? 'translateY' : 'translateX';\n\t\tthis._drawerEl.style.transform = `${prop}(${translateValue}px)`;\n\n\t\tif (this._backdropEl) {\n\t\t\tthis._backdropEl.style.opacity = String(Math.max(this._initialBackdropOpacity - progress, 0));\n\t\t}\n\t};\n\n\tprivate readonly _onPointerUp = (e: PointerEvent) => {\n\t\tif (!this._isDragging || !this._drawerEl) {\n\t\t\tthis._cleanup();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._drawerEl.classList.remove('vaul-dragging');\n\n\t\tconst swipeAmount = this._getTranslate();\n\n\t\tif (!this._isAllowedToDrag || swipeAmount === null || Number.isNaN(swipeAmount)) {\n\t\t\tthis._resetDrawer(true);\n\t\t\tthis._cleanup();\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentPosition = this._isVertical ? e.pageY : e.pageX;\n\t\tconst distMoved = this._pointerStart - currentPosition;\n\t\tconst timeTaken = Date.now() - (this._dragStartTime ?? Date.now());\n\t\tconst velocity = timeTaken > 0 ? Math.abs(distMoved) / timeTaken : 0;\n\n\t\tif (this._isPositive ? distMoved > 0 : distMoved < 0) {\n\t\t\tthis._resetDrawer(true);\n\t\t\tthis._cleanup();\n\t\t\treturn;\n\t\t}\n\n\t\tif (velocity > VELOCITY_THRESHOLD) {\n\t\t\tthis._animateAndClose();\n\t\t\tthis._cleanup();\n\t\t\tthis._brnDialogRef?.close();\n\t\t\treturn;\n\t\t}\n\n\t\tconst dimension = this._isVertical ? this._drawerEl.offsetHeight : this._drawerEl.offsetWidth;\n\t\tif (Math.abs(swipeAmount) >= dimension * this.closeThreshold()) {\n\t\t\tthis._animateAndClose();\n\t\t\tthis._cleanup();\n\t\t\tthis._brnDialogRef?.close();\n\t\t\treturn;\n\t\t}\n\n\t\tthis._resetDrawer(true);\n\t\tthis._cleanup();\n\t};\n\n\tprivate readonly _onPointerCancel = () => {\n\t\tthis._resetDrawer(true);\n\t\tthis._cleanup();\n\t};\n\n\tprivate _shouldDrag(el: EventTarget, isDraggingInDirection: boolean): boolean {\n\t\tif (this._direction === 'left' || this._direction === 'right') return true;\n\n\t\tconst now = Date.now();\n\n\t\tif (this._openTime !== null && now - this._openTime < OPEN_TIME_COOLDOWN) return false;\n\n\t\tconst currentTranslate = this._getTranslate();\n\t\tif (this._isPositive ? currentTranslate > 0 : currentTranslate < 0) return true;\n\n\t\tif (\n\t\t\tthis._lastTimeDragPrevented !== null &&\n\t\t\tnow - this._lastTimeDragPrevented < SCROLL_LOCK_TIMEOUT &&\n\t\t\tcurrentTranslate === 0\n\t\t) {\n\t\t\tthis._lastTimeDragPrevented = now;\n\t\t\treturn false;\n\t\t}\n\n\t\tif (isDraggingInDirection) {\n\t\t\tthis._lastTimeDragPrevented = now;\n\t\t\treturn false;\n\t\t}\n\n\t\tlet element = el as HTMLElement | null;\n\t\twhile (element) {\n\t\t\tif (element.scrollHeight > element.clientHeight) {\n\t\t\t\tif (element.scrollTop !== 0) {\n\t\t\t\t\tthis._lastTimeDragPrevented = now;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (element.getAttribute('role') === 'dialog') return true;\n\t\t\t}\n\t\t\telement = element.parentElement;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tprivate _getTranslate(): number {\n\t\tif (!this._drawerEl) return 0;\n\t\tconst style = getComputedStyle(this._drawerEl);\n\t\tconst transform = style.transform || (style as any).webkitTransform;\n\t\tif (!transform || transform === 'none') return 0;\n\t\tlet mat = transform.match(/^matrix3d\\((.+)\\)$/);\n\t\tif (mat) {\n\t\t\treturn parseFloat(mat[1].split(', ')[this._isVertical ? 13 : 12]);\n\t\t}\n\t\tmat = transform.match(/^matrix\\((.+)\\)$/);\n\t\tif (mat) {\n\t\t\treturn parseFloat(mat[1].split(', ')[this._isVertical ? 5 : 4]);\n\t\t}\n\t\treturn 0;\n\t}\n\n\tprivate _resetDrawer(animate = true): void {\n\t\tif (this._drawerEl) {\n\t\t\tthis._drawerEl.style.transition = animate ? TRANSITION : 'none';\n\t\t\tthis._drawerEl.style.transform = '';\n\t\t}\n\t\tif (this._backdropEl) {\n\t\t\tthis._backdropEl.style.transition = animate ? OVERLAY_TRANSITION : 'none';\n\t\t\tthis._backdropEl.style.opacity = String(this._initialBackdropOpacity);\n\t\t}\n\t\tsetTimeout(() => {\n\t\t\tif (this._drawerEl) this._drawerEl.style.transition = '';\n\t\t\tif (this._backdropEl) this._backdropEl.style.transition = '';\n\t\t}, 500);\n\t}\n\n\tprivate _animateAndClose(): void {\n\t\tif (!this._drawerEl) return;\n\t\tconst dimension = this._isVertical ? this._drawerEl.offsetHeight : this._drawerEl.offsetWidth;\n\t\tconst targetClose = this._isPositive ? dimension : -dimension;\n\t\tconst prop = this._isVertical ? 'translateY' : 'translateX';\n\t\tthis._drawerEl.style.transition = 'transform 0.3s cubic-bezier(0.32, 0.72, 0, 1)';\n\t\tthis._drawerEl.style.transform = `${prop}(${targetClose}px)`;\n\t\tthis._drawerEl.style.animation = 'none';\n\t\tif (this._backdropEl) {\n\t\t\tthis._backdropEl.style.transition = 'opacity 0.3s cubic-bezier(0.32, 0.72, 0, 1)';\n\t\t\tthis._backdropEl.style.opacity = '0';\n\t\t}\n\t}\n\n\tprivate _cleanup(): void {\n\t\tthis._isDragging = false;\n\t\tthis._isAllowedToDrag = false;\n\t\tif (this._drawerEl) {\n\t\t\tthis._drawerEl.style.touchAction = '';\n\t\t}\n\t\tif (this._pointerId !== -1) {\n\t\t\ttry {\n\t\t\t\tthis._element.nativeElement.releasePointerCapture(this._pointerId);\n\t\t\t} catch {\n\t\t\t\t/* empty */\n\t\t\t}\n\t\t\tthis._pointerId = -1;\n\t\t}\n\t\tthis._document.removeEventListener('pointermove', this._onPointerMove);\n\t}\n\n\tprivate _findScrollableAncestor(element: HTMLElement | null): HTMLElement | null {\n\t\tif (!element) return null;\n\t\tconst scrollProp = this._isVertical ? 'overflow-y' : 'overflow-x';\n\t\tconst sizeProp = this._isVertical ? 'scrollHeight' : 'scrollWidth';\n\t\tconst clientProp = this._isVertical ? 'clientHeight' : 'clientWidth';\n\t\tlet el: HTMLElement | null = element.parentElement;\n\t\twhile (el) {\n\t\t\tconst overflow = getComputedStyle(el)[scrollProp as any];\n\t\t\tif ((overflow === 'auto' || overflow === 'scroll') && (el as any)[sizeProp] > (el as any)[clientProp]) {\n\t\t\t\treturn el;\n\t\t\t}\n\t\t\tel = el.parentElement;\n\t\t}\n\t\treturn null;\n\t}\n}\n","import { Directive } from '@angular/core';\nimport { provideCustomClassSettableExisting } from '@spartan-ng/brain/core';\nimport { BrnDialogOverlay } from '@spartan-ng/brain/dialog';\n\n@Directive({\n\tselector: '[brnDrawerOverlay],brn-drawer-overlay',\n\tproviders: [provideCustomClassSettableExisting(() => BrnDrawerOverlay)],\n})\nexport class BrnDrawerOverlay extends BrnDialogOverlay {}\n","import { Directive } from '@angular/core';\nimport { BrnDialogTitle } from '@spartan-ng/brain/dialog';\n\n@Directive({\n\tselector: '[brnDrawerTitle]',\n\thostDirectives: [BrnDialogTitle],\n})\nexport class BrnDrawerTitle {}\n","import { Directive, inject, input } from '@angular/core';\nimport { BrnDialogTrigger } from '@spartan-ng/brain/dialog';\nimport { BrnDrawer } from './brn-drawer';\n\n@Directive({\n\tselector: 'button[brnDrawerTrigger]',\n})\nexport class BrnDrawerTrigger extends BrnDialogTrigger {\n\tprivate readonly _drawer = inject(BrnDrawer, { optional: true });\n\n\tpublic readonly direction = input<'bottom' | 'top' | 'left' | 'right' | undefined>(undefined);\n\n\toverride open() {\n\t\tconst direction = this.direction();\n\t\tif (this._drawer && direction) {\n\t\t\tthis._drawer.directionState.set(direction);\n\t\t}\n\t\tsuper.open();\n\t}\n}\n","import { BrnDrawer } from './lib/brn-drawer';\nimport { BrnDrawerClose } from './lib/brn-drawer-close';\nimport { BrnDrawerContent } from './lib/brn-drawer-content';\nimport { BrnDrawerDescription } from './lib/brn-drawer-description';\nimport { BrnDrawerHandle } from './lib/brn-drawer-handle';\nimport { BrnDrawerOverlay } from './lib/brn-drawer-overlay';\nimport { BrnDrawerTitle } from './lib/brn-drawer-title';\nimport { BrnDrawerTrigger } from './lib/brn-drawer-trigger';\n\nexport * from './lib/brn-drawer';\nexport * from './lib/brn-drawer-close';\nexport * from './lib/brn-drawer-content';\nexport * from './lib/brn-drawer-description';\nexport * from './lib/brn-drawer-handle';\nexport * from './lib/brn-drawer-overlay';\nexport * from './lib/brn-drawer-title';\nexport * from './lib/brn-drawer-trigger';\n\nexport const BrnDrawerImports = [\n\tBrnDrawer,\n\tBrnDrawerOverlay,\n\tBrnDrawerTrigger,\n\tBrnDrawerClose,\n\tBrnDrawerContent,\n\tBrnDrawerTitle,\n\tBrnDrawerDescription,\n\tBrnDrawerHandle,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAaM,MAAO,SAAU,SAAQ,SAAS,CAAA;AACvB,IAAA,SAAS,GAAG,KAAK,CAAsC,QAAQ,gFAAC;IAChE,cAAc,GAAG,YAAY,CAAC,MAAM,IAAI,CAAC,SAAS,EAAE,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,gBAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAC;AAErE,IAAA,WAAA,GAAA;AACC,QAAA,KAAK,EAAE;QACP,MAAM,CAAC,MAAK;AACX,YAAA,MAAM,SAAS,GAAG,IAAI,CAAC,cAAc,EAAE;YACvC,SAAS,CAAC,MAAK;AACd,gBAAA,IAAI,SAAS,KAAK,QAAQ,EAAE;AAC3B,oBAAA,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC;gBACzE;AACA,gBAAA,IAAI,SAAS,KAAK,KAAK,EAAE;AACxB,oBAAA,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC;gBACtE;AACA,gBAAA,IAAI,SAAS,KAAK,MAAM,EAAE;AACzB,oBAAA,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe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E;AAClC,QAAA,IAAI,IAAI,CAAC,OAAO,IAAI,SAAS,EAAE;YAC9B,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC;QAC3C;QACA,KAAK,CAAC,IAAI,EAAE;IACb;2HAXY,gBAAgB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;+GAAhB,gBAAgB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,0BAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,UAAA,EAAA,WAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;4FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAH5B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,QAAQ,EAAE,0BAA0B;AACpC,iBAAA;;;ACYM,MAAM,gBAAgB,GAAG;IAC/B,SAAS;IACT,gBAAgB;IAChB,gBAAgB;IAChB,cAAc;IACd,gBAAgB;IAChB,cAAc;IACd,oBAAoB;IACpB,eAAe;;;AC1BhB;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spartan-ng/brain",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.714",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/spartan-ng/spartan"
|
|
@@ -71,6 +71,10 @@
|
|
|
71
71
|
"types": "./types/spartan-ng-brain-dialog.d.ts",
|
|
72
72
|
"default": "./fesm2022/spartan-ng-brain-dialog.mjs"
|
|
73
73
|
},
|
|
74
|
+
"./drawer": {
|
|
75
|
+
"types": "./types/spartan-ng-brain-drawer.d.ts",
|
|
76
|
+
"default": "./fesm2022/spartan-ng-brain-drawer.mjs"
|
|
77
|
+
},
|
|
74
78
|
"./field": {
|
|
75
79
|
"types": "./types/spartan-ng-brain-field.d.ts",
|
|
76
80
|
"default": "./fesm2022/spartan-ng-brain-field.mjs"
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import * as i1 from '@spartan-ng/brain/dialog';
|
|
3
|
+
import { BrnDialog, BrnDialogClose, BrnDialogContent, BrnDialogOverlay, BrnDialogTrigger } from '@spartan-ng/brain/dialog';
|
|
4
|
+
import { ExposesSide } from '@spartan-ng/brain/core';
|
|
5
|
+
|
|
6
|
+
declare class BrnDrawer extends BrnDialog {
|
|
7
|
+
readonly direction: i0.InputSignal<"bottom" | "top" | "left" | "right">;
|
|
8
|
+
readonly directionState: i0.WritableSignal<"bottom" | "top" | "left" | "right">;
|
|
9
|
+
constructor();
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BrnDrawer, never>;
|
|
11
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BrnDrawer, "[brnDrawer],brn-drawer", ["brnDrawer"], { "direction": { "alias": "direction"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare class BrnDrawerClose extends BrnDialogClose {
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BrnDrawerClose, never>;
|
|
16
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BrnDrawerClose, "button[brnDrawerClose]", never, {}, {}, never, never, true, never>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare class BrnDrawerContent<T> extends BrnDialogContent<T> implements ExposesSide {
|
|
20
|
+
readonly side: i0.WritableSignal<"bottom" | "top" | "left" | "right">;
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BrnDrawerContent<any>, never>;
|
|
22
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BrnDrawerContent<any>, "[brnDrawerContent]", never, {}, {}, never, never, true, never>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare class BrnDrawerDescription {
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BrnDrawerDescription, never>;
|
|
27
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BrnDrawerDescription, "[brnDrawerDescription]", never, {}, {}, never, never, true, [{ directive: typeof i1.BrnDialogDescription; inputs: {}; outputs: {}; }]>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
declare class BrnDrawerHandle {
|
|
31
|
+
private readonly _brnDialogRef;
|
|
32
|
+
private readonly _brnDrawer;
|
|
33
|
+
private readonly _element;
|
|
34
|
+
private readonly _document;
|
|
35
|
+
private readonly _destroyRef;
|
|
36
|
+
private _pointerId;
|
|
37
|
+
constructor();
|
|
38
|
+
private _drawerEl;
|
|
39
|
+
private _backdropEl;
|
|
40
|
+
private _direction;
|
|
41
|
+
private _initialBackdropOpacity;
|
|
42
|
+
private _pointerStartX;
|
|
43
|
+
private _pointerStartY;
|
|
44
|
+
private _pointerStart;
|
|
45
|
+
private _pointerType;
|
|
46
|
+
private _isDragging;
|
|
47
|
+
private _isAllowedToDrag;
|
|
48
|
+
private _wasBeyondThreshold;
|
|
49
|
+
private _openTime;
|
|
50
|
+
private _lastTimeDragPrevented;
|
|
51
|
+
private _dragStartTime;
|
|
52
|
+
readonly closeThreshold: i0.InputSignal<number>;
|
|
53
|
+
private get _isVertical();
|
|
54
|
+
private get _isPositive();
|
|
55
|
+
private get _dimensionMultiplier();
|
|
56
|
+
private get _swipeThreshold();
|
|
57
|
+
protected _onPointerDown(event: PointerEvent): void;
|
|
58
|
+
private readonly _onPointerMove;
|
|
59
|
+
private readonly _onPointerUp;
|
|
60
|
+
private readonly _onPointerCancel;
|
|
61
|
+
private _shouldDrag;
|
|
62
|
+
private _getTranslate;
|
|
63
|
+
private _resetDrawer;
|
|
64
|
+
private _animateAndClose;
|
|
65
|
+
private _cleanup;
|
|
66
|
+
private _findScrollableAncestor;
|
|
67
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BrnDrawerHandle, never>;
|
|
68
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BrnDrawerHandle, "[brnDrawerHandle]", never, { "closeThreshold": { "alias": "closeThreshold"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
declare class BrnDrawerOverlay extends BrnDialogOverlay {
|
|
72
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BrnDrawerOverlay, never>;
|
|
73
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BrnDrawerOverlay, "[brnDrawerOverlay],brn-drawer-overlay", never, {}, {}, never, never, true, never>;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
declare class BrnDrawerTitle {
|
|
77
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BrnDrawerTitle, never>;
|
|
78
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BrnDrawerTitle, "[brnDrawerTitle]", never, {}, {}, never, never, true, [{ directive: typeof i1.BrnDialogTitle; inputs: {}; outputs: {}; }]>;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
declare class BrnDrawerTrigger extends BrnDialogTrigger {
|
|
82
|
+
private readonly _drawer;
|
|
83
|
+
readonly direction: i0.InputSignal<"bottom" | "top" | "left" | "right" | undefined>;
|
|
84
|
+
open(): void;
|
|
85
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BrnDrawerTrigger, never>;
|
|
86
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BrnDrawerTrigger, "button[brnDrawerTrigger]", never, { "direction": { "alias": "direction"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
declare const BrnDrawerImports: readonly [typeof BrnDrawer, typeof BrnDrawerOverlay, typeof BrnDrawerTrigger, typeof BrnDrawerClose, typeof BrnDrawerContent, typeof BrnDrawerTitle, typeof BrnDrawerDescription, typeof BrnDrawerHandle];
|
|
90
|
+
|
|
91
|
+
export { BrnDrawer, BrnDrawerClose, BrnDrawerContent, BrnDrawerDescription, BrnDrawerHandle, BrnDrawerImports, BrnDrawerOverlay, BrnDrawerTitle, BrnDrawerTrigger };
|