xv-webcomponents 1.22.6-qa.0 → 1.22.7-qa.0

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.
@@ -82451,8 +82451,22 @@ const XvGeoMap = class {
82451
82451
  }
82452
82452
  pickSearchResult(result) {
82453
82453
  this.resetSearch();
82454
- // adds to the selection and flies there exactly what "find this area" means here
82455
- void this.selectPostalCodes([result.code], true).catch(() => undefined);
82454
+ // navigate only (QA, 28.08): finding an area means SHOWING it selecting stays a
82455
+ // deliberate click on the map. Applies to every level (PLZ, Landkreis, Bundesland).
82456
+ void this.flyToUnit(result.code).catch(() => undefined);
82457
+ }
82458
+ /** Pan/zoom to a unit without touching the selection. */
82459
+ async flyToUnit(code) {
82460
+ var _a;
82461
+ await this.ensureReady();
82462
+ const res = await fetch(`${this.apiBase}/geo-units/${encodeURIComponent(this.level)}/lookup?resolution=${this.resolution}`, {
82463
+ method: 'POST',
82464
+ headers: { 'Content-Type': 'application/json' },
82465
+ body: JSON.stringify({ codes: [code] }),
82466
+ });
82467
+ if (!res.ok)
82468
+ return; // search already found it; a failed lookup just means no jump
82469
+ this.fitTo((_a = unwrap(await res.json())) !== null && _a !== void 0 ? _a : []);
82456
82470
  }
82457
82471
  /** A method call means the map is needed now — start loading even if it hasn't scrolled into view. */
