@omegagrid/dashboard 0.10.68 → 0.10.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/types.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { ComponentId } from "@omegagrid/core";
2
+ import type { DashboardItemModel } from "./model";
2
3
  export type DashboardItemSource = {
3
4
  /** id of the component */
4
5
  id: ComponentId;
@@ -29,6 +30,12 @@ export type DashboardOptions = {
29
30
  overlay?: {
30
31
  /** opacity of overlay in design mode */
31
32
  opacity?: number;
33
+ /**
34
+ * Custom design mode overlay renderer. When set, a plain div is rendered
35
+ * over the item instead of the default og-overlay and this function is
36
+ * called to fill its content (e.g. title and item controls).
37
+ */
38
+ renderer?: (div: HTMLDivElement, model: DashboardItemModel) => void;
32
39
  };
33
40
  };
34
41
  export type DashboardSource = {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,MAAM,mBAAmB,GAAG;IACjC,0BAA0B;IAC1B,EAAE,EAAE,WAAW,CAAC;IAEhB,cAAc;IACd,CAAC,EAAE,MAAM,CAAC;IAEV,cAAc;IACd,CAAC,EAAE,MAAM,CAAC;IAEV,YAAY;IACZ,CAAC,CAAC,EAAE,MAAM,CAAC;IAEX,aAAa;IACb,CAAC,CAAC,EAAE,MAAM,CAAC;IAEX,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;CACf,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC9B,wBAAwB;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,yBAAyB;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,qBAAqB;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,4B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AE/C,OAAO,CAAC,EAAE;QACT,wCAAwC;QACxC,OAAO,CAAC,EAAE,MAAM,CAAC;QAEjB;;;;WAIG;QACH,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;KACpE,CAAA;CACD,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC7B,sBAAsB;IACtB,KAAK,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAE9B,wBAAwB;IACxB,OAAO,CAAC,EAAE,gBAAgB,CAAC;CAC3B,CAAA"}
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import { ComponentId } from \"@omegagrid/core\";\n\nexport type DashboardItemSource = {\n\t/** id of the component */\n\tid: ComponentId;\n\n\t/** x coord */\n\tx: number;\n\n\t/** y coord */\n\ty: number;\n\t\n\t/** width */\n\tw?: number;\n\n\t/** height */\n\th?: number;\n\n\t/** title shown in design mode */\n\ttitle?: string;\n}\n\nexport type DashboardOptions = {\n\t/** number of columns */\n\tcolumns?: number;\n\n\t/** fixed column width */\n\tcolumnWidth?: number;\n\n\t/** number of rows */\n\trows?: number;\n\n\t/** fixed row height */\n\trowHeight?: number;\n\n\t/** The gap between items */\n\tgap?: number;\n\n\t/** Orientation of dashboard */\n\torientation?: 'horizontal' | 'vertical' | null;\n\n\toverlay?: {\n\t\t/** opacity of overlay in design mode */\n\t\topacity?: number;\n\t}\n}\n\nexport type DashboardSource = {\n\t/** Dashboard items */\n\titems?: DashboardItemSource[];\n\n\t/** Dashboard options */\n\toptions?: DashboardOptions;\n}"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import { ComponentId } from \"@omegagrid/core\";\nimport type { DashboardItemModel } from \"./model\";\n\nexport type DashboardItemSource = {\n\t/** id of the component */\n\tid: ComponentId;\n\n\t/** x coord */\n\tx: number;\n\n\t/** y coord */\n\ty: number;\n\t\n\t/** width */\n\tw?: number;\n\n\t/** height */\n\th?: number;\n\n\t/** title shown in design mode */\n\ttitle?: string;\n}\n\nexport type DashboardOptions = {\n\t/** number of columns */\n\tcolumns?: number;\n\n\t/** fixed column width */\n\tcolumnWidth?: number;\n\n\t/** number of rows */\n\trows?: number;\n\n\t/** fixed row height */\n\trowHeight?: number;\n\n\t/** The gap between items */\n\tgap?: number;\n\n\t/** Orientation of dashboard */\n\torientation?: 'horizontal' | 'vertical' | null;\n\n\toverlay?: {\n\t\t/** opacity of overlay in design mode */\n\t\topacity?: number;\n\n\t\t/**\n\t\t * Custom design mode overlay renderer. When set, a plain div is rendered\n\t\t * over the item instead of the default og-overlay and this function is\n\t\t * called to fill its content (e.g. title and item controls).\n\t\t */\n\t\trenderer?: (div: HTMLDivElement, model: DashboardItemModel) => void;\n\t}\n}\n\nexport type DashboardSource = {\n\t/** Dashboard items */\n\titems?: DashboardItemSource[];\n\n\t/** Dashboard options */\n\toptions?: DashboardOptions;\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/ui/dashboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,EAAE,cAAc,EAAO,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAKvH,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,qBAAa,cAAe,SAAQ,KAAK;IAExC,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAC;gBAEvB,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,c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IAAI,QAAQ,SAYX;IAED,SAAS,CAAC,IAAI,EAAE,aAAa;IAO7B,WAAW,CAAC,IAAI,EAAE,aAAa;IAO/B,QAAQ;IAUR,IAAI,YAAY,WAEf;IAED,cAAc,CAAC,MAAM,EAAE,MAAM;IAI7B,cAAc,CAAC,MAAM,EAAE,MAAM;IAI7B,sBAAsB;IAOtB,aAAa,CAAC,IAAI,EAAE,IAAI;IAQxB,eAAe,CAAC,IAAI,EAAE,aAAa;IAuCnC,oBAAoB,CAAC,IAAI,EAAE,aAAa;IAsCxC,eAAe;IAiDf,cAAc;IAQd,iBAAiB;IA8CjB,WAAW,GAAI,GAAG,cAAc,UAS/B;IAED,aAAa,GAAI,GAAG,cAAc,UAUjC;;IAYD,qBAAqB,CAAC,IAAI,EAAE,IAAI,GAAI,IAAI;IAWxC,eAAe,CAAC,IAAI,EAAE,IAAI;IAK1B,eAAe;IAIf,aAAa,CAAC,MAAM,EAAE,eAAe;IAMrC,eAAe,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI;IAM5C,aAAa;IAMb,MAAM;IAmBA,QAAQ;IAyCd,OAAO;IAIP,MAAM,kDAgBC;CAEP"}
@@ -253,9 +253,10 @@ let Dashboard = class Dashboard extends OmegaComponent {
253
253
  this._onItemResize = (e) => {
254
254
  if (!e.item.resizing)
255
255
  return;
256
- const topOffset = this.scrollOffset;
257
- const w = this.offsetToXCoord(e.item.offsetLeft + e.item.offsetWidth) - e.item.model.x + 1;
258
- const h = this.offsetToYCoord(e.item.offsetTop + e.item.offsetHeight + topOffset) - e.item.model.y + 1;
256
+ const gap = this.model.options.gap;
257
+ // Snap to the nearest cell count so the item can shrink down to a single cell
258
+ const w = Math.max(1, Math.round((e.item.offsetWidth + gap) / (this.baseSize.w + gap)));
259
+ const h = Math.max(1, Math.round((e.item.offsetHeight + gap) / (this.baseSize.h + gap)));
259
260
  const rect = { x: e.item.model.x, y: e.item.model.y, w, h };
260
261
  this.showPlaceholder(rect);
261
262
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ADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;yCACX;AAGf;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;kDACS;AAGlC;IADC,QAAQ,CAAC,mBAAmB,CAAC;wCACd;AAGhB;IADC,KAAK,CAAC,cAAc,CAAC;4CACD;AAGrB;IADC,KAAK,CAAC,kBAAkB,CAAC;0CACF;AAGxB;IADC,KAAK,CAAC,mBAAmB,CAAC;8CACC;AAG5B;IADC,KAAK,CAAC,YAAY,CAAC;6CACU;AA7BlB,SAAS;IADrB,aAAa,CAAC,cAAc,CAAC;GACjB,SAAS,CAubrB","sourcesContent":["import { ComponentFactory, ComponentStore, Layout, OmegaComponent, dom, Rect, Container, Size } from '@omegagrid/core';\nimport { html } from 'lit';\nimport { customElement, property, query, queryAll } from 'lit/decorators.js';\nimport { map } from 'lit/directives/map.js';\nimport { style } from './dashboard.style';\nimport { DashboardItemModel, DashboardModel } from '../model';\nimport { DashboardSource } from '../types';\nimport { DashboardItem } from './dashboardItem';\n\nexport class DashboardEvent extends Event {\n\n\treadonly item: DashboardItem;\n\treadonly model: DashboardItemModel;\n\n\tconstructor(type: string, args: Partial<DashboardEvent>) {\n\t\tsuper(`dashboard.${type}`, {bubbles: true, composed: true});\n\t\tObject.assign(this, args);\n\t}\n}\n\n@customElement('og-dashboard')\nexport class Dashboard extends OmegaComponent implements Layout {\n\n\tstatic styles = [OmegaComponent.styles, style];\n\n\t@property({type: Object})\n\tmodel: DashboardModel;\n\n\t@property({type: Boolean, reflect: true})\n\tdesignMode = false;\n\n\t@property({type: Boolean})\n\tnoGrid = false;\n\n\t@property({type: Object})\n\tcreateComponent: ComponentFactory;\n\n\t@queryAll('og-dashboard-item')\n\titems: NodeList;\n\n\t@query('og-container')\n\tcontainer: Container;\n\n\t@query('[slot=\"content\"]')\n\tcontent: HTMLDivElement;\n\n\t@query('.item-placeholder')\n\tplaceholder: HTMLDivElement;\n\n\t@query('.item-grid')\n\tgridCanvas: HTMLCanvasElement;\n\n\tprivate _currentItem: DashboardItem;\n\tprivate _previewPositions: Rect[];\n\tprivate _autoScrollInterval: number = null;\n\tprivate _autoScrollSpeed = { x: 0, y: 0 };\n\tprivate _isResizing = false;\n\n\treadonly components = new ComponentStore<HTMLElement & Layout>(\n\t\tid => this.createComponent ? this.createComponent(id) as HTMLElement & Layout : null\n\t);\n\n\tprivate _baseSize: Size;\n\tget baseSize() {\n\t\tif (this._baseSize) return this._baseSize;\n\t\tconst { columns, columnWidth, rows, rowHeight, gap } = this.model.options;\n\n\t\tthis._baseSize = {\n\t\t\tw: columnWidth || (columns ? (this.container.clientWidth - ((columns + 1) * gap)) / columns : null),\n\t\t\th: rowHeight || (rows ? (this.container.clientHeight - ((rows + 1) * gap)) / rows : null),\n\t\t};\n\n\t\tif (this._baseSize.w == null) this._baseSize.w = this._baseSize.h;\n\t\tif (this._baseSize.h == null) this._baseSize.h = this._baseSize.w;\n\t\treturn this._baseSize;\n\t}\n\n\tstartMove(item: DashboardItem) {\n\t\tthis._currentItem = item;\n\t\tthis._currentItem.classList.toggle('active', true);\n\t\tthis.classList.toggle('moving', true);\n\t\tthis._isResizing = false;\n\t}\n\n\tstartResize(item: DashboardItem) {\n\t\tthis._currentItem = item;\n\t\tthis._currentItem.classList.toggle('active', true);\n\t\tthis.classList.toggle('moving', true);\n\t\tthis._isResizing = true;\n\t}\n\n\tstopMove() {\n\t\tif (!this._currentItem) return;\n\t\tthis._currentItem.classList.toggle('active', false);\n\t\tthis._currentItem = null;\n\t\tthis.classList.toggle('moving', false);\n\t\tthis.hidePlaceholder();\n\t\tthis.updatePreviewPositions();\n\t\tthis.stopAutoScroll();\n\t}\n\n\tget scrollOffset() {\n\t\treturn this.container?.verticalSlider?.value || 0;\n\t}\n\n\toffsetToXCoord(offset: number) {\n\t\treturn Math.max(0, Math.floor(offset / (this.baseSize.w + this.model.options.gap)));\n\t}\n\n\toffsetToYCoord(offset: number) {\n\t\treturn Math.max(0, Math.floor(offset / (this.baseSize.h + this.model.options.gap)));\n\t}\n\n\tupdatePreviewPositions() {\n\t\tif (!this._previewPositions) return;\n\t\tthis.model.updatePositions(this._previewPositions);\n\t\tthis._previewPositions = null;\n\t\tthis.layout();\n\t}\n\n\tpreviewLayout(rect: Rect) {\n\t\tthis._previewPositions = this.model.calculatePositions(this._currentItem.model, rect);\n\t\tthis._previewPositions.forEach((rect, i) => {\n\t\t\tconst item = this.items[i] as DashboardItem;\n\t\t\tif (item && item != this._currentItem) this.setItemPosition(item, rect);\n\t\t});\n\t}\n\n\tcheckAutoScroll(item: DashboardItem) {\n\t\tif (!this.container) return;\n\n\t\t// For resize, also expand content area preemptively so there's space to scroll into\n\t\tif (this._isResizing) {\n\t\t\tthis.checkResizeExpansion(item);\n\t\t}\n\n\t\tconst threshold = 50; // pixels from edge to trigger scroll\n\t\tconst scrollSpeed = 5; // pixels per frame\n\t\tconst containerRect = this.container.getBoundingClientRect();\n\t\tconst itemRect = item.getBoundingClientRect();\n\n\t\tlet scrollX = 0;\n\t\tlet scrollY = 0;\n\n\t\t// Check horizontal scrolling\n\t\tif (itemRect.right > containerRect.right - threshold) {\n\t\t\tscrollX = scrollSpeed;\n\t\t} else if (itemRect.left < containerRect.left + threshold) {\n\t\t\tscrollX = -scrollSpeed;\n\t\t}\n\n\t\t// Check vertical scrolling\n\t\tif (itemRect.bottom > containerRect.bottom - threshold) {\n\t\t\tscrollY = scrollSpeed;\n\t\t} else if (itemRect.top < containerRect.top + threshold) {\n\t\t\tscrollY = -scrollSpeed;\n\t\t}\n\n\t\tthis._autoScrollSpeed = { x: scrollX, y: scrollY };\n\n\t\tif ((scrollX !== 0 || scrollY !== 0) && !this._autoScrollInterval) {\n\t\t\tthis.startAutoScroll();\n\t\t} else if (scrollX === 0 && scrollY === 0 && this._autoScrollInterval) {\n\t\t\tthis.stopAutoScroll();\n\t\t}\n\t}\n\n\tcheckResizeExpansion(item: DashboardItem) {\n\t\tif (!this.container || !this.model) return;\n\n\t\tconst baseSize = this.baseSize;\n\t\tconst gap = this.model.options.gap;\n\n\t\t// Item edges in content coordinates - offsetTop is already content-relative\n\t\tconst itemBottom = item.offsetTop + item.offsetHeight;\n\t\tconst itemRight = item.offsetLeft + item.offsetWidth;\n\t\tconst currentContentHeight = this.content.offsetHeight;\n\t\tconst currentContentWidth = this.content.offsetWidth;\n\n\t\t// Threshold: expand when item is within 1 grid cell of the content edge\n\t\tconst thresholdY = baseSize.h + gap;\n\t\tconst thresholdX = baseSize.w + gap;\n\n\t\tlet newHeight = currentContentHeight;\n\t\tlet newWidth = currentContentWidth;\n\t\tlet needsUpdate = false;\n\n\t\tif (itemBottom > currentContentHeight - thresholdY) {\n\t\t\tnewHeight = currentContentHeight + 5 * (baseSize.h + gap);\n\t\t\tneedsUpdate = true;\n\t\t}\n\n\t\tif (itemRight > currentContentWidth - thresholdX) {\n\t\t\tnewWidth = currentContentWidth + 5 * (baseSize.w + gap);\n\t\t\tneedsUpdate = true;\n\t\t}\n\n\t\tif (needsUpdate) {\n\t\t\tdom.setSize(this.content, { w: newWidth, h: newHeight });\n\t\t\tthis.model.size.w = Math.max(this.model.size.w, Math.ceil((newWidth - gap) / (baseSize.w + gap)));\n\t\t\tthis.model.size.h = Math.max(this.model.size.h, Math.ceil((newHeight - gap) / (baseSize.h + gap)));\n\t\t\tthis.drawGrid();\n\t\t}\n\t}\n\n\tstartAutoScroll() {\n\t\tif (this._autoScrollInterval) return;\n\n\t\tthis._autoScrollInterval = window.setInterval(() => {\n\t\t\tif (!this.container) return;\n\n\t\t\tconst { x, y } = this._autoScrollSpeed;\n\n\t\t\t// Scroll vertically\n\t\t\tif (y !== 0 && this.container.verticalSlider) {\n\t\t\t\tconst currentScroll = this.container.verticalSlider.value;\n\t\t\t\tconst maxScroll = this.container.verticalSlider.maxValue;\n\n\t\t\t\t// Expand content area if scrolling down near the bottom\n\t\t\t\tif (y > 0 && currentScroll >= maxScroll * 0.85) {\n\t\t\t\t\tthis.expandContentArea();\n\t\t\t\t\t// After expanding, continue scrolling\n\t\t\t\t\tconst newMaxScroll = this.container.verticalSlider.maxValue;\n\t\t\t\t\tthis.container.scrollVerticalTo(Math.min(newMaxScroll, currentScroll + y));\n\t\t\t\t} else {\n\t\t\t\t\tconst newScroll = Math.max(0, Math.min(maxScroll, currentScroll + y));\n\t\t\t\t\tthis.container.scrollVerticalTo(newScroll);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Scroll horizontally\n\t\t\tif (x !== 0 && this.container.horizontalSlider) {\n\t\t\t\tconst currentScroll = this.container.horizontalSlider.value;\n\t\t\t\tconst maxScroll = this.container.horizontalSlider.maxValue;\n\n\t\t\t\t// Expand content area if scrolling right near the edge\n\t\t\t\tif (x > 0 && currentScroll >= maxScroll * 0.85) {\n\t\t\t\t\tthis.expandContentArea();\n\t\t\t\t\t// After expanding, continue scrolling\n\t\t\t\t\tconst newMaxScroll = this.container.horizontalSlider.maxValue;\n\t\t\t\t\tthis.container.scrollHorizontalTo(Math.min(newMaxScroll, currentScroll + x));\n\t\t\t\t} else {\n\t\t\t\t\tconst newScroll = Math.max(0, Math.min(maxScroll, currentScroll + x));\n\t\t\t\t\tthis.container.scrollHorizontalTo(newScroll);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// During resize, update item size with new scroll offset so placeholder follows smoothly\n\t\t\tif (this._isResizing && this._currentItem) {\n\t\t\t\tthis._currentItem.updateResize();\n\t\t\t}\n\t\t}, 16); // ~60fps\n\t}\n\n\tstopAutoScroll() {\n\t\tif (this._autoScrollInterval) {\n\t\t\twindow.clearInterval(this._autoScrollInterval);\n\t\t\tthis._autoScrollInterval = null;\n\t\t}\n\t\tthis._autoScrollSpeed = { x: 0, y: 0 };\n\t}\n\n\texpandContentArea() {\n\t\tif (!this.model || !this._currentItem) return;\n\n\t\t// Calculate how much space we need based on current item position\n\t\tconst topOffset = this.scrollOffset;\n\t\tconst itemBottom = this._currentItem.offsetTop + this._currentItem.offsetHeight + topOffset;\n\t\tconst itemRight = this._currentItem.offsetLeft + this._currentItem.offsetWidth;\n\n\t\tconst currentContentHeight = this.content.offsetHeight;\n\t\tconst currentContentWidth = this.content.offsetWidth;\n\n\t\t// Expand by 2 grid cells if needed\n\t\tconst expandRows = 2;\n\t\tconst expandCols = 2;\n\t\tconst baseSize = this.baseSize;\n\t\tconst gap = this.model.options.gap;\n\n\t\tlet newHeight = currentContentHeight;\n\t\tlet newWidth = currentContentWidth;\n\n\t\t// Check if we need more height - only expand, never shrink\n\t\tif (itemBottom > currentContentHeight - gap * 2) {\n\t\t\tnewHeight = Math.max(currentContentHeight, currentContentHeight + expandRows * (baseSize.h + gap));\n\t\t}\n\n\t\t// Check if we need more width - only expand, never shrink\n\t\tif (itemRight > currentContentWidth - gap * 2) {\n\t\t\tnewWidth = Math.max(currentContentWidth, currentContentWidth + expandCols * (baseSize.w + gap));\n\t\t}\n\n\t\t// Only update if size actually changed\n\t\tif (newHeight !== currentContentHeight || newWidth !== currentContentWidth) {\n\t\t\tdom.setSize(this.content, { w: newWidth, h: newHeight });\n\n\t\t\t// Update model size to match new content dimensions\n\t\t\tconst newModelWidth = Math.ceil((newWidth - gap) / (baseSize.w + gap));\n\t\t\tconst newModelHeight = Math.ceil((newHeight - gap) / (baseSize.h + gap));\n\n\t\t\t// Only update if model size increased\n\t\t\tthis.model.size.w = Math.max(this.model.size.w, newModelWidth);\n\t\t\tthis.model.size.h = Math.max(this.model.size.h, newModelHeight);\n\n\t\t\tthis.drawGrid();\n\t\t}\n\t}\n\n\t_onItemMove = (e: DashboardEvent) => {\n\t\tif (!e.item.moving) return;\n\t\tconst topOffset = this.scrollOffset;\n\t\tconst x = this.offsetToXCoord(e.item.offsetLeft);\n\t\tconst y = this.offsetToYCoord(e.item.offsetTop + topOffset);\n\t\tconst rect: Rect = {x, y, w: e.item.model.w, h: e.item.model.h};\n\t\tthis.showPlaceholder(rect);\n\t\tthis.previewLayout(rect);\n\t\tthis.checkAutoScroll(e.item);\n\t}\n\n\t_onItemResize = (e: DashboardEvent) => {\n\t\tif (!e.item.resizing) return;\n\t\tconst topOffset = this.scrollOffset;\n\t\tconst w = this.offsetToXCoord(e.item.offsetLeft + e.item.offsetWidth) - e.item.model.x + 1;\n\t\tconst h = this.offsetToYCoord(e.item.offsetTop + e.item.offsetHeight + topOffset) - e.item.model.y + 1;\n\t\tconst rect: Rect = {x: e.item.model.x, y: e.item.model.y, w, h};\n\t\tthis.showPlaceholder(rect);\n\t\tthis.previewLayout(rect);\n\t\tthis.checkAutoScroll(e.item);\n\t}\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.addEventListener('dashboard.movestart', (e: DashboardEvent) => this.startMove(e.item));\n\t\tthis.addEventListener('dashboard.resizestart', (e: DashboardEvent) => this.startResize(e.item));\n\t\tthis.addEventListener('dashboard.movestop', () => this.stopMove());\n\t\tthis.addEventListener('dashboard.resizestop', () => this.stopMove());\n\t\tthis.addEventListener('dashboard.move', this._onItemMove);\n\t\tthis.addEventListener('dashboard.resize', this._onItemResize);\n\t}\n\n\tcalculateItemLocation(item: Rect) : Rect {\n\t\tconst baseSize = this.baseSize;\n\t\tconst gap = this.model.options.gap;\n\t\treturn {\n\t\t\tx: item.x * (baseSize.w + gap) + gap,\n\t\t\ty: item.y * (baseSize.h + gap) + gap,\n\t\t\tw: item.w * (baseSize.w + gap) - gap,\n\t\t\th: item.h * (baseSize.h + gap) - gap,\n\t\t};\n\t}\n\n\tshowPlaceholder(rect: Rect) {\n\t\tdom.showElement(this.placeholder);\n\t\tthis.setItemPosition(this.placeholder, rect);\n\t}\n\n\thidePlaceholder() {\n\t\tdom.hideElement(this.placeholder);\n\t}\n\n\tsetSourceData(source: DashboardSource) {\n\t\tthis.components.clear();\n\t\tthis.model = new DashboardModel(source);\n\t\tthis.model.detectAndFixCollisions();\n\t}\n\n\tsetItemPosition(elm: HTMLElement, rect: Rect) {\n\t\tconst {x, y, w, h} = this.calculateItemLocation(rect);\n\t\tdom.setSize(elm, { w, h});\n\t\tdom.setPosition(elm, {l: x, t: y});\n\t}\n\n\tfixCollisions() {\n\t\tif (!this.model) return;\n\t\tthis.model.detectAndFixCollisions();\n\t\tthis.layout();\n\t}\n\n\tlayout() {\n\t\tthis._baseSize = null;\n\t\tif (!this.model) return;\n\t\tthis.items?.forEach((item: DashboardItem) => this.setItemPosition(item, item.model));\n\n\t\tconst h = Math.max(\n\t\t\tthis.model.size.h * (this.baseSize.h + this.model.options.gap) + this.model.options.gap,\n\t\t\tthis.container.clientHeight\n\t\t);\n\n\t\tdom.setSize(this.content, {\n\t\t\tw: this.model.size.w * (this.baseSize.w + this.model.options.gap) + this.model.options.gap,\n\t\t\th: h\n\t\t});\n\n\t\tthis.items?.forEach((item: DashboardItem) => item.layout());\n\t\tthis.drawGrid();\n\t}\n\n\tasync drawGrid() {\n\t\tif (!this.gridCanvas) return;\n\t\tif (this.container.isUpdatePending) await this.container.updateComplete;\n\n\t\tconst ctx = this.gridCanvas.getContext('2d');\n\t\tif (!ctx) return;\n\n\t\tconst gap = this.model.options.gap;\n\t\tconst baseSize = this.baseSize;\n\n\t\tthis.gridCanvas.style.width = '100%';\n\t\tthis.gridCanvas.style.height = '100%';\n\t\tconst width = this.gridCanvas.offsetWidth;\n\t\tthis.gridCanvas.width = width;\n\t\tconst height = this.gridCanvas.offsetHeight;\n\t\tthis.gridCanvas.height = height;\n\t\tconst columns = width / baseSize.w;\n\t\tconst rows = height / baseSize.h;\n\n\n\t\tctx.clearRect(0, 0, width, height);\n\t\tctx.strokeStyle = 'rgba(116,116,116,0.2)';\n\t\tctx.lineWidth = 1;\n\n\t\tfor (let i = 0; i <= columns; i++) {\n\t\t\tconst x = Math.round(i * (baseSize.w + gap) + gap / 2) + 0.5;\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(x, 0);\n\t\t\tctx.lineTo(x, height);\n\t\t\tctx.stroke();\n\t\t}\n\n\t\tfor (let i = 0; i <= rows; i++) {\n\t\t\tconst y = Math.round(i * (baseSize.h + gap) + gap / 2) + 0.5;\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(0, y);\n\t\t\tctx.lineTo(width, y);\n\t\t\tctx.stroke();\n\t\t}\n\t}\n\n\tupdated() {\n\t\tthis.layout();\n\t}\n\n\trender = () => this.model ? html`\n\t\t<og-container>\n\t\t\t<div slot=\"content\">\n\t\t\t\t${this.designMode ? html`\n\t\t\t\t\t${this.noGrid ? '' : html`<canvas class=\"item-grid\"></canvas>`}\n\t\t\t\t\t<div class=\"item-placeholder\"></div>\n\t\t\t\t` : null}\n\t\t\t\t${map(this.model.items, item => html`\n\t\t\t\t\t<og-dashboard-item\n\t\t\t\t\t\t?designMode=\"${this.designMode}\"\n\t\t\t\t\t\t.model=\"${item}\"\n\t\t\t\t\t\t.components=\"${this.components}\">\n\t\t\t\t\t</og-dashboard-item>\n\t\t\t\t`)}\n\t\t\t</div>\n\t\t</og-container>\n\t` : '';\n\n}\n"]}
1
+ {"version":3,"file":"dashboard.js","sourceRoot":"","sources":["../../src/ui/dashboard.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAoB,cAAc,EAAU,cAAc,EAAE,GAAG,EAAyB,MAAM,iBAAiB,CAAC;AACvH,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAsB,cAAc,EAAE,MAAM,UAAU,CAAC;AAI9D,MAAM,OAAO,cAAe,SAAQ,KAAK;IAKxC,YAAY,IAAY,EAAE,IAA6B;QACtD,KAAK,CAAC,aAAa,IAAI,EAAE,EAAE,EAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;QAC5D,MAAM,CAAC,MAAM,CAAC,IAAI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AAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;YAC7D,GAAG,CAAC,SAAS,EAAE,CAAC;YAChB,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YACjB,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YACrB,GAAG,CAAC,MAAM,EAAE,CAAC;QACd,CAAC;IACF,CAAC;IAED,OAAO;QACN,IAAI,CAAC,MAAM,EAAE,CAAC;IACf,CAAC;;AAlaM,gBAAM,GAAG,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,AAAjC,CAAkC;AAG/C;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;wCACH;AAGtB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;6CACtB;AAGnB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;yCACX;AAGf;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;kDACS;AAGlC;IADC,QAAQ,CAAC,mBAAmB,CAAC;wCACd;AAGhB;IADC,KAAK,CAAC,cAAc,CAAC;4CACD;AAGrB;IADC,KAAK,CAAC,kBAAkB,CAAC;0CACF;AAGxB;IADC,KAAK,CAAC,mBAAmB,CAAC;8CACC;AAG5B;IADC,KAAK,CAAC,YAAY,CAAC;6CACU;AA7BlB,SAAS;IADrB,aAAa,CAAC,cAAc,CAAC;GACjB,SAAS,CAwbrB","sourcesContent":["import { ComponentFactory, ComponentStore, Layout, OmegaComponent, dom, Rect, Container, Size } from '@omegagrid/core';\nimport { html } from 'lit';\nimport { customElement, property, query, queryAll } from 'lit/decorators.js';\nimport { map } from 'lit/directives/map.js';\nimport { style } from './dashboard.style';\nimport { DashboardItemModel, DashboardModel } from '../model';\nimport { DashboardSource } from '../types';\nimport { DashboardItem } from './dashboardItem';\n\nexport class DashboardEvent extends Event {\n\n\treadonly item: DashboardItem;\n\treadonly model: DashboardItemModel;\n\n\tconstructor(type: string, args: Partial<DashboardEvent>) {\n\t\tsuper(`dashboard.${type}`, {bubbles: true, composed: true});\n\t\tObject.assign(this, args);\n\t}\n}\n\n@customElement('og-dashboard')\nexport class Dashboard extends OmegaComponent implements Layout {\n\n\tstatic styles = [OmegaComponent.styles, style];\n\n\t@property({type: Object})\n\tmodel: DashboardModel;\n\n\t@property({type: Boolean, reflect: true})\n\tdesignMode = false;\n\n\t@property({type: Boolean})\n\tnoGrid = false;\n\n\t@property({type: Object})\n\tcreateComponent: ComponentFactory;\n\n\t@queryAll('og-dashboard-item')\n\titems: NodeList;\n\n\t@query('og-container')\n\tcontainer: Container;\n\n\t@query('[slot=\"content\"]')\n\tcontent: HTMLDivElement;\n\n\t@query('.item-placeholder')\n\tplaceholder: HTMLDivElement;\n\n\t@query('.item-grid')\n\tgridCanvas: HTMLCanvasElement;\n\n\tprivate _currentItem: DashboardItem;\n\tprivate _previewPositions: Rect[];\n\tprivate _autoScrollInterval: number = null;\n\tprivate _autoScrollSpeed = { x: 0, y: 0 };\n\tprivate _isResizing = false;\n\n\treadonly components = new ComponentStore<HTMLElement & Layout>(\n\t\tid => this.createComponent ? this.createComponent(id) as HTMLElement & Layout : null\n\t);\n\n\tprivate _baseSize: Size;\n\tget baseSize() {\n\t\tif (this._baseSize) return this._baseSize;\n\t\tconst { columns, columnWidth, rows, rowHeight, gap } = this.model.options;\n\n\t\tthis._baseSize = {\n\t\t\tw: columnWidth || (columns ? (this.container.clientWidth - ((columns + 1) * gap)) / columns : null),\n\t\t\th: rowHeight || (rows ? (this.container.clientHeight - ((rows + 1) * gap)) / rows : null),\n\t\t};\n\n\t\tif (this._baseSize.w == null) this._baseSize.w = this._baseSize.h;\n\t\tif (this._baseSize.h == null) this._baseSize.h = this._baseSize.w;\n\t\treturn this._baseSize;\n\t}\n\n\tstartMove(item: DashboardItem) {\n\t\tthis._currentItem = item;\n\t\tthis._currentItem.classList.toggle('active', true);\n\t\tthis.classList.toggle('moving', true);\n\t\tthis._isResizing = false;\n\t}\n\n\tstartResize(item: DashboardItem) {\n\t\tthis._currentItem = item;\n\t\tthis._currentItem.classList.toggle('active', true);\n\t\tthis.classList.toggle('moving', true);\n\t\tthis._isResizing = true;\n\t}\n\n\tstopMove() {\n\t\tif (!this._currentItem) return;\n\t\tthis._currentItem.classList.toggle('active', false);\n\t\tthis._currentItem = null;\n\t\tthis.classList.toggle('moving', false);\n\t\tthis.hidePlaceholder();\n\t\tthis.updatePreviewPositions();\n\t\tthis.stopAutoScroll();\n\t}\n\n\tget scrollOffset() {\n\t\treturn this.container?.verticalSlider?.value || 0;\n\t}\n\n\toffsetToXCoord(offset: number) {\n\t\treturn Math.max(0, Math.floor(offset / (this.baseSize.w + this.model.options.gap)));\n\t}\n\n\toffsetToYCoord(offset: number) {\n\t\treturn Math.max(0, Math.floor(offset / (this.baseSize.h + this.model.options.gap)));\n\t}\n\n\tupdatePreviewPositions() {\n\t\tif (!this._previewPositions) return;\n\t\tthis.model.updatePositions(this._previewPositions);\n\t\tthis._previewPositions = null;\n\t\tthis.layout();\n\t}\n\n\tpreviewLayout(rect: Rect) {\n\t\tthis._previewPositions = this.model.calculatePositions(this._currentItem.model, rect);\n\t\tthis._previewPositions.forEach((rect, i) => {\n\t\t\tconst item = this.items[i] as DashboardItem;\n\t\t\tif (item && item != this._currentItem) this.setItemPosition(item, rect);\n\t\t});\n\t}\n\n\tcheckAutoScroll(item: DashboardItem) {\n\t\tif (!this.container) return;\n\n\t\t// For resize, also expand content area preemptively so there's space to scroll into\n\t\tif (this._isResizing) {\n\t\t\tthis.checkResizeExpansion(item);\n\t\t}\n\n\t\tconst threshold = 50; // pixels from edge to trigger scroll\n\t\tconst scrollSpeed = 5; // pixels per frame\n\t\tconst containerRect = this.container.getBoundingClientRect();\n\t\tconst itemRect = item.getBoundingClientRect();\n\n\t\tlet scrollX = 0;\n\t\tlet scrollY = 0;\n\n\t\t// Check horizontal scrolling\n\t\tif (itemRect.right > containerRect.right - threshold) {\n\t\t\tscrollX = scrollSpeed;\n\t\t} else if (itemRect.left < containerRect.left + threshold) {\n\t\t\tscrollX = -scrollSpeed;\n\t\t}\n\n\t\t// Check vertical scrolling\n\t\tif (itemRect.bottom > containerRect.bottom - threshold) {\n\t\t\tscrollY = scrollSpeed;\n\t\t} else if (itemRect.top < containerRect.top + threshold) {\n\t\t\tscrollY = -scrollSpeed;\n\t\t}\n\n\t\tthis._autoScrollSpeed = { x: scrollX, y: scrollY };\n\n\t\tif ((scrollX !== 0 || scrollY !== 0) && !this._autoScrollInterval) {\n\t\t\tthis.startAutoScroll();\n\t\t} else if (scrollX === 0 && scrollY === 0 && this._autoScrollInterval) {\n\t\t\tthis.stopAutoScroll();\n\t\t}\n\t}\n\n\tcheckResizeExpansion(item: DashboardItem) {\n\t\tif (!this.container || !this.model) return;\n\n\t\tconst baseSize = this.baseSize;\n\t\tconst gap = this.model.options.gap;\n\n\t\t// Item edges in content coordinates - offsetTop is already content-relative\n\t\tconst itemBottom = item.offsetTop + item.offsetHeight;\n\t\tconst itemRight = item.offsetLeft + item.offsetWidth;\n\t\tconst currentContentHeight = this.content.offsetHeight;\n\t\tconst currentContentWidth = this.content.offsetWidth;\n\n\t\t// Threshold: expand when item is within 1 grid cell of the content edge\n\t\tconst thresholdY = baseSize.h + gap;\n\t\tconst thresholdX = baseSize.w + gap;\n\n\t\tlet newHeight = currentContentHeight;\n\t\tlet newWidth = currentContentWidth;\n\t\tlet needsUpdate = false;\n\n\t\tif (itemBottom > currentContentHeight - thresholdY) {\n\t\t\tnewHeight = currentContentHeight + 5 * (baseSize.h + gap);\n\t\t\tneedsUpdate = true;\n\t\t}\n\n\t\tif (itemRight > currentContentWidth - thresholdX) {\n\t\t\tnewWidth = currentContentWidth + 5 * (baseSize.w + gap);\n\t\t\tneedsUpdate = true;\n\t\t}\n\n\t\tif (needsUpdate) {\n\t\t\tdom.setSize(this.content, { w: newWidth, h: newHeight });\n\t\t\tthis.model.size.w = Math.max(this.model.size.w, Math.ceil((newWidth - gap) / (baseSize.w + gap)));\n\t\t\tthis.model.size.h = Math.max(this.model.size.h, Math.ceil((newHeight - gap) / (baseSize.h + gap)));\n\t\t\tthis.drawGrid();\n\t\t}\n\t}\n\n\tstartAutoScroll() {\n\t\tif (this._autoScrollInterval) return;\n\n\t\tthis._autoScrollInterval = window.setInterval(() => {\n\t\t\tif (!this.container) return;\n\n\t\t\tconst { x, y } = this._autoScrollSpeed;\n\n\t\t\t// Scroll vertically\n\t\t\tif (y !== 0 && this.container.verticalSlider) {\n\t\t\t\tconst currentScroll = this.container.verticalSlider.value;\n\t\t\t\tconst maxScroll = this.container.verticalSlider.maxValue;\n\n\t\t\t\t// Expand content area if scrolling down near the bottom\n\t\t\t\tif (y > 0 && currentScroll >= maxScroll * 0.85) {\n\t\t\t\t\tthis.expandContentArea();\n\t\t\t\t\t// After expanding, continue scrolling\n\t\t\t\t\tconst newMaxScroll = this.container.verticalSlider.maxValue;\n\t\t\t\t\tthis.container.scrollVerticalTo(Math.min(newMaxScroll, currentScroll + y));\n\t\t\t\t} else {\n\t\t\t\t\tconst newScroll = Math.max(0, Math.min(maxScroll, currentScroll + y));\n\t\t\t\t\tthis.container.scrollVerticalTo(newScroll);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Scroll horizontally\n\t\t\tif (x !== 0 && this.container.horizontalSlider) {\n\t\t\t\tconst currentScroll = this.container.horizontalSlider.value;\n\t\t\t\tconst maxScroll = this.container.horizontalSlider.maxValue;\n\n\t\t\t\t// Expand content area if scrolling right near the edge\n\t\t\t\tif (x > 0 && currentScroll >= maxScroll * 0.85) {\n\t\t\t\t\tthis.expandContentArea();\n\t\t\t\t\t// After expanding, continue scrolling\n\t\t\t\t\tconst newMaxScroll = this.container.horizontalSlider.maxValue;\n\t\t\t\t\tthis.container.scrollHorizontalTo(Math.min(newMaxScroll, currentScroll + x));\n\t\t\t\t} else {\n\t\t\t\t\tconst newScroll = Math.max(0, Math.min(maxScroll, currentScroll + x));\n\t\t\t\t\tthis.container.scrollHorizontalTo(newScroll);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// During resize, update item size with new scroll offset so placeholder follows smoothly\n\t\t\tif (this._isResizing && this._currentItem) {\n\t\t\t\tthis._currentItem.updateResize();\n\t\t\t}\n\t\t}, 16); // ~60fps\n\t}\n\n\tstopAutoScroll() {\n\t\tif (this._autoScrollInterval) {\n\t\t\twindow.clearInterval(this._autoScrollInterval);\n\t\t\tthis._autoScrollInterval = null;\n\t\t}\n\t\tthis._autoScrollSpeed = { x: 0, y: 0 };\n\t}\n\n\texpandContentArea() {\n\t\tif (!this.model || !this._currentItem) return;\n\n\t\t// Calculate how much space we need based on current item position\n\t\tconst topOffset = this.scrollOffset;\n\t\tconst itemBottom = this._currentItem.offsetTop + this._currentItem.offsetHeight + topOffset;\n\t\tconst itemRight = this._currentItem.offsetLeft + this._currentItem.offsetWidth;\n\n\t\tconst currentContentHeight = this.content.offsetHeight;\n\t\tconst currentContentWidth = this.content.offsetWidth;\n\n\t\t// Expand by 2 grid cells if needed\n\t\tconst expandRows = 2;\n\t\tconst expandCols = 2;\n\t\tconst baseSize = this.baseSize;\n\t\tconst gap = this.model.options.gap;\n\n\t\tlet newHeight = currentContentHeight;\n\t\tlet newWidth = currentContentWidth;\n\n\t\t// Check if we need more height - only expand, never shrink\n\t\tif (itemBottom > currentContentHeight - gap * 2) {\n\t\t\tnewHeight = Math.max(currentContentHeight, currentContentHeight + expandRows * (baseSize.h + gap));\n\t\t}\n\n\t\t// Check if we need more width - only expand, never shrink\n\t\tif (itemRight > currentContentWidth - gap * 2) {\n\t\t\tnewWidth = Math.max(currentContentWidth, currentContentWidth + expandCols * (baseSize.w + gap));\n\t\t}\n\n\t\t// Only update if size actually changed\n\t\tif (newHeight !== currentContentHeight || newWidth !== currentContentWidth) {\n\t\t\tdom.setSize(this.content, { w: newWidth, h: newHeight });\n\n\t\t\t// Update model size to match new content dimensions\n\t\t\tconst newModelWidth = Math.ceil((newWidth - gap) / (baseSize.w + gap));\n\t\t\tconst newModelHeight = Math.ceil((newHeight - gap) / (baseSize.h + gap));\n\n\t\t\t// Only update if model size increased\n\t\t\tthis.model.size.w = Math.max(this.model.size.w, newModelWidth);\n\t\t\tthis.model.size.h = Math.max(this.model.size.h, newModelHeight);\n\n\t\t\tthis.drawGrid();\n\t\t}\n\t}\n\n\t_onItemMove = (e: DashboardEvent) => {\n\t\tif (!e.item.moving) return;\n\t\tconst topOffset = this.scrollOffset;\n\t\tconst x = this.offsetToXCoord(e.item.offsetLeft);\n\t\tconst y = this.offsetToYCoord(e.item.offsetTop + topOffset);\n\t\tconst rect: Rect = {x, y, w: e.item.model.w, h: e.item.model.h};\n\t\tthis.showPlaceholder(rect);\n\t\tthis.previewLayout(rect);\n\t\tthis.checkAutoScroll(e.item);\n\t}\n\n\t_onItemResize = (e: DashboardEvent) => {\n\t\tif (!e.item.resizing) return;\n\t\tconst gap = this.model.options.gap;\n\t\t// Snap to the nearest cell count so the item can shrink down to a single cell\n\t\tconst w = Math.max(1, Math.round((e.item.offsetWidth + gap) / (this.baseSize.w + gap)));\n\t\tconst h = Math.max(1, Math.round((e.item.offsetHeight + gap) / (this.baseSize.h + gap)));\n\t\tconst rect: Rect = {x: e.item.model.x, y: e.item.model.y, w, h};\n\t\tthis.showPlaceholder(rect);\n\t\tthis.previewLayout(rect);\n\t\tthis.checkAutoScroll(e.item);\n\t}\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.addEventListener('dashboard.movestart', (e: DashboardEvent) => this.startMove(e.item));\n\t\tthis.addEventListener('dashboard.resizestart', (e: DashboardEvent) => this.startResize(e.item));\n\t\tthis.addEventListener('dashboard.movestop', () => this.stopMove());\n\t\tthis.addEventListener('dashboard.resizestop', () => this.stopMove());\n\t\tthis.addEventListener('dashboard.move', this._onItemMove);\n\t\tthis.addEventListener('dashboard.resize', this._onItemResize);\n\t}\n\n\tcalculateItemLocation(item: Rect) : Rect {\n\t\tconst baseSize = this.baseSize;\n\t\tconst gap = this.model.options.gap;\n\t\treturn {\n\t\t\tx: item.x * (baseSize.w + gap) + gap,\n\t\t\ty: item.y * (baseSize.h + gap) + gap,\n\t\t\tw: item.w * (baseSize.w + gap) - gap,\n\t\t\th: item.h * (baseSize.h + gap) - gap,\n\t\t};\n\t}\n\n\tshowPlaceholder(rect: Rect) {\n\t\tdom.showElement(this.placeholder);\n\t\tthis.setItemPosition(this.placeholder, rect);\n\t}\n\n\thidePlaceholder() {\n\t\tdom.hideElement(this.placeholder);\n\t}\n\n\tsetSourceData(source: DashboardSource) {\n\t\tthis.components.clear();\n\t\tthis.model = new DashboardModel(source);\n\t\tthis.model.detectAndFixCollisions();\n\t}\n\n\tsetItemPosition(elm: HTMLElement, rect: Rect) {\n\t\tconst {x, y, w, h} = this.calculateItemLocation(rect);\n\t\tdom.setSize(elm, { w, h});\n\t\tdom.setPosition(elm, {l: x, t: y});\n\t}\n\n\tfixCollisions() {\n\t\tif (!this.model) return;\n\t\tthis.model.detectAndFixCollisions();\n\t\tthis.layout();\n\t}\n\n\tlayout() {\n\t\tthis._baseSize = null;\n\t\tif (!this.model) return;\n\t\tthis.items?.forEach((item: DashboardItem) => this.setItemPosition(item, item.model));\n\n\t\tconst h = Math.max(\n\t\t\tthis.model.size.h * (this.baseSize.h + this.model.options.gap) + this.model.options.gap,\n\t\t\tthis.container.clientHeight\n\t\t);\n\n\t\tdom.setSize(this.content, {\n\t\t\tw: this.model.size.w * (this.baseSize.w + this.model.options.gap) + this.model.options.gap,\n\t\t\th: h\n\t\t});\n\n\t\tthis.items?.forEach((item: DashboardItem) => item.layout());\n\t\tthis.drawGrid();\n\t}\n\n\tasync drawGrid() {\n\t\tif (!this.gridCanvas) return;\n\t\tif (this.container.isUpdatePending) await this.container.updateComplete;\n\n\t\tconst ctx = this.gridCanvas.getContext('2d');\n\t\tif (!ctx) return;\n\n\t\tconst gap = this.model.options.gap;\n\t\tconst baseSize = this.baseSize;\n\n\t\tthis.gridCanvas.style.width = '100%';\n\t\tthis.gridCanvas.style.height = '100%';\n\t\tconst width = this.gridCanvas.offsetWidth;\n\t\tthis.gridCanvas.width = width;\n\t\tconst height = this.gridCanvas.offsetHeight;\n\t\tthis.gridCanvas.height = height;\n\t\tconst columns = width / baseSize.w;\n\t\tconst rows = height / baseSize.h;\n\n\n\t\tctx.clearRect(0, 0, width, height);\n\t\tctx.strokeStyle = 'rgba(116,116,116,0.2)';\n\t\tctx.lineWidth = 1;\n\n\t\tfor (let i = 0; i <= columns; i++) {\n\t\t\tconst x = Math.round(i * (baseSize.w + gap) + gap / 2) + 0.5;\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(x, 0);\n\t\t\tctx.lineTo(x, height);\n\t\t\tctx.stroke();\n\t\t}\n\n\t\tfor (let i = 0; i <= rows; i++) {\n\t\t\tconst y = Math.round(i * (baseSize.h + gap) + gap / 2) + 0.5;\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(0, y);\n\t\t\tctx.lineTo(width, y);\n\t\t\tctx.stroke();\n\t\t}\n\t}\n\n\tupdated() {\n\t\tthis.layout();\n\t}\n\n\trender = () => this.model ? html`\n\t\t<og-container>\n\t\t\t<div slot=\"content\">\n\t\t\t\t${this.designMode ? html`\n\t\t\t\t\t${this.noGrid ? '' : html`<canvas class=\"item-grid\"></canvas>`}\n\t\t\t\t\t<div class=\"item-placeholder\"></div>\n\t\t\t\t` : null}\n\t\t\t\t${map(this.model.items, item => html`\n\t\t\t\t\t<og-dashboard-item\n\t\t\t\t\t\t?designMode=\"${this.designMode}\"\n\t\t\t\t\t\t.model=\"${item}\"\n\t\t\t\t\t\t.components=\"${this.components}\">\n\t\t\t\t\t</og-dashboard-item>\n\t\t\t\t`)}\n\t\t\t</div>\n\t\t</og-container>\n\t` : '';\n\n}\n"]}
@@ -7,6 +7,8 @@ export declare class DashboardItem extends OmegaComponent implements Layout {
7
7
  designMode: boolean;
8
8
  container: HTMLDivElement;
9
9
  overlay: Overlay;
10
+ customOverlay: HTMLDivElement;
11
+ get overlayRenderer(): (div: HTMLDivElement, model: DashboardItemModel) => void;
10
12
  private _parent;
11
13
  private _mouseOffset;
12
14
  private _movingOffset;
@@ -1 +1 @@
1
- {"version":3,"file":"dashboardItem.d.ts","sourceRoot":"","sources":["../../src/ui/dashboardItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAO,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAGvF,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAG9C,qBACa,aAAc,SAAQ,cAAe,YAAW,MAAM;IAElE,MAAM,CAAC,MAAM,iCAgBV;IAGH,UAAU,EAAE,cAAc,CAAC,WAAW,GAAG,MAAM,CAAC,CAAC;IAGjD,KAAK,EAAE,kBAAkB,CAAC;IAG1B,UAAU,UAAS;IAGnB,SAAS,EAAE,cAAc,CAAC;IAG1B,OAAO,EAAE,OAAO,CAAC;IAEjB,OAAO,CAAC,OAAO,CAAY;IAC3B,OAAO,CAAC,YAAY,CAAqC;IACzD,OAAO,CAAC,aAAa,CAAqC;IAC1D,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,cAAc,CAAqC;IAC3D,OAAO,CAAC,eAAe,CAAiB;IACxC,OAAO,CAAC,YAAY,CAAyC;IAC7D,OAAO,CAAC,oBAAoB,CAAK;IACjC,OAAO,CAAC,eAAe,CAAoB;IAE3C,IAAI,WAAW;aATa,MAAM;cAAQ,MAAM;MASF;IAC9C,IAAI,MAAM,YAAyC;IACnD,IAAI,QAAQ,YAA4B;IAGxC,IAAI,SAAS,kCAIZ;;IAcD,iBAAiB;IAMjB,oBAAoB;IAMpB,WAAW;IAMX,UAAU,aAYR;IAEF,YAAY,GAAI,GAAG,UAAU,UAoB3B;IAEF,YAAY,GAAI,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B;IAMpB,WAAW;IAMX,UAAU,aAYR;IAEF,YAAY,GAAI,GAAG,UAAU,UAoB3B;IAEF,YAAY,GAAI,GAAG,UAAU,UAO3B;IAEF,cAAc,GAAI,GAAG,UAAU,UAG7B;IAEF,iGAAiG;IACjG,YAAY;IAMZ,OAAO,CAAC,YAAY;IAYpB,SAAS,aAEP;IAEI,MAAM;IAKZ,WAAW,CAAC,IAAI,GAAE,MAAa,EAAE,MAAM,GAAE,OAAe;IAgBxD,WAAW;IAML,OAAO;IAgBb,MAAM,6CAMJ;CAEF"}
@@ -9,6 +9,7 @@ import { css, html } from "lit";
9
9
  import { customElement, property, query } from "lit/decorators.js";
10
10
  import { Dashboard, DashboardEvent } from "./dashboard";
11
11
  let DashboardItem = class DashboardItem extends OmegaComponent {
12
+ get overlayRenderer() { return this.model?.model?.options?.overlay?.renderer; }
12
13
  get mouseOffset() { return this._mouseOffset; }
13
14
  get moving() { return this._movingOffset !== null; }
14
15
  get resizing() { return this._resizing; }
@@ -82,7 +83,9 @@ let DashboardItem = class DashboardItem extends OmegaComponent {
82
83
  };
83
84
  this.render = () => html `
84
85
  <div class="container"></div>
85
- <og-overlay></og-overlay>
86
+ ${this.overlayRenderer
87
+ ? html `<div class="overlay-custom" style="display: none"></div>`
88
+ : html `<og-overlay></og-overlay>`}
86
89
  `;
87
90
  this.addEventListener('mousedown', this._onMouseDown);
88
91
  this.addEventListener('mouseup', this._onMouseUp);
@@ -129,6 +132,12 @@ let DashboardItem = class DashboardItem extends OmegaComponent {
129
132
  c.layout();
130
133
  }
131
134
  showOverlay(text = null, loader = false) {
135
+ if (this.customOverlay) {
136
+ // custom overlay appearance is fully controlled by the renderer
137
+ dom.showElement(this.customOverlay);
138
+ this.overlayRenderer(this.customOverlay, this.model);
139
+ return;
140
+ }
132
141
  this.overlay.text = text;
133
142
  this.overlay.defaultLoader = loader;
134
143
  const opacity = this.model.model.options.overlay?.opacity ?? 1;
@@ -138,7 +147,9 @@ let DashboardItem = class DashboardItem extends OmegaComponent {
138
147
  dom.hideElement(this.container);
139
148
  }
140
149
  hideOverlay() {
141
- this.overlay.hide();
150
+ if (this.customOverlay)
151
+ dom.hideElement(this.customOverlay);
152
+ this.overlay?.hide();
142
153
  dom.showElement(this.container);
143
154
  }
144
155
  async updated() {
@@ -169,6 +180,12 @@ DashboardItem.styles = [OmegaComponent.styles, css `
169
180
  background-color: var(--og-accent-color);
170
181
  }
171
182
 
183
+ .overlay-custom {
184
+ position: absolute;
185
+ inset: 0;
186
+ z-index: 1101;
187
+ }
188
+
172
189
  .container {
173
190
  height: 100%;
174
191
  }
@@ -188,6 +205,9 @@ __decorate([
188
205
  __decorate([
189
206
  query('og-overlay')
190
207
  ], DashboardItem.prototype, "overlay", void 0);
208
+ __decorate([
209
+ query('.overlay-custom')
210
+ ], DashboardItem.prototype, "customOverlay", void 0);
191
211
  DashboardItem = __decorate([
192
212
  customElement('og-dashboard-item')
193
213
  ], DashboardItem);
@@ -1 +1 @@
1
- {"version":3,"file":"dashboardItem.js","sourceRoot":"","sources":["../../src/ui/dashboardItem.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAkB,GAAG,EAAU,cAAc,EAAW,MAAM,iBAAiB,CAAC;AACvF,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGjD,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,cAAc;IA6ChD,IAAI,WAAW,KAAK,OAAO,IAAI,CAAC,YAAY,CAAA,CAAC,CAAC;IAC9C,IAAI,MAAM,KAAK,OAAO,IAAI,CAAC,aAAa,KAAK,IAAI,CAAA,CAAC,CAAC;IACnD,IAAI,QAAQ,KAAK,OAAO,IAAI,CAAC,SAAS,CAAA,CAAC,CAAC;IAGxC,IAAI,SAA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AAC;IAEF,CAAC;;AA9LM,oBAAM,GAAG,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;EAgB1C,CAAC,AAhBW,CAgBV;AAGH;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;iDACwB;AAGjD;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;4CACC;AAG1B;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;iDACtB;AAGnB;IADC,KAAK,CAAC,YAAY,CAAC;gDACM;AAG1B;IADC,KAAK,CAAC,YAAY,CAAC;8CACH;AAjCL,aAAa;IADzB,aAAa,CAAC,mBAAmB,CAAC;GACtB,aAAa,CAuMzB","sourcesContent":["import { ComponentStore, dom, Layout, OmegaComponent, Overlay } from \"@omegagrid/core\";\nimport { css, html } from \"lit\";\nimport { customElement, property, query } from \"lit/decorators.js\";\nimport { DashboardItemModel } from \"../model\";\nimport { Dashboard, DashboardEvent } from \"./dashboard\";\n\n@customElement('og-dashboard-item')\nexport class DashboardItem extends OmegaComponent implements Layout {\n\n\tstatic styles = [OmegaComponent.styles, css`\n\t\t:host {\n\t\t\tposition: relative;\n\t\t\toverflow: hidden;\n\t\t}\n\n\t\tog-overlay {\n\t\t\tposition: absolute;\n\t\t\tinset: 0;\n\t\t\tz-index: 1101;\n\t\t\tbackground-color: var(--og-accent-color);\n\t\t}\n\n\t\t.container {\n\t\t\theight: 100%;\n\t\t}\n\t`];\n\n\t@property({type: Object})\n\tcomponents: ComponentStore<HTMLElement & Layout>;\n\n\t@property({type: Object})\n\tmodel: DashboardItemModel;\n\n\t@property({type: Boolean, reflect: true})\n\tdesignMode = false;\n\n\t@query('.container')\n\tcontainer: HTMLDivElement;\n\t\n\t@query('og-overlay')\n\toverlay: Overlay;\n\n\tprivate _parent: Dashboard;\n\tprivate _mouseOffset: {top: number, left: number} = null;\n\tprivate _movingOffset: {top: number, left: number} = null;\n\tprivate _resizing = false;\n\tprivate _elementOffset: {top: number, left: number} = null;\n\tprivate _resizeObserver: ResizeObserver;\n\tprivate _initialSize: {width: number, height: number} = null;\n\tprivate _initialScrollOffset = 0;\n\tprivate _lastMouseEvent: MouseEvent = null;\n\n\tget mouseOffset() { return this._mouseOffset }\n\tget moving() { return this._movingOffset !== null }\n\tget resizing() { return this._resizing }\n\n\n\tget component() {\n\t\tif (!this.model) return null;\n\t\tif (!this.components) return null;\n\t\treturn this.components.get(this.model.id);\n\t}\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.addEventListener('mousedown', this._onMouseDown);\n\t\tthis.addEventListener('mouseup', this._onMouseUp);\n\t\tthis._resizeObserver = new ResizeObserver(() => {\n\t\t\t// Only dispatch resize event if not manually resizing\n\t\t\tif (!this._resizing) {\n\t\t\t\tthis.dispatchEvent(new DashboardEvent('resize', {item: this, model: this.model}));\n\t\t\t}\n\t\t});\n\t}\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\t\tthis._resizeObserver.observe(this);\n\t\tthis._parent = dom.findParent<Dashboard>(this, elm => elm instanceof Dashboard);\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.clearEvents();\n\t\tthis._parent = null;\n\t\tthis._resizeObserver.unobserve(this);\n\t}\n\n\tclearEvents() {\n\t\tthis._parent.removeEventListener('mouseup', this._onMouseUp);\n\t\tthis._parent.removeEventListener('mousemove', this._onMouseMove);\n\t\tthis._parent.removeEventListener('mousemove', this._onMouseResize);\n\t}\n\n\t_onMouseUp = () => {\n\t\tif (this.resizing) {\n\t\t\tthis.dispatchEvent(new DashboardEvent('resizestop', {item: this, model: this.model}));\n\t\t} else if (this.moving) {\n\t\t\tthis.dispatchEvent(new DashboardEvent('movestop', {item: this, model: this.model}));\n\t\t}\n\n\t\tthis._movingOffset = null;\n\t\tthis._resizing = false;\n\t\tthis._initialSize = null;\n\t\tthis._lastMouseEvent = null;\n\t\tthis.clearEvents();\n\t};\n\n\t_onMouseDown = (e: MouseEvent) => {\n\t\tif (!this._parent.designMode) return;\n\t\tconst scrollOffset = this._parent.scrollOffset;\n\t\tthis._mouseOffset = {top: e.offsetY, left: e.offsetX};\n\t\tif (e.offsetX > this.offsetWidth - 20 && e.offsetY > this.offsetHeight - 20) {\n\t\t\tthis._resizing = true;\n\t\t\t// Store pure client coordinates - NO scroll offset for resize\n\t\t\tthis._movingOffset = {left: e.clientX, top: e.clientY};\n\t\t\tthis._initialSize = {width: this.offsetWidth, height: this.offsetHeight};\n\t\t\tthis._initialScrollOffset = scrollOffset;\n\t\t\tthis._parent.addEventListener('mouseup', this._onMouseUp);\n\t\t\tthis._parent.addEventListener('mousemove', this._onMouseResize);\n\t\t\tthis.dispatchEvent(new DashboardEvent('resizestart', {item: this, model: this.model}));\n\t\t} else {\n\t\t\tthis._movingOffset = {left: e.clientX, top: e.clientY + scrollOffset}; \n\t\t\tthis._elementOffset = {left: this.offsetLeft, top: this.offsetTop + scrollOffset};\n\t\t\tthis._parent.addEventListener('mouseup', this._onMouseUp);\n\t\t\tthis._parent.addEventListener('mousemove', this._onMouseMove);\n\t\t\tthis.dispatchEvent(new DashboardEvent('movestart', {item: this, model: this.model}));\n\t\t}\n\t};\n\n\t_onMouseMove = (e: MouseEvent) => {\n\t\tconst scrollOffset = this._parent.scrollOffset;\n\t\tdom.setPosition(this, {\n\t\t\tl: this._elementOffset.left + e.clientX - this._movingOffset.left,\n\t\t\tt: this._elementOffset.top + e.clientY - this._movingOffset.top + scrollOffset, \n\t\t});\n\t\tthis.dispatchEvent(new DashboardEvent('move', {item: this, model: this.model}));\n\t};\n\n\t_onMouseResize = (e: MouseEvent) => {\n\t\tthis._lastMouseEvent = e;\n\t\tthis._applyResize(e.clientX, e.clientY);\n\t};\n\n\t/** Re-trigger resize calculation with current scroll offset (called from autoscroll interval) */\n\tupdateResize() {\n\t\tif (this._lastMouseEvent) {\n\t\t\tthis._applyResize(this._lastMouseEvent.clientX, this._lastMouseEvent.clientY);\n\t\t}\n\t}\n\n\tprivate _applyResize(clientX: number, clientY: number) {\n\t\tconst scrollDelta = this._parent.scrollOffset - this._initialScrollOffset;\n\t\tconst deltaX = clientX - this._movingOffset.left;\n\t\tconst deltaY = clientY - this._movingOffset.top + scrollDelta;\n\n\t\tconst newWidth = Math.max(50, this._initialSize.width + deltaX);\n\t\tconst newHeight = Math.max(50, this._initialSize.height + deltaY);\n\n\t\tdom.setSize(this, { w: newWidth, h: newHeight });\n\t\tthis.dispatchEvent(new DashboardEvent('resize', {item: this, model: this.model}));\n\t}\n\n\t_onResize = () => {\n\t\tthis.dispatchEvent(new DashboardEvent('resize', {item: this, model: this.model}));\n\t};\n\n\tasync layout() {\n\t\tconst c = await this.component;\n\t\tif (c?.layout) c.layout();\n\t}\n\n\tshowOverlay(text: string = null, loader: boolean = false) {\n\t\tthis.overlay.text = text;\n\t\tthis.overlay.defaultLoader = loader;\n\t\tconst opacity = this.model.model.options.overlay?.opacity ?? 1;\n\t\tthis.overlay.style.opacity = opacity.toString();\n\t\tthis.overlay.show(this);\n\t\tif (opacity >= 1) dom.hideElement(this.container);\n\t}\n\n\thideOverlay() {\n\t\tthis.overlay.hide();\n\t\tdom.showElement(this.container);\n\t}\n\n\tasync updated() {\n\t\tthis.showOverlay(this.designMode ? this.model.title : null);\n\t\tconst component = await this.component;\n\t\tif (component) {\n\t\t\tdom.empty(this.container);\n\t\t\tthis.container.appendChild(component);\n\t\t}\n\t\t\t\n\t\tif (this.designMode) {\n\t\t\tthis.showOverlay(this.model.title, false);\n\t\t} else {\n\t\t\tthis.hideOverlay();\n\t\t}\n\t\t\n\t}\n\n\trender = () => html`\n\t\t<div class=\"container\"></div>\n\t\t<og-overlay></og-overlay>\n\t`;\n\n}"]}
1
+ {"version":3,"file":"dashboardItem.js","sourceRoot":"","sources":["../../src/ui/dashboardItem.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAkB,GAAG,EAAU,cAAc,EAAW,MAAM,iBAA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,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;4CACC;AAG1B;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;iDACtB;AAGnB;IADC,KAAK,CAAC,YAAY,CAAC;gDACM;AAG1B;IADC,KAAK,CAAC,YAAY,CAAC;8CACH;AAGjB;IADC,KAAK,CAAC,iBAAiB,CAAC;oDACK;AA1ClB,aAAa;IADzB,aAAa,CAAC,mBAAmB,CAAC;GACtB,aAAa,CA6NzB","sourcesContent":["import { ComponentStore, dom, Layout, OmegaComponent, Overlay } from \"@omegagrid/core\";\nimport { css, html } from \"lit\";\nimport { customElement, property, query } from \"lit/decorators.js\";\nimport { DashboardItemModel } from \"../model\";\nimport { Dashboard, DashboardEvent } from \"./dashboard\";\n\n@customElement('og-dashboard-item')\nexport class DashboardItem extends OmegaComponent implements Layout {\n\n\tstatic styles = [OmegaComponent.styles, css`\n\t\t:host {\n\t\t\tposition: relative;\n\t\t\toverflow: hidden;\n\t\t}\n\n\t\tog-overlay {\n\t\t\tposition: absolute;\n\t\t\tinset: 0;\n\t\t\tz-index: 1101;\n\t\t\tbackground-color: var(--og-accent-color);\n\t\t}\n\n\t\t.overlay-custom {\n\t\t\tposition: absolute;\n\t\t\tinset: 0;\n\t\t\tz-index: 1101;\n\t\t}\n\n\t\t.container {\n\t\t\theight: 100%;\n\t\t}\n\t`];\n\n\t@property({type: Object})\n\tcomponents: ComponentStore<HTMLElement & Layout>;\n\n\t@property({type: Object})\n\tmodel: DashboardItemModel;\n\n\t@property({type: Boolean, reflect: true})\n\tdesignMode = false;\n\n\t@query('.container')\n\tcontainer: HTMLDivElement;\n\n\t@query('og-overlay')\n\toverlay: Overlay;\n\n\t@query('.overlay-custom')\n\tcustomOverlay: HTMLDivElement;\n\n\tget overlayRenderer() { return this.model?.model?.options?.overlay?.renderer }\n\n\tprivate _parent: Dashboard;\n\tprivate _mouseOffset: {top: number, left: number} = null;\n\tprivate _movingOffset: {top: number, left: number} = null;\n\tprivate _resizing = false;\n\tprivate _elementOffset: {top: number, left: number} = null;\n\tprivate _resizeObserver: ResizeObserver;\n\tprivate _initialSize: {width: number, height: number} = null;\n\tprivate _initialScrollOffset = 0;\n\tprivate _lastMouseEvent: MouseEvent = null;\n\n\tget mouseOffset() { return this._mouseOffset }\n\tget moving() { return this._movingOffset !== null }\n\tget resizing() { return this._resizing }\n\n\n\tget component() {\n\t\tif (!this.model) return null;\n\t\tif (!this.components) return null;\n\t\treturn this.components.get(this.model.id);\n\t}\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.addEventListener('mousedown', this._onMouseDown);\n\t\tthis.addEventListener('mouseup', this._onMouseUp);\n\t\tthis._resizeObserver = new ResizeObserver(() => {\n\t\t\t// Only dispatch resize event if not manually resizing\n\t\t\tif (!this._resizing) {\n\t\t\t\tthis.dispatchEvent(new DashboardEvent('resize', {item: this, model: this.model}));\n\t\t\t}\n\t\t});\n\t}\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\t\tthis._resizeObserver.observe(this);\n\t\tthis._parent = dom.findParent<Dashboard>(this, elm => elm instanceof Dashboard);\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.clearEvents();\n\t\tthis._parent = null;\n\t\tthis._resizeObserver.unobserve(this);\n\t}\n\n\tclearEvents() {\n\t\tthis._parent.removeEventListener('mouseup', this._onMouseUp);\n\t\tthis._parent.removeEventListener('mousemove', this._onMouseMove);\n\t\tthis._parent.removeEventListener('mousemove', this._onMouseResize);\n\t}\n\n\t_onMouseUp = () => {\n\t\tif (this.resizing) {\n\t\t\tthis.dispatchEvent(new DashboardEvent('resizestop', {item: this, model: this.model}));\n\t\t} else if (this.moving) {\n\t\t\tthis.dispatchEvent(new DashboardEvent('movestop', {item: this, model: this.model}));\n\t\t}\n\n\t\tthis._movingOffset = null;\n\t\tthis._resizing = false;\n\t\tthis._initialSize = null;\n\t\tthis._lastMouseEvent = null;\n\t\tthis.clearEvents();\n\t};\n\n\t_onMouseDown = (e: MouseEvent) => {\n\t\tif (!this._parent.designMode) return;\n\t\tconst scrollOffset = this._parent.scrollOffset;\n\t\tthis._mouseOffset = {top: e.offsetY, left: e.offsetX};\n\t\tif (e.offsetX > this.offsetWidth - 20 && e.offsetY > this.offsetHeight - 20) {\n\t\t\tthis._resizing = true;\n\t\t\t// Store pure client coordinates - NO scroll offset for resize\n\t\t\tthis._movingOffset = {left: e.clientX, top: e.clientY};\n\t\t\tthis._initialSize = {width: this.offsetWidth, height: this.offsetHeight};\n\t\t\tthis._initialScrollOffset = scrollOffset;\n\t\t\tthis._parent.addEventListener('mouseup', this._onMouseUp);\n\t\t\tthis._parent.addEventListener('mousemove', this._onMouseResize);\n\t\t\tthis.dispatchEvent(new DashboardEvent('resizestart', {item: this, model: this.model}));\n\t\t} else {\n\t\t\tthis._movingOffset = {left: e.clientX, top: e.clientY + scrollOffset}; \n\t\t\tthis._elementOffset = {left: this.offsetLeft, top: this.offsetTop + scrollOffset};\n\t\t\tthis._parent.addEventListener('mouseup', this._onMouseUp);\n\t\t\tthis._parent.addEventListener('mousemove', this._onMouseMove);\n\t\t\tthis.dispatchEvent(new DashboardEvent('movestart', {item: this, model: this.model}));\n\t\t}\n\t};\n\n\t_onMouseMove = (e: MouseEvent) => {\n\t\tconst scrollOffset = this._parent.scrollOffset;\n\t\tdom.setPosition(this, {\n\t\t\tl: this._elementOffset.left + e.clientX - this._movingOffset.left,\n\t\t\tt: this._elementOffset.top + e.clientY - this._movingOffset.top + scrollOffset, \n\t\t});\n\t\tthis.dispatchEvent(new DashboardEvent('move', {item: this, model: this.model}));\n\t};\n\n\t_onMouseResize = (e: MouseEvent) => {\n\t\tthis._lastMouseEvent = e;\n\t\tthis._applyResize(e.clientX, e.clientY);\n\t};\n\n\t/** Re-trigger resize calculation with current scroll offset (called from autoscroll interval) */\n\tupdateResize() {\n\t\tif (this._lastMouseEvent) {\n\t\t\tthis._applyResize(this._lastMouseEvent.clientX, this._lastMouseEvent.clientY);\n\t\t}\n\t}\n\n\tprivate _applyResize(clientX: number, clientY: number) {\n\t\tconst scrollDelta = this._parent.scrollOffset - this._initialScrollOffset;\n\t\tconst deltaX = clientX - this._movingOffset.left;\n\t\tconst deltaY = clientY - this._movingOffset.top + scrollDelta;\n\n\t\tconst newWidth = Math.max(50, this._initialSize.width + deltaX);\n\t\tconst newHeight = Math.max(50, this._initialSize.height + deltaY);\n\n\t\tdom.setSize(this, { w: newWidth, h: newHeight });\n\t\tthis.dispatchEvent(new DashboardEvent('resize', {item: this, model: this.model}));\n\t}\n\n\t_onResize = () => {\n\t\tthis.dispatchEvent(new DashboardEvent('resize', {item: this, model: this.model}));\n\t};\n\n\tasync layout() {\n\t\tconst c = await this.component;\n\t\tif (c?.layout) c.layout();\n\t}\n\n\tshowOverlay(text: string = null, loader: boolean = false) {\n\t\tif (this.customOverlay) {\n\t\t\t// custom overlay appearance is fully controlled by the renderer\n\t\t\tdom.showElement(this.customOverlay);\n\t\t\tthis.overlayRenderer(this.customOverlay, this.model);\n\t\t\treturn;\n\t\t}\n\n\t\tthis.overlay.text = text;\n\t\tthis.overlay.defaultLoader = loader;\n\t\tconst opacity = this.model.model.options.overlay?.opacity ?? 1;\n\t\tthis.overlay.style.opacity = opacity.toString();\n\t\tthis.overlay.show(this);\n\t\tif (opacity >= 1) dom.hideElement(this.container);\n\t}\n\n\thideOverlay() {\n\t\tif (this.customOverlay) dom.hideElement(this.customOverlay);\n\t\tthis.overlay?.hide();\n\t\tdom.showElement(this.container);\n\t}\n\n\tasync updated() {\n\t\tthis.showOverlay(this.designMode ? this.model.title : null);\n\t\tconst component = await this.component;\n\t\tif (component) {\n\t\t\tdom.empty(this.container);\n\t\t\tthis.container.appendChild(component);\n\t\t}\n\t\t\t\n\t\tif (this.designMode) {\n\t\t\tthis.showOverlay(this.model.title, false);\n\t\t} else {\n\t\t\tthis.hideOverlay();\n\t\t}\n\t\t\n\t}\n\n\trender = () => html`\n\t\t<div class=\"container\"></div>\n\t\t${this.overlayRenderer\n\t\t\t? html`<div class=\"overlay-custom\" style=\"display: none\"></div>`\n\t\t\t: html`<og-overlay></og-overlay>`\n\t\t}\n\t`;\n\n}"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omegagrid/dashboard",
3
- "version": "0.10.68",
3
+ "version": "0.10.70",
4
4
  "license": "UNLICENSED",
5
5
  "description": "Dashboard component",
6
6
  "main": "./dist/index.js",
@@ -28,8 +28,8 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@fortawesome/fontawesome-svg-core": "^7.0.1",
31
- "@omegagrid/core": "^0.10.68",
32
- "@omegagrid/localize": "^0.10.68",
31
+ "@omegagrid/core": "^0.10.70",
32
+ "@omegagrid/localize": "^0.10.70",
33
33
  "date-fns": "^3.2.0",
34
34
  "lit": "^3.1.1",
35
35
  "ts-debounce": "^4.0.0"