@acorex/cdk 22.3.2 → 22.3.4

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.
@@ -12,39 +12,45 @@ class AXResizableDirective {
12
12
  this.zone = inject(NgZone);
13
13
  this.document = inject(DOCUMENT);
14
14
  this.platformID = inject(PLATFORM_ID);
15
+ this.resizeHandles = new Map();
15
16
  this.isResizing = signal(false, /* @ts-ignore */
16
17
  ...(ngDevMode ? [{ debugName: "isResizing" }] : /* istanbul ignore next */ []));
18
+ this.activeHandle = null;
17
19
  this.initialElementWidth = 0;
18
- this.startMoveWidth = 0;
20
+ this.initialElementHeight = 0;
21
+ this.startX = 0;
22
+ this.startY = 0;
23
+ this.startWidth = 0;
24
+ this.startHeight = 0;
25
+ this.startRatio = 1;
19
26
  this.subscriptions = new Subscription();
20
- // Bound event handlers to maintain reference for cleanup
21
- this.boundMouseDown = this.onMouseDown.bind(this);
22
- this.boundMouseMove = this.onMouseMove.bind(this);
23
- this.boundMouseUp = this.onMouseUp.bind(this);
24
- this.boundMouseEnter = this.onMouseEnter.bind(this);
25
- this.boundMouseLeave = this.onMouseLeave.bind(this);
27
+ this.boundPointerDown = this.onPointerDown.bind(this);
28
+ this.boundPointerMove = this.onPointerMove.bind(this);
29
+ this.boundPointerUp = this.onPointerUp.bind(this);
30
+ this.boundPointerEnter = this.onPointerEnter.bind(this);
31
+ this.boundPointerLeave = this.onPointerLeave.bind(this);
26
32
  this.boundDoubleClick = this.onDoubleClick.bind(this);
27
- this.resizeObserver = new ResizeObserver((entries) => {
28
- const parentElement = this.hostElement.parentElement;
29
- if (!parentElement)
30
- return;
31
- for (const entry of entries) {
32
- if (entry.target === parentElement && this.maxWidth() === Infinity) {
33
- this.maxWidth.set(entry.contentRect.width);
34
- break;
35
- }
36
- }
37
- });
33
+ this.isRTL = signal(false, /* @ts-ignore */
34
+ ...(ngDevMode ? [{ debugName: "isRTL" }] : /* istanbul ignore next */ []));
38
35
  /** Define if directive is active or not */
39
36
  this.axResizable = model(true, /* @ts-ignore */
40
37
  ...(ngDevMode ? [{ debugName: "axResizable" }] : /* istanbul ignore next */ []));
38
+ /** Logical handles to render. Defaults to the inline-end edge. */
39
+ this.handles = model(['end'], /* @ts-ignore */
40
+ ...(ngDevMode ? [{ debugName: "handles" }] : /* istanbul ignore next */ []));
41
41
  /** Minimum width for the resizable element. */
42
42
  this.minWidth = model(100, /* @ts-ignore */
43
43
  ...(ngDevMode ? [{ debugName: "minWidth" }] : /* istanbul ignore next */ []));
44
44
  /** Maximum width for the resizable element. Defaults to parent width if not provided. */
45
45
  this.maxWidth = model(Infinity, /* @ts-ignore */
46
46
  ...(ngDevMode ? [{ debugName: "maxWidth" }] : /* istanbul ignore next */ []));
47
- /** Behavior on double-click: 'reset' or 'maximize'. */
47
+ /** Minimum height for the resizable element. */
48
+ this.minHeight = model(100, /* @ts-ignore */
49
+ ...(ngDevMode ? [{ debugName: "minHeight" }] : /* istanbul ignore next */ []));
50
+ /** Maximum height for the resizable element. Defaults to parent height if not provided. */
51
+ this.maxHeight = model(Infinity, /* @ts-ignore */
52
+ ...(ngDevMode ? [{ debugName: "maxHeight" }] : /* istanbul ignore next */ []));
53
+ /** Behavior on double-click: 'reset', 'maximize', or 'fit'. */
48
54
  this.dblClickAction = model('reset', /* @ts-ignore */
49
55
  ...(ngDevMode ? [{ debugName: "dblClickAction" }] : /* istanbul ignore next */ []));
50
56
  /** Define initial width for the element. */
@@ -53,281 +59,558 @@ class AXResizableDirective {
53
59
  /** Define reset width for the element. */
54
60
  this.defaultWidth = model(null, /* @ts-ignore */
55
61
  ...(ngDevMode ? [{ debugName: "defaultWidth" }] : /* istanbul ignore next */ []));
62
+ /** Define initial height for the element. */
63
+ this.height = model(null, /* @ts-ignore */
64
+ ...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
65
+ /** Define reset height for the element. */
66
+ this.defaultHeight = model(null, /* @ts-ignore */
67
+ ...(ngDevMode ? [{ debugName: "defaultHeight" }] : /* istanbul ignore next */ []));
68
+ /** Lock the element's aspect ratio from the size captured at pointer-down. */
69
+ this.lockAspectRatio = model(false, /* @ts-ignore */
70
+ ...(ngDevMode ? [{ debugName: "lockAspectRatio" }] : /* istanbul ignore next */ []));
56
71
  /** Event emitted when resizing starts. */
57
72
  this.onResizingStarted = output();
58
73
  /** Event emitted when resizing ends. */
59
74
  this.onResizingEnded = output();
60
75
  /** Event emitted on double-click. */
61
76
  this.onResizingDblClick = output();
62
- this.isRTL = signal(AXHtmlUtil.isRtl(this.document.documentElement), /* @ts-ignore */
63
- ...(ngDevMode ? [{ debugName: "isRTL" }] : /* istanbul ignore next */ []));
64
77
  this.isBrowser = isPlatformBrowser(this.platformID);
65
78
  this.hostElement = this.el.nativeElement;
79
+ this.isRTL.set(AXHtmlUtil.isRtl(this.document.documentElement));
66
80
  this.subscriptions.add(this.platformService.directionChange.subscribe((i) => {
67
81
  this.isRTL.set(i.data === 'rtl');
68
- if (this.resizeHandle) {
69
- this.updateHandlePosition();
70
- }
71
82
  }));
72
- if (this.isBrowser) {
73
- effect(() => {
74
- if (this.isResizing()) {
75
- return;
83
+ if (!this.isBrowser) {
84
+ return;
85
+ }
86
+ this.resizeObserver = new ResizeObserver((entries) => {
87
+ const parentElement = this.hostElement.parentElement;
88
+ if (!parentElement) {
89
+ return;
90
+ }
91
+ for (const entry of entries) {
92
+ if (entry.target !== parentElement) {
93
+ continue;
94
+ }
95
+ if (this.maxWidth() === Infinity) {
96
+ this.maxWidth.set(entry.contentRect.width);
76
97
  }
77
- const resolvedWidth = this.width() ?? this.defaultWidth();
78
- if (resolvedWidth !== null) {
79
- this.applyElementWidth(resolvedWidth);
98
+ if (this.maxHeight() === Infinity) {
99
+ this.maxHeight.set(entry.contentRect.height);
80
100
  }
81
- });
82
- }
101
+ }
102
+ });
103
+ effect(() => {
104
+ const isActive = this.axResizable();
105
+ const handles = this.handles();
106
+ this.reconcileHandles(isActive, handles);
107
+ });
108
+ effect(() => {
109
+ this.isRTL();
110
+ this.updateAllHandlePositions();
111
+ });
112
+ effect(() => {
113
+ if (this.isResizing()) {
114
+ return;
115
+ }
116
+ this.applySizeFromModel();
117
+ });
83
118
  }
84
119
  ngAfterViewInit() {
85
- if (!this.isBrowser)
120
+ if (!this.isBrowser) {
86
121
  return;
122
+ }
87
123
  this.initialElementWidth = this.hostElement.offsetWidth;
88
- this.applyWidthFromModel();
124
+ this.initialElementHeight = this.hostElement.offsetHeight;
125
+ this.applySizeFromModel();
126
+ const parentElement = this.hostElement.parentElement;
89
127
  if (this.maxWidth() === Infinity) {
90
- const parentWidth = this.hostElement.parentElement?.offsetWidth;
128
+ const parentWidth = parentElement?.offsetWidth;
91
129
  if (parentWidth) {
92
130
  this.maxWidth.set(parentWidth);
93
131
  }
94
132
  }
95
- const parentElement = this.hostElement.parentElement;
133
+ if (this.maxHeight() === Infinity) {
134
+ const parentHeight = parentElement?.offsetHeight;
135
+ if (parentHeight) {
136
+ this.maxHeight.set(parentHeight);
137
+ }
138
+ }
96
139
  if (parentElement) {
97
- this.resizeObserver.observe(parentElement);
140
+ this.resizeObserver?.observe(parentElement);
98
141
  }
99
- this.createResizeHandle();
100
- this.setupResizableState();
101
142
  }
102
143
  ngOnDestroy() {
103
144
  this.subscriptions.unsubscribe();
104
- this.resizeObserver.disconnect();
105
- this.cleanupEventListeners();
106
- }
107
- setupResizableState() {
108
- this.subscriptions.add(this.axResizable.subscribe((isActive) => {
109
- if (!isActive) {
110
- this.applyWidthFromModel();
111
- this.cleanupEventListeners();
112
- }
113
- else {
114
- this.applyWidthFromModel();
115
- this.createResizeHandle();
116
- }
117
- }));
145
+ this.resizeObserver?.disconnect();
146
+ this.destroyAllHandles();
147
+ this.document.body.style.cursor = '';
118
148
  }
119
- applyWidthFromModel() {
120
- const width = this.width();
121
- if (width !== null) {
122
- this.applyElementWidth(width);
149
+ reconcileHandles(isActive, handles) {
150
+ if (!this.isBrowser) {
151
+ return;
152
+ }
153
+ if (!isActive) {
154
+ this.stopResizing();
155
+ this.destroyAllHandles();
156
+ this.applySizeFromModel();
123
157
  return;
124
158
  }
125
- const defaultWidth = this.defaultWidth();
126
- if (defaultWidth !== null) {
127
- this.applyElementWidth(defaultWidth);
159
+ this.hostElement.style.position = 'relative';
160
+ const unique = [...new Set(handles)];
161
+ const desired = new Set(unique);
162
+ for (const [type, element] of this.resizeHandles) {
163
+ if (!desired.has(type)) {
164
+ this.destroyHandle(type, element);
165
+ }
166
+ }
167
+ for (const type of unique) {
168
+ if (!this.resizeHandles.has(type)) {
169
+ this.createHandle(type);
170
+ }
128
171
  }
129
172
  }
130
- applyElementWidth(width) {
131
- this.hostElement.style.width = `${width}px`;
173
+ createHandle(type) {
174
+ const handle = this.document.createElement('div');
175
+ handle.classList.add('ax-resizable-handler', `ax-resizable-handler--${type}`);
176
+ handle.dataset['axResizeHandle'] = type;
177
+ this.hostElement.appendChild(handle);
178
+ this.applyHandleStyles(handle, type);
179
+ this.attachHandleListeners(handle);
180
+ this.resizeHandles.set(type, handle);
132
181
  }
133
- createResizeHandle() {
134
- if (!this.axResizable() || this.resizeHandle)
135
- return;
136
- this.hostElement.style.position = 'relative';
137
- this.resizeHandle = this.document.createElement('div');
138
- this.resizeHandle.classList.add('ax-resizable-handler');
139
- this.hostElement.appendChild(this.resizeHandle);
140
- this.applyHandleStyles();
141
- this.attachEventListeners();
142
- }
143
- applyHandleStyles() {
144
- if (!this.resizeHandle)
145
- return;
146
- Object.assign(this.resizeHandle.style, {
147
- width: STYLES.handlerWidth,
148
- backgroundColor: STYLES.backgroundColor,
182
+ attachHandleListeners(handle) {
183
+ this.zone.runOutsideAngular(() => {
184
+ handle.addEventListener('pointerdown', this.boundPointerDown);
185
+ handle.addEventListener('pointermove', this.boundPointerMove);
186
+ handle.addEventListener('pointerup', this.boundPointerUp);
187
+ handle.addEventListener('pointercancel', this.boundPointerUp);
188
+ handle.addEventListener('pointerenter', this.boundPointerEnter);
189
+ handle.addEventListener('pointerleave', this.boundPointerLeave);
190
+ handle.addEventListener('dblclick', this.boundDoubleClick);
191
+ });
192
+ }
193
+ destroyHandle(type, handle) {
194
+ handle.removeEventListener('pointerdown', this.boundPointerDown);
195
+ handle.removeEventListener('pointermove', this.boundPointerMove);
196
+ handle.removeEventListener('pointerup', this.boundPointerUp);
197
+ handle.removeEventListener('pointercancel', this.boundPointerUp);
198
+ handle.removeEventListener('pointerenter', this.boundPointerEnter);
199
+ handle.removeEventListener('pointerleave', this.boundPointerLeave);
200
+ handle.removeEventListener('dblclick', this.boundDoubleClick);
201
+ handle.remove();
202
+ this.resizeHandles.delete(type);
203
+ }
204
+ destroyAllHandles() {
205
+ for (const [type, handle] of [...this.resizeHandles]) {
206
+ this.destroyHandle(type, handle);
207
+ }
208
+ }
209
+ applyHandleStyles(handle, type) {
210
+ const isCorner = type.includes('-');
211
+ Object.assign(handle.style, {
149
212
  position: 'absolute',
150
- top: '0',
151
- bottom: '0',
152
- cursor: STYLES.cursor,
153
- zIndex: STYLES.zIndex,
213
+ backgroundColor: STYLES.backgroundColor,
214
+ zIndex: isCorner ? STYLES.zIndexCorner : STYLES.zIndex,
154
215
  transition: STYLES.transition,
155
216
  borderRadius: STYLES.borderRadius,
156
217
  userSelect: 'none',
218
+ touchAction: 'none',
219
+ cursor: this.getCursorForHandle(type),
220
+ left: '',
221
+ right: '',
222
+ top: '',
223
+ bottom: '',
224
+ width: '',
225
+ height: '',
157
226
  });
158
- this.updateHandlePosition();
227
+ this.positionHandle(handle, type);
159
228
  }
160
- updateHandlePosition() {
161
- if (!this.resizeHandle)
162
- return;
163
- const isRTL = this.isRTL();
164
- if (isRTL) {
165
- this.resizeHandle.style.left = '0';
166
- this.resizeHandle.style.right = '';
229
+ updateAllHandlePositions() {
230
+ for (const [type, handle] of this.resizeHandles) {
231
+ handle.style.cursor = this.getCursorForHandle(type);
232
+ this.positionHandle(handle, type);
233
+ }
234
+ }
235
+ positionHandle(handle, type) {
236
+ const rtl = this.isRTL();
237
+ switch (type) {
238
+ case 'start':
239
+ case 'end':
240
+ handle.style.top = '0';
241
+ handle.style.bottom = '0';
242
+ handle.style.width = STYLES.handlerWidth;
243
+ this.applyInlineSide(handle, type, rtl);
244
+ break;
245
+ case 'top':
246
+ case 'bottom':
247
+ handle.style.left = '0';
248
+ handle.style.right = '0';
249
+ handle.style.height = STYLES.handlerHeight;
250
+ if (type === 'top') {
251
+ handle.style.top = '0';
252
+ handle.style.bottom = '';
253
+ }
254
+ else {
255
+ handle.style.bottom = '0';
256
+ handle.style.top = '';
257
+ }
258
+ break;
259
+ default: {
260
+ const [vertical, horizontal] = type.split('-');
261
+ handle.style.width = STYLES.cornerSize;
262
+ handle.style.height = STYLES.cornerSize;
263
+ if (vertical === 'top') {
264
+ handle.style.top = '0';
265
+ handle.style.bottom = '';
266
+ }
267
+ else {
268
+ handle.style.bottom = '0';
269
+ handle.style.top = '';
270
+ }
271
+ this.applyInlineSide(handle, horizontal, rtl);
272
+ break;
273
+ }
274
+ }
275
+ }
276
+ applyInlineSide(element, side, rtl) {
277
+ const physicalLeft = (side === 'start' && !rtl) || (side === 'end' && rtl);
278
+ if (physicalLeft) {
279
+ element.style.left = '0';
280
+ element.style.right = '';
167
281
  }
168
282
  else {
169
- this.resizeHandle.style.right = '0';
170
- this.resizeHandle.style.left = '';
283
+ element.style.right = '0';
284
+ element.style.left = '';
171
285
  }
172
286
  }
173
- attachEventListeners() {
174
- if (!this.resizeHandle)
175
- return;
176
- const handle = this.resizeHandle;
177
- this.zone.runOutsideAngular(() => {
178
- handle.addEventListener('mousedown', this.boundMouseDown);
179
- handle.addEventListener('mouseenter', this.boundMouseEnter);
180
- handle.addEventListener('mouseleave', this.boundMouseLeave);
181
- handle.addEventListener('dblclick', this.boundDoubleClick);
182
- this.document.addEventListener('mousemove', this.boundMouseMove);
183
- this.document.addEventListener('mouseup', this.boundMouseUp);
184
- });
287
+ applySizeFromModel() {
288
+ const width = this.width() ?? this.defaultWidth();
289
+ const height = this.height() ?? this.defaultHeight();
290
+ this.applySize(width, height);
185
291
  }
186
- cleanupEventListeners() {
187
- if (this.resizeHandle) {
188
- this.resizeHandle.removeEventListener('mousedown', this.boundMouseDown);
189
- this.resizeHandle.removeEventListener('mouseenter', this.boundMouseEnter);
190
- this.resizeHandle.removeEventListener('mouseleave', this.boundMouseLeave);
191
- this.resizeHandle.removeEventListener('dblclick', this.boundDoubleClick);
192
- this.resizeHandle.remove();
193
- this.resizeHandle = undefined;
194
- }
195
- this.document.removeEventListener('mousemove', this.boundMouseMove);
196
- this.document.removeEventListener('mouseup', this.boundMouseUp);
197
- this.document.body.style.cursor = '';
292
+ applySize(width, height) {
293
+ if (width !== null) {
294
+ this.hostElement.style.width = `${width}px`;
295
+ }
296
+ if (height !== null) {
297
+ this.hostElement.style.height = `${height}px`;
298
+ }
198
299
  }
199
- onMouseDown(event) {
200
- if (!this.resizeHandle)
201
- return;
202
- const handleRect = this.resizeHandle.getBoundingClientRect();
203
- if (event.clientX < handleRect.left || event.clientX > handleRect.right)
300
+ onPointerDown(event) {
301
+ const handleType = this.getHandleType(event);
302
+ const handle = event.currentTarget;
303
+ if (!handleType || !handle) {
204
304
  return;
305
+ }
205
306
  event.preventDefault();
307
+ event.stopPropagation();
308
+ try {
309
+ handle.setPointerCapture?.(event.pointerId);
310
+ }
311
+ catch {
312
+ // Pointer capture can throw for synthetic or inactive pointers.
313
+ }
314
+ this.activeHandle = handleType;
206
315
  this.isResizing.set(true);
207
- this.document.body.style.cursor = STYLES.cursorActive;
208
- this.resizeHandle.style.backgroundColor = STYLES.backgroundColorActive;
209
- this.startMoveWidth = this.hostElement.offsetWidth;
316
+ this.startX = event.clientX;
317
+ this.startY = event.clientY;
318
+ this.startWidth = this.hostElement.offsetWidth;
319
+ this.startHeight = this.hostElement.offsetHeight;
320
+ this.startRatio = this.startHeight > 0 ? this.startWidth / this.startHeight : 1;
321
+ this.document.body.style.cursor = this.getActiveCursor(handleType);
322
+ handle.style.backgroundColor = STYLES.backgroundColorActive;
323
+ const size = { width: this.startWidth, height: this.startHeight };
210
324
  this.zone.run(() => {
211
- this.onResizingStarted.emit({
212
- component: this,
213
- htmlElement: this.hostElement,
214
- isUserInteraction: true,
215
- name: 'resizingStarted',
216
- value: this.startMoveWidth,
217
- oldValue: this.startMoveWidth,
218
- });
325
+ this.onResizingStarted.emit(this.createResizeEvent('resizingStarted', size, size));
219
326
  });
220
327
  }
221
- onMouseMove(event) {
222
- if (!this.isResizing())
328
+ onPointerMove(event) {
329
+ if (!this.isResizing() || !this.activeHandle) {
223
330
  return;
224
- const rect = this.hostElement.getBoundingClientRect();
225
- const isRTL = this.isRTL();
226
- let newWidth = isRTL ? rect.right - event.clientX : event.clientX - rect.left;
227
- newWidth = Math.max(this.minWidth(), Math.min(newWidth, this.maxWidth()));
228
- if (newWidth !== this.hostElement.offsetWidth) {
229
- this.hostElement.style.width = `${newWidth}px`;
230
331
  }
332
+ const axes = getHandleAxes(this.activeHandle);
333
+ const lock = this.lockAspectRatio();
334
+ const next = this.computeSize(event, this.activeHandle);
335
+ event.preventDefault();
336
+ this.applySize(axes.horizontal || lock ? next.width : null, axes.vertical || lock ? next.height : null);
231
337
  }
232
- onMouseUp() {
233
- if (!this.isResizing() || !this.resizeHandle)
338
+ onPointerUp(event) {
339
+ if (!this.isResizing()) {
234
340
  return;
341
+ }
342
+ const handle = event.currentTarget;
343
+ try {
344
+ handle?.releasePointerCapture?.(event.pointerId);
345
+ }
346
+ catch {
347
+ // Pointer capture may already have been released.
348
+ }
349
+ const axes = this.activeHandle ? getHandleAxes(this.activeHandle) : null;
350
+ const current = this.getCurrentSize();
351
+ const oldSize = { width: this.startWidth, height: this.startHeight };
235
352
  this.document.body.style.cursor = '';
236
- this.resizeHandle.style.backgroundColor = STYLES.backgroundColor;
237
- const currentWidth = this.hostElement.offsetWidth;
353
+ if (handle) {
354
+ handle.style.backgroundColor = STYLES.backgroundColor;
355
+ }
238
356
  this.zone.run(() => {
239
- this.width.set(currentWidth);
240
- this.onResizingEnded.emit({
241
- component: this,
242
- htmlElement: this.hostElement,
243
- isUserInteraction: true,
244
- name: 'resizingEnded',
245
- value: currentWidth,
246
- oldValue: this.startMoveWidth,
247
- });
357
+ if (axes?.horizontal) {
358
+ this.width.set(current.width);
359
+ }
360
+ if (axes?.vertical) {
361
+ this.height.set(current.height);
362
+ }
363
+ this.onResizingEnded.emit(this.createResizeEvent('resizingEnded', current, oldSize));
248
364
  });
249
- this.isResizing.set(false);
365
+ this.stopResizing();
250
366
  }
251
- onMouseEnter() {
252
- if (!this.isResizing() && this.resizeHandle) {
253
- this.resizeHandle.style.backgroundColor = STYLES.backgroundColorHover;
367
+ onPointerEnter(event) {
368
+ if (this.isResizing()) {
369
+ return;
370
+ }
371
+ const handle = event.currentTarget;
372
+ if (handle) {
373
+ handle.style.backgroundColor = STYLES.backgroundColorHover;
254
374
  }
255
375
  }
256
- onMouseLeave() {
257
- if (!this.isResizing() && this.resizeHandle) {
258
- this.resizeHandle.style.backgroundColor = STYLES.backgroundColor;
376
+ onPointerLeave(event) {
377
+ if (this.isResizing()) {
378
+ return;
379
+ }
380
+ const handle = event.currentTarget;
381
+ if (handle) {
382
+ handle.style.backgroundColor = STYLES.backgroundColor;
259
383
  }
260
384
  }
261
- onDoubleClick() {
262
- const elementWidth = this.hostElement.offsetWidth;
385
+ onDoubleClick(event) {
386
+ const handleType = this.getHandleType(event);
387
+ if (!handleType) {
388
+ return;
389
+ }
390
+ event.preventDefault();
391
+ const axes = getHandleAxes(handleType);
392
+ const oldSize = this.getCurrentSize();
263
393
  const action = this.dblClickAction();
264
- let newWidth;
394
+ let size;
265
395
  switch (action) {
266
396
  case 'reset':
267
- newWidth = this.resetToInitialWidth();
397
+ size = this.resetToInitialSize(axes);
268
398
  break;
269
399
  case 'maximize':
270
- newWidth = this.maximizeToMaxWidth();
400
+ size = this.maximizeToMaxSize(axes);
271
401
  break;
272
402
  case 'fit':
273
- newWidth = this.fitToContent();
403
+ size = this.fitToContent(axes);
274
404
  break;
275
405
  default:
276
- newWidth = elementWidth;
406
+ size = oldSize;
277
407
  }
278
408
  this.zone.run(() => {
279
- this.onResizingDblClick.emit({
280
- component: this,
281
- htmlElement: this.hostElement,
282
- isUserInteraction: true,
283
- name: 'onResizingDblClick',
284
- oldValue: elementWidth,
285
- value: newWidth,
286
- });
409
+ this.onResizingDblClick.emit(this.createResizeEvent('onResizingDblClick', size, oldSize));
287
410
  });
288
411
  }
289
- resetToInitialWidth() {
290
- const defaultWidth = this.defaultWidth();
291
- if (defaultWidth !== null) {
292
- this.applyElementWidth(defaultWidth);
293
- return defaultWidth;
412
+ computeSize(event, handle) {
413
+ const dx = event.clientX - this.startX;
414
+ const dy = event.clientY - this.startY;
415
+ const rtl = this.isRTL();
416
+ const axes = getHandleAxes(handle);
417
+ const lock = this.lockAspectRatio();
418
+ let width = this.startWidth;
419
+ let height = this.startHeight;
420
+ if (axes.horizontal === 'end') {
421
+ width = this.startWidth + (rtl ? -dx : dx);
422
+ }
423
+ else if (axes.horizontal === 'start') {
424
+ width = this.startWidth + (rtl ? dx : -dx);
425
+ }
426
+ if (axes.vertical === 'bottom') {
427
+ height = this.startHeight + dy;
428
+ }
429
+ else if (axes.vertical === 'top') {
430
+ height = this.startHeight - dy;
431
+ }
432
+ if (lock) {
433
+ const ratio = this.startRatio > 0 ? this.startRatio : 1;
434
+ if (axes.horizontal && axes.vertical) {
435
+ const widthDelta = Math.abs(width - this.startWidth);
436
+ const heightDelta = Math.abs(height - this.startHeight);
437
+ if (widthDelta >= heightDelta) {
438
+ height = width / ratio;
439
+ }
440
+ else {
441
+ width = height * ratio;
442
+ }
443
+ }
444
+ else if (axes.horizontal) {
445
+ height = width / ratio;
446
+ }
447
+ else if (axes.vertical) {
448
+ width = height * ratio;
449
+ }
450
+ }
451
+ return this.clampSize(width, height, lock);
452
+ }
453
+ clampSize(width, height, lock) {
454
+ const minW = this.minWidth();
455
+ const maxW = this.maxWidth();
456
+ const minH = this.minHeight();
457
+ const maxH = this.maxHeight();
458
+ if (!lock) {
459
+ return {
460
+ width: Math.max(minW, Math.min(width, maxW)),
461
+ height: Math.max(minH, Math.min(height, maxH)),
462
+ };
463
+ }
464
+ const ratio = this.startRatio > 0 ? this.startRatio : 1;
465
+ width = Math.max(minW, width);
466
+ height = width / ratio;
467
+ if (height < minH) {
468
+ height = minH;
469
+ width = height * ratio;
470
+ }
471
+ if (width > maxW) {
472
+ width = maxW;
473
+ height = width / ratio;
474
+ }
475
+ if (height > maxH) {
476
+ height = maxH;
477
+ width = height * ratio;
478
+ }
479
+ if (width < minW) {
480
+ width = minW;
481
+ height = width / ratio;
482
+ }
483
+ if (height < minH) {
484
+ height = minH;
485
+ width = height * ratio;
486
+ }
487
+ return {
488
+ width: Math.max(minW, Math.min(width, maxW)),
489
+ height: Math.max(minH, Math.min(height, maxH)),
490
+ };
491
+ }
492
+ resetToInitialSize(axes) {
493
+ const size = this.getCurrentSize();
494
+ if (axes.horizontal) {
495
+ const next = this.defaultWidth() ?? this.width() ?? this.initialElementWidth;
496
+ this.applySize(next, null);
497
+ size.width = next;
498
+ }
499
+ if (axes.vertical) {
500
+ const next = this.defaultHeight() ?? this.height() ?? this.initialElementHeight;
501
+ this.applySize(null, next);
502
+ size.height = next;
503
+ }
504
+ return size;
505
+ }
506
+ maximizeToMaxSize(axes) {
507
+ const size = this.getCurrentSize();
508
+ if (axes.horizontal && this.maxWidth() !== Infinity) {
509
+ this.applySize(this.maxWidth(), null);
510
+ size.width = this.maxWidth();
511
+ }
512
+ if (axes.vertical && this.maxHeight() !== Infinity) {
513
+ this.applySize(null, this.maxHeight());
514
+ size.height = this.maxHeight();
515
+ }
516
+ return size;
517
+ }
518
+ fitToContent(axes) {
519
+ if (axes.horizontal) {
520
+ this.hostElement.style.width = 'fit-content';
521
+ }
522
+ if (axes.vertical) {
523
+ this.hostElement.style.height = 'fit-content';
524
+ }
525
+ return this.getCurrentSize();
526
+ }
527
+ getCurrentSize() {
528
+ return {
529
+ width: this.hostElement.offsetWidth,
530
+ height: this.hostElement.offsetHeight,
531
+ };
532
+ }
533
+ createResizeEvent(name, size, oldSize) {
534
+ return {
535
+ component: this,
536
+ htmlElement: this.hostElement,
537
+ isUserInteraction: true,
538
+ name,
539
+ value: size.width,
540
+ oldValue: oldSize.width,
541
+ size,
542
+ oldSize,
543
+ };
544
+ }
545
+ getHandleType(event) {
546
+ const target = event.currentTarget;
547
+ const value = target?.dataset['axResizeHandle'];
548
+ return value ?? null;
549
+ }
550
+ getCursorForHandle(type) {
551
+ if (type === 'start' || type === 'end') {
552
+ return STYLES.cursorHorizontal;
294
553
  }
295
- const initialWidth = this.width();
296
- if (initialWidth !== null) {
297
- this.applyElementWidth(initialWidth);
298
- return initialWidth;
554
+ if (type === 'top' || type === 'bottom') {
555
+ return STYLES.cursorVertical;
299
556
  }
300
- this.applyElementWidth(this.initialElementWidth);
301
- return this.initialElementWidth;
557
+ const nwseInLtr = type === 'bottom-end' || type === 'top-start';
558
+ const useNwse = this.isRTL() ? !nwseInLtr : nwseInLtr;
559
+ return useNwse ? STYLES.cursorCorner : STYLES.cursorCornerAlt;
302
560
  }
303
- maximizeToMaxWidth() {
304
- const maxWidth = this.maxWidth();
305
- if (maxWidth !== Infinity) {
306
- this.applyElementWidth(maxWidth);
561
+ getActiveCursor(type) {
562
+ if (type === 'start' || type === 'end') {
563
+ return STYLES.cursorActive;
307
564
  }
308
- return maxWidth;
565
+ return this.getCursorForHandle(type);
309
566
  }
310
- fitToContent() {
311
- this.hostElement.style.width = 'fit-content';
312
- return this.hostElement.clientWidth;
567
+ stopResizing() {
568
+ this.activeHandle = null;
569
+ this.isResizing.set(false);
313
570
  }
314
571
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXResizableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
315
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.6", type: AXResizableDirective, isStandalone: true, selector: "[axResizable]", inputs: { axResizable: { classPropertyName: "axResizable", publicName: "axResizable", isSignal: true, isRequired: false, transformFunction: null }, minWidth: { classPropertyName: "minWidth", publicName: "minWidth", isSignal: true, isRequired: false, transformFunction: null }, maxWidth: { classPropertyName: "maxWidth", publicName: "maxWidth", isSignal: true, isRequired: false, transformFunction: null }, dblClickAction: { classPropertyName: "dblClickAction", publicName: "dblClickAction", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, defaultWidth: { classPropertyName: "defaultWidth", publicName: "defaultWidth", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { axResizable: "axResizableChange", minWidth: "minWidthChange", maxWidth: "maxWidthChange", dblClickAction: "dblClickActionChange", width: "widthChange", defaultWidth: "defaultWidthChange", onResizingStarted: "onResizingStarted", onResizingEnded: "onResizingEnded", onResizingDblClick: "onResizingDblClick" }, ngImport: i0 }); }
572
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.6", type: AXResizableDirective, isStandalone: true, selector: "[axResizable]", inputs: { axResizable: { classPropertyName: "axResizable", publicName: "axResizable", isSignal: true, isRequired: false, transformFunction: null }, handles: { classPropertyName: "handles", publicName: "handles", isSignal: true, isRequired: false, transformFunction: null }, minWidth: { classPropertyName: "minWidth", publicName: "minWidth", isSignal: true, isRequired: false, transformFunction: null }, maxWidth: { classPropertyName: "maxWidth", publicName: "maxWidth", isSignal: true, isRequired: false, transformFunction: null }, minHeight: { classPropertyName: "minHeight", publicName: "minHeight", isSignal: true, isRequired: false, transformFunction: null }, maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: false, transformFunction: null }, dblClickAction: { classPropertyName: "dblClickAction", publicName: "dblClickAction", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, defaultWidth: { classPropertyName: "defaultWidth", publicName: "defaultWidth", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, defaultHeight: { classPropertyName: "defaultHeight", publicName: "defaultHeight", isSignal: true, isRequired: false, transformFunction: null }, lockAspectRatio: { classPropertyName: "lockAspectRatio", publicName: "lockAspectRatio", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { axResizable: "axResizableChange", handles: "handlesChange", minWidth: "minWidthChange", maxWidth: "maxWidthChange", minHeight: "minHeightChange", maxHeight: "maxHeightChange", dblClickAction: "dblClickActionChange", width: "widthChange", defaultWidth: "defaultWidthChange", height: "heightChange", defaultHeight: "defaultHeightChange", lockAspectRatio: "lockAspectRatioChange", onResizingStarted: "onResizingStarted", onResizingEnded: "onResizingEnded", onResizingDblClick: "onResizingDblClick" }, ngImport: i0 }); }
316
573
  }
317
574
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXResizableDirective, decorators: [{
318
575
  type: Directive,
319
576
  args: [{
320
577
  selector: '[axResizable]',
321
578
  }]
322
- }], ctorParameters: () => [], propDecorators: { axResizable: [{ type: i0.Input, args: [{ isSignal: true, alias: "axResizable", required: false }] }, { type: i0.Output, args: ["axResizableChange"] }], minWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "minWidth", required: false }] }, { type: i0.Output, args: ["minWidthChange"] }], maxWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxWidth", required: false }] }, { type: i0.Output, args: ["maxWidthChange"] }], dblClickAction: [{ type: i0.Input, args: [{ isSignal: true, alias: "dblClickAction", required: false }] }, { type: i0.Output, args: ["dblClickActionChange"] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }, { type: i0.Output, args: ["widthChange"] }], defaultWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultWidth", required: false }] }, { type: i0.Output, args: ["defaultWidthChange"] }], onResizingStarted: [{ type: i0.Output, args: ["onResizingStarted"] }], onResizingEnded: [{ type: i0.Output, args: ["onResizingEnded"] }], onResizingDblClick: [{ type: i0.Output, args: ["onResizingDblClick"] }] } });
579
+ }], ctorParameters: () => [], propDecorators: { axResizable: [{ type: i0.Input, args: [{ isSignal: true, alias: "axResizable", required: false }] }, { type: i0.Output, args: ["axResizableChange"] }], handles: [{ type: i0.Input, args: [{ isSignal: true, alias: "handles", required: false }] }, { type: i0.Output, args: ["handlesChange"] }], minWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "minWidth", required: false }] }, { type: i0.Output, args: ["minWidthChange"] }], maxWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxWidth", required: false }] }, { type: i0.Output, args: ["maxWidthChange"] }], minHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "minHeight", required: false }] }, { type: i0.Output, args: ["minHeightChange"] }], maxHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxHeight", required: false }] }, { type: i0.Output, args: ["maxHeightChange"] }], dblClickAction: [{ type: i0.Input, args: [{ isSignal: true, alias: "dblClickAction", required: false }] }, { type: i0.Output, args: ["dblClickActionChange"] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }, { type: i0.Output, args: ["widthChange"] }], defaultWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultWidth", required: false }] }, { type: i0.Output, args: ["defaultWidthChange"] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }, { type: i0.Output, args: ["heightChange"] }], defaultHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultHeight", required: false }] }, { type: i0.Output, args: ["defaultHeightChange"] }], lockAspectRatio: [{ type: i0.Input, args: [{ isSignal: true, alias: "lockAspectRatio", required: false }] }, { type: i0.Output, args: ["lockAspectRatioChange"] }], onResizingStarted: [{ type: i0.Output, args: ["onResizingStarted"] }], onResizingEnded: [{ type: i0.Output, args: ["onResizingEnded"] }], onResizingDblClick: [{ type: i0.Output, args: ["onResizingDblClick"] }] } });
580
+ function getHandleAxes(handle) {
581
+ switch (handle) {
582
+ case 'start':
583
+ return { horizontal: 'start', vertical: null };
584
+ case 'end':
585
+ return { horizontal: 'end', vertical: null };
586
+ case 'top':
587
+ return { horizontal: null, vertical: 'top' };
588
+ case 'bottom':
589
+ return { horizontal: null, vertical: 'bottom' };
590
+ case 'top-start':
591
+ return { horizontal: 'start', vertical: 'top' };
592
+ case 'top-end':
593
+ return { horizontal: 'end', vertical: 'top' };
594
+ case 'bottom-start':
595
+ return { horizontal: 'start', vertical: 'bottom' };
596
+ case 'bottom-end':
597
+ return { horizontal: 'end', vertical: 'bottom' };
598
+ }
599
+ }
323
600
  const STYLES = {
324
601
  handlerWidth: 'var(--ax-comp-resizable-handler-width, 4px)',
602
+ handlerHeight: 'var(--ax-comp-resizable-handler-height, 4px)',
603
+ cornerSize: 'var(--ax-comp-resizable-corner-size, 10px)',
325
604
  backgroundColor: 'rgba(var(--ax-comp-resizable-background-color))',
326
605
  backgroundColorActive: 'rgba(var(--ax-comp-resizable-background-color-active, var(--ax-sys-color-primary-surface)))',
327
606
  backgroundColorHover: 'rgba(var(--ax-comp-resizable-background-color-hover, var(--ax-sys-color-primary-light-surface)))',
328
- cursor: 'var(--ax-comp-resizable-cursor, ew-resize)',
607
+ cursorHorizontal: 'var(--ax-comp-resizable-cursor, ew-resize)',
608
+ cursorVertical: 'var(--ax-comp-resizable-cursor-vertical, ns-resize)',
609
+ cursorCorner: 'var(--ax-comp-resizable-cursor-corner, nwse-resize)',
610
+ cursorCornerAlt: 'var(--ax-comp-resizable-cursor-corner-alt, nesw-resize)',
329
611
  cursorActive: 'var(--ax-comp-resizable-cursor-active, ew-resize)',
330
612
  zIndex: 'var(--ax-comp-resizable-z-index, 999)',
613
+ zIndexCorner: 'var(--ax-comp-resizable-z-index-corner, 1000)',
331
614
  transition: 'var(--ax-comp-resizable-transition, background-color --ax-sys-transition-duration --ax-sys-transition-timing-function)',
332
615
  borderRadius: 'var(--ax-comp-resizable-border-radius, --ax-sys-border-radius)',
333
616
  };
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-cdk-resizable.mjs","sources":["../../../../packages/cdk/resizable/src/lib/resize.directive.ts","../../../../packages/cdk/resizable/src/acorex-cdk-resizable.ts"],"sourcesContent":["import { AXPlatform } from '@acorex/core/platform';\nimport { AXHtmlUtil } from '@acorex/core/utils';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n AfterViewInit,\n Directive,\n DOCUMENT,\n effect,\n ElementRef,\n inject,\n model,\n NgZone,\n OnDestroy,\n output,\n PLATFORM_ID,\n signal,\n WritableSignal,\n} from '@angular/core';\nimport { Subscription } from 'rxjs';\n\n@Directive({\n selector: '[axResizable]',\n})\nexport class AXResizableDirective implements AfterViewInit, OnDestroy {\n private readonly el = inject(ElementRef);\n private readonly platformService = inject(AXPlatform);\n private readonly zone = inject(NgZone);\n private readonly document = inject(DOCUMENT);\n private readonly platformID = inject(PLATFORM_ID);\n private readonly isBrowser: boolean;\n \n private hostElement!: HTMLElement;\n private resizeHandle?: HTMLElement;\n private isResizing: WritableSignal<boolean> = signal(false);\n private initialElementWidth = 0;\n private startMoveWidth = 0;\n private subscriptions = new Subscription();\n \n // Bound event handlers to maintain reference for cleanup\n private readonly boundMouseDown = this.onMouseDown.bind(this);\n private readonly boundMouseMove = this.onMouseMove.bind(this);\n private readonly boundMouseUp = this.onMouseUp.bind(this);\n private readonly boundMouseEnter = this.onMouseEnter.bind(this);\n private readonly boundMouseLeave = this.onMouseLeave.bind(this);\n private readonly boundDoubleClick = this.onDoubleClick.bind(this);\n \n private readonly resizeObserver = new ResizeObserver((entries) => {\n const parentElement = this.hostElement.parentElement;\n if (!parentElement) return;\n \n for (const entry of entries) {\n if (entry.target === parentElement && this.maxWidth() === Infinity) {\n this.maxWidth.set(entry.contentRect.width);\n break;\n }\n }\n });\n\n /** Define if directive is active or not */\n axResizable = model(true);\n\n /** Minimum width for the resizable element. */\n minWidth = model(100);\n\n /** Maximum width for the resizable element. Defaults to parent width if not provided. */\n maxWidth = model(Infinity);\n\n /** Behavior on double-click: 'reset' or 'maximize'. */\n dblClickAction = model<'reset' | 'maximize' | 'fit'>('reset');\n\n /** Define initial width for the element. */\n width = model<null | number>(null);\n\n /** Define reset width for the element. */\n defaultWidth = model<null | number>(null);\n\n /** Event emitted when resizing starts. */\n onResizingStarted = output<AXValueChangedEvent<number>>();\n\n /** Event emitted when resizing ends. */\n onResizingEnded = output<AXValueChangedEvent<number>>();\n\n /** Event emitted on double-click. */\n onResizingDblClick = output<AXValueChangedEvent<number>>();\n\n constructor() {\n this.isBrowser = isPlatformBrowser(this.platformID);\n this.hostElement = this.el.nativeElement as HTMLElement;\n \n this.subscriptions.add(\n this.platformService.directionChange.subscribe((i) => {\n this.isRTL.set(i.data === 'rtl');\n if (this.resizeHandle) {\n this.updateHandlePosition();\n }\n })\n );\n\n if (this.isBrowser) {\n effect(() => {\n if (this.isResizing()) {\n return;\n }\n const resolvedWidth = this.width() ?? this.defaultWidth();\n if (resolvedWidth !== null) {\n this.applyElementWidth(resolvedWidth);\n }\n });\n }\n }\n\n ngAfterViewInit(): void {\n if (!this.isBrowser) return;\n \n this.initialElementWidth = this.hostElement.offsetWidth;\n\n this.applyWidthFromModel();\n\n if (this.maxWidth() === Infinity) {\n const parentWidth = this.hostElement.parentElement?.offsetWidth;\n if (parentWidth) {\n this.maxWidth.set(parentWidth);\n }\n }\n \n const parentElement = this.hostElement.parentElement;\n if (parentElement) {\n this.resizeObserver.observe(parentElement);\n }\n \n this.createResizeHandle();\n this.setupResizableState();\n }\n\n ngOnDestroy(): void {\n this.subscriptions.unsubscribe();\n this.resizeObserver.disconnect();\n this.cleanupEventListeners();\n }\n\n private setupResizableState(): void {\n this.subscriptions.add(\n this.axResizable.subscribe((isActive) => {\n if (!isActive) {\n this.applyWidthFromModel();\n this.cleanupEventListeners();\n } else {\n this.applyWidthFromModel();\n this.createResizeHandle();\n }\n })\n );\n }\n\n private applyWidthFromModel(): void {\n const width = this.width();\n if (width !== null) {\n this.applyElementWidth(width);\n return;\n }\n const defaultWidth = this.defaultWidth();\n if (defaultWidth !== null) {\n this.applyElementWidth(defaultWidth);\n }\n }\n\n private applyElementWidth(width: number): void {\n this.hostElement.style.width = `${width}px`;\n }\n\n private createResizeHandle(): void {\n if (!this.axResizable() || this.resizeHandle) return;\n\n this.hostElement.style.position = 'relative';\n\n this.resizeHandle = this.document.createElement('div');\n this.resizeHandle.classList.add('ax-resizable-handler');\n this.hostElement.appendChild(this.resizeHandle);\n\n this.applyHandleStyles();\n this.attachEventListeners();\n }\n \n private applyHandleStyles(): void {\n if (!this.resizeHandle) return;\n \n Object.assign(this.resizeHandle.style, {\n width: STYLES.handlerWidth,\n backgroundColor: STYLES.backgroundColor,\n position: 'absolute',\n top: '0',\n bottom: '0',\n cursor: STYLES.cursor,\n zIndex: STYLES.zIndex,\n transition: STYLES.transition,\n borderRadius: STYLES.borderRadius,\n userSelect: 'none',\n });\n \n this.updateHandlePosition();\n }\n \n private updateHandlePosition(): void {\n if (!this.resizeHandle) return;\n \n const isRTL = this.isRTL();\n if (isRTL) {\n this.resizeHandle.style.left = '0';\n this.resizeHandle.style.right = '';\n } else {\n this.resizeHandle.style.right = '0';\n this.resizeHandle.style.left = '';\n }\n }\n \n private attachEventListeners(): void {\n if (!this.resizeHandle) return;\n \n const handle = this.resizeHandle;\n this.zone.runOutsideAngular(() => {\n handle.addEventListener('mousedown', this.boundMouseDown);\n handle.addEventListener('mouseenter', this.boundMouseEnter);\n handle.addEventListener('mouseleave', this.boundMouseLeave);\n handle.addEventListener('dblclick', this.boundDoubleClick);\n this.document.addEventListener('mousemove', this.boundMouseMove);\n this.document.addEventListener('mouseup', this.boundMouseUp);\n });\n }\n\n private cleanupEventListeners(): void {\n if (this.resizeHandle) {\n this.resizeHandle.removeEventListener('mousedown', this.boundMouseDown);\n this.resizeHandle.removeEventListener('mouseenter', this.boundMouseEnter);\n this.resizeHandle.removeEventListener('mouseleave', this.boundMouseLeave);\n this.resizeHandle.removeEventListener('dblclick', this.boundDoubleClick);\n this.resizeHandle.remove();\n this.resizeHandle = undefined;\n }\n\n this.document.removeEventListener('mousemove', this.boundMouseMove);\n this.document.removeEventListener('mouseup', this.boundMouseUp);\n this.document.body.style.cursor = '';\n }\n\n private isRTL = signal(AXHtmlUtil.isRtl(this.document.documentElement));\n\n private onMouseDown(event: MouseEvent): void {\n if (!this.resizeHandle) return;\n \n const handleRect = this.resizeHandle.getBoundingClientRect();\n if (event.clientX < handleRect.left || event.clientX > handleRect.right) return;\n \n event.preventDefault();\n \n this.isResizing.set(true);\n this.document.body.style.cursor = STYLES.cursorActive;\n this.resizeHandle.style.backgroundColor = STYLES.backgroundColorActive;\n this.startMoveWidth = this.hostElement.offsetWidth;\n \n this.zone.run(() => {\n this.onResizingStarted.emit({\n component: this,\n htmlElement: this.hostElement,\n isUserInteraction: true,\n name: 'resizingStarted',\n value: this.startMoveWidth,\n oldValue: this.startMoveWidth,\n });\n });\n }\n\n private onMouseMove(event: MouseEvent): void {\n if (!this.isResizing()) return;\n \n const rect = this.hostElement.getBoundingClientRect();\n const isRTL = this.isRTL();\n \n let newWidth = isRTL ? rect.right - event.clientX : event.clientX - rect.left;\n newWidth = Math.max(this.minWidth(), Math.min(newWidth, this.maxWidth()));\n\n if (newWidth !== this.hostElement.offsetWidth) {\n this.hostElement.style.width = `${newWidth}px`;\n }\n }\n\n private onMouseUp(): void {\n if (!this.isResizing() || !this.resizeHandle) return;\n\n this.document.body.style.cursor = '';\n this.resizeHandle.style.backgroundColor = STYLES.backgroundColor;\n\n const currentWidth = this.hostElement.offsetWidth;\n\n this.zone.run(() => {\n this.width.set(currentWidth);\n this.onResizingEnded.emit({\n component: this,\n htmlElement: this.hostElement,\n isUserInteraction: true,\n name: 'resizingEnded',\n value: currentWidth,\n oldValue: this.startMoveWidth,\n });\n });\n\n this.isResizing.set(false);\n }\n\n private onMouseEnter(): void {\n if (!this.isResizing() && this.resizeHandle) {\n this.resizeHandle.style.backgroundColor = STYLES.backgroundColorHover;\n }\n }\n\n private onMouseLeave(): void {\n if (!this.isResizing() && this.resizeHandle) {\n this.resizeHandle.style.backgroundColor = STYLES.backgroundColor;\n }\n }\n\n private onDoubleClick(): void {\n const elementWidth = this.hostElement.offsetWidth;\n const action = this.dblClickAction();\n \n let newWidth: number;\n switch (action) {\n case 'reset':\n newWidth = this.resetToInitialWidth();\n break;\n case 'maximize':\n newWidth = this.maximizeToMaxWidth();\n break;\n case 'fit':\n newWidth = this.fitToContent();\n break;\n default:\n newWidth = elementWidth;\n }\n\n this.zone.run(() => {\n this.onResizingDblClick.emit({\n component: this,\n htmlElement: this.hostElement,\n isUserInteraction: true,\n name: 'onResizingDblClick',\n oldValue: elementWidth,\n value: newWidth,\n });\n });\n }\n\n private resetToInitialWidth(): number {\n const defaultWidth = this.defaultWidth();\n if (defaultWidth !== null) {\n this.applyElementWidth(defaultWidth);\n return defaultWidth;\n }\n\n const initialWidth = this.width();\n if (initialWidth !== null) {\n this.applyElementWidth(initialWidth);\n return initialWidth;\n }\n\n this.applyElementWidth(this.initialElementWidth);\n return this.initialElementWidth;\n }\n\n private maximizeToMaxWidth(): number {\n const maxWidth = this.maxWidth();\n if (maxWidth !== Infinity) {\n this.applyElementWidth(maxWidth);\n }\n return maxWidth;\n }\n\n private fitToContent(): number {\n this.hostElement.style.width = 'fit-content';\n return this.hostElement.clientWidth;\n }\n}\n\ninterface AXValueChangedEvent<T> {\n component: unknown;\n htmlElement?: HTMLElement;\n isUserInteraction?: boolean;\n name?: string;\n value?: T;\n oldValue?: T;\n}\n\nconst STYLES = {\n handlerWidth: 'var(--ax-comp-resizable-handler-width, 4px)',\n backgroundColor: 'rgba(var(--ax-comp-resizable-background-color))',\n backgroundColorActive: 'rgba(var(--ax-comp-resizable-background-color-active, var(--ax-sys-color-primary-surface)))',\n backgroundColorHover:\n 'rgba(var(--ax-comp-resizable-background-color-hover, var(--ax-sys-color-primary-light-surface)))',\n cursor: 'var(--ax-comp-resizable-cursor, ew-resize)',\n cursorActive: 'var(--ax-comp-resizable-cursor-active, ew-resize)',\n zIndex: 'var(--ax-comp-resizable-z-index, 999)',\n transition:\n 'var(--ax-comp-resizable-transition, background-color --ax-sys-transition-duration --ax-sys-transition-timing-function)',\n borderRadius: 'var(--ax-comp-resizable-border-radius, --ax-sys-border-radius)',\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAuBa,oBAAoB,CAAA;AA8D/B,IAAA,WAAA,GAAA;AA7DiB,QAAA,IAAA,CAAA,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC;AACvB,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAC,UAAU,CAAC;AACpC,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC;AACrB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;QAKzC,IAAA,CAAA,UAAU,GAA4B,MAAM,CAAC,KAAK;uFAAC;QACnD,IAAA,CAAA,mBAAmB,GAAG,CAAC;QACvB,IAAA,CAAA,cAAc,GAAG,CAAC;AAClB,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,YAAY,EAAE;;QAGzB,IAAA,CAAA,cAAc,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;QAC5C,IAAA,CAAA,cAAc,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;QAC5C,IAAA,CAAA,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;QACxC,IAAA,CAAA,eAAe,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;QAC9C,IAAA,CAAA,eAAe,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;QAC9C,IAAA,CAAA,gBAAgB,GA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;AACjE,IAAA,MAAM,EAAE,uCAAuC;AAC/C,IAAA,UAAU,EACR,wHAAwH;AAC1H,IAAA,YAAY,EAAE,gEAAgE;CAC/E;;ACnZD;;AAEG;;;;"}
1
+ {"version":3,"file":"acorex-cdk-resizable.mjs","sources":["../../../../packages/cdk/resizable/src/lib/resize.directive.ts","../../../../packages/cdk/resizable/src/acorex-cdk-resizable.ts"],"sourcesContent":["import { AXPlatform } from '@acorex/core/platform';\nimport { AXHtmlUtil } from '@acorex/core/utils';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n AfterViewInit,\n Directive,\n DOCUMENT,\n effect,\n ElementRef,\n inject,\n model,\n NgZone,\n OnDestroy,\n output,\n PLATFORM_ID,\n signal,\n WritableSignal,\n} from '@angular/core';\nimport { Subscription } from 'rxjs';\n\nexport type AXResizeHandle =\n | 'start'\n | 'end'\n | 'top'\n | 'bottom'\n | 'top-start'\n | 'top-end'\n | 'bottom-start'\n | 'bottom-end';\n\nexport interface AXResizeSize {\n width: number;\n height: number;\n}\n\n/**\n * Resize event payload. `value` / `oldValue` remain the host width so existing\n * width-only listeners (`AXValueChangedEvent<number>`) keep compiling. Use `size`\n * / `oldSize` when both axes matter.\n */\nexport interface AXResizeChangedEvent {\n component: unknown;\n htmlElement?: HTMLElement;\n isUserInteraction?: boolean;\n name?: string;\n value?: number;\n oldValue?: number;\n size: AXResizeSize;\n oldSize: AXResizeSize;\n}\n\ntype AXResizeAxis = {\n horizontal: 'start' | 'end' | null;\n vertical: 'top' | 'bottom' | null;\n};\n\n@Directive({\n selector: '[axResizable]',\n})\nexport class AXResizableDirective implements AfterViewInit, OnDestroy {\n private readonly el = inject(ElementRef);\n private readonly platformService = inject(AXPlatform);\n private readonly zone = inject(NgZone);\n private readonly document = inject(DOCUMENT);\n private readonly platformID = inject(PLATFORM_ID);\n private readonly isBrowser: boolean;\n\n private hostElement!: HTMLElement;\n private readonly resizeHandles = new Map<AXResizeHandle, HTMLElement>();\n private readonly isResizing: WritableSignal<boolean> = signal(false);\n private activeHandle: AXResizeHandle | null = null;\n private initialElementWidth = 0;\n private initialElementHeight = 0;\n private startX = 0;\n private startY = 0;\n private startWidth = 0;\n private startHeight = 0;\n private startRatio = 1;\n private readonly subscriptions = new Subscription();\n private resizeObserver?: ResizeObserver;\n\n private readonly boundPointerDown = this.onPointerDown.bind(this);\n private readonly boundPointerMove = this.onPointerMove.bind(this);\n private readonly boundPointerUp = this.onPointerUp.bind(this);\n private readonly boundPointerEnter = this.onPointerEnter.bind(this);\n private readonly boundPointerLeave = this.onPointerLeave.bind(this);\n private readonly boundDoubleClick = this.onDoubleClick.bind(this);\n\n private readonly isRTL = signal(false);\n\n /** Define if directive is active or not */\n axResizable = model(true);\n\n /** Logical handles to render. Defaults to the inline-end edge. */\n handles = model<AXResizeHandle[]>(['end']);\n\n /** Minimum width for the resizable element. */\n minWidth = model(100);\n\n /** Maximum width for the resizable element. Defaults to parent width if not provided. */\n maxWidth = model(Infinity);\n\n /** Minimum height for the resizable element. */\n minHeight = model(100);\n\n /** Maximum height for the resizable element. Defaults to parent height if not provided. */\n maxHeight = model(Infinity);\n\n /** Behavior on double-click: 'reset', 'maximize', or 'fit'. */\n dblClickAction = model<'reset' | 'maximize' | 'fit'>('reset');\n\n /** Define initial width for the element. */\n width = model<null | number>(null);\n\n /** Define reset width for the element. */\n defaultWidth = model<null | number>(null);\n\n /** Define initial height for the element. */\n height = model<null | number>(null);\n\n /** Define reset height for the element. */\n defaultHeight = model<null | number>(null);\n\n /** Lock the element's aspect ratio from the size captured at pointer-down. */\n lockAspectRatio = model(false);\n\n /** Event emitted when resizing starts. */\n onResizingStarted = output<AXResizeChangedEvent>();\n\n /** Event emitted when resizing ends. */\n onResizingEnded = output<AXResizeChangedEvent>();\n\n /** Event emitted on double-click. */\n onResizingDblClick = output<AXResizeChangedEvent>();\n\n constructor() {\n this.isBrowser = isPlatformBrowser(this.platformID);\n this.hostElement = this.el.nativeElement as HTMLElement;\n this.isRTL.set(AXHtmlUtil.isRtl(this.document.documentElement));\n\n this.subscriptions.add(\n this.platformService.directionChange.subscribe((i) => {\n this.isRTL.set(i.data === 'rtl');\n }),\n );\n\n if (!this.isBrowser) {\n return;\n }\n\n this.resizeObserver = new ResizeObserver((entries) => {\n const parentElement = this.hostElement.parentElement;\n if (!parentElement) {\n return;\n }\n\n for (const entry of entries) {\n if (entry.target !== parentElement) {\n continue;\n }\n if (this.maxWidth() === Infinity) {\n this.maxWidth.set(entry.contentRect.width);\n }\n if (this.maxHeight() === Infinity) {\n this.maxHeight.set(entry.contentRect.height);\n }\n }\n });\n\n effect(() => {\n const isActive = this.axResizable();\n const handles = this.handles();\n this.reconcileHandles(isActive, handles);\n });\n\n effect(() => {\n this.isRTL();\n this.updateAllHandlePositions();\n });\n\n effect(() => {\n if (this.isResizing()) {\n return;\n }\n this.applySizeFromModel();\n });\n }\n\n ngAfterViewInit(): void {\n if (!this.isBrowser) {\n return;\n }\n\n this.initialElementWidth = this.hostElement.offsetWidth;\n this.initialElementHeight = this.hostElement.offsetHeight;\n this.applySizeFromModel();\n\n const parentElement = this.hostElement.parentElement;\n if (this.maxWidth() === Infinity) {\n const parentWidth = parentElement?.offsetWidth;\n if (parentWidth) {\n this.maxWidth.set(parentWidth);\n }\n }\n if (this.maxHeight() === Infinity) {\n const parentHeight = parentElement?.offsetHeight;\n if (parentHeight) {\n this.maxHeight.set(parentHeight);\n }\n }\n\n if (parentElement) {\n this.resizeObserver?.observe(parentElement);\n }\n }\n\n ngOnDestroy(): void {\n this.subscriptions.unsubscribe();\n this.resizeObserver?.disconnect();\n this.destroyAllHandles();\n this.document.body.style.cursor = '';\n }\n\n private reconcileHandles(isActive: boolean, handles: AXResizeHandle[]): void {\n if (!this.isBrowser) {\n return;\n }\n\n if (!isActive) {\n this.stopResizing();\n this.destroyAllHandles();\n this.applySizeFromModel();\n return;\n }\n\n this.hostElement.style.position = 'relative';\n\n const unique = [...new Set(handles)];\n const desired = new Set(unique);\n\n for (const [type, element] of this.resizeHandles) {\n if (!desired.has(type)) {\n this.destroyHandle(type, element);\n }\n }\n\n for (const type of unique) {\n if (!this.resizeHandles.has(type)) {\n this.createHandle(type);\n }\n }\n }\n\n private createHandle(type: AXResizeHandle): void {\n const handle = this.document.createElement('div');\n handle.classList.add('ax-resizable-handler', `ax-resizable-handler--${type}`);\n handle.dataset['axResizeHandle'] = type;\n this.hostElement.appendChild(handle);\n this.applyHandleStyles(handle, type);\n this.attachHandleListeners(handle);\n this.resizeHandles.set(type, handle);\n }\n\n private attachHandleListeners(handle: HTMLElement): void {\n this.zone.runOutsideAngular(() => {\n handle.addEventListener('pointerdown', this.boundPointerDown);\n handle.addEventListener('pointermove', this.boundPointerMove);\n handle.addEventListener('pointerup', this.boundPointerUp);\n handle.addEventListener('pointercancel', this.boundPointerUp);\n handle.addEventListener('pointerenter', this.boundPointerEnter);\n handle.addEventListener('pointerleave', this.boundPointerLeave);\n handle.addEventListener('dblclick', this.boundDoubleClick);\n });\n }\n\n private destroyHandle(type: AXResizeHandle, handle: HTMLElement): void {\n handle.removeEventListener('pointerdown', this.boundPointerDown);\n handle.removeEventListener('pointermove', this.boundPointerMove);\n handle.removeEventListener('pointerup', this.boundPointerUp);\n handle.removeEventListener('pointercancel', this.boundPointerUp);\n handle.removeEventListener('pointerenter', this.boundPointerEnter);\n handle.removeEventListener('pointerleave', this.boundPointerLeave);\n handle.removeEventListener('dblclick', this.boundDoubleClick);\n handle.remove();\n this.resizeHandles.delete(type);\n }\n\n private destroyAllHandles(): void {\n for (const [type, handle] of [...this.resizeHandles]) {\n this.destroyHandle(type, handle);\n }\n }\n\n private applyHandleStyles(handle: HTMLElement, type: AXResizeHandle): void {\n const isCorner = type.includes('-');\n\n Object.assign(handle.style, {\n position: 'absolute',\n backgroundColor: STYLES.backgroundColor,\n zIndex: isCorner ? STYLES.zIndexCorner : STYLES.zIndex,\n transition: STYLES.transition,\n borderRadius: STYLES.borderRadius,\n userSelect: 'none',\n touchAction: 'none',\n cursor: this.getCursorForHandle(type),\n left: '',\n right: '',\n top: '',\n bottom: '',\n width: '',\n height: '',\n });\n\n this.positionHandle(handle, type);\n }\n\n private updateAllHandlePositions(): void {\n for (const [type, handle] of this.resizeHandles) {\n handle.style.cursor = this.getCursorForHandle(type);\n this.positionHandle(handle, type);\n }\n }\n\n private positionHandle(handle: HTMLElement, type: AXResizeHandle): void {\n const rtl = this.isRTL();\n\n switch (type) {\n case 'start':\n case 'end':\n handle.style.top = '0';\n handle.style.bottom = '0';\n handle.style.width = STYLES.handlerWidth;\n this.applyInlineSide(handle, type, rtl);\n break;\n case 'top':\n case 'bottom':\n handle.style.left = '0';\n handle.style.right = '0';\n handle.style.height = STYLES.handlerHeight;\n if (type === 'top') {\n handle.style.top = '0';\n handle.style.bottom = '';\n } else {\n handle.style.bottom = '0';\n handle.style.top = '';\n }\n break;\n default: {\n const [vertical, horizontal] = type.split('-') as ['top' | 'bottom', 'start' | 'end'];\n handle.style.width = STYLES.cornerSize;\n handle.style.height = STYLES.cornerSize;\n if (vertical === 'top') {\n handle.style.top = '0';\n handle.style.bottom = '';\n } else {\n handle.style.bottom = '0';\n handle.style.top = '';\n }\n this.applyInlineSide(handle, horizontal, rtl);\n break;\n }\n }\n }\n\n private applyInlineSide(element: HTMLElement, side: 'start' | 'end', rtl: boolean): void {\n const physicalLeft = (side === 'start' && !rtl) || (side === 'end' && rtl);\n if (physicalLeft) {\n element.style.left = '0';\n element.style.right = '';\n } else {\n element.style.right = '0';\n element.style.left = '';\n }\n }\n\n private applySizeFromModel(): void {\n const width = this.width() ?? this.defaultWidth();\n const height = this.height() ?? this.defaultHeight();\n this.applySize(width, height);\n }\n\n private applySize(width: number | null, height: number | null): void {\n if (width !== null) {\n this.hostElement.style.width = `${width}px`;\n }\n if (height !== null) {\n this.hostElement.style.height = `${height}px`;\n }\n }\n\n private onPointerDown(event: PointerEvent): void {\n const handleType = this.getHandleType(event);\n const handle = event.currentTarget as HTMLElement | null;\n if (!handleType || !handle) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n try {\n handle.setPointerCapture?.(event.pointerId);\n } catch {\n // Pointer capture can throw for synthetic or inactive pointers.\n }\n\n this.activeHandle = handleType;\n this.isResizing.set(true);\n this.startX = event.clientX;\n this.startY = event.clientY;\n this.startWidth = this.hostElement.offsetWidth;\n this.startHeight = this.hostElement.offsetHeight;\n this.startRatio = this.startHeight > 0 ? this.startWidth / this.startHeight : 1;\n\n this.document.body.style.cursor = this.getActiveCursor(handleType);\n handle.style.backgroundColor = STYLES.backgroundColorActive;\n\n const size: AXResizeSize = { width: this.startWidth, height: this.startHeight };\n this.zone.run(() => {\n this.onResizingStarted.emit(this.createResizeEvent('resizingStarted', size, size));\n });\n }\n\n private onPointerMove(event: PointerEvent): void {\n if (!this.isResizing() || !this.activeHandle) {\n return;\n }\n\n const axes = getHandleAxes(this.activeHandle);\n const lock = this.lockAspectRatio();\n const next = this.computeSize(event, this.activeHandle);\n event.preventDefault();\n this.applySize(\n axes.horizontal || lock ? next.width : null,\n axes.vertical || lock ? next.height : null,\n );\n }\n\n private onPointerUp(event: PointerEvent): void {\n if (!this.isResizing()) {\n return;\n }\n\n const handle = event.currentTarget as HTMLElement | null;\n try {\n handle?.releasePointerCapture?.(event.pointerId);\n } catch {\n // Pointer capture may already have been released.\n }\n\n const axes = this.activeHandle ? getHandleAxes(this.activeHandle) : null;\n const current = this.getCurrentSize();\n const oldSize: AXResizeSize = { width: this.startWidth, height: this.startHeight };\n\n this.document.body.style.cursor = '';\n if (handle) {\n handle.style.backgroundColor = STYLES.backgroundColor;\n }\n\n this.zone.run(() => {\n if (axes?.horizontal) {\n this.width.set(current.width);\n }\n if (axes?.vertical) {\n this.height.set(current.height);\n }\n this.onResizingEnded.emit(this.createResizeEvent('resizingEnded', current, oldSize));\n });\n\n this.stopResizing();\n }\n\n private onPointerEnter(event: PointerEvent): void {\n if (this.isResizing()) {\n return;\n }\n const handle = event.currentTarget as HTMLElement | null;\n if (handle) {\n handle.style.backgroundColor = STYLES.backgroundColorHover;\n }\n }\n\n private onPointerLeave(event: PointerEvent): void {\n if (this.isResizing()) {\n return;\n }\n const handle = event.currentTarget as HTMLElement | null;\n if (handle) {\n handle.style.backgroundColor = STYLES.backgroundColor;\n }\n }\n\n private onDoubleClick(event: MouseEvent): void {\n const handleType = this.getHandleType(event);\n if (!handleType) {\n return;\n }\n\n event.preventDefault();\n\n const axes = getHandleAxes(handleType);\n const oldSize = this.getCurrentSize();\n const action = this.dblClickAction();\n\n let size: AXResizeSize;\n switch (action) {\n case 'reset':\n size = this.resetToInitialSize(axes);\n break;\n case 'maximize':\n size = this.maximizeToMaxSize(axes);\n break;\n case 'fit':\n size = this.fitToContent(axes);\n break;\n default:\n size = oldSize;\n }\n\n this.zone.run(() => {\n this.onResizingDblClick.emit(this.createResizeEvent('onResizingDblClick', size, oldSize));\n });\n }\n\n private computeSize(event: PointerEvent, handle: AXResizeHandle): AXResizeSize {\n const dx = event.clientX - this.startX;\n const dy = event.clientY - this.startY;\n const rtl = this.isRTL();\n const axes = getHandleAxes(handle);\n const lock = this.lockAspectRatio();\n\n let width = this.startWidth;\n let height = this.startHeight;\n\n if (axes.horizontal === 'end') {\n width = this.startWidth + (rtl ? -dx : dx);\n } else if (axes.horizontal === 'start') {\n width = this.startWidth + (rtl ? dx : -dx);\n }\n\n if (axes.vertical === 'bottom') {\n height = this.startHeight + dy;\n } else if (axes.vertical === 'top') {\n height = this.startHeight - dy;\n }\n\n if (lock) {\n const ratio = this.startRatio > 0 ? this.startRatio : 1;\n if (axes.horizontal && axes.vertical) {\n const widthDelta = Math.abs(width - this.startWidth);\n const heightDelta = Math.abs(height - this.startHeight);\n if (widthDelta >= heightDelta) {\n height = width / ratio;\n } else {\n width = height * ratio;\n }\n } else if (axes.horizontal) {\n height = width / ratio;\n } else if (axes.vertical) {\n width = height * ratio;\n }\n }\n\n return this.clampSize(width, height, lock);\n }\n\n private clampSize(width: number, height: number, lock: boolean): AXResizeSize {\n const minW = this.minWidth();\n const maxW = this.maxWidth();\n const minH = this.minHeight();\n const maxH = this.maxHeight();\n\n if (!lock) {\n return {\n width: Math.max(minW, Math.min(width, maxW)),\n height: Math.max(minH, Math.min(height, maxH)),\n };\n }\n\n const ratio = this.startRatio > 0 ? this.startRatio : 1;\n width = Math.max(minW, width);\n height = width / ratio;\n\n if (height < minH) {\n height = minH;\n width = height * ratio;\n }\n if (width > maxW) {\n width = maxW;\n height = width / ratio;\n }\n if (height > maxH) {\n height = maxH;\n width = height * ratio;\n }\n if (width < minW) {\n width = minW;\n height = width / ratio;\n }\n if (height < minH) {\n height = minH;\n width = height * ratio;\n }\n\n return {\n width: Math.max(minW, Math.min(width, maxW)),\n height: Math.max(minH, Math.min(height, maxH)),\n };\n }\n\n private resetToInitialSize(axes: AXResizeAxis): AXResizeSize {\n const size = this.getCurrentSize();\n\n if (axes.horizontal) {\n const next = this.defaultWidth() ?? this.width() ?? this.initialElementWidth;\n this.applySize(next, null);\n size.width = next;\n }\n if (axes.vertical) {\n const next = this.defaultHeight() ?? this.height() ?? this.initialElementHeight;\n this.applySize(null, next);\n size.height = next;\n }\n\n return size;\n }\n\n private maximizeToMaxSize(axes: AXResizeAxis): AXResizeSize {\n const size = this.getCurrentSize();\n\n if (axes.horizontal && this.maxWidth() !== Infinity) {\n this.applySize(this.maxWidth(), null);\n size.width = this.maxWidth();\n }\n if (axes.vertical && this.maxHeight() !== Infinity) {\n this.applySize(null, this.maxHeight());\n size.height = this.maxHeight();\n }\n\n return size;\n }\n\n private fitToContent(axes: AXResizeAxis): AXResizeSize {\n if (axes.horizontal) {\n this.hostElement.style.width = 'fit-content';\n }\n if (axes.vertical) {\n this.hostElement.style.height = 'fit-content';\n }\n return this.getCurrentSize();\n }\n\n private getCurrentSize(): AXResizeSize {\n return {\n width: this.hostElement.offsetWidth,\n height: this.hostElement.offsetHeight,\n };\n }\n\n private createResizeEvent(name: string, size: AXResizeSize, oldSize: AXResizeSize): AXResizeChangedEvent {\n return {\n component: this,\n htmlElement: this.hostElement,\n isUserInteraction: true,\n name,\n value: size.width,\n oldValue: oldSize.width,\n size,\n oldSize,\n };\n }\n\n private getHandleType(event: Event): AXResizeHandle | null {\n const target = event.currentTarget as HTMLElement | null;\n const value = target?.dataset['axResizeHandle'] as AXResizeHandle | undefined;\n return value ?? null;\n }\n\n private getCursorForHandle(type: AXResizeHandle): string {\n if (type === 'start' || type === 'end') {\n return STYLES.cursorHorizontal;\n }\n if (type === 'top' || type === 'bottom') {\n return STYLES.cursorVertical;\n }\n\n const nwseInLtr = type === 'bottom-end' || type === 'top-start';\n const useNwse = this.isRTL() ? !nwseInLtr : nwseInLtr;\n return useNwse ? STYLES.cursorCorner : STYLES.cursorCornerAlt;\n }\n\n private getActiveCursor(type: AXResizeHandle): string {\n if (type === 'start' || type === 'end') {\n return STYLES.cursorActive;\n }\n return this.getCursorForHandle(type);\n }\n\n private stopResizing(): void {\n this.activeHandle = null;\n this.isResizing.set(false);\n }\n}\n\nfunction getHandleAxes(handle: AXResizeHandle): AXResizeAxis {\n switch (handle) {\n case 'start':\n return { horizontal: 'start', vertical: null };\n case 'end':\n return { horizontal: 'end', vertical: null };\n case 'top':\n return { horizontal: null, vertical: 'top' };\n case 'bottom':\n return { horizontal: null, vertical: 'bottom' };\n case 'top-start':\n return { horizontal: 'start', vertical: 'top' };\n case 'top-end':\n return { horizontal: 'end', vertical: 'top' };\n case 'bottom-start':\n return { horizontal: 'start', vertical: 'bottom' };\n case 'bottom-end':\n return { horizontal: 'end', vertical: 'bottom' };\n }\n}\n\nconst STYLES = {\n handlerWidth: 'var(--ax-comp-resizable-handler-width, 4px)',\n handlerHeight: 'var(--ax-comp-resizable-handler-height, 4px)',\n cornerSize: 'var(--ax-comp-resizable-corner-size, 10px)',\n backgroundColor: 'rgba(var(--ax-comp-resizable-background-color))',\n backgroundColorActive: 'rgba(var(--ax-comp-resizable-background-color-active, var(--ax-sys-color-primary-surface)))',\n backgroundColorHover:\n 'rgba(var(--ax-comp-resizable-background-color-hover, var(--ax-sys-color-primary-light-surface)))',\n cursorHorizontal: 'var(--ax-comp-resizable-cursor, ew-resize)',\n cursorVertical: 'var(--ax-comp-resizable-cursor-vertical, ns-resize)',\n cursorCorner: 'var(--ax-comp-resizable-cursor-corner, nwse-resize)',\n cursorCornerAlt: 'var(--ax-comp-resizable-cursor-corner-alt, nesw-resize)',\n cursorActive: 'var(--ax-comp-resizable-cursor-active, ew-resize)',\n zIndex: 'var(--ax-comp-resizable-z-index, 999)',\n zIndexCorner: 'var(--ax-comp-resizable-z-index-corner, 1000)',\n transition:\n 'var(--ax-comp-resizable-transition, background-color --ax-sys-transition-duration --ax-sys-transition-timing-function)',\n borderRadius: 'var(--ax-comp-resizable-border-radius, --ax-sys-border-radius)',\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MA2Da,oBAAoB,CAAA;AA4E/B,IAAA,WAAA,GAAA;AA3EiB,QAAA,IAAA,CAAA,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC;AACvB,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAC,UAAU,CAAC;AACpC,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC;AACrB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;AAIhC,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,GAAG,EAA+B;QACtD,IAAA,CAAA,UAAU,GAA4B,MAAM,CAAC,KAAK;uFAAC;QAC5D,IAAA,CAAA,YAAY,GAA0B,IAAI;QAC1C,IAAA,CAAA,mBAAmB,GAAG,CAAC;QACvB,IAAA,CAAA,oBAAoB,GAAG,CAAC;QACxB,IAAA,CAAA,MAAM,GAAG,CAAC;QACV,IAAA,CAAA,MAAM,GAAG,CAAC;QACV,IAAA,CAAA,UAAU,GAAG,CAAC;QACd,I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AAG;AACb,IAAA,YAAY,EAAE,6CAA6C;AAC3D,IAAA,aAAa,EAAE,8CAA8C;AAC7D,IAAA,UAAU,EAAE,4CAA4C;AACxD,IAAA,eAAe,EAAE,iDAAiD;AAClE,IAAA,qBAAqB,EAAE,6FAA6F;AACpH,IAAA,oBAAoB,EAClB,kGAAkG;AACpG,IAAA,gBAAgB,EAAE,4CAA4C;AAC9D,IAAA,cAAc,EAAE,qDAAqD;AACrE,IAAA,YAAY,EAAE,qDAAqD;AACnE,IAAA,eAAe,EAAE,yDAAyD;AAC1E,IAAA,YAAY,EAAE,mDAAmD;AACjE,IAAA,MAAM,EAAE,uCAAuC;AAC/C,IAAA,YAAY,EAAE,+CAA+C;AAC7D,IAAA,UAAU,EACR,wHAAwH;AAC1H,IAAA,YAAY,EAAE,gEAAgE;CAC/E;;ACvuBD;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@acorex/cdk",
3
- "version": "22.3.2",
3
+ "version": "22.3.4",
4
4
  "peerDependencies": {
5
- "@acorex/core": "22.3.2",
5
+ "@acorex/core": "22.3.4",
6
6
  "quill": ">=2.0.2",
7
7
  "qrcode": ">=1.5.4",
8
8
  "swiper": ">=11.1.15",
@@ -1,6 +1,26 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { AfterViewInit, OnDestroy } from '@angular/core';
3
3
 
4
+ type AXResizeHandle = 'start' | 'end' | 'top' | 'bottom' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';
5
+ interface AXResizeSize {
6
+ width: number;
7
+ height: number;
8
+ }
9
+ /**
10
+ * Resize event payload. `value` / `oldValue` remain the host width so existing
11
+ * width-only listeners (`AXValueChangedEvent<number>`) keep compiling. Use `size`
12
+ * / `oldSize` when both axes matter.
13
+ */
14
+ interface AXResizeChangedEvent {
15
+ component: unknown;
16
+ htmlElement?: HTMLElement;
17
+ isUserInteraction?: boolean;
18
+ name?: string;
19
+ value?: number;
20
+ oldValue?: number;
21
+ size: AXResizeSize;
22
+ oldSize: AXResizeSize;
23
+ }
4
24
  declare class AXResizableDirective implements AfterViewInit, OnDestroy {
5
25
  private readonly el;
6
26
  private readonly platformService;
@@ -9,67 +29,89 @@ declare class AXResizableDirective implements AfterViewInit, OnDestroy {
9
29
  private readonly platformID;
10
30
  private readonly isBrowser;
11
31
  private hostElement;
12
- private resizeHandle?;
13
- private isResizing;
32
+ private readonly resizeHandles;
33
+ private readonly isResizing;
34
+ private activeHandle;
14
35
  private initialElementWidth;
15
- private startMoveWidth;
16
- private subscriptions;
17
- private readonly boundMouseDown;
18
- private readonly boundMouseMove;
19
- private readonly boundMouseUp;
20
- private readonly boundMouseEnter;
21
- private readonly boundMouseLeave;
36
+ private initialElementHeight;
37
+ private startX;
38
+ private startY;
39
+ private startWidth;
40
+ private startHeight;
41
+ private startRatio;
42
+ private readonly subscriptions;
43
+ private resizeObserver?;
44
+ private readonly boundPointerDown;
45
+ private readonly boundPointerMove;
46
+ private readonly boundPointerUp;
47
+ private readonly boundPointerEnter;
48
+ private readonly boundPointerLeave;
22
49
  private readonly boundDoubleClick;
23
- private readonly resizeObserver;
50
+ private readonly isRTL;
24
51
  /** Define if directive is active or not */
25
52
  axResizable: _angular_core.ModelSignal<boolean>;
53
+ /** Logical handles to render. Defaults to the inline-end edge. */
54
+ handles: _angular_core.ModelSignal<AXResizeHandle[]>;
26
55
  /** Minimum width for the resizable element. */
27
56
  minWidth: _angular_core.ModelSignal<number>;
28
57
  /** Maximum width for the resizable element. Defaults to parent width if not provided. */
29
58
  maxWidth: _angular_core.ModelSignal<number>;
30
- /** Behavior on double-click: 'reset' or 'maximize'. */
59
+ /** Minimum height for the resizable element. */
60
+ minHeight: _angular_core.ModelSignal<number>;
61
+ /** Maximum height for the resizable element. Defaults to parent height if not provided. */
62
+ maxHeight: _angular_core.ModelSignal<number>;
63
+ /** Behavior on double-click: 'reset', 'maximize', or 'fit'. */
31
64
  dblClickAction: _angular_core.ModelSignal<"reset" | "maximize" | "fit">;
32
65
  /** Define initial width for the element. */
33
66
  width: _angular_core.ModelSignal<number>;
34
67
  /** Define reset width for the element. */
35
68
  defaultWidth: _angular_core.ModelSignal<number>;
69
+ /** Define initial height for the element. */
70
+ height: _angular_core.ModelSignal<number>;
71
+ /** Define reset height for the element. */
72
+ defaultHeight: _angular_core.ModelSignal<number>;
73
+ /** Lock the element's aspect ratio from the size captured at pointer-down. */
74
+ lockAspectRatio: _angular_core.ModelSignal<boolean>;
36
75
  /** Event emitted when resizing starts. */
37
- onResizingStarted: _angular_core.OutputEmitterRef<AXValueChangedEvent<number>>;
76
+ onResizingStarted: _angular_core.OutputEmitterRef<AXResizeChangedEvent>;
38
77
  /** Event emitted when resizing ends. */
39
- onResizingEnded: _angular_core.OutputEmitterRef<AXValueChangedEvent<number>>;
78
+ onResizingEnded: _angular_core.OutputEmitterRef<AXResizeChangedEvent>;
40
79
  /** Event emitted on double-click. */
41
- onResizingDblClick: _angular_core.OutputEmitterRef<AXValueChangedEvent<number>>;
80
+ onResizingDblClick: _angular_core.OutputEmitterRef<AXResizeChangedEvent>;
42
81
  constructor();
43
82
  ngAfterViewInit(): void;
44
83
  ngOnDestroy(): void;
45
- private setupResizableState;
46
- private applyWidthFromModel;
47
- private applyElementWidth;
48
- private createResizeHandle;
84
+ private reconcileHandles;
85
+ private createHandle;
86
+ private attachHandleListeners;
87
+ private destroyHandle;
88
+ private destroyAllHandles;
49
89
  private applyHandleStyles;
50
- private updateHandlePosition;
51
- private attachEventListeners;
52
- private cleanupEventListeners;
53
- private isRTL;
54
- private onMouseDown;
55
- private onMouseMove;
56
- private onMouseUp;
57
- private onMouseEnter;
58
- private onMouseLeave;
90
+ private updateAllHandlePositions;
91
+ private positionHandle;
92
+ private applyInlineSide;
93
+ private applySizeFromModel;
94
+ private applySize;
95
+ private onPointerDown;
96
+ private onPointerMove;
97
+ private onPointerUp;
98
+ private onPointerEnter;
99
+ private onPointerLeave;
59
100
  private onDoubleClick;
60
- private resetToInitialWidth;
61
- private maximizeToMaxWidth;
101
+ private computeSize;
102
+ private clampSize;
103
+ private resetToInitialSize;
104
+ private maximizeToMaxSize;
62
105
  private fitToContent;
106
+ private getCurrentSize;
107
+ private createResizeEvent;
108
+ private getHandleType;
109
+ private getCursorForHandle;
110
+ private getActiveCursor;
111
+ private stopResizing;
63
112
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXResizableDirective, never>;
64
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AXResizableDirective, "[axResizable]", never, { "axResizable": { "alias": "axResizable"; "required": false; "isSignal": true; }; "minWidth": { "alias": "minWidth"; "required": false; "isSignal": true; }; "maxWidth": { "alias": "maxWidth"; "required": false; "isSignal": true; }; "dblClickAction": { "alias": "dblClickAction"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "defaultWidth": { "alias": "defaultWidth"; "required": false; "isSignal": true; }; }, { "axResizable": "axResizableChange"; "minWidth": "minWidthChange"; "maxWidth": "maxWidthChange"; "dblClickAction": "dblClickActionChange"; "width": "widthChange"; "defaultWidth": "defaultWidthChange"; "onResizingStarted": "onResizingStarted"; "onResizingEnded": "onResizingEnded"; "onResizingDblClick": "onResizingDblClick"; }, never, never, true, never>;
65
- }
66
- interface AXValueChangedEvent<T> {
67
- component: unknown;
68
- htmlElement?: HTMLElement;
69
- isUserInteraction?: boolean;
70
- name?: string;
71
- value?: T;
72
- oldValue?: T;
113
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AXResizableDirective, "[axResizable]", never, { "axResizable": { "alias": "axResizable"; "required": false; "isSignal": true; }; "handles": { "alias": "handles"; "required": false; "isSignal": true; }; "minWidth": { "alias": "minWidth"; "required": false; "isSignal": true; }; "maxWidth": { "alias": "maxWidth"; "required": false; "isSignal": true; }; "minHeight": { "alias": "minHeight"; "required": false; "isSignal": true; }; "maxHeight": { "alias": "maxHeight"; "required": false; "isSignal": true; }; "dblClickAction": { "alias": "dblClickAction"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "defaultWidth": { "alias": "defaultWidth"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "defaultHeight": { "alias": "defaultHeight"; "required": false; "isSignal": true; }; "lockAspectRatio": { "alias": "lockAspectRatio"; "required": false; "isSignal": true; }; }, { "axResizable": "axResizableChange"; "handles": "handlesChange"; "minWidth": "minWidthChange"; "maxWidth": "maxWidthChange"; "minHeight": "minHeightChange"; "maxHeight": "maxHeightChange"; "dblClickAction": "dblClickActionChange"; "width": "widthChange"; "defaultWidth": "defaultWidthChange"; "height": "heightChange"; "defaultHeight": "defaultHeightChange"; "lockAspectRatio": "lockAspectRatioChange"; "onResizingStarted": "onResizingStarted"; "onResizingEnded": "onResizingEnded"; "onResizingDblClick": "onResizingDblClick"; }, never, never, true, never>;
73
114
  }
74
115
 
75
116
  export { AXResizableDirective };
117
+ export type { AXResizeChangedEvent, AXResizeHandle, AXResizeSize };