@quadrel-enterprise-ui/framework 20.9.1 → 20.10.0-beta.139.1

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.
package/index.d.ts CHANGED
@@ -6662,6 +6662,7 @@ declare class QdInputComponent implements OnInit, OnChanges, OnDestroy, ControlV
6662
6662
  hasAutofocus: boolean;
6663
6663
  hasOptions: boolean;
6664
6664
  _value: QdInputValueWithUnit;
6665
+ _displayValue: string;
6665
6666
  control: AbstractControl | QdFormControl<any>;
6666
6667
  private _optionsResolver;
6667
6668
  private _subs;
@@ -9247,6 +9248,28 @@ interface QdPageSaveAction {
9247
9248
  * * This flag is useful in scenarios where form validation is not needed or should be bypassed, but it ensures that only modified forms can be saved.
9248
9249
  */
9249
9250
  hasValidation?: boolean;
9251
+ /**
9252
+ * @description Optional callback invoked after the framework marks the form as saved on a successful save.
9253
+ *
9254
+ * * Runs in the framework's navigation-bypass window, so router navigation from this hook does **not**
9255
+ * raise the unsaved-changes dialog.
9256
+ *
9257
+ * * For async handlers (returning `Observable<boolean>`), this hook is the **only** race-free place to
9258
+ * navigate. Side effects in `tap` run *before* the framework marks the form as saved; navigation
9259
+ * from there would still see a dirty form and trigger the dialog.
9260
+ *
9261
+ * @example
9262
+ * ```ts
9263
+ * save: {
9264
+ * handler: () => api.update(form.value).pipe(
9265
+ * tap(result => notifications.success('Saved')),
9266
+ * map(() => true)
9267
+ * ),
9268
+ * onSuccess: () => router.navigateByUrl('/list')
9269
+ * }
9270
+ * ```
9271
+ */
9272
+ onSuccess?: () => void;
9250
9273
  }
9251
9274
  /**
9252
9275
  * @description Interface for the safe draft action.
@@ -9261,9 +9284,39 @@ interface QdPageSaveDraftAction {
9261
9284
  i18n: string;
9262
9285
  };
9263
9286
  /**
9264
- * @description Handler function that is triggered when the save draft action is executed.
9287
+ * @description Triggered when the save draft action is executed.
9288
+ *
9289
+ * Success criteria:
9290
+ * - If the handler returns an `Observable<boolean>`, only the first emission counts:
9291
+ * - **true:** success — the framework marks the form as saved (the page is no longer dirty).
9292
+ * - **false:** failure/cancel — the form stays dirty.
9293
+ * - If the handler returns `void`, the action is treated as instant success and the form is marked as saved immediately.
9294
+ *
9295
+ * Errors emitted by the Observable are not caught by the framework — handle them via `catchError` in the handler.
9265
9296
  */
9266
- handler: () => void;
9297
+ handler: (formValues?: any) => void | Observable<boolean>;
9298
+ /**
9299
+ * @description Optional callback invoked after the framework marks the form as saved on a successful save draft.
9300
+ *
9301
+ * * Runs in the framework's navigation-bypass window, so router navigation from this hook does **not**
9302
+ * raise the unsaved-changes dialog.
9303
+ *
9304
+ * * For async handlers (returning `Observable<boolean>`), this hook is the **only** race-free place to
9305
+ * navigate. Side effects in `tap` run *before* the framework marks the form as saved; navigation
9306
+ * from there would still see a dirty form and trigger the dialog.
9307
+ *
9308
+ * @example
9309
+ * ```ts
9310
+ * saveDraft: {
9311
+ * handler: () => api.saveDraft(form.value).pipe(
9312
+ * tap(result => notifications.success('Draft saved')),
9313
+ * map(() => true)
9314
+ * ),
9315
+ * onSuccess: () => router.navigateByUrl('/drafts')
9316
+ * }
9317
+ * ```
9318
+ */
9319
+ onSuccess?: () => void;
9267
9320
  }