82458
82472
  ensureReady() {
@@ -82493,7 +82507,7 @@ const XvGeoMap = class {
82493
82507
  this.map.fitBounds([[minX, minY], [maxX, maxY]], { padding: 48, maxZoom: 12, duration: 800 });
82494
82508
  }
82495
82509
  render() {
82496
- return (index$1.h(index$1.Host, { key: '8393bdf29f0ac44635749d702c278cdbb619f4ac' }, index$1.h("div", { key: 'ef27303e9a69d582ee7ec25bd84da9d6095dcec9', class: "container" }, index$1.h("div", { key: '0deb697c20b721863aee6d83da5fe7826b133510', class: "map", ref: el => (this.mapContainer = el) }), this.ready && this.showSearch && (index$1.h("div", { key: '5f377f3fd746b77cdc94c33ceb6ff54a1bd7bc5e', class: "search" }, index$1.h("input", { key: '5a427450cc10ebcab663cef07116dfa70bbd5515', type: "search", placeholder: "Ort oder PLZ suchen", value: this.searchQuery, onInput: e => this.onSearchInput(e.target.value) }), this.searchResults.length > 0 && (index$1.h("ul", { key: '747052bad537d9bd379801cda19758758afe91f7', class: "search-results" }, this.searchResults.map(r => (index$1.h("li", { key: r.code, onClick: () => this.pickSearchResult(r) }, index$1.h("strong", null, r.code), " ", r.name))))))), this.ready && this.zoomGated && (index$1.h("div", { key: '9629a8642ea8cc61d851fd16669427a015c2ee67', class: "hint" }, "Reinzoomen, um PLZ-Gebiete zu laden")), !this.ready && !this.loadError && (index$1.h("div", { key: 'd5f5e8a2e31cb12c0107a45ea805c626f5a94804', class: "skeleton", "aria-busy": "true" }, index$1.h("xv-loader-v2", { key: 'f9c816a61a8177b54860e6c7b1015bfaec1cdadb', variant: "vertical" }, "Karte wird geladen \u2026"))), this.loadError && index$1.h("div", { key: '51d9a5e36105fdcf4e61f12609ab5fc2e2d9c16a', class: "skeleton error" }, "Karte konnte nicht geladen werden."))));
82510
+ return (index$1.h(index$1.Host, { key: '5e284532eaaf73fac04321672fd135a5fdfd1055' }, index$1.h("div", { key: 'b9334d39245fde17f998d0ad2557fe0a1fd09394', class: "container" }, index$1.h("div", { key: '8de6c78a3fb0907c9aac53f4543e3c0e85fbef73', class: "map", ref: el => (this.mapContainer = el) }), this.ready && this.showSearch && (index$1.h("div", { key: 'e65a447aa5fbebd4c95681c23ffa944d58d43c04', class: "search" }, index$1.h("input", { key: 'a33e4ccc1eaa2c8bd303126de72bcf0ce8a667ab', type: "search", placeholder: "Ort oder PLZ suchen", value: this.searchQuery, onInput: e => this.onSearchInput(e.target.value) }), this.searchResults.length > 0 && (index$1.h("ul", { key: 'd1debbd7d31a7a2048b109ba2e29fa4362e8a1a0', class: "search-results" }, this.searchResults.map(r => (index$1.h("li", { key: r.code, onClick: () => this.pickSearchResult(r) }, this.level === 'plz5' ? (index$1.h("span", null, index$1.h("strong", null, r.code), " ", r.name)) : (index$1.h("span", null, r.name))))))))), this.ready && this.zoomGated && (index$1.h("div", { key: 'ba53e4d000970bcfc9a4d4f785c1b4b5a13f9c95', class: "hint" }, "Reinzoomen, um PLZ-Gebiete zu laden")), !this.ready && !this.loadError && (index$1.h("div", { key: 'c15cc4e8b46cb5caab132974c6752100b2265ff7', class: "skeleton", "aria-busy": "true" }, index$1.h("xv-loader-v2", { key: '95d7ffb0dc15a48d375b412f3f54914016e8c841', variant: "vertical" }, "Karte wird geladen \u2026"))), this.loadError && index$1.h("div", { key: 'fd46702e9cd1d5e9575c48a62634a300e9c1c717', class: "skeleton error" }, "Karte konnte nicht geladen werden."))));
82497
82511
  }
82498
82512
  get el() { return index$1.getElement(this); }
82499
82513
  static get watchers() { return {
@@ -83406,6 +83420,13 @@ const XvOverflowMenu = class {
83406
83420
  const button = (index$1.h("button", { class: { btn: true, open: this.open }, onClick: this.onOpenToggle, disabled: this.disabled, "aria-haspopup": "menu", "aria-expanded": this.open ? 'true' : 'false', ref: (el) => (this.triggerButtonEl = el) }, index$1.h("slot", { name: "trigger" }, index$1.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 128 512" }, index$1.h("path", { d: "M64 368a48 48 0 1 0 0 96 48 48 0 1 0 0-96zm0-160a48 48 0 1 0 0 96 48 48 0 1 0 0-96zM112 96A48 48 0 1 0 16 96a48 48 0 1 0 96 0z" })))));
83407
83421
  return (index$1.h(index$1.Host, { class: "xv-overflow-menu", size: this.size }, this.tooltip ? index$1.h("xv-tooltip-v2", { message: this.tooltip }, button) : button, list));
83408
83422
  }
83423
+ // Moving the host in the DOM — a framework reordering a list, say — disconnects and reconnects
83424
+ // it, and the disconnect tears the anchor listener down. componentDidLoad does not run a second
83425
+ // time, so without this the menu stays dead. Safe on the first mount: addEventListener discards
83426
+ // a duplicate of the same handler, and setupAnchor is a no-op until anchor is set.
83427
+ connectedCallback() {
83428
+ this.setupAnchor();
83429
+ }
83409
83430
  componentDidLoad() {
83410
83431
  this.setupAnchor();
83411
83432
  this.syncOpenState();
@@ -512,8 +512,22 @@ export class XvGeoMap {
512
512
  }
513
513
  pickSearchResult(result) {
514
514
  this.resetSearch();
515
- // adds to the selection and flies there exactly what "find this area" means here
516
- void this.selectPostalCodes([result.code], true).catch(() => undefined);
515
+ // navigate only (QA, 28.08): finding an area means SHOWING it selecting stays a
516
+ // deliberate click on the map. Applies to every level (PLZ, Landkreis, Bundesland).
517
+ void this.flyToUnit(result.code).catch(() => undefined);
518
+ }
519
+ /** Pan/zoom to a unit without touching the selection. */
520
+ async flyToUnit(code) {
521
+ var _a;
522
+ await this.ensureReady();
523
+ const res = await fetch(`${this.apiBase}/geo-units/${encodeURIComponent(this.level)}/lookup?resolution=${this.resolution}`, {
524
+ method: 'POST',
525
+ headers: { 'Content-Type': 'application/json' },
526
+ body: JSON.stringify({ codes: [code] }),
527
+ });
528
+ if (!res.ok)
529
+ return; // search already found it; a failed lookup just means no jump
530
+ this.fitTo((_a = unwrap(await res.json())) !== null && _a !== void 0 ? _a : []);
517
531
  }
518
532
  /** A method call means the map is needed now — start loading even if it hasn't scrolled into view. */
519
533
  ensureReady() {
@@ -554,7 +568,7 @@ export class XvGeoMap {
554
568
  this.map.fitBounds([[minX, minY], [maxX, maxY]], { padding: 48, maxZoom: 12, duration: 800 });
555
569
  }
556
570
  render() {
557
- return (h(Host, { key: '8393bdf29f0ac44635749d702c278cdbb619f4ac' }, h("div", { key: 'ef27303e9a69d582ee7ec25bd84da9d6095dcec9', class: "container" }, h("div", { key: '0deb697c20b721863aee6d83da5fe7826b133510', class: "map", ref: el => (this.mapContainer = el) }), this.ready && this.showSearch && (h("div", { key: '5f377f3fd746b77cdc94c33ceb6ff54a1bd7bc5e', class: "search" }, h("input", { key: '5a427450cc10ebcab663cef07116dfa70bbd5515', type: "search", placeholder: "Ort oder PLZ suchen", value: this.searchQuery, onInput: e => this.onSearchInput(e.target.value) }), this.searchResults.length > 0 && (h("ul", { key: '747052bad537d9bd379801cda19758758afe91f7', class: "search-results" }, this.searchResults.map(r => (h("li", { key: r.code, onClick: () => this.pickSearchResult(r) }, h("strong", null, r.code), " ", r.name))))))), this.ready && this.zoomGated && (h("div", { key: '9629a8642ea8cc61d851fd16669427a015c2ee67', class: "hint" }, "Reinzoomen, um PLZ-Gebiete zu laden")), !this.ready && !this.loadError && (h("div", { key: 'd5f5e8a2e31cb12c0107a45ea805c626f5a94804', class: "skeleton", "aria-busy": "true" }, h("xv-loader-v2", { key: 'f9c816a61a8177b54860e6c7b1015bfaec1cdadb', variant: "vertical" }, "Karte wird geladen \u2026"))), this.loadError && h("div", { key: '51d9a5e36105fdcf4e61f12609ab5fc2e2d9c16a', class: "skeleton error" }, "Karte konnte nicht geladen werden."))));
571
+ return (h(Host, { key: '5e284532eaaf73fac04321672fd135a5fdfd1055' }, h("div", { key: 'b9334d39245fde17f998d0ad2557fe0a1fd09394', class: "container" }, h("div", { key: '8de6c78a3fb0907c9aac53f4543e3c0e85fbef73', class: "map", ref: el => (this.mapContainer = el) }), this.ready && this.showSearch && (h("div", { key: 'e65a447aa5fbebd4c95681c23ffa944d58d43c04', class: "search" }, h("input", { key: 'a33e4ccc1eaa2c8bd303126de72bcf0ce8a667ab', type: "search", placeholder: "Ort oder PLZ suchen", value: this.searchQuery, onInput: e => this.onSearchInput(e.target.value) }), this.searchResults.length > 0 && (h("ul", { key: 'd1debbd7d31a7a2048b109ba2e29fa4362e8a1a0', class: "search-results" }, this.searchResults.map(r => (h("li", { key: r.code, onClick: () => this.pickSearchResult(r) }, this.level === 'plz5' ? (h("span", null, h("strong", null, r.code), " ", r.name)) : (h("span", null, r.name))))))))), this.ready && this.zoomGated && (h("div", { key: 'ba53e4d000970bcfc9a4d4f785c1b4b5a13f9c95', class: "hint" }, "Reinzoomen, um PLZ-Gebiete zu laden")), !this.ready && !this.loadError && (h("div", { key: 'c15cc4e8b46cb5caab132974c6752100b2265ff7', class: "skeleton", "aria-busy": "true" }, h("xv-loader-v2", { key: '95d7ffb0dc15a48d375b412f3f54914016e8c841', variant: "vertical" }, "Karte wird geladen \u2026"))), this.loadError && h("div", { key: 'fd46702e9cd1d5e9575c48a62634a300e9c1c717', class: "skeleton error" }, "Karte konnte nicht geladen werden."))));
558
572
  }
559
573
  static get is() { return "xv-geo-map-v2"; }
560
574
  static get encapsulation() { return "shadow"; }
@@ -278,6 +278,13 @@ export class XvOverflowMenu {
278
278
  const button = (h("button", { class: { btn: true, open: this.open }, onClick: this.onOpenToggle, disabled: this.disabled, "aria-haspopup": "menu", "aria-expanded": this.open ? 'true' : 'false', ref: (el) => (this.triggerButtonEl = el) }, h("slot", { name: "trigger" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 128 512" }, h("path", { d: "M64 368a48 48 0 1 0 0 96 48 48 0 1 0 0-96zm0-160a48 48 0 1 0 0 96 48 48 0 1 0 0-96zM112 96A48 48 0 1 0 16 96a48 48 0 1 0 96 0z" })))));
279
279
  return (h(Host, { class: "xv-overflow-menu", size: this.size }, this.tooltip ? h("xv-tooltip-v2", { message: this.tooltip }, button) : button, list));
280
280
  }
281
+ // Moving the host in the DOM — a framework reordering a list, say — disconnects and reconnects
282
+ // it, and the disconnect tears the anchor listener down. componentDidLoad does not run a second
283
+ // time, so without this the menu stays dead. Safe on the first mount: addEventListener discards
284
+ // a duplicate of the same handler, and setupAnchor is a no-op until anchor is set.
285
+ connectedCallback() {
286
+ this.setupAnchor();
287
+ }
281
288
  componentDidLoad() {
282
289
  this.setupAnchor();
283
290
  this.syncOpenState();
@@ -82449,8 +82449,22 @@ const XvGeoMap = class {
82449
82449
  }
82450
82450
  pickSearchResult(result) {
82451
82451
  this.resetSearch();
82452
- // adds to the selection and flies there exactly what "find this area" means here
82453
- void this.selectPostalCodes([result.code], true).catch(() => undefined);
82452
+ // navigate only (QA, 28.08): finding an area means SHOWING it selecting stays a
82453
+ // deliberate click on the map. Applies to every level (PLZ, Landkreis, Bundesland).
82454
+ void this.flyToUnit(result.code).catch(() => undefined);
82455
+ }
82456
+ /** Pan/zoom to a unit without touching the selection. */
82457
+ async flyToUnit(code) {
82458
+ var _a;
82459
+ await this.ensureReady();
82460
+ const res = await fetch(`${this.apiBase}/geo-units/${encodeURIComponent(this.level)}/lookup?resolution=${this.resolution}`, {
82461
+ method: 'POST',
82462
+ headers: { 'Content-Type': 'application/json' },
82463
+ body: JSON.stringify({ codes: [code] }),
82464
+ });
82465
+ if (!res.ok)
82466
+ return; // search already found it; a failed lookup just means no jump
82467
+ this.fitTo((_a = unwrap(await res.json())) !== null && _a !== void 0 ? _a : []);
82454
82468
  }
82455
82469
  /** A method call means the map is needed now — start loading even if it hasn't scrolled into view. */
82456
82470
  ensureReady() {
@@ -82491,7 +82505,7 @@ const XvGeoMap = class {
82491
82505
  this.map.fitBounds([[minX, minY], [maxX, maxY]], { padding: 48, maxZoom: 12, duration: 800 });
82492
82506
  }
82493
82507
  render() {
82494
- return (h(Host, { key: '8393bdf29f0ac44635749d702c278cdbb619f4ac' }, h("div", { key: 'ef27303e9a69d582ee7ec25bd84da9d6095dcec9', class: "container" }, h("div", { key: '0deb697c20b721863aee6d83da5fe7826b133510', class: "map", ref: el => (this.mapContainer = el) }), this.ready && this.showSearch && (h("div", { key: '5f377f3fd746b77cdc94c33ceb6ff54a1bd7bc5e', class: "search" }, h("input", { key: '5a427450cc10ebcab663cef07116dfa70bbd5515', type: "search", placeholder: "Ort oder PLZ suchen", value: this.searchQuery, onInput: e => this.onSearchInput(e.target.value) }), this.searchResults.length > 0 && (h("ul", { key: '747052bad537d9bd379801cda19758758afe91f7', class: "search-results" }, this.searchResults.map(r => (h("li", { key: r.code, onClick: () => this.pickSearchResult(r) }, h("strong", null, r.code), " ", r.name))))))), this.ready && this.zoomGated && (h("div", { key: '9629a8642ea8cc61d851fd16669427a015c2ee67', class: "hint" }, "Reinzoomen, um PLZ-Gebiete zu laden")), !this.ready && !this.loadError && (h("div", { key: 'd5f5e8a2e31cb12c0107a45ea805c626f5a94804', class: "skeleton", "aria-busy": "true" }, h("xv-loader-v2", { key: 'f9c816a61a8177b54860e6c7b1015bfaec1cdadb', variant: "vertical" }, "Karte wird geladen \u2026"))), this.loadError && h("div", { key: '51d9a5e36105fdcf4e61f12609ab5fc2e2d9c16a', class: "skeleton error" }, "Karte konnte nicht geladen werden."))));
82508
+ return (h(Host, { key: '5e284532eaaf73fac04321672fd135a5fdfd1055' }, h("div", { key: 'b9334d39245fde17f998d0ad2557fe0a1fd09394', class: "container" }, h("div", { key: '8de6c78a3fb0907c9aac53f4543e3c0e85fbef73', class: "map", ref: el => (this.mapContainer = el) }), this.ready && this.showSearch && (h("div", { key: 'e65a447aa5fbebd4c95681c23ffa944d58d43c04', class: "search" }, h("input", { key: 'a33e4ccc1eaa2c8bd303126de72bcf0ce8a667ab', type: "search", placeholder: "Ort oder PLZ suchen", value: this.searchQuery, onInput: e => this.onSearchInput(e.target.value) }), this.searchResults.length > 0 && (h("ul", { key: 'd1debbd7d31a7a2048b109ba2e29fa4362e8a1a0', class: "search-results" }, this.searchResults.map(r => (h("li", { key: r.code, onClick: () => this.pickSearchResult(r) }, this.level === 'plz5' ? (h("span", null, h("strong", null, r.code), " ", r.name)) : (h("span", null, r.name))))))))), this.ready && this.zoomGated && (h("div", { key: 'ba53e4d000970bcfc9a4d4f785c1b4b5a13f9c95', class: "hint" }, "Reinzoomen, um PLZ-Gebiete zu laden")), !this.ready && !this.loadError && (h("div", { key: 'c15cc4e8b46cb5caab132974c6752100b2265ff7', class: "skeleton", "aria-busy": "true" }, h("xv-loader-v2", { key: '95d7ffb0dc15a48d375b412f3f54914016e8c841', variant: "vertical" }, "Karte wird geladen \u2026"))), this.loadError && h("div", { key: 'fd46702e9cd1d5e9575c48a62634a300e9c1c717', class: "skeleton error" }, "Karte konnte nicht geladen werden."))));
82495
82509
  }
82496
82510
  get el() { return getElement(this); }
82497
82511
  static get watchers() { return {
@@ -83404,6 +83418,13 @@ const XvOverflowMenu = class {
83404
83418
  const button = (h("button", { class: { btn: true, open: this.open }, onClick: this.onOpenToggle, disabled: this.disabled, "aria-haspopup": "menu", "aria-expanded": this.open ? 'true' : 'false', ref: (el) => (this.triggerButtonEl = el) }, h("slot", { name: "trigger" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 128 512" }, h("path", { d: "M64 368a48 48 0 1 0 0 96 48 48 0 1 0 0-96zm0-160a48 48 0 1 0 0 96 48 48 0 1 0 0-96zM112 96A48 48 0 1 0 16 96a48 48 0 1 0 96 0z" })))));
83405
83419
  return (h(Host, { class: "xv-overflow-menu", size: this.size }, this.tooltip ? h("xv-tooltip-v2", { message: this.tooltip }, button) : button, list));
83406
83420
  }
83421
+ // Moving the host in the DOM — a framework reordering a list, say — disconnects and reconnects
83422
+ // it, and the disconnect tears the anchor listener down. componentDidLoad does not run a second
83423
+ // time, so without this the menu stays dead. Safe on the first mount: addEventListener discards
83424
+ // a duplicate of the same handler, and setupAnchor is a no-op until anchor is set.
83425
+ connectedCallback() {
83426
+ this.setupAnchor();
83427
+ }
83407
83428
  componentDidLoad() {
83408
83429
  this.setupAnchor();
83409
83430
  this.syncOpenState();
@@ -122,6 +122,8 @@ export declare class XvGeoMap {
122
122
  private onSearchInput;
123
123
  private resetSearch;
124
124
  private pickSearchResult;
125
+ /** Pan/zoom to a unit without touching the selection. */
126
+ private flyToUnit;
125
127
  /** A method call means the map is needed now — start loading even if it hasn't scrolled into view. */
126
128
  private ensureReady;
127
129
  private applySelection;
@@ -57,6 +57,7 @@ export declare class XvOverflowMenu {
57
57
  private initOpenState;
58
58
  private restoreFocus;
59
59
  render(): any;
60
+ connectedCallback(): void;
60
61
  componentDidLoad(): void;
61
62
  disconnectedCallback(): void;
62
63
  }