ng-prime-tools 1.0.34 → 1.0.35
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/esm2022/lib/models/pt-confirm-dialog-config.model.mjs +2 -0
- package/esm2022/lib/models/pt-dialog-config.model.mjs +3 -0
- package/esm2022/lib/models/public-api.mjs +3 -2
- package/esm2022/lib/pt-confirm-dialog/pt-confirm-dialog.component.mjs +3 -2
- package/esm2022/lib/pt-dialog/pt-dialog.component.mjs +44 -71
- package/fesm2022/ng-prime-tools.mjs +53 -77
- package/fesm2022/ng-prime-tools.mjs.map +1 -1
- package/lib/models/{dialog-config.model.d.ts → pt-confirm-dialog-config.model.d.ts} +2 -2
- package/lib/models/pt-confirm-dialog-config.model.d.ts.map +1 -0
- package/lib/models/pt-dialog-config.model.d.ts +40 -0
- package/lib/models/pt-dialog-config.model.d.ts.map +1 -0
- package/lib/models/public-api.d.ts +2 -1
- package/lib/models/public-api.d.ts.map +1 -1
- package/lib/pt-confirm-dialog/pt-confirm-dialog.component.d.ts +2 -2
- package/lib/pt-confirm-dialog/pt-confirm-dialog.component.d.ts.map +1 -1
- package/lib/pt-dialog/pt-dialog.component.d.ts +11 -38
- package/lib/pt-dialog/pt-dialog.component.d.ts.map +1 -1
- package/lib/pt-metric-panel/pt-metric-panel.component.d.ts +1 -1
- package/package.json +1 -1
- package/esm2022/lib/models/dialog-config.model.mjs +0 -2
- package/lib/models/dialog-config.model.d.ts.map +0 -1
|
@@ -3802,7 +3802,7 @@ const DIALOG_STYLES = {
|
|
|
3802
3802
|
* Default config:
|
|
3803
3803
|
* - content is now empty string (no default message).
|
|
3804
3804
|
*/
|
|
3805
|
-
const DEFAULT_DIALOG_CONFIG = {
|
|
3805
|
+
const DEFAULT_DIALOG_CONFIG$1 = {
|
|
3806
3806
|
header: { text: 'Confirmation' },
|
|
3807
3807
|
visible: false,
|
|
3808
3808
|
width: '720px',
|
|
@@ -3822,14 +3822,15 @@ class PTConfirmDialogComponent {
|
|
|
3822
3822
|
this.messageService = messageService;
|
|
3823
3823
|
this.renderer = renderer;
|
|
3824
3824
|
this.el = el;
|
|
3825
|
-
this.dialogConfig = { ...DEFAULT_DIALOG_CONFIG };
|
|
3825
|
+
this.dialogConfig = { ...DEFAULT_DIALOG_CONFIG$1 };
|
|
3826
3826
|
this.confirm = new EventEmitter();
|
|
3827
3827
|
this.cancel = new EventEmitter();
|
|
3828
3828
|
this.SeverityEnum = SeverityEnum;
|
|
3829
3829
|
}
|
|
3830
3830
|
ngOnChanges(changes) {
|
|
3831
3831
|
if (changes['dialogConfig']) {
|
|
3832
|
-
const current = changes['dialogConfig']
|
|
3832
|
+
const current = changes['dialogConfig']
|
|
3833
|
+
.currentValue;
|
|
3833
3834
|
if (changes['dialogConfig'].previousValue?.dialogStyle !==
|
|
3834
3835
|
current?.dialogStyle) {
|
|
3835
3836
|
this.applyDialogStyle();
|
|
@@ -3852,18 +3853,18 @@ class PTConfirmDialogComponent {
|
|
|
3852
3853
|
? current.header
|
|
3853
3854
|
: styleConfig.header !== undefined
|
|
3854
3855
|
? styleConfig.header
|
|
3855
|
-
: DEFAULT_DIALOG_CONFIG.header;
|
|
3856
|
+
: DEFAULT_DIALOG_CONFIG$1.header;
|
|
3856
3857
|
this.dialogConfig = {
|
|
3857
|
-
...DEFAULT_DIALOG_CONFIG,
|
|
3858
|
+
...DEFAULT_DIALOG_CONFIG$1,
|
|
3858
3859
|
...current,
|
|
3859
3860
|
...styleConfig,
|
|
3860
3861
|
header: mergedHeader,
|
|
3861
3862
|
confirmButtonConfig: {
|
|
3862
|
-
...DEFAULT_DIALOG_CONFIG.confirmButtonConfig,
|
|
3863
|
+
...DEFAULT_DIALOG_CONFIG$1.confirmButtonConfig,
|
|
3863
3864
|
...current.confirmButtonConfig,
|
|
3864
3865
|
},
|
|
3865
3866
|
cancelButtonConfig: {
|
|
3866
|
-
...DEFAULT_DIALOG_CONFIG.cancelButtonConfig,
|
|
3867
|
+
...DEFAULT_DIALOG_CONFIG$1.cancelButtonConfig,
|
|
3867
3868
|
...current.cancelButtonConfig,
|
|
3868
3869
|
},
|
|
3869
3870
|
visible: current.visible,
|
|
@@ -4110,107 +4111,80 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImpo
|
|
|
4110
4111
|
}]
|
|
4111
4112
|
}] });
|
|
4112
4113
|
|
|
4114
|
+
const DEFAULT_DIALOG_CONFIG = {
|
|
4115
|
+
modal: true,
|
|
4116
|
+
closable: true,
|
|
4117
|
+
draggable: true,
|
|
4118
|
+
resizable: true,
|
|
4119
|
+
maximizable: false,
|
|
4120
|
+
dismissableMask: false,
|
|
4121
|
+
closeOnEscape: true,
|
|
4122
|
+
blockScroll: true,
|
|
4123
|
+
bodyScrollable: true,
|
|
4124
|
+
showFooter: true,
|
|
4125
|
+
position: 'center',
|
|
4126
|
+
};
|
|
4113
4127
|
class PTDialogComponent {
|
|
4114
4128
|
constructor() {
|
|
4115
|
-
/**
|
|
4116
|
-
this.
|
|
4117
|
-
|
|
4118
|
-
this.
|
|
4119
|
-
this.modal = true;
|
|
4120
|
-
this.closable = true;
|
|
4121
|
-
this.draggable = true;
|
|
4122
|
-
this.resizable = true;
|
|
4123
|
-
this.maximizable = false;
|
|
4124
|
-
this.dismissableMask = false;
|
|
4125
|
-
this.closeOnEscape = true;
|
|
4126
|
-
this.blockScroll = true;
|
|
4127
|
-
this.position = 'center';
|
|
4128
|
-
/** internal visible flag used by p-dialog */
|
|
4129
|
-
this._visible = false;
|
|
4129
|
+
/** Single configuration object */
|
|
4130
|
+
this._config = { ...DEFAULT_DIALOG_CONFIG };
|
|
4131
|
+
// ---- Internal visible state (PUBLIC so template can read it) ----
|
|
4132
|
+
this._internalVisible = false;
|
|
4130
4133
|
this.visibleChange = new EventEmitter();
|
|
4131
4134
|
}
|
|
4135
|
+
set config(value) {
|
|
4136
|
+
this._config = { ...DEFAULT_DIALOG_CONFIG, ...(value || {}) };
|
|
4137
|
+
}
|
|
4138
|
+
get config() {
|
|
4139
|
+
return this._config;
|
|
4140
|
+
}
|
|
4141
|
+
/** Input visible from parent */
|
|
4132
4142
|
get visible() {
|
|
4133
|
-
return this.
|
|
4143
|
+
return this._internalVisible;
|
|
4134
4144
|
}
|
|
4135
4145
|
set visible(v) {
|
|
4136
|
-
this.
|
|
4146
|
+
this._internalVisible = v;
|
|
4137
4147
|
}
|
|
4138
|
-
/** Final class applied to p-dialog */
|
|
4139
4148
|
get dialogStyleClass() {
|
|
4140
4149
|
return [
|
|
4141
4150
|
'border-round-3xl',
|
|
4142
4151
|
'shadow-6',
|
|
4143
4152
|
'overflow-hidden',
|
|
4144
|
-
'pt-dialog-header-blue',
|
|
4145
|
-
this.styleClass,
|
|
4153
|
+
'pt-dialog-header-blue',
|
|
4154
|
+
this.config.styleClass,
|
|
4146
4155
|
]
|
|
4147
4156
|
.filter(Boolean)
|
|
4148
4157
|
.join(' ');
|
|
4149
4158
|
}
|
|
4150
|
-
|
|
4159
|
+
get primePosition() {
|
|
4160
|
+
return (this.config.position ?? 'center');
|
|
4161
|
+
}
|
|
4151
4162
|
get bodyStyle() {
|
|
4152
4163
|
const style = {};
|
|
4153
|
-
if (this.bodyWidth) {
|
|
4154
|
-
style['max-width'] = this.bodyWidth;
|
|
4164
|
+
if (this.config.bodyWidth) {
|
|
4165
|
+
style['max-width'] = this.config.bodyWidth;
|
|
4155
4166
|
}
|
|
4156
|
-
if (this.bodyHeight) {
|
|
4157
|
-
style['max-height'] = this.bodyHeight;
|
|
4158
|
-
if (this.bodyScrollable) {
|
|
4167
|
+
if (this.config.bodyHeight) {
|
|
4168
|
+
style['max-height'] = this.config.bodyHeight;
|
|
4169
|
+
if (this.config.bodyScrollable !== false) {
|
|
4159
4170
|
style['overflow-y'] = 'auto';
|
|
4160
4171
|
style['overflow-x'] = 'auto';
|
|
4161
4172
|
}
|
|
4162
4173
|
}
|
|
4163
4174
|
return style;
|
|
4164
4175
|
}
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
this.visibleChange.emit(false);
|
|
4176
|
+
/** Sync <p-dialog> → parent */
|
|
4177
|
+
onInternalVisibleChange(v) {
|
|
4178
|
+
this._internalVisible = v;
|
|
4179
|
+
this.visibleChange.emit(v);
|
|
4170
4180
|
}
|
|
4171
4181
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4172
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTDialogComponent, selector: "pt-dialog", inputs: {
|
|
4182
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTDialogComponent, selector: "pt-dialog", inputs: { config: "config", visible: "visible" }, outputs: { visibleChange: "visibleChange" }, ngImport: i0, template: "<p-dialog\n [visible]=\"_internalVisible\"\n (visibleChange)=\"onInternalVisibleChange($event)\"\n [header]=\"config.header\"\n [modal]=\"config.modal\"\n [style]=\"config.style\"\n [breakpoints]=\"config.breakpoints\"\n [closable]=\"config.closable\"\n [draggable]=\"config.draggable\"\n [resizable]=\"config.resizable\"\n [maximizable]=\"config.maximizable\"\n [dismissableMask]=\"config.dismissableMask\"\n [closeOnEscape]=\"config.closeOnEscape\"\n [blockScroll]=\"config.blockScroll\"\n [position]=\"primePosition\"\n [contentStyle]=\"config.contentStyle\"\n [styleClass]=\"dialogStyleClass\"\n>\n <!-- HEADER -->\n <ng-template pTemplate=\"header\">\n <div\n class=\"flex align-items-center justify-content-between w-full px-4 pt-3 pb-2\"\n >\n <div class=\"flex align-items-center gap-2\">\n <i\n *ngIf=\"config.headerIconClass\"\n [ngClass]=\"config.headerIconClass\"\n ></i>\n <ng-content select=\"[ptDialogHeader]\"></ng-content>\n <span *ngIf=\"config.header\" class=\"font-bold text-lg\">\n {{ config.header }}\n </span>\n </div>\n </div>\n </ng-template>\n\n <!-- BODY -->\n <div\n class=\"surface-50 px-4 py-4 flex flex-column gap-3\"\n [ngStyle]=\"bodyStyle\"\n >\n <ng-content select=\"[ptDialogContent]\"></ng-content>\n <ng-content></ng-content>\n </div>\n\n <!-- FOOTER -->\n <ng-template pTemplate=\"footer\" *ngIf=\"config.showFooter !== false\">\n <div class=\"surface-100 px-4 py-2 flex justify-content-end gap-2\">\n <ng-content select=\"[ptDialogFooter]\"></ng-content>\n </div>\n </ng-template>\n</p-dialog>\n", styles: [":host ::ng-deep .pt-dialog-header-blue .p-dialog-header{background-color:#e0f2ff;border-bottom:0}:host ::ng-deep .pt-dialog-header-blue .p-dialog-footer{background-color:#f5f6f8!important;border-top:0!important}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i2$3.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "directive", type: i1$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }] }); }
|
|
4173
4183
|
}
|
|
4174
4184
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTDialogComponent, decorators: [{
|
|
4175
4185
|
type: Component,
|
|
4176
|
-
args: [{ selector: 'pt-dialog', template: "<p-dialog\n [
|
|
4177
|
-
}], propDecorators: {
|
|
4178
|
-
type: Input
|
|
4179
|
-
}], style: [{
|
|
4180
|
-
type: Input
|
|
4181
|
-
}], styleClass: [{
|
|
4182
|
-
type: Input
|
|
4183
|
-
}], headerIconClass: [{
|
|
4184
|
-
type: Input
|
|
4185
|
-
}], bodyWidth: [{
|
|
4186
|
-
type: Input
|
|
4187
|
-
}], bodyHeight: [{
|
|
4188
|
-
type: Input
|
|
4189
|
-
}], bodyScrollable: [{
|
|
4190
|
-
type: Input
|
|
4191
|
-
}], showFooter: [{
|
|
4192
|
-
type: Input
|
|
4193
|
-
}], modal: [{
|
|
4194
|
-
type: Input
|
|
4195
|
-
}], closable: [{
|
|
4196
|
-
type: Input
|
|
4197
|
-
}], draggable: [{
|
|
4198
|
-
type: Input
|
|
4199
|
-
}], resizable: [{
|
|
4200
|
-
type: Input
|
|
4201
|
-
}], maximizable: [{
|
|
4202
|
-
type: Input
|
|
4203
|
-
}], dismissableMask: [{
|
|
4204
|
-
type: Input
|
|
4205
|
-
}], closeOnEscape: [{
|
|
4206
|
-
type: Input
|
|
4207
|
-
}], blockScroll: [{
|
|
4208
|
-
type: Input
|
|
4209
|
-
}], breakpoints: [{
|
|
4210
|
-
type: Input
|
|
4211
|
-
}], position: [{
|
|
4212
|
-
type: Input
|
|
4213
|
-
}], contentStyle: [{
|
|
4186
|
+
args: [{ selector: 'pt-dialog', template: "<p-dialog\n [visible]=\"_internalVisible\"\n (visibleChange)=\"onInternalVisibleChange($event)\"\n [header]=\"config.header\"\n [modal]=\"config.modal\"\n [style]=\"config.style\"\n [breakpoints]=\"config.breakpoints\"\n [closable]=\"config.closable\"\n [draggable]=\"config.draggable\"\n [resizable]=\"config.resizable\"\n [maximizable]=\"config.maximizable\"\n [dismissableMask]=\"config.dismissableMask\"\n [closeOnEscape]=\"config.closeOnEscape\"\n [blockScroll]=\"config.blockScroll\"\n [position]=\"primePosition\"\n [contentStyle]=\"config.contentStyle\"\n [styleClass]=\"dialogStyleClass\"\n>\n <!-- HEADER -->\n <ng-template pTemplate=\"header\">\n <div\n class=\"flex align-items-center justify-content-between w-full px-4 pt-3 pb-2\"\n >\n <div class=\"flex align-items-center gap-2\">\n <i\n *ngIf=\"config.headerIconClass\"\n [ngClass]=\"config.headerIconClass\"\n ></i>\n <ng-content select=\"[ptDialogHeader]\"></ng-content>\n <span *ngIf=\"config.header\" class=\"font-bold text-lg\">\n {{ config.header }}\n </span>\n </div>\n </div>\n </ng-template>\n\n <!-- BODY -->\n <div\n class=\"surface-50 px-4 py-4 flex flex-column gap-3\"\n [ngStyle]=\"bodyStyle\"\n >\n <ng-content select=\"[ptDialogContent]\"></ng-content>\n <ng-content></ng-content>\n </div>\n\n <!-- FOOTER -->\n <ng-template pTemplate=\"footer\" *ngIf=\"config.showFooter !== false\">\n <div class=\"surface-100 px-4 py-2 flex justify-content-end gap-2\">\n <ng-content select=\"[ptDialogFooter]\"></ng-content>\n </div>\n </ng-template>\n</p-dialog>\n", styles: [":host ::ng-deep .pt-dialog-header-blue .p-dialog-header{background-color:#e0f2ff;border-bottom:0}:host ::ng-deep .pt-dialog-header-blue .p-dialog-footer{background-color:#f5f6f8!important;border-top:0!important}\n"] }]
|
|
4187
|
+
}], propDecorators: { config: [{
|
|
4214
4188
|
type: Input
|
|
4215
4189
|
}], visible: [{
|
|
4216
4190
|
type: Input
|
|
@@ -4859,6 +4833,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImpo
|
|
|
4859
4833
|
}]
|
|
4860
4834
|
}] });
|
|
4861
4835
|
|
|
4836
|
+
// src/lib/models/pt-dialog-config.model.ts
|
|
4837
|
+
|
|
4862
4838
|
// Advanced table
|
|
4863
4839
|
|
|
4864
4840
|
class PTGroupComponent {
|