@koalarx/ui 20.2.7 → 20.2.9
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/fesm2022/koalarx-ui-core-base.mjs +15 -15
- package/fesm2022/koalarx-ui-core-base.mjs.map +1 -1
- package/fesm2022/koalarx-ui-core-components-dialog.mjs +3 -3
- package/fesm2022/koalarx-ui-core-components-kl-root.mjs +4 -4
- package/fesm2022/koalarx-ui-core-components-kl-root.mjs.map +1 -1
- package/fesm2022/koalarx-ui-core-components-loader-page.mjs +7 -7
- package/fesm2022/koalarx-ui-core-components-loader-page.mjs.map +1 -1
- package/fesm2022/koalarx-ui-core-components-loader.mjs +4 -4
- package/fesm2022/koalarx-ui-core-components-loader.mjs.map +1 -1
- package/fesm2022/koalarx-ui-core-components-side-window.mjs +3 -3
- package/fesm2022/koalarx-ui-core-components-snackbar.mjs +3 -3
- package/fesm2022/koalarx-ui-core-guards.mjs +3 -3
- package/fesm2022/koalarx-ui-core-translations.mjs.map +1 -1
- package/fesm2022/koalarx-ui-shared-components-accordion.mjs +4 -4
- package/fesm2022/koalarx-ui-shared-components-accordion.mjs.map +1 -1
- package/fesm2022/koalarx-ui-shared-components-alert.mjs +6 -6
- package/fesm2022/koalarx-ui-shared-components-alert.mjs.map +1 -1
- package/fesm2022/koalarx-ui-shared-components-code-viewer.mjs +10 -10
- package/fesm2022/koalarx-ui-shared-components-code-viewer.mjs.map +1 -1
- package/fesm2022/koalarx-ui-shared-components-collapse.mjs +3 -3
- package/fesm2022/koalarx-ui-shared-components-confirm.mjs +6 -6
- package/fesm2022/koalarx-ui-shared-components-confirm.mjs.map +1 -1
- package/fesm2022/koalarx-ui-shared-components-datatable.mjs +47 -47
- package/fesm2022/koalarx-ui-shared-components-datatable.mjs.map +1 -1
- package/fesm2022/koalarx-ui-shared-components-dialog.mjs +10 -10
- package/fesm2022/koalarx-ui-shared-components-dialog.mjs.map +1 -1
- package/fesm2022/koalarx-ui-shared-components-dropdown.mjs +5 -5
- package/fesm2022/koalarx-ui-shared-components-dropdown.mjs.map +1 -1
- package/fesm2022/koalarx-ui-shared-components-field-errors.mjs +4 -4
- package/fesm2022/koalarx-ui-shared-components-field-errors.mjs.map +1 -1
- package/fesm2022/koalarx-ui-shared-components-horizontal-menu.mjs +7 -7
- package/fesm2022/koalarx-ui-shared-components-horizontal-menu.mjs.map +1 -1
- package/fesm2022/koalarx-ui-shared-components-input-field-autocomplete.mjs +49 -49
- package/fesm2022/koalarx-ui-shared-components-input-field-autocomplete.mjs.map +1 -1
- package/fesm2022/koalarx-ui-shared-components-input-field-field-group.mjs +3 -3
- package/fesm2022/koalarx-ui-shared-components-input-field-fieldset.mjs +3 -3
- package/fesm2022/koalarx-ui-shared-components-input-field-input-checkbox.mjs +6 -6
- package/fesm2022/koalarx-ui-shared-components-input-field-input-checkbox.mjs.map +1 -1
- package/fesm2022/koalarx-ui-shared-components-input-field-input-cnpj.mjs +3 -3
- package/fesm2022/koalarx-ui-shared-components-input-field-input-cpf.mjs +3 -3
- package/fesm2022/koalarx-ui-shared-components-input-field-input-currency.mjs +4 -4
- package/fesm2022/koalarx-ui-shared-components-input-field-input-currency.mjs.map +1 -1
- package/fesm2022/koalarx-ui-shared-components-input-field-input-date.mjs +5 -5
- package/fesm2022/koalarx-ui-shared-components-input-field-input-date.mjs.map +1 -1
- package/fesm2022/koalarx-ui-shared-components-input-field-input-datetime.mjs +5 -5
- package/fesm2022/koalarx-ui-shared-components-input-field-input-datetime.mjs.map +1 -1
- package/fesm2022/koalarx-ui-shared-components-input-field-input-email.mjs +3 -3
- package/fesm2022/koalarx-ui-shared-components-input-field-input-month.mjs +5 -5
- package/fesm2022/koalarx-ui-shared-components-input-field-input-month.mjs.map +1 -1
- package/fesm2022/koalarx-ui-shared-components-input-field-input-password.mjs +5 -5
- package/fesm2022/koalarx-ui-shared-components-input-field-input-password.mjs.map +1 -1
- package/fesm2022/koalarx-ui-shared-components-input-field-input-radio.mjs +9 -9
- package/fesm2022/koalarx-ui-shared-components-input-field-input-radio.mjs.map +1 -1
- package/fesm2022/koalarx-ui-shared-components-input-field-input-text.mjs +4 -4
- package/fesm2022/koalarx-ui-shared-components-input-field-input-text.mjs.map +1 -1
- package/fesm2022/koalarx-ui-shared-components-input-field-input-time.mjs +5 -5
- package/fesm2022/koalarx-ui-shared-components-input-field-input-time.mjs.map +1 -1
- package/fesm2022/koalarx-ui-shared-components-input-field-input-url.mjs +3 -3
- package/fesm2022/koalarx-ui-shared-components-input-field-select.mjs +4 -4
- package/fesm2022/koalarx-ui-shared-components-input-field-select.mjs.map +1 -1
- package/fesm2022/koalarx-ui-shared-components-input-field-switcher.mjs +6 -6
- package/fesm2022/koalarx-ui-shared-components-input-field-switcher.mjs.map +1 -1
- package/fesm2022/koalarx-ui-shared-components-input-field-textarea.mjs +6 -6
- package/fesm2022/koalarx-ui-shared-components-input-field-textarea.mjs.map +1 -1
- package/fesm2022/koalarx-ui-shared-components-input-field.mjs +15 -15
- package/fesm2022/koalarx-ui-shared-components-input-field.mjs.map +1 -1
- package/fesm2022/koalarx-ui-shared-components-on-this-page.mjs +5 -5
- package/fesm2022/koalarx-ui-shared-components-on-this-page.mjs.map +1 -1
- package/fesm2022/koalarx-ui-shared-components-side-window.mjs +9 -9
- package/fesm2022/koalarx-ui-shared-components-snackbar.mjs +15 -15
- package/fesm2022/koalarx-ui-shared-components-snackbar.mjs.map +1 -1
- package/fesm2022/koalarx-ui-shared-components-stepper.mjs +13 -13
- package/fesm2022/koalarx-ui-shared-components-stepper.mjs.map +1 -1
- package/fesm2022/koalarx-ui-shared-components-vertical-menu.mjs +7 -7
- package/fesm2022/koalarx-ui-shared-components-vertical-menu.mjs.map +1 -1
- package/fesm2022/koalarx-ui-shared-directives.mjs +28 -28
- package/fesm2022/koalarx-ui-shared-directives.mjs.map +1 -1
- package/fesm2022/koalarx-ui-shared-services.mjs +7 -7
- package/fesm2022/koalarx-ui-shared-services.mjs.map +1 -1
- package/fesm2022/koalarx-ui-shared-utils.mjs +3 -3
- package/fesm2022/koalarx-ui-shared-utils.mjs.map +1 -1
- package/fesm2022/koalarx-ui.mjs +6 -6
- package/package.json +11 -11
|
@@ -7,8 +7,8 @@ import { AppConfig } from '@koalarx/ui/core/config';
|
|
|
7
7
|
class OnThisPage {
|
|
8
8
|
router = inject(Router);
|
|
9
9
|
translations = inject(AppConfig).translation.onThisPage;
|
|
10
|
-
links = input.required();
|
|
11
|
-
activeSection = signal(null);
|
|
10
|
+
links = input.required(...(ngDevMode ? [{ debugName: "links" }] : []));
|
|
11
|
+
activeSection = signal(null, ...(ngDevMode ? [{ debugName: "activeSection" }] : []));
|
|
12
12
|
linkSections = linkedSignal(() => {
|
|
13
13
|
const links = this.links();
|
|
14
14
|
const currentSection = this.activeSection();
|
|
@@ -63,10 +63,10 @@ class OnThisPage {
|
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
67
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.
|
|
66
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: OnThisPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
67
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: OnThisPage, isStandalone: true, selector: "kl-on-this-page", inputs: { links: { classPropertyName: "links", publicName: "links", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div class=\"fixed\">\n <small class=\"opacity-70\">\n <ng-content select=\"[title]\">\n {{translations.title}}\n </ng-content>\n </small>\n\n <div class=\"flex flex-col gap-2 mt-2\">\n @for (item of linkSections(); track $index) {\n <a class=\"hover:cursor-pointer hover:opacity-90 transition duration-100 opacity-60\" [class]=\"{'opacity-100': item.isActive}\" (click)=\"scrollTo(item.elementId)\">\n {{ item.label }}\n </a>\n }\n </div>\n</div>\n" });
|
|
68
68
|
}
|
|
69
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
69
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: OnThisPage, decorators: [{
|
|
70
70
|
type: Component,
|
|
71
71
|
args: [{ selector: 'kl-on-this-page', template: "<div class=\"fixed\">\n <small class=\"opacity-70\">\n <ng-content select=\"[title]\">\n {{translations.title}}\n </ng-content>\n </small>\n\n <div class=\"flex flex-col gap-2 mt-2\">\n @for (item of linkSections(); track $index) {\n <a class=\"hover:cursor-pointer hover:opacity-90 transition duration-100 opacity-60\" [class]=\"{'opacity-100': item.isActive}\" (click)=\"scrollTo(item.elementId)\">\n {{ item.label }}\n </a>\n }\n </div>\n</div>\n" }]
|
|
72
72
|
}], ctorParameters: () => [] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"koalarx-ui-shared-components-on-this-page.mjs","sources":["../../projects/koala-ui/shared/components/on-this-page/on-this-page.ts","../../projects/koala-ui/shared/components/on-this-page/on-this-page.html","../../projects/koala-ui/shared/components/on-this-page/koalarx-ui-shared-components-on-this-page.ts"],"sourcesContent":["import {\n Component,\n inject,\n input,\n linkedSignal,\n OnDestroy,\n OnInit,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { NavigationEnd, Router } from '@angular/router';\nimport { AppConfig } from '@koalarx/ui/core/config';\n\nexport interface OnThisPageLink {\n label: string;\n elementId: string;\n}\n\n@Component({\n selector: 'kl-on-this-page',\n templateUrl: './on-this-page.html',\n})\nexport class OnThisPage implements OnInit, OnDestroy {\n private readonly router = inject(Router);\n\n readonly translations = inject(AppConfig).translation.onThisPage;\n\n links = input.required<OnThisPageLink[]>();\n activeSection = signal<string | null>(null);\n\n linkSections = linkedSignal(() => {\n const links = this.links();\n const currentSection = this.activeSection();\n\n return links.map((link) => ({\n label: link.label,\n elementId: link.elementId,\n isActive: link.elementId === currentSection,\n }));\n });\n\n private onScroll = () => {\n const links = this.links();\n let current: string | null = null;\n for (const link of links) {\n const el = document.getElementById(link.elementId);\n if (el) {\n const rect = el.getBoundingClientRect();\n if (rect.top <= 250) {\n current = link.elementId;\n }\n }\n }\n if (current) {\n this.activeSection.set(current);\n }\n };\n\n constructor() {\n this.router.events.pipe(takeUntilDestroyed()).subscribe((event) => {\n if (event instanceof NavigationEnd) {\n window.scrollTo({ top: 0 });\n }\n });\n }\n\n ngOnDestroy(): void {\n window.removeEventListener('scroll', this.onScroll);\n }\n\n ngOnInit(): void {\n this.activeSection.set(\n location.hash.match(/#[a-zA-Z]+/)?.[0]?.replace(/#/g, '') || null\n );\n window.addEventListener('scroll', this.onScroll, { passive: true });\n }\n\n scrollTo(elementId: string) {\n const element = document.getElementById(elementId);\n if (element) {\n this.activeSection.set(elementId);\n const link = location.hash.match(/#[a-zA-Z]+/)\n ? location.hash.replace(/#([^#]*)$/, `#${elementId}`)\n : `${location.hash}#${elementId}`;\n\n history.pushState({}, '', link);\n\n const scrollPosition =\n element.getBoundingClientRect().top + window.scrollY - 100;\n\n window.scrollTo({\n top: scrollPosition,\n behavior: 'smooth',\n });\n }\n }\n}\n","<div class=\"fixed\">\n <small class=\"opacity-70\">\n <ng-content select=\"[title]\">\n {{translations.title}}\n </ng-content>\n </small>\n\n <div class=\"flex flex-col gap-2 mt-2\">\n @for (item of linkSections(); track $index) {\n <a class=\"hover:cursor-pointer hover:opacity-90 transition duration-100 opacity-60\" [class]=\"{'opacity-100': item.isActive}\" (click)=\"scrollTo(item.elementId)\">\n {{ item.label }}\n </a>\n }\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAsBa,UAAU,CAAA;AACJ,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAE/B,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,UAAU;AAEhE,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"koalarx-ui-shared-components-on-this-page.mjs","sources":["../../projects/koala-ui/shared/components/on-this-page/on-this-page.ts","../../projects/koala-ui/shared/components/on-this-page/on-this-page.html","../../projects/koala-ui/shared/components/on-this-page/koalarx-ui-shared-components-on-this-page.ts"],"sourcesContent":["import {\n Component,\n inject,\n input,\n linkedSignal,\n OnDestroy,\n OnInit,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { NavigationEnd, Router } from '@angular/router';\nimport { AppConfig } from '@koalarx/ui/core/config';\n\nexport interface OnThisPageLink {\n label: string;\n elementId: string;\n}\n\n@Component({\n selector: 'kl-on-this-page',\n templateUrl: './on-this-page.html',\n})\nexport class OnThisPage implements OnInit, OnDestroy {\n private readonly router = inject(Router);\n\n readonly translations = inject(AppConfig).translation.onThisPage;\n\n links = input.required<OnThisPageLink[]>();\n activeSection = signal<string | null>(null);\n\n linkSections = linkedSignal(() => {\n const links = this.links();\n const currentSection = this.activeSection();\n\n return links.map((link) => ({\n label: link.label,\n elementId: link.elementId,\n isActive: link.elementId === currentSection,\n }));\n });\n\n private onScroll = () => {\n const links = this.links();\n let current: string | null = null;\n for (const link of links) {\n const el = document.getElementById(link.elementId);\n if (el) {\n const rect = el.getBoundingClientRect();\n if (rect.top <= 250) {\n current = link.elementId;\n }\n }\n }\n if (current) {\n this.activeSection.set(current);\n }\n };\n\n constructor() {\n this.router.events.pipe(takeUntilDestroyed()).subscribe((event) => {\n if (event instanceof NavigationEnd) {\n window.scrollTo({ top: 0 });\n }\n });\n }\n\n ngOnDestroy(): void {\n window.removeEventListener('scroll', this.onScroll);\n }\n\n ngOnInit(): void {\n this.activeSection.set(\n location.hash.match(/#[a-zA-Z]+/)?.[0]?.replace(/#/g, '') || null\n );\n window.addEventListener('scroll', this.onScroll, { passive: true });\n }\n\n scrollTo(elementId: string) {\n const element = document.getElementById(elementId);\n if (element) {\n this.activeSection.set(elementId);\n const link = location.hash.match(/#[a-zA-Z]+/)\n ? location.hash.replace(/#([^#]*)$/, `#${elementId}`)\n : `${location.hash}#${elementId}`;\n\n history.pushState({}, '', link);\n\n const scrollPosition =\n element.getBoundingClientRect().top + window.scrollY - 100;\n\n window.scrollTo({\n top: scrollPosition,\n behavior: 'smooth',\n });\n }\n }\n}\n","<div class=\"fixed\">\n <small class=\"opacity-70\">\n <ng-content select=\"[title]\">\n {{translations.title}}\n </ng-content>\n </small>\n\n <div class=\"flex flex-col gap-2 mt-2\">\n @for (item of linkSections(); track $index) {\n <a class=\"hover:cursor-pointer hover:opacity-90 transition duration-100 opacity-60\" [class]=\"{'opacity-100': item.isActive}\" (click)=\"scrollTo(item.elementId)\">\n {{ item.label }}\n </a>\n }\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAsBa,UAAU,CAAA;AACJ,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAE/B,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,UAAU;AAEhE,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,gDAAoB;AAC1C,IAAA,aAAa,GAAG,MAAM,CAAgB,IAAI,yDAAC;AAE3C,IAAA,YAAY,GAAG,YAAY,CAAC,MAAK;AAC/B,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE;AAC1B,QAAA,MAAM,cAAc,GAAG,IAAI,CAAC,aAAa,EAAE;QAE3C,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,MAAM;YAC1B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,SAAS,EAAE,IAAI,CAAC,SAAS;AACzB,YAAA,QAAQ,EAAE,IAAI,CAAC,SAAS,KAAK,cAAc;AAC5C,SAAA,CAAC,CAAC;AACL,KAAC,CAAC;IAEM,QAA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QAAQ,CAAC,cAAc,CAAC,SAAS,CAAC;QAClD,IAAI,OAAO,EAAE;AACX,YAAA,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC;YACjC,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY;AAC3C,kBAAE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAA,CAAA,EAAI,SAAS,CAAA,CAAE;kBAClD,GAAG,QAAQ,CAAC,IAAI,CAAA,CAAA,EAAI,SAAS,EAAE;YAEnC,OAAO,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC;AAE/B,YAAA,MAAM,cAAc,GAClB,OAAO,CAAC,qBAAqB,EAAE,CAAC,GAAG,GAAG,MAAM,CAAC,OAAO,GAAG,GAAG;YAE5D,MAAM,CAAC,QAAQ,CAAC;AACd,gBAAA,GAAG,EAAE,cAAc;AACnB,gBAAA,QAAQ,EAAE,QAAQ;AACnB,aAAA,CAAC;;;uGAvEK,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAV,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAU,8MCtBvB,yeAeA,EAAA,CAAA;;2FDOa,UAAU,EAAA,UAAA,EAAA,CAAA;kBAJtB,SAAS;+BACE,iBAAiB,EAAA,QAAA,EAAA,yeAAA,EAAA;;;AEnB7B;;AAEG;;;;"}
|
|
@@ -3,10 +3,10 @@ import { Component, InjectionToken, inject, ApplicationRef, EnvironmentInjector,
|
|
|
3
3
|
import { randomString } from '@koalarx/utils/KlString';
|
|
4
4
|
|
|
5
5
|
class SideWindowContent {
|
|
6
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
7
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.
|
|
6
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: SideWindowContent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: SideWindowContent, isStandalone: true, selector: "kl-side-window-content", ngImport: i0, template: "<div class=\"fixed flex z-10000 bg-base-100/20 h-screen w-screen justify-end p-2\">\n <div class=\"w-auto h-full bg-base-200 rounded-xl shadow-2xl border-4 border-neutral-200 dark:border-neutral-900 animate-slide-in-left\">\n <ng-content />\n </div>\n</div>\n" });
|
|
8
8
|
}
|
|
9
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
9
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: SideWindowContent, decorators: [{
|
|
10
10
|
type: Component,
|
|
11
11
|
args: [{ selector: 'kl-side-window-content', template: "<div class=\"fixed flex z-10000 bg-base-100/20 h-screen w-screen justify-end p-2\">\n <div class=\"w-auto h-full bg-base-200 rounded-xl shadow-2xl border-4 border-neutral-200 dark:border-neutral-900 animate-slide-in-left\">\n <ng-content />\n </div>\n</div>\n" }]
|
|
12
12
|
}] });
|
|
@@ -76,10 +76,10 @@ class SideWindow {
|
|
|
76
76
|
document.body.style.overflowY = 'hidden';
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
80
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
79
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: SideWindow, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
80
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: SideWindow, providedIn: 'root' });
|
|
81
81
|
}
|
|
82
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
82
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: SideWindow, decorators: [{
|
|
83
83
|
type: Injectable,
|
|
84
84
|
args: [{ providedIn: 'root' }]
|
|
85
85
|
}] });
|
|
@@ -103,10 +103,10 @@ class SideWindowRef {
|
|
|
103
103
|
}
|
|
104
104
|
}, 50);
|
|
105
105
|
}
|
|
106
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
107
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
106
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: SideWindowRef, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
107
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: SideWindowRef });
|
|
108
108
|
}
|
|
109
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
109
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: SideWindowRef, decorators: [{
|
|
110
110
|
type: Injectable
|
|
111
111
|
}] });
|
|
112
112
|
|
|
@@ -84,10 +84,10 @@ class Snackbar {
|
|
|
84
84
|
componentRef.changeDetectorRef.detectChanges();
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
88
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
87
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Snackbar, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
88
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Snackbar, providedIn: 'root' });
|
|
89
89
|
}
|
|
90
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
90
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Snackbar, decorators: [{
|
|
91
91
|
type: Injectable,
|
|
92
92
|
args: [{ providedIn: 'root' }]
|
|
93
93
|
}] });
|
|
@@ -100,21 +100,21 @@ class SnackbarRef {
|
|
|
100
100
|
this.componentRef().destroy();
|
|
101
101
|
this.appRef.detachView(this.componentRef().hostView);
|
|
102
102
|
}
|
|
103
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
104
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
103
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: SnackbarRef, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
104
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: SnackbarRef });
|
|
105
105
|
}
|
|
106
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
106
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: SnackbarRef, decorators: [{
|
|
107
107
|
type: Injectable
|
|
108
108
|
}] });
|
|
109
109
|
|
|
110
110
|
class SnackbarContent {
|
|
111
|
-
alertContentRef = viewChild('alertContent');
|
|
112
|
-
alertIconRef = viewChild('alertIcon');
|
|
111
|
+
alertContentRef = viewChild('alertContent', ...(ngDevMode ? [{ debugName: "alertContentRef" }] : []));
|
|
112
|
+
alertIconRef = viewChild('alertIcon', ...(ngDevMode ? [{ debugName: "alertIconRef" }] : []));
|
|
113
113
|
snackbarRef = inject(SnackbarRef);
|
|
114
|
-
type = input.required();
|
|
115
|
-
message = input.required();
|
|
116
|
-
timeout = input(0);
|
|
117
|
-
timePast = signal(0);
|
|
114
|
+
type = input.required(...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
115
|
+
message = input.required(...(ngDevMode ? [{ debugName: "message" }] : []));
|
|
116
|
+
timeout = input(0, ...(ngDevMode ? [{ debugName: "timeout" }] : []));
|
|
117
|
+
timePast = signal(0, ...(ngDevMode ? [{ debugName: "timePast" }] : []));
|
|
118
118
|
constructor() {
|
|
119
119
|
effect(() => this.addAlertClass());
|
|
120
120
|
effect(() => this.addIconClass());
|
|
@@ -177,10 +177,10 @@ class SnackbarContent {
|
|
|
177
177
|
dismiss() {
|
|
178
178
|
this.snackbarRef.dismiss();
|
|
179
179
|
}
|
|
180
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
181
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.
|
|
180
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: SnackbarContent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
181
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: SnackbarContent, isStandalone: true, selector: "kl-snackbar-content", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: true, transformFunction: null }, timeout: { classPropertyName: "timeout", publicName: "timeout", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "alertContentRef", first: true, predicate: ["alertContent"], descendants: true, isSignal: true }, { propertyName: "alertIconRef", first: true, predicate: ["alertIcon"], descendants: true, isSignal: true }], ngImport: i0, template: "<div role=\"alert\" #alertContent class=\"relative alert alert-outline bg-base-100! w-full lg:max-w-1/4 rounded-sm text-sm py-3 border-neutral-600\">\n <i #alertIcon class=\"h-4 w-4 shrink-0 stroke-current text-base fa-solid\"></i>\n <span [innerHTML]=\"message()\"></span>\n <div>\n <button class=\"btn btn-xs btn-outline\" (click)=\"dismiss()\">OK</button>\n </div>\n @if (timePast() > 0) {\n <progress class=\"absolute left-0 bottom-0 progress w-full opacity-20\"\n [value]=\"timePast()\"\n [max]=\"timeout()\">\n </progress>\n }\n</div>\n" });
|
|
182
182
|
}
|
|
183
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
183
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: SnackbarContent, decorators: [{
|
|
184
184
|
type: Component,
|
|
185
185
|
args: [{ selector: 'kl-snackbar-content', template: "<div role=\"alert\" #alertContent class=\"relative alert alert-outline bg-base-100! w-full lg:max-w-1/4 rounded-sm text-sm py-3 border-neutral-600\">\n <i #alertIcon class=\"h-4 w-4 shrink-0 stroke-current text-base fa-solid\"></i>\n <span [innerHTML]=\"message()\"></span>\n <div>\n <button class=\"btn btn-xs btn-outline\" (click)=\"dismiss()\">OK</button>\n </div>\n @if (timePast() > 0) {\n <progress class=\"absolute left-0 bottom-0 progress w-full opacity-20\"\n [value]=\"timePast()\"\n [max]=\"timeout()\">\n </progress>\n }\n</div>\n" }]
|
|
186
186
|
}], ctorParameters: () => [] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"koalarx-ui-shared-components-snackbar.mjs","sources":["../../projects/koala-ui/shared/components/snackbar/snackbar.ts","../../projects/koala-ui/shared/components/snackbar/snackbar-ref.ts","../../projects/koala-ui/shared/components/snackbar/snackbar-content.ts","../../projects/koala-ui/shared/components/snackbar/snackbar-content.html","../../projects/koala-ui/shared/components/snackbar/koalarx-ui-shared-components-snackbar.ts"],"sourcesContent":["import {\n ApplicationRef,\n createComponent,\n EnvironmentInjector,\n inject,\n Injectable,\n InjectionToken,\n Injector,\n inputBinding,\n} from '@angular/core';\nimport { randomString } from '@koalarx/utils/KlString';\nimport { SnackbarContent } from './snackbar-content';\nimport { SNACKBAR_REF_TOKEN, SnackbarRef } from './snackbar-ref';\n\nexport const SNACKBAR_CONFIG = new InjectionToken('SnackbarConfig');\nexport const SNACKBAR_APP_REF = new InjectionToken('SnackbarAppRef');\n\nexport type SnackbarType = 'info' | 'success' | 'warning' | 'error';\n\nexport interface SnackbarConfig {\n type: SnackbarType;\n message: string;\n timeout?: number;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class Snackbar {\n private readonly appRef = inject(ApplicationRef);\n private readonly injector = inject(EnvironmentInjector);\n\n private generateElementId() {\n let elementId: string;\n\n do {\n elementId = randomString(50, {\n numbers: false,\n lowercase: true,\n uppercase: true,\n specialCharacters: false,\n });\n } while (document.getElementById(elementId));\n\n return elementId;\n }\n\n success(message: string, timeout = 5000) {\n this.open({\n type: 'success',\n message,\n timeout,\n });\n }\n\n warning(message: string, timeout = 5000) {\n this.open({\n type: 'warning',\n message,\n timeout,\n });\n }\n\n error(message: string, timeout = 5000) {\n this.open({\n type: 'error',\n message,\n timeout,\n });\n }\n\n info(message: string, timeout = 5000) {\n this.open({\n type: 'info',\n message,\n timeout,\n });\n }\n\n open(config: SnackbarConfig) {\n const main = document.querySelector<HTMLElement>(\n 'kl-snackbar-container div'\n );\n\n if (main) {\n const elementId = this.generateElementId();\n const container = main.appendChild(document.createElement('div'));\n container.id = elementId;\n container.classList.add('flex', 'item-center', 'justify-end');\n\n const componentRef = createComponent(SnackbarContent, {\n environmentInjector: this.injector,\n hostElement: container,\n elementInjector: Injector.create({\n providers: [\n { provide: SNACKBAR_CONFIG, useValue: config },\n { provide: SNACKBAR_APP_REF, useValue: this.appRef },\n {\n provide: SNACKBAR_REF_TOKEN,\n useValue: () => componentRef,\n },\n {\n provide: SnackbarRef,\n deps: [SNACKBAR_CONFIG, SNACKBAR_APP_REF, SNACKBAR_REF_TOKEN],\n },\n ],\n }),\n bindings: [\n inputBinding('type', () => config.type),\n inputBinding('message', () => config.message),\n inputBinding('timeout', () => config.timeout ?? 0),\n ],\n });\n\n this.appRef.attachView(componentRef.hostView);\n\n componentRef.changeDetectorRef.detectChanges();\n }\n }\n}\n","import {\n ApplicationRef,\n ComponentRef,\n inject,\n Injectable,\n InjectionToken,\n} from '@angular/core';\nimport { SNACKBAR_APP_REF } from './snackbar';\nimport { SnackbarContent } from './snackbar-content';\n\nexport const SNACKBAR_REF_TOKEN = new InjectionToken('SnackbarRefToken');\n\n@Injectable()\nexport class SnackbarRef {\n private readonly appRef = inject<ApplicationRef>(SNACKBAR_APP_REF);\n private readonly componentRef =\n inject<() => ComponentRef<SnackbarContent>>(SNACKBAR_REF_TOKEN);\n\n dismiss() {\n this.componentRef().destroy();\n this.appRef.detachView(this.componentRef().hostView);\n }\n}\n","import {\n Component,\n effect,\n ElementRef,\n inject,\n input,\n OnInit,\n signal,\n viewChild,\n} from '@angular/core';\nimport { SnackbarType } from './snackbar';\nimport { SnackbarRef } from './snackbar-ref';\nimport { interval } from 'rxjs/internal/observable/interval';\nimport { startWith } from 'rxjs/internal/operators/startWith';\nimport { map } from 'rxjs/internal/operators/map';\n\n@Component({\n selector: 'kl-snackbar-content',\n templateUrl: './snackbar-content.html',\n})\nexport class SnackbarContent implements OnInit {\n private readonly alertContentRef =\n viewChild<ElementRef<HTMLDivElement>>('alertContent');\n private readonly alertIconRef =\n viewChild<ElementRef<HTMLElement>>('alertIcon');\n private readonly snackbarRef = inject(SnackbarRef);\n\n type = input.required<SnackbarType>();\n message = input.required<string>();\n timeout = input<number>(0);\n timePast = signal(0);\n\n constructor() {\n effect(() => this.addAlertClass());\n effect(() => this.addIconClass());\n }\n\n private addAlertClass() {\n const alertContent = this.alertContentRef()?.nativeElement;\n\n if (alertContent) {\n let className = `alert-${this.type()}`;\n\n switch (this.type()) {\n case 'info':\n className = 'alert-info';\n break;\n case 'success':\n className = 'alert-success';\n break;\n case 'warning':\n className = 'alert-warning';\n break;\n case 'error':\n className = 'alert-error';\n break;\n }\n\n alertContent.classList.add(className);\n }\n }\n\n private addIconClass() {\n const alertIcon = this.alertIconRef()?.nativeElement;\n\n if (alertIcon) {\n let className = '';\n\n switch (this.type()) {\n case 'info':\n className = 'fa-circle-info';\n break;\n case 'success':\n className = 'fa-circle-check';\n break;\n case 'warning':\n className = 'fa-triangle-exclamation';\n break;\n case 'error':\n className = 'fa-circle-xmark';\n break;\n }\n\n alertIcon.classList.add(className);\n }\n }\n\n ngOnInit(): void {\n const timeout = this.timeout();\n\n if (timeout > 0) {\n const timePastInterval = interval(1000)\n .pipe(\n startWith(0),\n map(() => this.timePast.update((past) => past + 1000)),\n map(() => this.timePast())\n )\n .subscribe((timePast) => {\n if (timePast > timeout) {\n timePastInterval?.unsubscribe();\n this.dismiss();\n }\n });\n }\n }\n\n dismiss() {\n this.snackbarRef.dismiss();\n }\n}\n","<div role=\"alert\" #alertContent class=\"relative alert alert-outline bg-base-100! w-full lg:max-w-1/4 rounded-sm text-sm py-3 border-neutral-600\">\n <i #alertIcon class=\"h-4 w-4 shrink-0 stroke-current text-base fa-solid\"></i>\n <span [innerHTML]=\"message()\"></span>\n <div>\n <button class=\"btn btn-xs btn-outline\" (click)=\"dismiss()\">OK</button>\n </div>\n @if (timePast() > 0) {\n <progress class=\"absolute left-0 bottom-0 progress w-full opacity-20\"\n [value]=\"timePast()\"\n [max]=\"timeout()\">\n </progress>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAca,eAAe,GAAG,IAAI,cAAc,CAAC,gBAAgB;MACrD,gBAAgB,GAAG,IAAI,cAAc,CAAC,gBAAgB;MAWtD,QAAQ,CAAA;AACF,IAAA,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC;AAC/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CAAC,IAAI;AACnC,iBAAA,IAAI,CACH,SAAS,CAAC,CAAC,CAAC,EACZ,GAAG,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,IAAI,GAAG,IAAI,CAAC,CAAC,EACtD,GAAG,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;AAE3B,iBAAA,SAAS,CAAC,CAAC,QAAQ,KAAI;AACtB,gBAAA,IAAI,QAAQ,GAAG,OAAO,EAAE;oBACtB,gBAAgB,EAAE,WAAW,EAAE;oBAC/B,IAAI,CAAC,OAAO,EAAE;;AAElB,aAAC,CAAC;;;IAIR,OAAO,GAAA;AACL,QAAA,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE;;uGAvFjB,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAf,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,eAAe,urBCpB5B,yjBAaA,EAAA,CAAA;;2FDOa,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,SAAS;+BACE,qBAAqB,EAAA,QAAA,EAAA,yjBAAA,EAAA;;;AEjBjC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"koalarx-ui-shared-components-snackbar.mjs","sources":["../../projects/koala-ui/shared/components/snackbar/snackbar.ts","../../projects/koala-ui/shared/components/snackbar/snackbar-ref.ts","../../projects/koala-ui/shared/components/snackbar/snackbar-content.ts","../../projects/koala-ui/shared/components/snackbar/snackbar-content.html","../../projects/koala-ui/shared/components/snackbar/koalarx-ui-shared-components-snackbar.ts"],"sourcesContent":["import {\n ApplicationRef,\n createComponent,\n EnvironmentInjector,\n inject,\n Injectable,\n InjectionToken,\n Injector,\n inputBinding,\n} from '@angular/core';\nimport { randomString } from '@koalarx/utils/KlString';\nimport { SnackbarContent } from './snackbar-content';\nimport { SNACKBAR_REF_TOKEN, SnackbarRef } from './snackbar-ref';\n\nexport const SNACKBAR_CONFIG = new InjectionToken('SnackbarConfig');\nexport const SNACKBAR_APP_REF = new InjectionToken('SnackbarAppRef');\n\nexport type SnackbarType = 'info' | 'success' | 'warning' | 'error';\n\nexport interface SnackbarConfig {\n type: SnackbarType;\n message: string;\n timeout?: number;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class Snackbar {\n private readonly appRef = inject(ApplicationRef);\n private readonly injector = inject(EnvironmentInjector);\n\n private generateElementId() {\n let elementId: string;\n\n do {\n elementId = randomString(50, {\n numbers: false,\n lowercase: true,\n uppercase: true,\n specialCharacters: false,\n });\n } while (document.getElementById(elementId));\n\n return elementId;\n }\n\n success(message: string, timeout = 5000) {\n this.open({\n type: 'success',\n message,\n timeout,\n });\n }\n\n warning(message: string, timeout = 5000) {\n this.open({\n type: 'warning',\n message,\n timeout,\n });\n }\n\n error(message: string, timeout = 5000) {\n this.open({\n type: 'error',\n message,\n timeout,\n });\n }\n\n info(message: string, timeout = 5000) {\n this.open({\n type: 'info',\n message,\n timeout,\n });\n }\n\n open(config: SnackbarConfig) {\n const main = document.querySelector<HTMLElement>(\n 'kl-snackbar-container div'\n );\n\n if (main) {\n const elementId = this.generateElementId();\n const container = main.appendChild(document.createElement('div'));\n container.id = elementId;\n container.classList.add('flex', 'item-center', 'justify-end');\n\n const componentRef = createComponent(SnackbarContent, {\n environmentInjector: this.injector,\n hostElement: container,\n elementInjector: Injector.create({\n providers: [\n { provide: SNACKBAR_CONFIG, useValue: config },\n { provide: SNACKBAR_APP_REF, useValue: this.appRef },\n {\n provide: SNACKBAR_REF_TOKEN,\n useValue: () => componentRef,\n },\n {\n provide: SnackbarRef,\n deps: [SNACKBAR_CONFIG, SNACKBAR_APP_REF, SNACKBAR_REF_TOKEN],\n },\n ],\n }),\n bindings: [\n inputBinding('type', () => config.type),\n inputBinding('message', () => config.message),\n inputBinding('timeout', () => config.timeout ?? 0),\n ],\n });\n\n this.appRef.attachView(componentRef.hostView);\n\n componentRef.changeDetectorRef.detectChanges();\n }\n }\n}\n","import {\n ApplicationRef,\n ComponentRef,\n inject,\n Injectable,\n InjectionToken,\n} from '@angular/core';\nimport { SNACKBAR_APP_REF } from './snackbar';\nimport { SnackbarContent } from './snackbar-content';\n\nexport const SNACKBAR_REF_TOKEN = new InjectionToken('SnackbarRefToken');\n\n@Injectable()\nexport class SnackbarRef {\n private readonly appRef = inject<ApplicationRef>(SNACKBAR_APP_REF);\n private readonly componentRef =\n inject<() => ComponentRef<SnackbarContent>>(SNACKBAR_REF_TOKEN);\n\n dismiss() {\n this.componentRef().destroy();\n this.appRef.detachView(this.componentRef().hostView);\n }\n}\n","import {\n Component,\n effect,\n ElementRef,\n inject,\n input,\n OnInit,\n signal,\n viewChild,\n} from '@angular/core';\nimport { SnackbarType } from './snackbar';\nimport { SnackbarRef } from './snackbar-ref';\nimport { interval } from 'rxjs/internal/observable/interval';\nimport { startWith } from 'rxjs/internal/operators/startWith';\nimport { map } from 'rxjs/internal/operators/map';\n\n@Component({\n selector: 'kl-snackbar-content',\n templateUrl: './snackbar-content.html',\n})\nexport class SnackbarContent implements OnInit {\n private readonly alertContentRef =\n viewChild<ElementRef<HTMLDivElement>>('alertContent');\n private readonly alertIconRef =\n viewChild<ElementRef<HTMLElement>>('alertIcon');\n private readonly snackbarRef = inject(SnackbarRef);\n\n type = input.required<SnackbarType>();\n message = input.required<string>();\n timeout = input<number>(0);\n timePast = signal(0);\n\n constructor() {\n effect(() => this.addAlertClass());\n effect(() => this.addIconClass());\n }\n\n private addAlertClass() {\n const alertContent = this.alertContentRef()?.nativeElement;\n\n if (alertContent) {\n let className = `alert-${this.type()}`;\n\n switch (this.type()) {\n case 'info':\n className = 'alert-info';\n break;\n case 'success':\n className = 'alert-success';\n break;\n case 'warning':\n className = 'alert-warning';\n break;\n case 'error':\n className = 'alert-error';\n break;\n }\n\n alertContent.classList.add(className);\n }\n }\n\n private addIconClass() {\n const alertIcon = this.alertIconRef()?.nativeElement;\n\n if (alertIcon) {\n let className = '';\n\n switch (this.type()) {\n case 'info':\n className = 'fa-circle-info';\n break;\n case 'success':\n className = 'fa-circle-check';\n break;\n case 'warning':\n className = 'fa-triangle-exclamation';\n break;\n case 'error':\n className = 'fa-circle-xmark';\n break;\n }\n\n alertIcon.classList.add(className);\n }\n }\n\n ngOnInit(): void {\n const timeout = this.timeout();\n\n if (timeout > 0) {\n const timePastInterval = interval(1000)\n .pipe(\n startWith(0),\n map(() => this.timePast.update((past) => past + 1000)),\n map(() => this.timePast())\n )\n .subscribe((timePast) => {\n if (timePast > timeout) {\n timePastInterval?.unsubscribe();\n this.dismiss();\n }\n });\n }\n }\n\n dismiss() {\n this.snackbarRef.dismiss();\n }\n}\n","<div role=\"alert\" #alertContent class=\"relative alert alert-outline bg-base-100! w-full lg:max-w-1/4 rounded-sm text-sm py-3 border-neutral-600\">\n <i #alertIcon class=\"h-4 w-4 shrink-0 stroke-current text-base fa-solid\"></i>\n <span [innerHTML]=\"message()\"></span>\n <div>\n <button class=\"btn btn-xs btn-outline\" (click)=\"dismiss()\">OK</button>\n </div>\n @if (timePast() > 0) {\n <progress class=\"absolute left-0 bottom-0 progress w-full opacity-20\"\n [value]=\"timePast()\"\n [max]=\"timeout()\">\n </progress>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAca,eAAe,GAAG,IAAI,cAAc,CAAC,gBAAgB;MACrD,gBAAgB,GAAG,IAAI,cAAc,CAAC,gBAAgB;MAWtD,QAAQ,CAAA;AACF,IAAA,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC;AAC/B,IAAA,QAAQ,GAAG,MAAM,CAAC,mBAAmB,CAAC;IAE/C,iBAAiB,GAAA;AACvB,QAAA,IAAI,SAAiB;AAErB,QAAA,GAAG;AACD,YAAA,SAAS,GAAG,YAAY,CAAC,EAA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,GAAG,IAAI,CAAC,CAAC,EACtD,GAAG,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;AAE3B,iBAAA,SAAS,CAAC,CAAC,QAAQ,KAAI;AACtB,gBAAA,IAAI,QAAQ,GAAG,OAAO,EAAE;oBACtB,gBAAgB,EAAE,WAAW,EAAE;oBAC/B,IAAI,CAAC,OAAO,EAAE;;AAElB,aAAC,CAAC;;;IAIR,OAAO,GAAA;AACL,QAAA,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE;;uGAvFjB,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAf,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,eAAe,urBCpB5B,yjBAaA,EAAA,CAAA;;2FDOa,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,SAAS;+BACE,qBAAqB,EAAA,QAAA,EAAA,yjBAAA,EAAA;;;AEjBjC;;AAEG;;;;"}
|
|
@@ -7,19 +7,19 @@ class StepGroup {
|
|
|
7
7
|
ngOnInit() {
|
|
8
8
|
this.elementRef.nativeElement.classList.add('steps');
|
|
9
9
|
}
|
|
10
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
11
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.
|
|
10
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: StepGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
11
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.6", type: StepGroup, isStandalone: true, selector: "ul[klStepGroup]", ngImport: i0 });
|
|
12
12
|
}
|
|
13
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
13
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: StepGroup, decorators: [{
|
|
14
14
|
type: Directive,
|
|
15
15
|
args: [{ selector: 'ul[klStepGroup]' }]
|
|
16
16
|
}] });
|
|
17
17
|
|
|
18
18
|
class StepItem {
|
|
19
19
|
elementRef = inject((ElementRef));
|
|
20
|
-
label = input.required();
|
|
21
|
-
indexStep = signal(0);
|
|
22
|
-
currentStep = input.required();
|
|
20
|
+
label = input.required(...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
21
|
+
indexStep = signal(0, ...(ngDevMode ? [{ debugName: "indexStep" }] : []));
|
|
22
|
+
currentStep = input.required(...(ngDevMode ? [{ debugName: "currentStep" }] : []));
|
|
23
23
|
constructor() {
|
|
24
24
|
effect(() => {
|
|
25
25
|
const currentStep = this.currentStep();
|
|
@@ -54,16 +54,16 @@ class StepItem {
|
|
|
54
54
|
this.elementRef.nativeElement.classList.add('step');
|
|
55
55
|
this.elementRef.nativeElement.innerText = this.label();
|
|
56
56
|
}
|
|
57
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
58
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.
|
|
57
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: StepItem, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
58
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.6", type: StepItem, isStandalone: true, selector: "li[klStepItem]", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, currentStep: { classPropertyName: "currentStep", publicName: "currentStep", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
|
|
59
59
|
}
|
|
60
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
60
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: StepItem, decorators: [{
|
|
61
61
|
type: Directive,
|
|
62
62
|
args: [{ selector: 'li[klStepItem]' }]
|
|
63
63
|
}], ctorParameters: () => [] });
|
|
64
64
|
|
|
65
65
|
class Stepper {
|
|
66
|
-
_currentStep = signal(1);
|
|
66
|
+
_currentStep = signal(1, ...(ngDevMode ? [{ debugName: "_currentStep" }] : []));
|
|
67
67
|
get currentStep() {
|
|
68
68
|
return this._currentStep.asReadonly();
|
|
69
69
|
}
|
|
@@ -73,10 +73,10 @@ class Stepper {
|
|
|
73
73
|
previous() {
|
|
74
74
|
this._currentStep.update((step) => (step > 1 ? step - 1 : step));
|
|
75
75
|
}
|
|
76
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
77
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
76
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Stepper, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
77
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Stepper });
|
|
78
78
|
}
|
|
79
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
79
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Stepper, decorators: [{
|
|
80
80
|
type: Injectable
|
|
81
81
|
}] });
|
|
82
82
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"koalarx-ui-shared-components-stepper.mjs","sources":["../../projects/koala-ui/shared/components/stepper/step-group.ts","../../projects/koala-ui/shared/components/stepper/step-item.ts","../../projects/koala-ui/shared/components/stepper/stepper.ts","../../projects/koala-ui/shared/components/stepper/koalarx-ui-shared-components-stepper.ts"],"sourcesContent":["import { Directive, ElementRef, inject, OnInit } from '@angular/core';\n\n@Directive({ selector: 'ul[klStepGroup]' })\nexport class StepGroup implements OnInit {\n private readonly elementRef = inject<ElementRef<HTMLUListElement>>(\n ElementRef<HTMLButtonElement>\n );\n\n ngOnInit(): void {\n this.elementRef.nativeElement.classList.add('steps');\n }\n}\n","import {\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n OnInit,\n signal,\n} from '@angular/core';\nimport { generateQuerySelector } from '@koalarx/ui/shared/utils';\n\n@Directive({ selector: 'li[klStepItem]' })\nexport class StepItem implements OnInit {\n private readonly elementRef = inject<ElementRef<HTMLLIElement>>(\n ElementRef<HTMLButtonElement>\n );\n\n label = input.required<string>();\n indexStep = signal<number>(0);\n currentStep = input.required<number>();\n\n constructor() {\n effect(() => {\n const currentStep = this.currentStep();\n const stepIndex = this.getStepIndex();\n\n if (stepIndex < currentStep) {\n this.elementRef.nativeElement.classList.add('step-primary');\n this.elementRef.nativeElement.dataset['content'] = '✓';\n } else if (currentStep === stepIndex) {\n this.elementRef.nativeElement.classList.add('step-primary');\n delete this.elementRef.nativeElement.dataset['content'];\n } else {\n this.elementRef.nativeElement.classList.remove('step-primary');\n delete this.elementRef.nativeElement.dataset['content'];\n }\n });\n }\n\n private getStepIndex(): number {\n const elementSelector = generateQuerySelector(\n this.elementRef.nativeElement\n );\n const elements = document.querySelectorAll(elementSelector);\n\n let elementCountPosition = 0;\n\n elements.forEach((el, index) => {\n if (el === this.elementRef.nativeElement) {\n elementCountPosition = index + 1;\n return;\n }\n });\n\n return elementCountPosition;\n }\n\n ngOnInit(): void {\n this.elementRef.nativeElement.classList.add('step');\n this.elementRef.nativeElement.innerText = this.label();\n }\n}\n","import { Injectable, signal } from '@angular/core';\n\n@Injectable()\nexport class Stepper {\n private readonly _currentStep = signal<number>(1);\n\n get currentStep() {\n return this._currentStep.asReadonly();\n }\n\n next() {\n this._currentStep.update((step) => step + 1);\n }\n\n previous() {\n this._currentStep.update((step) => (step > 1 ? step - 1 : step));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAGa,SAAS,CAAA;AACH,IAAA,UAAU,GAAG,MAAM,EAClC,UAA6B,EAC9B;IAED,QAAQ,GAAA;QACN,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC;;uGAN3C,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAT,SAAS,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAT,SAAS,EAAA,UAAA,EAAA,CAAA;kBADrB,SAAS;mBAAC,EAAE,QAAQ,EAAE,iBAAiB,EAAE;;;MCU7B,QAAQ,CAAA;AACF,IAAA,UAAU,GAAG,MAAM,EAClC,UAA6B,EAC9B;AAED,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"koalarx-ui-shared-components-stepper.mjs","sources":["../../projects/koala-ui/shared/components/stepper/step-group.ts","../../projects/koala-ui/shared/components/stepper/step-item.ts","../../projects/koala-ui/shared/components/stepper/stepper.ts","../../projects/koala-ui/shared/components/stepper/koalarx-ui-shared-components-stepper.ts"],"sourcesContent":["import { Directive, ElementRef, inject, OnInit } from '@angular/core';\n\n@Directive({ selector: 'ul[klStepGroup]' })\nexport class StepGroup implements OnInit {\n private readonly elementRef = inject<ElementRef<HTMLUListElement>>(\n ElementRef<HTMLButtonElement>\n );\n\n ngOnInit(): void {\n this.elementRef.nativeElement.classList.add('steps');\n }\n}\n","import {\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n OnInit,\n signal,\n} from '@angular/core';\nimport { generateQuerySelector } from '@koalarx/ui/shared/utils';\n\n@Directive({ selector: 'li[klStepItem]' })\nexport class StepItem implements OnInit {\n private readonly elementRef = inject<ElementRef<HTMLLIElement>>(\n ElementRef<HTMLButtonElement>\n );\n\n label = input.required<string>();\n indexStep = signal<number>(0);\n currentStep = input.required<number>();\n\n constructor() {\n effect(() => {\n const currentStep = this.currentStep();\n const stepIndex = this.getStepIndex();\n\n if (stepIndex < currentStep) {\n this.elementRef.nativeElement.classList.add('step-primary');\n this.elementRef.nativeElement.dataset['content'] = '✓';\n } else if (currentStep === stepIndex) {\n this.elementRef.nativeElement.classList.add('step-primary');\n delete this.elementRef.nativeElement.dataset['content'];\n } else {\n this.elementRef.nativeElement.classList.remove('step-primary');\n delete this.elementRef.nativeElement.dataset['content'];\n }\n });\n }\n\n private getStepIndex(): number {\n const elementSelector = generateQuerySelector(\n this.elementRef.nativeElement\n );\n const elements = document.querySelectorAll(elementSelector);\n\n let elementCountPosition = 0;\n\n elements.forEach((el, index) => {\n if (el === this.elementRef.nativeElement) {\n elementCountPosition = index + 1;\n return;\n }\n });\n\n return elementCountPosition;\n }\n\n ngOnInit(): void {\n this.elementRef.nativeElement.classList.add('step');\n this.elementRef.nativeElement.innerText = this.label();\n }\n}\n","import { Injectable, signal } from '@angular/core';\n\n@Injectable()\nexport class Stepper {\n private readonly _currentStep = signal<number>(1);\n\n get currentStep() {\n return this._currentStep.asReadonly();\n }\n\n next() {\n this._currentStep.update((step) => step + 1);\n }\n\n previous() {\n this._currentStep.update((step) => (step > 1 ? step - 1 : step));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAGa,SAAS,CAAA;AACH,IAAA,UAAU,GAAG,MAAM,EAClC,UAA6B,EAC9B;IAED,QAAQ,GAAA;QACN,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC;;uGAN3C,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EA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,GAAA;AACb,QAAA,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE;;IAGvC,IAAI,GAAA;AACF,QAAA,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,IAAI,GAAG,CAAC,CAAC;;IAG9C,QAAQ,GAAA;QACN,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,IAAI,MAAM,IAAI,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;;uGAZvD,OAAO,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;2GAAP,OAAO,EAAA,CAAA;;2FAAP,OAAO,EAAA,UAAA,EAAA,CAAA;kBADnB;;;ACFD;;AAEG;;;;"}
|
|
@@ -3,20 +3,20 @@ import { Component, input } from '@angular/core';
|
|
|
3
3
|
import { RouterLink, RouterLinkActive } from '@angular/router';
|
|
4
4
|
|
|
5
5
|
class VerticalMenuContainer {
|
|
6
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
7
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.
|
|
6
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: VerticalMenuContainer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: VerticalMenuContainer, isStandalone: true, selector: "kl-vertical-menu-container", ngImport: i0, template: "<ul class=\"menu rounded-box w-full\">\n <li class=\"menu-title\">\n <ng-content select=\"[title]\" />\n </li>\n <ng-content select=\"[items]\" />\n</ul>\n" });
|
|
8
8
|
}
|
|
9
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
9
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: VerticalMenuContainer, decorators: [{
|
|
10
10
|
type: Component,
|
|
11
11
|
args: [{ selector: 'kl-vertical-menu-container', template: "<ul class=\"menu rounded-box w-full\">\n <li class=\"menu-title\">\n <ng-content select=\"[title]\" />\n </li>\n <ng-content select=\"[items]\" />\n</ul>\n" }]
|
|
12
12
|
}] });
|
|
13
13
|
|
|
14
14
|
class VerticalMenuItem {
|
|
15
|
-
link = input.required();
|
|
16
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
17
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.
|
|
15
|
+
link = input.required(...(ngDevMode ? [{ debugName: "link" }] : []));
|
|
16
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: VerticalMenuItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
17
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.6", type: VerticalMenuItem, isStandalone: true, selector: "kl-vertical-menu-item", inputs: { link: { classPropertyName: "link", publicName: "link", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<li>\n <a class=\"opacity-70\"\n [routerLink]=\"link()\"\n routerLinkActive=\"opacity-100\">\n <ng-content />\n </a>\n</li>\n", dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }] });
|
|
18
18
|
}
|
|
19
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
19
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: VerticalMenuItem, decorators: [{
|
|
20
20
|
type: Component,
|
|
21
21
|
args: [{ selector: 'kl-vertical-menu-item', imports: [RouterLink, RouterLinkActive], template: "<li>\n <a class=\"opacity-70\"\n [routerLink]=\"link()\"\n routerLinkActive=\"opacity-100\">\n <ng-content />\n </a>\n</li>\n" }]
|
|
22
22
|
}] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"koalarx-ui-shared-components-vertical-menu.mjs","sources":["../../projects/koala-ui/shared/components/vertical-menu/vertical-menu-container.ts","../../projects/koala-ui/shared/components/vertical-menu/vertical-menu-container.html","../../projects/koala-ui/shared/components/vertical-menu/vertical-menu-item.ts","../../projects/koala-ui/shared/components/vertical-menu/vertical-menu-item.html","../../projects/koala-ui/shared/components/vertical-menu/koalarx-ui-shared-components-vertical-menu.ts"],"sourcesContent":["import { Component } from '@angular/core';\n\n@Component({\n selector: 'kl-vertical-menu-container',\n templateUrl: './vertical-menu-container.html',\n})\nexport class VerticalMenuContainer {}\n","<ul class=\"menu rounded-box w-full\">\n <li class=\"menu-title\">\n <ng-content select=\"[title]\" />\n </li>\n <ng-content select=\"[items]\" />\n</ul>\n","import { Component, input } from '@angular/core';\nimport { RouterLink, RouterLinkActive } from '@angular/router';\n\n@Component({\n selector: 'kl-vertical-menu-item',\n templateUrl: './vertical-menu-item.html',\n imports: [RouterLink, RouterLinkActive],\n})\nexport class VerticalMenuItem {\n link = input.required<string>();\n}\n","<li>\n <a class=\"opacity-70\"\n [routerLink]=\"link()\"\n routerLinkActive=\"opacity-100\">\n <ng-content />\n </a>\n</li>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAMa,qBAAqB,CAAA;uGAArB,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAArB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,qBAAqB,sFCNlC,mKAMA,EAAA,CAAA;;2FDAa,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAJjC,SAAS;+BACE,4BAA4B,EAAA,QAAA,EAAA,mKAAA,EAAA;;;MEK3B,gBAAgB,CAAA;AAC3B,IAAA,IAAI,GAAG,KAAK,CAAC,QAAQ
|
|
1
|
+
{"version":3,"file":"koalarx-ui-shared-components-vertical-menu.mjs","sources":["../../projects/koala-ui/shared/components/vertical-menu/vertical-menu-container.ts","../../projects/koala-ui/shared/components/vertical-menu/vertical-menu-container.html","../../projects/koala-ui/shared/components/vertical-menu/vertical-menu-item.ts","../../projects/koala-ui/shared/components/vertical-menu/vertical-menu-item.html","../../projects/koala-ui/shared/components/vertical-menu/koalarx-ui-shared-components-vertical-menu.ts"],"sourcesContent":["import { Component } from '@angular/core';\n\n@Component({\n selector: 'kl-vertical-menu-container',\n templateUrl: './vertical-menu-container.html',\n})\nexport class VerticalMenuContainer {}\n","<ul class=\"menu rounded-box w-full\">\n <li class=\"menu-title\">\n <ng-content select=\"[title]\" />\n </li>\n <ng-content select=\"[items]\" />\n</ul>\n","import { Component, input } from '@angular/core';\nimport { RouterLink, RouterLinkActive } from '@angular/router';\n\n@Component({\n selector: 'kl-vertical-menu-item',\n templateUrl: './vertical-menu-item.html',\n imports: [RouterLink, RouterLinkActive],\n})\nexport class VerticalMenuItem {\n link = input.required<string>();\n}\n","<li>\n <a class=\"opacity-70\"\n [routerLink]=\"link()\"\n routerLinkActive=\"opacity-100\">\n <ng-content />\n </a>\n</li>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAMa,qBAAqB,CAAA;uGAArB,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAA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AAuB,EAAA,OAAA,EAExB,CAAC,UAAU,EAAE,gBAAgB,CAAC,EAAA,QAAA,EAAA,0IAAA,EAAA;;;AENzC;;AAEG;;;;"}
|
|
@@ -8,7 +8,7 @@ import { Loader } from '@koalarx/ui/core/components/loader';
|
|
|
8
8
|
|
|
9
9
|
class HookChange {
|
|
10
10
|
viewContainerRef = inject(ViewContainerRef);
|
|
11
|
-
hookChange = input.required();
|
|
11
|
+
hookChange = input.required(...(ngDevMode ? [{ debugName: "hookChange" }] : []));
|
|
12
12
|
constructor() {
|
|
13
13
|
effect(() => {
|
|
14
14
|
this.hookChange();
|
|
@@ -18,10 +18,10 @@ class HookChange {
|
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
22
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.
|
|
21
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: HookChange, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
22
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.6", type: HookChange, isStandalone: true, selector: "[hookChange]", inputs: { hookChange: { classPropertyName: "hookChange", publicName: "hookChange", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
|
|
23
23
|
}
|
|
24
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
24
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: HookChange, decorators: [{
|
|
25
25
|
type: Directive,
|
|
26
26
|
args: [{ selector: '[hookChange]' }]
|
|
27
27
|
}], ctorParameters: () => [] });
|
|
@@ -35,7 +35,7 @@ class InputMask {
|
|
|
35
35
|
get input() {
|
|
36
36
|
return this.elementRef.nativeElement;
|
|
37
37
|
}
|
|
38
|
-
mask = input.required();
|
|
38
|
+
mask = input.required(...(ngDevMode ? [{ debugName: "mask" }] : []));
|
|
39
39
|
constructor() {
|
|
40
40
|
effect(() => {
|
|
41
41
|
const mask = this.mask();
|
|
@@ -53,10 +53,10 @@ class InputMask {
|
|
|
53
53
|
setValue(value) {
|
|
54
54
|
this.input.value = value;
|
|
55
55
|
}
|
|
56
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
57
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.
|
|
56
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: InputMask, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
57
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.6", type: InputMask, isStandalone: true, selector: "input[mask]", inputs: { mask: { classPropertyName: "mask", publicName: "mask", isSignal: true, isRequired: true, transformFunction: null } }, providers: [NgxMaskPipe], ngImport: i0 });
|
|
58
58
|
}
|
|
59
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
59
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: InputMask, decorators: [{
|
|
60
60
|
type: Directive,
|
|
61
61
|
args: [{ selector: 'input[mask]', providers: [NgxMaskPipe] }]
|
|
62
62
|
}], ctorParameters: () => [] });
|
|
@@ -65,7 +65,7 @@ class InputCurrencyMask {
|
|
|
65
65
|
elementRef = inject((ElementRef));
|
|
66
66
|
appConfig = inject(AppConfig);
|
|
67
67
|
writedValue = 0.0;
|
|
68
|
-
decimalCount = input(2);
|
|
68
|
+
decimalCount = input(2, ...(ngDevMode ? [{ debugName: "decimalCount" }] : []));
|
|
69
69
|
currencyValue = output();
|
|
70
70
|
maskCoin(value) {
|
|
71
71
|
let prefix = '$';
|
|
@@ -178,10 +178,10 @@ class InputCurrencyMask {
|
|
|
178
178
|
this.onReset();
|
|
179
179
|
setTimeout(() => this.applyMask());
|
|
180
180
|
}
|
|
181
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
182
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.
|
|
181
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: InputCurrencyMask, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
182
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.6", type: InputCurrencyMask, isStandalone: true, selector: "input[currencyMask]", inputs: { decimalCount: { classPropertyName: "decimalCount", publicName: "decimalCount", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { currencyValue: "currencyValue" }, providers: [NgxMaskPipe], ngImport: i0 });
|
|
183
183
|
}
|
|
184
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
184
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: InputCurrencyMask, decorators: [{
|
|
185
185
|
type: Directive,
|
|
186
186
|
args: [{
|
|
187
187
|
selector: 'input[currencyMask]',
|
|
@@ -191,8 +191,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
191
191
|
|
|
192
192
|
class Tooltip {
|
|
193
193
|
elementRef = inject((ElementRef));
|
|
194
|
-
tooltip = input.required();
|
|
195
|
-
tooltipPosition = input('top');
|
|
194
|
+
tooltip = input.required(...(ngDevMode ? [{ debugName: "tooltip" }] : []));
|
|
195
|
+
tooltipPosition = input('top', ...(ngDevMode ? [{ debugName: "tooltipPosition" }] : []));
|
|
196
196
|
constructor() {
|
|
197
197
|
effect(() => {
|
|
198
198
|
const element = this.elementRef.nativeElement;
|
|
@@ -215,10 +215,10 @@ class Tooltip {
|
|
|
215
215
|
}
|
|
216
216
|
});
|
|
217
217
|
}
|
|
218
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
219
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.
|
|
218
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Tooltip, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
219
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.6", type: Tooltip, isStandalone: true, selector: "[tooltip]", inputs: { tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: true, transformFunction: null }, tooltipPosition: { classPropertyName: "tooltipPosition", publicName: "tooltipPosition", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
220
220
|
}
|
|
221
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
221
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Tooltip, decorators: [{
|
|
222
222
|
type: Directive,
|
|
223
223
|
args: [{ selector: '[tooltip]' }]
|
|
224
224
|
}], ctorParameters: () => [] });
|
|
@@ -228,14 +228,14 @@ class Button {
|
|
|
228
228
|
appRef = inject(ApplicationRef);
|
|
229
229
|
injector = inject(EnvironmentInjector);
|
|
230
230
|
loaderComponent = null;
|
|
231
|
-
color = input('neutral');
|
|
232
|
-
type = input('button');
|
|
233
|
-
circle = input(false, { transform: booleanAttribute });
|
|
234
|
-
outline = input(false, { transform: booleanAttribute });
|
|
235
|
-
soft = input(false, { transform: booleanAttribute });
|
|
236
|
-
showLoader = input(false, { transform: booleanAttribute });
|
|
237
|
-
disabled = input(false, { transform: booleanAttribute });
|
|
238
|
-
size = input('medium');
|
|
231
|
+
color = input('neutral', ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
232
|
+
type = input('button', ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
233
|
+
circle = input(false, ...(ngDevMode ? [{ debugName: "circle", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
234
|
+
outline = input(false, ...(ngDevMode ? [{ debugName: "outline", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
235
|
+
soft = input(false, ...(ngDevMode ? [{ debugName: "soft", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
236
|
+
showLoader = input(false, ...(ngDevMode ? [{ debugName: "showLoader", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
237
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
238
|
+
size = input('medium', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
239
239
|
constructor() {
|
|
240
240
|
effect(() => this.toggleLoader(this.showLoader()));
|
|
241
241
|
effect(() => {
|
|
@@ -325,10 +325,10 @@ class Button {
|
|
|
325
325
|
this.elementRef.nativeElement.classList.add('btn-soft');
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
329
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.
|
|
328
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Button, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
329
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.6", type: Button, isStandalone: true, selector: "button[klButton], a[klButton]", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, circle: { classPropertyName: "circle", publicName: "circle", isSignal: true, isRequired: false, transformFunction: null }, outline: { classPropertyName: "outline", publicName: "outline", isSignal: true, isRequired: false, transformFunction: null }, soft: { classPropertyName: "soft", publicName: "soft", isSignal: true, isRequired: false, transformFunction: null }, showLoader: { classPropertyName: "showLoader", publicName: "showLoader", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
330
330
|
}
|
|
331
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
331
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Button, decorators: [{
|
|
332
332
|
type: Directive,
|
|
333
333
|
args: [{ selector: 'button[klButton], a[klButton]' }]
|
|
334
334
|
}], ctorParameters: () => [] });
|