From dfce23850b0243272599979e06ab554a04c4f81b Mon Sep 17 00:00:00 2001 From: gkrajniak Date: Wed, 10 Jun 2026 14:46:29 +0200 Subject: [PATCH 1/7] Adjust the dragging cursor Signed-off-by: gkrajniak --- .../card/dashboard-card.component.scss | 11 +++++++ .../dashboard/dashboard.component.html | 32 +++++++++++++------ .../dashboard/dashboard.component.scss | 12 +++++++ .../declarative-ui/stories/dashboard.cards.ts | 2 +- .../stories/dashboard.stories.ts | 2 +- 5 files changed, 48 insertions(+), 11 deletions(-) diff --git a/projects/ngx/declarative-ui/dashboard/card/dashboard-card.component.scss b/projects/ngx/declarative-ui/dashboard/card/dashboard-card.component.scss index c743120..5e9bfb9 100644 --- a/projects/ngx/declarative-ui/dashboard/card/dashboard-card.component.scss +++ b/projects/ngx/declarative-ui/dashboard/card/dashboard-card.component.scss @@ -34,6 +34,10 @@ padding-inline-start: var(--mfp_cardContainerPadding, 10px); padding-inline-end: var(--mfp_cardContainerPadding, 10px); + &--editing { + cursor: grab; + } + &--editing:hover { --sapTile_BorderColor: var(--sapHighlightColor, #0070f2); --sapGroup_ContentBorderColor: var(--sapHighlightColor, #0070f2); @@ -44,6 +48,13 @@ } } +// Gridstack adds .ui-draggable-dragging to the wrapping this +// card while a drag is active. Override the open-palm `grab` cursor with the +// closed-fist `grabbing` cursor for the duration of the drag. +:host-context(.ui-draggable-dragging) .component-card--editing { + cursor: grabbing !important; +} + .component-host { position: relative; height: 100%; diff --git a/projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.html b/projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.html index c95ceec..2ded5e1 100644 --- a/projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.html +++ b/projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.html @@ -23,7 +23,10 @@ @if (config().description) { - + } @@ -33,7 +36,11 @@ - + @for (card of looseCards(); track card.id) { - + Date: Wed, 10 Jun 2026 14:51:52 +0200 Subject: [PATCH 2/7] Adjust the dragging cursor Signed-off-by: gkrajniak --- .../dashboard/card/dashboard-card.component.scss | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/projects/ngx/declarative-ui/dashboard/card/dashboard-card.component.scss b/projects/ngx/declarative-ui/dashboard/card/dashboard-card.component.scss index 5e9bfb9..800d579 100644 --- a/projects/ngx/declarative-ui/dashboard/card/dashboard-card.component.scss +++ b/projects/ngx/declarative-ui/dashboard/card/dashboard-card.component.scss @@ -55,6 +55,18 @@ cursor: grabbing !important; } +// Keep the edit-mode highlight (blue border + resize-corner icon) visible on +// the dragged card. The browser stops firing :hover events during a drag, so +// we re-apply the same styles using the same Gridstack hook used for cursor. +:host-context(.ui-draggable-dragging) .component-card--editing { + --sapTile_BorderColor: var(--sapHighlightColor, #0070f2); + --sapGroup_ContentBorderColor: var(--sapHighlightColor, #0070f2); +} + +:host-context(.ui-draggable-dragging) .component-card--editing .card__resize-indicator { + opacity: 1; +} + .component-host { position: relative; height: 100%; From c75fde510c4e10aa58019a56407f4d2caf12f6e4 Mon Sep 17 00:00:00 2001 From: gkrajniak Date: Wed, 10 Jun 2026 15:48:22 +0200 Subject: [PATCH 3/7] Adjust after review Signed-off-by: gkrajniak --- .../dashboard/dashboard/dashboard.component.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.ts b/projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.ts index 3fe64ad..70b0368 100644 --- a/projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.ts +++ b/projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.ts @@ -3,10 +3,10 @@ import { DashboardCard } from '../card/dashboard-card.component'; import { addComponentToRegistry } from '../card/utils/dashboard-card-registry'; import { DiscardChangesDialog } from '../discard-changes-dialog/discard-changes-dialog.component'; import { EditCardsDialog } from '../edit-cards-dialog/edit-cards-dialog.component'; -import { UnsavedChangesDialog } from '../unsaved-changes-dialog/unsaved-changes-dialog.component'; import { CardConfig, DashboardConfig, SectionConfig } from '../models'; import { CELL_HEIGHT, COMPACT_BREAKPOINT } from '../models/constants'; import { DashboardSection } from '../section/dashboard-section.component'; +import { UnsavedChangesDialog } from '../unsaved-changes-dialog/unsaved-changes-dialog.component'; import { Component, ElementRef, @@ -145,11 +145,11 @@ export class Dashboard implements OnInit, OnDestroy { marginLeft: 0, marginRight: 0, columnOpts: { - breakpointForWindow: true, breakpoints: [ - { w: 1440, c: 12, layout: 'none' }, - { w: 1024, c: 8, layout: 'compact' }, - { w: 600, c: 1, layout: 'list' }, + { w: 4000, c: 14, layout: 'none' }, + { w: 1439, c: 12, layout: 'none' }, + { w: 1023, c: 8, layout: 'compact' }, + { w: 599, c: 4, layout: 'list' }, ], }, }), From 2c131f396699ee3aff6363506e0be7a7f9ab22c8 Mon Sep 17 00:00:00 2001 From: gkrajniak Date: Wed, 10 Jun 2026 17:07:46 +0200 Subject: [PATCH 4/7] Adjust after review Signed-off-by: gkrajniak --- .../dashboard/dashboard/dashboard.component.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.ts b/projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.ts index 70b0368..a7400ef 100644 --- a/projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.ts +++ b/projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.ts @@ -1,6 +1,6 @@ -import { ButtonSettings } from '../../models/ui-definition'; +import { ButtonSettings } from '../../models'; import { DashboardCard } from '../card/dashboard-card.component'; -import { addComponentToRegistry } from '../card/utils/dashboard-card-registry'; +import { addComponentToRegistry } from '../card/utils'; import { DiscardChangesDialog } from '../discard-changes-dialog/discard-changes-dialog.component'; import { EditCardsDialog } from '../edit-cards-dialog/edit-cards-dialog.component'; import { CardConfig, DashboardConfig, SectionConfig } from '../models'; @@ -146,8 +146,8 @@ export class Dashboard implements OnInit, OnDestroy { marginRight: 0, columnOpts: { breakpoints: [ - { w: 4000, c: 14, layout: 'none' }, - { w: 1439, c: 12, layout: 'none' }, + { w: 4000, c: 14, layout: 'compact' }, + { w: 1439, c: 12, layout: 'compact' }, { w: 1023, c: 8, layout: 'compact' }, { w: 599, c: 4, layout: 'list' }, ], From 3c945f92877e01e3f36d6ba52a9d99ee21b4e4b1 Mon Sep 17 00:00:00 2001 From: gkrajniak Date: Wed, 10 Jun 2026 17:30:35 +0200 Subject: [PATCH 5/7] Adjust after review Signed-off-by: gkrajniak --- .../dashboard/card/dashboard-card.component.scss | 9 +++++++++ .../dashboard/dashboard/dashboard.component.scss | 9 +++++++++ .../dashboard/dashboard/dashboard.component.ts | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/projects/ngx/declarative-ui/dashboard/card/dashboard-card.component.scss b/projects/ngx/declarative-ui/dashboard/card/dashboard-card.component.scss index 800d579..4bc8de9 100644 --- a/projects/ngx/declarative-ui/dashboard/card/dashboard-card.component.scss +++ b/projects/ngx/declarative-ui/dashboard/card/dashboard-card.component.scss @@ -85,6 +85,15 @@ z-index: 9; } +// In edit mode, this element doubles as Gridstack's resize handle (wired via +// gridOptions.resizable.element). Pointer events must be enabled so the +// resize drag can start; the south-east cursor mirrors what Gridstack would +// otherwise apply on its own .ui-resizable-se handle. +.component-card--editing .card__resize-indicator { + pointer-events: auto; + cursor: se-resize; +} + .card { position: relative; display: flex; diff --git a/projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.scss b/projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.scss index bc0fb0e..cf8786e 100644 --- a/projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.scss +++ b/projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.scss @@ -157,3 +157,12 @@ mfp-wc-dashboard { .grid-stack.grid-stack-dragging * { cursor: grabbing !important; } + +// Suppress the small grey diagonal-arrow SVG Gridstack draws inside its corner +// resize handles (see node_modules/gridstack/dist/gridstack.min.css — the +// .ui-resizable-{ne,nw,se,sw} rules embed an inline data: URI). The handle +// hit area stays interactive; we surface our own .card__resize-indicator +// inside the card as the edit-mode hint instead. +.grid-stack-item > .ui-resizable-handle { + background-image: none !important; +} diff --git a/projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.ts b/projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.ts index a7400ef..37298f4 100644 --- a/projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.ts +++ b/projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.ts @@ -144,6 +144,15 @@ export class Dashboard implements OnInit, OnDestroy { marginBottom: 0, marginLeft: 0, marginRight: 0, + // Use our own .card__resize-indicator (the blue chevron rendered inside + // each card in edit mode) as the resize handle, instead of Gridstack's + // generated grey-arrow handle. Documented in DDResizeOpt.element + // (gridstack/dist/types.d.ts:376). The element must have pointer-events + // enabled for resize-drag to start — see card SCSS where this is set + // in edit mode only, so view-mode interactions are unaffected. + resizable: { + element: '.card__resize-indicator', + }, columnOpts: { breakpoints: [ { w: 4000, c: 14, layout: 'compact' }, From ae29745bdc3fdf3451db276a6793344751034b51 Mon Sep 17 00:00:00 2001 From: gkrajniak Date: Wed, 10 Jun 2026 18:42:45 +0200 Subject: [PATCH 6/7] Adjust after review Signed-off-by: gkrajniak --- .../card/dashboard-card.component.html | 20 +++---- .../card/dashboard-card.component.scss | 15 ++--- .../dashboard/dashboard.component.html | 1 - .../dashboard/dashboard.component.scss | 23 ++++---- .../dashboard/dashboard.component.ts | 20 ++----- .../dashboard/models/_breakpoints.scss | 58 +++++++++++++++++++ .../dashboard/models/breakpoints.ts | 37 ++++++++++++ .../declarative-ui/dashboard/models/index.ts | 1 + .../section/dashboard-section.component.html | 2 +- .../section/dashboard-section.component.scss | 13 ++--- .../section/dashboard-section.component.ts | 23 +++++++- 11 files changed, 156 insertions(+), 57 deletions(-) create mode 100644 projects/ngx/declarative-ui/dashboard/models/_breakpoints.scss create mode 100644 projects/ngx/declarative-ui/dashboard/models/breakpoints.ts diff --git a/projects/ngx/declarative-ui/dashboard/card/dashboard-card.component.html b/projects/ngx/declarative-ui/dashboard/card/dashboard-card.component.html index ffd7bed..ec26d5b 100644 --- a/projects/ngx/declarative-ui/dashboard/card/dashboard-card.component.html +++ b/projects/ngx/declarative-ui/dashboard/card/dashboard-card.component.html @@ -6,24 +6,24 @@ class="card__remove" design="Default" icon="decline" - [accessibleName]="'Remove card: ' + (card().label || card().component)" + [accessibleName]=" + 'Remove card: ' + (card().label || card().component) + " (click)="removeCard.emit()" /> +