@smartbit4all/ng-client 7.3.16 → 7.3.18

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.
@@ -7632,12 +7632,11 @@ class SmartFormService {
7632
7632
  }
7633
7633
  applyComponentConstraints(widgets, constraints) {
7634
7634
  widgets.forEach((widget) => {
7635
- let widgetConstraints = constraints?.filter(
7636
- //(constraint: SmartFormComponentConstraint) => constraint.dataName === widget.key
7637
- (constraint) => this.antPathMatcher(constraint.dataName, widget.key));
7635
+ let widgetConstraints = constraints?.filter((constraint) => this.antPathMatcher(constraint.dataName, widget.key));
7638
7636
  if (widgetConstraints && widgetConstraints.length) {
7639
7637
  widgetConstraints.forEach((constraint) => {
7640
- if (constraint.visible === undefined) {
7638
+ // null or undefined: not specified, keep what earlier constraints (or the layout) set
7639
+ if (constraint.visible == null) {
7641
7640
  if (widget.isVisible === undefined) {
7642
7641
  widget.isVisible = true;
7643
7642
  }
@@ -7660,10 +7659,10 @@ class SmartFormService {
7660
7659
  let requiredIndex = validators.findIndex((v) => v.validator === Validators.required);
7661
7660
  let wasMandatory = requiredIndex >= 0;
7662
7661
  let tobeMandatory = false;
7663
- if (constraint.mandatory === undefined) {
7664
- // not specified on server, use client state
7665
- // if widget is not visible, client should default to not mandatory
7666
- tobeMandatory = widget.isVisible && wasMandatory;
7662
+ if (constraint.mandatory == null) {
7663
+ // not specified: keep the state left by earlier constraints or the layout;
7664
+ // a hidden widget is not mandatory unless a constraint says so
7665
+ tobeMandatory = !!widget.isVisible && wasMandatory;
7667
7666
  }
7668
7667
  else {
7669
7668
  tobeMandatory = constraint.mandatory;
@@ -7692,7 +7691,7 @@ class SmartFormService {
7692
7691
  }
7693
7692
  this.addEmptyItemToValueList(widget, emptyLabel);
7694
7693
  }
7695
- if (constraint.enabled === undefined || constraint.enabled === null) {
7694
+ if (constraint.enabled == null) {
7696
7695
  if (widget.isDisabled === undefined) {
7697
7696
  widget.isDisabled = false;
7698
7697
  }
@@ -24378,7 +24377,6 @@ class SmartFilterParamsComponent {
24378
24377
  this.setUp(this.service().model);
24379
24378
  });
24380
24379
  this.setUp(this.service().model);
24381
- console.log(this.service().model);
24382
24380
  }
24383
24381
  ngOnDestroy() {
24384
24382
  this._destroy$.next();
@@ -25981,6 +25979,30 @@ class GenericPageComponent extends SmartComponent {
25981
25979
  }
25982
25980
  return false;
25983
25981
  }
25982
+ initData() {
25983
+ this.claimDialogFooterActions();
25984
+ super.initData();
25985
+ }
25986
+ initActions() {
25987
+ this.claimDialogFooterActions();
25988
+ super.initActions();
25989
+ }
25990
+ claimDialogFooterActions() {
25991
+ if (!this.isShownInDialog()) {
25992
+ return;
25993
+ }
25994
+ this.uiActionModels.forEach((actionModel) => {
25995
+ if (!actionModel.uiAction.toolbar) {
25996
+ actionModel.uiAction.toolbar = TOOLBAR_DIALOG_FOOTER;
25997
+ }
25998
+ });
25999
+ }
26000
+ isShownInDialog() {
26001
+ const currentView = this.viewContext
26002
+ ?.getCurrentViewContext()
26003
+ ?.views.find((view) => this.model?.name == view.viewName);
26004
+ return currentView?.type == ViewType.DIALOG;
26005
+ }
25984
26006
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: GenericPageComponent, deps: [{ token: i0.Injector }, { token: SMART_GENERIC_PAGE_NAME }, { token: SMART_GENERIC_COMPONENT_NAME }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
25985
26007
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: GenericPageComponent, isStandalone: true, selector: "app-generic-page", usesInheritance: true, ngImport: i0, template: "<div class=\"generic-page-container\">\r\n @if (componentLayout) {\r\n <smart-component-layout\r\n class=\"generic-page-layout\"\r\n [smartComponentLayout]=\"componentLayout\"\r\n ></smart-component-layout>\r\n }\r\n <smart-ui-action-toolbar\r\n class=\"generic-page-toolbar\"\r\n [uiActionModels]=\"uiActionModels\"\r\n ></smart-ui-action-toolbar>\r\n</div>\r\n@if (showRouterOutlet()) {\r\n <div>\r\n <ng-container [smartEmbeddedSlot]=\"'router-outlet'\" [containerUuid]=\"uuid\"></ng-container>\r\n </div>\r\n}\r\n", styles: [".generic-page-container{display:flex;flex-direction:column;gap:1rem}\n"], dependencies: [{ kind: "component", type: SmartComponentLayoutComponent, selector: "smart-component-layout", inputs: ["smartComponentLayout", "parentLayoutComponent", "gridRow"] }, { kind: "component", type: UiActionToolbarComponent, selector: "smart-ui-action-toolbar", inputs: ["uiActionModels", "uiActionDescriptorService", "id", "executor", "widgetId", "nodeId", "actionParams", "scrollOnWrap", "toolbarPropertes"], outputs: ["actionFired"] }, { kind: "directive", type: SmartEmbeddedSlotDirective, selector: "[smartEmbeddedSlot]", inputs: ["smartEmbeddedSlot", "containerUuid"] }] }); }
25986
26008
  }