@elite.framework/ng.ui.core 1.0.55 → 1.0.57
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/collapsible/README.md +3 -0
- package/collapsible/index.d.ts +18 -0
- package/fesm2022/elite.framework-ng.ui.core-collapsible.mjs +86 -0
- package/fesm2022/elite.framework-ng.ui.core-collapsible.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.ui.core-datepicker.mjs +300 -117
- package/fesm2022/elite.framework-ng.ui.core-datepicker.mjs.map +1 -1
- package/fesm2022/elite.framework-ng.ui.core-formly-ui-all.mjs +37 -1
- package/fesm2022/elite.framework-ng.ui.core-formly-ui-all.mjs.map +1 -1
- package/fesm2022/elite.framework-ng.ui.core-generic-crud-table.mjs +2 -2
- package/fesm2022/elite.framework-ng.ui.core-generic-crud-table.mjs.map +1 -1
- package/fesm2022/elite.framework-ng.ui.core-generic-table.mjs +2 -2
- package/fesm2022/elite.framework-ng.ui.core-generic-table.mjs.map +1 -1
- package/fesm2022/elite.framework-ng.ui.core-tag-type.mjs +6 -2
- package/fesm2022/elite.framework-ng.ui.core-tag-type.mjs.map +1 -1
- package/formly-ui-all/index.d.ts +2 -1
- package/package.json +38 -34
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import * as i1 from '@angular/common';
|
|
3
|
+
import { FieldWrapper } from '@ngx-formly/core';
|
|
4
|
+
|
|
5
|
+
declare class CollapsibleModule {
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CollapsibleModule, never>;
|
|
7
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<CollapsibleModule, never, [typeof i1.CommonModule], never>;
|
|
8
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<CollapsibleModule>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare class CollapsibleWrapper extends FieldWrapper {
|
|
12
|
+
isCollapsed: boolean;
|
|
13
|
+
toggleCollapse(): void;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CollapsibleWrapper, never>;
|
|
15
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CollapsibleWrapper, "formly-wrapper-collapsible", never, {}, {}, never, never, true, never>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { CollapsibleModule, CollapsibleWrapper };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { NgModule, Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import { FieldWrapper, FormlyModule } from '@ngx-formly/core';
|
|
6
|
+
|
|
7
|
+
class CollapsibleModule {
|
|
8
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: CollapsibleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
9
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.8", ngImport: i0, type: CollapsibleModule, imports: [CommonModule] });
|
|
10
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: CollapsibleModule, imports: [CommonModule] });
|
|
11
|
+
}
|
|
12
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: CollapsibleModule, decorators: [{
|
|
13
|
+
type: NgModule,
|
|
14
|
+
args: [{
|
|
15
|
+
imports: [CommonModule],
|
|
16
|
+
}]
|
|
17
|
+
}] });
|
|
18
|
+
|
|
19
|
+
class CollapsibleWrapper extends FieldWrapper {
|
|
20
|
+
isCollapsed = true;
|
|
21
|
+
toggleCollapse() {
|
|
22
|
+
this.isCollapsed = !this.isCollapsed;
|
|
23
|
+
}
|
|
24
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: CollapsibleWrapper, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
25
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.8", type: CollapsibleWrapper, isStandalone: true, selector: "formly-wrapper-collapsible", usesInheritance: true, ngImport: i0, template: `
|
|
26
|
+
<div class="w-full flex flex-col rounded-lg shadow-md overflow-hidden border border-gray-300 bg-white">
|
|
27
|
+
<!-- Header -->
|
|
28
|
+
<div
|
|
29
|
+
class="flex items-center p-4 bg-gray-50 border-b border-gray-200 cursor-pointer transition duration-200 hover:bg-gray-100"
|
|
30
|
+
(click)="toggleCollapse()"
|
|
31
|
+
>
|
|
32
|
+
<div class="flex items-center gap-2">
|
|
33
|
+
<i *ngIf="props['icon']" class="{{ props['icon'] }} text-blue-500 text-lg"></i>
|
|
34
|
+
<span class="text-lg font-semibold text-gray-700">{{ props.label }}</span>
|
|
35
|
+
</div>
|
|
36
|
+
<i
|
|
37
|
+
class="pi mr-auto text-gray-600 text-xl transition-transform duration-300"
|
|
38
|
+
[ngClass]="{ 'pi-angle-up': !isCollapsed, 'pi-angle-down': isCollapsed }"
|
|
39
|
+
></i>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<!-- Body -->
|
|
43
|
+
<div [ngClass]="{ hidden: isCollapsed, 'p-6': !isCollapsed }">
|
|
44
|
+
<ng-container #fieldComponent></ng-container>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormlyModule }] });
|
|
48
|
+
}
|
|
49
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: CollapsibleWrapper, decorators: [{
|
|
50
|
+
type: Component,
|
|
51
|
+
args: [{
|
|
52
|
+
selector: 'formly-wrapper-collapsible',
|
|
53
|
+
standalone: true,
|
|
54
|
+
imports: [CommonModule, FormlyModule],
|
|
55
|
+
template: `
|
|
56
|
+
<div class="w-full flex flex-col rounded-lg shadow-md overflow-hidden border border-gray-300 bg-white">
|
|
57
|
+
<!-- Header -->
|
|
58
|
+
<div
|
|
59
|
+
class="flex items-center p-4 bg-gray-50 border-b border-gray-200 cursor-pointer transition duration-200 hover:bg-gray-100"
|
|
60
|
+
(click)="toggleCollapse()"
|
|
61
|
+
>
|
|
62
|
+
<div class="flex items-center gap-2">
|
|
63
|
+
<i *ngIf="props['icon']" class="{{ props['icon'] }} text-blue-500 text-lg"></i>
|
|
64
|
+
<span class="text-lg font-semibold text-gray-700">{{ props.label }}</span>
|
|
65
|
+
</div>
|
|
66
|
+
<i
|
|
67
|
+
class="pi mr-auto text-gray-600 text-xl transition-transform duration-300"
|
|
68
|
+
[ngClass]="{ 'pi-angle-up': !isCollapsed, 'pi-angle-down': isCollapsed }"
|
|
69
|
+
></i>
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<!-- Body -->
|
|
73
|
+
<div [ngClass]="{ hidden: isCollapsed, 'p-6': !isCollapsed }">
|
|
74
|
+
<ng-container #fieldComponent></ng-container>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
`,
|
|
78
|
+
}]
|
|
79
|
+
}] });
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Generated bundle index. Do not edit.
|
|
83
|
+
*/
|
|
84
|
+
|
|
85
|
+
export { CollapsibleModule, CollapsibleWrapper };
|
|
86
|
+
//# sourceMappingURL=elite.framework-ng.ui.core-collapsible.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elite.framework-ng.ui.core-collapsible.mjs","sources":["../tmp-esm2022/collapsible/lib/collapsible-module.js","../tmp-esm2022/collapsible/lib/collapsible-wrapper.js","../tmp-esm2022/collapsible/elite.framework-ng.ui.core-collapsible.js"],"sourcesContent":["import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport * as i0 from \"@angular/core\";\nexport class CollapsibleModule {\n static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"20.1.8\", ngImport: i0, type: CollapsibleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });\n static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"14.0.0\", version: \"20.1.8\", ngImport: i0, type: CollapsibleModule, imports: [CommonModule] });\n static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"20.1.8\", ngImport: i0, type: CollapsibleModule, imports: [CommonModule] });\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"20.1.8\", ngImport: i0, type: CollapsibleModule, decorators: [{\n type: NgModule,\n args: [{\n imports: [CommonModule],\n }]\n }] });\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29sbGFwc2libGUtbW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9uZy51aS5jb3JlL2NvbGxhcHNpYmxlL3NyYy9saWIvY29sbGFwc2libGUtbW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDekMsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLGlCQUFpQixDQUFDOztBQUsvQyxNQUFNLE9BQU8saUJBQWlCO3VHQUFqQixpQkFBaUI7d0dBQWpCLGlCQUFpQixZQUZsQixZQUFZO3dHQUVYLGlCQUFpQixZQUZsQixZQUFZOzsyRkFFWCxpQkFBaUI7a0JBSDdCLFFBQVE7bUJBQUM7b0JBQ1IsT0FBTyxFQUFFLENBQUMsWUFBWSxDQUFDO2lCQUN4QiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IE5nTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQgeyBDb21tb25Nb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jb21tb24nO1xuXG5ATmdNb2R1bGUoe1xuICBpbXBvcnRzOiBbQ29tbW9uTW9kdWxlXSxcbn0pXG5leHBvcnQgY2xhc3MgQ29sbGFwc2libGVNb2R1bGUge31cbiJdfQ==","import { Component } from '@angular/core';\nimport { FieldWrapper, FormlyModule } from '@ngx-formly/core';\nimport { CommonModule } from '@angular/common';\nimport * as i0 from \"@angular/core\";\nimport * as i1 from \"@angular/common\";\nexport class CollapsibleWrapper extends FieldWrapper {\n isCollapsed = true;\n toggleCollapse() {\n this.isCollapsed = !this.isCollapsed;\n }\n static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"20.1.8\", ngImport: i0, type: CollapsibleWrapper, deps: null, target: i0.ɵɵFactoryTarget.Component });\n static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"14.0.0\", version: \"20.1.8\", type: CollapsibleWrapper, isStandalone: true, selector: \"formly-wrapper-collapsible\", usesInheritance: true, ngImport: i0, template: `\r\n <div class=\"w-full flex flex-col rounded-lg shadow-md overflow-hidden border border-gray-300 bg-white\">\r\n <!-- Header -->\r\n <div\r\n class=\"flex items-center p-4 bg-gray-50 border-b border-gray-200 cursor-pointer transition duration-200 hover:bg-gray-100\"\r\n (click)=\"toggleCollapse()\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n <i *ngIf=\"props['icon']\" class=\"{{ props['icon'] }} text-blue-500 text-lg\"></i>\r\n <span class=\"text-lg font-semibold text-gray-700\">{{ props.label }}</span>\r\n </div>\r\n <i\r\n class=\"pi mr-auto text-gray-600 text-xl transition-transform duration-300\"\r\n [ngClass]=\"{ 'pi-angle-up': !isCollapsed, 'pi-angle-down': isCollapsed }\"\r\n ></i>\r\n </div>\r\n\r\n <!-- Body -->\r\n <div [ngClass]=\"{ hidden: isCollapsed, 'p-6': !isCollapsed }\">\r\n <ng-container #fieldComponent></ng-container>\r\n </div>\r\n </div>\r\n `, isInline: true, dependencies: [{ kind: \"ngmodule\", type: CommonModule }, { kind: \"directive\", type: i1.NgClass, selector: \"[ngClass]\", inputs: [\"class\", \"ngClass\"] }, { kind: \"directive\", type: i1.NgIf, selector: \"[ngIf]\", inputs: [\"ngIf\", \"ngIfThen\", \"ngIfElse\"] }, { kind: \"ngmodule\", type: FormlyModule }] });\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"20.1.8\", ngImport: i0, type: CollapsibleWrapper, decorators: [{\n type: Component,\n args: [{\n selector: 'formly-wrapper-collapsible',\n standalone: true,\n imports: [CommonModule, FormlyModule],\n template: `\r\n <div class=\"w-full flex flex-col rounded-lg shadow-md overflow-hidden border border-gray-300 bg-white\">\r\n <!-- Header -->\r\n <div\r\n class=\"flex items-center p-4 bg-gray-50 border-b border-gray-200 cursor-pointer transition duration-200 hover:bg-gray-100\"\r\n (click)=\"toggleCollapse()\"\r\n >\r\n <div class=\"flex items-center gap-2\">\r\n <i *ngIf=\"props['icon']\" class=\"{{ props['icon'] }} text-blue-500 text-lg\"></i>\r\n <span class=\"text-lg font-semibold text-gray-700\">{{ props.label }}</span>\r\n </div>\r\n <i\r\n class=\"pi mr-auto text-gray-600 text-xl transition-transform duration-300\"\r\n [ngClass]=\"{ 'pi-angle-up': !isCollapsed, 'pi-angle-down': isCollapsed }\"\r\n ></i>\r\n </div>\r\n\r\n <!-- Body -->\r\n <div [ngClass]=\"{ hidden: isCollapsed, 'p-6': !isCollapsed }\">\r\n <ng-container #fieldComponent></ng-container>\r\n </div>\r\n </div>\r\n `,\n }]\n }] });\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29sbGFwc2libGUtd3JhcHBlci5qcyIsInNvdXJjZVJvb3QiOi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hc3M9XCJwaSBtci1hdXRvIHRleHQtZ3JheS02MDAgdGV4dC14bCB0cmFuc2l0aW9uLXRyYW5zZm9ybSBkdXJhdGlvbi0zMDBcIlxyXG4gICAgICAgICAgW25nQ2xhc3NdPVwieyAncGktYW5nbGUtdXAnOiAhaXNDb2xsYXBzZWQsICdwaS1hbmdsZS1kb3duJzogaXNDb2xsYXBzZWQgfVwiXHJcbiAgICAgICAgPjwvaT5cclxuICAgICAgPC9kaXY+XHJcblxyXG4gICAgICA8IS0tIEJvZHkgLS0+XHJcbiAgICAgIDxkaXYgW25nQ2xhc3NdPVwieyBoaWRkZW46IGlzQ29sbGFwc2VkLCAncC02JzogIWlzQ29sbGFwc2VkIH1cIj5cclxuICAgICAgICA8bmctY29udGFpbmVyICNmaWVsZENvbXBvbmVudD48L25nLWNvbnRhaW5lcj5cclxuICAgICAgPC9kaXY+XHJcbiAgICA8L2Rpdj5cclxuICBgLFxyXG59KVxyXG5leHBvcnQgY2xhc3MgQ29sbGFwc2libGVXcmFwcGVyIGV4dGVuZHMgRmllbGRXcmFwcGVyIHtcclxuICBpc0NvbGxhcHNlZCA9IHRydWU7XHJcblxyXG4gIHRvZ2dsZUNvbGxhcHNlKCkge1xyXG4gICAgdGhpcy5pc0NvbGxhcHNlZCA9ICF0aGlzLmlzQ29sbGFwc2VkO1xyXG4gIH1cclxufVxyXG4iXX0=","/**\n * Generated bundle index. Do not edit.\n */\nexport * from './index';\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWxpdGUuZnJhbWV3b3JrLW5nLnVpLmNvcmUtY29sbGFwc2libGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL25nLnVpLmNvcmUvY29sbGFwc2libGUvc3JjL2VsaXRlLmZyYW1ld29yay1uZy51aS5jb3JlLWNvbGxhcHNpYmxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU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,YAAY,EAAE,CAAC,EAAE,CAAC;AAC5T;AACA,EAAE,CAAC,wBAAwB,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,kBAAkB,EAAE,UAAU,EAAE,CAAC;AAC5H,YAAY,IAAI,EAAE,SAAS;AAC3B,YAAY,IAAI,EAAE,CAAC;AACnB,oBAAoB,QAAQ,EAAE,4BAA4B;AAC1D,oBAAoB,UAAU,EAAE,IAAI;AACpC,oBAAoB,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;AACzD,oBAAoB,QAAQ,EAAE,CAAC;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,CAAC;AACH,iBAAiB;AACjB,SAAS,CAAC,EAAE,CAAC;;ACjEb;AACA;AACA;;;;"}
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { NgModule,
|
|
2
|
+
import { NgModule, Component } from '@angular/core';
|
|
3
|
+
import * as i2 from '@angular/common';
|
|
3
4
|
import { CommonModule } from '@angular/common';
|
|
4
5
|
import * as i1$1 from '@ngx-formly/core';
|
|
5
|
-
import { FieldType,
|
|
6
|
-
import { FormlyFormFieldModule } from '@elite.framework/ng.ui.core/form-field';
|
|
6
|
+
import { FieldType, FormlyModule } from '@ngx-formly/core';
|
|
7
7
|
import * as i1 from '@angular/forms';
|
|
8
|
-
import { ReactiveFormsModule } from '@angular/forms';
|
|
9
|
-
import * as
|
|
8
|
+
import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
9
|
+
import * as i3 from 'primeng/datepicker';
|
|
10
10
|
import { DatePickerModule } from 'primeng/datepicker';
|
|
11
|
-
import * as
|
|
11
|
+
import * as i4 from 'primeng/button';
|
|
12
|
+
import { ButtonModule } from 'primeng/button';
|
|
13
|
+
import * as i5 from 'primeng/inputtext';
|
|
14
|
+
import { InputTextModule } from 'primeng/inputtext';
|
|
15
|
+
import * as i6 from 'primeng/dialog';
|
|
16
|
+
import { DialogModule } from 'primeng/dialog';
|
|
17
|
+
import * as i7 from '@ngx-translate/core';
|
|
12
18
|
import { TranslateModule } from '@ngx-translate/core';
|
|
19
|
+
import { FormlyFormFieldModule } from '@elite.framework/ng.ui.core/form-field';
|
|
13
20
|
|
|
14
21
|
class DatepickerModule {
|
|
15
22
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: DatepickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -24,139 +31,315 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImpor
|
|
|
24
31
|
}] });
|
|
25
32
|
|
|
26
33
|
class FormlyFieldDatepicker extends FieldType {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
dialogVisible = false;
|
|
35
|
+
get mode() {
|
|
36
|
+
return this.props['mode'] || 'date';
|
|
37
|
+
}
|
|
38
|
+
dateControl = new FormControl(null);
|
|
39
|
+
timeControl = new FormControl(null);
|
|
40
|
+
ampmControl = new FormControl('AM');
|
|
41
|
+
get displayValue() {
|
|
42
|
+
const datePart = this.dateControl.value ? this.dateControl.value.toLocaleDateString() : '';
|
|
43
|
+
const timePart = this.timeControl.value && this.mode !== 'date'
|
|
44
|
+
? `${this.timeControl.value} ${this.ampmControl.value}`
|
|
45
|
+
: '';
|
|
46
|
+
if (this.mode === 'date')
|
|
47
|
+
return datePart;
|
|
48
|
+
if (this.mode === 'time')
|
|
49
|
+
return timePart;
|
|
50
|
+
if (this.mode === 'datetime')
|
|
51
|
+
return datePart && timePart ? `${datePart} ${timePart}` : datePart || timePart || '';
|
|
52
|
+
return '';
|
|
53
|
+
}
|
|
32
54
|
ngOnInit() {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const parsed = new Date(value);
|
|
37
|
-
if (!isNaN(parsed.getTime())) {
|
|
38
|
-
this.formControl.setValue(parsed, { emitEvent: false });
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
// Convert back to string when user selects date (if needed)
|
|
42
|
-
this.formControl.valueChanges.subscribe(val => {
|
|
43
|
-
if (val instanceof Date && this.props?.dataType === 'string') {
|
|
44
|
-
const pad = (n) => n.toString().padStart(2, '0');
|
|
45
|
-
const year = val.getFullYear();
|
|
46
|
-
const month = pad(val.getMonth() + 1); // months are 0-based
|
|
47
|
-
const day = pad(val.getDate());
|
|
48
|
-
let result = `${year}-${month}-${day}`;
|
|
49
|
-
if (this.props?.showTime) {
|
|
50
|
-
const hours = pad(val.getHours());
|
|
51
|
-
const minutes = pad(val.getMinutes());
|
|
52
|
-
const seconds = pad(val.getSeconds());
|
|
53
|
-
result += `T${hours}:${minutes}:${seconds}`;
|
|
54
|
-
}
|
|
55
|
-
if (this.formControl.value !== result) {
|
|
56
|
-
this.formControl.setValue(result, { emitEvent: false });
|
|
57
|
-
}
|
|
58
|
-
}
|
|
55
|
+
this.setInitialValue(this.formControl.value);
|
|
56
|
+
this.formControl.valueChanges.subscribe((value) => {
|
|
57
|
+
this.setInitialValue(value);
|
|
59
58
|
});
|
|
60
59
|
}
|
|
61
|
-
|
|
62
|
-
if (
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
60
|
+
setInitialValue(value) {
|
|
61
|
+
if (!value)
|
|
62
|
+
return;
|
|
63
|
+
if (this.mode !== 'time') {
|
|
64
|
+
// parse date part
|
|
65
|
+
const dateStr = value.split('T')[0];
|
|
66
|
+
const dt = new Date(dateStr);
|
|
67
|
+
if (!isNaN(dt.getTime()))
|
|
68
|
+
this.dateControl.setValue(dt, { emitEvent: false });
|
|
67
69
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
+
if (this.mode !== 'date') {
|
|
71
|
+
// parse time part
|
|
72
|
+
let timeStr = '';
|
|
73
|
+
if (this.mode === 'time') {
|
|
74
|
+
timeStr = value;
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
const tPart = value.split('T')[1];
|
|
78
|
+
if (tPart)
|
|
79
|
+
timeStr = tPart.substring(0, 5); // hh:mm
|
|
80
|
+
}
|
|
81
|
+
if (timeStr) {
|
|
82
|
+
const [hourStr, minuteStr] = timeStr.split(':');
|
|
83
|
+
let hours = parseInt(hourStr ?? '12', 10);
|
|
84
|
+
const minutes = parseInt(minuteStr ?? '0', 10);
|
|
85
|
+
const ampm = hours >= 12 ? 'PM' : 'AM';
|
|
86
|
+
hours = hours % 12 || 12;
|
|
87
|
+
this.timeControl.setValue(`${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}`, { emitEvent: false });
|
|
88
|
+
this.ampmControl.setValue(ampm, { emitEvent: false });
|
|
89
|
+
}
|
|
70
90
|
}
|
|
71
91
|
}
|
|
72
|
-
|
|
73
|
-
this.
|
|
92
|
+
openDialog() {
|
|
93
|
+
this.dialogVisible = true;
|
|
94
|
+
}
|
|
95
|
+
saveDialog() {
|
|
96
|
+
this.updateModel();
|
|
97
|
+
this.dialogVisible = false;
|
|
98
|
+
}
|
|
99
|
+
onDateChange() {
|
|
100
|
+
this.updateModel();
|
|
74
101
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
102
|
+
onTimeInput(event) {
|
|
103
|
+
if (this.mode === 'date')
|
|
104
|
+
return;
|
|
105
|
+
let input = event.target.value;
|
|
106
|
+
input = input.replace(/\D/g, '');
|
|
107
|
+
if (input.length > 2)
|
|
108
|
+
input = input.slice(0, 2) + ':' + input.slice(2, 4);
|
|
109
|
+
input = input.slice(0, 5);
|
|
110
|
+
this.timeControl.setValue(input, { emitEvent: false });
|
|
81
111
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
112
|
+
onTimeChange() {
|
|
113
|
+
if (this.mode === 'date')
|
|
114
|
+
return;
|
|
115
|
+
const value = this.timeControl.value;
|
|
116
|
+
if (!value)
|
|
117
|
+
return;
|
|
118
|
+
let [hourStr, minuteStr] = value.split(':');
|
|
119
|
+
let hours = parseInt(hourStr ?? '12', 10);
|
|
120
|
+
let minutes = parseInt(minuteStr ?? '0', 10);
|
|
121
|
+
if (isNaN(hours) || hours < 1)
|
|
122
|
+
hours = 1;
|
|
123
|
+
if (hours > 12)
|
|
124
|
+
hours = 12;
|
|
125
|
+
if (isNaN(minutes) || minutes < 0)
|
|
126
|
+
minutes = 0;
|
|
127
|
+
if (minutes > 59)
|
|
128
|
+
minutes = 59;
|
|
129
|
+
this.timeControl.setValue(`${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}`);
|
|
130
|
+
}
|
|
131
|
+
toggleAmPm() {
|
|
132
|
+
this.ampmControl.setValue(this.ampmControl.value === 'AM' ? 'PM' : 'AM');
|
|
133
|
+
}
|
|
134
|
+
updateModel() {
|
|
135
|
+
const dateVal = this.dateControl.value;
|
|
136
|
+
const timeVal = this.timeControl.value;
|
|
137
|
+
const ampm = this.ampmControl.value ?? 'AM';
|
|
138
|
+
if (this.mode === 'date') {
|
|
139
|
+
if (dateVal) {
|
|
140
|
+
const val = `${dateVal.getFullYear()}-${(dateVal.getMonth() + 1).toString().padStart(2, '0')}-${dateVal.getDate().toString().padStart(2, '0')}`;
|
|
141
|
+
this.formControl.setValue(val);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
else if (this.mode === 'time') {
|
|
145
|
+
if (timeVal)
|
|
146
|
+
this.formControl.setValue(`${timeVal} ${ampm}`);
|
|
147
|
+
}
|
|
148
|
+
else if (this.mode === 'datetime') {
|
|
149
|
+
if (dateVal && timeVal) {
|
|
150
|
+
let [hoursStr, minutesStr] = timeVal.split(':');
|
|
151
|
+
let hours = parseInt(hoursStr ?? '12', 10);
|
|
152
|
+
const minutes = parseInt(minutesStr ?? '0', 10);
|
|
153
|
+
if (ampm === 'PM' && hours < 12)
|
|
154
|
+
hours += 12;
|
|
155
|
+
if (ampm === 'AM' && hours === 12)
|
|
156
|
+
hours = 0;
|
|
157
|
+
const dt = new Date(dateVal);
|
|
158
|
+
dt.setHours(hours, minutes, 0, 0);
|
|
159
|
+
const val = `${dt.getFullYear()}-${(dt.getMonth() + 1).toString().padStart(2, '0')}-${dt.getDate().toString().padStart(2, '0')}T${dt.getHours().toString().padStart(2, '0')}:${dt.getMinutes().toString().padStart(2, '0')}:00`;
|
|
160
|
+
this.formControl.setValue(val);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
91
163
|
}
|
|
92
164
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: FormlyFieldDatepicker, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
93
165
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.8", type: FormlyFieldDatepicker, isStandalone: true, selector: "formly-field-primeng-datepicker", usesInheritance: true, ngImport: i0, template: `
|
|
94
|
-
<
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
166
|
+
<div class="w-full">
|
|
167
|
+
<span class="p-inputgroup">
|
|
168
|
+
<p-datepicker
|
|
169
|
+
*ngIf="mode === 'date'"
|
|
170
|
+
[(ngModel)]="dateControl.value"
|
|
171
|
+
[formControl]="dateControl"
|
|
172
|
+
dateFormat="yy-mm-dd"
|
|
173
|
+
[showIcon]="true"
|
|
174
|
+
inputId="buttondisplay"
|
|
175
|
+
[showOnFocus]="false"
|
|
176
|
+
appendTo="body"
|
|
177
|
+
class="flex-1 min-w-0"
|
|
178
|
+
(onSelect)="onDateChange()"
|
|
179
|
+
></p-datepicker>
|
|
180
|
+
<input
|
|
181
|
+
*ngIf="mode !== 'date'"
|
|
182
|
+
pInputText
|
|
183
|
+
readonly
|
|
184
|
+
[value]="displayValue"
|
|
185
|
+
class="flex-1 cursor-pointer bg-white border rounded-l-lg px-3 py-2"
|
|
186
|
+
/>
|
|
187
|
+
<button
|
|
188
|
+
*ngIf="mode !== 'date'"
|
|
189
|
+
style="padding: initial;"
|
|
190
|
+
pButton
|
|
191
|
+
type="button"
|
|
192
|
+
pRipple
|
|
193
|
+
icon="pi pi-calendar"
|
|
194
|
+
class="rounded-r-lg"
|
|
195
|
+
(click)="openDialog()"
|
|
196
|
+
></button>
|
|
197
|
+
</span>
|
|
198
|
+
</div>
|
|
199
|
+
|
|
200
|
+
<p-dialog [header]="'Select Date & Time' | translate" [(visible)]="dialogVisible" [modal]="false" [closable]="true">
|
|
201
|
+
<div class="flex flex-row items-center w-full gap-2 rounded-xl p-2">
|
|
202
|
+
<!-- Date Picker -->
|
|
203
|
+
<p-datepicker
|
|
204
|
+
*ngIf="mode !== 'time'"
|
|
205
|
+
[(ngModel)]="dateControl.value"
|
|
206
|
+
[formControl]="dateControl"
|
|
207
|
+
dateFormat="yy-mm-dd"
|
|
208
|
+
[showIcon]="true"
|
|
209
|
+
inputId="buttondisplay"
|
|
210
|
+
[showOnFocus]="false"
|
|
211
|
+
appendTo="body"
|
|
212
|
+
class="flex-1 min-w-0"
|
|
213
|
+
(onSelect)="onDateChange()"
|
|
214
|
+
></p-datepicker>
|
|
215
|
+
|
|
216
|
+
<!-- Time Input -->
|
|
217
|
+
<div *ngIf="mode !== 'date'" class="flex items-center gap-1">
|
|
218
|
+
<input
|
|
219
|
+
pInputText
|
|
220
|
+
type="text"
|
|
221
|
+
placeholder="hh:mm"
|
|
222
|
+
maxlength="5"
|
|
223
|
+
[formControl]="timeControl"
|
|
224
|
+
(input)="onTimeInput($event)"
|
|
225
|
+
(blur)="onTimeChange()"
|
|
226
|
+
class="w-20 text-center font-mono border rounded-lg px-3 py-2"
|
|
227
|
+
/>
|
|
228
|
+
|
|
229
|
+
<!-- AM/PM Toggle -->
|
|
230
|
+
<button
|
|
231
|
+
pButton
|
|
232
|
+
type="button"
|
|
233
|
+
class="rounded-lg border px-3 py-1.5 shadow-sm bg-gray-100 text-sm font-semibold text-gray-800"
|
|
234
|
+
(click)="toggleAmPm()"
|
|
235
|
+
[label]="ampmControl.value ?? 'AM'"
|
|
236
|
+
></button>
|
|
237
|
+
</div>
|
|
238
|
+
</div>
|
|
239
|
+
|
|
240
|
+
<ng-template #footer>
|
|
241
|
+
<button pButton type="button" [label]="'CANCEL' | translate" class="p-button-text" (click)="dialogVisible = false"></button>
|
|
242
|
+
<button pButton type="button" [label]="'SAVE' | translate" (click)="saveDialog()"></button>
|
|
243
|
+
</ng-template>
|
|
244
|
+
</p-dialog>
|
|
245
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: DatePickerModule }, { kind: "component", type: i3.DatePicker, selector: "p-datePicker, p-datepicker, p-date-picker", inputs: ["iconDisplay", "styleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "readonlyInput", "shortYearCutoff", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "minDate", "maxDate", "disabledDates", "disabledDays", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "view", "defaultDate", "appendTo"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i4.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "fluid", "label", "icon", "buttonProps"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i5.InputText, selector: "[pInputText]", inputs: ["pSize", "variant", "fluid", "invalid"] }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: i6.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "appendTo", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i7.TranslatePipe, name: "translate" }] });
|
|
119
246
|
}
|
|
120
247
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: FormlyFieldDatepicker, decorators: [{
|
|
121
248
|
type: Component,
|
|
122
249
|
args: [{
|
|
123
250
|
selector: 'formly-field-primeng-datepicker',
|
|
124
|
-
template: `
|
|
125
|
-
<p-datepicker
|
|
126
|
-
[dataType]="props.dataType ?? 'string'"
|
|
127
|
-
[dateFormat]="props.dateFormat ?? (props.showTime ? 'yy-mm-dd' : 'yy-mm-dd')"
|
|
128
|
-
[hourFormat]="props.hourFormat || '12'"
|
|
129
|
-
[timeOnly]="props.timeOnly || false"
|
|
130
|
-
[icon]="props.icon"
|
|
131
|
-
[showTime]="props.showTime || false"
|
|
132
|
-
[showIcon]="props.showIcon || true"
|
|
133
|
-
[showButtonBar]="props.showButtonBar"
|
|
134
|
-
[showOtherMonths]="props.showOtherMonths"
|
|
135
|
-
[selectOtherMonths]="props.selectOtherMonths"
|
|
136
|
-
[selectionMode]="props.selectionMode || 'single'"
|
|
137
|
-
[numberOfMonths]="props.numberOfMonths || 0"
|
|
138
|
-
[inline]="props.inline"
|
|
139
|
-
[readonlyInput]="props.readonlyInput"
|
|
140
|
-
[touchUI]="props.touchUI"
|
|
141
|
-
[formControl]="formControl"
|
|
142
|
-
[formlyAttributes]="field"
|
|
143
|
-
[placeholder]="(props['placeholder'] ?? '') | translate"
|
|
144
|
-
[styleClass]="'w-full rounded-none block text-base'"
|
|
145
|
-
appendTo="body"
|
|
146
|
-
(onSelect)="onDateSelect($event)"
|
|
147
|
-
(onBlur)="onTouched()"
|
|
148
|
-
></p-datepicker>
|
|
149
|
-
`,
|
|
150
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
151
251
|
standalone: true,
|
|
152
252
|
imports: [
|
|
253
|
+
FormsModule,
|
|
153
254
|
CommonModule,
|
|
154
255
|
ReactiveFormsModule,
|
|
155
256
|
DatePickerModule,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
257
|
+
ButtonModule,
|
|
258
|
+
InputTextModule,
|
|
259
|
+
DialogModule,
|
|
260
|
+
TranslateModule
|
|
159
261
|
],
|
|
262
|
+
template: `
|
|
263
|
+
<div class="w-full">
|
|
264
|
+
<span class="p-inputgroup">
|
|
265
|
+
<p-datepicker
|
|
266
|
+
*ngIf="mode === 'date'"
|
|
267
|
+
[(ngModel)]="dateControl.value"
|
|
268
|
+
[formControl]="dateControl"
|
|
269
|
+
dateFormat="yy-mm-dd"
|
|
270
|
+
[showIcon]="true"
|
|
271
|
+
inputId="buttondisplay"
|
|
272
|
+
[showOnFocus]="false"
|
|
273
|
+
appendTo="body"
|
|
274
|
+
class="flex-1 min-w-0"
|
|
275
|
+
(onSelect)="onDateChange()"
|
|
276
|
+
></p-datepicker>
|
|
277
|
+
<input
|
|
278
|
+
*ngIf="mode !== 'date'"
|
|
279
|
+
pInputText
|
|
280
|
+
readonly
|
|
281
|
+
[value]="displayValue"
|
|
282
|
+
class="flex-1 cursor-pointer bg-white border rounded-l-lg px-3 py-2"
|
|
283
|
+
/>
|
|
284
|
+
<button
|
|
285
|
+
*ngIf="mode !== 'date'"
|
|
286
|
+
style="padding: initial;"
|
|
287
|
+
pButton
|
|
288
|
+
type="button"
|
|
289
|
+
pRipple
|
|
290
|
+
icon="pi pi-calendar"
|
|
291
|
+
class="rounded-r-lg"
|
|
292
|
+
(click)="openDialog()"
|
|
293
|
+
></button>
|
|
294
|
+
</span>
|
|
295
|
+
</div>
|
|
296
|
+
|
|
297
|
+
<p-dialog [header]="'Select Date & Time' | translate" [(visible)]="dialogVisible" [modal]="false" [closable]="true">
|
|
298
|
+
<div class="flex flex-row items-center w-full gap-2 rounded-xl p-2">
|
|
299
|
+
<!-- Date Picker -->
|
|
300
|
+
<p-datepicker
|
|
301
|
+
*ngIf="mode !== 'time'"
|
|
302
|
+
[(ngModel)]="dateControl.value"
|
|
303
|
+
[formControl]="dateControl"
|
|
304
|
+
dateFormat="yy-mm-dd"
|
|
305
|
+
[showIcon]="true"
|
|
306
|
+
inputId="buttondisplay"
|
|
307
|
+
[showOnFocus]="false"
|
|
308
|
+
appendTo="body"
|
|
309
|
+
class="flex-1 min-w-0"
|
|
310
|
+
(onSelect)="onDateChange()"
|
|
311
|
+
></p-datepicker>
|
|
312
|
+
|
|
313
|
+
<!-- Time Input -->
|
|
314
|
+
<div *ngIf="mode !== 'date'" class="flex items-center gap-1">
|
|
315
|
+
<input
|
|
316
|
+
pInputText
|
|
317
|
+
type="text"
|
|
318
|
+
placeholder="hh:mm"
|
|
319
|
+
maxlength="5"
|
|
320
|
+
[formControl]="timeControl"
|
|
321
|
+
(input)="onTimeInput($event)"
|
|
322
|
+
(blur)="onTimeChange()"
|
|
323
|
+
class="w-20 text-center font-mono border rounded-lg px-3 py-2"
|
|
324
|
+
/>
|
|
325
|
+
|
|
326
|
+
<!-- AM/PM Toggle -->
|
|
327
|
+
<button
|
|
328
|
+
pButton
|
|
329
|
+
type="button"
|
|
330
|
+
class="rounded-lg border px-3 py-1.5 shadow-sm bg-gray-100 text-sm font-semibold text-gray-800"
|
|
331
|
+
(click)="toggleAmPm()"
|
|
332
|
+
[label]="ampmControl.value ?? 'AM'"
|
|
333
|
+
></button>
|
|
334
|
+
</div>
|
|
335
|
+
</div>
|
|
336
|
+
|
|
337
|
+
<ng-template #footer>
|
|
338
|
+
<button pButton type="button" [label]="'CANCEL' | translate" class="p-button-text" (click)="dialogVisible = false"></button>
|
|
339
|
+
<button pButton type="button" [label]="'SAVE' | translate" (click)="saveDialog()"></button>
|
|
340
|
+
</ng-template>
|
|
341
|
+
</p-dialog>
|
|
342
|
+
`,
|
|
160
343
|
}]
|
|
161
344
|
}] });
|
|
162
345
|
|