@memberjunction/ng-base-forms 6.1.3 → 6.1.5

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.
@@ -8,12 +8,14 @@
8
8
  */
9
9
  /**
10
10
  * Format a raw entity cell value for display in the dropdown.
11
- * - `Date` → locale date string
11
+ * - `Date` → locale date string; a SQL `date` column (pass its `sqlType`) is a calendar day that
12
+ * arrives as UTC midnight and is rendered as its stored day rather than shifted into the
13
+ * reader's zone (MJ#4210); a timestamp names an instant and stays in local time
12
14
  * - `null` / `undefined` → empty string
13
15
  * - `boolean` → `Yes` / `No`
14
16
  * - everything else → `String(value)`
15
17
  */
16
- export declare function FormatFKCell(val: unknown): string;
18
+ export declare function FormatFKCell(val: unknown, sqlType?: string | null): string;
17
19
  /**
18
20
  * In-memory filter/sort over cached rows for the FK dropdown.
19
21
  *
@@ -1 +1 @@
1
- {"version":3,"file":"fk-search-utils.d.ts","sourceRoot":"","sources":["../../../src/lib/field/fk-search-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAKjD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,EACtB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,GAC3B,CAAC,EAAE,CAQL"}
1
+ {"version":3,"file":"fk-search-utils.d.ts","sourceRoot":"","sources":["../../../src/lib/field/fk-search-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAK1E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,EACtB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,GAC3B,CAAC,EAAE,CAQL"}
@@ -6,18 +6,21 @@
6
6
  * and the empty-input "focus-show" (first N, sorted by name). Keeping them out of
7
7
  * the Angular component means they can be tested without TestBed / DI.
8
8
  */
9
+ import { IsDateOnlySQLType, FormatDateOnly } from '@memberjunction/core';
9
10
  /**
10
11
  * Format a raw entity cell value for display in the dropdown.
11
- * - `Date` → locale date string
12
+ * - `Date` → locale date string; a SQL `date` column (pass its `sqlType`) is a calendar day that
13
+ * arrives as UTC midnight and is rendered as its stored day rather than shifted into the
14
+ * reader's zone (MJ#4210); a timestamp names an instant and stays in local time
12
15
  * - `null` / `undefined` → empty string
13
16
  * - `boolean` → `Yes` / `No`
14
17
  * - everything else → `String(value)`
15
18
  */
