@bootkit/ng0 0.0.0-alpha.17 → 0.0.0-alpha.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/common/index.d.ts +60 -4
- package/components/list/index.d.ts +127 -0
- package/components/select/index.d.ts +120 -0
- package/components/table/index.d.ts +66 -10
- package/data/index.d.ts +171 -51
- package/fesm2022/bootkit-ng0-common.mjs +51 -1
- package/fesm2022/bootkit-ng0-common.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-accordion.mjs +14 -14
- package/fesm2022/bootkit-ng0-components-accordion.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-backdrop.mjs +4 -4
- package/fesm2022/bootkit-ng0-components-backdrop.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-button.mjs +11 -11
- package/fesm2022/bootkit-ng0-components-button.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-card.mjs +12 -12
- package/fesm2022/bootkit-ng0-components-card.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-code.mjs +9 -9
- package/fesm2022/bootkit-ng0-components-code.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-collapse.mjs +14 -14
- package/fesm2022/bootkit-ng0-components-collapse.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-confirmation.mjs +14 -14
- package/fesm2022/bootkit-ng0-components-confirmation.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-form-field.mjs +14 -14
- package/fesm2022/bootkit-ng0-components-form-field.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-list.mjs +331 -0
- package/fesm2022/bootkit-ng0-components-list.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-modal.mjs +13 -13
- package/fesm2022/bootkit-ng0-components-modal.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-nav.mjs +27 -27
- package/fesm2022/bootkit-ng0-components-nav.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-offcanvas.mjs +9 -9
- package/fesm2022/bootkit-ng0-components-offcanvas.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-overlay.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-pagination.mjs +15 -15
- package/fesm2022/bootkit-ng0-components-pagination.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-popover.mjs +11 -11
- package/fesm2022/bootkit-ng0-components-popover.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-select.mjs +394 -0
- package/fesm2022/bootkit-ng0-components-select.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-sidenav.mjs +21 -21
- package/fesm2022/bootkit-ng0-components-sidenav.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-stepper.mjs +13 -13
- package/fesm2022/bootkit-ng0-components-stepper.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-table.mjs +170 -72
- package/fesm2022/bootkit-ng0-components-table.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-toast.mjs +7 -7
- package/fesm2022/bootkit-ng0-components-toast.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-tooltip.mjs +9 -9
- package/fesm2022/bootkit-ng0-components-tooltip.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-vertical-menu.mjs +26 -26
- package/fesm2022/bootkit-ng0-components-vertical-menu.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-data.mjs +177 -60
- package/fesm2022/bootkit-ng0-data.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-date.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-file.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-form.mjs +36 -36
- package/fesm2022/bootkit-ng0-form.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-http.mjs +3 -3
- package/fesm2022/bootkit-ng0-http.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-localization-locales.mjs +20 -0
- package/fesm2022/bootkit-ng0-localization-locales.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-localization.mjs +100 -35
- package/fesm2022/bootkit-ng0-localization.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-platform-browser.mjs +7 -7
- package/fesm2022/bootkit-ng0-platform-browser.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-script.mjs +3 -3
- package/fesm2022/bootkit-ng0-script.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-security.mjs +15 -15
- package/fesm2022/bootkit-ng0-security.mjs.map +1 -1
- package/fesm2022/bootkit-ng0.mjs.map +1 -1
- package/localization/index.d.ts +63 -28
- package/package.json +22 -14
|
@@ -15,31 +15,31 @@ class FormFieldComponent {
|
|
|
15
15
|
/**
|
|
16
16
|
* The label text for the form field.
|
|
17
17
|
*/
|
|
18
|
-
label = input();
|
|
18
|
+
label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
|
|
19
19
|
/**
|
|
20
20
|
* The hint text to display below the form field.
|
|
21
21
|
* This is typically used to provide additional information or instructions to the user.
|
|
22
22
|
*/
|
|
23
|
-
hint = input();
|
|
23
|
+
hint = input(...(ngDevMode ? [undefined, { debugName: "hint" }] : []));
|
|
24
24
|
/**
|
|
25
25
|
* If true, the form-field will show validation errors.
|
|
26
26
|
* This is useful for displaying validation messages when the form control is invalid.
|
|
27
27
|
*/
|
|
28
|
-
showErrors = input(true);
|
|
28
|
+
showErrors = input(true, ...(ngDevMode ? [{ debugName: "showErrors" }] : []));
|
|
29
29
|
/**
|
|
30
30
|
* If true, the form-field will show a red asterisk for required fields.
|
|
31
31
|
* This is only a visual indicator and does not enforce validation.
|
|
32
32
|
*/
|
|
33
|
-
showRequiredIndicator = input(true);
|
|
33
|
+
showRequiredIndicator = input(true, ...(ngDevMode ? [{ debugName: "showRequiredIndicator" }] : []));
|
|
34
34
|
/**
|
|
35
35
|
* If true, the form-field will show subscripts (e.g. hints, errors) for the field label.
|
|
36
36
|
* This is useful for displaying additional information or validation messages.
|
|
37
37
|
*/
|
|
38
|
-
showSubscripts = input(true);
|
|
38
|
+
showSubscripts = input(true, ...(ngDevMode ? [{ debugName: "showSubscripts" }] : []));
|
|
39
39
|
/**
|
|
40
40
|
* If true, the form-field will be rendered inside a ".input-group" element.
|
|
41
41
|
*/
|
|
42
|
-
inputGroup = input(true);
|
|
42
|
+
inputGroup = input(true, ...(ngDevMode ? [{ debugName: "inputGroup" }] : []));
|
|
43
43
|
/**
|
|
44
44
|
* Returns the first localized error of the control
|
|
45
45
|
*/
|
|
@@ -95,14 +95,14 @@ class FormFieldComponent {
|
|
|
95
95
|
}
|
|
96
96
|
ngOnDestroy() {
|
|
97
97
|
}
|
|
98
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
99
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.
|
|
98
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", 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.2.1", 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()) {\r\n<label class=\"form-field-label\">\r\n {{label()}}\r\n <span *ngIf=\"isRequired && showRequiredIndicator()\" class=\"isc-form-field-required-marker\">*</span>\r\n</label>\r\n}\r\n\r\n@if(inputGroup()) {\r\n<div class=\"input-group\">\r\n <ng-container *ngTemplateOutlet=\"contentTemplate\"></ng-container>\r\n</div>\r\n}@else {\r\n<ng-container *ngTemplateOutlet=\"contentTemplate\"></ng-container>\r\n}\r\n\r\n<ng-template #contentTemplate>\r\n <ng-content></ng-content>\r\n</ng-template>\r\n\r\n@if(showSubscripts()) {\r\n<div class=\"form-field-subscript-wrapper\">\r\n @if(showErrors() && errorText && (touched || dirty)) {\r\n <span class=\"form-field-error text-danger\">\r\n {{errorText}}\r\n </span>\r\n }@else if(hint()) {\r\n <span class=\"form-field-hint\">\r\n {{hint()}}\r\n </span>\r\n }\r\n</div>\r\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
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
101
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", 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 }@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"] }]
|
|
105
|
+
], template: "@if(label()) {\r\n<label class=\"form-field-label\">\r\n {{label()}}\r\n <span *ngIf=\"isRequired && showRequiredIndicator()\" class=\"isc-form-field-required-marker\">*</span>\r\n</label>\r\n}\r\n\r\n@if(inputGroup()) {\r\n<div class=\"input-group\">\r\n <ng-container *ngTemplateOutlet=\"contentTemplate\"></ng-container>\r\n</div>\r\n}@else {\r\n<ng-container *ngTemplateOutlet=\"contentTemplate\"></ng-container>\r\n}\r\n\r\n<ng-template #contentTemplate>\r\n <ng-content></ng-content>\r\n</ng-template>\r\n\r\n@if(showSubscripts()) {\r\n<div class=\"form-field-subscript-wrapper\">\r\n @if(showErrors() && errorText && (touched || dirty)) {\r\n <span class=\"form-field-error text-danger\">\r\n {{errorText}}\r\n </span>\r\n }@else if(hint()) {\r\n <span class=\"form-field-hint\">\r\n {{hint()}}\r\n </span>\r\n }\r\n</div>\r\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: [{
|
|
@@ -120,13 +120,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
120
120
|
}] } });
|
|
121
121
|
|
|
122
122
|
class FormFieldModule {
|
|
123
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
124
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.
|
|
123
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: FormFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
124
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.1", ngImport: i0, type: FormFieldModule, imports: [CommonModule,
|
|
125
125
|
FormFieldComponent], exports: [FormFieldComponent] });
|
|
126
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.
|
|
126
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: FormFieldModule, imports: [CommonModule,
|
|
127
127
|
FormFieldComponent] });
|
|
128
128
|
}
|
|
129
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
129
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: FormFieldModule, decorators: [{
|
|
130
130
|
type: NgModule,
|
|
131
131
|
args: [{
|
|
132
132
|
imports: [
|
|
@@ -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 }@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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AA,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';\r\nimport { DestroyRef, HostListener, input, signal } from '@angular/core';\r\nimport { Component, Input, ContentChild, AfterContentInit, Optional, HostBinding, OnInit, OnDestroy, ElementRef, Renderer2 } from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { FormControl, NgControl, NgForm } from '@angular/forms';\r\nimport { Locale, LocalizationService } from '@bootkit/ng0/localization';\r\n\r\n@Component({\r\n selector: 'ng0-form-field, ng0-field',\r\n exportAs: 'ng0FormField',\r\n templateUrl: './form-field.component.html',\r\n styleUrls: ['./form-field.component.scss'],\r\n standalone: true,\r\n imports: [\r\n CommonModule\r\n ],\r\n})\r\nexport class FormFieldComponent implements OnInit, AfterContentInit, OnDestroy {\r\n\r\n /**\r\n * The label text for the form field.\r\n */\r\n public label = input<string>();\r\n\r\n /**\r\n * The hint text to display below the form field.\r\n * This is typically used to provide additional information or instructions to the user.\r\n */\r\n public hint = input<string>();\r\n\r\n /**\r\n * If true, the form-field will show validation errors.\r\n * This is useful for displaying validation messages when the form control is invalid.\r\n */\r\n public showErrors = input(true);\r\n\r\n /**\r\n * If true, the form-field will show a red asterisk for required fields.\r\n * This is only a visual indicator and does not enforce validation.\r\n */\r\n public showRequiredIndicator = input(true);\r\n\r\n /**\r\n * If true, the form-field will show subscripts (e.g. hints, errors) for the field label.\r\n * This is useful for displaying additional information or validation messages.\r\n */\r\n public showSubscripts = input(true);\r\n\r\n /**\r\n * If true, the form-field will be rendered inside a \".input-group\" element.\r\n */\r\n public inputGroup = input(true);\r\n\r\n /**\r\n * Returns the first localized error of the control \r\n */\r\n public get errorText() { return this._errorText; }\r\n\r\n /** Reports whether the control is touched. */\r\n public get touched(): boolean | null | undefined { return this._ngControl?.touched; }\r\n\r\n /** Reports whether the control is dirty. */\r\n public get dirty(): boolean | null | undefined { return this._ngControl?.dirty; }\r\n\r\n /** Returns true if this form-field is required, otherwise returns false. */\r\n @HostBinding('class.required-form-field')\r\n public get isRequired(): boolean { return this._isRequired; }\r\n\r\n @HostListener('focusout')\r\n private _onFocusOut() { this._validate(); }\r\n\r\n @ContentChild(NgControl, { static: true })\r\n private _ngControl?: NgControl;\r\n\r\n @ContentChild(NgControl, { static: true, read: ElementRef })\r\n private _ngControlElement?: ElementRef;\r\n\r\n private _isRequired = false;\r\n private _locale?: Locale;\r\n private _errorText?: string;\r\n\r\n constructor(\r\n private _renderer: Renderer2,\r\n private _destroyRef: DestroyRef,\r\n @Optional() private _form: NgForm,\r\n private _ls: LocalizationService,\r\n ) {\r\n this._locale = this._ls.get();\r\n this._ls.change.pipe(takeUntilDestroyed()).subscribe(e => this._locale = e.new);\r\n }\r\n\r\n ngOnInit(): void {\r\n }\r\n\r\n ngAfterContentInit(): void {\r\n this._isRequired = this._isRequiredField();\r\n\r\n if (this._ngControl) {\r\n this._ngControl?.statusChanges?.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(change => {\r\n this._validate();\r\n });\r\n }\r\n }\r\n\r\n private _validate() {\r\n if (!this._ngControl || !this.dirty || !this.touched) {\r\n return;\r\n }\r\n\r\n const invalid = this._ngControl.status === 'INVALID';\r\n if (invalid) {\r\n this._errorText = this._locale?.translateFirstError(this._ngControl.errors, 'Invalid')?.text;\r\n } else {\r\n this._errorText = undefined;\r\n }\r\n this._renderer.addClass(this._ngControlElement!.nativeElement, invalid ? 'is-invalid' : 'is-valid');\r\n this._renderer.removeClass(this._ngControlElement!.nativeElement, invalid ? 'is-valid' : 'is-invalid');\r\n }\r\n\r\n private _isRequiredField(): boolean {\r\n const validator = this._ngControl?.validator;\r\n const errors = validator && validator(new FormControl(null));\r\n return errors != null && errors['required'] === true;\r\n }\r\n\r\n ngOnDestroy(): void {\r\n }\r\n}\r\n","@if(label()) {\r\n<label class=\"form-field-label\">\r\n {{label()}}\r\n <span *ngIf=\"isRequired && showRequiredIndicator()\" class=\"isc-form-field-required-marker\">*</span>\r\n</label>\r\n}\r\n\r\n@if(inputGroup()) {\r\n<div class=\"input-group\">\r\n <ng-container *ngTemplateOutlet=\"contentTemplate\"></ng-container>\r\n</div>\r\n}@else {\r\n<ng-container *ngTemplateOutlet=\"contentTemplate\"></ng-container>\r\n}\r\n\r\n<ng-template #contentTemplate>\r\n <ng-content></ng-content>\r\n</ng-template>\r\n\r\n@if(showSubscripts()) {\r\n<div class=\"form-field-subscript-wrapper\">\r\n @if(showErrors() && errorText && (touched || dirty)) {\r\n <span class=\"form-field-error text-danger\">\r\n {{errorText}}\r\n </span>\r\n }@else if(hint()) {\r\n <span class=\"form-field-hint\">\r\n {{hint()}}\r\n </span>\r\n }\r\n</div>\r\n}","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormFieldComponent } from './form-field.component';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n FormFieldComponent,\r\n ],\r\n exports: [\r\n FormFieldComponent,\r\n ]\r\n})\r\nexport class FormFieldModule { }\r\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,I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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;;;;"}
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, DOCUMENT, ChangeDetectorRef, signal, input, booleanAttribute, TemplateRef, forwardRef, HostListener, ContentChild, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import { dataSourceAttribute, defaultBooleanValueComparer, BooleanValueComparerAttribute, defaultValueExtractor, ValueExtractorAttribute, stringFilter, FilterPredicateAttribute, DataRequest } from '@bootkit/ng0/data';
|
|
6
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
7
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
8
|
+
import { OverlayModule } from '@angular/cdk/overlay';
|
|
9
|
+
import { CssClassAttribute, sequentialIdGenerator } from '@bootkit/ng0/common';
|
|
10
|
+
import { LocalizationService, defaultValueFormatter, ValueFormatterAttribute } from '@bootkit/ng0/localization';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Select component that allows users to choose an option from a dropdown list.
|
|
14
|
+
*/
|
|
15
|
+
class ListComponent {
|
|
16
|
+
_el;
|
|
17
|
+
_renderer;
|
|
18
|
+
_destroyRef;
|
|
19
|
+
_document = inject(DOCUMENT);
|
|
20
|
+
_ls = inject(LocalizationService);
|
|
21
|
+
_changeDetector = inject(ChangeDetectorRef);
|
|
22
|
+
_value = signal(undefined, ...(ngDevMode ? [{ debugName: "_value" }] : []));
|
|
23
|
+
_onChangeCallback;
|
|
24
|
+
_onTouchedCallback;
|
|
25
|
+
_items = signal([], ...(ngDevMode ? [{ debugName: "_items" }] : []));
|
|
26
|
+
_isDisabled = signal(false, ...(ngDevMode ? [{ debugName: "_isDisabled" }] : []));
|
|
27
|
+
_activeOptionIndex = signal(-1, ...(ngDevMode ? [{ debugName: "_activeOptionIndex" }] : []));
|
|
28
|
+
_itemTemplate;
|
|
29
|
+
/**
|
|
30
|
+
* The data source for the select component.
|
|
31
|
+
* This can be an array of data, a function that returns an observable of data,
|
|
32
|
+
* or an instance of DataSource.
|
|
33
|
+
*/
|
|
34
|
+
source = input.required(...(ngDevMode ? [{ debugName: "source", transform: v => dataSourceAttribute(v) }] : [{
|
|
35
|
+
transform: v => dataSourceAttribute(v)
|
|
36
|
+
}]));
|
|
37
|
+
/**
|
|
38
|
+
* Indicates whether multi selection is enabled or not.
|
|
39
|
+
*/
|
|
40
|
+
multiple = input(false, ...(ngDevMode ? [{ debugName: "multiple", transform: booleanAttribute }] : [{
|
|
41
|
+
transform: booleanAttribute
|
|
42
|
+
}]));
|
|
43
|
+
/**
|
|
44
|
+
* Indicates whether to show selection indicator (checkbox/radio) next to each item.
|
|
45
|
+
* Default is false.
|
|
46
|
+
*/
|
|
47
|
+
showIndicator = input(false, ...(ngDevMode ? [{ debugName: "showIndicator", transform: booleanAttribute }] : [{
|
|
48
|
+
transform: booleanAttribute
|
|
49
|
+
}]));
|
|
50
|
+
/**
|
|
51
|
+
* A custom comparer function or the name of a field for comparing two objects.
|
|
52
|
+
*/
|
|
53
|
+
compareBy = input(defaultBooleanValueComparer, ...(ngDevMode ? [{ debugName: "compareBy", transform: BooleanValueComparerAttribute }] : [{
|
|
54
|
+
transform: BooleanValueComparerAttribute
|
|
55
|
+
}]));
|
|
56
|
+
/**
|
|
57
|
+
* Custom format function to convert an item to a string for display.
|
|
58
|
+
* Default converts the item to a string using its toString method.
|
|
59
|
+
*/
|
|
60
|
+
formatBy = input(defaultValueFormatter, ...(ngDevMode ? [{ debugName: "formatBy", transform: ValueFormatterAttribute(this._ls.get()) }] : [{
|
|
61
|
+
transform: ValueFormatterAttribute(this._ls.get())
|
|
62
|
+
}]));
|
|
63
|
+
/**
|
|
64
|
+
* Custom value extractor function to extract the value of any object while writing values.
|
|
65
|
+
*/
|
|
66
|
+
writeValueBy = input(defaultValueExtractor, ...(ngDevMode ? [{ debugName: "writeValueBy", transform: ValueExtractorAttribute }] : [{
|
|
67
|
+
transform: ValueExtractorAttribute
|
|
68
|
+
}]));
|
|
69
|
+
/**
|
|
70
|
+
* A custom filter predicate function to filter items based on a search string.
|
|
71
|
+
* Default checks if the item's string representation contains the filter string (case-insensitive).
|
|
72
|
+
* The filter predicate can be a function or a string representing the property name to filter.
|
|
73
|
+
*/
|
|
74
|
+
filterBy = input(stringFilter, ...(ngDevMode ? [{ debugName: "filterBy", transform: FilterPredicateAttribute }] : [{
|
|
75
|
+
transform: FilterPredicateAttribute
|
|
76
|
+
}]));
|
|
77
|
+
/**
|
|
78
|
+
* CSS class or classes to apply to the list container.
|
|
79
|
+
* Default is undefined.
|
|
80
|
+
*/
|
|
81
|
+
itemClass = input((item) => undefined, ...(ngDevMode ? [{ debugName: "itemClass", transform: CssClassAttribute }] : [{
|
|
82
|
+
transform: CssClassAttribute
|
|
83
|
+
}]));
|
|
84
|
+
focus = input('activeDescendant', ...(ngDevMode ? [{ debugName: "focus" }] : []));
|
|
85
|
+
idGenerator = input(sequentialIdGenerator('ng0-list-item-'), ...(ngDevMode ? [{ debugName: "idGenerator" }] : []));
|
|
86
|
+
constructor(_el, _renderer, _destroyRef) {
|
|
87
|
+
this._el = _el;
|
|
88
|
+
this._renderer = _renderer;
|
|
89
|
+
this._destroyRef = _destroyRef;
|
|
90
|
+
}
|
|
91
|
+
ngOnInit() {
|
|
92
|
+
this._loadItems();
|
|
93
|
+
this._listenToDataSourceChanges();
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Sets an option as active
|
|
97
|
+
*/
|
|
98
|
+
active(index) {
|
|
99
|
+
if (index < 0) {
|
|
100
|
+
throw Error();
|
|
101
|
+
}
|
|
102
|
+
this._activeOptionIndex.set(index);
|
|
103
|
+
// this.scrollItemIntoView(this._activeOptionIndex(), 'nearest');
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Filters the list items based on the provided criteria.
|
|
107
|
+
* @param params The filter parameters to apply.
|
|
108
|
+
* @returns void
|
|
109
|
+
*/
|
|
110
|
+
filter(...params) {
|
|
111
|
+
let filterBy = this.filterBy();
|
|
112
|
+
this._items().forEach(x => x.filtered = !filterBy(x.value, ...params));
|
|
113
|
+
this._changeDetector.markForCheck();
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Clears any applied filters and shows all items in the list.
|
|
117
|
+
* @returns void
|
|
118
|
+
*/
|
|
119
|
+
clearFilter() {
|
|
120
|
+
this._items().forEach(x => x.filtered = false);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Scrolls the item at the specified index into view within the dropdown list.
|
|
124
|
+
* @param index The index of the item to scroll into view.
|
|
125
|
+
* @param position The vertical alignment of the item after scrolling.
|
|
126
|
+
* Can be 'start', 'center', 'end', or 'nearest'.
|
|
127
|
+
* Default is 'nearest'.
|
|
128
|
+
* @param behavior The scrolling behavior.
|
|
129
|
+
*/
|
|
130
|
+
scrollItemIntoView(index, position, behavior) {
|
|
131
|
+
let item = this._items()[index];
|
|
132
|
+
let elm = this._document.getElementById(item.id);
|
|
133
|
+
elm.scrollIntoView({ block: position, behavior: behavior });
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Toggles the selection of an option by index
|
|
137
|
+
*/
|
|
138
|
+
toggleSelection(index) {
|
|
139
|
+
let optionsCount = this._items().length;
|
|
140
|
+
if (optionsCount == 0 || index < 0 || index > optionsCount - 1) {
|
|
141
|
+
throw new Error('Index out of range');
|
|
142
|
+
}
|
|
143
|
+
let item = this._items()[index];
|
|
144
|
+
let writeValueBy = this.writeValueBy();
|
|
145
|
+
if (this.multiple()) {
|
|
146
|
+
item.selected = !item.selected;
|
|
147
|
+
let selectedValues = this._items().filter(x => x.selected).map(x => (x.value));
|
|
148
|
+
this._value.set(selectedValues);
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
if (item.selected) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
let itemValue = writeValueBy(item.value);
|
|
155
|
+
this._items().forEach(x => x.selected = false);
|
|
156
|
+
item.selected = true;
|
|
157
|
+
this._value.set(itemValue);
|
|
158
|
+
}
|
|
159
|
+
this._onChangeCallback(this._value());
|
|
160
|
+
}
|
|
161
|
+
writeValue(v) {
|
|
162
|
+
let value;
|
|
163
|
+
if (this.multiple()) {
|
|
164
|
+
if (Array.isArray(v)) {
|
|
165
|
+
value = v;
|
|
166
|
+
}
|
|
167
|
+
else if (v === null || v === undefined) {
|
|
168
|
+
value = [];
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
throw Error('Provide an array or null as the value ng0-list component');
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
value = v;
|
|
176
|
+
}
|
|
177
|
+
this._value.set(value);
|
|
178
|
+
// Update selection state of items
|
|
179
|
+
let compareBy = this.compareBy();
|
|
180
|
+
if (this.multiple()) {
|
|
181
|
+
this._items().forEach(x => x.selected = value.some(y => compareBy(x.value, y)));
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
this._items().forEach(x => x.selected = compareBy(x.value, value));
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
registerOnChange(fn) {
|
|
188
|
+
this._onChangeCallback = fn;
|
|
189
|
+
}
|
|
190
|
+
registerOnTouched(fn) {
|
|
191
|
+
this._onTouchedCallback = fn;
|
|
192
|
+
}
|
|
193
|
+
setDisabledState(isDisabled) {
|
|
194
|
+
this._isDisabled.set(isDisabled);
|
|
195
|
+
}
|
|
196
|
+
_onKeydown(e, firedByFilter = false) {
|
|
197
|
+
if (this._isDisabled())
|
|
198
|
+
return;
|
|
199
|
+
let optionsCount = this._items().length;
|
|
200
|
+
if (optionsCount == 0) {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
switch (e.key) {
|
|
204
|
+
case 'ArrowDown':
|
|
205
|
+
if (this._activeOptionIndex() < optionsCount - 1) {
|
|
206
|
+
this.active(this._activeOptionIndex() + 1);
|
|
207
|
+
}
|
|
208
|
+
e.preventDefault();
|
|
209
|
+
break;
|
|
210
|
+
case 'ArrowUp':
|
|
211
|
+
if (this._activeOptionIndex() > 0) {
|
|
212
|
+
this.active(this._activeOptionIndex() - 1);
|
|
213
|
+
}
|
|
214
|
+
e.preventDefault();
|
|
215
|
+
break;
|
|
216
|
+
case 'Enter':
|
|
217
|
+
this.toggleSelection(this._activeOptionIndex());
|
|
218
|
+
e.preventDefault();
|
|
219
|
+
break;
|
|
220
|
+
case 'Home':
|
|
221
|
+
this.active(0);
|
|
222
|
+
e.preventDefault();
|
|
223
|
+
break;
|
|
224
|
+
case 'End':
|
|
225
|
+
this.active(optionsCount - 1);
|
|
226
|
+
e.preventDefault();
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
_loadItems() {
|
|
231
|
+
var r = new DataRequest();
|
|
232
|
+
this.source().load(r).pipe(takeUntilDestroyed(this._destroyRef)).subscribe(res => {
|
|
233
|
+
this._insertItems(0, ...res.data);
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
_listenToDataSourceChanges() {
|
|
237
|
+
this.source().change.subscribe(e => {
|
|
238
|
+
let options = this._items();
|
|
239
|
+
e.changes.forEach(change => {
|
|
240
|
+
switch (change.type) {
|
|
241
|
+
case 'insert':
|
|
242
|
+
this._insertItems(change.index, ...change.items);
|
|
243
|
+
break;
|
|
244
|
+
case 'replace':
|
|
245
|
+
options[change.index].value = change.value;
|
|
246
|
+
break;
|
|
247
|
+
case 'remove':
|
|
248
|
+
options.splice(change.index, change.count);
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
// this._changeDetector.markForCheck();
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
_insertItems(index, ...items) {
|
|
255
|
+
// let filter = this.filterBy()()
|
|
256
|
+
let idGenerator = this.idGenerator();
|
|
257
|
+
let compareBy = this.compareBy();
|
|
258
|
+
let value = this._value();
|
|
259
|
+
let isItemSelected = this.multiple() && Array.isArray(value) ?
|
|
260
|
+
(item) => value.some(x => compareBy(x.value, item)) :
|
|
261
|
+
(item) => compareBy(value, item);
|
|
262
|
+
var options = items.map(x => ({
|
|
263
|
+
id: idGenerator ? idGenerator(x) : undefined,
|
|
264
|
+
value: x,
|
|
265
|
+
selected: isItemSelected(x),
|
|
266
|
+
filtered: false,
|
|
267
|
+
}));
|
|
268
|
+
if (Number.isInteger(index)) {
|
|
269
|
+
this._items().splice(index, 0, ...options);
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
this._items().push(...options);
|
|
273
|
+
}
|
|
274
|
+
this._changeDetector.markForCheck();
|
|
275
|
+
}
|
|
276
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: ListComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.DestroyRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
277
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.1", type: ListComponent, isStandalone: true, selector: "ng0-list", inputs: { source: { classPropertyName: "source", publicName: "source", isSignal: true, isRequired: true, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, showIndicator: { classPropertyName: "showIndicator", publicName: "showIndicator", isSignal: true, isRequired: false, transformFunction: null }, compareBy: { classPropertyName: "compareBy", publicName: "compareBy", isSignal: true, isRequired: false, transformFunction: null }, formatBy: { classPropertyName: "formatBy", publicName: "formatBy", isSignal: true, isRequired: false, transformFunction: null }, writeValueBy: { classPropertyName: "writeValueBy", publicName: "writeValueBy", isSignal: true, isRequired: false, transformFunction: null }, filterBy: { classPropertyName: "filterBy", publicName: "filterBy", isSignal: true, isRequired: false, transformFunction: null }, itemClass: { classPropertyName: "itemClass", publicName: "itemClass", isSignal: true, isRequired: false, transformFunction: null }, focus: { classPropertyName: "focus", publicName: "focus", isSignal: true, isRequired: false, transformFunction: null }, idGenerator: { classPropertyName: "idGenerator", publicName: "idGenerator", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "keydown": "_onKeydown($event)" }, properties: { "class.ng0-list-loading": "source().isLoading()", "attr.aria-activedescendant": "_activeOptionIndex() > -1 ? (_items()[_activeOptionIndex()].id) : undefined", "attr.disabled": "_isDisabled()", "attr.tabindex": "_isDisabled() || focus() === \"none\" ? \"-1\" : \"0\"", "attr.aria-disabled": "_isDisabled()" } }, providers: [{
|
|
278
|
+
provide: NG_VALUE_ACCESSOR,
|
|
279
|
+
useExisting: forwardRef(() => ListComponent),
|
|
280
|
+
multi: true
|
|
281
|
+
}], queries: [{ propertyName: "_itemTemplate", first: true, predicate: TemplateRef, descendants: true }], exportAs: ["ng0List"], ngImport: i0, template: "@for (i of _items(); track $index) {\r\n@if(!i.filtered) {\r\n<div class=\"ng0-list-item\"\r\n [ngClass]=\"itemClass()(i)\"\r\n [attr.id]=\"i.id\"\r\n [class.ng0-list-item-active]=\"$index == _activeOptionIndex()\"\r\n [class.ng0-list-item-selected]=\"i.selected\"\r\n (click)=\"toggleSelection($index);\">\r\n\r\n @if(_itemTemplate) {\r\n <ng-container *ngTemplateOutlet=\"_itemTemplate; context: { $implicit: i}\" />\r\n } @else {\r\n\r\n @if(showIndicator()) {\r\n <input class=\"form-check-input ng0-list-item-indicator\"\r\n [checked]=\"i.selected\"\r\n [attr.type]=\"multiple() ? 'checkbox' : 'radio'\"\r\n [attr.name]=\"i.id\"\r\n [attr.id]=\"i.id\">\r\n }\r\n\r\n {{formatBy()(i.value)}}\r\n\r\n }\r\n</div>\r\n}\r\n}", styles: [":host{display:block;overflow-y:auto;overflow-x:hidden;-webkit-user-select:none;user-select:none}:host.disabled{background-color:var(--bs-secondary-bg)}.ng0-list-item{display:flex;padding-inline-start:.5rem}.ng0-list-item .ng0-list-item-indicator{margin-inline-end:.5rem}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: OverlayModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
282
|
+
}
|
|
283
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: ListComponent, decorators: [{
|
|
284
|
+
type: Component,
|
|
285
|
+
args: [{ selector: 'ng0-list', exportAs: 'ng0List', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
286
|
+
CommonModule,
|
|
287
|
+
OverlayModule,
|
|
288
|
+
], providers: [{
|
|
289
|
+
provide: NG_VALUE_ACCESSOR,
|
|
290
|
+
useExisting: forwardRef(() => ListComponent),
|
|
291
|
+
multi: true
|
|
292
|
+
}], host: {
|
|
293
|
+
'[class.ng0-list-loading]': 'source().isLoading()',
|
|
294
|
+
'[attr.aria-activedescendant]': '_activeOptionIndex() > -1 ? (_items()[_activeOptionIndex()].id) : undefined',
|
|
295
|
+
'[attr.disabled]': '_isDisabled()',
|
|
296
|
+
'[attr.tabindex]': '_isDisabled() || focus() === "none" ? "-1" : "0"',
|
|
297
|
+
'[attr.aria-disabled]': '_isDisabled()'
|
|
298
|
+
}, template: "@for (i of _items(); track $index) {\r\n@if(!i.filtered) {\r\n<div class=\"ng0-list-item\"\r\n [ngClass]=\"itemClass()(i)\"\r\n [attr.id]=\"i.id\"\r\n [class.ng0-list-item-active]=\"$index == _activeOptionIndex()\"\r\n [class.ng0-list-item-selected]=\"i.selected\"\r\n (click)=\"toggleSelection($index);\">\r\n\r\n @if(_itemTemplate) {\r\n <ng-container *ngTemplateOutlet=\"_itemTemplate; context: { $implicit: i}\" />\r\n } @else {\r\n\r\n @if(showIndicator()) {\r\n <input class=\"form-check-input ng0-list-item-indicator\"\r\n [checked]=\"i.selected\"\r\n [attr.type]=\"multiple() ? 'checkbox' : 'radio'\"\r\n [attr.name]=\"i.id\"\r\n [attr.id]=\"i.id\">\r\n }\r\n\r\n {{formatBy()(i.value)}}\r\n\r\n }\r\n</div>\r\n}\r\n}", styles: [":host{display:block;overflow-y:auto;overflow-x:hidden;-webkit-user-select:none;user-select:none}:host.disabled{background-color:var(--bs-secondary-bg)}.ng0-list-item{display:flex;padding-inline-start:.5rem}.ng0-list-item .ng0-list-item-indicator{margin-inline-end:.5rem}\n"] }]
|
|
299
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.DestroyRef }], propDecorators: { _itemTemplate: [{
|
|
300
|
+
type: ContentChild,
|
|
301
|
+
args: [TemplateRef]
|
|
302
|
+
}], _onKeydown: [{
|
|
303
|
+
type: HostListener,
|
|
304
|
+
args: ['keydown', ['$event']]
|
|
305
|
+
}] } });
|
|
306
|
+
|
|
307
|
+
const Items = [ListComponent];
|
|
308
|
+
/**
|
|
309
|
+
* List module.
|
|
310
|
+
*/
|
|
311
|
+
class ListModule {
|
|
312
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: ListModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
313
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.1", ngImport: i0, type: ListModule, imports: [ListComponent], exports: [ListComponent] });
|
|
314
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: ListModule, imports: [Items] });
|
|
315
|
+
}
|
|
316
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: ListModule, decorators: [{
|
|
317
|
+
type: NgModule,
|
|
318
|
+
args: [{
|
|
319
|
+
imports: Items,
|
|
320
|
+
exports: Items
|
|
321
|
+
}]
|
|
322
|
+
}] });
|
|
323
|
+
|
|
324
|
+
// export * from './types';
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Generated bundle index. Do not edit.
|
|
328
|
+
*/
|
|
329
|
+
|
|
330
|
+
export { ListComponent, ListModule };
|
|
331
|
+
//# sourceMappingURL=bootkit-ng0-components-list.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootkit-ng0-components-list.mjs","sources":["../../../projects/ng0/components/list/list.component.ts","../../../projects/ng0/components/list/list.component.html","../../../projects/ng0/components/list/list.module.ts","../../../projects/ng0/components/list/public-api.ts","../../../projects/ng0/components/list/bootkit-ng0-components-list.ts"],"sourcesContent":["import { Component, ElementRef, Renderer2, input, OnInit, DestroyRef, signal, HostListener, inject, forwardRef, TemplateRef, ContentChild, DOCUMENT, ChangeDetectionStrategy, booleanAttribute, ChangeDetectorRef, effect } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { dataSourceAttribute, DataRequest, DataSource, DataSourceLike, ValueExtractorAttribute, defaultValueExtractor, stringFilter, FilterPredicate, FilterPredicateAttribute, BooleanValueComparerAttribute } from '@bootkit/ng0/data';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\r\nimport { OverlayModule } from '@angular/cdk/overlay';\r\nimport { _IdGenerator, CssClassLike, CssClassAttribute, IdGenerator, sequentialIdGenerator, } from '@bootkit/ng0/common';\r\nimport { ValueFormatterAttribute, defaultValueFormatter, LocalizationService } from '@bootkit/ng0/localization';\r\nimport { ListItem } from './types';\r\nimport { } from '@bootkit/ng0/data';\r\nimport { defaultBooleanValueComparer } from '@bootkit/ng0/data';\r\n\r\n/**\r\n * Select component that allows users to choose an option from a dropdown list.\r\n */\r\n@Component({\r\n selector: 'ng0-list',\r\n exportAs: 'ng0List',\r\n templateUrl: './list.component.html',\r\n styleUrl: './list.component.scss',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [\r\n CommonModule,\r\n OverlayModule,\r\n ],\r\n providers: [{\r\n provide: NG_VALUE_ACCESSOR,\r\n useExisting: forwardRef(() => ListComponent),\r\n multi: true\r\n }],\r\n host: {\r\n '[class.ng0-list-loading]': 'source().isLoading()',\r\n '[attr.aria-activedescendant]': '_activeOptionIndex() > -1 ? (_items()[_activeOptionIndex()].id) : undefined',\r\n '[attr.disabled]': '_isDisabled()',\r\n '[attr.tabindex]': '_isDisabled() || focus() === \"none\" ? \"-1\" : \"0\"',\r\n '[attr.aria-disabled]': '_isDisabled()'\r\n }\r\n})\r\nexport class ListComponent implements OnInit, ControlValueAccessor {\r\n private _document = inject(DOCUMENT);\r\n private _ls = inject(LocalizationService);\r\n private _changeDetector = inject(ChangeDetectorRef);\r\n protected _value = signal<any>(undefined);\r\n private _onChangeCallback!: (value: any) => void;\r\n private _onTouchedCallback!: (value: any) => void;\r\n\r\n protected readonly _items = signal<ListItem[]>([]);\r\n protected readonly _isDisabled = signal<boolean>(false);\r\n protected readonly _activeOptionIndex = signal<number>(-1);\r\n @ContentChild(TemplateRef) protected _itemTemplate?: TemplateRef<any>;\r\n\r\n /**\r\n * The data source for the select component.\r\n * This can be an array of data, a function that returns an observable of data,\r\n * or an instance of DataSource.\r\n */\r\n public readonly source = input.required<DataSource<any>, DataSourceLike<any>>({\r\n transform: v => dataSourceAttribute(v)\r\n });\r\n\r\n /** \r\n * Indicates whether multi selection is enabled or not.\r\n */\r\n public readonly multiple = input(false, {\r\n transform: booleanAttribute\r\n });\r\n\r\n /**\r\n * Indicates whether to show selection indicator (checkbox/radio) next to each item.\r\n * Default is false.\r\n */\r\n public readonly showIndicator = input(false, {\r\n transform: booleanAttribute\r\n });\r\n\r\n /**\r\n * A custom comparer function or the name of a field for comparing two objects.\r\n */\r\n public readonly compareBy = input(defaultBooleanValueComparer, {\r\n transform: BooleanValueComparerAttribute\r\n });\r\n\r\n /**\r\n * Custom format function to convert an item to a string for display.\r\n * Default converts the item to a string using its toString method.\r\n */\r\n public readonly formatBy = input(defaultValueFormatter, {\r\n transform: ValueFormatterAttribute(this._ls.get())\r\n });\r\n\r\n /**\r\n * Custom value extractor function to extract the value of any object while writing values.\r\n */\r\n public readonly writeValueBy = input(defaultValueExtractor, {\r\n transform: ValueExtractorAttribute\r\n });\r\n\r\n /**\r\n * A custom filter predicate function to filter items based on a search string.\r\n * Default checks if the item's string representation contains the filter string (case-insensitive).\r\n * The filter predicate can be a function or a string representing the property name to filter.\r\n */\r\n public readonly filterBy = input(stringFilter, {\r\n transform: FilterPredicateAttribute\r\n });\r\n\r\n\r\n /**\r\n * CSS class or classes to apply to the list container.\r\n * Default is undefined.\r\n */\r\n public readonly itemClass = input((item) => undefined, {\r\n transform: CssClassAttribute\r\n });\r\n\r\n public readonly focus = input<'none' | 'roving' | 'activeDescendant'>('activeDescendant');\r\n\r\n public readonly idGenerator = input<IdGenerator | undefined>(sequentialIdGenerator('ng0-list-item-'));\r\n\r\n constructor(protected _el: ElementRef<HTMLDivElement>, private _renderer: Renderer2, private _destroyRef: DestroyRef) {\r\n }\r\n\r\n ngOnInit(): void {\r\n this._loadItems();\r\n this._listenToDataSourceChanges();\r\n }\r\n\r\n /**\r\n * Sets an option as active\r\n */\r\n public active(index: number): void {\r\n if (index < 0) {\r\n throw Error();\r\n }\r\n\r\n this._activeOptionIndex.set(index);\r\n // this.scrollItemIntoView(this._activeOptionIndex(), 'nearest');\r\n }\r\n\r\n /**\r\n * Filters the list items based on the provided criteria.\r\n * @param params The filter parameters to apply.\r\n * @returns void\r\n */\r\n public filter(...params: any[]): void {\r\n let filterBy = this.filterBy();\r\n this._items().forEach(x => x.filtered = !filterBy(x.value, ...params));\r\n this._changeDetector.markForCheck();\r\n }\r\n\r\n /**\r\n * Clears any applied filters and shows all items in the list.\r\n * @returns void\r\n */\r\n public clearFilter(): void {\r\n this._items().forEach(x => x.filtered = false);\r\n }\r\n\r\n /**\r\n * Scrolls the item at the specified index into view within the dropdown list.\r\n * @param index The index of the item to scroll into view.\r\n * @param position The vertical alignment of the item after scrolling.\r\n * Can be 'start', 'center', 'end', or 'nearest'.\r\n * Default is 'nearest'.\r\n * @param behavior The scrolling behavior.\r\n */\r\n public scrollItemIntoView(index: number, position?: ScrollLogicalPosition, behavior?: ScrollBehavior) {\r\n let item = this._items()[index];\r\n let elm = this._document.getElementById(item.id) as HTMLUListElement;\r\n elm!.scrollIntoView({ block: position, behavior: behavior });\r\n }\r\n\r\n /**\r\n * Toggles the selection of an option by index\r\n */\r\n public toggleSelection(index: number) {\r\n let optionsCount = this._items().length;\r\n if (optionsCount == 0 || index < 0 || index > optionsCount - 1) {\r\n throw new Error('Index out of range');\r\n }\r\n\r\n let item = this._items()[index];\r\n let writeValueBy = this.writeValueBy();\r\n\r\n if (this.multiple()) {\r\n item.selected = !item.selected;\r\n let selectedValues = this._items().filter(x => x.selected).map(x => (x.value));\r\n this._value.set(selectedValues);\r\n } else {\r\n if (item.selected) {\r\n return;\r\n }\r\n let itemValue = writeValueBy(item.value);\r\n this._items().forEach(x => x.selected = false);\r\n item.selected = true;\r\n this._value.set(itemValue);\r\n }\r\n\r\n this._onChangeCallback(this._value());\r\n }\r\n\r\n writeValue(v: any): void {\r\n let value;\r\n\r\n if (this.multiple()) {\r\n if (Array.isArray(v)) {\r\n value = v;\r\n } else if (v === null || v === undefined) {\r\n value = [];\r\n } else {\r\n throw Error('Provide an array or null as the value ng0-list component');\r\n }\r\n } else {\r\n value = v;\r\n }\r\n\r\n this._value.set(value);\r\n\r\n // Update selection state of items\r\n let compareBy = this.compareBy();\r\n if (this.multiple()) {\r\n this._items().forEach(x => x.selected = (value as any[]).some(y => compareBy(x.value, y)));\r\n } else {\r\n this._items().forEach(x => x.selected = compareBy(x.value, value));\r\n }\r\n }\r\n\r\n registerOnChange(fn: any): void {\r\n this._onChangeCallback = fn;\r\n }\r\n\r\n registerOnTouched(fn: any): void {\r\n this._onTouchedCallback = fn;\r\n }\r\n\r\n setDisabledState?(isDisabled: boolean): void {\r\n this._isDisabled.set(isDisabled);\r\n }\r\n\r\n @HostListener('keydown', ['$event'])\r\n protected _onKeydown(e: KeyboardEvent, firedByFilter: boolean = false) {\r\n if (this._isDisabled())\r\n return;\r\n\r\n let optionsCount = this._items().length;\r\n if (optionsCount == 0) {\r\n return;\r\n }\r\n\r\n switch (e.key) {\r\n case 'ArrowDown':\r\n if (this._activeOptionIndex() < optionsCount - 1) {\r\n this.active(this._activeOptionIndex() + 1);\r\n }\r\n e.preventDefault();\r\n break;\r\n\r\n case 'ArrowUp':\r\n if (this._activeOptionIndex() > 0) {\r\n this.active(this._activeOptionIndex()! - 1);\r\n }\r\n e.preventDefault();\r\n break;\r\n\r\n case 'Enter':\r\n this.toggleSelection(this._activeOptionIndex());\r\n e.preventDefault();\r\n break;\r\n\r\n case 'Home':\r\n this.active(0);\r\n e.preventDefault();\r\n break;\r\n\r\n case 'End':\r\n this.active(optionsCount - 1);\r\n e.preventDefault();\r\n break;\r\n }\r\n }\r\n\r\n private _loadItems() {\r\n var r = new DataRequest();\r\n this.source().load(r).pipe(takeUntilDestroyed(this._destroyRef)).subscribe(res => {\r\n this._insertItems(0, ...res.data);\r\n });\r\n }\r\n\r\n private _listenToDataSourceChanges() {\r\n this.source().change.subscribe(e => {\r\n let options = this._items();\r\n e.changes.forEach(change => {\r\n switch (change.type) {\r\n case 'insert':\r\n this._insertItems(change.index!, ...change.items);\r\n break;\r\n case 'replace':\r\n options[change.index].value = change.value;\r\n break;\r\n case 'remove':\r\n options.splice(change.index, change.count);\r\n }\r\n });\r\n\r\n // this._changeDetector.markForCheck();\r\n });\r\n }\r\n\r\n private _insertItems(index?: number, ...items: any[]) {\r\n // let filter = this.filterBy()()\r\n let idGenerator = this.idGenerator()\r\n let compareBy = this.compareBy();\r\n let value = this._value();\r\n let isItemSelected = this.multiple() && Array.isArray(value) ?\r\n (item: any) => (value as any[]).some(x => compareBy(x.value, item)) :\r\n (item: any) => compareBy(value, item);\r\n\r\n var options = items.map(x => ({\r\n id: idGenerator ? idGenerator(x) : undefined,\r\n value: x,\r\n selected: isItemSelected(x),\r\n filtered: false,\r\n }) as ListItem)\r\n\r\n if (Number.isInteger(index)) {\r\n this._items().splice(index!, 0, ...options);\r\n } else {\r\n this._items().push(...options);\r\n }\r\n\r\n this._changeDetector.markForCheck();\r\n }\r\n}\r\n","@for (i of _items(); track $index) {\r\n@if(!i.filtered) {\r\n<div class=\"ng0-list-item\"\r\n [ngClass]=\"itemClass()(i)\"\r\n [attr.id]=\"i.id\"\r\n [class.ng0-list-item-active]=\"$index == _activeOptionIndex()\"\r\n [class.ng0-list-item-selected]=\"i.selected\"\r\n (click)=\"toggleSelection($index);\">\r\n\r\n @if(_itemTemplate) {\r\n <ng-container *ngTemplateOutlet=\"_itemTemplate; context: { $implicit: i}\" />\r\n } @else {\r\n\r\n @if(showIndicator()) {\r\n <input class=\"form-check-input ng0-list-item-indicator\"\r\n [checked]=\"i.selected\"\r\n [attr.type]=\"multiple() ? 'checkbox' : 'radio'\"\r\n [attr.name]=\"i.id\"\r\n [attr.id]=\"i.id\">\r\n }\r\n\r\n {{formatBy()(i.value)}}\r\n\r\n }\r\n</div>\r\n}\r\n}","import { NgModule } from '@angular/core';\r\nimport { ListComponent } from './list.component';\r\n\r\nconst Items = [ListComponent]\r\n\r\n/**\r\n * List module.\r\n */\r\n@NgModule({\r\n imports: Items,\r\n exports: Items\r\n})\r\nexport class ListModule { }\r\n","// export * from './types';\r\nexport * from './list.component';\r\nexport * from './list.module';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;AAYA;;AAEG;MAyBU,aAAa,CAAA;AAiF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
|
6
6
|
/**
|
|
7
7
|
* Is modal scrollable?
|
|
8
8
|
*/
|
|
9
|
-
scrollable = input(false);
|
|
9
|
+
scrollable = input(false, ...(ngDevMode ? [{ debugName: "scrollable" }] : []));
|
|
10
10
|
/** Is modal vertically centered? */
|
|
11
|
-
centered = input(false);
|
|
11
|
+
centered = input(false, ...(ngDevMode ? [{ debugName: "centered" }] : []));
|
|
12
12
|
/**
|
|
13
13
|
* Size of the modal.
|
|
14
14
|
*/
|
|
15
|
-
size = input('default');
|
|
15
|
+
size = input('default', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
16
16
|
/**
|
|
17
17
|
* Is modal fullscreen?
|
|
18
18
|
*/
|
|
19
|
-
fullscreen = input();
|
|
19
|
+
fullscreen = input(...(ngDevMode ? [undefined, { debugName: "fullscreen" }] : []));
|
|
20
20
|
/**
|
|
21
21
|
* Emitted when user clicks the backdrop or presses the escape key.
|
|
22
22
|
*/
|
|
@@ -25,7 +25,7 @@ class ModalComponent {
|
|
|
25
25
|
* Emitted when the backdrop is clicked.
|
|
26
26
|
*/
|
|
27
27
|
backdropClick = new EventEmitter();
|
|
28
|
-
_modalStatic = signal(false);
|
|
28
|
+
_modalStatic = signal(false, ...(ngDevMode ? [{ debugName: "_modalStatic" }] : []));
|
|
29
29
|
constructor() {
|
|
30
30
|
}
|
|
31
31
|
_onBackdropClick(event) {
|
|
@@ -43,14 +43,14 @@ class ModalComponent {
|
|
|
43
43
|
this._modalStatic.set(true);
|
|
44
44
|
setTimeout(() => this._modalStatic.set(false), 100);
|
|
45
45
|
}
|
|
46
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
47
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.
|
|
46
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: ModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
47
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.1", type: ModalComponent, isStandalone: true, selector: "ng0-modal", inputs: { scrollable: { classPropertyName: "scrollable", publicName: "scrollable", isSignal: true, isRequired: false, transformFunction: null }, centered: { classPropertyName: "centered", publicName: "centered", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, fullscreen: { classPropertyName: "fullscreen", publicName: "fullscreen", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closeRequest: "closeRequest", backdropClick: "backdropClick" }, host: { listeners: { "document:keydown": "_onDocumentKeyDown($event)" } }, exportAs: ["ng0Modal"], ngImport: i0, template: "@let fullscreenValue=fullscreen();\r\n@let sizeValue=size();\r\n\r\n<div class=\"modal d-block\"\r\n (click)=\"$event.target == $event.currentTarget ? _onBackdropClick($event): ''\"\r\n [class.modal-static]=\"_modalStatic()\">\r\n\r\n <div class=\"modal-dialog\"\r\n [class]=\"{\r\n 'modal-dialog-scrollable': scrollable(),\r\n 'modal-dialog-centered': centered(),\r\n 'modal-fullscreen': fullscreenValue == 'always',\r\n 'modal-fullscreen-sm-down': fullscreenValue == 'sm',\r\n 'modal-fullscreen-md-down': fullscreenValue == 'md',\r\n 'modal-fullscreen-lg-down': fullscreenValue == 'lg',\r\n 'modal-fullscreen-xl-down': fullscreenValue == 'xl',\r\n 'modal-fullscreen-xxl-down': fullscreenValue == 'xxl',\r\n 'modal-sm': sizeValue == 'sm',\r\n 'modal-lg': sizeValue == 'lg',\r\n 'modal-xl': sizeValue == 'xl',\r\n }\">\r\n <div class=\"modal-content\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n</div>\r\n<div class=\"modal-backdrop fade show\"></div>", dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
48
48
|
}
|
|
49
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
49
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: ModalComponent, decorators: [{
|
|
50
50
|
type: Component,
|
|
51
51
|
args: [{ selector: 'ng0-modal', exportAs: 'ng0Modal', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
52
52
|
CommonModule,
|
|
53
|
-
], template: "@let fullscreenValue=fullscreen();\n@let sizeValue=size();\n\n<div class=\"modal d-block\"\n (click)=\"$event.target == $event.currentTarget ? _onBackdropClick($event): ''\"\n [class.modal-static]=\"_modalStatic()\">\n\n <div class=\"modal-dialog\"\n [class]=\"{\n 'modal-dialog-scrollable': scrollable(),\n 'modal-dialog-centered': centered(),\n 'modal-fullscreen': fullscreenValue == 'always',\n 'modal-fullscreen-sm-down': fullscreenValue == 'sm',\n 'modal-fullscreen-md-down': fullscreenValue == 'md',\n 'modal-fullscreen-lg-down': fullscreenValue == 'lg',\n 'modal-fullscreen-xl-down': fullscreenValue == 'xl',\n 'modal-fullscreen-xxl-down': fullscreenValue == 'xxl',\n 'modal-sm': sizeValue == 'sm',\n 'modal-lg': sizeValue == 'lg',\n 'modal-xl': sizeValue == 'xl',\n }\">\n <div class=\"modal-content\">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\n<div class=\"modal-backdrop fade show\"></div>" }]
|
|
53
|
+
], template: "@let fullscreenValue=fullscreen();\r\n@let sizeValue=size();\r\n\r\n<div class=\"modal d-block\"\r\n (click)=\"$event.target == $event.currentTarget ? _onBackdropClick($event): ''\"\r\n [class.modal-static]=\"_modalStatic()\">\r\n\r\n <div class=\"modal-dialog\"\r\n [class]=\"{\r\n 'modal-dialog-scrollable': scrollable(),\r\n 'modal-dialog-centered': centered(),\r\n 'modal-fullscreen': fullscreenValue == 'always',\r\n 'modal-fullscreen-sm-down': fullscreenValue == 'sm',\r\n 'modal-fullscreen-md-down': fullscreenValue == 'md',\r\n 'modal-fullscreen-lg-down': fullscreenValue == 'lg',\r\n 'modal-fullscreen-xl-down': fullscreenValue == 'xl',\r\n 'modal-fullscreen-xxl-down': fullscreenValue == 'xxl',\r\n 'modal-sm': sizeValue == 'sm',\r\n 'modal-lg': sizeValue == 'lg',\r\n 'modal-xl': sizeValue == 'xl',\r\n }\">\r\n <div class=\"modal-content\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n</div>\r\n<div class=\"modal-backdrop fade show\"></div>" }]
|
|
54
54
|
}], ctorParameters: () => [], propDecorators: { closeRequest: [{
|
|
55
55
|
type: Output
|
|
56
56
|
}], backdropClick: [{
|
|
@@ -61,11 +61,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
61
61
|
}] } });
|
|
62
62
|
|
|
63
63
|
class ModalModule {
|
|
64
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
65
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.
|
|
66
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.
|
|
64
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: ModalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
65
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.1", ngImport: i0, type: ModalModule, imports: [ModalComponent], exports: [ModalComponent] });
|
|
66
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: ModalModule, imports: [ModalComponent] });
|
|
67
67
|
}
|
|
68
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
68
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: ModalModule, decorators: [{
|
|
69
69
|
type: NgModule,
|
|
70
70
|
args: [{
|
|
71
71
|
imports: [
|