@bootkit/ng0 0.0.0-alpha.1 → 0.0.0-alpha.11
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/common/index.d.ts +82 -3
- package/components/accordion/index.d.ts +32 -0
- package/components/backdrop/index.d.ts +8 -0
- package/components/button/index.d.ts +48 -0
- package/components/card/index.d.ts +27 -0
- package/components/code/index.d.ts +35 -0
- package/components/collapse/index.d.ts +59 -0
- package/components/confirmation/index.d.ts +66 -0
- package/components/form-field/index.d.ts +72 -0
- package/components/modal/index.d.ts +29 -0
- package/components/nav/index.d.ts +68 -0
- package/{offcanvas/offcanvas.directive.d.ts → components/offcanvas/index.d.ts} +14 -5
- package/components/overlay/index.d.ts +40 -0
- package/components/pagination/index.d.ts +56 -0
- package/components/popover/index.d.ts +36 -0
- package/components/sidenav/index.d.ts +46 -0
- package/components/stepper/index.d.ts +26 -0
- package/components/table/index.d.ts +211 -0
- package/components/toast/index.d.ts +101 -0
- package/components/tooltip/index.d.ts +30 -0
- package/components/vertical-menu/index.d.ts +61 -0
- package/data/index.d.ts +203 -0
- package/date/index.d.ts +34 -0
- package/fesm2022/bootkit-ng0-common.mjs +38 -3
- package/fesm2022/bootkit-ng0-common.mjs.map +1 -1
- package/fesm2022/{bootkit-ng0-accordion.mjs → bootkit-ng0-components-accordion.mjs} +16 -16
- package/fesm2022/bootkit-ng0-components-accordion.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-backdrop.mjs +41 -0
- package/fesm2022/bootkit-ng0-components-backdrop.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-button.mjs +119 -0
- package/fesm2022/bootkit-ng0-components-button.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-card.mjs +62 -0
- package/fesm2022/bootkit-ng0-components-card.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-code.mjs +70 -0
- package/fesm2022/bootkit-ng0-components-code.mjs.map +1 -0
- package/fesm2022/{bootkit-ng0-collapse.mjs → bootkit-ng0-components-collapse.mjs} +16 -16
- package/fesm2022/bootkit-ng0-components-collapse.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-confirmation.mjs +167 -0
- package/fesm2022/bootkit-ng0-components-confirmation.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-form-field.mjs +147 -0
- package/fesm2022/bootkit-ng0-components-form-field.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-modal.mjs +68 -0
- package/fesm2022/bootkit-ng0-components-modal.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-nav.mjs +165 -0
- package/fesm2022/bootkit-ng0-components-nav.mjs.map +1 -0
- package/fesm2022/{bootkit-ng0-offcanvas.mjs → bootkit-ng0-components-offcanvas.mjs} +11 -11
- package/fesm2022/bootkit-ng0-components-offcanvas.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-overlay.mjs +99 -0
- package/fesm2022/bootkit-ng0-components-overlay.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-pagination.mjs +120 -0
- package/fesm2022/bootkit-ng0-components-pagination.mjs.map +1 -0
- package/fesm2022/{bootkit-ng0-popover.mjs → bootkit-ng0-components-popover.mjs} +12 -12
- package/fesm2022/bootkit-ng0-components-popover.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-sidenav.mjs +132 -0
- package/fesm2022/bootkit-ng0-components-sidenav.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-stepper.mjs +91 -0
- package/fesm2022/bootkit-ng0-components-stepper.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-table.mjs +358 -0
- package/fesm2022/bootkit-ng0-components-table.mjs.map +1 -0
- package/fesm2022/{bootkit-ng0-toast.mjs → bootkit-ng0-components-toast.mjs} +10 -10
- package/fesm2022/bootkit-ng0-components-toast.mjs.map +1 -0
- package/fesm2022/{bootkit-ng0-tooltip.mjs → bootkit-ng0-components-tooltip.mjs} +10 -10
- package/fesm2022/bootkit-ng0-components-tooltip.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-vertical-menu.mjs +161 -0
- package/fesm2022/bootkit-ng0-components-vertical-menu.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-data.mjs +267 -0
- package/fesm2022/bootkit-ng0-data.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-date.mjs +50 -0
- package/fesm2022/bootkit-ng0-date.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-file.mjs +50 -0
- package/fesm2022/bootkit-ng0-file.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-form.mjs +420 -0
- package/fesm2022/bootkit-ng0-form.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-http.mjs +277 -0
- package/fesm2022/bootkit-ng0-http.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-localization-locales.mjs +82 -0
- package/fesm2022/bootkit-ng0-localization-locales.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-localization.mjs +419 -0
- package/fesm2022/bootkit-ng0-localization.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-platform-browser.mjs +51 -0
- package/fesm2022/bootkit-ng0-platform-browser.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-script.mjs +59 -0
- package/fesm2022/bootkit-ng0-script.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-security.mjs +132 -0
- package/fesm2022/bootkit-ng0-security.mjs.map +1 -0
- package/file/index.d.ts +22 -0
- package/form/index.d.ts +91 -0
- package/http/index.d.ts +167 -0
- package/index.d.ts +3 -5
- package/localization/index.d.ts +265 -0
- package/localization/locales/index.d.ts +7 -0
- package/package.json +123 -61
- package/platform/browser/index.d.ts +22 -0
- package/script/index.d.ts +27 -0
- package/security/index.d.ts +42 -0
- package/accordion/accordion-item.component.d.ts +0 -13
- package/accordion/accordion.component.d.ts +0 -13
- package/accordion/accordion.module.d.ts +0 -8
- package/accordion/index.d.ts +0 -5
- package/accordion/public-api.d.ts +0 -3
- package/collapse/collapse.component.d.ts +0 -18
- package/collapse/collapse.directive.d.ts +0 -32
- package/collapse/collapse.module.d.ts +0 -8
- package/collapse/index.d.ts +0 -5
- package/collapse/public-api.d.ts +0 -3
- package/common/public-api.d.ts +0 -2
- package/common/types.d.ts +0 -4
- package/common/utils.d.ts +0 -3
- package/esm2022/accordion/accordion-item.component.mjs +0 -34
- package/esm2022/accordion/accordion.component.mjs +0 -25
- package/esm2022/accordion/accordion.module.mjs +0 -25
- package/esm2022/accordion/bootkit-ng0-accordion.mjs +0 -5
- package/esm2022/accordion/public-api.mjs +0 -4
- package/esm2022/bootkit-ng0.mjs +0 -5
- package/esm2022/collapse/bootkit-ng0-collapse.mjs +0 -5
- package/esm2022/collapse/collapse.component.mjs +0 -46
- package/esm2022/collapse/collapse.directive.mjs +0 -94
- package/esm2022/collapse/collapse.module.mjs +0 -23
- package/esm2022/collapse/public-api.mjs +0 -4
- package/esm2022/common/bootkit-ng0-common.mjs +0 -5
- package/esm2022/common/public-api.mjs +0 -3
- package/esm2022/common/types.mjs +0 -3
- package/esm2022/common/utils.mjs +0 -16
- package/esm2022/lib/index.mjs +0 -3
- package/esm2022/lib/types.mjs +0 -2
- package/esm2022/modal/bootkit-ng0-modal.mjs +0 -5
- package/esm2022/modal/modal.component.mjs +0 -44
- package/esm2022/modal/modal.module.mjs +0 -20
- package/esm2022/modal/public-api.mjs +0 -3
- package/esm2022/modal/types.mjs +0 -3
- package/esm2022/nav/bootkit-ng0-nav.mjs +0 -5
- package/esm2022/nav/nav-item.directive.mjs +0 -26
- package/esm2022/nav/nav-link.directive.mjs +0 -45
- package/esm2022/nav/nav.directive.mjs +0 -23
- package/esm2022/nav/nav.module.mjs +0 -35
- package/esm2022/nav/public-api.mjs +0 -7
- package/esm2022/nav/tab-content.component.mjs +0 -29
- package/esm2022/nav/tab-pane.directive.mjs +0 -20
- package/esm2022/offcanvas/bootkit-ng0-offcanvas.mjs +0 -5
- package/esm2022/offcanvas/offcanvas.directive.mjs +0 -118
- package/esm2022/offcanvas/offcanvas.module.mjs +0 -19
- package/esm2022/offcanvas/public-api.mjs +0 -3
- package/esm2022/overlay/bootkit-ng0-overlay.mjs +0 -5
- package/esm2022/overlay/overlay.directive.mjs +0 -111
- package/esm2022/overlay/overlay.module.mjs +0 -22
- package/esm2022/overlay/private/utils.mjs +0 -58
- package/esm2022/overlay/public-api.mjs +0 -3
- package/esm2022/popover/bootkit-ng0-popover.mjs +0 -5
- package/esm2022/popover/popover-wrapper/popover-wrapper.component.mjs +0 -29
- package/esm2022/popover/popover.directive.mjs +0 -140
- package/esm2022/popover/public-api.mjs +0 -2
- package/esm2022/popover/types.mjs +0 -2
- package/esm2022/public-api.mjs +0 -5
- package/esm2022/toast/bootkit-ng0-toast.mjs +0 -5
- package/esm2022/toast/public-api.mjs +0 -4
- package/esm2022/toast/toast-ref.mjs +0 -27
- package/esm2022/toast/toast.component.mjs +0 -68
- package/esm2022/toast/toast.service.mjs +0 -93
- package/esm2022/toast/types.mjs +0 -2
- package/esm2022/tooltip/bootkit-ng0-tooltip.mjs +0 -5
- package/esm2022/tooltip/public-api.mjs +0 -3
- package/esm2022/tooltip/tooltip-wrapper/tooltip-wrapper.component.mjs +0 -44
- package/esm2022/tooltip/tooltip.directive.mjs +0 -93
- package/esm2022/tooltip/types.mjs +0 -2
- package/fesm2022/bootkit-ng0-accordion.mjs.map +0 -1
- package/fesm2022/bootkit-ng0-collapse.mjs.map +0 -1
- package/fesm2022/bootkit-ng0-modal.mjs +0 -68
- package/fesm2022/bootkit-ng0-modal.mjs.map +0 -1
- package/fesm2022/bootkit-ng0-nav.mjs +0 -166
- package/fesm2022/bootkit-ng0-nav.mjs.map +0 -1
- package/fesm2022/bootkit-ng0-offcanvas.mjs.map +0 -1
- package/fesm2022/bootkit-ng0-overlay.mjs +0 -194
- package/fesm2022/bootkit-ng0-overlay.mjs.map +0 -1
- package/fesm2022/bootkit-ng0-popover.mjs.map +0 -1
- package/fesm2022/bootkit-ng0-toast.mjs.map +0 -1
- package/fesm2022/bootkit-ng0-tooltip.mjs.map +0 -1
- package/lib/index.d.ts +0 -2
- package/lib/types.d.ts +0 -1
- package/modal/index.d.ts +0 -5
- package/modal/modal.component.d.ts +0 -18
- package/modal/modal.module.d.ts +0 -7
- package/modal/public-api.d.ts +0 -2
- package/modal/types.d.ts +0 -2
- package/nav/index.d.ts +0 -5
- package/nav/nav-item.directive.d.ts +0 -13
- package/nav/nav-link.directive.d.ts +0 -16
- package/nav/nav.directive.d.ts +0 -11
- package/nav/nav.module.d.ts +0 -11
- package/nav/public-api.d.ts +0 -6
- package/nav/tab-content.component.d.ts +0 -15
- package/nav/tab-pane.directive.d.ts +0 -9
- package/offcanvas/index.d.ts +0 -5
- package/offcanvas/offcanvas.module.d.ts +0 -7
- package/offcanvas/public-api.d.ts +0 -2
- package/overlay/index.d.ts +0 -5
- package/overlay/overlay.directive.d.ts +0 -50
- package/overlay/overlay.module.d.ts +0 -10
- package/overlay/private/utils.d.ts +0 -10
- package/overlay/public-api.d.ts +0 -2
- package/popover/index.d.ts +0 -5
- package/popover/popover-wrapper/popover-wrapper.component.d.ts +0 -15
- package/popover/popover.directive.d.ts +0 -30
- package/popover/public-api.d.ts +0 -1
- package/popover/types.d.ts +0 -4
- package/public-api.d.ts +0 -1
- package/toast/index.d.ts +0 -5
- package/toast/public-api.d.ts +0 -3
- package/toast/toast-ref.d.ts +0 -12
- package/toast/toast.component.d.ts +0 -19
- package/toast/toast.service.d.ts +0 -43
- package/toast/types.d.ts +0 -44
- package/tooltip/index.d.ts +0 -5
- package/tooltip/public-api.d.ts +0 -2
- package/tooltip/tooltip-wrapper/tooltip-wrapper.component.d.ts +0 -19
- package/tooltip/tooltip.directive.d.ts +0 -24
- package/tooltip/types.d.ts +0 -3
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import * as i3 from '@angular/common';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { input, ElementRef, ContentChild, HostListener, HostBinding, Optional, Component, NgModule } from '@angular/core';
|
|
5
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
|
+
import * as i1 from '@angular/forms';
|
|
7
|
+
import { FormControl, NgControl } from '@angular/forms';
|
|
8
|
+
import * as i2 from '@bootkit/ng0/localization';
|
|
9
|
+
|
|
10
|
+
class FormFieldComponent {
|
|
11
|
+
_renderer;
|
|
12
|
+
_destroyRef;
|
|
13
|
+
_form;
|
|
14
|
+
_ls;
|
|
15
|
+
/**
|
|
16
|
+
* The label text for the form field.
|
|
17
|
+
*/
|
|
18
|
+
label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
|
|
19
|
+
/**
|
|
20
|
+
* The hint text to display below the form field.
|
|
21
|
+
* This is typically used to provide additional information or instructions to the user.
|
|
22
|
+
*/
|
|
23
|
+
hint = input(...(ngDevMode ? [undefined, { debugName: "hint" }] : []));
|
|
24
|
+
/**
|
|
25
|
+
* If true, the form-field will show validation errors.
|
|
26
|
+
* This is useful for displaying validation messages when the form control is invalid.
|
|
27
|
+
*/
|
|
28
|
+
showErrors = input(true, ...(ngDevMode ? [{ debugName: "showErrors" }] : []));
|
|
29
|
+
/**
|
|
30
|
+
* If true, the form-field will show a red asterisk for required fields.
|
|
31
|
+
* This is only a visual indicator and does not enforce validation.
|
|
32
|
+
*/
|
|
33
|
+
showRequiredIndicator = input(true, ...(ngDevMode ? [{ debugName: "showRequiredIndicator" }] : []));
|
|
34
|
+
/**
|
|
35
|
+
* If true, the form-field will show subscripts (e.g. hints, errors) for the field label.
|
|
36
|
+
* This is useful for displaying additional information or validation messages.
|
|
37
|
+
*/
|
|
38
|
+
showSubscripts = input(true, ...(ngDevMode ? [{ debugName: "showSubscripts" }] : []));
|
|
39
|
+
/**
|
|
40
|
+
* If true, the form-field will be rendered inside a ".input-group" element.
|
|
41
|
+
*/
|
|
42
|
+
inputGroup = input(true, ...(ngDevMode ? [{ debugName: "inputGroup" }] : []));
|
|
43
|
+
/**
|
|
44
|
+
* Returns the first localized error of the control
|
|
45
|
+
*/
|
|
46
|
+
get errorText() { return this._errorText; }
|
|
47
|
+
/** Reports whether the control is touched. */
|
|
48
|
+
get touched() { return this._ngControl?.touched; }
|
|
49
|
+
/** Reports whether the control is dirty. */
|
|
50
|
+
get dirty() { return this._ngControl?.dirty; }
|
|
51
|
+
/** Returns true if this form-field is required, otherwise returns false. */
|
|
52
|
+
get isRequired() { return this._isRequired; }
|
|
53
|
+
_onFocusOut() { this._validate(); }
|
|
54
|
+
_ngControl;
|
|
55
|
+
_ngControlElement;
|
|
56
|
+
_isRequired = false;
|
|
57
|
+
_locale;
|
|
58
|
+
_errorText;
|
|
59
|
+
constructor(_renderer, _destroyRef, _form, _ls) {
|
|
60
|
+
this._renderer = _renderer;
|
|
61
|
+
this._destroyRef = _destroyRef;
|
|
62
|
+
this._form = _form;
|
|
63
|
+
this._ls = _ls;
|
|
64
|
+
this._locale = this._ls.get();
|
|
65
|
+
this._ls.change.pipe(takeUntilDestroyed()).subscribe(e => this._locale = e.new);
|
|
66
|
+
}
|
|
67
|
+
ngOnInit() {
|
|
68
|
+
}
|
|
69
|
+
ngAfterContentInit() {
|
|
70
|
+
this._isRequired = this._isRequiredField();
|
|
71
|
+
if (this._ngControl) {
|
|
72
|
+
this._ngControl?.statusChanges?.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(change => {
|
|
73
|
+
this._validate();
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
_validate() {
|
|
78
|
+
if (!this._ngControl || !this.dirty || !this.touched) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const invalid = this._ngControl.status === 'INVALID';
|
|
82
|
+
if (invalid) {
|
|
83
|
+
this._errorText = this._locale?.translateFirstError(this._ngControl.errors, 'Invalid')?.text;
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
this._errorText = undefined;
|
|
87
|
+
}
|
|
88
|
+
this._renderer.addClass(this._ngControlElement.nativeElement, invalid ? 'is-invalid' : 'is-valid');
|
|
89
|
+
this._renderer.removeClass(this._ngControlElement.nativeElement, invalid ? 'is-valid' : 'is-invalid');
|
|
90
|
+
}
|
|
91
|
+
_isRequiredField() {
|
|
92
|
+
const validator = this._ngControl?.validator;
|
|
93
|
+
const errors = validator && validator(new FormControl(null));
|
|
94
|
+
return errors != null && errors['required'] === true;
|
|
95
|
+
}
|
|
96
|
+
ngOnDestroy() {
|
|
97
|
+
}
|
|
98
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.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.1.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()) {\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 }@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
|
+
}
|
|
101
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: FormFieldComponent, decorators: [{
|
|
102
|
+
type: Component,
|
|
103
|
+
args: [{ selector: 'ng0-form-field, ng0-field', exportAs: 'ng0FormField', standalone: true, imports: [
|
|
104
|
+
CommonModule
|
|
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 }@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
|
+
}], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.DestroyRef }, { type: i1.NgForm, decorators: [{
|
|
107
|
+
type: Optional
|
|
108
|
+
}] }, { type: i2.LocalizationService }], propDecorators: { isRequired: [{
|
|
109
|
+
type: HostBinding,
|
|
110
|
+
args: ['class.required-form-field']
|
|
111
|
+
}], _onFocusOut: [{
|
|
112
|
+
type: HostListener,
|
|
113
|
+
args: ['focusout']
|
|
114
|
+
}], _ngControl: [{
|
|
115
|
+
type: ContentChild,
|
|
116
|
+
args: [NgControl, { static: true }]
|
|
117
|
+
}], _ngControlElement: [{
|
|
118
|
+
type: ContentChild,
|
|
119
|
+
args: [NgControl, { static: true, read: ElementRef }]
|
|
120
|
+
}] } });
|
|
121
|
+
|
|
122
|
+
class FormFieldModule {
|
|
123
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: FormFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
124
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.6", ngImport: i0, type: FormFieldModule, imports: [CommonModule,
|
|
125
|
+
FormFieldComponent], exports: [FormFieldComponent] });
|
|
126
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: FormFieldModule, imports: [CommonModule,
|
|
127
|
+
FormFieldComponent] });
|
|
128
|
+
}
|
|
129
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: FormFieldModule, decorators: [{
|
|
130
|
+
type: NgModule,
|
|
131
|
+
args: [{
|
|
132
|
+
imports: [
|
|
133
|
+
CommonModule,
|
|
134
|
+
FormFieldComponent,
|
|
135
|
+
],
|
|
136
|
+
exports: [
|
|
137
|
+
FormFieldComponent,
|
|
138
|
+
]
|
|
139
|
+
}]
|
|
140
|
+
}] });
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Generated bundle index. Do not edit.
|
|
144
|
+
*/
|
|
145
|
+
|
|
146
|
+
export { FormFieldComponent, FormFieldModule };
|
|
147
|
+
//# sourceMappingURL=bootkit-ng0-components-form-field.mjs.map
|
|
@@ -0,0 +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';\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 }@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,IAAA,KAAA;AACZ,IAAA,GAAA;AAlEV;;AAEG;IACI,KAAK,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,OAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;AAE9B;;;AAGG;IACI,IAAI,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;AAE7B;;;AAGG;AACI,IAAA,UAAU,GAAG,KAAK,CAAC,IAAI,sDAAC;AAE/B;;;AAGG;AACI,IAAA,qBAAqB,GAAG,KAAK,CAAC,IAAI,iEAAC;AAE1C;;;AAGG;AACI,IAAA,cAAc,GAAG,KAAK,CAAC,IAAI,0DAAC;AAEnC;;AAEG;AACI,IAAA,UAAU,GAAG,KAAK,CAAC,IAAI,sDAAC;AAE/B;;AAEG;IACH,IAAW,SAAS,KAAK,OAAO,IAAI,CAAC,UAAU,CAAC;;IAGhD,IAAW,OAAO,GAAA,EAAiC,OAAO,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC;;IAGnF,IAAW,KAAK,GAAA,EAAiC,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,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A,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;;;;"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, EventEmitter, signal, HostListener, Output, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
|
|
5
|
+
class ModalComponent {
|
|
6
|
+
scrollable = input(false, ...(ngDevMode ? [{ debugName: "scrollable" }] : []));
|
|
7
|
+
/** Is modal vertically centered? */
|
|
8
|
+
centered = input(false, ...(ngDevMode ? [{ debugName: "centered" }] : []));
|
|
9
|
+
size = input('default', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
10
|
+
fullscreen = input(...(ngDevMode ? [undefined, { debugName: "fullscreen" }] : []));
|
|
11
|
+
closeRequest = new EventEmitter();
|
|
12
|
+
backdropClick = new EventEmitter();
|
|
13
|
+
_modalStatic = signal(false, ...(ngDevMode ? [{ debugName: "_modalStatic" }] : []));
|
|
14
|
+
constructor() {
|
|
15
|
+
}
|
|
16
|
+
_onBackdropClick() {
|
|
17
|
+
this.backdropClick.emit();
|
|
18
|
+
this._modalStatic.set(true);
|
|
19
|
+
var timeout = setTimeout(() => {
|
|
20
|
+
this._modalStatic.set(false);
|
|
21
|
+
clearTimeout(timeout);
|
|
22
|
+
}, 100);
|
|
23
|
+
}
|
|
24
|
+
onKeyDown(event) {
|
|
25
|
+
if (event.key === 'Escape') {
|
|
26
|
+
this.closeRequest.emit();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
30
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.6", 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": "onKeyDown($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(): ''\"\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 });
|
|
31
|
+
}
|
|
32
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ModalComponent, decorators: [{
|
|
33
|
+
type: Component,
|
|
34
|
+
args: [{ selector: 'ng0-modal', exportAs: 'ng0Modal', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
35
|
+
CommonModule,
|
|
36
|
+
], 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(): ''\"\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>" }]
|
|
37
|
+
}], ctorParameters: () => [], propDecorators: { closeRequest: [{
|
|
38
|
+
type: Output
|
|
39
|
+
}], backdropClick: [{
|
|
40
|
+
type: Output
|
|
41
|
+
}], onKeyDown: [{
|
|
42
|
+
type: HostListener,
|
|
43
|
+
args: ['document:keydown', ['$event']]
|
|
44
|
+
}] } });
|
|
45
|
+
|
|
46
|
+
class ModalModule {
|
|
47
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ModalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
48
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.6", ngImport: i0, type: ModalModule, imports: [ModalComponent], exports: [ModalComponent] });
|
|
49
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ModalModule, imports: [ModalComponent] });
|
|
50
|
+
}
|
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ModalModule, decorators: [{
|
|
52
|
+
type: NgModule,
|
|
53
|
+
args: [{
|
|
54
|
+
imports: [
|
|
55
|
+
ModalComponent,
|
|
56
|
+
],
|
|
57
|
+
exports: [
|
|
58
|
+
ModalComponent,
|
|
59
|
+
]
|
|
60
|
+
}]
|
|
61
|
+
}] });
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Generated bundle index. Do not edit.
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
export { ModalComponent, ModalModule };
|
|
68
|
+
//# sourceMappingURL=bootkit-ng0-components-modal.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootkit-ng0-components-modal.mjs","sources":["../../../projects/ng0/components/modal/modal.component.ts","../../../projects/ng0/components/modal/modal.component.html","../../../projects/ng0/components/modal/modal.module.ts","../../../projects/ng0/components/modal/bootkit-ng0-components-modal.ts"],"sourcesContent":["import { Component, Output, EventEmitter, ChangeDetectionStrategy, input, signal, HostListener } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { ModalCloseRequest } from './types';\r\n\r\n@Component({\r\n selector: 'ng0-modal',\r\n exportAs: 'ng0Modal',\r\n templateUrl: 'modal.component.html',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [\r\n CommonModule,\r\n ]\r\n})\r\nexport class ModalComponent {\r\n public scrollable = input<boolean>(false);\r\n\r\n /** Is modal vertically centered? */\r\n public centered = input<boolean>(false);\r\n public size = input<'sm' | 'default' | 'lg' | 'xl'>('default');\r\n public fullscreen = input<'always' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'>();\r\n @Output() public closeRequest = new EventEmitter<ModalCloseRequest>();\r\n @Output() public backdropClick = new EventEmitter();\r\n\r\n protected _modalStatic = signal(false);\r\n\r\n constructor() {\r\n }\r\n\r\n protected _onBackdropClick() {\r\n this.backdropClick.emit();\r\n this._modalStatic.set(true)\r\n var timeout = setTimeout(() => {\r\n this._modalStatic.set(false)\r\n clearTimeout(timeout);\r\n }, 100);\r\n }\r\n\r\n @HostListener('document:keydown', ['$event'])\r\n onKeyDown(event: KeyboardEvent) {\r\n if (event.key === 'Escape') {\r\n this.closeRequest.emit();\r\n }\r\n }\r\n}\r\n","@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(): ''\"\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>","import { NgModule } from '@angular/core';\r\nimport { ModalComponent } from './modal.component';\r\n\r\n@NgModule({\r\n imports: [\r\n ModalComponent,\r\n ],\r\n exports: [\r\n ModalComponent,\r\n ]\r\n})\r\nexport class ModalModule {\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAca,cAAc,CAAA;AAChB,IAAA,UAAU,GAAG,KAAK,CAAU,KAAK,sDAAC;;AAGlC,IAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,oDAAC;AAChC,IAAA,IAAI,GAAG,KAAK,CAAiC,SAAS,gDAAC;IACvD,UAAU,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,YAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAgD;AACxD,IAAA,YAAY,GAAG,IAAI,YAAY,EAAqB;AACpD,IAAA,aAAa,GAAG,IAAI,YAAY,EAAE;AAEzC,IAAA,YAAY,GAAG,MAAM,CAAC,KAAK,wDAAC;AAEtC,IAAA,WAAA,GAAA;;IAGU,gBAAgB,GAAA;AACtB,QAAA,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE;AACzB,QAAA,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC;AAC3B,QAAA,IAAI,OAAO,GAAG,UAAU,CAAC,MAAK;AAC1B,YAAA,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC;YAC5B,YAAY,CAAC,OAAO,CAAC;SACxB,EAAE,GAAG,CAAC;;AAIX,IAAA,SAAS,CAAC,KAAoB,EAAA;AAC5B,QAAA,IAAI,KAAK,CAAC,GAAG,KAAK,QAAQ,EAAE;AAC1B,YAAA,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE;;;uGA3BnB,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,C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,qBAAA,EAAA,QAAA,EAAA,6lCAAA,EAAA;wDASgB,YAAY,EAAA,CAAA;sBAA5B;gBACgB,aAAa,EAAA,CAAA;sBAA7B;gBAiBD,SAAS,EAAA,CAAA;sBADR,YAAY;uBAAC,kBAAkB,EAAE,CAAC,QAAQ,CAAC;;;ME3BnC,WAAW,CAAA;uGAAX,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;wGAAX,WAAW,EAAA,OAAA,EAAA,CANhB,cAAc,CAAA,EAAA,OAAA,EAAA,CAGd,cAAc,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,WAAW,YANhB,cAAc,CAAA,EAAA,CAAA;;2FAMT,WAAW,EAAA,UAAA,EAAA,CAAA;kBARvB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE;wBACL,cAAc;AACjB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACL,cAAc;AACjB;AACJ,iBAAA;;;ACVD;;AAEG;;;;"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { model, input, Directive, HostBinding, HostListener, computed, ContentChildren, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
|
|
6
|
+
class NavDirective {
|
|
7
|
+
/**
|
|
8
|
+
* The active item.
|
|
9
|
+
*/
|
|
10
|
+
activeItem = model(0, ...(ngDevMode ? [{ debugName: "activeItem" }] : []));
|
|
11
|
+
/**
|
|
12
|
+
* Whether the navigation is disabled.
|
|
13
|
+
*/
|
|
14
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
15
|
+
constructor() {
|
|
16
|
+
}
|
|
17
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: NavDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
18
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.6", type: NavDirective, isStandalone: true, selector: "[ng0Nav]", inputs: { activeItem: { classPropertyName: "activeItem", publicName: "activeItem", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activeItem: "activeItemChange" }, exportAs: ["ng0Nav"], ngImport: i0 });
|
|
19
|
+
}
|
|
20
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: NavDirective, decorators: [{
|
|
21
|
+
type: Directive,
|
|
22
|
+
args: [{
|
|
23
|
+
selector: '[ng0Nav]',
|
|
24
|
+
exportAs: 'ng0Nav',
|
|
25
|
+
standalone: true,
|
|
26
|
+
}]
|
|
27
|
+
}], ctorParameters: () => [] });
|
|
28
|
+
|
|
29
|
+
class NavItemDirective {
|
|
30
|
+
elementRef;
|
|
31
|
+
id = input.required(...(ngDevMode ? [{ debugName: "id", alias: 'ng0NavItem' }] : [{ alias: 'ng0NavItem' }]));
|
|
32
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
33
|
+
constructor(elementRef) {
|
|
34
|
+
this.elementRef = elementRef;
|
|
35
|
+
}
|
|
36
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: NavItemDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
37
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.6", type: NavItemDirective, isStandalone: true, selector: "[ng0NavItem]", inputs: { id: { classPropertyName: "id", publicName: "ng0NavItem", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["ng0NavItem"], ngImport: i0 });
|
|
38
|
+
}
|
|
39
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: NavItemDirective, decorators: [{
|
|
40
|
+
type: Directive,
|
|
41
|
+
args: [{
|
|
42
|
+
selector: '[ng0NavItem]',
|
|
43
|
+
exportAs: 'ng0NavItem',
|
|
44
|
+
standalone: true,
|
|
45
|
+
}]
|
|
46
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }] });
|
|
47
|
+
|
|
48
|
+
class NavLinkDirective {
|
|
49
|
+
elementRef;
|
|
50
|
+
_nav;
|
|
51
|
+
_navItem;
|
|
52
|
+
constructor(elementRef, _nav, _navItem) {
|
|
53
|
+
this.elementRef = elementRef;
|
|
54
|
+
this._nav = _nav;
|
|
55
|
+
this._navItem = _navItem;
|
|
56
|
+
}
|
|
57
|
+
_onClick() {
|
|
58
|
+
this._nav.activeItem.set(this._navItem.id());
|
|
59
|
+
}
|
|
60
|
+
get _active() {
|
|
61
|
+
return this._nav.activeItem() === this._navItem.id();
|
|
62
|
+
}
|
|
63
|
+
get _disabled() {
|
|
64
|
+
return this._nav.disabled() || this._navItem.disabled();
|
|
65
|
+
}
|
|
66
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: NavLinkDirective, deps: [{ token: i0.ElementRef }, { token: NavDirective }, { token: NavItemDirective }], target: i0.ɵɵFactoryTarget.Directive });
|
|
67
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.6", type: NavLinkDirective, isStandalone: true, selector: "[ng0NavLink]", host: { listeners: { "click": "_onClick()" }, properties: { "class.active": "this._active", "class.disabled": "this._disabled" } }, exportAs: ["ng0NavLink"], ngImport: i0 });
|
|
68
|
+
}
|
|
69
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: NavLinkDirective, decorators: [{
|
|
70
|
+
type: Directive,
|
|
71
|
+
args: [{
|
|
72
|
+
selector: '[ng0NavLink]',
|
|
73
|
+
exportAs: 'ng0NavLink',
|
|
74
|
+
standalone: true,
|
|
75
|
+
}]
|
|
76
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: NavDirective }, { type: NavItemDirective }], propDecorators: { _onClick: [{
|
|
77
|
+
type: HostListener,
|
|
78
|
+
args: ['click']
|
|
79
|
+
}], _active: [{
|
|
80
|
+
type: HostBinding,
|
|
81
|
+
args: ['class.active']
|
|
82
|
+
}], _disabled: [{
|
|
83
|
+
type: HostBinding,
|
|
84
|
+
args: ['class.disabled']
|
|
85
|
+
}] } });
|
|
86
|
+
|
|
87
|
+
class NavContentDirective {
|
|
88
|
+
templateRef;
|
|
89
|
+
id = input.required(...(ngDevMode ? [{ debugName: "id", alias: 'ng0NavContent' }] : [{ alias: 'ng0NavContent' }]));
|
|
90
|
+
constructor(templateRef) {
|
|
91
|
+
this.templateRef = templateRef;
|
|
92
|
+
}
|
|
93
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: NavContentDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
94
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.6", type: NavContentDirective, isStandalone: true, selector: "[ng0NavContent]", inputs: { id: { classPropertyName: "id", publicName: "ng0NavContent", isSignal: true, isRequired: true, transformFunction: null } }, exportAs: ["ng0NavContent"], ngImport: i0 });
|
|
95
|
+
}
|
|
96
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: NavContentDirective, decorators: [{
|
|
97
|
+
type: Directive,
|
|
98
|
+
args: [{
|
|
99
|
+
selector: '[ng0NavContent]',
|
|
100
|
+
exportAs: 'ng0NavContent',
|
|
101
|
+
standalone: true,
|
|
102
|
+
}]
|
|
103
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
|
104
|
+
|
|
105
|
+
class NavContentContainerComponent {
|
|
106
|
+
_elementRef;
|
|
107
|
+
_renderer;
|
|
108
|
+
/**
|
|
109
|
+
* The navigation directive that this content belongs to.
|
|
110
|
+
*/
|
|
111
|
+
nav = input.required(...(ngDevMode ? [{ debugName: "nav" }] : []));
|
|
112
|
+
_contents;
|
|
113
|
+
_activeItem = computed(() => this.nav().activeItem(), ...(ngDevMode ? [{ debugName: "_activeItem" }] : []));
|
|
114
|
+
constructor(_elementRef, _renderer) {
|
|
115
|
+
this._elementRef = _elementRef;
|
|
116
|
+
this._renderer = _renderer;
|
|
117
|
+
}
|
|
118
|
+
ngOnInit() {
|
|
119
|
+
this._renderer.addClass(this._elementRef.nativeElement, 'tab-content');
|
|
120
|
+
}
|
|
121
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: NavContentContainerComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
122
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: NavContentContainerComponent, isStandalone: true, selector: "ng0-navcontent-container", inputs: { nav: { classPropertyName: "nav", publicName: "nav", isSignal: true, isRequired: true, transformFunction: null } }, queries: [{ propertyName: "_contents", predicate: NavContentDirective }], exportAs: ["ng0Navcontent"], ngImport: i0, template: "@for (content of _contents; track $index) {\r\n @if(content.id() === _activeItem()) {\r\n <ng-container *ngTemplateOutlet=\"content.templateRef;\"></ng-container>\r\n }\r\n}\r\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
123
|
+
}
|
|
124
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: NavContentContainerComponent, decorators: [{
|
|
125
|
+
type: Component,
|
|
126
|
+
args: [{ selector: 'ng0-navcontent-container', exportAs: 'ng0Navcontent', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule], template: "@for (content of _contents; track $index) {\r\n @if(content.id() === _activeItem()) {\r\n <ng-container *ngTemplateOutlet=\"content.templateRef;\"></ng-container>\r\n }\r\n}\r\n", styles: [":host{display:block}\n"] }]
|
|
127
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { _contents: [{
|
|
128
|
+
type: ContentChildren,
|
|
129
|
+
args: [NavContentDirective]
|
|
130
|
+
}] } });
|
|
131
|
+
|
|
132
|
+
const items = [
|
|
133
|
+
NavDirective,
|
|
134
|
+
NavItemDirective,
|
|
135
|
+
NavLinkDirective,
|
|
136
|
+
NavContentContainerComponent,
|
|
137
|
+
NavContentDirective
|
|
138
|
+
];
|
|
139
|
+
class NavModule {
|
|
140
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: NavModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
141
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.6", ngImport: i0, type: NavModule, imports: [NavDirective,
|
|
142
|
+
NavItemDirective,
|
|
143
|
+
NavLinkDirective,
|
|
144
|
+
NavContentContainerComponent,
|
|
145
|
+
NavContentDirective], exports: [NavDirective,
|
|
146
|
+
NavItemDirective,
|
|
147
|
+
NavLinkDirective,
|
|
148
|
+
NavContentContainerComponent,
|
|
149
|
+
NavContentDirective] });
|
|
150
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: NavModule, imports: [NavContentContainerComponent] });
|
|
151
|
+
}
|
|
152
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: NavModule, decorators: [{
|
|
153
|
+
type: NgModule,
|
|
154
|
+
args: [{
|
|
155
|
+
imports: items,
|
|
156
|
+
exports: items
|
|
157
|
+
}]
|
|
158
|
+
}] });
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Generated bundle index. Do not edit.
|
|
162
|
+
*/
|
|
163
|
+
|
|
164
|
+
export { NavContentContainerComponent, NavContentDirective, NavDirective, NavItemDirective, NavLinkDirective, NavModule };
|
|
165
|
+
//# sourceMappingURL=bootkit-ng0-components-nav.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootkit-ng0-components-nav.mjs","sources":["../../../projects/ng0/components/nav/nav.directive.ts","../../../projects/ng0/components/nav/nav-item.directive.ts","../../../projects/ng0/components/nav/nav-link.directive.ts","../../../projects/ng0/components/nav/nav-content.directive.ts","../../../projects/ng0/components/nav/nav-content-container.component.ts","../../../projects/ng0/components/nav/nav-content-container.component.html","../../../projects/ng0/components/nav/nav.module.ts","../../../projects/ng0/components/nav/bootkit-ng0-components-nav.ts"],"sourcesContent":["import { Directive, ElementRef, Renderer2, input, model } from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[ng0Nav]',\r\n exportAs: 'ng0Nav',\r\n standalone: true,\r\n})\r\nexport class NavDirective {\r\n /**\r\n * The active item.\r\n */\r\n activeItem = model<any>(0);\r\n\r\n /**\r\n * Whether the navigation is disabled.\r\n */\r\n disabled = input(false);\r\n\r\n constructor() {\r\n }\r\n}\r\n","import { Directive, ElementRef, Renderer2, input } from '@angular/core';\r\nimport { NavDirective } from './nav.directive';\r\n\r\n@Directive({\r\n selector: '[ng0NavItem]',\r\n exportAs: 'ng0NavItem',\r\n standalone: true,\r\n})\r\nexport class NavItemDirective {\r\n id = input.required<any>({alias: 'ng0NavItem'});\r\n disabled = input(false);\r\n\r\n constructor(public elementRef: ElementRef) {\r\n }\r\n}\r\n","import { Directive, ElementRef, HostBinding, HostListener, Renderer2, input } from '@angular/core';\r\nimport { NavDirective } from './nav.directive';\r\nimport { NavItemDirective } from './nav-item.directive';\r\n\r\n@Directive({\r\n selector: '[ng0NavLink]',\r\n exportAs: 'ng0NavLink',\r\n standalone: true,\r\n})\r\nexport class NavLinkDirective {\r\n constructor(public elementRef: ElementRef, private _nav: NavDirective, private _navItem: NavItemDirective) {\r\n }\r\n\r\n @HostListener('click')\r\n private _onClick() {\r\n this._nav.activeItem.set(this._navItem.id());\r\n }\r\n\r\n @HostBinding('class.active') \r\n private get _active() {\r\n return this._nav.activeItem() === this._navItem.id();\r\n }\r\n\r\n @HostBinding('class.disabled') \r\n private get _disabled() {\r\n return this._nav.disabled() || this._navItem.disabled();\r\n }\r\n}\r\n","import { Directive, input, TemplateRef } from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[ng0NavContent]',\r\n exportAs: 'ng0NavContent',\r\n standalone: true,\r\n})\r\nexport class NavContentDirective {\r\n id = input.required<any>({alias: 'ng0NavContent'});\r\n \r\n constructor(public templateRef: TemplateRef<any>) {\r\n }\r\n}\r\n","import { Component, ContentChildren, QueryList, ElementRef, Renderer2, OnInit, input, ChangeDetectionStrategy, computed } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { NavContentDirective } from './nav-content.directive';\r\nimport { NavDirective } from './nav.directive';\r\n\r\n@Component({\r\n selector: 'ng0-navcontent-container',\r\n exportAs: 'ng0Navcontent',\r\n templateUrl: './nav-content-container.component.html',\r\n styles: `:host{display: block;}`,\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [CommonModule]\r\n})\r\nexport class NavContentContainerComponent implements OnInit {\r\n /** \r\n * The navigation directive that this content belongs to.\r\n */\r\n nav = input.required<NavDirective>();\r\n\r\n @ContentChildren(NavContentDirective) protected _contents!: QueryList<NavContentDirective>;\r\n protected _activeItem = computed(() => this.nav().activeItem());\r\n\r\n constructor(private _elementRef: ElementRef, private _renderer: Renderer2) {\r\n }\r\n\r\n ngOnInit(): void {\r\n this._renderer.addClass(this._elementRef.nativeElement, 'tab-content');\r\n }\r\n}\r\n","@for (content of _contents; track $index) {\r\n @if(content.id() === _activeItem()) {\r\n <ng-container *ngTemplateOutlet=\"content.templateRef;\"></ng-container>\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { NavDirective } from './nav.directive';\r\nimport { NavLinkDirective } from './nav-link.directive';\r\nimport { NavContentContainerComponent } from './nav-content-container.component';\r\nimport { NavContentDirective } from './nav-content.directive';\r\nimport { NavItemDirective } from './nav-item.directive';\r\n\r\nconst items = [\r\n NavDirective,\r\n NavItemDirective,\r\n NavLinkDirective,\r\n NavContentContainerComponent,\r\n NavContentDirective\r\n];\r\n\r\n@NgModule({\r\n imports: items,\r\n exports: items\r\n})\r\nexport class NavModule {\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.NavDirective","i2.NavItemDirective"],"mappings":";;;;;MAOa,YAAY,CAAA;AACnB;;AAEG;AACH,IAAA,UAAU,GAAG,KAAK,CAAM,CAAC,sDAAC;AAE1B;;AAEG;AACH,IAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,oDAAC;AAEvB,IAAA,WAAA,GAAA;;uGAXO,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAZ,YAAY,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,EAAA,UAAA,EAAA,EAAA,iBAAA,EAAA,YAAA,EAAA,UAAA,EAAA,YAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,K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ACZ,gBAAgB;YAChB,gBAAgB;YAChB,4BAA4B;AAC5B,YAAA,mBAAmB,aAJnB,YAAY;YACZ,gBAAgB;YAChB,gBAAgB;YAChB,4BAA4B;YAC5B,mBAAmB,CAAA,EAAA,CAAA;AAOR,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,SAAS,YARpB,4BAA4B,CAAA,EAAA,CAAA;;2FAQjB,SAAS,EAAA,UAAA,EAAA,CAAA;kBAJrB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,KAAK;AACd,oBAAA,OAAO,EAAE;AACV,iBAAA;;;AClBD;;AAEG;;;;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, EventEmitter, afterNextRender, effect, untracked,
|
|
2
|
+
import { input, EventEmitter, afterNextRender, effect, untracked, HostListener, Output, Directive, NgModule } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
class OffcanvasDirective {
|
|
5
5
|
_el;
|
|
6
6
|
_renderer;
|
|
7
|
-
show = input(false);
|
|
8
|
-
hasBackdrop = input(false);
|
|
7
|
+
show = input(false, ...(ngDevMode ? [{ debugName: "show" }] : []));
|
|
8
|
+
hasBackdrop = input(false, ...(ngDevMode ? [{ debugName: "hasBackdrop" }] : []));
|
|
9
9
|
backdropClick = new EventEmitter;
|
|
10
10
|
_firstShowEffectRun = true;
|
|
11
11
|
_firstBackdropEffectRun = true;
|
|
@@ -100,10 +100,10 @@ class OffcanvasDirective {
|
|
|
100
100
|
ngOnDestroy() {
|
|
101
101
|
this._destroyBackdrop();
|
|
102
102
|
}
|
|
103
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
104
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
103
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: OffcanvasDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
104
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.6", type: OffcanvasDirective, isStandalone: true, selector: "[ng0Offcanvas]", inputs: { show: { classPropertyName: "show", publicName: "show", isSignal: true, isRequired: false, transformFunction: null }, hasBackdrop: { classPropertyName: "hasBackdrop", publicName: "hasBackdrop", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { backdropClick: "backdropClick" }, host: { listeners: { "transitionend": "_onTransitionend($event)" } }, exportAs: ["ng0Offcanvas"], ngImport: i0 });
|
|
105
105
|
}
|
|
106
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
106
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: OffcanvasDirective, decorators: [{
|
|
107
107
|
type: Directive,
|
|
108
108
|
args: [{
|
|
109
109
|
selector: '[ng0Offcanvas]',
|
|
@@ -121,11 +121,11 @@ const items = [
|
|
|
121
121
|
OffcanvasDirective,
|
|
122
122
|
];
|
|
123
123
|
class OffcanvasModule {
|
|
124
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
125
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
126
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
124
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: OffcanvasModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
125
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.6", ngImport: i0, type: OffcanvasModule, imports: [OffcanvasDirective], exports: [OffcanvasDirective] });
|
|
126
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: OffcanvasModule });
|
|
127
127
|
}
|
|
128
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
128
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: OffcanvasModule, decorators: [{
|
|
129
129
|
type: NgModule,
|
|
130
130
|
args: [{
|
|
131
131
|
imports: items,
|
|
@@ -138,4 +138,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImpo
|
|
|
138
138
|
*/
|
|
139
139
|
|
|
140
140
|
export { OffcanvasDirective, OffcanvasModule };
|
|
141
|
-
//# sourceMappingURL=bootkit-ng0-offcanvas.mjs.map
|
|
141
|
+
//# sourceMappingURL=bootkit-ng0-components-offcanvas.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootkit-ng0-components-offcanvas.mjs","sources":["../../../projects/ng0/components/offcanvas/offcanvas.directive.ts","../../../projects/ng0/components/offcanvas/offcanvas.module.ts","../../../projects/ng0/components/offcanvas/bootkit-ng0-components-offcanvas.ts"],"sourcesContent":["import { OnInit, ElementRef, Renderer2, effect, HostListener, Directive, input, Output, EventEmitter, OnDestroy, afterNextRender, untracked } from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[ng0Offcanvas]',\r\n exportAs: 'ng0Offcanvas',\r\n standalone: true,\r\n})\r\nexport class OffcanvasDirective implements OnInit, OnDestroy {\r\n public show = input(false);\r\n public hasBackdrop = input(false);\r\n\r\n @Output()\r\n public backdropClick = new EventEmitter<MouseEvent>;\r\n\r\n private _firstShowEffectRun = true;\r\n private _firstBackdropEffectRun = true;\r\n private _backdropElement?: any;\r\n private _backdropClickUnlistenFunc?: any;\r\n private _backdropTransitionendUnlistenFunc?: any;\r\n private addClass = (c: string) => this._renderer.addClass(this._el.nativeElement, c);\r\n\r\n constructor(private _el: ElementRef, private _renderer: Renderer2) {\r\n\r\n afterNextRender(() => {\r\n if (this.show() && this.hasBackdrop()) {\r\n this._createBackdrop();\r\n }\r\n });\r\n\r\n effect(() => {\r\n var show = this.show();\r\n var backdrop = untracked(() => this.hasBackdrop());\r\n\r\n if (this._firstShowEffectRun) {\r\n if (show) {\r\n this.addClass('show');\r\n }\r\n this._firstShowEffectRun = false;\r\n return;\r\n }\r\n\r\n\r\n if (show) {\r\n this.addClass('show');\r\n if (backdrop)\r\n this._createBackdrop();\r\n } else {\r\n this.addClass('hiding');\r\n this._hideBackdrop(); // we first hide backdrop, after hide transition completed, we destroy it.\r\n }\r\n });\r\n\r\n effect(() => {\r\n var backdrop = this.hasBackdrop();\r\n var show = untracked(() => this.show());\r\n\r\n if (this._firstBackdropEffectRun) {\r\n this._firstBackdropEffectRun = false;\r\n return;\r\n }\r\n\r\n if (show) {\r\n if (backdrop)\r\n this._createBackdrop();\r\n else\r\n this._destroyBackdrop();\r\n }\r\n });\r\n }\r\n\r\n ngOnInit(): void {\r\n }\r\n\r\n private _createBackdrop() {\r\n if (!this._backdropElement) {\r\n this._backdropElement = this._renderer.createElement('div');\r\n ['offcanvas-backdrop', 'fade', 'show'].forEach(c => this._renderer.addClass(this._backdropElement, c));\r\n\r\n // Append the new element next to the host element\r\n const parent = this._renderer.parentNode(this._el.nativeElement);\r\n const nextSibling = this._renderer.nextSibling(this._el.nativeElement);\r\n this._renderer.insertBefore(parent, this._backdropElement, nextSibling);\r\n\r\n this._backdropClickUnlistenFunc = this._renderer.listen(this._backdropElement, 'click', (e) => {\r\n this.backdropClick.emit(e);\r\n });\r\n\r\n this._backdropTransitionendUnlistenFunc = this._renderer.listen(this._backdropElement, 'transitionend', (e) => {\r\n if (!this.show()) {\r\n this._destroyBackdrop();\r\n }\r\n });\r\n }\r\n }\r\n\r\n private _destroyBackdrop() {\r\n if (this._backdropElement) {\r\n const parent = this._renderer.parentNode(this._el.nativeElement);\r\n this._renderer.removeChild(parent, this._backdropElement, false);\r\n this._backdropClickUnlistenFunc()\r\n\r\n this._backdropClickUnlistenFunc = undefined;\r\n this._backdropElement = undefined\r\n }\r\n }\r\n\r\n private _hideBackdrop() {\r\n if (this._backdropElement) {\r\n this._renderer.removeClass(this._backdropElement, 'show');\r\n }\r\n }\r\n\r\n @HostListener('transitionend', ['$event'])\r\n private _onTransitionend(e: TransitionEvent): void {\r\n if (!this.show() && e.propertyName == 'transform') {\r\n ['show', 'hiding'].forEach(x => this._renderer.removeClass(this._el.nativeElement, x));\r\n // if (this.backdrop())\r\n // this._destroyBackdrop();\r\n }\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this._destroyBackdrop()\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { OffcanvasDirective } from './offcanvas.directive';\r\n\r\nconst items = [\r\n OffcanvasDirective,\r\n];\r\n\r\n@NgModule({\r\n imports: items,\r\n exports: items\r\n})\r\nexport class OffcanvasModule {\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAOa,kBAAkB,CAAA;AAcP,IAAA,GAAA;AAAyB,IAAA,SAAA;AAbtC,IAAA,IAAI,GAAG,KAAK,CAAC,KAAK,gDAAC;AACnB,IAAA,WAAW,GAAG,KAAK,CAAC,KAAK,uDAAC;IAG1B,aAAa,GAAG,IAAI,YAAwB;IAE3C,mBAAmB,GAAG,IAAI;IAC1B,uBAAuB,GAAG,IAAI;AAC9B,IAAA,gBAAgB;AAChB,IAAA,0BAA0B;AAC1B,IAAA,kCAAkC;IAClC,QAAQ,GAAG,CAAC,CAAS,KAAK,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC,CAAC;IAEpF,WAAA,CAAoB,GAAe,EAAU,SAAoB,EAAA;QAA7C,IAAA,CAAA,GAAG,GAA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