@sumaris-net/ngx-components 18.2.35-alpha1 → 18.2.35-alpha2

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.
@@ -36832,7 +36832,8 @@ class AppEditor extends AppFormContainer {
36832
36832
  toolbar = null;
36833
36833
  formButtonsBar = null;
36834
36834
  content;
36835
- constructor(route, router, navController, alertCtrl, translate) {
36835
+ constructor(route, // Modal editor give 'null'
36836
+ router, navController, alertCtrl, translate) {
36836
36837
  super();
36837
36838
  this.route = route;
36838
36839
  this.router = router;
@@ -36924,7 +36925,6 @@ class AppEditor extends AppFormContainer {
36924
36925
  this.markAsSaved(opts);
36925
36926
  }
36926
36927
  async reloadWithConfirmation(confirm) {
36927
- console.debug(this._logPrefix + ': reloadWithConfirmation', new Error());
36928
36928
  const needConfirm = this.dirty;
36929
36929
  // if not confirm yet: ask confirmation
36930
36930
  if (!confirm && needConfirm) {
@@ -37048,12 +37048,14 @@ class AppEditor extends AppFormContainer {
37048
37048
  throw new Error("Missing toastController in component's constructor");
37049
37049
  await Toasts.show(this.toastController, this.translate, opts);
37050
37050
  }
37051
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: AppEditor, deps: [{ token: i1$5.ActivatedRoute }, { token: i1$5.Router }, { token: i2$1.NavController }, { token: i2$1.AlertController }, { token: i1$1.TranslateService }], target: i0.ɵɵFactoryTarget.Directive });
37051
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: AppEditor, deps: [{ token: i1$5.ActivatedRoute, optional: true }, { token: i1$5.Router }, { token: i2$1.NavController }, { token: i2$1.AlertController }, { token: i1$1.TranslateService }], target: i0.ɵɵFactoryTarget.Directive });
37052
37052
  static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.11", type: AppEditor, viewQueries: [{ propertyName: "toolbar", first: true, predicate: ToolbarToken, descendants: true }, { propertyName: "formButtonsBar", first: true, predicate: FormButtonsBarToken, descendants: true, static: true }, { propertyName: "content", first: true, predicate: IonContent, descendants: true, static: true }], usesInheritance: true, ngImport: i0 });
37053
37053
  }
37054
37054
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: AppEditor, decorators: [{
37055
37055
  type: Directive
37056
- }], ctorParameters: () => [{ type: i1$5.ActivatedRoute }, { type: i1$5.Router }, { type: i2$1.NavController }, { type: i2$1.AlertController }, { type: i1$1.TranslateService }], propDecorators: { toolbar: [{
37056
+ }], ctorParameters: () => [{ type: i1$5.ActivatedRoute, decorators: [{
37057
+ type: Optional
37058
+ }] }, { type: i1$5.Router }, { type: i2$1.NavController }, { type: i2$1.AlertController }, { type: i1$1.TranslateService }], propDecorators: { toolbar: [{
37057
37059
  type: ViewChild,
37058
37060
  args: [ToolbarToken]
37059
37061
  }], formButtonsBar: [{
@@ -37080,11 +37082,6 @@ class AppTabEditorOptions {
37080
37082
  }
37081
37083
  // eslint-disable-next-line @angular-eslint/directive-class-suffix
37082
37084
  class AppTabEditor extends AppEditor {
37083
- route;
37084
- router;
37085
- navController;
37086
- alertCtrl;
37087
- translate;
37088
37085
  _selectedTabIndex = 0;
37089
37086
  // Editor options
37090
37087
  tabCount;
@@ -37102,11 +37099,6 @@ class AppTabEditor extends AppEditor {
37102
37099
  constructor(route, // Modal editor give 'null'
37103
37100
  router, navController, alertCtrl, translate, options) {
37104
37101
  super(route, router, navController, alertCtrl, translate);
37105
- this.route = route;
37106
- this.router = router;
37107
- this.navController = navController;
37108
- this.alertCtrl = alertCtrl;
37109
- this.translate = translate;
37110
37102
  options = {
37111
37103
  tabCount: 1,
37112
37104
  enableSwipe: true,
@@ -37176,10 +37168,11 @@ class AppTabEditor extends AppEditor {
37176
37168
  if (queryTabIndexParamName === 'tab' && isNotNil(this.queryParams['subtab'])) {
37177
37169
  delete this.queryParams.subtab; // clean subtab
37178
37170
  }
37171
+ // Update queryParam only (not the path)
37179
37172
  this.router.navigate(['.'], {
37180
37173
  relativeTo: this.route,
37174
+ replaceUrl: false, // Avoid to change the URL (e.g. to avoid restoring '/:id' by '/new' if changed silently)
37181
37175
  queryParams: this.queryParams,
37182
- replaceUrl: true,
37183
37176
  state: { animated: false },
37184
37177
  });
37185
37178
  return true;
@@ -39330,6 +39323,7 @@ class AppEntityEditor extends AppTabEditor {
39330
39323
  console.debug('[entity-editor] Updating route using queryParams: ', queryParams);
39331
39324
  return await this.router.navigate(['.'], {
39332
39325
  relativeTo: this.route,
39326
+ replaceUrl: false,
39333
39327
  queryParams: this.queryParams,
39334
39328
  state: { animated: false },
39335
39329
  });
@@ -39338,6 +39332,8 @@ class AppEntityEditor extends AppTabEditor {
39338
39332
  else {
39339
39333
  // Current route was '/new' => change to '/new?id=:id' (to allow CustomReuseStrategy to detect that route can be reused)
39340
39334
  if (currId === 'new') {
39335
+ if (this.debug)
39336
+ console.debug('[entity-editor] Updating route /new into /:id, using queryParams: ', queryParams);
39341
39337
  const res = await this.router.navigate(['.'], {
39342
39338
  relativeTo: this.route,
39343
39339
  replaceUrl: true,