@luigi-project/core-modular 0.0.10-dev.202606300110 → 0.0.11-dev.202607100055

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.
@@ -11,8 +11,9 @@ export declare class Routing {
11
11
  *
12
12
  * @param params - An object containing key-value pairs to be added as search parameters.
13
13
  * @param keepBrowserHistory - If `true`, a new entry is added to the browser's history; otherwise, the current entry is replaced. Defaults to `false`.
14
+ * @param preventLuigiConfigUpdate - If `true`, prevents updating the Luigi configuration when adding search parameters. Defaults to `false`.
14
15
  */
15
- addSearchParams(params: object, keepBrowserHistory?: boolean): void;
16
+ addSearchParams(params: object, keepBrowserHistory?: boolean, preventLuigiConfigUpdate?: boolean): void;
16
17
  /**
17
18
  * Get search parameter from URL as an object.
18
19
  * @memberof Routing
package/luigi-engine.d.ts CHANGED
@@ -36,7 +36,7 @@ export declare class LuigiEngine {
36
36
  init: (luigi: import('./core-api/luigi').Luigi) => void;
37
37
  handlePageErrorHandler: (pageErrorHandler: import('./types/navigation').PageErrorHandler, node: import('./types/navigation').Node, luigi: import('./core-api/luigi').Luigi) => void;
38
38
  handleExternalLinkNavigation: (externalLink: import('./types/navigation').ExternalLink) => void;
39
- addSearchParamsFromClient(searchParams: Record<string, any>, keepBrowserHistory: boolean, luigi: import('./core-api/luigi').Luigi): Promise<void>;
39
+ addSearchParamsFromClient(searchParams: Record<string, any>, keepBrowserHistory: boolean, preventLuigiConfigUpdate: boolean, luigi: import('./core-api/luigi').Luigi): Promise<void>;
40
40
  };
41
41
  bootstrap(connector: LuigiConnector): void;
42
42
  init(): void;
package/luigi.js CHANGED
@@ -8076,6 +8076,11 @@ var Ti = {
8076
8076
  };
8077
8077
  }
8078
8078
  async navItemClick(e, t) {
8079
+ if (e.openNodeInModal) {
8080
+ let n = a.replaceVars(H.getNodePath(e), t?.pathParams || {}, ":", !1);
8081
+ this.luigi.navigation().openAsModal(n, e.openNodeInModal === !0 ? {} : e.openNodeInModal);
8082
+ return;
8083
+ }
8079
8084
  if (await U.get(Ai).getUnsavedChangesModalPromise(), e.externalLink?.url) {
8080
8085
  Ei.openExternalLink(e.externalLink, t?.pathParams);
8081
8086
  return;
@@ -8587,7 +8592,11 @@ var Ti = {
8587
8592
  nodeParams: u
8588
8593
  };
8589
8594
  let f = l?.selectedNode ?? await this.getNavigationService().getCurrentNode(r), p = f?.viewUrl || "";
8590
- if (f && this.previousPathData && await this.handleViewUrlMisconfigured(f, p, this.previousPathData, d) || await this.handlePageNotFound(f, p, l, r, d)) return;
8595
+ if (f && await this.handleViewUrlMisconfigured(f, p, this.previousPathData, d) || await this.handlePageNotFound(f, p, l, r, d)) {
8596
+ let e = this.luigi.getEngine()._connector;
8597
+ e?.renderLeftNav(await this.getNavigationService().getLeftNavData(r, l)), e?.renderTabNav(await this.getNavigationService().getTabNavData(r, l));
8598
+ return;
8599
+ }
8591
8600
  let m = this.luigi.getEngine()._connector;
8592
8601
  if (m?.renderTopNav(await this.getNavigationService().getTopNavData(r, l)), m?.renderLeftNav(await this.getNavigationService().getLeftNavData(r, l)), m?.renderTabNav(await this.getNavigationService().getTabNavData(r, l)), m?.renderBreadcrumbs(await this.getNavigationService().getBreadcrumbData(r, l, (e) => {
8593
8602
  m?.renderBreadcrumbs(e);
@@ -8737,7 +8746,7 @@ var Ti = {
8737
8746
  if (!o && t.trim() === "" && !s && !a) {
8738
8747
  if (console.warn("The intended target route can't be accessed since it has neither a viewUrl nor children. This is most likely a misconfiguration."), !(n && (n.selectedNode?.viewUrl || n.selectedNode && n.selectedNode.compound))) {
8739
8748
  let e = await this.getNavigationService().getPathData("/"), t = await H.getDefaultChildNode(e);
8740
- this.showPageNotFoundError(t, r, !1), this.getNavigationService().handleNavigationRequest({ path: t });
8749
+ this.showPageNotFoundError(t, r, !1);
8741
8750
  }
8742
8751
  return !0;
8743
8752
  }
@@ -9429,13 +9438,13 @@ var Ti = {
9429
9438
  constructor(e) {
9430
9439
  this.luigi = e;
9431
9440
  }
9432
- addSearchParams(e, t = !1) {
9441
+ addSearchParams(e, t = !1, n = !1) {
9433
9442
  if (!a.isObject(e)) {
9434
9443
  console.log("Params argument must be an object");
9435
9444
  return;
9436
9445
  }
9437
- let n = new URL(location.href);
9438
- this.luigi.getConfigValue("routing.useHashRouting") ? n.hash = H.addParamsOnHashRouting(e, n.hash) : H.modifySearchParams(e, n.searchParams), this.handleBrowserHistory(t, n), this.luigi.configChanged();
9446
+ let r = new URL(location.href);
9447
+ this.luigi.getConfigValue("routing.useHashRouting") ? r.hash = H.addParamsOnHashRouting(e, r.hash) : H.modifySearchParams(e, r.searchParams), this.handleBrowserHistory(t, r), n || this.luigi.configChanged();
9439
9448
  }
9440
9449
  getSearchParams() {
9441
9450
  let e = {}, t = [
@@ -11167,15 +11176,15 @@ var fc = {
11167
11176
  t && (t.opener = null, t.focus());
11168
11177
  }
11169
11178
  },
11170
- async addSearchParamsFromClient(e, t, n) {
11171
- let r = U.get(Ni), i = H.getCurrentPath(n, n.getConfig().routing?.useHashRouting), a = (await r.getCurrentNode(i.path))?.clientPermissions?.urlParameters, o = { ...e };
11172
- if (a) {
11179
+ async addSearchParamsFromClient(e, t, n, r) {
11180
+ let i = U.get(Ni), a = H.getCurrentPath(r, r.getConfig().routing?.useHashRouting), o = (await i.getCurrentNode(a.path))?.clientPermissions?.urlParameters, s = { ...e };
11181
+ if (o) {
11173
11182
  let e = {};
11174
- Object.keys(a).forEach((t) => {
11175
- t in o && a[t]?.write === !0 && (e[t] = o[t], delete o[t]);
11183
+ Object.keys(o).forEach((t) => {
11184
+ t in s && o[t]?.write === !0 && (e[t] = s[t], delete s[t]);
11176
11185
  });
11177
- for (let e in o) console.warn(`No permission to add the search param "${e}" to the url`);
11178
- Object.keys(e).length > 0 && n.routing().addSearchParams(e, t);
11186
+ for (let e in s) console.warn(`No permission to add the search param "${e}" to the url`);
11187
+ Object.keys(e).length > 0 && r.routing().addSearchParams(e, t, n);
11179
11188
  }
11180
11189
  }
11181
11190
  }, pc, mc = {
@@ -11289,7 +11298,7 @@ var fc = {
11289
11298
  gc.luigi.getEngine()._connector?.closeUserSettings();
11290
11299
  }), e.addEventListener(V.ADD_SEARCH_PARAMS_REQUEST, (e) => {
11291
11300
  let n = e.detail;
11292
- fc.addSearchParamsFromClient(n.data, n.keepBrowserHistory, t);
11301
+ fc.addSearchParamsFromClient(n.data, n.keepBrowserHistory, n.preventLuigiConfigUpdate, t);
11293
11302
  }), e.addEventListener(V.UPDATE_MODAL_SETTINGS_REQUEST, (e) => {
11294
11303
  let n = e.payload;
11295
11304
  W.updateModalSettings(n.updatedModalSettings, n.addHistoryEntry, t);