@quadrel-enterprise-ui/framework 20.9.0 → 20.9.1-beta.137.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 advances the form baseline 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 commits the baseline; navigation from
|
|
9259
|
+
* 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
|
|
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 advances the form baseline so 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 baseline is committed 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 advances the form baseline 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 commits the baseline; navigation from
|
|
9306
|
+
* 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
|
|
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 advances the form baseline so 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 baseline is committed immediately.
|
|
9369
|
+
*
|
|
9370
|
+
* Errors emitted by the Observable are not caught by the framework — handle them via `catchError` in the handler.
|
|
9371
|
+
*/
|
|
9372
|
+
handler: (formValues?: any) => void | Observable<boolean>;
|
|
9373
|
+
/**
|
|
9374
|
+
* @description Optional callback invoked after the framework advances the form baseline 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 commits the baseline; navigation from
|
|
9381
|
+
* 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
|
+
* ```
|
|
9310
9393
|
*/
|
|
9311
|
-
|
|
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
|
|
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 advances the form baseline so 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 baseline is committed 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 advances the form baseline 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 commits the baseline; navigation from
|
|
9435
|
+
* 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: (
|
|
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) =>
|
|
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) =>
|
|
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
|
|
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;
|