osl-base-extended 13.0.0 → 13.1.0

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.
@@ -143,6 +143,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
143
143
  args: [MAT_DIALOG_DATA]
144
144
  }] }] });
145
145
 
146
+ class WarningDialog {
147
+ dialogRef;
148
+ data;
149
+ constructor(dialogRef, data) {
150
+ this.dialogRef = dialogRef;
151
+ this.data = data;
152
+ }
153
+ confirm() {
154
+ this.dialogRef.close(true);
155
+ }
156
+ cancel() {
157
+ this.dialogRef.close(false);
158
+ }
159
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: WarningDialog, deps: [{ token: i1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
160
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: WarningDialog, isStandalone: true, selector: "warning-dialog", ngImport: i0, template: "<div class=\"warning-dialog-container\">\n\n <!-- Header: centered icon + top-right close -->\n <div class=\"warning-dialog-header\">\n <div class=\"warning-icon-wrapper\">\n <div class=\"warning-icon-ring\">\n <svg class=\"warning-icon\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z\"/>\n </svg>\n </div>\n </div>\n <button mat-icon-button class=\"close-btn\" (click)=\"cancel()\" aria-label=\"Close\">\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\" width=\"20\" height=\"20\">\n <path d=\"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"/>\n </svg>\n </button>\n </div>\n\n <!-- Body -->\n <mat-dialog-content class=\"warning-dialog-content\">\n <h2 class=\"warning-title\">{{ data.title }}</h2>\n <p class=\"warning-message\">{{ data.message }}</p>\n </mat-dialog-content>\n\n <!-- Actions -->\n <mat-dialog-actions class=\"warning-dialog-actions\">\n <button mat-stroked-button class=\"no-btn\" (click)=\"cancel()\">\n {{ data.noText }}\n </button>\n <button mat-flat-button class=\"yes-btn\" (click)=\"confirm()\">\n {{ data.yesText }}\n </button>\n </mat-dialog-actions>\n\n</div>\n", styles: [".warning-dialog-container{padding:8px 4px}.warning-dialog-header{display:flex;justify-content:space-between;align-items:flex-start;padding:8px 8px 0}.warning-icon-wrapper{display:flex;align-items:center;justify-content:center;flex:1;padding-left:40px}.warning-icon-ring{width:72px;height:72px;border-radius:50%;background:#f59e0b1a;border:2px solid rgba(245,158,11,.3);display:flex;align-items:center;justify-content:center;animation:pulse-ring-warning 2s ease-in-out infinite}.warning-icon{width:36px;height:36px;color:var(--osl-warning, #d97706)}.close-btn{color:var(--osl-secondary, #6b7280);flex-shrink:0}.close-btn:hover{color:var(--osl-black, #000)}.warning-dialog-content{text-align:center;padding:16px 24px 8px!important;max-height:unset!important;overflow:visible!important}.warning-title{font-size:20px;font-weight:600;color:var(--osl-black, #111827);margin:0 0 10px;line-height:1.3}.warning-message{font-size:14px;color:var(--osl-secondary, #6b7280);margin:0;line-height:1.6}.warning-dialog-actions{display:flex!important;justify-content:center;gap:12px;padding:16px 24px 20px!important}.warning-dialog-actions .no-btn{border-color:var(--osl-border-color, #d1d5db);color:var(--osl-secondary, #6b7280);border-radius:var(--osl-border-radius, 4px);height:38px;font-size:14px;font-weight:500;padding:0 18px;transition:all .2s ease}.warning-dialog-actions .no-btn:hover{border-color:var(--osl-secondary, #6b7280);background:#f9fafb}.warning-dialog-actions .yes-btn{background:var(--osl-warning, #d97706);color:var(--osl-warning-text, #ffffff);border-radius:var(--osl-border-radius, 4px);height:38px;font-size:14px;font-weight:500;padding:0 18px;transition:all .2s ease}.warning-dialog-actions .yes-btn:hover{background:var(--osl-warning-hover, #b45309);box-shadow:0 4px 12px #d9770659}@keyframes pulse-ring-warning{0%,to{box-shadow:0 0 #f59e0b2e}50%{box-shadow:0 0 0 8px #f59e0b00}}\n"], dependencies: [{ kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }] });
161
+ }
162
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: WarningDialog, decorators: [{
163
+ type: Component,
164
+ args: [{ selector: 'warning-dialog', standalone: true, imports: [MatDialogModule, MatButtonModule], template: "<div class=\"warning-dialog-container\">\n\n <!-- Header: centered icon + top-right close -->\n <div class=\"warning-dialog-header\">\n <div class=\"warning-icon-wrapper\">\n <div class=\"warning-icon-ring\">\n <svg class=\"warning-icon\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z\"/>\n </svg>\n </div>\n </div>\n <button mat-icon-button class=\"close-btn\" (click)=\"cancel()\" aria-label=\"Close\">\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\" width=\"20\" height=\"20\">\n <path d=\"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"/>\n </svg>\n </button>\n </div>\n\n <!-- Body -->\n <mat-dialog-content class=\"warning-dialog-content\">\n <h2 class=\"warning-title\">{{ data.title }}</h2>\n <p class=\"warning-message\">{{ data.message }}</p>\n </mat-dialog-content>\n\n <!-- Actions -->\n <mat-dialog-actions class=\"warning-dialog-actions\">\n <button mat-stroked-button class=\"no-btn\" (click)=\"cancel()\">\n {{ data.noText }}\n </button>\n <button mat-flat-button class=\"yes-btn\" (click)=\"confirm()\">\n {{ data.yesText }}\n </button>\n </mat-dialog-actions>\n\n</div>\n", styles: [".warning-dialog-container{padding:8px 4px}.warning-dialog-header{display:flex;justify-content:space-between;align-items:flex-start;padding:8px 8px 0}.warning-icon-wrapper{display:flex;align-items:center;justify-content:center;flex:1;padding-left:40px}.warning-icon-ring{width:72px;height:72px;border-radius:50%;background:#f59e0b1a;border:2px solid rgba(245,158,11,.3);display:flex;align-items:center;justify-content:center;animation:pulse-ring-warning 2s ease-in-out infinite}.warning-icon{width:36px;height:36px;color:var(--osl-warning, #d97706)}.close-btn{color:var(--osl-secondary, #6b7280);flex-shrink:0}.close-btn:hover{color:var(--osl-black, #000)}.warning-dialog-content{text-align:center;padding:16px 24px 8px!important;max-height:unset!important;overflow:visible!important}.warning-title{font-size:20px;font-weight:600;color:var(--osl-black, #111827);margin:0 0 10px;line-height:1.3}.warning-message{font-size:14px;color:var(--osl-secondary, #6b7280);margin:0;line-height:1.6}.warning-dialog-actions{display:flex!important;justify-content:center;gap:12px;padding:16px 24px 20px!important}.warning-dialog-actions .no-btn{border-color:var(--osl-border-color, #d1d5db);color:var(--osl-secondary, #6b7280);border-radius:var(--osl-border-radius, 4px);height:38px;font-size:14px;font-weight:500;padding:0 18px;transition:all .2s ease}.warning-dialog-actions .no-btn:hover{border-color:var(--osl-secondary, #6b7280);background:#f9fafb}.warning-dialog-actions .yes-btn{background:var(--osl-warning, #d97706);color:var(--osl-warning-text, #ffffff);border-radius:var(--osl-border-radius, 4px);height:38px;font-size:14px;font-weight:500;padding:0 18px;transition:all .2s ease}.warning-dialog-actions .yes-btn:hover{background:var(--osl-warning-hover, #b45309);box-shadow:0 4px 12px #d9770659}@keyframes pulse-ring-warning{0%,to{box-shadow:0 0 #f59e0b2e}50%{box-shadow:0 0 0 8px #f59e0b00}}\n"] }]
165
+ }], ctorParameters: () => [{ type: i1.MatDialogRef }, { type: WarningDialogData, decorators: [{
166
+ type: Inject,
167
+ args: [MAT_DIALOG_DATA]
168
+ }] }] });
169
+ class WarningDialogData {
170
+ title = 'Warning';
171
+ message = 'Are you sure you want to proceed?';
172
+ yesText = 'Yes';
173
+ noText = 'No';
174
+ data;
175
+ }
176
+
146
177
  class DirtyStateService {
147
178
  _isDirty = false;
148
179
  _saveCallback;
@@ -224,6 +255,23 @@ class baseComponent {
224
255
  disableClose: true,
225
256
  });
