@smartsoft001/crud-shell-angular 2.153.0 → 2.155.0

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.
@@ -3040,6 +3040,15 @@ class CrudItemPageBaseComponent extends BaseComponent$1 {
3040
3040
  super();
3041
3041
  this.selected = this.facade.selected;
3042
3042
  }
3043
+ /**
3044
+ * The reactive form of the first rendered `<smart-form>`, or `undefined`
3045
+ * until the form factory has built it. A method rather than a `computed`:
3046
+ * `FormComponent.form` is a plain field assigned asynchronously, so a
3047
+ * computed would cache `undefined` from the first read.
3048
+ */
3049
+ getForm() {
3050
+ return this.formComponents()[0]?.form;
3051
+ }
3043
3052
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: CrudItemPageBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3044
3053
  static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "22.1.3", type: CrudItemPageBaseComponent, isStandalone: true, inputs: { detailsOptions: { classPropertyName: "detailsOptions", publicName: "detailsOptions", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, uniqueProvider: { classPropertyName: "uniqueProvider", publicName: "uniqueProvider", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onPartialChange: "onPartialChange", onChange: "onChange", onValidChange: "onValidChange" }, viewQueries: [{ propertyName: "contentTpl", first: true, predicate: ["contentTpl"], descendants: true, isSignal: true }, { propertyName: "formComponents", predicate: FormComponent, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0 });
3045
3054
  }
@@ -3451,10 +3460,14 @@ class ItemComponent extends CreateDynamicComponent('crud-item-page') {
3451
3460
  }
3452
3461
  checkFirstInvalid() {
3453
3462
  this.cd.detectChanges();
3454
- const form = this.template() === 'default'
3455
- ? this.standardComponents()?.[0]?.formComponents?.[0]?.form
3456
- : this.baseInstance.formComponents()[0].form;
3463
+ const host = this.template() === 'default'
3464
+ ? this.standardComponents()[0]
3465
+ : this.baseInstance;
3466
+ const form = host?.getForm();
3457
3467
  this.cd.detectChanges();
3468
+ // Nothing has been built yet, so there is nothing valid to submit.
3469
+ if (!form)
3470
+ return true;
3458
3471
  if (form.valid)
3459
3472
  return false;
3460
3473
  const invalidFields = [];
@@ -3511,13 +3524,18 @@ class ItemComponent extends CreateDynamicComponent('crud-item-page') {
3511
3524
  <div class="dynamic-content"></div>
3512
3525
  <div #bottomTpl class="text-xl py-2.5 separator"></div>
3513
3526
  </smart-page>
3514
- `, isInline: true, dependencies: [{ kind: "component", type: PageComponent, selector: "smart-page", inputs: ["options", "class"] }, { kind: "component", type: ItemStandardComponent, selector: "smart-crud-item-standard-page" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.Eager });
3527
+ `, isInline: true, dependencies: [{ kind: "component", type: PageComponent, selector: "smart-page", inputs: ["options", "class"] }, { kind: "component", type: ItemStandardComponent, selector: "smart-crud-item-standard-page" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: DynamicContentDirective, selector: ".dynamic-content" }], changeDetection: i0.ChangeDetectionStrategy.Eager });
3515
3528
  }
3516
3529
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ItemComponent, decorators: [{
3517
3530
  type: Component,
3518
3531
  args: [{
3519
3532
  selector: 'smart-crud-item-page',
3520
- imports: [PageComponent, ItemStandardComponent, NgTemplateOutlet],
3533
+ imports: [
3534
+ PageComponent,
3535
+ ItemStandardComponent,
3536
+ NgTemplateOutlet,
3537
+ DynamicContentDirective,
3538
+ ],
3521
3539
  changeDetection: ChangeDetectionStrategy.Eager,
3522
3540
  template: `
3523
3541
  <smart-page [options]="pageOptions()" [class]="config.cssClass || ''">
@@ -3975,13 +3993,18 @@ class ListComponent extends CreateDynamicComponent('crud-list-page') {
3975
3993
  <div class="dynamic-content"></div>
3976
3994
  </smart-page>
3977
3995
  }
3978
- `, isInline: true, dependencies: [{ kind: "component", type: PageComponent, selector: "smart-page", inputs: ["options", "class"] }, { kind: "component", type: ListStandardComponent, selector: "smart-crud-list-standard-page" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.Eager });
3996
+ `, isInline: true, dependencies: [{ kind: "component", type: PageComponent, selector: "smart-page", inputs: ["options", "class"] }, { kind: "component", type: ListStandardComponent, selector: "smart-crud-list-standard-page" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: DynamicContentDirective, selector: ".dynamic-content" }], changeDetection: i0.ChangeDetectionStrategy.Eager });
3979
3997
  }
3980
3998
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ListComponent, decorators: [{
3981
3999
  type: Component,
3982
4000
  args: [{
3983
4001
  selector: 'smart-crud-list-page',
3984
- imports: [PageComponent, ListStandardComponent, NgTemplateOutlet],
4002
+ imports: [
4003
+ PageComponent,
4004
+ ListStandardComponent,
4005
+ NgTemplateOutlet,
4006
+ DynamicContentDirective,
4007
+ ],
3985
4008
  changeDetection: ChangeDetectionStrategy.Eager,
3986
4009
  template: `
3987
4010
  @if (filter() && pageOptions()) {