9268
9321
  /**
9269
9322
  * @description Interface for the cancel action, including an optional confirmation message.
@@ -9306,9 +9359,39 @@ interface QdPageCreateSubmitAction {
9306
9359
  i18n: string;
9307
9360
  };
9308
9361
  /**
9309
- * @description Handler function that is triggered when the submit action is executed.
9362
+ * @description Triggered when the submit action is executed.
9363
+ *
9364
+ * Success criteria:
9365
+ * - If the handler returns an `Observable<boolean>`, only the first emission counts:
9366
+ * - **true:** success — the framework marks the form as saved (the page is no longer dirty).
9367
+ * - **false:** failure/cancel — the form stays dirty.
9368
+ * - If the handler returns `void`, the action is treated as instant success and the form is marked as saved immediately.
9369
+ *
9370
+ * Errors emitted by the Observable are not caught by the framework — handle them via `catchError` in the handler.
9310
9371
  */
9311
- handler: (formValues?: any) => void;
9372
+ handler: (formValues?: any) => void | Observable<boolean>;
9373
+ /**
9374
+ * @description Optional callback invoked after the framework marks the form as saved on a successful submit.
9375
+ *
9376
+ * * Runs in the framework's navigation-bypass window, so router navigation from this hook does **not**
9377
+ * raise the unsaved-changes dialog.
9378
+ *
9379
+ * * For async handlers (returning `Observable<boolean>`), this hook is the **only** race-free place to
9380
+ * navigate. Side effects in `tap` run *before* the framework marks the form as saved; navigation
9381
+ * from there would still see a dirty form and trigger the dialog.
9382
+ *
9383
+ * @example
9384
+ * ```ts
9385
+ * submit: {
9386
+ * handler: (formValues) => api.create(formValues).pipe(
9387
+ * tap(result => notifications.success('Created')),
9388
+ * map(() => true)
9389
+ * ),
9390
+ * onSuccess: () => router.navigateByUrl('/')
9391
+ * }
9392
+ * ```
9393
+ */
9394
+ onSuccess?: () => void;
9312
9395
  }
9313
9396
  /**
9314
9397
  * @description Interface for the submit action.
@@ -9323,9 +9406,17 @@ interface QdPageSubmitAction {
9323
9406
  i18n: string;
9324
9407
  };
9325
9408
  /**
9326
- * @description Handler function that is triggered when the submit action is executed.
9409
+ * @description Triggered when the submit action is executed.
9410
+ *
9411
+ * Success criteria:
9412
+ * - If the handler returns an `Observable<boolean>`, only the first emission counts:
9413
+ * - **true:** success — the framework marks the form as saved (the page is no longer dirty).
9414
+ * - **false:** failure/cancel — the form stays dirty.
9415
+ * - If the handler returns `void`, the action is treated as instant success and the form is marked as saved immediately.
9416
+ *
9417
+ * Errors emitted by the Observable are not caught by the framework — handle them via `catchError` in the handler.
9327
9418
  */
9328
- handler: (formValues?: any) => void;
9419
+ handler: (formValues?: any) => void | Observable<boolean>;
9329
9420
  /**
9330
9421
  * @description By default, the visibility of the submit button depends on the page type and the operation mode.
9331
9422
  * To completely hide the submit button, you can set this isHidden flag.
@@ -9333,6 +9424,28 @@ interface QdPageSubmitAction {
9333
9424
  * @default false
9334
9425
  */
9335
9426
  isHidden?: boolean;
