@quadrel-enterprise-ui/framework 19.6.0 → 19.6.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.
@@ -28954,8 +28954,23 @@ class QdPageSubmitActionService {
28954
28954
  configureSubmitAction(submitConfig) {
28955
28955
  this._labelI18n = submitConfig.label?.i18n || 'i18n.qd.page.footer.submit';
28956
28956
  this._submitHandler = this.buildSubmitHandler(submitConfig.handler);
28957
+ this.registerSubmitAction();
28957
28958
  this.trackFormValidity();
28958
28959
  }
28960
+ registerSubmitAction() {
28961
+ this.footerService.setActions([
28962
+ {
28963
+ key: 'submit',
28964
+ action: {
28965
+ titleI18n: this._labelI18n,
28966
+ handler: this._submitHandler,
28967
+ isDisabled: true,
28968
+ isVisible: this._isVisible,
28969
+ type: QdFooterActionType.Primary
28970
+ }
28971
+ }
28972
+ ]);
28973
+ }
28959
28974
  buildSubmitHandler(originalHandler) {
28960
28975
  return (...args) => {
28961
28976
  if (!this.formGroupManagerService.hasFormGroups())
@@ -29441,9 +29456,11 @@ class QdPageComponent {
29441
29456
  if (!configChange)
29442
29457
  return;
29443
29458
  const { currentValue: curr, previousValue: prev } = configChange;
29444
- if (curr?.pageTypeConfig?.submit?.isHidden !== prev?.pageTypeConfig?.submit?.isHidden)
29459
+ if (!curr?.pageTypeConfig?.submit || !prev?.pageTypeConfig?.submit)
29460
+ return;
29461
+ if (curr.pageTypeConfig.submit.isHidden !== prev.pageTypeConfig.submit.isHidden)
29445
29462
  this.footerService.updateActions([
29446
- { actionKey: 'submit', partialAction: { isVisible: !curr?.pageTypeConfig?.submit?.isHidden } }
29463
+ { actionKey: 'submit', partialAction: { isVisible: !curr.pageTypeConfig.submit.isHidden } }
29447
29464
  ]);
29448
29465
  }
29449
29466
  ngAfterViewInit() {
@@ -29519,11 +29536,12 @@ class QdPageComponent {
29519
29536
  ]);
29520
29537
  }
29521
29538
  updateInspectPageOperationMode(pageTypeConfig, mode) {
29522
- this.submitActionService.setSubmitActionForInspect(pageTypeConfig, mode === 'view');
29523
- this.footerService.updateActions([
29524
- { actionKey: 'submit', partialAction: { isVisible: mode === 'view' && !pageTypeConfig?.submit?.isHidden } }
29525
- ]);
29526
- this.initSubmitValidation();
29539
+ if (pageTypeConfig?.submit) {
29540
+ const isVisible = mode === 'view' && !pageTypeConfig.submit.isHidden;
29541
+ this.submitActionService.setSubmitActionForInspect(pageTypeConfig, isVisible);
29542
+ this.footerService.updateActions([{ actionKey: 'submit', partialAction: { isVisible } }]);
29543
+ this.initSubmitValidation();
29544
+ }
29527
29545
  if (this._isInitialized)
29528
29546
  this.operationModeChanged.emit(mode);
29529
29547
  }