16
- export function FormatFKCell(val) {
19
+ export function FormatFKCell(val, sqlType) {
17
20
  if (val === null || val === undefined)
18
21
  return '';
19
22
  if (val instanceof Date)
20
- return val.toLocaleDateString();
23
+ return IsDateOnlySQLType(sqlType) ? FormatDateOnly(val) : val.toLocaleDateString();
21
24
  if (typeof val === 'boolean')
22
25
  return val ? 'Yes' : 'No';
23
26
  return String(val);
@@ -1 +1 @@
1
- {"version":3,"file":"fk-search-utils.js","sourceRoot":"","sources":["../../../src/lib/field/fk-search-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,GAAY;IACvC,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IACjD,IAAI,GAAG,YAAY,IAAI;QAAE,OAAO,GAAG,CAAC,kBAAkB,EAAE,CAAC;IACzD,IAAI,OAAO,GAAG,KAAK,SAAS;QAAE,OAAO,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IACxD,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;AACrB,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,kBAAkB,CAChC,IAAsB,EACtB,KAAa,EACb,KAAa,EACb,OAA4B;IAE5B,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACrC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnB,OAAO,CAAC,GAAG,IAAI,CAAC;aACb,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aAChF,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9E,CAAC","sourcesContent":["/**\n * Pure, framework-free helpers for the FK autocomplete in {@link MjFormFieldComponent}.\n *\n * These functions hold the parts of the FK search UX that have real logic worth\n * unit-testing in isolation — cell formatting, the in-memory cached-entity filter,\n * and the empty-input \"focus-show\" (first N, sorted by name). Keeping them out of\n * the Angular component means they can be tested without TestBed / DI.\n */\n\n/**\n * Format a raw entity cell value for display in the dropdown.\n * - `Date` → locale date string\n * - `null` / `undefined` → empty string\n * - `boolean` → `Yes` / `No`\n * - everything else → `String(value)`\n */\nexport function FormatFKCell(val: unknown): string {\n if (val === null || val === undefined) return '';\n if (val instanceof Date) return val.toLocaleDateString();\n if (typeof val === 'boolean') return val ? 'Yes' : 'No';\n return String(val);\n}\n\n/**\n * In-memory filter/sort over cached rows for the FK dropdown.\n *\n * - **Empty query** → returns the first `limit` rows sorted ascending by the\n * formatted name field (the \"focus-show\" behavior).\n * - **Non-empty query** → returns every row whose formatted name field contains\n * the query as a case-insensitive substring (no limit; the full match set).\n *\n * `getName` extracts the raw name-field value for a row; formatting + comparison\n * are handled here so callers don't duplicate the rules.\n *\n * @returns A NEW array (never mutates the input) suitable for rendering.\n */\nexport function FilterCachedFKRows<T>(\n rows: ReadonlyArray<T>,\n query: string,\n limit: number,\n getName: (row: T) => unknown\n): T[] {\n const q = query.trim().toLowerCase();\n if (q.length === 0) {\n return [...rows]\n .sort((a, b) => FormatFKCell(getName(a)).localeCompare(FormatFKCell(getName(b))))\n .slice(0, limit);\n }\n return rows.filter(r => FormatFKCell(getName(r)).toLowerCase().includes(q));\n}\n"]}
1
+ {"version":3,"file":"fk-search-utils.js","sourceRoot":"","sources":["../../../src/lib/field/fk-search-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEzE;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,GAAY,EAAE,OAAuB;IAChE,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IACjD,IAAI,GAAG,YAAY,IAAI;QAAE,OAAO,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,kBAAkB,EAAE,CAAC;IAC5G,IAAI,OAAO,GAAG,KAAK,SAAS;QAAE,OAAO,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IACxD,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;AACrB,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,kBAAkB,CAChC,IAAsB,EACtB,KAAa,EACb,KAAa,EACb,OAA4B;IAE5B,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACrC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnB,OAAO,CAAC,GAAG,IAAI,CAAC;aACb,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aAChF,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9E,CAAC","sourcesContent":["/**\n * Pure, framework-free helpers for the FK autocomplete in {@link MjFormFieldComponent}.\n *\n * These functions hold the parts of the FK search UX that have real logic worth\n * unit-testing in isolation — cell formatting, the in-memory cached-entity filter,\n * and the empty-input \"focus-show\" (first N, sorted by name). Keeping them out of\n * the Angular component means they can be tested without TestBed / DI.\n */\n\nimport { IsDateOnlySQLType, FormatDateOnly } from '@memberjunction/core';\n\n/**\n * Format a raw entity cell value for display in the dropdown.\n * - `Date` → locale date string; a SQL `date` column (pass its `sqlType`) is a calendar day that\n * arrives as UTC midnight and is rendered as its stored day rather than shifted into the\n * reader's zone (MJ#4210); a timestamp names an instant and stays in local time\n * - `null` / `undefined` → empty string\n * - `boolean` → `Yes` / `No`\n * - everything else → `String(value)`\n */\nexport function FormatFKCell(val: unknown, sqlType?: string | null): string {\n if (val === null || val === undefined) return '';\n if (val instanceof Date) return IsDateOnlySQLType(sqlType) ? FormatDateOnly(val) : val.toLocaleDateString();\n if (typeof val === 'boolean') return val ? 'Yes' : 'No';\n return String(val);\n}\n\n/**\n * In-memory filter/sort over cached rows for the FK dropdown.\n *\n * - **Empty query** → returns the first `limit` rows sorted ascending by the\n * formatted name field (the \"focus-show\" behavior).\n * - **Non-empty query** → returns every row whose formatted name field contains\n * the query as a case-insensitive substring (no limit; the full match set).\n *\n * `getName` extracts the raw name-field value for a row; formatting + comparison\n * are handled here so callers don't duplicate the rules.\n *\n * @returns A NEW array (never mutates the input) suitable for rendering.\n */\nexport function FilterCachedFKRows<T>(\n rows: ReadonlyArray<T>,\n query: string,\n limit: number,\n getName: (row: T) => unknown\n): T[] {\n const q = query.trim().toLowerCase();\n if (q.length === 0) {\n return [...rows]\n .sort((a, b) => FormatFKCell(getName(a)).localeCompare(FormatFKCell(getName(b))))\n .slice(0, limit);\n }\n return rows.filter(r => FormatFKCell(getName(r)).toLowerCase().includes(q));\n}\n"]}
@@ -317,7 +317,7 @@ export declare class MjFormFieldComponent extends BaseAngularComponent implement
317
317
  AllowFKCreate: boolean;
318
318
  /** Surface used for the inline create form: a modal dialog (default) or a slide-in. */
319
319
  FKCreatePresentation: 'dialog' | 'slide-in';
320
- /** Cleanup function for scroll/resize listeners */
320
+ /** Cleanup function for the scroll/resize/outside-press listeners armed while a dropdown is open */
321
321
  private _scrollCleanup;
322
322
  /** Inline style for the fixed-position dropdown */
323
323
  get DropdownPositionStyle(): Record<string, string>;
@@ -338,12 +338,25 @@ export declare class MjFormFieldComponent extends BaseAngularComponent implement
338
338
  private portalDropdownToBody;
339
339
  /** Tracks a dropdown element we relocated to body so we can drop the reference on close. */
340
340
  private _portaledDropdownEl;
341
- /** Start listening for scroll/resize to close dropdowns */
341
+ /** Set in ngOnDestroy so deferred work (the portal microtask) knows not to touch the DOM. */
342
+ private _destroyed;
343
+ /**
344
+ * Arm the listeners that dismiss an open dropdown from outside the field: an ancestor scroll,
345
+ * a resize, and a pointer press anywhere but the field or its panel.
346
+ */
342
347
  private startScrollListener;
343
348
  /** Remove scroll/resize listeners */
344
349
  private stopScrollListener;
345
350
  /** Close all dropdown types */
346
351
  private closeAllDropdowns;
352
+ /**
353
+ * Nothing started before a dismiss may reopen the panel. Retiring the sequence orphans a
354
+ * lookup still in flight (its result is dropped at the sequence check), and cancelling the
355
+ * debounce stops a keystroke's pending search from firing after the user has left the field.
356
+ * Without this, a lookup slower than the blur grace period reopened the list with nothing
357
+ * focused, and neither Escape nor clicking away could reach it — only picking a row could.
358
+ */
359
+ private cancelPendingFKSearch;
347
360
  /** Max rows shown on an empty-input focus-show (cached fast path only). */
348
361
  private static readonly FK_FOCUS_SHOW_LIMIT;
349
362
  /** Max rows returned from a DB search. */
@@ -391,9 +404,14 @@ export declare class MjFormFieldComponent extends BaseAngularComponent implement
391
404
  private _fkQuery;
392
405
  /** Debounce timer for FK search */
393
406
  private _fkSearchTimeout;
407
+ /** The blur grace timer, so a refocus inside the grace window can cancel the close it scheduled. */
408
+ private _fkBlurTimeout;
394
409
  /** Last known FK input element for position recalculation */
395
410
  private _lastFKInputEl;
396
- /** Monotonic token so a slow DB response from a stale query can't clobber a newer one. */
411
+ /**
412
+ * Monotonic token so a slow lookup response cannot clobber a newer one — and, because every
413
+ * dismiss retires it, cannot reopen a panel the user has already closed.
414
+ */
397
415
  private _fkSearchSeq;
398
416
  /** Cached column plan for the current related entity (rebuilt on demand). */
399
417
  private _fkColumnPlan;
@@ -484,7 +502,10 @@ export declare class MjFormFieldComponent extends BaseAngularComponent implement
484
502
  * applies a saved value when it still resolves to a real field.
485
503
  */
486
504
  private ensureLinkedFieldPrefsLoaded;
487
- /** Format a raw cell value for display in the dropdown (delegates to the pure helper). */
505
+ /**
506
+ * Format a raw cell value for display in the dropdown (delegates to the pure helper). The
507
+ * related entity's column type lets a SQL `date` render as its stored day (MJ#4210).
508
+ */
488
509
  private formatCell;
489
510
  /**
490
511
  * Build the suggestion view-models from a set of plain rows (cached or DB),
@@ -595,6 +616,7 @@ export declare class MjFormFieldComponent extends BaseAngularComponent implement
595
616
  private searchCachedEntity;
596
617
  /** Hide dropdown on blur, revert to matched name if user didn't select */
597
618
  OnFKBlur(): void;
619
+ private cancelPendingFKBlur;
598
620
  /**
599
621
  * Keyboard navigation in the FK input: ArrowDown/ArrowUp move the active row,
600
622
  * Enter selects it, Escape closes the dropdown.
@@ -1 +1 @@
1
- {"version":3,"file":"form-field.component.d.ts","sourceRoot":"","sources":["../../../src/lib/field/form-field.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAsD,SAAS,EAAE,aAAa,EAAE,SAAS,EAAyB,MAAM,eAAe,CAAC;AACvL,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,UAAU,EAAc,eAAe,EAA4N,MAAM,sBAAsB,CAAC;AAEzS,OAAO,EAAE,mBAAmB,EAA4E,MAAM,wBAAwB,CAAC;AACvI,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;;AAIjE;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEvE;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,8DAA8D;IAC9D,MAAM,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,wDAAwD;IACxD,SAAS,EAAE,MAAM,CAAC;IAClB,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,4DAA4D;IAC5D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;;;;;;;;;;;OAkBG;IACH,IAAI,sBAAsB,IAAI,OAAO,CAMpC;yCAn3EU,oBAAoB;2CAApB,oBAAoB;CAo3EhC"}
@@ -1,6 +1,6 @@
1
1
  import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy, ChangeDetectorRef, inject, ElementRef, Renderer2 } from '@angular/core';
2
2
  import { BaseAngularComponent } from '@memberjunction/ng-base-types';
3
- import { EntityFieldTSType, CompositeKey, KeyValuePair, RunView, CoerceImageSrc, IsInlineImageDataUri, CoerceRawImageBase64ToDataUri, MaxStoredImageChars, MaxInlineImageBytes, FormatByteSize, ParseCssHexColor, PrettyPrintJson } from '@memberjunction/core';
3
+ import { EntityFieldTSType, CompositeKey, KeyValuePair, RunView, CoerceImageSrc, IsInlineImageDataUri, CoerceRawImageBase64ToDataUri, MaxStoredImageChars, MaxInlineImageBytes, FormatByteSize, ParseCssHexColor, PrettyPrintJson, IsDateOnlySQLType, FormatDateOnly } from '@memberjunction/core';
4
4
  import { BaseEngineRegistry } from '@memberjunction/core';
5
5
  import { ValidationErrorInfo, HighlightSearchMatches, detectRichTextFormat, UUIDsEqual } from '@memberjunction/global';
6
6
  import { FormatFKCell, FilterCachedFKRows } from './fk-search-utils';
@@ -1468,7 +1468,7 @@ export class MjFormFieldComponent extends BaseAngularComponent {
1468
1468
  AllowFKCreate = true;
1469
1469
  /** Surface used for the inline create form: a modal dialog (default) or a slide-in. */
1470
1470
  FKCreatePresentation = 'dialog';
1471
- /** Cleanup function for scroll/resize listeners */
1471
+ /** Cleanup function for the scroll/resize/outside-press listeners armed while a dropdown is open */
1472
1472
  _scrollCleanup = null;
1473
1473
  /** Inline style for the fixed-position dropdown */
1474
1474
  get DropdownPositionStyle() {
@@ -1544,6 +1544,12 @@ export class MjFormFieldComponent extends BaseAngularComponent {
1544
1544
  // the DOM yet when we first look, so retry across a few frames until it renders.
1545
1545
  // (The async DB path lands here post-render, so it succeeds on the first try.)
1546
1546
  const tryPortal = (retriesLeft) => {
1547
+ // The portal runs a tick after the open. If the field was destroyed or the panel
1548
+ // dismissed in between, moving the node to <body> now would orphan it there: a destroyed
1549
+ // component has no ngOnDestroy left to remove it, and a closed panel's @if has already
1550
+ // let go of it.
1551
+ if (this._destroyed || !this.ShowFKDropdown)
1552
+ return;
1547
1553
  const host = this.hostRef?.nativeElement;
1548
1554
  if (!host)
1549
1555
  return;
@@ -1562,7 +1568,12 @@ export class MjFormFieldComponent extends BaseAngularComponent {
1562
1568
  }
1563
1569
  /** Tracks a dropdown element we relocated to body so we can drop the reference on close. */
1564
1570
  _portaledDropdownEl = null;
1565
- /** Start listening for scroll/resize to close dropdowns */
1571
+ /** Set in ngOnDestroy so deferred work (the portal microtask) knows not to touch the DOM. */
1572
+ _destroyed = false;
1573
+ /**
1574
+ * Arm the listeners that dismiss an open dropdown from outside the field: an ancestor scroll,
1575
+ * a resize, and a pointer press anywhere but the field or its panel.
1576
+ */
1566
1577
  startScrollListener() {
1567
1578
  this.stopScrollListener();
1568
1579
  const onScroll = (e) => {
@@ -1579,11 +1590,28 @@ export class MjFormFieldComponent extends BaseAngularComponent {
1579
1590
  this.closeAllDropdowns();
1580
1591
  this.cdr.markForCheck();
1581
1592
  };
1593
+ // A press outside the field and its panel dismisses, whether or not the input has focus.
1594
+ // The input's blur covers the ordinary case, but the panel is portaled to <body> and must
1595
+ // own its dismissal: a panel that is open while nothing has focus has no blur to come, and
1596
+ // the input's Escape handler cannot hear a key it is not focused for.
1597
+ const onPointerDown = (e) => {
1598
+ const target = e.target;
1599
+ if (!target)
1600
+ return;
1601
+ if (this.hostRef.nativeElement.contains(target))
1602
+ return;
1603
+ if (this._portaledDropdownEl?.contains(target))
1604
+ return;
1605
+ this.closeAllDropdowns();
1606
+ this.cdr.markForCheck();
1607
+ };
1582
1608
  document.addEventListener('scroll', onScroll, true); // capture phase catches all scrollable ancestors
1583
1609
  window.addEventListener('resize', onResize);
1610
+ document.addEventListener('mousedown', onPointerDown, true);
1584
1611
  this._scrollCleanup = () => {
1585
1612
  document.removeEventListener('scroll', onScroll, true);
1586
1613
  window.removeEventListener('resize', onResize);
1614
+ document.removeEventListener('mousedown', onPointerDown, true);
1587
1615
  };
1588
1616
  }
1589
1617
  /** Remove scroll/resize listeners */
@@ -1602,8 +1630,23 @@ export class MjFormFieldComponent extends BaseAngularComponent {
1602
1630
  this._portaledDropdownEl = null;
1603
1631
  this.ShowValueListDropdown = false;
1604
1632
  this.ShowSelectDropdown = false;
1633
+ this.cancelPendingFKSearch();
1605
1634
  this.stopScrollListener();
1606
1635
  }
1636
+ /**
1637
+ * Nothing started before a dismiss may reopen the panel. Retiring the sequence orphans a
1638
+ * lookup still in flight (its result is dropped at the sequence check), and cancelling the
1639
+ * debounce stops a keystroke's pending search from firing after the user has left the field.
1640
+ * Without this, a lookup slower than the blur grace period reopened the list with nothing
1641
+ * focused, and neither Escape nor clicking away could reach it — only picking a row could.
1642
+ */
1643
+ cancelPendingFKSearch() {
1644
+ this._fkSearchSeq++;
1645
+ if (this._fkSearchTimeout) {
1646
+ clearTimeout(this._fkSearchTimeout);
1647
+ this._fkSearchTimeout = null;
1648
+ }
1649
+ }
1607
1650
  // ============================================
1608
1651
  // FK AUTOCOMPLETE (custom implementation)
1609
1652
  // ============================================
@@ -1654,9 +1697,14 @@ export class MjFormFieldComponent extends BaseAngularComponent {
1654
1697
  _fkQuery = '';
1655
1698
  /** Debounce timer for FK search */
1656
1699
  _fkSearchTimeout = null;
1700
+ /** The blur grace timer, so a refocus inside the grace window can cancel the close it scheduled. */
1701
+ _fkBlurTimeout = null;
1657
1702
  /** Last known FK input element for position recalculation */
1658
1703
  _lastFKInputEl = null;
1659
- /** Monotonic token so a slow DB response from a stale query can't clobber a newer one. */
1704
+ /**
1705
+ * Monotonic token so a slow lookup response cannot clobber a newer one — and, because every
1706
+ * dismiss retires it, cannot reopen a panel the user has already closed.
1707
+ */
1660
1708
  _fkSearchSeq = 0;
1661
1709
  /** Cached column plan for the current related entity (rebuilt on demand). */
1662
1710
  _fkColumnPlan = null;
@@ -1920,9 +1968,13 @@ export class MjFormFieldComponent extends BaseAngularComponent {
1920
1968
  }
1921
1969
  this.FKSearchFieldLabel = this.labelForRelatedField(this.FKSearchField);
1922
1970
  }
1923
- /** Format a raw cell value for display in the dropdown (delegates to the pure helper). */
1924
- formatCell(val) {
1925
- return FormatFKCell(val);
1971
+ /**
1972
+ * Format a raw cell value for display in the dropdown (delegates to the pure helper). The
1973
+ * related entity's column type lets a SQL `date` render as its stored day (MJ#4210).
1974
+ */
1975
+ formatCell(val, fieldName) {
1976
+ const sqlType = fieldName ? this.getRelatedEntityInfo()?.Fields.find(f => f.Name === fieldName)?.Type : undefined;
1977
+ return FormatFKCell(val, sqlType);
1926
1978
  }
1927
1979
  /**
1928
1980
  * Build the suggestion view-models from a set of plain rows (cached or DB),
@@ -1934,17 +1986,17 @@ export class MjFormFieldComponent extends BaseAngularComponent {
1934
1986
  // Only highlight the column actually being searched, and only when enabled.
1935
1987
  const nameQuery = (this.FKHighlightMatches && this.isSearchingNameField(plan)) ? query : '';
1936
1988
  return rows.map(row => {
1937
- const name = this.formatCell(row.get(plan.NameFieldName));
1989
+ const name = this.formatCell(row.get(plan.NameFieldName), plan.NameFieldName);
1938
1990
  // Per-row icon from the entity's ExtendedType='Icon' field; else the
1939
1991
  // entity-level icon; else none.
1940
- const rowIcon = plan.IconFieldName ? this.formatCell(row.get(plan.IconFieldName)).trim() : '';
1992
+ const rowIcon = plan.IconFieldName ? this.formatCell(row.get(plan.IconFieldName), plan.IconFieldName).trim() : '';
1941
1993
  return {
1942
1994
  PrimaryKeyValue: row.get(plan.PkFieldName),
1943
1995
  DisplayName: name,
1944
1996
  // Empty query yields the (still HTML-escaped) plain name — no marks.
1945
1997
  HighlightedName: HighlightSearchMatches(name, nameQuery, 'mj-forms-search-highlight'),
1946
1998
  ExtraColumns: plan.ExtraFieldNames.map((fieldName, i) => {
1947
- const value = this.formatCell(row.get(fieldName));
1999
+ const value = this.formatCell(row.get(fieldName), fieldName);
1948
2000
  const colQuery = (this.FKHighlightMatches && fieldName === searchField) ? query : '';
1949
2001
  return {
1950
2002
  FieldName: fieldName,
@@ -2279,6 +2331,9 @@ export class MjFormFieldComponent extends BaseAngularComponent {
2279
2331
  OnFKFocus(event) {
2280
2332
  const input = event.target;
2281
2333
  this._lastFKInputEl = input;
2334
+ // Focus regained inside the blur grace window: that blur must not close the panel this
2335
+ // focus is about to open, nor retire the lookup it starts.
2336
+ this.cancelPendingFKBlur();
2282
2337
  this.FKFocused = true; // reveal the scope pill while focused
2283
2338
  // Select any pre-filled (linked) text so the first keystroke replaces it instead
2284
2339
  // of appending — matches how a searchable dropdown behaves.
@@ -2333,7 +2388,9 @@ export class MjFormFieldComponent extends BaseAngularComponent {
2333
2388
  /** Hide dropdown on blur, revert to matched name if user didn't select */
2334
2389
  OnFKBlur() {
2335
2390
  // Small delay so mousedown on dropdown items / scope menu fires first
2336
- setTimeout(() => {
2391
+ this.cancelPendingFKBlur();
2392
+ this._fkBlurTimeout = setTimeout(() => {
2393
+ this._fkBlurTimeout = null;
2337
2394
  this.closeFKDropdown();
2338
2395
  this.FKShowScopeMenu = false;
2339
2396
  this.FKFocused = false; // hide the scope pill
@@ -2344,18 +2401,32 @@ export class MjFormFieldComponent extends BaseAngularComponent {
2344
2401
  this.cdr.markForCheck();
2345
2402
  }, 200);
2346
2403
  }
2404
+ cancelPendingFKBlur() {
2405
+ if (this._fkBlurTimeout) {
2406
+ clearTimeout(this._fkBlurTimeout);
2407
+ this._fkBlurTimeout = null;
2408
+ }
2409
+ }
2347
2410
  /**
2348
2411
  * Keyboard navigation in the FK input: ArrowDown/ArrowUp move the active row,
2349
2412
  * Enter selects it, Escape closes the dropdown.
2350
2413
  */
2351
2414
  OnFKKeydown(event) {
2352
- if (!this.ShowFKDropdown || this.FKSuggestions.length === 0) {
2353
- if (event.key === 'Escape') {
2415
+ if (event.key === 'Escape') {
2416
+ // Escape closes the panel and is consumed: the same key reaching the document would
2417
+ // also close a dialog hosting the form (mj-dialog listens for document Escape), and
2418
+ // dismissing a picker must not take the whole form with it. With no panel open the key
2419
+ // is left alone, so it still closes the dialog when that is what the user means.
2420
+ if (this.ShowFKDropdown) {
2421
+ event.preventDefault();
2422
+ event.stopPropagation();
2354
2423
  this.closeFKDropdown();
2355
2424
  this.cdr.markForCheck();
2356
2425
  }
2357
2426
  return;
2358
2427
  }
2428
+ if (!this.ShowFKDropdown || this.FKSuggestions.length === 0)
2429
+ return;
2359
2430
  switch (event.key) {
2360
2431
  case 'ArrowDown':
2361
2432
  event.preventDefault();
@@ -2377,11 +2448,6 @@ export class MjFormFieldComponent extends BaseAngularComponent {
2377
2448
  }
2378
2449
  break;
2379
2450
  }
2380
- case 'Escape':
2381
- event.preventDefault();
2382
- this.closeFKDropdown();
2383
- this.cdr.markForCheck();
2384
- break;
2385
2451
  }
2386
2452
  }
2387
2453
  /** Scroll the keyboard-active option into view inside the (possibly portaled) dropdown. */
@@ -2467,7 +2533,7 @@ export class MjFormFieldComponent extends BaseAngularComponent {
2467
2533
  const pk = created.Get(plan.PkFieldName);
2468
2534
  if (pk == null)
2469
2535
  return;
2470
- const name = this.formatCell(created.Get(plan.NameFieldName));
2536
+ const name = this.formatCell(created.Get(plan.NameFieldName), plan.NameFieldName);
2471
2537
  this._fkInputText = name;
2472
2538
  this.Value = pk;
2473
2539
  this.FKIsMatched = true;
@@ -2491,7 +2557,9 @@ export class MjFormFieldComponent extends BaseAngularComponent {
2491
2557
  if (nameFieldMap) {
2492
2558
  this.Record.Set(nameFieldMap, '');
2493
2559
  }
2494
- // Re-open the full list — clearing almost always precedes picking something else.
2560
+ // Re-open the full list — clearing almost always precedes picking something else. A blur
2561
+ // still inside its grace period must not close the list this just opened.
2562
+ this.cancelPendingFKBlur();
2495
2563
  this.showInitialFKSuggestions();
2496
2564
  this.cdr.markForCheck();
2497
2565
  }
@@ -2503,6 +2571,7 @@ export class MjFormFieldComponent extends BaseAngularComponent {
2503
2571
  this.FKActiveIndex = -1;
2504
2572
  this.FKSelectedSuggestion = null;
2505
2573
  this._portaledDropdownEl = null;
2574
+ this.cancelPendingFKSearch();
2506
2575
  this.stopScrollListener();
2507
2576
  }
2508
2577
  /**
@@ -2543,7 +2612,8 @@ export class MjFormFieldComponent extends BaseAngularComponent {
2543
2612
  ResultType: 'simple',
2544
2613
  Fields: fields
2545
2614
  });
2546
- // Ignore stale responses (a newer keystroke already fired).
2615
+ // Stale: a newer keystroke fired, or the panel was dismissed while this was in flight. A
2616
+ // dismissed panel stays dismissed — this result must not reopen it.
2547
2617
  if (seq !== this._fkSearchSeq)
2548
2618
  return;
2549
2619
  this.FKLoading = false;
@@ -2806,7 +2876,7 @@ export class MjFormFieldComponent extends BaseAngularComponent {
2806
2876
  * an instant, and the correct way to show THAT is the reader's local zone.
2807
2877
  */
2808
2878
  get IsDateOnlyField() {
2809
- return (this.FieldInfo?.Type ?? '').trim().toLowerCase() === 'date';
2879
+ return IsDateOnlySQLType(this.FieldInfo?.Type);
2810
2880
  }
2811
2881
  FormatValue() {
2812
2882
  const val = this.Value;
@@ -2831,7 +2901,7 @@ export class MjFormFieldComponent extends BaseAngularComponent {
2831
2901
  * and local time is the right way to show one.
2832
2902
  */
2833
2903
  if (this.IsDateOnlyField) {
2834
- return val.toLocaleDateString(undefined, { timeZone: 'UTC' });
2904
+ return FormatDateOnly(val);
2835
2905
  }
2836
2906
  return val.toLocaleString();
2837
2907
  }
@@ -2868,6 +2938,9 @@ export class MjFormFieldComponent extends BaseAngularComponent {
2868
2938
  this._fkColWidths = {};
2869
2939
  this._fkPrefKey = null; // force prefs reload for the new field
2870
2940
  this._portaledDropdownEl = null;
2941
+ // A lookup still out for the previous record must not land on this one.
2942
+ this.cancelPendingFKSearch();
2943
+ this.stopScrollListener();
2871
2944
  this._fkColumnPlan = null;
2872
2945
  this._resolvedFKName = undefined;
2873
2946
  this._resolvedFKValue = undefined;
@@ -2893,9 +2966,12 @@ export class MjFormFieldComponent extends BaseAngularComponent {
2893
2966
  }
2894
2967
  }
2895
2968
  ngOnDestroy() {
2896
- if (this._fkSearchTimeout) {
2897
- clearTimeout(this._fkSearchTimeout);
2898
- }
2969
+ this._destroyed = true;
2970
+ // Retire the sequence too, not just the debounce: a lookup still in flight would otherwise
2971
+ // land on a destroyed component, reopen the panel and re-arm document listeners with no
2972
+ // owner left to remove them.
2973
+ this.cancelPendingFKSearch();
2974
+ this.cancelPendingFKBlur();
2899
2975
  this.teardownFKResizeListeners();
2900
2976
  this.stopScrollListener();
2901
2977
  // If we relocated the dropdown to <body> and Angular tears us down while it's