@nxa-lab/nxa-ui 0.3.6
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/nxa-lab-nxa-ui.mjs +3571 -0
- package/fesm2022/nxa-lab-nxa-ui.mjs.map +1 -0
- package/package.json +37 -0
- package/styles/_layers.css +5 -0
- package/styles/_safelist.css +133 -0
- package/styles/_variables.css +4 -0
- package/styles/animations.css +80 -0
- package/styles/components/buttons.css +15 -0
- package/styles/components/modals.css +3 -0
- package/styles/components/nxa-drawer.css +55 -0
- package/styles/components/progress-api-call.css +5 -0
- package/styles/components/text.css +195 -0
- package/styles/inputs/nxa-radio.css +3 -0
- package/styles/layouts/host.css +3 -0
- package/styles/layouts/nxa-page.css +0 -0
- package/styles/main.css +18 -0
- package/types/nxa-lab-nxa-ui.d.ts +1463 -0
|
@@ -0,0 +1,3571 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, signal, EventEmitter, computed, Output, Input, ChangeDetectionStrategy, ViewEncapsulation, effect, forwardRef, Injectable, InjectionToken, inject, Injector, contentChildren, HostBinding, Directive, ElementRef, NgZone, viewChild, ViewContainerRef, HostListener } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import { RouterLink, RouterLinkActive } from '@angular/router';
|
|
6
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
7
|
+
import { provideIcons, NgIcon } from '@ng-icons/core';
|
|
8
|
+
import { heroChevronUpSolid, heroChevronDownSolid } from '@ng-icons/heroicons/solid';
|
|
9
|
+
import { BehaviorSubject, map, throttleTime, isObservable, firstValueFrom, timer, switchMap, finalize } from 'rxjs';
|
|
10
|
+
import { HttpContextToken } from '@angular/common/http';
|
|
11
|
+
import { Overlay, OverlayPositionBuilder } from '@angular/cdk/overlay';
|
|
12
|
+
import { ComponentPortal } from '@angular/cdk/portal';
|
|
13
|
+
import { bootstrapInfoCircle } from '@ng-icons/bootstrap-icons';
|
|
14
|
+
import { heroChevronLeft, heroChevronRight } from '@ng-icons/heroicons/outline';
|
|
15
|
+
import * as i2 from '@angular/cdk/scrolling';
|
|
16
|
+
import { ScrollingModule } from '@angular/cdk/scrolling';
|
|
17
|
+
import { moveItemInArray, CdkDrag, CdkDropList } from '@angular/cdk/drag-drop';
|
|
18
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
19
|
+
import { toSignal, toObservable } from '@angular/core/rxjs-interop';
|
|
20
|
+
|
|
21
|
+
const NXA_COLORS_ALL = [
|
|
22
|
+
'primary',
|
|
23
|
+
'secondary',
|
|
24
|
+
'accent',
|
|
25
|
+
'neutral',
|
|
26
|
+
'info',
|
|
27
|
+
'warning',
|
|
28
|
+
'error',
|
|
29
|
+
'success',
|
|
30
|
+
'content',
|
|
31
|
+
'ghost',
|
|
32
|
+
'link',
|
|
33
|
+
];
|
|
34
|
+
const NXA_NEUTRAL_COLORS = [
|
|
35
|
+
'neutral'
|
|
36
|
+
];
|
|
37
|
+
const NXA_CONTENT_COLORS = [
|
|
38
|
+
'content'
|
|
39
|
+
];
|
|
40
|
+
const NXA_BRAND_COLORS = [
|
|
41
|
+
'primary',
|
|
42
|
+
'secondary',
|
|
43
|
+
'accent',
|
|
44
|
+
];
|
|
45
|
+
const NXA_STATUS_COLORS = [
|
|
46
|
+
'info',
|
|
47
|
+
'success',
|
|
48
|
+
'warning',
|
|
49
|
+
'error',
|
|
50
|
+
];
|
|
51
|
+
|
|
52
|
+
function applyMixins(derivedCtor, constructors) {
|
|
53
|
+
constructors.forEach((baseCtor) => {
|
|
54
|
+
Object.getOwnPropertyNames(baseCtor.prototype).forEach((name) => {
|
|
55
|
+
Object.defineProperty(derivedCtor.prototype, name, Object.getOwnPropertyDescriptor(baseCtor.prototype, name) ||
|
|
56
|
+
Object.create(null));
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const NXA_SIZES = [
|
|
62
|
+
'xs',
|
|
63
|
+
'sm',
|
|
64
|
+
'md',
|
|
65
|
+
'lg',
|
|
66
|
+
'xl'
|
|
67
|
+
];
|
|
68
|
+
|
|
69
|
+
const NXA_HOST_CONTENTS_ONLY = 'contents';
|
|
70
|
+
const NXA_HOST_BLOCK = 'block min-h-0 basis-fit h-fit flex-1 max-h-full w-full max-w-full inset-0 box-border';
|
|
71
|
+
const NXA_HOST_LAYOUT = 'w-full h-full min-h-0 flex flex-col flex-1';
|
|
72
|
+
function sanitizeIcon(icon, sanitizer) {
|
|
73
|
+
return sanitizer.bypassSecurityTrustHtml(icon);
|
|
74
|
+
}
|
|
75
|
+
function isBrowserContext() {
|
|
76
|
+
return typeof document !== "undefined";
|
|
77
|
+
}
|
|
78
|
+
function isServerContext() {
|
|
79
|
+
return typeof document === "undefined";
|
|
80
|
+
}
|
|
81
|
+
function shallowEqual(obj1, obj2) {
|
|
82
|
+
if (obj1 === obj2)
|
|
83
|
+
return true;
|
|
84
|
+
if (!obj1 || !obj2)
|
|
85
|
+
return false;
|
|
86
|
+
const keys1 = Object.keys(obj1);
|
|
87
|
+
const keys2 = Object.keys(obj2);
|
|
88
|
+
if (keys1.length !== keys2.length)
|
|
89
|
+
return false;
|
|
90
|
+
for (const key of keys1) {
|
|
91
|
+
if (obj1[key] !== obj2[key])
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
function deepEqual(a, b) {
|
|
97
|
+
if (a === b)
|
|
98
|
+
return true;
|
|
99
|
+
// Handle NaN
|
|
100
|
+
if (typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b)) {
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
if (typeof a !== 'object' || a === null ||
|
|
104
|
+
typeof b !== 'object' || b === null) {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
// Date
|
|
108
|
+
if (a instanceof Date && b instanceof Date) {
|
|
109
|
+
return a.getTime() === b.getTime();
|
|
110
|
+
}
|
|
111
|
+
// RegExp
|
|
112
|
+
if (a instanceof RegExp && b instanceof RegExp) {
|
|
113
|
+
return a.toString() === b.toString();
|
|
114
|
+
}
|
|
115
|
+
// Arrays
|
|
116
|
+
if (Array.isArray(a) !== Array.isArray(b))
|
|
117
|
+
return false;
|
|
118
|
+
const keysA = Object.keys(a);
|
|
119
|
+
const keysB = Object.keys(b);
|
|
120
|
+
if (keysA.length !== keysB.length)
|
|
121
|
+
return false;
|
|
122
|
+
for (const key of keysA) {
|
|
123
|
+
if (!keysB.includes(key))
|
|
124
|
+
return false;
|
|
125
|
+
if (!deepEqual(a[key], b[key]))
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
return true;
|
|
129
|
+
}
|
|
130
|
+
function getStyleVariable(name) {
|
|
131
|
+
return getComputedStyle(document.documentElement).getPropertyValue(`${name}`).trim();
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
class NxaFormControl {
|
|
135
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaFormControl, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
136
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.5", type: NxaFormControl, isStandalone: true, selector: "nxa-form-control", host: { properties: { "attr.id": "null" }, classAttribute: "block min-h-0 basis-fit h-fit flex-1 max-h-full w-full max-w-full inset-0 box-border" }, ngImport: i0, template: "<!-- container -->\n<div class=\"nxa-form-control-container\">\n <!-- Top Label Container -->\n <div class=\"nxa-form-control-top\">\n <div>\n <ng-content select=\"[top-left]\"></ng-content>\n </div>\n <div>\n <ng-content select=\"[top-right]\"></ng-content>\n </div>\n </div>\n <!-- Input container -->\n <div class=\"nxa-form-control-input-container\">\n <div>\n <ng-content select=\"[leading]\"></ng-content>\n </div>\n <ng-content select=\"\"></ng-content>\n <div>\n <ng-content select=\"[trailing]\"></ng-content>\n </div>\n\n </div>\n <!-- Bottom Label Container -->\n <div class=\"nxa-form-control-bottom\">\n <div>\n <ng-content select=\"[bottom-left]\"></ng-content>\n </div>\n <div>\n <ng-content select=\"[bottom-right]\"></ng-content>\n </div>\n </div>\n</div>\n<!-- Error message Container -->\n<div class=\"nxa-form-control-error-message\">\n <ng-content select=\"[error-message]\"></ng-content>\n</div>", styles: [".nxa-form-control-container{width:100%;min-width:calc(var(--spacing, .25rem) * 10)}.nxa-form-control-input-container{display:flex;width:100%;flex-direction:row;align-items:center;padding-top:calc(var(--spacing, .25rem) * 0)}.nxa-form-control-top{width:100%;flex-direction:row;justify-content:space-between;padding-bottom:calc(var(--spacing, .25rem) * 0)}@layer daisyui.l1.l2.l3{.nxa-form-control-top{display:inline-flex;align-items:center;gap:.375rem;white-space:nowrap;color:currentcolor}@supports (color: color-mix(in lab,red,red)){.nxa-form-control-top{color:color-mix(in oklab,currentcolor 60%,transparent)}}.nxa-form-control-top:has(input){cursor:pointer}.nxa-form-control-top:is(.input>*,.select>*){display:flex;height:calc(100% - .5rem);align-items:center;padding-inline:.75rem;white-space:nowrap;font-size:inherit}.nxa-form-control-top:is(.input>*,.select>*):first-child{margin-inline-start:-.75rem;margin-inline-end:.75rem;border-inline-end:var(--border) solid currentColor}@supports (color: color-mix(in lab,red,red)){.nxa-form-control-top:is(.input>*,.select>*):first-child{border-inline-end:var(--border) solid color-mix(in oklab,currentColor 10%,#0000)}}.nxa-form-control-top:is(.input>*,.select>*):last-child{margin-inline-start:.75rem;margin-inline-end:-.75rem;border-inline-start:var(--border) solid currentColor}@supports (color: color-mix(in lab,red,red)){.nxa-form-control-top:is(.input>*,.select>*):last-child{border-inline-start:var(--border) solid color-mix(in oklab,currentColor 10%,#0000)}}}.nxa-form-control-bottom{width:100%;flex-direction:row;justify-content:space-between;padding-bottom:calc(var(--spacing, .25rem) * 0)}@layer daisyui.l1.l2.l3{.nxa-form-control-bottom{display:inline-flex;align-items:center;gap:.375rem;white-space:nowrap;color:currentcolor}@supports (color: color-mix(in lab,red,red)){.nxa-form-control-bottom{color:color-mix(in oklab,currentcolor 60%,transparent)}}.nxa-form-control-bottom:has(input){cursor:pointer}.nxa-form-control-bottom:is(.input>*,.select>*){display:flex;height:calc(100% - .5rem);align-items:center;padding-inline:.75rem;white-space:nowrap;font-size:inherit}.nxa-form-control-bottom:is(.input>*,.select>*):first-child{margin-inline-start:-.75rem;margin-inline-end:.75rem;border-inline-end:var(--border) solid currentColor}@supports (color: color-mix(in lab,red,red)){.nxa-form-control-bottom:is(.input>*,.select>*):first-child{border-inline-end:var(--border) solid color-mix(in oklab,currentColor 10%,#0000)}}.nxa-form-control-bottom:is(.input>*,.select>*):last-child{margin-inline-start:.75rem;margin-inline-end:-.75rem;border-inline-start:var(--border) solid currentColor}@supports (color: color-mix(in lab,red,red)){.nxa-form-control-bottom:is(.input>*,.select>*):last-child{border-inline-start:var(--border) solid color-mix(in oklab,currentColor 10%,#0000)}}}.nxa-form-control-error-message{margin:calc(var(--spacing, .25rem) * 0);display:block;min-height:calc(var(--spacing, .25rem) * 0);width:100%;padding:calc(var(--spacing, .25rem) * 0);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));color:var(--color-error)}@layer base{:where(:root),:root:has(input.theme-controller[value=light]:checked),[data-theme=light]{color-scheme:light;--color-base-100: oklch(100% 0 0);--color-base-200: oklch(98% 0 0);--color-base-300: oklch(95% 0 0);--color-base-content: oklch(21% .006 285.885);--color-primary: oklch(45% .24 277.023);--color-primary-content: oklch(93% .034 272.788);--color-secondary: oklch(65% .241 354.308);--color-secondary-content: oklch(94% .028 342.258);--color-accent: oklch(77% .152 181.912);--color-accent-content: oklch(38% .063 188.416);--color-neutral: oklch(14% .005 285.823);--color-neutral-content: oklch(92% .004 286.32);--color-info: oklch(74% .16 232.661);--color-info-content: oklch(29% .066 243.157);--color-success: oklch(76% .177 163.223);--color-success-content: oklch(37% .077 168.94);--color-warning: oklch(82% .189 84.429);--color-warning-content: oklch(41% .112 45.904);--color-error: oklch(71% .194 13.428);--color-error-content: oklch(27% .105 12.094);--radius-selector: .5rem;--radius-field: .25rem;--radius-box: .5rem;--size-selector: .25rem;--size-field: .25rem;--border: 1px;--depth: 1;--noise: 0}}@layer base{@media(prefers-color-scheme:dark){:root:not([data-theme]){color-scheme:dark;--color-base-100: oklch(25.33% .016 252.42);--color-base-200: oklch(23.26% .014 253.1);--color-base-300: oklch(21.15% .012 254.09);--color-base-content: oklch(97.807% .029 256.847);--color-primary: oklch(58% .233 277.117);--color-primary-content: oklch(96% .018 272.314);--color-secondary: oklch(65% .241 354.308);--color-secondary-content: oklch(94% .028 342.258);--color-accent: oklch(77% .152 181.912);--color-accent-content: oklch(38% .063 188.416);--color-neutral: oklch(14% .005 285.823);--color-neutral-content: oklch(92% .004 286.32);--color-info: oklch(74% .16 232.661);--color-info-content: oklch(29% .066 243.157);--color-success: oklch(76% .177 163.223);--color-success-content: oklch(37% .077 168.94);--color-warning: oklch(82% .189 84.429);--color-warning-content: oklch(41% .112 45.904);--color-error: oklch(71% .194 13.428);--color-error-content: oklch(27% .105 12.094);--radius-selector: .5rem;--radius-field: .25rem;--radius-box: .5rem;--size-selector: .25rem;--size-field: .25rem;--border: 1px;--depth: 1;--noise: 0}}}@layer base{:root:has(input.theme-controller[value=light]:checked),[data-theme=light]{color-scheme:light;--color-base-100: oklch(100% 0 0);--color-base-200: oklch(98% 0 0);--color-base-300: oklch(95% 0 0);--color-base-content: oklch(21% .006 285.885);--color-primary: oklch(45% .24 277.023);--color-primary-content: oklch(93% .034 272.788);--color-secondary: oklch(65% .241 354.308);--color-secondary-content: oklch(94% .028 342.258);--color-accent: oklch(77% .152 181.912);--color-accent-content: oklch(38% .063 188.416);--color-neutral: oklch(14% .005 285.823);--color-neutral-content: oklch(92% .004 286.32);--color-info: oklch(74% .16 232.661);--color-info-content: oklch(29% .066 243.157);--color-success: oklch(76% .177 163.223);--color-success-content: oklch(37% .077 168.94);--color-warning: oklch(82% .189 84.429);--color-warning-content: oklch(41% .112 45.904);--color-error: oklch(71% .194 13.428);--color-error-content: oklch(27% .105 12.094);--radius-selector: .5rem;--radius-field: .25rem;--radius-box: .5rem;--size-selector: .25rem;--size-field: .25rem;--border: 1px;--depth: 1;--noise: 0}}@layer base{:root:has(input.theme-controller[value=dark]:checked),[data-theme=dark]{color-scheme:dark;--color-base-100: oklch(25.33% .016 252.42);--color-base-200: oklch(23.26% .014 253.1);--color-base-300: oklch(21.15% .012 254.09);--color-base-content: oklch(97.807% .029 256.847);--color-primary: oklch(58% .233 277.117);--color-primary-content: oklch(96% .018 272.314);--color-secondary: oklch(65% .241 354.308);--color-secondary-content: oklch(94% .028 342.258);--color-accent: oklch(77% .152 181.912);--color-accent-content: oklch(38% .063 188.416);--color-neutral: oklch(14% .005 285.823);--color-neutral-content: oklch(92% .004 286.32);--color-info: oklch(74% .16 232.661);--color-info-content: oklch(29% .066 243.157);--color-success: oklch(76% .177 163.223);--color-success-content: oklch(37% .077 168.94);--color-warning: oklch(82% .189 84.429);--color-warning-content: oklch(41% .112 45.904);--color-error: oklch(71% .194 13.428);--color-error-content: oklch(27% .105 12.094);--radius-selector: .5rem;--radius-field: .25rem;--radius-box: .5rem;--size-selector: .25rem;--size-field: .25rem;--border: 1px;--depth: 1;--noise: 0}}@layer base{:root{--fx-noise: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.34' numOctaves='4' stitchTiles='stitch'%3E%3C/feTurbulence%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23a)' opacity='0.2'%3E%3C/rect%3E%3C/svg%3E\")}}@layer base{:root{scrollbar-color:currentColor #0000}@supports (color: color-mix(in lab,red,red)){:root{scrollbar-color:color-mix(in oklch,currentColor 35%,#0000) #0000}}}@layer base{@property --radialprogress{syntax: \"<percentage>\"; inherits: true; initial-value: 0%;}}@layer base{:root:not(span){overflow:var(--page-overflow)}}@layer base{:root{background:var(--page-scroll-bg, var(--root-bg));--page-scroll-bg-on: linear-gradient(var(--root-bg, #0000), var(--root-bg, #0000)) var(--root-bg, #0000);--page-scroll-transition-on: background-color .3s ease-out;transition:var(--page-scroll-transition);scrollbar-gutter:var(--page-scroll-gutter, unset);scrollbar-gutter:if(style(--page-has-scroll: 1): var(--page-scroll-gutter, unset) ; else: unset)}@supports (color: color-mix(in lab,red,red)){:root{--page-scroll-bg-on: linear-gradient(var(--root-bg, #0000), var(--root-bg, #0000)) color-mix(in srgb, var(--root-bg, #0000), oklch(0% 0 0) calc(var(--page-has-backdrop, 0) * 40%))}}@keyframes set-page-has-scroll{0%,to{--page-has-scroll: 1}}}@layer base{:root,[data-theme]{background:var(--page-scroll-bg, var(--root-bg));color:var(--color-base-content)}:where(:root,[data-theme]){--root-bg: var(--color-base-100)}}@keyframes rating{0%,40%{scale:1.1;filter:brightness(1.05) contrast(1.05)}}@keyframes dropdown{0%{opacity:0}}@keyframes radio{0%{padding:5px}50%{padding:3px}}@keyframes toast{0%{scale:.9;opacity:0}to{scale:1;opacity:1}}@keyframes rotator{89.9999%,to{--first-item-position: 0 0%}90%,99.9999%{--first-item-position: 0 calc(var(--items) * 100%)}to{translate:0 -100%}}@keyframes skeleton{0%{background-position:150%}to{background-position:-50%}}@keyframes menu{0%{opacity:0}}@keyframes progress{50%{background-position-x:-115%}}\n/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */\n"] });
|
|
137
|
+
}
|
|
138
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaFormControl, decorators: [{
|
|
139
|
+
type: Component,
|
|
140
|
+
args: [{ selector: 'nxa-form-control', host: {
|
|
141
|
+
'[attr.id]': 'null',
|
|
142
|
+
class: NXA_HOST_BLOCK,
|
|
143
|
+
}, template: "<!-- container -->\n<div class=\"nxa-form-control-container\">\n <!-- Top Label Container -->\n <div class=\"nxa-form-control-top\">\n <div>\n <ng-content select=\"[top-left]\"></ng-content>\n </div>\n <div>\n <ng-content select=\"[top-right]\"></ng-content>\n </div>\n </div>\n <!-- Input container -->\n <div class=\"nxa-form-control-input-container\">\n <div>\n <ng-content select=\"[leading]\"></ng-content>\n </div>\n <ng-content select=\"\"></ng-content>\n <div>\n <ng-content select=\"[trailing]\"></ng-content>\n </div>\n\n </div>\n <!-- Bottom Label Container -->\n <div class=\"nxa-form-control-bottom\">\n <div>\n <ng-content select=\"[bottom-left]\"></ng-content>\n </div>\n <div>\n <ng-content select=\"[bottom-right]\"></ng-content>\n </div>\n </div>\n</div>\n<!-- Error message Container -->\n<div class=\"nxa-form-control-error-message\">\n <ng-content select=\"[error-message]\"></ng-content>\n</div>", styles: [".nxa-form-control-container{width:100%;min-width:calc(var(--spacing, .25rem) * 10)}.nxa-form-control-input-container{display:flex;width:100%;flex-direction:row;align-items:center;padding-top:calc(var(--spacing, .25rem) * 0)}.nxa-form-control-top{width:100%;flex-direction:row;justify-content:space-between;padding-bottom:calc(var(--spacing, .25rem) * 0)}@layer daisyui.l1.l2.l3{.nxa-form-control-top{display:inline-flex;align-items:center;gap:.375rem;white-space:nowrap;color:currentcolor}@supports (color: color-mix(in lab,red,red)){.nxa-form-control-top{color:color-mix(in oklab,currentcolor 60%,transparent)}}.nxa-form-control-top:has(input){cursor:pointer}.nxa-form-control-top:is(.input>*,.select>*){display:flex;height:calc(100% - .5rem);align-items:center;padding-inline:.75rem;white-space:nowrap;font-size:inherit}.nxa-form-control-top:is(.input>*,.select>*):first-child{margin-inline-start:-.75rem;margin-inline-end:.75rem;border-inline-end:var(--border) solid currentColor}@supports (color: color-mix(in lab,red,red)){.nxa-form-control-top:is(.input>*,.select>*):first-child{border-inline-end:var(--border) solid color-mix(in oklab,currentColor 10%,#0000)}}.nxa-form-control-top:is(.input>*,.select>*):last-child{margin-inline-start:.75rem;margin-inline-end:-.75rem;border-inline-start:var(--border) solid currentColor}@supports (color: color-mix(in lab,red,red)){.nxa-form-control-top:is(.input>*,.select>*):last-child{border-inline-start:var(--border) solid color-mix(in oklab,currentColor 10%,#0000)}}}.nxa-form-control-bottom{width:100%;flex-direction:row;justify-content:space-between;padding-bottom:calc(var(--spacing, .25rem) * 0)}@layer daisyui.l1.l2.l3{.nxa-form-control-bottom{display:inline-flex;align-items:center;gap:.375rem;white-space:nowrap;color:currentcolor}@supports (color: color-mix(in lab,red,red)){.nxa-form-control-bottom{color:color-mix(in oklab,currentcolor 60%,transparent)}}.nxa-form-control-bottom:has(input){cursor:pointer}.nxa-form-control-bottom:is(.input>*,.select>*){display:flex;height:calc(100% - .5rem);align-items:center;padding-inline:.75rem;white-space:nowrap;font-size:inherit}.nxa-form-control-bottom:is(.input>*,.select>*):first-child{margin-inline-start:-.75rem;margin-inline-end:.75rem;border-inline-end:var(--border) solid currentColor}@supports (color: color-mix(in lab,red,red)){.nxa-form-control-bottom:is(.input>*,.select>*):first-child{border-inline-end:var(--border) solid color-mix(in oklab,currentColor 10%,#0000)}}.nxa-form-control-bottom:is(.input>*,.select>*):last-child{margin-inline-start:.75rem;margin-inline-end:-.75rem;border-inline-start:var(--border) solid currentColor}@supports (color: color-mix(in lab,red,red)){.nxa-form-control-bottom:is(.input>*,.select>*):last-child{border-inline-start:var(--border) solid color-mix(in oklab,currentColor 10%,#0000)}}}.nxa-form-control-error-message{margin:calc(var(--spacing, .25rem) * 0);display:block;min-height:calc(var(--spacing, .25rem) * 0);width:100%;padding:calc(var(--spacing, .25rem) * 0);font-size:var(--text-sm, .875rem);line-height:var(--tw-leading, var(--text-sm--line-height, calc(1.25 / .875)));color:var(--color-error)}@layer base{:where(:root),:root:has(input.theme-controller[value=light]:checked),[data-theme=light]{color-scheme:light;--color-base-100: oklch(100% 0 0);--color-base-200: oklch(98% 0 0);--color-base-300: oklch(95% 0 0);--color-base-content: oklch(21% .006 285.885);--color-primary: oklch(45% .24 277.023);--color-primary-content: oklch(93% .034 272.788);--color-secondary: oklch(65% .241 354.308);--color-secondary-content: oklch(94% .028 342.258);--color-accent: oklch(77% .152 181.912);--color-accent-content: oklch(38% .063 188.416);--color-neutral: oklch(14% .005 285.823);--color-neutral-content: oklch(92% .004 286.32);--color-info: oklch(74% .16 232.661);--color-info-content: oklch(29% .066 243.157);--color-success: oklch(76% .177 163.223);--color-success-content: oklch(37% .077 168.94);--color-warning: oklch(82% .189 84.429);--color-warning-content: oklch(41% .112 45.904);--color-error: oklch(71% .194 13.428);--color-error-content: oklch(27% .105 12.094);--radius-selector: .5rem;--radius-field: .25rem;--radius-box: .5rem;--size-selector: .25rem;--size-field: .25rem;--border: 1px;--depth: 1;--noise: 0}}@layer base{@media(prefers-color-scheme:dark){:root:not([data-theme]){color-scheme:dark;--color-base-100: oklch(25.33% .016 252.42);--color-base-200: oklch(23.26% .014 253.1);--color-base-300: oklch(21.15% .012 254.09);--color-base-content: oklch(97.807% .029 256.847);--color-primary: oklch(58% .233 277.117);--color-primary-content: oklch(96% .018 272.314);--color-secondary: oklch(65% .241 354.308);--color-secondary-content: oklch(94% .028 342.258);--color-accent: oklch(77% .152 181.912);--color-accent-content: oklch(38% .063 188.416);--color-neutral: oklch(14% .005 285.823);--color-neutral-content: oklch(92% .004 286.32);--color-info: oklch(74% .16 232.661);--color-info-content: oklch(29% .066 243.157);--color-success: oklch(76% .177 163.223);--color-success-content: oklch(37% .077 168.94);--color-warning: oklch(82% .189 84.429);--color-warning-content: oklch(41% .112 45.904);--color-error: oklch(71% .194 13.428);--color-error-content: oklch(27% .105 12.094);--radius-selector: .5rem;--radius-field: .25rem;--radius-box: .5rem;--size-selector: .25rem;--size-field: .25rem;--border: 1px;--depth: 1;--noise: 0}}}@layer base{:root:has(input.theme-controller[value=light]:checked),[data-theme=light]{color-scheme:light;--color-base-100: oklch(100% 0 0);--color-base-200: oklch(98% 0 0);--color-base-300: oklch(95% 0 0);--color-base-content: oklch(21% .006 285.885);--color-primary: oklch(45% .24 277.023);--color-primary-content: oklch(93% .034 272.788);--color-secondary: oklch(65% .241 354.308);--color-secondary-content: oklch(94% .028 342.258);--color-accent: oklch(77% .152 181.912);--color-accent-content: oklch(38% .063 188.416);--color-neutral: oklch(14% .005 285.823);--color-neutral-content: oklch(92% .004 286.32);--color-info: oklch(74% .16 232.661);--color-info-content: oklch(29% .066 243.157);--color-success: oklch(76% .177 163.223);--color-success-content: oklch(37% .077 168.94);--color-warning: oklch(82% .189 84.429);--color-warning-content: oklch(41% .112 45.904);--color-error: oklch(71% .194 13.428);--color-error-content: oklch(27% .105 12.094);--radius-selector: .5rem;--radius-field: .25rem;--radius-box: .5rem;--size-selector: .25rem;--size-field: .25rem;--border: 1px;--depth: 1;--noise: 0}}@layer base{:root:has(input.theme-controller[value=dark]:checked),[data-theme=dark]{color-scheme:dark;--color-base-100: oklch(25.33% .016 252.42);--color-base-200: oklch(23.26% .014 253.1);--color-base-300: oklch(21.15% .012 254.09);--color-base-content: oklch(97.807% .029 256.847);--color-primary: oklch(58% .233 277.117);--color-primary-content: oklch(96% .018 272.314);--color-secondary: oklch(65% .241 354.308);--color-secondary-content: oklch(94% .028 342.258);--color-accent: oklch(77% .152 181.912);--color-accent-content: oklch(38% .063 188.416);--color-neutral: oklch(14% .005 285.823);--color-neutral-content: oklch(92% .004 286.32);--color-info: oklch(74% .16 232.661);--color-info-content: oklch(29% .066 243.157);--color-success: oklch(76% .177 163.223);--color-success-content: oklch(37% .077 168.94);--color-warning: oklch(82% .189 84.429);--color-warning-content: oklch(41% .112 45.904);--color-error: oklch(71% .194 13.428);--color-error-content: oklch(27% .105 12.094);--radius-selector: .5rem;--radius-field: .25rem;--radius-box: .5rem;--size-selector: .25rem;--size-field: .25rem;--border: 1px;--depth: 1;--noise: 0}}@layer base{:root{--fx-noise: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.34' numOctaves='4' stitchTiles='stitch'%3E%3C/feTurbulence%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23a)' opacity='0.2'%3E%3C/rect%3E%3C/svg%3E\")}}@layer base{:root{scrollbar-color:currentColor #0000}@supports (color: color-mix(in lab,red,red)){:root{scrollbar-color:color-mix(in oklch,currentColor 35%,#0000) #0000}}}@layer base{@property --radialprogress{syntax: \"<percentage>\"; inherits: true; initial-value: 0%;}}@layer base{:root:not(span){overflow:var(--page-overflow)}}@layer base{:root{background:var(--page-scroll-bg, var(--root-bg));--page-scroll-bg-on: linear-gradient(var(--root-bg, #0000), var(--root-bg, #0000)) var(--root-bg, #0000);--page-scroll-transition-on: background-color .3s ease-out;transition:var(--page-scroll-transition);scrollbar-gutter:var(--page-scroll-gutter, unset);scrollbar-gutter:if(style(--page-has-scroll: 1): var(--page-scroll-gutter, unset) ; else: unset)}@supports (color: color-mix(in lab,red,red)){:root{--page-scroll-bg-on: linear-gradient(var(--root-bg, #0000), var(--root-bg, #0000)) color-mix(in srgb, var(--root-bg, #0000), oklch(0% 0 0) calc(var(--page-has-backdrop, 0) * 40%))}}@keyframes set-page-has-scroll{0%,to{--page-has-scroll: 1}}}@layer base{:root,[data-theme]{background:var(--page-scroll-bg, var(--root-bg));color:var(--color-base-content)}:where(:root,[data-theme]){--root-bg: var(--color-base-100)}}@keyframes rating{0%,40%{scale:1.1;filter:brightness(1.05) contrast(1.05)}}@keyframes dropdown{0%{opacity:0}}@keyframes radio{0%{padding:5px}50%{padding:3px}}@keyframes toast{0%{scale:.9;opacity:0}to{scale:1;opacity:1}}@keyframes rotator{89.9999%,to{--first-item-position: 0 0%}90%,99.9999%{--first-item-position: 0 calc(var(--items) * 100%)}to{translate:0 -100%}}@keyframes skeleton{0%{background-position:150%}to{background-position:-50%}}@keyframes menu{0%{opacity:0}}@keyframes progress{50%{background-position-x:-115%}}\n/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */\n"] }]
|
|
144
|
+
}] });
|
|
145
|
+
|
|
146
|
+
class NxaButton {
|
|
147
|
+
//#region Private Singnal
|
|
148
|
+
/**
|
|
149
|
+
* @ignore
|
|
150
|
+
*/
|
|
151
|
+
_color = signal('neutral', ...(ngDevMode ? [{ debugName: "_color" }] : []));
|
|
152
|
+
/**
|
|
153
|
+
* @ignore
|
|
154
|
+
*/
|
|
155
|
+
_size = signal("md", ...(ngDevMode ? [{ debugName: "_size" }] : []));
|
|
156
|
+
/**
|
|
157
|
+
* @ignore
|
|
158
|
+
*/
|
|
159
|
+
_disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : []));
|
|
160
|
+
/**
|
|
161
|
+
* @ignore
|
|
162
|
+
*/
|
|
163
|
+
_loading = signal(false, ...(ngDevMode ? [{ debugName: "_loading" }] : []));
|
|
164
|
+
/**
|
|
165
|
+
* @ignore
|
|
166
|
+
*/
|
|
167
|
+
_routerLink = signal(null, ...(ngDevMode ? [{ debugName: "_routerLink" }] : []));
|
|
168
|
+
/**
|
|
169
|
+
* @ignore
|
|
170
|
+
*/
|
|
171
|
+
_outlined = signal(false, ...(ngDevMode ? [{ debugName: "_outlined" }] : []));
|
|
172
|
+
/**
|
|
173
|
+
* @ignore
|
|
174
|
+
*/
|
|
175
|
+
_className = signal('', ...(ngDevMode ? [{ debugName: "_className" }] : []));
|
|
176
|
+
/**
|
|
177
|
+
* @ignore
|
|
178
|
+
*/
|
|
179
|
+
_type = signal('button', ...(ngDevMode ? [{ debugName: "_type" }] : []));
|
|
180
|
+
/**
|
|
181
|
+
* @ignore
|
|
182
|
+
*/
|
|
183
|
+
_spinnerTemplateRef = signal(null, ...(ngDevMode ? [{ debugName: "_spinnerTemplateRef" }] : []));
|
|
184
|
+
/**
|
|
185
|
+
*
|
|
186
|
+
*/
|
|
187
|
+
_label = signal('', ...(ngDevMode ? [{ debugName: "_label" }] : []));
|
|
188
|
+
set label(value) {
|
|
189
|
+
this._label.set(value);
|
|
190
|
+
}
|
|
191
|
+
get label() {
|
|
192
|
+
return this._label();
|
|
193
|
+
}
|
|
194
|
+
//#endregion
|
|
195
|
+
//#region public Input
|
|
196
|
+
// /**
|
|
197
|
+
// * Color of the button based on DaisyUI Theme Colors
|
|
198
|
+
// * @param {NxaColorAll}
|
|
199
|
+
// * {@link NxaColorAll}
|
|
200
|
+
// */
|
|
201
|
+
set color(value) { this._color.set(value); }
|
|
202
|
+
;
|
|
203
|
+
/**
|
|
204
|
+
* Size of the button based on DaisyUI Theme Sizes
|
|
205
|
+
*/
|
|
206
|
+
set size(value) { this._size.set(value); }
|
|
207
|
+
;
|
|
208
|
+
/**
|
|
209
|
+
* Disabled button effect + handleClick won't fire an event
|
|
210
|
+
*/
|
|
211
|
+
set disabled(value) { this._disabled.set(value); }
|
|
212
|
+
;
|
|
213
|
+
/**
|
|
214
|
+
* show a loading spinner + diabled fire events from button
|
|
215
|
+
*/
|
|
216
|
+
set loading(value) { this._loading.set(value); }
|
|
217
|
+
;
|
|
218
|
+
/**
|
|
219
|
+
* if value is provided it change the button into a link that is navigable
|
|
220
|
+
*/
|
|
221
|
+
set routerLink(value) {
|
|
222
|
+
this._routerLink.set(value);
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* set the style to outlinee
|
|
226
|
+
*/
|
|
227
|
+
set outlined(value) {
|
|
228
|
+
this._outlined.set(value);
|
|
229
|
+
}
|
|
230
|
+
;
|
|
231
|
+
/**
|
|
232
|
+
* classes provided will be injected into the button
|
|
233
|
+
*/
|
|
234
|
+
set className(value) {
|
|
235
|
+
this._className.set(value);
|
|
236
|
+
}
|
|
237
|
+
;
|
|
238
|
+
/**
|
|
239
|
+
* type of button, work only if it's a button without routerLink
|
|
240
|
+
*/
|
|
241
|
+
set type(value) {
|
|
242
|
+
this._type.set(value);
|
|
243
|
+
}
|
|
244
|
+
;
|
|
245
|
+
/**
|
|
246
|
+
* custom spinner for the loading state
|
|
247
|
+
*/
|
|
248
|
+
set spinnerTemplateRef(value) {
|
|
249
|
+
this._spinnerTemplateRef.set(value);
|
|
250
|
+
}
|
|
251
|
+
;
|
|
252
|
+
//#endregion
|
|
253
|
+
/**
|
|
254
|
+
* click event handled with disabled & loading condition to prevent multiple clicks
|
|
255
|
+
*/
|
|
256
|
+
nxaClick = new EventEmitter();
|
|
257
|
+
//#region Output
|
|
258
|
+
/**
|
|
259
|
+
* @ignore
|
|
260
|
+
*/
|
|
261
|
+
computedClasses = computed(() => {
|
|
262
|
+
const consumerClasses = this._className().split(/\s+/).filter(Boolean).reduce((acc, cls) => ({ ...acc, [cls]: true }), {});
|
|
263
|
+
const defaultClasses = {
|
|
264
|
+
'btn': true,
|
|
265
|
+
[`btn-${this._color()}`]: true,
|
|
266
|
+
[`btn-${this._size()}`]: true,
|
|
267
|
+
'btn-disabled': this._disabled() || this._loading(),
|
|
268
|
+
'btn-outline': this._outlined(),
|
|
269
|
+
['pointer-events-none']: this._disabled() || this._loading(),
|
|
270
|
+
};
|
|
271
|
+
return { ...defaultClasses, ...consumerClasses };
|
|
272
|
+
}, ...(ngDevMode ? [{ debugName: "computedClasses" }] : []));
|
|
273
|
+
handleClick(event) {
|
|
274
|
+
event.preventDefault();
|
|
275
|
+
event.stopPropagation();
|
|
276
|
+
if (this._disabled() || this._loading()) {
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
this.nxaClick.emit(event);
|
|
280
|
+
}
|
|
281
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
282
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.5", type: NxaButton, isStandalone: true, selector: "nxa-button", inputs: { label: "label", color: "color", size: "size", disabled: "disabled", loading: "loading", routerLink: "routerLink", outlined: "outlined", className: "className", type: "type", spinnerTemplateRef: "spinnerTemplateRef" }, outputs: { nxaClick: "nxaClick" }, host: { attributes: { "role": "button" }, listeners: { "click": "handleClick($event)" }, classAttribute: "contents" }, ngImport: i0, template: "<!-- Button Content Wrapper -->\n<ng-container>\n <!-- Link Button -->\n @if (!!_routerLink()) {\n\n <a role=\"button\" [ngClass]=\"computedClasses()\" [routerLink]=\"_routerLink()\"\n [attr.aria-disabled]=\"_disabled() || _loading()\" [attr.aria-busy]=\"_loading()\"\n [routerLinkActive]=\"'btn-disabled'\" [attr.aria-label]=\"label\">\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\n </a>\n }\n <!-- Norml Button Behaviour -->\n @else {\n\n <button role=\"button\" [ngClass]=\"computedClasses()\" [disabled]=\"_disabled() || _loading()\"\n [attr.aria-disabled]=\"_disabled() || _loading()\" [attr.aria-busy]=\"_loading()\" [type]=\"_type()\"\n [attr.aria-label]=\"label\">\n @if(_loading()){\n <ng-container *ngTemplateOutlet=\"_spinnerTemplateRef()??defaultSpinner\"></ng-container>\n }\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\n </button>\n\n }\n</ng-container>\n<ng-template #defaultSpinner>\n <span class=\"loading loading-spinner\"\n [ngClass]=\"\n {'loading-xs':_size()==='xs', 'loading-sm':_size()==='sm', 'loading-md':_size()==='md', 'loading-lg':_size()==='lg','loading-xl':_size()==='xl'}\"></span>\n</ng-template>\n<!-- Button Template with slots -->\n<ng-template #buttonContent>\n <ng-content select=\"[leading]\"></ng-content>\n <ng-content select=\"\"></ng-content>\n <ng-content select=\"[trailing]\"></ng-content>\n</ng-template>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
283
|
+
}
|
|
284
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaButton, decorators: [{
|
|
285
|
+
type: Component,
|
|
286
|
+
args: [{ selector: 'nxa-button', imports: [CommonModule, RouterLink, RouterLinkActive], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, host: {
|
|
287
|
+
role: "button",
|
|
288
|
+
class: NXA_HOST_CONTENTS_ONLY,
|
|
289
|
+
"(click)": "handleClick($event)"
|
|
290
|
+
}, template: "<!-- Button Content Wrapper -->\n<ng-container>\n <!-- Link Button -->\n @if (!!_routerLink()) {\n\n <a role=\"button\" [ngClass]=\"computedClasses()\" [routerLink]=\"_routerLink()\"\n [attr.aria-disabled]=\"_disabled() || _loading()\" [attr.aria-busy]=\"_loading()\"\n [routerLinkActive]=\"'btn-disabled'\" [attr.aria-label]=\"label\">\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\n </a>\n }\n <!-- Norml Button Behaviour -->\n @else {\n\n <button role=\"button\" [ngClass]=\"computedClasses()\" [disabled]=\"_disabled() || _loading()\"\n [attr.aria-disabled]=\"_disabled() || _loading()\" [attr.aria-busy]=\"_loading()\" [type]=\"_type()\"\n [attr.aria-label]=\"label\">\n @if(_loading()){\n <ng-container *ngTemplateOutlet=\"_spinnerTemplateRef()??defaultSpinner\"></ng-container>\n }\n <ng-container *ngTemplateOutlet=\"buttonContent\"></ng-container>\n </button>\n\n }\n</ng-container>\n<ng-template #defaultSpinner>\n <span class=\"loading loading-spinner\"\n [ngClass]=\"\n {'loading-xs':_size()==='xs', 'loading-sm':_size()==='sm', 'loading-md':_size()==='md', 'loading-lg':_size()==='lg','loading-xl':_size()==='xl'}\"></span>\n</ng-template>\n<!-- Button Template with slots -->\n<ng-template #buttonContent>\n <ng-content select=\"[leading]\"></ng-content>\n <ng-content select=\"\"></ng-content>\n <ng-content select=\"[trailing]\"></ng-content>\n</ng-template>" }]
|
|
291
|
+
}], propDecorators: { label: [{
|
|
292
|
+
type: Input
|
|
293
|
+
}], color: [{
|
|
294
|
+
type: Input
|
|
295
|
+
}], size: [{
|
|
296
|
+
type: Input
|
|
297
|
+
}], disabled: [{
|
|
298
|
+
type: Input
|
|
299
|
+
}], loading: [{
|
|
300
|
+
type: Input
|
|
301
|
+
}], routerLink: [{
|
|
302
|
+
type: Input
|
|
303
|
+
}], outlined: [{
|
|
304
|
+
type: Input
|
|
305
|
+
}], className: [{
|
|
306
|
+
type: Input
|
|
307
|
+
}], type: [{
|
|
308
|
+
type: Input
|
|
309
|
+
}], spinnerTemplateRef: [{
|
|
310
|
+
type: Input
|
|
311
|
+
}], nxaClick: [{
|
|
312
|
+
type: Output
|
|
313
|
+
}] } });
|
|
314
|
+
|
|
315
|
+
function modelState(initialValue, autoEmit = false) {
|
|
316
|
+
const _modelSig = signal(initialValue, ...(ngDevMode ? [{ debugName: "_modelSig" }] : []));
|
|
317
|
+
const emitter = new EventEmitter();
|
|
318
|
+
if (autoEmit) {
|
|
319
|
+
let initialized = false;
|
|
320
|
+
effect(() => {
|
|
321
|
+
const value = _modelSig();
|
|
322
|
+
if (!initialized) {
|
|
323
|
+
initialized = true;
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
emitter.emit(value);
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
return {
|
|
330
|
+
sig: _modelSig,
|
|
331
|
+
emitter,
|
|
332
|
+
get: () => _modelSig(),
|
|
333
|
+
set: (v) => {
|
|
334
|
+
_modelSig.set(v);
|
|
335
|
+
},
|
|
336
|
+
update: (updateFn) => {
|
|
337
|
+
_modelSig.update(updateFn);
|
|
338
|
+
},
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
class NxaCheckbox {
|
|
343
|
+
//#region private signals
|
|
344
|
+
_value = modelState(true, true);
|
|
345
|
+
_disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : []));
|
|
346
|
+
_color = signal('neutral', ...(ngDevMode ? [{ debugName: "_color" }] : []));
|
|
347
|
+
_size = signal('md', ...(ngDevMode ? [{ debugName: "_size" }] : []));
|
|
348
|
+
_displayAs = signal('checkbox', ...(ngDevMode ? [{ debugName: "_displayAs" }] : []));
|
|
349
|
+
_id = signal('', ...(ngDevMode ? [{ debugName: "_id" }] : []));
|
|
350
|
+
_className = signal('', ...(ngDevMode ? [{ debugName: "_className" }] : []));
|
|
351
|
+
///
|
|
352
|
+
/// Control Value Accessor Stat Functions
|
|
353
|
+
///
|
|
354
|
+
onChange = () => { return; };
|
|
355
|
+
onTouched = () => { return; };
|
|
356
|
+
//#region inputs
|
|
357
|
+
/**
|
|
358
|
+
* Checkbox Value
|
|
359
|
+
* @type {boolean}
|
|
360
|
+
* @default false
|
|
361
|
+
*/
|
|
362
|
+
set value(value) {
|
|
363
|
+
this._value.update(() => value);
|
|
364
|
+
}
|
|
365
|
+
get value() {
|
|
366
|
+
return this._value.get();
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Checkbox disabled state
|
|
370
|
+
* @type {boolean}
|
|
371
|
+
* @default false
|
|
372
|
+
* @description If true, the checkbox will be disabled and cannot be interacted with.
|
|
373
|
+
*/
|
|
374
|
+
set disabled(value) {
|
|
375
|
+
this._disabled.set(value);
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Checkbox color
|
|
379
|
+
* @type {NxaBrandColor | NxaStatusColor | NxaNeutralColor}
|
|
380
|
+
* @default 'neutral'
|
|
381
|
+
*/
|
|
382
|
+
set color(value) {
|
|
383
|
+
this._color.set(value);
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Checkbox size
|
|
387
|
+
* @type {NxaSize}
|
|
388
|
+
* @default 'md'
|
|
389
|
+
*/
|
|
390
|
+
set size(value) {
|
|
391
|
+
this._size.set(value);
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Show checkbox as checkbox or toggle
|
|
395
|
+
* @type {'checkbox' | 'toggle'}
|
|
396
|
+
* @default 'checkbox'
|
|
397
|
+
* @description If 'checkbox', it will show as a checkbox, if 'toggle', it will show as a toggle switch.
|
|
398
|
+
* This is useful for different use cases where you want to show a checkbox or a toggle switch.
|
|
399
|
+
*/
|
|
400
|
+
set displayAs(value) {
|
|
401
|
+
this._displayAs.set(value);
|
|
402
|
+
}
|
|
403
|
+
set id(value) {
|
|
404
|
+
this._id.set(value);
|
|
405
|
+
}
|
|
406
|
+
set className(value) {
|
|
407
|
+
this._className.set(value);
|
|
408
|
+
}
|
|
409
|
+
//#endregion
|
|
410
|
+
//#region outputs
|
|
411
|
+
valueChange = this._value.emitter;
|
|
412
|
+
//#endregion
|
|
413
|
+
//#region control value accessor
|
|
414
|
+
/**
|
|
415
|
+
* @ignore
|
|
416
|
+
* Control value accessor write value function
|
|
417
|
+
* update state value when form inject current value
|
|
418
|
+
*/
|
|
419
|
+
writeValue(obj) {
|
|
420
|
+
this._value.sig.set(obj);
|
|
421
|
+
}
|
|
422
|
+
registerOnChange(fn) {
|
|
423
|
+
this.onChange = fn;
|
|
424
|
+
}
|
|
425
|
+
registerOnTouched(fn) {
|
|
426
|
+
this.onTouched = fn;
|
|
427
|
+
}
|
|
428
|
+
setDisabledState(isDisabled) {
|
|
429
|
+
this.disabled = (isDisabled);
|
|
430
|
+
}
|
|
431
|
+
onInput(event) {
|
|
432
|
+
const input = event.target;
|
|
433
|
+
this._value.set(input.checked);
|
|
434
|
+
this.onChange(input.checked);
|
|
435
|
+
}
|
|
436
|
+
onBlur() {
|
|
437
|
+
this.onTouched();
|
|
438
|
+
}
|
|
439
|
+
//#endregion
|
|
440
|
+
computedNgClasses = computed(() => {
|
|
441
|
+
return {
|
|
442
|
+
[`${this._displayAs()}`]: true,
|
|
443
|
+
[`disabled`]: this._disabled(),
|
|
444
|
+
[`${this._displayAs()}-xs`]: this._size() === 'xs',
|
|
445
|
+
[`${this._displayAs()}-sm`]: this._size() === 'sm',
|
|
446
|
+
[`${this._displayAs()}-md`]: this._size() === 'md',
|
|
447
|
+
[`${this._displayAs()}-lg`]: this._size() === 'lg',
|
|
448
|
+
[`${this._displayAs()}-primary`]: this._color() === 'primary',
|
|
449
|
+
[`${this._displayAs()}-secondary`]: this._color() === 'secondary',
|
|
450
|
+
[`${this._displayAs()}-accent`]: this._color() === 'accent',
|
|
451
|
+
[`${this._displayAs()}-info`]: this._color() === 'info',
|
|
452
|
+
[`${this._displayAs()}-warning`]: this._color() === 'warning',
|
|
453
|
+
[`${this._displayAs()}-error`]: this._color() === 'error',
|
|
454
|
+
[`${this._displayAs()}-success`]: this._color() === 'success',
|
|
455
|
+
[`${this._displayAs()}-neutral`]: this._color() === 'neutral',
|
|
456
|
+
};
|
|
457
|
+
}, ...(ngDevMode ? [{ debugName: "computedNgClasses" }] : []));
|
|
458
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaCheckbox, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
459
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.5", type: NxaCheckbox, isStandalone: true, selector: "nxa-checkbox", inputs: { value: "value", disabled: "disabled", color: "color", size: "size", displayAs: "displayAs", id: "id", className: "className" }, outputs: { valueChange: "valueChange" }, host: { properties: { "attr.id": "null" }, classAttribute: "contents" }, providers: [
|
|
460
|
+
{
|
|
461
|
+
provide: NG_VALUE_ACCESSOR,
|
|
462
|
+
useExisting: forwardRef(() => NxaCheckbox),
|
|
463
|
+
multi: true
|
|
464
|
+
}
|
|
465
|
+
], ngImport: i0, template: "<div class=\"form-control w-fit min-w-5 flex flex-row items-center\" [class]=\"_className()\">\n <label class=\"label cursor-pointer\" [for]=\"_id()\">\n <span class=\"label-text\">\n <ng-content select=\"[label]\"></ng-content>\n </span> \n </label>\n <input \n [attr.id]=\"_id()\"\n type=\"checkbox\"\n [disabled]=\"_disabled()\" \n (input)=\"onInput($event)\"\n class=\"mx-2\"\n [checked]=\"_value.get()\"\n [aria-checked]=\"_value.get()\"\n [ngClass]=\"computedNgClasses()\"\n (blur)=\"onBlur()\" />\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
466
|
+
}
|
|
467
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaCheckbox, decorators: [{
|
|
468
|
+
type: Component,
|
|
469
|
+
args: [{ selector: 'nxa-checkbox', standalone: true, host: {
|
|
470
|
+
'[attr.id]': 'null',
|
|
471
|
+
class: NXA_HOST_CONTENTS_ONLY
|
|
472
|
+
}, providers: [
|
|
473
|
+
{
|
|
474
|
+
provide: NG_VALUE_ACCESSOR,
|
|
475
|
+
useExisting: forwardRef(() => NxaCheckbox),
|
|
476
|
+
multi: true
|
|
477
|
+
}
|
|
478
|
+
], encapsulation: ViewEncapsulation.None, imports: [CommonModule], template: "<div class=\"form-control w-fit min-w-5 flex flex-row items-center\" [class]=\"_className()\">\n <label class=\"label cursor-pointer\" [for]=\"_id()\">\n <span class=\"label-text\">\n <ng-content select=\"[label]\"></ng-content>\n </span> \n </label>\n <input \n [attr.id]=\"_id()\"\n type=\"checkbox\"\n [disabled]=\"_disabled()\" \n (input)=\"onInput($event)\"\n class=\"mx-2\"\n [checked]=\"_value.get()\"\n [aria-checked]=\"_value.get()\"\n [ngClass]=\"computedNgClasses()\"\n (blur)=\"onBlur()\" />\n</div>\n" }]
|
|
479
|
+
}], propDecorators: { value: [{
|
|
480
|
+
type: Input
|
|
481
|
+
}], disabled: [{
|
|
482
|
+
type: Input
|
|
483
|
+
}], color: [{
|
|
484
|
+
type: Input
|
|
485
|
+
}], size: [{
|
|
486
|
+
type: Input
|
|
487
|
+
}], displayAs: [{
|
|
488
|
+
type: Input
|
|
489
|
+
}], id: [{
|
|
490
|
+
type: Input
|
|
491
|
+
}], className: [{
|
|
492
|
+
type: Input
|
|
493
|
+
}], valueChange: [{
|
|
494
|
+
type: Output
|
|
495
|
+
}] } });
|
|
496
|
+
|
|
497
|
+
class NxaDateTimeInput {
|
|
498
|
+
//#region state
|
|
499
|
+
//#endregion
|
|
500
|
+
//#region inputs
|
|
501
|
+
_type = signal('datetime-local', ...(ngDevMode ? [{ debugName: "_type" }] : []));
|
|
502
|
+
set type(value) { this._type.set(value); }
|
|
503
|
+
;
|
|
504
|
+
get type() { return this._type(); }
|
|
505
|
+
//#endregion
|
|
506
|
+
writeValue(obj) {
|
|
507
|
+
throw new Error('Method not implemented.');
|
|
508
|
+
}
|
|
509
|
+
registerOnChange(fn) {
|
|
510
|
+
throw new Error('Method not implemented.');
|
|
511
|
+
}
|
|
512
|
+
registerOnTouched(fn) {
|
|
513
|
+
throw new Error('Method not implemented.');
|
|
514
|
+
}
|
|
515
|
+
setDisabledState(isDisabled) {
|
|
516
|
+
throw new Error('Method not implemented.');
|
|
517
|
+
}
|
|
518
|
+
ngOnInit() {
|
|
519
|
+
}
|
|
520
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaDateTimeInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
521
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.5", type: NxaDateTimeInput, isStandalone: true, selector: "nxa-date-time-input", inputs: { type: "type" }, host: { classAttribute: "block min-h-0 basis-fit h-fit flex-1 max-h-full w-full max-w-full inset-0 box-border p-2" }, providers: [
|
|
522
|
+
{
|
|
523
|
+
provide: NG_VALUE_ACCESSOR,
|
|
524
|
+
useExisting: forwardRef(() => NxaDateTimeInput),
|
|
525
|
+
multi: true,
|
|
526
|
+
}
|
|
527
|
+
], ngImport: i0, template: "<input [type]=\"_type()\" placeholder=\"\" class=\"input w-full\" />" });
|
|
528
|
+
}
|
|
529
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaDateTimeInput, decorators: [{
|
|
530
|
+
type: Component,
|
|
531
|
+
args: [{ selector: 'nxa-date-time-input', providers: [
|
|
532
|
+
{
|
|
533
|
+
provide: NG_VALUE_ACCESSOR,
|
|
534
|
+
useExisting: forwardRef(() => NxaDateTimeInput),
|
|
535
|
+
multi: true,
|
|
536
|
+
}
|
|
537
|
+
], host: {
|
|
538
|
+
class: `${NXA_HOST_BLOCK} p-2`
|
|
539
|
+
}, imports: [], template: "<input [type]=\"_type()\" placeholder=\"\" class=\"input w-full\" />" }]
|
|
540
|
+
}], propDecorators: { type: [{
|
|
541
|
+
type: Input
|
|
542
|
+
}] } });
|
|
543
|
+
|
|
544
|
+
class NxaDrawerService {
|
|
545
|
+
/**
|
|
546
|
+
* store state of any drawer
|
|
547
|
+
*/
|
|
548
|
+
_drawerStates$ = new BehaviorSubject([]);
|
|
549
|
+
/**
|
|
550
|
+
* register a drawer so that it can be used
|
|
551
|
+
* @param drawerState initial drawer state
|
|
552
|
+
*/
|
|
553
|
+
registerDrawer(drawerState) {
|
|
554
|
+
const states = this._drawerStates$.value;
|
|
555
|
+
const index = states.findIndex(drawer => drawer.id === drawerState.id);
|
|
556
|
+
if (index !== -1) {
|
|
557
|
+
// Replace existing drawer state with the same id
|
|
558
|
+
const updatedStates = [...states];
|
|
559
|
+
updatedStates[index] = drawerState;
|
|
560
|
+
this._drawerStates$.next(updatedStates);
|
|
561
|
+
}
|
|
562
|
+
else {
|
|
563
|
+
// Add new drawer state
|
|
564
|
+
this._drawerStates$.next([...states, drawerState]);
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* remove drawer state
|
|
569
|
+
* @param id id of the drawer
|
|
570
|
+
*/
|
|
571
|
+
unregisterDrawer(id) {
|
|
572
|
+
this._drawerStates$.next(this._drawerStates$.value.filter(drawer => drawer.id !== id));
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* get drawer state stream by Id
|
|
576
|
+
* @param id id of the drawer
|
|
577
|
+
* @returns Observable state of the drawer
|
|
578
|
+
*/
|
|
579
|
+
getDrawerState$(id) {
|
|
580
|
+
return this._drawerStates$.asObservable().pipe(
|
|
581
|
+
// Map the array to the drawer state with the given id
|
|
582
|
+
map(states => states.find(x => x.id === id)));
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
* get current drawer state by Id
|
|
586
|
+
* @param id id of the drawer
|
|
587
|
+
* @returns NxaDrawerState
|
|
588
|
+
*/
|
|
589
|
+
getDrawerState(id) {
|
|
590
|
+
return this._drawerStates$.value.find(x => x.id === id);
|
|
591
|
+
}
|
|
592
|
+
/**
|
|
593
|
+
* update state of a drawer
|
|
594
|
+
* @param drawerState
|
|
595
|
+
*/
|
|
596
|
+
updateDrawerState(drawerState) {
|
|
597
|
+
this._drawerStates$.next(this._drawerStates$.value.map(drawer => drawer.id === drawerState.id ? { ...drawer, ...drawerState } : drawer));
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* Toggle State of a drawer
|
|
601
|
+
* @param id drawer Id
|
|
602
|
+
*/
|
|
603
|
+
toggle(id) {
|
|
604
|
+
const state = this.getDrawerState(id);
|
|
605
|
+
this.updateDrawerState({ ...state, state: state?.state == "OPEN" ? "CLOSE" : "OPEN" });
|
|
606
|
+
}
|
|
607
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaDrawerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
608
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaDrawerService, providedIn: 'root' });
|
|
609
|
+
}
|
|
610
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaDrawerService, decorators: [{
|
|
611
|
+
type: Injectable,
|
|
612
|
+
args: [{
|
|
613
|
+
providedIn: 'root'
|
|
614
|
+
}]
|
|
615
|
+
}] });
|
|
616
|
+
|
|
617
|
+
const DEFAULT_TAILWIND_BREAKPOINTS = {
|
|
618
|
+
sm: 640,
|
|
619
|
+
md: 768,
|
|
620
|
+
lg: 1024,
|
|
621
|
+
xl: 1280,
|
|
622
|
+
'2xl': 1536,
|
|
623
|
+
};
|
|
624
|
+
const NXA_BREAKPOINTS = new InjectionToken('NXA_BREAKPOINTS', {
|
|
625
|
+
providedIn: 'root',
|
|
626
|
+
factory: () => DEFAULT_TAILWIND_BREAKPOINTS,
|
|
627
|
+
});
|
|
628
|
+
class NxaLayoutService {
|
|
629
|
+
breakpoints = inject(NXA_BREAKPOINTS);
|
|
630
|
+
_breakpoint$ = new BehaviorSubject(this.getBreakpoint());
|
|
631
|
+
_resizeObserver;
|
|
632
|
+
constructor() {
|
|
633
|
+
if (typeof window === "undefined")
|
|
634
|
+
return;
|
|
635
|
+
this._resizeObserver = new ResizeObserver(() => {
|
|
636
|
+
this._breakpoint$.next(this.getBreakpoint());
|
|
637
|
+
});
|
|
638
|
+
this._resizeObserver.observe(document.documentElement);
|
|
639
|
+
}
|
|
640
|
+
get breakpoint$() {
|
|
641
|
+
return this._breakpoint$.asObservable().pipe(throttleTime(10));
|
|
642
|
+
}
|
|
643
|
+
get current() {
|
|
644
|
+
return this._breakpoint$.value;
|
|
645
|
+
}
|
|
646
|
+
getBreakpoint() {
|
|
647
|
+
if (typeof window === "undefined")
|
|
648
|
+
return 'md';
|
|
649
|
+
const width = window.innerWidth;
|
|
650
|
+
const { sm = 640, md = 768, lg = 1024, xl = 1280, ['2xl']: x2l = 1536 } = this.breakpoints;
|
|
651
|
+
if (width < sm)
|
|
652
|
+
return 'xs';
|
|
653
|
+
if (width < md)
|
|
654
|
+
return 'sm';
|
|
655
|
+
if (width < lg)
|
|
656
|
+
return 'md';
|
|
657
|
+
if (width < xl)
|
|
658
|
+
return 'lg';
|
|
659
|
+
if (width < x2l)
|
|
660
|
+
return 'xl';
|
|
661
|
+
return '2xl';
|
|
662
|
+
}
|
|
663
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaLayoutService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
664
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaLayoutService, providedIn: 'root' });
|
|
665
|
+
}
|
|
666
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaLayoutService, decorators: [{
|
|
667
|
+
type: Injectable,
|
|
668
|
+
args: [{
|
|
669
|
+
providedIn: 'root'
|
|
670
|
+
}]
|
|
671
|
+
}], ctorParameters: () => [] });
|
|
672
|
+
|
|
673
|
+
const SKIP_LOADING = new HttpContextToken(() => false);
|
|
674
|
+
class NxaLoadingService {
|
|
675
|
+
_isLoading$ = new BehaviorSubject(0);
|
|
676
|
+
get isLoading$() {
|
|
677
|
+
return this._isLoading$.pipe(map((count) => count > 0));
|
|
678
|
+
}
|
|
679
|
+
get isLoading() {
|
|
680
|
+
return this._isLoading$.value > 0;
|
|
681
|
+
}
|
|
682
|
+
addLoading() {
|
|
683
|
+
this._isLoading$.next(this._isLoading$.value + 1);
|
|
684
|
+
}
|
|
685
|
+
removeLoading() {
|
|
686
|
+
const current = this._isLoading$.value;
|
|
687
|
+
if (current > 0) {
|
|
688
|
+
this._isLoading$.next(current - 1);
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaLoadingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
692
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaLoadingService, providedIn: 'root' });
|
|
693
|
+
}
|
|
694
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaLoadingService, decorators: [{
|
|
695
|
+
type: Injectable,
|
|
696
|
+
args: [{
|
|
697
|
+
providedIn: 'root'
|
|
698
|
+
}]
|
|
699
|
+
}] });
|
|
700
|
+
|
|
701
|
+
class NxaOverlayRef {
|
|
702
|
+
overlayRef;
|
|
703
|
+
_afterClose$ = new BehaviorSubject(null);
|
|
704
|
+
afterClose$ = this._afterClose$.asObservable();
|
|
705
|
+
constructor(overlayRef) {
|
|
706
|
+
this.overlayRef = overlayRef;
|
|
707
|
+
}
|
|
708
|
+
close(returnValue) {
|
|
709
|
+
this.overlayRef.dispose();
|
|
710
|
+
this._afterClose$.next(returnValue);
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
const NXA_OVERLAY_DATA = new InjectionToken('NXA_OVERLAY_DATA', {
|
|
714
|
+
providedIn: 'root',
|
|
715
|
+
factory: () => null,
|
|
716
|
+
});
|
|
717
|
+
const NXA_OVERLAY_CONFIG_DEFAULTS = new InjectionToken('NXA_OVERLAY_CONFIG_DEFAULTS', {
|
|
718
|
+
providedIn: 'root',
|
|
719
|
+
factory: () => {
|
|
720
|
+
const overlay = inject(Overlay);
|
|
721
|
+
return {
|
|
722
|
+
disposeOnNavigation: true,
|
|
723
|
+
width: '80%',
|
|
724
|
+
height: '60%',
|
|
725
|
+
usePopover: true,
|
|
726
|
+
hasBackdrop: true,
|
|
727
|
+
scrollStrategy: overlay.scrollStrategies.block(),
|
|
728
|
+
backdropClickDismiss: true,
|
|
729
|
+
};
|
|
730
|
+
},
|
|
731
|
+
});
|
|
732
|
+
class NxaOverlayService {
|
|
733
|
+
overlay = inject(Overlay);
|
|
734
|
+
defaultConfig = inject(NXA_OVERLAY_CONFIG_DEFAULTS);
|
|
735
|
+
positionBuilder = inject(OverlayPositionBuilder);
|
|
736
|
+
create(component, data, config) {
|
|
737
|
+
// merge Configurations
|
|
738
|
+
const finalConfig = {
|
|
739
|
+
...this.defaultConfig,
|
|
740
|
+
...config,
|
|
741
|
+
};
|
|
742
|
+
// create position strategy if missing
|
|
743
|
+
if (!finalConfig.positionStrategy) {
|
|
744
|
+
finalConfig.positionStrategy = this.positionBuilder
|
|
745
|
+
.global()
|
|
746
|
+
.centerHorizontally()
|
|
747
|
+
.centerVertically();
|
|
748
|
+
}
|
|
749
|
+
//create Overlay Ref
|
|
750
|
+
const modalRef = new NxaOverlayRef(this.overlay.create(finalConfig));
|
|
751
|
+
// create injection context
|
|
752
|
+
const injector = Injector.create({
|
|
753
|
+
providers: [
|
|
754
|
+
{ provide: NxaOverlayRef, useValue: modalRef },
|
|
755
|
+
{ provide: NXA_OVERLAY_DATA, useValue: data },
|
|
756
|
+
],
|
|
757
|
+
});
|
|
758
|
+
// Create Portal for the overlay and attach component to it
|
|
759
|
+
const componentPortal = new ComponentPortal(component, null, injector);
|
|
760
|
+
modalRef.overlayRef.attach(componentPortal);
|
|
761
|
+
// dismiss on backdrop click
|
|
762
|
+
if (finalConfig.backdropClickDismiss) {
|
|
763
|
+
modalRef.overlayRef.backdropClick().subscribe(() => {
|
|
764
|
+
modalRef.close();
|
|
765
|
+
});
|
|
766
|
+
}
|
|
767
|
+
return modalRef;
|
|
768
|
+
}
|
|
769
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaOverlayService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
770
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaOverlayService, providedIn: 'root' });
|
|
771
|
+
}
|
|
772
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaOverlayService, decorators: [{
|
|
773
|
+
type: Injectable,
|
|
774
|
+
args: [{
|
|
775
|
+
providedIn: 'root',
|
|
776
|
+
}]
|
|
777
|
+
}] });
|
|
778
|
+
|
|
779
|
+
const NXA_DEFAULT_THEME_BRIGHTNESS_MAP = {
|
|
780
|
+
light: "light",
|
|
781
|
+
dark: "dark",
|
|
782
|
+
cupcake: "light",
|
|
783
|
+
bumblebee: "light",
|
|
784
|
+
emerald: "light",
|
|
785
|
+
corporate: "light",
|
|
786
|
+
synthwave: "dark",
|
|
787
|
+
retro: "light",
|
|
788
|
+
cyberpunk: "light",
|
|
789
|
+
valentine: "light",
|
|
790
|
+
halloween: "dark",
|
|
791
|
+
garden: "light",
|
|
792
|
+
forest: "dark",
|
|
793
|
+
aqua: "light",
|
|
794
|
+
lofi: "light",
|
|
795
|
+
pastel: "light",
|
|
796
|
+
fantasy: "light",
|
|
797
|
+
wireframe: "light",
|
|
798
|
+
black: "dark",
|
|
799
|
+
luxury: "dark",
|
|
800
|
+
dracula: "dark",
|
|
801
|
+
cmyk: "light",
|
|
802
|
+
autumn: "light",
|
|
803
|
+
business: "dark",
|
|
804
|
+
acid: "light",
|
|
805
|
+
lemonade: "light",
|
|
806
|
+
night: "dark",
|
|
807
|
+
coffee: "dark",
|
|
808
|
+
winter: "light",
|
|
809
|
+
};
|
|
810
|
+
const NXA_THEME_BRIGHTNESS_MAP = new InjectionToken("NXA_THEME_BRIGHTNESS_MAP", {
|
|
811
|
+
providedIn: "root",
|
|
812
|
+
factory: () => NXA_DEFAULT_THEME_BRIGHTNESS_MAP,
|
|
813
|
+
});
|
|
814
|
+
/**
|
|
815
|
+
* Default Light theme name
|
|
816
|
+
*/
|
|
817
|
+
const NXA_DEFAULT_LIGHT_THEME = new InjectionToken('NXA_DEFAULT_LIGHT_THEME', {
|
|
818
|
+
providedIn: 'root',
|
|
819
|
+
factory: () => 'light'
|
|
820
|
+
});
|
|
821
|
+
/**
|
|
822
|
+
* Default Dark theme name
|
|
823
|
+
*/
|
|
824
|
+
const NXA_DEFAULT_DARK_THEME = new InjectionToken('NXA_DEFAULT_DARK_THEME', {
|
|
825
|
+
providedIn: 'root',
|
|
826
|
+
factory: () => 'dark'
|
|
827
|
+
});
|
|
828
|
+
/**
|
|
829
|
+
* Preference for dark theme
|
|
830
|
+
* If true, the service will set the default theme to dark
|
|
831
|
+
* If false, it will set the default theme to light
|
|
832
|
+
*/
|
|
833
|
+
const NXA_PREFER_DARK_THEME = new InjectionToken('NXA_PREFERRED_DARK_THEME', {
|
|
834
|
+
providedIn: 'root',
|
|
835
|
+
factory: () => true
|
|
836
|
+
});
|
|
837
|
+
/**
|
|
838
|
+
* Theme Loader function
|
|
839
|
+
* allow to load theme dynamically
|
|
840
|
+
* can be override to load theme from local storage, server or any other source
|
|
841
|
+
*/
|
|
842
|
+
const NXA_THEME_LOADER = new InjectionToken('NXA_THEME_LOADER', {
|
|
843
|
+
providedIn: 'root',
|
|
844
|
+
factory: () => () => {
|
|
845
|
+
if (inject(NXA_PREFER_DARK_THEME)) {
|
|
846
|
+
return inject(NXA_DEFAULT_DARK_THEME);
|
|
847
|
+
}
|
|
848
|
+
return inject(NXA_DEFAULT_LIGHT_THEME);
|
|
849
|
+
},
|
|
850
|
+
});
|
|
851
|
+
/**
|
|
852
|
+
* Theme Saving function
|
|
853
|
+
* allow to save theme name when it is changed
|
|
854
|
+
* can be override to save theme in local storage, server or any other source
|
|
855
|
+
*/
|
|
856
|
+
const NXA_THEME_SAVING = new InjectionToken('NXA_THEME_SAVING', {
|
|
857
|
+
providedIn: 'root',
|
|
858
|
+
factory: () => (themeName) => {
|
|
859
|
+
console.debug(`Inject a function to store ${themeName} the selected theme of the user`);
|
|
860
|
+
}
|
|
861
|
+
});
|
|
862
|
+
class NxaThemeService {
|
|
863
|
+
_defaultLightTheme = inject(NXA_DEFAULT_LIGHT_THEME);
|
|
864
|
+
_defaultDarkTheme = inject(NXA_DEFAULT_DARK_THEME);
|
|
865
|
+
_preferDarkTheme = inject(NXA_PREFER_DARK_THEME);
|
|
866
|
+
_themeBrightnessMap = inject(NXA_THEME_BRIGHTNESS_MAP);
|
|
867
|
+
_themeLoaderFn = inject(NXA_THEME_LOADER);
|
|
868
|
+
_themeSavingFn = inject(NXA_THEME_SAVING);
|
|
869
|
+
_currentTheme = null;
|
|
870
|
+
get currentTheme() {
|
|
871
|
+
return this._currentTheme;
|
|
872
|
+
}
|
|
873
|
+
set currentTheme(value) {
|
|
874
|
+
this._currentTheme = value;
|
|
875
|
+
if (value)
|
|
876
|
+
this._currentBrightness$.next(this.getColorScheme(value));
|
|
877
|
+
}
|
|
878
|
+
_currentBrightness$ = new BehaviorSubject("dark");
|
|
879
|
+
get currentBrightness$() { return this._currentBrightness$.asObservable(); }
|
|
880
|
+
;
|
|
881
|
+
getTheme() {
|
|
882
|
+
return this.currentTheme;
|
|
883
|
+
}
|
|
884
|
+
getColorScheme(themeName) {
|
|
885
|
+
if (themeName)
|
|
886
|
+
return this._themeBrightnessMap[themeName];
|
|
887
|
+
return this._preferDarkTheme ? "dark" : "light";
|
|
888
|
+
}
|
|
889
|
+
setTheme(theme) {
|
|
890
|
+
if (!isBrowserContext())
|
|
891
|
+
return;
|
|
892
|
+
this._currentBrightness$.next(this.getColorScheme(theme));
|
|
893
|
+
if (this._currentTheme === theme)
|
|
894
|
+
return;
|
|
895
|
+
this._currentTheme = theme;
|
|
896
|
+
document.documentElement.setAttribute('data-theme', theme);
|
|
897
|
+
if (this._themeSavingFn) {
|
|
898
|
+
this._themeSavingFn(this._currentTheme);
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
constructor() {
|
|
902
|
+
this._initializeTheme();
|
|
903
|
+
}
|
|
904
|
+
async _initializeTheme() {
|
|
905
|
+
if (typeof document === "undefined")
|
|
906
|
+
return;
|
|
907
|
+
// Load theme from HTML
|
|
908
|
+
const htmlTheme = document.documentElement.getAttribute('data-theme');
|
|
909
|
+
// if no theme is provided in html
|
|
910
|
+
if (!htmlTheme) {
|
|
911
|
+
try {
|
|
912
|
+
// try to read with the theme loaded function
|
|
913
|
+
const loadedTheme = await this._resolveTheme(this._themeLoaderFn);
|
|
914
|
+
// if it not work then throw an error and go on the fall back
|
|
915
|
+
if (!loadedTheme) {
|
|
916
|
+
throw new Error('Theme loader returned null or undefined');
|
|
917
|
+
}
|
|
918
|
+
this.setTheme(loadedTheme);
|
|
919
|
+
}
|
|
920
|
+
catch {
|
|
921
|
+
// fall back to default theme
|
|
922
|
+
const fallback = this._preferDarkTheme ? this._defaultDarkTheme : this._defaultLightTheme;
|
|
923
|
+
this.setTheme(fallback);
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
else {
|
|
927
|
+
// set theme from html and save it
|
|
928
|
+
this.setTheme(htmlTheme);
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
async _resolveTheme(loader) {
|
|
932
|
+
if (isObservable(loader)) {
|
|
933
|
+
return await firstValueFrom(loader);
|
|
934
|
+
}
|
|
935
|
+
else if (loader instanceof Promise) {
|
|
936
|
+
return await loader;
|
|
937
|
+
}
|
|
938
|
+
else {
|
|
939
|
+
return loader();
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaThemeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
943
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaThemeService, providedIn: 'root' });
|
|
944
|
+
}
|
|
945
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaThemeService, decorators: [{
|
|
946
|
+
type: Injectable,
|
|
947
|
+
args: [{
|
|
948
|
+
providedIn: 'root'
|
|
949
|
+
}]
|
|
950
|
+
}], ctorParameters: () => [] });
|
|
951
|
+
|
|
952
|
+
const NXA_TOAST_CONFIG_DEFAULTS = new InjectionToken('NXA_TOAST_CONFIG_DEFAULTS', {
|
|
953
|
+
providedIn: 'any',
|
|
954
|
+
factory: () => {
|
|
955
|
+
return {
|
|
956
|
+
component: NxaToast,
|
|
957
|
+
direction: 'bottom-right',
|
|
958
|
+
width: 'auto',
|
|
959
|
+
height: 'auto',
|
|
960
|
+
maxWidth: '20rem',
|
|
961
|
+
maxHeight: '1rem',
|
|
962
|
+
/**
|
|
963
|
+
* x and y distance from the edge of the screen.
|
|
964
|
+
* The first value is for x (left or right)
|
|
965
|
+
* and the second value is for y (top or bottom).
|
|
966
|
+
* You can use any valid CSS length unit (e.g., px, rem, %, etc.).
|
|
967
|
+
*/
|
|
968
|
+
distance: ['1em', '3em'],
|
|
969
|
+
};
|
|
970
|
+
},
|
|
971
|
+
});
|
|
972
|
+
class NxaToastService {
|
|
973
|
+
static count = 0;
|
|
974
|
+
overlayService = inject(NxaOverlayService);
|
|
975
|
+
toastDefaultConfig = inject(NXA_TOAST_CONFIG_DEFAULTS);
|
|
976
|
+
overlay = inject(Overlay);
|
|
977
|
+
show(title, message, color, duration = 3000, config) {
|
|
978
|
+
const finalConf = { ...this.toastDefaultConfig, ...config };
|
|
979
|
+
let positionStrategy = this.overlay.position().global();
|
|
980
|
+
if (finalConf.direction.includes('top')) {
|
|
981
|
+
positionStrategy = positionStrategy.top(`${finalConf.distance[1]}`);
|
|
982
|
+
}
|
|
983
|
+
if (finalConf.direction.includes('bottom')) {
|
|
984
|
+
positionStrategy = positionStrategy.bottom(`${finalConf.distance[1]}`);
|
|
985
|
+
}
|
|
986
|
+
if (finalConf.direction.includes('right')) {
|
|
987
|
+
positionStrategy = positionStrategy.right(`${finalConf.distance[0]}`);
|
|
988
|
+
}
|
|
989
|
+
if (finalConf.direction.includes('left')) {
|
|
990
|
+
positionStrategy = positionStrategy.left(`${finalConf.distance[0]}`);
|
|
991
|
+
}
|
|
992
|
+
const ref = this.overlayService.create(config?.component ?? NxaToast, { title: title, message, color, duration }, {
|
|
993
|
+
hasBackdrop: false,
|
|
994
|
+
positionStrategy: positionStrategy,
|
|
995
|
+
panelClass: finalConf.panelClass,
|
|
996
|
+
height: finalConf.height,
|
|
997
|
+
maxHeight: finalConf.maxHeight,
|
|
998
|
+
maxWidth: finalConf.maxWidth,
|
|
999
|
+
width: finalConf.width,
|
|
1000
|
+
});
|
|
1001
|
+
NxaToastService.count++;
|
|
1002
|
+
timer(duration).subscribe(() => {
|
|
1003
|
+
NxaToastService.count--;
|
|
1004
|
+
ref.close();
|
|
1005
|
+
});
|
|
1006
|
+
}
|
|
1007
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaToastService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1008
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaToastService, providedIn: 'root' });
|
|
1009
|
+
}
|
|
1010
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaToastService, decorators: [{
|
|
1011
|
+
type: Injectable,
|
|
1012
|
+
args: [{
|
|
1013
|
+
providedIn: 'root',
|
|
1014
|
+
}]
|
|
1015
|
+
}] });
|
|
1016
|
+
|
|
1017
|
+
// import { inject } from '@angular/core';
|
|
1018
|
+
// import { NxaConstructor } from '../utils/nxa-mixin-utils';
|
|
1019
|
+
// import {
|
|
1020
|
+
// NxaOverlayService,
|
|
1021
|
+
// } from '../services/overlay/nxa-overlay.service';
|
|
1022
|
+
// import { NxaOverlayHandler, NXA_OVERLAY_DATA, NXA_OVERLAY_HANDLER, NxaOverlayState } from '../services';
|
|
1023
|
+
// Base overlay
|
|
1024
|
+
const NxaOverlayBase = NxaOverlayBaseMixin(class {
|
|
1025
|
+
});
|
|
1026
|
+
// // Overlay + draggable contract
|
|
1027
|
+
// export interface INxaOverlayDraggable<TData> extends INxaOverlay<TData> {
|
|
1028
|
+
// startDrag(): void;
|
|
1029
|
+
// stopDrag(): void;
|
|
1030
|
+
// updateOverlayPosition(x: number, y: number): void;
|
|
1031
|
+
// }
|
|
1032
|
+
// Base mixin: injects overlay services
|
|
1033
|
+
function NxaOverlayBaseMixin(Base) {
|
|
1034
|
+
return class extends Base {
|
|
1035
|
+
overlayService = inject(NxaOverlayService);
|
|
1036
|
+
overlayRef = inject(NxaOverlayRef);
|
|
1037
|
+
overlayData = inject(NXA_OVERLAY_DATA);
|
|
1038
|
+
};
|
|
1039
|
+
}
|
|
1040
|
+
// // Draggable mixin: requires the base overlay mixin
|
|
1041
|
+
// export function NxaOverlayDraggableMixin<
|
|
1042
|
+
// TData,
|
|
1043
|
+
// TBase extends NxaConstructor<object>,
|
|
1044
|
+
// >(Base: TBase) {
|
|
1045
|
+
// return class
|
|
1046
|
+
// extends NxaOverlayBaseMixin<TData, TBase>(Base)
|
|
1047
|
+
// implements INxaOverlayDraggable<TData>
|
|
1048
|
+
// {
|
|
1049
|
+
// startDrag(): void {
|
|
1050
|
+
// (this.overlayState.value as any).dragging = true;
|
|
1051
|
+
// }
|
|
1052
|
+
// updateOverlayPosition(x: number, y: number) {
|
|
1053
|
+
// if (!(this.overlayState.value as any).dragging) return;
|
|
1054
|
+
// const offset = (this.overlayState.value as any).offset || { x: 0, y: 0 };
|
|
1055
|
+
// const newLeft = x + offset.x;
|
|
1056
|
+
// const newTop = y + offset.y;
|
|
1057
|
+
// this.overlayService.updateOverlayConfig({
|
|
1058
|
+
// ...this.overlayState,
|
|
1059
|
+
// left: `${newLeft}px`,
|
|
1060
|
+
// top: `${newTop}px`,
|
|
1061
|
+
// });
|
|
1062
|
+
// }
|
|
1063
|
+
// stopDrag(): void {
|
|
1064
|
+
// (this.overlayState.value as any).dragging = false;
|
|
1065
|
+
// }
|
|
1066
|
+
// };
|
|
1067
|
+
// }
|
|
1068
|
+
|
|
1069
|
+
const WithClassName = WithClassNameMixin(class {
|
|
1070
|
+
});
|
|
1071
|
+
function WithClassNameMixin(Base) {
|
|
1072
|
+
return class extends Base {
|
|
1073
|
+
/** Raw internal value from the component's @Input() */
|
|
1074
|
+
_className = signal(null, ...(ngDevMode ? [{ debugName: "_className" }] : []));
|
|
1075
|
+
/** Normalized final string */
|
|
1076
|
+
_classNameObject = computed(() => {
|
|
1077
|
+
const classes = this._className();
|
|
1078
|
+
let out = {};
|
|
1079
|
+
if (!classes)
|
|
1080
|
+
return '';
|
|
1081
|
+
if (typeof classes === 'string') {
|
|
1082
|
+
out = classes
|
|
1083
|
+
.split(/\s+/)
|
|
1084
|
+
.filter(Boolean)
|
|
1085
|
+
.reduce((acc, val) => ({ ...acc, [val]: true }), {});
|
|
1086
|
+
}
|
|
1087
|
+
else if (typeof classes === 'object') {
|
|
1088
|
+
out = classes;
|
|
1089
|
+
}
|
|
1090
|
+
else {
|
|
1091
|
+
throw new Error('ClassName type is not valid', classes);
|
|
1092
|
+
}
|
|
1093
|
+
return out;
|
|
1094
|
+
}, ...(ngDevMode ? [{ debugName: "_classNameObject" }] : []));
|
|
1095
|
+
};
|
|
1096
|
+
}
|
|
1097
|
+
function WithClassHeaderMixin(base) {
|
|
1098
|
+
return class extends base {
|
|
1099
|
+
_classHeader = signal('', ...(ngDevMode ? [{ debugName: "_classHeader" }] : []));
|
|
1100
|
+
_classHeaderObject = computed(() => {
|
|
1101
|
+
const classes = this._classHeader();
|
|
1102
|
+
let out = {};
|
|
1103
|
+
if (!classes)
|
|
1104
|
+
return {};
|
|
1105
|
+
if (typeof classes === 'string') {
|
|
1106
|
+
// String to object
|
|
1107
|
+
out = classes
|
|
1108
|
+
.split(/\s+/)
|
|
1109
|
+
.filter(Boolean)
|
|
1110
|
+
.reduce((acc, val) => ({ ...acc, [val]: true }), {});
|
|
1111
|
+
}
|
|
1112
|
+
else if (typeof classes === 'object') {
|
|
1113
|
+
out = classes;
|
|
1114
|
+
}
|
|
1115
|
+
else {
|
|
1116
|
+
throw new Error('ClassBody type is not valid', classes);
|
|
1117
|
+
}
|
|
1118
|
+
return out;
|
|
1119
|
+
}, ...(ngDevMode ? [{ debugName: "_classHeaderObject" }] : []));
|
|
1120
|
+
};
|
|
1121
|
+
}
|
|
1122
|
+
function WithClassBodyMixin(base) {
|
|
1123
|
+
return class extends base {
|
|
1124
|
+
_classBody = signal({}, ...(ngDevMode ? [{ debugName: "_classBody" }] : []));
|
|
1125
|
+
_classBodyObject = computed(() => {
|
|
1126
|
+
const classes = this._classBody();
|
|
1127
|
+
let out = {};
|
|
1128
|
+
if (!classes)
|
|
1129
|
+
return {};
|
|
1130
|
+
if (typeof classes === 'string') {
|
|
1131
|
+
// String to object
|
|
1132
|
+
out = classes
|
|
1133
|
+
.split(/\s+/)
|
|
1134
|
+
.filter(Boolean)
|
|
1135
|
+
.reduce((acc, val) => ({ ...acc, [val]: true }), {});
|
|
1136
|
+
}
|
|
1137
|
+
else if (typeof classes === 'object') {
|
|
1138
|
+
out = classes;
|
|
1139
|
+
}
|
|
1140
|
+
else {
|
|
1141
|
+
throw new Error('ClassBody type is not valid', classes);
|
|
1142
|
+
}
|
|
1143
|
+
return out;
|
|
1144
|
+
}, ...(ngDevMode ? [{ debugName: "_classBodyObject" }] : []));
|
|
1145
|
+
};
|
|
1146
|
+
}
|
|
1147
|
+
function WithClassFooterMixin(base) {
|
|
1148
|
+
return class extends base {
|
|
1149
|
+
_classFooter = signal('', ...(ngDevMode ? [{ debugName: "_classFooter" }] : []));
|
|
1150
|
+
_classFooterObject = computed(() => {
|
|
1151
|
+
const classes = this._classFooter();
|
|
1152
|
+
let out = {};
|
|
1153
|
+
if (!classes)
|
|
1154
|
+
return {};
|
|
1155
|
+
if (typeof classes === 'string') {
|
|
1156
|
+
// String to object
|
|
1157
|
+
out = classes
|
|
1158
|
+
.split(/\s+/)
|
|
1159
|
+
.filter(Boolean)
|
|
1160
|
+
.reduce((acc, val) => ({ ...acc, [val]: true }), {});
|
|
1161
|
+
}
|
|
1162
|
+
else if (typeof classes === 'object') {
|
|
1163
|
+
out = classes;
|
|
1164
|
+
}
|
|
1165
|
+
else {
|
|
1166
|
+
throw new Error('ClassBody type is not valid', classes);
|
|
1167
|
+
}
|
|
1168
|
+
return out;
|
|
1169
|
+
}, ...(ngDevMode ? [{ debugName: "_classFooterObject" }] : []));
|
|
1170
|
+
};
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
// Typeguard
|
|
1174
|
+
function isNxaDropDownOption(obj) {
|
|
1175
|
+
return obj && typeof obj === 'object' && 'label' in obj && 'value' in obj;
|
|
1176
|
+
}
|
|
1177
|
+
class NxaDropdown extends WithClassNameMixin(class {
|
|
1178
|
+
}) {
|
|
1179
|
+
//#region state
|
|
1180
|
+
_isOpen = signal(false, ...(ngDevMode ? [{ debugName: "_isOpen" }] : []));
|
|
1181
|
+
_label = signal('', ...(ngDevMode ? [{ debugName: "_label" }] : []));
|
|
1182
|
+
_options = signal([], ...(ngDevMode ? [{ debugName: "_options" }] : []));
|
|
1183
|
+
_buttonTemplateRef = signal(null, ...(ngDevMode ? [{ debugName: "_buttonTemplateRef" }] : []));
|
|
1184
|
+
_itemTemplateRef = signal(null, ...(ngDevMode ? [{ debugName: "_itemTemplateRef" }] : []));
|
|
1185
|
+
_value = modelState(null, true);
|
|
1186
|
+
//#endregion
|
|
1187
|
+
//#region inputs/outputs
|
|
1188
|
+
set isOpen(value) {
|
|
1189
|
+
this._isOpen.set(value);
|
|
1190
|
+
}
|
|
1191
|
+
get isOpen() {
|
|
1192
|
+
return this._isOpen();
|
|
1193
|
+
}
|
|
1194
|
+
set label(value) {
|
|
1195
|
+
this._label.set(value);
|
|
1196
|
+
}
|
|
1197
|
+
get label() {
|
|
1198
|
+
return this._label();
|
|
1199
|
+
}
|
|
1200
|
+
set options(value) {
|
|
1201
|
+
this._options.set(value);
|
|
1202
|
+
}
|
|
1203
|
+
get options() {
|
|
1204
|
+
return this._options();
|
|
1205
|
+
}
|
|
1206
|
+
set buttonTemplateRef(value) {
|
|
1207
|
+
this._buttonTemplateRef.set(value);
|
|
1208
|
+
}
|
|
1209
|
+
get buttonTemplateRef() {
|
|
1210
|
+
return this._buttonTemplateRef();
|
|
1211
|
+
}
|
|
1212
|
+
set itemTemplateRef(value) {
|
|
1213
|
+
this._itemTemplateRef.set(value);
|
|
1214
|
+
}
|
|
1215
|
+
get itemTemplateRef() {
|
|
1216
|
+
return this._itemTemplateRef();
|
|
1217
|
+
}
|
|
1218
|
+
set className(value) {
|
|
1219
|
+
this._className.set(value);
|
|
1220
|
+
}
|
|
1221
|
+
get className() {
|
|
1222
|
+
return this._className();
|
|
1223
|
+
}
|
|
1224
|
+
set value(value) {
|
|
1225
|
+
if (isNxaDropDownOption(value)) {
|
|
1226
|
+
this._value.set(value); // full option object
|
|
1227
|
+
}
|
|
1228
|
+
else {
|
|
1229
|
+
this._value.set(value != null ? { label: String(value), value } : null);
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
get value() {
|
|
1233
|
+
return this._value.get();
|
|
1234
|
+
}
|
|
1235
|
+
valueChange = this._value.emitter;
|
|
1236
|
+
//#endregion
|
|
1237
|
+
selectByValue(value) {
|
|
1238
|
+
const options = this.options;
|
|
1239
|
+
const match = options.find((opt) => {
|
|
1240
|
+
if (typeof opt === 'string') {
|
|
1241
|
+
return opt === value;
|
|
1242
|
+
}
|
|
1243
|
+
return opt.value === value;
|
|
1244
|
+
});
|
|
1245
|
+
if (!match)
|
|
1246
|
+
return;
|
|
1247
|
+
if (typeof match === 'string') {
|
|
1248
|
+
this._value.set({
|
|
1249
|
+
label: match,
|
|
1250
|
+
value: match,
|
|
1251
|
+
});
|
|
1252
|
+
return;
|
|
1253
|
+
}
|
|
1254
|
+
this._value.set(match);
|
|
1255
|
+
}
|
|
1256
|
+
selectItem(selectedItem) {
|
|
1257
|
+
this._value.set(selectedItem);
|
|
1258
|
+
// this.valueChange.emit(selectedItem.value);
|
|
1259
|
+
}
|
|
1260
|
+
_normalizedOptions = computed(() => this._options().map(item => typeof item === 'string'
|
|
1261
|
+
? { label: item, value: item }
|
|
1262
|
+
: item), ...(ngDevMode ? [{ debugName: "_normalizedOptions" }] : []));
|
|
1263
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaDropdown, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1264
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.5", type: NxaDropdown, isStandalone: true, selector: "nxa-dropdown", inputs: { isOpen: "isOpen", label: "label", options: "options", buttonTemplateRef: "buttonTemplateRef", itemTemplateRef: "itemTemplateRef", className: "className", value: "value" }, outputs: { valueChange: "valueChange" }, usesInheritance: true, ngImport: i0, template: "<!-- Drop Down Container -->\n<div class=\"dropdown nxa-dropdown\" [ngClass]=\"_classNameObject()\" (focusin)=\"_isOpen.set(true)\"\n (focusout)=\"_isOpen.set(false)\">\n <!-- Drop Down Button -->\n @if(!!_buttonTemplateRef()){\n <!-- DropDown Template Injected Button -->\n <ng-container *ngTemplateOutlet=\"_buttonTemplateRef()!\"></ng-container>\n }@else {\n <!-- DropDown Default Button -->\n <nxa-button color=\"primary\" className=\"w-full h-full\">\n <p class=\"font-semibold menu\">{{ _value.get()?.label || _label() }}</p>\n <div trailing class=\"swap swap-rotate fill-current\">\n <ng-icon name=\"heroChevronDownSolid\" [class.swap-on]=\"_isOpen()\" [class.swap-off]=\"!_isOpen()\"\n class=\"fill-current\"></ng-icon>\n <ng-icon name=\"heroChevronUpSolid\" [class.swap-on]=\"!_isOpen()\" [class.swap-off]=\"_isOpen()\"\n class=\"fill-current\"></ng-icon>\n </div>\n </nxa-button>\n }\n <!-- Drop Down List Of Items -->\n <ul tabindex=\"0\" class=\"dropdown-content menu bg-base-100 rounded-box z-100 min-w-32 p-2 w-fit nxa-dropdown-content\">\n @for (item of _normalizedOptions(); track $index) {\n <li class=\"w-fit cursor-pointer\" tabindex=\"0\" (click)=\"selectItem(item)\" (keypress.enter)=\"selectItem(item)\">\n @if (!!_itemTemplateRef()) {\n <ng-container\n *ngTemplateOutlet=\"_itemTemplateRef()!; context: { label: item.label, value: item.value }\"></ng-container>\n } @else {\n <p>{{ item.label }}</p>\n }\n </li>\n }\n </ul>\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: NxaButton, selector: "nxa-button", inputs: ["label", "color", "size", "disabled", "loading", "routerLink", "outlined", "className", "type", "spinnerTemplateRef"], outputs: ["nxaClick"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], viewProviders: [provideIcons({ heroChevronDownSolid, heroChevronUpSolid })], encapsulation: i0.ViewEncapsulation.None });
|
|
1265
|
+
}
|
|
1266
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaDropdown, decorators: [{
|
|
1267
|
+
type: Component,
|
|
1268
|
+
args: [{ selector: 'nxa-dropdown', imports: [CommonModule, NxaButton, NgIcon], viewProviders: [provideIcons({ heroChevronDownSolid, heroChevronUpSolid })], encapsulation: ViewEncapsulation.None, template: "<!-- Drop Down Container -->\n<div class=\"dropdown nxa-dropdown\" [ngClass]=\"_classNameObject()\" (focusin)=\"_isOpen.set(true)\"\n (focusout)=\"_isOpen.set(false)\">\n <!-- Drop Down Button -->\n @if(!!_buttonTemplateRef()){\n <!-- DropDown Template Injected Button -->\n <ng-container *ngTemplateOutlet=\"_buttonTemplateRef()!\"></ng-container>\n }@else {\n <!-- DropDown Default Button -->\n <nxa-button color=\"primary\" className=\"w-full h-full\">\n <p class=\"font-semibold menu\">{{ _value.get()?.label || _label() }}</p>\n <div trailing class=\"swap swap-rotate fill-current\">\n <ng-icon name=\"heroChevronDownSolid\" [class.swap-on]=\"_isOpen()\" [class.swap-off]=\"!_isOpen()\"\n class=\"fill-current\"></ng-icon>\n <ng-icon name=\"heroChevronUpSolid\" [class.swap-on]=\"!_isOpen()\" [class.swap-off]=\"_isOpen()\"\n class=\"fill-current\"></ng-icon>\n </div>\n </nxa-button>\n }\n <!-- Drop Down List Of Items -->\n <ul tabindex=\"0\" class=\"dropdown-content menu bg-base-100 rounded-box z-100 min-w-32 p-2 w-fit nxa-dropdown-content\">\n @for (item of _normalizedOptions(); track $index) {\n <li class=\"w-fit cursor-pointer\" tabindex=\"0\" (click)=\"selectItem(item)\" (keypress.enter)=\"selectItem(item)\">\n @if (!!_itemTemplateRef()) {\n <ng-container\n *ngTemplateOutlet=\"_itemTemplateRef()!; context: { label: item.label, value: item.value }\"></ng-container>\n } @else {\n <p>{{ item.label }}</p>\n }\n </li>\n }\n </ul>\n</div>" }]
|
|
1269
|
+
}], propDecorators: { isOpen: [{
|
|
1270
|
+
type: Input
|
|
1271
|
+
}], label: [{
|
|
1272
|
+
type: Input
|
|
1273
|
+
}], options: [{
|
|
1274
|
+
type: Input
|
|
1275
|
+
}], buttonTemplateRef: [{
|
|
1276
|
+
type: Input
|
|
1277
|
+
}], itemTemplateRef: [{
|
|
1278
|
+
type: Input
|
|
1279
|
+
}], className: [{
|
|
1280
|
+
type: Input
|
|
1281
|
+
}], value: [{
|
|
1282
|
+
type: Input
|
|
1283
|
+
}], valueChange: [{
|
|
1284
|
+
type: Output
|
|
1285
|
+
}] } });
|
|
1286
|
+
|
|
1287
|
+
class NxaFileInput {
|
|
1288
|
+
//#region state
|
|
1289
|
+
_multiFile = signal(false, ...(ngDevMode ? [{ debugName: "_multiFile" }] : []));
|
|
1290
|
+
_disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : []));
|
|
1291
|
+
_color = signal('neutral', ...(ngDevMode ? [{ debugName: "_color" }] : []));
|
|
1292
|
+
_size = signal('md', ...(ngDevMode ? [{ debugName: "_size" }] : []));
|
|
1293
|
+
_className = signal('', ...(ngDevMode ? [{ debugName: "_className" }] : []));
|
|
1294
|
+
_value = modelState(null, true);
|
|
1295
|
+
//#endregion
|
|
1296
|
+
//#region Input/Output
|
|
1297
|
+
set multiFile(value) {
|
|
1298
|
+
this._multiFile.set(value);
|
|
1299
|
+
}
|
|
1300
|
+
set disabled(value) {
|
|
1301
|
+
this._disabled.set(value);
|
|
1302
|
+
}
|
|
1303
|
+
set color(value) {
|
|
1304
|
+
this._color.set(value);
|
|
1305
|
+
}
|
|
1306
|
+
set size(value) {
|
|
1307
|
+
this._size.set(value);
|
|
1308
|
+
}
|
|
1309
|
+
set className(value) {
|
|
1310
|
+
this._className.set(value);
|
|
1311
|
+
}
|
|
1312
|
+
set value(value) {
|
|
1313
|
+
this._value.set(value);
|
|
1314
|
+
}
|
|
1315
|
+
valueChange = this._value.emitter;
|
|
1316
|
+
//#endregion
|
|
1317
|
+
//#region Input State Fn
|
|
1318
|
+
onChange = () => { return; };
|
|
1319
|
+
onTouched = () => { return; };
|
|
1320
|
+
//#endregion
|
|
1321
|
+
//#region Compute Class
|
|
1322
|
+
computedInputNgClasses = computed(() => ({
|
|
1323
|
+
[`file-input-${this._size()}`]: true,
|
|
1324
|
+
[`file-input-${this._color()}`]: true,
|
|
1325
|
+
}), ...(ngDevMode ? [{ debugName: "computedInputNgClasses" }] : []));
|
|
1326
|
+
//#endregion
|
|
1327
|
+
//#region control value Accessor
|
|
1328
|
+
writeValue(obj) {
|
|
1329
|
+
this._value.set(obj);
|
|
1330
|
+
}
|
|
1331
|
+
registerOnChange(fn) {
|
|
1332
|
+
this.onChange = fn;
|
|
1333
|
+
}
|
|
1334
|
+
registerOnTouched(fn) {
|
|
1335
|
+
this.onTouched = fn;
|
|
1336
|
+
}
|
|
1337
|
+
setDisabledState(isDisabled) {
|
|
1338
|
+
this._disabled.set(isDisabled);
|
|
1339
|
+
}
|
|
1340
|
+
onFileSelected(event) {
|
|
1341
|
+
const input = event.target;
|
|
1342
|
+
this._value.set(input.files ?? null);
|
|
1343
|
+
this.onChange(this._value.get());
|
|
1344
|
+
this.onTouched();
|
|
1345
|
+
}
|
|
1346
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaFileInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1347
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.5", type: NxaFileInput, isStandalone: true, selector: "nxa-file-input", inputs: { multiFile: "multiFile", disabled: "disabled", color: "color", size: "size", className: "className", value: "value" }, outputs: { valueChange: "valueChange" }, host: { classAttribute: "w-full h-full min-h-0 flex flex-col flex-1 p-2" }, providers: [
|
|
1348
|
+
{
|
|
1349
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1350
|
+
useExisting: forwardRef(() => NxaFileInput),
|
|
1351
|
+
multi: true,
|
|
1352
|
+
}
|
|
1353
|
+
], ngImport: i0, template: "<input \ntype=\"file\" \nclass=\"file-input\" \n[ngClass]=\"computedInputNgClasses()\"\n[class]=\"_className()\"\n(change)=\"onFileSelected($event)\" \n[multiple]=\"_multiFile()\" \n[disabled]=\"_disabled()\"\n/>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
1354
|
+
}
|
|
1355
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaFileInput, decorators: [{
|
|
1356
|
+
type: Component,
|
|
1357
|
+
args: [{ selector: 'nxa-file-input', host: {
|
|
1358
|
+
class: `${NXA_HOST_LAYOUT} p-2`,
|
|
1359
|
+
}, providers: [
|
|
1360
|
+
{
|
|
1361
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1362
|
+
useExisting: forwardRef(() => NxaFileInput),
|
|
1363
|
+
multi: true,
|
|
1364
|
+
}
|
|
1365
|
+
], imports: [CommonModule], template: "<input \ntype=\"file\" \nclass=\"file-input\" \n[ngClass]=\"computedInputNgClasses()\"\n[class]=\"_className()\"\n(change)=\"onFileSelected($event)\" \n[multiple]=\"_multiFile()\" \n[disabled]=\"_disabled()\"\n/>\n" }]
|
|
1366
|
+
}], propDecorators: { multiFile: [{
|
|
1367
|
+
type: Input
|
|
1368
|
+
}], disabled: [{
|
|
1369
|
+
type: Input
|
|
1370
|
+
}], color: [{
|
|
1371
|
+
type: Input
|
|
1372
|
+
}], size: [{
|
|
1373
|
+
type: Input
|
|
1374
|
+
}], className: [{
|
|
1375
|
+
type: Input
|
|
1376
|
+
}], value: [{
|
|
1377
|
+
type: Input
|
|
1378
|
+
}], valueChange: [{
|
|
1379
|
+
type: Output
|
|
1380
|
+
}] } });
|
|
1381
|
+
|
|
1382
|
+
class NxaRadio {
|
|
1383
|
+
//#region State
|
|
1384
|
+
_id = signal('', ...(ngDevMode ? [{ debugName: "_id" }] : []));
|
|
1385
|
+
set id(value) { this._id.set(value); }
|
|
1386
|
+
get id() { return this._id(); }
|
|
1387
|
+
_name = signal('', ...(ngDevMode ? [{ debugName: "_name" }] : []));
|
|
1388
|
+
set name(value) { this._name.set(value); }
|
|
1389
|
+
get name() { return this._name(); }
|
|
1390
|
+
_value = signal(null, ...(ngDevMode ? [{ debugName: "_value" }] : []));
|
|
1391
|
+
set value(value) { this._value.set(value); }
|
|
1392
|
+
get value() { return this._value(); }
|
|
1393
|
+
_checked = modelState(false, true);
|
|
1394
|
+
set checked(value) { this._checked.set(value); }
|
|
1395
|
+
get checked() { return this._checked.get(); }
|
|
1396
|
+
_disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : []));
|
|
1397
|
+
set disabled(value) { this._disabled.set(value); }
|
|
1398
|
+
get disabled() { return this._disabled(); }
|
|
1399
|
+
_color = signal('neutral', ...(ngDevMode ? [{ debugName: "_color" }] : []));
|
|
1400
|
+
set color(value) { this._color.set(value); }
|
|
1401
|
+
_size = signal('md', ...(ngDevMode ? [{ debugName: "_size" }] : []));
|
|
1402
|
+
set size(value) { this._size.set(value); }
|
|
1403
|
+
_className = signal('', ...(ngDevMode ? [{ debugName: "_className" }] : []));
|
|
1404
|
+
set className(value) { this._className.set(value); }
|
|
1405
|
+
get className() { return this._className(); }
|
|
1406
|
+
//#endregion
|
|
1407
|
+
selectedChangeEffect = effect(() => {
|
|
1408
|
+
const checked = this._checked.get();
|
|
1409
|
+
if (checked) {
|
|
1410
|
+
this.selected.emit();
|
|
1411
|
+
}
|
|
1412
|
+
}, ...(ngDevMode ? [{ debugName: "selectedChangeEffect" }] : []));
|
|
1413
|
+
selected = new EventEmitter();
|
|
1414
|
+
checkedChange = this._checked.emitter;
|
|
1415
|
+
//#endregion
|
|
1416
|
+
//#region Computed classes
|
|
1417
|
+
computedNgClasses = computed(() => ({
|
|
1418
|
+
[`radio-${this._color()}`]: true,
|
|
1419
|
+
[`radio-${this._size()}`]: true,
|
|
1420
|
+
'disabled': this._disabled(),
|
|
1421
|
+
'checked': this._checked.get()
|
|
1422
|
+
}), ...(ngDevMode ? [{ debugName: "computedNgClasses" }] : []));
|
|
1423
|
+
//#endregion
|
|
1424
|
+
//#region Methods
|
|
1425
|
+
/** Called by group to set checked state */
|
|
1426
|
+
setChecked(value) {
|
|
1427
|
+
this._checked.set(value);
|
|
1428
|
+
}
|
|
1429
|
+
/** Trigger selection event */
|
|
1430
|
+
select() {
|
|
1431
|
+
if (!this._disabled()) {
|
|
1432
|
+
// this.selected.emit(this._value()!);
|
|
1433
|
+
this._checked.set(true);
|
|
1434
|
+
}
|
|
1435
|
+
}
|
|
1436
|
+
setDisabledState(isDisabled) {
|
|
1437
|
+
this._disabled.set(isDisabled);
|
|
1438
|
+
}
|
|
1439
|
+
/** For native input change if used directly */
|
|
1440
|
+
onNativeChange(event) {
|
|
1441
|
+
const input = event.target;
|
|
1442
|
+
this._checked.set(input.checked);
|
|
1443
|
+
if (input.checked)
|
|
1444
|
+
this.selected.emit();
|
|
1445
|
+
}
|
|
1446
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaRadio, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1447
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.5", type: NxaRadio, isStandalone: true, selector: "nxa-radio", inputs: { id: "id", name: "name", value: "value", checked: "checked", disabled: "disabled", color: "color", size: "size", className: "className" }, outputs: { selected: "selected", checkedChange: "checkedChange" }, host: { classAttribute: "contents" }, ngImport: i0, template: "<div class=\"form-control min-w-fit w-fit display flex flex-row items-center nxa-radio\" [class]=\"_className()\">\n <div class=\"label label-text w-fit\">\n <ng-content select=\"[label]\" class=\"label-text\"></ng-content>\n </div>\n <input \n tabindex=\"0\" \n [id]=\"_id()\" \n type=\"radio\" \n [name]=\"_name()\" \n [value]=\"_value()\"\n [checked]=\"_checked.get()\"\n [disabled]=\"_disabled()\" \n [aria-checked]=\"_checked.get()\"\n [aria-disabled]=\"_disabled()\"\n (input)=\"onNativeChange($event)\"\n class=\"radio mx-2\" [ngClass]=\"computedNgClasses()\" />\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
1448
|
+
}
|
|
1449
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaRadio, decorators: [{
|
|
1450
|
+
type: Component,
|
|
1451
|
+
args: [{ selector: 'nxa-radio', standalone: true, encapsulation: ViewEncapsulation.None, host: {
|
|
1452
|
+
class: NXA_HOST_CONTENTS_ONLY
|
|
1453
|
+
}, imports: [CommonModule], template: "<div class=\"form-control min-w-fit w-fit display flex flex-row items-center nxa-radio\" [class]=\"_className()\">\n <div class=\"label label-text w-fit\">\n <ng-content select=\"[label]\" class=\"label-text\"></ng-content>\n </div>\n <input \n tabindex=\"0\" \n [id]=\"_id()\" \n type=\"radio\" \n [name]=\"_name()\" \n [value]=\"_value()\"\n [checked]=\"_checked.get()\"\n [disabled]=\"_disabled()\" \n [aria-checked]=\"_checked.get()\"\n [aria-disabled]=\"_disabled()\"\n (input)=\"onNativeChange($event)\"\n class=\"radio mx-2\" [ngClass]=\"computedNgClasses()\" />\n</div>" }]
|
|
1454
|
+
}], propDecorators: { id: [{
|
|
1455
|
+
type: Input
|
|
1456
|
+
}], name: [{
|
|
1457
|
+
type: Input
|
|
1458
|
+
}], value: [{
|
|
1459
|
+
type: Input
|
|
1460
|
+
}], checked: [{
|
|
1461
|
+
type: Input
|
|
1462
|
+
}], disabled: [{
|
|
1463
|
+
type: Input
|
|
1464
|
+
}], color: [{
|
|
1465
|
+
type: Input
|
|
1466
|
+
}], size: [{
|
|
1467
|
+
type: Input
|
|
1468
|
+
}], className: [{
|
|
1469
|
+
type: Input
|
|
1470
|
+
}], selected: [{
|
|
1471
|
+
type: Output
|
|
1472
|
+
}], checkedChange: [{
|
|
1473
|
+
type: Output
|
|
1474
|
+
}] } });
|
|
1475
|
+
|
|
1476
|
+
class NxaRadioGroup {
|
|
1477
|
+
_radiosSig = contentChildren(NxaRadio, { ...(ngDevMode ? { debugName: "_radiosSig" } : {}), descendants: true });
|
|
1478
|
+
_selectedValue = modelState(null, true);
|
|
1479
|
+
get selectedValue() {
|
|
1480
|
+
return this._selectedValue.get();
|
|
1481
|
+
}
|
|
1482
|
+
set selectedValue(value) {
|
|
1483
|
+
this._selectedValue.set(value);
|
|
1484
|
+
this.updateRadios();
|
|
1485
|
+
this.onChange(value);
|
|
1486
|
+
this.onTouched();
|
|
1487
|
+
}
|
|
1488
|
+
_name = signal('', ...(ngDevMode ? [{ debugName: "_name" }] : []));
|
|
1489
|
+
set name(value) {
|
|
1490
|
+
this._name.set(value);
|
|
1491
|
+
this._radiosSig().forEach((radio) => (radio.name = value));
|
|
1492
|
+
}
|
|
1493
|
+
get name() {
|
|
1494
|
+
return this._name();
|
|
1495
|
+
}
|
|
1496
|
+
onChange = () => {
|
|
1497
|
+
return;
|
|
1498
|
+
};
|
|
1499
|
+
onTouched = () => {
|
|
1500
|
+
return;
|
|
1501
|
+
};
|
|
1502
|
+
ngAfterContentInit() {
|
|
1503
|
+
this._radiosSig().forEach((radio) => {
|
|
1504
|
+
radio.name = this.name;
|
|
1505
|
+
radio.selected.subscribe(() => {
|
|
1506
|
+
this.selectedValue = radio.value;
|
|
1507
|
+
});
|
|
1508
|
+
});
|
|
1509
|
+
this.updateRadios(); // initial sync
|
|
1510
|
+
}
|
|
1511
|
+
writeValue(obj) {
|
|
1512
|
+
this._selectedValue.set(obj);
|
|
1513
|
+
this.updateRadios();
|
|
1514
|
+
}
|
|
1515
|
+
registerOnChange(fn) {
|
|
1516
|
+
this.onChange = fn;
|
|
1517
|
+
}
|
|
1518
|
+
registerOnTouched(fn) {
|
|
1519
|
+
this.onTouched = fn;
|
|
1520
|
+
}
|
|
1521
|
+
setDisabledState(isDisabled) {
|
|
1522
|
+
this._radiosSig().forEach((radio) => radio.setDisabledState(isDisabled));
|
|
1523
|
+
}
|
|
1524
|
+
/** Sync all radios with the selected value */
|
|
1525
|
+
updateRadios() {
|
|
1526
|
+
const value = this._selectedValue.get();
|
|
1527
|
+
this._radiosSig()?.forEach((radio) => {
|
|
1528
|
+
radio.setChecked(radio.value === value);
|
|
1529
|
+
});
|
|
1530
|
+
}
|
|
1531
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaRadioGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1532
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.1.5", type: NxaRadioGroup, isStandalone: true, selector: "nxa-radio-group", inputs: { selectedValue: "selectedValue", name: "name" }, providers: [
|
|
1533
|
+
{
|
|
1534
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1535
|
+
useExisting: forwardRef(() => NxaRadioGroup),
|
|
1536
|
+
multi: true,
|
|
1537
|
+
},
|
|
1538
|
+
], queries: [{ propertyName: "_radiosSig", predicate: NxaRadio, descendants: true, isSignal: true }], ngImport: i0, template: ` <ng-content select=""></ng-content> `, isInline: true });
|
|
1539
|
+
}
|
|
1540
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaRadioGroup, decorators: [{
|
|
1541
|
+
type: Component,
|
|
1542
|
+
args: [{
|
|
1543
|
+
selector: 'nxa-radio-group',
|
|
1544
|
+
template: ` <ng-content select=""></ng-content> `,
|
|
1545
|
+
providers: [
|
|
1546
|
+
{
|
|
1547
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1548
|
+
useExisting: forwardRef(() => NxaRadioGroup),
|
|
1549
|
+
multi: true,
|
|
1550
|
+
},
|
|
1551
|
+
],
|
|
1552
|
+
}]
|
|
1553
|
+
}], propDecorators: { _radiosSig: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => NxaRadio), { ...{ descendants: true }, isSignal: true }] }], selectedValue: [{
|
|
1554
|
+
type: Input
|
|
1555
|
+
}], name: [{
|
|
1556
|
+
type: Input
|
|
1557
|
+
}] } });
|
|
1558
|
+
|
|
1559
|
+
class NxaRange {
|
|
1560
|
+
_min = signal(0, ...(ngDevMode ? [{ debugName: "_min" }] : []));
|
|
1561
|
+
set min(value) { this._min.set(value); }
|
|
1562
|
+
get min() { return this._min(); }
|
|
1563
|
+
;
|
|
1564
|
+
_max = signal(100, ...(ngDevMode ? [{ debugName: "_max" }] : []));
|
|
1565
|
+
set max(value) {
|
|
1566
|
+
this._max.set(value);
|
|
1567
|
+
}
|
|
1568
|
+
get max() {
|
|
1569
|
+
return this._max();
|
|
1570
|
+
}
|
|
1571
|
+
_step = signal(1, ...(ngDevMode ? [{ debugName: "_step" }] : []));
|
|
1572
|
+
set step(value) { this._step.set(value); }
|
|
1573
|
+
get step() { return this._step(); }
|
|
1574
|
+
_value = modelState(0, true);
|
|
1575
|
+
set value(value) { this._value.set(value); }
|
|
1576
|
+
get value() { return this._value.get(); }
|
|
1577
|
+
valueChange = this._value.emitter;
|
|
1578
|
+
_disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : []));
|
|
1579
|
+
set disabled(value) { this._disabled.set(value); }
|
|
1580
|
+
get disabled() { return this._disabled(); }
|
|
1581
|
+
_size = signal("md", ...(ngDevMode ? [{ debugName: "_size" }] : []));
|
|
1582
|
+
set size(size) { this._size.set(size); }
|
|
1583
|
+
get size() {
|
|
1584
|
+
return this._size();
|
|
1585
|
+
}
|
|
1586
|
+
_color = signal('neutral', ...(ngDevMode ? [{ debugName: "_color" }] : []));
|
|
1587
|
+
set color(color) { this._color.set(color); }
|
|
1588
|
+
get color() {
|
|
1589
|
+
return this._color();
|
|
1590
|
+
}
|
|
1591
|
+
_className = signal("", ...(ngDevMode ? [{ debugName: "_className" }] : []));
|
|
1592
|
+
set className(value) { this._className.set(value); }
|
|
1593
|
+
get className() { return this._className(); }
|
|
1594
|
+
computedNgClasses = computed(() => {
|
|
1595
|
+
const consumerClasses = this._className().split(/\s+/).filter(Boolean).reduce((acc, cls) => ({ ...acc, [cls]: true }), {});
|
|
1596
|
+
return {
|
|
1597
|
+
"range": true,
|
|
1598
|
+
[`range-${this._size()}`]: true,
|
|
1599
|
+
[`range-${this._color()}`]: true,
|
|
1600
|
+
...consumerClasses,
|
|
1601
|
+
};
|
|
1602
|
+
}, ...(ngDevMode ? [{ debugName: "computedNgClasses" }] : []));
|
|
1603
|
+
onChange = () => { return; };
|
|
1604
|
+
onTouched = () => { return; };
|
|
1605
|
+
writeValue(obj) {
|
|
1606
|
+
if (obj == null)
|
|
1607
|
+
return;
|
|
1608
|
+
const value = parseFloat(obj);
|
|
1609
|
+
if (isNaN(value))
|
|
1610
|
+
throw Error("Write value is not a number");
|
|
1611
|
+
this._value.set(value);
|
|
1612
|
+
}
|
|
1613
|
+
registerOnChange(fn) {
|
|
1614
|
+
this.onChange = fn;
|
|
1615
|
+
}
|
|
1616
|
+
registerOnTouched(fn) {
|
|
1617
|
+
this.onTouched = fn;
|
|
1618
|
+
}
|
|
1619
|
+
setDisabledState(isDisabled) {
|
|
1620
|
+
this.disabled = isDisabled;
|
|
1621
|
+
}
|
|
1622
|
+
onValueChange($event) {
|
|
1623
|
+
const inputEl = $event.target;
|
|
1624
|
+
this.value = parseFloat(inputEl.value);
|
|
1625
|
+
this.onChange(this.value);
|
|
1626
|
+
this.onTouched();
|
|
1627
|
+
}
|
|
1628
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaRange, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1629
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.5", type: NxaRange, isStandalone: true, selector: "nxa-range", inputs: { min: "min", max: "max", step: "step", value: "value", disabled: "disabled", size: "size", color: "color", className: "className" }, outputs: { valueChange: "valueChange" }, host: { classAttribute: "block min-h-0 basis-fit h-fit flex-1 max-h-full w-full max-w-full inset-0 box-border" }, providers: [
|
|
1630
|
+
{
|
|
1631
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1632
|
+
useExisting: forwardRef(() => NxaRange),
|
|
1633
|
+
multi: true,
|
|
1634
|
+
}
|
|
1635
|
+
], ngImport: i0, template: "<input \n tooltip\n type=\"range\" \n [min]=\"_min()\"\n [max]=\"_max()\"\n [value]=\"_value.get()\"\n [step]=\"_step()\"\n [disabled]=\"_disabled()\"\n [ariaValueMin]=\"_min()\"\n [ariaValueMax]=\"_max()\"\n [ariaValueNow]=\"_value.get()\"\n [ngClass]=\"computedNgClasses()\"\n [title]=\"_value.get()\"\n (input)=\"onValueChange($event)\"\n class=\"range w-full min-h-fit\" />", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
1636
|
+
}
|
|
1637
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaRange, decorators: [{
|
|
1638
|
+
type: Component,
|
|
1639
|
+
args: [{ selector: 'nxa-range', host: {
|
|
1640
|
+
class: NXA_HOST_BLOCK,
|
|
1641
|
+
}, providers: [
|
|
1642
|
+
{
|
|
1643
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1644
|
+
useExisting: forwardRef(() => NxaRange),
|
|
1645
|
+
multi: true,
|
|
1646
|
+
}
|
|
1647
|
+
], imports: [CommonModule], template: "<input \n tooltip\n type=\"range\" \n [min]=\"_min()\"\n [max]=\"_max()\"\n [value]=\"_value.get()\"\n [step]=\"_step()\"\n [disabled]=\"_disabled()\"\n [ariaValueMin]=\"_min()\"\n [ariaValueMax]=\"_max()\"\n [ariaValueNow]=\"_value.get()\"\n [ngClass]=\"computedNgClasses()\"\n [title]=\"_value.get()\"\n (input)=\"onValueChange($event)\"\n class=\"range w-full min-h-fit\" />" }]
|
|
1648
|
+
}], propDecorators: { min: [{
|
|
1649
|
+
type: Input
|
|
1650
|
+
}], max: [{
|
|
1651
|
+
type: Input
|
|
1652
|
+
}], step: [{
|
|
1653
|
+
type: Input
|
|
1654
|
+
}], value: [{
|
|
1655
|
+
type: Input
|
|
1656
|
+
}], valueChange: [{
|
|
1657
|
+
type: Output
|
|
1658
|
+
}], disabled: [{
|
|
1659
|
+
type: Input
|
|
1660
|
+
}], size: [{
|
|
1661
|
+
type: Input
|
|
1662
|
+
}], color: [{
|
|
1663
|
+
type: Input
|
|
1664
|
+
}], className: [{
|
|
1665
|
+
type: Input
|
|
1666
|
+
}] } });
|
|
1667
|
+
|
|
1668
|
+
class NxaSelect {
|
|
1669
|
+
//#region State
|
|
1670
|
+
//#endregion
|
|
1671
|
+
//#region Input/Output
|
|
1672
|
+
/**
|
|
1673
|
+
* doc protected
|
|
1674
|
+
*/
|
|
1675
|
+
_id = signal('', ...(ngDevMode ? [{ debugName: "_id" }] : []));
|
|
1676
|
+
/**
|
|
1677
|
+
* doc setter
|
|
1678
|
+
*/
|
|
1679
|
+
set id(value) {
|
|
1680
|
+
this._id.set(value);
|
|
1681
|
+
}
|
|
1682
|
+
/**
|
|
1683
|
+
* doc getter
|
|
1684
|
+
*/
|
|
1685
|
+
get id() { return this._id(); }
|
|
1686
|
+
;
|
|
1687
|
+
_optionTemplateRef = signal(null, ...(ngDevMode ? [{ debugName: "_optionTemplateRef" }] : []));
|
|
1688
|
+
set optionTemplateRef(value) {
|
|
1689
|
+
this._optionTemplateRef.set(value);
|
|
1690
|
+
}
|
|
1691
|
+
get optionTemplateRef() { return this._optionTemplateRef(); }
|
|
1692
|
+
;
|
|
1693
|
+
_value = modelState(null, true);
|
|
1694
|
+
set selected(value) {
|
|
1695
|
+
this._value.set(value);
|
|
1696
|
+
}
|
|
1697
|
+
get selected() { return this._value.get(); }
|
|
1698
|
+
_options = signal([], ...(ngDevMode ? [{ debugName: "_options" }] : []));
|
|
1699
|
+
set options(values) {
|
|
1700
|
+
this._options.set(values);
|
|
1701
|
+
}
|
|
1702
|
+
_disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : []));
|
|
1703
|
+
set disabled(value) {
|
|
1704
|
+
this._disabled.set(value);
|
|
1705
|
+
}
|
|
1706
|
+
_color = signal('neutral', ...(ngDevMode ? [{ debugName: "_color" }] : []));
|
|
1707
|
+
set color(value) {
|
|
1708
|
+
this._color.set(value);
|
|
1709
|
+
}
|
|
1710
|
+
_size = signal('md', ...(ngDevMode ? [{ debugName: "_size" }] : []));
|
|
1711
|
+
set size(value) {
|
|
1712
|
+
this._size.set(value);
|
|
1713
|
+
}
|
|
1714
|
+
_className = signal('', ...(ngDevMode ? [{ debugName: "_className" }] : []));
|
|
1715
|
+
set className(value) {
|
|
1716
|
+
this._className.set(value);
|
|
1717
|
+
}
|
|
1718
|
+
_compareFn = (a, b) => a === b;
|
|
1719
|
+
set compareFn(value) {
|
|
1720
|
+
this._compareFn = value;
|
|
1721
|
+
}
|
|
1722
|
+
nxaSelectedChange = this._value.emitter;
|
|
1723
|
+
//#endregion
|
|
1724
|
+
computeNgClasses = computed(() => {
|
|
1725
|
+
return {
|
|
1726
|
+
[`select-${this._size()}`]: true,
|
|
1727
|
+
[`select-${this._color()}`]: true,
|
|
1728
|
+
// [this.className()]: !!this.className(),
|
|
1729
|
+
};
|
|
1730
|
+
}, ...(ngDevMode ? [{ debugName: "computeNgClasses" }] : []));
|
|
1731
|
+
onChange = () => { return; };
|
|
1732
|
+
onTouched = () => { return; };
|
|
1733
|
+
isGroup(item) {
|
|
1734
|
+
return item && typeof item === 'object' && 'options' in item && Array.isArray(item.options);
|
|
1735
|
+
}
|
|
1736
|
+
getIndexFromValue() {
|
|
1737
|
+
if (!this._value.get())
|
|
1738
|
+
return -1;
|
|
1739
|
+
return this._options().indexOf(this._value.get());
|
|
1740
|
+
}
|
|
1741
|
+
writeValue(obj) {
|
|
1742
|
+
if (!obj) {
|
|
1743
|
+
this._value.set(null);
|
|
1744
|
+
return;
|
|
1745
|
+
}
|
|
1746
|
+
let found = null;
|
|
1747
|
+
for (const item of this._options()) {
|
|
1748
|
+
if (this.isGroup(item)) {
|
|
1749
|
+
const inner = item.options.find(opt => this._compareFn(opt, obj));
|
|
1750
|
+
if (inner) {
|
|
1751
|
+
found = inner;
|
|
1752
|
+
break;
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
else {
|
|
1756
|
+
if (this._compareFn(item, obj)) {
|
|
1757
|
+
found = item;
|
|
1758
|
+
break;
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
}
|
|
1762
|
+
// fallback: accept obj directly if not found
|
|
1763
|
+
this._value.set(found ?? obj);
|
|
1764
|
+
}
|
|
1765
|
+
registerOnChange(fn) {
|
|
1766
|
+
this.onChange = fn;
|
|
1767
|
+
}
|
|
1768
|
+
registerOnTouched(fn) {
|
|
1769
|
+
this.onTouched = fn;
|
|
1770
|
+
}
|
|
1771
|
+
setDisabledState(isDisabled) {
|
|
1772
|
+
this._disabled.set(isDisabled);
|
|
1773
|
+
}
|
|
1774
|
+
selectedChange(event) {
|
|
1775
|
+
const value = event.target.value;
|
|
1776
|
+
// value format: "i" or "i-j" where i = group index or option index, j = index inside group
|
|
1777
|
+
let selectedOption;
|
|
1778
|
+
if (value.includes('-')) {
|
|
1779
|
+
const [groupIndexStr, optionIndexStr] = value.split('-');
|
|
1780
|
+
const groupIndex = parseInt(groupIndexStr, 10);
|
|
1781
|
+
const optionIndex = parseInt(optionIndexStr, 10);
|
|
1782
|
+
const group = this._options()[groupIndex];
|
|
1783
|
+
selectedOption = group.options[optionIndex];
|
|
1784
|
+
}
|
|
1785
|
+
else {
|
|
1786
|
+
const index = parseInt(value, 10);
|
|
1787
|
+
selectedOption = this._options()[index];
|
|
1788
|
+
}
|
|
1789
|
+
this._value.set(selectedOption);
|
|
1790
|
+
this.onChange(selectedOption);
|
|
1791
|
+
this.onTouched();
|
|
1792
|
+
}
|
|
1793
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaSelect, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1794
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.5", type: NxaSelect, isStandalone: true, selector: "nxa-select", inputs: { id: "id", optionTemplateRef: "optionTemplateRef", selected: "selected", options: "options", disabled: "disabled", color: "color", size: "size", className: "className", compareFn: "compareFn" }, outputs: { nxaSelectedChange: "nxaSelectedChange" }, host: { properties: { "attr.id": "null" }, classAttribute: "contents" }, providers: [
|
|
1795
|
+
{
|
|
1796
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1797
|
+
useExisting: forwardRef(() => NxaSelect),
|
|
1798
|
+
multi: true,
|
|
1799
|
+
}
|
|
1800
|
+
], ngImport: i0, template: "<div class=\"form-control h-full w-full\" [class]=\"_className()\">\n <div class=\"label min-h-0 p-0 m-0\">\n <div class=\"label-text\">\n <ng-content select=\"[top-left]\"></ng-content>\n </div>\n <div class=\"label-text-alt\">\n <ng-content select=\"[top-right]\"></ng-content>\n </div>\n </div>\n <div class=\"flex flex-row gap-2 justify-center items-center pb-2\">\n <div class=\"w-fit label-text min-h-0\">\n <ng-content select=\"[label]\"></ng-content>\n </div>\n <select class=\"select select-bordered w-full\" [id]=\"_id()\" [ngClass]=\"computeNgClasses()\" [value]=\"getIndexFromValue()\" (input)=\"selectedChange($event)\"\n [disabled]=\"_disabled()\">\n @for (element of _options(); track $index; let i = $index) {\n @if (isGroup(element)) {\n <optgroup [label]=\"element.label\">\n @for (item of element.options; track $index; let j = $index) {\n <option [value]=\"i + '-' + j\">\n <ng-container *ngTemplateOutlet=\"_optionTemplateRef() ?? defaultRow; context: { $implicit: item }\"></ng-container>\n </option>\n }\n </optgroup>\n } @else {\n <option [value]=\"i.toString()\">\n <ng-container *ngTemplateOutlet=\"_optionTemplateRef() ?? defaultRow; context: { $implicit: element }\"></ng-container>\n </option>\n }\n }\n </select>\n </div>\n <div class=\"label p-0\">\n <div class=\"label-text\">\n <ng-content select=\"[bottom-left]\"></ng-content>\n </div>\n <div class=\"label-text-alt\">\n <ng-content select=\"[bottom-right]\"></ng-content>\n </div>\n </div>\n</div>\n\n<ng-template #defaultRow let-item>\n {{item}}\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
1801
|
+
}
|
|
1802
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaSelect, decorators: [{
|
|
1803
|
+
type: Component,
|
|
1804
|
+
args: [{ selector: 'nxa-select', host: {
|
|
1805
|
+
'[attr.id]': 'null',
|
|
1806
|
+
class: NXA_HOST_CONTENTS_ONLY
|
|
1807
|
+
}, imports: [CommonModule], providers: [
|
|
1808
|
+
{
|
|
1809
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1810
|
+
useExisting: forwardRef(() => NxaSelect),
|
|
1811
|
+
multi: true,
|
|
1812
|
+
}
|
|
1813
|
+
], template: "<div class=\"form-control h-full w-full\" [class]=\"_className()\">\n <div class=\"label min-h-0 p-0 m-0\">\n <div class=\"label-text\">\n <ng-content select=\"[top-left]\"></ng-content>\n </div>\n <div class=\"label-text-alt\">\n <ng-content select=\"[top-right]\"></ng-content>\n </div>\n </div>\n <div class=\"flex flex-row gap-2 justify-center items-center pb-2\">\n <div class=\"w-fit label-text min-h-0\">\n <ng-content select=\"[label]\"></ng-content>\n </div>\n <select class=\"select select-bordered w-full\" [id]=\"_id()\" [ngClass]=\"computeNgClasses()\" [value]=\"getIndexFromValue()\" (input)=\"selectedChange($event)\"\n [disabled]=\"_disabled()\">\n @for (element of _options(); track $index; let i = $index) {\n @if (isGroup(element)) {\n <optgroup [label]=\"element.label\">\n @for (item of element.options; track $index; let j = $index) {\n <option [value]=\"i + '-' + j\">\n <ng-container *ngTemplateOutlet=\"_optionTemplateRef() ?? defaultRow; context: { $implicit: item }\"></ng-container>\n </option>\n }\n </optgroup>\n } @else {\n <option [value]=\"i.toString()\">\n <ng-container *ngTemplateOutlet=\"_optionTemplateRef() ?? defaultRow; context: { $implicit: element }\"></ng-container>\n </option>\n }\n }\n </select>\n </div>\n <div class=\"label p-0\">\n <div class=\"label-text\">\n <ng-content select=\"[bottom-left]\"></ng-content>\n </div>\n <div class=\"label-text-alt\">\n <ng-content select=\"[bottom-right]\"></ng-content>\n </div>\n </div>\n</div>\n\n<ng-template #defaultRow let-item>\n {{item}}\n</ng-template>\n" }]
|
|
1814
|
+
}], propDecorators: { id: [{
|
|
1815
|
+
type: Input
|
|
1816
|
+
}], optionTemplateRef: [{
|
|
1817
|
+
type: Input
|
|
1818
|
+
}], selected: [{
|
|
1819
|
+
type: Input
|
|
1820
|
+
}], options: [{
|
|
1821
|
+
type: Input
|
|
1822
|
+
}], disabled: [{
|
|
1823
|
+
type: Input
|
|
1824
|
+
}], color: [{
|
|
1825
|
+
type: Input
|
|
1826
|
+
}], size: [{
|
|
1827
|
+
type: Input
|
|
1828
|
+
}], className: [{
|
|
1829
|
+
type: Input
|
|
1830
|
+
}], compareFn: [{
|
|
1831
|
+
type: Input
|
|
1832
|
+
}], nxaSelectedChange: [{
|
|
1833
|
+
type: Output
|
|
1834
|
+
}] } });
|
|
1835
|
+
|
|
1836
|
+
class NxaTextInput extends WithClassBodyMixin(WithClassNameMixin(class {
|
|
1837
|
+
})) {
|
|
1838
|
+
_placeholder = signal('', ...(ngDevMode ? [{ debugName: "_placeholder" }] : []));
|
|
1839
|
+
/**
|
|
1840
|
+
* Placeholder displayed Text
|
|
1841
|
+
* */
|
|
1842
|
+
set placeholder(value) {
|
|
1843
|
+
this._placeholder.set(value);
|
|
1844
|
+
}
|
|
1845
|
+
get placeholder() {
|
|
1846
|
+
return this._placeholder();
|
|
1847
|
+
}
|
|
1848
|
+
_type = signal('text', ...(ngDevMode ? [{ debugName: "_type" }] : []));
|
|
1849
|
+
/**
|
|
1850
|
+
* Input type (text, email, password, search, url, tel, number)
|
|
1851
|
+
*/
|
|
1852
|
+
set type(value) {
|
|
1853
|
+
this._type.set(value);
|
|
1854
|
+
}
|
|
1855
|
+
get type() {
|
|
1856
|
+
return this._type();
|
|
1857
|
+
}
|
|
1858
|
+
_name = signal(undefined, ...(ngDevMode ? [{ debugName: "_name" }] : []));
|
|
1859
|
+
/**
|
|
1860
|
+
* Name Of Input Element
|
|
1861
|
+
*/
|
|
1862
|
+
set name(value) {
|
|
1863
|
+
this._name.set(value);
|
|
1864
|
+
}
|
|
1865
|
+
get name() {
|
|
1866
|
+
return this._name();
|
|
1867
|
+
}
|
|
1868
|
+
_id = signal(undefined, ...(ngDevMode ? [{ debugName: "_id" }] : []));
|
|
1869
|
+
/**
|
|
1870
|
+
* Html element id
|
|
1871
|
+
*/
|
|
1872
|
+
set id(value) {
|
|
1873
|
+
this._id.set(value);
|
|
1874
|
+
}
|
|
1875
|
+
get id() {
|
|
1876
|
+
return this._id();
|
|
1877
|
+
}
|
|
1878
|
+
_color = signal('neutral', ...(ngDevMode ? [{ debugName: "_color" }] : []));
|
|
1879
|
+
/**
|
|
1880
|
+
* Color of the input ( "primary" | "secondary" | "accent" | "info" | "success" | "warning" | "error" | "neutral")
|
|
1881
|
+
*/
|
|
1882
|
+
set color(value) {
|
|
1883
|
+
this._color.set(value);
|
|
1884
|
+
}
|
|
1885
|
+
get color() {
|
|
1886
|
+
return this._color();
|
|
1887
|
+
}
|
|
1888
|
+
_size = signal('md', ...(ngDevMode ? [{ debugName: "_size" }] : []));
|
|
1889
|
+
set size(value) {
|
|
1890
|
+
this._size.set(value);
|
|
1891
|
+
}
|
|
1892
|
+
get size() {
|
|
1893
|
+
return this._size();
|
|
1894
|
+
}
|
|
1895
|
+
_autocomplete = signal(undefined, ...(ngDevMode ? [{ debugName: "_autocomplete" }] : []));
|
|
1896
|
+
set autocomplete(value) {
|
|
1897
|
+
this._autocomplete.set(value);
|
|
1898
|
+
}
|
|
1899
|
+
get autocomplete() {
|
|
1900
|
+
return this._autocomplete();
|
|
1901
|
+
}
|
|
1902
|
+
_maxlength = signal(undefined, ...(ngDevMode ? [{ debugName: "_maxlength" }] : []));
|
|
1903
|
+
set maxlength(value) {
|
|
1904
|
+
this._maxlength.set(value);
|
|
1905
|
+
}
|
|
1906
|
+
get maxlength() {
|
|
1907
|
+
return this._maxlength();
|
|
1908
|
+
}
|
|
1909
|
+
_minlength = signal(undefined, ...(ngDevMode ? [{ debugName: "_minlength" }] : []));
|
|
1910
|
+
set minlength(value) {
|
|
1911
|
+
this._minlength.set(value);
|
|
1912
|
+
}
|
|
1913
|
+
get minlength() {
|
|
1914
|
+
return this._minlength();
|
|
1915
|
+
}
|
|
1916
|
+
_required = signal(undefined, ...(ngDevMode ? [{ debugName: "_required" }] : []));
|
|
1917
|
+
set required(value) {
|
|
1918
|
+
this._required.set(value);
|
|
1919
|
+
}
|
|
1920
|
+
get required() {
|
|
1921
|
+
return this._required();
|
|
1922
|
+
}
|
|
1923
|
+
_readonly = signal(undefined, ...(ngDevMode ? [{ debugName: "_readonly" }] : []));
|
|
1924
|
+
set readonly(value) {
|
|
1925
|
+
this._readonly.set(value);
|
|
1926
|
+
}
|
|
1927
|
+
get readonly() {
|
|
1928
|
+
return this._readonly();
|
|
1929
|
+
}
|
|
1930
|
+
set classBody(value) {
|
|
1931
|
+
this._classBody.set(value);
|
|
1932
|
+
}
|
|
1933
|
+
get classBody() {
|
|
1934
|
+
return this._classBody();
|
|
1935
|
+
}
|
|
1936
|
+
set className(value) {
|
|
1937
|
+
this._className.set(value);
|
|
1938
|
+
}
|
|
1939
|
+
get className() {
|
|
1940
|
+
return this._className();
|
|
1941
|
+
}
|
|
1942
|
+
_value = modelState(null, true);
|
|
1943
|
+
set value(value) {
|
|
1944
|
+
this._value.set(value);
|
|
1945
|
+
}
|
|
1946
|
+
get value() {
|
|
1947
|
+
return this._value.get();
|
|
1948
|
+
}
|
|
1949
|
+
nxValueChange = this._value.emitter;
|
|
1950
|
+
_disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : []));
|
|
1951
|
+
set disabled(value) {
|
|
1952
|
+
this._disabled.set(value);
|
|
1953
|
+
}
|
|
1954
|
+
get disabled() {
|
|
1955
|
+
return this._disabled();
|
|
1956
|
+
}
|
|
1957
|
+
/** @ignore */
|
|
1958
|
+
computedNgClasses = computed(() => ({
|
|
1959
|
+
[`input-${this._color()}`]: true,
|
|
1960
|
+
['disabled']: this._disabled(),
|
|
1961
|
+
[`input-${this._size()}`]: true,
|
|
1962
|
+
}), ...(ngDevMode ? [{ debugName: "computedNgClasses" }] : []));
|
|
1963
|
+
onChange = () => {
|
|
1964
|
+
return;
|
|
1965
|
+
};
|
|
1966
|
+
onTouched = () => {
|
|
1967
|
+
return;
|
|
1968
|
+
};
|
|
1969
|
+
writeValue(obj) {
|
|
1970
|
+
this._value.set(obj);
|
|
1971
|
+
}
|
|
1972
|
+
registerOnChange(fn) {
|
|
1973
|
+
this.onChange = fn;
|
|
1974
|
+
}
|
|
1975
|
+
registerOnTouched(fn) {
|
|
1976
|
+
this.onTouched = fn;
|
|
1977
|
+
}
|
|
1978
|
+
setDisabledState(isDisabled) {
|
|
1979
|
+
this._disabled.set(isDisabled);
|
|
1980
|
+
}
|
|
1981
|
+
onInput(event) {
|
|
1982
|
+
const input = event.target;
|
|
1983
|
+
this._value.set(input.value);
|
|
1984
|
+
this.onChange(input.value);
|
|
1985
|
+
}
|
|
1986
|
+
onBlur() {
|
|
1987
|
+
this.onTouched();
|
|
1988
|
+
}
|
|
1989
|
+
ngOnInit() { return; }
|
|
1990
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaTextInput, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1991
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.5", type: NxaTextInput, isStandalone: true, selector: "nxa-text-input", inputs: { placeholder: "placeholder", type: "type", name: "name", id: "id", color: "color", size: "size", autocomplete: "autocomplete", maxlength: "maxlength", minlength: "minlength", required: "required", readonly: "readonly", classBody: "classBody", className: "className", value: "value", disabled: "disabled" }, outputs: { nxValueChange: "nxValueChange" }, host: { properties: { "attr.id": "null" }, classAttribute: "block min-h-0 basis-fit h-fit flex-1 max-h-full w-full max-w-full inset-0 box-border" }, providers: [
|
|
1992
|
+
{
|
|
1993
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1994
|
+
useExisting: forwardRef(() => NxaTextInput),
|
|
1995
|
+
multi: true,
|
|
1996
|
+
},
|
|
1997
|
+
], usesInheritance: true, ngImport: i0, template: "<span class=\"nxa-text-input-container\" [ngClass]=\"_classNameObject()\">\n <div class=\"content label\">\n <ng-content select=\"[left]\"></ng-content>\n </div>\n\n <span \n class=\"input input-bordered flex flex-row flex-1 justify-start items-center my-2 px-0\" \n [ngClass]=\"{...computedNgClasses(),..._classBodyObject()}\"\n >\n <div class=\"min-w-0 px-0 w-fit\">\n <ng-content select=\"[leading]\"></ng-content>\n </div>\n\n <input\n class=\"grow flex-1 ps-2 min-w-fit\"\n [attr.type]=\"_type()\"\n [attr.placeholder]=\"_placeholder()\"\n [attr.name]=\"_name()\"\n [attr.id]=\"_id()\"\n [attr.autocomplete]=\"_autocomplete()\"\n [attr.maxlength]=\"_maxlength()\"\n [attr.minlength]=\"_minlength()\"\n [attr.required]=\"_required() ? true : null\"\n [attr.readonly]=\"_readonly() ? true : null\"\n [ngClass]=\"computedNgClasses()\"\n [value]=\"_value.get() ?? ''\"\n [disabled]=\"_disabled()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n />\n\n <div class=\"px-0 min-w-0\">\n <ng-content select=\"[trailing]\"></ng-content>\n </div>\n </span>\n\n <div class=\"contents label\">\n <ng-content select=\"[right]\"></ng-content>\n </div>\n</span>\n\n<div class=\"w-full min-h-0 p-0 m-0 text-error text-sm\">\n <ng-content select=\"[error-message]\"></ng-content>\n</div>", styles: ["@layer properties;.nxa-text-input-container{display:flex;height:fit-content;width:100%;flex:auto;flex-direction:row;align-items:center}.nxa-text-input-container::nth-child{width:100%;border-style:var(--tw-border-style);border-width:1px}.nxa-text-input-container::first-child,.nxa-text-input-container::last-child{width:fit-content}@layer base{:where(:root),:root:has(input.theme-controller[value=light]:checked),[data-theme=light]{color-scheme:light;--color-base-100: oklch(100% 0 0);--color-base-200: oklch(98% 0 0);--color-base-300: oklch(95% 0 0);--color-base-content: oklch(21% .006 285.885);--color-primary: oklch(45% .24 277.023);--color-primary-content: oklch(93% .034 272.788);--color-secondary: oklch(65% .241 354.308);--color-secondary-content: oklch(94% .028 342.258);--color-accent: oklch(77% .152 181.912);--color-accent-content: oklch(38% .063 188.416);--color-neutral: oklch(14% .005 285.823);--color-neutral-content: oklch(92% .004 286.32);--color-info: oklch(74% .16 232.661);--color-info-content: oklch(29% .066 243.157);--color-success: oklch(76% .177 163.223);--color-success-content: oklch(37% .077 168.94);--color-warning: oklch(82% .189 84.429);--color-warning-content: oklch(41% .112 45.904);--color-error: oklch(71% .194 13.428);--color-error-content: oklch(27% .105 12.094);--radius-selector: .5rem;--radius-field: .25rem;--radius-box: .5rem;--size-selector: .25rem;--size-field: .25rem;--border: 1px;--depth: 1;--noise: 0}}@layer base{@media(prefers-color-scheme:dark){:root:not([data-theme]){color-scheme:dark;--color-base-100: oklch(25.33% .016 252.42);--color-base-200: oklch(23.26% .014 253.1);--color-base-300: oklch(21.15% .012 254.09);--color-base-content: oklch(97.807% .029 256.847);--color-primary: oklch(58% .233 277.117);--color-primary-content: oklch(96% .018 272.314);--color-secondary: oklch(65% .241 354.308);--color-secondary-content: oklch(94% .028 342.258);--color-accent: oklch(77% .152 181.912);--color-accent-content: oklch(38% .063 188.416);--color-neutral: oklch(14% .005 285.823);--color-neutral-content: oklch(92% .004 286.32);--color-info: oklch(74% .16 232.661);--color-info-content: oklch(29% .066 243.157);--color-success: oklch(76% .177 163.223);--color-success-content: oklch(37% .077 168.94);--color-warning: oklch(82% .189 84.429);--color-warning-content: oklch(41% .112 45.904);--color-error: oklch(71% .194 13.428);--color-error-content: oklch(27% .105 12.094);--radius-selector: .5rem;--radius-field: .25rem;--radius-box: .5rem;--size-selector: .25rem;--size-field: .25rem;--border: 1px;--depth: 1;--noise: 0}}}@layer base{:root:has(input.theme-controller[value=light]:checked),[data-theme=light]{color-scheme:light;--color-base-100: oklch(100% 0 0);--color-base-200: oklch(98% 0 0);--color-base-300: oklch(95% 0 0);--color-base-content: oklch(21% .006 285.885);--color-primary: oklch(45% .24 277.023);--color-primary-content: oklch(93% .034 272.788);--color-secondary: oklch(65% .241 354.308);--color-secondary-content: oklch(94% .028 342.258);--color-accent: oklch(77% .152 181.912);--color-accent-content: oklch(38% .063 188.416);--color-neutral: oklch(14% .005 285.823);--color-neutral-content: oklch(92% .004 286.32);--color-info: oklch(74% .16 232.661);--color-info-content: oklch(29% .066 243.157);--color-success: oklch(76% .177 163.223);--color-success-content: oklch(37% .077 168.94);--color-warning: oklch(82% .189 84.429);--color-warning-content: oklch(41% .112 45.904);--color-error: oklch(71% .194 13.428);--color-error-content: oklch(27% .105 12.094);--radius-selector: .5rem;--radius-field: .25rem;--radius-box: .5rem;--size-selector: .25rem;--size-field: .25rem;--border: 1px;--depth: 1;--noise: 0}}@layer base{:root:has(input.theme-controller[value=dark]:checked),[data-theme=dark]{color-scheme:dark;--color-base-100: oklch(25.33% .016 252.42);--color-base-200: oklch(23.26% .014 253.1);--color-base-300: oklch(21.15% .012 254.09);--color-base-content: oklch(97.807% .029 256.847);--color-primary: oklch(58% .233 277.117);--color-primary-content: oklch(96% .018 272.314);--color-secondary: oklch(65% .241 354.308);--color-secondary-content: oklch(94% .028 342.258);--color-accent: oklch(77% .152 181.912);--color-accent-content: oklch(38% .063 188.416);--color-neutral: oklch(14% .005 285.823);--color-neutral-content: oklch(92% .004 286.32);--color-info: oklch(74% .16 232.661);--color-info-content: oklch(29% .066 243.157);--color-success: oklch(76% .177 163.223);--color-success-content: oklch(37% .077 168.94);--color-warning: oklch(82% .189 84.429);--color-warning-content: oklch(41% .112 45.904);--color-error: oklch(71% .194 13.428);--color-error-content: oklch(27% .105 12.094);--radius-selector: .5rem;--radius-field: .25rem;--radius-box: .5rem;--size-selector: .25rem;--size-field: .25rem;--border: 1px;--depth: 1;--noise: 0}}@layer base{:root{--fx-noise: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.34' numOctaves='4' stitchTiles='stitch'%3E%3C/feTurbulence%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23a)' opacity='0.2'%3E%3C/rect%3E%3C/svg%3E\")}}@layer base{:root{scrollbar-color:currentColor #0000}@supports (color: color-mix(in lab,red,red)){:root{scrollbar-color:color-mix(in oklch,currentColor 35%,#0000) #0000}}}@layer base{@property --radialprogress{syntax: \"<percentage>\"; inherits: true; initial-value: 0%;}}@layer base{:root:not(span){overflow:var(--page-overflow)}}@layer base{:root{background:var(--page-scroll-bg, var(--root-bg));--page-scroll-bg-on: linear-gradient(var(--root-bg, #0000), var(--root-bg, #0000)) var(--root-bg, #0000);--page-scroll-transition-on: background-color .3s ease-out;transition:var(--page-scroll-transition);scrollbar-gutter:var(--page-scroll-gutter, unset);scrollbar-gutter:if(style(--page-has-scroll: 1): var(--page-scroll-gutter, unset) ; else: unset)}@supports (color: color-mix(in lab,red,red)){:root{--page-scroll-bg-on: linear-gradient(var(--root-bg, #0000), var(--root-bg, #0000)) color-mix(in srgb, var(--root-bg, #0000), oklch(0% 0 0) calc(var(--page-has-backdrop, 0) * 40%))}}@keyframes set-page-has-scroll{0%,to{--page-has-scroll: 1}}}@layer base{:root,[data-theme]{background:var(--page-scroll-bg, var(--root-bg));color:var(--color-base-content)}:where(:root,[data-theme]){--root-bg: var(--color-base-100)}}@keyframes rating{0%,40%{scale:1.1;filter:brightness(1.05) contrast(1.05)}}@keyframes dropdown{0%{opacity:0}}@keyframes radio{0%{padding:5px}50%{padding:3px}}@keyframes toast{0%{scale:.9;opacity:0}to{scale:1;opacity:1}}@keyframes rotator{89.9999%,to{--first-item-position: 0 0%}90%,99.9999%{--first-item-position: 0 calc(var(--items) * 100%)}to{translate:0 -100%}}@keyframes skeleton{0%{background-position:150%}to{background-position:-50%}}@keyframes menu{0%{opacity:0}}@keyframes progress{50%{background-position-x:-115%}}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid}}}\n/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
1998
|
+
}
|
|
1999
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaTextInput, decorators: [{
|
|
2000
|
+
type: Component,
|
|
2001
|
+
args: [{ selector: 'nxa-text-input', providers: [
|
|
2002
|
+
{
|
|
2003
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2004
|
+
useExisting: forwardRef(() => NxaTextInput),
|
|
2005
|
+
multi: true,
|
|
2006
|
+
},
|
|
2007
|
+
], standalone: true, host: {
|
|
2008
|
+
'[attr.id]': 'null',
|
|
2009
|
+
class: NXA_HOST_BLOCK,
|
|
2010
|
+
}, imports: [CommonModule], template: "<span class=\"nxa-text-input-container\" [ngClass]=\"_classNameObject()\">\n <div class=\"content label\">\n <ng-content select=\"[left]\"></ng-content>\n </div>\n\n <span \n class=\"input input-bordered flex flex-row flex-1 justify-start items-center my-2 px-0\" \n [ngClass]=\"{...computedNgClasses(),..._classBodyObject()}\"\n >\n <div class=\"min-w-0 px-0 w-fit\">\n <ng-content select=\"[leading]\"></ng-content>\n </div>\n\n <input\n class=\"grow flex-1 ps-2 min-w-fit\"\n [attr.type]=\"_type()\"\n [attr.placeholder]=\"_placeholder()\"\n [attr.name]=\"_name()\"\n [attr.id]=\"_id()\"\n [attr.autocomplete]=\"_autocomplete()\"\n [attr.maxlength]=\"_maxlength()\"\n [attr.minlength]=\"_minlength()\"\n [attr.required]=\"_required() ? true : null\"\n [attr.readonly]=\"_readonly() ? true : null\"\n [ngClass]=\"computedNgClasses()\"\n [value]=\"_value.get() ?? ''\"\n [disabled]=\"_disabled()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n />\n\n <div class=\"px-0 min-w-0\">\n <ng-content select=\"[trailing]\"></ng-content>\n </div>\n </span>\n\n <div class=\"contents label\">\n <ng-content select=\"[right]\"></ng-content>\n </div>\n</span>\n\n<div class=\"w-full min-h-0 p-0 m-0 text-error text-sm\">\n <ng-content select=\"[error-message]\"></ng-content>\n</div>", styles: ["@layer properties;.nxa-text-input-container{display:flex;height:fit-content;width:100%;flex:auto;flex-direction:row;align-items:center}.nxa-text-input-container::nth-child{width:100%;border-style:var(--tw-border-style);border-width:1px}.nxa-text-input-container::first-child,.nxa-text-input-container::last-child{width:fit-content}@layer base{:where(:root),:root:has(input.theme-controller[value=light]:checked),[data-theme=light]{color-scheme:light;--color-base-100: oklch(100% 0 0);--color-base-200: oklch(98% 0 0);--color-base-300: oklch(95% 0 0);--color-base-content: oklch(21% .006 285.885);--color-primary: oklch(45% .24 277.023);--color-primary-content: oklch(93% .034 272.788);--color-secondary: oklch(65% .241 354.308);--color-secondary-content: oklch(94% .028 342.258);--color-accent: oklch(77% .152 181.912);--color-accent-content: oklch(38% .063 188.416);--color-neutral: oklch(14% .005 285.823);--color-neutral-content: oklch(92% .004 286.32);--color-info: oklch(74% .16 232.661);--color-info-content: oklch(29% .066 243.157);--color-success: oklch(76% .177 163.223);--color-success-content: oklch(37% .077 168.94);--color-warning: oklch(82% .189 84.429);--color-warning-content: oklch(41% .112 45.904);--color-error: oklch(71% .194 13.428);--color-error-content: oklch(27% .105 12.094);--radius-selector: .5rem;--radius-field: .25rem;--radius-box: .5rem;--size-selector: .25rem;--size-field: .25rem;--border: 1px;--depth: 1;--noise: 0}}@layer base{@media(prefers-color-scheme:dark){:root:not([data-theme]){color-scheme:dark;--color-base-100: oklch(25.33% .016 252.42);--color-base-200: oklch(23.26% .014 253.1);--color-base-300: oklch(21.15% .012 254.09);--color-base-content: oklch(97.807% .029 256.847);--color-primary: oklch(58% .233 277.117);--color-primary-content: oklch(96% .018 272.314);--color-secondary: oklch(65% .241 354.308);--color-secondary-content: oklch(94% .028 342.258);--color-accent: oklch(77% .152 181.912);--color-accent-content: oklch(38% .063 188.416);--color-neutral: oklch(14% .005 285.823);--color-neutral-content: oklch(92% .004 286.32);--color-info: oklch(74% .16 232.661);--color-info-content: oklch(29% .066 243.157);--color-success: oklch(76% .177 163.223);--color-success-content: oklch(37% .077 168.94);--color-warning: oklch(82% .189 84.429);--color-warning-content: oklch(41% .112 45.904);--color-error: oklch(71% .194 13.428);--color-error-content: oklch(27% .105 12.094);--radius-selector: .5rem;--radius-field: .25rem;--radius-box: .5rem;--size-selector: .25rem;--size-field: .25rem;--border: 1px;--depth: 1;--noise: 0}}}@layer base{:root:has(input.theme-controller[value=light]:checked),[data-theme=light]{color-scheme:light;--color-base-100: oklch(100% 0 0);--color-base-200: oklch(98% 0 0);--color-base-300: oklch(95% 0 0);--color-base-content: oklch(21% .006 285.885);--color-primary: oklch(45% .24 277.023);--color-primary-content: oklch(93% .034 272.788);--color-secondary: oklch(65% .241 354.308);--color-secondary-content: oklch(94% .028 342.258);--color-accent: oklch(77% .152 181.912);--color-accent-content: oklch(38% .063 188.416);--color-neutral: oklch(14% .005 285.823);--color-neutral-content: oklch(92% .004 286.32);--color-info: oklch(74% .16 232.661);--color-info-content: oklch(29% .066 243.157);--color-success: oklch(76% .177 163.223);--color-success-content: oklch(37% .077 168.94);--color-warning: oklch(82% .189 84.429);--color-warning-content: oklch(41% .112 45.904);--color-error: oklch(71% .194 13.428);--color-error-content: oklch(27% .105 12.094);--radius-selector: .5rem;--radius-field: .25rem;--radius-box: .5rem;--size-selector: .25rem;--size-field: .25rem;--border: 1px;--depth: 1;--noise: 0}}@layer base{:root:has(input.theme-controller[value=dark]:checked),[data-theme=dark]{color-scheme:dark;--color-base-100: oklch(25.33% .016 252.42);--color-base-200: oklch(23.26% .014 253.1);--color-base-300: oklch(21.15% .012 254.09);--color-base-content: oklch(97.807% .029 256.847);--color-primary: oklch(58% .233 277.117);--color-primary-content: oklch(96% .018 272.314);--color-secondary: oklch(65% .241 354.308);--color-secondary-content: oklch(94% .028 342.258);--color-accent: oklch(77% .152 181.912);--color-accent-content: oklch(38% .063 188.416);--color-neutral: oklch(14% .005 285.823);--color-neutral-content: oklch(92% .004 286.32);--color-info: oklch(74% .16 232.661);--color-info-content: oklch(29% .066 243.157);--color-success: oklch(76% .177 163.223);--color-success-content: oklch(37% .077 168.94);--color-warning: oklch(82% .189 84.429);--color-warning-content: oklch(41% .112 45.904);--color-error: oklch(71% .194 13.428);--color-error-content: oklch(27% .105 12.094);--radius-selector: .5rem;--radius-field: .25rem;--radius-box: .5rem;--size-selector: .25rem;--size-field: .25rem;--border: 1px;--depth: 1;--noise: 0}}@layer base{:root{--fx-noise: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.34' numOctaves='4' stitchTiles='stitch'%3E%3C/feTurbulence%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23a)' opacity='0.2'%3E%3C/rect%3E%3C/svg%3E\")}}@layer base{:root{scrollbar-color:currentColor #0000}@supports (color: color-mix(in lab,red,red)){:root{scrollbar-color:color-mix(in oklch,currentColor 35%,#0000) #0000}}}@layer base{@property --radialprogress{syntax: \"<percentage>\"; inherits: true; initial-value: 0%;}}@layer base{:root:not(span){overflow:var(--page-overflow)}}@layer base{:root{background:var(--page-scroll-bg, var(--root-bg));--page-scroll-bg-on: linear-gradient(var(--root-bg, #0000), var(--root-bg, #0000)) var(--root-bg, #0000);--page-scroll-transition-on: background-color .3s ease-out;transition:var(--page-scroll-transition);scrollbar-gutter:var(--page-scroll-gutter, unset);scrollbar-gutter:if(style(--page-has-scroll: 1): var(--page-scroll-gutter, unset) ; else: unset)}@supports (color: color-mix(in lab,red,red)){:root{--page-scroll-bg-on: linear-gradient(var(--root-bg, #0000), var(--root-bg, #0000)) color-mix(in srgb, var(--root-bg, #0000), oklch(0% 0 0) calc(var(--page-has-backdrop, 0) * 40%))}}@keyframes set-page-has-scroll{0%,to{--page-has-scroll: 1}}}@layer base{:root,[data-theme]{background:var(--page-scroll-bg, var(--root-bg));color:var(--color-base-content)}:where(:root,[data-theme]){--root-bg: var(--color-base-100)}}@keyframes rating{0%,40%{scale:1.1;filter:brightness(1.05) contrast(1.05)}}@keyframes dropdown{0%{opacity:0}}@keyframes radio{0%{padding:5px}50%{padding:3px}}@keyframes toast{0%{scale:.9;opacity:0}to{scale:1;opacity:1}}@keyframes rotator{89.9999%,to{--first-item-position: 0 0%}90%,99.9999%{--first-item-position: 0 calc(var(--items) * 100%)}to{translate:0 -100%}}@keyframes skeleton{0%{background-position:150%}to{background-position:-50%}}@keyframes menu{0%{opacity:0}}@keyframes progress{50%{background-position-x:-115%}}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid}}}\n/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */\n"] }]
|
|
2011
|
+
}], propDecorators: { placeholder: [{
|
|
2012
|
+
type: Input
|
|
2013
|
+
}], type: [{
|
|
2014
|
+
type: Input
|
|
2015
|
+
}], name: [{
|
|
2016
|
+
type: Input
|
|
2017
|
+
}], id: [{
|
|
2018
|
+
type: Input
|
|
2019
|
+
}], color: [{
|
|
2020
|
+
type: Input
|
|
2021
|
+
}], size: [{
|
|
2022
|
+
type: Input
|
|
2023
|
+
}], autocomplete: [{
|
|
2024
|
+
type: Input
|
|
2025
|
+
}], maxlength: [{
|
|
2026
|
+
type: Input
|
|
2027
|
+
}], minlength: [{
|
|
2028
|
+
type: Input
|
|
2029
|
+
}], required: [{
|
|
2030
|
+
type: Input
|
|
2031
|
+
}], readonly: [{
|
|
2032
|
+
type: Input
|
|
2033
|
+
}], classBody: [{
|
|
2034
|
+
type: Input
|
|
2035
|
+
}], className: [{
|
|
2036
|
+
type: Input
|
|
2037
|
+
}], value: [{
|
|
2038
|
+
type: Input
|
|
2039
|
+
}], nxValueChange: [{
|
|
2040
|
+
type: Output
|
|
2041
|
+
}], disabled: [{
|
|
2042
|
+
type: Input
|
|
2043
|
+
}] } });
|
|
2044
|
+
|
|
2045
|
+
class NxaLinearLayout {
|
|
2046
|
+
_className = signal('', ...(ngDevMode ? [{ debugName: "_className" }] : []));
|
|
2047
|
+
/**
|
|
2048
|
+
* Allows the consumer to pass additional CSS classes to the component.
|
|
2049
|
+
* These classes will be merged with the component's own classes,
|
|
2050
|
+
* allowing for further customization of the layout's appearance and behavior.
|
|
2051
|
+
* className="flex-col"
|
|
2052
|
+
*/
|
|
2053
|
+
set className(value) {
|
|
2054
|
+
this._className.set(value);
|
|
2055
|
+
}
|
|
2056
|
+
get className() {
|
|
2057
|
+
return this._className();
|
|
2058
|
+
}
|
|
2059
|
+
_gap = signal('0', ...(ngDevMode ? [{ debugName: "_gap" }] : []));
|
|
2060
|
+
set gap(value) {
|
|
2061
|
+
this._gap.set(value);
|
|
2062
|
+
}
|
|
2063
|
+
get gap() {
|
|
2064
|
+
return this._gap();
|
|
2065
|
+
}
|
|
2066
|
+
_justify = signal('between', ...(ngDevMode ? [{ debugName: "_justify" }] : []));
|
|
2067
|
+
set justify(value) {
|
|
2068
|
+
this._justify.set(value);
|
|
2069
|
+
}
|
|
2070
|
+
get justify() {
|
|
2071
|
+
return this._justify();
|
|
2072
|
+
}
|
|
2073
|
+
_align = signal('start', ...(ngDevMode ? [{ debugName: "_align" }] : []));
|
|
2074
|
+
set align(value) {
|
|
2075
|
+
this._align.set(value);
|
|
2076
|
+
}
|
|
2077
|
+
get align() {
|
|
2078
|
+
return this._align();
|
|
2079
|
+
}
|
|
2080
|
+
_wrap = signal('wrap', ...(ngDevMode ? [{ debugName: "_wrap" }] : [])); // nowrap, wrap, wrap-reverse
|
|
2081
|
+
set wrap(value) {
|
|
2082
|
+
this._wrap.set(value);
|
|
2083
|
+
}
|
|
2084
|
+
get wrap() {
|
|
2085
|
+
return this._wrap();
|
|
2086
|
+
}
|
|
2087
|
+
_direction = signal('col', ...(ngDevMode ? [{ debugName: "_direction" }] : [])); // row, row-reverse, col, col-reverse
|
|
2088
|
+
set direction(value) {
|
|
2089
|
+
this._direction.set(value);
|
|
2090
|
+
}
|
|
2091
|
+
get direction() {
|
|
2092
|
+
return this._direction();
|
|
2093
|
+
}
|
|
2094
|
+
// computed
|
|
2095
|
+
computedClasses = computed(() => {
|
|
2096
|
+
const consumerClasses = this._className().split(/\s+/).filter(Boolean).reduce((acc, cls) => ({ ...acc, [cls]: true }), {});
|
|
2097
|
+
return {
|
|
2098
|
+
[`justify-${this._justify()}`]: !!this._justify(),
|
|
2099
|
+
[`items-${this._align()}`]: !!this._align(),
|
|
2100
|
+
[`flex-${this._wrap()}`]: !!this._wrap(),
|
|
2101
|
+
[`flex-${this._direction()}`]: !!this._direction(),
|
|
2102
|
+
...consumerClasses
|
|
2103
|
+
};
|
|
2104
|
+
}, ...(ngDevMode ? [{ debugName: "computedClasses" }] : []));
|
|
2105
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaLinearLayout, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2106
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.5", type: NxaLinearLayout, isStandalone: true, selector: "nxa-linear-layout", inputs: { className: "className", gap: "gap", justify: "justify", align: "align", wrap: "wrap", direction: "direction" }, host: { classAttribute: "block min-h-0 basis-fit h-fit flex-1 max-h-full w-full max-w-full inset-0 box-border" }, ngImport: i0, template: `
|
|
2107
|
+
<div class="flex items-stretch min-h-fit h-full" [ngClass]="computedClasses()" [style.gap]="_gap()||'calc(var(--spacing) * 1)'">
|
|
2108
|
+
<ng-content></ng-content>
|
|
2109
|
+
</div>
|
|
2110
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
2111
|
+
}
|
|
2112
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaLinearLayout, decorators: [{
|
|
2113
|
+
type: Component,
|
|
2114
|
+
args: [{
|
|
2115
|
+
selector: 'nxa-linear-layout',
|
|
2116
|
+
template: `
|
|
2117
|
+
<div class="flex items-stretch min-h-fit h-full" [ngClass]="computedClasses()" [style.gap]="_gap()||'calc(var(--spacing) * 1)'">
|
|
2118
|
+
<ng-content></ng-content>
|
|
2119
|
+
</div>
|
|
2120
|
+
`,
|
|
2121
|
+
imports: [CommonModule],
|
|
2122
|
+
host: {
|
|
2123
|
+
class: NXA_HOST_BLOCK,
|
|
2124
|
+
},
|
|
2125
|
+
}]
|
|
2126
|
+
}], propDecorators: { className: [{
|
|
2127
|
+
type: Input
|
|
2128
|
+
}], gap: [{
|
|
2129
|
+
type: Input
|
|
2130
|
+
}], justify: [{
|
|
2131
|
+
type: Input
|
|
2132
|
+
}], align: [{
|
|
2133
|
+
type: Input
|
|
2134
|
+
}], wrap: [{
|
|
2135
|
+
type: Input
|
|
2136
|
+
}], direction: [{
|
|
2137
|
+
type: Input
|
|
2138
|
+
}] } });
|
|
2139
|
+
|
|
2140
|
+
class NxaContainer {
|
|
2141
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaContainer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2142
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.5", type: NxaContainer, isStandalone: true, selector: "nxa-container", host: { classAttribute: "block min-h-0 basis-fit h-fit flex-1 max-h-full w-full max-w-full inset-0 box-border relative z-0 inset-0 box-border" }, ngImport: i0, template: `
|
|
2143
|
+
<ng-content></ng-content>
|
|
2144
|
+
`, isInline: true });
|
|
2145
|
+
}
|
|
2146
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaContainer, decorators: [{
|
|
2147
|
+
type: Component,
|
|
2148
|
+
args: [{
|
|
2149
|
+
selector: 'nxa-container',
|
|
2150
|
+
template: `
|
|
2151
|
+
<ng-content></ng-content>
|
|
2152
|
+
`,
|
|
2153
|
+
host: {
|
|
2154
|
+
class: `${NXA_HOST_BLOCK} relative z-0 inset-0 box-border`,
|
|
2155
|
+
}
|
|
2156
|
+
}]
|
|
2157
|
+
}] });
|
|
2158
|
+
|
|
2159
|
+
class NxaExpansionPanel {
|
|
2160
|
+
_isOpen = modelState(false, true);
|
|
2161
|
+
_className = signal('', ...(ngDevMode ? [{ debugName: "_className" }] : []));
|
|
2162
|
+
_classHeader = signal('', ...(ngDevMode ? [{ debugName: "_classHeader" }] : []));
|
|
2163
|
+
_classBody = signal('', ...(ngDevMode ? [{ debugName: "_classBody" }] : []));
|
|
2164
|
+
set isOpen(value) { this._isOpen.set(value); }
|
|
2165
|
+
get isOpen() { return this._isOpen.get(); }
|
|
2166
|
+
set className(value) { this._className.set(value); }
|
|
2167
|
+
set classHeader(value) { this._classHeader.set(value); }
|
|
2168
|
+
set classBody(value) { this._classBody.set(value); }
|
|
2169
|
+
isOpenChange = this._isOpen.emitter;
|
|
2170
|
+
headerClicked() {
|
|
2171
|
+
this._isOpen.set(!this._isOpen.get());
|
|
2172
|
+
}
|
|
2173
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaExpansionPanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2174
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.5", type: NxaExpansionPanel, isStandalone: true, selector: "nxa-expansion-panel", inputs: { isOpen: "isOpen", className: "className", classHeader: "classHeader", classBody: "classBody" }, outputs: { isOpenChange: "isOpenChange" }, host: { classAttribute: "contents" }, ngImport: i0, template: "<div class=\"collapse collapse-arrow bg-base-200 relative overflow-visible pointer-events-all\"\n [class.collapse-open]=\"_isOpen.get()\" [class.collapse-close]=\"!_isOpen.get()\" [class]=\"_className()\">\n <div class=\"collapse-title max-h-12 content-stretch overflow-visible pointer-events-auto cursor-pointer\" tabindex=\"0\"\n (keyup.enter)=\"headerClicked()\" (click)=\"headerClicked()\" [class]=\"_classHeader()\">\n <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n </div>\n <div class=\"collapse-content nxa-expansion-body \" [class]=\"_classBody()\">\n <ng-container *ngTemplateOutlet=\"bodyTemplate\"></ng-container>\n </div>\n</div>\n<ng-template #headerTemplate>\n <ng-content select=\"[expansion-header]\"></ng-content>\n</ng-template>\n\n<ng-template #bodyTemplate>\n <ng-content select=\"[expansion-body]\"></ng-content>\n</ng-template>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
2175
|
+
}
|
|
2176
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaExpansionPanel, decorators: [{
|
|
2177
|
+
type: Component,
|
|
2178
|
+
args: [{ selector: 'nxa-expansion-panel', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
2179
|
+
class: NXA_HOST_CONTENTS_ONLY
|
|
2180
|
+
}, imports: [
|
|
2181
|
+
CommonModule
|
|
2182
|
+
], template: "<div class=\"collapse collapse-arrow bg-base-200 relative overflow-visible pointer-events-all\"\n [class.collapse-open]=\"_isOpen.get()\" [class.collapse-close]=\"!_isOpen.get()\" [class]=\"_className()\">\n <div class=\"collapse-title max-h-12 content-stretch overflow-visible pointer-events-auto cursor-pointer\" tabindex=\"0\"\n (keyup.enter)=\"headerClicked()\" (click)=\"headerClicked()\" [class]=\"_classHeader()\">\n <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n </div>\n <div class=\"collapse-content nxa-expansion-body \" [class]=\"_classBody()\">\n <ng-container *ngTemplateOutlet=\"bodyTemplate\"></ng-container>\n </div>\n</div>\n<ng-template #headerTemplate>\n <ng-content select=\"[expansion-header]\"></ng-content>\n</ng-template>\n\n<ng-template #bodyTemplate>\n <ng-content select=\"[expansion-body]\"></ng-content>\n</ng-template>" }]
|
|
2183
|
+
}], propDecorators: { isOpen: [{
|
|
2184
|
+
type: Input
|
|
2185
|
+
}], className: [{
|
|
2186
|
+
type: Input
|
|
2187
|
+
}], classHeader: [{
|
|
2188
|
+
type: Input
|
|
2189
|
+
}], classBody: [{
|
|
2190
|
+
type: Input
|
|
2191
|
+
}], isOpenChange: [{
|
|
2192
|
+
type: Output
|
|
2193
|
+
}] } });
|
|
2194
|
+
|
|
2195
|
+
/**
|
|
2196
|
+
* @group UI Components
|
|
2197
|
+
*/
|
|
2198
|
+
class NxaAccordion {
|
|
2199
|
+
/**
|
|
2200
|
+
* Get Expansion Panel Children
|
|
2201
|
+
*/
|
|
2202
|
+
expansionPanelsSig = contentChildren(NxaExpansionPanel, ...(ngDevMode ? [{ debugName: "expansionPanelsSig" }] : []));
|
|
2203
|
+
/**
|
|
2204
|
+
* Map Expansion Panel state into a signal
|
|
2205
|
+
*/
|
|
2206
|
+
expansionPanelStateSig = computed(() => this.expansionPanelsSig().map((x) => x.isOpen), ...(ngDevMode ? [{ debugName: "expansionPanelStateSig" }] : []));
|
|
2207
|
+
/**
|
|
2208
|
+
* Store old state
|
|
2209
|
+
*/
|
|
2210
|
+
_oldState;
|
|
2211
|
+
/**
|
|
2212
|
+
* detect index of changed expansion panel (toggled) or NaN
|
|
2213
|
+
*/
|
|
2214
|
+
changedPanel = computed(() => {
|
|
2215
|
+
let index = NaN;
|
|
2216
|
+
const oldState = this._oldState;
|
|
2217
|
+
const newState = this.expansionPanelStateSig();
|
|
2218
|
+
if (typeof this._oldState === 'undefined')
|
|
2219
|
+
return NaN;
|
|
2220
|
+
// Check for changes in state array
|
|
2221
|
+
for (let i = 0; i < newState.length; i++) {
|
|
2222
|
+
if (typeof oldState !== 'undefined' && oldState[i] !== newState[i]) {
|
|
2223
|
+
index = i;
|
|
2224
|
+
break;
|
|
2225
|
+
}
|
|
2226
|
+
}
|
|
2227
|
+
// update old values
|
|
2228
|
+
this._oldState = newState;
|
|
2229
|
+
return index;
|
|
2230
|
+
}, ...(ngDevMode ? [{ debugName: "changedPanel" }] : []));
|
|
2231
|
+
updatePanels = effect(() => {
|
|
2232
|
+
const index = this.changedPanel();
|
|
2233
|
+
const panels = this.expansionPanelsSig();
|
|
2234
|
+
if (Number.isNaN(index) || !panels[index].isOpen)
|
|
2235
|
+
return;
|
|
2236
|
+
for (let i = 0; i < panels.length; i++) {
|
|
2237
|
+
const updatedPanel = panels[i];
|
|
2238
|
+
if (index !== i) {
|
|
2239
|
+
updatedPanel.isOpen = false;
|
|
2240
|
+
}
|
|
2241
|
+
}
|
|
2242
|
+
}, ...(ngDevMode ? [{ debugName: "updatePanels" }] : []));
|
|
2243
|
+
ngAfterContentInit() {
|
|
2244
|
+
this._oldState = this.expansionPanelStateSig();
|
|
2245
|
+
}
|
|
2246
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaAccordion, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2247
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.1.5", type: NxaAccordion, isStandalone: true, selector: "nxa-accordion", host: { classAttribute: "w-full h-full min-h-0 flex flex-col flex-1" }, queries: [{ propertyName: "expansionPanelsSig", predicate: NxaExpansionPanel, isSignal: true }], ngImport: i0, template: "<div class=\"overflow-visible\">\n <ng-container *ngTemplateOutlet=\"expansionPanelContainer\"></ng-container>\n</div>\n<ng-template #expansionPanelContainer>\n <ng-content select=\"nxa-expansion-panel\"></ng-content>\n</ng-template>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
2248
|
+
}
|
|
2249
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaAccordion, decorators: [{
|
|
2250
|
+
type: Component,
|
|
2251
|
+
args: [{ selector: 'nxa-accordion', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
2252
|
+
class: `${NXA_HOST_LAYOUT}`,
|
|
2253
|
+
}, imports: [CommonModule], template: "<div class=\"overflow-visible\">\n <ng-container *ngTemplateOutlet=\"expansionPanelContainer\"></ng-container>\n</div>\n<ng-template #expansionPanelContainer>\n <ng-content select=\"nxa-expansion-panel\"></ng-content>\n</ng-template>" }]
|
|
2254
|
+
}], propDecorators: { expansionPanelsSig: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => NxaExpansionPanel), { isSignal: true }] }] } });
|
|
2255
|
+
|
|
2256
|
+
class NxaCard extends WithClassNameMixin(WithClassHeaderMixin(WithClassBodyMixin(WithClassFooterMixin(class {
|
|
2257
|
+
})))) {
|
|
2258
|
+
_size = signal('md', ...(ngDevMode ? [{ debugName: "_size" }] : []));
|
|
2259
|
+
sizeComputed = computed(() => {
|
|
2260
|
+
return { [`card-${this._size()}`]: true };
|
|
2261
|
+
}, ...(ngDevMode ? [{ debugName: "sizeComputed" }] : []));
|
|
2262
|
+
set size(size) {
|
|
2263
|
+
this._size.set(size);
|
|
2264
|
+
}
|
|
2265
|
+
get size() {
|
|
2266
|
+
return this._size();
|
|
2267
|
+
}
|
|
2268
|
+
set className(value) {
|
|
2269
|
+
this._className.set(value);
|
|
2270
|
+
}
|
|
2271
|
+
get className() {
|
|
2272
|
+
return this._className();
|
|
2273
|
+
}
|
|
2274
|
+
set classHeader(value) {
|
|
2275
|
+
this._classHeader.set(value);
|
|
2276
|
+
}
|
|
2277
|
+
get classHeader() {
|
|
2278
|
+
return this._classHeader();
|
|
2279
|
+
}
|
|
2280
|
+
set classBody(value) {
|
|
2281
|
+
this._classBody.set(value);
|
|
2282
|
+
}
|
|
2283
|
+
get classBody() {
|
|
2284
|
+
return this._classBody();
|
|
2285
|
+
}
|
|
2286
|
+
set classFooter(value) {
|
|
2287
|
+
this._classFooter.set(value);
|
|
2288
|
+
}
|
|
2289
|
+
get classFooter() {
|
|
2290
|
+
return this._classFooter();
|
|
2291
|
+
}
|
|
2292
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaCard, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2293
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.5", type: NxaCard, isStandalone: true, selector: "nxa-card", inputs: { size: "size", className: "className", classHeader: "classHeader", classBody: "classBody", classFooter: "classFooter" }, host: { classAttribute: "block min-h-0 basis-fit h-fit flex-1 max-h-full w-full max-w-full inset-0 box-border" }, usesInheritance: true, ngImport: i0, template: "<div class=\"card bg-base-200 drop-shadow-xl flex h-full max-h-full nxa-card-component\" [ngClass]=\"{...sizeComputed(),..._classNameObject()}\">\n <ng-content select=\"[card-image]\"></ng-content>\n <div class=\"card-body flex flex-1 flex-col min-h-0 basis-full\">\n <div class=\"card-title flex flex-0 min-h-0 h-fit nxa-card-title\" [ngClass]=\"_classHeaderObject()\">\n <ng-content select=\"[card-header]\"></ng-content>\n </div>\n <div class=\"flex grow min-h-0 basis-full overflow-hidden nxa-card-body\" [ngClass]=\"_classBodyObject()\">\n <ng-content select=\"[card-body]\"></ng-content>\n </div>\n <div class=\"card-actions flex grow-0 min-h-0 h-fit nxa-card-footer\" [ngClass]=\"_classFooterObject()\">\n <ng-content select=\"[card-footer]\"></ng-content>\n </div>\n </div>\n <ng-content select=\"[card-image-bottom]\"></ng-content>\n\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
2294
|
+
}
|
|
2295
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaCard, decorators: [{
|
|
2296
|
+
type: Component,
|
|
2297
|
+
args: [{ selector: 'nxa-card', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
2298
|
+
class: NXA_HOST_BLOCK,
|
|
2299
|
+
}, imports: [CommonModule], template: "<div class=\"card bg-base-200 drop-shadow-xl flex h-full max-h-full nxa-card-component\" [ngClass]=\"{...sizeComputed(),..._classNameObject()}\">\n <ng-content select=\"[card-image]\"></ng-content>\n <div class=\"card-body flex flex-1 flex-col min-h-0 basis-full\">\n <div class=\"card-title flex flex-0 min-h-0 h-fit nxa-card-title\" [ngClass]=\"_classHeaderObject()\">\n <ng-content select=\"[card-header]\"></ng-content>\n </div>\n <div class=\"flex grow min-h-0 basis-full overflow-hidden nxa-card-body\" [ngClass]=\"_classBodyObject()\">\n <ng-content select=\"[card-body]\"></ng-content>\n </div>\n <div class=\"card-actions flex grow-0 min-h-0 h-fit nxa-card-footer\" [ngClass]=\"_classFooterObject()\">\n <ng-content select=\"[card-footer]\"></ng-content>\n </div>\n </div>\n <ng-content select=\"[card-image-bottom]\"></ng-content>\n\n</div>\n" }]
|
|
2300
|
+
}], propDecorators: { size: [{
|
|
2301
|
+
type: Input
|
|
2302
|
+
}], className: [{
|
|
2303
|
+
type: Input
|
|
2304
|
+
}], classHeader: [{
|
|
2305
|
+
type: Input
|
|
2306
|
+
}], classBody: [{
|
|
2307
|
+
type: Input
|
|
2308
|
+
}], classFooter: [{
|
|
2309
|
+
type: Input
|
|
2310
|
+
}] } });
|
|
2311
|
+
|
|
2312
|
+
class NxaAutoSizeDirective {
|
|
2313
|
+
_nxaAutoSize = signal('xy', ...(ngDevMode ? [{ debugName: "_nxaAutoSize" }] : []));
|
|
2314
|
+
set nxaAutoSize(value) {
|
|
2315
|
+
this._nxaAutoSize.set(value);
|
|
2316
|
+
}
|
|
2317
|
+
;
|
|
2318
|
+
get height() {
|
|
2319
|
+
return this._nxaAutoSize().includes('y') ? '100%' : null;
|
|
2320
|
+
}
|
|
2321
|
+
get flexGrow() {
|
|
2322
|
+
return this._nxaAutoSize().includes('y') ? '1' : null;
|
|
2323
|
+
}
|
|
2324
|
+
get flexShrink() {
|
|
2325
|
+
return this._nxaAutoSize().includes('y') ? '1' : null;
|
|
2326
|
+
}
|
|
2327
|
+
get flexBasis() {
|
|
2328
|
+
return this._nxaAutoSize().includes('y') ? '0' : null;
|
|
2329
|
+
}
|
|
2330
|
+
get minHeight() {
|
|
2331
|
+
return this._nxaAutoSize().includes('y') ? '0' : null;
|
|
2332
|
+
}
|
|
2333
|
+
get width() {
|
|
2334
|
+
return this._nxaAutoSize().includes('x') ? '100%' : null;
|
|
2335
|
+
}
|
|
2336
|
+
get minWidth() {
|
|
2337
|
+
return this._nxaAutoSize().includes('x') ? '0' : null;
|
|
2338
|
+
}
|
|
2339
|
+
position = 'relative';
|
|
2340
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaAutoSizeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2341
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.5", type: NxaAutoSizeDirective, isStandalone: true, selector: "[nxaAutoSize]", inputs: { nxaAutoSize: "nxaAutoSize" }, host: { properties: { "style.height": "this.height", "style.flex-grow": "this.flexGrow", "style.flex-shrink": "this.flexShrink", "style.flex-basis": "this.flexBasis", "style.min-height": "this.minHeight", "style.width": "this.width", "style.min-width": "this.minWidth", "style.position": "this.position" } }, ngImport: i0 });
|
|
2342
|
+
}
|
|
2343
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaAutoSizeDirective, decorators: [{
|
|
2344
|
+
type: Directive,
|
|
2345
|
+
args: [{
|
|
2346
|
+
selector: '[nxaAutoSize]',
|
|
2347
|
+
standalone: true,
|
|
2348
|
+
}]
|
|
2349
|
+
}], propDecorators: { nxaAutoSize: [{
|
|
2350
|
+
type: Input
|
|
2351
|
+
}], height: [{
|
|
2352
|
+
type: HostBinding,
|
|
2353
|
+
args: ['style.height']
|
|
2354
|
+
}], flexGrow: [{
|
|
2355
|
+
type: HostBinding,
|
|
2356
|
+
args: ['style.flex-grow']
|
|
2357
|
+
}], flexShrink: [{
|
|
2358
|
+
type: HostBinding,
|
|
2359
|
+
args: ['style.flex-shrink']
|
|
2360
|
+
}], flexBasis: [{
|
|
2361
|
+
type: HostBinding,
|
|
2362
|
+
args: ['style.flex-basis']
|
|
2363
|
+
}], minHeight: [{
|
|
2364
|
+
type: HostBinding,
|
|
2365
|
+
args: ['style.min-height']
|
|
2366
|
+
}], width: [{
|
|
2367
|
+
type: HostBinding,
|
|
2368
|
+
args: ['style.width']
|
|
2369
|
+
}], minWidth: [{
|
|
2370
|
+
type: HostBinding,
|
|
2371
|
+
args: ['style.min-width']
|
|
2372
|
+
}], position: [{
|
|
2373
|
+
type: HostBinding,
|
|
2374
|
+
args: ['style.position']
|
|
2375
|
+
}] } });
|
|
2376
|
+
|
|
2377
|
+
class NxaForceSizeDirective {
|
|
2378
|
+
el = inject(ElementRef);
|
|
2379
|
+
zone = inject(NgZone);
|
|
2380
|
+
set nxaForceSize(value) {
|
|
2381
|
+
this._nxaForceSize.set(value);
|
|
2382
|
+
}
|
|
2383
|
+
;
|
|
2384
|
+
_nxaForceSize = signal('xy', { ...(ngDevMode ? { debugName: "_nxaForceSize" } : {}) });
|
|
2385
|
+
_resizeObserver;
|
|
2386
|
+
hostWidth;
|
|
2387
|
+
hostHeight;
|
|
2388
|
+
ngAfterViewInit() {
|
|
2389
|
+
if (typeof window === 'undefined')
|
|
2390
|
+
return;
|
|
2391
|
+
requestAnimationFrame(() => {
|
|
2392
|
+
this.zone.runOutsideAngular(() => {
|
|
2393
|
+
this.setDimensions();
|
|
2394
|
+
const parent = this.el.nativeElement.parentElement;
|
|
2395
|
+
if (parent) {
|
|
2396
|
+
this._resizeObserver = new ResizeObserver(() => this.setDimensions());
|
|
2397
|
+
this._resizeObserver.observe(parent);
|
|
2398
|
+
}
|
|
2399
|
+
window.addEventListener('resize', this.setDimensions);
|
|
2400
|
+
});
|
|
2401
|
+
});
|
|
2402
|
+
}
|
|
2403
|
+
setDimensions = () => {
|
|
2404
|
+
const parent = this.el.nativeElement.parentElement;
|
|
2405
|
+
if (!parent)
|
|
2406
|
+
return;
|
|
2407
|
+
const { height, width } = parent.getBoundingClientRect();
|
|
2408
|
+
const size = this._nxaForceSize();
|
|
2409
|
+
this.hostHeight = size.includes('y') ? `${height}px` : undefined;
|
|
2410
|
+
this.hostWidth = size.includes('x') ? `${width}px` : undefined;
|
|
2411
|
+
};
|
|
2412
|
+
ngOnDestroy() {
|
|
2413
|
+
this._resizeObserver?.disconnect();
|
|
2414
|
+
if (typeof window === 'undefined')
|
|
2415
|
+
return;
|
|
2416
|
+
window.removeEventListener('resize', this.setDimensions);
|
|
2417
|
+
}
|
|
2418
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaForceSizeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2419
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.5", type: NxaForceSizeDirective, isStandalone: true, selector: "[nxaForceSize]", inputs: { nxaForceSize: "nxaForceSize" }, host: { properties: { "style.width": "this.hostWidth", "style.height": "this.hostHeight" } }, ngImport: i0 });
|
|
2420
|
+
}
|
|
2421
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaForceSizeDirective, decorators: [{
|
|
2422
|
+
type: Directive,
|
|
2423
|
+
args: [{
|
|
2424
|
+
selector: '[nxaForceSize]',
|
|
2425
|
+
standalone: true,
|
|
2426
|
+
}]
|
|
2427
|
+
}], propDecorators: { nxaForceSize: [{
|
|
2428
|
+
type: Input
|
|
2429
|
+
}], hostWidth: [{
|
|
2430
|
+
type: HostBinding,
|
|
2431
|
+
args: ['style.width']
|
|
2432
|
+
}], hostHeight: [{
|
|
2433
|
+
type: HostBinding,
|
|
2434
|
+
args: ['style.height']
|
|
2435
|
+
}] } });
|
|
2436
|
+
|
|
2437
|
+
class NxaPagination {
|
|
2438
|
+
_label = signal('Page', ...(ngDevMode ? [{ debugName: "_label" }] : []));
|
|
2439
|
+
set label(value) {
|
|
2440
|
+
this._label.set(value);
|
|
2441
|
+
}
|
|
2442
|
+
get label() {
|
|
2443
|
+
return this._label();
|
|
2444
|
+
}
|
|
2445
|
+
_totalPages = signal(10, ...(ngDevMode ? [{ debugName: "_totalPages" }] : []));
|
|
2446
|
+
set totalPages(value) {
|
|
2447
|
+
this._totalPages.set(value);
|
|
2448
|
+
}
|
|
2449
|
+
get totalPages() {
|
|
2450
|
+
return this._totalPages();
|
|
2451
|
+
}
|
|
2452
|
+
_currentPage = modelState(1, true);
|
|
2453
|
+
set currentPage(value) {
|
|
2454
|
+
this._currentPage.set(value);
|
|
2455
|
+
}
|
|
2456
|
+
get currentPage() {
|
|
2457
|
+
return this._currentPage.get();
|
|
2458
|
+
}
|
|
2459
|
+
currentPageChange = this._currentPage.emitter;
|
|
2460
|
+
nextPage() {
|
|
2461
|
+
this.currentPageChange.emit(this._currentPage.get() + 1);
|
|
2462
|
+
}
|
|
2463
|
+
prevPage() {
|
|
2464
|
+
this.currentPageChange.emit(this._currentPage.get() - 1);
|
|
2465
|
+
}
|
|
2466
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaPagination, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2467
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.5", type: NxaPagination, isStandalone: true, selector: "nxa-pagination", inputs: { label: "label", totalPages: "totalPages", currentPage: "currentPage" }, outputs: { currentPageChange: "currentPageChange" }, ngImport: i0, template: "<div class=\"join w-72 py-1 my-3 flex flex-row justify-between items-center ms-4\">\n <nxa-button color=\"primary\" classes=\"min-w-14 join-item\" [outlined]=\"true\" (click)=\"prevPage()\"\n [disabled]=\"_currentPage.get() === 1\">\n <ng-icon name=\"heroChevronLeft\"></ng-icon>\n </nxa-button>\n <span class=\"join-item bg-base-200 self-stretch flex-1 px-1 text-center content-center\">\n <p class=\"text-center \">{{_label()}}</p>\n </span>\n <nxa-button color=\"primary\" classes=\"min-w-14 join-item\" [outlined]=\"true\" (click)=\"nextPage()\"\n [disabled]=\"_currentPage.get() === _totalPages()\">\n <ng-icon name=\"heroChevronRight\"></ng-icon>\n </nxa-button>\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "component", type: NxaButton, selector: "nxa-button", inputs: ["label", "color", "size", "disabled", "loading", "routerLink", "outlined", "className", "type", "spinnerTemplateRef"], outputs: ["nxaClick"] }], viewProviders: [provideIcons({ heroChevronRight, heroChevronLeft })] });
|
|
2468
|
+
}
|
|
2469
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaPagination, decorators: [{
|
|
2470
|
+
type: Component,
|
|
2471
|
+
args: [{ selector: 'nxa-pagination', encapsulation: ViewEncapsulation.Emulated, viewProviders: [provideIcons({ heroChevronRight, heroChevronLeft })], imports: [CommonModule, NgIcon, NxaButton], template: "<div class=\"join w-72 py-1 my-3 flex flex-row justify-between items-center ms-4\">\n <nxa-button color=\"primary\" classes=\"min-w-14 join-item\" [outlined]=\"true\" (click)=\"prevPage()\"\n [disabled]=\"_currentPage.get() === 1\">\n <ng-icon name=\"heroChevronLeft\"></ng-icon>\n </nxa-button>\n <span class=\"join-item bg-base-200 self-stretch flex-1 px-1 text-center content-center\">\n <p class=\"text-center \">{{_label()}}</p>\n </span>\n <nxa-button color=\"primary\" classes=\"min-w-14 join-item\" [outlined]=\"true\" (click)=\"nextPage()\"\n [disabled]=\"_currentPage.get() === _totalPages()\">\n <ng-icon name=\"heroChevronRight\"></ng-icon>\n </nxa-button>\n</div>" }]
|
|
2472
|
+
}], propDecorators: { label: [{
|
|
2473
|
+
type: Input
|
|
2474
|
+
}], totalPages: [{
|
|
2475
|
+
type: Input
|
|
2476
|
+
}], currentPage: [{
|
|
2477
|
+
type: Input
|
|
2478
|
+
}], currentPageChange: [{
|
|
2479
|
+
type: Output
|
|
2480
|
+
}] } });
|
|
2481
|
+
|
|
2482
|
+
class NxaDatagrid {
|
|
2483
|
+
_data = signal([], ...(ngDevMode ? [{ debugName: "_data" }] : []));
|
|
2484
|
+
set data(value) {
|
|
2485
|
+
this._data.set(value);
|
|
2486
|
+
}
|
|
2487
|
+
get data() {
|
|
2488
|
+
return this._data();
|
|
2489
|
+
}
|
|
2490
|
+
_headers = signal([], ...(ngDevMode ? [{ debugName: "_headers" }] : []));
|
|
2491
|
+
set headers(value) {
|
|
2492
|
+
this._headers.set(value);
|
|
2493
|
+
}
|
|
2494
|
+
get headers() {
|
|
2495
|
+
return this._headers();
|
|
2496
|
+
}
|
|
2497
|
+
_headerRowTemplate = signal(undefined, ...(ngDevMode ? [{ debugName: "_headerRowTemplate" }] : []));
|
|
2498
|
+
set headerRowTemplate(value) {
|
|
2499
|
+
this._headerRowTemplate.set(value);
|
|
2500
|
+
}
|
|
2501
|
+
get headerRowTemplate() {
|
|
2502
|
+
return this._headerRowTemplate();
|
|
2503
|
+
}
|
|
2504
|
+
_dataRowTemplate = signal(undefined, ...(ngDevMode ? [{ debugName: "_dataRowTemplate" }] : []));
|
|
2505
|
+
set dataRowTemplate(value) {
|
|
2506
|
+
this._dataRowTemplate.set(value);
|
|
2507
|
+
}
|
|
2508
|
+
get dataRowTemplate() {
|
|
2509
|
+
return this._dataRowTemplate();
|
|
2510
|
+
}
|
|
2511
|
+
getObjectKeys(value) {
|
|
2512
|
+
return Object.keys(value);
|
|
2513
|
+
}
|
|
2514
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaDatagrid, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2515
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.5", type: NxaDatagrid, isStandalone: true, selector: "nxa-datagrid", inputs: { data: "data", headers: "headers", headerRowTemplate: "headerRowTemplate", dataRowTemplate: "dataRowTemplate" }, host: { classAttribute: "w-full h-full min-h-0 flex flex-col flex-1" }, ngImport: i0, template: "<div class=\"nxa-datagrid-container overflow-visible h-full min-h-0 flex flex-col flex-1\">\n <div class=\"flex flex-row nxa-datagrid-headers relative top-0 left-0 w-full h-10 justify-between items-center overflow-visible\">\n <div *ngFor=\"let header of _headers(); let hi = index\" class=\"w-full justify-stretch flex flex-row\">\n <ng-container\n *ngTemplateOutlet=\"_headerRowTemplate()|| defaultHeaders; context: { $implicit: header, index: hi }\"></ng-container>\n </div>\n </div>\n <div class=\"w-full flex flex-col overflow-y-auto\" nxaAutoSize=\"y\">\n <div class=\"flex flex-row justify-between\" *ngFor=\"let row of _data(); let ri = index\">\n <ng-container\n *ngTemplateOutlet=\"_dataRowTemplate() || defaultRow; context: { $implicit: row, index: ri }\"></ng-container>\n </div>\n </div>\n <div>\n <nxa-pagination class=\"h-20\" [currentPage]=\"1\" [totalPages]=\"20\" [label]=\"`page 1/20`\"></nxa-pagination>\n </div>\n</div>\n\n<ng-template #defaultHeaders let-header let-index=\"index\">\n <div class=\"flex flex-row w-full justify-stretch bg-purple-700 border\">\n @for (key of getObjectKeys(header); track key) {\n <div class=\"flex flex-row bg-red-500 w-full text-center\">\n <p>\n {{header[key]}}\n </p>\n </div>\n }\n </div>\n</ng-template>\n\n<ng-template #defaultRow let-row let-index=\"index\">\n <div class=\"flex flex-row w-full justify-between shadow-xl\">\n @for (key of getObjectKeys(row); track key) {\n <div class=\"flex flex-row justify-between\">\n {{row[key]}} {{index}}\n </div>\n }\n </div>\n</ng-template>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NxaAutoSizeDirective, selector: "[nxaAutoSize]", inputs: ["nxaAutoSize"] }, { kind: "component", type: NxaPagination, selector: "nxa-pagination", inputs: ["label", "totalPages", "currentPage"], outputs: ["currentPageChange"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
2516
|
+
}
|
|
2517
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaDatagrid, decorators: [{
|
|
2518
|
+
type: Component,
|
|
2519
|
+
args: [{ selector: 'nxa-datagrid', imports: [CommonModule, NxaAutoSizeDirective, NxaPagination], encapsulation: ViewEncapsulation.None, host: {
|
|
2520
|
+
class: NXA_HOST_LAYOUT
|
|
2521
|
+
}, template: "<div class=\"nxa-datagrid-container overflow-visible h-full min-h-0 flex flex-col flex-1\">\n <div class=\"flex flex-row nxa-datagrid-headers relative top-0 left-0 w-full h-10 justify-between items-center overflow-visible\">\n <div *ngFor=\"let header of _headers(); let hi = index\" class=\"w-full justify-stretch flex flex-row\">\n <ng-container\n *ngTemplateOutlet=\"_headerRowTemplate()|| defaultHeaders; context: { $implicit: header, index: hi }\"></ng-container>\n </div>\n </div>\n <div class=\"w-full flex flex-col overflow-y-auto\" nxaAutoSize=\"y\">\n <div class=\"flex flex-row justify-between\" *ngFor=\"let row of _data(); let ri = index\">\n <ng-container\n *ngTemplateOutlet=\"_dataRowTemplate() || defaultRow; context: { $implicit: row, index: ri }\"></ng-container>\n </div>\n </div>\n <div>\n <nxa-pagination class=\"h-20\" [currentPage]=\"1\" [totalPages]=\"20\" [label]=\"`page 1/20`\"></nxa-pagination>\n </div>\n</div>\n\n<ng-template #defaultHeaders let-header let-index=\"index\">\n <div class=\"flex flex-row w-full justify-stretch bg-purple-700 border\">\n @for (key of getObjectKeys(header); track key) {\n <div class=\"flex flex-row bg-red-500 w-full text-center\">\n <p>\n {{header[key]}}\n </p>\n </div>\n }\n </div>\n</ng-template>\n\n<ng-template #defaultRow let-row let-index=\"index\">\n <div class=\"flex flex-row w-full justify-between shadow-xl\">\n @for (key of getObjectKeys(row); track key) {\n <div class=\"flex flex-row justify-between\">\n {{row[key]}} {{index}}\n </div>\n }\n </div>\n</ng-template>" }]
|
|
2522
|
+
}], propDecorators: { data: [{
|
|
2523
|
+
type: Input
|
|
2524
|
+
}], headers: [{
|
|
2525
|
+
type: Input
|
|
2526
|
+
}], headerRowTemplate: [{
|
|
2527
|
+
type: Input
|
|
2528
|
+
}], dataRowTemplate: [{
|
|
2529
|
+
type: Input
|
|
2530
|
+
}] } });
|
|
2531
|
+
|
|
2532
|
+
class NxaDynamicList {
|
|
2533
|
+
_rowTemplateRef = signal(null, ...(ngDevMode ? [{ debugName: "_rowTemplateRef" }] : []));
|
|
2534
|
+
set rowTemplateRef(value) {
|
|
2535
|
+
this._rowTemplateRef.set(value);
|
|
2536
|
+
}
|
|
2537
|
+
get rowTemplateRef() {
|
|
2538
|
+
return this._rowTemplateRef();
|
|
2539
|
+
}
|
|
2540
|
+
_data = signal(null, ...(ngDevMode ? [{ debugName: "_data" }] : []));
|
|
2541
|
+
set data(value) {
|
|
2542
|
+
this._data.set(value);
|
|
2543
|
+
}
|
|
2544
|
+
get data() {
|
|
2545
|
+
return this._data();
|
|
2546
|
+
}
|
|
2547
|
+
_enableSorting = signal(false, ...(ngDevMode ? [{ debugName: "_enableSorting" }] : []));
|
|
2548
|
+
set enableSorting(value) {
|
|
2549
|
+
this._enableSorting.set(value);
|
|
2550
|
+
}
|
|
2551
|
+
get enableSorting() {
|
|
2552
|
+
return this._enableSorting();
|
|
2553
|
+
}
|
|
2554
|
+
_enableDrop = signal(false, ...(ngDevMode ? [{ debugName: "_enableDrop" }] : []));
|
|
2555
|
+
set enableDrop(value) {
|
|
2556
|
+
this._enableDrop.set(value);
|
|
2557
|
+
}
|
|
2558
|
+
get enableDrop() {
|
|
2559
|
+
return this._enableDrop();
|
|
2560
|
+
}
|
|
2561
|
+
_enableDrag = signal(false, ...(ngDevMode ? [{ debugName: "_enableDrag" }] : []));
|
|
2562
|
+
set enableDrag(value) {
|
|
2563
|
+
this._enableDrag.set(value);
|
|
2564
|
+
}
|
|
2565
|
+
get enableDrag() {
|
|
2566
|
+
return this._enableDrag();
|
|
2567
|
+
}
|
|
2568
|
+
_rowHeight = signal(48, ...(ngDevMode ? [{ debugName: "_rowHeight" }] : []));
|
|
2569
|
+
set rowHeight(value) {
|
|
2570
|
+
this._rowHeight.set(value);
|
|
2571
|
+
}
|
|
2572
|
+
get rowHeight() {
|
|
2573
|
+
return this._rowHeight();
|
|
2574
|
+
}
|
|
2575
|
+
elementSorted = new EventEmitter();
|
|
2576
|
+
elementDropped(event) {
|
|
2577
|
+
this._data.update((currentData) => {
|
|
2578
|
+
if (!currentData) {
|
|
2579
|
+
console.warn("NxaDynamicList: Data array is not initialized during drop operation.");
|
|
2580
|
+
return [];
|
|
2581
|
+
}
|
|
2582
|
+
const newData = [...currentData];
|
|
2583
|
+
this.elementSorted.emit({ prevIndex: event.previousIndex, currentIndex: event.currentIndex });
|
|
2584
|
+
moveItemInArray(newData, event.previousIndex, event.currentIndex);
|
|
2585
|
+
return newData;
|
|
2586
|
+
});
|
|
2587
|
+
}
|
|
2588
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaDynamicList, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2589
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.5", type: NxaDynamicList, isStandalone: true, selector: "nxa-dynamic-list", inputs: { rowTemplateRef: "rowTemplateRef", data: "data", enableSorting: "enableSorting", enableDrop: "enableDrop", enableDrag: "enableDrag", rowHeight: "rowHeight" }, outputs: { elementSorted: "elementSorted" }, host: { classAttribute: "block min-h-0 basis-fit h-fit flex-1 max-h-full w-full max-w-full inset-0 box-border" }, ngImport: i0, template: "<cdk-virtual-scroll-viewport [itemSize]=\"_rowHeight()\" class=\"h-full w-full\" cdkDropList\n [cdkDropListDisabled]=\"!_enableDrop()\" [cdkDropListSortingDisabled]=\"!_enableSorting()\"\n (cdkDropListDropped)=\"elementDropped($event)\">\n <div *cdkVirtualFor=\"let item of _data(); let i = index\" cdkDrag [cdkDragDisabled]=\"!_enableDrag()\">\n <ng-container *ngTemplateOutlet=\"_rowTemplateRef(); context: { $implicit: item, index: i }\"></ng-container>\n </div>\n</cdk-virtual-scroll-viewport>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i2.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i2.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i2.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }] });
|
|
2590
|
+
}
|
|
2591
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaDynamicList, decorators: [{
|
|
2592
|
+
type: Component,
|
|
2593
|
+
args: [{ selector: 'nxa-dynamic-list', standalone: true, host: {
|
|
2594
|
+
class: NXA_HOST_BLOCK
|
|
2595
|
+
}, imports: [CommonModule, ScrollingModule, CdkDrag, CdkDropList, NxaContainer], template: "<cdk-virtual-scroll-viewport [itemSize]=\"_rowHeight()\" class=\"h-full w-full\" cdkDropList\n [cdkDropListDisabled]=\"!_enableDrop()\" [cdkDropListSortingDisabled]=\"!_enableSorting()\"\n (cdkDropListDropped)=\"elementDropped($event)\">\n <div *cdkVirtualFor=\"let item of _data(); let i = index\" cdkDrag [cdkDragDisabled]=\"!_enableDrag()\">\n <ng-container *ngTemplateOutlet=\"_rowTemplateRef(); context: { $implicit: item, index: i }\"></ng-container>\n </div>\n</cdk-virtual-scroll-viewport>" }]
|
|
2596
|
+
}], propDecorators: { rowTemplateRef: [{
|
|
2597
|
+
type: Input
|
|
2598
|
+
}], data: [{
|
|
2599
|
+
type: Input
|
|
2600
|
+
}], enableSorting: [{
|
|
2601
|
+
type: Input
|
|
2602
|
+
}], enableDrop: [{
|
|
2603
|
+
type: Input
|
|
2604
|
+
}], enableDrag: [{
|
|
2605
|
+
type: Input
|
|
2606
|
+
}], rowHeight: [{
|
|
2607
|
+
type: Input
|
|
2608
|
+
}], elementSorted: [{
|
|
2609
|
+
type: Output
|
|
2610
|
+
}] } });
|
|
2611
|
+
|
|
2612
|
+
class NxaListTile {
|
|
2613
|
+
_className = signal('', ...(ngDevMode ? [{ debugName: "_className" }] : []));
|
|
2614
|
+
set className(value) {
|
|
2615
|
+
this._className.set(value);
|
|
2616
|
+
}
|
|
2617
|
+
get className() {
|
|
2618
|
+
return this._className();
|
|
2619
|
+
}
|
|
2620
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaListTile, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2621
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.5", type: NxaListTile, isStandalone: true, selector: "nxa-list-tile", inputs: { className: "className" }, host: { classAttribute: "contents" }, ngImport: i0, template: "<div class=\"w-full grid bg-inherit grid-cols-[auto_auto_auto] gap-1 h-12\" [class]=\"_className()\">\n <div class=\"nxa-list-tile-leading content-center\">\n <ng-content select=\"[leading]\"></ng-content>\n </div>\n <div class=\"nxa-list-tile-content content-center\">\n <ng-content select=\"\"></ng-content>\n </div>\n <div class=\"nxa-list-tile-trailing content-center\">\n <ng-content select=\"[trailing]\"></ng-content>\n </div>\n</div>" });
|
|
2622
|
+
}
|
|
2623
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaListTile, decorators: [{
|
|
2624
|
+
type: Component,
|
|
2625
|
+
args: [{ selector: 'nxa-list-tile', host: {
|
|
2626
|
+
class: NXA_HOST_CONTENTS_ONLY,
|
|
2627
|
+
}, template: "<div class=\"w-full grid bg-inherit grid-cols-[auto_auto_auto] gap-1 h-12\" [class]=\"_className()\">\n <div class=\"nxa-list-tile-leading content-center\">\n <ng-content select=\"[leading]\"></ng-content>\n </div>\n <div class=\"nxa-list-tile-content content-center\">\n <ng-content select=\"\"></ng-content>\n </div>\n <div class=\"nxa-list-tile-trailing content-center\">\n <ng-content select=\"[trailing]\"></ng-content>\n </div>\n</div>" }]
|
|
2628
|
+
}], propDecorators: { className: [{
|
|
2629
|
+
type: Input
|
|
2630
|
+
}] } });
|
|
2631
|
+
|
|
2632
|
+
class NxaBadge extends WithClassNameMixin(class {
|
|
2633
|
+
}) {
|
|
2634
|
+
domSanitizer = inject(DomSanitizer);
|
|
2635
|
+
// Signals
|
|
2636
|
+
_color = signal('accent', ...(ngDevMode ? [{ debugName: "_color" }] : []));
|
|
2637
|
+
_outlined = signal(false, ...(ngDevMode ? [{ debugName: "_outlined" }] : []));
|
|
2638
|
+
_size = signal('md', ...(ngDevMode ? [{ debugName: "_size" }] : []));
|
|
2639
|
+
_label = signal('', ...(ngDevMode ? [{ debugName: "_label" }] : []));
|
|
2640
|
+
_icon = signal('', ...(ngDevMode ? [{ debugName: "_icon" }] : []));
|
|
2641
|
+
// @Input() setters
|
|
2642
|
+
set color(value) {
|
|
2643
|
+
this._color.set(value);
|
|
2644
|
+
}
|
|
2645
|
+
get color() {
|
|
2646
|
+
return this._color();
|
|
2647
|
+
}
|
|
2648
|
+
set outlined(value) {
|
|
2649
|
+
this._outlined.set(value);
|
|
2650
|
+
}
|
|
2651
|
+
get outlined() {
|
|
2652
|
+
return this._outlined();
|
|
2653
|
+
}
|
|
2654
|
+
set size(value) {
|
|
2655
|
+
this._size.set(value);
|
|
2656
|
+
}
|
|
2657
|
+
get size() {
|
|
2658
|
+
return this._size();
|
|
2659
|
+
}
|
|
2660
|
+
set label(value) {
|
|
2661
|
+
this._label.set(value);
|
|
2662
|
+
}
|
|
2663
|
+
get label() {
|
|
2664
|
+
return this._label();
|
|
2665
|
+
}
|
|
2666
|
+
set icon(value) {
|
|
2667
|
+
this._icon.set(value);
|
|
2668
|
+
}
|
|
2669
|
+
get icon() {
|
|
2670
|
+
return this._icon();
|
|
2671
|
+
}
|
|
2672
|
+
set className(value) {
|
|
2673
|
+
this._className.set(value);
|
|
2674
|
+
}
|
|
2675
|
+
get className() {
|
|
2676
|
+
return this._className();
|
|
2677
|
+
}
|
|
2678
|
+
computedClasses = computed(() => {
|
|
2679
|
+
return {
|
|
2680
|
+
[`badge-${this._size()}`]: true,
|
|
2681
|
+
[`badge-${this._color()}`]: true,
|
|
2682
|
+
[`badge-outline`]: this._outlined(),
|
|
2683
|
+
};
|
|
2684
|
+
}, ...(ngDevMode ? [{ debugName: "computedClasses" }] : []));
|
|
2685
|
+
getIconHTML() {
|
|
2686
|
+
if (this._icon()) {
|
|
2687
|
+
return sanitizeIcon(this._icon(), this.domSanitizer);
|
|
2688
|
+
}
|
|
2689
|
+
return null;
|
|
2690
|
+
}
|
|
2691
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaBadge, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2692
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.5", type: NxaBadge, isStandalone: true, selector: "nxa-badge", inputs: { color: "color", outlined: "outlined", size: "size", label: "label", icon: "icon", className: "className" }, usesInheritance: true, ngImport: i0, template: "<div class=\"badge flex flex-row items-center nxa-badge-component\" [ngClass]=\"{\n 'badge-neutral':_color()==='neutral',\n 'badge-primary':_color()==='primary',\n 'badge-secondary':_color()==='secondary',\n 'badge-accent':_color()==='accent',\n 'badge-ghost':_color()==='ghost',\n 'badge-link':_color()==='link',\n 'badge-info':_color()==='info',\n 'badge-success':_color()==='success',\n 'badge-warning':_color()==='warning',\n 'badge-error':_color()==='error',\n 'badge-xs':_size()==='xs',\n 'badge-sm':_size()==='sm',\n 'badge-md':_size()==='md',\n 'badge-lg':_size()==='lg',\n 'badge-xl':_size()==='xl', \n ...computedClasses(),\n ..._classNameObject()\n }\">\n <div class=\"w-fit h-fit\">\n <ng-content select=\"[leading]\"></ng-content>\n </div>\n @if (_label()) {\n <p class=\"me-1 font-light text-sm\">{{_label()}}</p>\n }\n <ng-content></ng-content>\n @if(!!_icon()){\n <div class=\"w-4 h-4 flex items-center justify-center text-[1rem]\" [innerHTML]=\"getIconHTML()\"></div>\n }\n <div class=\"w-fit h-fit\">\n <ng-content select=\"[trailing]\"></ng-content>\n </div>\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
2693
|
+
}
|
|
2694
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaBadge, decorators: [{
|
|
2695
|
+
type: Component,
|
|
2696
|
+
args: [{ selector: 'nxa-badge', encapsulation: ViewEncapsulation.None, imports: [CommonModule], template: "<div class=\"badge flex flex-row items-center nxa-badge-component\" [ngClass]=\"{\n 'badge-neutral':_color()==='neutral',\n 'badge-primary':_color()==='primary',\n 'badge-secondary':_color()==='secondary',\n 'badge-accent':_color()==='accent',\n 'badge-ghost':_color()==='ghost',\n 'badge-link':_color()==='link',\n 'badge-info':_color()==='info',\n 'badge-success':_color()==='success',\n 'badge-warning':_color()==='warning',\n 'badge-error':_color()==='error',\n 'badge-xs':_size()==='xs',\n 'badge-sm':_size()==='sm',\n 'badge-md':_size()==='md',\n 'badge-lg':_size()==='lg',\n 'badge-xl':_size()==='xl', \n ...computedClasses(),\n ..._classNameObject()\n }\">\n <div class=\"w-fit h-fit\">\n <ng-content select=\"[leading]\"></ng-content>\n </div>\n @if (_label()) {\n <p class=\"me-1 font-light text-sm\">{{_label()}}</p>\n }\n <ng-content></ng-content>\n @if(!!_icon()){\n <div class=\"w-4 h-4 flex items-center justify-center text-[1rem]\" [innerHTML]=\"getIconHTML()\"></div>\n }\n <div class=\"w-fit h-fit\">\n <ng-content select=\"[trailing]\"></ng-content>\n </div>\n</div>" }]
|
|
2697
|
+
}], propDecorators: { color: [{
|
|
2698
|
+
type: Input
|
|
2699
|
+
}], outlined: [{
|
|
2700
|
+
type: Input
|
|
2701
|
+
}], size: [{
|
|
2702
|
+
type: Input
|
|
2703
|
+
}], label: [{
|
|
2704
|
+
type: Input
|
|
2705
|
+
}], icon: [{
|
|
2706
|
+
type: Input
|
|
2707
|
+
}], className: [{
|
|
2708
|
+
type: Input
|
|
2709
|
+
}] } });
|
|
2710
|
+
|
|
2711
|
+
class NxaText {
|
|
2712
|
+
_layoutService = inject(NxaLayoutService);
|
|
2713
|
+
_screenSizeChanged = toSignal(this._layoutService.breakpoint$);
|
|
2714
|
+
_for = signal('', ...(ngDevMode ? [{ debugName: "_for" }] : []));
|
|
2715
|
+
set for(value) { this._for.set(value); }
|
|
2716
|
+
get for() { return this._for(); }
|
|
2717
|
+
_useLabelTag = computed(() => !!this._for(), ...(ngDevMode ? [{ debugName: "_useLabelTag" }] : []));
|
|
2718
|
+
/**
|
|
2719
|
+
* The type of text to render.
|
|
2720
|
+
*/
|
|
2721
|
+
_type = signal('paragraph', ...(ngDevMode ? [{ debugName: "_type" }] : []));
|
|
2722
|
+
set type(value) { this._type.set(value); }
|
|
2723
|
+
get type() { return this._type(); }
|
|
2724
|
+
/**
|
|
2725
|
+
* The size of the text.
|
|
2726
|
+
* default depends on the type of text
|
|
2727
|
+
*/
|
|
2728
|
+
_size = signal('md', ...(ngDevMode ? [{ debugName: "_size" }] : []));
|
|
2729
|
+
set size(value) { this._size.set(value); }
|
|
2730
|
+
get size() { return this._size(); }
|
|
2731
|
+
_computeSizeSuffix = computed(() => {
|
|
2732
|
+
const screenBreakPoint = this._screenSizeChanged();
|
|
2733
|
+
const sizeInput = this._size();
|
|
2734
|
+
let result = 'md';
|
|
2735
|
+
if (!!sizeInput && typeof sizeInput === 'object') {
|
|
2736
|
+
result = sizeInput[screenBreakPoint] || 'md';
|
|
2737
|
+
}
|
|
2738
|
+
else if (!!sizeInput && typeof sizeInput === 'string') {
|
|
2739
|
+
result = sizeInput;
|
|
2740
|
+
}
|
|
2741
|
+
return result;
|
|
2742
|
+
}, ...(ngDevMode ? [{ debugName: "_computeSizeSuffix" }] : []));
|
|
2743
|
+
/**
|
|
2744
|
+
* The weight of the text.
|
|
2745
|
+
* default depends on the type of text
|
|
2746
|
+
* Possible values: 'extralight', 'thin', 'light', 'normal', 'medium', 'semibold', 'bold', 'extrabold'
|
|
2747
|
+
*/
|
|
2748
|
+
_weight = signal(null, ...(ngDevMode ? [{ debugName: "_weight" }] : []));
|
|
2749
|
+
set weight(value) { this._weight.set(value); }
|
|
2750
|
+
;
|
|
2751
|
+
get weight() { return this._weight(); }
|
|
2752
|
+
/**
|
|
2753
|
+
* The italic style of the text.
|
|
2754
|
+
* default false
|
|
2755
|
+
*/
|
|
2756
|
+
_italic = signal(false, ...(ngDevMode ? [{ debugName: "_italic" }] : []));
|
|
2757
|
+
set italic(value) { this._italic.set(value); }
|
|
2758
|
+
;
|
|
2759
|
+
get italic() { return this._italic(); }
|
|
2760
|
+
/**
|
|
2761
|
+
* The color of the text.
|
|
2762
|
+
* default 'content'
|
|
2763
|
+
* Possible values: 'primary', 'secondary', 'success', 'warning', 'error', 'content', 'info', 'neutral'
|
|
2764
|
+
*
|
|
2765
|
+
* Note: This is a custom color, not a tailwind color.
|
|
2766
|
+
* You can use this to set the color of the text to any color you want.
|
|
2767
|
+
*/
|
|
2768
|
+
_color = signal('content', ...(ngDevMode ? [{ debugName: "_color" }] : []));
|
|
2769
|
+
set color(value) { this._color.set(value); }
|
|
2770
|
+
;
|
|
2771
|
+
get color() { return this._color(); }
|
|
2772
|
+
// Alternative using input from angular core
|
|
2773
|
+
//
|
|
2774
|
+
/**
|
|
2775
|
+
* Custom class name to add to the text element.
|
|
2776
|
+
* This can be used to add additional styles to the text element.
|
|
2777
|
+
* It will be added to the computed classes of the text element.
|
|
2778
|
+
*
|
|
2779
|
+
* Note: use tailwind/ global classes to override local value, some time !important is required.
|
|
2780
|
+
*/
|
|
2781
|
+
_className = signal('', ...(ngDevMode ? [{ debugName: "_className" }] : []));
|
|
2782
|
+
set className(value) {
|
|
2783
|
+
this._className.set(value);
|
|
2784
|
+
}
|
|
2785
|
+
;
|
|
2786
|
+
get className() {
|
|
2787
|
+
return this._className();
|
|
2788
|
+
}
|
|
2789
|
+
;
|
|
2790
|
+
computedClasses = computed(() => {
|
|
2791
|
+
let classes = `nxa-text ${'nxa-text-' + this._type()}`;
|
|
2792
|
+
const size = this._computeSizeSuffix();
|
|
2793
|
+
classes += ` nxa-text-${size}`;
|
|
2794
|
+
if (this._weight()) {
|
|
2795
|
+
classes += ` nxa-text-${this._weight()}`;
|
|
2796
|
+
}
|
|
2797
|
+
if (this._color()) {
|
|
2798
|
+
classes += ` nxa-text-${this._color()}`;
|
|
2799
|
+
}
|
|
2800
|
+
return `${classes} ${this._className()}`;
|
|
2801
|
+
}, ...(ngDevMode ? [{ debugName: "computedClasses" }] : []));
|
|
2802
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaText, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2803
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.5", type: NxaText, isStandalone: true, selector: "nxa-text", inputs: { for: "for", type: "type", size: "size", weight: "weight", italic: "italic", color: "color", className: "className" }, host: { properties: { "attr.for": "null" }, classAttribute: "contents" }, ngImport: i0, template: "@if(!!_for()){\n<label class=\"min-h-fit h-fit w-fit\" [for]=\"_for()\" [class]=\"computedClasses()\" [ngClass]=\"{\n 'italic': _italic(),\n }\">\n <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n</label>\n}@else if(_type()===\"title\" && _size()==='xl')\n{\n<h1 class=\"min-h-fit h-fit\" [class]=\"computedClasses()\" [ngClass]=\"{\n 'italic': _italic(),\n }\">\n <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n</h1>\n}@else if(_type()===\"title\" && _size()==='lg')\n{\n<h2 class=\"min-h-fit h-fit\" [class]=\"computedClasses()\" [ngClass]=\"{\n 'italic': _italic(),\n }\">\n <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n</h2>\n}@else if(_type()===\"title\" && _size()==='md')\n{\n<h3 class=\"min-h-fit h-fit\" [class]=\"computedClasses()\" [ngClass]=\"{\n 'italic': _italic(),\n }\">\n <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n</h3>\n}@else if(_type()===\"title\" && _size()==='sm')\n{\n<h4 class=\"min-h-fit h-fit\" [class]=\"computedClasses()\" [ngClass]=\"{\n 'italic': _italic(),\n }\">\n <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n</h4>\n}@else if(_type()===\"title\" && _size()==='xs')\n{\n<h5 class=\"min-h-fit h-fit\" [class]=\"computedClasses()\" [ngClass]=\"{\n 'italic': _italic(),\n }\">\n <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n</h5>\n}@else{\n<p class=\"min-h-fit h-fit\" [class]=\"computedClasses()\" [ngClass]=\"{\n 'italic': _italic(),\n }\">\n <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n</p>\n}\n\n<ng-template #content>\n <ng-content select=\"\"></ng-content>\n</ng-template>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
2804
|
+
}
|
|
2805
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaText, decorators: [{
|
|
2806
|
+
type: Component,
|
|
2807
|
+
args: [{ selector: 'nxa-text', standalone: true, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule], host: {
|
|
2808
|
+
class: NXA_HOST_CONTENTS_ONLY,
|
|
2809
|
+
'[attr.for]': "null",
|
|
2810
|
+
}, template: "@if(!!_for()){\n<label class=\"min-h-fit h-fit w-fit\" [for]=\"_for()\" [class]=\"computedClasses()\" [ngClass]=\"{\n 'italic': _italic(),\n }\">\n <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n</label>\n}@else if(_type()===\"title\" && _size()==='xl')\n{\n<h1 class=\"min-h-fit h-fit\" [class]=\"computedClasses()\" [ngClass]=\"{\n 'italic': _italic(),\n }\">\n <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n</h1>\n}@else if(_type()===\"title\" && _size()==='lg')\n{\n<h2 class=\"min-h-fit h-fit\" [class]=\"computedClasses()\" [ngClass]=\"{\n 'italic': _italic(),\n }\">\n <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n</h2>\n}@else if(_type()===\"title\" && _size()==='md')\n{\n<h3 class=\"min-h-fit h-fit\" [class]=\"computedClasses()\" [ngClass]=\"{\n 'italic': _italic(),\n }\">\n <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n</h3>\n}@else if(_type()===\"title\" && _size()==='sm')\n{\n<h4 class=\"min-h-fit h-fit\" [class]=\"computedClasses()\" [ngClass]=\"{\n 'italic': _italic(),\n }\">\n <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n</h4>\n}@else if(_type()===\"title\" && _size()==='xs')\n{\n<h5 class=\"min-h-fit h-fit\" [class]=\"computedClasses()\" [ngClass]=\"{\n 'italic': _italic(),\n }\">\n <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n</h5>\n}@else{\n<p class=\"min-h-fit h-fit\" [class]=\"computedClasses()\" [ngClass]=\"{\n 'italic': _italic(),\n }\">\n <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n</p>\n}\n\n<ng-template #content>\n <ng-content select=\"\"></ng-content>\n</ng-template>" }]
|
|
2811
|
+
}], propDecorators: { for: [{
|
|
2812
|
+
type: Input
|
|
2813
|
+
}], type: [{
|
|
2814
|
+
type: Input
|
|
2815
|
+
}], size: [{
|
|
2816
|
+
type: Input
|
|
2817
|
+
}], weight: [{
|
|
2818
|
+
type: Input
|
|
2819
|
+
}], italic: [{
|
|
2820
|
+
type: Input
|
|
2821
|
+
}], color: [{
|
|
2822
|
+
type: Input
|
|
2823
|
+
}], className: [{
|
|
2824
|
+
type: Input
|
|
2825
|
+
}] } });
|
|
2826
|
+
|
|
2827
|
+
class NxaDrawer {
|
|
2828
|
+
domSanitizer = inject(DomSanitizer);
|
|
2829
|
+
_headerContent = signal(null, ...(ngDevMode ? [{ debugName: "_headerContent" }] : []));
|
|
2830
|
+
set headerContent(value) {
|
|
2831
|
+
this._headerContent.set(value);
|
|
2832
|
+
}
|
|
2833
|
+
get headerContent() {
|
|
2834
|
+
return this._headerContent();
|
|
2835
|
+
}
|
|
2836
|
+
_footerContent = signal(null, ...(ngDevMode ? [{ debugName: "_footerContent" }] : []));
|
|
2837
|
+
set footerContent(value) {
|
|
2838
|
+
this._footerContent.set(value);
|
|
2839
|
+
}
|
|
2840
|
+
get footerContent() {
|
|
2841
|
+
return this._footerContent();
|
|
2842
|
+
}
|
|
2843
|
+
_menuEntries = signal([], ...(ngDevMode ? [{ debugName: "_menuEntries" }] : []));
|
|
2844
|
+
set menuEntries(value) {
|
|
2845
|
+
this._menuEntries.set(value);
|
|
2846
|
+
}
|
|
2847
|
+
get menuEntries() {
|
|
2848
|
+
return this._menuEntries();
|
|
2849
|
+
}
|
|
2850
|
+
_className = signal('', ...(ngDevMode ? [{ debugName: "_className" }] : []));
|
|
2851
|
+
set className(value) {
|
|
2852
|
+
this._className.set(value);
|
|
2853
|
+
}
|
|
2854
|
+
get className() {
|
|
2855
|
+
return this._className();
|
|
2856
|
+
}
|
|
2857
|
+
getIconHtml(icon) {
|
|
2858
|
+
return sanitizeIcon(icon, this.domSanitizer);
|
|
2859
|
+
}
|
|
2860
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaDrawer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2861
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.5", type: NxaDrawer, isStandalone: true, selector: "nxa-drawer", inputs: { headerContent: "headerContent", footerContent: "footerContent", menuEntries: "menuEntries", className: "className" }, host: { classAttribute: "w-full h-full min-h-0 flex flex-col flex-1" }, ngImport: i0, template: "<!-- nxa Drawer Container -->\n<div class=\"nxa-drawer-container\" [class]=\"_className()\">\n <!-- nxa Drawer Header -->\n @if(!!_headerContent()){\n <div class=\"nxa-drawer-header\">\n <ng-container *ngTemplateOutlet=\"_headerContent()!\"></ng-container>\n </div>\n }\n <!-- nxa Drawer Menu -->\n <div class=\"nxa-drawer-menu\">\n <!-- For each Section in the menu Entries -->\n @for (section of _menuEntries(); track $index) {\n <div class=\"nxa-drawer-menu-section\">\n <!-- Menu Section Title -->\n <nxa-text className=\"nxa-drawer-menu-section-title\" type=\"label\" size=\"xl\"\n color=\"primary\">{{section.label}}</nxa-text>\n <!-- Menu Section Entries -->\n <ul class=\"w-full\">\n @for (item of section.entries; track $index) {\n <ng-container *ngTemplateOutlet=\"renderMenuEntry; context: { $implicit: item }\"></ng-container>\n }\n </ul>\n </div>\n }\n </div>\n\n\n @if(!!_footerContent()){\n <div class=\"nxa-drawer-footer\">\n <ng-container *ngTemplateOutlet=\"_footerContent()!\"></ng-container>\n </div>\n }\n</div>\n\n<ng-template #renderMenuEntry let-item>\n @if(!item.subEntries && item.routerLink){\n <!-- Menu Entry single line -->\n <a class=\"nxa-drawer-menu-entry nxa-click-animation\" [id]=\"item.id||''\" [routerLink]=\"item.routerLink\"\n [fragment]=\"item.fragment\" [routerLinkActive]=\"'active'\">\n <!-- Display icon if needed or placeholder-->\n @if(!!item.icon){\n <div class=\"nxa-drawer-menu-icon\" [innerHTML]=\"getIconHtml(item.icon)\"></div>\n }\n @else {\n <div class=\"\"></div>\n }\n <!-- Actual Entry label -->\n <nxa-text className=\"nxa-drawer-menu-label\" type=\"label\" [size]=\"{\n 'xs': 'sm',\n 'sm': 'md',\n 'md': 'md',\n 'lg': 'md',\n 'xl': 'lg',\n '2xl': 'lg'\n }\" weight=\"light\" color=\"content\">{{item.label}}</nxa-text>\n <!-- Display Badge If needed -->\n @if (!!item.badge) {\n <nxa-badge class=\"nxa-drawer-menu-badge\" [label]=\"item.badge.label\" [color]=\"item.badge.color\"\n [size]=\"item.badge.size\" [icon]=\"item.badge.icon\">\n </nxa-badge>\n }\n </a>\n }@else if(item.onClick){\n <!-- Menu Entry single line -->\n <button class=\"nxa-drawer-menu-entry nxa-click-animation\" [id]=\"item.id||''\" [routerLink]=\"item.routerLink\"\n [fragment]=\"item.fragment\" [routerLinkActive]=\"'active'\" (click)=\"item.onClick()\">\n <!-- Display icon if needed or placeholder-->\n @if(!!item.icon){\n <div class=\"nxa-drawer-menu-icon\" [innerHTML]=\"getIconHtml(item.icon)\"></div>\n }\n @else {\n <div class=\"\"></div>\n }\n <!-- Actual Entry label -->\n <nxa-text className=\"nxa-drawer-menu-label\" type=\"label\" [size]=\"{\n 'xs': 'sm',\n 'sm': 'md',\n 'md': 'md',\n 'lg': 'md',\n 'xl': 'lg',\n '2xl': 'lg'\n }\" weight=\"light\" color=\"content\">{{item.label}}</nxa-text>\n <!-- Display Badge If needed -->\n @if (!!item.badge) {\n <nxa-badge class=\"nxa-drawer-menu-badge\" [label]=\"item.badge.label\" [color]=\"item.badge.color\"\n [size]=\"item.badge.size\" [icon]=\"item.badge.icon\">\n </nxa-badge>\n }\n </button>\n }\n @else{\n <!-- Menu section Subentries (recursive) -->\n <nxa-expansion-panel [isOpen]=\"item.defaultOpen || false\" className=\"mx-0\" classBody=\"px-0\">\n <div expansion-header class=\"nxa-drawer-menu-expansion h-10 pointer-events-auto\">\n <!-- Display icon if needed or placeholder-->\n @if(!!item.icon){\n <div class=\"nxa-drawer-menu-icon\" [innerHTML]=\"getIconHtml(item.icon)\">\n </div>\n }@else {\n <div class=\"\"></div>\n }\n <!-- Actual Entry label -->\n <nxa-text className=\"nxa-drawer-menu-label\" type=\"label\" size=\"md\">{{item.label}}</nxa-text>\n <!-- Display Badge If needed -->\n @if (!!item.badge) {\n <nxa-badge class=\"nxa-drawer-menu-badge\" [label]=\"item.badge.label\" [color]=\"item.badge.color\"\n [size]=\"item.badge.size\" [icon]=\"item.badge.icon\">\n </nxa-badge>\n }\n </div>\n <div expansion-body>\n <ul>\n @for (subItem of item.subEntries; track $index) {\n <ng-container *ngTemplateOutlet=\"renderMenuEntry; context: { $implicit: subItem }\"></ng-container>\n }\n </ul>\n </div>\n </nxa-expansion-panel>\n }\n</ng-template>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: NxaBadge, selector: "nxa-badge", inputs: ["color", "outlined", "size", "label", "icon", "className"] }, { kind: "component", type: NxaExpansionPanel, selector: "nxa-expansion-panel", inputs: ["isOpen", "className", "classHeader", "classBody"], outputs: ["isOpenChange"] }, { 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"] }, { kind: "component", type: NxaText, selector: "nxa-text", inputs: ["for", "type", "size", "weight", "italic", "color", "className"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
2862
|
+
}
|
|
2863
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaDrawer, decorators: [{
|
|
2864
|
+
type: Component,
|
|
2865
|
+
args: [{ selector: 'nxa-drawer', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [CommonModule, NxaBadge, NxaExpansionPanel, RouterLink, RouterLinkActive, NxaText], host: {
|
|
2866
|
+
class: NXA_HOST_LAYOUT
|
|
2867
|
+
}, template: "<!-- nxa Drawer Container -->\n<div class=\"nxa-drawer-container\" [class]=\"_className()\">\n <!-- nxa Drawer Header -->\n @if(!!_headerContent()){\n <div class=\"nxa-drawer-header\">\n <ng-container *ngTemplateOutlet=\"_headerContent()!\"></ng-container>\n </div>\n }\n <!-- nxa Drawer Menu -->\n <div class=\"nxa-drawer-menu\">\n <!-- For each Section in the menu Entries -->\n @for (section of _menuEntries(); track $index) {\n <div class=\"nxa-drawer-menu-section\">\n <!-- Menu Section Title -->\n <nxa-text className=\"nxa-drawer-menu-section-title\" type=\"label\" size=\"xl\"\n color=\"primary\">{{section.label}}</nxa-text>\n <!-- Menu Section Entries -->\n <ul class=\"w-full\">\n @for (item of section.entries; track $index) {\n <ng-container *ngTemplateOutlet=\"renderMenuEntry; context: { $implicit: item }\"></ng-container>\n }\n </ul>\n </div>\n }\n </div>\n\n\n @if(!!_footerContent()){\n <div class=\"nxa-drawer-footer\">\n <ng-container *ngTemplateOutlet=\"_footerContent()!\"></ng-container>\n </div>\n }\n</div>\n\n<ng-template #renderMenuEntry let-item>\n @if(!item.subEntries && item.routerLink){\n <!-- Menu Entry single line -->\n <a class=\"nxa-drawer-menu-entry nxa-click-animation\" [id]=\"item.id||''\" [routerLink]=\"item.routerLink\"\n [fragment]=\"item.fragment\" [routerLinkActive]=\"'active'\">\n <!-- Display icon if needed or placeholder-->\n @if(!!item.icon){\n <div class=\"nxa-drawer-menu-icon\" [innerHTML]=\"getIconHtml(item.icon)\"></div>\n }\n @else {\n <div class=\"\"></div>\n }\n <!-- Actual Entry label -->\n <nxa-text className=\"nxa-drawer-menu-label\" type=\"label\" [size]=\"{\n 'xs': 'sm',\n 'sm': 'md',\n 'md': 'md',\n 'lg': 'md',\n 'xl': 'lg',\n '2xl': 'lg'\n }\" weight=\"light\" color=\"content\">{{item.label}}</nxa-text>\n <!-- Display Badge If needed -->\n @if (!!item.badge) {\n <nxa-badge class=\"nxa-drawer-menu-badge\" [label]=\"item.badge.label\" [color]=\"item.badge.color\"\n [size]=\"item.badge.size\" [icon]=\"item.badge.icon\">\n </nxa-badge>\n }\n </a>\n }@else if(item.onClick){\n <!-- Menu Entry single line -->\n <button class=\"nxa-drawer-menu-entry nxa-click-animation\" [id]=\"item.id||''\" [routerLink]=\"item.routerLink\"\n [fragment]=\"item.fragment\" [routerLinkActive]=\"'active'\" (click)=\"item.onClick()\">\n <!-- Display icon if needed or placeholder-->\n @if(!!item.icon){\n <div class=\"nxa-drawer-menu-icon\" [innerHTML]=\"getIconHtml(item.icon)\"></div>\n }\n @else {\n <div class=\"\"></div>\n }\n <!-- Actual Entry label -->\n <nxa-text className=\"nxa-drawer-menu-label\" type=\"label\" [size]=\"{\n 'xs': 'sm',\n 'sm': 'md',\n 'md': 'md',\n 'lg': 'md',\n 'xl': 'lg',\n '2xl': 'lg'\n }\" weight=\"light\" color=\"content\">{{item.label}}</nxa-text>\n <!-- Display Badge If needed -->\n @if (!!item.badge) {\n <nxa-badge class=\"nxa-drawer-menu-badge\" [label]=\"item.badge.label\" [color]=\"item.badge.color\"\n [size]=\"item.badge.size\" [icon]=\"item.badge.icon\">\n </nxa-badge>\n }\n </button>\n }\n @else{\n <!-- Menu section Subentries (recursive) -->\n <nxa-expansion-panel [isOpen]=\"item.defaultOpen || false\" className=\"mx-0\" classBody=\"px-0\">\n <div expansion-header class=\"nxa-drawer-menu-expansion h-10 pointer-events-auto\">\n <!-- Display icon if needed or placeholder-->\n @if(!!item.icon){\n <div class=\"nxa-drawer-menu-icon\" [innerHTML]=\"getIconHtml(item.icon)\">\n </div>\n }@else {\n <div class=\"\"></div>\n }\n <!-- Actual Entry label -->\n <nxa-text className=\"nxa-drawer-menu-label\" type=\"label\" size=\"md\">{{item.label}}</nxa-text>\n <!-- Display Badge If needed -->\n @if (!!item.badge) {\n <nxa-badge class=\"nxa-drawer-menu-badge\" [label]=\"item.badge.label\" [color]=\"item.badge.color\"\n [size]=\"item.badge.size\" [icon]=\"item.badge.icon\">\n </nxa-badge>\n }\n </div>\n <div expansion-body>\n <ul>\n @for (subItem of item.subEntries; track $index) {\n <ng-container *ngTemplateOutlet=\"renderMenuEntry; context: { $implicit: subItem }\"></ng-container>\n }\n </ul>\n </div>\n </nxa-expansion-panel>\n }\n</ng-template>" }]
|
|
2868
|
+
}], propDecorators: { headerContent: [{
|
|
2869
|
+
type: Input
|
|
2870
|
+
}], footerContent: [{
|
|
2871
|
+
type: Input
|
|
2872
|
+
}], menuEntries: [{
|
|
2873
|
+
type: Input
|
|
2874
|
+
}], className: [{
|
|
2875
|
+
type: Input
|
|
2876
|
+
}] } });
|
|
2877
|
+
|
|
2878
|
+
class NxaProgressApiCall {
|
|
2879
|
+
loadingService = inject(NxaLoadingService);
|
|
2880
|
+
isLoading = toSignal(this.loadingService.isLoading$);
|
|
2881
|
+
get hidden() {
|
|
2882
|
+
return !this.isLoading();
|
|
2883
|
+
}
|
|
2884
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaProgressApiCall, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2885
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.5", type: NxaProgressApiCall, isStandalone: true, selector: "nxa-progress-api-call", host: { properties: { "class.hidden": "this.hidden" } }, ngImport: i0, template: "<progress class=\"progress w-full progress-accent\"></progress>" });
|
|
2886
|
+
}
|
|
2887
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaProgressApiCall, decorators: [{
|
|
2888
|
+
type: Component,
|
|
2889
|
+
args: [{ selector: 'nxa-progress-api-call', template: "<progress class=\"progress w-full progress-accent\"></progress>" }]
|
|
2890
|
+
}], propDecorators: { hidden: [{
|
|
2891
|
+
type: HostBinding,
|
|
2892
|
+
args: ['class.hidden']
|
|
2893
|
+
}] } });
|
|
2894
|
+
|
|
2895
|
+
class NxaToast extends NxaOverlayBaseMixin(class {
|
|
2896
|
+
}) {
|
|
2897
|
+
isVisible = signal(true, ...(ngDevMode ? [{ debugName: "isVisible" }] : []));
|
|
2898
|
+
ngOnInit() {
|
|
2899
|
+
// Initialization logic here if needed
|
|
2900
|
+
}
|
|
2901
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaToast, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2902
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.5", type: NxaToast, isStandalone: true, selector: "nxa-toast", host: { classAttribute: "block min-h-0 basis-fit h-fit flex-1 max-h-full w-full max-w-full inset-0 box-border" }, usesInheritance: true, ngImport: i0, template: "<div class=\"transition-transform duration-200\" [class.translate-x-[100%]]=\"!isVisible()\">\n <div class=\"alert\" [ngClass]=\"{\n 'alert-info':overlayData.color==='info',\n 'alert-success':overlayData.color==='success',\n 'alert-warning':overlayData.color==='warning',\n 'alert-error':overlayData.color==='error',\n }\">\n <ng-icon name=\"bootstrapInfoCircle\"></ng-icon>\n <span>{{overlayData.title}}</span>\n <span>{{overlayData.message}}</span>\n </div>\n</div>", dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], viewProviders: [provideIcons({ bootstrapInfoCircle })] });
|
|
2903
|
+
}
|
|
2904
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaToast, decorators: [{
|
|
2905
|
+
type: Component,
|
|
2906
|
+
args: [{ selector: 'nxa-toast', viewProviders: [provideIcons({ bootstrapInfoCircle })], imports: [NgIcon, CommonModule], host: {
|
|
2907
|
+
class: `${NXA_HOST_BLOCK}`
|
|
2908
|
+
}, template: "<div class=\"transition-transform duration-200\" [class.translate-x-[100%]]=\"!isVisible()\">\n <div class=\"alert\" [ngClass]=\"{\n 'alert-info':overlayData.color==='info',\n 'alert-success':overlayData.color==='success',\n 'alert-warning':overlayData.color==='warning',\n 'alert-error':overlayData.color==='error',\n }\">\n <ng-icon name=\"bootstrapInfoCircle\"></ng-icon>\n <span>{{overlayData.title}}</span>\n <span>{{overlayData.message}}</span>\n </div>\n</div>" }]
|
|
2909
|
+
}] });
|
|
2910
|
+
|
|
2911
|
+
class NxaTooltip {
|
|
2912
|
+
// tooltipMessage
|
|
2913
|
+
_tooltipMessage = signal('', ...(ngDevMode ? [{ debugName: "_tooltipMessage" }] : []));
|
|
2914
|
+
set tooltipMessage(value) {
|
|
2915
|
+
this._tooltipMessage.set(value ?? '');
|
|
2916
|
+
}
|
|
2917
|
+
get tooltipMessage() {
|
|
2918
|
+
return this._tooltipMessage();
|
|
2919
|
+
}
|
|
2920
|
+
// anchorId
|
|
2921
|
+
_anchorId = signal('', ...(ngDevMode ? [{ debugName: "_anchorId" }] : []));
|
|
2922
|
+
set anchorId(value) {
|
|
2923
|
+
this._anchorId.set(value ?? '');
|
|
2924
|
+
}
|
|
2925
|
+
get anchorId() {
|
|
2926
|
+
return this._anchorId();
|
|
2927
|
+
}
|
|
2928
|
+
tooltipRef = viewChild.required('tooltip');
|
|
2929
|
+
setAnchorEffect = effect(() => {
|
|
2930
|
+
const anchorId = this._anchorId();
|
|
2931
|
+
if (anchorId) {
|
|
2932
|
+
const anchorElement = document.getElementById(anchorId);
|
|
2933
|
+
if (anchorElement && this.tooltipRef()) {
|
|
2934
|
+
const rect = anchorElement.getBoundingClientRect();
|
|
2935
|
+
this.tooltipRef().style.position = 'absolute';
|
|
2936
|
+
this.tooltipRef().style.overflowAnchor = anchorId;
|
|
2937
|
+
this.tooltipRef().style.top = `${rect.bottom + window.scrollY}px`;
|
|
2938
|
+
this.tooltipRef().style.left = `${rect.left + window.scrollX}px`;
|
|
2939
|
+
}
|
|
2940
|
+
}
|
|
2941
|
+
}, ...(ngDevMode ? [{ debugName: "setAnchorEffect" }] : []));
|
|
2942
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaTooltip, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2943
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.1.5", type: NxaTooltip, isStandalone: true, selector: "nxa-tooltip", inputs: { tooltipMessage: "tooltipMessage", anchorId: "anchorId" }, host: { classAttribute: "contents" }, viewQueries: [{ propertyName: "tooltipRef", first: true, predicate: ["tooltip"], descendants: true, isSignal: true }], ngImport: i0, template: "<nxa-text type=\"caption\" className=\"tooltip-primary p-2 rounded-md absolute z-[999]\" #tooltip>\n {{ _tooltipMessage() }}\n</nxa-text>", dependencies: [{ kind: "component", type: NxaText, selector: "nxa-text", inputs: ["for", "type", "size", "weight", "italic", "color", "className"] }] });
|
|
2944
|
+
}
|
|
2945
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaTooltip, decorators: [{
|
|
2946
|
+
type: Component,
|
|
2947
|
+
args: [{ selector: 'nxa-tooltip', host: {
|
|
2948
|
+
class: NXA_HOST_CONTENTS_ONLY
|
|
2949
|
+
}, imports: [NxaText], template: "<nxa-text type=\"caption\" className=\"tooltip-primary p-2 rounded-md absolute z-[999]\" #tooltip>\n {{ _tooltipMessage() }}\n</nxa-text>" }]
|
|
2950
|
+
}], propDecorators: { tooltipMessage: [{
|
|
2951
|
+
type: Input
|
|
2952
|
+
}], anchorId: [{
|
|
2953
|
+
type: Input
|
|
2954
|
+
}], tooltipRef: [{ type: i0.ViewChild, args: ['tooltip', { isSignal: true }] }] } });
|
|
2955
|
+
|
|
2956
|
+
class NxaTooltipDirective {
|
|
2957
|
+
viewContainerRef = inject(ViewContainerRef);
|
|
2958
|
+
tooltipComponentRef;
|
|
2959
|
+
// Signals for inputs
|
|
2960
|
+
_anchorId = signal(null, ...(ngDevMode ? [{ debugName: "_anchorId" }] : []));
|
|
2961
|
+
_tooltipMessage = signal(null, ...(ngDevMode ? [{ debugName: "_tooltipMessage" }] : []));
|
|
2962
|
+
_direction = signal(null, ...(ngDevMode ? [{ debugName: "_direction" }] : []));
|
|
2963
|
+
set anchorId(value) {
|
|
2964
|
+
this._anchorId.set(value);
|
|
2965
|
+
}
|
|
2966
|
+
get anchorId() {
|
|
2967
|
+
return this._anchorId();
|
|
2968
|
+
}
|
|
2969
|
+
set tooltipMessage(value) {
|
|
2970
|
+
this._tooltipMessage.set(value);
|
|
2971
|
+
}
|
|
2972
|
+
get tooltipMessage() {
|
|
2973
|
+
return this._tooltipMessage();
|
|
2974
|
+
}
|
|
2975
|
+
set direction(value) {
|
|
2976
|
+
this._direction.set(value);
|
|
2977
|
+
}
|
|
2978
|
+
get direction() {
|
|
2979
|
+
return this._direction();
|
|
2980
|
+
}
|
|
2981
|
+
_relativeClass = true;
|
|
2982
|
+
onMouseEnter() {
|
|
2983
|
+
this.viewContainerRef.clear();
|
|
2984
|
+
this.tooltipComponentRef = this.viewContainerRef.createComponent(NxaTooltip);
|
|
2985
|
+
if (this._tooltipMessage())
|
|
2986
|
+
this.tooltipComponentRef.instance.tooltipMessage = this._tooltipMessage();
|
|
2987
|
+
}
|
|
2988
|
+
onMouseLeave() {
|
|
2989
|
+
if (this.tooltipComponentRef) {
|
|
2990
|
+
this.tooltipComponentRef.destroy();
|
|
2991
|
+
this.tooltipComponentRef = undefined;
|
|
2992
|
+
}
|
|
2993
|
+
}
|
|
2994
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaTooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2995
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.5", type: NxaTooltipDirective, isStandalone: true, selector: "[nxaTooltip]", inputs: { anchorId: "anchorId", tooltipMessage: "tooltipMessage", direction: "direction" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()" }, properties: { "class.relative": "this._relativeClass" } }, ngImport: i0 });
|
|
2996
|
+
}
|
|
2997
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaTooltipDirective, decorators: [{
|
|
2998
|
+
type: Directive,
|
|
2999
|
+
args: [{
|
|
3000
|
+
selector: '[nxaTooltip]'
|
|
3001
|
+
}]
|
|
3002
|
+
}], propDecorators: { anchorId: [{
|
|
3003
|
+
type: Input
|
|
3004
|
+
}], tooltipMessage: [{
|
|
3005
|
+
type: Input
|
|
3006
|
+
}], direction: [{
|
|
3007
|
+
type: Input
|
|
3008
|
+
}], _relativeClass: [{
|
|
3009
|
+
type: HostBinding,
|
|
3010
|
+
args: ['class.relative']
|
|
3011
|
+
}], onMouseEnter: [{
|
|
3012
|
+
type: HostListener,
|
|
3013
|
+
args: ['mouseenter']
|
|
3014
|
+
}], onMouseLeave: [{
|
|
3015
|
+
type: HostListener,
|
|
3016
|
+
args: ['mouseleave']
|
|
3017
|
+
}] } });
|
|
3018
|
+
|
|
3019
|
+
class NxaNavbar extends WithClassNameMixin(class {
|
|
3020
|
+
}) {
|
|
3021
|
+
_leadingTemplate = signal(null, ...(ngDevMode ? [{ debugName: "_leadingTemplate" }] : []));
|
|
3022
|
+
set leadingTemplate(value) {
|
|
3023
|
+
this._leadingTemplate.set(value);
|
|
3024
|
+
}
|
|
3025
|
+
get leadingTemplate() {
|
|
3026
|
+
return this._leadingTemplate();
|
|
3027
|
+
}
|
|
3028
|
+
_contentTemplate = signal(null, ...(ngDevMode ? [{ debugName: "_contentTemplate" }] : []));
|
|
3029
|
+
set contentTemplate(value) {
|
|
3030
|
+
this._contentTemplate.set(value);
|
|
3031
|
+
}
|
|
3032
|
+
get contentTemplate() {
|
|
3033
|
+
return this._contentTemplate();
|
|
3034
|
+
}
|
|
3035
|
+
_trailingTemplate = signal(null, ...(ngDevMode ? [{ debugName: "_trailingTemplate" }] : []));
|
|
3036
|
+
set trailingTemplate(value) {
|
|
3037
|
+
this._trailingTemplate.set(value);
|
|
3038
|
+
}
|
|
3039
|
+
get trailingTemplate() {
|
|
3040
|
+
return this._trailingTemplate();
|
|
3041
|
+
}
|
|
3042
|
+
set className(value) {
|
|
3043
|
+
this._className.set(value);
|
|
3044
|
+
}
|
|
3045
|
+
get className() {
|
|
3046
|
+
return this._className();
|
|
3047
|
+
}
|
|
3048
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaNavbar, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
3049
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.5", type: NxaNavbar, isStandalone: true, selector: "nxa-navbar", inputs: { leadingTemplate: "leadingTemplate", contentTemplate: "contentTemplate", trailingTemplate: "trailingTemplate", className: "className" }, usesInheritance: true, ngImport: i0, template: "<div class=\"navbar shadow-xl\" [ngClass]=\"_classNameObject()\">\n <div class=\"navbar-start\">\n @if(!!_leadingTemplate()){\n <ng-container [ngTemplateOutlet]=\"_leadingTemplate()!\"></ng-container>\n }@else {\n <ng-content select=\"[leading]\"></ng-content>\n }\n </div>\n <div class=\"navbar-center\">\n @if(!!_contentTemplate()){\n <ng-container [ngTemplateOutlet]=\"_contentTemplate()!\"></ng-container>\n }@else {\n <ng-content select=\"[content]\"></ng-content>\n }\n </div>\n <div class=\"navbar-end\">\n @if(!!_trailingTemplate()){\n <ng-container [ngTemplateOutlet]=\"_trailingTemplate()!\"></ng-container>\n }@else {\n <ng-content select=\"[trailing]\"></ng-content>\n }\n </div>\n</div>\n<div class=\"relative inset-0 h-1\">\n <nxa-progress-api-call class=\"absolute w-full top-0 bottom-0\"></nxa-progress-api-call>\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: NxaProgressApiCall, selector: "nxa-progress-api-call" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
3050
|
+
}
|
|
3051
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaNavbar, decorators: [{
|
|
3052
|
+
type: Component,
|
|
3053
|
+
args: [{ selector: 'nxa-navbar', encapsulation: ViewEncapsulation.None, imports: [CommonModule, NxaProgressApiCall], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"navbar shadow-xl\" [ngClass]=\"_classNameObject()\">\n <div class=\"navbar-start\">\n @if(!!_leadingTemplate()){\n <ng-container [ngTemplateOutlet]=\"_leadingTemplate()!\"></ng-container>\n }@else {\n <ng-content select=\"[leading]\"></ng-content>\n }\n </div>\n <div class=\"navbar-center\">\n @if(!!_contentTemplate()){\n <ng-container [ngTemplateOutlet]=\"_contentTemplate()!\"></ng-container>\n }@else {\n <ng-content select=\"[content]\"></ng-content>\n }\n </div>\n <div class=\"navbar-end\">\n @if(!!_trailingTemplate()){\n <ng-container [ngTemplateOutlet]=\"_trailingTemplate()!\"></ng-container>\n }@else {\n <ng-content select=\"[trailing]\"></ng-content>\n }\n </div>\n</div>\n<div class=\"relative inset-0 h-1\">\n <nxa-progress-api-call class=\"absolute w-full top-0 bottom-0\"></nxa-progress-api-call>\n</div>" }]
|
|
3054
|
+
}], propDecorators: { leadingTemplate: [{
|
|
3055
|
+
type: Input
|
|
3056
|
+
}], contentTemplate: [{
|
|
3057
|
+
type: Input
|
|
3058
|
+
}], trailingTemplate: [{
|
|
3059
|
+
type: Input
|
|
3060
|
+
}], className: [{
|
|
3061
|
+
type: Input
|
|
3062
|
+
}] } });
|
|
3063
|
+
|
|
3064
|
+
const BREAKPOINT_ORDER = {
|
|
3065
|
+
xs: 0,
|
|
3066
|
+
sm: 1,
|
|
3067
|
+
md: 2,
|
|
3068
|
+
lg: 3,
|
|
3069
|
+
xl: 4,
|
|
3070
|
+
'2xl': 5,
|
|
3071
|
+
};
|
|
3072
|
+
class NxaPage extends WithClassNameMixin(WithClassBodyMixin(class {
|
|
3073
|
+
})) {
|
|
3074
|
+
//#region Injection
|
|
3075
|
+
/**
|
|
3076
|
+
*
|
|
3077
|
+
*/
|
|
3078
|
+
drawerService = inject(NxaDrawerService);
|
|
3079
|
+
layoutService = inject(NxaLayoutService);
|
|
3080
|
+
nxaBreakpoints = inject(NXA_BREAKPOINTS);
|
|
3081
|
+
//#endregion
|
|
3082
|
+
//#region State
|
|
3083
|
+
_isRoot = signal(false, ...(ngDevMode ? [{ debugName: "_isRoot" }] : []));
|
|
3084
|
+
_drawer = signal(null, ...(ngDevMode ? [{ debugName: "_drawer" }] : []));
|
|
3085
|
+
_navBar = signal(null, ...(ngDevMode ? [{ debugName: "_navBar" }] : []));
|
|
3086
|
+
_contentFooter = signal(null, ...(ngDevMode ? [{ debugName: "_contentFooter" }] : []));
|
|
3087
|
+
_pageFooter = signal(null, ...(ngDevMode ? [{ debugName: "_pageFooter" }] : []));
|
|
3088
|
+
_sidebar = signal(null, ...(ngDevMode ? [{ debugName: "_sidebar" }] : []));
|
|
3089
|
+
_drawerId = signal('nxa-drawer', ...(ngDevMode ? [{ debugName: "_drawerId" }] : []));
|
|
3090
|
+
_drawerDefaultOpen = signal(true, ...(ngDevMode ? [{ debugName: "_drawerDefaultOpen" }] : []));
|
|
3091
|
+
_overlayFrom = signal('md', ...(ngDevMode ? [{ debugName: "_overlayFrom" }] : []));
|
|
3092
|
+
_currentBreakpoint = toSignal(this.layoutService.breakpoint$);
|
|
3093
|
+
_oldBreakpoint = signal('md', ...(ngDevMode ? [{ debugName: "_oldBreakpoint" }] : []));
|
|
3094
|
+
// protected _drawerRef = viewChild<ElementRef>("drawer");
|
|
3095
|
+
// protected _contentRef = viewChild<ElementRef>("content");
|
|
3096
|
+
// protected _enforceMaxWidth= signal<boolean>(true);
|
|
3097
|
+
// protected _updateContentWidth=effect(()=>{
|
|
3098
|
+
// const enforcedWidth = this._enforceMaxWidth();
|
|
3099
|
+
// const drawerState = this._drawerState()
|
|
3100
|
+
// if(!enforcedWidth) return;
|
|
3101
|
+
// const drawerEl = (this._drawerRef()?.nativeElement as HTMLElement);
|
|
3102
|
+
// const contentEl = (this._contentRef()?.nativeElement as HTMLElement);
|
|
3103
|
+
// if (!drawerEl || !contentEl) return;
|
|
3104
|
+
// const drawerWidth = drawerState?.state == 'OPEN' ? drawerEl.clientWidth : 0;
|
|
3105
|
+
// contentEl.style.maxWidth=`calc(100% - ${drawerWidth}px)`;
|
|
3106
|
+
// });
|
|
3107
|
+
_isOverlay = computed(() => {
|
|
3108
|
+
const current = this._currentBreakpoint();
|
|
3109
|
+
if (!current)
|
|
3110
|
+
return false; // no value yet
|
|
3111
|
+
return (BREAKPOINT_ORDER[current] < BREAKPOINT_ORDER[this._overlayFrom()]);
|
|
3112
|
+
}, ...(ngDevMode ? [{ debugName: "_isOverlay" }] : []));
|
|
3113
|
+
_computedNgClasses = computed(() => {
|
|
3114
|
+
return {
|
|
3115
|
+
...this._classNameObject(),
|
|
3116
|
+
'is-root': this._isRoot(),
|
|
3117
|
+
'nxa-drawer-overlay': this._isOverlay(),
|
|
3118
|
+
};
|
|
3119
|
+
}, ...(ngDevMode ? [{ debugName: "_computedNgClasses" }] : []));
|
|
3120
|
+
/**
|
|
3121
|
+
* fetch drawer state for this drawer
|
|
3122
|
+
*/
|
|
3123
|
+
_drawerState$;
|
|
3124
|
+
/**
|
|
3125
|
+
* fetch drawe state for this drawer again
|
|
3126
|
+
*/
|
|
3127
|
+
_drawerState = toSignal(toObservable(this._drawerId).pipe(switchMap(x => this.drawerService.getDrawerState$(x))));
|
|
3128
|
+
//#endregion
|
|
3129
|
+
//#region inputs
|
|
3130
|
+
set className(value) {
|
|
3131
|
+
this._className.set(value);
|
|
3132
|
+
}
|
|
3133
|
+
get className() {
|
|
3134
|
+
return this._className();
|
|
3135
|
+
}
|
|
3136
|
+
set classBody(value) {
|
|
3137
|
+
this._classBody.set(value);
|
|
3138
|
+
}
|
|
3139
|
+
get classBody() {
|
|
3140
|
+
return this._classBody();
|
|
3141
|
+
}
|
|
3142
|
+
// @Input() public set enforceMaxWidth(value:boolean){
|
|
3143
|
+
// this._enforceMaxWidth.set(value);
|
|
3144
|
+
// }
|
|
3145
|
+
// public get enforceMaxWidth():boolean{
|
|
3146
|
+
// return this._enforceMaxWidth();
|
|
3147
|
+
// }
|
|
3148
|
+
/**
|
|
3149
|
+
* if this page is root of the website page,
|
|
3150
|
+
* set true if it's the base container of the app
|
|
3151
|
+
*/
|
|
3152
|
+
set root(value) {
|
|
3153
|
+
this._isRoot.set(value);
|
|
3154
|
+
}
|
|
3155
|
+
;
|
|
3156
|
+
/**
|
|
3157
|
+
* drawer layout to display
|
|
3158
|
+
*/
|
|
3159
|
+
set drawerTemplate(value) {
|
|
3160
|
+
this._drawer.set(value);
|
|
3161
|
+
}
|
|
3162
|
+
/**
|
|
3163
|
+
* navbar to display
|
|
3164
|
+
*/
|
|
3165
|
+
set navBarTemplate(value) {
|
|
3166
|
+
this._navBar.set(value);
|
|
3167
|
+
}
|
|
3168
|
+
/**
|
|
3169
|
+
* footer for content
|
|
3170
|
+
*/
|
|
3171
|
+
set contentFooterTemplate(value) {
|
|
3172
|
+
this._contentFooter.set(value);
|
|
3173
|
+
}
|
|
3174
|
+
/**
|
|
3175
|
+
* footer for the entire page
|
|
3176
|
+
*/
|
|
3177
|
+
set pageFooterTemplate(value) {
|
|
3178
|
+
this._pageFooter.set(value);
|
|
3179
|
+
}
|
|
3180
|
+
/**
|
|
3181
|
+
* sidenav on the side of the page
|
|
3182
|
+
*/
|
|
3183
|
+
set sidebarTemplate(value) {
|
|
3184
|
+
this._sidebar.set(value);
|
|
3185
|
+
}
|
|
3186
|
+
;
|
|
3187
|
+
/**
|
|
3188
|
+
*
|
|
3189
|
+
*/
|
|
3190
|
+
set drawerId(value) {
|
|
3191
|
+
this._drawerId.set(value);
|
|
3192
|
+
}
|
|
3193
|
+
;
|
|
3194
|
+
set drawerDefaultOpen(value) {
|
|
3195
|
+
this._drawerDefaultOpen.set(value);
|
|
3196
|
+
}
|
|
3197
|
+
set overlayFrom(value) {
|
|
3198
|
+
this._overlayFrom.set(value);
|
|
3199
|
+
}
|
|
3200
|
+
//#endregion
|
|
3201
|
+
ngOnInit() {
|
|
3202
|
+
const isOpen = (this.layoutService.current === "lg" || this.layoutService.current === "xl" || this.layoutService.current === "2xl") && this._drawerDefaultOpen();
|
|
3203
|
+
this.drawerService.registerDrawer({ id: this._drawerId(), state: isOpen ? 'OPEN' : 'CLOSE', side: 'LEFT' });
|
|
3204
|
+
this._drawerState$ = this.drawerService.getDrawerState$(this._drawerId());
|
|
3205
|
+
}
|
|
3206
|
+
ngOnDestroy() {
|
|
3207
|
+
this.drawerService.unregisterDrawer(this._drawerId());
|
|
3208
|
+
}
|
|
3209
|
+
/**
|
|
3210
|
+
* handle changes in the value of the checkbox
|
|
3211
|
+
* this sync the state between daisy ui component and service status
|
|
3212
|
+
* @param event
|
|
3213
|
+
*/
|
|
3214
|
+
valueChange(event) {
|
|
3215
|
+
const checked = event.target.checked;
|
|
3216
|
+
this.drawerService.updateDrawerState({ ...this._drawerState(), state: checked ? "OPEN" : "CLOSE", side: 'LEFT' });
|
|
3217
|
+
}
|
|
3218
|
+
closeDrawer() {
|
|
3219
|
+
this.drawerService.updateDrawerState({ ...this._drawerState(), state: "CLOSE" });
|
|
3220
|
+
}
|
|
3221
|
+
/**
|
|
3222
|
+
* handle the injection on host element of class root
|
|
3223
|
+
* this is needed to allow the switch of style if root page
|
|
3224
|
+
* */
|
|
3225
|
+
get isRoot() {
|
|
3226
|
+
return this._isRoot();
|
|
3227
|
+
}
|
|
3228
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaPage, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
3229
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.5", type: NxaPage, isStandalone: true, selector: "nxa-page", inputs: { className: "className", classBody: "classBody", root: "root", drawerTemplate: "drawerTemplate", navBarTemplate: "navBarTemplate", contentFooterTemplate: "contentFooterTemplate", pageFooterTemplate: "pageFooterTemplate", sidebarTemplate: "sidebarTemplate", drawerId: "drawerId", drawerDefaultOpen: "drawerDefaultOpen", overlayFrom: "overlayFrom" }, host: { properties: { "class.is-root": "this.isRoot" }, classAttribute: "w-full h-full min-h-0 flex flex-col flex-1" }, usesInheritance: true, ngImport: i0, template: "<div class=\"nxa-page\" [ngClass]=\"_computedNgClasses()\">\n\n <div class=\"nxa-page-content-container\">\n\n <!-- Navbar Slot -->\n @if(!!_navBar()){\n <ng-container *ngTemplateOutlet=\"_navBar()!\"></ng-container>\n }@else{\n <ng-content select=\"[navbar]\"></ng-content>\n }\n <!-- Content Slot -->\n <div class=\"nxa-page-content\" #content>\n <div class=\"nxa-content\" [ngClass]=\"_classBody()\">\n <ng-content></ng-content>\n </div>\n <div class=\"nxa-page-sidenav-container\">\n <!-- Sidebar slot -->\n @if(!!_sidebar()){\n <ng-container [ngTemplateOutlet]=\"_sidebar()!\"></ng-container>\n }@else{\n <ng-content select=\"[sidenav]\"></ng-content>\n }\n </div>\n </div>\n <!-- Content Footer Slot -->\n <div class=\"grow-0 w-full h-fit\">\n @if(!!_contentFooter()){\n <ng-container *ngTemplateOutlet=\"_contentFooter()!\"></ng-container>\n }@else{\n <ng-content select=\"[content-footer]\"></ng-content>\n }\n </div>\n </div>\n @if (_isOverlay() && _drawerState()?.state === 'OPEN') {\n <div class=\"nxa-drawer-backdrop\" tabindex=\"0\" (click)=\"closeDrawer()\" (keydown.enter)=\"closeDrawer()\">\n </div>\n }\n <!-- Drawer Content Slot-->\n <div class=\"nxa-drawer-container\" #drawer [ngClass]=\"{\n 'nxa-drawer-open':_drawerState()?.state==='OPEN',\n 'nxa-drawer-close':_drawerState()?.state==='CLOSE',\n 'nxa-drawer-overlay':_isOverlay(),\n }\n \">\n @if(!!_drawer()){\n <ng-container *ngTemplateOutlet=\"_drawer()!\"></ng-container>\n }@else{\n <ng-content select=\"[drawer]\"></ng-content>\n }\n\n </div>\n</div>\n<!-- Full page Footer Slot-->\n<div class=\"nxa-page-footer\">\n @if(!!_pageFooter()){\n <ng-container *ngTemplateOutlet=\"_pageFooter()!\"></ng-container>\n\n }@else{\n <ng-content select=\"[page-footer]\"></ng-content>\n }\n</div>", styles: ["@layer properties;.nxa-page-sidenav-container{display:block;width:fit-content;min-width:calc(var(--spacing, .25rem) * 0);flex:none}.nxa-content{width:100%}.nxa-page{position:relative;display:flex;height:100%;min-height:calc(var(--spacing, .25rem) * 0);width:100%;max-width:100%;flex:1;flex-basis:100%;flex-direction:row-reverse;overflow:hidden}.nxa-page.is-root{height:100dvh;width:100dvw}.nxa-page .nxa-drawer-backdrop{position:absolute;top:calc(var(--spacing, .25rem) * 0);right:calc(var(--spacing, .25rem) * 0);bottom:calc(var(--spacing, .25rem) * 0);left:calc(var(--spacing, .25rem) * 0);cursor:pointer;background-color:var(--color-base-300);opacity:75%}.nxa-page .nxa-page-content-container{z-index:0;display:flex;min-height:calc(var(--spacing, .25rem) * 0);width:100%;min-width:calc(var(--spacing, .25rem) * 0);flex:1;flex-basis:100%;flex-direction:column}.nxa-page .nxa-page-content{z-index:0;display:flex;height:100%;min-height:calc(var(--spacing, .25rem) * 0);min-width:calc(var(--spacing, .25rem) * 0);flex:1;flex-basis:100%}.nxa-page .nxa-page-content .nxa-content{display:flex;height:100%;min-height:calc(var(--spacing, .25rem) * 0);min-width:calc(var(--spacing, .25rem) * 0);flex:1;flex-basis:100%}.nxa-drawer-container{inset-inline-start:calc(var(--spacing, .25rem) * 0);top:calc(var(--spacing, .25rem) * 0);bottom:calc(var(--spacing, .25rem) * 0);z-index:10;min-height:100%;max-width:fit-content;background-color:var(--color-base-200);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function, cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration, var(--default-transition-duration, .15s));--tw-duration: .3s;transition-duration:.3s;--tw-ease: var(--ease-in-out, cubic-bezier(.4, 0, .2, 1));transition-timing-function:var(--ease-in-out, cubic-bezier(.4, 0, .2, 1))}.nxa-drawer-container.nxa-drawer-overlay{position:absolute;inset-inline-start:calc(var(--spacing, .25rem) * 0);top:calc(var(--spacing, .25rem) * 0)}.nxa-drawer-container.nxa-drawer-open{pointer-events:auto;height:100%;width:fit-content;min-width:fit-content;--tw-translate-x: calc(var(--spacing, .25rem) * 0);translate:var(--tw-translate-x) var(--tw-translate-y);opacity:100%}.nxa-drawer-container.nxa-drawer-close{pointer-events:none;z-index:50;min-width:calc(var(--spacing, .25rem) * 0);opacity:0%;transition-delay:0s,0s,.3s,ease-out}.nxa-drawer-container.nxa-drawer-close:where(:dir(ltr),[dir=ltr],[dir=ltr] *){--tw-translate-x: -100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.nxa-drawer-container.nxa-drawer-close:where(:dir(rtl),[dir=rtl],[dir=rtl] *){--tw-translate-x: 100%;translate:var(--tw-translate-x) var(--tw-translate-y)}@layer base{:where(:root),:root:has(input.theme-controller[value=light]:checked),[data-theme=light]{color-scheme:light;--color-base-100: oklch(100% 0 0);--color-base-200: oklch(98% 0 0);--color-base-300: oklch(95% 0 0);--color-base-content: oklch(21% .006 285.885);--color-primary: oklch(45% .24 277.023);--color-primary-content: oklch(93% .034 272.788);--color-secondary: oklch(65% .241 354.308);--color-secondary-content: oklch(94% .028 342.258);--color-accent: oklch(77% .152 181.912);--color-accent-content: oklch(38% .063 188.416);--color-neutral: oklch(14% .005 285.823);--color-neutral-content: oklch(92% .004 286.32);--color-info: oklch(74% .16 232.661);--color-info-content: oklch(29% .066 243.157);--color-success: oklch(76% .177 163.223);--color-success-content: oklch(37% .077 168.94);--color-warning: oklch(82% .189 84.429);--color-warning-content: oklch(41% .112 45.904);--color-error: oklch(71% .194 13.428);--color-error-content: oklch(27% .105 12.094);--radius-selector: .5rem;--radius-field: .25rem;--radius-box: .5rem;--size-selector: .25rem;--size-field: .25rem;--border: 1px;--depth: 1;--noise: 0}}@layer base{@media(prefers-color-scheme:dark){:root:not([data-theme]){color-scheme:dark;--color-base-100: oklch(25.33% .016 252.42);--color-base-200: oklch(23.26% .014 253.1);--color-base-300: oklch(21.15% .012 254.09);--color-base-content: oklch(97.807% .029 256.847);--color-primary: oklch(58% .233 277.117);--color-primary-content: oklch(96% .018 272.314);--color-secondary: oklch(65% .241 354.308);--color-secondary-content: oklch(94% .028 342.258);--color-accent: oklch(77% .152 181.912);--color-accent-content: oklch(38% .063 188.416);--color-neutral: oklch(14% .005 285.823);--color-neutral-content: oklch(92% .004 286.32);--color-info: oklch(74% .16 232.661);--color-info-content: oklch(29% .066 243.157);--color-success: oklch(76% .177 163.223);--color-success-content: oklch(37% .077 168.94);--color-warning: oklch(82% .189 84.429);--color-warning-content: oklch(41% .112 45.904);--color-error: oklch(71% .194 13.428);--color-error-content: oklch(27% .105 12.094);--radius-selector: .5rem;--radius-field: .25rem;--radius-box: .5rem;--size-selector: .25rem;--size-field: .25rem;--border: 1px;--depth: 1;--noise: 0}}}@layer base{:root:has(input.theme-controller[value=light]:checked),[data-theme=light]{color-scheme:light;--color-base-100: oklch(100% 0 0);--color-base-200: oklch(98% 0 0);--color-base-300: oklch(95% 0 0);--color-base-content: oklch(21% .006 285.885);--color-primary: oklch(45% .24 277.023);--color-primary-content: oklch(93% .034 272.788);--color-secondary: oklch(65% .241 354.308);--color-secondary-content: oklch(94% .028 342.258);--color-accent: oklch(77% .152 181.912);--color-accent-content: oklch(38% .063 188.416);--color-neutral: oklch(14% .005 285.823);--color-neutral-content: oklch(92% .004 286.32);--color-info: oklch(74% .16 232.661);--color-info-content: oklch(29% .066 243.157);--color-success: oklch(76% .177 163.223);--color-success-content: oklch(37% .077 168.94);--color-warning: oklch(82% .189 84.429);--color-warning-content: oklch(41% .112 45.904);--color-error: oklch(71% .194 13.428);--color-error-content: oklch(27% .105 12.094);--radius-selector: .5rem;--radius-field: .25rem;--radius-box: .5rem;--size-selector: .25rem;--size-field: .25rem;--border: 1px;--depth: 1;--noise: 0}}@layer base{:root:has(input.theme-controller[value=dark]:checked),[data-theme=dark]{color-scheme:dark;--color-base-100: oklch(25.33% .016 252.42);--color-base-200: oklch(23.26% .014 253.1);--color-base-300: oklch(21.15% .012 254.09);--color-base-content: oklch(97.807% .029 256.847);--color-primary: oklch(58% .233 277.117);--color-primary-content: oklch(96% .018 272.314);--color-secondary: oklch(65% .241 354.308);--color-secondary-content: oklch(94% .028 342.258);--color-accent: oklch(77% .152 181.912);--color-accent-content: oklch(38% .063 188.416);--color-neutral: oklch(14% .005 285.823);--color-neutral-content: oklch(92% .004 286.32);--color-info: oklch(74% .16 232.661);--color-info-content: oklch(29% .066 243.157);--color-success: oklch(76% .177 163.223);--color-success-content: oklch(37% .077 168.94);--color-warning: oklch(82% .189 84.429);--color-warning-content: oklch(41% .112 45.904);--color-error: oklch(71% .194 13.428);--color-error-content: oklch(27% .105 12.094);--radius-selector: .5rem;--radius-field: .25rem;--radius-box: .5rem;--size-selector: .25rem;--size-field: .25rem;--border: 1px;--depth: 1;--noise: 0}}@layer base{:root{--fx-noise: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.34' numOctaves='4' stitchTiles='stitch'%3E%3C/feTurbulence%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23a)' opacity='0.2'%3E%3C/rect%3E%3C/svg%3E\")}}@layer base{:root{scrollbar-color:currentColor #0000}@supports (color: color-mix(in lab,red,red)){:root{scrollbar-color:color-mix(in oklch,currentColor 35%,#0000) #0000}}}@layer base{@property --radialprogress{syntax: \"<percentage>\"; inherits: true; initial-value: 0%;}}@layer base{:root:not(span){overflow:var(--page-overflow)}}@layer base{:root{background:var(--page-scroll-bg, var(--root-bg));--page-scroll-bg-on: linear-gradient(var(--root-bg, #0000), var(--root-bg, #0000)) var(--root-bg, #0000);--page-scroll-transition-on: background-color .3s ease-out;transition:var(--page-scroll-transition);scrollbar-gutter:var(--page-scroll-gutter, unset);scrollbar-gutter:if(style(--page-has-scroll: 1): var(--page-scroll-gutter, unset) ; else: unset)}@supports (color: color-mix(in lab,red,red)){:root{--page-scroll-bg-on: linear-gradient(var(--root-bg, #0000), var(--root-bg, #0000)) color-mix(in srgb, var(--root-bg, #0000), oklch(0% 0 0) calc(var(--page-has-backdrop, 0) * 40%))}}@keyframes set-page-has-scroll{0%,to{--page-has-scroll: 1}}}@layer base{:root,[data-theme]{background:var(--page-scroll-bg, var(--root-bg));color:var(--color-base-content)}:where(:root,[data-theme]){--root-bg: var(--color-base-100)}}@keyframes rating{0%,40%{scale:1.1;filter:brightness(1.05) contrast(1.05)}}@keyframes dropdown{0%{opacity:0}}@keyframes radio{0%{padding:5px}50%{padding:3px}}@keyframes toast{0%{scale:.9;opacity:0}to{scale:1;opacity:1}}@keyframes rotator{89.9999%,to{--first-item-position: 0 0%}90%,99.9999%{--first-item-position: 0 calc(var(--items) * 100%)}to{translate:0 -100%}}@keyframes skeleton{0%{background-position:150%}to{background-position:-50%}}@keyframes menu{0%{opacity:0}}@keyframes progress{50%{background-position-x:-115%}}@property --tw-duration{syntax: \"*\"; inherits: false;}@property --tw-ease{syntax: \"*\"; inherits: false;}@property --tw-translate-x{syntax: \"*\"; inherits: false; initial-value: 0;}@property --tw-translate-y{syntax: \"*\"; inherits: false; initial-value: 0;}@property --tw-translate-z{syntax: \"*\"; inherits: false; initial-value: 0;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-duration: initial;--tw-ease: initial;--tw-translate-x: 0;--tw-translate-y: 0;--tw-translate-z: 0}}}\n/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
3230
|
+
}
|
|
3231
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaPage, decorators: [{
|
|
3232
|
+
type: Component,
|
|
3233
|
+
args: [{ selector: 'nxa-page', encapsulation: ViewEncapsulation.None, host: {
|
|
3234
|
+
class: NXA_HOST_LAYOUT
|
|
3235
|
+
}, imports: [CommonModule], template: "<div class=\"nxa-page\" [ngClass]=\"_computedNgClasses()\">\n\n <div class=\"nxa-page-content-container\">\n\n <!-- Navbar Slot -->\n @if(!!_navBar()){\n <ng-container *ngTemplateOutlet=\"_navBar()!\"></ng-container>\n }@else{\n <ng-content select=\"[navbar]\"></ng-content>\n }\n <!-- Content Slot -->\n <div class=\"nxa-page-content\" #content>\n <div class=\"nxa-content\" [ngClass]=\"_classBody()\">\n <ng-content></ng-content>\n </div>\n <div class=\"nxa-page-sidenav-container\">\n <!-- Sidebar slot -->\n @if(!!_sidebar()){\n <ng-container [ngTemplateOutlet]=\"_sidebar()!\"></ng-container>\n }@else{\n <ng-content select=\"[sidenav]\"></ng-content>\n }\n </div>\n </div>\n <!-- Content Footer Slot -->\n <div class=\"grow-0 w-full h-fit\">\n @if(!!_contentFooter()){\n <ng-container *ngTemplateOutlet=\"_contentFooter()!\"></ng-container>\n }@else{\n <ng-content select=\"[content-footer]\"></ng-content>\n }\n </div>\n </div>\n @if (_isOverlay() && _drawerState()?.state === 'OPEN') {\n <div class=\"nxa-drawer-backdrop\" tabindex=\"0\" (click)=\"closeDrawer()\" (keydown.enter)=\"closeDrawer()\">\n </div>\n }\n <!-- Drawer Content Slot-->\n <div class=\"nxa-drawer-container\" #drawer [ngClass]=\"{\n 'nxa-drawer-open':_drawerState()?.state==='OPEN',\n 'nxa-drawer-close':_drawerState()?.state==='CLOSE',\n 'nxa-drawer-overlay':_isOverlay(),\n }\n \">\n @if(!!_drawer()){\n <ng-container *ngTemplateOutlet=\"_drawer()!\"></ng-container>\n }@else{\n <ng-content select=\"[drawer]\"></ng-content>\n }\n\n </div>\n</div>\n<!-- Full page Footer Slot-->\n<div class=\"nxa-page-footer\">\n @if(!!_pageFooter()){\n <ng-container *ngTemplateOutlet=\"_pageFooter()!\"></ng-container>\n\n }@else{\n <ng-content select=\"[page-footer]\"></ng-content>\n }\n</div>", styles: ["@layer properties;.nxa-page-sidenav-container{display:block;width:fit-content;min-width:calc(var(--spacing, .25rem) * 0);flex:none}.nxa-content{width:100%}.nxa-page{position:relative;display:flex;height:100%;min-height:calc(var(--spacing, .25rem) * 0);width:100%;max-width:100%;flex:1;flex-basis:100%;flex-direction:row-reverse;overflow:hidden}.nxa-page.is-root{height:100dvh;width:100dvw}.nxa-page .nxa-drawer-backdrop{position:absolute;top:calc(var(--spacing, .25rem) * 0);right:calc(var(--spacing, .25rem) * 0);bottom:calc(var(--spacing, .25rem) * 0);left:calc(var(--spacing, .25rem) * 0);cursor:pointer;background-color:var(--color-base-300);opacity:75%}.nxa-page .nxa-page-content-container{z-index:0;display:flex;min-height:calc(var(--spacing, .25rem) * 0);width:100%;min-width:calc(var(--spacing, .25rem) * 0);flex:1;flex-basis:100%;flex-direction:column}.nxa-page .nxa-page-content{z-index:0;display:flex;height:100%;min-height:calc(var(--spacing, .25rem) * 0);min-width:calc(var(--spacing, .25rem) * 0);flex:1;flex-basis:100%}.nxa-page .nxa-page-content .nxa-content{display:flex;height:100%;min-height:calc(var(--spacing, .25rem) * 0);min-width:calc(var(--spacing, .25rem) * 0);flex:1;flex-basis:100%}.nxa-drawer-container{inset-inline-start:calc(var(--spacing, .25rem) * 0);top:calc(var(--spacing, .25rem) * 0);bottom:calc(var(--spacing, .25rem) * 0);z-index:10;min-height:100%;max-width:fit-content;background-color:var(--color-base-200);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function, cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration, var(--default-transition-duration, .15s));--tw-duration: .3s;transition-duration:.3s;--tw-ease: var(--ease-in-out, cubic-bezier(.4, 0, .2, 1));transition-timing-function:var(--ease-in-out, cubic-bezier(.4, 0, .2, 1))}.nxa-drawer-container.nxa-drawer-overlay{position:absolute;inset-inline-start:calc(var(--spacing, .25rem) * 0);top:calc(var(--spacing, .25rem) * 0)}.nxa-drawer-container.nxa-drawer-open{pointer-events:auto;height:100%;width:fit-content;min-width:fit-content;--tw-translate-x: calc(var(--spacing, .25rem) * 0);translate:var(--tw-translate-x) var(--tw-translate-y);opacity:100%}.nxa-drawer-container.nxa-drawer-close{pointer-events:none;z-index:50;min-width:calc(var(--spacing, .25rem) * 0);opacity:0%;transition-delay:0s,0s,.3s,ease-out}.nxa-drawer-container.nxa-drawer-close:where(:dir(ltr),[dir=ltr],[dir=ltr] *){--tw-translate-x: -100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.nxa-drawer-container.nxa-drawer-close:where(:dir(rtl),[dir=rtl],[dir=rtl] *){--tw-translate-x: 100%;translate:var(--tw-translate-x) var(--tw-translate-y)}@layer base{:where(:root),:root:has(input.theme-controller[value=light]:checked),[data-theme=light]{color-scheme:light;--color-base-100: oklch(100% 0 0);--color-base-200: oklch(98% 0 0);--color-base-300: oklch(95% 0 0);--color-base-content: oklch(21% .006 285.885);--color-primary: oklch(45% .24 277.023);--color-primary-content: oklch(93% .034 272.788);--color-secondary: oklch(65% .241 354.308);--color-secondary-content: oklch(94% .028 342.258);--color-accent: oklch(77% .152 181.912);--color-accent-content: oklch(38% .063 188.416);--color-neutral: oklch(14% .005 285.823);--color-neutral-content: oklch(92% .004 286.32);--color-info: oklch(74% .16 232.661);--color-info-content: oklch(29% .066 243.157);--color-success: oklch(76% .177 163.223);--color-success-content: oklch(37% .077 168.94);--color-warning: oklch(82% .189 84.429);--color-warning-content: oklch(41% .112 45.904);--color-error: oklch(71% .194 13.428);--color-error-content: oklch(27% .105 12.094);--radius-selector: .5rem;--radius-field: .25rem;--radius-box: .5rem;--size-selector: .25rem;--size-field: .25rem;--border: 1px;--depth: 1;--noise: 0}}@layer base{@media(prefers-color-scheme:dark){:root:not([data-theme]){color-scheme:dark;--color-base-100: oklch(25.33% .016 252.42);--color-base-200: oklch(23.26% .014 253.1);--color-base-300: oklch(21.15% .012 254.09);--color-base-content: oklch(97.807% .029 256.847);--color-primary: oklch(58% .233 277.117);--color-primary-content: oklch(96% .018 272.314);--color-secondary: oklch(65% .241 354.308);--color-secondary-content: oklch(94% .028 342.258);--color-accent: oklch(77% .152 181.912);--color-accent-content: oklch(38% .063 188.416);--color-neutral: oklch(14% .005 285.823);--color-neutral-content: oklch(92% .004 286.32);--color-info: oklch(74% .16 232.661);--color-info-content: oklch(29% .066 243.157);--color-success: oklch(76% .177 163.223);--color-success-content: oklch(37% .077 168.94);--color-warning: oklch(82% .189 84.429);--color-warning-content: oklch(41% .112 45.904);--color-error: oklch(71% .194 13.428);--color-error-content: oklch(27% .105 12.094);--radius-selector: .5rem;--radius-field: .25rem;--radius-box: .5rem;--size-selector: .25rem;--size-field: .25rem;--border: 1px;--depth: 1;--noise: 0}}}@layer base{:root:has(input.theme-controller[value=light]:checked),[data-theme=light]{color-scheme:light;--color-base-100: oklch(100% 0 0);--color-base-200: oklch(98% 0 0);--color-base-300: oklch(95% 0 0);--color-base-content: oklch(21% .006 285.885);--color-primary: oklch(45% .24 277.023);--color-primary-content: oklch(93% .034 272.788);--color-secondary: oklch(65% .241 354.308);--color-secondary-content: oklch(94% .028 342.258);--color-accent: oklch(77% .152 181.912);--color-accent-content: oklch(38% .063 188.416);--color-neutral: oklch(14% .005 285.823);--color-neutral-content: oklch(92% .004 286.32);--color-info: oklch(74% .16 232.661);--color-info-content: oklch(29% .066 243.157);--color-success: oklch(76% .177 163.223);--color-success-content: oklch(37% .077 168.94);--color-warning: oklch(82% .189 84.429);--color-warning-content: oklch(41% .112 45.904);--color-error: oklch(71% .194 13.428);--color-error-content: oklch(27% .105 12.094);--radius-selector: .5rem;--radius-field: .25rem;--radius-box: .5rem;--size-selector: .25rem;--size-field: .25rem;--border: 1px;--depth: 1;--noise: 0}}@layer base{:root:has(input.theme-controller[value=dark]:checked),[data-theme=dark]{color-scheme:dark;--color-base-100: oklch(25.33% .016 252.42);--color-base-200: oklch(23.26% .014 253.1);--color-base-300: oklch(21.15% .012 254.09);--color-base-content: oklch(97.807% .029 256.847);--color-primary: oklch(58% .233 277.117);--color-primary-content: oklch(96% .018 272.314);--color-secondary: oklch(65% .241 354.308);--color-secondary-content: oklch(94% .028 342.258);--color-accent: oklch(77% .152 181.912);--color-accent-content: oklch(38% .063 188.416);--color-neutral: oklch(14% .005 285.823);--color-neutral-content: oklch(92% .004 286.32);--color-info: oklch(74% .16 232.661);--color-info-content: oklch(29% .066 243.157);--color-success: oklch(76% .177 163.223);--color-success-content: oklch(37% .077 168.94);--color-warning: oklch(82% .189 84.429);--color-warning-content: oklch(41% .112 45.904);--color-error: oklch(71% .194 13.428);--color-error-content: oklch(27% .105 12.094);--radius-selector: .5rem;--radius-field: .25rem;--radius-box: .5rem;--size-selector: .25rem;--size-field: .25rem;--border: 1px;--depth: 1;--noise: 0}}@layer base{:root{--fx-noise: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.34' numOctaves='4' stitchTiles='stitch'%3E%3C/feTurbulence%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23a)' opacity='0.2'%3E%3C/rect%3E%3C/svg%3E\")}}@layer base{:root{scrollbar-color:currentColor #0000}@supports (color: color-mix(in lab,red,red)){:root{scrollbar-color:color-mix(in oklch,currentColor 35%,#0000) #0000}}}@layer base{@property --radialprogress{syntax: \"<percentage>\"; inherits: true; initial-value: 0%;}}@layer base{:root:not(span){overflow:var(--page-overflow)}}@layer base{:root{background:var(--page-scroll-bg, var(--root-bg));--page-scroll-bg-on: linear-gradient(var(--root-bg, #0000), var(--root-bg, #0000)) var(--root-bg, #0000);--page-scroll-transition-on: background-color .3s ease-out;transition:var(--page-scroll-transition);scrollbar-gutter:var(--page-scroll-gutter, unset);scrollbar-gutter:if(style(--page-has-scroll: 1): var(--page-scroll-gutter, unset) ; else: unset)}@supports (color: color-mix(in lab,red,red)){:root{--page-scroll-bg-on: linear-gradient(var(--root-bg, #0000), var(--root-bg, #0000)) color-mix(in srgb, var(--root-bg, #0000), oklch(0% 0 0) calc(var(--page-has-backdrop, 0) * 40%))}}@keyframes set-page-has-scroll{0%,to{--page-has-scroll: 1}}}@layer base{:root,[data-theme]{background:var(--page-scroll-bg, var(--root-bg));color:var(--color-base-content)}:where(:root,[data-theme]){--root-bg: var(--color-base-100)}}@keyframes rating{0%,40%{scale:1.1;filter:brightness(1.05) contrast(1.05)}}@keyframes dropdown{0%{opacity:0}}@keyframes radio{0%{padding:5px}50%{padding:3px}}@keyframes toast{0%{scale:.9;opacity:0}to{scale:1;opacity:1}}@keyframes rotator{89.9999%,to{--first-item-position: 0 0%}90%,99.9999%{--first-item-position: 0 calc(var(--items) * 100%)}to{translate:0 -100%}}@keyframes skeleton{0%{background-position:150%}to{background-position:-50%}}@keyframes menu{0%{opacity:0}}@keyframes progress{50%{background-position-x:-115%}}@property --tw-duration{syntax: \"*\"; inherits: false;}@property --tw-ease{syntax: \"*\"; inherits: false;}@property --tw-translate-x{syntax: \"*\"; inherits: false; initial-value: 0;}@property --tw-translate-y{syntax: \"*\"; inherits: false; initial-value: 0;}@property --tw-translate-z{syntax: \"*\"; inherits: false; initial-value: 0;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-duration: initial;--tw-ease: initial;--tw-translate-x: 0;--tw-translate-y: 0;--tw-translate-z: 0}}}\n/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */\n"] }]
|
|
3236
|
+
}], propDecorators: { className: [{
|
|
3237
|
+
type: Input
|
|
3238
|
+
}], classBody: [{
|
|
3239
|
+
type: Input
|
|
3240
|
+
}], root: [{
|
|
3241
|
+
type: Input
|
|
3242
|
+
}], drawerTemplate: [{
|
|
3243
|
+
type: Input
|
|
3244
|
+
}], navBarTemplate: [{
|
|
3245
|
+
type: Input
|
|
3246
|
+
}], contentFooterTemplate: [{
|
|
3247
|
+
type: Input
|
|
3248
|
+
}], pageFooterTemplate: [{
|
|
3249
|
+
type: Input
|
|
3250
|
+
}], sidebarTemplate: [{
|
|
3251
|
+
type: Input
|
|
3252
|
+
}], drawerId: [{
|
|
3253
|
+
type: Input
|
|
3254
|
+
}], drawerDefaultOpen: [{
|
|
3255
|
+
type: Input
|
|
3256
|
+
}], overlayFrom: [{
|
|
3257
|
+
type: Input
|
|
3258
|
+
}], isRoot: [{
|
|
3259
|
+
type: HostBinding,
|
|
3260
|
+
args: ['class.is-root']
|
|
3261
|
+
}] } });
|
|
3262
|
+
|
|
3263
|
+
class NxaTabDirective {
|
|
3264
|
+
//#region public interface
|
|
3265
|
+
// Signals
|
|
3266
|
+
_tabId = signal('', ...(ngDevMode ? [{ debugName: "_tabId" }] : []));
|
|
3267
|
+
_tabIndex = signal(0, ...(ngDevMode ? [{ debugName: "_tabIndex" }] : []));
|
|
3268
|
+
_openingIndex = signal(0, ...(ngDevMode ? [{ debugName: "_openingIndex" }] : []));
|
|
3269
|
+
_isActive = signal(false, ...(ngDevMode ? [{ debugName: "_isActive" }] : []));
|
|
3270
|
+
_title = signal('', ...(ngDevMode ? [{ debugName: "_title" }] : []));
|
|
3271
|
+
_icon = signal('', ...(ngDevMode ? [{ debugName: "_icon" }] : []));
|
|
3272
|
+
_disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : []));
|
|
3273
|
+
_animationDuration = signal(650, ...(ngDevMode ? [{ debugName: "_animationDuration" }] : []));
|
|
3274
|
+
_defaultAnimation = signal(true, ...(ngDevMode ? [{ debugName: "_defaultAnimation" }] : []));
|
|
3275
|
+
// @Input() bindings with getters/setters
|
|
3276
|
+
get tabId() {
|
|
3277
|
+
return this._tabId();
|
|
3278
|
+
}
|
|
3279
|
+
set tabId(value) {
|
|
3280
|
+
this._tabId.set(value);
|
|
3281
|
+
}
|
|
3282
|
+
get tabIndex() {
|
|
3283
|
+
return this._tabIndex();
|
|
3284
|
+
}
|
|
3285
|
+
set tabIndex(value) {
|
|
3286
|
+
this._tabIndex.set(value);
|
|
3287
|
+
}
|
|
3288
|
+
get openingIndex() {
|
|
3289
|
+
return this._openingIndex();
|
|
3290
|
+
}
|
|
3291
|
+
set openingIndex(value) {
|
|
3292
|
+
this._openingIndex.set(value);
|
|
3293
|
+
}
|
|
3294
|
+
get isActive() {
|
|
3295
|
+
return this._isActive();
|
|
3296
|
+
}
|
|
3297
|
+
set isActive(value) {
|
|
3298
|
+
this._isActive.set(value);
|
|
3299
|
+
}
|
|
3300
|
+
get title() {
|
|
3301
|
+
return this._title();
|
|
3302
|
+
}
|
|
3303
|
+
set title(value) {
|
|
3304
|
+
this._title.set(value);
|
|
3305
|
+
}
|
|
3306
|
+
get icon() {
|
|
3307
|
+
return this._icon();
|
|
3308
|
+
}
|
|
3309
|
+
set icon(value) {
|
|
3310
|
+
this._icon.set(value);
|
|
3311
|
+
}
|
|
3312
|
+
get disabled() {
|
|
3313
|
+
return this._disabled();
|
|
3314
|
+
}
|
|
3315
|
+
set disabled(value) {
|
|
3316
|
+
this._disabled.set(value);
|
|
3317
|
+
}
|
|
3318
|
+
get animationDuration() {
|
|
3319
|
+
return this._animationDuration();
|
|
3320
|
+
}
|
|
3321
|
+
set animationDuration(value) {
|
|
3322
|
+
this._animationDuration.set(value);
|
|
3323
|
+
}
|
|
3324
|
+
get defaultAnimation() {
|
|
3325
|
+
return this._defaultAnimation();
|
|
3326
|
+
}
|
|
3327
|
+
set defaultAnimation(value) {
|
|
3328
|
+
this._defaultAnimation.set(value);
|
|
3329
|
+
}
|
|
3330
|
+
//#endregion
|
|
3331
|
+
_tabState = signal('OPEN', ...(ngDevMode ? [{ debugName: "_tabState" }] : []));
|
|
3332
|
+
_animationDelayEffect = effect(() => {
|
|
3333
|
+
const isActive = this._isActive();
|
|
3334
|
+
const state = this._tabState();
|
|
3335
|
+
if (isActive && state === 'CLOSE') {
|
|
3336
|
+
this._tabState.set('OPENING');
|
|
3337
|
+
setTimeout(() => {
|
|
3338
|
+
this._tabState.set('OPEN');
|
|
3339
|
+
}, this._animationDuration());
|
|
3340
|
+
}
|
|
3341
|
+
else if (!isActive && state === 'OPEN') {
|
|
3342
|
+
this._tabState.set('CLOSING');
|
|
3343
|
+
setTimeout(() => {
|
|
3344
|
+
this._tabState.set('CLOSE');
|
|
3345
|
+
}, this._animationDuration());
|
|
3346
|
+
}
|
|
3347
|
+
}, ...(ngDevMode ? [{ debugName: "_animationDelayEffect" }] : []));
|
|
3348
|
+
nxaTab = true;
|
|
3349
|
+
fullHeight = true;
|
|
3350
|
+
fullWidth = true;
|
|
3351
|
+
left = 0;
|
|
3352
|
+
top = 0;
|
|
3353
|
+
right = 0;
|
|
3354
|
+
bottom = 0;
|
|
3355
|
+
position = 'absolute';
|
|
3356
|
+
get display() {
|
|
3357
|
+
return this._tabState() == 'CLOSE' ? 'none' : 'block';
|
|
3358
|
+
}
|
|
3359
|
+
get isTabOpening() {
|
|
3360
|
+
return this._tabState() == 'OPENING';
|
|
3361
|
+
}
|
|
3362
|
+
get isTabOpen() {
|
|
3363
|
+
return this._tabState() == 'OPEN';
|
|
3364
|
+
}
|
|
3365
|
+
get isTabClosing() {
|
|
3366
|
+
return this._tabState() == 'CLOSING';
|
|
3367
|
+
}
|
|
3368
|
+
get isTabClose() {
|
|
3369
|
+
return this._tabState() == 'CLOSE';
|
|
3370
|
+
}
|
|
3371
|
+
get isClosingLeft() {
|
|
3372
|
+
return this._tabState() == 'CLOSING' && this._tabIndex() > this._openingIndex();
|
|
3373
|
+
}
|
|
3374
|
+
get isClosingRight() {
|
|
3375
|
+
return this._tabState() == 'CLOSING' && this._tabIndex() < this._openingIndex();
|
|
3376
|
+
}
|
|
3377
|
+
get isOpeningLeft() {
|
|
3378
|
+
return this._tabState() == 'CLOSING' && this._tabIndex() < this._openingIndex();
|
|
3379
|
+
}
|
|
3380
|
+
get isOpeningRight() {
|
|
3381
|
+
return this._tabState() == 'CLOSING' && this._tabIndex() > this._openingIndex();
|
|
3382
|
+
}
|
|
3383
|
+
get animateDefault() {
|
|
3384
|
+
return this._defaultAnimation();
|
|
3385
|
+
}
|
|
3386
|
+
ngOnInit() {
|
|
3387
|
+
this._tabState.set(this._isActive() ? 'OPEN' : 'CLOSE');
|
|
3388
|
+
}
|
|
3389
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaTabDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
3390
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.5", type: NxaTabDirective, isStandalone: true, selector: "[nxaTab]", inputs: { tabId: "tabId", tabIndex: "tabIndex", openingIndex: "openingIndex", isActive: "isActive", title: "title", icon: "icon", disabled: "disabled", animationDuration: "animationDuration", defaultAnimation: "defaultAnimation" }, host: { properties: { "class.nxa-tab": "this.nxaTab", "class.h-full": "this.fullHeight", "class.w-full": "this.fullWidth", "style.left": "this.left", "style.top": "this.top", "style.right": "this.right", "style.bottom": "this.bottom", "style.position": "this.position", "style.display": "this.display", "class.nxa-tab-opening": "this.isTabOpening", "class.nxa-tab-open": "this.isTabOpen", "class.nxa-tab-closing": "this.isTabClosing", "class.nxa-tab-close": "this.isTabClose", "class.nxa-closing-left": "this.isClosingLeft", "class.nxa-closing-right": "this.isClosingRight", "class.nxa-opening-left": "this.isOpeningLeft", "class.nxa-opening-right": "this.isOpeningRight", "class.tab-animate-default": "this.animateDefault" } }, ngImport: i0 });
|
|
3391
|
+
}
|
|
3392
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaTabDirective, decorators: [{
|
|
3393
|
+
type: Directive,
|
|
3394
|
+
args: [{
|
|
3395
|
+
selector: '[nxaTab]'
|
|
3396
|
+
}]
|
|
3397
|
+
}], propDecorators: { tabId: [{
|
|
3398
|
+
type: Input
|
|
3399
|
+
}], tabIndex: [{
|
|
3400
|
+
type: Input
|
|
3401
|
+
}], openingIndex: [{
|
|
3402
|
+
type: Input
|
|
3403
|
+
}], isActive: [{
|
|
3404
|
+
type: Input
|
|
3405
|
+
}], title: [{
|
|
3406
|
+
type: Input
|
|
3407
|
+
}], icon: [{
|
|
3408
|
+
type: Input
|
|
3409
|
+
}], disabled: [{
|
|
3410
|
+
type: Input
|
|
3411
|
+
}], animationDuration: [{
|
|
3412
|
+
type: Input
|
|
3413
|
+
}], defaultAnimation: [{
|
|
3414
|
+
type: Input
|
|
3415
|
+
}], nxaTab: [{
|
|
3416
|
+
type: HostBinding,
|
|
3417
|
+
args: ['class.nxa-tab']
|
|
3418
|
+
}], fullHeight: [{
|
|
3419
|
+
type: HostBinding,
|
|
3420
|
+
args: ['class.h-full']
|
|
3421
|
+
}], fullWidth: [{
|
|
3422
|
+
type: HostBinding,
|
|
3423
|
+
args: ['class.w-full']
|
|
3424
|
+
}], left: [{
|
|
3425
|
+
type: HostBinding,
|
|
3426
|
+
args: ['style.left']
|
|
3427
|
+
}], top: [{
|
|
3428
|
+
type: HostBinding,
|
|
3429
|
+
args: ['style.top']
|
|
3430
|
+
}], right: [{
|
|
3431
|
+
type: HostBinding,
|
|
3432
|
+
args: ['style.right']
|
|
3433
|
+
}], bottom: [{
|
|
3434
|
+
type: HostBinding,
|
|
3435
|
+
args: ['style.bottom']
|
|
3436
|
+
}], position: [{
|
|
3437
|
+
type: HostBinding,
|
|
3438
|
+
args: ['style.position']
|
|
3439
|
+
}], display: [{
|
|
3440
|
+
type: HostBinding,
|
|
3441
|
+
args: ['style.display']
|
|
3442
|
+
}], isTabOpening: [{
|
|
3443
|
+
type: HostBinding,
|
|
3444
|
+
args: ['class.nxa-tab-opening']
|
|
3445
|
+
}], isTabOpen: [{
|
|
3446
|
+
type: HostBinding,
|
|
3447
|
+
args: ['class.nxa-tab-open']
|
|
3448
|
+
}], isTabClosing: [{
|
|
3449
|
+
type: HostBinding,
|
|
3450
|
+
args: ['class.nxa-tab-closing']
|
|
3451
|
+
}], isTabClose: [{
|
|
3452
|
+
type: HostBinding,
|
|
3453
|
+
args: ['class.nxa-tab-close']
|
|
3454
|
+
}], isClosingLeft: [{
|
|
3455
|
+
type: HostBinding,
|
|
3456
|
+
args: ['class.nxa-closing-left']
|
|
3457
|
+
}], isClosingRight: [{
|
|
3458
|
+
type: HostBinding,
|
|
3459
|
+
args: ['class.nxa-closing-right']
|
|
3460
|
+
}], isOpeningLeft: [{
|
|
3461
|
+
type: HostBinding,
|
|
3462
|
+
args: ['class.nxa-opening-left']
|
|
3463
|
+
}], isOpeningRight: [{
|
|
3464
|
+
type: HostBinding,
|
|
3465
|
+
args: ['class.nxa-opening-right']
|
|
3466
|
+
}], animateDefault: [{
|
|
3467
|
+
type: HostBinding,
|
|
3468
|
+
args: ['class.tab-animate-default']
|
|
3469
|
+
}] } });
|
|
3470
|
+
|
|
3471
|
+
class NxaTabView {
|
|
3472
|
+
/* ---- Signals + @Input setters ---- */
|
|
3473
|
+
_tabType = signal('lift', ...(ngDevMode ? [{ debugName: "_tabType" }] : []));
|
|
3474
|
+
set tabType(value) {
|
|
3475
|
+
this._tabType.set(value);
|
|
3476
|
+
}
|
|
3477
|
+
get tabType() {
|
|
3478
|
+
return this._tabType();
|
|
3479
|
+
}
|
|
3480
|
+
_tabSize = signal('md', ...(ngDevMode ? [{ debugName: "_tabSize" }] : []));
|
|
3481
|
+
set tabSize(value) {
|
|
3482
|
+
this._tabSize.set(value);
|
|
3483
|
+
}
|
|
3484
|
+
get tabSize() {
|
|
3485
|
+
return this._tabSize();
|
|
3486
|
+
}
|
|
3487
|
+
_className = signal('', ...(ngDevMode ? [{ debugName: "_className" }] : []));
|
|
3488
|
+
set className(value) {
|
|
3489
|
+
this._className.set(value);
|
|
3490
|
+
}
|
|
3491
|
+
get className() {
|
|
3492
|
+
return this._className();
|
|
3493
|
+
}
|
|
3494
|
+
_animate = signal(true, ...(ngDevMode ? [{ debugName: "_animate" }] : []));
|
|
3495
|
+
set animate(value) {
|
|
3496
|
+
this._animate.set(value);
|
|
3497
|
+
}
|
|
3498
|
+
get animate() {
|
|
3499
|
+
return this._animate();
|
|
3500
|
+
}
|
|
3501
|
+
tabs = contentChildren(NxaTabDirective, { ...(ngDevMode ? { debugName: "tabs" } : {}), descendants: true });
|
|
3502
|
+
updateTabState = effect(() => {
|
|
3503
|
+
this.tabs().forEach(x => { if (!this._animate()) {
|
|
3504
|
+
x.animationDuration = 0;
|
|
3505
|
+
} });
|
|
3506
|
+
}, ...(ngDevMode ? [{ debugName: "updateTabState" }] : []));
|
|
3507
|
+
tabsLabelState = computed(() => {
|
|
3508
|
+
return this.tabs().map((tab) => ({
|
|
3509
|
+
label: tab.title,
|
|
3510
|
+
active: tab.isActive
|
|
3511
|
+
}));
|
|
3512
|
+
}, ...(ngDevMode ? [{ debugName: "tabsLabelState" }] : []));
|
|
3513
|
+
computedNgTabClass = computed(() => ({
|
|
3514
|
+
[`tabs-${this._tabType()}`]: true,
|
|
3515
|
+
[`tabs-${this._tabSize()}`]: true,
|
|
3516
|
+
}), ...(ngDevMode ? [{ debugName: "computedNgTabClass" }] : []));
|
|
3517
|
+
onTabclick(tabIndex) {
|
|
3518
|
+
this.tabs().forEach((tab, index) => {
|
|
3519
|
+
tab.tabIndex = index;
|
|
3520
|
+
if (tabIndex === index) {
|
|
3521
|
+
tab.isActive = true;
|
|
3522
|
+
}
|
|
3523
|
+
else {
|
|
3524
|
+
tab.isActive = false;
|
|
3525
|
+
tab.openingIndex = tabIndex;
|
|
3526
|
+
}
|
|
3527
|
+
});
|
|
3528
|
+
}
|
|
3529
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaTabView, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3530
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.5", type: NxaTabView, isStandalone: true, selector: "nxa-tab-view", inputs: { tabType: "tabType", tabSize: "tabSize", className: "className", animate: "animate" }, host: { classAttribute: "block min-h-0 basis-fit h-fit flex-1 max-h-full w-full max-w-full inset-0 box-border" }, queries: [{ propertyName: "tabs", predicate: NxaTabDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Nxa Tab View Container -->\n<div class=\"flex flex-col flex-1 min-h-0 h-full relative w-full nxa-tab-view-container\" [class]=\"_className()\">\n <!-- Nxa Tab view Header -->\n <div class=\"overflow-x-auto px-2 shrink-0 grow-0 min-h-fit nxa-tab-view-header\">\n <div role=\"tablist\" class=\"tabs tabs-bordered px-1\" [ngClass]=\"computedNgTabClass()\">\n @for (label of tabsLabelState(); let index = $index; track $index) {\n <a role=\"tab\" class=\"tab\" tabindex=\"0\" [class.tab-active]=\"label.active\" (click)=\"onTabclick(index)\" (keypress)=\"onTabclick(index)\">\n {{label.label}}\n </a>\n }\n </div>\n </div>\n <!-- Nxa Tab View Body -->\n <div class=\"flex relative flex-1 min-h-0 h-full basis-full nxa-tab-view-body\">\n <ng-content select=\"[nxaTab]\"></ng-content>\n </div>\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
3531
|
+
}
|
|
3532
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NxaTabView, decorators: [{
|
|
3533
|
+
type: Component,
|
|
3534
|
+
args: [{ selector: 'nxa-tab-view', encapsulation: ViewEncapsulation.None, imports: [CommonModule], host: {
|
|
3535
|
+
class: `${NXA_HOST_BLOCK}`,
|
|
3536
|
+
}, template: "<!-- Nxa Tab View Container -->\n<div class=\"flex flex-col flex-1 min-h-0 h-full relative w-full nxa-tab-view-container\" [class]=\"_className()\">\n <!-- Nxa Tab view Header -->\n <div class=\"overflow-x-auto px-2 shrink-0 grow-0 min-h-fit nxa-tab-view-header\">\n <div role=\"tablist\" class=\"tabs tabs-bordered px-1\" [ngClass]=\"computedNgTabClass()\">\n @for (label of tabsLabelState(); let index = $index; track $index) {\n <a role=\"tab\" class=\"tab\" tabindex=\"0\" [class.tab-active]=\"label.active\" (click)=\"onTabclick(index)\" (keypress)=\"onTabclick(index)\">\n {{label.label}}\n </a>\n }\n </div>\n </div>\n <!-- Nxa Tab View Body -->\n <div class=\"flex relative flex-1 min-h-0 h-full basis-full nxa-tab-view-body\">\n <ng-content select=\"[nxaTab]\"></ng-content>\n </div>\n</div>" }]
|
|
3537
|
+
}], propDecorators: { tabType: [{
|
|
3538
|
+
type: Input
|
|
3539
|
+
}], tabSize: [{
|
|
3540
|
+
type: Input
|
|
3541
|
+
}], className: [{
|
|
3542
|
+
type: Input
|
|
3543
|
+
}], animate: [{
|
|
3544
|
+
type: Input
|
|
3545
|
+
}], tabs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => NxaTabDirective), { ...{ descendants: true }, isSignal: true }] }] } });
|
|
3546
|
+
|
|
3547
|
+
// Layouts
|
|
3548
|
+
|
|
3549
|
+
const NxaLoadingInterceptor = (req, next) => {
|
|
3550
|
+
const loadingService = inject(NxaLoadingService);
|
|
3551
|
+
const shouldTrack = !req.context.get(SKIP_LOADING);
|
|
3552
|
+
if (shouldTrack) {
|
|
3553
|
+
loadingService.addLoading();
|
|
3554
|
+
}
|
|
3555
|
+
return next(req).pipe(finalize(() => {
|
|
3556
|
+
if (shouldTrack) {
|
|
3557
|
+
loadingService.removeLoading();
|
|
3558
|
+
}
|
|
3559
|
+
}));
|
|
3560
|
+
};
|
|
3561
|
+
|
|
3562
|
+
/*
|
|
3563
|
+
* Public API Surface of nxa-ui
|
|
3564
|
+
*/
|
|
3565
|
+
|
|
3566
|
+
/**
|
|
3567
|
+
* Generated bundle index. Do not edit.
|
|
3568
|
+
*/
|
|
3569
|
+
|
|
3570
|
+
export { DEFAULT_TAILWIND_BREAKPOINTS, NXA_BRAND_COLORS, NXA_BREAKPOINTS, NXA_COLORS_ALL, NXA_CONTENT_COLORS, NXA_DEFAULT_DARK_THEME, NXA_DEFAULT_LIGHT_THEME, NXA_DEFAULT_THEME_BRIGHTNESS_MAP, NXA_HOST_BLOCK, NXA_HOST_CONTENTS_ONLY, NXA_HOST_LAYOUT, NXA_NEUTRAL_COLORS, NXA_OVERLAY_CONFIG_DEFAULTS, NXA_OVERLAY_DATA, NXA_PREFER_DARK_THEME, NXA_SIZES, NXA_STATUS_COLORS, NXA_THEME_BRIGHTNESS_MAP, NXA_THEME_LOADER, NXA_THEME_SAVING, NXA_TOAST_CONFIG_DEFAULTS, NxaAccordion, NxaAutoSizeDirective, NxaBadge, NxaButton, NxaCard, NxaCheckbox, NxaContainer, NxaDatagrid, NxaDateTimeInput, NxaDrawer, NxaDrawerService, NxaDropdown, NxaDynamicList, NxaExpansionPanel, NxaFileInput, NxaForceSizeDirective, NxaFormControl, NxaLayoutService, NxaLinearLayout, NxaListTile, NxaLoadingInterceptor, NxaLoadingService, NxaNavbar, NxaOverlayBase, NxaOverlayBaseMixin, NxaOverlayRef, NxaOverlayService, NxaPage, NxaPagination, NxaProgressApiCall, NxaRadio, NxaRadioGroup, NxaRange, NxaSelect, NxaTabDirective, NxaTabView, NxaText, NxaTextInput, NxaThemeService, NxaToast, NxaToastService, NxaTooltip, NxaTooltipDirective, SKIP_LOADING, WithClassBodyMixin, WithClassFooterMixin, WithClassHeaderMixin, WithClassName, WithClassNameMixin, applyMixins, deepEqual, getStyleVariable, isBrowserContext, isServerContext, sanitizeIcon, shallowEqual };
|
|
3571
|
+
//# sourceMappingURL=nxa-lab-nxa-ui.mjs.map
|