@indigina/ui-kit 1.1.540 → 1.1.541

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.
@@ -16359,21 +16359,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
16359
16359
  const KIT_ENTITY_CREATE_SERVICE = new InjectionToken('kitEntityCreateService');
16360
16360
  class KitCreateEntityDialogComponent extends DialogContentBase {
16361
16361
  constructor() {
16362
- super(...arguments);
16362
+ const dialog = inject(DialogRef);
16363
+ super(dialog);
16363
16364
  this.entityService = inject(KIT_ENTITY_CREATE_SERVICE);
16364
16365
  this.kitFormErrors = inject(KitFormErrors);
16365
16366
  this.formBuilder = inject(FormBuilder);
16367
+ this.maxLength = input(256, ...(ngDevMode ? [{ debugName: "maxLength" }] : /* istanbul ignore next */ []));
16366
16368
  this.form = this.formBuilder.group({
16367
16369
  name: this.formBuilder.control('', [
16368
16370
  Validators.required,
16369
16371
  kitWhitespaceValidator(),
16370
- Validators.maxLength(256),
16372
+ Validators.maxLength(this.maxLength()),
16371
16373
  ]),
16372
16374
  });
16373
16375
  this.kitButtonKind = KitButtonKind;
16374
16376
  this.kitButtonType = KitButtonType;
16375
16377
  this.isSaving = signal(false, ...(ngDevMode ? [{ debugName: "isSaving" }] : /* istanbul ignore next */ []));
16376
16378
  this.getTextboxState = getTextboxState;
16379
+ effect(() => {
16380
+ const maxLength = this.maxLength();
16381
+ this.form.controls['name'].setValidators([
16382
+ Validators.required,
16383
+ kitWhitespaceValidator(),
16384
+ Validators.maxLength(maxLength),
16385
+ ]);
16386
+ this.form.controls['name'].updateValueAndValidity({ emitEvent: false });
16387
+ });
16377
16388
  }
16378
16389
  createEntity() {
16379
16390
  this.isSaving.set(true);
@@ -16384,8 +16395,8 @@ class KitCreateEntityDialogComponent extends DialogContentBase {
16384
16395
  getFormErrorMessages(form, controlName) {
16385
16396
  return this.kitFormErrors.getErrors(form.controls[controlName]).join('. ');
16386
16397
  }
16387
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitCreateEntityDialogComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
16388
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.4", type: KitCreateEntityDialogComponent, isStandalone: true, selector: "kit-create-entity-dialog", providers: [KitFormErrors], usesInheritance: true, ngImport: i0, template: "<div [formGroup]=\"form\">\n <kit-textbox class=\"textbox\"\n formControlName=\"name\"\n [label]=\"'Name' | translate\"\n [showStateIcon]=\"false\"\n [state]=\"getTextboxState(form.get('name'))\"\n [messageText]=\"getFormErrorMessages(form, 'name')\" />\n\n <kit-dialog-actions>\n <kit-button [label]=\"'Cancel' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [type]=\"kitButtonType.GHOST\"\n (clicked)=\"dialog.close()\" />\n <kit-button [label]=\"'Save' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [disabled]=\"form.invalid || isSaving()\"\n (clicked)=\"createEntity()\" />\n </kit-dialog-actions>\n</div>\n", styles: ["::ng-deep .kit-dialog .k-dialog{min-width:400px}::ng-deep .kit-dialog .k-dialog .k-dialog-content{padding:20px 25px}\n"], dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "component", type: KitTextboxComponent, selector: "kit-textbox", inputs: ["placeholder", "label", "labelTooltip", "defaultValue", "messageIcon", "messageText", "messageTemplate", "disabled", "maxlength", "state", "size", "icon", "clearButton", "showStateIcon", "readonly", "customStateIcon", "type"], outputs: ["defaultValueChange", "disabledChange", "blured", "focused", "changed"] }, { kind: "component", type: KitDialogActionsComponent, selector: "kit-dialog-actions" }, { kind: "component", type: KitButtonComponent, selector: "kit-button", inputs: ["disabled", "label", "type", "icon", "iconType", "kind", "state", "iconPosition", "buttonClass", "active"], outputs: ["clicked"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$8.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$8.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$8.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "pipe", type: i1$e.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
16398
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitCreateEntityDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
16399
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.4", type: KitCreateEntityDialogComponent, isStandalone: true, selector: "kit-create-entity-dialog", inputs: { maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null } }, providers: [KitFormErrors], usesInheritance: true, ngImport: i0, template: "<div [formGroup]=\"form\">\n <kit-textbox class=\"textbox\"\n formControlName=\"name\"\n [label]=\"'Name' | translate\"\n [showStateIcon]=\"false\"\n [state]=\"getTextboxState(form.get('name'))\"\n [messageText]=\"getFormErrorMessages(form, 'name')\" />\n\n <kit-dialog-actions>\n <kit-button [label]=\"'Cancel' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [type]=\"kitButtonType.GHOST\"\n (clicked)=\"dialog.close()\" />\n <kit-button [label]=\"'Save' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [disabled]=\"form.invalid || isSaving()\"\n (clicked)=\"createEntity()\" />\n </kit-dialog-actions>\n</div>\n", styles: ["::ng-deep .kit-dialog .k-dialog{min-width:400px}::ng-deep .kit-dialog .k-dialog .k-dialog-content{padding:20px 25px}\n"], dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "component", type: KitTextboxComponent, selector: "kit-textbox", inputs: ["placeholder", "label", "labelTooltip", "defaultValue", "messageIcon", "messageText", "messageTemplate", "disabled", "maxlength", "state", "size", "icon", "clearButton", "showStateIcon", "readonly", "customStateIcon", "type"], outputs: ["defaultValueChange", "disabledChange", "blured", "focused", "changed"] }, { kind: "component", type: KitDialogActionsComponent, selector: "kit-dialog-actions" }, { kind: "component", type: KitButtonComponent, selector: "kit-button", inputs: ["disabled", "label", "type", "icon", "iconType", "kind", "state", "iconPosition", "buttonClass", "active"], outputs: ["clicked"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$8.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$8.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$8.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "pipe", type: i1$e.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
16389
16400
  }
16390
16401
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: KitCreateEntityDialogComponent, decorators: [{
16391
16402
  type: Component,
@@ -16397,7 +16408,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
16397
16408
  FormsModule,
16398
16409
  ReactiveFormsModule,
16399
16410
  ], providers: [KitFormErrors], template: "<div [formGroup]=\"form\">\n <kit-textbox class=\"textbox\"\n formControlName=\"name\"\n [label]=\"'Name' | translate\"\n [showStateIcon]=\"false\"\n [state]=\"getTextboxState(form.get('name'))\"\n [messageText]=\"getFormErrorMessages(form, 'name')\" />\n\n <kit-dialog-actions>\n <kit-button [label]=\"'Cancel' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [type]=\"kitButtonType.GHOST\"\n (clicked)=\"dialog.close()\" />\n <kit-button [label]=\"'Save' | translate\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [disabled]=\"form.invalid || isSaving()\"\n (clicked)=\"createEntity()\" />\n </kit-dialog-actions>\n</div>\n", styles: ["::ng-deep .kit-dialog .k-dialog{min-width:400px}::ng-deep .kit-dialog .k-dialog .k-dialog-content{padding:20px 25px}\n"] }]
16400
- }] });
16411
+ }], ctorParameters: () => [], propDecorators: { maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }] } });
16401
16412
 
16402
16413
  var KitPermissionTypes;
16403
16414
  (function (KitPermissionTypes) {
@@ -16770,6 +16781,7 @@ class KitUserRolesComponent {
16770
16781
  content: KitCreateEntityDialogComponent,
16771
16782
  appendTo: this.viewContainerRef,
16772
16783
  });
16784
+ signalSetFn(this.kitDialogService.dialogInstance.maxLength[SIGNAL], 64);
16773
16785
  this.kitDialogService.dialogRef?.result.pipe(take(1)).subscribe((result) => {
16774
16786
  if (result && 'id' in result) {
16775
16787
  this.kitCardDetailsComponent().appendCard(result);