@acorex/components 21.0.0-next.26 → 21.0.0-next.27

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.
@@ -1,9 +1,9 @@
1
- import { AXEvent, MXBaseComponent, AXComponent, AXValuableComponent } from '@acorex/cdk/common';
1
+ import { AXEvent, MXValueComponent, AXComponent, MXBaseComponent, AXValuableComponent } from '@acorex/cdk/common';
2
2
  import { AXLabelComponent } from '@acorex/components/label';
3
3
  import { AXSelectBoxComponent } from '@acorex/components/select-box';
4
4
  import { AXUnsubscriber } from '@acorex/core/utils';
5
5
  import * as i0 from '@angular/core';
6
- import { input, contentChildren, effect, EventEmitter, Input, Output, ChangeDetectionStrategy, ViewEncapsulation, Component, signal, inject, ViewContainerRef, afterNextRender, HostBinding, ContentChild, InjectionToken, Directive, NgModule } from '@angular/core';
6
+ import { input, contentChildren, effect, afterNextRender, EventEmitter, Input, Output, ChangeDetectionStrategy, ViewEncapsulation, Component, signal, inject, ViewContainerRef, HostBinding, ContentChild, InjectionToken, Directive, NgModule } from '@angular/core';
7
7
  import { AXAlertComponent, AXAlertModule } from '@acorex/components/alert';
8
8
  import { AXButtonComponent, AXButtonModule } from '@acorex/components/button';
9
9
  import { AXDecoratorIconComponent, AXDecoratorGenericComponent, AXDecoratorModule } from '@acorex/components/decorators';
@@ -23,8 +23,9 @@ class AXFormValidationEvent extends AXEvent {
23
23
  *
24
24
  * @category Components
25
25
  */
26
- class AXFormComponent extends MXBaseComponent {
26
+ class AXFormComponent extends MXValueComponent {
27
27
  #applyLooks;
28
+ #init;
28
29
  /**
29
30
  * Determines when the form should be updated.
30
31
  */
@@ -79,6 +80,28 @@ class AXFormComponent extends MXBaseComponent {
79
80
  }
80
81
  });
81
82
  }, ...(ngDevMode ? [{ debugName: "#applyLooks" }] : []));
83
+ this.#init = afterNextRender(() => {
84
+ this.content().forEach((item) => {
85
+ if (item.input) {
86
+ item.input.disabled = this.disabled;
87
+ item.input.readonly = this.readonly;
88
+ }
89
+ });
90
+ this.disabledChange.subscribe((disabled) => {
91
+ this.content().forEach((item) => {
92
+ if (item.input) {
93
+ item.input.disabled = disabled;
94
+ }
95
+ });
96
+ });
97
+ this.readonlyChange.subscribe((readonly) => {
98
+ this.content().forEach((item) => {
99
+ if (item.input) {
100
+ item.input.readonly = readonly;
101
+ }
102
+ });
103
+ });
104
+ });
82
105
  /**
83
106
  * Determines the style of the message in the form field.
84
107
  * @defaultValue 'bottom'
@@ -199,7 +222,7 @@ class AXFormComponent extends MXBaseComponent {
199
222
  this._clearSubs();
200
223
  }
201
224
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: AXFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
202
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.9", type: AXFormComponent, isStandalone: true, selector: "ax-form", inputs: { labelMode: { classPropertyName: "labelMode", publicName: "labelMode", isSignal: true, isRequired: false, transformFunction: null }, look: { classPropertyName: "look", publicName: "look", isSignal: true, isRequired: false, transformFunction: null }, messageStyle: { classPropertyName: "messageStyle", publicName: "messageStyle", isSignal: true, isRequired: false, transformFunction: null }, updateOn: { classPropertyName: "updateOn", publicName: "updateOn", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { onValidate: "onValidate", updateOnChange: "updateOnChange" }, providers: [{ provide: AXComponent, useExisting: AXFormComponent }], queries: [{ propertyName: "content", predicate: AXFormFieldComponent, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `<form (submit)="_handleSubmit($event)" (reset)="_handleReset()" class="ax-{{ messageStyle() }}-error">
225
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.9", type: AXFormComponent, isStandalone: true, selector: "ax-form", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: false, isRequired: false, transformFunction: null }, labelMode: { classPropertyName: "labelMode", publicName: "labelMode", isSignal: true, isRequired: false, transformFunction: null }, look: { classPropertyName: "look", publicName: "look", isSignal: true, isRequired: false, transformFunction: null }, messageStyle: { classPropertyName: "messageStyle", publicName: "messageStyle", isSignal: true, isRequired: false, transformFunction: null }, updateOn: { classPropertyName: "updateOn", publicName: "updateOn", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { onValidate: "onValidate", updateOnChange: "updateOnChange" }, providers: [{ provide: AXComponent, useExisting: AXFormComponent }], queries: [{ propertyName: "content", predicate: AXFormFieldComponent, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `<form (submit)="_handleSubmit($event)" (reset)="_handleReset()" class="ax-{{ messageStyle() }}-error">
203
226
  <ng-content></ng-content>
204
227
  </form>`, isInline: true, styles: ["form{height:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
205
228
  }
@@ -207,7 +230,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImpor
207
230
  type: Component,
208
231
  args: [{ selector: 'ax-form', template: `<form (submit)="_handleSubmit($event)" (reset)="_handleReset()" class="ax-{{ messageStyle() }}-error">
209
232
  <ng-content></ng-content>
210
- </form>`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: AXComponent, useExisting: AXFormComponent }], styles: ["form{height:100%}\n"] }]
233
+ </form>`, inputs: ['disabled', 'readonly'], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: AXComponent, useExisting: AXFormComponent }], styles: ["form{height:100%}\n"] }]
211
234
  }], ctorParameters: () => [], propDecorators: { labelMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelMode", required: false }] }], look: [{ type: i0.Input, args: [{ isSignal: true, alias: "look", required: false }] }], content: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => AXFormFieldComponent), { ...{ descendants: true }, isSignal: true }] }], messageStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "messageStyle", required: false }] }], onValidate: [{
212
235
  type: Output
213
236
  }], updateOnChange: [{