@acorex/components 22.0.0-next.33 → 22.0.0-next.34

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.
@@ -155,6 +155,7 @@ function readAllowedSizesFromElement(element) {
155
155
  }
156
156
  }
157
157
  const AX_GRID_LAYOUT_RESIZE_INVALID_CLASS = 'ax-grid-layout-resize-invalid';
158
+ const AX_GRID_LAYOUT_RESIZE_PREV_SIZE_ATTR = 'data-ax-resize-prev-size';
158
159
  function isExactAllowedSize(width, height, allowedSizes) {
159
160
  const safeWidth = Number.isFinite(width) && width > 0 ? Math.round(width) : 1;
160
161
  const safeHeight = Number.isFinite(height) && height > 0 ? Math.round(height) : 1;
@@ -178,6 +179,38 @@ function clearResizeValidityMarkers(gridEl) {
178
179
  el.classList.remove(AX_GRID_LAYOUT_RESIZE_INVALID_CLASS);
179
180
  });
180
181
  }
182
+ function storeResizeStartSize(element) {
183
+ const node = element.gridstackNode;
184
+ if (!node) {
185
+ return;
186
+ }
187
+ const width = node.w ?? 1;
188
+ const height = node.h ?? 1;
189
+ element.setAttribute(AX_GRID_LAYOUT_RESIZE_PREV_SIZE_ATTR, JSON.stringify([width, height]));
190
+ }
191
+ function clearResizeStartSize(element) {
192
+ element.removeAttribute(AX_GRID_LAYOUT_RESIZE_PREV_SIZE_ATTR);
193
+ }
194
+ function readResizeStartSize(element) {
195
+ const raw = element.getAttribute(AX_GRID_LAYOUT_RESIZE_PREV_SIZE_ATTR);
196
+ if (!raw) {
197
+ return undefined;
198
+ }
199
+ try {
200
+ const parsed = JSON.parse(raw);
201
+ if (!Array.isArray(parsed) || parsed.length !== 2) {
202
+ return undefined;
203
+ }
204
+ const [width, height] = parsed;
205
+ if (!Number.isFinite(width) || !Number.isFinite(height) || width <= 0 || height <= 0) {
206
+ return undefined;
207
+ }
208
+ return [width, height];
209
+ }
210
+ catch {
211
+ return undefined;
212
+ }
213
+ }
181
214
  function snapToAllowedSize(width, height, allowedSizes) {
182
215
  const safeWidth = Number.isFinite(width) && width > 0 ? width : 1;
183
216
  const safeHeight = Number.isFinite(height) && height > 0 ? height : 1;
@@ -229,6 +262,31 @@ function snapElementToAllowedSize(grid, element) {
229
262
  grid.update(element, { w: width, h: height });
230
263
  return true;
231
264
  }
265
+ function revertElementToAllowedSizeIfInvalid(grid, element) {
266
+ const allowedSizes = readAllowedSizesFromElement(element);
267
+ if (!allowedSizes?.length) {
268
+ return false;
269
+ }
270
+ const node = element.gridstackNode;
271
+ if (!node) {
272
+ return false;
273
+ }
274
+ const currentWidth = node.w ?? 1;
275
+ const currentHeight = node.h ?? 1;
276
+ if (isExactAllowedSize(currentWidth, currentHeight, allowedSizes)) {
277
+ return false;
278
+ }
279
+ const previousSize = readResizeStartSize(element);
280
+ if (!previousSize) {
281
+ return false;
282
+ }
283
+ const [width, height] = previousSize;
284
+ if (node.w === width && node.h === height) {
285
+ return false;
286
+ }
287
+ grid.update(element, { w: width, h: height });
288
+ return true;
289
+ }
232
290
 
233
291
  class AXGridLayoutWidgetComponent {
234
292
  constructor() {
@@ -483,6 +541,7 @@ class AXGridLayoutContainerComponent extends NXComponent {
483
541
  if (!this.grid) {
484
542
  return;
485
543
  }
544
+ storeResizeStartSize(element);
486
545
  updateResizeValidityMarkers(this.grid.el, element);
487
546
  })
488
547
  .on('resize', (_event, element) => {
@@ -496,8 +555,9 @@ class AXGridLayoutContainerComponent extends NXComponent {
496
555
  return;
497
556
  }
498
557
  clearResizeValidityMarkers(this.grid.el);
499
- const didSnap = snapElementToAllowedSize(this.grid, element);
500
- if (didSnap) {
558
+ const didRevert = revertElementToAllowedSizeIfInvalid(this.grid, element);
559
+ clearResizeStartSize(element);
560
+ if (didRevert) {
501
561
  this._dispatchChangeEvent();
502
562
  }
503
563
  });
@@ -719,5 +779,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
719
779
  * Generated bundle index. Do not edit.
720
780
  */
721
781
 
722
- export { AXGridLayoutBuilderModule, AXGridLayoutContainerComponent, AXGridLayoutWidgetComponent, AX_GRID_LAYOUT_ALLOWED_SIZES_ATTR, AX_GRID_LAYOUT_RESIZE_INVALID_CLASS, clearResizeValidityMarkers, convertAXGridLayoutNodeToGridStackNode, convertAXGridLayoutOptionsToGridStackOptions, convertAXGridLayoutWidgetToGridStackWidget, convertGridStackNodeToAXGridLayoutNode, convertGridStackOptionsToAXGridLayoutOptions, convertGridStackWidgetToAXGridLayoutWidget, deriveMinMaxFromAllowedSizes, isExactAllowedSize, normalizeLayoutNodeWithAllowedSizes, readAllowedSizesFromElement, removeUndefinedKeys, snapElementToAllowedSize, snapToAllowedSize, updateResizeValidityMarkers, writeAllowedSizesToElement };
782
+ export { AXGridLayoutBuilderModule, AXGridLayoutContainerComponent, AXGridLayoutWidgetComponent, AX_GRID_LAYOUT_ALLOWED_SIZES_ATTR, AX_GRID_LAYOUT_RESIZE_INVALID_CLASS, AX_GRID_LAYOUT_RESIZE_PREV_SIZE_ATTR, clearResizeStartSize, clearResizeValidityMarkers, convertAXGridLayoutNodeToGridStackNode, convertAXGridLayoutOptionsToGridStackOptions, convertAXGridLayoutWidgetToGridStackWidget, convertGridStackNodeToAXGridLayoutNode, convertGridStackOptionsToAXGridLayoutOptions, convertGridStackWidgetToAXGridLayoutWidget, deriveMinMaxFromAllowedSizes, isExactAllowedSize, normalizeLayoutNodeWithAllowedSizes, readAllowedSizesFromElement, readResizeStartSize, removeUndefinedKeys, revertElementToAllowedSizeIfInvalid, snapElementToAllowedSize, snapToAllowedSize, storeResizeStartSize, updateResizeValidityMarkers, writeAllowedSizesToElement };
723
783
  //# sourceMappingURL=acorex-components-grid-layout-builder.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-components-grid-layout-builder.mjs","sources":["../../../../packages/components/grid-layout-builder/src/lib/utility.ts","../../../../packages/components/grid-layout-builder/src/lib/grid-layout-widget.component.ts","../../../../packages/components/grid-layout-builder/src/lib/grid-layout-container.component.ts","../../../../packages/components/grid-layout-builder/src/lib/grid-layout-builder.module.ts","../../../../packages/components/grid-layout-builder/src/acorex-components-grid-layout-builder.ts"],"sourcesContent":["import { AXGridLayoutNode, AXGridLayoutOptions, AXGridLayoutSize, AXGridLayoutWidget } from './types';\n\nexport const AX_GRID_LAYOUT_ALLOWED_SIZES_ATTR = 'data-ax-allowed-sizes';\n\n// Convert AXGridLayoutWidget to GridStackWidget\nexport function convertAXGridLayoutWidgetToGridStackWidget(\n widget: AXGridLayoutWidget,\n): import('gridstack').GridStackWidget {\n const normalized = normalizeLayoutNodeWithAllowedSizes(widget);\n\n return {\n id: normalized.id,\n x: normalized.x,\n y: normalized.y,\n w: normalized.width,\n h: normalized.height,\n maxW: normalized.maxWidth,\n maxH: normalized.maxHeight,\n minW: normalized.minWidth,\n minH: normalized.minHeight,\n noResize: normalized.disableResize,\n noMove: normalized.disableDrag,\n };\n}\n\n// Convert GridStackWidget to AXGridLayoutWidget\nexport function convertGridStackWidgetToAXGridLayoutWidget(\n widget: import('gridstack').GridStackWidget,\n): AXGridLayoutWidget {\n return {\n id: widget.id,\n x: widget.x,\n y: widget.y,\n width: widget.w,\n height: widget.h,\n maxWidth: widget.maxW,\n maxHeight: widget.maxH,\n minWidth: widget.minW,\n minHeight: widget.minH,\n disableResize: widget.noResize,\n disableDrag: widget.noMove,\n };\n}\n\n// Convert AXGridLayoutNode to GridStackNode\nexport function convertAXGridLayoutNodeToGridStackNode(node: AXGridLayoutNode): import('gridstack').GridStackNode {\n const normalized = normalizeLayoutNodeWithAllowedSizes(node);\n\n return {\n id: normalized.id,\n x: normalized.x,\n y: normalized.y,\n w: normalized.width,\n h: normalized.height,\n maxW: normalized.maxWidth,\n maxH: normalized.maxHeight,\n minW: normalized.minWidth,\n minH: normalized.minHeight,\n noResize: normalized.disableResize,\n noMove: normalized.disableDrag,\n el: normalized.element,\n };\n}\n\n// Convert GridStackNode to AXGridLayoutNode\nexport function convertGridStackNodeToAXGridLayoutNode(node: import('gridstack').GridStackNode): AXGridLayoutNode {\n const element = node.el;\n const allowedSizes = element ? readAllowedSizesFromElement(element) : undefined;\n\n return {\n id: node.id,\n x: node.x,\n y: node.y,\n width: node.w,\n height: node.h,\n maxWidth: node.maxW,\n maxHeight: node.maxH,\n minWidth: node.minW,\n minHeight: node.minH,\n disableResize: node.noResize,\n disableDrag: node.noMove,\n allowedSizes,\n element,\n };\n}\n\n// Convert AXGridLayoutOptions to GridStackOptions\nexport function convertAXGridLayoutOptionsToGridStackOptions(\n options: AXGridLayoutOptions,\n): import('gridstack').GridStackOptions {\n return {\n column: options.column,\n disableDrag: options.disableDrag,\n disableResize: options.disableResize,\n margin: options.gap,\n cellHeight: options.cellHeight,\n rtl: options.rtl,\n maxRow: options.maxRow,\n minRow: options.minRow,\n row: options.row,\n removable: options.removableSelector || options.removable,\n acceptWidgets: options.acceptWidgets,\n float: options.float,\n handle: options.dragHandlerSelector,\n columnOpts: { breakpoints: options?.responsiveLayout?.map((i) => ({ c: i.column, w: i.width })) },\n };\n}\n\n// Convert GridStackOptions to AXGridLayoutOptions\nexport function convertGridStackOptionsToAXGridLayoutOptions(\n options: import('gridstack').GridStackOptions,\n): AXGridLayoutOptions {\n return {\n column: options.column,\n disableDrag: options.disableDrag,\n disableResize: options.disableResize,\n gap: options.margin,\n cellHeight: options.cellHeight,\n rtl: options.rtl,\n maxRow: options.maxRow,\n minRow: options.minRow,\n row: options.row,\n removableSelector: typeof options.removable === 'string' ? options.removable : undefined,\n removable: typeof options.removable === 'boolean' ? options.removable : undefined,\n acceptWidgets: options.acceptWidgets as boolean,\n float: options.float,\n dragHandlerSelector: options.handle,\n responsiveLayout: options?.columnOpts?.breakpoints?.map((i) => ({ width: i.w, column: i.c })),\n };\n}\n\n/** remove keys which are undefined */\nexport function removeUndefinedKeys<T extends object>(obj: T): T {\n const newObj = { ...obj } as Record<string, unknown>;\n for (const key in newObj) {\n if (newObj[key] === undefined) {\n delete newObj[key];\n }\n }\n return newObj as T;\n}\n\nexport function writeAllowedSizesToElement(\n element: HTMLElement | undefined,\n allowedSizes: readonly AXGridLayoutSize[] | undefined,\n): void {\n if (!element) {\n return;\n }\n\n if (!allowedSizes?.length) {\n element.removeAttribute(AX_GRID_LAYOUT_ALLOWED_SIZES_ATTR);\n return;\n }\n\n element.setAttribute(AX_GRID_LAYOUT_ALLOWED_SIZES_ATTR, JSON.stringify(allowedSizes));\n}\n\nexport function readAllowedSizesFromElement(element: HTMLElement): readonly AXGridLayoutSize[] | undefined {\n const raw = element.getAttribute(AX_GRID_LAYOUT_ALLOWED_SIZES_ATTR);\n if (!raw) {\n return undefined;\n }\n\n try {\n const parsed = JSON.parse(raw) as unknown;\n if (!Array.isArray(parsed) || parsed.length === 0) {\n return undefined;\n }\n\n const sizes = parsed\n .filter((entry): entry is [number, number] => Array.isArray(entry) && entry.length === 2)\n .map(([width, height]) => [Number(width), Number(height)] as const)\n .filter(([width, height]) => Number.isFinite(width) && Number.isFinite(height) && width > 0 && height > 0);\n\n return sizes.length > 0 ? sizes : undefined;\n } catch {\n return undefined;\n }\n}\n\nexport const AX_GRID_LAYOUT_RESIZE_INVALID_CLASS = 'ax-grid-layout-resize-invalid';\n\nexport function isExactAllowedSize(\n width: number,\n height: number,\n allowedSizes: readonly AXGridLayoutSize[],\n): boolean {\n const safeWidth = Number.isFinite(width) && width > 0 ? Math.round(width) : 1;\n const safeHeight = Number.isFinite(height) && height > 0 ? Math.round(height) : 1;\n\n return allowedSizes.some(([w, h]) => w === safeWidth && h === safeHeight);\n}\n\nexport function updateResizeValidityMarkers(\n gridEl: HTMLElement,\n element: import('gridstack').GridItemHTMLElement,\n): void {\n const allowedSizes = readAllowedSizesFromElement(element);\n if (!allowedSizes?.length) {\n clearResizeValidityMarkers(gridEl);\n return;\n }\n\n const node = element.gridstackNode;\n const isValid = isExactAllowedSize(node?.w ?? 1, node?.h ?? 1, allowedSizes);\n\n element.classList.toggle(AX_GRID_LAYOUT_RESIZE_INVALID_CLASS, !isValid);\n gridEl\n .querySelector('.grid-stack-placeholder')\n ?.classList.toggle(AX_GRID_LAYOUT_RESIZE_INVALID_CLASS, !isValid);\n}\n\nexport function clearResizeValidityMarkers(gridEl: HTMLElement): void {\n gridEl.querySelectorAll(`.${AX_GRID_LAYOUT_RESIZE_INVALID_CLASS}`).forEach((el) => {\n el.classList.remove(AX_GRID_LAYOUT_RESIZE_INVALID_CLASS);\n });\n}\n\nexport function snapToAllowedSize(\n width: number,\n height: number,\n allowedSizes: readonly AXGridLayoutSize[],\n): AXGridLayoutSize {\n const safeWidth = Number.isFinite(width) && width > 0 ? width : 1;\n const safeHeight = Number.isFinite(height) && height > 0 ? height : 1;\n\n return allowedSizes.reduce<AXGridLayoutSize>((best, size) => {\n const bestDistance = (best[0] - safeWidth) ** 2 + (best[1] - safeHeight) ** 2;\n const nextDistance = (size[0] - safeWidth) ** 2 + (size[1] - safeHeight) ** 2;\n return nextDistance < bestDistance ? size : best;\n }, allowedSizes[0]);\n}\n\nexport function deriveMinMaxFromAllowedSizes(allowedSizes: readonly AXGridLayoutSize[]): Pick<\n AXGridLayoutWidget,\n 'minWidth' | 'maxWidth' | 'minHeight' | 'maxHeight'\n> {\n const widths = allowedSizes.map(([width]) => width);\n const heights = allowedSizes.map(([, height]) => height);\n\n return {\n minWidth: Math.min(...widths),\n maxWidth: Math.max(...widths),\n minHeight: Math.min(...heights),\n maxHeight: Math.max(...heights),\n };\n}\n\nexport function normalizeLayoutNodeWithAllowedSizes<T extends AXGridLayoutWidget>(node: T): T {\n if (!node.allowedSizes?.length) {\n return node;\n }\n\n const [width, height] = snapToAllowedSize(node.width ?? 1, node.height ?? 1, node.allowedSizes);\n const bounds = deriveMinMaxFromAllowedSizes(node.allowedSizes);\n\n return {\n ...node,\n width,\n height,\n minWidth: bounds.minWidth,\n maxWidth: bounds.maxWidth,\n minHeight: bounds.minHeight,\n maxHeight: bounds.maxHeight,\n };\n}\n\nexport function snapElementToAllowedSize(\n grid: import('gridstack').GridStack,\n element: import('gridstack').GridItemHTMLElement,\n): boolean {\n const allowedSizes = readAllowedSizesFromElement(element);\n if (!allowedSizes?.length) {\n return false;\n }\n\n const node = element.gridstackNode;\n if (!node) {\n return false;\n }\n\n const [width, height] = snapToAllowedSize(node.w ?? 1, node.h ?? 1, allowedSizes);\n if (node.w === width && node.h === height) {\n return false;\n }\n\n grid.update(element, { w: width, h: height });\n return true;\n}\n","import { AXComponent } from '@acorex/cdk/common';\nimport { Component, effect, ElementRef, inject, input, untracked, ViewEncapsulation } from '@angular/core';\nimport { AXGridLayoutNode, AXGridLayoutWidget, AXGridLayoutWidgetElement } from './types';\nimport {\n convertAXGridLayoutWidgetToGridStackWidget,\n convertGridStackNodeToAXGridLayoutNode,\n normalizeLayoutNodeWithAllowedSizes,\n removeUndefinedKeys,\n writeAllowedSizesToElement,\n} from './utility';\n\n@Component({\n selector: 'ax-grid-layout-widget',\n template: `<div class=\"grid-stack-item-content\"><ng-content></ng-content></div>`,\n\n encapsulation: ViewEncapsulation.None,\n providers: [{ provide: AXComponent, useExisting: AXGridLayoutWidgetComponent }],\n})\nexport class AXGridLayoutWidgetComponent {\n private readonly elementRef: ElementRef<AXGridLayoutWidgetElement> = inject(ElementRef);\n\n public options = input<AXGridLayoutNode>();\n\n #eff = effect(() => {\n const options = this.options();\n\n untracked(() => {\n const element = this.elementRef.nativeElement;\n const normalized = options ? normalizeLayoutNodeWithAllowedSizes(options) : undefined;\n writeAllowedSizesToElement(element, normalized?.allowedSizes);\n\n const gridstackNode = element.gridstackNode as import('gridstack').GridStackNode;\n if (gridstackNode?.grid && normalized) {\n gridstackNode.grid.update(\n element,\n removeUndefinedKeys(convertAXGridLayoutWidgetToGridStackWidget(normalized)),\n );\n }\n });\n });\n\n /**\n * Locks or unlocks the widget (prevents dragging and resizing).\n *\n * @param state - If true, the widget will be locked.\n * @returns void - No return value. The widget lock state is updated.\n */\n public setLockable(state: boolean): void {\n this.updateWidgetOptions({ disableResize: state, disableDrag: state });\n }\n\n /**\n * Enables or disables resizing of the widget.\n *\n * @param state - If true, resizing will be enabled.\n * @returns void - No return value. The widget resize state is updated.\n */\n public setResizable(state: boolean): void {\n this.updateWidgetOptions({ disableResize: !state });\n }\n\n /**\n * Updates the widget options.\n *\n * @param options - The new options for the widget.\n * @returns void - No return value. The widget options are updated.\n */\n public setOptions(options: AXGridLayoutWidget): void {\n this.updateWidgetOptions(options);\n }\n\n /**\n * Returns the current options of the widget.\n *\n * @returns AXGridLayoutNode - The current widget options.\n */\n public getOptions(): AXGridLayoutNode {\n const gridstackNode = this.elementRef.nativeElement.gridstackNode;\n return gridstackNode\n ? removeUndefinedKeys(convertGridStackNodeToAXGridLayoutNode(gridstackNode))\n : { ...this.options(), element: this.elementRef.nativeElement };\n }\n\n /**\n * Returns the widget options from the Angular input binding (stored/desired positions),\n * bypassing the live gridstackNode which may have been auto-reflowed.\n * Used by the container to load correct per-breakpoint layouts after column changes.\n *\n * @returns AXGridLayoutNode - The widget options from the input signal.\n */\n public getInputOptions(): AXGridLayoutNode {\n const opts = this.options();\n const normalized = opts ? normalizeLayoutNodeWithAllowedSizes(opts) : undefined;\n return normalized\n ? { ...normalized, element: this.elementRef.nativeElement }\n : { element: this.elementRef.nativeElement };\n }\n\n /**\n * Returns the native DOM element of the widget.\n *\n * @returns AXGridLayoutWidgetElement - The native element.\n */\n public get element(): AXGridLayoutWidgetElement {\n return this.elementRef.nativeElement;\n }\n\n /**\n * Updates the widget options and triggers a grid update.\n * @param options - The partial options to update.\n */\n private updateWidgetOptions(options: Partial<AXGridLayoutWidget>): void {\n const gridstackNode = this.elementRef.nativeElement.gridstackNode as import('gridstack').GridStackNode;\n if (gridstackNode?.grid) {\n gridstackNode.grid.update(\n this.elementRef.nativeElement,\n removeUndefinedKeys(convertAXGridLayoutWidgetToGridStackWidget(options)),\n );\n }\n }\n}\n","import { AXComponent, NXComponent } from '@acorex/cdk/common';\nimport {\n Component,\n ContentChildren,\n ElementRef,\n NgZone,\n OnDestroy,\n QueryList,\n ViewEncapsulation,\n afterNextRender,\n effect,\n inject,\n input,\n model,\n output,\n untracked,\n} from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { AXGridLayoutWidgetComponent } from './grid-layout-widget.component';\nimport {\n AXGridLayout,\n AXGridLayoutContainerElement,\n AXGridLayoutEvent,\n AXGridLayoutNode,\n AXGridLayoutOptions,\n AXGridLayoutPosition,\n AXGridLayoutWidget,\n AXGridLayoutWidgetElement,\n} from './types';\nimport {\n convertAXGridLayoutNodeToGridStackNode,\n convertAXGridLayoutOptionsToGridStackOptions,\n convertAXGridLayoutWidgetToGridStackWidget,\n convertGridStackNodeToAXGridLayoutNode,\n convertGridStackOptionsToAXGridLayoutOptions,\n clearResizeValidityMarkers,\n normalizeLayoutNodeWithAllowedSizes,\n removeUndefinedKeys,\n snapElementToAllowedSize,\n updateResizeValidityMarkers,\n writeAllowedSizesToElement,\n} from './utility';\n\n@Component({\n selector: 'ax-grid-layout-container',\n template: `<ng-content></ng-content> `,\n styleUrl: './grid-layout-container.css',\n\n encapsulation: ViewEncapsulation.None,\n providers: [{ provide: AXComponent, useExisting: AXGridLayoutContainerComponent }],\n})\nexport class AXGridLayoutContainerComponent extends NXComponent implements OnDestroy {\n //#region Inputs and Outputs\n public options = input<AXGridLayoutOptions>();\n\n protected onAdded = output<AXGridLayoutEvent>();\n protected onRemoved = output<AXGridLayoutEvent>();\n protected onWidgetChange = output<AXGridLayoutEvent>();\n protected onChange = output<AXGridLayoutEvent>();\n protected onRender = output<void>();\n\n protected isEmpty = model(false);\n //#endregion\n\n //#region Private Properties\n private readonly elementRef: ElementRef<AXGridLayoutContainerElement> = inject(ElementRef);\n private readonly ngZone = inject(NgZone);\n\n @ContentChildren(AXGridLayoutWidgetComponent) public gridstackItems?: QueryList<AXGridLayoutWidgetComponent>;\n\n private el = this.elementRef.nativeElement;\n private grid?: AXGridLayout;\n protected _sub: Subscription | undefined;\n private isInitialized = false;\n //#endregion\n\n //#region Initialization\n #init = afterNextRender(() => {\n this.ngZone.runOutsideAngular(async () => {\n const { GridStack } = await import('gridstack');\n const gridStackOptions = removeUndefinedKeys(convertAXGridLayoutOptionsToGridStackOptions(this.options() ?? {}));\n this.grid = GridStack.init(gridStackOptions, this.el);\n this.updateAll();\n this.hookEvents(this.grid);\n this.onRender.emit();\n this.isInitialized = true;\n });\n this._sub = this.gridstackItems?.changes.subscribe(() => {\n this.updateAll();\n });\n });\n\n // Watch for options changes\n #optionsEffect = effect(() => {\n const newOptions = this.options();\n if (this.isInitialized && this.grid && newOptions) {\n untracked(() => {\n this.ngZone.runOutsideAngular(() => {\n const gridStackOptions = removeUndefinedKeys(convertAXGridLayoutOptionsToGridStackOptions(newOptions));\n\n const column = gridStackOptions.column;\n\n // Detect whether the column count is changing — requires loading from stored input positions\n const isColumnChange = typeof column === 'number' && column !== this.grid?.opts?.column;\n\n // Use 'none' layout mode to prevent GridStack from auto-reflowing widget positions.\n // The correct per-breakpoint positions will be loaded explicitly via updateAll(true).\n if (typeof column === 'number') {\n this.grid?.column(column, 'none');\n }\n\n if (gridStackOptions.cellHeight !== undefined) {\n this.grid?.cellHeight(gridStackOptions.cellHeight);\n }\n\n if (gridStackOptions.margin !== undefined) {\n this.grid?.margin(gridStackOptions.margin);\n }\n\n if (gridStackOptions.disableResize !== undefined) {\n this.grid?.enableResize(!gridStackOptions.disableResize);\n }\n\n if (gridStackOptions.disableDrag !== undefined) {\n this.grid?.enableMove(!gridStackOptions.disableDrag);\n }\n\n if (gridStackOptions.float !== undefined) {\n this.grid?.float(gridStackOptions.float);\n }\n\n if (gridStackOptions.animate !== undefined) {\n this.grid?.setAnimation(gridStackOptions.animate);\n }\n\n // When column count changes, read from Angular inputs (stored per-breakpoint positions)\n // to avoid using stale gridstackNode positions from the old column layout.\n // For non-column changes, read from gridstackNode to preserve live drag/resize state.\n this.updateAll(isColumnChange);\n });\n });\n }\n });\n\n public ngOnDestroy(): void {\n this.unhookEvents(this.grid);\n this._sub?.unsubscribe();\n this.destroy();\n }\n //#endregion\n\n //#region Internal Methods\n\n /**\n * Synchronizes the grid layout with the current widget list.\n *\n * @param useInputValues - When true, reads positions from Angular input bindings\n * (stored per-breakpoint positions). When false, reads from live gridstackNode\n * (preserving user drag/resize state). Use true after column/breakpoint changes.\n */\n private updateAll(useInputValues = false) {\n if (!this.grid) return;\n\n const arrays = this.gridstackItems?.toArray() ?? [];\n\n if (arrays.length === 0) {\n this.grid.removeAll(true);\n this.checkEmpty();\n return;\n }\n\n const layout: AXGridLayoutNode[] = [];\n arrays.forEach((item) => {\n const widgetOptions = useInputValues ? item.getInputOptions() : item.getOptions();\n if (widgetOptions) {\n const normalized = normalizeLayoutNodeWithAllowedSizes(widgetOptions);\n writeAllowedSizesToElement(normalized.element ?? item.element, normalized.allowedSizes);\n layout.push(removeUndefinedKeys(convertAXGridLayoutNodeToGridStackNode(normalized)));\n }\n });\n\n this.grid.load(layout);\n this.checkEmpty();\n }\n\n private checkEmpty() {\n if (this.grid) {\n const isEmpty = !this.getChildren().length;\n if (isEmpty === this.isEmpty()) return;\n this.isEmpty.set(isEmpty);\n }\n }\n\n private hookEvents(grid?: AXGridLayout): void {\n if (grid) {\n grid\n .on('added', (event: Event, nodes: import('gridstack').GridStackNode[]) => {\n const mappedNodes = nodes.map((node) => removeUndefinedKeys(convertGridStackNodeToAXGridLayoutNode(node)));\n this.checkEmpty();\n this.onAdded.emit({ sender: this, nodes: mappedNodes });\n this._dispatchChangeEvent();\n })\n .on('removed', (event: Event, nodes: import('gridstack').GridStackNode[]) => {\n const mappedNodes = nodes.map((node) => removeUndefinedKeys(convertGridStackNodeToAXGridLayoutNode(node)));\n this.checkEmpty();\n this.onRemoved.emit({ sender: this, nodes: mappedNodes });\n this._dispatchChangeEvent();\n })\n .on('change', (event: Event, nodes: import('gridstack').GridStackNode[]) => {\n const mappedNodes = nodes.map((node) => removeUndefinedKeys(convertGridStackNodeToAXGridLayoutNode(node)));\n this.onWidgetChange.emit({ sender: this, nodes: mappedNodes });\n this._dispatchChangeEvent();\n })\n .on('resizestart', (_event: Event, element: import('gridstack').GridItemHTMLElement) => {\n if (!this.grid) {\n return;\n }\n updateResizeValidityMarkers(this.grid.el, element);\n })\n .on('resize', (_event: Event, element: import('gridstack').GridItemHTMLElement) => {\n if (!this.grid) {\n return;\n }\n updateResizeValidityMarkers(this.grid.el, element);\n })\n .on('resizestop', (_event: Event, element: import('gridstack').GridItemHTMLElement) => {\n if (!this.grid) {\n return;\n }\n\n clearResizeValidityMarkers(this.grid.el);\n\n const didSnap = snapElementToAllowedSize(this.grid, element);\n if (didSnap) {\n this._dispatchChangeEvent();\n }\n });\n }\n }\n\n private unhookEvents(grid?: AXGridLayout) {\n if (grid) grid.offAll();\n }\n\n private _dispatchChangeEvent() {\n if (this.getChildren().length) {\n this.onChange.emit({\n sender: this,\n nodes: this.getChildren(),\n });\n }\n }\n //#endregion\n\n /**\n * Adds a widget to the grid layout.\n *\n * @param w - Widget configuration object.\n * @param withAutoArrange - Whether to compact the grid before adding the widget.\n * @returns AXGridLayoutWidgetElement | undefined - The created widget element or undefined if failed.\n */\n public addWidget(w: AXGridLayoutWidget, withAutoArrange = false): AXGridLayoutWidgetElement | undefined {\n if (withAutoArrange) this.compact();\n\n const gridStackWidget = removeUndefinedKeys(convertAXGridLayoutWidgetToGridStackWidget(w));\n const node = this.grid?.addWidget(gridStackWidget)?.gridstackNode;\n if (!node) return undefined;\n\n const widgetElement: AXGridLayoutWidgetElement = node.el as AXGridLayoutWidgetElement;\n widgetElement.gridstackNode = removeUndefinedKeys(convertGridStackNodeToAXGridLayoutNode(node));\n\n return widgetElement;\n }\n\n /**\n * Compacts the grid layout.\n *\n * @param layout - Layout type for compacting ('list' or 'compact').\n * @param doSort - Whether to sort items while compacting.\n * @returns void - No return value. The grid layout is compacted.\n */\n public compact(layout: 'list' | 'compact' = 'compact', doSort = true): void {\n this.grid?.compact(layout, doSort);\n }\n\n /**\n * Sets the cell height of the grid.\n *\n * @param val - New cell height value.\n * @returns void - No return value. The cell height is updated.\n */\n public setCellHeight(val: number): void {\n this.grid?.cellHeight(val);\n }\n\n /**\n * Sets the number of columns in the grid.\n *\n * @param column - Number of columns.\n * @param layout - Layout type for the change ('list', 'compact', 'moveScale', 'move', 'scale', or 'none').\n * @returns void - No return value. The column count is updated.\n */\n public setColumn(\n column: number,\n layout: 'list' | 'compact' | 'moveScale' | 'move' | 'scale' | 'none' = 'moveScale',\n ): void {\n this.grid?.column(column, layout);\n }\n\n /**\n * Destroys the grid instance.\n *\n * @param removeDOM - Whether to remove DOM elements.\n * @returns void - No return value. The grid instance is destroyed.\n */\n public destroy(removeDOM = true): void {\n this.grid?.destroy(removeDOM);\n }\n\n /**\n * Enables or disables moving of widgets.\n *\n * @param state - Whether to enable moving.\n * @param recurse - Whether to apply to all child widgets.\n * @returns void - No return value. The move state is updated.\n */\n public setMovable(state: boolean, recurse?: boolean) {\n this.grid?.enableMove(state, recurse);\n }\n\n /**\n * Enables or disables resizing of widgets.\n *\n * @param state - Whether to enable resizing.\n * @param recurse - Whether to apply to all child widgets.\n * @returns void - No return value. The resize state is updated.\n */\n public setResizable(state: boolean, recurse?: boolean) {\n this.grid?.enableResize(state, recurse);\n }\n\n /**\n * Sets the float property of the grid.\n *\n * @param val - Whether to enable floating widgets.\n * @returns void - No return value. The float state is updated.\n */\n public setFloat(val: boolean): void {\n this.grid?.float(val);\n }\n\n /**\n * Sets the margin between grid items.\n *\n * @param value - Margin value (number in pixels or string with units).\n * @returns void - No return value. The margin is updated.\n */\n public setMargin(value: number | string): void {\n this.grid?.margin(value);\n }\n\n /**\n * Removes a specific widget from the grid.\n *\n * @param el - The widget element to remove.\n * @param removeDOM - Whether to remove the DOM element.\n * @param triggerEvent - Whether to trigger removal events.\n * @returns void - No return value. The widget is removed.\n */\n public removeWidget(el: AXGridLayoutWidgetElement, removeDOM = true, triggerEvent = true): void {\n this.grid?.removeWidget(el, removeDOM, triggerEvent);\n }\n\n /**\n * Removes all widgets from the grid.\n *\n * @param removeDOM - Whether to remove DOM elements.\n * @returns void - No return value. All widgets are removed.\n */\n public removeAll(removeDOM = true): void {\n this.grid?.removeAll(removeDOM);\n }\n\n /**\n * Sets the animation state for the grid.\n *\n * @param doAnimate - Whether to enable animations.\n * @returns void - No return value. The animation state is updated.\n */\n public setAnimation(doAnimate: boolean): void {\n this.grid?.setAnimation(doAnimate);\n }\n\n /**\n * Sets up draggable functionality for external elements.\n *\n * @param dragIn - CSS selector string or array of HTML elements to make draggable.\n * @param widgets - Optional widget configuration for dragged items.\n * @returns Promise<void> - Promise that resolves when drag setup is complete.\n */\n public async setupDraggable(dragIn?: string | HTMLElement[], widgets?: AXGridLayoutWidget) {\n if (typeof dragIn === 'string') {\n document.querySelectorAll(dragIn).forEach((item) => {\n if (!item.classList.contains('grid-stack-item')) {\n item.classList.add('grid-stack-item');\n }\n });\n }\n const { GridStack } = await import('gridstack');\n const gridStackWidgets = widgets\n ? [removeUndefinedKeys(convertAXGridLayoutWidgetToGridStackWidget(widgets))]\n : undefined;\n GridStack.setupDragIn(dragIn, undefined, gridStackWidgets);\n }\n\n /**\n * Gets the current grid options.\n *\n * @returns AXGridLayoutOptions - Current grid configuration options.\n */\n public getOptions(): AXGridLayoutOptions {\n const opts = this.grid?.opts;\n if (!opts) return {};\n\n return removeUndefinedKeys(convertGridStackOptionsToAXGridLayoutOptions(opts));\n }\n\n /**\n * Gets all child widgets in the grid.\n *\n * @returns AXGridLayoutNode[] - Array of all child widget nodes.\n */\n public getChildren(): AXGridLayoutNode[] {\n const children = this.grid?.engine.nodes ?? [];\n return children.map((node) => removeUndefinedKeys(convertGridStackNodeToAXGridLayoutNode(node)));\n }\n\n /**\n * Finds an empty space in the grid for a widget.\n *\n * @param input - Dimensions of the widget with height and width.\n * @returns { x: number; y: number } - Object containing x and y coordinates of empty space.\n */\n public findEmptySpace(\n input: Required<Pick<AXGridLayoutPosition, 'height' | 'width'>>,\n ): Pick<AXGridLayoutPosition, 'x' | 'y'> {\n const value = { h: input.height, w: input.width } as import('gridstack').GridStackNode;\n this.grid?.engine.findEmptyPosition(value);\n return { x: value.x, y: value.y };\n }\n //#endregion\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { AXGridLayoutContainerComponent } from './grid-layout-container.component';\nimport { AXGridLayoutWidgetComponent } from './grid-layout-widget.component';\n\n@NgModule({\n imports: [CommonModule, AXGridLayoutContainerComponent, AXGridLayoutWidgetComponent],\n exports: [AXGridLayoutContainerComponent, AXGridLayoutWidgetComponent],\n})\nexport class AXGridLayoutBuilderModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAEO,MAAM,iCAAiC,GAAG;AAEjD;AACM,SAAU,0CAA0C,CACxD,MAA0B,EAAA;AAE1B,IAAA,MAAM,UAAU,GAAG,mCAAmC,CAAC,MAAM,CAAC;IAE9D,OAAO;QACL,EAAE,EAAE,UAAU,CAAC,EAAE;QACjB,CAAC,EAAE,UAAU,CAAC,CAAC;QACf,CAAC,EAAE,UAAU,CAAC,CAAC;QACf,CAAC,EAAE,UAAU,CAAC,KAAK;QACnB,CAAC,EAAE,UAAU,CAAC,MAAM;QACpB,IAAI,EAAE,UAAU,CAAC,QAAQ;QACzB,IAAI,EAAE,UAAU,CAAC,SAAS;QAC1B,IAAI,EAAE,UAAU,CAAC,QAAQ;QACzB,IAAI,EAAE,UAAU,CAAC,SAAS;QAC1B,QAAQ,EAAE,UAAU,CAAC,aAAa;QAClC,MAAM,EAAE,UAAU,CAAC,WAAW;KAC/B;AACH;AAEA;AACM,SAAU,0CAA0C,CACxD,MAA2C,EAAA;IAE3C,OAAO;QACL,EAAE,EAAE,MAAM,CAAC,EAAE;QACb,CAAC,EAAE,MAAM,CAAC,CAAC;QACX,CAAC,EAAE,MAAM,CAAC,CAAC;QACX,KAAK,EAAE,MAAM,CAAC,CAAC;QACf,MAAM,EAAE,MAAM,CAAC,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAC,IAAI;QACrB,SAAS,EAAE,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A,EAAA,OAAA,EAAA,CACzE,8BAA8B,EAAE,2BAA2B,CAAA,EAAA,CAAA,CAAA;AAE1D,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,yBAAyB,YAH1B,YAAY,CAAA,EAAA,CAAA,CAAA;;2FAGX,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAJrC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,8BAA8B,EAAE,2BAA2B,CAAC;AACpF,oBAAA,OAAO,EAAE,CAAC,8BAA8B,EAAE,2BAA2B,CAAC;AACvE,iBAAA;;;ACTD;;AAEG;;;;"}
1
+ {"version":3,"file":"acorex-components-grid-layout-builder.mjs","sources":["../../../../packages/components/grid-layout-builder/src/lib/utility.ts","../../../../packages/components/grid-layout-builder/src/lib/grid-layout-widget.component.ts","../../../../packages/components/grid-layout-builder/src/lib/grid-layout-container.component.ts","../../../../packages/components/grid-layout-builder/src/lib/grid-layout-builder.module.ts","../../../../packages/components/grid-layout-builder/src/acorex-components-grid-layout-builder.ts"],"sourcesContent":["import { AXGridLayoutNode, AXGridLayoutOptions, AXGridLayoutSize, AXGridLayoutWidget } from './types';\n\nexport const AX_GRID_LAYOUT_ALLOWED_SIZES_ATTR = 'data-ax-allowed-sizes';\n\n// Convert AXGridLayoutWidget to GridStackWidget\nexport function convertAXGridLayoutWidgetToGridStackWidget(\n widget: AXGridLayoutWidget,\n): import('gridstack').GridStackWidget {\n const normalized = normalizeLayoutNodeWithAllowedSizes(widget);\n\n return {\n id: normalized.id,\n x: normalized.x,\n y: normalized.y,\n w: normalized.width,\n h: normalized.height,\n maxW: normalized.maxWidth,\n maxH: normalized.maxHeight,\n minW: normalized.minWidth,\n minH: normalized.minHeight,\n noResize: normalized.disableResize,\n noMove: normalized.disableDrag,\n };\n}\n\n// Convert GridStackWidget to AXGridLayoutWidget\nexport function convertGridStackWidgetToAXGridLayoutWidget(\n widget: import('gridstack').GridStackWidget,\n): AXGridLayoutWidget {\n return {\n id: widget.id,\n x: widget.x,\n y: widget.y,\n width: widget.w,\n height: widget.h,\n maxWidth: widget.maxW,\n maxHeight: widget.maxH,\n minWidth: widget.minW,\n minHeight: widget.minH,\n disableResize: widget.noResize,\n disableDrag: widget.noMove,\n };\n}\n\n// Convert AXGridLayoutNode to GridStackNode\nexport function convertAXGridLayoutNodeToGridStackNode(node: AXGridLayoutNode): import('gridstack').GridStackNode {\n const normalized = normalizeLayoutNodeWithAllowedSizes(node);\n\n return {\n id: normalized.id,\n x: normalized.x,\n y: normalized.y,\n w: normalized.width,\n h: normalized.height,\n maxW: normalized.maxWidth,\n maxH: normalized.maxHeight,\n minW: normalized.minWidth,\n minH: normalized.minHeight,\n noResize: normalized.disableResize,\n noMove: normalized.disableDrag,\n el: normalized.element,\n };\n}\n\n// Convert GridStackNode to AXGridLayoutNode\nexport function convertGridStackNodeToAXGridLayoutNode(node: import('gridstack').GridStackNode): AXGridLayoutNode {\n const element = node.el;\n const allowedSizes = element ? readAllowedSizesFromElement(element) : undefined;\n\n return {\n id: node.id,\n x: node.x,\n y: node.y,\n width: node.w,\n height: node.h,\n maxWidth: node.maxW,\n maxHeight: node.maxH,\n minWidth: node.minW,\n minHeight: node.minH,\n disableResize: node.noResize,\n disableDrag: node.noMove,\n allowedSizes,\n element,\n };\n}\n\n// Convert AXGridLayoutOptions to GridStackOptions\nexport function convertAXGridLayoutOptionsToGridStackOptions(\n options: AXGridLayoutOptions,\n): import('gridstack').GridStackOptions {\n return {\n column: options.column,\n disableDrag: options.disableDrag,\n disableResize: options.disableResize,\n margin: options.gap,\n cellHeight: options.cellHeight,\n rtl: options.rtl,\n maxRow: options.maxRow,\n minRow: options.minRow,\n row: options.row,\n removable: options.removableSelector || options.removable,\n acceptWidgets: options.acceptWidgets,\n float: options.float,\n handle: options.dragHandlerSelector,\n columnOpts: { breakpoints: options?.responsiveLayout?.map((i) => ({ c: i.column, w: i.width })) },\n };\n}\n\n// Convert GridStackOptions to AXGridLayoutOptions\nexport function convertGridStackOptionsToAXGridLayoutOptions(\n options: import('gridstack').GridStackOptions,\n): AXGridLayoutOptions {\n return {\n column: options.column,\n disableDrag: options.disableDrag,\n disableResize: options.disableResize,\n gap: options.margin,\n cellHeight: options.cellHeight,\n rtl: options.rtl,\n maxRow: options.maxRow,\n minRow: options.minRow,\n row: options.row,\n removableSelector: typeof options.removable === 'string' ? options.removable : undefined,\n removable: typeof options.removable === 'boolean' ? options.removable : undefined,\n acceptWidgets: options.acceptWidgets as boolean,\n float: options.float,\n dragHandlerSelector: options.handle,\n responsiveLayout: options?.columnOpts?.breakpoints?.map((i) => ({ width: i.w, column: i.c })),\n };\n}\n\n/** remove keys which are undefined */\nexport function removeUndefinedKeys<T extends object>(obj: T): T {\n const newObj = { ...obj } as Record<string, unknown>;\n for (const key in newObj) {\n if (newObj[key] === undefined) {\n delete newObj[key];\n }\n }\n return newObj as T;\n}\n\nexport function writeAllowedSizesToElement(\n element: HTMLElement | undefined,\n allowedSizes: readonly AXGridLayoutSize[] | undefined,\n): void {\n if (!element) {\n return;\n }\n\n if (!allowedSizes?.length) {\n element.removeAttribute(AX_GRID_LAYOUT_ALLOWED_SIZES_ATTR);\n return;\n }\n\n element.setAttribute(AX_GRID_LAYOUT_ALLOWED_SIZES_ATTR, JSON.stringify(allowedSizes));\n}\n\nexport function readAllowedSizesFromElement(element: HTMLElement): readonly AXGridLayoutSize[] | undefined {\n const raw = element.getAttribute(AX_GRID_LAYOUT_ALLOWED_SIZES_ATTR);\n if (!raw) {\n return undefined;\n }\n\n try {\n const parsed = JSON.parse(raw) as unknown;\n if (!Array.isArray(parsed) || parsed.length === 0) {\n return undefined;\n }\n\n const sizes = parsed\n .filter((entry): entry is [number, number] => Array.isArray(entry) && entry.length === 2)\n .map(([width, height]) => [Number(width), Number(height)] as const)\n .filter(([width, height]) => Number.isFinite(width) && Number.isFinite(height) && width > 0 && height > 0);\n\n return sizes.length > 0 ? sizes : undefined;\n } catch {\n return undefined;\n }\n}\n\nexport const AX_GRID_LAYOUT_RESIZE_INVALID_CLASS = 'ax-grid-layout-resize-invalid';\nexport const AX_GRID_LAYOUT_RESIZE_PREV_SIZE_ATTR = 'data-ax-resize-prev-size';\n\nexport function isExactAllowedSize(\n width: number,\n height: number,\n allowedSizes: readonly AXGridLayoutSize[],\n): boolean {\n const safeWidth = Number.isFinite(width) && width > 0 ? Math.round(width) : 1;\n const safeHeight = Number.isFinite(height) && height > 0 ? Math.round(height) : 1;\n\n return allowedSizes.some(([w, h]) => w === safeWidth && h === safeHeight);\n}\n\nexport function updateResizeValidityMarkers(\n gridEl: HTMLElement,\n element: import('gridstack').GridItemHTMLElement,\n): void {\n const allowedSizes = readAllowedSizesFromElement(element);\n if (!allowedSizes?.length) {\n clearResizeValidityMarkers(gridEl);\n return;\n }\n\n const node = element.gridstackNode;\n const isValid = isExactAllowedSize(node?.w ?? 1, node?.h ?? 1, allowedSizes);\n\n element.classList.toggle(AX_GRID_LAYOUT_RESIZE_INVALID_CLASS, !isValid);\n gridEl\n .querySelector('.grid-stack-placeholder')\n ?.classList.toggle(AX_GRID_LAYOUT_RESIZE_INVALID_CLASS, !isValid);\n}\n\nexport function clearResizeValidityMarkers(gridEl: HTMLElement): void {\n gridEl.querySelectorAll(`.${AX_GRID_LAYOUT_RESIZE_INVALID_CLASS}`).forEach((el) => {\n el.classList.remove(AX_GRID_LAYOUT_RESIZE_INVALID_CLASS);\n });\n}\n\nexport function storeResizeStartSize(element: import('gridstack').GridItemHTMLElement): void {\n const node = element.gridstackNode;\n if (!node) {\n return;\n }\n\n const width = node.w ?? 1;\n const height = node.h ?? 1;\n element.setAttribute(AX_GRID_LAYOUT_RESIZE_PREV_SIZE_ATTR, JSON.stringify([width, height]));\n}\n\nexport function clearResizeStartSize(element: HTMLElement): void {\n element.removeAttribute(AX_GRID_LAYOUT_RESIZE_PREV_SIZE_ATTR);\n}\n\nexport function readResizeStartSize(element: HTMLElement): AXGridLayoutSize | undefined {\n const raw = element.getAttribute(AX_GRID_LAYOUT_RESIZE_PREV_SIZE_ATTR);\n if (!raw) {\n return undefined;\n }\n\n try {\n const parsed = JSON.parse(raw) as unknown;\n if (!Array.isArray(parsed) || parsed.length !== 2) {\n return undefined;\n }\n\n const [width, height] = parsed;\n if (!Number.isFinite(width) || !Number.isFinite(height) || width <= 0 || height <= 0) {\n return undefined;\n }\n\n return [width, height];\n } catch {\n return undefined;\n }\n}\n\nexport function snapToAllowedSize(\n width: number,\n height: number,\n allowedSizes: readonly AXGridLayoutSize[],\n): AXGridLayoutSize {\n const safeWidth = Number.isFinite(width) && width > 0 ? width : 1;\n const safeHeight = Number.isFinite(height) && height > 0 ? height : 1;\n\n return allowedSizes.reduce<AXGridLayoutSize>((best, size) => {\n const bestDistance = (best[0] - safeWidth) ** 2 + (best[1] - safeHeight) ** 2;\n const nextDistance = (size[0] - safeWidth) ** 2 + (size[1] - safeHeight) ** 2;\n return nextDistance < bestDistance ? size : best;\n }, allowedSizes[0]);\n}\n\nexport function deriveMinMaxFromAllowedSizes(allowedSizes: readonly AXGridLayoutSize[]): Pick<\n AXGridLayoutWidget,\n 'minWidth' | 'maxWidth' | 'minHeight' | 'maxHeight'\n> {\n const widths = allowedSizes.map(([width]) => width);\n const heights = allowedSizes.map(([, height]) => height);\n\n return {\n minWidth: Math.min(...widths),\n maxWidth: Math.max(...widths),\n minHeight: Math.min(...heights),\n maxHeight: Math.max(...heights),\n };\n}\n\nexport function normalizeLayoutNodeWithAllowedSizes<T extends AXGridLayoutWidget>(node: T): T {\n if (!node.allowedSizes?.length) {\n return node;\n }\n\n const [width, height] = snapToAllowedSize(node.width ?? 1, node.height ?? 1, node.allowedSizes);\n const bounds = deriveMinMaxFromAllowedSizes(node.allowedSizes);\n\n return {\n ...node,\n width,\n height,\n minWidth: bounds.minWidth,\n maxWidth: bounds.maxWidth,\n minHeight: bounds.minHeight,\n maxHeight: bounds.maxHeight,\n };\n}\n\nexport function snapElementToAllowedSize(\n grid: import('gridstack').GridStack,\n element: import('gridstack').GridItemHTMLElement,\n): boolean {\n const allowedSizes = readAllowedSizesFromElement(element);\n if (!allowedSizes?.length) {\n return false;\n }\n\n const node = element.gridstackNode;\n if (!node) {\n return false;\n }\n\n const [width, height] = snapToAllowedSize(node.w ?? 1, node.h ?? 1, allowedSizes);\n if (node.w === width && node.h === height) {\n return false;\n }\n\n grid.update(element, { w: width, h: height });\n return true;\n}\n\nexport function revertElementToAllowedSizeIfInvalid(\n grid: import('gridstack').GridStack,\n element: import('gridstack').GridItemHTMLElement,\n): boolean {\n const allowedSizes = readAllowedSizesFromElement(element);\n if (!allowedSizes?.length) {\n return false;\n }\n\n const node = element.gridstackNode;\n if (!node) {\n return false;\n }\n\n const currentWidth = node.w ?? 1;\n const currentHeight = node.h ?? 1;\n\n if (isExactAllowedSize(currentWidth, currentHeight, allowedSizes)) {\n return false;\n }\n\n const previousSize = readResizeStartSize(element);\n if (!previousSize) {\n return false;\n }\n\n const [width, height] = previousSize;\n if (node.w === width && node.h === height) {\n return false;\n }\n\n grid.update(element, { w: width, h: height });\n return true;\n}\n","import { AXComponent } from '@acorex/cdk/common';\nimport { Component, effect, ElementRef, inject, input, untracked, ViewEncapsulation } from '@angular/core';\nimport { AXGridLayoutNode, AXGridLayoutWidget, AXGridLayoutWidgetElement } from './types';\nimport {\n convertAXGridLayoutWidgetToGridStackWidget,\n convertGridStackNodeToAXGridLayoutNode,\n normalizeLayoutNodeWithAllowedSizes,\n removeUndefinedKeys,\n writeAllowedSizesToElement,\n} from './utility';\n\n@Component({\n selector: 'ax-grid-layout-widget',\n template: `<div class=\"grid-stack-item-content\"><ng-content></ng-content></div>`,\n\n encapsulation: ViewEncapsulation.None,\n providers: [{ provide: AXComponent, useExisting: AXGridLayoutWidgetComponent }],\n})\nexport class AXGridLayoutWidgetComponent {\n private readonly elementRef: ElementRef<AXGridLayoutWidgetElement> = inject(ElementRef);\n\n public options = input<AXGridLayoutNode>();\n\n #eff = effect(() => {\n const options = this.options();\n\n untracked(() => {\n const element = this.elementRef.nativeElement;\n const normalized = options ? normalizeLayoutNodeWithAllowedSizes(options) : undefined;\n writeAllowedSizesToElement(element, normalized?.allowedSizes);\n\n const gridstackNode = element.gridstackNode as import('gridstack').GridStackNode;\n if (gridstackNode?.grid && normalized) {\n gridstackNode.grid.update(\n element,\n removeUndefinedKeys(convertAXGridLayoutWidgetToGridStackWidget(normalized)),\n );\n }\n });\n });\n\n /**\n * Locks or unlocks the widget (prevents dragging and resizing).\n *\n * @param state - If true, the widget will be locked.\n * @returns void - No return value. The widget lock state is updated.\n */\n public setLockable(state: boolean): void {\n this.updateWidgetOptions({ disableResize: state, disableDrag: state });\n }\n\n /**\n * Enables or disables resizing of the widget.\n *\n * @param state - If true, resizing will be enabled.\n * @returns void - No return value. The widget resize state is updated.\n */\n public setResizable(state: boolean): void {\n this.updateWidgetOptions({ disableResize: !state });\n }\n\n /**\n * Updates the widget options.\n *\n * @param options - The new options for the widget.\n * @returns void - No return value. The widget options are updated.\n */\n public setOptions(options: AXGridLayoutWidget): void {\n this.updateWidgetOptions(options);\n }\n\n /**\n * Returns the current options of the widget.\n *\n * @returns AXGridLayoutNode - The current widget options.\n */\n public getOptions(): AXGridLayoutNode {\n const gridstackNode = this.elementRef.nativeElement.gridstackNode;\n return gridstackNode\n ? removeUndefinedKeys(convertGridStackNodeToAXGridLayoutNode(gridstackNode))\n : { ...this.options(), element: this.elementRef.nativeElement };\n }\n\n /**\n * Returns the widget options from the Angular input binding (stored/desired positions),\n * bypassing the live gridstackNode which may have been auto-reflowed.\n * Used by the container to load correct per-breakpoint layouts after column changes.\n *\n * @returns AXGridLayoutNode - The widget options from the input signal.\n */\n public getInputOptions(): AXGridLayoutNode {\n const opts = this.options();\n const normalized = opts ? normalizeLayoutNodeWithAllowedSizes(opts) : undefined;\n return normalized\n ? { ...normalized, element: this.elementRef.nativeElement }\n : { element: this.elementRef.nativeElement };\n }\n\n /**\n * Returns the native DOM element of the widget.\n *\n * @returns AXGridLayoutWidgetElement - The native element.\n */\n public get element(): AXGridLayoutWidgetElement {\n return this.elementRef.nativeElement;\n }\n\n /**\n * Updates the widget options and triggers a grid update.\n * @param options - The partial options to update.\n */\n private updateWidgetOptions(options: Partial<AXGridLayoutWidget>): void {\n const gridstackNode = this.elementRef.nativeElement.gridstackNode as import('gridstack').GridStackNode;\n if (gridstackNode?.grid) {\n gridstackNode.grid.update(\n this.elementRef.nativeElement,\n removeUndefinedKeys(convertAXGridLayoutWidgetToGridStackWidget(options)),\n );\n }\n }\n}\n","import { AXComponent, NXComponent } from '@acorex/cdk/common';\nimport {\n Component,\n ContentChildren,\n ElementRef,\n NgZone,\n OnDestroy,\n QueryList,\n ViewEncapsulation,\n afterNextRender,\n effect,\n inject,\n input,\n model,\n output,\n untracked,\n} from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { AXGridLayoutWidgetComponent } from './grid-layout-widget.component';\nimport {\n AXGridLayout,\n AXGridLayoutContainerElement,\n AXGridLayoutEvent,\n AXGridLayoutNode,\n AXGridLayoutOptions,\n AXGridLayoutPosition,\n AXGridLayoutWidget,\n AXGridLayoutWidgetElement,\n} from './types';\nimport {\n convertAXGridLayoutNodeToGridStackNode,\n convertAXGridLayoutOptionsToGridStackOptions,\n convertAXGridLayoutWidgetToGridStackWidget,\n convertGridStackNodeToAXGridLayoutNode,\n convertGridStackOptionsToAXGridLayoutOptions,\n clearResizeValidityMarkers,\n clearResizeStartSize,\n normalizeLayoutNodeWithAllowedSizes,\n removeUndefinedKeys,\n revertElementToAllowedSizeIfInvalid,\n storeResizeStartSize,\n updateResizeValidityMarkers,\n writeAllowedSizesToElement,\n} from './utility';\n\n@Component({\n selector: 'ax-grid-layout-container',\n template: `<ng-content></ng-content> `,\n styleUrl: './grid-layout-container.css',\n\n encapsulation: ViewEncapsulation.None,\n providers: [{ provide: AXComponent, useExisting: AXGridLayoutContainerComponent }],\n})\nexport class AXGridLayoutContainerComponent extends NXComponent implements OnDestroy {\n //#region Inputs and Outputs\n public options = input<AXGridLayoutOptions>();\n\n protected onAdded = output<AXGridLayoutEvent>();\n protected onRemoved = output<AXGridLayoutEvent>();\n protected onWidgetChange = output<AXGridLayoutEvent>();\n protected onChange = output<AXGridLayoutEvent>();\n protected onRender = output<void>();\n\n protected isEmpty = model(false);\n //#endregion\n\n //#region Private Properties\n private readonly elementRef: ElementRef<AXGridLayoutContainerElement> = inject(ElementRef);\n private readonly ngZone = inject(NgZone);\n\n @ContentChildren(AXGridLayoutWidgetComponent) public gridstackItems?: QueryList<AXGridLayoutWidgetComponent>;\n\n private el = this.elementRef.nativeElement;\n private grid?: AXGridLayout;\n protected _sub: Subscription | undefined;\n private isInitialized = false;\n //#endregion\n\n //#region Initialization\n #init = afterNextRender(() => {\n this.ngZone.runOutsideAngular(async () => {\n const { GridStack } = await import('gridstack');\n const gridStackOptions = removeUndefinedKeys(convertAXGridLayoutOptionsToGridStackOptions(this.options() ?? {}));\n this.grid = GridStack.init(gridStackOptions, this.el);\n this.updateAll();\n this.hookEvents(this.grid);\n this.onRender.emit();\n this.isInitialized = true;\n });\n this._sub = this.gridstackItems?.changes.subscribe(() => {\n this.updateAll();\n });\n });\n\n // Watch for options changes\n #optionsEffect = effect(() => {\n const newOptions = this.options();\n if (this.isInitialized && this.grid && newOptions) {\n untracked(() => {\n this.ngZone.runOutsideAngular(() => {\n const gridStackOptions = removeUndefinedKeys(convertAXGridLayoutOptionsToGridStackOptions(newOptions));\n\n const column = gridStackOptions.column;\n\n // Detect whether the column count is changing — requires loading from stored input positions\n const isColumnChange = typeof column === 'number' && column !== this.grid?.opts?.column;\n\n // Use 'none' layout mode to prevent GridStack from auto-reflowing widget positions.\n // The correct per-breakpoint positions will be loaded explicitly via updateAll(true).\n if (typeof column === 'number') {\n this.grid?.column(column, 'none');\n }\n\n if (gridStackOptions.cellHeight !== undefined) {\n this.grid?.cellHeight(gridStackOptions.cellHeight);\n }\n\n if (gridStackOptions.margin !== undefined) {\n this.grid?.margin(gridStackOptions.margin);\n }\n\n if (gridStackOptions.disableResize !== undefined) {\n this.grid?.enableResize(!gridStackOptions.disableResize);\n }\n\n if (gridStackOptions.disableDrag !== undefined) {\n this.grid?.enableMove(!gridStackOptions.disableDrag);\n }\n\n if (gridStackOptions.float !== undefined) {\n this.grid?.float(gridStackOptions.float);\n }\n\n if (gridStackOptions.animate !== undefined) {\n this.grid?.setAnimation(gridStackOptions.animate);\n }\n\n // When column count changes, read from Angular inputs (stored per-breakpoint positions)\n // to avoid using stale gridstackNode positions from the old column layout.\n // For non-column changes, read from gridstackNode to preserve live drag/resize state.\n this.updateAll(isColumnChange);\n });\n });\n }\n });\n\n public ngOnDestroy(): void {\n this.unhookEvents(this.grid);\n this._sub?.unsubscribe();\n this.destroy();\n }\n //#endregion\n\n //#region Internal Methods\n\n /**\n * Synchronizes the grid layout with the current widget list.\n *\n * @param useInputValues - When true, reads positions from Angular input bindings\n * (stored per-breakpoint positions). When false, reads from live gridstackNode\n * (preserving user drag/resize state). Use true after column/breakpoint changes.\n */\n private updateAll(useInputValues = false) {\n if (!this.grid) return;\n\n const arrays = this.gridstackItems?.toArray() ?? [];\n\n if (arrays.length === 0) {\n this.grid.removeAll(true);\n this.checkEmpty();\n return;\n }\n\n const layout: AXGridLayoutNode[] = [];\n arrays.forEach((item) => {\n const widgetOptions = useInputValues ? item.getInputOptions() : item.getOptions();\n if (widgetOptions) {\n const normalized = normalizeLayoutNodeWithAllowedSizes(widgetOptions);\n writeAllowedSizesToElement(normalized.element ?? item.element, normalized.allowedSizes);\n layout.push(removeUndefinedKeys(convertAXGridLayoutNodeToGridStackNode(normalized)));\n }\n });\n\n this.grid.load(layout);\n this.checkEmpty();\n }\n\n private checkEmpty() {\n if (this.grid) {\n const isEmpty = !this.getChildren().length;\n if (isEmpty === this.isEmpty()) return;\n this.isEmpty.set(isEmpty);\n }\n }\n\n private hookEvents(grid?: AXGridLayout): void {\n if (grid) {\n grid\n .on('added', (event: Event, nodes: import('gridstack').GridStackNode[]) => {\n const mappedNodes = nodes.map((node) => removeUndefinedKeys(convertGridStackNodeToAXGridLayoutNode(node)));\n this.checkEmpty();\n this.onAdded.emit({ sender: this, nodes: mappedNodes });\n this._dispatchChangeEvent();\n })\n .on('removed', (event: Event, nodes: import('gridstack').GridStackNode[]) => {\n const mappedNodes = nodes.map((node) => removeUndefinedKeys(convertGridStackNodeToAXGridLayoutNode(node)));\n this.checkEmpty();\n this.onRemoved.emit({ sender: this, nodes: mappedNodes });\n this._dispatchChangeEvent();\n })\n .on('change', (event: Event, nodes: import('gridstack').GridStackNode[]) => {\n const mappedNodes = nodes.map((node) => removeUndefinedKeys(convertGridStackNodeToAXGridLayoutNode(node)));\n this.onWidgetChange.emit({ sender: this, nodes: mappedNodes });\n this._dispatchChangeEvent();\n })\n .on('resizestart', (_event: Event, element: import('gridstack').GridItemHTMLElement) => {\n if (!this.grid) {\n return;\n }\n storeResizeStartSize(element);\n updateResizeValidityMarkers(this.grid.el, element);\n })\n .on('resize', (_event: Event, element: import('gridstack').GridItemHTMLElement) => {\n if (!this.grid) {\n return;\n }\n updateResizeValidityMarkers(this.grid.el, element);\n })\n .on('resizestop', (_event: Event, element: import('gridstack').GridItemHTMLElement) => {\n if (!this.grid) {\n return;\n }\n\n clearResizeValidityMarkers(this.grid.el);\n\n const didRevert = revertElementToAllowedSizeIfInvalid(this.grid, element);\n clearResizeStartSize(element);\n if (didRevert) {\n this._dispatchChangeEvent();\n }\n });\n }\n }\n\n private unhookEvents(grid?: AXGridLayout) {\n if (grid) grid.offAll();\n }\n\n private _dispatchChangeEvent() {\n if (this.getChildren().length) {\n this.onChange.emit({\n sender: this,\n nodes: this.getChildren(),\n });\n }\n }\n //#endregion\n\n /**\n * Adds a widget to the grid layout.\n *\n * @param w - Widget configuration object.\n * @param withAutoArrange - Whether to compact the grid before adding the widget.\n * @returns AXGridLayoutWidgetElement | undefined - The created widget element or undefined if failed.\n */\n public addWidget(w: AXGridLayoutWidget, withAutoArrange = false): AXGridLayoutWidgetElement | undefined {\n if (withAutoArrange) this.compact();\n\n const gridStackWidget = removeUndefinedKeys(convertAXGridLayoutWidgetToGridStackWidget(w));\n const node = this.grid?.addWidget(gridStackWidget)?.gridstackNode;\n if (!node) return undefined;\n\n const widgetElement: AXGridLayoutWidgetElement = node.el as AXGridLayoutWidgetElement;\n widgetElement.gridstackNode = removeUndefinedKeys(convertGridStackNodeToAXGridLayoutNode(node));\n\n return widgetElement;\n }\n\n /**\n * Compacts the grid layout.\n *\n * @param layout - Layout type for compacting ('list' or 'compact').\n * @param doSort - Whether to sort items while compacting.\n * @returns void - No return value. The grid layout is compacted.\n */\n public compact(layout: 'list' | 'compact' = 'compact', doSort = true): void {\n this.grid?.compact(layout, doSort);\n }\n\n /**\n * Sets the cell height of the grid.\n *\n * @param val - New cell height value.\n * @returns void - No return value. The cell height is updated.\n */\n public setCellHeight(val: number): void {\n this.grid?.cellHeight(val);\n }\n\n /**\n * Sets the number of columns in the grid.\n *\n * @param column - Number of columns.\n * @param layout - Layout type for the change ('list', 'compact', 'moveScale', 'move', 'scale', or 'none').\n * @returns void - No return value. The column count is updated.\n */\n public setColumn(\n column: number,\n layout: 'list' | 'compact' | 'moveScale' | 'move' | 'scale' | 'none' = 'moveScale',\n ): void {\n this.grid?.column(column, layout);\n }\n\n /**\n * Destroys the grid instance.\n *\n * @param removeDOM - Whether to remove DOM elements.\n * @returns void - No return value. The grid instance is destroyed.\n */\n public destroy(removeDOM = true): void {\n this.grid?.destroy(removeDOM);\n }\n\n /**\n * Enables or disables moving of widgets.\n *\n * @param state - Whether to enable moving.\n * @param recurse - Whether to apply to all child widgets.\n * @returns void - No return value. The move state is updated.\n */\n public setMovable(state: boolean, recurse?: boolean) {\n this.grid?.enableMove(state, recurse);\n }\n\n /**\n * Enables or disables resizing of widgets.\n *\n * @param state - Whether to enable resizing.\n * @param recurse - Whether to apply to all child widgets.\n * @returns void - No return value. The resize state is updated.\n */\n public setResizable(state: boolean, recurse?: boolean) {\n this.grid?.enableResize(state, recurse);\n }\n\n /**\n * Sets the float property of the grid.\n *\n * @param val - Whether to enable floating widgets.\n * @returns void - No return value. The float state is updated.\n */\n public setFloat(val: boolean): void {\n this.grid?.float(val);\n }\n\n /**\n * Sets the margin between grid items.\n *\n * @param value - Margin value (number in pixels or string with units).\n * @returns void - No return value. The margin is updated.\n */\n public setMargin(value: number | string): void {\n this.grid?.margin(value);\n }\n\n /**\n * Removes a specific widget from the grid.\n *\n * @param el - The widget element to remove.\n * @param removeDOM - Whether to remove the DOM element.\n * @param triggerEvent - Whether to trigger removal events.\n * @returns void - No return value. The widget is removed.\n */\n public removeWidget(el: AXGridLayoutWidgetElement, removeDOM = true, triggerEvent = true): void {\n this.grid?.removeWidget(el, removeDOM, triggerEvent);\n }\n\n /**\n * Removes all widgets from the grid.\n *\n * @param removeDOM - Whether to remove DOM elements.\n * @returns void - No return value. All widgets are removed.\n */\n public removeAll(removeDOM = true): void {\n this.grid?.removeAll(removeDOM);\n }\n\n /**\n * Sets the animation state for the grid.\n *\n * @param doAnimate - Whether to enable animations.\n * @returns void - No return value. The animation state is updated.\n */\n public setAnimation(doAnimate: boolean): void {\n this.grid?.setAnimation(doAnimate);\n }\n\n /**\n * Sets up draggable functionality for external elements.\n *\n * @param dragIn - CSS selector string or array of HTML elements to make draggable.\n * @param widgets - Optional widget configuration for dragged items.\n * @returns Promise<void> - Promise that resolves when drag setup is complete.\n */\n public async setupDraggable(dragIn?: string | HTMLElement[], widgets?: AXGridLayoutWidget) {\n if (typeof dragIn === 'string') {\n document.querySelectorAll(dragIn).forEach((item) => {\n if (!item.classList.contains('grid-stack-item')) {\n item.classList.add('grid-stack-item');\n }\n });\n }\n const { GridStack } = await import('gridstack');\n const gridStackWidgets = widgets\n ? [removeUndefinedKeys(convertAXGridLayoutWidgetToGridStackWidget(widgets))]\n : undefined;\n GridStack.setupDragIn(dragIn, undefined, gridStackWidgets);\n }\n\n /**\n * Gets the current grid options.\n *\n * @returns AXGridLayoutOptions - Current grid configuration options.\n */\n public getOptions(): AXGridLayoutOptions {\n const opts = this.grid?.opts;\n if (!opts) return {};\n\n return removeUndefinedKeys(convertGridStackOptionsToAXGridLayoutOptions(opts));\n }\n\n /**\n * Gets all child widgets in the grid.\n *\n * @returns AXGridLayoutNode[] - Array of all child widget nodes.\n */\n public getChildren(): AXGridLayoutNode[] {\n const children = this.grid?.engine.nodes ?? [];\n return children.map((node) => removeUndefinedKeys(convertGridStackNodeToAXGridLayoutNode(node)));\n }\n\n /**\n * Finds an empty space in the grid for a widget.\n *\n * @param input - Dimensions of the widget with height and width.\n * @returns { x: number; y: number } - Object containing x and y coordinates of empty space.\n */\n public findEmptySpace(\n input: Required<Pick<AXGridLayoutPosition, 'height' | 'width'>>,\n ): Pick<AXGridLayoutPosition, 'x' | 'y'> {\n const value = { h: input.height, w: input.width } as import('gridstack').GridStackNode;\n this.grid?.engine.findEmptyPosition(value);\n return { x: value.x, y: value.y };\n }\n //#endregion\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { AXGridLayoutContainerComponent } from './grid-layout-container.component';\nimport { AXGridLayoutWidgetComponent } from './grid-layout-widget.component';\n\n@NgModule({\n imports: [CommonModule, AXGridLayoutContainerComponent, AXGridLayoutWidgetComponent],\n exports: [AXGridLayoutContainerComponent, AXGridLayoutWidgetComponent],\n})\nexport class AXGridLayoutBuilderModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAEO,MAAM,iCAAiC,GAAG;AAEjD;AACM,SAAU,0CAA0C,CACxD,MAA0B,EAAA;AAE1B,IAAA,MAAM,UAAU,GAAG,mCAAmC,CAAC,MAAM,CAAC;IAE9D,OAAO;QACL,EAAE,EAAE,UAAU,CAAC,EAAE;QACjB,CAAC,EAAE,UAAU,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A,aAAA,EAGvB,iBAAiB,CAAC,IAAI,EAAA,SAAA,EAC1B,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAA,8BAAgC,EAAE,CAAC,EAAA,MAAA,EAAA,CAAA,6lUAAA,CAAA,EAAA;;sBAmBjF,eAAe;uBAAC,2BAA2B;;;MC5DjC,yBAAyB,CAAA;8GAAzB,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAzB,yBAAyB,EAAA,OAAA,EAAA,CAH1B,YAAY,EAAE,8BAA8B,EAAE,2BAA2B,CAAA,EAAA,OAAA,EAAA,CACzE,8BAA8B,EAAE,2BAA2B,CAAA,EAAA,CAAA,CAAA;AAE1D,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,yBAAyB,YAH1B,YAAY,CAAA,EAAA,CAAA,CAAA;;2FAGX,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAJrC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,8BAA8B,EAAE,2BAA2B,CAAC;AACpF,oBAAA,OAAO,EAAE,CAAC,8BAA8B,EAAE,2BAA2B,CAAC;AACvE,iBAAA;;;ACTD;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@acorex/components",
3
- "version": "22.0.0-next.33",
3
+ "version": "22.0.0-next.34",
4
4
  "peerDependencies": {
5
- "@acorex/core": "22.0.0-next.33",
6
- "@acorex/cdk": "22.0.0-next.33",
5
+ "@acorex/core": "22.0.0-next.34",
6
+ "@acorex/cdk": "22.0.0-next.34",
7
7
  "polytype": ">=0.17.0",
8
8
  "angular-imask": ">=7.6.1",
9
9
  "imask": ">=7.6.1",
@@ -25,8 +25,8 @@ interface AXGridLayoutPosition {
25
25
  /** minimum height of widget in rows (default?: undefined = un-constrained) */
26
26
  minHeight?: number;
27
27
  /**
28
- * When set, resize snaps to one of these `[width, height]` presets.
29
- * Min/max bounds are derived from this list during grid conversion.
28
+ * When set, resize is limited to these `[width, height]` presets.
29
+ * Invalid sizes revert to the previous size on resize end. Min/max bounds are derived from this list.
30
30
  */
31
31
  allowedSizes?: readonly AXGridLayoutSize[];
32
32
  }
@@ -337,13 +337,18 @@ declare function removeUndefinedKeys<T extends object>(obj: T): T;
337
337
  declare function writeAllowedSizesToElement(element: HTMLElement | undefined, allowedSizes: readonly AXGridLayoutSize[] | undefined): void;
338
338
  declare function readAllowedSizesFromElement(element: HTMLElement): readonly AXGridLayoutSize[] | undefined;
339
339
  declare const AX_GRID_LAYOUT_RESIZE_INVALID_CLASS = "ax-grid-layout-resize-invalid";
340
+ declare const AX_GRID_LAYOUT_RESIZE_PREV_SIZE_ATTR = "data-ax-resize-prev-size";
340
341
  declare function isExactAllowedSize(width: number, height: number, allowedSizes: readonly AXGridLayoutSize[]): boolean;
341
342
  declare function updateResizeValidityMarkers(gridEl: HTMLElement, element: gridstack.GridItemHTMLElement): void;
342
343
  declare function clearResizeValidityMarkers(gridEl: HTMLElement): void;
344
+ declare function storeResizeStartSize(element: gridstack.GridItemHTMLElement): void;
345
+ declare function clearResizeStartSize(element: HTMLElement): void;
346
+ declare function readResizeStartSize(element: HTMLElement): AXGridLayoutSize | undefined;
343
347
  declare function snapToAllowedSize(width: number, height: number, allowedSizes: readonly AXGridLayoutSize[]): AXGridLayoutSize;
344
348
  declare function deriveMinMaxFromAllowedSizes(allowedSizes: readonly AXGridLayoutSize[]): Pick<AXGridLayoutWidget, 'minWidth' | 'maxWidth' | 'minHeight' | 'maxHeight'>;
345
349
  declare function normalizeLayoutNodeWithAllowedSizes<T extends AXGridLayoutWidget>(node: T): T;
346
350
  declare function snapElementToAllowedSize(grid: gridstack.GridStack, element: gridstack.GridItemHTMLElement): boolean;
351
+ declare function revertElementToAllowedSizeIfInvalid(grid: gridstack.GridStack, element: gridstack.GridItemHTMLElement): boolean;
347
352
 
348
- export { AXGridLayoutBuilderModule, AXGridLayoutContainerComponent, AXGridLayoutWidgetComponent, AX_GRID_LAYOUT_ALLOWED_SIZES_ATTR, AX_GRID_LAYOUT_RESIZE_INVALID_CLASS, clearResizeValidityMarkers, convertAXGridLayoutNodeToGridStackNode, convertAXGridLayoutOptionsToGridStackOptions, convertAXGridLayoutWidgetToGridStackWidget, convertGridStackNodeToAXGridLayoutNode, convertGridStackOptionsToAXGridLayoutOptions, convertGridStackWidgetToAXGridLayoutWidget, deriveMinMaxFromAllowedSizes, isExactAllowedSize, normalizeLayoutNodeWithAllowedSizes, readAllowedSizesFromElement, removeUndefinedKeys, snapElementToAllowedSize, snapToAllowedSize, updateResizeValidityMarkers, writeAllowedSizesToElement };
353
+ export { AXGridLayoutBuilderModule, AXGridLayoutContainerComponent, AXGridLayoutWidgetComponent, AX_GRID_LAYOUT_ALLOWED_SIZES_ATTR, AX_GRID_LAYOUT_RESIZE_INVALID_CLASS, AX_GRID_LAYOUT_RESIZE_PREV_SIZE_ATTR, clearResizeStartSize, clearResizeValidityMarkers, convertAXGridLayoutNodeToGridStackNode, convertAXGridLayoutOptionsToGridStackOptions, convertAXGridLayoutWidgetToGridStackWidget, convertGridStackNodeToAXGridLayoutNode, convertGridStackOptionsToAXGridLayoutOptions, convertGridStackWidgetToAXGridLayoutWidget, deriveMinMaxFromAllowedSizes, isExactAllowedSize, normalizeLayoutNodeWithAllowedSizes, readAllowedSizesFromElement, readResizeStartSize, removeUndefinedKeys, revertElementToAllowedSizeIfInvalid, snapElementToAllowedSize, snapToAllowedSize, storeResizeStartSize, updateResizeValidityMarkers, writeAllowedSizesToElement };
349
354
  export type { AXGridLayout, AXGridLayoutContainerElement, AXGridLayoutEvent, AXGridLayoutNode, AXGridLayoutOptions, AXGridLayoutPosition, AXGridLayoutSize, AXGridLayoutWidget, AXGridLayoutWidgetElement };