@bootkit/ng0 0.0.0-alpha.16 → 0.0.0-alpha.17
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.
- package/components/table/index.d.ts +2 -2
- package/fesm2022/bootkit-ng0-components-form-field.mjs +2 -2
- package/fesm2022/bootkit-ng0-components-form-field.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-form.mjs +210 -140
- package/fesm2022/bootkit-ng0-form.mjs.map +1 -1
- package/form/index.d.ts +53 -37
- package/package.json +15 -15
|
@@ -73,9 +73,9 @@ declare class TableColumnDirective implements OnInit {
|
|
|
73
73
|
* Type of the table cell.
|
|
74
74
|
*/
|
|
75
75
|
type: _angular_core.InputSignal<TableCellType>;
|
|
76
|
-
cellClass: _angular_core.InputSignal<string |
|
|
76
|
+
cellClass: _angular_core.InputSignal<string | {
|
|
77
77
|
[klass: string]: any;
|
|
78
|
-
} | null | undefined>;
|
|
78
|
+
} | string[] | null | undefined>;
|
|
79
79
|
/** Deprecated */
|
|
80
80
|
bold: _angular_core.InputSignal<boolean>;
|
|
81
81
|
shrink: _angular_core.InputSignal<boolean>;
|
|
@@ -96,13 +96,13 @@ class FormFieldComponent {
|
|
|
96
96
|
ngOnDestroy() {
|
|
97
97
|
}
|
|
98
98
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: FormFieldComponent, deps: [{ token: i0.Renderer2 }, { token: i0.DestroyRef }, { token: i1.NgForm, optional: true }, { token: i2.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
99
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.6", type: FormFieldComponent, isStandalone: true, selector: "ng0-form-field, ng0-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, showErrors: { classPropertyName: "showErrors", publicName: "showErrors", isSignal: true, isRequired: false, transformFunction: null }, showRequiredIndicator: { classPropertyName: "showRequiredIndicator", publicName: "showRequiredIndicator", isSignal: true, isRequired: false, transformFunction: null }, showSubscripts: { classPropertyName: "showSubscripts", publicName: "showSubscripts", isSignal: true, isRequired: false, transformFunction: null }, inputGroup: { classPropertyName: "inputGroup", publicName: "inputGroup", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "focusout": "_onFocusOut()" }, properties: { "class.required-form-field": "this.isRequired" } }, queries: [{ propertyName: "_ngControl", first: true, predicate: NgControl, descendants: true, static: true }, { propertyName: "_ngControlElement", first: true, predicate: NgControl, descendants: true, read: ElementRef, static: true }], exportAs: ["ng0FormField"], ngImport: i0, template: "@if(label()) {\n<label class=\"form-field-label\">\n {{label()}}\n <span *ngIf=\"isRequired && showRequiredIndicator()\" class=\"isc-form-field-required-marker\">*</span>\n</label>\n}\n\n@if(inputGroup()) {\n<div class=\"input-group\">\n <ng-container *ngTemplateOutlet=\"contentTemplate\"></ng-container>\n</div>\n}@else {\n<ng-container *ngTemplateOutlet=\"contentTemplate\"></ng-container>\n}\n\n<ng-template #contentTemplate>\n <ng-content></ng-content>\n</ng-template>\n\n@if(showSubscripts()) {\n<div class=\"form-field-subscript-wrapper\">\n @if(showErrors() && errorText && (touched || dirty)) {\n <span class=\"form-field-error text-danger\">\n {{errorText}}\n </span>\n }@if(hint()) {\n <span class=\"form-field-hint\">\n {{hint()}}\n </span>\n }\n</div>\n}", styles: [":host{display:block}.form-field-subscript-wrapper{margin-top:.2rem;min-height:1.5em;line-height:1.5em;text-align:justify}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
99
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.6", type: FormFieldComponent, isStandalone: true, selector: "ng0-form-field, ng0-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, showErrors: { classPropertyName: "showErrors", publicName: "showErrors", isSignal: true, isRequired: false, transformFunction: null }, showRequiredIndicator: { classPropertyName: "showRequiredIndicator", publicName: "showRequiredIndicator", isSignal: true, isRequired: false, transformFunction: null }, showSubscripts: { classPropertyName: "showSubscripts", publicName: "showSubscripts", isSignal: true, isRequired: false, transformFunction: null }, inputGroup: { classPropertyName: "inputGroup", publicName: "inputGroup", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "focusout": "_onFocusOut()" }, properties: { "class.required-form-field": "this.isRequired" } }, queries: [{ propertyName: "_ngControl", first: true, predicate: NgControl, descendants: true, static: true }, { propertyName: "_ngControlElement", first: true, predicate: NgControl, descendants: true, read: ElementRef, static: true }], exportAs: ["ng0FormField"], ngImport: i0, template: "@if(label()) {\n<label class=\"form-field-label\">\n {{label()}}\n <span *ngIf=\"isRequired && showRequiredIndicator()\" class=\"isc-form-field-required-marker\">*</span>\n</label>\n}\n\n@if(inputGroup()) {\n<div class=\"input-group\">\n <ng-container *ngTemplateOutlet=\"contentTemplate\"></ng-container>\n</div>\n}@else {\n<ng-container *ngTemplateOutlet=\"contentTemplate\"></ng-container>\n}\n\n<ng-template #contentTemplate>\n <ng-content></ng-content>\n</ng-template>\n\n@if(showSubscripts()) {\n<div class=\"form-field-subscript-wrapper\">\n @if(showErrors() && errorText && (touched || dirty)) {\n <span class=\"form-field-error text-danger\">\n {{errorText}}\n </span>\n }@else if(hint()) {\n <span class=\"form-field-hint\">\n {{hint()}}\n </span>\n }\n</div>\n}", styles: [":host{display:block}.form-field-subscript-wrapper{margin-top:.2rem;min-height:1.5em;line-height:1.5em;text-align:justify}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
100
100
|
}
|
|
101
101
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: FormFieldComponent, decorators: [{
|
|
102
102
|
type: Component,
|
|
103
103
|
args: [{ selector: 'ng0-form-field, ng0-field', exportAs: 'ng0FormField', standalone: true, imports: [
|
|
104
104
|
CommonModule
|
|
105
|
-
], template: "@if(label()) {\n<label class=\"form-field-label\">\n {{label()}}\n <span *ngIf=\"isRequired && showRequiredIndicator()\" class=\"isc-form-field-required-marker\">*</span>\n</label>\n}\n\n@if(inputGroup()) {\n<div class=\"input-group\">\n <ng-container *ngTemplateOutlet=\"contentTemplate\"></ng-container>\n</div>\n}@else {\n<ng-container *ngTemplateOutlet=\"contentTemplate\"></ng-container>\n}\n\n<ng-template #contentTemplate>\n <ng-content></ng-content>\n</ng-template>\n\n@if(showSubscripts()) {\n<div class=\"form-field-subscript-wrapper\">\n @if(showErrors() && errorText && (touched || dirty)) {\n <span class=\"form-field-error text-danger\">\n {{errorText}}\n </span>\n }@if(hint()) {\n <span class=\"form-field-hint\">\n {{hint()}}\n </span>\n }\n</div>\n}", styles: [":host{display:block}.form-field-subscript-wrapper{margin-top:.2rem;min-height:1.5em;line-height:1.5em;text-align:justify}\n"] }]
|
|
105
|
+
], template: "@if(label()) {\n<label class=\"form-field-label\">\n {{label()}}\n <span *ngIf=\"isRequired && showRequiredIndicator()\" class=\"isc-form-field-required-marker\">*</span>\n</label>\n}\n\n@if(inputGroup()) {\n<div class=\"input-group\">\n <ng-container *ngTemplateOutlet=\"contentTemplate\"></ng-container>\n</div>\n}@else {\n<ng-container *ngTemplateOutlet=\"contentTemplate\"></ng-container>\n}\n\n<ng-template #contentTemplate>\n <ng-content></ng-content>\n</ng-template>\n\n@if(showSubscripts()) {\n<div class=\"form-field-subscript-wrapper\">\n @if(showErrors() && errorText && (touched || dirty)) {\n <span class=\"form-field-error text-danger\">\n {{errorText}}\n </span>\n }@else if(hint()) {\n <span class=\"form-field-hint\">\n {{hint()}}\n </span>\n }\n</div>\n}", styles: [":host{display:block}.form-field-subscript-wrapper{margin-top:.2rem;min-height:1.5em;line-height:1.5em;text-align:justify}\n"] }]
|
|
106
106
|
}], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.DestroyRef }, { type: i1.NgForm, decorators: [{
|
|
107
107
|
type: Optional
|
|
108
108
|
}] }, { type: i2.LocalizationService }], propDecorators: { isRequired: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootkit-ng0-components-form-field.mjs","sources":["../../../projects/ng0/components/form-field/form-field.component.ts","../../../projects/ng0/components/form-field/form-field.component.html","../../../projects/ng0/components/form-field/form-field.module.ts","../../../projects/ng0/components/form-field/bootkit-ng0-components-form-field.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { DestroyRef, HostListener, input, signal } from '@angular/core';\nimport { Component, Input, ContentChild, AfterContentInit, Optional, HostBinding, OnInit, OnDestroy, ElementRef, Renderer2 } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { FormControl, NgControl, NgForm } from '@angular/forms';\nimport { Locale, LocalizationService } from '@bootkit/ng0/localization';\n\n@Component({\n selector: 'ng0-form-field, ng0-field',\n exportAs: 'ng0FormField',\n templateUrl: './form-field.component.html',\n styleUrls: ['./form-field.component.scss'],\n standalone: true,\n imports: [\n CommonModule\n ],\n})\nexport class FormFieldComponent implements OnInit, AfterContentInit, OnDestroy {\n\n /**\n * The label text for the form field.\n */\n public label = input<string>();\n\n /**\n * The hint text to display below the form field.\n * This is typically used to provide additional information or instructions to the user.\n */\n public hint = input<string>();\n\n /**\n * If true, the form-field will show validation errors.\n * This is useful for displaying validation messages when the form control is invalid.\n */\n public showErrors = input(true);\n\n /**\n * If true, the form-field will show a red asterisk for required fields.\n * This is only a visual indicator and does not enforce validation.\n */\n public showRequiredIndicator = input(true);\n\n /**\n * If true, the form-field will show subscripts (e.g. hints, errors) for the field label.\n * This is useful for displaying additional information or validation messages.\n */\n public showSubscripts = input(true);\n\n /**\n * If true, the form-field will be rendered inside a \".input-group\" element.\n */\n public inputGroup = input(true);\n\n /**\n * Returns the first localized error of the control \n */\n public get errorText() { return this._errorText; }\n\n /** Reports whether the control is touched. */\n public get touched(): boolean | null | undefined { return this._ngControl?.touched; }\n\n /** Reports whether the control is dirty. */\n public get dirty(): boolean | null | undefined { return this._ngControl?.dirty; }\n\n /** Returns true if this form-field is required, otherwise returns false. */\n @HostBinding('class.required-form-field')\n public get isRequired(): boolean { return this._isRequired; }\n\n @HostListener('focusout')\n private _onFocusOut() { this._validate(); }\n\n @ContentChild(NgControl, { static: true })\n private _ngControl?: NgControl;\n\n @ContentChild(NgControl, { static: true, read: ElementRef })\n private _ngControlElement?: ElementRef;\n\n private _isRequired = false;\n private _locale?: Locale;\n private _errorText?: string;\n\n constructor(\n private _renderer: Renderer2,\n private _destroyRef: DestroyRef,\n @Optional() private _form: NgForm,\n private _ls: LocalizationService,\n ) {\n this._locale = this._ls.get();\n this._ls.change.pipe(takeUntilDestroyed()).subscribe(e => this._locale = e.new);\n }\n\n ngOnInit(): void {\n }\n\n ngAfterContentInit(): void {\n this._isRequired = this._isRequiredField();\n\n if (this._ngControl) {\n this._ngControl?.statusChanges?.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(change => {\n this._validate();\n });\n }\n }\n\n private _validate() {\n if (!this._ngControl || !this.dirty || !this.touched) {\n return;\n }\n\n const invalid = this._ngControl.status === 'INVALID';\n if (invalid) {\n this._errorText = this._locale?.translateFirstError(this._ngControl.errors, 'Invalid')?.text;\n } else {\n this._errorText = undefined;\n }\n this._renderer.addClass(this._ngControlElement!.nativeElement, invalid ? 'is-invalid' : 'is-valid');\n this._renderer.removeClass(this._ngControlElement!.nativeElement, invalid ? 'is-valid' : 'is-invalid');\n }\n\n private _isRequiredField(): boolean {\n const validator = this._ngControl?.validator;\n const errors = validator && validator(new FormControl(null));\n return errors != null && errors['required'] === true;\n }\n\n ngOnDestroy(): void {\n }\n}\n","@if(label()) {\n<label class=\"form-field-label\">\n {{label()}}\n <span *ngIf=\"isRequired && showRequiredIndicator()\" class=\"isc-form-field-required-marker\">*</span>\n</label>\n}\n\n@if(inputGroup()) {\n<div class=\"input-group\">\n <ng-container *ngTemplateOutlet=\"contentTemplate\"></ng-container>\n</div>\n}@else {\n<ng-container *ngTemplateOutlet=\"contentTemplate\"></ng-container>\n}\n\n<ng-template #contentTemplate>\n <ng-content></ng-content>\n</ng-template>\n\n@if(showSubscripts()) {\n<div class=\"form-field-subscript-wrapper\">\n @if(showErrors() && errorText && (touched || dirty)) {\n <span class=\"form-field-error text-danger\">\n {{errorText}}\n </span>\n }@if(hint()) {\n <span class=\"form-field-hint\">\n {{hint()}}\n </span>\n }\n</div>\n}","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormFieldComponent } from './form-field.component';\n\n@NgModule({\n imports: [\n CommonModule,\n FormFieldComponent,\n ],\n exports: [\n FormFieldComponent,\n ]\n})\nexport class FormFieldModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MAiBa,kBAAkB,CAAA;AAiEnB,IAAA,SAAA;AACA,IAAA,WAAA;AACY,IAAA,KAAA;AACZ,IAAA,GAAA;AAlEV;;AAEG;IACI,KAAK,GAAG,KAAK,EAAU;AAE9B;;;AAGG;IACI,IAAI,GAAG,KAAK,EAAU;AAE7B;;;AAGG;AACI,IAAA,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC;AAE/B;;;AAGG;AACI,IAAA,qBAAqB,GAAG,KAAK,CAAC,IAAI,CAAC;AAE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CAAA,SAAS,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;gBAIjC,iBAAiB,EAAA,CAAA;sBADxB,YAAY;uBAAC,SAAS,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE;;;ME7DhD,eAAe,CAAA;uGAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAAf,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,YAPxB,YAAY;AACZ,YAAA,kBAAkB,aAGlB,kBAAkB,CAAA,EAAA,CAAA;AAGT,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,YAPxB,YAAY;YACZ,kBAAkB,CAAA,EAAA,CAAA;;2FAMT,eAAe,EAAA,UAAA,EAAA,CAAA;kBAT3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,kBAAkB;AACnB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,kBAAkB;AACnB;AACF,iBAAA;;;ACZD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"bootkit-ng0-components-form-field.mjs","sources":["../../../projects/ng0/components/form-field/form-field.component.ts","../../../projects/ng0/components/form-field/form-field.component.html","../../../projects/ng0/components/form-field/form-field.module.ts","../../../projects/ng0/components/form-field/bootkit-ng0-components-form-field.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { DestroyRef, HostListener, input, signal } from '@angular/core';\nimport { Component, Input, ContentChild, AfterContentInit, Optional, HostBinding, OnInit, OnDestroy, ElementRef, Renderer2 } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { FormControl, NgControl, NgForm } from '@angular/forms';\nimport { Locale, LocalizationService } from '@bootkit/ng0/localization';\n\n@Component({\n selector: 'ng0-form-field, ng0-field',\n exportAs: 'ng0FormField',\n templateUrl: './form-field.component.html',\n styleUrls: ['./form-field.component.scss'],\n standalone: true,\n imports: [\n CommonModule\n ],\n})\nexport class FormFieldComponent implements OnInit, AfterContentInit, OnDestroy {\n\n /**\n * The label text for the form field.\n */\n public label = input<string>();\n\n /**\n * The hint text to display below the form field.\n * This is typically used to provide additional information or instructions to the user.\n */\n public hint = input<string>();\n\n /**\n * If true, the form-field will show validation errors.\n * This is useful for displaying validation messages when the form control is invalid.\n */\n public showErrors = input(true);\n\n /**\n * If true, the form-field will show a red asterisk for required fields.\n * This is only a visual indicator and does not enforce validation.\n */\n public showRequiredIndicator = input(true);\n\n /**\n * If true, the form-field will show subscripts (e.g. hints, errors) for the field label.\n * This is useful for displaying additional information or validation messages.\n */\n public showSubscripts = input(true);\n\n /**\n * If true, the form-field will be rendered inside a \".input-group\" element.\n */\n public inputGroup = input(true);\n\n /**\n * Returns the first localized error of the control \n */\n public get errorText() { return this._errorText; }\n\n /** Reports whether the control is touched. */\n public get touched(): boolean | null | undefined { return this._ngControl?.touched; }\n\n /** Reports whether the control is dirty. */\n public get dirty(): boolean | null | undefined { return this._ngControl?.dirty; }\n\n /** Returns true if this form-field is required, otherwise returns false. */\n @HostBinding('class.required-form-field')\n public get isRequired(): boolean { return this._isRequired; }\n\n @HostListener('focusout')\n private _onFocusOut() { this._validate(); }\n\n @ContentChild(NgControl, { static: true })\n private _ngControl?: NgControl;\n\n @ContentChild(NgControl, { static: true, read: ElementRef })\n private _ngControlElement?: ElementRef;\n\n private _isRequired = false;\n private _locale?: Locale;\n private _errorText?: string;\n\n constructor(\n private _renderer: Renderer2,\n private _destroyRef: DestroyRef,\n @Optional() private _form: NgForm,\n private _ls: LocalizationService,\n ) {\n this._locale = this._ls.get();\n this._ls.change.pipe(takeUntilDestroyed()).subscribe(e => this._locale = e.new);\n }\n\n ngOnInit(): void {\n }\n\n ngAfterContentInit(): void {\n this._isRequired = this._isRequiredField();\n\n if (this._ngControl) {\n this._ngControl?.statusChanges?.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(change => {\n this._validate();\n });\n }\n }\n\n private _validate() {\n if (!this._ngControl || !this.dirty || !this.touched) {\n return;\n }\n\n const invalid = this._ngControl.status === 'INVALID';\n if (invalid) {\n this._errorText = this._locale?.translateFirstError(this._ngControl.errors, 'Invalid')?.text;\n } else {\n this._errorText = undefined;\n }\n this._renderer.addClass(this._ngControlElement!.nativeElement, invalid ? 'is-invalid' : 'is-valid');\n this._renderer.removeClass(this._ngControlElement!.nativeElement, invalid ? 'is-valid' : 'is-invalid');\n }\n\n private _isRequiredField(): boolean {\n const validator = this._ngControl?.validator;\n const errors = validator && validator(new FormControl(null));\n return errors != null && errors['required'] === true;\n }\n\n ngOnDestroy(): void {\n }\n}\n","@if(label()) {\n<label class=\"form-field-label\">\n {{label()}}\n <span *ngIf=\"isRequired && showRequiredIndicator()\" class=\"isc-form-field-required-marker\">*</span>\n</label>\n}\n\n@if(inputGroup()) {\n<div class=\"input-group\">\n <ng-container *ngTemplateOutlet=\"contentTemplate\"></ng-container>\n</div>\n}@else {\n<ng-container *ngTemplateOutlet=\"contentTemplate\"></ng-container>\n}\n\n<ng-template #contentTemplate>\n <ng-content></ng-content>\n</ng-template>\n\n@if(showSubscripts()) {\n<div class=\"form-field-subscript-wrapper\">\n @if(showErrors() && errorText && (touched || dirty)) {\n <span class=\"form-field-error text-danger\">\n {{errorText}}\n </span>\n }@else if(hint()) {\n <span class=\"form-field-hint\">\n {{hint()}}\n </span>\n }\n</div>\n}","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormFieldComponent } from './form-field.component';\n\n@NgModule({\n imports: [\n CommonModule,\n FormFieldComponent,\n ],\n exports: [\n FormFieldComponent,\n ]\n})\nexport class FormFieldModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MAiBa,kBAAkB,CAAA;AAiEnB,IAAA,SAAA;AACA,IAAA,WAAA;AACY,IAAA,KAAA;AACZ,IAAA,GAAA;AAlEV;;AAEG;IACI,KAAK,GAAG,KAAK,EAAU;AAE9B;;;AAGG;IACI,IAAI,GAAG,KAAK,EAAU;AAE7B;;;AAGG;AACI,IAAA,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC;AAE/B;;;AAGG;AACI,IAAA,qBAAqB,GAAG,KAAK,CAAC,IAAI,CAAC;AAE1C;;;AAGG;AACI,IAAA,cAAc,GAAG,KAAK,CAAC,IAAI,CAAC;AAEnC;;AAEG;AACI,IAAA,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC;AAE/B;;AAEG;IACH,IAAW,SAAS,KAAK,OAAO,IAAI,CAAC,UAAU,CAAC;;IAGhD,IAAW,OAAO,GAAiC,EAAA,OAAO,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC;;IAGnF,IAAW,KAAK,GAAiC,EAAA,OAAO,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC;;IAG/E,IACW,UAAU,KAAc,OAAO,IAAI,CAAC,WAAW,CAAC;AAGnD,IAAA,WAAW,KAAK,IAAI,CAAC,SAAS,EAAE,CAAC;AAGjC,IAAA,UAAU;AAGV,IAAA,iBAAiB;IAEjB,WAAW,GAAG,KAAK;AACnB,IAAA,OAAO;AACP,IAAA,UAAU;AAElB,IAAA,WAAA,CACU,SAAoB,EACpB,WAAuB,EACX,KAAa,EACzB,GAAwB,EAAA;QAHxB,IAAS,CAAA,SAAA,GAAT,SAAS;QACT,IAAW,CAAA,WAAA,GAAX,WAAW;QACC,IAAK,CAAA,KAAA,GAAL,KAAK;QACjB,IAAG,CAAA,GAAA,GAAH,GAAG;QAEX,IAAI,CAAC,OAAO,GAAG,I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AAO,EAAE;wBACP,YAAY;wBACZ,kBAAkB;AACnB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,kBAAkB;AACnB;AACF,iBAAA;;;ACZD;;AAEG;;;;"}
|
|
@@ -1,145 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Input, Directive, input,
|
|
3
|
-
import { NG_VALIDATORS,
|
|
2
|
+
import { Input, Directive, input, forwardRef, HostListener, numberAttribute, NgModule } from '@angular/core';
|
|
3
|
+
import { NG_VALUE_ACCESSOR, NG_VALIDATORS, Validators } from '@angular/forms';
|
|
4
4
|
import { formatNumber } from '@angular/common';
|
|
5
5
|
|
|
6
|
-
function equalWithValidator(targetValue, inequalityMessage) {
|
|
7
|
-
return (control) => {
|
|
8
|
-
const isValid = control.value === targetValue;
|
|
9
|
-
return isValid ? null :
|
|
10
|
-
{
|
|
11
|
-
equalWith: {
|
|
12
|
-
value: control.value,
|
|
13
|
-
message: inequalityMessage
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
class EqualWithValidatorDirective {
|
|
20
|
-
targetValue;
|
|
21
|
-
inequalityMessage;
|
|
22
|
-
constructor() {
|
|
23
|
-
}
|
|
24
|
-
validate(control) {
|
|
25
|
-
return equalWithValidator(this.targetValue, this.inequalityMessage)(control);
|
|
26
|
-
}
|
|
27
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: EqualWithValidatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
28
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.6", type: EqualWithValidatorDirective, isStandalone: true, selector: "[ng0EqualWith]", inputs: { targetValue: ["ng0EqualWith", "targetValue"], inequalityMessage: "inequalityMessage" }, providers: [
|
|
29
|
-
{ provide: NG_VALIDATORS, useExisting: EqualWithValidatorDirective, multi: true }
|
|
30
|
-
], exportAs: ["ng0EqualWith"], ngImport: i0 });
|
|
31
|
-
}
|
|
32
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: EqualWithValidatorDirective, decorators: [{
|
|
33
|
-
type: Directive,
|
|
34
|
-
args: [{
|
|
35
|
-
selector: '[ng0EqualWith]',
|
|
36
|
-
exportAs: 'ng0EqualWith',
|
|
37
|
-
standalone: true,
|
|
38
|
-
providers: [
|
|
39
|
-
{ provide: NG_VALIDATORS, useExisting: EqualWithValidatorDirective, multi: true }
|
|
40
|
-
]
|
|
41
|
-
}]
|
|
42
|
-
}], ctorParameters: () => [], propDecorators: { targetValue: [{
|
|
43
|
-
type: Input,
|
|
44
|
-
args: ['ng0EqualWith']
|
|
45
|
-
}], inequalityMessage: [{
|
|
46
|
-
type: Input
|
|
47
|
-
}] } });
|
|
48
|
-
|
|
49
|
-
const urlRegEx = new RegExp('(https?://)?([\\da-z.-]+)\\.([a-z.]{2,6})[/\\w .-]*/?');
|
|
50
|
-
function urlValidator() {
|
|
51
|
-
return (control) => {
|
|
52
|
-
const value = control.value;
|
|
53
|
-
if (!value || urlRegEx.test(value)) {
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
return {
|
|
58
|
-
'url': {
|
|
59
|
-
value
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
class UrlValidatorDirective {
|
|
67
|
-
/** Directive is enabled or disabled */
|
|
68
|
-
iscUrl = true;
|
|
69
|
-
validate(control) {
|
|
70
|
-
return urlValidator()(control);
|
|
71
|
-
}
|
|
72
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: UrlValidatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
73
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.6", type: UrlValidatorDirective, isStandalone: true, selector: "input[ng0Url]", inputs: { iscUrl: "iscUrl" }, providers: [{ provide: NG_VALIDATORS, useExisting: UrlValidatorDirective, multi: true }], exportAs: ["ng0Url"], ngImport: i0 });
|
|
74
|
-
}
|
|
75
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: UrlValidatorDirective, decorators: [{
|
|
76
|
-
type: Directive,
|
|
77
|
-
args: [{
|
|
78
|
-
selector: 'input[ng0Url]',
|
|
79
|
-
exportAs: 'ng0Url',
|
|
80
|
-
standalone: true,
|
|
81
|
-
providers: [{ provide: NG_VALIDATORS, useExisting: UrlValidatorDirective, multi: true }]
|
|
82
|
-
}]
|
|
83
|
-
}], propDecorators: { iscUrl: [{
|
|
84
|
-
type: Input
|
|
85
|
-
}] } });
|
|
86
|
-
|
|
87
|
-
class CustomValidatorDirective {
|
|
88
|
-
validator = input.required({ alias: 'ng0CustomValidator' });
|
|
89
|
-
constructor() { }
|
|
90
|
-
validate(control) {
|
|
91
|
-
return this.validator()(control);
|
|
92
|
-
}
|
|
93
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: CustomValidatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
94
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.6", type: CustomValidatorDirective, isStandalone: true, selector: "[ng0CustomValidator]", inputs: { validator: { classPropertyName: "validator", publicName: "ng0CustomValidator", isSignal: true, isRequired: true, transformFunction: null } }, providers: [
|
|
95
|
-
{ provide: NG_VALIDATORS, useExisting: CustomValidatorDirective, multi: true }
|
|
96
|
-
], exportAs: ["ng0CustomValidator"], ngImport: i0 });
|
|
97
|
-
}
|
|
98
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: CustomValidatorDirective, decorators: [{
|
|
99
|
-
type: Directive,
|
|
100
|
-
args: [{
|
|
101
|
-
selector: '[ng0CustomValidator]',
|
|
102
|
-
exportAs: 'ng0CustomValidator',
|
|
103
|
-
standalone: true,
|
|
104
|
-
providers: [
|
|
105
|
-
{ provide: NG_VALIDATORS, useExisting: CustomValidatorDirective, multi: true }
|
|
106
|
-
]
|
|
107
|
-
}]
|
|
108
|
-
}], ctorParameters: () => [] });
|
|
109
|
-
|
|
110
|
-
const items = [
|
|
111
|
-
// ErrorDirective,
|
|
112
|
-
// FirstErrorDirective,
|
|
113
|
-
// Validators
|
|
114
|
-
EqualWithValidatorDirective,
|
|
115
|
-
UrlValidatorDirective,
|
|
116
|
-
CustomValidatorDirective,
|
|
117
|
-
];
|
|
118
|
-
class ValidationModule {
|
|
119
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: ValidationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
120
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.6", ngImport: i0, type: ValidationModule, imports: [
|
|
121
|
-
// ErrorDirective,
|
|
122
|
-
// FirstErrorDirective,
|
|
123
|
-
// Validators
|
|
124
|
-
EqualWithValidatorDirective,
|
|
125
|
-
UrlValidatorDirective,
|
|
126
|
-
CustomValidatorDirective], exports: [
|
|
127
|
-
// ErrorDirective,
|
|
128
|
-
// FirstErrorDirective,
|
|
129
|
-
// Validators
|
|
130
|
-
EqualWithValidatorDirective,
|
|
131
|
-
UrlValidatorDirective,
|
|
132
|
-
CustomValidatorDirective] });
|
|
133
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: ValidationModule });
|
|
134
|
-
}
|
|
135
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: ValidationModule, decorators: [{
|
|
136
|
-
type: NgModule,
|
|
137
|
-
args: [{
|
|
138
|
-
imports: items,
|
|
139
|
-
exports: items,
|
|
140
|
-
}]
|
|
141
|
-
}] });
|
|
142
|
-
|
|
143
6
|
class FocusDirective {
|
|
144
7
|
elementRef;
|
|
145
8
|
/**
|
|
@@ -412,9 +275,216 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
412
275
|
args: ['paste', ['$event']]
|
|
413
276
|
}] } });
|
|
414
277
|
|
|
278
|
+
function equalWithValidator(targetValue, inequalityMessage) {
|
|
279
|
+
return (control) => {
|
|
280
|
+
const isValid = control.value === targetValue;
|
|
281
|
+
return isValid ? null :
|
|
282
|
+
{
|
|
283
|
+
equalWith: {
|
|
284
|
+
value: control.value,
|
|
285
|
+
message: inequalityMessage
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
class EqualWithValidatorDirective {
|
|
292
|
+
targetValue;
|
|
293
|
+
inequalityMessage;
|
|
294
|
+
constructor() {
|
|
295
|
+
}
|
|
296
|
+
validate(control) {
|
|
297
|
+
return equalWithValidator(this.targetValue, this.inequalityMessage)(control);
|
|
298
|
+
}
|
|
299
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: EqualWithValidatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
300
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.6", type: EqualWithValidatorDirective, isStandalone: true, selector: "[ng0EqualWith]", inputs: { targetValue: ["ng0EqualWith", "targetValue"], inequalityMessage: "inequalityMessage" }, providers: [
|
|
301
|
+
{ provide: NG_VALIDATORS, useExisting: EqualWithValidatorDirective, multi: true }
|
|
302
|
+
], exportAs: ["ng0EqualWith"], ngImport: i0 });
|
|
303
|
+
}
|
|
304
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: EqualWithValidatorDirective, decorators: [{
|
|
305
|
+
type: Directive,
|
|
306
|
+
args: [{
|
|
307
|
+
selector: '[ng0EqualWith]',
|
|
308
|
+
exportAs: 'ng0EqualWith',
|
|
309
|
+
standalone: true,
|
|
310
|
+
providers: [
|
|
311
|
+
{ provide: NG_VALIDATORS, useExisting: EqualWithValidatorDirective, multi: true }
|
|
312
|
+
]
|
|
313
|
+
}]
|
|
314
|
+
}], ctorParameters: () => [], propDecorators: { targetValue: [{
|
|
315
|
+
type: Input,
|
|
316
|
+
args: ['ng0EqualWith']
|
|
317
|
+
}], inequalityMessage: [{
|
|
318
|
+
type: Input
|
|
319
|
+
}] } });
|
|
320
|
+
|
|
321
|
+
const urlRegEx = new RegExp('(https?://)?([\\da-z.-]+)\\.([a-z.]{2,6})[/\\w .-]*/?');
|
|
322
|
+
function urlValidator() {
|
|
323
|
+
return (control) => {
|
|
324
|
+
const value = control.value;
|
|
325
|
+
if (!value || urlRegEx.test(value)) {
|
|
326
|
+
return null;
|
|
327
|
+
}
|
|
328
|
+
else {
|
|
329
|
+
return {
|
|
330
|
+
'url': {
|
|
331
|
+
value
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
class UrlValidatorDirective {
|
|
339
|
+
/** Directive is enabled or disabled */
|
|
340
|
+
iscUrl = true;
|
|
341
|
+
validate(control) {
|
|
342
|
+
return urlValidator()(control);
|
|
343
|
+
}
|
|
344
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: UrlValidatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
345
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.6", type: UrlValidatorDirective, isStandalone: true, selector: "input[ng0Url]", inputs: { iscUrl: "iscUrl" }, providers: [{ provide: NG_VALIDATORS, useExisting: UrlValidatorDirective, multi: true }], exportAs: ["ng0Url"], ngImport: i0 });
|
|
346
|
+
}
|
|
347
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: UrlValidatorDirective, decorators: [{
|
|
348
|
+
type: Directive,
|
|
349
|
+
args: [{
|
|
350
|
+
selector: 'input[ng0Url]',
|
|
351
|
+
exportAs: 'ng0Url',
|
|
352
|
+
standalone: true,
|
|
353
|
+
providers: [{ provide: NG_VALIDATORS, useExisting: UrlValidatorDirective, multi: true }]
|
|
354
|
+
}]
|
|
355
|
+
}], propDecorators: { iscUrl: [{
|
|
356
|
+
type: Input
|
|
357
|
+
}] } });
|
|
358
|
+
|
|
359
|
+
class CustomValidatorDirective {
|
|
360
|
+
validator = input.required({ alias: 'ng0CustomValidator' });
|
|
361
|
+
constructor() { }
|
|
362
|
+
validate(control) {
|
|
363
|
+
return this.validator()(control);
|
|
364
|
+
}
|
|
365
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: CustomValidatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
366
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.6", type: CustomValidatorDirective, isStandalone: true, selector: "[ng0CustomValidator]", inputs: { validator: { classPropertyName: "validator", publicName: "ng0CustomValidator", isSignal: true, isRequired: true, transformFunction: null } }, providers: [
|
|
367
|
+
{ provide: NG_VALIDATORS, useExisting: CustomValidatorDirective, multi: true }
|
|
368
|
+
], exportAs: ["ng0CustomValidator"], ngImport: i0 });
|
|
369
|
+
}
|
|
370
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: CustomValidatorDirective, decorators: [{
|
|
371
|
+
type: Directive,
|
|
372
|
+
args: [{
|
|
373
|
+
selector: '[ng0CustomValidator]',
|
|
374
|
+
exportAs: 'ng0CustomValidator',
|
|
375
|
+
standalone: true,
|
|
376
|
+
providers: [
|
|
377
|
+
{ provide: NG_VALIDATORS, useExisting: CustomValidatorDirective, multi: true }
|
|
378
|
+
]
|
|
379
|
+
}]
|
|
380
|
+
}], ctorParameters: () => [] });
|
|
381
|
+
|
|
382
|
+
/** Min validator */
|
|
383
|
+
class MinValidatorDirective {
|
|
384
|
+
min = input.required({
|
|
385
|
+
transform: numberAttribute,
|
|
386
|
+
});
|
|
387
|
+
validate(control) {
|
|
388
|
+
return Validators.min(this.min())(control);
|
|
389
|
+
}
|
|
390
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: MinValidatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
391
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.6", type: MinValidatorDirective, isStandalone: true, selector: "input[type=text][ng0Number][min]", inputs: { min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: true, transformFunction: null } }, providers: [{
|
|
392
|
+
provide: NG_VALIDATORS,
|
|
393
|
+
useExisting: MinValidatorDirective,
|
|
394
|
+
multi: true
|
|
395
|
+
}], exportAs: ["ng0Min"], ngImport: i0 });
|
|
396
|
+
}
|
|
397
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: MinValidatorDirective, decorators: [{
|
|
398
|
+
type: Directive,
|
|
399
|
+
args: [{
|
|
400
|
+
selector: 'input[type=text][ng0Number][min]',
|
|
401
|
+
exportAs: 'ng0Min',
|
|
402
|
+
standalone: true,
|
|
403
|
+
providers: [{
|
|
404
|
+
provide: NG_VALIDATORS,
|
|
405
|
+
useExisting: MinValidatorDirective,
|
|
406
|
+
multi: true
|
|
407
|
+
}]
|
|
408
|
+
}]
|
|
409
|
+
}] });
|
|
410
|
+
|
|
411
|
+
/** Max validator */
|
|
412
|
+
class MaxValidatorDirective {
|
|
413
|
+
max = input.required({
|
|
414
|
+
transform: numberAttribute,
|
|
415
|
+
});
|
|
416
|
+
validate(control) {
|
|
417
|
+
return Validators.max(this.max())(control);
|
|
418
|
+
}
|
|
419
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: MaxValidatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
420
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.6", type: MaxValidatorDirective, isStandalone: true, selector: "input[type=text][ng0Number][max]", inputs: { max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: true, transformFunction: null } }, providers: [{
|
|
421
|
+
provide: NG_VALIDATORS,
|
|
422
|
+
useExisting: MaxValidatorDirective,
|
|
423
|
+
multi: true
|
|
424
|
+
}], exportAs: ["ng0Max"], ngImport: i0 });
|
|
425
|
+
}
|
|
426
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: MaxValidatorDirective, decorators: [{
|
|
427
|
+
type: Directive,
|
|
428
|
+
args: [{
|
|
429
|
+
selector: 'input[type=text][ng0Number][max]',
|
|
430
|
+
exportAs: 'ng0Max',
|
|
431
|
+
standalone: true,
|
|
432
|
+
providers: [{
|
|
433
|
+
provide: NG_VALIDATORS,
|
|
434
|
+
useExisting: MaxValidatorDirective,
|
|
435
|
+
multi: true
|
|
436
|
+
}]
|
|
437
|
+
}]
|
|
438
|
+
}] });
|
|
439
|
+
|
|
440
|
+
const items = [
|
|
441
|
+
// ErrorDirective,
|
|
442
|
+
// FirstErrorDirective,
|
|
443
|
+
NumberDirective,
|
|
444
|
+
// Validators
|
|
445
|
+
MinValidatorDirective,
|
|
446
|
+
MaxValidatorDirective,
|
|
447
|
+
EqualWithValidatorDirective,
|
|
448
|
+
UrlValidatorDirective,
|
|
449
|
+
CustomValidatorDirective,
|
|
450
|
+
];
|
|
451
|
+
class FormModule {
|
|
452
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: FormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
453
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.6", ngImport: i0, type: FormModule, imports: [
|
|
454
|
+
// ErrorDirective,
|
|
455
|
+
// FirstErrorDirective,
|
|
456
|
+
NumberDirective,
|
|
457
|
+
// Validators
|
|
458
|
+
MinValidatorDirective,
|
|
459
|
+
MaxValidatorDirective,
|
|
460
|
+
EqualWithValidatorDirective,
|
|
461
|
+
UrlValidatorDirective,
|
|
462
|
+
CustomValidatorDirective], exports: [
|
|
463
|
+
// ErrorDirective,
|
|
464
|
+
// FirstErrorDirective,
|
|
465
|
+
NumberDirective,
|
|
466
|
+
// Validators
|
|
467
|
+
MinValidatorDirective,
|
|
468
|
+
MaxValidatorDirective,
|
|
469
|
+
EqualWithValidatorDirective,
|
|
470
|
+
UrlValidatorDirective,
|
|
471
|
+
CustomValidatorDirective] });
|
|
472
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: FormModule });
|
|
473
|
+
}
|
|
474
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: FormModule, decorators: [{
|
|
475
|
+
type: NgModule,
|
|
476
|
+
args: [{
|
|
477
|
+
imports: items,
|
|
478
|
+
exports: items,
|
|
479
|
+
}]
|
|
480
|
+
}] });
|
|
481
|
+
|
|
482
|
+
// export * from './validation/error.directive';
|
|
483
|
+
// export * from './validation/first-error.directive';
|
|
484
|
+
|
|
415
485
|
/**
|
|
416
486
|
* Generated bundle index. Do not edit.
|
|
417
487
|
*/
|
|
418
488
|
|
|
419
|
-
export { CustomValidatorDirective, EqualWithValidatorDirective, FocusDirective, NumberDirective, UrlValidatorDirective,
|
|
489
|
+
export { CustomValidatorDirective, EqualWithValidatorDirective, FocusDirective, FormModule, MaxValidatorDirective, MinValidatorDirective, NumberDirective, UrlValidatorDirective, equalWithValidator };
|
|
420
490
|
//# sourceMappingURL=bootkit-ng0-form.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootkit-ng0-form.mjs","sources":["../../../projects/ng0/form/validation/validators/equal-with/equal-with-validator.ts","../../../projects/ng0/form/validation/validators/equal-with/equal-with.directive.ts","../../../projects/ng0/form/validation/validators/url/url-validator.ts","../../../projects/ng0/form/validation/validators/url/url-validator.directive.ts","../../../projects/ng0/form/validation/validators/custom/custom-validator.directive.ts","../../../projects/ng0/form/validation/validation.module.ts","../../../projects/ng0/form/focus.directive.ts","../../../projects/ng0/form/number.directive.ts","../../../projects/ng0/form/bootkit-ng0-form.ts"],"sourcesContent":["import { AbstractControl, ValidatorFn } from '@angular/forms';\n\nexport function equalWithValidator(targetValue?: string, inequalityMessage?: string): ValidatorFn {\n return (control: AbstractControl): { [key: string]: any } | null => {\n const isValid = control.value === targetValue;\n\n return isValid ? null :\n {\n equalWith: {\n value: control.value,\n message: inequalityMessage\n }\n };\n };\n}\n","import { Directive, Input } from '@angular/core';\nimport { AbstractControl, NG_VALIDATORS, Validator } from '@angular/forms';\nimport { equalWithValidator } from './equal-with-validator';\n\n@Directive({\n selector: '[ng0EqualWith]',\n exportAs: 'ng0EqualWith',\n standalone: true,\n providers: [\n { provide: NG_VALIDATORS, useExisting: EqualWithValidatorDirective, multi: true }\n ]\n})\nexport class EqualWithValidatorDirective implements Validator {\n @Input('ng0EqualWith') targetValue?: string;\n @Input() inequalityMessage?: string;\n\n constructor() {\n }\n\n validate(control: AbstractControl): { [key: string]: any } | null {\n return equalWithValidator(this.targetValue, this.inequalityMessage)(control);\n }\n}\n","import { AbstractControl, ValidatorFn } from '@angular/forms';\nconst urlRegEx = new RegExp('(https?://)?([\\\\da-z.-]+)\\\\.([a-z.]{2,6})[/\\\\w .-]*/?');\n\nexport function urlValidator(): ValidatorFn {\n return (control: AbstractControl): { [key: string]: any } | null => {\n const value = (control.value as string);\n if (!value || urlRegEx.test(value)) {\n return null;\n } else {\n return {\n 'url': {\n value\n }\n };\n }\n };\n}","import { Directive, Input } from '@angular/core';\nimport { FormControl, NG_VALIDATORS, ValidationErrors, Validator } from '@angular/forms';\nimport { urlValidator } from './url-validator';\n\n@Directive({\n selector: 'input[ng0Url]',\n exportAs: 'ng0Url',\n standalone: true,\n providers: [{ provide: NG_VALIDATORS, useExisting: UrlValidatorDirective, multi: true }]\n})\nexport class UrlValidatorDirective implements Validator {\n /** Directive is enabled or disabled */\n @Input() iscUrl?: boolean | string = true;\n\n validate(control: FormControl): ValidationErrors | null {\n return urlValidator()(control);\n }\n}\n","import { Directive, input, Input } from '@angular/core';\nimport { AbstractControl, NG_VALIDATORS, ValidationErrors, Validator } from '@angular/forms';\n\n@Directive({\n selector: '[ng0CustomValidator]',\n exportAs: 'ng0CustomValidator',\n standalone: true,\n providers: [\n { provide: NG_VALIDATORS, useExisting: CustomValidatorDirective, multi: true }\n ]\n})\nexport class CustomValidatorDirective implements Validator {\n validator = input.required<(value: any) => ValidationErrors | null>({alias: 'ng0CustomValidator'});\n\n constructor() { }\n\n validate(control: AbstractControl): ValidationErrors | null {\n return this.validator()(control);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { EqualWithValidatorDirective } from './validators/equal-with/equal-with.directive';\nimport { UrlValidatorDirective } from './validators/url/url-validator.directive';\nimport { CustomValidatorDirective } from './validators/custom/custom-validator.directive';\n\nconst items = [\n // ErrorDirective,\n // FirstErrorDirective,\n\n // Validators\n EqualWithValidatorDirective,\n UrlValidatorDirective,\n CustomValidatorDirective,\n];\n\n@NgModule({\n imports: items,\n exports: items,\n})\nexport class ValidationModule { }\n","import { Directive, ElementRef, Input, OnChanges, SimpleChanges, OnInit } from '@angular/core';\n\n@Directive({\n selector: '[ng0Focus]',\n exportAs: 'ng0Focus',\n standalone: true\n})\nexport class FocusDirective implements OnInit, OnChanges {\n /** \n * \n */\n @Input() focusOnLoad = true;\n @Input() focusWhen?: boolean;\n private focused = false;\n\n constructor(private elementRef: ElementRef) {\n }\n\n ngOnInit(): void {\n if (this.focusOnLoad) {\n setTimeout(() => {\n this.elementRef.nativeElement.focus();\n });\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['focusWhen']) {\n if (this.focusWhen) {\n setTimeout(() => {\n this.elementRef.nativeElement.focus();\n });\n }\n }\n }\n}\n","import { Directive, HostListener, forwardRef, ElementRef, Renderer2, input } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { formatNumber } from '@angular/common';\n\nconst addThousandsSeparator = (str: string) => str.replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\nconst isValidNumber = (str: string) => str.trim() !== '' && !isNaN(Number(str));\nconst removeChar = (str: string, charToRemove: string) => str.split(charToRemove).join('');\n\nconst Keys = {\n backspace: 'Backspace',\n tab: 'Tab',\n arrowLeft: 'ArrowLeft',\n arrowRight: 'ArrowRight',\n delete: 'Delete',\n home: 'Home',\n end: 'End'\n}\n\n@Directive({\n selector: '[ng0Number]',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => NumberDirective),\n multi: true\n }\n ]\n})\nexport class NumberDirective implements ControlValueAccessor {\n /** */\n minFractionDigits = input<number | undefined>(3);\n maxFractionDigits = input<number| undefined>(10);\n useGrouping = input<boolean>(false);\n numberType = input<'decimal' | 'integer'>('integer');\n private onChange = (_: any) => { };\n private onTouched = () => { };\n private decimalSeparator!: string;\n private thousandsSeparator: string = ',';\n private selectionStart: number = 0;\n private selectionEnd: number = 0;\n private isCursorInsideIntegerPart: boolean = false;\n private decimalSeparatorPosition = -1;\n private value?: number;\n private setProperty = (prop: string, value: any) => this.renderer.setProperty(this.el.nativeElement, prop, value);\n\n constructor(\n private el: ElementRef<HTMLInputElement>,\n private renderer: Renderer2,\n // private locale: Locale,\n ) { }\n\n ngOnInit() {\n // Use Intl.NumberFormat to find decimal separator for locale\n const formatted = formatNumber(1.1, 'en', '1.1-1');\n this.decimalSeparator = formatted.replace(/\\d/g, '') || '.';\n }\n\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n\n setDisabledState?(isDisabled: boolean): void {\n this.setProperty('disabled', isDisabled);\n }\n\n writeValue(value: any): void {\n var inputValue: string;\n\n if (value === undefined || value === null) {\n inputValue = '';\n this.value = undefined;\n } else if (typeof value === 'number') {\n inputValue = this.formatNumber(value);\n this.value = value;\n }\n else if (typeof value === 'string') {\n const parsedValue = this.value = Number.parseFloat(value);\n inputValue = this.formatNumber(parsedValue);\n } else {\n console.error('NumberDirective: Unsupported value type', value);\n inputValue = 'Invalid';\n }\n\n this.setProperty('value', inputValue);\n }\n\n @HostListener('keydown', ['$event'])\n private onKeyDown(event: KeyboardEvent) {\n this.updateCursorInfo();\n\n if (!this.isKeyAllowed(event.key)) {\n event.preventDefault();\n return;\n }\n\n const key = event.key;\n\n if (key == Keys.backspace) {\n if (this.selectionStart > 1 && (this.selectionStart === this.selectionEnd)) {\n let value = this.el.nativeElement.value;\n let beforeSelection = value.charAt(this.selectionStart - 1);\n if (beforeSelection === ',') {\n // If the character before the cursor is a comma, we need to skip it\n this.setProperty('selectionStart', this.selectionStart - 2);\n }\n }\n }\n }\n\n @HostListener('input', ['$event.target.value'])\n private onInput(s: string) {\n if (s === '') {\n this.value = undefined;\n this.onChange(undefined);\n return;\n }\n\n this.updateCursorInfo();\n\n if (this.isCursorInsideIntegerPart) {\n this.formatIntegerPart(s);\n }\n\n var number = Number(removeChar(this.el.nativeElement.value, this.thousandsSeparator));\n this.value = isNaN(number) ? undefined : number;\n this.onChange(this.value);\n }\n\n private formatIntegerPart(value: string) {\n // Format the input value\n const integerPart = value.split(this.decimalSeparator)[0];\n const decimalPart = value.split(this.decimalSeparator)[1];\n\n if (integerPart.length <= 3) {\n return;\n }\n\n let normalizedIntegerPart = removeChar(integerPart, this.thousandsSeparator); // Remove commas\n\n let formattedValue = addThousandsSeparator(normalizedIntegerPart);\n if (decimalPart !== undefined) {\n formattedValue += this.decimalSeparator + decimalPart;\n }\n\n this.setProperty('value', formattedValue);\n let newSelectionStart: number;\n\n // fix the cursor position after formatting\n if (value.length == 1) {\n newSelectionStart = 1;\n } else {\n const newValueLength = formattedValue.length;\n const cursorJump = newValueLength - value.length;\n newSelectionStart = Math.max(0, this.selectionStart + cursorJump);\n }\n\n this.setProperty('selectionStart', newSelectionStart);\n this.setProperty('selectionEnd', newSelectionStart);\n\n // return formattedValue;\n }\n\n @HostListener('blur')\n private onBlur() {\n if (this.value !== undefined) {\n let formattedValue = this.formatNumber(this.value);\n this.setProperty('value', formattedValue);\n }\n\n this.onTouched();\n }\n\n @HostListener('paste', ['$event'])\n private onPaste(event: ClipboardEvent) {\n // event.\n // value = value.trim();\n }\n\n private updateCursorInfo() {\n let value = this.el.nativeElement.value;\n this.selectionStart = this.el.nativeElement.selectionStart || 0;\n this.selectionEnd = this.el.nativeElement.selectionEnd || 0;\n\n this.decimalSeparatorPosition = value.indexOf(this.decimalSeparator);\n if (this.decimalSeparatorPosition > -1) {\n this.isCursorInsideIntegerPart = (this.selectionStart <= this.decimalSeparatorPosition);\n } else {\n this.isCursorInsideIntegerPart = true;\n }\n }\n\n private formatNumber(n: number): string {\n var isInteger = this.numberType() == 'integer';\n return new Intl.NumberFormat('en-US', {\n useGrouping: this.useGrouping(),\n minimumFractionDigits: isInteger ? 0 : this.minFractionDigits(),\n maximumFractionDigits: isInteger ? 0 : this.maxFractionDigits(),\n style: 'decimal',\n }).format(n);\n }\n\n private isKeyAllowed(key: string) {\n const allowedKeys = [Keys.backspace, Keys.tab, Keys.arrowLeft, Keys.arrowRight, Keys.delete, Keys.home, Keys.end];\n const input = this.el.nativeElement;\n const value = input.value;\n\n if (allowedKeys.includes(key)) {\n return true; // allow control/navigation keys\n }\n\n // Allow one leading minus\n if (key === '-') {\n return (input.selectionStart === 0 || input.selectionEnd === 0) && value.charAt(0) !== '-';\n }\n\n // Allow one dot for decimal\n if (key === this.decimalSeparator) {\n return (this.numberType() == 'decimal') &&\n (!value.includes(this.decimalSeparator)) &&\n (this.selectionStart == input.value.length);\n }\n\n // Allow numbers only\n if (/^\\d$/.test(key)) {\n if (this.isCursorInsideIntegerPart) {\n return true;\n } else {\n var decimalPart = value.split(this.decimalSeparator)[1];\n var maxFractionDigits = this.maxFractionDigits();\n if (maxFractionDigits != undefined && decimalPart.length < maxFractionDigits) {\n return true;\n } else {\n return this.selectionStart !== this.selectionEnd; // allow a new digit if a substring is selected\n }\n }\n }\n\n return false;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAEgB,SAAA,kBAAkB,CAAC,WAAoB,EAAE,iBAA0B,EAAA;IAC7E,OAAO,CAAC,OAAwB,KAAmC;AAC7D,QAAA,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,KAAK,WAAW;AAE7C,QAAA,OAAO,OAAO,GAAG,IAAI;AACf,YAAA;AACM,gBAAA,SAAS,EAAE;oBACL,KAAK,EAAE,OAAO,CAAC,KAAK;AACpB,oBAAA,OAAO,EAAE;AACd;aACN;AACb,KAAC;AACP;;MCFa,2BAA2B,CAAA;AACX,IAAA,WAAW;AACzB,IAAA,iBAAiB;AAE1B,IAAA,WAAA,GAAA;;AAGA,IAAA,QAAQ,CAAC,OAAwB,EAAA;AAC3B,QAAA,OAAO,kBAAkB,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC;;uGAR3E,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAA3B,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,2BAA2B,EA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A,EAAA,EAAA,SAAA,EAAA,EAAA,SAAA,EAAA,mBAAA,EAAA,OAAA,EAAA,8BAAA,EAAA,MAAA,EAAA,UAAA,EAAA,OAAA,EAAA,iBAAA,EAAA,EAAA,EAAA,SAAA,EAAA;AACT,YAAA;AACE,gBAAA,OAAO,EAAE,iBAAiB;AAC1B,gBAAA,WAAW,EAAE,UAAU,CAAC,MAAM,eAAe,CAAC;AAC9C,gBAAA,KAAK,EAAE;AACR;AACF,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAEU,eAAe,EAAA,UAAA,EAAA,CAAA;kBAV3B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,SAAS,EAAE;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,qBAAqB,CAAC;AAC9C,4BAAA,KAAK,EAAE;AACR;AACF;AACF,iBAAA;uGAgES,SAAS,EAAA,CAAA;sBADhB,YAAY;uBAAC,SAAS,EAAE,CAAC,QAAQ,CAAC;gBAwB3B,OAAO,EAAA,CAAA;sBADd,YAAY;uBAAC,OAAO,EAAE,CAAC,qBAAqB,CAAC;gBAsDtC,MAAM,EAAA,CAAA;sBADb,YAAY;uBAAC,MAAM;gBAWZ,OAAO,EAAA,CAAA;sBADd,YAAY;uBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;;;AChLnC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"bootkit-ng0-form.mjs","sources":["../../../projects/ng0/form/focus.directive.ts","../../../projects/ng0/form/number.directive.ts","../../../projects/ng0/form/validation/validators/equal-with/equal-with-validator.ts","../../../projects/ng0/form/validation/validators/equal-with/equal-with.directive.ts","../../../projects/ng0/form/validation/validators/url/url-validator.ts","../../../projects/ng0/form/validation/validators/url/url-validator.directive.ts","../../../projects/ng0/form/validation/validators/custom/custom-validator.directive.ts","../../../projects/ng0/form/validation/validators/min/min-validator.directive.ts","../../../projects/ng0/form/validation/validators/max/max-validator.directive.ts","../../../projects/ng0/form/form.module.ts","../../../projects/ng0/form/public-api.ts","../../../projects/ng0/form/bootkit-ng0-form.ts"],"sourcesContent":["import { Directive, ElementRef, Input, OnChanges, SimpleChanges, OnInit } from '@angular/core';\n\n@Directive({\n selector: '[ng0Focus]',\n exportAs: 'ng0Focus',\n standalone: true\n})\nexport class FocusDirective implements OnInit, OnChanges {\n /** \n * \n */\n @Input() focusOnLoad = true;\n @Input() focusWhen?: boolean;\n private focused = false;\n\n constructor(private elementRef: ElementRef) {\n }\n\n ngOnInit(): void {\n if (this.focusOnLoad) {\n setTimeout(() => {\n this.elementRef.nativeElement.focus();\n });\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['focusWhen']) {\n if (this.focusWhen) {\n setTimeout(() => {\n this.elementRef.nativeElement.focus();\n });\n }\n }\n }\n}\n","import { Directive, HostListener, forwardRef, ElementRef, Renderer2, input } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { formatNumber } from '@angular/common';\n\nconst addThousandsSeparator = (str: string) => str.replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\nconst isValidNumber = (str: string) => str.trim() !== '' && !isNaN(Number(str));\nconst removeChar = (str: string, charToRemove: string) => str.split(charToRemove).join('');\n\nconst Keys = {\n backspace: 'Backspace',\n tab: 'Tab',\n arrowLeft: 'ArrowLeft',\n arrowRight: 'ArrowRight',\n delete: 'Delete',\n home: 'Home',\n end: 'End'\n}\n\n@Directive({\n selector: '[ng0Number]',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => NumberDirective),\n multi: true\n }\n ]\n})\nexport class NumberDirective implements ControlValueAccessor {\n /** */\n minFractionDigits = input<number | undefined>(3);\n maxFractionDigits = input<number| undefined>(10);\n useGrouping = input<boolean>(false);\n numberType = input<'decimal' | 'integer'>('integer');\n private onChange = (_: any) => { };\n private onTouched = () => { };\n private decimalSeparator!: string;\n private thousandsSeparator: string = ',';\n private selectionStart: number = 0;\n private selectionEnd: number = 0;\n private isCursorInsideIntegerPart: boolean = false;\n private decimalSeparatorPosition = -1;\n private value?: number;\n private setProperty = (prop: string, value: any) => this.renderer.setProperty(this.el.nativeElement, prop, value);\n\n constructor(\n private el: ElementRef<HTMLInputElement>,\n private renderer: Renderer2,\n // private locale: Locale,\n ) { }\n\n ngOnInit() {\n // Use Intl.NumberFormat to find decimal separator for locale\n const formatted = formatNumber(1.1, 'en', '1.1-1');\n this.decimalSeparator = formatted.replace(/\\d/g, '') || '.';\n }\n\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n\n setDisabledState?(isDisabled: boolean): void {\n this.setProperty('disabled', isDisabled);\n }\n\n writeValue(value: any): void {\n var inputValue: string;\n\n if (value === undefined || value === null) {\n inputValue = '';\n this.value = undefined;\n } else if (typeof value === 'number') {\n inputValue = this.formatNumber(value);\n this.value = value;\n }\n else if (typeof value === 'string') {\n const parsedValue = this.value = Number.parseFloat(value);\n inputValue = this.formatNumber(parsedValue);\n } else {\n console.error('NumberDirective: Unsupported value type', value);\n inputValue = 'Invalid';\n }\n\n this.setProperty('value', inputValue);\n }\n\n @HostListener('keydown', ['$event'])\n private onKeyDown(event: KeyboardEvent) {\n this.updateCursorInfo();\n\n if (!this.isKeyAllowed(event.key)) {\n event.preventDefault();\n return;\n }\n\n const key = event.key;\n\n if (key == Keys.backspace) {\n if (this.selectionStart > 1 && (this.selectionStart === this.selectionEnd)) {\n let value = this.el.nativeElement.value;\n let beforeSelection = value.charAt(this.selectionStart - 1);\n if (beforeSelection === ',') {\n // If the character before the cursor is a comma, we need to skip it\n this.setProperty('selectionStart', this.selectionStart - 2);\n }\n }\n }\n }\n\n @HostListener('input', ['$event.target.value'])\n private onInput(s: string) {\n if (s === '') {\n this.value = undefined;\n this.onChange(undefined);\n return;\n }\n\n this.updateCursorInfo();\n\n if (this.isCursorInsideIntegerPart) {\n this.formatIntegerPart(s);\n }\n\n var number = Number(removeChar(this.el.nativeElement.value, this.thousandsSeparator));\n this.value = isNaN(number) ? undefined : number;\n this.onChange(this.value);\n }\n\n private formatIntegerPart(value: string) {\n // Format the input value\n const integerPart = value.split(this.decimalSeparator)[0];\n const decimalPart = value.split(this.decimalSeparator)[1];\n\n if (integerPart.length <= 3) {\n return;\n }\n\n let normalizedIntegerPart = removeChar(integerPart, this.thousandsSeparator); // Remove commas\n\n let formattedValue = addThousandsSeparator(normalizedIntegerPart);\n if (decimalPart !== undefined) {\n formattedValue += this.decimalSeparator + decimalPart;\n }\n\n this.setProperty('value', formattedValue);\n let newSelectionStart: number;\n\n // fix the cursor position after formatting\n if (value.length == 1) {\n newSelectionStart = 1;\n } else {\n const newValueLength = formattedValue.length;\n const cursorJump = newValueLength - value.length;\n newSelectionStart = Math.max(0, this.selectionStart + cursorJump);\n }\n\n this.setProperty('selectionStart', newSelectionStart);\n this.setProperty('selectionEnd', newSelectionStart);\n\n // return formattedValue;\n }\n\n @HostListener('blur')\n private onBlur() {\n if (this.value !== undefined) {\n let formattedValue = this.formatNumber(this.value);\n this.setProperty('value', formattedValue);\n }\n\n this.onTouched();\n }\n\n @HostListener('paste', ['$event'])\n private onPaste(event: ClipboardEvent) {\n // event.\n // value = value.trim();\n }\n\n private updateCursorInfo() {\n let value = this.el.nativeElement.value;\n this.selectionStart = this.el.nativeElement.selectionStart || 0;\n this.selectionEnd = this.el.nativeElement.selectionEnd || 0;\n\n this.decimalSeparatorPosition = value.indexOf(this.decimalSeparator);\n if (this.decimalSeparatorPosition > -1) {\n this.isCursorInsideIntegerPart = (this.selectionStart <= this.decimalSeparatorPosition);\n } else {\n this.isCursorInsideIntegerPart = true;\n }\n }\n\n private formatNumber(n: number): string {\n var isInteger = this.numberType() == 'integer';\n return new Intl.NumberFormat('en-US', {\n useGrouping: this.useGrouping(),\n minimumFractionDigits: isInteger ? 0 : this.minFractionDigits(),\n maximumFractionDigits: isInteger ? 0 : this.maxFractionDigits(),\n style: 'decimal',\n }).format(n);\n }\n\n private isKeyAllowed(key: string) {\n const allowedKeys = [Keys.backspace, Keys.tab, Keys.arrowLeft, Keys.arrowRight, Keys.delete, Keys.home, Keys.end];\n const input = this.el.nativeElement;\n const value = input.value;\n\n if (allowedKeys.includes(key)) {\n return true; // allow control/navigation keys\n }\n\n // Allow one leading minus\n if (key === '-') {\n return (input.selectionStart === 0 || input.selectionEnd === 0) && value.charAt(0) !== '-';\n }\n\n // Allow one dot for decimal\n if (key === this.decimalSeparator) {\n return (this.numberType() == 'decimal') &&\n (!value.includes(this.decimalSeparator)) &&\n (this.selectionStart == input.value.length);\n }\n\n // Allow numbers only\n if (/^\\d$/.test(key)) {\n if (this.isCursorInsideIntegerPart) {\n return true;\n } else {\n var decimalPart = value.split(this.decimalSeparator)[1];\n var maxFractionDigits = this.maxFractionDigits();\n if (maxFractionDigits != undefined && decimalPart.length < maxFractionDigits) {\n return true;\n } else {\n return this.selectionStart !== this.selectionEnd; // allow a new digit if a substring is selected\n }\n }\n }\n\n return false;\n }\n}\n","import { AbstractControl, ValidatorFn } from '@angular/forms';\n\nexport function equalWithValidator(targetValue?: string, inequalityMessage?: string): ValidatorFn {\n return (control: AbstractControl): { [key: string]: any } | null => {\n const isValid = control.value === targetValue;\n\n return isValid ? null :\n {\n equalWith: {\n value: control.value,\n message: inequalityMessage\n }\n };\n };\n}\n","import { Directive, Input } from '@angular/core';\nimport { AbstractControl, NG_VALIDATORS, Validator } from '@angular/forms';\nimport { equalWithValidator } from './equal-with-validator';\n\n@Directive({\n selector: '[ng0EqualWith]',\n exportAs: 'ng0EqualWith',\n standalone: true,\n providers: [\n { provide: NG_VALIDATORS, useExisting: EqualWithValidatorDirective, multi: true }\n ]\n})\nexport class EqualWithValidatorDirective implements Validator {\n @Input('ng0EqualWith') targetValue?: string;\n @Input() inequalityMessage?: string;\n\n constructor() {\n }\n\n validate(control: AbstractControl): { [key: string]: any } | null {\n return equalWithValidator(this.targetValue, this.inequalityMessage)(control);\n }\n}\n","import { AbstractControl, ValidatorFn } from '@angular/forms';\nconst urlRegEx = new RegExp('(https?://)?([\\\\da-z.-]+)\\\\.([a-z.]{2,6})[/\\\\w .-]*/?');\n\nexport function urlValidator(): ValidatorFn {\n return (control: AbstractControl): { [key: string]: any } | null => {\n const value = (control.value as string);\n if (!value || urlRegEx.test(value)) {\n return null;\n } else {\n return {\n 'url': {\n value\n }\n };\n }\n };\n}","import { Directive, Input } from '@angular/core';\nimport { FormControl, NG_VALIDATORS, ValidationErrors, Validator } from '@angular/forms';\nimport { urlValidator } from './url-validator';\n\n@Directive({\n selector: 'input[ng0Url]',\n exportAs: 'ng0Url',\n standalone: true,\n providers: [{ provide: NG_VALIDATORS, useExisting: UrlValidatorDirective, multi: true }]\n})\nexport class UrlValidatorDirective implements Validator {\n /** Directive is enabled or disabled */\n @Input() iscUrl?: boolean | string = true;\n\n validate(control: FormControl): ValidationErrors | null {\n return urlValidator()(control);\n }\n}\n","import { Directive, input, Input } from '@angular/core';\nimport { AbstractControl, NG_VALIDATORS, ValidationErrors, Validator } from '@angular/forms';\n\n@Directive({\n selector: '[ng0CustomValidator]',\n exportAs: 'ng0CustomValidator',\n standalone: true,\n providers: [\n { provide: NG_VALIDATORS, useExisting: CustomValidatorDirective, multi: true }\n ]\n})\nexport class CustomValidatorDirective implements Validator {\n validator = input.required<(value: any) => ValidationErrors | null>({alias: 'ng0CustomValidator'});\n\n constructor() { }\n\n validate(control: AbstractControl): ValidationErrors | null {\n return this.validator()(control);\n }\n}\n","import { Directive, input, numberAttribute } from '@angular/core';\nimport { AbstractControl, NG_VALIDATORS, ValidationErrors, Validator, Validators } from '@angular/forms';\n\n/** Min validator */\n@Directive({\n selector: 'input[type=text][ng0Number][min]',\n exportAs: 'ng0Min',\n standalone: true,\n providers: [{\n provide: NG_VALIDATORS,\n useExisting: MinValidatorDirective,\n multi: true\n }]\n})\nexport class MinValidatorDirective implements Validator {\n min = input.required<number, number | string | undefined | null>({\n transform: numberAttribute,\n });\n\n validate(control: AbstractControl): ValidationErrors | null {\n return Validators.min(this.min())(control);\n }\n}\n","import { Directive, input, numberAttribute } from '@angular/core';\nimport { AbstractControl, NG_VALIDATORS, ValidationErrors, Validator, Validators } from '@angular/forms';\n\n/** Max validator */\n@Directive({\n selector: 'input[type=text][ng0Number][max]',\n exportAs: 'ng0Max',\n standalone: true,\n providers: [{\n provide: NG_VALIDATORS,\n useExisting: MaxValidatorDirective,\n multi: true\n }]\n})\nexport class MaxValidatorDirective implements Validator {\n max = input.required<number, number | string | undefined | null>({\n transform: numberAttribute,\n });\n\n validate(control: AbstractControl): ValidationErrors | null {\n return Validators.max(this.max())(control);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { EqualWithValidatorDirective } from './validation/validators/equal-with/equal-with.directive';\nimport { UrlValidatorDirective } from './validation/validators/url/url-validator.directive';\nimport { CustomValidatorDirective } from './validation/validators/custom/custom-validator.directive';\nimport { MinValidatorDirective } from './validation/validators/min/min-validator.directive';\nimport { MaxValidatorDirective } from './validation/validators/max/max-validator.directive';\nimport { NumberDirective } from './number.directive';\n\nconst items = [\n // ErrorDirective,\n // FirstErrorDirective,\n NumberDirective,\n\n // Validators\n MinValidatorDirective,\n MaxValidatorDirective,\n EqualWithValidatorDirective,\n UrlValidatorDirective,\n CustomValidatorDirective,\n];\n\n@NgModule({\n imports: items,\n exports: items,\n})\nexport class FormModule { }\n","\nexport * from './focus.directive';\nexport * from './number.directive';\nexport * from './form.module';\n\n// Validation\nexport * from './validation/validators/custom/custom-validator.directive';\nexport * from './validation/validators/equal-with/equal-with-validator';\nexport * from './validation/validators/equal-with/equal-with.directive';\nexport * from './validation/validators/url/url-validator.directive';\nexport * from './validation/validators/min/min-validator.directive';\nexport * from './validation/validators/max/max-validator.directive';\n// export * from './validation/error.directive';\n// export * from './validation/first-error.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\n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;kBAJtB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,KAAK;AACd,oBAAA,OAAO,EAAE,KAAK;AACf,iBAAA;;;ACZD;AACA;;ACbA;;AAEG;;;;"}
|
package/form/index.d.ts
CHANGED
|
@@ -1,41 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { OnInit, OnChanges, ElementRef, SimpleChanges, Renderer2 } from '@angular/core';
|
|
3
|
-
import { Validator, AbstractControl,
|
|
4
|
-
|
|
5
|
-
declare class EqualWithValidatorDirective implements Validator {
|
|
6
|
-
targetValue?: string;
|
|
7
|
-
inequalityMessage?: string;
|
|
8
|
-
constructor();
|
|
9
|
-
validate(control: AbstractControl): {
|
|
10
|
-
[key: string]: any;
|
|
11
|
-
} | null;
|
|
12
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<EqualWithValidatorDirective, never>;
|
|
13
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<EqualWithValidatorDirective, "[ng0EqualWith]", ["ng0EqualWith"], { "targetValue": { "alias": "ng0EqualWith"; "required": false; }; "inequalityMessage": { "alias": "inequalityMessage"; "required": false; }; }, {}, never, never, true, never>;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
declare class UrlValidatorDirective implements Validator {
|
|
17
|
-
/** Directive is enabled or disabled */
|
|
18
|
-
iscUrl?: boolean | string;
|
|
19
|
-
validate(control: FormControl): ValidationErrors | null;
|
|
20
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<UrlValidatorDirective, never>;
|
|
21
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<UrlValidatorDirective, "input[ng0Url]", ["ng0Url"], { "iscUrl": { "alias": "iscUrl"; "required": false; }; }, {}, never, never, true, never>;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
declare class CustomValidatorDirective implements Validator {
|
|
25
|
-
validator: i0.InputSignal<(value: any) => ValidationErrors | null>;
|
|
26
|
-
constructor();
|
|
27
|
-
validate(control: AbstractControl): ValidationErrors | null;
|
|
28
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CustomValidatorDirective, never>;
|
|
29
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<CustomValidatorDirective, "[ng0CustomValidator]", ["ng0CustomValidator"], { "validator": { "alias": "ng0CustomValidator"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
declare class ValidationModule {
|
|
33
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ValidationModule, never>;
|
|
34
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<ValidationModule, never, [typeof EqualWithValidatorDirective, typeof UrlValidatorDirective, typeof CustomValidatorDirective], [typeof EqualWithValidatorDirective, typeof UrlValidatorDirective, typeof CustomValidatorDirective]>;
|
|
35
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<ValidationModule>;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
declare function equalWithValidator(targetValue?: string, inequalityMessage?: string): ValidatorFn;
|
|
3
|
+
import { ControlValueAccessor, Validator, AbstractControl, ValidationErrors, FormControl, ValidatorFn } from '@angular/forms';
|
|
39
4
|
|
|
40
5
|
declare class FocusDirective implements OnInit, OnChanges {
|
|
41
6
|
private elementRef;
|
|
@@ -88,4 +53,55 @@ declare class NumberDirective implements ControlValueAccessor {
|
|
|
88
53
|
static ɵdir: i0.ɵɵDirectiveDeclaration<NumberDirective, "[ng0Number]", never, { "minFractionDigits": { "alias": "minFractionDigits"; "required": false; "isSignal": true; }; "maxFractionDigits": { "alias": "maxFractionDigits"; "required": false; "isSignal": true; }; "useGrouping": { "alias": "useGrouping"; "required": false; "isSignal": true; }; "numberType": { "alias": "numberType"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
89
54
|
}
|
|
90
55
|
|
|
91
|
-
|
|
56
|
+
/** Min validator */
|
|
57
|
+
declare class MinValidatorDirective implements Validator {
|
|
58
|
+
min: i0.InputSignalWithTransform<number, string | number | null | undefined>;
|
|
59
|
+
validate(control: AbstractControl): ValidationErrors | null;
|
|
60
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MinValidatorDirective, never>;
|
|
61
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<MinValidatorDirective, "input[type=text][ng0Number][min]", ["ng0Min"], { "min": { "alias": "min"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** Max validator */
|
|
65
|
+
declare class MaxValidatorDirective implements Validator {
|
|
66
|
+
max: i0.InputSignalWithTransform<number, string | number | null | undefined>;
|
|
67
|
+
validate(control: AbstractControl): ValidationErrors | null;
|
|
68
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MaxValidatorDirective, never>;
|
|
69
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<MaxValidatorDirective, "input[type=text][ng0Number][max]", ["ng0Max"], { "max": { "alias": "max"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
declare class EqualWithValidatorDirective implements Validator {
|
|
73
|
+
targetValue?: string;
|
|
74
|
+
inequalityMessage?: string;
|
|
75
|
+
constructor();
|
|
76
|
+
validate(control: AbstractControl): {
|
|
77
|
+
[key: string]: any;
|
|
78
|
+
} | null;
|
|
79
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EqualWithValidatorDirective, never>;
|
|
80
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<EqualWithValidatorDirective, "[ng0EqualWith]", ["ng0EqualWith"], { "targetValue": { "alias": "ng0EqualWith"; "required": false; }; "inequalityMessage": { "alias": "inequalityMessage"; "required": false; }; }, {}, never, never, true, never>;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
declare class UrlValidatorDirective implements Validator {
|
|
84
|
+
/** Directive is enabled or disabled */
|
|
85
|
+
iscUrl?: boolean | string;
|
|
86
|
+
validate(control: FormControl): ValidationErrors | null;
|
|
87
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UrlValidatorDirective, never>;
|
|
88
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<UrlValidatorDirective, "input[ng0Url]", ["ng0Url"], { "iscUrl": { "alias": "iscUrl"; "required": false; }; }, {}, never, never, true, never>;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
declare class CustomValidatorDirective implements Validator {
|
|
92
|
+
validator: i0.InputSignal<(value: any) => ValidationErrors | null>;
|
|
93
|
+
constructor();
|
|
94
|
+
validate(control: AbstractControl): ValidationErrors | null;
|
|
95
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CustomValidatorDirective, never>;
|
|
96
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CustomValidatorDirective, "[ng0CustomValidator]", ["ng0CustomValidator"], { "validator": { "alias": "ng0CustomValidator"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
declare class FormModule {
|
|
100
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormModule, never>;
|
|
101
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<FormModule, never, [typeof NumberDirective, typeof MinValidatorDirective, typeof MaxValidatorDirective, typeof EqualWithValidatorDirective, typeof UrlValidatorDirective, typeof CustomValidatorDirective], [typeof NumberDirective, typeof MinValidatorDirective, typeof MaxValidatorDirective, typeof EqualWithValidatorDirective, typeof UrlValidatorDirective, typeof CustomValidatorDirective]>;
|
|
102
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<FormModule>;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
declare function equalWithValidator(targetValue?: string, inequalityMessage?: string): ValidatorFn;
|
|
106
|
+
|
|
107
|
+
export { CustomValidatorDirective, EqualWithValidatorDirective, FocusDirective, FormModule, MaxValidatorDirective, MinValidatorDirective, NumberDirective, UrlValidatorDirective, equalWithValidator };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bootkit/ng0",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.17",
|
|
4
4
|
"description": "Angular+Bootstrap Component Library",
|
|
5
5
|
"homepage": "https://bootkitlib.github.io/",
|
|
6
6
|
"author": "BootKit",
|
|
@@ -35,26 +35,26 @@
|
|
|
35
35
|
"types": "./index.d.ts",
|
|
36
36
|
"default": "./fesm2022/bootkit-ng0.mjs"
|
|
37
37
|
},
|
|
38
|
-
"./
|
|
39
|
-
"types": "./
|
|
40
|
-
"default": "./fesm2022/bootkit-ng0-
|
|
38
|
+
"./file": {
|
|
39
|
+
"types": "./file/index.d.ts",
|
|
40
|
+
"default": "./fesm2022/bootkit-ng0-file.mjs"
|
|
41
41
|
},
|
|
42
42
|
"./date": {
|
|
43
43
|
"types": "./date/index.d.ts",
|
|
44
44
|
"default": "./fesm2022/bootkit-ng0-date.mjs"
|
|
45
45
|
},
|
|
46
|
-
"./
|
|
47
|
-
"types": "./
|
|
48
|
-
"default": "./fesm2022/bootkit-ng0-
|
|
49
|
-
},
|
|
50
|
-
"./common": {
|
|
51
|
-
"types": "./common/index.d.ts",
|
|
52
|
-
"default": "./fesm2022/bootkit-ng0-common.mjs"
|
|
46
|
+
"./data": {
|
|
47
|
+
"types": "./data/index.d.ts",
|
|
48
|
+
"default": "./fesm2022/bootkit-ng0-data.mjs"
|
|
53
49
|
},
|
|
54
50
|
"./form": {
|
|
55
51
|
"types": "./form/index.d.ts",
|
|
56
52
|
"default": "./fesm2022/bootkit-ng0-form.mjs"
|
|
57
53
|
},
|
|
54
|
+
"./common": {
|
|
55
|
+
"types": "./common/index.d.ts",
|
|
56
|
+
"default": "./fesm2022/bootkit-ng0-common.mjs"
|
|
57
|
+
},
|
|
58
58
|
"./http": {
|
|
59
59
|
"types": "./http/index.d.ts",
|
|
60
60
|
"default": "./fesm2022/bootkit-ng0-http.mjs"
|
|
@@ -127,14 +127,14 @@
|
|
|
127
127
|
"types": "./components/popover/index.d.ts",
|
|
128
128
|
"default": "./fesm2022/bootkit-ng0-components-popover.mjs"
|
|
129
129
|
},
|
|
130
|
-
"./components/sidenav": {
|
|
131
|
-
"types": "./components/sidenav/index.d.ts",
|
|
132
|
-
"default": "./fesm2022/bootkit-ng0-components-sidenav.mjs"
|
|
133
|
-
},
|
|
134
130
|
"./components/stepper": {
|
|
135
131
|
"types": "./components/stepper/index.d.ts",
|
|
136
132
|
"default": "./fesm2022/bootkit-ng0-components-stepper.mjs"
|
|
137
133
|
},
|
|
134
|
+
"./components/sidenav": {
|
|
135
|
+
"types": "./components/sidenav/index.d.ts",
|
|
136
|
+
"default": "./fesm2022/bootkit-ng0-components-sidenav.mjs"
|
|
137
|
+
},
|
|
138
138
|
"./components/table": {
|
|
139
139
|
"types": "./components/table/index.d.ts",
|
|
140
140
|
"default": "./fesm2022/bootkit-ng0-components-table.mjs"
|