@neoprototype/neop-ui-lib 1.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/assets/images/check.svg +3 -0
- package/assets/images/default.png +0 -0
- package/assets/images/error-table.png +0 -0
- package/assets/images/error.png +0 -0
- package/assets/images/minus.svg +3 -0
- package/assets/images/success.png +0 -0
- package/assets/images/warning.png +0 -0
- package/fesm2022/neoprototype-neop-ui-lib.mjs +2670 -0
- package/fesm2022/neoprototype-neop-ui-lib.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/basic/basic.module.d.ts +12 -0
- package/lib/components/basic/np-action-bar/np-action-bar.component.d.ts +56 -0
- package/lib/components/basic/np-alert/np-alert.component.d.ts +27 -0
- package/lib/components/basic/np-breadcrumb/np-breadcrumb.component.d.ts +31 -0
- package/lib/components/basic/np-button/np-button.component.d.ts +18 -0
- package/lib/components/basic/np-checkbox/np-checkbox.component.d.ts +19 -0
- package/lib/components/basic/np-dropdowns/np-dropdowns.component.d.ts +32 -0
- package/lib/components/basic/np-input-field/np-input-field.component.d.ts +46 -0
- package/lib/components/basic/np-input-textera/np-input-textera.component.d.ts +22 -0
- package/lib/components/basic/np-loading-indicator/np-loading-indicator.component.d.ts +7 -0
- package/lib/components/basic/np-pagination/np-pagination.component.d.ts +38 -0
- package/lib/components/basic/np-progress-bar/np-progress-bar.component.d.ts +7 -0
- package/lib/components/basic/np-resize/np-resize.component.d.ts +27 -0
- package/lib/components/basic/np-scrollbar/np-scrollbar.component.d.ts +14 -0
- package/lib/components/basic/np-select/np-select.component.d.ts +29 -0
- package/lib/components/basic/np-slider/np-slider.component.d.ts +16 -0
- package/lib/components/basic/np-tab/np-tab.component.d.ts +19 -0
- package/lib/components/basic/np-table/np-table.component.d.ts +91 -0
- package/lib/components/basic/np-toggle/np-toggle.component.d.ts +15 -0
- package/lib/components/basic/np-tooltip/np-tooltip.component.d.ts +18 -0
- package/lib/components/basic/np-tree/np-tree.component.d.ts +48 -0
- package/lib/components/basic/np-typography/np-typography.component.d.ts +15 -0
- package/lib/components/modal/np-modal/np-modal.component.d.ts +34 -0
- package/lib/components/neop-component.module.d.ts +7 -0
- package/lib/config/form-error-config.d.ts +3 -0
- package/lib/enum/basic/breadcrumb.enum.d.ts +5 -0
- package/lib/enum/np-breadcrumb.enum.d.ts +4 -0
- package/lib/interfaces/default.interface.d.ts +5 -0
- package/lib/interfaces/dictionary-item.interface.d.ts +10 -0
- package/lib/interfaces/np-tab.interface.d.ts +5 -0
- package/lib/interfaces/np-table.interface.d.ts +8 -0
- package/lib/interfaces/np-tree.interface.d.ts +29 -0
- package/lib/interfaces/np.actions.d.ts +8 -0
- package/lib/models/default.mode.d.ts +68 -0
- package/lib/services/np-dialog.service.d.ts +11 -0
- package/lib/services/test.service.d.ts +8 -0
- package/lib/services/theme.service.d.ts +9 -0
- package/package.json +26 -0
- package/public-api.d.ts +35 -0
- package/scss/fonts/Inter/Inter-VariableFont_opsz,wght.ttf +0 -0
- package/scss/fonts/fonts.scss +4 -0
- package/scss/index.less +1 -0
- package/scss/index.scss +3 -0
- package/scss/ngzorro/custom-theme.scss +0 -0
- package/scss/ngzorro/modal/custom-modal.scss +6 -0
- package/scss/ngzorro/ng-zorro.less +3 -0
- package/scss/ngzorro/ng-zorro.scss +4 -0
- package/scss/tailwind/tailwind.scss +1 -0
- package/scss/theme/index.scss +20 -0
- package/scss/theme/theme-dark.scss +21 -0
- package/scss/theme/theme-light.scss +30 -0
|
@@ -0,0 +1,2670 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, NgModule, Component, ViewChild, Input, EventEmitter, Output, InjectionToken, Optional, Inject, ElementRef, HostListener, ViewChildren, TemplateRef } from '@angular/core';
|
|
3
|
+
import * as i1 from 'ng-zorro-antd/modal';
|
|
4
|
+
import { NzModalModule } from 'ng-zorro-antd/modal';
|
|
5
|
+
import * as i1$1 from '@angular/common';
|
|
6
|
+
import { CommonModule, DecimalPipe } from '@angular/common';
|
|
7
|
+
import { NzTypographyModule } from 'ng-zorro-antd/typography';
|
|
8
|
+
import * as i2 from '@angular/forms';
|
|
9
|
+
import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
10
|
+
import { NzButtonModule } from 'ng-zorro-antd/button';
|
|
11
|
+
import { NzCheckboxModule } from 'ng-zorro-antd/checkbox';
|
|
12
|
+
import * as i3$1 from 'ng-zorro-antd/switch';
|
|
13
|
+
import { NzSwitchModule } from 'ng-zorro-antd/switch';
|
|
14
|
+
import * as i3 from 'ng-zorro-antd/input';
|
|
15
|
+
import { NzInputModule } from 'ng-zorro-antd/input';
|
|
16
|
+
import * as i1$2 from 'ng-zorro-antd/icon';
|
|
17
|
+
import { NzIconModule } from 'ng-zorro-antd/icon';
|
|
18
|
+
import * as i5 from 'ng-zorro-antd/date-picker';
|
|
19
|
+
import { NzDatePickerModule } from 'ng-zorro-antd/date-picker';
|
|
20
|
+
import * as i3$2 from 'ng-zorro-antd/select';
|
|
21
|
+
import { NzSelectModule } from 'ng-zorro-antd/select';
|
|
22
|
+
import * as i3$3 from 'ng-zorro-antd/dropdown';
|
|
23
|
+
import { NzDropDownModule } from 'ng-zorro-antd/dropdown';
|
|
24
|
+
import * as i2$1 from 'ng-zorro-antd/menu';
|
|
25
|
+
import * as i1$4 from '@angular/router';
|
|
26
|
+
import { RouterModule, NavigationEnd } from '@angular/router';
|
|
27
|
+
import * as i2$2 from 'ng-zorro-antd/tooltip';
|
|
28
|
+
import { NzToolTipModule } from 'ng-zorro-antd/tooltip';
|
|
29
|
+
import * as i1$3 from 'ng-zorro-antd/core/transition-patch';
|
|
30
|
+
import { filter } from 'rxjs/operators';
|
|
31
|
+
import * as i1$5 from 'ng-zorro-antd/progress';
|
|
32
|
+
import { NzProgressModule } from 'ng-zorro-antd/progress';
|
|
33
|
+
import * as i2$3 from 'ng-zorro-antd/slider';
|
|
34
|
+
import { NzSliderModule } from 'ng-zorro-antd/slider';
|
|
35
|
+
import { NzSpinModule } from 'ng-zorro-antd/spin';
|
|
36
|
+
import * as i3$4 from 'ng-zorro-antd/resizable';
|
|
37
|
+
import { NzResizableModule } from 'ng-zorro-antd/resizable';
|
|
38
|
+
|
|
39
|
+
class TestService {
|
|
40
|
+
constructor() {
|
|
41
|
+
}
|
|
42
|
+
test() {
|
|
43
|
+
return 'test1';
|
|
44
|
+
}
|
|
45
|
+
test2() {
|
|
46
|
+
return 'test2';
|
|
47
|
+
}
|
|
48
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: TestService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
49
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: TestService, providedIn: 'root' });
|
|
50
|
+
}
|
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: TestService, decorators: [{
|
|
52
|
+
type: Injectable,
|
|
53
|
+
args: [{
|
|
54
|
+
providedIn: 'root'
|
|
55
|
+
}]
|
|
56
|
+
}], ctorParameters: () => [] });
|
|
57
|
+
|
|
58
|
+
class ThemeService {
|
|
59
|
+
// private renderer: Renderer2;
|
|
60
|
+
themeElement;
|
|
61
|
+
constructor(rendererFactory) {
|
|
62
|
+
// this.renderer = rendererFactory.createRenderer(null, null);
|
|
63
|
+
this.themeElement = document.getElementById('themeElementId');
|
|
64
|
+
}
|
|
65
|
+
setTheme(themeClass) {
|
|
66
|
+
if (!this.themeElement) {
|
|
67
|
+
this.themeElement = document.getElementById('themeElementId');
|
|
68
|
+
}
|
|
69
|
+
if (this.themeElement) {
|
|
70
|
+
this.themeElement.className = themeClass;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: ThemeService, deps: [{ token: i0.RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
74
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: ThemeService, providedIn: 'root' });
|
|
75
|
+
}
|
|
76
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: ThemeService, decorators: [{
|
|
77
|
+
type: Injectable,
|
|
78
|
+
args: [{
|
|
79
|
+
providedIn: 'root'
|
|
80
|
+
}]
|
|
81
|
+
}], ctorParameters: () => [{ type: i0.RendererFactory2 }] });
|
|
82
|
+
|
|
83
|
+
class NpDialogService {
|
|
84
|
+
modal;
|
|
85
|
+
constructor(modal) {
|
|
86
|
+
this.modal = modal;
|
|
87
|
+
}
|
|
88
|
+
openDialog(component, params) {
|
|
89
|
+
const modalRef = this.modal.create({
|
|
90
|
+
nzContent: component,
|
|
91
|
+
nzTitle: undefined,
|
|
92
|
+
nzData: params,
|
|
93
|
+
nzFooter: null,
|
|
94
|
+
nzCentered: true,
|
|
95
|
+
nzWidth: params?.nzWidth ?? '400px'
|
|
96
|
+
});
|
|
97
|
+
return modalRef.afterClose;
|
|
98
|
+
}
|
|
99
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpDialogService, deps: [{ token: i1.NzModalService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
100
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpDialogService, providedIn: 'root' });
|
|
101
|
+
}
|
|
102
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpDialogService, decorators: [{
|
|
103
|
+
type: Injectable,
|
|
104
|
+
args: [{
|
|
105
|
+
providedIn: 'root',
|
|
106
|
+
}]
|
|
107
|
+
}], ctorParameters: () => [{ type: i1.NzModalService }] });
|
|
108
|
+
|
|
109
|
+
class NeopComponentModule {
|
|
110
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NeopComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
111
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.5", ngImport: i0, type: NeopComponentModule, imports: [CommonModule] });
|
|
112
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NeopComponentModule, imports: [CommonModule] });
|
|
113
|
+
}
|
|
114
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NeopComponentModule, decorators: [{
|
|
115
|
+
type: NgModule,
|
|
116
|
+
args: [{
|
|
117
|
+
declarations: [],
|
|
118
|
+
imports: [
|
|
119
|
+
CommonModule,
|
|
120
|
+
],
|
|
121
|
+
exports: []
|
|
122
|
+
}]
|
|
123
|
+
}] });
|
|
124
|
+
|
|
125
|
+
class NpTypographyComponent {
|
|
126
|
+
renderer;
|
|
127
|
+
container;
|
|
128
|
+
npType = 'text';
|
|
129
|
+
npSize = 'sm';
|
|
130
|
+
npWeight = 'regular';
|
|
131
|
+
_ngContent = null;
|
|
132
|
+
set ngContent(value) {
|
|
133
|
+
this._ngContent = value;
|
|
134
|
+
this.updateContent();
|
|
135
|
+
}
|
|
136
|
+
constructor(renderer) {
|
|
137
|
+
this.renderer = renderer;
|
|
138
|
+
}
|
|
139
|
+
updateContent() {
|
|
140
|
+
if (!this._ngContent) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
if (this._ngContent instanceof Element) {
|
|
144
|
+
this.renderer.appendChild(this.container.nativeElement, this._ngContent);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpTypographyComponent, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
148
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: NpTypographyComponent, isStandalone: true, selector: "np-typography", inputs: { npType: "npType", npSize: "npSize", npWeight: "npWeight", ngContent: "ngContent" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, static: true }], ngImport: i0, template: "<p #container class=\"{{ npType }}-{{ npSize }} font-{{ npWeight }} font-text\">\n <!-- [ngClass]=\"splitClass()\" -->\n <ng-content></ng-content>\n</p>\n", styles: [".font-text{font-family:Inter,sans-serif;margin:0}.display-xl{font-size:60px;line-height:72px;letter-spacing:-2%}.display-lg{font-size:48px;line-height:60px;letter-spacing:-2%}.display-md{font-size:36px;line-height:44px;letter-spacing:-2%}.display-sm{font-size:30px;line-height:38px}.display-xs{font-size:24px;line-height:32px}.text-xl{font-size:20px;line-height:30px}.text-lg{font-size:18px;line-height:28px}.text-md{font-size:16px;line-height:24px}.text-sm{font-size:14px;line-height:20px}.text-xs{font-size:12px;line-height:18px}.font-regular{font-weight:400}.font-medium{font-weight:500}.font-semibold{font-weight:600}.font-bold{font-weight:700}\n"], dependencies: [{ kind: "ngmodule", type: NzTypographyModule }, { kind: "ngmodule", type: CommonModule }] });
|
|
149
|
+
}
|
|
150
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpTypographyComponent, decorators: [{
|
|
151
|
+
type: Component,
|
|
152
|
+
args: [{ selector: 'np-typography', imports: [NzTypographyModule, CommonModule], template: "<p #container class=\"{{ npType }}-{{ npSize }} font-{{ npWeight }} font-text\">\n <!-- [ngClass]=\"splitClass()\" -->\n <ng-content></ng-content>\n</p>\n", styles: [".font-text{font-family:Inter,sans-serif;margin:0}.display-xl{font-size:60px;line-height:72px;letter-spacing:-2%}.display-lg{font-size:48px;line-height:60px;letter-spacing:-2%}.display-md{font-size:36px;line-height:44px;letter-spacing:-2%}.display-sm{font-size:30px;line-height:38px}.display-xs{font-size:24px;line-height:32px}.text-xl{font-size:20px;line-height:30px}.text-lg{font-size:18px;line-height:28px}.text-md{font-size:16px;line-height:24px}.text-sm{font-size:14px;line-height:20px}.text-xs{font-size:12px;line-height:18px}.font-regular{font-weight:400}.font-medium{font-weight:500}.font-semibold{font-weight:600}.font-bold{font-weight:700}\n"] }]
|
|
153
|
+
}], ctorParameters: () => [{ type: i0.Renderer2 }], propDecorators: { container: [{
|
|
154
|
+
type: ViewChild,
|
|
155
|
+
args: ['container', { static: true }]
|
|
156
|
+
}], npType: [{
|
|
157
|
+
type: Input
|
|
158
|
+
}], npSize: [{
|
|
159
|
+
type: Input
|
|
160
|
+
}], npWeight: [{
|
|
161
|
+
type: Input
|
|
162
|
+
}], ngContent: [{
|
|
163
|
+
type: Input
|
|
164
|
+
}] } });
|
|
165
|
+
|
|
166
|
+
class NpButtonComponent {
|
|
167
|
+
renderer;
|
|
168
|
+
container;
|
|
169
|
+
npType = 'primary';
|
|
170
|
+
npSize = 'sm';
|
|
171
|
+
className = '';
|
|
172
|
+
isLoading = false;
|
|
173
|
+
disabled = false;
|
|
174
|
+
_ngContent = null;
|
|
175
|
+
set ngContent(value) {
|
|
176
|
+
this._ngContent = value;
|
|
177
|
+
this.updateContent();
|
|
178
|
+
}
|
|
179
|
+
constructor(renderer) {
|
|
180
|
+
this.renderer = renderer;
|
|
181
|
+
}
|
|
182
|
+
updateContent() {
|
|
183
|
+
if (!this._ngContent) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
if (this._ngContent instanceof Element) {
|
|
187
|
+
this.renderer.appendChild(this.container.nativeElement, this._ngContent);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
onClick(e) {
|
|
191
|
+
if (this.disabled) {
|
|
192
|
+
e.preventDefault();
|
|
193
|
+
e.stopPropagation();
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
if (this.isLoading) {
|
|
197
|
+
e.preventDefault();
|
|
198
|
+
e.stopPropagation();
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
// Add rip
|
|
202
|
+
const target = e.target;
|
|
203
|
+
const rect = target.getBoundingClientRect();
|
|
204
|
+
const x = e?.clientX - rect.left;
|
|
205
|
+
const y = e?.clientY - rect.top;
|
|
206
|
+
const ripples = this.renderer.createElement('span');
|
|
207
|
+
ripples.style.left = x + 'px';
|
|
208
|
+
ripples.style.top = y + 'px';
|
|
209
|
+
this.renderer.appendChild(this.container.nativeElement, ripples);
|
|
210
|
+
setTimeout(() => {
|
|
211
|
+
this.renderer.removeChild(this.container.nativeElement, ripples);
|
|
212
|
+
}, 1000);
|
|
213
|
+
}
|
|
214
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpButtonComponent, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
215
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: NpButtonComponent, isStandalone: true, selector: "np-button", inputs: { npType: "npType", npSize: "npSize", className: "className", isLoading: "isLoading", disabled: "disabled", ngContent: "ngContent" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, static: true }], ngImport: i0, template: "<button\n #container\n class=\"np-button ripple\n {{ npType }}\n {{ npSize }}\n {{ isLoading ? 'np-loading' : '' }}\n {{ disabled ? npType + '-disabled' : ''}}\n {{ className }}\"\n (click)=\"onClick($event)\"\n>\n <div class=\"inline items-center\">\n <i class=\"fa-solid fa-spinner-third fa-spin\" *ngIf=\"isLoading\"></i>\n <ng-content></ng-content>\n </div>\n</button>\n", styles: ["@layer theme,base,components,utilities;@layer theme{@theme default{ --font-sans: ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"; --font-serif: ui-serif, Georgia, Cambria, \"Times New Roman\", Times, serif; --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace; --color-red-50: oklch(.971 .013 17.38); --color-red-100: oklch(.936 .032 17.717); --color-red-200: oklch(.885 .062 18.334); --color-red-300: oklch(.808 .114 19.571); --color-red-400: oklch(.704 .191 22.216); --color-red-500: oklch(.637 .237 25.331); --color-red-600: oklch(.577 .245 27.325); --color-red-700: oklch(.505 .213 27.518); --color-red-800: oklch(.444 .177 26.899); --color-red-900: oklch(.396 .141 25.723); --color-red-950: oklch(.258 .092 26.042); --color-orange-50: oklch(.98 .016 73.684); --color-orange-100: oklch(.954 .038 75.164); --color-orange-200: oklch(.901 .076 70.697); --color-orange-300: oklch(.837 .128 66.29); --color-orange-400: oklch(.75 .183 55.934); --color-orange-500: oklch(.705 .213 47.604); --color-orange-600: oklch(.646 .222 41.116); --color-orange-700: oklch(.553 .195 38.402); --color-orange-800: oklch(.47 .157 37.304); --color-orange-900: oklch(.408 .123 38.172); --color-orange-950: oklch(.266 .079 36.259); --color-amber-50: oklch(.987 .022 95.277); --color-amber-100: oklch(.962 .059 95.617); --color-amber-200: oklch(.924 .12 95.746); --color-amber-300: oklch(.879 .169 91.605); --color-amber-400: oklch(.828 .189 84.429); --color-amber-500: oklch(.769 .188 70.08); --color-amber-600: oklch(.666 .179 58.318); --color-amber-700: oklch(.555 .163 48.998); --color-amber-800: oklch(.473 .137 46.201); --color-amber-900: oklch(.414 .112 45.904); --color-amber-950: oklch(.279 .077 45.635); --color-yellow-50: oklch(.987 .026 102.212); --color-yellow-100: oklch(.973 .071 103.193); --color-yellow-200: oklch(.945 .129 101.54); --color-yellow-300: oklch(.905 .182 98.111); --color-yellow-400: oklch(.852 .199 91.936); --color-yellow-500: oklch(.795 .184 86.047); --color-yellow-600: oklch(.681 .162 75.834); --color-yellow-700: oklch(.554 .135 66.442); --color-yellow-800: oklch(.476 .114 61.907); --color-yellow-900: oklch(.421 .095 57.708); --color-yellow-950: oklch(.286 .066 53.813); --color-lime-50: oklch(.986 .031 120.757); --color-lime-100: oklch(.967 .067 122.328); --color-lime-200: oklch(.938 .127 124.321); --color-lime-300: oklch(.897 .196 126.665); --color-lime-400: oklch(.841 .238 128.85); --color-lime-500: oklch(.768 .233 130.85); --color-lime-600: oklch(.648 .2 131.684); --color-lime-700: oklch(.532 .157 131.589); --color-lime-800: oklch(.453 .124 130.933); --color-lime-900: oklch(.405 .101 131.063); --color-lime-950: oklch(.274 .072 132.109); --color-green-50: oklch(.982 .018 155.826); --color-green-100: oklch(.962 .044 156.743); --color-green-200: oklch(.925 .084 155.995); --color-green-300: oklch(.871 .15 154.449); --color-green-400: oklch(.792 .209 151.711); --color-green-500: oklch(.723 .219 149.579); --color-green-600: oklch(.627 .194 149.214); --color-green-700: oklch(.527 .154 150.069); --color-green-800: oklch(.448 .119 151.328); --color-green-900: oklch(.393 .095 152.535); --color-green-950: oklch(.266 .065 152.934); --color-emerald-50: oklch(.979 .021 166.113); --color-emerald-100: oklch(.95 .052 163.051); --color-emerald-200: oklch(.905 .093 164.15); --color-emerald-300: oklch(.845 .143 164.978); --color-emerald-400: oklch(.765 .177 163.223); --color-emerald-500: oklch(.696 .17 162.48); --color-emerald-600: oklch(.596 .145 163.225); --color-emerald-700: oklch(.508 .118 165.612); --color-emerald-800: oklch(.432 .095 166.913); --color-emerald-900: oklch(.378 .077 168.94); --color-emerald-950: oklch(.262 .051 172.552); --color-teal-50: oklch(.984 .014 180.72); --color-teal-100: oklch(.953 .051 180.801); --color-teal-200: oklch(.91 .096 180.426); --color-teal-300: oklch(.855 .138 181.071); --color-teal-400: oklch(.777 .152 181.912); --color-teal-500: oklch(.704 .14 182.503); --color-teal-600: oklch(.6 .118 184.704); --color-teal-700: oklch(.511 .096 186.391); --color-teal-800: oklch(.437 .078 188.216); --color-teal-900: oklch(.386 .063 188.416); --color-teal-950: oklch(.277 .046 192.524); --color-cyan-50: oklch(.984 .019 200.873); --color-cyan-100: oklch(.956 .045 203.388); --color-cyan-200: oklch(.917 .08 205.041); --color-cyan-300: oklch(.865 .127 207.078); --color-cyan-400: oklch(.789 .154 211.53); --color-cyan-500: oklch(.715 .143 215.221); --color-cyan-600: oklch(.609 .126 221.723); --color-cyan-700: oklch(.52 .105 223.128); --color-cyan-800: oklch(.45 .085 224.283); --color-cyan-900: oklch(.398 .07 227.392); --color-cyan-950: oklch(.302 .056 229.695); --color-sky-50: oklch(.977 .013 236.62); --color-sky-100: oklch(.951 .026 236.824); --color-sky-200: oklch(.901 .058 230.902); --color-sky-300: oklch(.828 .111 230.318); --color-sky-400: oklch(.746 .16 232.661); --color-sky-500: oklch(.685 .169 237.323); --color-sky-600: oklch(.588 .158 241.966); --color-sky-700: oklch(.5 .134 242.749); --color-sky-800: oklch(.443 .11 240.79); --color-sky-900: oklch(.391 .09 240.876); --color-sky-950: oklch(.293 .066 243.157); --color-blue-50: oklch(.97 .014 254.604); --color-blue-100: oklch(.932 .032 255.585); --color-blue-200: oklch(.882 .059 254.128); --color-blue-300: oklch(.809 .105 251.813); --color-blue-400: oklch(.707 .165 254.624); --color-blue-500: oklch(.623 .214 259.815); --color-blue-600: oklch(.546 .245 262.881); --color-blue-700: oklch(.488 .243 264.376); --color-blue-800: oklch(.424 .199 265.638); --color-blue-900: oklch(.379 .146 265.522); --color-blue-950: oklch(.282 .091 267.935); --color-indigo-50: oklch(.962 .018 272.314); --color-indigo-100: oklch(.93 .034 272.788); --color-indigo-200: oklch(.87 .065 274.039); --color-indigo-300: oklch(.785 .115 274.713); --color-indigo-400: oklch(.673 .182 276.935); --color-indigo-500: oklch(.585 .233 277.117); --color-indigo-600: oklch(.511 .262 276.966); --color-indigo-700: oklch(.457 .24 277.023); --color-indigo-800: oklch(.398 .195 277.366); --color-indigo-900: oklch(.359 .144 278.697); --color-indigo-950: oklch(.257 .09 281.288); --color-violet-50: oklch(.969 .016 293.756); --color-violet-100: oklch(.943 .029 294.588); --color-violet-200: oklch(.894 .057 293.283); --color-violet-300: oklch(.811 .111 293.571); --color-violet-400: oklch(.702 .183 293.541); --color-violet-500: oklch(.606 .25 292.717); --color-violet-600: oklch(.541 .281 293.009); --color-violet-700: oklch(.491 .27 292.581); --color-violet-800: oklch(.432 .232 292.759); --color-violet-900: oklch(.38 .189 293.745); --color-violet-950: oklch(.283 .141 291.089); --color-purple-50: oklch(.977 .014 308.299); --color-purple-100: oklch(.946 .033 307.174); --color-purple-200: oklch(.902 .063 306.703); --color-purple-300: oklch(.827 .119 306.383); --color-purple-400: oklch(.714 .203 305.504); --color-purple-500: oklch(.627 .265 303.9); --color-purple-600: oklch(.558 .288 302.321); --color-purple-700: oklch(.496 .265 301.924); --color-purple-800: oklch(.438 .218 303.724); --color-purple-900: oklch(.381 .176 304.987); --color-purple-950: oklch(.291 .149 302.717); --color-fuchsia-50: oklch(.977 .017 320.058); --color-fuchsia-100: oklch(.952 .037 318.852); --color-fuchsia-200: oklch(.903 .076 319.62); --color-fuchsia-300: oklch(.833 .145 321.434); --color-fuchsia-400: oklch(.74 .238 322.16); --color-fuchsia-500: oklch(.667 .295 322.15); --color-fuchsia-600: oklch(.591 .293 322.896); --color-fuchsia-700: oklch(.518 .253 323.949); --color-fuchsia-800: oklch(.452 .211 324.591); --color-fuchsia-900: oklch(.401 .17 325.612); --color-fuchsia-950: oklch(.293 .136 325.661); --color-pink-50: oklch(.971 .014 343.198); --color-pink-100: oklch(.948 .028 342.258); --color-pink-200: oklch(.899 .061 343.231); --color-pink-300: oklch(.823 .12 346.018); --color-pink-400: oklch(.718 .202 349.761); --color-pink-500: oklch(.656 .241 354.308); --color-pink-600: oklch(.592 .249 .584); --color-pink-700: oklch(.525 .223 3.958); --color-pink-800: oklch(.459 .187 3.815); --color-pink-900: oklch(.408 .153 2.432); --color-pink-950: oklch(.284 .109 3.907); --color-rose-50: oklch(.969 .015 12.422); --color-rose-100: oklch(.941 .03 12.58); --color-rose-200: oklch(.892 .058 10.001); --color-rose-300: oklch(.81 .117 11.638); --color-rose-400: oklch(.712 .194 13.428); --color-rose-500: oklch(.645 .246 16.439); --color-rose-600: oklch(.586 .253 17.585); --color-rose-700: oklch(.514 .222 16.935); --color-rose-800: oklch(.455 .188 13.697); --color-rose-900: oklch(.41 .159 10.272); --color-rose-950: oklch(.271 .105 12.094); --color-slate-50: oklch(.984 .003 247.858); --color-slate-100: oklch(.968 .007 247.896); --color-slate-200: oklch(.929 .013 255.508); --color-slate-300: oklch(.869 .022 252.894); --color-slate-400: oklch(.704 .04 256.788); --color-slate-500: oklch(.554 .046 257.417); --color-slate-600: oklch(.446 .043 257.281); --color-slate-700: oklch(.372 .044 257.287); --color-slate-800: oklch(.279 .041 260.031); --color-slate-900: oklch(.208 .042 265.755); --color-slate-950: oklch(.129 .042 264.695); --color-gray-50: oklch(.985 .002 247.839); --color-gray-100: oklch(.967 .003 264.542); --color-gray-200: oklch(.928 .006 264.531); --color-gray-300: oklch(.872 .01 258.338); --color-gray-400: oklch(.707 .022 261.325); --color-gray-500: oklch(.551 .027 264.364); --color-gray-600: oklch(.446 .03 256.802); --color-gray-700: oklch(.373 .034 259.733); --color-gray-800: oklch(.278 .033 256.848); --color-gray-900: oklch(.21 .034 264.665); --color-gray-950: oklch(.13 .028 261.692); --color-zinc-50: oklch(.985 0 0); --color-zinc-100: oklch(.967 .001 286.375); --color-zinc-200: oklch(.92 .004 286.32); --color-zinc-300: oklch(.871 .006 286.286); --color-zinc-400: oklch(.705 .015 286.067); --color-zinc-500: oklch(.552 .016 285.938); --color-zinc-600: oklch(.442 .017 285.786); --color-zinc-700: oklch(.37 .013 285.805); --color-zinc-800: oklch(.274 .006 286.033); --color-zinc-900: oklch(.21 .006 285.885); --color-zinc-950: oklch(.141 .005 285.823); --color-neutral-50: oklch(.985 0 0); --color-neutral-100: oklch(.97 0 0); --color-neutral-200: oklch(.922 0 0); --color-neutral-300: oklch(.87 0 0); --color-neutral-400: oklch(.708 0 0); --color-neutral-500: oklch(.556 0 0); --color-neutral-600: oklch(.439 0 0); --color-neutral-700: oklch(.371 0 0); --color-neutral-800: oklch(.269 0 0); --color-neutral-900: oklch(.205 0 0); --color-neutral-950: oklch(.145 0 0); --color-stone-50: oklch(.985 .001 106.423); --color-stone-100: oklch(.97 .001 106.424); --color-stone-200: oklch(.923 .003 48.717); --color-stone-300: oklch(.869 .005 56.366); --color-stone-400: oklch(.709 .01 56.259); --color-stone-500: oklch(.553 .013 58.071); --color-stone-600: oklch(.444 .011 73.639); --color-stone-700: oklch(.374 .01 67.558); --color-stone-800: oklch(.268 .007 34.298); --color-stone-900: oklch(.216 .006 56.043); --color-stone-950: oklch(.147 .004 49.25); --color-black: #000; --color-white: #fff; --spacing: .25rem; --breakpoint-sm: 40rem; --breakpoint-md: 48rem; --breakpoint-lg: 64rem; --breakpoint-xl: 80rem; --breakpoint-2xl: 96rem; --container-3xs: 16rem; --container-2xs: 18rem; --container-xs: 20rem; --container-sm: 24rem; --container-md: 28rem; --container-lg: 32rem; --container-xl: 36rem; --container-2xl: 42rem; --container-3xl: 48rem; --container-4xl: 56rem; --container-5xl: 64rem; --container-6xl: 72rem; --container-7xl: 80rem; --text-xs: .75rem; --text-xs--line-height: calc(1 / .75); --text-sm: .875rem; --text-sm--line-height: calc(1.25 / .875); --text-base: 1rem; --text-base--line-height: 1.5 ; --text-lg: 1.125rem; --text-lg--line-height: calc(1.75 / 1.125); --text-xl: 1.25rem; --text-xl--line-height: calc(1.75 / 1.25); --text-2xl: 1.5rem; --text-2xl--line-height: calc(2 / 1.5); --text-3xl: 1.875rem; --text-3xl--line-height: 1.2 ; --text-4xl: 2.25rem; --text-4xl--line-height: calc(2.5 / 2.25); --text-5xl: 3rem; --text-5xl--line-height: 1; --text-6xl: 3.75rem; --text-6xl--line-height: 1; --text-7xl: 4.5rem; --text-7xl--line-height: 1; --text-8xl: 6rem; --text-8xl--line-height: 1; --text-9xl: 8rem; --text-9xl--line-height: 1; --font-weight-thin: 100; --font-weight-extralight: 200; --font-weight-light: 300; --font-weight-normal: 400; --font-weight-medium: 500; --font-weight-semibold: 600; --font-weight-bold: 700; --font-weight-extrabold: 800; --font-weight-black: 900; --tracking-tighter: -.05em; --tracking-tight: -.025em; --tracking-normal: 0em; --tracking-wide: .025em; --tracking-wider: .05em; --tracking-widest: .1em; --leading-tight: 1.25; --leading-snug: 1.375; --leading-normal: 1.5; --leading-relaxed: 1.625; --leading-loose: 2; --radius-xs: .125rem; --radius-sm: .25rem; --radius-md: .375rem; --radius-lg: .5rem; --radius-xl: .75rem; --radius-2xl: 1rem; --radius-3xl: 1.5rem; --radius-4xl: 2rem; --shadow-2xs: 0 1px rgb(0 0 0 / .05); --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / .05); --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1); --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1); --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1); --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1); --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / .25); --inset-shadow-2xs: inset 0 1px rgb(0 0 0 / .05); --inset-shadow-xs: inset 0 1px 1px rgb(0 0 0 / .05); --inset-shadow-sm: inset 0 2px 4px rgb(0 0 0 / .05); --drop-shadow-xs: 0 1px 1px rgb(0 0 0 / .05); --drop-shadow-sm: 0 1px 2px rgb(0 0 0 / .15); --drop-shadow-md: 0 3px 3px rgb(0 0 0 / .12); --drop-shadow-lg: 0 4px 4px rgb(0 0 0 / .15); --drop-shadow-xl: 0 9px 7px rgb(0 0 0 / .1); --drop-shadow-2xl: 0 25px 25px rgb(0 0 0 / .15); --ease-in: cubic-bezier(.4, 0, 1, 1); --ease-out: cubic-bezier(0, 0, .2, 1); --ease-in-out: cubic-bezier(.4, 0, .2, 1); --animate-spin: spin 1s linear infinite; --animate-ping: ping 1s cubic-bezier(0, 0, .2, 1) infinite; --animate-pulse: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite; --animate-bounce: bounce 1s infinite; @keyframes spin { to { transform: rotate(360deg); } } @keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } } @keyframes pulse { 50% { opacity: .5; } } @keyframes bounce { 0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(.8, 0, 1, 1); } 50% { transform: none; animation-timing-function: cubic-bezier(0, 0, .2, 1); } } --blur-xs: 4px; --blur-sm: 8px; --blur-md: 12px; --blur-lg: 16px; --blur-xl: 24px; --blur-2xl: 40px; --blur-3xl: 64px; --perspective-dramatic: 100px; --perspective-near: 300px; --perspective-normal: 500px; --perspective-midrange: 800px; --perspective-distant: 1200px; --aspect-video: 16 / 9; --default-transition-duration: .15s; --default-transition-timing-function: cubic-bezier(.4, 0, .2, 1); --default-font-family: var(--font-sans); --default-font-feature-settings: var(--font-sans--font-feature-settings); --default-font-variation-settings: var( --font-sans--font-variation-settings ); --default-mono-font-family: var(--font-mono); --default-mono-font-feature-settings: var( --font-mono--font-feature-settings ); --default-mono-font-variation-settings: var( --font-mono--font-variation-settings ); }@theme default inline reference{ --blur: 8px; --shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1); --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / .05); --drop-shadow: 0 1px 2px rgb(0 0 0 / .1), 0 1px 1px rgb(0 0 0 / .06); --radius: .25rem; --max-width-prose: 65ch; }}@layer base{*,:after,:before,::backdrop,::file-selector-button{box-sizing:border-box;margin:0;padding:0;border:0 solid}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;tab-size:4;font-family:var(--default-font-family, ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\");font-feature-settings:var(--default-font-feature-settings, normal);font-variation-settings:var(--default-font-variation-settings, normal);-webkit-tap-highlight-color:transparent}body{line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace);font-feature-settings:var(--default-mono-font-feature-settings, normal);font-variation-settings:var(--default-mono-font-variation-settings, normal);font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea,::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1;color:color-mix(in oklab,currentColor 50%,transparent)}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]),::file-selector-button{appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{@tailwind utilities;}.theme-dark{--color-primary: black;--color-primary-hover: black;--color-secondary: #ffffff;--color-secondary-hover: black;--color-secondary-hover-border: rgba(234, 236, 240, 1)}.theme-light{--color-primary: #475467;--color-border: #475467;--color-primary-hover: #344054;--color-shadown: 0px 1px 2px 0px rgba(16, 24, 40, .05);--color-secondary: #ffffff;--color-border: #d0d5dd;--color-secondary-hover: #d0d5dd;--color-secondary-hover-border: rgba(234, 236, 240, 1);--color-destructive: #d92d20;--color-destructive-text: #ffff;--color-destructive-border: #d0d5dd;--color-destructive-hover: #b42318;--color-destructive-hover-border: rgba(234, 236, 240, 1)}@theme{ --color-primary: var(--color-primary); --color-primary-hover: var(--color-primary-hover); --color-secondary: var(--color-secondary); --color-secondary-hover: var(--color-secondary-hover); --color-secondary-hover-border: var(--color-secondary-hover-border); }@theme{ --color-test: var(--color-test); --color-np-25: rgba(252, 252, 253, 1); --color-np-50: rgba(249, 250, 251, 1); --color-np-100: rgba(242, 244, 247, 1); --color-np-200: rgba(234, 236, 240, 1); --color-np-300: rgba(208, 213, 221, 1); --color-np-400: rgba(152, 162, 179, 1); --color-np-500: rgba(102, 112, 133, 1); --color-np-primary: rgba(102, 112, 133, 1); --color-np-600: rgba(71, 84, 103, 1); --color-np-700: rgba(52, 64, 84, 1); --color-np-800: rgba(24, 34, 48, 1); --color-np-900: rgba(16, 24, 40, 1); --color-np-950: rgba(12, 17, 29, 1); --animate-fade-in-scale: fade-in-scale .3s ease-out; }button{font-family:Inter,sans-serif;font-weight:600;border-radius:4px;cursor:pointer;gap:10px;position:relative;overflow:hidden}button span{position:absolute;background-color:#fff;transform:translate(-50%,-50%);pointer-events:none;border-radius:50%;animation:animate 1s linear infinite}@keyframes animate{0%{width:0px;height:0px;opacity:.3}to{width:500px;height:500px;opacity:0}}.primary{border:1px solid var(--color-border);background-color:var(--color-primary);color:#fff;box-shadow:0 1px 2px #1018280d}.primary:hover{background-color:var(--color-primary-hover);border:1px solid var(--color-primary-hover);box-shadow:0 1px 2px #1018280d}.primary:focus{box-shadow:0 0 0 4px #f0f2f4;animation:spreadShadow 1.5s infinite alternate}.primary-disabled{background:#f2f4f7;border:1px solid rgb(234,236,240);box-shadow:0 1px 2px #1018280d;color:#98a2b3;cursor:not-allowed}.primary-disabled:hover,.primary-disabled:focus{background:#f2f4f7;border:1px solid rgb(234,236,240);box-shadow:0 1px 2px #1018280d}.secondary{border:1px solid var(--color-border);background:var(--color-secondary);color:#344054;box-shadow:0 1px 2px #1018280d}.secondary:hover{background:var(--color-secondary-hover);border:1px solid var(--color-secondary-hover-border);box-shadow:0 1px 2px #1018280d}.secondary:focus{box-shadow:0 0 0 4px #98a2b324;animation:spreadShadow 1.5s infinite alternate}.secondary-disabled{background:#fff;border:1px solid rgb(234,236,240);box-shadow:var(--color-shadown);color:#98a2b3;cursor:not-allowed!important}.secondary-disabled:hover,.secondary-disabled:focus{background:#fff;border:1px solid rgb(234,236,240);box-shadow:0 1px 2px #1018280d}.destructive{border:1px solid var(--color-border);background:var(--color-destructive);color:var(--color-destructive-text);box-shadow:0 1px 2px #1018280d}.destructive:hover{background:var(--color-destructive-hover);border:1px solid var(--color-destructive-hover-border);box-shadow:0 1px 2px #1018280d}.destructive:focus{box-shadow:0 0 0 4px #98a2b324;animation:spreadShadow 1.5s infinite alternate}.destructive-disabled{background:#f2f4f7;border:1px solid rgb(234,236,240);box-shadow:var(--color-shadown);color:#98a2b3;cursor:not-allowed!important}.destructive-disabled:hover,.destructive-disabled:focus{background:#f2f4f7;border:1px solid rgb(234,236,240);box-shadow:0 1px 2px #1018280d}::ng-deep .fa-spin{animation:fa-spin 2s infinite linear}@keyframes fa-spin{0%{transform:rotate(0)}to{transform:rotate(2turn)}}.warning{border:1px solid rgb(220,104,3);background:#dc6803;color:#fff;box-shadow:0 1px 2px #1018280d}.warning:hover{background:#b54708;border:1px solid rgb(181,71,8);box-shadow:0 1px 2px #1018280d}.warning:focus{border:1px solid rgb(220,104,3);background:#dc6803;box-shadow:0 0 0 4px #dc68030d,0 1px 2px #dc68030d;animation:spreadShadow 1.5s infinite alternate}.warning-disabled{opacity:.7;cursor:not-allowed!important}.warning-disabled:hover,.warning-disabled:focus{border:1px solid rgb(220,104,3);background:#dc6803;color:#fff;box-shadow:0 1px 2px #1018280d}.np-loading{opacity:.7;cursor:not-allowed}.np-loading.primary:hover{border:1px solid var(--color-border);background-color:var(--color-primary);color:#fff;box-shadow:0 1px 2px #1018280d}.np-loading.primary:focus{border:1px solid var(--color-border);background-color:var(--color-primary);color:#fff;box-shadow:0 1px 2px #1018280d}.np-loading.secondary:hover{border:1px solid var(--color-border);background:var(--color-secondary);color:#344054;box-shadow:0 1px 2px #1018280d}.np-loading.secondary:focus{border:1px solid var(--color-border);background:var(--color-secondary);color:#344054;box-shadow:0 1px 2px #1018280d}.np-loading.destructive:hover{border:1px solid var(--color-border);background:var(--color-destructive);color:var(--color-destructive-text);box-shadow:0 1px 2px #1018280d}.np-loading.destructive:focus{border:1px solid var(--color-border);background:var(--color-destructive);color:var(--color-destructive-text);box-shadow:0 1px 2px #1018280d}.np-loading.warning:hover{border:1px solid rgb(220,104,3);background:#dc6803;color:#fff;box-shadow:0 1px 2px #1018280d}.np-loading.warning:focus{border:1px solid rgb(220,104,3);background:#dc6803;color:#fff;box-shadow:0 1px 2px #1018280d}.xs{font-size:14px;line-height:8px;padding:6px 12px;height:28px}.sm{font-size:14px;line-height:20px;padding:8px 12px}.md{font-size:14px;padding:10px 14px;line-height:20px}.lg{font-size:16px;padding:10px 16px;line-height:24px}.bs{padding:4px}img{width:20px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
216
|
+
}
|
|
217
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpButtonComponent, decorators: [{
|
|
218
|
+
type: Component,
|
|
219
|
+
args: [{ selector: 'np-button', imports: [CommonModule], template: "<button\n #container\n class=\"np-button ripple\n {{ npType }}\n {{ npSize }}\n {{ isLoading ? 'np-loading' : '' }}\n {{ disabled ? npType + '-disabled' : ''}}\n {{ className }}\"\n (click)=\"onClick($event)\"\n>\n <div class=\"inline items-center\">\n <i class=\"fa-solid fa-spinner-third fa-spin\" *ngIf=\"isLoading\"></i>\n <ng-content></ng-content>\n </div>\n</button>\n", styles: ["@layer theme,base,components,utilities;@layer theme{@theme default{ --font-sans: ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"; --font-serif: ui-serif, Georgia, Cambria, \"Times New Roman\", Times, serif; --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace; --color-red-50: oklch(.971 .013 17.38); --color-red-100: oklch(.936 .032 17.717); --color-red-200: oklch(.885 .062 18.334); --color-red-300: oklch(.808 .114 19.571); --color-red-400: oklch(.704 .191 22.216); --color-red-500: oklch(.637 .237 25.331); --color-red-600: oklch(.577 .245 27.325); --color-red-700: oklch(.505 .213 27.518); --color-red-800: oklch(.444 .177 26.899); --color-red-900: oklch(.396 .141 25.723); --color-red-950: oklch(.258 .092 26.042); --color-orange-50: oklch(.98 .016 73.684); --color-orange-100: oklch(.954 .038 75.164); --color-orange-200: oklch(.901 .076 70.697); --color-orange-300: oklch(.837 .128 66.29); --color-orange-400: oklch(.75 .183 55.934); --color-orange-500: oklch(.705 .213 47.604); --color-orange-600: oklch(.646 .222 41.116); --color-orange-700: oklch(.553 .195 38.402); --color-orange-800: oklch(.47 .157 37.304); --color-orange-900: oklch(.408 .123 38.172); --color-orange-950: oklch(.266 .079 36.259); --color-amber-50: oklch(.987 .022 95.277); --color-amber-100: oklch(.962 .059 95.617); --color-amber-200: oklch(.924 .12 95.746); --color-amber-300: oklch(.879 .169 91.605); --color-amber-400: oklch(.828 .189 84.429); --color-amber-500: oklch(.769 .188 70.08); --color-amber-600: oklch(.666 .179 58.318); --color-amber-700: oklch(.555 .163 48.998); --color-amber-800: oklch(.473 .137 46.201); --color-amber-900: oklch(.414 .112 45.904); --color-amber-950: oklch(.279 .077 45.635); --color-yellow-50: oklch(.987 .026 102.212); --color-yellow-100: oklch(.973 .071 103.193); --color-yellow-200: oklch(.945 .129 101.54); --color-yellow-300: oklch(.905 .182 98.111); --color-yellow-400: oklch(.852 .199 91.936); --color-yellow-500: oklch(.795 .184 86.047); --color-yellow-600: oklch(.681 .162 75.834); --color-yellow-700: oklch(.554 .135 66.442); --color-yellow-800: oklch(.476 .114 61.907); --color-yellow-900: oklch(.421 .095 57.708); --color-yellow-950: oklch(.286 .066 53.813); --color-lime-50: oklch(.986 .031 120.757); --color-lime-100: oklch(.967 .067 122.328); --color-lime-200: oklch(.938 .127 124.321); --color-lime-300: oklch(.897 .196 126.665); --color-lime-400: oklch(.841 .238 128.85); --color-lime-500: oklch(.768 .233 130.85); --color-lime-600: oklch(.648 .2 131.684); --color-lime-700: oklch(.532 .157 131.589); --color-lime-800: oklch(.453 .124 130.933); --color-lime-900: oklch(.405 .101 131.063); --color-lime-950: oklch(.274 .072 132.109); --color-green-50: oklch(.982 .018 155.826); --color-green-100: oklch(.962 .044 156.743); --color-green-200: oklch(.925 .084 155.995); --color-green-300: oklch(.871 .15 154.449); --color-green-400: oklch(.792 .209 151.711); --color-green-500: oklch(.723 .219 149.579); --color-green-600: oklch(.627 .194 149.214); --color-green-700: oklch(.527 .154 150.069); --color-green-800: oklch(.448 .119 151.328); --color-green-900: oklch(.393 .095 152.535); --color-green-950: oklch(.266 .065 152.934); --color-emerald-50: oklch(.979 .021 166.113); --color-emerald-100: oklch(.95 .052 163.051); --color-emerald-200: oklch(.905 .093 164.15); --color-emerald-300: oklch(.845 .143 164.978); --color-emerald-400: oklch(.765 .177 163.223); --color-emerald-500: oklch(.696 .17 162.48); --color-emerald-600: oklch(.596 .145 163.225); --color-emerald-700: oklch(.508 .118 165.612); --color-emerald-800: oklch(.432 .095 166.913); --color-emerald-900: oklch(.378 .077 168.94); --color-emerald-950: oklch(.262 .051 172.552); --color-teal-50: oklch(.984 .014 180.72); --color-teal-100: oklch(.953 .051 180.801); --color-teal-200: oklch(.91 .096 180.426); --color-teal-300: oklch(.855 .138 181.071); --color-teal-400: oklch(.777 .152 181.912); --color-teal-500: oklch(.704 .14 182.503); --color-teal-600: oklch(.6 .118 184.704); --color-teal-700: oklch(.511 .096 186.391); --color-teal-800: oklch(.437 .078 188.216); --color-teal-900: oklch(.386 .063 188.416); --color-teal-950: oklch(.277 .046 192.524); --color-cyan-50: oklch(.984 .019 200.873); --color-cyan-100: oklch(.956 .045 203.388); --color-cyan-200: oklch(.917 .08 205.041); --color-cyan-300: oklch(.865 .127 207.078); --color-cyan-400: oklch(.789 .154 211.53); --color-cyan-500: oklch(.715 .143 215.221); --color-cyan-600: oklch(.609 .126 221.723); --color-cyan-700: oklch(.52 .105 223.128); --color-cyan-800: oklch(.45 .085 224.283); --color-cyan-900: oklch(.398 .07 227.392); --color-cyan-950: oklch(.302 .056 229.695); --color-sky-50: oklch(.977 .013 236.62); --color-sky-100: oklch(.951 .026 236.824); --color-sky-200: oklch(.901 .058 230.902); --color-sky-300: oklch(.828 .111 230.318); --color-sky-400: oklch(.746 .16 232.661); --color-sky-500: oklch(.685 .169 237.323); --color-sky-600: oklch(.588 .158 241.966); --color-sky-700: oklch(.5 .134 242.749); --color-sky-800: oklch(.443 .11 240.79); --color-sky-900: oklch(.391 .09 240.876); --color-sky-950: oklch(.293 .066 243.157); --color-blue-50: oklch(.97 .014 254.604); --color-blue-100: oklch(.932 .032 255.585); --color-blue-200: oklch(.882 .059 254.128); --color-blue-300: oklch(.809 .105 251.813); --color-blue-400: oklch(.707 .165 254.624); --color-blue-500: oklch(.623 .214 259.815); --color-blue-600: oklch(.546 .245 262.881); --color-blue-700: oklch(.488 .243 264.376); --color-blue-800: oklch(.424 .199 265.638); --color-blue-900: oklch(.379 .146 265.522); --color-blue-950: oklch(.282 .091 267.935); --color-indigo-50: oklch(.962 .018 272.314); --color-indigo-100: oklch(.93 .034 272.788); --color-indigo-200: oklch(.87 .065 274.039); --color-indigo-300: oklch(.785 .115 274.713); --color-indigo-400: oklch(.673 .182 276.935); --color-indigo-500: oklch(.585 .233 277.117); --color-indigo-600: oklch(.511 .262 276.966); --color-indigo-700: oklch(.457 .24 277.023); --color-indigo-800: oklch(.398 .195 277.366); --color-indigo-900: oklch(.359 .144 278.697); --color-indigo-950: oklch(.257 .09 281.288); --color-violet-50: oklch(.969 .016 293.756); --color-violet-100: oklch(.943 .029 294.588); --color-violet-200: oklch(.894 .057 293.283); --color-violet-300: oklch(.811 .111 293.571); --color-violet-400: oklch(.702 .183 293.541); --color-violet-500: oklch(.606 .25 292.717); --color-violet-600: oklch(.541 .281 293.009); --color-violet-700: oklch(.491 .27 292.581); --color-violet-800: oklch(.432 .232 292.759); --color-violet-900: oklch(.38 .189 293.745); --color-violet-950: oklch(.283 .141 291.089); --color-purple-50: oklch(.977 .014 308.299); --color-purple-100: oklch(.946 .033 307.174); --color-purple-200: oklch(.902 .063 306.703); --color-purple-300: oklch(.827 .119 306.383); --color-purple-400: oklch(.714 .203 305.504); --color-purple-500: oklch(.627 .265 303.9); --color-purple-600: oklch(.558 .288 302.321); --color-purple-700: oklch(.496 .265 301.924); --color-purple-800: oklch(.438 .218 303.724); --color-purple-900: oklch(.381 .176 304.987); --color-purple-950: oklch(.291 .149 302.717); --color-fuchsia-50: oklch(.977 .017 320.058); --color-fuchsia-100: oklch(.952 .037 318.852); --color-fuchsia-200: oklch(.903 .076 319.62); --color-fuchsia-300: oklch(.833 .145 321.434); --color-fuchsia-400: oklch(.74 .238 322.16); --color-fuchsia-500: oklch(.667 .295 322.15); --color-fuchsia-600: oklch(.591 .293 322.896); --color-fuchsia-700: oklch(.518 .253 323.949); --color-fuchsia-800: oklch(.452 .211 324.591); --color-fuchsia-900: oklch(.401 .17 325.612); --color-fuchsia-950: oklch(.293 .136 325.661); --color-pink-50: oklch(.971 .014 343.198); --color-pink-100: oklch(.948 .028 342.258); --color-pink-200: oklch(.899 .061 343.231); --color-pink-300: oklch(.823 .12 346.018); --color-pink-400: oklch(.718 .202 349.761); --color-pink-500: oklch(.656 .241 354.308); --color-pink-600: oklch(.592 .249 .584); --color-pink-700: oklch(.525 .223 3.958); --color-pink-800: oklch(.459 .187 3.815); --color-pink-900: oklch(.408 .153 2.432); --color-pink-950: oklch(.284 .109 3.907); --color-rose-50: oklch(.969 .015 12.422); --color-rose-100: oklch(.941 .03 12.58); --color-rose-200: oklch(.892 .058 10.001); --color-rose-300: oklch(.81 .117 11.638); --color-rose-400: oklch(.712 .194 13.428); --color-rose-500: oklch(.645 .246 16.439); --color-rose-600: oklch(.586 .253 17.585); --color-rose-700: oklch(.514 .222 16.935); --color-rose-800: oklch(.455 .188 13.697); --color-rose-900: oklch(.41 .159 10.272); --color-rose-950: oklch(.271 .105 12.094); --color-slate-50: oklch(.984 .003 247.858); --color-slate-100: oklch(.968 .007 247.896); --color-slate-200: oklch(.929 .013 255.508); --color-slate-300: oklch(.869 .022 252.894); --color-slate-400: oklch(.704 .04 256.788); --color-slate-500: oklch(.554 .046 257.417); --color-slate-600: oklch(.446 .043 257.281); --color-slate-700: oklch(.372 .044 257.287); --color-slate-800: oklch(.279 .041 260.031); --color-slate-900: oklch(.208 .042 265.755); --color-slate-950: oklch(.129 .042 264.695); --color-gray-50: oklch(.985 .002 247.839); --color-gray-100: oklch(.967 .003 264.542); --color-gray-200: oklch(.928 .006 264.531); --color-gray-300: oklch(.872 .01 258.338); --color-gray-400: oklch(.707 .022 261.325); --color-gray-500: oklch(.551 .027 264.364); --color-gray-600: oklch(.446 .03 256.802); --color-gray-700: oklch(.373 .034 259.733); --color-gray-800: oklch(.278 .033 256.848); --color-gray-900: oklch(.21 .034 264.665); --color-gray-950: oklch(.13 .028 261.692); --color-zinc-50: oklch(.985 0 0); --color-zinc-100: oklch(.967 .001 286.375); --color-zinc-200: oklch(.92 .004 286.32); --color-zinc-300: oklch(.871 .006 286.286); --color-zinc-400: oklch(.705 .015 286.067); --color-zinc-500: oklch(.552 .016 285.938); --color-zinc-600: oklch(.442 .017 285.786); --color-zinc-700: oklch(.37 .013 285.805); --color-zinc-800: oklch(.274 .006 286.033); --color-zinc-900: oklch(.21 .006 285.885); --color-zinc-950: oklch(.141 .005 285.823); --color-neutral-50: oklch(.985 0 0); --color-neutral-100: oklch(.97 0 0); --color-neutral-200: oklch(.922 0 0); --color-neutral-300: oklch(.87 0 0); --color-neutral-400: oklch(.708 0 0); --color-neutral-500: oklch(.556 0 0); --color-neutral-600: oklch(.439 0 0); --color-neutral-700: oklch(.371 0 0); --color-neutral-800: oklch(.269 0 0); --color-neutral-900: oklch(.205 0 0); --color-neutral-950: oklch(.145 0 0); --color-stone-50: oklch(.985 .001 106.423); --color-stone-100: oklch(.97 .001 106.424); --color-stone-200: oklch(.923 .003 48.717); --color-stone-300: oklch(.869 .005 56.366); --color-stone-400: oklch(.709 .01 56.259); --color-stone-500: oklch(.553 .013 58.071); --color-stone-600: oklch(.444 .011 73.639); --color-stone-700: oklch(.374 .01 67.558); --color-stone-800: oklch(.268 .007 34.298); --color-stone-900: oklch(.216 .006 56.043); --color-stone-950: oklch(.147 .004 49.25); --color-black: #000; --color-white: #fff; --spacing: .25rem; --breakpoint-sm: 40rem; --breakpoint-md: 48rem; --breakpoint-lg: 64rem; --breakpoint-xl: 80rem; --breakpoint-2xl: 96rem; --container-3xs: 16rem; --container-2xs: 18rem; --container-xs: 20rem; --container-sm: 24rem; --container-md: 28rem; --container-lg: 32rem; --container-xl: 36rem; --container-2xl: 42rem; --container-3xl: 48rem; --container-4xl: 56rem; --container-5xl: 64rem; --container-6xl: 72rem; --container-7xl: 80rem; --text-xs: .75rem; --text-xs--line-height: calc(1 / .75); --text-sm: .875rem; --text-sm--line-height: calc(1.25 / .875); --text-base: 1rem; --text-base--line-height: 1.5 ; --text-lg: 1.125rem; --text-lg--line-height: calc(1.75 / 1.125); --text-xl: 1.25rem; --text-xl--line-height: calc(1.75 / 1.25); --text-2xl: 1.5rem; --text-2xl--line-height: calc(2 / 1.5); --text-3xl: 1.875rem; --text-3xl--line-height: 1.2 ; --text-4xl: 2.25rem; --text-4xl--line-height: calc(2.5 / 2.25); --text-5xl: 3rem; --text-5xl--line-height: 1; --text-6xl: 3.75rem; --text-6xl--line-height: 1; --text-7xl: 4.5rem; --text-7xl--line-height: 1; --text-8xl: 6rem; --text-8xl--line-height: 1; --text-9xl: 8rem; --text-9xl--line-height: 1; --font-weight-thin: 100; --font-weight-extralight: 200; --font-weight-light: 300; --font-weight-normal: 400; --font-weight-medium: 500; --font-weight-semibold: 600; --font-weight-bold: 700; --font-weight-extrabold: 800; --font-weight-black: 900; --tracking-tighter: -.05em; --tracking-tight: -.025em; --tracking-normal: 0em; --tracking-wide: .025em; --tracking-wider: .05em; --tracking-widest: .1em; --leading-tight: 1.25; --leading-snug: 1.375; --leading-normal: 1.5; --leading-relaxed: 1.625; --leading-loose: 2; --radius-xs: .125rem; --radius-sm: .25rem; --radius-md: .375rem; --radius-lg: .5rem; --radius-xl: .75rem; --radius-2xl: 1rem; --radius-3xl: 1.5rem; --radius-4xl: 2rem; --shadow-2xs: 0 1px rgb(0 0 0 / .05); --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / .05); --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1); --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1); --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1); --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1); --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / .25); --inset-shadow-2xs: inset 0 1px rgb(0 0 0 / .05); --inset-shadow-xs: inset 0 1px 1px rgb(0 0 0 / .05); --inset-shadow-sm: inset 0 2px 4px rgb(0 0 0 / .05); --drop-shadow-xs: 0 1px 1px rgb(0 0 0 / .05); --drop-shadow-sm: 0 1px 2px rgb(0 0 0 / .15); --drop-shadow-md: 0 3px 3px rgb(0 0 0 / .12); --drop-shadow-lg: 0 4px 4px rgb(0 0 0 / .15); --drop-shadow-xl: 0 9px 7px rgb(0 0 0 / .1); --drop-shadow-2xl: 0 25px 25px rgb(0 0 0 / .15); --ease-in: cubic-bezier(.4, 0, 1, 1); --ease-out: cubic-bezier(0, 0, .2, 1); --ease-in-out: cubic-bezier(.4, 0, .2, 1); --animate-spin: spin 1s linear infinite; --animate-ping: ping 1s cubic-bezier(0, 0, .2, 1) infinite; --animate-pulse: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite; --animate-bounce: bounce 1s infinite; @keyframes spin { to { transform: rotate(360deg); } } @keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } } @keyframes pulse { 50% { opacity: .5; } } @keyframes bounce { 0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(.8, 0, 1, 1); } 50% { transform: none; animation-timing-function: cubic-bezier(0, 0, .2, 1); } } --blur-xs: 4px; --blur-sm: 8px; --blur-md: 12px; --blur-lg: 16px; --blur-xl: 24px; --blur-2xl: 40px; --blur-3xl: 64px; --perspective-dramatic: 100px; --perspective-near: 300px; --perspective-normal: 500px; --perspective-midrange: 800px; --perspective-distant: 1200px; --aspect-video: 16 / 9; --default-transition-duration: .15s; --default-transition-timing-function: cubic-bezier(.4, 0, .2, 1); --default-font-family: var(--font-sans); --default-font-feature-settings: var(--font-sans--font-feature-settings); --default-font-variation-settings: var( --font-sans--font-variation-settings ); --default-mono-font-family: var(--font-mono); --default-mono-font-feature-settings: var( --font-mono--font-feature-settings ); --default-mono-font-variation-settings: var( --font-mono--font-variation-settings ); }@theme default inline reference{ --blur: 8px; --shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1); --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / .05); --drop-shadow: 0 1px 2px rgb(0 0 0 / .1), 0 1px 1px rgb(0 0 0 / .06); --radius: .25rem; --max-width-prose: 65ch; }}@layer base{*,:after,:before,::backdrop,::file-selector-button{box-sizing:border-box;margin:0;padding:0;border:0 solid}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;tab-size:4;font-family:var(--default-font-family, ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\");font-feature-settings:var(--default-font-feature-settings, normal);font-variation-settings:var(--default-font-variation-settings, normal);-webkit-tap-highlight-color:transparent}body{line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace);font-feature-settings:var(--default-mono-font-feature-settings, normal);font-variation-settings:var(--default-mono-font-variation-settings, normal);font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea,::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1;color:color-mix(in oklab,currentColor 50%,transparent)}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]),::file-selector-button{appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{@tailwind utilities;}.theme-dark{--color-primary: black;--color-primary-hover: black;--color-secondary: #ffffff;--color-secondary-hover: black;--color-secondary-hover-border: rgba(234, 236, 240, 1)}.theme-light{--color-primary: #475467;--color-border: #475467;--color-primary-hover: #344054;--color-shadown: 0px 1px 2px 0px rgba(16, 24, 40, .05);--color-secondary: #ffffff;--color-border: #d0d5dd;--color-secondary-hover: #d0d5dd;--color-secondary-hover-border: rgba(234, 236, 240, 1);--color-destructive: #d92d20;--color-destructive-text: #ffff;--color-destructive-border: #d0d5dd;--color-destructive-hover: #b42318;--color-destructive-hover-border: rgba(234, 236, 240, 1)}@theme{ --color-primary: var(--color-primary); --color-primary-hover: var(--color-primary-hover); --color-secondary: var(--color-secondary); --color-secondary-hover: var(--color-secondary-hover); --color-secondary-hover-border: var(--color-secondary-hover-border); }@theme{ --color-test: var(--color-test); --color-np-25: rgba(252, 252, 253, 1); --color-np-50: rgba(249, 250, 251, 1); --color-np-100: rgba(242, 244, 247, 1); --color-np-200: rgba(234, 236, 240, 1); --color-np-300: rgba(208, 213, 221, 1); --color-np-400: rgba(152, 162, 179, 1); --color-np-500: rgba(102, 112, 133, 1); --color-np-primary: rgba(102, 112, 133, 1); --color-np-600: rgba(71, 84, 103, 1); --color-np-700: rgba(52, 64, 84, 1); --color-np-800: rgba(24, 34, 48, 1); --color-np-900: rgba(16, 24, 40, 1); --color-np-950: rgba(12, 17, 29, 1); --animate-fade-in-scale: fade-in-scale .3s ease-out; }button{font-family:Inter,sans-serif;font-weight:600;border-radius:4px;cursor:pointer;gap:10px;position:relative;overflow:hidden}button span{position:absolute;background-color:#fff;transform:translate(-50%,-50%);pointer-events:none;border-radius:50%;animation:animate 1s linear infinite}@keyframes animate{0%{width:0px;height:0px;opacity:.3}to{width:500px;height:500px;opacity:0}}.primary{border:1px solid var(--color-border);background-color:var(--color-primary);color:#fff;box-shadow:0 1px 2px #1018280d}.primary:hover{background-color:var(--color-primary-hover);border:1px solid var(--color-primary-hover);box-shadow:0 1px 2px #1018280d}.primary:focus{box-shadow:0 0 0 4px #f0f2f4;animation:spreadShadow 1.5s infinite alternate}.primary-disabled{background:#f2f4f7;border:1px solid rgb(234,236,240);box-shadow:0 1px 2px #1018280d;color:#98a2b3;cursor:not-allowed}.primary-disabled:hover,.primary-disabled:focus{background:#f2f4f7;border:1px solid rgb(234,236,240);box-shadow:0 1px 2px #1018280d}.secondary{border:1px solid var(--color-border);background:var(--color-secondary);color:#344054;box-shadow:0 1px 2px #1018280d}.secondary:hover{background:var(--color-secondary-hover);border:1px solid var(--color-secondary-hover-border);box-shadow:0 1px 2px #1018280d}.secondary:focus{box-shadow:0 0 0 4px #98a2b324;animation:spreadShadow 1.5s infinite alternate}.secondary-disabled{background:#fff;border:1px solid rgb(234,236,240);box-shadow:var(--color-shadown);color:#98a2b3;cursor:not-allowed!important}.secondary-disabled:hover,.secondary-disabled:focus{background:#fff;border:1px solid rgb(234,236,240);box-shadow:0 1px 2px #1018280d}.destructive{border:1px solid var(--color-border);background:var(--color-destructive);color:var(--color-destructive-text);box-shadow:0 1px 2px #1018280d}.destructive:hover{background:var(--color-destructive-hover);border:1px solid var(--color-destructive-hover-border);box-shadow:0 1px 2px #1018280d}.destructive:focus{box-shadow:0 0 0 4px #98a2b324;animation:spreadShadow 1.5s infinite alternate}.destructive-disabled{background:#f2f4f7;border:1px solid rgb(234,236,240);box-shadow:var(--color-shadown);color:#98a2b3;cursor:not-allowed!important}.destructive-disabled:hover,.destructive-disabled:focus{background:#f2f4f7;border:1px solid rgb(234,236,240);box-shadow:0 1px 2px #1018280d}::ng-deep .fa-spin{animation:fa-spin 2s infinite linear}@keyframes fa-spin{0%{transform:rotate(0)}to{transform:rotate(2turn)}}.warning{border:1px solid rgb(220,104,3);background:#dc6803;color:#fff;box-shadow:0 1px 2px #1018280d}.warning:hover{background:#b54708;border:1px solid rgb(181,71,8);box-shadow:0 1px 2px #1018280d}.warning:focus{border:1px solid rgb(220,104,3);background:#dc6803;box-shadow:0 0 0 4px #dc68030d,0 1px 2px #dc68030d;animation:spreadShadow 1.5s infinite alternate}.warning-disabled{opacity:.7;cursor:not-allowed!important}.warning-disabled:hover,.warning-disabled:focus{border:1px solid rgb(220,104,3);background:#dc6803;color:#fff;box-shadow:0 1px 2px #1018280d}.np-loading{opacity:.7;cursor:not-allowed}.np-loading.primary:hover{border:1px solid var(--color-border);background-color:var(--color-primary);color:#fff;box-shadow:0 1px 2px #1018280d}.np-loading.primary:focus{border:1px solid var(--color-border);background-color:var(--color-primary);color:#fff;box-shadow:0 1px 2px #1018280d}.np-loading.secondary:hover{border:1px solid var(--color-border);background:var(--color-secondary);color:#344054;box-shadow:0 1px 2px #1018280d}.np-loading.secondary:focus{border:1px solid var(--color-border);background:var(--color-secondary);color:#344054;box-shadow:0 1px 2px #1018280d}.np-loading.destructive:hover{border:1px solid var(--color-border);background:var(--color-destructive);color:var(--color-destructive-text);box-shadow:0 1px 2px #1018280d}.np-loading.destructive:focus{border:1px solid var(--color-border);background:var(--color-destructive);color:var(--color-destructive-text);box-shadow:0 1px 2px #1018280d}.np-loading.warning:hover{border:1px solid rgb(220,104,3);background:#dc6803;color:#fff;box-shadow:0 1px 2px #1018280d}.np-loading.warning:focus{border:1px solid rgb(220,104,3);background:#dc6803;color:#fff;box-shadow:0 1px 2px #1018280d}.xs{font-size:14px;line-height:8px;padding:6px 12px;height:28px}.sm{font-size:14px;line-height:20px;padding:8px 12px}.md{font-size:14px;padding:10px 14px;line-height:20px}.lg{font-size:16px;padding:10px 16px;line-height:24px}.bs{padding:4px}img{width:20px}\n"] }]
|
|
220
|
+
}], ctorParameters: () => [{ type: i0.Renderer2 }], propDecorators: { container: [{
|
|
221
|
+
type: ViewChild,
|
|
222
|
+
args: ['container', { static: true }]
|
|
223
|
+
}], npType: [{
|
|
224
|
+
type: Input
|
|
225
|
+
}], npSize: [{
|
|
226
|
+
type: Input
|
|
227
|
+
}], className: [{
|
|
228
|
+
type: Input
|
|
229
|
+
}], isLoading: [{
|
|
230
|
+
type: Input
|
|
231
|
+
}], disabled: [{
|
|
232
|
+
type: Input
|
|
233
|
+
}], ngContent: [{
|
|
234
|
+
type: Input
|
|
235
|
+
}] } });
|
|
236
|
+
|
|
237
|
+
class NpCheckboxComponent {
|
|
238
|
+
_input = new FormControl('');
|
|
239
|
+
set input(value) {
|
|
240
|
+
if (value === true) {
|
|
241
|
+
this._input.patchValue(true);
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
this._input = !!value ? value : new FormControl(false);
|
|
245
|
+
}
|
|
246
|
+
type = '';
|
|
247
|
+
size = 'md';
|
|
248
|
+
npType = 'checkbox';
|
|
249
|
+
isDisabled = false;
|
|
250
|
+
groupName = 'radioGroup';
|
|
251
|
+
label;
|
|
252
|
+
description;
|
|
253
|
+
isIndeterminate = false;
|
|
254
|
+
valueChange = new EventEmitter();
|
|
255
|
+
onChange(event) {
|
|
256
|
+
const inputElement = event.target;
|
|
257
|
+
const value = inputElement.checked;
|
|
258
|
+
this._input?.patchValue(value);
|
|
259
|
+
this.valueChange.emit(value);
|
|
260
|
+
}
|
|
261
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
262
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: NpCheckboxComponent, isStandalone: true, selector: "np-checkbox", inputs: { input: "input", type: "type", size: "size", npType: "npType", isDisabled: "isDisabled", groupName: "groupName", label: "label", description: "description", isIndeterminate: "isIndeterminate" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: "<label\n [ngClass]=\"[\n size,\n isIndeterminate ? 'indeterminate' : type,\n isDisabled ? 'disabled' : '',\n _input.value ? 'isChecked' : '',\n ]\"\n>\n <input\n [type]=\"type === 'radio' ? 'radio' : 'checkbox'\"\n [name]=\"type === 'radio' ? groupName : null\"\n [checked]=\"_input.value\"\n [disabled]=\"isDisabled\"\n (change)=\"onChange($event)\"\n />\n <span\n [ngClass]=\"[\n 'custom-checkbox',\n isIndeterminate ? 'indeterminate' : type,\n isDisabled ? 'span-disabled' : ''\n ]\"\n ></span>\n <div>\n <np-typography\n *ngIf=\"label\"\n [class]=\"'label-' + size\"\n npType=\"text\"\n npSize=\"sm\"\n npWeight=\"medium\"\n style=\"color: rgba(52, 64, 84, 1)\"\n >{{ label }}</np-typography\n >\n <np-typography\n *ngIf=\"description\"\n [class]=\"'description-' + size\"\n npType=\"text\"\n npSize=\"sm\"\n npWeight=\"regular\"\n style=\"color: rgba(71, 84, 103, 1)\"\n >{{ description }}</np-typography\n >\n </div>\n</label>\n\n<!-- <label nz-checkbox >Checkbox</label> -->\n", styles: ["input[type=checkbox],input[type=radio]{display:none}.checkbox,.indeterminate,.radio{display:flex;gap:5px}.custom-checkbox{display:flex;border:1px solid rgb(208,213,221);border-radius:2px;cursor:pointer;position:relative;transition:all .6s ease}input:checked+.custom-checkbox{background:#475467;border:1px solid rgb(71,84,103)}input:checked+.custom-checkbox:after{position:absolute;left:50%;top:60%;transform:translate(-50%,-50%)}input:checked+.checkbox:after{min-height:16px;text-align:center;content:url(/assets/images/check.svg)}.checkbox span:hover{background:#475467;border:1px solid rgb(71,84,103);content:url(/assets/images/check.svg)}.checkbox span:focus{box-shadow:0 0 0 4px #98a2b324}input:checked+.indeterminate:after{content:url(/assets/images/minus.svg)}.indeterminate span:hover{background:#475467;border:1px solid rgb(71,84,103);content:url(/assets/images/minus.svg)}.indeterminate span:focus{box-shadow:0 0 0 4px #98a2b324}.radio .custom-checkbox{border-radius:50%}.radio .custom-checkbox:hover{background:#475467;border-color:#475467}.radio .custom-checkbox:hover:after{content:\"\";background:#fff;border-radius:50%;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}.radio input:checked+.custom-checkbox:after{content:\"\";background:#fff;border-radius:50%;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);animation:.36s ease-in-out 0s 1 normal backwards running antCheckboxEffect;transition:all .6s ease}.sm .custom-checkbox{display:flex;width:16px;height:16px;min-width:16px}.md .custom-checkbox{display:flex;width:20px;height:20px;min-width:20px}.sm.radio input:checked+.custom-checkbox:after,.sm.radio .custom-checkbox:hover:after{width:6px;height:6px}.md.radio input:checked+.custom-checkbox:after,.md.radio .custom-checkbox:hover:after{width:8px;height:8px}.checkbox-label,.checkbox-description{margin:0}.label-sm{font-family:Inter,sans-serif;font-weight:500;font-size:14px;line-height:16px;color:#344054;cursor:pointer}.label-md{font-family:Inter,sans-serif;font-weight:500;font-size:16px;line-height:24px;color:#344054;cursor:pointer}.description-sm{font-family:Inter,sans-serif;font-weight:400;font-size:14px;line-height:16px;color:#475467}.description-md{font-family:Inter,sans-serif;font-weight:400;font-size:16px;line-height:24px;color:#475467}.disabled{cursor:not-allowed!important}.disabled .checkbox-label{cursor:not-allowed}.span-disabled{cursor:not-allowed!important;background-color:#f9fafb!important;border:1px solid rgb(208,213,221)!important}.radio.disabled input:checked+.custom-checkbox{border:1px solid rgb(208,213,221);background:#f9fafb}.radio.disabled input:checked+.custom-checkbox:after{background:#d0d5dd}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: NzCheckboxModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: NzButtonModule }, { kind: "ngmodule", type: NzSwitchModule }, { kind: "component", type: NpTypographyComponent, selector: "np-typography", inputs: ["npType", "npSize", "npWeight", "ngContent"] }] });
|
|
263
|
+
}
|
|
264
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpCheckboxComponent, decorators: [{
|
|
265
|
+
type: Component,
|
|
266
|
+
args: [{ selector: 'np-checkbox', imports: [
|
|
267
|
+
CommonModule,
|
|
268
|
+
NzCheckboxModule,
|
|
269
|
+
FormsModule,
|
|
270
|
+
ReactiveFormsModule,
|
|
271
|
+
NzButtonModule,
|
|
272
|
+
NzSwitchModule,
|
|
273
|
+
NpTypographyComponent,
|
|
274
|
+
], template: "<label\n [ngClass]=\"[\n size,\n isIndeterminate ? 'indeterminate' : type,\n isDisabled ? 'disabled' : '',\n _input.value ? 'isChecked' : '',\n ]\"\n>\n <input\n [type]=\"type === 'radio' ? 'radio' : 'checkbox'\"\n [name]=\"type === 'radio' ? groupName : null\"\n [checked]=\"_input.value\"\n [disabled]=\"isDisabled\"\n (change)=\"onChange($event)\"\n />\n <span\n [ngClass]=\"[\n 'custom-checkbox',\n isIndeterminate ? 'indeterminate' : type,\n isDisabled ? 'span-disabled' : ''\n ]\"\n ></span>\n <div>\n <np-typography\n *ngIf=\"label\"\n [class]=\"'label-' + size\"\n npType=\"text\"\n npSize=\"sm\"\n npWeight=\"medium\"\n style=\"color: rgba(52, 64, 84, 1)\"\n >{{ label }}</np-typography\n >\n <np-typography\n *ngIf=\"description\"\n [class]=\"'description-' + size\"\n npType=\"text\"\n npSize=\"sm\"\n npWeight=\"regular\"\n style=\"color: rgba(71, 84, 103, 1)\"\n >{{ description }}</np-typography\n >\n </div>\n</label>\n\n<!-- <label nz-checkbox >Checkbox</label> -->\n", styles: ["input[type=checkbox],input[type=radio]{display:none}.checkbox,.indeterminate,.radio{display:flex;gap:5px}.custom-checkbox{display:flex;border:1px solid rgb(208,213,221);border-radius:2px;cursor:pointer;position:relative;transition:all .6s ease}input:checked+.custom-checkbox{background:#475467;border:1px solid rgb(71,84,103)}input:checked+.custom-checkbox:after{position:absolute;left:50%;top:60%;transform:translate(-50%,-50%)}input:checked+.checkbox:after{min-height:16px;text-align:center;content:url(/assets/images/check.svg)}.checkbox span:hover{background:#475467;border:1px solid rgb(71,84,103);content:url(/assets/images/check.svg)}.checkbox span:focus{box-shadow:0 0 0 4px #98a2b324}input:checked+.indeterminate:after{content:url(/assets/images/minus.svg)}.indeterminate span:hover{background:#475467;border:1px solid rgb(71,84,103);content:url(/assets/images/minus.svg)}.indeterminate span:focus{box-shadow:0 0 0 4px #98a2b324}.radio .custom-checkbox{border-radius:50%}.radio .custom-checkbox:hover{background:#475467;border-color:#475467}.radio .custom-checkbox:hover:after{content:\"\";background:#fff;border-radius:50%;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}.radio input:checked+.custom-checkbox:after{content:\"\";background:#fff;border-radius:50%;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);animation:.36s ease-in-out 0s 1 normal backwards running antCheckboxEffect;transition:all .6s ease}.sm .custom-checkbox{display:flex;width:16px;height:16px;min-width:16px}.md .custom-checkbox{display:flex;width:20px;height:20px;min-width:20px}.sm.radio input:checked+.custom-checkbox:after,.sm.radio .custom-checkbox:hover:after{width:6px;height:6px}.md.radio input:checked+.custom-checkbox:after,.md.radio .custom-checkbox:hover:after{width:8px;height:8px}.checkbox-label,.checkbox-description{margin:0}.label-sm{font-family:Inter,sans-serif;font-weight:500;font-size:14px;line-height:16px;color:#344054;cursor:pointer}.label-md{font-family:Inter,sans-serif;font-weight:500;font-size:16px;line-height:24px;color:#344054;cursor:pointer}.description-sm{font-family:Inter,sans-serif;font-weight:400;font-size:14px;line-height:16px;color:#475467}.description-md{font-family:Inter,sans-serif;font-weight:400;font-size:16px;line-height:24px;color:#475467}.disabled{cursor:not-allowed!important}.disabled .checkbox-label{cursor:not-allowed}.span-disabled{cursor:not-allowed!important;background-color:#f9fafb!important;border:1px solid rgb(208,213,221)!important}.radio.disabled input:checked+.custom-checkbox{border:1px solid rgb(208,213,221);background:#f9fafb}.radio.disabled input:checked+.custom-checkbox:after{background:#d0d5dd}\n"] }]
|
|
275
|
+
}], propDecorators: { input: [{
|
|
276
|
+
type: Input
|
|
277
|
+
}], type: [{
|
|
278
|
+
type: Input
|
|
279
|
+
}], size: [{
|
|
280
|
+
type: Input
|
|
281
|
+
}], npType: [{
|
|
282
|
+
type: Input
|
|
283
|
+
}], isDisabled: [{
|
|
284
|
+
type: Input
|
|
285
|
+
}], groupName: [{
|
|
286
|
+
type: Input
|
|
287
|
+
}], label: [{
|
|
288
|
+
type: Input
|
|
289
|
+
}], description: [{
|
|
290
|
+
type: Input
|
|
291
|
+
}], isIndeterminate: [{
|
|
292
|
+
type: Input
|
|
293
|
+
}], valueChange: [{
|
|
294
|
+
type: Output
|
|
295
|
+
}] } });
|
|
296
|
+
|
|
297
|
+
const FORM_ERROR_MAP = new InjectionToken('FORM_ERROR_MAP');
|
|
298
|
+
|
|
299
|
+
class NpInputFieldComponent {
|
|
300
|
+
decimalPipe;
|
|
301
|
+
defaultErrorMap;
|
|
302
|
+
constructor(decimalPipe, defaultErrorMap) {
|
|
303
|
+
this.decimalPipe = decimalPipe;
|
|
304
|
+
this.defaultErrorMap = defaultErrorMap;
|
|
305
|
+
}
|
|
306
|
+
inputRef;
|
|
307
|
+
size = '';
|
|
308
|
+
label;
|
|
309
|
+
placeholder = '';
|
|
310
|
+
iconLeft;
|
|
311
|
+
iconRight;
|
|
312
|
+
hint;
|
|
313
|
+
errorMap;
|
|
314
|
+
disabled = false;
|
|
315
|
+
limitValue;
|
|
316
|
+
functionHandler;
|
|
317
|
+
submitted = false;
|
|
318
|
+
digitsInfo = '1.2-2';
|
|
319
|
+
locale = 'en-US';
|
|
320
|
+
inputType = 'text';
|
|
321
|
+
passwordVisible = false;
|
|
322
|
+
_input = new FormControl('');
|
|
323
|
+
_type = 'text';
|
|
324
|
+
set input(value) {
|
|
325
|
+
this._input = value ? value : new FormControl('');
|
|
326
|
+
}
|
|
327
|
+
set type(value) {
|
|
328
|
+
this._type = value;
|
|
329
|
+
this.updateInputType();
|
|
330
|
+
}
|
|
331
|
+
get type() {
|
|
332
|
+
return this._type;
|
|
333
|
+
}
|
|
334
|
+
valueChange = new EventEmitter();
|
|
335
|
+
iconLeftClick = new EventEmitter();
|
|
336
|
+
iconRightClick = new EventEmitter();
|
|
337
|
+
onChangeValue() {
|
|
338
|
+
this.valueChange.emit(this._input?.value);
|
|
339
|
+
}
|
|
340
|
+
updateInputType() {
|
|
341
|
+
if (this._type === 'password') {
|
|
342
|
+
this.inputType = this.passwordVisible ? 'text' : 'password';
|
|
343
|
+
}
|
|
344
|
+
else if (this._type === 'date') {
|
|
345
|
+
this.inputType = 'date';
|
|
346
|
+
}
|
|
347
|
+
else if (this._type === 'number') {
|
|
348
|
+
this.inputType = 'number';
|
|
349
|
+
}
|
|
350
|
+
else {
|
|
351
|
+
this.inputType = 'text';
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
togglePassword() {
|
|
355
|
+
this.passwordVisible = !this.passwordVisible;
|
|
356
|
+
this.updateInputType();
|
|
357
|
+
}
|
|
358
|
+
get computedStatus() {
|
|
359
|
+
if (!this._input)
|
|
360
|
+
return undefined;
|
|
361
|
+
const control = this._input;
|
|
362
|
+
const showError = control.invalid && (control.dirty || control.touched || this.submitted);
|
|
363
|
+
return showError ? 'error' : undefined;
|
|
364
|
+
}
|
|
365
|
+
get errorMessageFromInput() {
|
|
366
|
+
if (!this._input || !this._input.errors)
|
|
367
|
+
return null;
|
|
368
|
+
const firstKey = Object.keys(this._input.errors)[0];
|
|
369
|
+
return (this.errorMap?.[firstKey] || this.defaultErrorMap?.[firstKey] || null);
|
|
370
|
+
}
|
|
371
|
+
handleKeyPress(event) {
|
|
372
|
+
if (this._type === 'number') {
|
|
373
|
+
const isDigit = /^[0-9]$/.test(event.key);
|
|
374
|
+
if (!isDigit) {
|
|
375
|
+
event.preventDefault();
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
if (this._type === 'text') {
|
|
379
|
+
const isLetter = /^[a-zA-Z ]$/.test(event.key);
|
|
380
|
+
if (!isLetter) {
|
|
381
|
+
event.preventDefault();
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
onInputChange(event) {
|
|
386
|
+
const input = event.target.value;
|
|
387
|
+
const reg = /^-?(0|[1-9][0-9]*)(\.[0-9]*)?$/;
|
|
388
|
+
if (this.limitValue && input.length > this.limitValue) {
|
|
389
|
+
event.target.value = this._input.value || '';
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
if (this.type === 'number') {
|
|
393
|
+
if ((!isNaN(+input) && reg.test(input)) ||
|
|
394
|
+
input === '' ||
|
|
395
|
+
input === '-') {
|
|
396
|
+
this._input.setValue(input);
|
|
397
|
+
this.valueChange.emit(input);
|
|
398
|
+
}
|
|
399
|
+
else {
|
|
400
|
+
event.target.value = this._input.value || '';
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
else {
|
|
404
|
+
if (this.limitValue && input.length > this.limitValue) {
|
|
405
|
+
event.target.value = this._input.value || '';
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
this._input.setValue(input);
|
|
409
|
+
this.valueChange.emit(input);
|
|
410
|
+
if (this.type === 'function') {
|
|
411
|
+
try {
|
|
412
|
+
this.functionHandler?.(input);
|
|
413
|
+
}
|
|
414
|
+
catch (e) {
|
|
415
|
+
console.warn('functionHandler error:', e);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
onBlur() {
|
|
421
|
+
if (this.type === 'number') {
|
|
422
|
+
const raw = this._input.value;
|
|
423
|
+
const numeric = Number(raw?.toString().replace(/,/g, ''));
|
|
424
|
+
const formatted = this.decimalPipe.transform(numeric, this.digitsInfo, this.locale);
|
|
425
|
+
if (formatted) {
|
|
426
|
+
if (this.inputRef?.nativeElement) {
|
|
427
|
+
this.inputRef.nativeElement.value = formatted;
|
|
428
|
+
}
|
|
429
|
+
const standardized = Number(formatted.replace(/,/g, ''));
|
|
430
|
+
this._input.setValue(standardized);
|
|
431
|
+
}
|
|
432
|
+
else {
|
|
433
|
+
this._input.setValue(numeric);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
handleIconLeftClick() {
|
|
438
|
+
this.iconLeftClick.emit();
|
|
439
|
+
}
|
|
440
|
+
handleIconRightClick() {
|
|
441
|
+
this.iconRightClick.emit();
|
|
442
|
+
}
|
|
443
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpInputFieldComponent, deps: [{ token: i1$1.DecimalPipe }, { token: FORM_ERROR_MAP, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
444
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: NpInputFieldComponent, isStandalone: true, selector: "np-input-field", inputs: { size: "size", label: "label", placeholder: "placeholder", iconLeft: "iconLeft", iconRight: "iconRight", hint: "hint", errorMap: "errorMap", disabled: "disabled", limitValue: "limitValue", functionHandler: "functionHandler", submitted: "submitted", digitsInfo: "digitsInfo", locale: "locale", input: "input", type: "type" }, outputs: { valueChange: "valueChange", iconLeftClick: "iconLeftClick", iconRightClick: "iconRightClick" }, providers: [DecimalPipe], viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["inputRef"], descendants: true, static: true }], ngImport: i0, template: "<div class=\"input-wrapper flex column w-full\">\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"medium\" *ngIf=\"label\" class=\"input-label\">{{ label }}</np-typography>\n\n <ng-container *ngIf=\"type === 'date'; else normalInput\">\n <div [ngClass]=\"size\">\n <nz-date-picker\n [formControl]=\"_input\"\n [nzDisabled]=\"disabled\"\n [nzFormat]=\"'yyyy-MM-dd'\"\n class=\"w-full\"\n ></nz-date-picker>\n </div>\n </ng-container>\n <ng-template #normalInput>\n <nz-input-group\n [class]=\"[size,'input-group', computedStatus === 'error' ? 'error' : '']\"\n [nzSuffix]=\"suffixTemplateInfo\"\n [nzPrefix]=\"prefixTemplateUser\"\n >\n <input\n #inputRef\n nz-input\n [type]=\"inputType\"\n [placeholder]=\"placeholder\"\n [ngClass]=\"{ 'disabled': disabled}\"\n [value]=\"_input.value\"\n (input)=\"onInputChange($event)\"\n (blur)=\"onBlur()\"\n (keypress)=\"handleKeyPress($event)\"\n />\n </nz-input-group>\n </ng-template>\n\n <ng-template #prefixTemplateUser>\n <i class=\"{{ iconLeft }} icon-input\" (click)=\"handleIconLeftClick()\"></i>\n </ng-template>\n\n <ng-template #suffixTemplateInfo>\n <i\n class=\"{{ iconRight }} icon-input\"\n *ngIf=\"type !== 'password'\"\n (click)=\"handleIconRightClick()\"\n ></i>\n <span\n *ngIf=\"type == 'password'\"\n nz-icon\n class=\"ant-input-password-icon\"\n [nzType]=\"passwordVisible ? 'eye' : 'eye-invisible'\"\n (click)=\"togglePassword()\">\n </span>\n </ng-template>\n\n <div class=\"flex justify-between\" *ngIf=\"computedStatus === 'error' || hint || limitValue && type !== 'date'\">\n <div class=\"flex flex-col w-full mb-3\">\n <np-typography *ngIf=\"computedStatus === 'error'\" class=\"input-error text-red-500\">{{ errorMessageFromInput }}</np-typography>\n <np-typography *ngIf=\"hint\" class=\"input-hint\">{{ hint }}</np-typography>\n </div>\n <np-typography *ngIf=\"limitValue && type !== 'date'\" class=\"limit-value\">\n {{ (_input.value?.toString()?.length) || 0 }}/{{ limitValue }}\n </np-typography>\n </div>\n</div>\n", styles: [".input-wrapper{display:flex;flex-direction:column;gap:4px}.input-label{color:#344054}.bs{height:36px}.sm{height:40px!important}.md{height:44px}.ant-input-affix-wrapper{border-color:#d0d5dd!important;border-radius:4px}.ant-input-affix-wrapper:hover,.ant-input-affix-wrapper:focus,.ant-input-affix-wrapper:focus-visible,.ant-input-affix-wrapper:focus-within{box-shadow:0 0 0 4px #f0f2f4}.ant-input-affix-wrapper.error{border:1px solid rgb(253,162,155)!important}.ant-input-affix-wrapper.error:hover,.ant-input-affix-wrapper.error:focus,.ant-input-affix-wrapper.error:focus-visible,.ant-input-affix-wrapper.error:focus-within{box-shadow:0 0 0 4px #f044383d}.ant-input-affix-wrapper-disabled{border:1px solid rgb(208,213,221)!important;pointer-events:none}.ant-input-affix-wrapper-disabled:hover,.ant-input-affix-wrapper-disabled:focus,.ant-input-affix-wrapper-disabled:focus-visible,.ant-input-affix-wrapper-disabled:focus-within{box-shadow:none}.ant-input-affix-wrapper-disabled .ant-input-password-icon.anticon,.ant-input-affix-wrapper-disabled .ant-input-password-icon.anticon:hover{color:#d0d5dd}.input-hint,.limit-value{color:#475467}.icon-input{color:#667085}::ng-deep span.ant-input-prefix{margin-right:6px!important}::ng-deep .sm .ant-picker{height:40px!important}::ng-deep .md .ant-picker{height:44px!important}::ng-deep .ant-picker{border-color:#d0d5dd!important;border-radius:4px}::ng-deep .ant-picker:hover,::ng-deep .ant-picker:focus,::ng-deep .ant-picker:focus-visible,::ng-deep .ant-picker:focus-within{box-shadow:0 0 0 4px #f0f2f4}::ng-deep .error{border:1px solid rgb(253,162,155)!important}::ng-deep .error:hover,::ng-deep .error:focus,::ng-deep .error:focus-visible,::ng-deep .error:focus-within{box-shadow:0 0 0 4px #f044383d!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: NzInputModule }, { kind: "directive", type: i3.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzBorderless", "nzSize", "nzStepperless", "nzStatus", "disabled"], exportAs: ["nzInput"] }, { kind: "component", type: i3.NzInputGroupComponent, selector: "nz-input-group", inputs: ["nzAddOnBeforeIcon", "nzAddOnAfterIcon", "nzPrefixIcon", "nzSuffixIcon", "nzAddOnBefore", "nzAddOnAfter", "nzPrefix", "nzStatus", "nzSuffix", "nzSize", "nzSearch", "nzCompact"], exportAs: ["nzInputGroup"] }, { kind: "directive", type: i3.NzInputGroupWhitSuffixOrPrefixDirective, selector: "nz-input-group[nzSuffix], nz-input-group[nzPrefix]" }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i1$2.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "component", type: NpTypographyComponent, selector: "np-typography", inputs: ["npType", "npSize", "npWeight", "ngContent"] }, { kind: "ngmodule", type: NzDatePickerModule }, { kind: "component", type: i5.NzDatePickerComponent, selector: "nz-date-picker,nz-week-picker,nz-month-picker,nz-quarter-picker,nz-year-picker,nz-range-picker", inputs: ["nzAllowClear", "nzAutoFocus", "nzDisabled", "nzBorderless", "nzInputReadOnly", "nzInline", "nzOpen", "nzDisabledDate", "nzLocale", "nzPlaceHolder", "nzPopupStyle", "nzDropdownClassName", "nzSize", "nzStatus", "nzFormat", "nzDateRender", "nzDisabledTime", "nzRenderExtraFooter", "nzShowToday", "nzMode", "nzShowNow", "nzRanges", "nzDefaultPickerValue", "nzSeparator", "nzSuffixIcon", "nzBackdrop", "nzId", "nzPlacement", "nzShowWeekNumber", "nzShowTime"], outputs: ["nzOnPanelChange", "nzOnCalendarChange", "nzOnOk", "nzOnOpenChange"], exportAs: ["nzDatePicker"] }] });
|
|
445
|
+
}
|
|
446
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpInputFieldComponent, decorators: [{
|
|
447
|
+
type: Component,
|
|
448
|
+
args: [{ selector: 'np-input-field', imports: [
|
|
449
|
+
CommonModule,
|
|
450
|
+
FormsModule,
|
|
451
|
+
ReactiveFormsModule,
|
|
452
|
+
NzInputModule,
|
|
453
|
+
NzIconModule,
|
|
454
|
+
NpTypographyComponent,
|
|
455
|
+
NzDatePickerModule,
|
|
456
|
+
], providers: [DecimalPipe], template: "<div class=\"input-wrapper flex column w-full\">\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"medium\" *ngIf=\"label\" class=\"input-label\">{{ label }}</np-typography>\n\n <ng-container *ngIf=\"type === 'date'; else normalInput\">\n <div [ngClass]=\"size\">\n <nz-date-picker\n [formControl]=\"_input\"\n [nzDisabled]=\"disabled\"\n [nzFormat]=\"'yyyy-MM-dd'\"\n class=\"w-full\"\n ></nz-date-picker>\n </div>\n </ng-container>\n <ng-template #normalInput>\n <nz-input-group\n [class]=\"[size,'input-group', computedStatus === 'error' ? 'error' : '']\"\n [nzSuffix]=\"suffixTemplateInfo\"\n [nzPrefix]=\"prefixTemplateUser\"\n >\n <input\n #inputRef\n nz-input\n [type]=\"inputType\"\n [placeholder]=\"placeholder\"\n [ngClass]=\"{ 'disabled': disabled}\"\n [value]=\"_input.value\"\n (input)=\"onInputChange($event)\"\n (blur)=\"onBlur()\"\n (keypress)=\"handleKeyPress($event)\"\n />\n </nz-input-group>\n </ng-template>\n\n <ng-template #prefixTemplateUser>\n <i class=\"{{ iconLeft }} icon-input\" (click)=\"handleIconLeftClick()\"></i>\n </ng-template>\n\n <ng-template #suffixTemplateInfo>\n <i\n class=\"{{ iconRight }} icon-input\"\n *ngIf=\"type !== 'password'\"\n (click)=\"handleIconRightClick()\"\n ></i>\n <span\n *ngIf=\"type == 'password'\"\n nz-icon\n class=\"ant-input-password-icon\"\n [nzType]=\"passwordVisible ? 'eye' : 'eye-invisible'\"\n (click)=\"togglePassword()\">\n </span>\n </ng-template>\n\n <div class=\"flex justify-between\" *ngIf=\"computedStatus === 'error' || hint || limitValue && type !== 'date'\">\n <div class=\"flex flex-col w-full mb-3\">\n <np-typography *ngIf=\"computedStatus === 'error'\" class=\"input-error text-red-500\">{{ errorMessageFromInput }}</np-typography>\n <np-typography *ngIf=\"hint\" class=\"input-hint\">{{ hint }}</np-typography>\n </div>\n <np-typography *ngIf=\"limitValue && type !== 'date'\" class=\"limit-value\">\n {{ (_input.value?.toString()?.length) || 0 }}/{{ limitValue }}\n </np-typography>\n </div>\n</div>\n", styles: [".input-wrapper{display:flex;flex-direction:column;gap:4px}.input-label{color:#344054}.bs{height:36px}.sm{height:40px!important}.md{height:44px}.ant-input-affix-wrapper{border-color:#d0d5dd!important;border-radius:4px}.ant-input-affix-wrapper:hover,.ant-input-affix-wrapper:focus,.ant-input-affix-wrapper:focus-visible,.ant-input-affix-wrapper:focus-within{box-shadow:0 0 0 4px #f0f2f4}.ant-input-affix-wrapper.error{border:1px solid rgb(253,162,155)!important}.ant-input-affix-wrapper.error:hover,.ant-input-affix-wrapper.error:focus,.ant-input-affix-wrapper.error:focus-visible,.ant-input-affix-wrapper.error:focus-within{box-shadow:0 0 0 4px #f044383d}.ant-input-affix-wrapper-disabled{border:1px solid rgb(208,213,221)!important;pointer-events:none}.ant-input-affix-wrapper-disabled:hover,.ant-input-affix-wrapper-disabled:focus,.ant-input-affix-wrapper-disabled:focus-visible,.ant-input-affix-wrapper-disabled:focus-within{box-shadow:none}.ant-input-affix-wrapper-disabled .ant-input-password-icon.anticon,.ant-input-affix-wrapper-disabled .ant-input-password-icon.anticon:hover{color:#d0d5dd}.input-hint,.limit-value{color:#475467}.icon-input{color:#667085}::ng-deep span.ant-input-prefix{margin-right:6px!important}::ng-deep .sm .ant-picker{height:40px!important}::ng-deep .md .ant-picker{height:44px!important}::ng-deep .ant-picker{border-color:#d0d5dd!important;border-radius:4px}::ng-deep .ant-picker:hover,::ng-deep .ant-picker:focus,::ng-deep .ant-picker:focus-visible,::ng-deep .ant-picker:focus-within{box-shadow:0 0 0 4px #f0f2f4}::ng-deep .error{border:1px solid rgb(253,162,155)!important}::ng-deep .error:hover,::ng-deep .error:focus,::ng-deep .error:focus-visible,::ng-deep .error:focus-within{box-shadow:0 0 0 4px #f044383d!important}\n"] }]
|
|
457
|
+
}], ctorParameters: () => [{ type: i1$1.DecimalPipe }, { type: undefined, decorators: [{
|
|
458
|
+
type: Optional
|
|
459
|
+
}, {
|
|
460
|
+
type: Inject,
|
|
461
|
+
args: [FORM_ERROR_MAP]
|
|
462
|
+
}] }], propDecorators: { inputRef: [{
|
|
463
|
+
type: ViewChild,
|
|
464
|
+
args: ['inputRef', { static: true }]
|
|
465
|
+
}], size: [{
|
|
466
|
+
type: Input
|
|
467
|
+
}], label: [{
|
|
468
|
+
type: Input
|
|
469
|
+
}], placeholder: [{
|
|
470
|
+
type: Input
|
|
471
|
+
}], iconLeft: [{
|
|
472
|
+
type: Input
|
|
473
|
+
}], iconRight: [{
|
|
474
|
+
type: Input
|
|
475
|
+
}], hint: [{
|
|
476
|
+
type: Input
|
|
477
|
+
}], errorMap: [{
|
|
478
|
+
type: Input
|
|
479
|
+
}], disabled: [{
|
|
480
|
+
type: Input
|
|
481
|
+
}], limitValue: [{
|
|
482
|
+
type: Input
|
|
483
|
+
}], functionHandler: [{
|
|
484
|
+
type: Input
|
|
485
|
+
}], submitted: [{
|
|
486
|
+
type: Input
|
|
487
|
+
}], digitsInfo: [{
|
|
488
|
+
type: Input
|
|
489
|
+
}], locale: [{
|
|
490
|
+
type: Input
|
|
491
|
+
}], input: [{
|
|
492
|
+
type: Input
|
|
493
|
+
}], type: [{
|
|
494
|
+
type: Input
|
|
495
|
+
}], valueChange: [{
|
|
496
|
+
type: Output
|
|
497
|
+
}], iconLeftClick: [{
|
|
498
|
+
type: Output
|
|
499
|
+
}], iconRightClick: [{
|
|
500
|
+
type: Output
|
|
501
|
+
}] } });
|
|
502
|
+
|
|
503
|
+
class NpInputTexteraComponent {
|
|
504
|
+
defaultErrorMap;
|
|
505
|
+
constructor(defaultErrorMap) {
|
|
506
|
+
this.defaultErrorMap = defaultErrorMap;
|
|
507
|
+
}
|
|
508
|
+
label = '';
|
|
509
|
+
placeholder;
|
|
510
|
+
hint;
|
|
511
|
+
disabled = false;
|
|
512
|
+
value;
|
|
513
|
+
limitValue;
|
|
514
|
+
submitted = false;
|
|
515
|
+
_input = new FormControl('');
|
|
516
|
+
currentLength = 0;
|
|
517
|
+
set input(value) {
|
|
518
|
+
this._input = value ? value : new FormControl('');
|
|
519
|
+
}
|
|
520
|
+
onTextareaInput(event) {
|
|
521
|
+
const input = event.target.value;
|
|
522
|
+
if (this.limitValue && input.length > this.limitValue) {
|
|
523
|
+
const trimmed = input.slice(0, this.limitValue);
|
|
524
|
+
this._input.setValue(trimmed);
|
|
525
|
+
this.currentLength = trimmed.length;
|
|
526
|
+
}
|
|
527
|
+
else {
|
|
528
|
+
this._input.setValue(input);
|
|
529
|
+
this.currentLength = input.length;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
get computedStatus() {
|
|
533
|
+
if (!this._input)
|
|
534
|
+
return undefined;
|
|
535
|
+
const c = this._input;
|
|
536
|
+
return c.invalid && (c.dirty || c.touched || this.submitted)
|
|
537
|
+
? 'error'
|
|
538
|
+
: undefined;
|
|
539
|
+
}
|
|
540
|
+
get errorMessageFromInput() {
|
|
541
|
+
if (!this._input || !this._input.errors)
|
|
542
|
+
return null;
|
|
543
|
+
const firstKey = Object.keys(this._input.errors)[0];
|
|
544
|
+
return this.defaultErrorMap?.[firstKey] || null;
|
|
545
|
+
}
|
|
546
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpInputTexteraComponent, deps: [{ token: FORM_ERROR_MAP, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
547
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: NpInputTexteraComponent, isStandalone: true, selector: "np-input-textera", inputs: { label: "label", placeholder: "placeholder", hint: "hint", disabled: "disabled", value: "value", limitValue: "limitValue", submitted: "submitted", input: "input" }, ngImport: i0, template: "<div class=\"flex flex-col gap-1\" [ngClass]=\"computedStatus === 'error' ? 'error' : ''\">\n <np-typography npWeight=\"medium\" *ngIf=\"label\" class=\"input-label\">{{ label }}</np-typography>\n\n <textarea\n nz-input\n [placeholder]=\"placeholder\"\n [nzAutosize]=\"{ minRows: 5 }\"\n [disabled]=\"_input.disabled\"\n [formControl]=\"_input\"\n (input)=\"onTextareaInput($event)\"\n ></textarea>\n\n <div class=\"flex justify-between\">\n <div class=\"flex-col flex\">\n <np-typography *ngIf=\"computedStatus === 'error'\" class=\"input-error text-red-500\">\n {{ errorMessageFromInput }}\n </np-typography>\n <np-typography *ngIf=\"hint\" class=\"input-hint\">{{ hint }}</np-typography>\n </div>\n <np-typography *ngIf=\"limitValue\" class=\"limit-value\">\n {{ currentLength }}/{{ limitValue }}\n </np-typography>\n </div>\n</div>\n", styles: [".input-hint{color:#475467}.ant-input{border-radius:4px}.ant-input:focus:not(.ant-input-disabled),.ant-input:hover:not(.ant-input-disabled){background-color:#fff;border:1px solid rgb(208,213,221);box-shadow:0 0 0 4px #f0f2f4}.error{border:none!important}.error:hover,.error:focus,.error:focus-visible,.error:focus-within{box-shadow:none!important}.error .ant-input{border:1px solid rgb(253,162,155)}.error .ant-input:focus:not(.ant-input-disabled),.error .ant-input:hover:not(.ant-input-disabled){background-color:#fff;box-shadow:0 0 0 4px #f044383d}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: NzInputModule }, { kind: "directive", type: i3.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzBorderless", "nzSize", "nzStepperless", "nzStatus", "disabled"], exportAs: ["nzInput"] }, { kind: "directive", type: i3.NzAutosizeDirective, selector: "textarea[nzAutosize]", inputs: ["nzAutosize"], exportAs: ["nzAutosize"] }, { kind: "component", type: NpTypographyComponent, selector: "np-typography", inputs: ["npType", "npSize", "npWeight", "ngContent"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
|
|
548
|
+
}
|
|
549
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpInputTexteraComponent, decorators: [{
|
|
550
|
+
type: Component,
|
|
551
|
+
args: [{ selector: 'np-input-textera', imports: [
|
|
552
|
+
CommonModule,
|
|
553
|
+
FormsModule,
|
|
554
|
+
NzInputModule,
|
|
555
|
+
NpTypographyComponent,
|
|
556
|
+
ReactiveFormsModule,
|
|
557
|
+
], template: "<div class=\"flex flex-col gap-1\" [ngClass]=\"computedStatus === 'error' ? 'error' : ''\">\n <np-typography npWeight=\"medium\" *ngIf=\"label\" class=\"input-label\">{{ label }}</np-typography>\n\n <textarea\n nz-input\n [placeholder]=\"placeholder\"\n [nzAutosize]=\"{ minRows: 5 }\"\n [disabled]=\"_input.disabled\"\n [formControl]=\"_input\"\n (input)=\"onTextareaInput($event)\"\n ></textarea>\n\n <div class=\"flex justify-between\">\n <div class=\"flex-col flex\">\n <np-typography *ngIf=\"computedStatus === 'error'\" class=\"input-error text-red-500\">\n {{ errorMessageFromInput }}\n </np-typography>\n <np-typography *ngIf=\"hint\" class=\"input-hint\">{{ hint }}</np-typography>\n </div>\n <np-typography *ngIf=\"limitValue\" class=\"limit-value\">\n {{ currentLength }}/{{ limitValue }}\n </np-typography>\n </div>\n</div>\n", styles: [".input-hint{color:#475467}.ant-input{border-radius:4px}.ant-input:focus:not(.ant-input-disabled),.ant-input:hover:not(.ant-input-disabled){background-color:#fff;border:1px solid rgb(208,213,221);box-shadow:0 0 0 4px #f0f2f4}.error{border:none!important}.error:hover,.error:focus,.error:focus-visible,.error:focus-within{box-shadow:none!important}.error .ant-input{border:1px solid rgb(253,162,155)}.error .ant-input:focus:not(.ant-input-disabled),.error .ant-input:hover:not(.ant-input-disabled){background-color:#fff;box-shadow:0 0 0 4px #f044383d}\n"] }]
|
|
558
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
559
|
+
type: Optional
|
|
560
|
+
}, {
|
|
561
|
+
type: Inject,
|
|
562
|
+
args: [FORM_ERROR_MAP]
|
|
563
|
+
}] }], propDecorators: { label: [{
|
|
564
|
+
type: Input
|
|
565
|
+
}], placeholder: [{
|
|
566
|
+
type: Input
|
|
567
|
+
}], hint: [{
|
|
568
|
+
type: Input
|
|
569
|
+
}], disabled: [{
|
|
570
|
+
type: Input
|
|
571
|
+
}], value: [{
|
|
572
|
+
type: Input
|
|
573
|
+
}], limitValue: [{
|
|
574
|
+
type: Input
|
|
575
|
+
}], submitted: [{
|
|
576
|
+
type: Input
|
|
577
|
+
}], input: [{
|
|
578
|
+
type: Input
|
|
579
|
+
}] } });
|
|
580
|
+
|
|
581
|
+
class NpToggleComponent {
|
|
582
|
+
_input = new FormControl('');
|
|
583
|
+
set input(value) {
|
|
584
|
+
if (value === true) {
|
|
585
|
+
this._input.patchValue(true);
|
|
586
|
+
return;
|
|
587
|
+
}
|
|
588
|
+
this._input = !!value ? value : new FormControl(false);
|
|
589
|
+
}
|
|
590
|
+
size = 'sm';
|
|
591
|
+
label;
|
|
592
|
+
subLabel;
|
|
593
|
+
disabled = false;
|
|
594
|
+
// private _checked: boolean = false;
|
|
595
|
+
// @Input()
|
|
596
|
+
// set checked(value: boolean) {
|
|
597
|
+
// this._checked = value;
|
|
598
|
+
// this.checkedChange.emit(value);
|
|
599
|
+
// }
|
|
600
|
+
// get checked(): boolean {
|
|
601
|
+
// return this._checked;
|
|
602
|
+
// }
|
|
603
|
+
valueChange = new EventEmitter();
|
|
604
|
+
toggleChecked(value) {
|
|
605
|
+
this._input?.patchValue(value);
|
|
606
|
+
this.valueChange.emit(value);
|
|
607
|
+
}
|
|
608
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
609
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: NpToggleComponent, isStandalone: true, selector: "np-toggle", inputs: { input: "input", size: "size", label: "label", subLabel: "subLabel", disabled: "disabled" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: "<div class=\"flex gap-2\">\n <nz-switch\n [ngModel]=\"_input.value\"\n (ngModelChange)=\"toggleChecked($event)\"\n [nzDisabled]=\"disabled\"\n [nzSize]=\"size === 'sm' ? 'small' : 'default'\"\n ></nz-switch>\n <div class=\"flex flex-col justify-center\">\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"medium\" *ngIf=\"label\" class=\"input-label leading-none\"\n [class.input-label-checked]=\"_input.value\"\n >{{ label }}</np-typography>\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"regular\" *ngIf=\"subLabel\" class=\"input-subLabel\"\n [class.input-label-checked]=\"_input.value\">{{ subLabel }}</np-typography>\n </div>\n</div>\n", styles: ["::ng-deep .ant-switch{background-color:#f2f4f7}::ng-deep .ant-switch:focus{box-shadow:0 0 0 4px #98a2b333}::ng-deep .ant-switch:focus:hover{box-shadow:0 0 0 4px #98a2b333}::ng-deep .ant-switch-checked{background-color:#475467}::ng-deep .ant-switch-checked:hover{background-color:#344054}.input-label{color:#344054}.input-subLabel{color:#475467}nz-switch{display:flex}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NzSwitchModule }, { kind: "component", type: i3$1.NzSwitchComponent, selector: "nz-switch", inputs: ["nzLoading", "nzDisabled", "nzControl", "nzCheckedChildren", "nzUnCheckedChildren", "nzSize", "nzId"], exportAs: ["nzSwitch"] }, { kind: "ngmodule", type: NzButtonModule }, { kind: "component", type: NpTypographyComponent, selector: "np-typography", inputs: ["npType", "npSize", "npWeight", "ngContent"] }] });
|
|
610
|
+
}
|
|
611
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpToggleComponent, decorators: [{
|
|
612
|
+
type: Component,
|
|
613
|
+
args: [{ selector: 'np-toggle', imports: [
|
|
614
|
+
CommonModule,
|
|
615
|
+
FormsModule,
|
|
616
|
+
NzSwitchModule,
|
|
617
|
+
NzButtonModule,
|
|
618
|
+
NpTypographyComponent,
|
|
619
|
+
], template: "<div class=\"flex gap-2\">\n <nz-switch\n [ngModel]=\"_input.value\"\n (ngModelChange)=\"toggleChecked($event)\"\n [nzDisabled]=\"disabled\"\n [nzSize]=\"size === 'sm' ? 'small' : 'default'\"\n ></nz-switch>\n <div class=\"flex flex-col justify-center\">\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"medium\" *ngIf=\"label\" class=\"input-label leading-none\"\n [class.input-label-checked]=\"_input.value\"\n >{{ label }}</np-typography>\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"regular\" *ngIf=\"subLabel\" class=\"input-subLabel\"\n [class.input-label-checked]=\"_input.value\">{{ subLabel }}</np-typography>\n </div>\n</div>\n", styles: ["::ng-deep .ant-switch{background-color:#f2f4f7}::ng-deep .ant-switch:focus{box-shadow:0 0 0 4px #98a2b333}::ng-deep .ant-switch:focus:hover{box-shadow:0 0 0 4px #98a2b333}::ng-deep .ant-switch-checked{background-color:#475467}::ng-deep .ant-switch-checked:hover{background-color:#344054}.input-label{color:#344054}.input-subLabel{color:#475467}nz-switch{display:flex}\n"] }]
|
|
620
|
+
}], propDecorators: { input: [{
|
|
621
|
+
type: Input
|
|
622
|
+
}], size: [{
|
|
623
|
+
type: Input
|
|
624
|
+
}], label: [{
|
|
625
|
+
type: Input
|
|
626
|
+
}], subLabel: [{
|
|
627
|
+
type: Input
|
|
628
|
+
}], disabled: [{
|
|
629
|
+
type: Input
|
|
630
|
+
}], valueChange: [{
|
|
631
|
+
type: Output
|
|
632
|
+
}] } });
|
|
633
|
+
|
|
634
|
+
var NpInputMode;
|
|
635
|
+
(function (NpInputMode) {
|
|
636
|
+
NpInputMode["DEFAULT"] = "default";
|
|
637
|
+
NpInputMode["MULTIPLE"] = "multiple";
|
|
638
|
+
NpInputMode["TAGS"] = "tags";
|
|
639
|
+
})(NpInputMode || (NpInputMode = {}));
|
|
640
|
+
class NpSelectComponent {
|
|
641
|
+
npType = 'sm';
|
|
642
|
+
className = '';
|
|
643
|
+
label;
|
|
644
|
+
hint;
|
|
645
|
+
placeHolder = '';
|
|
646
|
+
labelTemplate = undefined;
|
|
647
|
+
valueTemplate = undefined;
|
|
648
|
+
isAllowClear = true;
|
|
649
|
+
iconPrefixClass = undefined;
|
|
650
|
+
mode = 'default';
|
|
651
|
+
listItem = [];
|
|
652
|
+
NpMode = NpInputMode;
|
|
653
|
+
_input = new FormControl(null);
|
|
654
|
+
set input(value) {
|
|
655
|
+
this._input = !!value ? value : new FormControl([]);
|
|
656
|
+
}
|
|
657
|
+
valueChange = new EventEmitter();
|
|
658
|
+
onChangeValue() {
|
|
659
|
+
this.valueChange.emit(this._input?.value);
|
|
660
|
+
}
|
|
661
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
662
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.5", type: NpSelectComponent, isStandalone: true, selector: "np-select", inputs: { npType: "npType", className: "className", label: "label", hint: "hint", placeHolder: "placeHolder", labelTemplate: "labelTemplate", valueTemplate: "valueTemplate", isAllowClear: "isAllowClear", iconPrefixClass: "iconPrefixClass", mode: "mode", listItem: "listItem", input: "input" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: "<div class=\"flex flex-col gap-1 np-select {{ className }}\">\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"medium\" *ngIf=\"label\" class=\"input-label\">{{ label }}</np-typography>\n <div class=\"relative {{ npType }} \" [class.add-prefix-icon]=\"iconPrefixClass\">\n <nz-select\n [nzPlaceHolder]=\"placeHolder\"\n class=\"w-full\"\n [formControl]=\"_input\"\n [nzShowSearch]=\"true\"\n [nzAllowClear]=\"isAllowClear\"\n [nzMode]=\"mode\"\n [nzCustomTemplate]=\"valueTemplate ?? defaultTemplate\"\n (ngModelChange)=\"onChangeValue()\"\n >\n @for (item of listItem; track item) {\n <nz-option\n nzCustomContent\n [nzLabel]=\"item?.label\"\n [nzValue]=\"item?.value\"\n >\n @if (labelTemplate) {\n <ng-container\n *ngTemplateOutlet=\"labelTemplate; context: { item: item }\"\n ></ng-container>\n } @else {\n <div class=\"flex justify-between\">\n <div>{{ item?.label }}</div>\n @if(mode === NpMode.DEFAULT) {\n <div class=\"icon-check\"><i class=\"fa-light fa-check\"></i></div>\n }\n </div>\n }\n </nz-option>\n }\n </nz-select>\n <ng-template #defaultTemplate let-selected>\n {{ selected.nzLabel }}\n </ng-template>\n <div class=\"prefix-icon absolute\">\n <i class=\"{{ iconPrefixClass }}\"></i>\n </div>\n </div>\n <np-typography *ngIf=\"hint\" class=\"input-hint\">{{ hint }}</np-typography>\n</div>\n\n<!-- <nz-select\n nzMode=\"multiple\"\n nzPlaceHolder=\"Please select\"\n [(ngModel)]=\"value\"\n class=\"w-full\"\n >\n @for (item of listItem; track item) {\n <nz-option [nzLabel]=\"item?.label\" [nzValue]=\"item?.value\"></nz-option>\n }\n </nz-select> -->\n", styles: ["::ng-deep .np-select .prefix-icon{display:none}::ng-deep .np-select .ant-select .ant-select-selector{border-radius:8px}::ng-deep .np-select .ant-select .ant-select-selector:focus{box-shadow:0 0 0 4px #98a2b324}::ng-deep .np-select .ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) .ant-select-selector{box-shadow:0 0 0 4px #98a2b324}::ng-deep .np-select .ant-select-multiple .ant-select-selection-item-remove{margin-left:5px;margin-top:1px}::ng-deep .np-select .add-prefix-icon .ant-select-single .ant-select-selection-search .ant-select-selection-search-input{margin-left:28px}::ng-deep .np-select .add-prefix-icon .ant-select-selection-search .ant-select-selection-search-input{min-height:100%}::ng-deep .np-select .add-prefix-icon .ant-select-multiple .ant-select-selection-search{margin-left:0}::ng-deep .np-select .add-prefix-icon .prefix-icon{display:block}::ng-deep .np-select .add-prefix-icon .ant-select-selection-placeholder{padding-left:8px}::ng-deep .np-select .add-prefix-icon .ant-select-multiple .ant-select-selection-placeholder{padding-left:28px}::ng-deep .np-select .add-prefix-icon .ant-select-single .ant-select-selector{padding-left:30px}::ng-deep .np-select .add-prefix-icon .ant-select-multiple .ant-select-selector{padding-left:38px}::ng-deep .np-select .add-prefix-icon .ant-select-selection-item{padding-left:8px}::ng-deep .np-select .ant-select-multiple .ant-select-selection-item{background:#fff;border-radius:6px;margin:0 6px 0 0;padding-left:10px;padding-right:10px}::ng-deep .np-select .sm .prefix-icon{top:10px;left:14px}::ng-deep .np-select .sm .ant-select .ant-select-selector{padding-top:5px;padding-bottom:5px;min-height:40px}::ng-deep .np-select .md .prefix-icon{top:14px;left:14px}::ng-deep .np-select .md .ant-select .ant-select-selector{padding-top:7px;padding-bottom:7px;min-height:44px}::ng-deep .ant-select-dropdown{box-shadow:0 12px 16px -4px #10182814;border:1px solid #eaecf0;border-radius:8px}::ng-deep .ant-select-dropdown .icon-check{display:none}::ng-deep .ant-select-item-option-selected:not(.ant-select-item-option-disabled){background-color:#f9fafb}::ng-deep .ant-select-item-option-selected:not(.ant-select-item-option-disabled) .icon-check{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: NpTypographyComponent, selector: "np-typography", inputs: ["npType", "npSize", "npWeight", "ngContent"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: NzSelectModule }, { kind: "component", type: i3$2.NzOptionComponent, selector: "nz-option", inputs: ["nzTitle", "nzLabel", "nzValue", "nzKey", "nzDisabled", "nzHide", "nzCustomContent"], exportAs: ["nzOption"] }, { kind: "component", type: i3$2.NzSelectComponent, selector: "nz-select", inputs: ["nzId", "nzSize", "nzStatus", "nzOptionHeightPx", "nzOptionOverflowSize", "nzDropdownClassName", "nzDropdownMatchSelectWidth", "nzDropdownStyle", "nzNotFoundContent", "nzPlaceHolder", "nzPlacement", "nzMaxTagCount", "nzDropdownRender", "nzCustomTemplate", "nzSuffixIcon", "nzClearIcon", "nzRemoveIcon", "nzMenuItemSelectedIcon", "nzTokenSeparators", "nzMaxTagPlaceholder", "nzMaxMultipleCount", "nzMode", "nzFilterOption", "compareWith", "nzAllowClear", "nzBorderless", "nzShowSearch", "nzLoading", "nzAutoFocus", "nzAutoClearSearchValue", "nzServerSearch", "nzDisabled", "nzOpen", "nzSelectOnTab", "nzBackdrop", "nzOptions", "nzShowArrow"], outputs: ["nzOnSearch", "nzScrollToBottom", "nzOpenChange", "nzBlur", "nzFocus"], exportAs: ["nzSelect"] }] });
|
|
663
|
+
}
|
|
664
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpSelectComponent, decorators: [{
|
|
665
|
+
type: Component,
|
|
666
|
+
args: [{ selector: 'np-select', imports: [
|
|
667
|
+
CommonModule,
|
|
668
|
+
NpTypographyComponent,
|
|
669
|
+
FormsModule,
|
|
670
|
+
ReactiveFormsModule,
|
|
671
|
+
NzSelectModule,
|
|
672
|
+
], template: "<div class=\"flex flex-col gap-1 np-select {{ className }}\">\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"medium\" *ngIf=\"label\" class=\"input-label\">{{ label }}</np-typography>\n <div class=\"relative {{ npType }} \" [class.add-prefix-icon]=\"iconPrefixClass\">\n <nz-select\n [nzPlaceHolder]=\"placeHolder\"\n class=\"w-full\"\n [formControl]=\"_input\"\n [nzShowSearch]=\"true\"\n [nzAllowClear]=\"isAllowClear\"\n [nzMode]=\"mode\"\n [nzCustomTemplate]=\"valueTemplate ?? defaultTemplate\"\n (ngModelChange)=\"onChangeValue()\"\n >\n @for (item of listItem; track item) {\n <nz-option\n nzCustomContent\n [nzLabel]=\"item?.label\"\n [nzValue]=\"item?.value\"\n >\n @if (labelTemplate) {\n <ng-container\n *ngTemplateOutlet=\"labelTemplate; context: { item: item }\"\n ></ng-container>\n } @else {\n <div class=\"flex justify-between\">\n <div>{{ item?.label }}</div>\n @if(mode === NpMode.DEFAULT) {\n <div class=\"icon-check\"><i class=\"fa-light fa-check\"></i></div>\n }\n </div>\n }\n </nz-option>\n }\n </nz-select>\n <ng-template #defaultTemplate let-selected>\n {{ selected.nzLabel }}\n </ng-template>\n <div class=\"prefix-icon absolute\">\n <i class=\"{{ iconPrefixClass }}\"></i>\n </div>\n </div>\n <np-typography *ngIf=\"hint\" class=\"input-hint\">{{ hint }}</np-typography>\n</div>\n\n<!-- <nz-select\n nzMode=\"multiple\"\n nzPlaceHolder=\"Please select\"\n [(ngModel)]=\"value\"\n class=\"w-full\"\n >\n @for (item of listItem; track item) {\n <nz-option [nzLabel]=\"item?.label\" [nzValue]=\"item?.value\"></nz-option>\n }\n </nz-select> -->\n", styles: ["::ng-deep .np-select .prefix-icon{display:none}::ng-deep .np-select .ant-select .ant-select-selector{border-radius:8px}::ng-deep .np-select .ant-select .ant-select-selector:focus{box-shadow:0 0 0 4px #98a2b324}::ng-deep .np-select .ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) .ant-select-selector{box-shadow:0 0 0 4px #98a2b324}::ng-deep .np-select .ant-select-multiple .ant-select-selection-item-remove{margin-left:5px;margin-top:1px}::ng-deep .np-select .add-prefix-icon .ant-select-single .ant-select-selection-search .ant-select-selection-search-input{margin-left:28px}::ng-deep .np-select .add-prefix-icon .ant-select-selection-search .ant-select-selection-search-input{min-height:100%}::ng-deep .np-select .add-prefix-icon .ant-select-multiple .ant-select-selection-search{margin-left:0}::ng-deep .np-select .add-prefix-icon .prefix-icon{display:block}::ng-deep .np-select .add-prefix-icon .ant-select-selection-placeholder{padding-left:8px}::ng-deep .np-select .add-prefix-icon .ant-select-multiple .ant-select-selection-placeholder{padding-left:28px}::ng-deep .np-select .add-prefix-icon .ant-select-single .ant-select-selector{padding-left:30px}::ng-deep .np-select .add-prefix-icon .ant-select-multiple .ant-select-selector{padding-left:38px}::ng-deep .np-select .add-prefix-icon .ant-select-selection-item{padding-left:8px}::ng-deep .np-select .ant-select-multiple .ant-select-selection-item{background:#fff;border-radius:6px;margin:0 6px 0 0;padding-left:10px;padding-right:10px}::ng-deep .np-select .sm .prefix-icon{top:10px;left:14px}::ng-deep .np-select .sm .ant-select .ant-select-selector{padding-top:5px;padding-bottom:5px;min-height:40px}::ng-deep .np-select .md .prefix-icon{top:14px;left:14px}::ng-deep .np-select .md .ant-select .ant-select-selector{padding-top:7px;padding-bottom:7px;min-height:44px}::ng-deep .ant-select-dropdown{box-shadow:0 12px 16px -4px #10182814;border:1px solid #eaecf0;border-radius:8px}::ng-deep .ant-select-dropdown .icon-check{display:none}::ng-deep .ant-select-item-option-selected:not(.ant-select-item-option-disabled){background-color:#f9fafb}::ng-deep .ant-select-item-option-selected:not(.ant-select-item-option-disabled) .icon-check{display:block}\n"] }]
|
|
673
|
+
}], propDecorators: { npType: [{
|
|
674
|
+
type: Input
|
|
675
|
+
}], className: [{
|
|
676
|
+
type: Input
|
|
677
|
+
}], label: [{
|
|
678
|
+
type: Input
|
|
679
|
+
}], hint: [{
|
|
680
|
+
type: Input
|
|
681
|
+
}], placeHolder: [{
|
|
682
|
+
type: Input
|
|
683
|
+
}], labelTemplate: [{
|
|
684
|
+
type: Input
|
|
685
|
+
}], valueTemplate: [{
|
|
686
|
+
type: Input
|
|
687
|
+
}], isAllowClear: [{
|
|
688
|
+
type: Input
|
|
689
|
+
}], iconPrefixClass: [{
|
|
690
|
+
type: Input
|
|
691
|
+
}], mode: [{
|
|
692
|
+
type: Input
|
|
693
|
+
}], listItem: [{
|
|
694
|
+
type: Input
|
|
695
|
+
}], input: [{
|
|
696
|
+
type: Input
|
|
697
|
+
}], valueChange: [{
|
|
698
|
+
type: Output
|
|
699
|
+
}] } });
|
|
700
|
+
|
|
701
|
+
// import { NpDropdownContentMenuComponent } from './np-dropdown-content-menu/np-dropdown-content-menu.component';
|
|
702
|
+
// export interface NpDroplistItem {
|
|
703
|
+
// value: string;
|
|
704
|
+
// label: string;
|
|
705
|
+
// nzValue: string;
|
|
706
|
+
// nzLabel: string;
|
|
707
|
+
// }
|
|
708
|
+
var NpMode;
|
|
709
|
+
(function (NpMode) {
|
|
710
|
+
NpMode["DEFAULT"] = "default";
|
|
711
|
+
NpMode["MULTIPLE"] = "multiple";
|
|
712
|
+
NpMode["TAGS"] = "tags";
|
|
713
|
+
})(NpMode || (NpMode = {}));
|
|
714
|
+
class NpDropdownsComponent {
|
|
715
|
+
npType = 'secondary';
|
|
716
|
+
npSize = 'sm';
|
|
717
|
+
className = '';
|
|
718
|
+
value = 'Menu Dropdown';
|
|
719
|
+
useSearch = false;
|
|
720
|
+
alwaysOpen = false;
|
|
721
|
+
placement = 'bottomCenter';
|
|
722
|
+
// @Input() label: string = 'Menu Dropdown';
|
|
723
|
+
list = [];
|
|
724
|
+
// @Output() valueChange = new EventEmitter<any>();
|
|
725
|
+
valueChange = new EventEmitter();
|
|
726
|
+
visible = false;
|
|
727
|
+
searchControl = new FormControl('');
|
|
728
|
+
originalList = [];
|
|
729
|
+
filteredList = [];
|
|
730
|
+
ngOnInit() {
|
|
731
|
+
this.originalList = [...this.list];
|
|
732
|
+
this.filteredList = [...this.list];
|
|
733
|
+
this.searchControl.valueChanges.subscribe((text) => {
|
|
734
|
+
this.filterList(text ?? '');
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
clickMe() {
|
|
738
|
+
this.visible = false;
|
|
739
|
+
}
|
|
740
|
+
change(value) { }
|
|
741
|
+
onSelectItem(item) {
|
|
742
|
+
this.visible = false;
|
|
743
|
+
if (this.npType !== 'icon') {
|
|
744
|
+
this.value = item?.value;
|
|
745
|
+
}
|
|
746
|
+
// this.label = item?.label;
|
|
747
|
+
// this.valueChange?.emit(item);
|
|
748
|
+
this.valueChange.emit(item);
|
|
749
|
+
}
|
|
750
|
+
onRightIconClick() {
|
|
751
|
+
this.searchControl.setValue('');
|
|
752
|
+
}
|
|
753
|
+
filterList(search) {
|
|
754
|
+
const normalizedSearch = search?.toLowerCase().trim() || '';
|
|
755
|
+
if (!normalizedSearch) {
|
|
756
|
+
this.filteredList = [...this.originalList];
|
|
757
|
+
return;
|
|
758
|
+
}
|
|
759
|
+
const matchedItems = this.originalList.filter((item) => item.label?.toLowerCase().includes(normalizedSearch));
|
|
760
|
+
const originalWithoutDivider = this.originalList.filter((item) => item.type !== 'divider');
|
|
761
|
+
const isSame = matchedItems.length === originalWithoutDivider.length &&
|
|
762
|
+
matchedItems.every((item) => originalWithoutDivider.some((o) => o.label === item.label));
|
|
763
|
+
if (isSame) {
|
|
764
|
+
this.filteredList = [...this.originalList];
|
|
765
|
+
}
|
|
766
|
+
else {
|
|
767
|
+
this.filteredList = matchedItems;
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpDropdownsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
771
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.5", type: NpDropdownsComponent, isStandalone: true, selector: "np-dropdowns", inputs: { npType: "npType", npSize: "npSize", className: "className", value: "value", useSearch: "useSearch", alwaysOpen: "alwaysOpen", placement: "placement", list: "list" }, outputs: { valueChange: "valueChange", visible: "visible" }, ngImport: i0, template: "<np-button\n class=\"inline-block w-auto np-dropdown {{ className }}\"\n [npType]=\"npType\"\n [npSize]=\"npSize\"\n nz-dropdown\n nzTrigger=\"click\"\n [nzDropdownMenu]=\"menu\"\n [nzVisible]=\"alwaysOpen\"\n [nzPlacement]=\"placement\"\n>\n <div class=\"flex gap-1 items-center\">\n {{ value }}\n @if (npType === 'icon') {\n <i class=\"fa-solid fa-ellipsis-vertical\"></i>\n } @else {\n <i class=\"fa-light icon fa-chevron-down\" [class.icon-up]=\"visible\"></i>\n }\n </div>\n</np-button>\n\n<nz-dropdown-menu #menu=\"nzDropdownMenu\">\n <ul nz-menu>\n <div class=\"px-[8px] py-[2px] mb-1\" *ngIf=\"useSearch\">\n <np-input-field\n size=\"sm\"\n type=\"string\"\n placeholder=\"Search\"\n iconLeft=\"fa-regular fa-magnifying-glass\"\n iconRight=\"fa-solid fa-xmark-large\"\n [input]=\"searchControl\"\n (iconRightClick)=\"onRightIconClick()\"\n ></np-input-field>\n </div>\n @for (item of filteredList; track item) {\n <ng-container\n *ngTemplateOutlet=\"contentMenu; context: { item: item }\"\n ></ng-container>\n }\n </ul>\n\n <ng-template #contentMenu let-item=\"item\">\n @if (item?.type === 'divider') {\n <li nz-menu-divider></li>\n } @else if (!item?.childrens) {\n <li nz-menu-item (click)=\"onSelectItem(item)\">\n <ng-container\n *ngTemplateOutlet=\"contentTemplate; context: { item: item }\"\n ></ng-container>\n </li>\n } @else {\n <ng-container\n *ngTemplateOutlet=\"contentSubMenuTemplate; context: { item: item }\"\n ></ng-container>\n }\n </ng-template>\n\n <ng-template #contentSubMenuTemplate let-item=\"item\">\n <li nz-submenu [nzTitle]=\"submenuTitle\">\n <ng-template #submenuTitle>\n <ng-container\n *ngTemplateOutlet=\"contentTemplate; context: { item: item }\"\n ></ng-container>\n </ng-template>\n <ul>\n @for (itemChild of item?.childrens; track itemChild) { @if\n (itemChild?.type === 'divider') {\n <li nz-menu-divider></li>\n } @else if (!itemChild?.childrens) {\n <li nz-menu-item (click)=\"onSelectItem(itemChild)\">\n <ng-container\n *ngTemplateOutlet=\"contentTemplate; context: { item: itemChild }\"\n ></ng-container>\n </li>\n } @else {\n\n <!-- Start Fix temp when not use recursive template -->\n <li nz-submenu [nzTitle]=\"submenuTitle2\">\n <ng-template #submenuTitle2>\n <ng-container\n *ngTemplateOutlet=\"contentTemplate; context: { item: itemChild }\"\n ></ng-container>\n </ng-template>\n <ul>\n @for (itemChild2 of itemChild?.childrens; track itemChild2) {\n <li nz-menu-item (click)=\"onSelectItem(itemChild2)\">\n <ng-container\n *ngTemplateOutlet=\"\n contentTemplate;\n context: { item: itemChild2 }\n \"\n ></ng-container>\n </li>\n }\n </ul>\n </li>\n <!-- End Fix temp when not use recursive template -->\n\n <!-- <ng-container\n *ngTemplateOutlet=\"contentMenu; context: { item: itemChild }\"\n ></ng-container> -->\n } }\n </ul>\n </li>\n </ng-template>\n\n <ng-template #contentTemplate let-item=\"item\">\n <i class=\"{{ item?.classIcon }} mr-[4px]\"></i>\n {{ item?.label }}\n </ng-template>\n</nz-dropdown-menu>\n", styles: ["::ng-deep .ant-dropdown-menu{box-shadow:0 12px 16px -4px #10182814;border:1px solid #eaecf0;border-radius:8px;min-width:200px}::ng-deep .nz-dropdown-menu{pointer-events:auto!important}::ng-deep .fa-xmark-large{cursor:pointer}.menu .item{cursor:pointer}.menu .item:hover{background-color:#f5f5f5}.menu .item-selected{background-color:#f9fafb}.np-dropdown .icon{transition:transform .3s ease-in-out}.np-dropdown .icon-up{transform:rotate(180deg)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: NpButtonComponent, selector: "np-button", inputs: ["npType", "npSize", "className", "isLoading", "disabled", "ngContent"] }, { kind: "ngmodule", type:
|
|
772
|
+
// NzPopoverModule,
|
|
773
|
+
NzDropDownModule }, { kind: "directive", type: i2$1.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { kind: "component", type: i2$1.NzMenuItemComponent, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }, { kind: "component", type: i2$1.NzSubMenuComponent, selector: "[nz-submenu]", inputs: ["nzMenuClassName", "nzPaddingLeft", "nzTitle", "nzIcon", "nzTriggerSubMenuAction", "nzOpen", "nzDisabled", "nzPlacement"], outputs: ["nzOpenChange"], exportAs: ["nzSubmenu"] }, { kind: "directive", type: i2$1.NzMenuDividerDirective, selector: "[nz-menu-divider]", exportAs: ["nzMenuDivider"] }, { kind: "directive", type: i3$3.NzDropDownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { kind: "component", type: i3$3.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }, { kind: "ngmodule", type:
|
|
774
|
+
// NpDropdownContentMenuComponent
|
|
775
|
+
NzSelectModule }, { kind: "component", type: NpInputFieldComponent, selector: "np-input-field", inputs: ["size", "label", "placeholder", "iconLeft", "iconRight", "hint", "errorMap", "disabled", "limitValue", "functionHandler", "submitted", "digitsInfo", "locale", "input", "type"], outputs: ["valueChange", "iconLeftClick", "iconRightClick"] }] });
|
|
776
|
+
}
|
|
777
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpDropdownsComponent, decorators: [{
|
|
778
|
+
type: Component,
|
|
779
|
+
args: [{ selector: 'np-dropdowns', imports: [
|
|
780
|
+
CommonModule,
|
|
781
|
+
FormsModule,
|
|
782
|
+
ReactiveFormsModule,
|
|
783
|
+
NpButtonComponent,
|
|
784
|
+
// NzPopoverModule,
|
|
785
|
+
NzDropDownModule,
|
|
786
|
+
// NpDropdownContentMenuComponent
|
|
787
|
+
NzSelectModule,
|
|
788
|
+
NpInputFieldComponent,
|
|
789
|
+
], template: "<np-button\n class=\"inline-block w-auto np-dropdown {{ className }}\"\n [npType]=\"npType\"\n [npSize]=\"npSize\"\n nz-dropdown\n nzTrigger=\"click\"\n [nzDropdownMenu]=\"menu\"\n [nzVisible]=\"alwaysOpen\"\n [nzPlacement]=\"placement\"\n>\n <div class=\"flex gap-1 items-center\">\n {{ value }}\n @if (npType === 'icon') {\n <i class=\"fa-solid fa-ellipsis-vertical\"></i>\n } @else {\n <i class=\"fa-light icon fa-chevron-down\" [class.icon-up]=\"visible\"></i>\n }\n </div>\n</np-button>\n\n<nz-dropdown-menu #menu=\"nzDropdownMenu\">\n <ul nz-menu>\n <div class=\"px-[8px] py-[2px] mb-1\" *ngIf=\"useSearch\">\n <np-input-field\n size=\"sm\"\n type=\"string\"\n placeholder=\"Search\"\n iconLeft=\"fa-regular fa-magnifying-glass\"\n iconRight=\"fa-solid fa-xmark-large\"\n [input]=\"searchControl\"\n (iconRightClick)=\"onRightIconClick()\"\n ></np-input-field>\n </div>\n @for (item of filteredList; track item) {\n <ng-container\n *ngTemplateOutlet=\"contentMenu; context: { item: item }\"\n ></ng-container>\n }\n </ul>\n\n <ng-template #contentMenu let-item=\"item\">\n @if (item?.type === 'divider') {\n <li nz-menu-divider></li>\n } @else if (!item?.childrens) {\n <li nz-menu-item (click)=\"onSelectItem(item)\">\n <ng-container\n *ngTemplateOutlet=\"contentTemplate; context: { item: item }\"\n ></ng-container>\n </li>\n } @else {\n <ng-container\n *ngTemplateOutlet=\"contentSubMenuTemplate; context: { item: item }\"\n ></ng-container>\n }\n </ng-template>\n\n <ng-template #contentSubMenuTemplate let-item=\"item\">\n <li nz-submenu [nzTitle]=\"submenuTitle\">\n <ng-template #submenuTitle>\n <ng-container\n *ngTemplateOutlet=\"contentTemplate; context: { item: item }\"\n ></ng-container>\n </ng-template>\n <ul>\n @for (itemChild of item?.childrens; track itemChild) { @if\n (itemChild?.type === 'divider') {\n <li nz-menu-divider></li>\n } @else if (!itemChild?.childrens) {\n <li nz-menu-item (click)=\"onSelectItem(itemChild)\">\n <ng-container\n *ngTemplateOutlet=\"contentTemplate; context: { item: itemChild }\"\n ></ng-container>\n </li>\n } @else {\n\n <!-- Start Fix temp when not use recursive template -->\n <li nz-submenu [nzTitle]=\"submenuTitle2\">\n <ng-template #submenuTitle2>\n <ng-container\n *ngTemplateOutlet=\"contentTemplate; context: { item: itemChild }\"\n ></ng-container>\n </ng-template>\n <ul>\n @for (itemChild2 of itemChild?.childrens; track itemChild2) {\n <li nz-menu-item (click)=\"onSelectItem(itemChild2)\">\n <ng-container\n *ngTemplateOutlet=\"\n contentTemplate;\n context: { item: itemChild2 }\n \"\n ></ng-container>\n </li>\n }\n </ul>\n </li>\n <!-- End Fix temp when not use recursive template -->\n\n <!-- <ng-container\n *ngTemplateOutlet=\"contentMenu; context: { item: itemChild }\"\n ></ng-container> -->\n } }\n </ul>\n </li>\n </ng-template>\n\n <ng-template #contentTemplate let-item=\"item\">\n <i class=\"{{ item?.classIcon }} mr-[4px]\"></i>\n {{ item?.label }}\n </ng-template>\n</nz-dropdown-menu>\n", styles: ["::ng-deep .ant-dropdown-menu{box-shadow:0 12px 16px -4px #10182814;border:1px solid #eaecf0;border-radius:8px;min-width:200px}::ng-deep .nz-dropdown-menu{pointer-events:auto!important}::ng-deep .fa-xmark-large{cursor:pointer}.menu .item{cursor:pointer}.menu .item:hover{background-color:#f5f5f5}.menu .item-selected{background-color:#f9fafb}.np-dropdown .icon{transition:transform .3s ease-in-out}.np-dropdown .icon-up{transform:rotate(180deg)}\n"] }]
|
|
790
|
+
}], propDecorators: { npType: [{
|
|
791
|
+
type: Input
|
|
792
|
+
}], npSize: [{
|
|
793
|
+
type: Input
|
|
794
|
+
}], className: [{
|
|
795
|
+
type: Input
|
|
796
|
+
}], value: [{
|
|
797
|
+
type: Input
|
|
798
|
+
}], useSearch: [{
|
|
799
|
+
type: Input
|
|
800
|
+
}], alwaysOpen: [{
|
|
801
|
+
type: Input
|
|
802
|
+
}], placement: [{
|
|
803
|
+
type: Input
|
|
804
|
+
}], list: [{
|
|
805
|
+
type: Input
|
|
806
|
+
}], valueChange: [{
|
|
807
|
+
type: Output
|
|
808
|
+
}], visible: [{
|
|
809
|
+
type: Output
|
|
810
|
+
}] } });
|
|
811
|
+
|
|
812
|
+
class NpTooltipComponent {
|
|
813
|
+
renderer;
|
|
814
|
+
type = 'primary';
|
|
815
|
+
text = 'Title';
|
|
816
|
+
descriptions;
|
|
817
|
+
position;
|
|
818
|
+
tooltipVisible = false;
|
|
819
|
+
container;
|
|
820
|
+
_ngContent = null;
|
|
821
|
+
set ngContent(value) {
|
|
822
|
+
this._ngContent = value;
|
|
823
|
+
this.updateContent();
|
|
824
|
+
}
|
|
825
|
+
constructor(renderer) {
|
|
826
|
+
this.renderer = renderer;
|
|
827
|
+
}
|
|
828
|
+
updateContent() {
|
|
829
|
+
if (!this._ngContent) {
|
|
830
|
+
return;
|
|
831
|
+
}
|
|
832
|
+
// if (typeof this._ngContent === 'string') {
|
|
833
|
+
// const contentContainer = this.renderer.createElement('ng-container');
|
|
834
|
+
// contentContainer.innerHTML = this.ngContent;
|
|
835
|
+
// this.renderer.appendChild(this.container.nativeElement, contentContainer);
|
|
836
|
+
// }
|
|
837
|
+
if (this._ngContent instanceof Element) {
|
|
838
|
+
this.renderer.appendChild(this.container.nativeElement, this._ngContent);
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
get tooltipColor() {
|
|
842
|
+
return this.type === 'primary'
|
|
843
|
+
? 'rgba(255, 255, 255, 1)'
|
|
844
|
+
: 'rgba(16, 24, 40, 1)';
|
|
845
|
+
}
|
|
846
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpTooltipComponent, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
847
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: NpTooltipComponent, isStandalone: true, selector: "np-tooltip", inputs: { type: "type", text: "text", descriptions: "descriptions", position: "position", tooltipVisible: "tooltipVisible", ngContent: "ngContent" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, static: true }], ngImport: i0, template: "<div\n #container\n class=\"h-full\"\n [nzTooltipTitle]=\"customTooltip\"\n [nzTooltipPlacement]=\"position\"\n nzTooltipTrigger=\"hover\"\n [nzTooltipVisible]='tooltipVisible'\n nzTooltipOverlayClassName=\"tooltip-class\"\n nz-button\n nz-tooltip\n [nzTooltipColor]=\"tooltipColor\"\n>\n <ng-content></ng-content>\n</div>\n\n<ng-template #customTooltip>\n <div class=\"custom-tooltip\">\n <np-typography\n npType=\"text\"\n npSize=\"xs\"\n npWeight=\"semibold\"\n [ngStyle]=\"{ color: type === 'primary' ? 'rgba(52, 64, 84, 1)' : 'rgba(255, 255, 255, 1)' }\"\n >{{ text }}</np-typography\n >\n <np-typography\n npType=\"text\"\n npSize=\"xs\"\n npWeight=\"medium\"\n [ngStyle]=\"{ color: type === 'primary' ? 'rgba(52, 64, 84, 1)' : 'rgba(255, 255, 255, 1)' }\"\n >{{ descriptions }}</np-typography\n >\n </div>\n</ng-template>\n", styles: [".custom-tooltip{box-shadow:0 4px 6px -2px #10182808,0 12px 16px -4px #10182814;padding:6px 8px;border-radius:8px}::ng-deep .ant-tooltip-inner{padding:0;border-radius:8px;display:flex;align-items:center}::ng-deep .tooltip-class .ant-tooltip-arrow{display:block!important}::ng-deep .ant-tooltip-placement-top.tooltip-class .ant-tooltip-arrow{transform:translateY(95%) translate(-50%)}::ng-deep .ant-tooltip-placement-topLeft .ant-tooltip-arrow{transform:translateY(94%)}\n"], dependencies: [{ kind: "ngmodule", type: NzButtonModule }, { kind: "directive", type: i1$3.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "ngmodule", type: NzToolTipModule }, { kind: "directive", type: i2$2.NzTooltipDirective, selector: "[nz-tooltip]", inputs: ["nzTooltipTitle", "nzTooltipTitleContext", "nz-tooltip", "nzTooltipTrigger", "nzTooltipPlacement", "nzTooltipOrigin", "nzTooltipVisible", "nzTooltipMouseEnterDelay", "nzTooltipMouseLeaveDelay", "nzTooltipOverlayClassName", "nzTooltipOverlayStyle", "nzTooltipArrowPointAtCenter", "cdkConnectedOverlayPush", "nzTooltipColor"], outputs: ["nzTooltipVisibleChange"], exportAs: ["nzTooltip"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: NpTypographyComponent, selector: "np-typography", inputs: ["npType", "npSize", "npWeight", "ngContent"] }] });
|
|
848
|
+
}
|
|
849
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpTooltipComponent, decorators: [{
|
|
850
|
+
type: Component,
|
|
851
|
+
args: [{ selector: 'np-tooltip', imports: [
|
|
852
|
+
NzButtonModule,
|
|
853
|
+
NzToolTipModule,
|
|
854
|
+
CommonModule,
|
|
855
|
+
NpTypographyComponent,
|
|
856
|
+
], template: "<div\n #container\n class=\"h-full\"\n [nzTooltipTitle]=\"customTooltip\"\n [nzTooltipPlacement]=\"position\"\n nzTooltipTrigger=\"hover\"\n [nzTooltipVisible]='tooltipVisible'\n nzTooltipOverlayClassName=\"tooltip-class\"\n nz-button\n nz-tooltip\n [nzTooltipColor]=\"tooltipColor\"\n>\n <ng-content></ng-content>\n</div>\n\n<ng-template #customTooltip>\n <div class=\"custom-tooltip\">\n <np-typography\n npType=\"text\"\n npSize=\"xs\"\n npWeight=\"semibold\"\n [ngStyle]=\"{ color: type === 'primary' ? 'rgba(52, 64, 84, 1)' : 'rgba(255, 255, 255, 1)' }\"\n >{{ text }}</np-typography\n >\n <np-typography\n npType=\"text\"\n npSize=\"xs\"\n npWeight=\"medium\"\n [ngStyle]=\"{ color: type === 'primary' ? 'rgba(52, 64, 84, 1)' : 'rgba(255, 255, 255, 1)' }\"\n >{{ descriptions }}</np-typography\n >\n </div>\n</ng-template>\n", styles: [".custom-tooltip{box-shadow:0 4px 6px -2px #10182808,0 12px 16px -4px #10182814;padding:6px 8px;border-radius:8px}::ng-deep .ant-tooltip-inner{padding:0;border-radius:8px;display:flex;align-items:center}::ng-deep .tooltip-class .ant-tooltip-arrow{display:block!important}::ng-deep .ant-tooltip-placement-top.tooltip-class .ant-tooltip-arrow{transform:translateY(95%) translate(-50%)}::ng-deep .ant-tooltip-placement-topLeft .ant-tooltip-arrow{transform:translateY(94%)}\n"] }]
|
|
857
|
+
}], ctorParameters: () => [{ type: i0.Renderer2 }], propDecorators: { type: [{
|
|
858
|
+
type: Input
|
|
859
|
+
}], text: [{
|
|
860
|
+
type: Input
|
|
861
|
+
}], descriptions: [{
|
|
862
|
+
type: Input
|
|
863
|
+
}], position: [{
|
|
864
|
+
type: Input
|
|
865
|
+
}], tooltipVisible: [{
|
|
866
|
+
type: Input
|
|
867
|
+
}], container: [{
|
|
868
|
+
type: ViewChild,
|
|
869
|
+
args: ['container', { static: true }]
|
|
870
|
+
}], ngContent: [{
|
|
871
|
+
type: Input
|
|
872
|
+
}] } });
|
|
873
|
+
|
|
874
|
+
class NpActionBarComponent {
|
|
875
|
+
actions = [];
|
|
876
|
+
data;
|
|
877
|
+
notCompressMin = 5;
|
|
878
|
+
isNotResponsive = false;
|
|
879
|
+
triggerBtn;
|
|
880
|
+
resizeContainer;
|
|
881
|
+
scrollWrapper;
|
|
882
|
+
unCompressedActions = [];
|
|
883
|
+
unCompressedActions2 = [];
|
|
884
|
+
compressedActions = [];
|
|
885
|
+
isMoreOpen = false;
|
|
886
|
+
dropdownStyles = { top: '0px', left: '0px' };
|
|
887
|
+
countIcon = 0;
|
|
888
|
+
countResize = 0;
|
|
889
|
+
canPrevious = false;
|
|
890
|
+
canNext = false;
|
|
891
|
+
isOverflowing = false;
|
|
892
|
+
isPreviousDisable = false;
|
|
893
|
+
isNextDisable = false;
|
|
894
|
+
isReturn = false;
|
|
895
|
+
valueStart = 0;
|
|
896
|
+
isCheckValue = false;
|
|
897
|
+
scrollMaxWidth = null;
|
|
898
|
+
totalActionWidth = 0;
|
|
899
|
+
lastResizeWidth = 0;
|
|
900
|
+
isResize = false;
|
|
901
|
+
iconWidth = 0;
|
|
902
|
+
visibleIcons = 0;
|
|
903
|
+
resizeStack = [];
|
|
904
|
+
resizeObserver = null;
|
|
905
|
+
ngOnInit() {
|
|
906
|
+
this.splitActions();
|
|
907
|
+
this.unCompressedActions2 = this.unCompressedActions;
|
|
908
|
+
this.countIcon = this.unCompressedActions.length;
|
|
909
|
+
this.countResize = this.countIcon - 3;
|
|
910
|
+
}
|
|
911
|
+
ngAfterViewInit() {
|
|
912
|
+
if (!this.isNotResponsive) {
|
|
913
|
+
setTimeout(() => {
|
|
914
|
+
this.updateScrollState();
|
|
915
|
+
this.attachScrollListener();
|
|
916
|
+
this.setupResizeObserver();
|
|
917
|
+
let count = 0;
|
|
918
|
+
const interval = setInterval(() => {
|
|
919
|
+
this.updateScrollState();
|
|
920
|
+
count++;
|
|
921
|
+
if (count > 5)
|
|
922
|
+
clearInterval(interval);
|
|
923
|
+
});
|
|
924
|
+
});
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
setupResizeObserver() {
|
|
928
|
+
const parent = this.resizeContainer?.nativeElement?.parentElement;
|
|
929
|
+
if (!parent || typeof ResizeObserver === 'undefined')
|
|
930
|
+
return;
|
|
931
|
+
this.resizeObserver = new ResizeObserver(() => {
|
|
932
|
+
this.updateScrollState();
|
|
933
|
+
});
|
|
934
|
+
this.resizeObserver.observe(parent);
|
|
935
|
+
}
|
|
936
|
+
ngOnDestroy() {
|
|
937
|
+
this.resizeObserver?.disconnect();
|
|
938
|
+
}
|
|
939
|
+
splitActions() {
|
|
940
|
+
const visible = this.actions.filter((a) => !a.hidden);
|
|
941
|
+
const count = visible.length;
|
|
942
|
+
this.unCompressedActions = visible.slice(0, this.notCompressMin);
|
|
943
|
+
this.compressedActions =
|
|
944
|
+
count > this.notCompressMin ? visible.slice(this.notCompressMin) : [];
|
|
945
|
+
}
|
|
946
|
+
trigger(action) {
|
|
947
|
+
if (typeof action.onClick === 'function') {
|
|
948
|
+
action.onClick(this.data);
|
|
949
|
+
}
|
|
950
|
+
this.isMoreOpen = false;
|
|
951
|
+
}
|
|
952
|
+
showMoreActions() {
|
|
953
|
+
this.isMoreOpen = !this.isMoreOpen;
|
|
954
|
+
if (this.isMoreOpen && this.triggerBtn?.nativeElement) {
|
|
955
|
+
const rect = this.triggerBtn.nativeElement.getBoundingClientRect();
|
|
956
|
+
const dropdownWidth = 150;
|
|
957
|
+
const left = rect.left + rect.width / 2 - dropdownWidth / 2 + window.scrollX;
|
|
958
|
+
this.dropdownStyles = {
|
|
959
|
+
top: `${rect.bottom + 10}px`,
|
|
960
|
+
left: `${Math.max(left, 10)}px`,
|
|
961
|
+
};
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
onClickOutside(event) {
|
|
965
|
+
const target = event.target;
|
|
966
|
+
const inside = this.triggerBtn?.nativeElement.contains(target);
|
|
967
|
+
if (!inside) {
|
|
968
|
+
this.isMoreOpen = false;
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
onWindowScroll() {
|
|
972
|
+
this.isMoreOpen = false;
|
|
973
|
+
}
|
|
974
|
+
onResize() {
|
|
975
|
+
if (!this.isNotResponsive) {
|
|
976
|
+
this.updateScrollState();
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
// private updateScrollState(): void {
|
|
980
|
+
// const el = this.resizeContainer?.nativeElement;
|
|
981
|
+
// if (!el) return;
|
|
982
|
+
// const totalActionWidth = el.scrollWidth;
|
|
983
|
+
// const parentWidth = el.parentElement ? el.parentElement.clientWidth - 3 : 0;
|
|
984
|
+
// if (!this.isCheckValue) {
|
|
985
|
+
// this.isCheckValue = true;
|
|
986
|
+
// this.valueStart = totalActionWidth;
|
|
987
|
+
// }
|
|
988
|
+
// if (parentWidth > this.valueStart) this.isReturn = false;
|
|
989
|
+
// if (parentWidth > totalActionWidth) {
|
|
990
|
+
// if (!this.isReturn) this.scrollMaxWidth = totalActionWidth;
|
|
991
|
+
// } else {
|
|
992
|
+
// this.scrollMaxWidth = 64;
|
|
993
|
+
// this.isReturn = true;
|
|
994
|
+
// }
|
|
995
|
+
// if (totalActionWidth >= parentWidth || this.isReturn) {
|
|
996
|
+
// this.isOverflowing = true;
|
|
997
|
+
// this.unCompressedActions2 = [
|
|
998
|
+
// ...this.unCompressedActions,
|
|
999
|
+
// ...this.compressedActions,
|
|
1000
|
+
// ];
|
|
1001
|
+
// } else {
|
|
1002
|
+
// this.isOverflowing = false;
|
|
1003
|
+
// this.unCompressedActions2 = [...this.unCompressedActions];
|
|
1004
|
+
// }
|
|
1005
|
+
// this.canPrevious = this.isOverflowing;
|
|
1006
|
+
// this.canNext = this.isOverflowing;
|
|
1007
|
+
// setTimeout(() => {
|
|
1008
|
+
// this.updateBtnScroll();
|
|
1009
|
+
// }, 0);
|
|
1010
|
+
// }
|
|
1011
|
+
updateScrollState() {
|
|
1012
|
+
const el = this.resizeContainer?.nativeElement;
|
|
1013
|
+
if (!el)
|
|
1014
|
+
return;
|
|
1015
|
+
if (this.totalActionWidth !== this.scrollMaxWidth) {
|
|
1016
|
+
this.totalActionWidth = el.scrollWidth;
|
|
1017
|
+
}
|
|
1018
|
+
let parentWidth = el.parentElement ? el.parentElement.clientWidth - 3 : 0;
|
|
1019
|
+
if (!this.isCheckValue) {
|
|
1020
|
+
this.isCheckValue = true;
|
|
1021
|
+
this.valueStart = this.totalActionWidth;
|
|
1022
|
+
}
|
|
1023
|
+
if (parentWidth > this.valueStart)
|
|
1024
|
+
this.isReturn = false;
|
|
1025
|
+
if (this.isReturn) {
|
|
1026
|
+
parentWidth = parentWidth - 73;
|
|
1027
|
+
}
|
|
1028
|
+
if (parentWidth > this.totalActionWidth) {
|
|
1029
|
+
const lastState = this.resizeStack[this.resizeStack.length - 1];
|
|
1030
|
+
if (this.countResize === this.countIcon - 3) {
|
|
1031
|
+
this.scrollMaxWidth = this.valueStart;
|
|
1032
|
+
this.isResize = false;
|
|
1033
|
+
}
|
|
1034
|
+
if (parentWidth > lastState) {
|
|
1035
|
+
this.countResize++;
|
|
1036
|
+
const last = this.resizeStack.pop();
|
|
1037
|
+
this.scrollMaxWidth = last !== undefined ? last : null;
|
|
1038
|
+
this.totalActionWidth = last !== undefined ? last : 0;
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
else {
|
|
1042
|
+
this.scrollMaxWidth = this.countResize * 25 - 11;
|
|
1043
|
+
const lastState = this.resizeStack[this.resizeStack.length - 1];
|
|
1044
|
+
if (lastState !== this.scrollMaxWidth) {
|
|
1045
|
+
this.resizeStack.push(this.totalActionWidth);
|
|
1046
|
+
}
|
|
1047
|
+
if (this.totalActionWidth !== this.scrollMaxWidth) {
|
|
1048
|
+
this.totalActionWidth = this.scrollMaxWidth;
|
|
1049
|
+
this.countResize--;
|
|
1050
|
+
this.lastResizeWidth = parentWidth;
|
|
1051
|
+
}
|
|
1052
|
+
this.isResize = true;
|
|
1053
|
+
this.isReturn = true;
|
|
1054
|
+
}
|
|
1055
|
+
if (this.totalActionWidth >= parentWidth || this.isReturn) {
|
|
1056
|
+
this.isOverflowing = true;
|
|
1057
|
+
this.unCompressedActions2 = [
|
|
1058
|
+
...this.unCompressedActions,
|
|
1059
|
+
...this.compressedActions,
|
|
1060
|
+
];
|
|
1061
|
+
}
|
|
1062
|
+
else {
|
|
1063
|
+
this.isOverflowing = false;
|
|
1064
|
+
this.unCompressedActions2 = [...this.unCompressedActions];
|
|
1065
|
+
}
|
|
1066
|
+
this.canPrevious = this.isOverflowing;
|
|
1067
|
+
this.canNext = this.isOverflowing;
|
|
1068
|
+
setTimeout(() => {
|
|
1069
|
+
this.updateBtnScroll();
|
|
1070
|
+
}, 0);
|
|
1071
|
+
}
|
|
1072
|
+
updateBtnScroll() {
|
|
1073
|
+
const ele = this.scrollWrapper?.nativeElement;
|
|
1074
|
+
this.isPreviousDisable = ele.scrollLeft <= 0;
|
|
1075
|
+
this.isNextDisable = ele.scrollLeft + ele.clientWidth >= ele.scrollWidth;
|
|
1076
|
+
}
|
|
1077
|
+
attachScrollListener() {
|
|
1078
|
+
const el = this.scrollWrapper?.nativeElement;
|
|
1079
|
+
if (el) {
|
|
1080
|
+
el.addEventListener('scroll', () => this.updateBtnScroll());
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
scrollLeft() {
|
|
1084
|
+
if (this.isPreviousDisable)
|
|
1085
|
+
return;
|
|
1086
|
+
const el = this.scrollWrapper?.nativeElement;
|
|
1087
|
+
if (el) {
|
|
1088
|
+
const scrollAmount = this.getScrollStep();
|
|
1089
|
+
el.scrollBy({ left: -scrollAmount, behavior: 'smooth' });
|
|
1090
|
+
console.log('scrollLeft :', scrollAmount);
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
scrollRight() {
|
|
1094
|
+
if (this.isNextDisable)
|
|
1095
|
+
return;
|
|
1096
|
+
const el = this.scrollWrapper?.nativeElement;
|
|
1097
|
+
if (el) {
|
|
1098
|
+
const scrollAmount = this.getScrollStep();
|
|
1099
|
+
el.scrollBy({ left: scrollAmount, behavior: 'smooth' });
|
|
1100
|
+
console.log('scrollLeft :', scrollAmount);
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
getScrollStep() {
|
|
1104
|
+
const el = this.scrollWrapper?.nativeElement;
|
|
1105
|
+
const btn = el?.querySelector('button');
|
|
1106
|
+
if (!btn)
|
|
1107
|
+
return 100; // fallback
|
|
1108
|
+
const iconWidth = btn.offsetWidth;
|
|
1109
|
+
const gap = 12;
|
|
1110
|
+
const containerWidth = el.clientWidth;
|
|
1111
|
+
const visibleIcons = Math.ceil(containerWidth / (iconWidth + gap));
|
|
1112
|
+
return visibleIcons * (iconWidth + gap);
|
|
1113
|
+
}
|
|
1114
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpActionBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1115
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: NpActionBarComponent, isStandalone: true, selector: "np-action-bar", inputs: { actions: "actions", data: "data", notCompressMin: "notCompressMin", isNotResponsive: "isNotResponsive" }, host: { listeners: { "document:click": "onClickOutside($event)", "window:scroll": "onWindowScroll()", "window:resize": "onResize()" } }, viewQueries: [{ propertyName: "triggerBtn", first: true, predicate: ["triggerBtn"], descendants: true, read: ElementRef }, { propertyName: "resizeContainer", first: true, predicate: ["resizeContainer"], descendants: true }, { propertyName: "scrollWrapper", first: true, predicate: ["scrollWrapper"], descendants: true }], ngImport: i0, template: "<div class=\"relative flex w-full justify-center items-center\">\n <div #resizeContainer class=\"np-action-bar flex items-center rounded-full border border-gray-300 bg-white px-1 py-1\">\n <button\n *ngIf=\"canPrevious\"\n (click)=\"scrollLeft()\"\n class=\"rounded-full flex items-center justify-center bg-gray-100 w-[26px] h-[20px] btn-previous\"\n [ngClass]=\"{\n 'opacity-40 cursor-not-allowed': isPreviousDisable,\n 'cursor-pointer': !isPreviousDisable,\n\n }\"\n >\n <i class=\"fa-solid fa-chevron-left px-3 py-1\"></i>\n </button>\n\n <div\n #scrollWrapper\n class=\"flex w-full no-scrollbar scroll-smooth\"\n [ngClass]=\"{\n 'mx-3': compressedActions.length === 0 && !canPrevious,\n 'ms-3': !canPrevious && compressedActions.length > 0,\n 'overflow-x-auto': isOverflowing,\n }\"\n [ngStyle]=\"{ 'max-width.px': scrollMaxWidth }\"\n >\n <ng-container *ngFor=\"let action of unCompressedActions2\">\n <np-tooltip [text]=\"action.label || ''\" class=\"h-[20px]\">\n <button\n class=\"action-btn cursor-pointer bg-transparent\"\n (click)=\"trigger(action)\"\n >\n <i class=\"{{ action.classIcon }}\"></i>\n </button>\n </np-tooltip>\n </ng-container>\n </div>\n\n <button\n *ngIf=\"canNext\"\n (click)=\"scrollRight()\"\n class=\"rounded-full flex items-center justify-center bg-gray-100 w-[26px] h-[20px] btn-next\"\n [ngClass]=\"{\n 'opacity-40 cursor-not-allowed': isNextDisable,\n 'cursor-pointer': !isNextDisable,\n }\"\n >\n <i class=\"fa-solid fa-chevron-right\"></i>\n </button>\n\n <np-tooltip\n *ngIf=\"compressedActions.length > 0 && !isOverflowing\"\n text=\"More actions\"\n class=\"px-3 ms-1 rounded-2xl h-[20px]\"\n [ngClass]=\"{\n 'bg-gray-100': isMoreOpen,\n 'bg-transparent': !isMoreOpen,\n }\"\n >\n <button\n #triggerBtn\n class=\"action-btn cursor-pointer bg-transparent\"\n (click)=\"showMoreActions()\"\n >\n <i class=\"fa-solid fa-ellipsis\"></i>\n </button>\n </np-tooltip>\n </div>\n</div>\n\n<div\n *ngIf=\"isMoreOpen\"\n class=\"fixed z-999 min-w-[150px] bg-white border border-gray-200 rounded-lg shadow-md overflow-hidden\"\n [ngStyle]=\"dropdownStyles\"\n>\n <ng-container *ngFor=\"let action of compressedActions\">\n <button\n class=\"flex w-full items-center gap-2 px-3 py-2 hover:bg-gray-100 transition-all duration-150 text-left\"\n (click)=\"trigger(action)\"\n >\n <i class=\"{{ action.classIcon }}\"></i>\n {{ action.label }}\n </button>\n </ng-container>\n</div>\n", styles: [".np-action-bar .action-btn{width:13px;height:20px}.np-action-bar .no-scrollbar{scrollbar-width:none;-ms-overflow-style:none;gap:12px}.np-action-bar .no-scrollbar::-webkit-scrollbar{display:none}.btn-previous{margin-right:5px}.btn-next{margin-left:5px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: NpTooltipComponent, selector: "np-tooltip", inputs: ["type", "text", "descriptions", "position", "tooltipVisible", "ngContent"] }] });
|
|
1116
|
+
}
|
|
1117
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpActionBarComponent, decorators: [{
|
|
1118
|
+
type: Component,
|
|
1119
|
+
args: [{ selector: 'np-action-bar', imports: [CommonModule, NpTooltipComponent], template: "<div class=\"relative flex w-full justify-center items-center\">\n <div #resizeContainer class=\"np-action-bar flex items-center rounded-full border border-gray-300 bg-white px-1 py-1\">\n <button\n *ngIf=\"canPrevious\"\n (click)=\"scrollLeft()\"\n class=\"rounded-full flex items-center justify-center bg-gray-100 w-[26px] h-[20px] btn-previous\"\n [ngClass]=\"{\n 'opacity-40 cursor-not-allowed': isPreviousDisable,\n 'cursor-pointer': !isPreviousDisable,\n\n }\"\n >\n <i class=\"fa-solid fa-chevron-left px-3 py-1\"></i>\n </button>\n\n <div\n #scrollWrapper\n class=\"flex w-full no-scrollbar scroll-smooth\"\n [ngClass]=\"{\n 'mx-3': compressedActions.length === 0 && !canPrevious,\n 'ms-3': !canPrevious && compressedActions.length > 0,\n 'overflow-x-auto': isOverflowing,\n }\"\n [ngStyle]=\"{ 'max-width.px': scrollMaxWidth }\"\n >\n <ng-container *ngFor=\"let action of unCompressedActions2\">\n <np-tooltip [text]=\"action.label || ''\" class=\"h-[20px]\">\n <button\n class=\"action-btn cursor-pointer bg-transparent\"\n (click)=\"trigger(action)\"\n >\n <i class=\"{{ action.classIcon }}\"></i>\n </button>\n </np-tooltip>\n </ng-container>\n </div>\n\n <button\n *ngIf=\"canNext\"\n (click)=\"scrollRight()\"\n class=\"rounded-full flex items-center justify-center bg-gray-100 w-[26px] h-[20px] btn-next\"\n [ngClass]=\"{\n 'opacity-40 cursor-not-allowed': isNextDisable,\n 'cursor-pointer': !isNextDisable,\n }\"\n >\n <i class=\"fa-solid fa-chevron-right\"></i>\n </button>\n\n <np-tooltip\n *ngIf=\"compressedActions.length > 0 && !isOverflowing\"\n text=\"More actions\"\n class=\"px-3 ms-1 rounded-2xl h-[20px]\"\n [ngClass]=\"{\n 'bg-gray-100': isMoreOpen,\n 'bg-transparent': !isMoreOpen,\n }\"\n >\n <button\n #triggerBtn\n class=\"action-btn cursor-pointer bg-transparent\"\n (click)=\"showMoreActions()\"\n >\n <i class=\"fa-solid fa-ellipsis\"></i>\n </button>\n </np-tooltip>\n </div>\n</div>\n\n<div\n *ngIf=\"isMoreOpen\"\n class=\"fixed z-999 min-w-[150px] bg-white border border-gray-200 rounded-lg shadow-md overflow-hidden\"\n [ngStyle]=\"dropdownStyles\"\n>\n <ng-container *ngFor=\"let action of compressedActions\">\n <button\n class=\"flex w-full items-center gap-2 px-3 py-2 hover:bg-gray-100 transition-all duration-150 text-left\"\n (click)=\"trigger(action)\"\n >\n <i class=\"{{ action.classIcon }}\"></i>\n {{ action.label }}\n </button>\n </ng-container>\n</div>\n", styles: [".np-action-bar .action-btn{width:13px;height:20px}.np-action-bar .no-scrollbar{scrollbar-width:none;-ms-overflow-style:none;gap:12px}.np-action-bar .no-scrollbar::-webkit-scrollbar{display:none}.btn-previous{margin-right:5px}.btn-next{margin-left:5px}\n"] }]
|
|
1120
|
+
}], propDecorators: { actions: [{
|
|
1121
|
+
type: Input
|
|
1122
|
+
}], data: [{
|
|
1123
|
+
type: Input
|
|
1124
|
+
}], notCompressMin: [{
|
|
1125
|
+
type: Input
|
|
1126
|
+
}], isNotResponsive: [{
|
|
1127
|
+
type: Input
|
|
1128
|
+
}], triggerBtn: [{
|
|
1129
|
+
type: ViewChild,
|
|
1130
|
+
args: ['triggerBtn', { read: ElementRef }]
|
|
1131
|
+
}], resizeContainer: [{
|
|
1132
|
+
type: ViewChild,
|
|
1133
|
+
args: ['resizeContainer']
|
|
1134
|
+
}], scrollWrapper: [{
|
|
1135
|
+
type: ViewChild,
|
|
1136
|
+
args: ['scrollWrapper']
|
|
1137
|
+
}], onClickOutside: [{
|
|
1138
|
+
type: HostListener,
|
|
1139
|
+
args: ['document:click', ['$event']]
|
|
1140
|
+
}], onWindowScroll: [{
|
|
1141
|
+
type: HostListener,
|
|
1142
|
+
args: ['window:scroll']
|
|
1143
|
+
}], onResize: [{
|
|
1144
|
+
type: HostListener,
|
|
1145
|
+
args: ['window:resize']
|
|
1146
|
+
}] } });
|
|
1147
|
+
|
|
1148
|
+
class NpTreeComponent {
|
|
1149
|
+
type = 'default';
|
|
1150
|
+
expandPosition = 'left';
|
|
1151
|
+
notCompressMin = 3;
|
|
1152
|
+
isCompactActions = false;
|
|
1153
|
+
autoHideActions = true;
|
|
1154
|
+
className = '';
|
|
1155
|
+
_list = [];
|
|
1156
|
+
_flattenList = [];
|
|
1157
|
+
set list(value) {
|
|
1158
|
+
this._flattenList = this.getFlattenList(value);
|
|
1159
|
+
this._list = value;
|
|
1160
|
+
this.visibleNodes = this.getVisibleNodes();
|
|
1161
|
+
}
|
|
1162
|
+
_input = new FormControl(null);
|
|
1163
|
+
set input(value) {
|
|
1164
|
+
this._input = !!value ? value : new FormControl([]);
|
|
1165
|
+
}
|
|
1166
|
+
valueChange = new EventEmitter();
|
|
1167
|
+
itemActiveId = '';
|
|
1168
|
+
useLine = false;
|
|
1169
|
+
visibleNodes = [];
|
|
1170
|
+
getFlattenList(arr, level = 0, parentId = null, parentLastMap = {}, parentMap = {}) {
|
|
1171
|
+
if (!arr)
|
|
1172
|
+
return [];
|
|
1173
|
+
return arr.reduce((acc, item, index, array) => {
|
|
1174
|
+
const isLast = index === array.length - 1;
|
|
1175
|
+
const isLastByLevel = { ...parentLastMap, [level]: isLast };
|
|
1176
|
+
const hasParentByLevel = { ...parentMap, [level]: !!parentId };
|
|
1177
|
+
const flatItem = {
|
|
1178
|
+
...item,
|
|
1179
|
+
level,
|
|
1180
|
+
parentId,
|
|
1181
|
+
isExpanded: false,
|
|
1182
|
+
isLastByLevel,
|
|
1183
|
+
hasParentByLevel,
|
|
1184
|
+
};
|
|
1185
|
+
acc.push(flatItem);
|
|
1186
|
+
if (item.childrens?.length) {
|
|
1187
|
+
const children = this.getFlattenList(item.childrens, level + 1, item.id, isLastByLevel, hasParentByLevel);
|
|
1188
|
+
acc.push(...children);
|
|
1189
|
+
}
|
|
1190
|
+
return acc;
|
|
1191
|
+
}, []);
|
|
1192
|
+
}
|
|
1193
|
+
onExpand(item) {
|
|
1194
|
+
item.isExpanded = !item.isExpanded;
|
|
1195
|
+
this.visibleNodes = this.getVisibleNodes();
|
|
1196
|
+
}
|
|
1197
|
+
getVisibleNodes() {
|
|
1198
|
+
const result = [];
|
|
1199
|
+
const map = new Map(this._flattenList?.map((item) => [item.id, item]));
|
|
1200
|
+
for (const item of this._flattenList ?? []) {
|
|
1201
|
+
if (!item.parentId || this.isParentExpanded(item, map)) {
|
|
1202
|
+
result.push(item);
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
return result;
|
|
1206
|
+
}
|
|
1207
|
+
isParentExpanded(item, map) {
|
|
1208
|
+
let parent = map.get(item.parentId);
|
|
1209
|
+
while (parent) {
|
|
1210
|
+
if (!parent.isExpanded)
|
|
1211
|
+
return false;
|
|
1212
|
+
parent = map.get(parent.parentId);
|
|
1213
|
+
}
|
|
1214
|
+
return true;
|
|
1215
|
+
}
|
|
1216
|
+
itemHasChildren(item) {
|
|
1217
|
+
return this._flattenList?.some((x) => x.parentId === item.id) ?? false;
|
|
1218
|
+
}
|
|
1219
|
+
onSelectItem(item) {
|
|
1220
|
+
if (!item) {
|
|
1221
|
+
return;
|
|
1222
|
+
}
|
|
1223
|
+
item.isSelected = !item.isSelected;
|
|
1224
|
+
this.itemActiveId = item.id;
|
|
1225
|
+
if (this.type === 'default')
|
|
1226
|
+
return;
|
|
1227
|
+
this.onCheckItem(item);
|
|
1228
|
+
}
|
|
1229
|
+
onCheckItem(item) {
|
|
1230
|
+
const isParentClick = this.itemHasChildren(item);
|
|
1231
|
+
item.isChecked = !item.isChecked;
|
|
1232
|
+
item.isIndeterminate = false;
|
|
1233
|
+
item.checkboxType = 'checkbox';
|
|
1234
|
+
if (isParentClick) {
|
|
1235
|
+
this.updateChildrenSelection(item);
|
|
1236
|
+
}
|
|
1237
|
+
this.updateParentSelection(item.parentId ?? undefined);
|
|
1238
|
+
this.onValueChange();
|
|
1239
|
+
}
|
|
1240
|
+
updateParentSelection(parentId) {
|
|
1241
|
+
if (!parentId)
|
|
1242
|
+
return;
|
|
1243
|
+
const parentNode = this._flattenList?.find((x) => x.id === parentId);
|
|
1244
|
+
if (!parentNode)
|
|
1245
|
+
return;
|
|
1246
|
+
const children = this._flattenList?.filter((x) => x.parentId === parentNode.id) ?? [];
|
|
1247
|
+
const allSelected = children.every((child) => child.isChecked);
|
|
1248
|
+
const someSelected = children.some((child) => child.isChecked || child.isIndeterminate);
|
|
1249
|
+
parentNode.isIndeterminate = someSelected && !allSelected;
|
|
1250
|
+
parentNode.isChecked = allSelected || (someSelected && !allSelected);
|
|
1251
|
+
parentNode.checkboxType = allSelected
|
|
1252
|
+
? 'checkbox'
|
|
1253
|
+
: someSelected
|
|
1254
|
+
? 'indeterminate'
|
|
1255
|
+
: undefined;
|
|
1256
|
+
this.updateParentSelection(parentNode.parentId ?? undefined);
|
|
1257
|
+
}
|
|
1258
|
+
updateChildrenSelection(node) {
|
|
1259
|
+
const children = this._flattenList?.filter((x) => x.parentId === node.id) ?? [];
|
|
1260
|
+
for (const child of children) {
|
|
1261
|
+
child.isChecked = node.isChecked;
|
|
1262
|
+
child.isIndeterminate = false;
|
|
1263
|
+
child.checkboxType = 'checkbox';
|
|
1264
|
+
this.updateChildrenSelection(child);
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
onValueChange() {
|
|
1268
|
+
// this.valueChange.
|
|
1269
|
+
// console.log('data-datadata', this._input?.value);
|
|
1270
|
+
}
|
|
1271
|
+
onSelectAction(event) {
|
|
1272
|
+
if (event.onClick()) {
|
|
1273
|
+
event.onClick(event);
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
ngOnInit() {
|
|
1277
|
+
if (this._list?.length) {
|
|
1278
|
+
this.normalizeIcons(this._list);
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
normalizeIcons(list) {
|
|
1282
|
+
list.forEach((item) => {
|
|
1283
|
+
if (item.iconCollapsed) {
|
|
1284
|
+
item.iconExpanded ??= item.iconCollapsed;
|
|
1285
|
+
item.iconLeaf ??= item.iconCollapsed;
|
|
1286
|
+
}
|
|
1287
|
+
if (item.childrens?.length) {
|
|
1288
|
+
this.normalizeIcons(item.childrens);
|
|
1289
|
+
}
|
|
1290
|
+
});
|
|
1291
|
+
}
|
|
1292
|
+
getNodeClasses(item, isLast) {
|
|
1293
|
+
return {
|
|
1294
|
+
['level-' + (item.level ?? 0)]: true,
|
|
1295
|
+
'is-last': isLast,
|
|
1296
|
+
};
|
|
1297
|
+
}
|
|
1298
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpTreeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1299
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.5", type: NpTreeComponent, isStandalone: true, selector: "np-tree", inputs: { type: "type", expandPosition: "expandPosition", notCompressMin: "notCompressMin", isCompactActions: "isCompactActions", autoHideActions: "autoHideActions", className: "className", list: "list", input: "input", itemActiveId: "itemActiveId", useLine: "useLine" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: "<ng-template\n #wrapWithLevel\n let-content\n let-level=\"level\"\n let-max=\"max\"\n let-isLastByLevel=\"isLastByLevel\"\n let-hasParentByLevel=\"hasParentByLevel\"\n let-isLine=\"isLine\"\n>\n <div\n [ngClass]=\"[\n 'tree-line',\n 'level-' + level,\n isLine ? '' : 'no-line',\n isLastByLevel?.[level] ? 'is-last' : '',\n hasParentByLevel?.[level] ? 'has-parent' : '',\n expandPosition === 'right' ? 'expand-right' : '',\n ]\"\n >\n @if (level < max) {\n <ng-container\n *ngTemplateOutlet=\"\n wrapWithLevel;\n context: {\n $implicit: content,\n level: level + 1,\n max: max,\n isLastByLevel: isLastByLevel,\n hasParentByLevel: hasParentByLevel,\n isLine: isLine\n }\n \"\n ></ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n }\n </div>\n</ng-template>\n\n<div class=\"np-tree {{className}}\">\n @for (item of visibleNodes; track item; let isLast = $last) {\n <ng-template #treeNodeContent>\n <div\n class=\"tree-node\"\n [ngClass]=\"[\n itemHasChildren(item) ? 'has-children' : '',\n item.parentId ? 'has-parent' : ''\n ]\"\n >\n <div\n class=\"flex py-[7px] w-full min-h-[40px] bt-1 cursor-pointer tree-item group {{item.className}}\"\n [class.tree-node-selected]=\"item?.id === itemActiveId\"\n [routerLink]=\"item.path ? item.path : null\"\n [routerLinkActive]=\"item.path ? 'tree-node-selected' : ''\"\n >\n <div class=\"flex gap-1 items-center\">\n @if (expandPosition === 'left') {\n @if (itemHasChildren(item)) {\n <np-button npType=\"icon\" npSize=\"bs\" (click)=\"onExpand(item)\">\n <i\n class=\"fa-solid fa-caret-right\"\n [ngClass]=\"item?.isExpanded ? 'iconExpand' : ''\"\n style=\"color: rgba(102, 112, 133, 1)\"\n ></i>\n </np-button>\n } @else {\n <div class=\"w-[15px] h-[14px]\"></div>\n }\n }\n\n <div class=\"flex items-center gap-1\" (click)=\"onSelectItem(item)\">\n @if ( type === 'checkbox' ) {\n <np-checkbox\n [input]=\"item.isChecked\"\n [type]=\"item.checkboxType || 'checkbox'\"\n size=\"md\"\n (valueChange)=\"onCheckItem(item)\"\n (click)=\"$event.stopPropagation()\"\n ></np-checkbox>\n } @if (type === 'icon') {\n <i\n class=\"fa-light\"\n [ngClass]=\"\n item?.childrens?.length\n ? item?.isExpanded\n ? item?.iconExpanded\n : item?.iconCollapsed\n : item?.iconLeaf\n \"\n ></i>\n }\n\n <span class=\"text-[16px] whitespace-nowrap\">{{ item?.name }}</span>\n </div>\n </div>\n\n <div class=\"px-2 w-full flex items-center justify-end gap-1\">\n @if ((item?.actions?.length ?? 0) > 0){\n <np-action-bar\n class=\"w-full flex justify-end\"\n ngClass=\"\n {{autoHideActions ? 'opacity-0 group-hover:opacity-100 transition-opacity duration-200' : ''}}\n \"\n [actions]=\"item.actions ?? []\"\n [notCompressMin]=\"this.notCompressMin\"\n [isNotResponsive]=\"isCompactActions\"\n >\n </np-action-bar>\n }\n @if (expandPosition === 'right')\n {\n @if (itemHasChildren(item)){\n <np-button npType=\"icon\" npSize=\"bs\" (click)=\"onExpand(item)\" className=\"flex w-[17px]\">\n <i\n class=\"fa-solid fa-chevron-right\"\n [ngClass]=\"item?.isExpanded ? 'iconExpand' : ''\"\n style=\"color: rgba(102, 112, 133, 1)\"\n ></i>\n </np-button>\n }\n @else {\n <div class=\"w-[17px]\"></div>\n }\n }\n </div>\n </div>\n </div>\n </ng-template>\n\n <ng-container\n *ngTemplateOutlet=\"\n wrapWithLevel;\n context: {\n $implicit: treeNodeContent,\n level: 0,\n max: item.level ?? 0,\n isLastByLevel: item.isLastByLevel,\n hasParentByLevel: item.hasParentByLevel,\n isLine: useLine\n }\n \"\n ></ng-container>\n }\n</div>\n", styles: [".np-tree .tree-node{transition:height .3s ease-out}.np-tree .iconExpand{transform:rotate(90deg);transition:transform .1s ease-in-out}.np-tree .icon-collapse{transition:transform .3s ease-in-out}.np-tree .tree-node-selected{background-color:#f9fafb}::ng-deep .np-tree np-action-bar div.justify-center{justify-content:end!important}.level-1{padding-left:40px}.level-1.expand-right{padding-left:30px}.tree-line .level-1{position:relative}.tree-line .level-1.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-1.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-1.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-1.expand-right.is-last:after{display:none}.tree-line .level-1:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-1:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-1.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-1.is-last:after{display:none}.level-2{padding-left:40px}.level-2.expand-right{padding-left:30px}.tree-line .level-2{position:relative}.tree-line .level-2.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-2.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-2.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-2.expand-right.is-last:after{display:none}.tree-line .level-2:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-2:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-2.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-2.is-last:after{display:none}.level-3{padding-left:40px}.level-3.expand-right{padding-left:30px}.tree-line .level-3{position:relative}.tree-line .level-3.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-3.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-3.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-3.expand-right.is-last:after{display:none}.tree-line .level-3:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-3:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-3.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-3.is-last:after{display:none}.level-4{padding-left:40px}.level-4.expand-right{padding-left:30px}.tree-line .level-4{position:relative}.tree-line .level-4.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-4.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-4.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-4.expand-right.is-last:after{display:none}.tree-line .level-4:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-4:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-4.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-4.is-last:after{display:none}.level-5{padding-left:40px}.level-5.expand-right{padding-left:30px}.tree-line .level-5{position:relative}.tree-line .level-5.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-5.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-5.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-5.expand-right.is-last:after{display:none}.tree-line .level-5:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-5:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-5.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-5.is-last:after{display:none}.level-6{padding-left:40px}.level-6.expand-right{padding-left:30px}.tree-line .level-6{position:relative}.tree-line .level-6.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-6.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-6.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-6.expand-right.is-last:after{display:none}.tree-line .level-6:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-6:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-6.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-6.is-last:after{display:none}.level-7{padding-left:40px}.level-7.expand-right{padding-left:30px}.tree-line .level-7{position:relative}.tree-line .level-7.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-7.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-7.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-7.expand-right.is-last:after{display:none}.tree-line .level-7:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-7:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-7.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-7.is-last:after{display:none}.level-8{padding-left:40px}.level-8.expand-right{padding-left:30px}.tree-line .level-8{position:relative}.tree-line .level-8.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-8.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-8.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-8.expand-right.is-last:after{display:none}.tree-line .level-8:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-8:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-8.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-8.is-last:after{display:none}.level-9{padding-left:40px}.level-9.expand-right{padding-left:30px}.tree-line .level-9{position:relative}.tree-line .level-9.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-9.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-9.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-9.expand-right.is-last:after{display:none}.tree-line .level-9:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-9:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-9.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-9.is-last:after{display:none}.level-10{padding-left:40px}.level-10.expand-right{padding-left:30px}.tree-line .level-10{position:relative}.tree-line .level-10.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-10.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-10.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-10.expand-right.is-last:after{display:none}.tree-line .level-10:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-10:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-10.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-10.is-last:after{display:none}.level-11{padding-left:40px}.level-11.expand-right{padding-left:30px}.tree-line .level-11{position:relative}.tree-line .level-11.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-11.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-11.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-11.expand-right.is-last:after{display:none}.tree-line .level-11:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-11:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-11.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-11.is-last:after{display:none}.level-12{padding-left:40px}.level-12.expand-right{padding-left:30px}.tree-line .level-12{position:relative}.tree-line .level-12.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-12.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-12.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-12.expand-right.is-last:after{display:none}.tree-line .level-12:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-12:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-12.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-12.is-last:after{display:none}.level-13{padding-left:40px}.level-13.expand-right{padding-left:30px}.tree-line .level-13{position:relative}.tree-line .level-13.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-13.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-13.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-13.expand-right.is-last:after{display:none}.tree-line .level-13:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-13:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-13.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-13.is-last:after{display:none}.level-14{padding-left:40px}.level-14.expand-right{padding-left:30px}.tree-line .level-14{position:relative}.tree-line .level-14.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-14.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-14.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-14.expand-right.is-last:after{display:none}.tree-line .level-14:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-14:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-14.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-14.is-last:after{display:none}.level-15{padding-left:40px}.level-15.expand-right{padding-left:30px}.tree-line .level-15{position:relative}.tree-line .level-15.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-15.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-15.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-15.expand-right.is-last:after{display:none}.tree-line .level-15:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-15:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-15.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-15.is-last:after{display:none}.level-16{padding-left:40px}.level-16.expand-right{padding-left:30px}.tree-line .level-16{position:relative}.tree-line .level-16.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-16.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-16.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-16.expand-right.is-last:after{display:none}.tree-line .level-16:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-16:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-16.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-16.is-last:after{display:none}.level-17{padding-left:40px}.level-17.expand-right{padding-left:30px}.tree-line .level-17{position:relative}.tree-line .level-17.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-17.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-17.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-17.expand-right.is-last:after{display:none}.tree-line .level-17:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-17:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-17.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-17.is-last:after{display:none}.level-18{padding-left:40px}.level-18.expand-right{padding-left:30px}.tree-line .level-18{position:relative}.tree-line .level-18.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-18.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-18.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-18.expand-right.is-last:after{display:none}.tree-line .level-18:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-18:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-18.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-18.is-last:after{display:none}.level-19{padding-left:40px}.level-19.expand-right{padding-left:30px}.tree-line .level-19{position:relative}.tree-line .level-19.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-19.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-19.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-19.expand-right.is-last:after{display:none}.tree-line .level-19:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-19:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-19.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-19.is-last:after{display:none}.level-20{padding-left:40px}.level-20.expand-right{padding-left:30px}.tree-line .level-20{position:relative}.tree-line .level-20.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-20.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-20.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-20.expand-right.is-last:after{display:none}.tree-line .level-20:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-20:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-20.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-20.is-last:after{display:none}.tree-line:has(>.tree-line.has-parent):after{display:none}.tree-line.is-last:has(>.tree-line.has-parent):before{display:none}.tree-line.no-line:before,.tree-line.no-line:after{display:none!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: NpCheckboxComponent, selector: "np-checkbox", inputs: ["input", "type", "size", "npType", "isDisabled", "groupName", "label", "description", "isIndeterminate"], outputs: ["valueChange"] }, { kind: "component", type: NpButtonComponent, selector: "np-button", inputs: ["npType", "npSize", "className", "isLoading", "disabled", "ngContent"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1$4.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1$4.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "component", type: NpActionBarComponent, selector: "np-action-bar", inputs: ["actions", "data", "notCompressMin", "isNotResponsive"] }] });
|
|
1300
|
+
}
|
|
1301
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpTreeComponent, decorators: [{
|
|
1302
|
+
type: Component,
|
|
1303
|
+
args: [{ selector: 'np-tree', imports: [
|
|
1304
|
+
CommonModule,
|
|
1305
|
+
NpCheckboxComponent,
|
|
1306
|
+
NpButtonComponent,
|
|
1307
|
+
RouterModule,
|
|
1308
|
+
NpActionBarComponent,
|
|
1309
|
+
], template: "<ng-template\n #wrapWithLevel\n let-content\n let-level=\"level\"\n let-max=\"max\"\n let-isLastByLevel=\"isLastByLevel\"\n let-hasParentByLevel=\"hasParentByLevel\"\n let-isLine=\"isLine\"\n>\n <div\n [ngClass]=\"[\n 'tree-line',\n 'level-' + level,\n isLine ? '' : 'no-line',\n isLastByLevel?.[level] ? 'is-last' : '',\n hasParentByLevel?.[level] ? 'has-parent' : '',\n expandPosition === 'right' ? 'expand-right' : '',\n ]\"\n >\n @if (level < max) {\n <ng-container\n *ngTemplateOutlet=\"\n wrapWithLevel;\n context: {\n $implicit: content,\n level: level + 1,\n max: max,\n isLastByLevel: isLastByLevel,\n hasParentByLevel: hasParentByLevel,\n isLine: isLine\n }\n \"\n ></ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n }\n </div>\n</ng-template>\n\n<div class=\"np-tree {{className}}\">\n @for (item of visibleNodes; track item; let isLast = $last) {\n <ng-template #treeNodeContent>\n <div\n class=\"tree-node\"\n [ngClass]=\"[\n itemHasChildren(item) ? 'has-children' : '',\n item.parentId ? 'has-parent' : ''\n ]\"\n >\n <div\n class=\"flex py-[7px] w-full min-h-[40px] bt-1 cursor-pointer tree-item group {{item.className}}\"\n [class.tree-node-selected]=\"item?.id === itemActiveId\"\n [routerLink]=\"item.path ? item.path : null\"\n [routerLinkActive]=\"item.path ? 'tree-node-selected' : ''\"\n >\n <div class=\"flex gap-1 items-center\">\n @if (expandPosition === 'left') {\n @if (itemHasChildren(item)) {\n <np-button npType=\"icon\" npSize=\"bs\" (click)=\"onExpand(item)\">\n <i\n class=\"fa-solid fa-caret-right\"\n [ngClass]=\"item?.isExpanded ? 'iconExpand' : ''\"\n style=\"color: rgba(102, 112, 133, 1)\"\n ></i>\n </np-button>\n } @else {\n <div class=\"w-[15px] h-[14px]\"></div>\n }\n }\n\n <div class=\"flex items-center gap-1\" (click)=\"onSelectItem(item)\">\n @if ( type === 'checkbox' ) {\n <np-checkbox\n [input]=\"item.isChecked\"\n [type]=\"item.checkboxType || 'checkbox'\"\n size=\"md\"\n (valueChange)=\"onCheckItem(item)\"\n (click)=\"$event.stopPropagation()\"\n ></np-checkbox>\n } @if (type === 'icon') {\n <i\n class=\"fa-light\"\n [ngClass]=\"\n item?.childrens?.length\n ? item?.isExpanded\n ? item?.iconExpanded\n : item?.iconCollapsed\n : item?.iconLeaf\n \"\n ></i>\n }\n\n <span class=\"text-[16px] whitespace-nowrap\">{{ item?.name }}</span>\n </div>\n </div>\n\n <div class=\"px-2 w-full flex items-center justify-end gap-1\">\n @if ((item?.actions?.length ?? 0) > 0){\n <np-action-bar\n class=\"w-full flex justify-end\"\n ngClass=\"\n {{autoHideActions ? 'opacity-0 group-hover:opacity-100 transition-opacity duration-200' : ''}}\n \"\n [actions]=\"item.actions ?? []\"\n [notCompressMin]=\"this.notCompressMin\"\n [isNotResponsive]=\"isCompactActions\"\n >\n </np-action-bar>\n }\n @if (expandPosition === 'right')\n {\n @if (itemHasChildren(item)){\n <np-button npType=\"icon\" npSize=\"bs\" (click)=\"onExpand(item)\" className=\"flex w-[17px]\">\n <i\n class=\"fa-solid fa-chevron-right\"\n [ngClass]=\"item?.isExpanded ? 'iconExpand' : ''\"\n style=\"color: rgba(102, 112, 133, 1)\"\n ></i>\n </np-button>\n }\n @else {\n <div class=\"w-[17px]\"></div>\n }\n }\n </div>\n </div>\n </div>\n </ng-template>\n\n <ng-container\n *ngTemplateOutlet=\"\n wrapWithLevel;\n context: {\n $implicit: treeNodeContent,\n level: 0,\n max: item.level ?? 0,\n isLastByLevel: item.isLastByLevel,\n hasParentByLevel: item.hasParentByLevel,\n isLine: useLine\n }\n \"\n ></ng-container>\n }\n</div>\n", styles: [".np-tree .tree-node{transition:height .3s ease-out}.np-tree .iconExpand{transform:rotate(90deg);transition:transform .1s ease-in-out}.np-tree .icon-collapse{transition:transform .3s ease-in-out}.np-tree .tree-node-selected{background-color:#f9fafb}::ng-deep .np-tree np-action-bar div.justify-center{justify-content:end!important}.level-1{padding-left:40px}.level-1.expand-right{padding-left:30px}.tree-line .level-1{position:relative}.tree-line .level-1.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-1.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-1.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-1.expand-right.is-last:after{display:none}.tree-line .level-1:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-1:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-1.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-1.is-last:after{display:none}.level-2{padding-left:40px}.level-2.expand-right{padding-left:30px}.tree-line .level-2{position:relative}.tree-line .level-2.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-2.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-2.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-2.expand-right.is-last:after{display:none}.tree-line .level-2:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-2:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-2.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-2.is-last:after{display:none}.level-3{padding-left:40px}.level-3.expand-right{padding-left:30px}.tree-line .level-3{position:relative}.tree-line .level-3.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-3.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-3.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-3.expand-right.is-last:after{display:none}.tree-line .level-3:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-3:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-3.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-3.is-last:after{display:none}.level-4{padding-left:40px}.level-4.expand-right{padding-left:30px}.tree-line .level-4{position:relative}.tree-line .level-4.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-4.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-4.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-4.expand-right.is-last:after{display:none}.tree-line .level-4:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-4:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-4.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-4.is-last:after{display:none}.level-5{padding-left:40px}.level-5.expand-right{padding-left:30px}.tree-line .level-5{position:relative}.tree-line .level-5.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-5.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-5.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-5.expand-right.is-last:after{display:none}.tree-line .level-5:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-5:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-5.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-5.is-last:after{display:none}.level-6{padding-left:40px}.level-6.expand-right{padding-left:30px}.tree-line .level-6{position:relative}.tree-line .level-6.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-6.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-6.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-6.expand-right.is-last:after{display:none}.tree-line .level-6:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-6:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-6.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-6.is-last:after{display:none}.level-7{padding-left:40px}.level-7.expand-right{padding-left:30px}.tree-line .level-7{position:relative}.tree-line .level-7.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-7.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-7.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-7.expand-right.is-last:after{display:none}.tree-line .level-7:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-7:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-7.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-7.is-last:after{display:none}.level-8{padding-left:40px}.level-8.expand-right{padding-left:30px}.tree-line .level-8{position:relative}.tree-line .level-8.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-8.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-8.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-8.expand-right.is-last:after{display:none}.tree-line .level-8:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-8:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-8.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-8.is-last:after{display:none}.level-9{padding-left:40px}.level-9.expand-right{padding-left:30px}.tree-line .level-9{position:relative}.tree-line .level-9.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-9.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-9.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-9.expand-right.is-last:after{display:none}.tree-line .level-9:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-9:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-9.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-9.is-last:after{display:none}.level-10{padding-left:40px}.level-10.expand-right{padding-left:30px}.tree-line .level-10{position:relative}.tree-line .level-10.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-10.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-10.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-10.expand-right.is-last:after{display:none}.tree-line .level-10:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-10:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-10.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-10.is-last:after{display:none}.level-11{padding-left:40px}.level-11.expand-right{padding-left:30px}.tree-line .level-11{position:relative}.tree-line .level-11.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-11.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-11.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-11.expand-right.is-last:after{display:none}.tree-line .level-11:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-11:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-11.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-11.is-last:after{display:none}.level-12{padding-left:40px}.level-12.expand-right{padding-left:30px}.tree-line .level-12{position:relative}.tree-line .level-12.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-12.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-12.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-12.expand-right.is-last:after{display:none}.tree-line .level-12:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-12:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-12.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-12.is-last:after{display:none}.level-13{padding-left:40px}.level-13.expand-right{padding-left:30px}.tree-line .level-13{position:relative}.tree-line .level-13.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-13.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-13.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-13.expand-right.is-last:after{display:none}.tree-line .level-13:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-13:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-13.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-13.is-last:after{display:none}.level-14{padding-left:40px}.level-14.expand-right{padding-left:30px}.tree-line .level-14{position:relative}.tree-line .level-14.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-14.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-14.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-14.expand-right.is-last:after{display:none}.tree-line .level-14:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-14:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-14.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-14.is-last:after{display:none}.level-15{padding-left:40px}.level-15.expand-right{padding-left:30px}.tree-line .level-15{position:relative}.tree-line .level-15.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-15.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-15.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-15.expand-right.is-last:after{display:none}.tree-line .level-15:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-15:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-15.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-15.is-last:after{display:none}.level-16{padding-left:40px}.level-16.expand-right{padding-left:30px}.tree-line .level-16{position:relative}.tree-line .level-16.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-16.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-16.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-16.expand-right.is-last:after{display:none}.tree-line .level-16:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-16:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-16.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-16.is-last:after{display:none}.level-17{padding-left:40px}.level-17.expand-right{padding-left:30px}.tree-line .level-17{position:relative}.tree-line .level-17.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-17.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-17.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-17.expand-right.is-last:after{display:none}.tree-line .level-17:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-17:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-17.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-17.is-last:after{display:none}.level-18{padding-left:40px}.level-18.expand-right{padding-left:30px}.tree-line .level-18{position:relative}.tree-line .level-18.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-18.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-18.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-18.expand-right.is-last:after{display:none}.tree-line .level-18:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-18:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-18.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-18.is-last:after{display:none}.level-19{padding-left:40px}.level-19.expand-right{padding-left:30px}.tree-line .level-19{position:relative}.tree-line .level-19.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-19.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-19.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-19.expand-right.is-last:after{display:none}.tree-line .level-19:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-19:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-19.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-19.is-last:after{display:none}.level-20{padding-left:40px}.level-20.expand-right{padding-left:30px}.tree-line .level-20{position:relative}.tree-line .level-20.expand-right:before{content:\"\";position:absolute;top:0;bottom:0;left:6px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-20.expand-right:after{content:\"\";position:absolute;top:20px;left:6px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-20.expand-right.is-last:before{content:\"\";position:absolute;top:0;left:6px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-20.expand-right.is-last:after{display:none}.tree-line .level-20:before{content:\"\";position:absolute;top:0;bottom:0;left:28px;width:2px;transform:translate(100%);background-color:#e4e7ec}.tree-line .level-20:after{content:\"\";position:absolute;top:20px;left:28px;width:10px;transform:translate(40%);height:2px;background-color:#e4e7ec}.tree-line .level-20.is-last:before{content:\"\";position:absolute;top:0;left:28px;width:10px;height:22px;background:transparent;transform:translate(20%);border-left:2px solid rgb(228,231,236);border-bottom:2px solid rgb(228,231,236);border-bottom-left-radius:4px;box-sizing:border-box}.tree-line .level-20.is-last:after{display:none}.tree-line:has(>.tree-line.has-parent):after{display:none}.tree-line.is-last:has(>.tree-line.has-parent):before{display:none}.tree-line.no-line:before,.tree-line.no-line:after{display:none!important}\n"] }]
|
|
1310
|
+
}], propDecorators: { type: [{
|
|
1311
|
+
type: Input
|
|
1312
|
+
}], expandPosition: [{
|
|
1313
|
+
type: Input
|
|
1314
|
+
}], notCompressMin: [{
|
|
1315
|
+
type: Input
|
|
1316
|
+
}], isCompactActions: [{
|
|
1317
|
+
type: Input
|
|
1318
|
+
}], autoHideActions: [{
|
|
1319
|
+
type: Input
|
|
1320
|
+
}], className: [{
|
|
1321
|
+
type: Input
|
|
1322
|
+
}], list: [{
|
|
1323
|
+
type: Input
|
|
1324
|
+
}], input: [{
|
|
1325
|
+
type: Input
|
|
1326
|
+
}], valueChange: [{
|
|
1327
|
+
type: Output
|
|
1328
|
+
}], itemActiveId: [{
|
|
1329
|
+
type: Input
|
|
1330
|
+
}], useLine: [{
|
|
1331
|
+
type: Input
|
|
1332
|
+
}] } });
|
|
1333
|
+
|
|
1334
|
+
class NpPaginationComponent {
|
|
1335
|
+
type = 'basic';
|
|
1336
|
+
totalItems = 0;
|
|
1337
|
+
pageSize = [];
|
|
1338
|
+
isReverse = false;
|
|
1339
|
+
pageSizeChange = new EventEmitter();
|
|
1340
|
+
pageTotal = 1;
|
|
1341
|
+
_pageSizeValue = 10;
|
|
1342
|
+
_pageIndex = 1;
|
|
1343
|
+
isDropdownOpenMap = {
|
|
1344
|
+
basic: false,
|
|
1345
|
+
outlined: false,
|
|
1346
|
+
text: false,
|
|
1347
|
+
simple: false,
|
|
1348
|
+
full: false,
|
|
1349
|
+
};
|
|
1350
|
+
get pageIndex() {
|
|
1351
|
+
return this._pageIndex;
|
|
1352
|
+
}
|
|
1353
|
+
set pageIndex(value) {
|
|
1354
|
+
if (value !== this._pageIndex) {
|
|
1355
|
+
this._pageIndex = value;
|
|
1356
|
+
this.pageIndexChange.emit(this._pageIndex);
|
|
1357
|
+
}
|
|
1358
|
+
}
|
|
1359
|
+
get pageSizeOptions() {
|
|
1360
|
+
return this._pageSizeValue;
|
|
1361
|
+
}
|
|
1362
|
+
set pageSizeOptions(value) {
|
|
1363
|
+
if (value !== this._pageSizeValue) {
|
|
1364
|
+
this._pageSizeValue = value;
|
|
1365
|
+
this.pageSizeChange.emit(value);
|
|
1366
|
+
this.pageIndex = 1;
|
|
1367
|
+
this.calculatePageTotal();
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
pageIndexChange = new EventEmitter();
|
|
1371
|
+
triggerRef;
|
|
1372
|
+
ngOnInit() {
|
|
1373
|
+
if (this.pageSize?.length > 0) {
|
|
1374
|
+
this.pageSizeOptions = this.pageSize[0];
|
|
1375
|
+
}
|
|
1376
|
+
this.calculatePageTotal();
|
|
1377
|
+
}
|
|
1378
|
+
ngOnChanges(changes) {
|
|
1379
|
+
if (changes['pageSize']) {
|
|
1380
|
+
this.pageSizeOptions = this.pageSize?.length > 0 ? this.pageSize[0] : 10;
|
|
1381
|
+
}
|
|
1382
|
+
this.calculatePageTotal();
|
|
1383
|
+
}
|
|
1384
|
+
calculatePageTotal() {
|
|
1385
|
+
this.pageTotal = Math.ceil(this.totalItems / this.pageSizeOptions);
|
|
1386
|
+
if (this.pageIndex >= this.pageTotal) {
|
|
1387
|
+
this.pageIndex = this.pageTotal;
|
|
1388
|
+
}
|
|
1389
|
+
if (this.pageIndex < 1) {
|
|
1390
|
+
this.pageIndex = 1;
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
onPageSizeChange(newSize) {
|
|
1394
|
+
const size = Number(newSize);
|
|
1395
|
+
if (!isNaN(size)) {
|
|
1396
|
+
this.pageSizeOptions = size;
|
|
1397
|
+
this.pageIndex = 1;
|
|
1398
|
+
this.pageSizeChange.emit(size);
|
|
1399
|
+
this.calculatePageTotal();
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
dropdownStyleMap = {};
|
|
1403
|
+
toggleDropdownByType(type) {
|
|
1404
|
+
Object.keys(this.isDropdownOpenMap).forEach((key) => {
|
|
1405
|
+
this.isDropdownOpenMap[key] = false;
|
|
1406
|
+
});
|
|
1407
|
+
this.isDropdownOpenMap[type] = true;
|
|
1408
|
+
if (this.triggerRef?.nativeElement) {
|
|
1409
|
+
const rect = this.triggerRef.nativeElement.getBoundingClientRect();
|
|
1410
|
+
this.dropdownStyleMap[type] = {
|
|
1411
|
+
top: `${rect.bottom}px`,
|
|
1412
|
+
left: `${rect.left}px`,
|
|
1413
|
+
width: `${rect.width}px`,
|
|
1414
|
+
};
|
|
1415
|
+
}
|
|
1416
|
+
}
|
|
1417
|
+
onSelectPageSize(size) {
|
|
1418
|
+
this.isDropdownOpenMap[this.type] = false;
|
|
1419
|
+
this.onPageSizeChange(size.toString());
|
|
1420
|
+
}
|
|
1421
|
+
getDisplayedPages() {
|
|
1422
|
+
const pages = [];
|
|
1423
|
+
const total = this.pageTotal;
|
|
1424
|
+
const current = this.pageIndex;
|
|
1425
|
+
if (total <= 7) {
|
|
1426
|
+
return Array.from({ length: total }, (_, i) => i + 1);
|
|
1427
|
+
}
|
|
1428
|
+
pages.push(1, 2, 3);
|
|
1429
|
+
if (current > 3) {
|
|
1430
|
+
pages.push('...');
|
|
1431
|
+
}
|
|
1432
|
+
let start = Math.max(4, current - 1);
|
|
1433
|
+
let end = Math.min(total - 3, current + 1);
|
|
1434
|
+
for (let i = start; i <= end; i++) {
|
|
1435
|
+
pages.push(i);
|
|
1436
|
+
}
|
|
1437
|
+
if (current < total - 3) {
|
|
1438
|
+
pages.push('...');
|
|
1439
|
+
}
|
|
1440
|
+
pages.push(total - 2, total - 1, total);
|
|
1441
|
+
return pages;
|
|
1442
|
+
}
|
|
1443
|
+
prevPage() {
|
|
1444
|
+
if (this.pageIndex > 1) {
|
|
1445
|
+
this.changePage(this.pageIndex - 1);
|
|
1446
|
+
}
|
|
1447
|
+
}
|
|
1448
|
+
nextPage() {
|
|
1449
|
+
if (this.pageIndex < this.pageTotal) {
|
|
1450
|
+
this.changePage(this.pageIndex + 1);
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
changePage(newPage) {
|
|
1454
|
+
if (typeof newPage === 'number' && newPage !== this.pageIndex) {
|
|
1455
|
+
this.pageIndex = newPage;
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
onDocumentClick(event) {
|
|
1459
|
+
const clickedInside = this.triggerRef?.nativeElement?.contains(event.target);
|
|
1460
|
+
if (!clickedInside && this.type) {
|
|
1461
|
+
this.isDropdownOpenMap[this.type] = false;
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
onWindowScroll() {
|
|
1465
|
+
if (this.type) {
|
|
1466
|
+
this.isDropdownOpenMap[this.type] = false;
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpPaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1470
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: NpPaginationComponent, isStandalone: true, selector: "np-pagination", inputs: { type: "type", totalItems: "totalItems", pageSize: "pageSize", isReverse: "isReverse", pageIndex: "pageIndex", pageSizeOptions: "pageSizeOptions" }, outputs: { pageSizeChange: "pageSizeChange", pageIndexChange: "pageIndexChange" }, host: { listeners: { "document:click": "onDocumentClick($event)", "window:scroll": "onWindowScroll()" } }, viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["dropdownTrigger"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-container [ngSwitch]=\"type\">\n <div *ngSwitchCase=\"'basic'\">\n <div\n class=\"flex items-center justify-between gap-3\"\n [ngClass]=\"isReverse ? 'flex-row-reverse' : 'flex-row'\"\n >\n <div class=\"flex items-center justify-between space-x-2 gap-3\">\n <button\n (click)=\"prevPage()\"\n [disabled]=\"pageIndex === 1\"\n class=\"px-3 py-2 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed w-[38px] flex items-center justify-center\"\n >\n <i class=\"fa-solid fa-arrow-left\" style=\"color: #475467;\"></i>\n <!-- <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: #475467;\">\n <i class=\"fa-solid fa-arrow-left me-1\" style=\"color: #475467;\"></i>\n </np-typography> -->\n </button>\n\n <div class=\"flex gap-[1px] mx-0\">\n <ng-container *ngFor=\"let page of getDisplayedPages()\">\n <button\n *ngIf=\"page !== '...'; else dots\"\n (click)=\"changePage(page)\"\n [class.bg-gray-200]=\"page === pageIndex\"\n class=\"px-3 py-2 text-gray-700 rounded-md hover:bg-gray-200 w-[40px] cursor-pointer\"\n >\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: rgba(24, 34, 48, 1);\">{{ page }}</np-typography>\n </button>\n\n <ng-template #dots>\n <span class=\"px-2\">...</span>\n </ng-template>\n </ng-container>\n </div>\n\n <button\n (click)=\"nextPage()\"\n [disabled]=\"pageIndex === pageTotal\"\n class=\"px-3 py-2 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed w-[38px] flex items-center justify-center\"\n >\n <i class=\"fa-solid fa-arrow-right\" style=\"color: #475467;\"></i>\n <!-- <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: #475467;\">\n <i class=\"fa-solid fa-arrow-right ms-1\" style=\"color: #475467;\"></i>\n </np-typography> -->\n </button>\n </div>\n\n <div *ngIf=\"pageSize?.length\" class=\"relative inline-block\">\n <div\n #dropdownTrigger\n class=\"px-[12px] py-[8px] cursor-pointer flex gap-3 items-center justify-between\"\n (click)=\"toggleDropdownByType(type)\"\n >\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: rgba(52, 64, 84, 1);\">\n {{ pageSizeOptions }} / page\n </np-typography>\n <i class=\"fa-solid fa-chevron-down\"></i>\n </div>\n\n <div\n *ngIf=\"isDropdownOpenMap[type]\"\n class=\"fixed z-1000 mt-1 w-full bg-white border border-gray-300 rounded-sm shadow-md\"\n [ngStyle]=\"dropdownStyleMap[type]\"\n >\n <div\n *ngFor=\"let size of pageSize\"\n (click)=\"size !== pageSizeOptions && onSelectPageSize(size)\"\n class=\"px-[12px] py-[8px] hover:bg-gray-100\"\n [ngClass]=\"{\n 'cursor-not-allowed': size === pageSizeOptions,\n 'cursor-pointer': size !== pageSizeOptions\n }\"\n >\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"medium\" [ngClass]=\"{ 'text-gray-300': size === pageSizeOptions }\">\n {{ size }} / page\n </np-typography>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div *ngSwitchCase=\"'outlined'\">\n <div\n class=\"flex items-center gap-3\"\n [ngClass]=\"isReverse ? 'flex-row-reverse' : 'flex-row'\"\n >\n <div class=\"flex items-center justify-between flex-1 space-x-2\">\n <button\n (click)=\"prevPage()\"\n [disabled]=\"pageIndex === 1\"\n class=\"cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed border border-[#D0D5DD] rounded-[4px] w-[38px] h-[36px] flex items-center justify-center focus:ring-4 focus:ring-[rgba(152,162,179,0.14)]\"\n >\n <!-- <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: #475467;\">\n <i class=\"fa-solid fa-arrow-left me-1\" style=\"color: #475467;\"></i> Previous\n </np-typography> -->\n <i class=\"fa-solid fa-arrow-left\" style=\"color: #475467;\"></i>\n </button>\n\n <div class=\"flex gap-[1px] mx-3\">\n <ng-container *ngFor=\"let page of getDisplayedPages()\">\n <button\n *ngIf=\"page !== '...'; else dots\"\n (click)=\"changePage(page)\"\n [class.bg-gray-200]=\"page === pageIndex\"\n class=\"px-[12px] py-[8px] text-gray-700 rounded-md hover:bg-gray-200 w-[40px] cursor-pointer\"\n >\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: rgba(24, 34, 48, 1);\">{{ page }}</np-typography>\n </button>\n\n <ng-template #dots>\n <span class=\"px-2\">...</span>\n </ng-template>\n </ng-container>\n </div>\n\n <button\n (click)=\"nextPage()\"\n [disabled]=\"pageIndex === pageTotal\"\n class=\"h-[36px] flex items-center justify-centercursor-pointer flex items-center justify-center disabled:opacity-50 disabled:cursor-not-allowed border border-[#D0D5DD] rounded-[4px] w-[38px] focus:ring-4 focus:ring-[rgba(152,162,179,0.14)]\"\n >\n <!-- <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: #475467;\">\n Next <i class=\"fa-solid fa-arrow-right ms-1\" style=\"color: #475467;\"></i>\n </np-typography> -->\n <i class=\"fa-solid fa-arrow-right\" style=\"color: #475467;\"></i>\n </button>\n </div>\n\n <div *ngIf=\"pageSize?.length\" class=\"relative inline-block\">\n <div\n #dropdownTrigger\n class=\"px-[12px] py-[8px] border border-gray-300 rounded-sm bg-white cursor-pointer flex gap-3 items-center justify-between\"\n (click)=\"toggleDropdownByType(type)\"\n >\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: rgba(52, 64, 84, 1);\">\n {{ pageSizeOptions }} / page\n </np-typography>\n <i class=\"fa-solid fa-chevron-down\"></i>\n </div>\n\n <div\n [ngStyle]=\"dropdownStyleMap[type]\"\n *ngIf=\"isDropdownOpenMap[type]\"\n class=\"fixed z-100 mt-1 w-full bg-white border border-gray-300 rounded-sm shadow-md overflow-auto\"\n >\n <div\n *ngFor=\"let size of pageSize\"\n (click)=\"size !== pageSizeOptions && onSelectPageSize(size)\"\n class=\"px-[12px] py-[8px] hover:bg-gray-100\"\n [ngClass]=\"{\n 'cursor-not-allowed': size === pageSizeOptions,\n 'cursor-pointer': size !== pageSizeOptions\n }\"\n >\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"medium\" [ngClass]=\"{ 'text-gray-300': size === pageSizeOptions }\">\n {{ size }} / page\n </np-typography>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div *ngSwitchCase=\"'text'\">\n <div\n class=\"flex items-center gap-3\"\n [ngClass]=\"isReverse ? 'flex-row-reverse' : 'flex-row'\"\n >\n <div class=\"flex justify-between items-center flex-1\">\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"medium\" style=\"color: rgba(52, 64, 84, 1);\">\n Page {{pageIndex}} of {{pageTotal}}\n </np-typography>\n\n <div class=\"flex gap-3\">\n <button\n (click)=\"prevPage()\"\n [disabled]=\"pageIndex === 1\"\n class=\"cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed border border-[#D0D5DD] rounded-[4px] w-[38px] h-[36px] flex items-center justify-center focus:ring-4 focus:ring-[rgba(152,162,179,0.14)]\"\n >\n <i class=\"fa-solid fa-arrow-left\" style=\"color: #475467;\"></i>\n <!-- <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: #475467;\">Previous</np-typography> -->\n </button>\n\n <button\n (click)=\"nextPage()\"\n [disabled]=\"pageIndex === pageTotal\"\n class=\"=cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed border border-[#D0D5DD] rounded-[4px] w-[38px] h-[36px] flex items-center justify-center focus:ring-4 focus:ring-[rgba(152,162,179,0.14)]\"\n >\n <i class=\"fa-solid fa-arrow-right\" style=\"color: #475467;\"></i>\n <!-- <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: #475467;\">Next</np-typography> -->\n </button>\n </div>\n </div>\n\n <div *ngIf=\"pageSize?.length\" class=\"relative inline-block\">\n <div\n #dropdownTrigger\n class=\"px-[12px] py-[8px] bg-transparent cursor-pointer flex gap-3 items-center justify-between\"\n (click)=\"toggleDropdownByType(type)\"\n >\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: rgba(52, 64, 84, 1);\">\n {{ pageSizeOptions }} / page\n </np-typography>\n <i class=\"fa-solid fa-chevron-down\"></i>\n </div>\n\n <div\n *ngIf=\"isDropdownOpenMap[type]\"\n [ngStyle]=\"dropdownStyleMap[type]\"\n class=\"fixed z-100 mt-1 w-full bg-white border border-gray-300 rounded-sm shadow-md overflow-auto\"\n >\n <div\n *ngFor=\"let size of pageSize\"\n (click)=\"size !== pageSizeOptions && onSelectPageSize(size)\"\n class=\"px-[12px] py-[8px] hover:bg-gray-100\"\n [ngClass]=\"{\n 'cursor-not-allowed': size === pageSizeOptions,\n 'cursor-pointer': size !== pageSizeOptions\n }\"\n >\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"medium\" [ngClass]=\"{ 'text-gray-300': size === pageSizeOptions }\">\n {{ size }} / page\n </np-typography>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div *ngSwitchCase=\"'simple'\">\n <div\n class=\"flex items-center gap-3\"\n [ngClass]=\"isReverse ? 'flex-row-reverse' : 'flex-row'\"\n >\n <div class=\"flex justify-between items-center flex-1\">\n <button\n (click)=\"prevPage()\"\n [disabled]=\"pageIndex === 1\"\n class=\"px-3 py-2 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed border border-[#D0D5DD] rounded-[4px] w-[38px] h-[36px] flex items-center justify-center focus:ring-4 focus:ring-[rgba(152,162,179,0.14)]\"\n >\n <i class=\"fa-solid fa-arrow-left\" style=\"color: #475467;\"></i>\n <!-- <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: #475467;\">Previous</np-typography> -->\n </button>\n\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"medium\" style=\"color: rgba(52, 64, 84, 1);\">\n Page {{pageIndex}} of {{pageTotal}}\n </np-typography>\n\n <button\n (click)=\"nextPage()\"\n [disabled]=\"pageIndex === pageTotal\"\n class=\"px-3 py-2 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed border border-[#D0D5DD] rounded-[4px] w-[38px] h-[36px] flex items-center justify-center focus:ring-4 focus:ring-[rgba(152,162,179,0.14)]\"\n >\n <i class=\"fa-solid fa-arrow-right\" style=\"color: #475467;\"></i>\n <!-- <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: #475467;\">Next</np-typography> -->\n </button>\n </div>\n\n <div *ngIf=\"pageSize?.length\" class=\"relative inline-block\">\n <div\n #dropdownTrigger\n class=\"px-[12px] py-[8px] bg-transparent cursor-pointer flex gap-3 items-center justify-between\"\n (click)=\"toggleDropdownByType(type)\"\n >\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: rgba(52, 64, 84, 1);\">\n {{ pageSizeOptions }} / page\n </np-typography>\n <i class=\"fa-solid fa-chevron-down\"></i>\n </div>\n\n <div\n *ngIf=\"isDropdownOpenMap[type]\"\n [ngStyle]=\"dropdownStyleMap[type]\"\n class=\"fixed z-100 mt-1 w-full bg-white border border-gray-300 rounded-sm shadow-md overflow-auto\"\n >\n <div\n *ngFor=\"let size of pageSize\"\n (click)=\"size !== pageSizeOptions && onSelectPageSize(size)\"\n class=\"px-[12px] py-[8px] hover:bg-gray-100\"\n [ngClass]=\"{\n 'cursor-not-allowed': size === pageSizeOptions,\n 'cursor-pointer': size !== pageSizeOptions\n }\"\n >\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"medium\" [ngClass]=\"{ 'text-gray-300': size === pageSizeOptions }\">\n {{ size }} / page\n </np-typography>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div *ngSwitchCase=\"'full'\">\n <div\n class=\"flex items-center gap-3\"\n [ngClass]=\"isReverse ? 'flex-row-reverse' : 'flex-row'\"\n >\n <div class=\"flex items-center w-full flex-1\">\n <button\n (click)=\"prevPage()\"\n [disabled]=\"pageIndex === 1\"\n class=\"px-3 py-2 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed w-[52px] h-[40px] border-y-1 border-s-1 border-[#D0D5DD] rounded-l-[4px]\"\n >\n <i class=\"fa-solid fa-arrow-left\" style=\"color: #475467;\"></i>\n <!-- <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: #475467;\" class=\"flex items-center\">\n <i class=\"fa-solid fa-arrow-left me-1\" style=\"color: #475467;\"></i> Previous\n </np-typography> -->\n </button>\n\n <div class=\"flex\">\n <ng-container *ngFor=\"let page of getDisplayedPages(); let last = last\">\n <button\n *ngIf=\"page !== '...'; else dots\"\n (click)=\"changePage(page)\"\n [class.bg-gray-200]=\"page === pageIndex\"\n [ngClass]=\"{\n 'border-y-1 border-s-1': !last,\n 'border-1': last\n }\"\n class=\"px-3 py-2 hover:bg-gray-200 w-[40px] h-[40px] border-[#D0D5DD] cursor-pointer\"\n >\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: rgba(24, 34, 48, 1);\">\n {{ page }}\n </np-typography>\n </button>\n\n <ng-template #dots>\n <span class=\"px-3 py-2 w-[40px] h-[40px] border-y-1 border-s-1 border-[#D0D5DD] cursor-text\">\n ...\n </span>\n </ng-template>\n </ng-container>\n </div>\n\n <button\n (click)=\"nextPage()\"\n [disabled]=\"pageIndex === pageTotal\"\n class=\"px-3 py-2 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed w-[52px] h-[40px] border-y-1 border-e-1 border-[#D0D5DD] rounded-r-[4px]\"\n >\n <i class=\"fa-solid fa-arrow-right\" style=\"color: #475467;\"></i>\n <!-- <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: #475467;\">\n Next <i class=\"fa-solid fa-arrow-right ms-1\" style=\"color: #475467;\"></i>\n </np-typography> -->\n </button>\n </div>\n\n <div *ngIf=\"pageSize?.length\" class=\"relative inline-block\">\n <div\n #dropdownTrigger\n class=\"px-[12px] py-[8px] border border-gray-300 rounded-sm bg-white cursor-pointer flex gap-3 items-center justify-between\"\n (click)=\"toggleDropdownByType(type)\"\n >\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: rgba(52, 64, 84, 1);\">\n {{ pageSizeOptions }} / page\n </np-typography>\n <i class=\"fa-solid fa-chevron-down\"></i>\n </div>\n\n <div\n *ngIf=\"isDropdownOpenMap[type]\"\n [ngStyle]=\"dropdownStyleMap[type]\"\n class=\"fixed z-100 mt-1 w-full bg-white border border-gray-300 rounded-sm shadow-md overflow-auto\"\n >\n <div\n *ngFor=\"let size of pageSize\"\n (click)=\"size !== pageSizeOptions && onSelectPageSize(size)\"\n class=\"px-[12px] py-[8px] hover:bg-gray-100\"\n [ngClass]=\"{\n 'cursor-not-allowed': size === pageSizeOptions,\n 'cursor-pointer': size !== pageSizeOptions\n }\"\n >\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"medium\" [ngClass]=\"{ 'text-gray-300': size === pageSizeOptions }\">\n {{ size }} / page\n </np-typography>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n</ng-container>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: NpTypographyComponent, selector: "np-typography", inputs: ["npType", "npSize", "npWeight", "ngContent"] }, { kind: "ngmodule", type: FormsModule }] });
|
|
1471
|
+
}
|
|
1472
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpPaginationComponent, decorators: [{
|
|
1473
|
+
type: Component,
|
|
1474
|
+
args: [{ selector: 'np-pagination', imports: [CommonModule, NpTypographyComponent, FormsModule], template: "<ng-container [ngSwitch]=\"type\">\n <div *ngSwitchCase=\"'basic'\">\n <div\n class=\"flex items-center justify-between gap-3\"\n [ngClass]=\"isReverse ? 'flex-row-reverse' : 'flex-row'\"\n >\n <div class=\"flex items-center justify-between space-x-2 gap-3\">\n <button\n (click)=\"prevPage()\"\n [disabled]=\"pageIndex === 1\"\n class=\"px-3 py-2 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed w-[38px] flex items-center justify-center\"\n >\n <i class=\"fa-solid fa-arrow-left\" style=\"color: #475467;\"></i>\n <!-- <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: #475467;\">\n <i class=\"fa-solid fa-arrow-left me-1\" style=\"color: #475467;\"></i>\n </np-typography> -->\n </button>\n\n <div class=\"flex gap-[1px] mx-0\">\n <ng-container *ngFor=\"let page of getDisplayedPages()\">\n <button\n *ngIf=\"page !== '...'; else dots\"\n (click)=\"changePage(page)\"\n [class.bg-gray-200]=\"page === pageIndex\"\n class=\"px-3 py-2 text-gray-700 rounded-md hover:bg-gray-200 w-[40px] cursor-pointer\"\n >\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: rgba(24, 34, 48, 1);\">{{ page }}</np-typography>\n </button>\n\n <ng-template #dots>\n <span class=\"px-2\">...</span>\n </ng-template>\n </ng-container>\n </div>\n\n <button\n (click)=\"nextPage()\"\n [disabled]=\"pageIndex === pageTotal\"\n class=\"px-3 py-2 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed w-[38px] flex items-center justify-center\"\n >\n <i class=\"fa-solid fa-arrow-right\" style=\"color: #475467;\"></i>\n <!-- <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: #475467;\">\n <i class=\"fa-solid fa-arrow-right ms-1\" style=\"color: #475467;\"></i>\n </np-typography> -->\n </button>\n </div>\n\n <div *ngIf=\"pageSize?.length\" class=\"relative inline-block\">\n <div\n #dropdownTrigger\n class=\"px-[12px] py-[8px] cursor-pointer flex gap-3 items-center justify-between\"\n (click)=\"toggleDropdownByType(type)\"\n >\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: rgba(52, 64, 84, 1);\">\n {{ pageSizeOptions }} / page\n </np-typography>\n <i class=\"fa-solid fa-chevron-down\"></i>\n </div>\n\n <div\n *ngIf=\"isDropdownOpenMap[type]\"\n class=\"fixed z-1000 mt-1 w-full bg-white border border-gray-300 rounded-sm shadow-md\"\n [ngStyle]=\"dropdownStyleMap[type]\"\n >\n <div\n *ngFor=\"let size of pageSize\"\n (click)=\"size !== pageSizeOptions && onSelectPageSize(size)\"\n class=\"px-[12px] py-[8px] hover:bg-gray-100\"\n [ngClass]=\"{\n 'cursor-not-allowed': size === pageSizeOptions,\n 'cursor-pointer': size !== pageSizeOptions\n }\"\n >\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"medium\" [ngClass]=\"{ 'text-gray-300': size === pageSizeOptions }\">\n {{ size }} / page\n </np-typography>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div *ngSwitchCase=\"'outlined'\">\n <div\n class=\"flex items-center gap-3\"\n [ngClass]=\"isReverse ? 'flex-row-reverse' : 'flex-row'\"\n >\n <div class=\"flex items-center justify-between flex-1 space-x-2\">\n <button\n (click)=\"prevPage()\"\n [disabled]=\"pageIndex === 1\"\n class=\"cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed border border-[#D0D5DD] rounded-[4px] w-[38px] h-[36px] flex items-center justify-center focus:ring-4 focus:ring-[rgba(152,162,179,0.14)]\"\n >\n <!-- <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: #475467;\">\n <i class=\"fa-solid fa-arrow-left me-1\" style=\"color: #475467;\"></i> Previous\n </np-typography> -->\n <i class=\"fa-solid fa-arrow-left\" style=\"color: #475467;\"></i>\n </button>\n\n <div class=\"flex gap-[1px] mx-3\">\n <ng-container *ngFor=\"let page of getDisplayedPages()\">\n <button\n *ngIf=\"page !== '...'; else dots\"\n (click)=\"changePage(page)\"\n [class.bg-gray-200]=\"page === pageIndex\"\n class=\"px-[12px] py-[8px] text-gray-700 rounded-md hover:bg-gray-200 w-[40px] cursor-pointer\"\n >\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: rgba(24, 34, 48, 1);\">{{ page }}</np-typography>\n </button>\n\n <ng-template #dots>\n <span class=\"px-2\">...</span>\n </ng-template>\n </ng-container>\n </div>\n\n <button\n (click)=\"nextPage()\"\n [disabled]=\"pageIndex === pageTotal\"\n class=\"h-[36px] flex items-center justify-centercursor-pointer flex items-center justify-center disabled:opacity-50 disabled:cursor-not-allowed border border-[#D0D5DD] rounded-[4px] w-[38px] focus:ring-4 focus:ring-[rgba(152,162,179,0.14)]\"\n >\n <!-- <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: #475467;\">\n Next <i class=\"fa-solid fa-arrow-right ms-1\" style=\"color: #475467;\"></i>\n </np-typography> -->\n <i class=\"fa-solid fa-arrow-right\" style=\"color: #475467;\"></i>\n </button>\n </div>\n\n <div *ngIf=\"pageSize?.length\" class=\"relative inline-block\">\n <div\n #dropdownTrigger\n class=\"px-[12px] py-[8px] border border-gray-300 rounded-sm bg-white cursor-pointer flex gap-3 items-center justify-between\"\n (click)=\"toggleDropdownByType(type)\"\n >\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: rgba(52, 64, 84, 1);\">\n {{ pageSizeOptions }} / page\n </np-typography>\n <i class=\"fa-solid fa-chevron-down\"></i>\n </div>\n\n <div\n [ngStyle]=\"dropdownStyleMap[type]\"\n *ngIf=\"isDropdownOpenMap[type]\"\n class=\"fixed z-100 mt-1 w-full bg-white border border-gray-300 rounded-sm shadow-md overflow-auto\"\n >\n <div\n *ngFor=\"let size of pageSize\"\n (click)=\"size !== pageSizeOptions && onSelectPageSize(size)\"\n class=\"px-[12px] py-[8px] hover:bg-gray-100\"\n [ngClass]=\"{\n 'cursor-not-allowed': size === pageSizeOptions,\n 'cursor-pointer': size !== pageSizeOptions\n }\"\n >\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"medium\" [ngClass]=\"{ 'text-gray-300': size === pageSizeOptions }\">\n {{ size }} / page\n </np-typography>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div *ngSwitchCase=\"'text'\">\n <div\n class=\"flex items-center gap-3\"\n [ngClass]=\"isReverse ? 'flex-row-reverse' : 'flex-row'\"\n >\n <div class=\"flex justify-between items-center flex-1\">\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"medium\" style=\"color: rgba(52, 64, 84, 1);\">\n Page {{pageIndex}} of {{pageTotal}}\n </np-typography>\n\n <div class=\"flex gap-3\">\n <button\n (click)=\"prevPage()\"\n [disabled]=\"pageIndex === 1\"\n class=\"cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed border border-[#D0D5DD] rounded-[4px] w-[38px] h-[36px] flex items-center justify-center focus:ring-4 focus:ring-[rgba(152,162,179,0.14)]\"\n >\n <i class=\"fa-solid fa-arrow-left\" style=\"color: #475467;\"></i>\n <!-- <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: #475467;\">Previous</np-typography> -->\n </button>\n\n <button\n (click)=\"nextPage()\"\n [disabled]=\"pageIndex === pageTotal\"\n class=\"=cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed border border-[#D0D5DD] rounded-[4px] w-[38px] h-[36px] flex items-center justify-center focus:ring-4 focus:ring-[rgba(152,162,179,0.14)]\"\n >\n <i class=\"fa-solid fa-arrow-right\" style=\"color: #475467;\"></i>\n <!-- <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: #475467;\">Next</np-typography> -->\n </button>\n </div>\n </div>\n\n <div *ngIf=\"pageSize?.length\" class=\"relative inline-block\">\n <div\n #dropdownTrigger\n class=\"px-[12px] py-[8px] bg-transparent cursor-pointer flex gap-3 items-center justify-between\"\n (click)=\"toggleDropdownByType(type)\"\n >\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: rgba(52, 64, 84, 1);\">\n {{ pageSizeOptions }} / page\n </np-typography>\n <i class=\"fa-solid fa-chevron-down\"></i>\n </div>\n\n <div\n *ngIf=\"isDropdownOpenMap[type]\"\n [ngStyle]=\"dropdownStyleMap[type]\"\n class=\"fixed z-100 mt-1 w-full bg-white border border-gray-300 rounded-sm shadow-md overflow-auto\"\n >\n <div\n *ngFor=\"let size of pageSize\"\n (click)=\"size !== pageSizeOptions && onSelectPageSize(size)\"\n class=\"px-[12px] py-[8px] hover:bg-gray-100\"\n [ngClass]=\"{\n 'cursor-not-allowed': size === pageSizeOptions,\n 'cursor-pointer': size !== pageSizeOptions\n }\"\n >\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"medium\" [ngClass]=\"{ 'text-gray-300': size === pageSizeOptions }\">\n {{ size }} / page\n </np-typography>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div *ngSwitchCase=\"'simple'\">\n <div\n class=\"flex items-center gap-3\"\n [ngClass]=\"isReverse ? 'flex-row-reverse' : 'flex-row'\"\n >\n <div class=\"flex justify-between items-center flex-1\">\n <button\n (click)=\"prevPage()\"\n [disabled]=\"pageIndex === 1\"\n class=\"px-3 py-2 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed border border-[#D0D5DD] rounded-[4px] w-[38px] h-[36px] flex items-center justify-center focus:ring-4 focus:ring-[rgba(152,162,179,0.14)]\"\n >\n <i class=\"fa-solid fa-arrow-left\" style=\"color: #475467;\"></i>\n <!-- <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: #475467;\">Previous</np-typography> -->\n </button>\n\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"medium\" style=\"color: rgba(52, 64, 84, 1);\">\n Page {{pageIndex}} of {{pageTotal}}\n </np-typography>\n\n <button\n (click)=\"nextPage()\"\n [disabled]=\"pageIndex === pageTotal\"\n class=\"px-3 py-2 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed border border-[#D0D5DD] rounded-[4px] w-[38px] h-[36px] flex items-center justify-center focus:ring-4 focus:ring-[rgba(152,162,179,0.14)]\"\n >\n <i class=\"fa-solid fa-arrow-right\" style=\"color: #475467;\"></i>\n <!-- <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: #475467;\">Next</np-typography> -->\n </button>\n </div>\n\n <div *ngIf=\"pageSize?.length\" class=\"relative inline-block\">\n <div\n #dropdownTrigger\n class=\"px-[12px] py-[8px] bg-transparent cursor-pointer flex gap-3 items-center justify-between\"\n (click)=\"toggleDropdownByType(type)\"\n >\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: rgba(52, 64, 84, 1);\">\n {{ pageSizeOptions }} / page\n </np-typography>\n <i class=\"fa-solid fa-chevron-down\"></i>\n </div>\n\n <div\n *ngIf=\"isDropdownOpenMap[type]\"\n [ngStyle]=\"dropdownStyleMap[type]\"\n class=\"fixed z-100 mt-1 w-full bg-white border border-gray-300 rounded-sm shadow-md overflow-auto\"\n >\n <div\n *ngFor=\"let size of pageSize\"\n (click)=\"size !== pageSizeOptions && onSelectPageSize(size)\"\n class=\"px-[12px] py-[8px] hover:bg-gray-100\"\n [ngClass]=\"{\n 'cursor-not-allowed': size === pageSizeOptions,\n 'cursor-pointer': size !== pageSizeOptions\n }\"\n >\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"medium\" [ngClass]=\"{ 'text-gray-300': size === pageSizeOptions }\">\n {{ size }} / page\n </np-typography>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div *ngSwitchCase=\"'full'\">\n <div\n class=\"flex items-center gap-3\"\n [ngClass]=\"isReverse ? 'flex-row-reverse' : 'flex-row'\"\n >\n <div class=\"flex items-center w-full flex-1\">\n <button\n (click)=\"prevPage()\"\n [disabled]=\"pageIndex === 1\"\n class=\"px-3 py-2 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed w-[52px] h-[40px] border-y-1 border-s-1 border-[#D0D5DD] rounded-l-[4px]\"\n >\n <i class=\"fa-solid fa-arrow-left\" style=\"color: #475467;\"></i>\n <!-- <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: #475467;\" class=\"flex items-center\">\n <i class=\"fa-solid fa-arrow-left me-1\" style=\"color: #475467;\"></i> Previous\n </np-typography> -->\n </button>\n\n <div class=\"flex\">\n <ng-container *ngFor=\"let page of getDisplayedPages(); let last = last\">\n <button\n *ngIf=\"page !== '...'; else dots\"\n (click)=\"changePage(page)\"\n [class.bg-gray-200]=\"page === pageIndex\"\n [ngClass]=\"{\n 'border-y-1 border-s-1': !last,\n 'border-1': last\n }\"\n class=\"px-3 py-2 hover:bg-gray-200 w-[40px] h-[40px] border-[#D0D5DD] cursor-pointer\"\n >\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: rgba(24, 34, 48, 1);\">\n {{ page }}\n </np-typography>\n </button>\n\n <ng-template #dots>\n <span class=\"px-3 py-2 w-[40px] h-[40px] border-y-1 border-s-1 border-[#D0D5DD] cursor-text\">\n ...\n </span>\n </ng-template>\n </ng-container>\n </div>\n\n <button\n (click)=\"nextPage()\"\n [disabled]=\"pageIndex === pageTotal\"\n class=\"px-3 py-2 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed w-[52px] h-[40px] border-y-1 border-e-1 border-[#D0D5DD] rounded-r-[4px]\"\n >\n <i class=\"fa-solid fa-arrow-right\" style=\"color: #475467;\"></i>\n <!-- <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: #475467;\">\n Next <i class=\"fa-solid fa-arrow-right ms-1\" style=\"color: #475467;\"></i>\n </np-typography> -->\n </button>\n </div>\n\n <div *ngIf=\"pageSize?.length\" class=\"relative inline-block\">\n <div\n #dropdownTrigger\n class=\"px-[12px] py-[8px] border border-gray-300 rounded-sm bg-white cursor-pointer flex gap-3 items-center justify-between\"\n (click)=\"toggleDropdownByType(type)\"\n >\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\" style=\"color: rgba(52, 64, 84, 1);\">\n {{ pageSizeOptions }} / page\n </np-typography>\n <i class=\"fa-solid fa-chevron-down\"></i>\n </div>\n\n <div\n *ngIf=\"isDropdownOpenMap[type]\"\n [ngStyle]=\"dropdownStyleMap[type]\"\n class=\"fixed z-100 mt-1 w-full bg-white border border-gray-300 rounded-sm shadow-md overflow-auto\"\n >\n <div\n *ngFor=\"let size of pageSize\"\n (click)=\"size !== pageSizeOptions && onSelectPageSize(size)\"\n class=\"px-[12px] py-[8px] hover:bg-gray-100\"\n [ngClass]=\"{\n 'cursor-not-allowed': size === pageSizeOptions,\n 'cursor-pointer': size !== pageSizeOptions\n }\"\n >\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"medium\" [ngClass]=\"{ 'text-gray-300': size === pageSizeOptions }\">\n {{ size }} / page\n </np-typography>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n</ng-container>\n" }]
|
|
1475
|
+
}], propDecorators: { type: [{
|
|
1476
|
+
type: Input
|
|
1477
|
+
}], totalItems: [{
|
|
1478
|
+
type: Input
|
|
1479
|
+
}], pageSize: [{
|
|
1480
|
+
type: Input
|
|
1481
|
+
}], isReverse: [{
|
|
1482
|
+
type: Input
|
|
1483
|
+
}], pageSizeChange: [{
|
|
1484
|
+
type: Output
|
|
1485
|
+
}], pageIndex: [{
|
|
1486
|
+
type: Input
|
|
1487
|
+
}], pageSizeOptions: [{
|
|
1488
|
+
type: Input
|
|
1489
|
+
}], pageIndexChange: [{
|
|
1490
|
+
type: Output
|
|
1491
|
+
}], triggerRef: [{
|
|
1492
|
+
type: ViewChild,
|
|
1493
|
+
args: ['dropdownTrigger', { static: false }]
|
|
1494
|
+
}], onDocumentClick: [{
|
|
1495
|
+
type: HostListener,
|
|
1496
|
+
args: ['document:click', ['$event']]
|
|
1497
|
+
}], onWindowScroll: [{
|
|
1498
|
+
type: HostListener,
|
|
1499
|
+
args: ['window:scroll']
|
|
1500
|
+
}] } });
|
|
1501
|
+
|
|
1502
|
+
class NpScrollbarComponent {
|
|
1503
|
+
renderer;
|
|
1504
|
+
container;
|
|
1505
|
+
// @Input() size: string ='sm' ;
|
|
1506
|
+
width;
|
|
1507
|
+
height;
|
|
1508
|
+
_ngContent = null;
|
|
1509
|
+
set ngContent(value) {
|
|
1510
|
+
this._ngContent = value;
|
|
1511
|
+
this.updateContent();
|
|
1512
|
+
}
|
|
1513
|
+
constructor(renderer) {
|
|
1514
|
+
this.renderer = renderer;
|
|
1515
|
+
}
|
|
1516
|
+
updateContent() {
|
|
1517
|
+
if (!this._ngContent) {
|
|
1518
|
+
return;
|
|
1519
|
+
}
|
|
1520
|
+
if (this._ngContent instanceof Element) {
|
|
1521
|
+
this.renderer.appendChild(this.container.nativeElement, this._ngContent);
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpScrollbarComponent, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
1525
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: NpScrollbarComponent, isStandalone: true, selector: "np-scrollbar", inputs: { width: "width", height: "height", ngContent: "ngContent" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, static: true }], ngImport: i0, template: "<div\n #container\n class=\"custom-scrollbar overflow-auto\"\n [ngStyle]=\"{ 'max-width': width, 'max-height': height }\"\n>\n <ng-content></ng-content>\n</div>\n", styles: [".custom-scrollbar::-webkit-scrollbar{background-color:transparent;width:8px;height:8px}.custom-scrollbar::-webkit-scrollbar-thumb{background-color:#eaecf0;border-radius:8px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
1526
|
+
}
|
|
1527
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpScrollbarComponent, decorators: [{
|
|
1528
|
+
type: Component,
|
|
1529
|
+
args: [{ selector: 'np-scrollbar', imports: [CommonModule], template: "<div\n #container\n class=\"custom-scrollbar overflow-auto\"\n [ngStyle]=\"{ 'max-width': width, 'max-height': height }\"\n>\n <ng-content></ng-content>\n</div>\n", styles: [".custom-scrollbar::-webkit-scrollbar{background-color:transparent;width:8px;height:8px}.custom-scrollbar::-webkit-scrollbar-thumb{background-color:#eaecf0;border-radius:8px}\n"] }]
|
|
1530
|
+
}], ctorParameters: () => [{ type: i0.Renderer2 }], propDecorators: { container: [{
|
|
1531
|
+
type: ViewChild,
|
|
1532
|
+
args: ['container', { static: true }]
|
|
1533
|
+
}], width: [{
|
|
1534
|
+
type: Input
|
|
1535
|
+
}], height: [{
|
|
1536
|
+
type: Input
|
|
1537
|
+
}], ngContent: [{
|
|
1538
|
+
type: Input
|
|
1539
|
+
}] } });
|
|
1540
|
+
|
|
1541
|
+
class NpAlertComponent {
|
|
1542
|
+
el;
|
|
1543
|
+
renderer;
|
|
1544
|
+
type = 'notification';
|
|
1545
|
+
state = 'info';
|
|
1546
|
+
description = '';
|
|
1547
|
+
title;
|
|
1548
|
+
message;
|
|
1549
|
+
autoHide = true;
|
|
1550
|
+
isMessageVisible = false;
|
|
1551
|
+
opacity = 1;
|
|
1552
|
+
constructor(el, renderer) {
|
|
1553
|
+
this.el = el;
|
|
1554
|
+
this.renderer = renderer;
|
|
1555
|
+
}
|
|
1556
|
+
ngOnInit() {
|
|
1557
|
+
if (this.autoHide) {
|
|
1558
|
+
setTimeout(() => {
|
|
1559
|
+
this.startFadeOut();
|
|
1560
|
+
}, 3000);
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
startFadeOut() {
|
|
1564
|
+
let fadeDuration = 5000;
|
|
1565
|
+
let fadeInterval = 50;
|
|
1566
|
+
let step = fadeInterval / fadeDuration;
|
|
1567
|
+
let fadeEffect = setInterval(() => {
|
|
1568
|
+
if (this.opacity > 0) {
|
|
1569
|
+
this.opacity -= step;
|
|
1570
|
+
}
|
|
1571
|
+
else {
|
|
1572
|
+
clearInterval(fadeEffect);
|
|
1573
|
+
this.removeSelf();
|
|
1574
|
+
}
|
|
1575
|
+
}, fadeInterval);
|
|
1576
|
+
}
|
|
1577
|
+
closeAlert() {
|
|
1578
|
+
this.removeSelf();
|
|
1579
|
+
}
|
|
1580
|
+
removeSelf() {
|
|
1581
|
+
this.renderer.removeChild(this.el.nativeElement.parentNode, this.el.nativeElement);
|
|
1582
|
+
}
|
|
1583
|
+
showMessege() {
|
|
1584
|
+
this.isMessageVisible = !this.isMessageVisible;
|
|
1585
|
+
}
|
|
1586
|
+
getIcon() {
|
|
1587
|
+
switch (this.state) {
|
|
1588
|
+
case 'success':
|
|
1589
|
+
return 'fa-duotone fa-solid fa-circle-check';
|
|
1590
|
+
case 'info':
|
|
1591
|
+
return 'fa-duotone fa-solid fa-circle-info';
|
|
1592
|
+
case 'warning':
|
|
1593
|
+
return 'fa-duotone fa-solid fa-triangle-exclamation';
|
|
1594
|
+
case 'error':
|
|
1595
|
+
return 'fa-duotone fa-solid fa-circle-exclamation';
|
|
1596
|
+
default:
|
|
1597
|
+
return '';
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
// getIconNotification(): string {
|
|
1601
|
+
// switch (this.state) {
|
|
1602
|
+
// case 'success':
|
|
1603
|
+
// return 'projects/neop-ui-lib/scss/images/success.png';
|
|
1604
|
+
// case 'warning':
|
|
1605
|
+
// return 'projects/neop-ui-lib/scss/images/warning.png';
|
|
1606
|
+
// case 'error':
|
|
1607
|
+
// return 'projects/neop-ui-lib/scss/images/error.png';
|
|
1608
|
+
// default:
|
|
1609
|
+
// return '';
|
|
1610
|
+
// }
|
|
1611
|
+
// }
|
|
1612
|
+
getIconNotification() {
|
|
1613
|
+
switch (this.state) {
|
|
1614
|
+
case 'success':
|
|
1615
|
+
return { icon: 'fa-circle-check', color: '#12B76A' };
|
|
1616
|
+
case 'warning':
|
|
1617
|
+
return { icon: 'fa-circle-exclamation', color: '#F79009' };
|
|
1618
|
+
case 'error':
|
|
1619
|
+
return { icon: 'fa-circle-exclamation', color: '#F04438' };
|
|
1620
|
+
default:
|
|
1621
|
+
return { icon: '', color: '' };
|
|
1622
|
+
}
|
|
1623
|
+
}
|
|
1624
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpAlertComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
1625
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: NpAlertComponent, isStandalone: true, selector: "np-alert", inputs: { type: "type", state: "state", description: "description", title: "title", message: "message", autoHide: "autoHide" }, ngImport: i0, template: "<ng-container >\n <div class=\"np-alert flex gap-3 items-start\" [ngClass]=\"type\" [style.opacity]=\"opacity\">\n <div class=\"icon-wrapper rounded-[10px]\" [ngClass]=\"state\" *ngIf=\"type == 'toast'\">\n <i [ngClass]=\"getIcon()\" class=\"p-[8px]\"></i>\n </div>\n <div class=\"icon-wrapper rounded-[10px]\" *ngIf=\"getIconNotification().icon && type == 'notification'\">\n <i class=\"glow fa-regular\"\n [ngClass]=\"getIconNotification().icon\"\n [ngStyle]=\"{ 'color': getIconNotification().color }\">\n </i>\n </div>\n\n <div class=\"flex flex-col flex-1\">\n <div class=\"flex justify-between\" *ngIf=\"title\">\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\">{{ title }}</np-typography>\n <button (click)=\"closeAlert()\" class=\"close-btn cursor-pointer opacity-50\">\n <i class=\"fa fa-times\"></i>\n </button>\n </div>\n\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"regular\">{{ description }}</np-typography>\n <np-typography *ngIf=\"isMessageVisible\" npType=\"text\" npSize=\"sm\" npWeight=\"regular\">\n {{ message }}\n </np-typography>\n\n <div class=\"flex gap-3 mt-2\" *ngIf=\"type !== 'notification'\">\n <button (click)=\"closeAlert()\" class=\"dismiss cursor-pointer\">\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\">Dismiss</np-typography>\n </button>\n <button *ngIf=\"message\" class=\"learn-more cursor-pointer\" (click)=\"showMessege()\">\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\">Learn More</np-typography>\n </button>\n </div>\n </div>\n </div>\n</ng-container>\n", styles: [".np-alert{min-width:300px;max-width:390px;border-radius:6px;background-color:#fff;border:1px solid rgb(208,213,221);padding:16px;box-shadow:0 1px 2px #1018280d;z-index:999!important}.toast .success{--fa-primary-color: #ffffff;--fa-secondary-color: #38c793;--fa-secondary-opacity: 1;background-color:#effaf6}.toast .info{--fa-primary-color: #ffffff;--fa-secondary-color: #344054;--fa-secondary-opacity: 1;background-color:#f2f4f7}.toast .warning{--fa-primary-color: #ffffff;--fa-secondary-color: #f17b2c;--fa-secondary-opacity: 1;background-color:#fef3eb}.toast .error{--fa-primary-color: #ffffff;--fa-secondary-color: #df1c41;--fa-secondary-opacity: 1;background-color:#fdedf0}.glow{animation:glowEffect 1.5s infinite alternate}@keyframes glowEffect{0%{text-shadow:0 0 10px currentColor}to{text-shadow:0 0 10px currentColor,0 0 20px currentColor,0 0 30px currentColor,0 0 40px currentColor}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: NpTypographyComponent, selector: "np-typography", inputs: ["npType", "npSize", "npWeight", "ngContent"] }] });
|
|
1626
|
+
}
|
|
1627
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpAlertComponent, decorators: [{
|
|
1628
|
+
type: Component,
|
|
1629
|
+
args: [{ selector: 'np-alert', imports: [CommonModule, NpTypographyComponent], template: "<ng-container >\n <div class=\"np-alert flex gap-3 items-start\" [ngClass]=\"type\" [style.opacity]=\"opacity\">\n <div class=\"icon-wrapper rounded-[10px]\" [ngClass]=\"state\" *ngIf=\"type == 'toast'\">\n <i [ngClass]=\"getIcon()\" class=\"p-[8px]\"></i>\n </div>\n <div class=\"icon-wrapper rounded-[10px]\" *ngIf=\"getIconNotification().icon && type == 'notification'\">\n <i class=\"glow fa-regular\"\n [ngClass]=\"getIconNotification().icon\"\n [ngStyle]=\"{ 'color': getIconNotification().color }\">\n </i>\n </div>\n\n <div class=\"flex flex-col flex-1\">\n <div class=\"flex justify-between\" *ngIf=\"title\">\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\">{{ title }}</np-typography>\n <button (click)=\"closeAlert()\" class=\"close-btn cursor-pointer opacity-50\">\n <i class=\"fa fa-times\"></i>\n </button>\n </div>\n\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"regular\">{{ description }}</np-typography>\n <np-typography *ngIf=\"isMessageVisible\" npType=\"text\" npSize=\"sm\" npWeight=\"regular\">\n {{ message }}\n </np-typography>\n\n <div class=\"flex gap-3 mt-2\" *ngIf=\"type !== 'notification'\">\n <button (click)=\"closeAlert()\" class=\"dismiss cursor-pointer\">\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\">Dismiss</np-typography>\n </button>\n <button *ngIf=\"message\" class=\"learn-more cursor-pointer\" (click)=\"showMessege()\">\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"semibold\">Learn More</np-typography>\n </button>\n </div>\n </div>\n </div>\n</ng-container>\n", styles: [".np-alert{min-width:300px;max-width:390px;border-radius:6px;background-color:#fff;border:1px solid rgb(208,213,221);padding:16px;box-shadow:0 1px 2px #1018280d;z-index:999!important}.toast .success{--fa-primary-color: #ffffff;--fa-secondary-color: #38c793;--fa-secondary-opacity: 1;background-color:#effaf6}.toast .info{--fa-primary-color: #ffffff;--fa-secondary-color: #344054;--fa-secondary-opacity: 1;background-color:#f2f4f7}.toast .warning{--fa-primary-color: #ffffff;--fa-secondary-color: #f17b2c;--fa-secondary-opacity: 1;background-color:#fef3eb}.toast .error{--fa-primary-color: #ffffff;--fa-secondary-color: #df1c41;--fa-secondary-opacity: 1;background-color:#fdedf0}.glow{animation:glowEffect 1.5s infinite alternate}@keyframes glowEffect{0%{text-shadow:0 0 10px currentColor}to{text-shadow:0 0 10px currentColor,0 0 20px currentColor,0 0 30px currentColor,0 0 40px currentColor}}\n"] }]
|
|
1630
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { type: [{
|
|
1631
|
+
type: Input
|
|
1632
|
+
}], state: [{
|
|
1633
|
+
type: Input
|
|
1634
|
+
}], description: [{
|
|
1635
|
+
type: Input
|
|
1636
|
+
}], title: [{
|
|
1637
|
+
type: Input
|
|
1638
|
+
}], message: [{
|
|
1639
|
+
type: Input
|
|
1640
|
+
}], autoHide: [{
|
|
1641
|
+
type: Input
|
|
1642
|
+
}] } });
|
|
1643
|
+
|
|
1644
|
+
var ETypeNpBreadcrumb;
|
|
1645
|
+
(function (ETypeNpBreadcrumb) {
|
|
1646
|
+
ETypeNpBreadcrumb["BASIC"] = "basic";
|
|
1647
|
+
ETypeNpBreadcrumb["SEPARATORS"] = "separators";
|
|
1648
|
+
ETypeNpBreadcrumb["HIGHLIGHT"] = "highlighted";
|
|
1649
|
+
})(ETypeNpBreadcrumb || (ETypeNpBreadcrumb = {}));
|
|
1650
|
+
|
|
1651
|
+
var E_NP_BREADCRUMB;
|
|
1652
|
+
(function (E_NP_BREADCRUMB) {
|
|
1653
|
+
E_NP_BREADCRUMB["NAME"] = "name";
|
|
1654
|
+
E_NP_BREADCRUMB["PARAM"] = "param";
|
|
1655
|
+
})(E_NP_BREADCRUMB || (E_NP_BREADCRUMB = {}));
|
|
1656
|
+
|
|
1657
|
+
class NpBreadcrumbComponent {
|
|
1658
|
+
_Router;
|
|
1659
|
+
_ActivatedRoute;
|
|
1660
|
+
npType = ETypeNpBreadcrumb.BASIC;
|
|
1661
|
+
isBorder = true;
|
|
1662
|
+
iconBreakDown = 'fa-slash-forward';
|
|
1663
|
+
isBgLast = false;
|
|
1664
|
+
isGetFromUrl = false;
|
|
1665
|
+
breadcrumbs = [];
|
|
1666
|
+
isExpanded = false;
|
|
1667
|
+
ETypeNpBreadcrumb = ETypeNpBreadcrumb;
|
|
1668
|
+
idBreadcrum = `${Math.floor(Math.random() * 100)}-${new Date()?.getTime()}`;
|
|
1669
|
+
constructor(_Router, _ActivatedRoute) {
|
|
1670
|
+
this._Router = _Router;
|
|
1671
|
+
this._ActivatedRoute = _ActivatedRoute;
|
|
1672
|
+
}
|
|
1673
|
+
async ngOnInit() {
|
|
1674
|
+
this.getBreadcrumbs();
|
|
1675
|
+
this._Router.events
|
|
1676
|
+
.pipe(filter((event) => event instanceof NavigationEnd))
|
|
1677
|
+
.subscribe(async () => {
|
|
1678
|
+
this.getBreadcrumbs();
|
|
1679
|
+
});
|
|
1680
|
+
}
|
|
1681
|
+
ngAfterViewInit() {
|
|
1682
|
+
const dotBreadcrum = document.getElementById(this.idBreadcrum);
|
|
1683
|
+
if (dotBreadcrum) {
|
|
1684
|
+
dotBreadcrum.addEventListener('mouseover', () => {
|
|
1685
|
+
this.isExpanded = true;
|
|
1686
|
+
});
|
|
1687
|
+
dotBreadcrum.addEventListener('mouseleave', () => {
|
|
1688
|
+
this.isExpanded = false;
|
|
1689
|
+
});
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
async getBreadcrumbs() {
|
|
1693
|
+
if (this.isGetFromUrl) {
|
|
1694
|
+
this.breadcrumbs = await this.createBreadcrumbs(this._ActivatedRoute.root);
|
|
1695
|
+
}
|
|
1696
|
+
}
|
|
1697
|
+
async createBreadcrumbs(route, url = '', breadcrumbs = []) {
|
|
1698
|
+
const children = route.children;
|
|
1699
|
+
if (!!children && children.length > 0) {
|
|
1700
|
+
for (const child of children) {
|
|
1701
|
+
const routeURL = child.snapshot.url
|
|
1702
|
+
.map((segment) => segment.path)
|
|
1703
|
+
.join('/');
|
|
1704
|
+
// .replace('#', '');
|
|
1705
|
+
if (routeURL !== '') {
|
|
1706
|
+
url += `/${routeURL}`;
|
|
1707
|
+
}
|
|
1708
|
+
const data = child.snapshot.data;
|
|
1709
|
+
if (data[E_NP_BREADCRUMB.NAME] &&
|
|
1710
|
+
!breadcrumbs?.some((x) => x?.url === url)) {
|
|
1711
|
+
breadcrumbs.push({
|
|
1712
|
+
label: data[E_NP_BREADCRUMB.NAME],
|
|
1713
|
+
url,
|
|
1714
|
+
});
|
|
1715
|
+
}
|
|
1716
|
+
return await this.createBreadcrumbs(child, url, breadcrumbs);
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
return breadcrumbs;
|
|
1720
|
+
}
|
|
1721
|
+
onRedirect(item) {
|
|
1722
|
+
if (!item) {
|
|
1723
|
+
this._Router.navigate(['/'], {
|
|
1724
|
+
relativeTo: this._ActivatedRoute,
|
|
1725
|
+
});
|
|
1726
|
+
return;
|
|
1727
|
+
}
|
|
1728
|
+
if (!item?.url) {
|
|
1729
|
+
return;
|
|
1730
|
+
}
|
|
1731
|
+
this._Router.navigate([item?.url], {
|
|
1732
|
+
relativeTo: this._ActivatedRoute,
|
|
1733
|
+
});
|
|
1734
|
+
}
|
|
1735
|
+
onExpand() {
|
|
1736
|
+
this.isExpanded = !this.isExpanded;
|
|
1737
|
+
}
|
|
1738
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpBreadcrumbComponent, deps: [{ token: i1$4.Router }, { token: i1$4.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
|
|
1739
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.5", type: NpBreadcrumbComponent, isStandalone: true, selector: "np-breadcrumb", inputs: { npType: "npType", isBorder: "isBorder", iconBreakDown: "iconBreakDown", isBgLast: "isBgLast", isGetFromUrl: "isGetFromUrl", breadcrumbs: "breadcrumbs" }, ngImport: i0, template: "<div\n class=\"flex items-center gap-3 np-breadcrumb {{ npType }}\"\n [id]=\"idBreadcrum\"\n>\n <!-- [class.border-breadcrumb]=\"isBorder\" -->\n <i class=\"fa-light fa-house cursor-pointer\" (click)=\"onRedirect(null)\"></i>\n @for (item of breadcrumbs; track item; let index = $index; let first = $first;\n let last = $last) {\n <i class=\"fa-light {{ iconBreakDown }} text-[#D0D5DD]\"></i>\n @if (isExpanded) {\n <ng-container\n *ngTemplateOutlet=\"\n contentTemplate;\n context: { item: item, last: last, isBgLast: isBgLast }\n \"\n ></ng-container>\n } @else { @if (index === 1 && breadcrumbs.length > 2) {\n <div class=\"cursor-pointer\" (click)=\"onExpand()\">...</div>\n } @if (first || last) {\n <ng-container\n *ngTemplateOutlet=\"\n contentTemplate;\n context: { item: item, last: last, isBgLast: isBgLast }\n \"\n ></ng-container>\n } } }\n</div>\n\n<ng-template\n #contentTemplate\n let-item=\"item\"\n let-last=\"last\"\n let-isBgLast=\"isBgLast\"\n>\n <!-- [class.item-last]=\"last && isBgLast\" -->\n <div\n class=\"cursor-pointer text-[#475467]\"\n [class.item-last]=\"last && npType === ETypeNpBreadcrumb.HIGHLIGHT\"\n (click)=\"onRedirect(item)\"\n >\n {{ item?.label }}\n </div>\n</ng-template>\n", styles: [".np-breadcrumb{list-style:none;display:flex;margin:0;padding:4px 6px;min-height:36px}.np-breadcrumb .item-last{padding:3px 5px;border-radius:6px;background-color:#f9fafb;color:#344054}.np-breadcrumb.separators,.np-breadcrumb.highlighted{border-top:1px solid #eaecf0;border-bottom:1px solid #eaecf0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
1740
|
+
}
|
|
1741
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpBreadcrumbComponent, decorators: [{
|
|
1742
|
+
type: Component,
|
|
1743
|
+
args: [{ selector: 'np-breadcrumb', imports: [CommonModule], template: "<div\n class=\"flex items-center gap-3 np-breadcrumb {{ npType }}\"\n [id]=\"idBreadcrum\"\n>\n <!-- [class.border-breadcrumb]=\"isBorder\" -->\n <i class=\"fa-light fa-house cursor-pointer\" (click)=\"onRedirect(null)\"></i>\n @for (item of breadcrumbs; track item; let index = $index; let first = $first;\n let last = $last) {\n <i class=\"fa-light {{ iconBreakDown }} text-[#D0D5DD]\"></i>\n @if (isExpanded) {\n <ng-container\n *ngTemplateOutlet=\"\n contentTemplate;\n context: { item: item, last: last, isBgLast: isBgLast }\n \"\n ></ng-container>\n } @else { @if (index === 1 && breadcrumbs.length > 2) {\n <div class=\"cursor-pointer\" (click)=\"onExpand()\">...</div>\n } @if (first || last) {\n <ng-container\n *ngTemplateOutlet=\"\n contentTemplate;\n context: { item: item, last: last, isBgLast: isBgLast }\n \"\n ></ng-container>\n } } }\n</div>\n\n<ng-template\n #contentTemplate\n let-item=\"item\"\n let-last=\"last\"\n let-isBgLast=\"isBgLast\"\n>\n <!-- [class.item-last]=\"last && isBgLast\" -->\n <div\n class=\"cursor-pointer text-[#475467]\"\n [class.item-last]=\"last && npType === ETypeNpBreadcrumb.HIGHLIGHT\"\n (click)=\"onRedirect(item)\"\n >\n {{ item?.label }}\n </div>\n</ng-template>\n", styles: [".np-breadcrumb{list-style:none;display:flex;margin:0;padding:4px 6px;min-height:36px}.np-breadcrumb .item-last{padding:3px 5px;border-radius:6px;background-color:#f9fafb;color:#344054}.np-breadcrumb.separators,.np-breadcrumb.highlighted{border-top:1px solid #eaecf0;border-bottom:1px solid #eaecf0}\n"] }]
|
|
1744
|
+
}], ctorParameters: () => [{ type: i1$4.Router }, { type: i1$4.ActivatedRoute }], propDecorators: { npType: [{
|
|
1745
|
+
type: Input
|
|
1746
|
+
}], isBorder: [{
|
|
1747
|
+
type: Input
|
|
1748
|
+
}], iconBreakDown: [{
|
|
1749
|
+
type: Input
|
|
1750
|
+
}], isBgLast: [{
|
|
1751
|
+
type: Input
|
|
1752
|
+
}], isGetFromUrl: [{
|
|
1753
|
+
type: Input
|
|
1754
|
+
}], breadcrumbs: [{
|
|
1755
|
+
type: Input
|
|
1756
|
+
}] } });
|
|
1757
|
+
|
|
1758
|
+
class NpProgressBarComponent {
|
|
1759
|
+
type = 'style-1';
|
|
1760
|
+
percent = 0;
|
|
1761
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1762
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: NpProgressBarComponent, isStandalone: true, selector: "np-progress-bar", inputs: { type: "type", percent: "percent" }, ngImport: i0, template: "<nz-progress\n [nzPercent]=\"percent\"\n [nzShowInfo]=\"type == 'style-2'\"\n [nzFormat]=\"customFormat\"\n nzStrokeColor=\"rgba(71, 84, 103, 1)\"\n></nz-progress>\n<np-typography npType=\"text\" npSize=\"sm\" npWeight=\"medium\" *ngIf=\"type === 'style-3'\" class=\"flex justify-end\">\n {{ percent }}%\n</np-typography>\n\n<ng-template #customFormat>\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"medium\">\n {{ percent }}%\n </np-typography>\n</ng-template>\n", styles: ["::ng-deep .ant-progress-inner{background-color:#eaecf0}\n"], dependencies: [{ kind: "ngmodule", type: NzProgressModule }, { kind: "component", type: i1$5.NzProgressComponent, selector: "nz-progress", inputs: ["nzShowInfo", "nzWidth", "nzStrokeColor", "nzSize", "nzFormat", "nzSuccessPercent", "nzPercent", "nzStrokeWidth", "nzGapDegree", "nzStatus", "nzType", "nzGapPosition", "nzStrokeLinecap", "nzSteps"], exportAs: ["nzProgress"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: NpTypographyComponent, selector: "np-typography", inputs: ["npType", "npSize", "npWeight", "ngContent"] }] });
|
|
1763
|
+
}
|
|
1764
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpProgressBarComponent, decorators: [{
|
|
1765
|
+
type: Component,
|
|
1766
|
+
args: [{ selector: 'np-progress-bar', imports: [NzProgressModule, CommonModule, NpTypographyComponent], template: "<nz-progress\n [nzPercent]=\"percent\"\n [nzShowInfo]=\"type == 'style-2'\"\n [nzFormat]=\"customFormat\"\n nzStrokeColor=\"rgba(71, 84, 103, 1)\"\n></nz-progress>\n<np-typography npType=\"text\" npSize=\"sm\" npWeight=\"medium\" *ngIf=\"type === 'style-3'\" class=\"flex justify-end\">\n {{ percent }}%\n</np-typography>\n\n<ng-template #customFormat>\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"medium\">\n {{ percent }}%\n </np-typography>\n</ng-template>\n", styles: ["::ng-deep .ant-progress-inner{background-color:#eaecf0}\n"] }]
|
|
1767
|
+
}], propDecorators: { type: [{
|
|
1768
|
+
type: Input
|
|
1769
|
+
}], percent: [{
|
|
1770
|
+
type: Input
|
|
1771
|
+
}] } });
|
|
1772
|
+
|
|
1773
|
+
class NpSliderComponent {
|
|
1774
|
+
_values = [0, 50];
|
|
1775
|
+
get values() {
|
|
1776
|
+
return this._values;
|
|
1777
|
+
}
|
|
1778
|
+
set values(val) {
|
|
1779
|
+
this._values = val;
|
|
1780
|
+
this.valuesChange.emit(this._values);
|
|
1781
|
+
}
|
|
1782
|
+
min = 0;
|
|
1783
|
+
max = 100;
|
|
1784
|
+
step = 1;
|
|
1785
|
+
tooltipVisible = 'default';
|
|
1786
|
+
isDisabled = false;
|
|
1787
|
+
isFloating = false;
|
|
1788
|
+
valuesChange = new EventEmitter();
|
|
1789
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpSliderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1790
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: NpSliderComponent, isStandalone: true, selector: "np-slider", inputs: { values: "values", min: "min", max: "max", step: "step", tooltipVisible: "tooltipVisible", isDisabled: "isDisabled", isFloating: "isFloating" }, outputs: { valuesChange: "valuesChange" }, ngImport: i0, template: "<nz-slider\n nzRange\n [(ngModel)]=\"values\"\n [nzDisabled]=\"isDisabled\"\n [nzMin]=\"min\"\n [nzMax]=\"max\"\n [nzStep]=\"step\"\n [nzTipFormatter]=\"tooltipTemplate\"\n [nzTooltipVisible]=\"tooltipVisible\"\n >\n</nz-slider>\n\n<ng-template #tooltipTemplate let-value>\n <div [ngClass]=\"isFloating ? 'tooltip-class-floating' : 'tooltip-class'\">\n <np-typography npSize=\"sm\" npType=\"text\" npWeight=\"medium\" style=\"color: rgba(16, 24, 40, 1);\">\n {{value}} %\n </np-typography>\n </div>\n</ng-template>\n\n\n", styles: ["::ng-deep .ant-tooltip:has(.tooltip-class){padding:0}::ng-deep .ant-slider-rail{background-color:#eaecf0;height:8px;border-radius:4px}::ng-deep .ant-slider-track{height:8px;background-color:#475467}::ng-deep .ant-slider-handle{width:24px;height:24px;margin-top:-8px;border:1.5px solid rgb(71,84,103);background-color:#fff}::ng-deep .ant-tooltip-placement-right,::ng-deep .ant-tooltip-placement-left{padding:0 10px}::ng-deep .ant-tooltip-arrow{display:none!important}::ng-deep .ant-tooltip-inner{background:none;box-shadow:none}::ng-deep .ant-slider:hover .ant-slider-track{background-color:#475467}::ng-deep .ant-slider:hover .ant-slider-handle:not(.ant-tooltip-open){border-color:#475467}::ng-deep .ant-slider:hover .ant-slider-rail{background-color:#eaecf0}::ng-deep .ant-slider:focus .ant-slider-handle:not(.ant-tooltip-open){box-shadow:0 0 0 4px #d0d5dd}.tooltip-class-floating{background-color:#fff;padding:6px 8px;border-radius:8px;border:1px solid rgb(234,236,240)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NzSliderModule }, { kind: "component", type: i2$3.NzSliderComponent, selector: "nz-slider", inputs: ["nzDisabled", "nzDots", "nzIncluded", "nzRange", "nzVertical", "nzReverse", "nzDefaultValue", "nzMarks", "nzMax", "nzMin", "nzStep", "nzTooltipVisible", "nzTooltipPlacement", "nzTipFormatter"], outputs: ["nzOnAfterChange"], exportAs: ["nzSlider"] }, { kind: "component", type: NpTypographyComponent, selector: "np-typography", inputs: ["npType", "npSize", "npWeight", "ngContent"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
1791
|
+
}
|
|
1792
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpSliderComponent, decorators: [{
|
|
1793
|
+
type: Component,
|
|
1794
|
+
args: [{ selector: 'np-slider', standalone: true, imports: [FormsModule, NzSliderModule, NpTypographyComponent, CommonModule], template: "<nz-slider\n nzRange\n [(ngModel)]=\"values\"\n [nzDisabled]=\"isDisabled\"\n [nzMin]=\"min\"\n [nzMax]=\"max\"\n [nzStep]=\"step\"\n [nzTipFormatter]=\"tooltipTemplate\"\n [nzTooltipVisible]=\"tooltipVisible\"\n >\n</nz-slider>\n\n<ng-template #tooltipTemplate let-value>\n <div [ngClass]=\"isFloating ? 'tooltip-class-floating' : 'tooltip-class'\">\n <np-typography npSize=\"sm\" npType=\"text\" npWeight=\"medium\" style=\"color: rgba(16, 24, 40, 1);\">\n {{value}} %\n </np-typography>\n </div>\n</ng-template>\n\n\n", styles: ["::ng-deep .ant-tooltip:has(.tooltip-class){padding:0}::ng-deep .ant-slider-rail{background-color:#eaecf0;height:8px;border-radius:4px}::ng-deep .ant-slider-track{height:8px;background-color:#475467}::ng-deep .ant-slider-handle{width:24px;height:24px;margin-top:-8px;border:1.5px solid rgb(71,84,103);background-color:#fff}::ng-deep .ant-tooltip-placement-right,::ng-deep .ant-tooltip-placement-left{padding:0 10px}::ng-deep .ant-tooltip-arrow{display:none!important}::ng-deep .ant-tooltip-inner{background:none;box-shadow:none}::ng-deep .ant-slider:hover .ant-slider-track{background-color:#475467}::ng-deep .ant-slider:hover .ant-slider-handle:not(.ant-tooltip-open){border-color:#475467}::ng-deep .ant-slider:hover .ant-slider-rail{background-color:#eaecf0}::ng-deep .ant-slider:focus .ant-slider-handle:not(.ant-tooltip-open){box-shadow:0 0 0 4px #d0d5dd}.tooltip-class-floating{background-color:#fff;padding:6px 8px;border-radius:8px;border:1px solid rgb(234,236,240)}\n"] }]
|
|
1795
|
+
}], propDecorators: { values: [{
|
|
1796
|
+
type: Input
|
|
1797
|
+
}], min: [{
|
|
1798
|
+
type: Input
|
|
1799
|
+
}], max: [{
|
|
1800
|
+
type: Input
|
|
1801
|
+
}], step: [{
|
|
1802
|
+
type: Input
|
|
1803
|
+
}], tooltipVisible: [{
|
|
1804
|
+
type: Input
|
|
1805
|
+
}], isDisabled: [{
|
|
1806
|
+
type: Input
|
|
1807
|
+
}], isFloating: [{
|
|
1808
|
+
type: Input
|
|
1809
|
+
}], valuesChange: [{
|
|
1810
|
+
type: Output
|
|
1811
|
+
}] } });
|
|
1812
|
+
|
|
1813
|
+
class NpLoadingIndicatorComponent {
|
|
1814
|
+
npType = 'type-1';
|
|
1815
|
+
npSize = 'sm';
|
|
1816
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpLoadingIndicatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1817
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: NpLoadingIndicatorComponent, isStandalone: true, selector: "np-loading-indicator", inputs: { npType: "npType", npSize: "npSize" }, ngImport: i0, template: "<div class=\"flex flex-col items-center gap-2\" [ngClass]=\"npSize\">\n <i\n *ngIf=\"npType === 'outlined'\"\n class=\"fa-duotone fa-solid fa-spinner-third fa-spin\"\n style=\"--fa-primary-color: #475467; --fa-secondary-color: #f2f4f7; --fa-secondary-opacity: 1;\">\n </i>\n <div *ngIf=\"npType === 'filled'\" class=\"solid-loader\"></div>\n\n <np-typography [npSize]=\"npSize\" npType=\"text\" npWeight=\"medium\" style=\"color: rgba(52, 64, 84, 1);\">\n Loading...\n </np-typography>\n</div>\n\n\n", styles: [".sm .fa-spin{font-size:28px;-webkit-text-stroke:1px currentColor}.sm .solid-loader{width:28px;height:28px;border:4px solid rgb(71,84,103);border-top-color:transparent;border-radius:50%}.sm .solid-loader:before,.sm .solid-loader:after{width:4px;height:4px}.sm .solid-loader:before{top:0;left:-1px}.sm .solid-loader:after{top:0;right:-1px}.md .fa-spin{font-size:48px;-webkit-text-stroke:1px currentColor}.md .solid-loader{width:48px;height:48px;border:6px solid rgb(71,84,103);border-top-color:transparent;border-radius:50%}.md .solid-loader:before,.md .solid-loader:after{width:6px;height:6px}.md .solid-loader:before{top:0;left:0}.md .solid-loader:after{top:0;right:0}.lg .fa-spin{font-size:56px;-webkit-text-stroke:0px currentColor}.lg .solid-loader{width:56px;height:56px;border:6px solid rgb(71,84,103);border-top-color:transparent;border-radius:50%}.lg .solid-loader:before,.lg .solid-loader:after{width:6px;height:6px}.lg .solid-loader:before{top:2px;left:1px}.lg .solid-loader:after{top:2px;right:1px}.xl .fa-spin{font-size:58px;-webkit-text-stroke:1px currentColor}.xl .solid-loader{width:58px;height:58px;border:8px solid rgb(71,84,103);border-top-color:transparent;border-radius:50%}.xl .solid-loader:before,.xl .solid-loader:after{width:8px;height:8px}.xl .solid-loader:before{top:0;left:-1px}.xl .solid-loader:after{top:0;right:-1px}.solid-loader{position:relative;animation:spin 2s linear infinite}.solid-loader:before,.solid-loader:after{content:\"\";position:absolute;background-color:#475467;border-radius:50%}@keyframes spin{to{transform:rotate(360deg)}}\n"], dependencies: [{ kind: "ngmodule", type: NzSpinModule }, { kind: "ngmodule", type: NzIconModule }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: NpTypographyComponent, selector: "np-typography", inputs: ["npType", "npSize", "npWeight", "ngContent"] }] });
|
|
1818
|
+
}
|
|
1819
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpLoadingIndicatorComponent, decorators: [{
|
|
1820
|
+
type: Component,
|
|
1821
|
+
args: [{ selector: 'np-loading-indicator', imports: [NzSpinModule, NzIconModule, CommonModule, NpTypographyComponent], template: "<div class=\"flex flex-col items-center gap-2\" [ngClass]=\"npSize\">\n <i\n *ngIf=\"npType === 'outlined'\"\n class=\"fa-duotone fa-solid fa-spinner-third fa-spin\"\n style=\"--fa-primary-color: #475467; --fa-secondary-color: #f2f4f7; --fa-secondary-opacity: 1;\">\n </i>\n <div *ngIf=\"npType === 'filled'\" class=\"solid-loader\"></div>\n\n <np-typography [npSize]=\"npSize\" npType=\"text\" npWeight=\"medium\" style=\"color: rgba(52, 64, 84, 1);\">\n Loading...\n </np-typography>\n</div>\n\n\n", styles: [".sm .fa-spin{font-size:28px;-webkit-text-stroke:1px currentColor}.sm .solid-loader{width:28px;height:28px;border:4px solid rgb(71,84,103);border-top-color:transparent;border-radius:50%}.sm .solid-loader:before,.sm .solid-loader:after{width:4px;height:4px}.sm .solid-loader:before{top:0;left:-1px}.sm .solid-loader:after{top:0;right:-1px}.md .fa-spin{font-size:48px;-webkit-text-stroke:1px currentColor}.md .solid-loader{width:48px;height:48px;border:6px solid rgb(71,84,103);border-top-color:transparent;border-radius:50%}.md .solid-loader:before,.md .solid-loader:after{width:6px;height:6px}.md .solid-loader:before{top:0;left:0}.md .solid-loader:after{top:0;right:0}.lg .fa-spin{font-size:56px;-webkit-text-stroke:0px currentColor}.lg .solid-loader{width:56px;height:56px;border:6px solid rgb(71,84,103);border-top-color:transparent;border-radius:50%}.lg .solid-loader:before,.lg .solid-loader:after{width:6px;height:6px}.lg .solid-loader:before{top:2px;left:1px}.lg .solid-loader:after{top:2px;right:1px}.xl .fa-spin{font-size:58px;-webkit-text-stroke:1px currentColor}.xl .solid-loader{width:58px;height:58px;border:8px solid rgb(71,84,103);border-top-color:transparent;border-radius:50%}.xl .solid-loader:before,.xl .solid-loader:after{width:8px;height:8px}.xl .solid-loader:before{top:0;left:-1px}.xl .solid-loader:after{top:0;right:-1px}.solid-loader{position:relative;animation:spin 2s linear infinite}.solid-loader:before,.solid-loader:after{content:\"\";position:absolute;background-color:#475467;border-radius:50%}@keyframes spin{to{transform:rotate(360deg)}}\n"] }]
|
|
1822
|
+
}], propDecorators: { npType: [{
|
|
1823
|
+
type: Input
|
|
1824
|
+
}], npSize: [{
|
|
1825
|
+
type: Input
|
|
1826
|
+
}] } });
|
|
1827
|
+
|
|
1828
|
+
class NpTableComponent {
|
|
1829
|
+
cdr;
|
|
1830
|
+
constructor(cdr) {
|
|
1831
|
+
this.cdr = cdr;
|
|
1832
|
+
}
|
|
1833
|
+
ngAfterViewInit() {
|
|
1834
|
+
setTimeout(() => {
|
|
1835
|
+
this.updatePaginationWidth();
|
|
1836
|
+
this.syncRowHeights();
|
|
1837
|
+
});
|
|
1838
|
+
if (this.selectableType === 'checkbox') {
|
|
1839
|
+
this.bindSelectAllListener();
|
|
1840
|
+
}
|
|
1841
|
+
this.cdr.detectChanges();
|
|
1842
|
+
}
|
|
1843
|
+
ngOnInit() {
|
|
1844
|
+
const [start, end] = this.scrollColumnsRange || [
|
|
1845
|
+
0,
|
|
1846
|
+
this.columns.length - 1,
|
|
1847
|
+
];
|
|
1848
|
+
this.isAtStart = start === 0;
|
|
1849
|
+
this.isAtEnd = end === this.columns.length - 1;
|
|
1850
|
+
}
|
|
1851
|
+
leftRows;
|
|
1852
|
+
middleRows;
|
|
1853
|
+
rightRows;
|
|
1854
|
+
leftHead;
|
|
1855
|
+
middleHead;
|
|
1856
|
+
rightHead;
|
|
1857
|
+
tableLeft;
|
|
1858
|
+
tableMiddle;
|
|
1859
|
+
tableRight;
|
|
1860
|
+
columns = [];
|
|
1861
|
+
selectableType = null;
|
|
1862
|
+
isSortable = false;
|
|
1863
|
+
isFilterable = false;
|
|
1864
|
+
isDeleteable = false;
|
|
1865
|
+
pageSize = [];
|
|
1866
|
+
isUsePagination = true;
|
|
1867
|
+
panigationType = 'basic';
|
|
1868
|
+
state = 'normal';
|
|
1869
|
+
className = '';
|
|
1870
|
+
classNameLeft = ''; // className for left fixed table
|
|
1871
|
+
classNameRight = ''; // className for right fixed table
|
|
1872
|
+
scrollColumnsRange = null;
|
|
1873
|
+
scrollWidth = '';
|
|
1874
|
+
isReverse = false;
|
|
1875
|
+
showVerticalDivider = false;
|
|
1876
|
+
selectAllSub;
|
|
1877
|
+
selectAllFc = new FormControl(false);
|
|
1878
|
+
isIndeterminateAll = false;
|
|
1879
|
+
currentPage = 1;
|
|
1880
|
+
currentPageSize = this.pageSize[0];
|
|
1881
|
+
paginationWidth = '100%';
|
|
1882
|
+
isAtStart = true;
|
|
1883
|
+
isAtEnd = true;
|
|
1884
|
+
_dataSource = [];
|
|
1885
|
+
sortKey = null;
|
|
1886
|
+
sortDirection = null;
|
|
1887
|
+
deleteSelectedRows = new EventEmitter();
|
|
1888
|
+
set dataSource(value) {
|
|
1889
|
+
this._dataSource =
|
|
1890
|
+
value?.map((row) => ({
|
|
1891
|
+
...row,
|
|
1892
|
+
selectFc: new FormControl(false),
|
|
1893
|
+
})) || [];
|
|
1894
|
+
this.currentPage = 1;
|
|
1895
|
+
this.selectAllFc.setValue(false, { emitEvent: false });
|
|
1896
|
+
this.isIndeterminateAll = false;
|
|
1897
|
+
if (this.selectableType === 'checkbox') {
|
|
1898
|
+
this.bindSelectAllListener();
|
|
1899
|
+
}
|
|
1900
|
+
if (this.selectableType === 'radio') {
|
|
1901
|
+
this._dataSource.forEach((row) => {
|
|
1902
|
+
row.selectFc.valueChanges.subscribe((val) => {
|
|
1903
|
+
if (val) {
|
|
1904
|
+
this._dataSource.forEach((r) => {
|
|
1905
|
+
if (r !== row) {
|
|
1906
|
+
r.selectFc.setValue(false, { emitEvent: false });
|
|
1907
|
+
}
|
|
1908
|
+
});
|
|
1909
|
+
}
|
|
1910
|
+
});
|
|
1911
|
+
});
|
|
1912
|
+
}
|
|
1913
|
+
}
|
|
1914
|
+
get fixedLeftColumns() {
|
|
1915
|
+
if (!this.scrollColumnsRange)
|
|
1916
|
+
return [];
|
|
1917
|
+
return this.columns.slice(0, this.scrollColumnsRange[0]);
|
|
1918
|
+
}
|
|
1919
|
+
get scrollableColumns() {
|
|
1920
|
+
if (!this.scrollColumnsRange)
|
|
1921
|
+
return this.columns;
|
|
1922
|
+
return this.columns.slice(this.scrollColumnsRange[0], this.scrollColumnsRange[1] + 1);
|
|
1923
|
+
}
|
|
1924
|
+
get fixedRightColumns() {
|
|
1925
|
+
if (!this.scrollColumnsRange)
|
|
1926
|
+
return [];
|
|
1927
|
+
return this.columns.slice(this.scrollColumnsRange[1] + 1);
|
|
1928
|
+
}
|
|
1929
|
+
syncRowHeights() {
|
|
1930
|
+
const left = this.leftRows.toArray();
|
|
1931
|
+
const middle = this.middleRows.toArray();
|
|
1932
|
+
const right = this.rightRows.toArray();
|
|
1933
|
+
for (let i = 0; i < middle.length; i++) {
|
|
1934
|
+
left[i]?.nativeElement.style.removeProperty('height');
|
|
1935
|
+
middle[i]?.nativeElement.style.removeProperty('height');
|
|
1936
|
+
right[i]?.nativeElement.style.removeProperty('height');
|
|
1937
|
+
}
|
|
1938
|
+
for (let i = 0; i < middle.length; i++) {
|
|
1939
|
+
const hLeft = left[i]?.nativeElement.offsetHeight || 0;
|
|
1940
|
+
const hMid = middle[i]?.nativeElement.offsetHeight || 0;
|
|
1941
|
+
const hRight = right[i]?.nativeElement.offsetHeight || 0;
|
|
1942
|
+
const max = Math.max(hLeft, hMid, hRight);
|
|
1943
|
+
if (left[i])
|
|
1944
|
+
left[i].nativeElement.style.height = `${max}px`;
|
|
1945
|
+
if (middle[i])
|
|
1946
|
+
middle[i].nativeElement.style.height = `${max}px`;
|
|
1947
|
+
if (right[i])
|
|
1948
|
+
right[i].nativeElement.style.height = `${max}px`;
|
|
1949
|
+
}
|
|
1950
|
+
this.leftHead?.nativeElement.style.removeProperty('height');
|
|
1951
|
+
this.middleHead?.nativeElement.style.removeProperty('height');
|
|
1952
|
+
this.rightHead?.nativeElement.style.removeProperty('height');
|
|
1953
|
+
const hHeadLeft = this.leftHead?.nativeElement.offsetHeight || 0;
|
|
1954
|
+
const hHeadMid = this.middleHead?.nativeElement.offsetHeight || 0;
|
|
1955
|
+
const hHeadRight = this.rightHead?.nativeElement.offsetHeight || 0;
|
|
1956
|
+
const maxHead = Math.max(hHeadLeft, hHeadMid, hHeadRight);
|
|
1957
|
+
if (this.leftHead)
|
|
1958
|
+
this.leftHead.nativeElement.style.height = `${maxHead}px`;
|
|
1959
|
+
if (this.middleHead)
|
|
1960
|
+
this.middleHead.nativeElement.style.height = `${maxHead}px`;
|
|
1961
|
+
if (this.rightHead)
|
|
1962
|
+
this.rightHead.nativeElement.style.height = `${maxHead}px`;
|
|
1963
|
+
}
|
|
1964
|
+
updatePaginationWidth() {
|
|
1965
|
+
const wLeft = this.tableLeft?.nativeElement.offsetWidth || 0;
|
|
1966
|
+
const wMid = this.tableMiddle?.nativeElement.offsetWidth || 0;
|
|
1967
|
+
const wRight = this.tableRight?.nativeElement.offsetWidth || 0;
|
|
1968
|
+
const total = wLeft + wMid + wRight;
|
|
1969
|
+
this.paginationWidth = `${total}px`;
|
|
1970
|
+
}
|
|
1971
|
+
bindSelectAllListener() {
|
|
1972
|
+
this.selectAllSub?.unsubscribe();
|
|
1973
|
+
this.selectAllSub = this.selectAllFc.valueChanges.subscribe((checked) => {
|
|
1974
|
+
this._dataSource?.forEach((row) => {
|
|
1975
|
+
row.selectFc.patchValue(checked, { emitEvent: false });
|
|
1976
|
+
});
|
|
1977
|
+
this.isIndeterminateAll = false;
|
|
1978
|
+
});
|
|
1979
|
+
}
|
|
1980
|
+
filterIcons;
|
|
1981
|
+
dropdownPositionMap = {};
|
|
1982
|
+
get filteredData() {
|
|
1983
|
+
return this._dataSource.filter((row) => {
|
|
1984
|
+
for (const key in this.selectedFilters) {
|
|
1985
|
+
const selectedSet = this.selectedFilters[key];
|
|
1986
|
+
if (selectedSet && selectedSet.size > 0 && !selectedSet.has(row[key])) {
|
|
1987
|
+
return false;
|
|
1988
|
+
}
|
|
1989
|
+
}
|
|
1990
|
+
return true;
|
|
1991
|
+
});
|
|
1992
|
+
}
|
|
1993
|
+
get pagedData() {
|
|
1994
|
+
const filtered = this.filteredData;
|
|
1995
|
+
if (this.isUsePagination) {
|
|
1996
|
+
const start = (this.currentPage - 1) * this.currentPageSize;
|
|
1997
|
+
const end = start + this.currentPageSize;
|
|
1998
|
+
return filtered.slice(start, end);
|
|
1999
|
+
}
|
|
2000
|
+
else {
|
|
2001
|
+
return filtered;
|
|
2002
|
+
}
|
|
2003
|
+
}
|
|
2004
|
+
onPageChange(newPage) {
|
|
2005
|
+
this.currentPage = newPage;
|
|
2006
|
+
}
|
|
2007
|
+
onPageSizeChange(newSize) {
|
|
2008
|
+
this.currentPageSize = newSize;
|
|
2009
|
+
this.currentPage = 1;
|
|
2010
|
+
}
|
|
2011
|
+
onSortColumn(column) {
|
|
2012
|
+
if (!column?.key)
|
|
2013
|
+
return;
|
|
2014
|
+
if (this.sortKey === column.key) {
|
|
2015
|
+
this.sortDirection = this.sortDirection === 'asc' ? 'desc' : 'asc';
|
|
2016
|
+
}
|
|
2017
|
+
else {
|
|
2018
|
+
this.sortKey = column.key;
|
|
2019
|
+
this.sortDirection = 'asc';
|
|
2020
|
+
}
|
|
2021
|
+
if (!this.sortDirection) {
|
|
2022
|
+
this._dataSource.sort((a, b) => 0);
|
|
2023
|
+
}
|
|
2024
|
+
else {
|
|
2025
|
+
this._dataSource.sort((a, b) => {
|
|
2026
|
+
const aValue = a[this.sortKey];
|
|
2027
|
+
const bValue = b[this.sortKey];
|
|
2028
|
+
const aNum = parseFloat(aValue);
|
|
2029
|
+
const bNum = parseFloat(bValue);
|
|
2030
|
+
const isNumber = !isNaN(aNum) && !isNaN(bNum);
|
|
2031
|
+
if (isNumber) {
|
|
2032
|
+
return this.sortDirection === 'asc' ? aNum - bNum : bNum - aNum;
|
|
2033
|
+
}
|
|
2034
|
+
return this.sortDirection === 'asc'
|
|
2035
|
+
? String(aValue).localeCompare(String(bValue))
|
|
2036
|
+
: String(bValue).localeCompare(String(aValue));
|
|
2037
|
+
});
|
|
2038
|
+
}
|
|
2039
|
+
this.currentPage = 1;
|
|
2040
|
+
}
|
|
2041
|
+
onChangeSelectColumn($event) {
|
|
2042
|
+
if (this.selectableType !== 'checkbox')
|
|
2043
|
+
return;
|
|
2044
|
+
const allSelected = this._dataSource?.every((child) => child.selectFc?.value);
|
|
2045
|
+
const someSelected = this._dataSource?.some((child) => child.selectFc?.value);
|
|
2046
|
+
this.isIndeterminateAll = someSelected && !allSelected;
|
|
2047
|
+
this.selectAllFc?.patchValue(someSelected, { emitEvent: false });
|
|
2048
|
+
}
|
|
2049
|
+
ngOnDestroy() {
|
|
2050
|
+
this.selectAllSub?.unsubscribe();
|
|
2051
|
+
}
|
|
2052
|
+
get selectedCount() {
|
|
2053
|
+
return this._dataSource.filter((row) => row.selectFc?.value).length;
|
|
2054
|
+
}
|
|
2055
|
+
onDeleteSelected() {
|
|
2056
|
+
const selectedRows = this._dataSource.filter((row) => row.selectFc?.value);
|
|
2057
|
+
this.deleteSelectedRows.emit(selectedRows);
|
|
2058
|
+
this._dataSource = this._dataSource.filter((row) => !row.selectFc?.value);
|
|
2059
|
+
this.currentPage = 1;
|
|
2060
|
+
this.selectAllFc.setValue(false, { emitEvent: false });
|
|
2061
|
+
this.isIndeterminateAll = false;
|
|
2062
|
+
}
|
|
2063
|
+
onRefresh() { }
|
|
2064
|
+
onContactSupport() { }
|
|
2065
|
+
activeFilterKey = null;
|
|
2066
|
+
searchKeyword = {};
|
|
2067
|
+
searchControls = {};
|
|
2068
|
+
selectedFilters = {};
|
|
2069
|
+
toggleFilter(key) {
|
|
2070
|
+
this.activeFilterKey = this.activeFilterKey === key ? null : key;
|
|
2071
|
+
if (!this.searchControls[key]) {
|
|
2072
|
+
this.searchControls[key] = new FormControl('');
|
|
2073
|
+
this.searchControls[key].valueChanges.subscribe((val) => {
|
|
2074
|
+
this.searchKeyword[key] = val?.toLowerCase() || '';
|
|
2075
|
+
});
|
|
2076
|
+
}
|
|
2077
|
+
setTimeout(() => {
|
|
2078
|
+
const icon = this.filterIcons?.find((_, idx) => this.columns[idx]?.key === key);
|
|
2079
|
+
if (icon) {
|
|
2080
|
+
const rect = icon.nativeElement.getBoundingClientRect();
|
|
2081
|
+
const dropdownWidth = 250;
|
|
2082
|
+
const left = rect.left + rect.width / 2 - dropdownWidth / 2;
|
|
2083
|
+
this.dropdownPositionMap[key] = {
|
|
2084
|
+
top: `${rect.bottom + 4}px`,
|
|
2085
|
+
left: `${left}px`,
|
|
2086
|
+
};
|
|
2087
|
+
}
|
|
2088
|
+
}, 0);
|
|
2089
|
+
}
|
|
2090
|
+
shouldShowFilterCheck(colKey) {
|
|
2091
|
+
return (this.selectedFilters[colKey]?.size > 0 && this.activeFilterKey !== colKey);
|
|
2092
|
+
}
|
|
2093
|
+
getDistinctFilteredValues(colKey) {
|
|
2094
|
+
const keyword = this.searchKeyword[colKey]?.toLowerCase() || '';
|
|
2095
|
+
const uniqueSet = new Set();
|
|
2096
|
+
const filteredExcludingCurrent = this._dataSource.filter((row) => {
|
|
2097
|
+
for (const key in this.selectedFilters) {
|
|
2098
|
+
if (key === colKey)
|
|
2099
|
+
continue;
|
|
2100
|
+
const selectedSet = this.selectedFilters[key];
|
|
2101
|
+
if (selectedSet && selectedSet.size > 0 && !selectedSet.has(row[key])) {
|
|
2102
|
+
return false;
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
2105
|
+
return true;
|
|
2106
|
+
});
|
|
2107
|
+
filteredExcludingCurrent.forEach((row) => {
|
|
2108
|
+
const value = row[colKey];
|
|
2109
|
+
if (!uniqueSet.has(value) &&
|
|
2110
|
+
String(value).toLowerCase().includes(keyword)) {
|
|
2111
|
+
uniqueSet.add(value);
|
|
2112
|
+
}
|
|
2113
|
+
});
|
|
2114
|
+
const values = Array.from(uniqueSet);
|
|
2115
|
+
const allNumbers = values.every((val) => !isNaN(parseFloat(val)));
|
|
2116
|
+
return values.sort((a, b) => {
|
|
2117
|
+
if (allNumbers) {
|
|
2118
|
+
return parseFloat(a) - parseFloat(b);
|
|
2119
|
+
}
|
|
2120
|
+
else {
|
|
2121
|
+
return String(a).localeCompare(String(b));
|
|
2122
|
+
}
|
|
2123
|
+
});
|
|
2124
|
+
}
|
|
2125
|
+
getFilteredColumnValues(colKey) {
|
|
2126
|
+
const keyword = this.searchKeyword[colKey]?.toLowerCase() || '';
|
|
2127
|
+
return this._dataSource.filter((row) => String(row[colKey]).toLowerCase().includes(keyword));
|
|
2128
|
+
}
|
|
2129
|
+
isChecked(colKey, value) {
|
|
2130
|
+
const isSelected = this.selectedFilters[colKey]?.has(value) ?? false;
|
|
2131
|
+
return new FormControl(isSelected);
|
|
2132
|
+
}
|
|
2133
|
+
onToggleFilter(colKey, value, checked) {
|
|
2134
|
+
if (!this.selectedFilters[colKey]) {
|
|
2135
|
+
this.selectedFilters[colKey] = new Set();
|
|
2136
|
+
}
|
|
2137
|
+
if (checked) {
|
|
2138
|
+
this.selectedFilters[colKey].add(value);
|
|
2139
|
+
}
|
|
2140
|
+
else {
|
|
2141
|
+
this.selectedFilters[colKey].delete(value);
|
|
2142
|
+
}
|
|
2143
|
+
this.currentPage = 1;
|
|
2144
|
+
if (this.activeFilterKey && this.activeFilterKey !== colKey) {
|
|
2145
|
+
const currentControl = this.searchControls[this.activeFilterKey];
|
|
2146
|
+
const value = currentControl?.value || '';
|
|
2147
|
+
currentControl?.setValue(value);
|
|
2148
|
+
}
|
|
2149
|
+
}
|
|
2150
|
+
onClickOutside(event) {
|
|
2151
|
+
const clickedInside = this.filterIcons?.some((el) => el.nativeElement.contains(event.target));
|
|
2152
|
+
const dropdownClicked = Object.keys(this.dropdownPositionMap).some((key) => {
|
|
2153
|
+
const el = document.querySelector(`.filter-dropdown`);
|
|
2154
|
+
return el?.contains(event.target);
|
|
2155
|
+
});
|
|
2156
|
+
if (!clickedInside && !dropdownClicked) {
|
|
2157
|
+
this.activeFilterKey = null;
|
|
2158
|
+
}
|
|
2159
|
+
}
|
|
2160
|
+
onScrollCloseFilter() {
|
|
2161
|
+
this.activeFilterKey = null;
|
|
2162
|
+
}
|
|
2163
|
+
onResizeWindow() {
|
|
2164
|
+
setTimeout(() => this.syncRowHeights(), 0);
|
|
2165
|
+
}
|
|
2166
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpTableComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2167
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.5", type: NpTableComponent, isStandalone: true, selector: "np-table", inputs: { columns: "columns", selectableType: "selectableType", isSortable: "isSortable", isFilterable: "isFilterable", isDeleteable: "isDeleteable", pageSize: "pageSize", isUsePagination: "isUsePagination", panigationType: "panigationType", state: "state", className: "className", classNameLeft: "classNameLeft", classNameRight: "classNameRight", scrollColumnsRange: "scrollColumnsRange", scrollWidth: "scrollWidth", isReverse: "isReverse", showVerticalDivider: "showVerticalDivider", dataSource: "dataSource" }, outputs: { deleteSelectedRows: "deleteSelectedRows" }, host: { listeners: { "document:click": "onClickOutside($event)", "window:scroll": "onScrollCloseFilter()", "window:resize": "onResizeWindow()" } }, viewQueries: [{ propertyName: "leftHead", first: true, predicate: ["leftHead"], descendants: true, read: ElementRef }, { propertyName: "middleHead", first: true, predicate: ["middleHead"], descendants: true, read: ElementRef }, { propertyName: "rightHead", first: true, predicate: ["rightHead"], descendants: true, read: ElementRef }, { propertyName: "tableLeft", first: true, predicate: ["tableLeft"], descendants: true }, { propertyName: "tableMiddle", first: true, predicate: ["tableMiddle"], descendants: true }, { propertyName: "tableRight", first: true, predicate: ["tableRight"], descendants: true }, { propertyName: "leftRows", predicate: ["leftRow"], descendants: true, read: ElementRef }, { propertyName: "middleRows", predicate: ["middleRow"], descendants: true, read: ElementRef }, { propertyName: "rightRows", predicate: ["rightRow"], descendants: true, read: ElementRef }, { propertyName: "filterIcons", predicate: ["filterIcon"], descendants: true }], ngImport: i0, template: "@if (state !== 'error') {\n @if (scrollColumnsRange == null) {\n <table class=\"np-table rounded-xl my-[15px] mx-auto {{ className }}\">\n <thead>\n <tr *ngIf=\"selectedCount > 0 && isDeleteable\" style=\"background-color: rgba(234, 236, 240, 1)\">\n <td [attr.colspan]=\"columns.length + (selectableType !== null ? 1 : 0)\" class=\"px-4 py-2\">\n <div class=\"flex justify-between items-center\">\n <div class=\"text-sm font-medium text-gray-700\">\n {{ selectedCount }} selected\n </div>\n <np-button npType=\"secondary\" npSize=\"sm\" (click)=\"onDeleteSelected()\">Delete</np-button>\n </div>\n </td>\n </tr>\n\n <tr>\n <th\n class=\"select-column\"\n *ngIf=\"selectableType !== null && state !== 'loading' && _dataSource.length > 0\"\n >\n <np-checkbox\n *ngIf=\"selectableType === 'checkbox'\"\n type=\"checkbox\"\n size=\"sm\"\n [input]=\"selectAllFc\"\n [isIndeterminate]=\"isIndeterminateAll\"\n ></np-checkbox>\n </th>\n\n <ng-container *ngFor=\"let col of columns\">\n <th\n [class.border-r]=\"showVerticalDivider && state !== 'loading' && _dataSource.length > 0\"\n class=\"border-gray-200\"\n >\n <ng-container *ngTemplateOutlet=\"headerTemplate; context: { col: col }\"></ng-container>\n </th>\n </ng-container>\n </tr>\n </thead>\n\n <tbody>\n @if (state === 'loading') {\n <tr>\n <td [attr.colspan]=\"columns.length + (selectableType !== null ? 1 : 0)\" class=\"h-[400px] w-full\">\n <np-loading-indicator npSize=\"md\" npType=\"outlined\"></np-loading-indicator>\n </td>\n </tr>\n }\n\n @else if (_dataSource.length > 0) {\n @for (row of pagedData; track row) {\n <tr>\n <td class=\"select-column\" *ngIf=\"selectableType !== null\">\n <np-checkbox\n [type]=\"selectableType\"\n size=\"sm\"\n [input]=\"row.selectFc\"\n (valueChange)=\"onChangeSelectColumn($event)\"\n ></np-checkbox>\n </td>\n\n @for (col of columns; track col) {\n <ng-container *ngTemplateOutlet=\"renderCell; context: { row: row, col: col }\"></ng-container>\n }\n </tr>\n }\n\n <tr *ngIf=\"isUsePagination\">\n <td [attr.colspan]=\"columns.length + (selectableType !== null ? 1 : 0)\" style=\"padding: 12px 0px !important\">\n <div class=\"w-full\">\n <np-pagination\n [type]=\"panigationType\"\n [totalItems]=\"filteredData.length\"\n [(pageIndex)]=\"currentPage\"\n [pageSize]=\"pageSize\"\n [pageSizeOptions]=\"currentPageSize\"\n [isReverse]=\"isReverse\"\n (pageSizeChange)=\"onPageSizeChange($event)\"\n ></np-pagination>\n </div>\n </td>\n </tr>\n }\n @else {\n <tr>\n <td [attr.colspan]=\"columns.length + (selectableType !== null ? 1 : 0)\" class=\"h-[400px]\">\n <div class=\"flex flex-col gap-4 h-full items-center justify-center\">\n <i class=\"fa-regular fa-file-circle-xmark fa-2xl\" style=\"color: rgba(208, 213, 221, 1)\"></i>\n <np-typography\n npType=\"text\"\n npSize=\"sm\"\n npWeight=\"medium\"\n style=\"color: rgba(208, 213, 221, 1)\"\n >\n No data\n </np-typography>\n </div>\n </td>\n </tr>\n }\n </tbody>\n </table>\n }\n @else {\n <div class=\"flex flex-col w-full\">\n <div class=\"flex w-full\">\n <table *ngIf=\"!isAtStart\" class=\"np-table rounded-l-xl fixed-left z-10 {{ classNameLeft }}\" #tableLeft>\n <thead>\n <tr *ngIf=\"selectedCount > 0 && isDeleteable\" style=\"background-color: rgba(234, 236, 240, 1)\">\n <td [attr.colspan]=\"columns.length + (selectableType !== null ? 1 : 0)\" class=\"px-4 py-2\">\n <div class=\"flex justify-between items-center\">\n <div class=\"text-sm font-medium text-gray-700\">\n {{ selectedCount }} selected\n </div>\n <np-button npType=\"secondary\" npSize=\"sm\" (click)=\"onDeleteSelected()\">Delete</np-button>\n </div>\n </td>\n </tr>\n\n <tr #leftHead>\n <th class=\"select-column\" *ngIf=\"selectableType !== null && state !== 'loading' && _dataSource.length > 0\">\n <np-checkbox\n [type]=\"selectableType\"\n size=\"sm\"\n [input]=\"selectAllFc\"\n [isIndeterminate]=\"isIndeterminateAll\"\n ></np-checkbox>\n </th>\n\n <ng-container *ngFor=\"let col of fixedLeftColumns\">\n <th\n [class.border-r]=\"showVerticalDivider && state !== 'loading' && _dataSource.length > 0\"\n class=\"border-gray-200\"\n >\n <ng-container *ngTemplateOutlet=\"headerTemplate; context: { col: col }\"></ng-container>\n </th>\n </ng-container>\n </tr>\n </thead>\n\n <tbody>\n @for (row of pagedData; track row) {\n <tr #leftRow>\n <td class=\"select-column\" *ngIf=\"selectableType !== null\">\n <np-checkbox\n [type]=\"selectableType\"\n size=\"sm\"\n [input]=\"row.selectFc\"\n (valueChange)=\"onChangeSelectColumn($event)\"\n ></np-checkbox>\n </td>\n\n @for (col of fixedLeftColumns; track col) {\n <ng-container *ngTemplateOutlet=\"renderCell; context: { row: row, col: col }\"></ng-container>\n }\n </tr>\n }\n </tbody>\n </table>\n\n <div\n class=\"scrollable-wrapper mb-[-12px] grow\"\n style=\"overflow-x: auto;\"\n [style.max-width]=\"scrollWidth\"\n #tableMiddle\n [ngClass]=\"{\n 'rounded-l-xl border-l-midtable': isAtStart,\n 'rounded-r-xl border-r-midtable': isAtEnd\n }\"\n >\n <table class=\"np-table scrollable min-w-fit w-full\" style=\"border-left: none; border-right: none;\">\n <thead>\n <tr #middleHead>\n <ng-container *ngFor=\"let col of scrollableColumns\">\n <th\n [class.border-r]=\"showVerticalDivider && state !== 'loading' && _dataSource.length > 0\"\n class=\"border-gray-200\"\n >\n <ng-container *ngTemplateOutlet=\"headerTemplate; context: { col: col }\"></ng-container>\n </th>\n </ng-container>\n </tr>\n </thead>\n\n <tbody>\n @for (row of pagedData; track row) {\n <tr #middleRow>\n @for (col of scrollableColumns; track col) {\n <ng-container *ngTemplateOutlet=\"renderCell; context: { row: row, col: col }\"></ng-container>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n\n <table *ngIf=\"!isAtEnd\" class=\"np-table rounded-r-xl fixed-right z-10 {{ classNameLeft }}\" #tableRight>\n <thead>\n <tr #rightHead>\n @for (col of fixedRightColumns; track col) {\n <th\n [class.border-r]=\"showVerticalDivider && state !== 'loading' && _dataSource.length > 0\"\n class=\"border-gray-200\"\n >\n <ng-container *ngTemplateOutlet=\"headerTemplate; context: { col: col }\"></ng-container>\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n @for (row of pagedData; track row) {\n <tr #rightRow>\n @for (col of fixedRightColumns; track col) {\n <ng-container *ngTemplateOutlet=\"renderCell; context: { row: row, col: col }\"></ng-container>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n\n <div class=\"mt-3 w-full\" *ngIf=\"isUsePagination\" [style.width]=\"paginationWidth\">\n <np-pagination\n [type]=\"panigationType\"\n [totalItems]=\"filteredData.length\"\n [(pageIndex)]=\"currentPage\"\n [pageSize]=\"pageSize\"\n [pageSizeOptions]=\"currentPageSize\"\n (pageSizeChange)=\"onPageSizeChange($event)\"\n ></np-pagination>\n </div>\n </div>\n }\n} @else {\n <div class=\"np-table rounded-xl pb-[100px] max-w-[535px]\">\n <div class=\"flex flex-col relative justify-center items-center h-full mt-[-40px]\">\n <img src=\"assets/images/error-table.png\" alt=\"error\"/>\n <div class=\"flex flex-col items-center justify-center gap-2 absolute bottom-0 left-[50%] translate-x-[-50%]\">\n <div class=\"flex flex-col items-center\">\n <np-typography npType=\"text\" npSize=\"md\" npWeight=\"semibold\">\n Something went wrong...\n </np-typography>\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"regular\" style=\"color: rgba(71, 84, 103, 1); max-width: 352px; text-align: center;\">\n We had some trouble loading this page. Please refresh the page or get in touch for support.\n </np-typography>\n </div>\n <div class=\"flex gap-3\">\n <np-button\n npType=\"secondary\"\n npSize=\"sm\"\n npShape=\"rounded\"\n (click)=\"onContactSupport()\"\n >Contact support\n </np-button>\n\n <np-button\n npType=\"primary\"\n npSize=\"sm\"\n npShape=\"rounded\"\n (click)=\"onRefresh()\"\n >Refresh\n </np-button>\n </div>\n </div>\n </div>\n </div>\n}\n\n<ng-template #headerTemplate let-col=\"col\">\n <div #filterIcon class=\"flex items-center w-full\">\n <div class=\"w-full\">\n <ng-container *ngIf=\"col.headerTemplate; else defaultHeader\">\n <ng-container *ngTemplateOutlet=\"col.headerTemplate; context: { col: col }\"></ng-container>\n </ng-container>\n <ng-template #defaultHeader>\n <p style=\"margin: 0;\">{{ col.label }}</p>\n </ng-template>\n </div>\n\n <ng-container *ngIf=\"!col.headerTemplate\">\n <div class=\"flex gap-2 ms-2\">\n <div *ngIf=\"isSortable && !col.template\" (click)=\"onSortColumn(col)\" class=\"cursor-pointer\">\n <i *ngIf=\"sortKey === col.key && sortDirection === 'asc'\" class=\"fa-duotone fa-solid fa-sort\"\n style=\"--fa-primary-color: #475467; --fa-secondary-color: #475467; --fa-secondary-opacity: 0.5;\"></i>\n <i *ngIf=\"sortKey === col.key && sortDirection === 'desc'\" class=\"fa-duotone fa-solid fa-sort fa-rotate-180\"\n style=\"--fa-primary-color: #475467; --fa-secondary-color: #475467; --fa-secondary-opacity: 0.5;\"></i>\n <i *ngIf=\"sortKey !== col.key || !sortDirection\" class=\"fa-solid fa-sort\" style=\"color: #d0d5d3\"></i>\n </div>\n\n <div class=\"cursor-pointer relative\" (click)=\"toggleFilter(col.key)\" *ngIf=\"isFilterable && !col.template\">\n <ng-container *ngIf=\"shouldShowFilterCheck(col.key); else filterIconTemplate\">\n <span class=\"relative inline-block\">\n <i class=\"fa-solid fa-filter\" style=\"color: #d0d5dd\"></i>\n <span class=\"absolute top-[1px] right-[-2px] block w-[6px] h-[6px] bg-black rounded-full\"></span>\n </span>\n </ng-container>\n <ng-template #filterIconTemplate>\n <i class=\"fa-solid fa-filter\"\n [ngStyle]=\"{ color: activeFilterKey === col.key ? '#000' : '#d0d5dd' }\"></i>\n </ng-template>\n\n <div\n #filterDropdown\n [hidden]=\"activeFilterKey !== col.key\"\n (click)=\"$event.stopPropagation()\"\n [ngStyle]=\"dropdownPositionMap[col.key] || {}\"\n class=\"min-w-[240px] filter fixed px-2 pt-2 rounded-[8px] z-[9999]\"\n >\n <np-input-field\n size=\"md\"\n type=\"text\"\n placeholder=\"Search...\"\n iconLeft=\"fa-thin fa-magnifying-glass\"\n [input]=\"searchControls[col.key]\"\n ></np-input-field>\n <np-scrollbar height=\"200px\">\n <div *ngIf=\"getDistinctFilteredValues(col.key).length > 0\">\n <div *ngFor=\"let value of getDistinctFilteredValues(col.key)\" class=\"py-2 flex items-center\">\n <np-checkbox\n type=\"checkbox\"\n size=\"sm\"\n [input]=\"isChecked(col.key, value)\"\n (valueChange)=\"onToggleFilter(col.key, value, $event)\"\n [label]=\"value\"\n ></np-checkbox>\n </div>\n </div>\n <div *ngIf=\"getDistinctFilteredValues(col.key).length === 0\" class=\"text-center py-[50px]\">\n <np-typography\n npType=\"text\"\n npSize=\"sm\"\n npWeight=\"regular\"\n style=\"color: rgba(208, 213, 221, 1);\"\n >\n No matches.\n </np-typography>\n </div>\n </np-scrollbar>\n </div>\n </div>\n </div>\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #renderCell let-row=\"row\" let-col=\"col\">\n <td\n style =\"min-width: 100px;\"\n [class.border-r]=\"showVerticalDivider\"\n class=\"border-gray-200\"\n >\n <ng-container *ngIf=\"col.template; else default\">\n <ng-container *ngTemplateOutlet=\"col.template; context: { row: row, col: col }\"></ng-container>\n </ng-container>\n <ng-template #default>\n <div class=\"flex items-center\">\n <div>{{ row[col.key] }}</div>\n </div>\n </ng-template>\n </td>\n</ng-template>\n", styles: [".np-table{border-collapse:separate;border-spacing:0;border:1px solid #eaecf0;overflow:hidden;box-shadow:0 1px 2px #1018280f;box-shadow:0 1px 3px #1018281a}.np-table .select-column{width:40px;max-width:40px}.np-table thead{background-color:#f9fafb}.np-table th,.np-table td{padding:12px;text-align:left;border-bottom:1px solid #eaecf0}.np-table th{font-size:12px;font-weight:500}.np-table td{font-size:14px;font-weight:400}.np-table tbody tr:last-child td{border-bottom:none}.filter{border:1px solid rgb(234,236,240);background-color:#fff}.border-l-midtable{border-left:1px solid #eaecf0}.border-r-midtable{border-right:1px solid #eaecf0}::-webkit-scrollbar{background-color:transparent;width:8px;height:8px}::-webkit-scrollbar-thumb{background-color:#eaecf0;border-radius:8px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: NpCheckboxComponent, selector: "np-checkbox", inputs: ["input", "type", "size", "npType", "isDisabled", "groupName", "label", "description", "isIndeterminate"], outputs: ["valueChange"] }, { kind: "component", type: NpPaginationComponent, selector: "np-pagination", inputs: ["type", "totalItems", "pageSize", "isReverse", "pageIndex", "pageSizeOptions"], outputs: ["pageSizeChange", "pageIndexChange"] }, { kind: "component", type: NpTypographyComponent, selector: "np-typography", inputs: ["npType", "npSize", "npWeight", "ngContent"] }, { kind: "component", type: NpLoadingIndicatorComponent, selector: "np-loading-indicator", inputs: ["npType", "npSize"] }, { kind: "component", type: NpButtonComponent, selector: "np-button", inputs: ["npType", "npSize", "className", "isLoading", "disabled", "ngContent"] }, { kind: "component", type: NpScrollbarComponent, selector: "np-scrollbar", inputs: ["width", "height", "ngContent"] }, { kind: "component", type: NpInputFieldComponent, selector: "np-input-field", inputs: ["size", "label", "placeholder", "iconLeft", "iconRight", "hint", "errorMap", "disabled", "limitValue", "functionHandler", "submitted", "digitsInfo", "locale", "input", "type"], outputs: ["valueChange", "iconLeftClick", "iconRightClick"] }, { kind: "ngmodule", type: FormsModule }] });
|
|
2168
|
+
}
|
|
2169
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpTableComponent, decorators: [{
|
|
2170
|
+
type: Component,
|
|
2171
|
+
args: [{ selector: 'np-table', imports: [
|
|
2172
|
+
CommonModule,
|
|
2173
|
+
NpCheckboxComponent,
|
|
2174
|
+
NpPaginationComponent,
|
|
2175
|
+
NpTypographyComponent,
|
|
2176
|
+
NpLoadingIndicatorComponent,
|
|
2177
|
+
NpButtonComponent,
|
|
2178
|
+
NpScrollbarComponent,
|
|
2179
|
+
NpInputFieldComponent,
|
|
2180
|
+
FormsModule,
|
|
2181
|
+
], template: "@if (state !== 'error') {\n @if (scrollColumnsRange == null) {\n <table class=\"np-table rounded-xl my-[15px] mx-auto {{ className }}\">\n <thead>\n <tr *ngIf=\"selectedCount > 0 && isDeleteable\" style=\"background-color: rgba(234, 236, 240, 1)\">\n <td [attr.colspan]=\"columns.length + (selectableType !== null ? 1 : 0)\" class=\"px-4 py-2\">\n <div class=\"flex justify-between items-center\">\n <div class=\"text-sm font-medium text-gray-700\">\n {{ selectedCount }} selected\n </div>\n <np-button npType=\"secondary\" npSize=\"sm\" (click)=\"onDeleteSelected()\">Delete</np-button>\n </div>\n </td>\n </tr>\n\n <tr>\n <th\n class=\"select-column\"\n *ngIf=\"selectableType !== null && state !== 'loading' && _dataSource.length > 0\"\n >\n <np-checkbox\n *ngIf=\"selectableType === 'checkbox'\"\n type=\"checkbox\"\n size=\"sm\"\n [input]=\"selectAllFc\"\n [isIndeterminate]=\"isIndeterminateAll\"\n ></np-checkbox>\n </th>\n\n <ng-container *ngFor=\"let col of columns\">\n <th\n [class.border-r]=\"showVerticalDivider && state !== 'loading' && _dataSource.length > 0\"\n class=\"border-gray-200\"\n >\n <ng-container *ngTemplateOutlet=\"headerTemplate; context: { col: col }\"></ng-container>\n </th>\n </ng-container>\n </tr>\n </thead>\n\n <tbody>\n @if (state === 'loading') {\n <tr>\n <td [attr.colspan]=\"columns.length + (selectableType !== null ? 1 : 0)\" class=\"h-[400px] w-full\">\n <np-loading-indicator npSize=\"md\" npType=\"outlined\"></np-loading-indicator>\n </td>\n </tr>\n }\n\n @else if (_dataSource.length > 0) {\n @for (row of pagedData; track row) {\n <tr>\n <td class=\"select-column\" *ngIf=\"selectableType !== null\">\n <np-checkbox\n [type]=\"selectableType\"\n size=\"sm\"\n [input]=\"row.selectFc\"\n (valueChange)=\"onChangeSelectColumn($event)\"\n ></np-checkbox>\n </td>\n\n @for (col of columns; track col) {\n <ng-container *ngTemplateOutlet=\"renderCell; context: { row: row, col: col }\"></ng-container>\n }\n </tr>\n }\n\n <tr *ngIf=\"isUsePagination\">\n <td [attr.colspan]=\"columns.length + (selectableType !== null ? 1 : 0)\" style=\"padding: 12px 0px !important\">\n <div class=\"w-full\">\n <np-pagination\n [type]=\"panigationType\"\n [totalItems]=\"filteredData.length\"\n [(pageIndex)]=\"currentPage\"\n [pageSize]=\"pageSize\"\n [pageSizeOptions]=\"currentPageSize\"\n [isReverse]=\"isReverse\"\n (pageSizeChange)=\"onPageSizeChange($event)\"\n ></np-pagination>\n </div>\n </td>\n </tr>\n }\n @else {\n <tr>\n <td [attr.colspan]=\"columns.length + (selectableType !== null ? 1 : 0)\" class=\"h-[400px]\">\n <div class=\"flex flex-col gap-4 h-full items-center justify-center\">\n <i class=\"fa-regular fa-file-circle-xmark fa-2xl\" style=\"color: rgba(208, 213, 221, 1)\"></i>\n <np-typography\n npType=\"text\"\n npSize=\"sm\"\n npWeight=\"medium\"\n style=\"color: rgba(208, 213, 221, 1)\"\n >\n No data\n </np-typography>\n </div>\n </td>\n </tr>\n }\n </tbody>\n </table>\n }\n @else {\n <div class=\"flex flex-col w-full\">\n <div class=\"flex w-full\">\n <table *ngIf=\"!isAtStart\" class=\"np-table rounded-l-xl fixed-left z-10 {{ classNameLeft }}\" #tableLeft>\n <thead>\n <tr *ngIf=\"selectedCount > 0 && isDeleteable\" style=\"background-color: rgba(234, 236, 240, 1)\">\n <td [attr.colspan]=\"columns.length + (selectableType !== null ? 1 : 0)\" class=\"px-4 py-2\">\n <div class=\"flex justify-between items-center\">\n <div class=\"text-sm font-medium text-gray-700\">\n {{ selectedCount }} selected\n </div>\n <np-button npType=\"secondary\" npSize=\"sm\" (click)=\"onDeleteSelected()\">Delete</np-button>\n </div>\n </td>\n </tr>\n\n <tr #leftHead>\n <th class=\"select-column\" *ngIf=\"selectableType !== null && state !== 'loading' && _dataSource.length > 0\">\n <np-checkbox\n [type]=\"selectableType\"\n size=\"sm\"\n [input]=\"selectAllFc\"\n [isIndeterminate]=\"isIndeterminateAll\"\n ></np-checkbox>\n </th>\n\n <ng-container *ngFor=\"let col of fixedLeftColumns\">\n <th\n [class.border-r]=\"showVerticalDivider && state !== 'loading' && _dataSource.length > 0\"\n class=\"border-gray-200\"\n >\n <ng-container *ngTemplateOutlet=\"headerTemplate; context: { col: col }\"></ng-container>\n </th>\n </ng-container>\n </tr>\n </thead>\n\n <tbody>\n @for (row of pagedData; track row) {\n <tr #leftRow>\n <td class=\"select-column\" *ngIf=\"selectableType !== null\">\n <np-checkbox\n [type]=\"selectableType\"\n size=\"sm\"\n [input]=\"row.selectFc\"\n (valueChange)=\"onChangeSelectColumn($event)\"\n ></np-checkbox>\n </td>\n\n @for (col of fixedLeftColumns; track col) {\n <ng-container *ngTemplateOutlet=\"renderCell; context: { row: row, col: col }\"></ng-container>\n }\n </tr>\n }\n </tbody>\n </table>\n\n <div\n class=\"scrollable-wrapper mb-[-12px] grow\"\n style=\"overflow-x: auto;\"\n [style.max-width]=\"scrollWidth\"\n #tableMiddle\n [ngClass]=\"{\n 'rounded-l-xl border-l-midtable': isAtStart,\n 'rounded-r-xl border-r-midtable': isAtEnd\n }\"\n >\n <table class=\"np-table scrollable min-w-fit w-full\" style=\"border-left: none; border-right: none;\">\n <thead>\n <tr #middleHead>\n <ng-container *ngFor=\"let col of scrollableColumns\">\n <th\n [class.border-r]=\"showVerticalDivider && state !== 'loading' && _dataSource.length > 0\"\n class=\"border-gray-200\"\n >\n <ng-container *ngTemplateOutlet=\"headerTemplate; context: { col: col }\"></ng-container>\n </th>\n </ng-container>\n </tr>\n </thead>\n\n <tbody>\n @for (row of pagedData; track row) {\n <tr #middleRow>\n @for (col of scrollableColumns; track col) {\n <ng-container *ngTemplateOutlet=\"renderCell; context: { row: row, col: col }\"></ng-container>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n\n <table *ngIf=\"!isAtEnd\" class=\"np-table rounded-r-xl fixed-right z-10 {{ classNameLeft }}\" #tableRight>\n <thead>\n <tr #rightHead>\n @for (col of fixedRightColumns; track col) {\n <th\n [class.border-r]=\"showVerticalDivider && state !== 'loading' && _dataSource.length > 0\"\n class=\"border-gray-200\"\n >\n <ng-container *ngTemplateOutlet=\"headerTemplate; context: { col: col }\"></ng-container>\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n @for (row of pagedData; track row) {\n <tr #rightRow>\n @for (col of fixedRightColumns; track col) {\n <ng-container *ngTemplateOutlet=\"renderCell; context: { row: row, col: col }\"></ng-container>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n\n <div class=\"mt-3 w-full\" *ngIf=\"isUsePagination\" [style.width]=\"paginationWidth\">\n <np-pagination\n [type]=\"panigationType\"\n [totalItems]=\"filteredData.length\"\n [(pageIndex)]=\"currentPage\"\n [pageSize]=\"pageSize\"\n [pageSizeOptions]=\"currentPageSize\"\n (pageSizeChange)=\"onPageSizeChange($event)\"\n ></np-pagination>\n </div>\n </div>\n }\n} @else {\n <div class=\"np-table rounded-xl pb-[100px] max-w-[535px]\">\n <div class=\"flex flex-col relative justify-center items-center h-full mt-[-40px]\">\n <img src=\"assets/images/error-table.png\" alt=\"error\"/>\n <div class=\"flex flex-col items-center justify-center gap-2 absolute bottom-0 left-[50%] translate-x-[-50%]\">\n <div class=\"flex flex-col items-center\">\n <np-typography npType=\"text\" npSize=\"md\" npWeight=\"semibold\">\n Something went wrong...\n </np-typography>\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"regular\" style=\"color: rgba(71, 84, 103, 1); max-width: 352px; text-align: center;\">\n We had some trouble loading this page. Please refresh the page or get in touch for support.\n </np-typography>\n </div>\n <div class=\"flex gap-3\">\n <np-button\n npType=\"secondary\"\n npSize=\"sm\"\n npShape=\"rounded\"\n (click)=\"onContactSupport()\"\n >Contact support\n </np-button>\n\n <np-button\n npType=\"primary\"\n npSize=\"sm\"\n npShape=\"rounded\"\n (click)=\"onRefresh()\"\n >Refresh\n </np-button>\n </div>\n </div>\n </div>\n </div>\n}\n\n<ng-template #headerTemplate let-col=\"col\">\n <div #filterIcon class=\"flex items-center w-full\">\n <div class=\"w-full\">\n <ng-container *ngIf=\"col.headerTemplate; else defaultHeader\">\n <ng-container *ngTemplateOutlet=\"col.headerTemplate; context: { col: col }\"></ng-container>\n </ng-container>\n <ng-template #defaultHeader>\n <p style=\"margin: 0;\">{{ col.label }}</p>\n </ng-template>\n </div>\n\n <ng-container *ngIf=\"!col.headerTemplate\">\n <div class=\"flex gap-2 ms-2\">\n <div *ngIf=\"isSortable && !col.template\" (click)=\"onSortColumn(col)\" class=\"cursor-pointer\">\n <i *ngIf=\"sortKey === col.key && sortDirection === 'asc'\" class=\"fa-duotone fa-solid fa-sort\"\n style=\"--fa-primary-color: #475467; --fa-secondary-color: #475467; --fa-secondary-opacity: 0.5;\"></i>\n <i *ngIf=\"sortKey === col.key && sortDirection === 'desc'\" class=\"fa-duotone fa-solid fa-sort fa-rotate-180\"\n style=\"--fa-primary-color: #475467; --fa-secondary-color: #475467; --fa-secondary-opacity: 0.5;\"></i>\n <i *ngIf=\"sortKey !== col.key || !sortDirection\" class=\"fa-solid fa-sort\" style=\"color: #d0d5d3\"></i>\n </div>\n\n <div class=\"cursor-pointer relative\" (click)=\"toggleFilter(col.key)\" *ngIf=\"isFilterable && !col.template\">\n <ng-container *ngIf=\"shouldShowFilterCheck(col.key); else filterIconTemplate\">\n <span class=\"relative inline-block\">\n <i class=\"fa-solid fa-filter\" style=\"color: #d0d5dd\"></i>\n <span class=\"absolute top-[1px] right-[-2px] block w-[6px] h-[6px] bg-black rounded-full\"></span>\n </span>\n </ng-container>\n <ng-template #filterIconTemplate>\n <i class=\"fa-solid fa-filter\"\n [ngStyle]=\"{ color: activeFilterKey === col.key ? '#000' : '#d0d5dd' }\"></i>\n </ng-template>\n\n <div\n #filterDropdown\n [hidden]=\"activeFilterKey !== col.key\"\n (click)=\"$event.stopPropagation()\"\n [ngStyle]=\"dropdownPositionMap[col.key] || {}\"\n class=\"min-w-[240px] filter fixed px-2 pt-2 rounded-[8px] z-[9999]\"\n >\n <np-input-field\n size=\"md\"\n type=\"text\"\n placeholder=\"Search...\"\n iconLeft=\"fa-thin fa-magnifying-glass\"\n [input]=\"searchControls[col.key]\"\n ></np-input-field>\n <np-scrollbar height=\"200px\">\n <div *ngIf=\"getDistinctFilteredValues(col.key).length > 0\">\n <div *ngFor=\"let value of getDistinctFilteredValues(col.key)\" class=\"py-2 flex items-center\">\n <np-checkbox\n type=\"checkbox\"\n size=\"sm\"\n [input]=\"isChecked(col.key, value)\"\n (valueChange)=\"onToggleFilter(col.key, value, $event)\"\n [label]=\"value\"\n ></np-checkbox>\n </div>\n </div>\n <div *ngIf=\"getDistinctFilteredValues(col.key).length === 0\" class=\"text-center py-[50px]\">\n <np-typography\n npType=\"text\"\n npSize=\"sm\"\n npWeight=\"regular\"\n style=\"color: rgba(208, 213, 221, 1);\"\n >\n No matches.\n </np-typography>\n </div>\n </np-scrollbar>\n </div>\n </div>\n </div>\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #renderCell let-row=\"row\" let-col=\"col\">\n <td\n style =\"min-width: 100px;\"\n [class.border-r]=\"showVerticalDivider\"\n class=\"border-gray-200\"\n >\n <ng-container *ngIf=\"col.template; else default\">\n <ng-container *ngTemplateOutlet=\"col.template; context: { row: row, col: col }\"></ng-container>\n </ng-container>\n <ng-template #default>\n <div class=\"flex items-center\">\n <div>{{ row[col.key] }}</div>\n </div>\n </ng-template>\n </td>\n</ng-template>\n", styles: [".np-table{border-collapse:separate;border-spacing:0;border:1px solid #eaecf0;overflow:hidden;box-shadow:0 1px 2px #1018280f;box-shadow:0 1px 3px #1018281a}.np-table .select-column{width:40px;max-width:40px}.np-table thead{background-color:#f9fafb}.np-table th,.np-table td{padding:12px;text-align:left;border-bottom:1px solid #eaecf0}.np-table th{font-size:12px;font-weight:500}.np-table td{font-size:14px;font-weight:400}.np-table tbody tr:last-child td{border-bottom:none}.filter{border:1px solid rgb(234,236,240);background-color:#fff}.border-l-midtable{border-left:1px solid #eaecf0}.border-r-midtable{border-right:1px solid #eaecf0}::-webkit-scrollbar{background-color:transparent;width:8px;height:8px}::-webkit-scrollbar-thumb{background-color:#eaecf0;border-radius:8px}\n"] }]
|
|
2182
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { leftRows: [{
|
|
2183
|
+
type: ViewChildren,
|
|
2184
|
+
args: ['leftRow', { read: ElementRef }]
|
|
2185
|
+
}], middleRows: [{
|
|
2186
|
+
type: ViewChildren,
|
|
2187
|
+
args: ['middleRow', { read: ElementRef }]
|
|
2188
|
+
}], rightRows: [{
|
|
2189
|
+
type: ViewChildren,
|
|
2190
|
+
args: ['rightRow', { read: ElementRef }]
|
|
2191
|
+
}], leftHead: [{
|
|
2192
|
+
type: ViewChild,
|
|
2193
|
+
args: ['leftHead', { read: ElementRef }]
|
|
2194
|
+
}], middleHead: [{
|
|
2195
|
+
type: ViewChild,
|
|
2196
|
+
args: ['middleHead', { read: ElementRef }]
|
|
2197
|
+
}], rightHead: [{
|
|
2198
|
+
type: ViewChild,
|
|
2199
|
+
args: ['rightHead', { read: ElementRef }]
|
|
2200
|
+
}], tableLeft: [{
|
|
2201
|
+
type: ViewChild,
|
|
2202
|
+
args: ['tableLeft', { static: false }]
|
|
2203
|
+
}], tableMiddle: [{
|
|
2204
|
+
type: ViewChild,
|
|
2205
|
+
args: ['tableMiddle', { static: false }]
|
|
2206
|
+
}], tableRight: [{
|
|
2207
|
+
type: ViewChild,
|
|
2208
|
+
args: ['tableRight', { static: false }]
|
|
2209
|
+
}], columns: [{
|
|
2210
|
+
type: Input
|
|
2211
|
+
}], selectableType: [{
|
|
2212
|
+
type: Input
|
|
2213
|
+
}], isSortable: [{
|
|
2214
|
+
type: Input
|
|
2215
|
+
}], isFilterable: [{
|
|
2216
|
+
type: Input
|
|
2217
|
+
}], isDeleteable: [{
|
|
2218
|
+
type: Input
|
|
2219
|
+
}], pageSize: [{
|
|
2220
|
+
type: Input
|
|
2221
|
+
}], isUsePagination: [{
|
|
2222
|
+
type: Input
|
|
2223
|
+
}], panigationType: [{
|
|
2224
|
+
type: Input
|
|
2225
|
+
}], state: [{
|
|
2226
|
+
type: Input
|
|
2227
|
+
}], className: [{
|
|
2228
|
+
type: Input
|
|
2229
|
+
}], classNameLeft: [{
|
|
2230
|
+
type: Input
|
|
2231
|
+
}], classNameRight: [{
|
|
2232
|
+
type: Input
|
|
2233
|
+
}], scrollColumnsRange: [{
|
|
2234
|
+
type: Input
|
|
2235
|
+
}], scrollWidth: [{
|
|
2236
|
+
type: Input
|
|
2237
|
+
}], isReverse: [{
|
|
2238
|
+
type: Input
|
|
2239
|
+
}], showVerticalDivider: [{
|
|
2240
|
+
type: Input
|
|
2241
|
+
}], deleteSelectedRows: [{
|
|
2242
|
+
type: Output
|
|
2243
|
+
}], dataSource: [{
|
|
2244
|
+
type: Input
|
|
2245
|
+
}], filterIcons: [{
|
|
2246
|
+
type: ViewChildren,
|
|
2247
|
+
args: ['filterIcon']
|
|
2248
|
+
}], onClickOutside: [{
|
|
2249
|
+
type: HostListener,
|
|
2250
|
+
args: ['document:click', ['$event']]
|
|
2251
|
+
}], onScrollCloseFilter: [{
|
|
2252
|
+
type: HostListener,
|
|
2253
|
+
args: ['window:scroll']
|
|
2254
|
+
}], onResizeWindow: [{
|
|
2255
|
+
type: HostListener,
|
|
2256
|
+
args: ['window:resize']
|
|
2257
|
+
}] } });
|
|
2258
|
+
|
|
2259
|
+
class NpTabComponent {
|
|
2260
|
+
_Router;
|
|
2261
|
+
_ActivatedRoute;
|
|
2262
|
+
tabs = [];
|
|
2263
|
+
tabActive = '';
|
|
2264
|
+
isLink = false;
|
|
2265
|
+
onChange = new EventEmitter();
|
|
2266
|
+
indexActive = 0;
|
|
2267
|
+
constructor(_Router, _ActivatedRoute) {
|
|
2268
|
+
this._Router = _Router;
|
|
2269
|
+
this._ActivatedRoute = _ActivatedRoute;
|
|
2270
|
+
}
|
|
2271
|
+
ngOnInit() {
|
|
2272
|
+
this.setTabActiveDefault();
|
|
2273
|
+
}
|
|
2274
|
+
setTabActiveDefault() {
|
|
2275
|
+
if (this.tabActive) {
|
|
2276
|
+
this.indexActive = this.tabs?.findIndex((x) => x.key === this.tabActive);
|
|
2277
|
+
return;
|
|
2278
|
+
}
|
|
2279
|
+
if (!this.isLink) {
|
|
2280
|
+
this.tabActive = this.tabs[0]?.key;
|
|
2281
|
+
this.indexActive = 0;
|
|
2282
|
+
return;
|
|
2283
|
+
}
|
|
2284
|
+
const queryParmTabIndex = this._ActivatedRoute.snapshot.queryParamMap.get('tab');
|
|
2285
|
+
if (queryParmTabIndex === undefined || queryParmTabIndex === null) {
|
|
2286
|
+
this.tabActive = this.tabs[0]?.key;
|
|
2287
|
+
this.indexActive = 0;
|
|
2288
|
+
return;
|
|
2289
|
+
}
|
|
2290
|
+
const tabActive = this.tabs?.[+queryParmTabIndex];
|
|
2291
|
+
this.tabActive = tabActive?.key;
|
|
2292
|
+
this.indexActive = +queryParmTabIndex;
|
|
2293
|
+
}
|
|
2294
|
+
onChangeTab(tab, index) {
|
|
2295
|
+
this.tabActive = tab.key;
|
|
2296
|
+
this.indexActive = index;
|
|
2297
|
+
this.onChange.emit(tab);
|
|
2298
|
+
if (tab?.path && this.isLink) {
|
|
2299
|
+
this._Router.navigate([], {
|
|
2300
|
+
relativeTo: this._ActivatedRoute,
|
|
2301
|
+
queryParams: { tab: index },
|
|
2302
|
+
queryParamsHandling: 'merge',
|
|
2303
|
+
});
|
|
2304
|
+
}
|
|
2305
|
+
}
|
|
2306
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpTabComponent, deps: [{ token: i1$4.Router }, { token: i1$4.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
|
|
2307
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.5", type: NpTabComponent, isStandalone: true, selector: "np-tab", inputs: { tabs: "tabs", tabActive: "tabActive", isLink: "isLink" }, outputs: { onChange: "onChange" }, ngImport: i0, template: "<!-- <div class=\"tab-container\">\n <div class=\"tab-list\">\n <a *ngFor=\"let tab of tabs\" class=\"tab\" [routerLink]=\"tab.path\" [class.active]=\"isActive(tab.path)\">\n {{ tab.label }}\n </a>\n <div class=\"indicator\" [ngStyle]=\"indicatorStyle()\"></div>\n </div>\n</div> -->\n<div class=\"np-tab flex flex-col h-full\">\n <div class=\"flex justify-between w-full p-2 np-tab-header\">\n @for (tab of tabs; track tab; let index = $index; let first = $first) {\n <div class=\"flex-1\">\n <div\n class=\"text-[16px] font-[600] flex justify-center p-2 tab-item\"\n (click)=\"onChangeTab(tab, $index)\"\n >\n <!-- [class.active]=\"tabActive === tab.key\" -->\n <span class=\"tab-label\">{{ tab?.label }}</span>\n\n @if($first) {\n <div\n class=\"tab-active\"\n [ngStyle]=\"{\n left: indexActive * 100 + '%'\n }\"\n ></div>\n }\n </div>\n </div>\n }\n <!-- <div class=\"box\" [class.test]=\"tabActive === 'Tab 3'\"></div> -->\n </div>\n <ng-content></ng-content>\n</div>\n", styles: [".np-tab .np-tab-header{background-color:#f2f4f7}.np-tab .np-tab-header .tab-item{background-color:transparent;color:#667085;cursor:pointer;transition:background-color .3s ease,color .3s ease,box-shadow .3s ease;position:relative}.np-tab .np-tab-header .tab-item .tab-active{position:absolute;width:100%;bottom:0;left:0%;height:100%;background-color:#fff;color:#344054;box-shadow:0 1px 3px #1018281a;border-radius:6px;transition:left .3s ease-in-out}.np-tab .np-tab-header .tab-item .tab-label{z-index:1}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: RouterModule }] });
|
|
2308
|
+
}
|
|
2309
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpTabComponent, decorators: [{
|
|
2310
|
+
type: Component,
|
|
2311
|
+
args: [{ selector: 'np-tab', imports: [CommonModule, RouterModule], template: "<!-- <div class=\"tab-container\">\n <div class=\"tab-list\">\n <a *ngFor=\"let tab of tabs\" class=\"tab\" [routerLink]=\"tab.path\" [class.active]=\"isActive(tab.path)\">\n {{ tab.label }}\n </a>\n <div class=\"indicator\" [ngStyle]=\"indicatorStyle()\"></div>\n </div>\n</div> -->\n<div class=\"np-tab flex flex-col h-full\">\n <div class=\"flex justify-between w-full p-2 np-tab-header\">\n @for (tab of tabs; track tab; let index = $index; let first = $first) {\n <div class=\"flex-1\">\n <div\n class=\"text-[16px] font-[600] flex justify-center p-2 tab-item\"\n (click)=\"onChangeTab(tab, $index)\"\n >\n <!-- [class.active]=\"tabActive === tab.key\" -->\n <span class=\"tab-label\">{{ tab?.label }}</span>\n\n @if($first) {\n <div\n class=\"tab-active\"\n [ngStyle]=\"{\n left: indexActive * 100 + '%'\n }\"\n ></div>\n }\n </div>\n </div>\n }\n <!-- <div class=\"box\" [class.test]=\"tabActive === 'Tab 3'\"></div> -->\n </div>\n <ng-content></ng-content>\n</div>\n", styles: [".np-tab .np-tab-header{background-color:#f2f4f7}.np-tab .np-tab-header .tab-item{background-color:transparent;color:#667085;cursor:pointer;transition:background-color .3s ease,color .3s ease,box-shadow .3s ease;position:relative}.np-tab .np-tab-header .tab-item .tab-active{position:absolute;width:100%;bottom:0;left:0%;height:100%;background-color:#fff;color:#344054;box-shadow:0 1px 3px #1018281a;border-radius:6px;transition:left .3s ease-in-out}.np-tab .np-tab-header .tab-item .tab-label{z-index:1}\n"] }]
|
|
2312
|
+
}], ctorParameters: () => [{ type: i1$4.Router }, { type: i1$4.ActivatedRoute }], propDecorators: { tabs: [{
|
|
2313
|
+
type: Input
|
|
2314
|
+
}], tabActive: [{
|
|
2315
|
+
type: Input
|
|
2316
|
+
}], isLink: [{
|
|
2317
|
+
type: Input
|
|
2318
|
+
}], onChange: [{
|
|
2319
|
+
type: Output
|
|
2320
|
+
}] } });
|
|
2321
|
+
|
|
2322
|
+
class NpResizeComponent {
|
|
2323
|
+
renderer;
|
|
2324
|
+
iconService;
|
|
2325
|
+
container;
|
|
2326
|
+
constructor(renderer, iconService) {
|
|
2327
|
+
this.renderer = renderer;
|
|
2328
|
+
this.iconService = iconService;
|
|
2329
|
+
this.iconService.addIconLiteral('ng-zorro:antd', this.ngZorroIconLiteral);
|
|
2330
|
+
}
|
|
2331
|
+
width;
|
|
2332
|
+
height;
|
|
2333
|
+
maxWidth;
|
|
2334
|
+
maxHeight;
|
|
2335
|
+
minWidth;
|
|
2336
|
+
minHeight;
|
|
2337
|
+
directions = [];
|
|
2338
|
+
isDisable = false;
|
|
2339
|
+
id = -1;
|
|
2340
|
+
resizeDirection = null;
|
|
2341
|
+
_ngContent = null;
|
|
2342
|
+
ngZorroIconLiteral = '<svg width="8" height="18" viewBox="0 0 8 18" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_4739_7041)"><path d="M0.535156 3.99987L0.535156 13.0665C0.535156 14.9811 2.08724 16.5332 4.00182 16.5332C5.91641 16.5332 7.46849 14.9811 7.46849 13.0665L7.46849 3.99987C7.46849 2.08528 5.91641 0.533203 4.00182 0.533203C2.08724 0.533203 0.535156 2.08528 0.535156 3.99987Z" fill="white"/><path d="M0.535156 3.99987L0.535156 13.0665C0.535156 14.9811 2.08724 16.5332 4.00182 16.5332C5.91641 16.5332 7.46849 14.9811 7.46849 13.0665L7.46849 3.99987C7.46849 2.08528 5.91641 0.533203 4.00182 0.533203C2.08724 0.533203 0.535156 2.08528 0.535156 3.99987Z" stroke="#D0D5DD"/><path d="M3.99225 4C4.36434 4 4.67442 4.21593 4.86047 4.51826C5.04651 4.84223 5.04651 5.25252 4.86047 5.55485C4.67442 5.87883 4.36434 6.07319 3.99225 6.07319C3.64083 6.07319 3.33075 5.87883 3.14471 5.55485C2.95865 5.25252 2.95865 4.84223 3.14471 4.51826C3.33075 4.21593 3.64083 4 3.99225 4ZM3.99225 7.45532C4.36434 7.45532 4.67442 7.67125 4.86047 7.97358C5.04651 8.29755 5.04651 8.70784 4.86047 9.01017C4.67442 9.33414 4.36434 9.52851 3.99225 9.52851C3.64083 9.52851 3.33075 9.33414 3.14471 9.01017C2.95865 8.70784 2.95865 8.29755 3.14471 7.97358C3.33075 7.67125 3.64083 7.45532 3.99225 7.45532ZM4.9845 11.9472C4.9845 12.336 4.79845 12.6599 4.48837 12.8542C4.19897 13.0486 3.8062 13.0486 3.49612 12.8542C3.20672 12.6599 3 12.336 3 11.9472C3 11.5801 3.20672 11.2562 3.49612 11.0618C3.8062 10.8674 4.19897 10.8674 4.48837 11.0618C4.79845 11.2562 4.9845 11.5801 4.9845 11.9472Z" fill="#D0D5DD"/></g><defs><clipPath id="clip0_4739_7041"><rect width="8" height="17.0667" fill="white"/></clipPath></defs></svg>';
|
|
2343
|
+
set ngContent(value) {
|
|
2344
|
+
this._ngContent = value;
|
|
2345
|
+
this.updateContent();
|
|
2346
|
+
}
|
|
2347
|
+
onResize({ width, height, direction }) {
|
|
2348
|
+
cancelAnimationFrame(this.id);
|
|
2349
|
+
this.id = requestAnimationFrame(() => {
|
|
2350
|
+
this.width = width;
|
|
2351
|
+
this.height = height;
|
|
2352
|
+
this.resizeDirection = direction;
|
|
2353
|
+
});
|
|
2354
|
+
}
|
|
2355
|
+
updateContent() {
|
|
2356
|
+
if (!this._ngContent) {
|
|
2357
|
+
return;
|
|
2358
|
+
}
|
|
2359
|
+
if (this._ngContent instanceof Element) {
|
|
2360
|
+
this.renderer.appendChild(this.container.nativeElement, this._ngContent);
|
|
2361
|
+
}
|
|
2362
|
+
}
|
|
2363
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpResizeComponent, deps: [{ token: i0.Renderer2 }, { token: i1$2.NzIconService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2364
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: NpResizeComponent, isStandalone: true, selector: "np-resize", inputs: { width: "width", height: "height", maxWidth: "maxWidth", maxHeight: "maxHeight", minWidth: "minWidth", minHeight: "minHeight", directions: "directions", isDisable: "isDisable", ngContent: "ngContent" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, static: true }], ngImport: i0, template: "<div\n #container\n class=\"box\"\n nz-resizable\n (nzResize)=\"onResize($event)\"\n [style.height.px]=\"height\"\n [style.width.px]=\"width\"\n [nzMaxWidth]=\"maxWidth\"\n [nzMinWidth]=\"minWidth\"\n [nzMaxHeight]=\"maxHeight\"\n [nzMinHeight]=\"minHeight\"\n [nzDisabled]=\"isDisable\"\n >\n <nz-resize-handle\n *ngIf=\"directions.includes('topLeft') || (directions.includes('top') && directions.includes('left'))\"\n nzDirection=\"topLeft\"\n >\n <nz-icon class=\"bottom-right\" nzType=\"ng-zorro:antd\" nzTheme=\"outline\" [nzRotate]=\"225\"/>\n </nz-resize-handle>\n\n <nz-resize-handle\n *ngIf=\"directions.includes('topRight') || (directions.includes('top') && directions.includes('right'))\"\n nzDirection=\"topRight\"\n >\n <nz-icon class=\"bottom-right\" nzType=\"ng-zorro:antd\" nzTheme=\"outline\" [nzRotate]=\"135\"/>\n </nz-resize-handle>\n\n <nz-resize-handle\n *ngIf=\"directions.includes('bottomLeft') || (directions.includes('bottom') && directions.includes('left'))\"\n nzDirection=\"bottomLeft\"\n >\n <nz-icon class=\"bottom-right\" nzType=\"ng-zorro:antd\" nzTheme=\"outline\" [nzRotate]=\"315\"/>\n </nz-resize-handle>\n\n <nz-resize-handle\n *ngIf=\"directions.includes('bottomRight') || (directions.includes('bottom') && directions.includes('right'))\"\n nzDirection=\"bottomRight\"\n >\n <nz-icon class=\"bottom-right\" nzType=\"ng-zorro:antd\" nzTheme=\"outline\" [nzRotate]=\"45\" />\n </nz-resize-handle>\n\n <nz-resize-handle *ngIf=\"directions.includes('top')\" nzDirection=\"top\">\n <nz-icon class=\"bottom-right\" nzType=\"ng-zorro:antd\" nzTheme=\"outline\" [nzRotate]=\"90\"/>\n </nz-resize-handle>\n\n <nz-resize-handle *ngIf=\"directions.includes('right')\" nzDirection=\"right\">\n <nz-icon class=\"bottom-right\" nzType=\"ng-zorro:antd\" nzTheme=\"outline\" [nzRotate]=\"0\"/>\n </nz-resize-handle>\n\n <nz-resize-handle *ngIf=\"directions.includes('bottom')\" nzDirection=\"bottom\">\n <nz-icon class=\"bottom-right\" nzType=\"ng-zorro:antd\" nzTheme=\"outline\" [nzRotate]=\"90\"/>\n </nz-resize-handle>\n\n <nz-resize-handle *ngIf=\"directions.includes('left')\" nzDirection=\"left\">\n <nz-icon class=\"bottom-right\" nzType=\"ng-zorro:antd\" nzTheme=\"outline\" [nzRotate]=\"0\"/>\n </nz-resize-handle>\n\n <ng-content></ng-content>\n</div>\n\n", styles: [":host{height:100%;width:100%}.box{display:flex;align-items:center;justify-content:center;background:#fff;border:1px solid #ddd;border-radius:10px}.anticon{color:#fff!important}::ng-deep .anticon svg{height:24px!important}::ng-deep .nz-resizable-handle{position:absolute;width:2px;height:2px;background:transparent;z-index:100}::ng-deep .nz-resizable-handle-left,::ng-deep .nz-resizable-handle-right{width:24px;height:24px;top:50%;transform:translateY(-50%);cursor:ew-resize;display:flex;justify-content:center;align-items:center}::ng-deep .nz-resizable-handle-bottom{width:24px;height:24px;left:50%;transform:translate(-50%);cursor:ns-resize;display:flex;justify-content:center;align-items:center}::ng-deep .nz-resizable-handle-left{left:-12px}::ng-deep .nz-resizable-handle-right{right:-12px}::ng-deep .nz-resizable-handle-top{top:-12px}::ng-deep .nz-resizable-handle-bottom{bottom:-12px}::ng-deep .nz-resizable-handle-topLeft,::ng-deep .nz-resizable-handle-topRight{width:24px;height:24px;position:absolute;top:-11px;display:flex;justify-content:center;align-items:center;rotate:180deg}::ng-deep .nz-resizable-handle-bottomLeft,::ng-deep .nz-resizable-handle-bottomRight{width:24px;height:24px;position:absolute;bottom:-11px;display:flex;justify-content:center;align-items:center}::ng-deep .nz-resizable-handle-topLeft{left:-11px;cursor:nwse-resize}::ng-deep .nz-resizable-handle-topRight{right:-11px;cursor:nesw-resize}::ng-deep .nz-resizable-handle-bottomLeft{left:-11px;cursor:nesw-resize}::ng-deep .nz-resizable-handle-bottomRight{right:-11px;cursor:nwse-resize}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: NzResizableModule }, { kind: "directive", type: i3$4.NzResizableDirective, selector: "[nz-resizable]", inputs: ["nzBounds", "nzMaxHeight", "nzMaxWidth", "nzMinHeight", "nzMinWidth", "nzGridColumnCount", "nzMaxColumn", "nzMinColumn", "nzLockAspectRatio", "nzPreview", "nzDisabled"], outputs: ["nzResize", "nzResizeEnd", "nzResizeStart"], exportAs: ["nzResizable"] }, { kind: "component", type: i3$4.NzResizeHandleComponent, selector: "nz-resize-handle, [nz-resize-handle]", inputs: ["nzDirection", "nzCursorType"], outputs: ["nzMouseDown"], exportAs: ["nzResizeHandle"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i1$2.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }] });
|
|
2365
|
+
}
|
|
2366
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpResizeComponent, decorators: [{
|
|
2367
|
+
type: Component,
|
|
2368
|
+
args: [{ selector: 'np-resize', imports: [CommonModule, NzResizableModule, NzIconModule], template: "<div\n #container\n class=\"box\"\n nz-resizable\n (nzResize)=\"onResize($event)\"\n [style.height.px]=\"height\"\n [style.width.px]=\"width\"\n [nzMaxWidth]=\"maxWidth\"\n [nzMinWidth]=\"minWidth\"\n [nzMaxHeight]=\"maxHeight\"\n [nzMinHeight]=\"minHeight\"\n [nzDisabled]=\"isDisable\"\n >\n <nz-resize-handle\n *ngIf=\"directions.includes('topLeft') || (directions.includes('top') && directions.includes('left'))\"\n nzDirection=\"topLeft\"\n >\n <nz-icon class=\"bottom-right\" nzType=\"ng-zorro:antd\" nzTheme=\"outline\" [nzRotate]=\"225\"/>\n </nz-resize-handle>\n\n <nz-resize-handle\n *ngIf=\"directions.includes('topRight') || (directions.includes('top') && directions.includes('right'))\"\n nzDirection=\"topRight\"\n >\n <nz-icon class=\"bottom-right\" nzType=\"ng-zorro:antd\" nzTheme=\"outline\" [nzRotate]=\"135\"/>\n </nz-resize-handle>\n\n <nz-resize-handle\n *ngIf=\"directions.includes('bottomLeft') || (directions.includes('bottom') && directions.includes('left'))\"\n nzDirection=\"bottomLeft\"\n >\n <nz-icon class=\"bottom-right\" nzType=\"ng-zorro:antd\" nzTheme=\"outline\" [nzRotate]=\"315\"/>\n </nz-resize-handle>\n\n <nz-resize-handle\n *ngIf=\"directions.includes('bottomRight') || (directions.includes('bottom') && directions.includes('right'))\"\n nzDirection=\"bottomRight\"\n >\n <nz-icon class=\"bottom-right\" nzType=\"ng-zorro:antd\" nzTheme=\"outline\" [nzRotate]=\"45\" />\n </nz-resize-handle>\n\n <nz-resize-handle *ngIf=\"directions.includes('top')\" nzDirection=\"top\">\n <nz-icon class=\"bottom-right\" nzType=\"ng-zorro:antd\" nzTheme=\"outline\" [nzRotate]=\"90\"/>\n </nz-resize-handle>\n\n <nz-resize-handle *ngIf=\"directions.includes('right')\" nzDirection=\"right\">\n <nz-icon class=\"bottom-right\" nzType=\"ng-zorro:antd\" nzTheme=\"outline\" [nzRotate]=\"0\"/>\n </nz-resize-handle>\n\n <nz-resize-handle *ngIf=\"directions.includes('bottom')\" nzDirection=\"bottom\">\n <nz-icon class=\"bottom-right\" nzType=\"ng-zorro:antd\" nzTheme=\"outline\" [nzRotate]=\"90\"/>\n </nz-resize-handle>\n\n <nz-resize-handle *ngIf=\"directions.includes('left')\" nzDirection=\"left\">\n <nz-icon class=\"bottom-right\" nzType=\"ng-zorro:antd\" nzTheme=\"outline\" [nzRotate]=\"0\"/>\n </nz-resize-handle>\n\n <ng-content></ng-content>\n</div>\n\n", styles: [":host{height:100%;width:100%}.box{display:flex;align-items:center;justify-content:center;background:#fff;border:1px solid #ddd;border-radius:10px}.anticon{color:#fff!important}::ng-deep .anticon svg{height:24px!important}::ng-deep .nz-resizable-handle{position:absolute;width:2px;height:2px;background:transparent;z-index:100}::ng-deep .nz-resizable-handle-left,::ng-deep .nz-resizable-handle-right{width:24px;height:24px;top:50%;transform:translateY(-50%);cursor:ew-resize;display:flex;justify-content:center;align-items:center}::ng-deep .nz-resizable-handle-bottom{width:24px;height:24px;left:50%;transform:translate(-50%);cursor:ns-resize;display:flex;justify-content:center;align-items:center}::ng-deep .nz-resizable-handle-left{left:-12px}::ng-deep .nz-resizable-handle-right{right:-12px}::ng-deep .nz-resizable-handle-top{top:-12px}::ng-deep .nz-resizable-handle-bottom{bottom:-12px}::ng-deep .nz-resizable-handle-topLeft,::ng-deep .nz-resizable-handle-topRight{width:24px;height:24px;position:absolute;top:-11px;display:flex;justify-content:center;align-items:center;rotate:180deg}::ng-deep .nz-resizable-handle-bottomLeft,::ng-deep .nz-resizable-handle-bottomRight{width:24px;height:24px;position:absolute;bottom:-11px;display:flex;justify-content:center;align-items:center}::ng-deep .nz-resizable-handle-topLeft{left:-11px;cursor:nwse-resize}::ng-deep .nz-resizable-handle-topRight{right:-11px;cursor:nesw-resize}::ng-deep .nz-resizable-handle-bottomLeft{left:-11px;cursor:nesw-resize}::ng-deep .nz-resizable-handle-bottomRight{right:-11px;cursor:nwse-resize}\n"] }]
|
|
2369
|
+
}], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i1$2.NzIconService }], propDecorators: { container: [{
|
|
2370
|
+
type: ViewChild,
|
|
2371
|
+
args: ['container', { static: true }]
|
|
2372
|
+
}], width: [{
|
|
2373
|
+
type: Input,
|
|
2374
|
+
args: [{ required: true }]
|
|
2375
|
+
}], height: [{
|
|
2376
|
+
type: Input,
|
|
2377
|
+
args: [{ required: true }]
|
|
2378
|
+
}], maxWidth: [{
|
|
2379
|
+
type: Input
|
|
2380
|
+
}], maxHeight: [{
|
|
2381
|
+
type: Input
|
|
2382
|
+
}], minWidth: [{
|
|
2383
|
+
type: Input
|
|
2384
|
+
}], minHeight: [{
|
|
2385
|
+
type: Input
|
|
2386
|
+
}], directions: [{
|
|
2387
|
+
type: Input
|
|
2388
|
+
}], isDisable: [{
|
|
2389
|
+
type: Input
|
|
2390
|
+
}], ngContent: [{
|
|
2391
|
+
type: Input
|
|
2392
|
+
}] } });
|
|
2393
|
+
|
|
2394
|
+
class BasicModule {
|
|
2395
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: BasicModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2396
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.5", ngImport: i0, type: BasicModule, imports: [CommonModule,
|
|
2397
|
+
NpCheckboxComponent,
|
|
2398
|
+
NpInputFieldComponent,
|
|
2399
|
+
NpButtonComponent,
|
|
2400
|
+
NpTypographyComponent,
|
|
2401
|
+
NpInputTexteraComponent], exports: [NpCheckboxComponent,
|
|
2402
|
+
NpInputFieldComponent,
|
|
2403
|
+
NpButtonComponent,
|
|
2404
|
+
NpTypographyComponent,
|
|
2405
|
+
NpInputTexteraComponent] });
|
|
2406
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: BasicModule, imports: [CommonModule,
|
|
2407
|
+
NpCheckboxComponent,
|
|
2408
|
+
NpInputFieldComponent,
|
|
2409
|
+
NpButtonComponent,
|
|
2410
|
+
NpTypographyComponent,
|
|
2411
|
+
NpInputTexteraComponent] });
|
|
2412
|
+
}
|
|
2413
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: BasicModule, decorators: [{
|
|
2414
|
+
type: NgModule,
|
|
2415
|
+
args: [{
|
|
2416
|
+
declarations: [],
|
|
2417
|
+
imports: [
|
|
2418
|
+
CommonModule,
|
|
2419
|
+
NpCheckboxComponent,
|
|
2420
|
+
NpInputFieldComponent,
|
|
2421
|
+
NpButtonComponent,
|
|
2422
|
+
NpTypographyComponent,
|
|
2423
|
+
NpInputTexteraComponent,
|
|
2424
|
+
],
|
|
2425
|
+
exports: [
|
|
2426
|
+
NpCheckboxComponent,
|
|
2427
|
+
NpInputFieldComponent,
|
|
2428
|
+
NpButtonComponent,
|
|
2429
|
+
NpTypographyComponent,
|
|
2430
|
+
NpInputTexteraComponent,
|
|
2431
|
+
],
|
|
2432
|
+
}]
|
|
2433
|
+
}] });
|
|
2434
|
+
|
|
2435
|
+
class NpModalComponent {
|
|
2436
|
+
modalButton = '';
|
|
2437
|
+
modalTitle = '';
|
|
2438
|
+
modalDescriptions = '';
|
|
2439
|
+
modalType = 'notification';
|
|
2440
|
+
modalState = 'default';
|
|
2441
|
+
useIcon = true;
|
|
2442
|
+
useCheckBox = true;
|
|
2443
|
+
cancelText = 'Cancel';
|
|
2444
|
+
okText = 'OK';
|
|
2445
|
+
modalContent;
|
|
2446
|
+
modalFooter;
|
|
2447
|
+
loadingOK = false;
|
|
2448
|
+
ok = new EventEmitter();
|
|
2449
|
+
cancel = new EventEmitter();
|
|
2450
|
+
checkbox = new EventEmitter();
|
|
2451
|
+
isVisible = false;
|
|
2452
|
+
isOkLoading = false;
|
|
2453
|
+
modalWidth = 544;
|
|
2454
|
+
checkboxControl = new FormControl(false);
|
|
2455
|
+
ngOnInit() {
|
|
2456
|
+
if (this.modalType === 'confirmation') {
|
|
2457
|
+
this.modalWidth = 400;
|
|
2458
|
+
}
|
|
2459
|
+
else if (this.modalType === 'notification') {
|
|
2460
|
+
this.modalWidth = 544;
|
|
2461
|
+
}
|
|
2462
|
+
}
|
|
2463
|
+
isTemplate(value) {
|
|
2464
|
+
return value instanceof TemplateRef;
|
|
2465
|
+
}
|
|
2466
|
+
get iconPath() {
|
|
2467
|
+
switch (this.modalState) {
|
|
2468
|
+
case 'error':
|
|
2469
|
+
return 'assets/images/error.png';
|
|
2470
|
+
case 'success':
|
|
2471
|
+
return 'assets/images/success.png';
|
|
2472
|
+
case 'warning':
|
|
2473
|
+
return 'assets/images/warning.png';
|
|
2474
|
+
case 'default':
|
|
2475
|
+
default:
|
|
2476
|
+
return 'assets/images/default.png';
|
|
2477
|
+
}
|
|
2478
|
+
}
|
|
2479
|
+
showModal() {
|
|
2480
|
+
this.isVisible = true;
|
|
2481
|
+
}
|
|
2482
|
+
handleOk() {
|
|
2483
|
+
this.ok.emit();
|
|
2484
|
+
this.isVisible = false;
|
|
2485
|
+
}
|
|
2486
|
+
handleCancel() {
|
|
2487
|
+
this.isVisible = false;
|
|
2488
|
+
this.cancel.emit();
|
|
2489
|
+
}
|
|
2490
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2491
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: NpModalComponent, isStandalone: true, selector: "np-modal", inputs: { modalButton: "modalButton", modalTitle: "modalTitle", modalDescriptions: "modalDescriptions", modalType: "modalType", modalState: "modalState", useIcon: "useIcon", useCheckBox: "useCheckBox", cancelText: "cancelText", okText: "okText", modalContent: "modalContent", modalFooter: "modalFooter", loadingOK: "loadingOK" }, outputs: { ok: "ok", cancel: "cancel", checkbox: "checkbox" }, ngImport: i0, template: "<np-button (click)=\"showModal()\">\n <ng-container *ngIf=\"isTemplate(modalButton); else textTitle\">\n <ng-container *ngTemplateOutlet=\"modalButton\"></ng-container>\n </ng-container>\n <ng-template #textTitle>{{ modalButton }}</ng-template>\n</np-button>\n\n<nz-modal\n [(nzVisible)]=\"isVisible\"\n (nzOnCancel)=\"handleCancel()\"\n (nzOnOk)=\"handleOk()\"\n [nzTitle]=\"isTemplate(modalTitle) ? modalTitle : titleTemplate\"\n [nzContent]=\"modalContent || ''\"\n [nzFooter]=\"isTemplate(modalFooter) ? modalFooter : footerTemplate\"\n [nzWidth]=\"modalWidth\"\n nzClassName=\"np-modal\"\n>\n</nz-modal>\n\n<ng-template #titleTemplate>\n <ng-container *ngTemplateOutlet=\"modalType === 'confirmation' ? contentConfirmation : contentNotification\"></ng-container>\n</ng-template>\n\n<ng-template #footerTemplate>\n <ng-container *ngTemplateOutlet=\"modalType === 'confirmation' ? footerConfirmation : footerNotification\"></ng-container>\n</ng-template>\n\n<!---------------------------------------------------------------->\n\n<ng-template #contentConfirmation>\n <div class=\"flex w-full\">\n <div class=\"flex flex-col grow gap-1\">\n <img\n *ngIf=\"useIcon\"\n [src]=\"iconPath\"\n [alt]=\"modalState + ' icon'\"\n class=\"w-[48px] h-[48px]\"\n />\n <div class=\"flex flex-col gap-[4px]\">\n <np-typography npType=\"text\" npSize=\"lg\" npWeight=\"semibold\">\n {{modalTitle}}\n </np-typography>\n <ng-container *ngIf=\"isTemplate(modalDescriptions); else textDesc\">\n <ng-container *ngTemplateOutlet=\"modalDescriptions\"></ng-container>\n </ng-container>\n <ng-template #textDesc>\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"regular\" style=\"color: rgba(71, 84, 103, 1);\">\n {{modalDescriptions}}\n </np-typography>\n </ng-template>\n </div>\n </div>\n <div class=\"flex pt-3\">\n <i class=\"fa-solid fa-xmark cursor-pointer fa-xl\" (click)=\"handleCancel()\"></i>\n </div>\n </div>\n</ng-template>\n\n<ng-template #footerConfirmation>\n <div class=\"flex justify-between {{modalType}}\">\n <np-button npSize=\"lg\" npType=\"secondary\" (click)=\"handleCancel()\">\n {{cancelText}}\n </np-button>\n <np-button\n npSize=\"lg\"\n [npType]=\"\n modalState === 'error'\n ? 'destructive'\n : modalState === 'warning'\n ? 'warning'\n : 'primary'\n \"\n [isLoading]=\"loadingOK\"\n (click)=\"handleOk()\"\n >\n {{okText}}\n </np-button>\n </div>\n</ng-template>\n\n<ng-template #contentNotification>\n <div class=\"flex w-full\">\n <div class=\"flex me-3\" *ngIf=\"useIcon\">\n <img\n [src]=\"iconPath\"\n [alt]=\"modalState + ' icon'\"\n class=\"min-w-[48px] max-w-[48px] h-[48px]\"\n />\n </div>\n <div class=\"flex flex-col grow\">\n <div class=\"flex\">\n <div class=\"flex grow\">\n <np-typography npType=\"text\" npSize=\"lg\" npWeight=\"semibold\">\n {{modalTitle}}\n </np-typography>\n </div>\n <div class=\"flex pt-3\">\n <i class=\"fa-solid fa-xmark cursor-pointer fa-xl\" (click)=\"handleCancel()\"></i>\n </div>\n </div>\n <div class=\"flex grow\">\n <ng-container *ngIf=\"isTemplate(modalDescriptions); else textDesc\">\n <ng-container *ngTemplateOutlet=\"modalDescriptions\"></ng-container>\n </ng-container>\n <ng-template #textDesc>\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"regular\" style=\"color: rgba(71, 84, 103, 1);\">\n {{modalDescriptions}}\n </np-typography>\n </ng-template>\n </div>\n </div>\n </div>\n</ng-template>\n\n<ng-template #footerNotification>\n <div class=\"flex justify-between items-center w-full\">\n <div class=\"flex w-full\" *ngIf=\"useCheckBox\">\n <np-checkbox\n type=\"checkbox\"\n size=\"sm\"\n label=\"Don\u2019t show again\"\n [input]=\"checkboxControl\"\n ></np-checkbox>\n </div>\n <div class=\"flex gap-3 w-full justify-end\">\n <np-button npSize=\"lg\" npType=\"secondary\" (click)=\"handleCancel()\">\n {{cancelText}}\n </np-button>\n <np-button\n npSize=\"lg\"\n [npType]=\"\n modalState === 'error'\n ? 'destructive'\n : modalState === 'warning'\n ? 'warning'\n : 'primary'\n \"\n [isLoading]=\"loadingOK\"\n (click)=\"handleOk()\"\n >\n {{okText}}\n </np-button>\n </div>\n </div>\n</ng-template>\n", styles: ["::ng-deep .np-modal .ant-modal-content{border-radius:8px}::ng-deep .np-modal .confirmation .np-button{width:175px}::ng-deep .ant-modal-footer{border-top:none;padding:10px 20px;border-radius:8px}::ng-deep .ant-modal-header{border-bottom:none;padding:10px 20px;border-radius:8px}::ng-deep .checkbox{align-items:center}::ng-deep .ant-modal{top:calc(50% - 100px)}\n"], dependencies: [{ kind: "ngmodule", type: NzModalModule }, { kind: "component", type: i1.NzModalComponent, selector: "nz-modal", inputs: ["nzMask", "nzMaskClosable", "nzCloseOnNavigation", "nzVisible", "nzClosable", "nzOkLoading", "nzOkDisabled", "nzCancelDisabled", "nzCancelLoading", "nzKeyboard", "nzNoAnimation", "nzCentered", "nzDraggable", "nzContent", "nzFooter", "nzZIndex", "nzWidth", "nzWrapClassName", "nzClassName", "nzStyle", "nzTitle", "nzCloseIcon", "nzMaskStyle", "nzBodyStyle", "nzOkText", "nzCancelText", "nzOkType", "nzOkDanger", "nzIconType", "nzModalType", "nzAutofocus", "nzOnOk", "nzOnCancel"], outputs: ["nzOnOk", "nzOnCancel", "nzAfterOpen", "nzAfterClose", "nzVisibleChange"], exportAs: ["nzModal"] }, { kind: "component", type: NpButtonComponent, selector: "np-button", inputs: ["npType", "npSize", "className", "isLoading", "disabled", "ngContent"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: NpTypographyComponent, selector: "np-typography", inputs: ["npType", "npSize", "npWeight", "ngContent"] }, { kind: "ngmodule", type: BasicModule }, { kind: "component", type: NpCheckboxComponent, selector: "np-checkbox", inputs: ["input", "type", "size", "npType", "isDisabled", "groupName", "label", "description", "isIndeterminate"], outputs: ["valueChange"] }] });
|
|
2492
|
+
}
|
|
2493
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: NpModalComponent, decorators: [{
|
|
2494
|
+
type: Component,
|
|
2495
|
+
args: [{ selector: 'np-modal', imports: [
|
|
2496
|
+
NzModalModule,
|
|
2497
|
+
NpButtonComponent,
|
|
2498
|
+
CommonModule,
|
|
2499
|
+
NpTypographyComponent,
|
|
2500
|
+
BasicModule,
|
|
2501
|
+
NpCheckboxComponent,
|
|
2502
|
+
], template: "<np-button (click)=\"showModal()\">\n <ng-container *ngIf=\"isTemplate(modalButton); else textTitle\">\n <ng-container *ngTemplateOutlet=\"modalButton\"></ng-container>\n </ng-container>\n <ng-template #textTitle>{{ modalButton }}</ng-template>\n</np-button>\n\n<nz-modal\n [(nzVisible)]=\"isVisible\"\n (nzOnCancel)=\"handleCancel()\"\n (nzOnOk)=\"handleOk()\"\n [nzTitle]=\"isTemplate(modalTitle) ? modalTitle : titleTemplate\"\n [nzContent]=\"modalContent || ''\"\n [nzFooter]=\"isTemplate(modalFooter) ? modalFooter : footerTemplate\"\n [nzWidth]=\"modalWidth\"\n nzClassName=\"np-modal\"\n>\n</nz-modal>\n\n<ng-template #titleTemplate>\n <ng-container *ngTemplateOutlet=\"modalType === 'confirmation' ? contentConfirmation : contentNotification\"></ng-container>\n</ng-template>\n\n<ng-template #footerTemplate>\n <ng-container *ngTemplateOutlet=\"modalType === 'confirmation' ? footerConfirmation : footerNotification\"></ng-container>\n</ng-template>\n\n<!---------------------------------------------------------------->\n\n<ng-template #contentConfirmation>\n <div class=\"flex w-full\">\n <div class=\"flex flex-col grow gap-1\">\n <img\n *ngIf=\"useIcon\"\n [src]=\"iconPath\"\n [alt]=\"modalState + ' icon'\"\n class=\"w-[48px] h-[48px]\"\n />\n <div class=\"flex flex-col gap-[4px]\">\n <np-typography npType=\"text\" npSize=\"lg\" npWeight=\"semibold\">\n {{modalTitle}}\n </np-typography>\n <ng-container *ngIf=\"isTemplate(modalDescriptions); else textDesc\">\n <ng-container *ngTemplateOutlet=\"modalDescriptions\"></ng-container>\n </ng-container>\n <ng-template #textDesc>\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"regular\" style=\"color: rgba(71, 84, 103, 1);\">\n {{modalDescriptions}}\n </np-typography>\n </ng-template>\n </div>\n </div>\n <div class=\"flex pt-3\">\n <i class=\"fa-solid fa-xmark cursor-pointer fa-xl\" (click)=\"handleCancel()\"></i>\n </div>\n </div>\n</ng-template>\n\n<ng-template #footerConfirmation>\n <div class=\"flex justify-between {{modalType}}\">\n <np-button npSize=\"lg\" npType=\"secondary\" (click)=\"handleCancel()\">\n {{cancelText}}\n </np-button>\n <np-button\n npSize=\"lg\"\n [npType]=\"\n modalState === 'error'\n ? 'destructive'\n : modalState === 'warning'\n ? 'warning'\n : 'primary'\n \"\n [isLoading]=\"loadingOK\"\n (click)=\"handleOk()\"\n >\n {{okText}}\n </np-button>\n </div>\n</ng-template>\n\n<ng-template #contentNotification>\n <div class=\"flex w-full\">\n <div class=\"flex me-3\" *ngIf=\"useIcon\">\n <img\n [src]=\"iconPath\"\n [alt]=\"modalState + ' icon'\"\n class=\"min-w-[48px] max-w-[48px] h-[48px]\"\n />\n </div>\n <div class=\"flex flex-col grow\">\n <div class=\"flex\">\n <div class=\"flex grow\">\n <np-typography npType=\"text\" npSize=\"lg\" npWeight=\"semibold\">\n {{modalTitle}}\n </np-typography>\n </div>\n <div class=\"flex pt-3\">\n <i class=\"fa-solid fa-xmark cursor-pointer fa-xl\" (click)=\"handleCancel()\"></i>\n </div>\n </div>\n <div class=\"flex grow\">\n <ng-container *ngIf=\"isTemplate(modalDescriptions); else textDesc\">\n <ng-container *ngTemplateOutlet=\"modalDescriptions\"></ng-container>\n </ng-container>\n <ng-template #textDesc>\n <np-typography npType=\"text\" npSize=\"sm\" npWeight=\"regular\" style=\"color: rgba(71, 84, 103, 1);\">\n {{modalDescriptions}}\n </np-typography>\n </ng-template>\n </div>\n </div>\n </div>\n</ng-template>\n\n<ng-template #footerNotification>\n <div class=\"flex justify-between items-center w-full\">\n <div class=\"flex w-full\" *ngIf=\"useCheckBox\">\n <np-checkbox\n type=\"checkbox\"\n size=\"sm\"\n label=\"Don\u2019t show again\"\n [input]=\"checkboxControl\"\n ></np-checkbox>\n </div>\n <div class=\"flex gap-3 w-full justify-end\">\n <np-button npSize=\"lg\" npType=\"secondary\" (click)=\"handleCancel()\">\n {{cancelText}}\n </np-button>\n <np-button\n npSize=\"lg\"\n [npType]=\"\n modalState === 'error'\n ? 'destructive'\n : modalState === 'warning'\n ? 'warning'\n : 'primary'\n \"\n [isLoading]=\"loadingOK\"\n (click)=\"handleOk()\"\n >\n {{okText}}\n </np-button>\n </div>\n </div>\n</ng-template>\n", styles: ["::ng-deep .np-modal .ant-modal-content{border-radius:8px}::ng-deep .np-modal .confirmation .np-button{width:175px}::ng-deep .ant-modal-footer{border-top:none;padding:10px 20px;border-radius:8px}::ng-deep .ant-modal-header{border-bottom:none;padding:10px 20px;border-radius:8px}::ng-deep .checkbox{align-items:center}::ng-deep .ant-modal{top:calc(50% - 100px)}\n"] }]
|
|
2503
|
+
}], propDecorators: { modalButton: [{
|
|
2504
|
+
type: Input
|
|
2505
|
+
}], modalTitle: [{
|
|
2506
|
+
type: Input
|
|
2507
|
+
}], modalDescriptions: [{
|
|
2508
|
+
type: Input
|
|
2509
|
+
}], modalType: [{
|
|
2510
|
+
type: Input
|
|
2511
|
+
}], modalState: [{
|
|
2512
|
+
type: Input
|
|
2513
|
+
}], useIcon: [{
|
|
2514
|
+
type: Input
|
|
2515
|
+
}], useCheckBox: [{
|
|
2516
|
+
type: Input
|
|
2517
|
+
}], cancelText: [{
|
|
2518
|
+
type: Input
|
|
2519
|
+
}], okText: [{
|
|
2520
|
+
type: Input
|
|
2521
|
+
}], modalContent: [{
|
|
2522
|
+
type: Input
|
|
2523
|
+
}], modalFooter: [{
|
|
2524
|
+
type: Input
|
|
2525
|
+
}], loadingOK: [{
|
|
2526
|
+
type: Input
|
|
2527
|
+
}], ok: [{
|
|
2528
|
+
type: Output
|
|
2529
|
+
}], cancel: [{
|
|
2530
|
+
type: Output
|
|
2531
|
+
}], checkbox: [{
|
|
2532
|
+
type: Output
|
|
2533
|
+
}] } });
|
|
2534
|
+
|
|
2535
|
+
class DefaultModel {
|
|
2536
|
+
/**
|
|
2537
|
+
* all keys are in lowercase
|
|
2538
|
+
* @type {{}}
|
|
2539
|
+
* @private
|
|
2540
|
+
*/
|
|
2541
|
+
_data = {};
|
|
2542
|
+
/**
|
|
2543
|
+
* all keys are raw
|
|
2544
|
+
* @type {{}}
|
|
2545
|
+
* @private
|
|
2546
|
+
*/
|
|
2547
|
+
_raw = {};
|
|
2548
|
+
_idKey = '';
|
|
2549
|
+
_id;
|
|
2550
|
+
/**
|
|
2551
|
+
*
|
|
2552
|
+
* @param _data
|
|
2553
|
+
* @param idKey
|
|
2554
|
+
* @param isAutoAssign
|
|
2555
|
+
*/
|
|
2556
|
+
constructor(_data = {}, idKey = '', isAutoAssign = false, isAssignRawData = true) {
|
|
2557
|
+
if (_data) {
|
|
2558
|
+
// set raw
|
|
2559
|
+
if (_data.hasOwnProperty('_raw')) {
|
|
2560
|
+
delete _data['_raw'];
|
|
2561
|
+
}
|
|
2562
|
+
this._raw = _data;
|
|
2563
|
+
// store data to new place
|
|
2564
|
+
for (const key of Object.keys(_data)) {
|
|
2565
|
+
this._data[key.toLowerCase()] = this._raw[key];
|
|
2566
|
+
}
|
|
2567
|
+
const self = this;
|
|
2568
|
+
// setTimeout(() => {
|
|
2569
|
+
if (isAutoAssign) {
|
|
2570
|
+
if (isAssignRawData) {
|
|
2571
|
+
Object.assign(self, self._raw);
|
|
2572
|
+
}
|
|
2573
|
+
else {
|
|
2574
|
+
Object.assign(self, self._data);
|
|
2575
|
+
}
|
|
2576
|
+
}
|
|
2577
|
+
// });
|
|
2578
|
+
}
|
|
2579
|
+
if (idKey) {
|
|
2580
|
+
// set id key
|
|
2581
|
+
this._idKey = idKey.toLowerCase();
|
|
2582
|
+
this._id = this.getId();
|
|
2583
|
+
}
|
|
2584
|
+
}
|
|
2585
|
+
/**
|
|
2586
|
+
* get value of id
|
|
2587
|
+
* @return {any}
|
|
2588
|
+
*/
|
|
2589
|
+
getId() {
|
|
2590
|
+
if (this._idKey && this._data[this._idKey]) {
|
|
2591
|
+
return this._data[this._idKey];
|
|
2592
|
+
}
|
|
2593
|
+
return null;
|
|
2594
|
+
}
|
|
2595
|
+
setId(id) {
|
|
2596
|
+
this._data[this._idKey] = id;
|
|
2597
|
+
this._id = this.getId();
|
|
2598
|
+
}
|
|
2599
|
+
/**
|
|
2600
|
+
* delete object property
|
|
2601
|
+
* @param key: string
|
|
2602
|
+
*/
|
|
2603
|
+
deleteProperty(key) {
|
|
2604
|
+
const self = this;
|
|
2605
|
+
if (!!self?.key) {
|
|
2606
|
+
delete self[key];
|
|
2607
|
+
}
|
|
2608
|
+
}
|
|
2609
|
+
/**
|
|
2610
|
+
* get key of id
|
|
2611
|
+
* @returns {string}
|
|
2612
|
+
*/
|
|
2613
|
+
getIdKey() {
|
|
2614
|
+
return this._idKey || '';
|
|
2615
|
+
}
|
|
2616
|
+
/**
|
|
2617
|
+
* get value of _data by key
|
|
2618
|
+
* @param key: string
|
|
2619
|
+
* @returns {any}
|
|
2620
|
+
*/
|
|
2621
|
+
getValue(key) {
|
|
2622
|
+
return this._data[key.toLowerCase()];
|
|
2623
|
+
}
|
|
2624
|
+
/**
|
|
2625
|
+
* set value of _data by key & value of this object's attribute if existed
|
|
2626
|
+
* @param key: string
|
|
2627
|
+
* @param value: string
|
|
2628
|
+
* @returns {any}
|
|
2629
|
+
*/
|
|
2630
|
+
setValue(key, value) {
|
|
2631
|
+
const self = this;
|
|
2632
|
+
if (self.hasOwnProperty(key)) {
|
|
2633
|
+
self[key] = value;
|
|
2634
|
+
}
|
|
2635
|
+
return (this._data[key.toLowerCase()] = value);
|
|
2636
|
+
}
|
|
2637
|
+
/**
|
|
2638
|
+
* get raw value of _data by key
|
|
2639
|
+
* @param key: string
|
|
2640
|
+
* @returns {any}
|
|
2641
|
+
*/
|
|
2642
|
+
getRawValue(key) {
|
|
2643
|
+
return this._raw[key];
|
|
2644
|
+
}
|
|
2645
|
+
/**
|
|
2646
|
+
* set value of _data by key
|
|
2647
|
+
* @param key: string
|
|
2648
|
+
* @param value: string
|
|
2649
|
+
* @returns {any}
|
|
2650
|
+
*/
|
|
2651
|
+
setRawValue(key, value) {
|
|
2652
|
+
return (this._raw[key] = value);
|
|
2653
|
+
}
|
|
2654
|
+
/*STATIC*/
|
|
2655
|
+
static describe(instance) {
|
|
2656
|
+
return Object.getOwnPropertyNames(instance)?.filter((x) => !x.startsWith('_'));
|
|
2657
|
+
}
|
|
2658
|
+
}
|
|
2659
|
+
|
|
2660
|
+
/*
|
|
2661
|
+
* Public API Surface of neop-ui-lib
|
|
2662
|
+
*/
|
|
2663
|
+
// export service
|
|
2664
|
+
|
|
2665
|
+
/**
|
|
2666
|
+
* Generated bundle index. Do not edit.
|
|
2667
|
+
*/
|
|
2668
|
+
|
|
2669
|
+
export { DefaultModel, ETypeNpBreadcrumb, E_NP_BREADCRUMB, FORM_ERROR_MAP, NeopComponentModule, NpActionBarComponent, NpAlertComponent, NpBreadcrumbComponent, NpButtonComponent, NpCheckboxComponent, NpDialogService, NpDropdownsComponent, NpInputFieldComponent, NpInputMode, NpInputTexteraComponent, NpLoadingIndicatorComponent, NpModalComponent, NpMode, NpPaginationComponent, NpProgressBarComponent, NpResizeComponent, NpScrollbarComponent, NpSelectComponent, NpSliderComponent, NpTabComponent, NpTableComponent, NpToggleComponent, NpTooltipComponent, NpTreeComponent, NpTypographyComponent, TestService, ThemeService };
|
|
2670
|
+
//# sourceMappingURL=neoprototype-neop-ui-lib.mjs.map
|