9427
+ /**
9428
+ * @description Optional callback invoked after the framework marks the form as saved on a successful submit.
9429
+ *
9430
+ * * Runs in the framework's navigation-bypass window, so router navigation from this hook does **not**
9431
+ * raise the unsaved-changes dialog.
9432
+ *
9433
+ * * For async handlers (returning `Observable<boolean>`), this hook is the **only** race-free place to
9434
+ * navigate. Side effects in `tap` run *before* the framework marks the form as saved; navigation
9435
+ * from there would still see a dirty form and trigger the dialog.
9436
+ *
9437
+ * @example
9438
+ * ```ts
9439
+ * submit: {
9440
+ * handler: (formValues) => api.update(formValues).pipe(
9441
+ * tap(result => notifications.success('Updated')),
9442
+ * map(() => true)
9443
+ * ),
9444
+ * onSuccess: () => router.navigateByUrl('/list')
9445
+ * }
9446
+ * ```
9447
+ */
9448
+ onSuccess?: () => void;
9336
9449
  }
9337
9450
  /**
9338
9451
  * @description Interface for the edit action.
@@ -12874,7 +12987,15 @@ declare class QdSectionComponent implements OnInit, AfterViewInit, OnChanges, On
12874
12987
  * handler: () => handleCancel()
12875
12988
  * },
12876
12989
  * save: {
12877
- * handler: (formValues) => handleSave(formValues)
12990
+ * handler: () => saveApi.save(form.value).pipe(
12991
+ * tap(result => notifications.success('Saved')),
12992
+ * map(() => true),
12993
+ * catchError(err => {
12994
+ * notifications.showError(err);
12995
+ * return of(false);
12996
+ * })
12997
+ * ),
12998
+ * onSuccess: () => router.navigate(['/overview'])
12878
12999
  * }
12879
13000
  * }
12880
13001
  * };
@@ -12992,7 +13113,8 @@ declare class QdSectionComponent implements OnInit, AfterViewInit, OnChanges, On
12992
13113
  * pageType: 'create',
12993
13114
  * pageTypeConfig: {
12994
13115
  * submit: {
12995
- * handler: (formValues) => handleSubmit(formValues)
13116
+ * handler: (formValues) => createApi.create(formValues).pipe(map(() => true)),
13117
+ * onSuccess: () => router.navigate(['/items'])
12996
13118
  * }
12997
13119
  * }
12998
13120
  * };
@@ -13085,7 +13207,14 @@ declare class QdSectionComponent implements OnInit, AfterViewInit, OnChanges, On
13085
13207
  * handler: () => handleCancel()
13086
13208
  * },
13087
13209
  * save: {
13088
- * handler: (formValues) => handleSave(formValues)
13210
+ * handler: (formValues) => saveApi.save(formValues).pipe(
13211
+ * map(() => true),
13212
+ * catchError(err => {
13213
+ * notifications.showError(err);
13214
+ * return of(false);
13215
+ * })
13216
+ * ),
13217
+ * onSuccess: () => router.navigate(['/overview'])
13089
13218
  * }
13090
13219
  * }
13091
13220
  * };
@@ -13197,7 +13326,7 @@ declare class QdPageComponent<T extends object> implements OnInit, OnChanges, Af
13197
13326
  private handleCancelActionWithFormChanges;
13198
13327
  private initSaveDraftFooterAction;
13199
13328
  private updateInspectPageOperationMode;
13200
- private generateFooterActionHandler;
13329
+ private generateCommitActionHandler;
13201
13330
  private setupCancelConfirmation;
13202
13331
  private initSubmitValidation;
13203
13332
  private setupPageDialogCloseContract;
@@ -13324,6 +13453,7 @@ declare class QdPageStoreService<T extends object> {
13324
13453
  declare class QdPageObjectHeaderComponent<T extends object> implements OnInit, OnChanges, OnDestroy {
13325
13454
  private pageObjectResolver;
13326
13455
  private formGroupManagerService;
13456
+ private navigationInterceptor;
13327
13457
  private dialogComponent;
13328
13458
  private dialog;
13329
13459
  private confirmationDialogService;
@@ -17014,17 +17144,35 @@ interface QdQuickEditConfig<T extends string> {
17014
17144
  */
17015
17145
  canAdd?: boolean;