226
257
  }
258
+ openWarningDialog(title, message, onYesClick, onClose, yesText = 'Yes', noText = 'No', data) {
259
+ const dialogData = { title, message, yesText, noText, data };
260
+ const dialogRef = this._injector.get(MatDialog).open(WarningDialog, {
261
+ width: '380px',
262
+ data: dialogData,
263
+ disableClose: true,
264
+ });
265
+ dialogRef.afterClosed().subscribe((confirmed) => {
266
+ if (confirmed) {
267
+ onYesClick?.();
268
+ }
269
+ else {
270
+ onClose?.();
271
+ }
272
+ });
273
+ return dialogRef;
274
+ }
227
275
  isValidBeforeSave(formElements, model) {
228
276
  const errors = [];
229
277
  this._collectValidationErrors(formElements, model, errors);
@@ -7920,5 +7968,5 @@ const unsavedChangesGuard = () => {
7920
7968
  * Generated bundle index. Do not edit.
7921
7969
  */
7922
7970
 
7923
- export { array_util as ArrayUtil, date_util as DateUtil, DeleteConfirmation, DeleteConfirmationData, Dialog, DialogWrapper, DirtyStateService, DynamicForm, ErrorDialog, FormStructureModule, Httpbase, number_util as NumberUtil, OSL_ATTACH_CALLER_IP, object_util as ObjectUtil, OslAutocomplete, OslAutocompleteLister, OslBaseExtended, OslButton, OslCheckbox, OslDatepicker, OslDatetimepicker, OslDocumentUploader, OslFileUpload, OslFormGrid, OslGrid, OslMenu, OslMenuTriggerFor, OslRadio, OslReportForm, OslReportGrid, OslSearchbar, OslSelect, OslSetup, OslSkeletonDirective, OslSkeletonModule, OslSkeletonThemeService, OslSlideToggle, OslTooltipDirective, OslUserLog, Oslinput, Osltextarea, storage_util as StorageUtil, string_util as StringUtil, UnsavedChangesDialog, validation_util as ValidationUtil, baseComponent, provideCallerIpHeader, unsavedChangesGuard };
7971
+ export { array_util as ArrayUtil, date_util as DateUtil, DeleteConfirmation, DeleteConfirmationData, Dialog, DialogWrapper, DirtyStateService, DynamicForm, ErrorDialog, FormStructureModule, Httpbase, number_util as NumberUtil, OSL_ATTACH_CALLER_IP, object_util as ObjectUtil, OslAutocomplete, OslAutocompleteLister, OslBaseExtended, OslButton, OslCheckbox, OslDatepicker, OslDatetimepicker, OslDocumentUploader, OslFileUpload, OslFormGrid, OslGrid, OslMenu, OslMenuTriggerFor, OslRadio, OslReportForm, OslReportGrid, OslSearchbar, OslSelect, OslSetup, OslSkeletonDirective, OslSkeletonModule, OslSkeletonThemeService, OslSlideToggle, OslTooltipDirective, OslUserLog, Oslinput, Osltextarea, storage_util as StorageUtil, string_util as StringUtil, UnsavedChangesDialog, validation_util as ValidationUtil, WarningDialog, WarningDialogData, baseComponent, provideCallerIpHeader, unsavedChangesGuard };
7924
7972
  //# sourceMappingURL=osl-base-extended.mjs.map