17016
17146
  /**
17017
- * @description An optional confirmation message displayed in a dialog before a row is removed via the built-in remove button.
17147
+ * @description Enables a confirmation dialog before a row is removed via the built-in remove button.
17018
17148
  *
17019
- * When provided, a confirmation dialog is shown to the user. The row is only removed if the user confirms.
17020
- * If not provided, the row is removed directly.
17149
+ * When set to `true`, a confirmation dialog with a framework default message is shown. The row is only removed if the user confirms.
17021
17150
  * Only applies when `canAdd` is true and the remove button is visible.
17022
17151
  *
17152
+ * @default false
17153
+ *
17154
+ * @example
17155
+ * ```ts
17156
+ * {
17157
+ * columns: [...],
17158
+ * canAdd: true,
17159
+ * hasRemoveConfirmation: true
17160
+ * }
17161
+ * ```
17162
+ */
17163
+ hasRemoveConfirmation?: boolean;
17164
+ /**
17165
+ * @description Overrides the default message of the remove confirmation dialog.
17166
+ *
17167
+ * When set, the confirmation dialog is shown with the provided message (setting this also enables the dialog for backward compatibility).
17168
+ * If omitted, the framework default message is shown when the dialog is enabled via `hasRemoveConfirmation`.
17169
+ *
17023
17170
  * @example
17024
17171
  * ```ts
17025
17172
  * {
17026
17173
  * columns: [...],
17027
17174
  * canAdd: true,
17175
+ * hasRemoveConfirmation: true,
17028
17176
  * removeConfirmationMessage: { i18n: 'i18n.app.remove.entry.confirmation' }
17029
17177
  * }
17030
17178
  * ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quadrel-enterprise-ui/framework",
3
- "version": "20.9.1",
3
+ "version": "20.10.0-beta.139.1",
4
4
  "exports": {
5
5
  "./jest-preset": "./jest-preset.js",
6
6
  "./package.json": {
@@ -171,5 +171,6 @@
171
171
  "i18n.qd.section.toolbar.defaultAction": "Aktion",
172
172
  "i18n.qd.quick.edit.submitButtonLabel": "Speichern",
173
173
  "i18n.qd.quick.edit.createButtonLabel": "Hinzufügen",
174
- "i18n.qd.quick.edit.removeButtonLabel": "Löschen"
174
+ "i18n.qd.quick.edit.removeButtonLabel": "Löschen",
175
+ "i18n.qd.quick.edit.removeConfirmation.message": "Möchten Sie diesen Eintrag wirklich löschen?"
175
176
  }
@@ -171,5 +171,6 @@
171
171
  "i18n.qd.quick.edit.submitButtonLabel": "Save",
172
172
  "i18n.qd.quick.edit.createButtonLabel": "Add",
173
173
  "i18n.qd.quick.edit.removeButtonLabel": "Remove",
174
+ "i18n.qd.quick.edit.removeConfirmation.message": "Are you sure you want to remove this entry?",
174
175
  "i18n.contact.tag": "AEO"
175
176
  }
@@ -171,5 +171,6 @@
171
171
  "i18n.qd.quick.edit.submitButtonLabel": "Enregistrer",
172
172
  "i18n.qd.quick.edit.createButtonLabel": "Ajouter",
173
173
  "i18n.qd.quick.edit.removeButtonLabel": "Retirer",
174
+ "i18n.qd.quick.edit.removeConfirmation.message": "Voulez-vous vraiment retirer cette entrée ?",
174
175
  "i18n.contact.tag": "AEO"
175
176
  }
@@ -171,6 +171,7 @@
171
171
  "i18n.qd.quick.edit.submitButtonLabel": "Trasferire",
172
172
  "i18n.qd.quick.edit.createButtonLabel": "Aggiungere",
173
173
  "i18n.qd.quick.edit.removeButtonLabel": "Eliminare",
174
+ "i18n.qd.quick.edit.removeConfirmation.message": "Vuoi davvero eliminare questa voce?",
174
175
  "i18n.contact.tag": "AEO",
175
176
  "i18n.qd.page.footer.saveDraft": "Entwurf speichern"
176
177
  }