intelica-library-components 1.1.4 → 1.1.12

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.
@@ -28,11 +28,12 @@ import { InputText, InputTextModule } from 'primeng/inputtext';
28
28
  import * as i6 from 'primeng/select';
29
29
  import { Select, SelectModule } from 'primeng/select';
30
30
  import * as i3$1 from 'primeng/api';
31
+ import { ConfirmationService } from 'primeng/api';
31
32
  import { InputGroupAddonModule } from 'primeng/inputgroupaddon';
32
33
  import * as i3$2 from 'primeng/ripple';
33
34
  import { RippleModule } from 'primeng/ripple';
34
35
  import * as i2$3 from 'primeng/datepicker';
35
- import { DatePickerModule } from 'primeng/datepicker';
36
+ import { DatePickerModule, DatePicker } from 'primeng/datepicker';
36
37
  import * as i2$2 from 'primeng/multiselect';
37
38
  import { MultiSelectModule } from 'primeng/multiselect';
38
39
  import * as i7 from 'primeng/textarea';
@@ -41,6 +42,8 @@ import { Dialog } from 'primeng/dialog';
41
42
  import * as echarts from 'echarts';
42
43
  import * as i2$4 from 'primeng/skeleton';
43
44
  import { SkeletonModule } from 'primeng/skeleton';
45
+ import * as i1$3 from 'primeng/confirmdialog';
46
+ import { ConfirmDialogModule } from 'primeng/confirmdialog';
44
47
  import * as XLSX from 'xlsx';
45
48
  import { Workbook } from 'exceljs';
46
49
  import { saveAs } from 'file-saver';
@@ -518,6 +521,33 @@ var TableSortOrder;
518
521
  TableSortOrder[TableSortOrder["Desc"] = -1] = "Desc";
519
522
  })(TableSortOrder || (TableSortOrder = {}));
520
523
 
524
+ /**
525
+ * Enum representing the different types of alerts available in the system.
526
+ * Each type corresponds to a specific visual style and semantic meaning.
527
+ */
528
+ var AlertType;
529
+ (function (AlertType) {
530
+ /** Warning alert - Yellow icon and title, used for cautionary messages */
531
+ AlertType["WARNING"] = "warning";
532
+ /** Success alert - Green icon and title, used for successful operations */
533
+ AlertType["SUCCESS"] = "success";
534
+ /** Error alert - Red icon and title, used for error messages */
535
+ AlertType["ERROR"] = "error";
536
+ })(AlertType || (AlertType = {}));
537
+ /**
538
+ * Enum representing the button configuration modes for alerts.
539
+ * Determines which buttons are displayed in the alert dialog.
540
+ */
541
+ var AlertButtonMode;
542
+ (function (AlertButtonMode) {
543
+ /** Only shows a single OK/Confirm button */
544
+ AlertButtonMode["OK_ONLY"] = "ok_only";
545
+ /** Shows both Confirm and Cancel buttons */
546
+ AlertButtonMode["CONFIRM_CANCEL"] = "confirm_cancel";
547
+ /** Shows only a Confirm button (without cancel) */
548
+ AlertButtonMode["CONFIRM_ONLY"] = "confirm_only";
549
+ })(AlertButtonMode || (AlertButtonMode = {}));
550
+
521
551
  class PermissionsService {
522
552
  constructor() { }
523
553
  async canActivate(next, state) {
@@ -4917,6 +4947,457 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
4917
4947
  args: ["document:click", ["$event"]]
4918
4948
  }] } });
4919
4949
 
4950
+ /**
4951
+ * Constants for DatePicker custom button types
4952
+ * Use these constants instead of string literals to maintain consistency
4953
+ * and facilitate future changes
4954
+ */
4955
+ const DATEPICKER_BUTTON_TYPES = {
4956
+ TODAY: 'TODAY',
4957
+ LAST_12_MONTHS: 'LAST_12_MONTHS',
4958
+ CURRENT_YEAR: 'CURRENT_YEAR',
4959
+ CURRENT_MONTH: 'CURRENT_MONTH',
4960
+ };
4961
+
4962
+ class DatepickerComponent {
4963
+ cdr;
4964
+ // Expose constants to template
4965
+ DATEPICKER_BUTTON_TYPES = DATEPICKER_BUTTON_TYPES;
4966
+ /**
4967
+ * @description Readonly input
4968
+ * @default false
4969
+ * @type {boolean}
4970
+ */
4971
+ readonlyInput = false;
4972
+ /**
4973
+ * @description Show icon
4974
+ * @default false
4975
+ * @type {boolean}
4976
+ */
4977
+ showIcon = false;
4978
+ /**
4979
+ * @description Number of months to display
4980
+ * @default 2
4981
+ * @type {number}
4982
+ */
4983
+ numberOfMonths = 2;
4984
+ /**
4985
+ * @description Panel style class
4986
+ * @default "prDatapicker prDatapicker--dropdown"
4987
+ * @type {string}
4988
+ */
4989
+ panelStyleClass = "prDatapicker prDatapicker--dropdown";
4990
+ /**
4991
+ * @description Manual apply mode - requires Apply button click to confirm selection
4992
+ * @default false
4993
+ * @type {boolean}
4994
+ */
4995
+ manualApply = false;
4996
+ /**
4997
+ * @description Custom buttons to show in footer
4998
+ * @default []
4999
+ * @type {CustomButtonType[]}
5000
+ */
5001
+ customButtons = [];
5002
+ /**
5003
+ * @description Date format for display in input
5004
+ * @default "dd M, yy" (e.g., "08 Jan, 2026")
5005
+ * @type {string}
5006
+ */
5007
+ dateFormat;
5008
+ /**
5009
+ * @description View mode for the datepicker
5010
+ * @default "date"
5011
+ * @type {"date" | "month" | "year"}
5012
+ */
5013
+ view = "date";
5014
+ /**
5015
+ * @description Selection mode for the datepicker
5016
+ * @default "range"
5017
+ * @type {"single" | "range"}
5018
+ */
5019
+ selectionMode = "range";
5020
+ /**
5021
+ * @description Change event
5022
+ * @emits {(Date | null)[] | null}
5023
+ * @type {EventEmitter<(Date | null)[] | null>}
5024
+ */
5025
+ onChangeEvent = new EventEmitter();
5026
+ rangeDates = null;
5027
+ // Temporary selection for manual apply mode
5028
+ tempSelection = null;
5029
+ viewMonth;
5030
+ viewYear;
5031
+ currentYear = new Date().getFullYear();
5032
+ currentMonth = new Date().getMonth();
5033
+ defaultDate;
5034
+ navigatingWithArrows = false;
5035
+ // ViewChild to access datepicker instance
5036
+ datepickerRef;
5037
+ // Flag to control when closing is allowed
5038
+ allowClose = true;
5039
+ // Flag to prevent auto-close immediately after date selection
5040
+ preventAutoClose = false;
5041
+ // Track active button
5042
+ activeButton = null;
5043
+ months = [
5044
+ { label: "Enero", value: 0 },
5045
+ { label: "Febrero", value: 1 },
5046
+ { label: "Marzo", value: 2 },
5047
+ { label: "Abril", value: 3 },
5048
+ { label: "Mayo", value: 4 },
5049
+ { label: "Junio", value: 5 },
5050
+ { label: "Julio", value: 6 },
5051
+ { label: "Agosto", value: 7 },
5052
+ { label: "Septiembre", value: 8 },
5053
+ { label: "Octubre", value: 9 },
5054
+ { label: "Noviembre", value: 10 },
5055
+ { label: "Diciembre", value: 11 },
5056
+ ];
5057
+ years = [];
5058
+ onChangeFn = () => { };
5059
+ onTouchedFn = () => { };
5060
+ constructor(cdr) {
5061
+ this.cdr = cdr;
5062
+ const today = new Date();
5063
+ this.viewMonth = today.getMonth();
5064
+ this.viewYear = today.getFullYear();
5065
+ this.defaultDate = new Date(this.viewYear, this.viewMonth, 1);
5066
+ const YEARS_BACK = 10;
5067
+ this.years = [];
5068
+ for (let y = this.viewYear - YEARS_BACK; y <= this.viewYear; y++) {
5069
+ this.years.push(y);
5070
+ }
5071
+ }
5072
+ get filteredMonths() {
5073
+ if (this.navigatingWithArrows) {
5074
+ return this.months;
5075
+ }
5076
+ if (this.viewYear === this.currentYear) {
5077
+ return this.months.filter(m => m.value >= this.currentMonth);
5078
+ }
5079
+ return this.months;
5080
+ }
5081
+ getDateFormat() {
5082
+ if (this.dateFormat) {
5083
+ return this.dateFormat;
5084
+ }
5085
+ switch (this.view) {
5086
+ case 'month':
5087
+ return 'M, yy';
5088
+ case 'year':
5089
+ return 'yy';
5090
+ default:
5091
+ return 'dd M, yy';
5092
+ }
5093
+ }
5094
+ normalizeMonthYear(month, year) {
5095
+ if (month > 11) {
5096
+ return { month: 0, year: year + 1 };
5097
+ }
5098
+ if (month < 0) {
5099
+ return { month: 11, year: year - 1 };
5100
+ }
5101
+ return { month, year };
5102
+ }
5103
+ onMonthChange(event) {
5104
+ this.navigatingWithArrows = true;
5105
+ const normalized = this.normalizeMonthYear(event.month, event.year);
5106
+ this.viewMonth = normalized.month;
5107
+ this.viewYear = normalized.year;
5108
+ }
5109
+ onYearChange(event) {
5110
+ this.navigatingWithArrows = true;
5111
+ const normalized = this.normalizeMonthYear(event.month, event.year);
5112
+ this.viewMonth = normalized.month;
5113
+ this.viewYear = normalized.year;
5114
+ }
5115
+ onViewChange() {
5116
+ this.navigatingWithArrows = false;
5117
+ if (this.viewYear === this.currentYear && this.viewMonth < this.currentMonth) {
5118
+ this.viewMonth = this.currentMonth;
5119
+ }
5120
+ this.defaultDate = new Date(this.viewYear, this.viewMonth, 1);
5121
+ }
5122
+ // Internal model for the datepicker (handles manual apply mode)
5123
+ get internalModel() {
5124
+ // In manual apply mode, show temp selection for the calendar
5125
+ // In normal mode, show the actual value
5126
+ return this.manualApply ? this.tempSelection : this.rangeDates;
5127
+ }
5128
+ // Handle model changes from datepicker
5129
+ onModelChange(val) {
5130
+ // Reset active button when user manually selects dates
5131
+ this.activeButton = null;
5132
+ if (this.manualApply) {
5133
+ // In manual apply mode, only store in temp selection
5134
+ this.tempSelection = val;
5135
+ // Prevent auto-close immediately after date selection
5136
+ this.preventAutoClose = true;
5137
+ // After a brief moment, allow closing by clicking outside
5138
+ setTimeout(() => {
5139
+ this.preventAutoClose = false;
5140
+ }, 200);
5141
+ }
5142
+ else {
5143
+ // In normal mode, update the actual value immediately
5144
+ this.rangeDates = val;
5145
+ this.onChangeEvent.emit(this.rangeDates);
5146
+ this.onChangeFn(this.rangeDates);
5147
+ this.onTouchedFn();
5148
+ }
5149
+ }
5150
+ writeValue(value) {
5151
+ this.rangeDates = value;
5152
+ if (this.manualApply) {
5153
+ this.tempSelection = value;
5154
+ }
5155
+ }
5156
+ registerOnChange(fn) {
5157
+ this.onChangeFn = fn;
5158
+ }
5159
+ registerOnTouched(fn) {
5160
+ this.onTouchedFn = fn;
5161
+ }
5162
+ setDisabledState(isDisabled) {
5163
+ /* opcional: implementar si necesitas deshabilitar el componente desde ngModel */
5164
+ }
5165
+ onDateChange() {
5166
+ this.onChangeEvent.emit(this.rangeDates);
5167
+ this.onChangeFn(this.rangeDates);
5168
+ this.onTouchedFn();
5169
+ }
5170
+ // Event handlers for open/close
5171
+ handleOpen() {
5172
+ if (this.manualApply) {
5173
+ // Initialize temp selection with current value
5174
+ this.tempSelection = this.rangeDates;
5175
+ // Reset flags
5176
+ this.allowClose = false;
5177
+ this.preventAutoClose = false;
5178
+ // Ensure hideOverlay is overridden every time the overlay opens
5179
+ setTimeout(() => {
5180
+ this.setupHideOverlayOverride();
5181
+ }, 0);
5182
+ }
5183
+ }
5184
+ handleClose() {
5185
+ if (this.manualApply) {
5186
+ // Reset temp selection to current value (discards changes if not applied)
5187
+ this.tempSelection = this.rangeDates;
5188
+ // Reset flags
5189
+ this.allowClose = false;
5190
+ this.preventAutoClose = false;
5191
+ // Force the datepicker to refresh its internal model to show the original value
5192
+ // Use setTimeout to ensure the change happens after the close animation
5193
+ setTimeout(() => {
5194
+ if (this.datepickerRef) {
5195
+ // Update the datepicker's internal value
5196
+ this.datepickerRef.value = this.rangeDates;
5197
+ // Trigger change detection
5198
+ this.cdr.detectChanges();
5199
+ }
5200
+ }, 0);
5201
+ }
5202
+ }
5203
+ // Apply button callback
5204
+ applyCallback(event) {
5205
+ // Apply the temporary selection to the actual value
5206
+ this.rangeDates = this.tempSelection;
5207
+ this.onChangeEvent.emit(this.rangeDates);
5208
+ this.onChangeFn(this.rangeDates);
5209
+ this.onTouchedFn();
5210
+ // Allow closing
5211
+ this.allowClose = true;
5212
+ this.preventAutoClose = false;
5213
+ // Close the datepicker overlay
5214
+ if (this.datepickerRef) {
5215
+ this.datepickerRef.overlayVisible = false;
5216
+ }
5217
+ }
5218
+ // Clear button callback
5219
+ clearCallback(event) {
5220
+ // Reset active button
5221
+ this.activeButton = null;
5222
+ if (this.manualApply) {
5223
+ // In manual apply mode, clear both temp selection and actual value
5224
+ this.tempSelection = null;
5225
+ this.rangeDates = null;
5226
+ this.onChangeEvent.emit(this.rangeDates);
5227
+ this.onChangeFn(this.rangeDates);
5228
+ this.onTouchedFn();
5229
+ // Allow closing
5230
+ this.allowClose = true;
5231
+ this.preventAutoClose = false;
5232
+ }
5233
+ else {
5234
+ this.rangeDates = null;
5235
+ this.onChangeEvent.emit(this.rangeDates);
5236
+ this.onChangeFn(this.rangeDates);
5237
+ this.onTouchedFn();
5238
+ }
5239
+ // Close the datepicker overlay
5240
+ if (this.datepickerRef) {
5241
+ this.datepickerRef.overlayVisible = false;
5242
+ }
5243
+ }
5244
+ // Custom button callbacks
5245
+ todayCallback(event) {
5246
+ const today = new Date();
5247
+ const dateRange = [today, today];
5248
+ this.activeButton = DATEPICKER_BUTTON_TYPES.TODAY;
5249
+ if (this.manualApply) {
5250
+ this.tempSelection = dateRange;
5251
+ }
5252
+ else {
5253
+ this.rangeDates = dateRange;
5254
+ this.onChangeEvent.emit(this.rangeDates);
5255
+ this.onChangeFn(this.rangeDates);
5256
+ this.onTouchedFn();
5257
+ }
5258
+ }
5259
+ last12MonthsCallback(event) {
5260
+ const endDate = new Date();
5261
+ const startDate = new Date();
5262
+ startDate.setMonth(startDate.getMonth() - 12);
5263
+ const dateRange = [startDate, endDate];
5264
+ this.activeButton = DATEPICKER_BUTTON_TYPES.LAST_12_MONTHS;
5265
+ if (this.manualApply) {
5266
+ this.tempSelection = dateRange;
5267
+ }
5268
+ else {
5269
+ this.rangeDates = dateRange;
5270
+ this.onChangeEvent.emit(this.rangeDates);
5271
+ this.onChangeFn(this.rangeDates);
5272
+ this.onTouchedFn();
5273
+ }
5274
+ }
5275
+ currentYearCallback(event) {
5276
+ const today = new Date();
5277
+ const startDate = new Date(today.getFullYear(), 0, 1); // January 1st
5278
+ const endDate = new Date(today.getFullYear(), 11, 31); // December 31st
5279
+ const dateRange = [startDate, endDate];
5280
+ this.activeButton = DATEPICKER_BUTTON_TYPES.CURRENT_YEAR;
5281
+ if (this.manualApply) {
5282
+ this.tempSelection = dateRange;
5283
+ }
5284
+ else {
5285
+ this.rangeDates = dateRange;
5286
+ this.onChangeEvent.emit(this.rangeDates);
5287
+ this.onChangeFn(this.rangeDates);
5288
+ this.onTouchedFn();
5289
+ }
5290
+ }
5291
+ currentMonthCallback(event) {
5292
+ const today = new Date();
5293
+ const startDate = new Date(today.getFullYear(), today.getMonth(), 1); // First day of month
5294
+ const lastDay = new Date(today.getFullYear(), today.getMonth() + 1, 0).getDate();
5295
+ const endDate = new Date(today.getFullYear(), today.getMonth(), lastDay); // Last day of month
5296
+ const dateRange = [startDate, endDate];
5297
+ this.activeButton = DATEPICKER_BUTTON_TYPES.CURRENT_MONTH;
5298
+ if (this.manualApply) {
5299
+ this.tempSelection = dateRange;
5300
+ }
5301
+ else {
5302
+ this.rangeDates = dateRange;
5303
+ this.onChangeEvent.emit(this.rangeDates);
5304
+ this.onChangeFn(this.rangeDates);
5305
+ this.onTouchedFn();
5306
+ }
5307
+ }
5308
+ // Helper method to check if a button should be shown
5309
+ shouldShowButton(buttonType) {
5310
+ return this.customButtons.includes(buttonType);
5311
+ }
5312
+ // Helper method to get button class
5313
+ getButtonClass(buttonType) {
5314
+ return this.activeButton === buttonType ? 'btnActive' : 'btnSecond';
5315
+ }
5316
+ ngAfterViewChecked() {
5317
+ // Sync viewYear with PrimeNG's internal year when in month view
5318
+ if (this.view === 'month' && this.datepickerRef && this.datepickerRef.currentYear !== undefined) {
5319
+ if (this.viewYear !== this.datepickerRef.currentYear) {
5320
+ // Use setTimeout to avoid ExpressionChangedAfterItHasBeenCheckedError
5321
+ setTimeout(() => {
5322
+ this.viewYear = this.datepickerRef.currentYear;
5323
+ }, 0);
5324
+ }
5325
+ }
5326
+ }
5327
+ setupHideOverlayOverride() {
5328
+ if (!this.datepickerRef) {
5329
+ return;
5330
+ }
5331
+ // Check if hideOverlay method exists
5332
+ if (!this.datepickerRef.hideOverlay) {
5333
+ return;
5334
+ }
5335
+ // Save the original method only once
5336
+ if (!this.datepickerRef._hideOverlayOriginal) {
5337
+ this.datepickerRef._hideOverlayOriginal = this.datepickerRef.hideOverlay.bind(this.datepickerRef);
5338
+ }
5339
+ // Override the hideOverlay method
5340
+ this.datepickerRef.hideOverlay = () => {
5341
+ // In manual apply mode, prevent auto-close only immediately after date selection
5342
+ if (this.manualApply && this.preventAutoClose) {
5343
+ return;
5344
+ }
5345
+ // In manual apply mode, if closing without Apply button (clicking outside)
5346
+ // Reset temp selection to original value BEFORE closing
5347
+ if (this.manualApply && !this.allowClose) {
5348
+ // Reset temp selection to discard changes
5349
+ this.tempSelection = this.rangeDates;
5350
+ // Update datepicker's internal value
5351
+ this.datepickerRef.value = this.rangeDates;
5352
+ }
5353
+ // Allow closing
5354
+ this.datepickerRef._hideOverlayOriginal();
5355
+ };
5356
+ }
5357
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DatepickerComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
5358
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.1", type: DatepickerComponent, isStandalone: true, selector: "intelica-datepicker", inputs: { readonlyInput: "readonlyInput", showIcon: "showIcon", numberOfMonths: "numberOfMonths", panelStyleClass: "panelStyleClass", manualApply: "manualApply", customButtons: "customButtons", dateFormat: "dateFormat", view: "view", selectionMode: "selectionMode" }, outputs: { onChangeEvent: "onChange" }, providers: [
5359
+ {
5360
+ provide: NG_VALUE_ACCESSOR,
5361
+ useExisting: forwardRef(() => DatepickerComponent),
5362
+ multi: true,
5363
+ },
5364
+ ], viewQueries: [{ propertyName: "datepickerRef", first: true, predicate: ["datepicker"], descendants: true }], ngImport: i0, template: "<p-datepicker\r\n\t#datepicker\r\n\t[class]=\"panelStyleClass\"\r\n\t[ngModel]=\"internalModel\"\r\n\t(ngModelChange)=\"onModelChange($event)\"\r\n\t[selectionMode]=\"selectionMode\"\r\n\t[numberOfMonths]=\"numberOfMonths\"\r\n\t[readonlyInput]=\"readonlyInput\"\r\n\t[showIcon]=\"showIcon\"\r\n\t[view]=\"view\"\r\n\t[dateFormat]=\"getDateFormat()\"\r\n\t[defaultDate]=\"defaultDate\"\r\n\t(onMonthChange)=\"onMonthChange($event)\"\r\n\t(onYearChange)=\"onYearChange($event)\"\r\n\t(onShow)=\"handleOpen()\"\r\n\t(onHide)=\"handleClose()\"\r\n\t>\r\n\r\n\t<ng-template pTemplate=\"header\">\r\n\t\t<div class=\"prDatapicker__header\">\r\n\t\t\t<div class=\"prDatapicker__content\">\r\n\r\n\t\t\t\t<!-- MES -->\r\n\t\t\t\t<p-select\r\n\t\t\t\t\t*ngIf=\"view === 'date'\"\r\n\t\t\t\t\tclass=\"prSelect\"\r\n\t\t\t\t\t[options]=\"filteredMonths\"\r\n\t\t\t\t\toptionLabel=\"label\"\r\n\t\t\t\t\toptionValue=\"value\"\r\n\t\t\t\t\t[(ngModel)]=\"viewMonth\"\r\n\t\t\t\t\t(ngModelChange)=\"onViewChange()\"\r\n\t\t\t\t\tdropdownIcon=\"icon icon-arrow-down\">\r\n\t\t\t\t</p-select>\r\n\r\n\t\t\t\t<!-- A\u00D1O -->\r\n\t\t\t\t<p-select\r\n\t\t\t\t\t*ngIf=\"view === 'date' || view === 'month'\"\r\n\t\t\t\t\tclass=\"prSelect\"\r\n\t\t\t\t\t[options]=\"years\"\r\n\t\t\t\t\t[(ngModel)]=\"viewYear\"\r\n\t\t\t\t\t(ngModelChange)=\"onViewChange()\"\r\n\t\t\t\t\tdropdownIcon=\"icon icon-arrow-down\"\r\n\t\t\t\t\t[virtualScroll]=\"true\"\r\n\t\t\t\t\t[virtualScrollItemSize]=\"38\">\r\n\t\t\t\t</p-select>\r\n\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</ng-template>\r\n\t<ng-template pTemplate=\"footer\" *ngIf=\"selectionMode === 'range'\">\r\n\t\t<div class=\"footerDatapicker footerDatapicker--range\">\r\n\t\t\t<div class=\"footerDatapicker__box\">\r\n\t\t\t\t<!-- TODAY button -->\r\n\t\t\t\t<p-button\r\n\t\t\t\t\t*ngIf=\"shouldShowButton(DATEPICKER_BUTTON_TYPES.TODAY)\"\r\n\t\t\t\t\t[class]=\"getButtonClass(DATEPICKER_BUTTON_TYPES.TODAY)\"\r\n\t\t\t\t\tlabel=\"Today\"\r\n\t\t\t\t\t(click)=\"todayCallback($event)\">\r\n\t\t\t\t</p-button>\r\n\t\t\t\t<!-- LAST 12 MONTHS button -->\r\n\t\t\t\t<p-button\r\n\t\t\t\t\t*ngIf=\"shouldShowButton(DATEPICKER_BUTTON_TYPES.LAST_12_MONTHS)\"\r\n\t\t\t\t\t[class]=\"getButtonClass(DATEPICKER_BUTTON_TYPES.LAST_12_MONTHS)\"\r\n\t\t\t\t\tlabel=\"Last 12 months\"\r\n\t\t\t\t\t(click)=\"last12MonthsCallback($event)\">\r\n\t\t\t\t</p-button>\r\n\t\t\t\t<!-- CURRENT YEAR button -->\r\n\t\t\t\t<p-button\r\n\t\t\t\t\t*ngIf=\"shouldShowButton(DATEPICKER_BUTTON_TYPES.CURRENT_YEAR)\"\r\n\t\t\t\t\t[class]=\"getButtonClass(DATEPICKER_BUTTON_TYPES.CURRENT_YEAR)\"\r\n\t\t\t\t\tlabel=\"Current year\"\r\n\t\t\t\t\t(click)=\"currentYearCallback($event)\">\r\n\t\t\t\t</p-button>\r\n\t\t\t\t<!-- CURRENT MONTH button -->\r\n\t\t\t\t<p-button\r\n\t\t\t\t\t*ngIf=\"shouldShowButton(DATEPICKER_BUTTON_TYPES.CURRENT_MONTH)\"\r\n\t\t\t\t\t[class]=\"getButtonClass(DATEPICKER_BUTTON_TYPES.CURRENT_MONTH)\"\r\n\t\t\t\t\tlabel=\"Current month\"\r\n\t\t\t\t\t(click)=\"currentMonthCallback($event)\">\r\n\t\t\t\t</p-button>\r\n\t\t\t</div>\r\n\t\t\t<div class=\"footerDatapicker__box\">\r\n\t\t\t\t<!-- Apply button - shown only in manual apply mode -->\r\n\t\t\t\t<p-button\r\n\t\t\t\t\t*ngIf=\"manualApply\"\r\n\t\t\t\t\tclass=\"btnPrimary\"\r\n\t\t\t\t\tlabel=\"Apply\"\r\n\t\t\t\t\t(click)=\"applyCallback($event)\">\r\n\t\t\t\t</p-button>\r\n\t\t\t\t<!-- Clear button - always shown -->\r\n\t\t\t\t<p-button\r\n\t\t\t\t\tclass=\"btnSecond\"\r\n\t\t\t\t\tlabel=\"Clear\"\r\n\t\t\t\t\t(click)=\"clearCallback($event)\">\r\n\t\t\t\t</p-button>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</ng-template>\r\n\r\n</p-datepicker>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: 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: SelectModule }, { kind: "component", type: i6.Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "panelStyle", "styleClass", "panelStyleClass", "readonly", "editable", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "filterValue", "options", "appendTo"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "directive", type: i3$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "buttonProps", "autofocus", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }] });
5365
+ }
5366
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DatepickerComponent, decorators: [{
5367
+ type: Component,
5368
+ args: [{ selector: "intelica-datepicker", imports: [CommonModule, FormsModule, DatePicker, SelectModule, ButtonModule], providers: [
5369
+ {
5370
+ provide: NG_VALUE_ACCESSOR,
5371
+ useExisting: forwardRef(() => DatepickerComponent),
5372
+ multi: true,
5373
+ },
5374
+ ], template: "<p-datepicker\r\n\t#datepicker\r\n\t[class]=\"panelStyleClass\"\r\n\t[ngModel]=\"internalModel\"\r\n\t(ngModelChange)=\"onModelChange($event)\"\r\n\t[selectionMode]=\"selectionMode\"\r\n\t[numberOfMonths]=\"numberOfMonths\"\r\n\t[readonlyInput]=\"readonlyInput\"\r\n\t[showIcon]=\"showIcon\"\r\n\t[view]=\"view\"\r\n\t[dateFormat]=\"getDateFormat()\"\r\n\t[defaultDate]=\"defaultDate\"\r\n\t(onMonthChange)=\"onMonthChange($event)\"\r\n\t(onYearChange)=\"onYearChange($event)\"\r\n\t(onShow)=\"handleOpen()\"\r\n\t(onHide)=\"handleClose()\"\r\n\t>\r\n\r\n\t<ng-template pTemplate=\"header\">\r\n\t\t<div class=\"prDatapicker__header\">\r\n\t\t\t<div class=\"prDatapicker__content\">\r\n\r\n\t\t\t\t<!-- MES -->\r\n\t\t\t\t<p-select\r\n\t\t\t\t\t*ngIf=\"view === 'date'\"\r\n\t\t\t\t\tclass=\"prSelect\"\r\n\t\t\t\t\t[options]=\"filteredMonths\"\r\n\t\t\t\t\toptionLabel=\"label\"\r\n\t\t\t\t\toptionValue=\"value\"\r\n\t\t\t\t\t[(ngModel)]=\"viewMonth\"\r\n\t\t\t\t\t(ngModelChange)=\"onViewChange()\"\r\n\t\t\t\t\tdropdownIcon=\"icon icon-arrow-down\">\r\n\t\t\t\t</p-select>\r\n\r\n\t\t\t\t<!-- A\u00D1O -->\r\n\t\t\t\t<p-select\r\n\t\t\t\t\t*ngIf=\"view === 'date' || view === 'month'\"\r\n\t\t\t\t\tclass=\"prSelect\"\r\n\t\t\t\t\t[options]=\"years\"\r\n\t\t\t\t\t[(ngModel)]=\"viewYear\"\r\n\t\t\t\t\t(ngModelChange)=\"onViewChange()\"\r\n\t\t\t\t\tdropdownIcon=\"icon icon-arrow-down\"\r\n\t\t\t\t\t[virtualScroll]=\"true\"\r\n\t\t\t\t\t[virtualScrollItemSize]=\"38\">\r\n\t\t\t\t</p-select>\r\n\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</ng-template>\r\n\t<ng-template pTemplate=\"footer\" *ngIf=\"selectionMode === 'range'\">\r\n\t\t<div class=\"footerDatapicker footerDatapicker--range\">\r\n\t\t\t<div class=\"footerDatapicker__box\">\r\n\t\t\t\t<!-- TODAY button -->\r\n\t\t\t\t<p-button\r\n\t\t\t\t\t*ngIf=\"shouldShowButton(DATEPICKER_BUTTON_TYPES.TODAY)\"\r\n\t\t\t\t\t[class]=\"getButtonClass(DATEPICKER_BUTTON_TYPES.TODAY)\"\r\n\t\t\t\t\tlabel=\"Today\"\r\n\t\t\t\t\t(click)=\"todayCallback($event)\">\r\n\t\t\t\t</p-button>\r\n\t\t\t\t<!-- LAST 12 MONTHS button -->\r\n\t\t\t\t<p-button\r\n\t\t\t\t\t*ngIf=\"shouldShowButton(DATEPICKER_BUTTON_TYPES.LAST_12_MONTHS)\"\r\n\t\t\t\t\t[class]=\"getButtonClass(DATEPICKER_BUTTON_TYPES.LAST_12_MONTHS)\"\r\n\t\t\t\t\tlabel=\"Last 12 months\"\r\n\t\t\t\t\t(click)=\"last12MonthsCallback($event)\">\r\n\t\t\t\t</p-button>\r\n\t\t\t\t<!-- CURRENT YEAR button -->\r\n\t\t\t\t<p-button\r\n\t\t\t\t\t*ngIf=\"shouldShowButton(DATEPICKER_BUTTON_TYPES.CURRENT_YEAR)\"\r\n\t\t\t\t\t[class]=\"getButtonClass(DATEPICKER_BUTTON_TYPES.CURRENT_YEAR)\"\r\n\t\t\t\t\tlabel=\"Current year\"\r\n\t\t\t\t\t(click)=\"currentYearCallback($event)\">\r\n\t\t\t\t</p-button>\r\n\t\t\t\t<!-- CURRENT MONTH button -->\r\n\t\t\t\t<p-button\r\n\t\t\t\t\t*ngIf=\"shouldShowButton(DATEPICKER_BUTTON_TYPES.CURRENT_MONTH)\"\r\n\t\t\t\t\t[class]=\"getButtonClass(DATEPICKER_BUTTON_TYPES.CURRENT_MONTH)\"\r\n\t\t\t\t\tlabel=\"Current month\"\r\n\t\t\t\t\t(click)=\"currentMonthCallback($event)\">\r\n\t\t\t\t</p-button>\r\n\t\t\t</div>\r\n\t\t\t<div class=\"footerDatapicker__box\">\r\n\t\t\t\t<!-- Apply button - shown only in manual apply mode -->\r\n\t\t\t\t<p-button\r\n\t\t\t\t\t*ngIf=\"manualApply\"\r\n\t\t\t\t\tclass=\"btnPrimary\"\r\n\t\t\t\t\tlabel=\"Apply\"\r\n\t\t\t\t\t(click)=\"applyCallback($event)\">\r\n\t\t\t\t</p-button>\r\n\t\t\t\t<!-- Clear button - always shown -->\r\n\t\t\t\t<p-button\r\n\t\t\t\t\tclass=\"btnSecond\"\r\n\t\t\t\t\tlabel=\"Clear\"\r\n\t\t\t\t\t(click)=\"clearCallback($event)\">\r\n\t\t\t\t</p-button>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</ng-template>\r\n\r\n</p-datepicker>\r\n" }]
5375
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { readonlyInput: [{
5376
+ type: Input
5377
+ }], showIcon: [{
5378
+ type: Input
5379
+ }], numberOfMonths: [{
5380
+ type: Input
5381
+ }], panelStyleClass: [{
5382
+ type: Input
5383
+ }], manualApply: [{
5384
+ type: Input
5385
+ }], customButtons: [{
5386
+ type: Input
5387
+ }], dateFormat: [{
5388
+ type: Input
5389
+ }], view: [{
5390
+ type: Input
5391
+ }], selectionMode: [{
5392
+ type: Input
5393
+ }], onChangeEvent: [{
5394
+ type: Output,
5395
+ args: ["onChange"]
5396
+ }], datepickerRef: [{
5397
+ type: ViewChild,
5398
+ args: ['datepicker']
5399
+ }] } });
5400
+
4920
5401
  class SkeletonService {
4921
5402
  isLoading = signal(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
4922
5403
  hide() {
@@ -5348,6 +5829,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
5348
5829
  type: Input
5349
5830
  }] } });
5350
5831
 
5832
+ class IntelicaAlertComponent {
5833
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: IntelicaAlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
5834
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.1", type: IntelicaAlertComponent, isStandalone: true, selector: "intelica-alert", ngImport: i0, template: "<p-confirmDialog key=\"intelica-alert-dialog\" [style]=\"{width: 'auto', 'max-width': '90cw'}\" [closable]=\"false\"\r\n [visible]=\"undefined\">\r\n <!-- \r\n We use the headless template. \r\n 'message' contains the confirmation object.\r\n 'message.data' contains our custom 'presentationData' object from AlertService.\r\n -->\r\n <ng-template pTemplate=\"headless\" let-message let-onAccept=\"onAccept\" let-onReject=\"onReject\">\r\n <div [style]=\"message.data.dialogStyle\"\r\n style=\"background: white; display: flex; flex-direction: column; align-items: center; padding: 2rem; position: relative; text-align: center;\">\r\n\r\n <!-- Close Button -->\r\n @if (message.data.config.showCloseButton) {\r\n <button type=\"button\"\r\n style=\"position: absolute; top: 0.75rem; right: 0.75rem; background: transparent; border: none; cursor: pointer; padding: 0.5rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: background-color 0.2s;\"\r\n (click)=\"onReject()\" aria-label=\"Cerrar\">\r\n <i class=\"pi pi-times\" style=\"font-size: 1.25rem; color: #6c757d;\"></i>\r\n </button>\r\n }\r\n\r\n <!-- Icon -->\r\n <div [style.backgroundColor]=\"message.data.iconBackgroundColor\"\r\n style=\"width: 80px; height: 80px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 1.5rem;\">\r\n @if (message.data.config.customImageUrl) {\r\n <img [src]=\"message.data.config.customImageUrl\" style=\"width: 60px; height: 60px; object-fit: contain;\"\r\n alt=\"Alert icon\" />\r\n } @else {\r\n <i [class]=\"message.data.iconClass\" [style.color]=\"message.data.iconColor\"\r\n style=\"font-size: 2.5rem;\"></i>\r\n }\r\n </div>\r\n\r\n <!-- Title -->\r\n <h2 [style.color]=\"message.data.titleColor\"\r\n style=\"margin: 0 0 0.75rem 0; font-size: 1.5rem; font-weight: 600;\">{{ message.header }}</h2>\r\n\r\n <!-- Subtitle / Message -->\r\n @if (message.message) {\r\n <p [style.color]=\"message.data.config.styles?.subtitleColor ?? '#555'\"\r\n style=\"margin: 0 0 1.5rem 0; font-size: 1rem; line-height: 1.5;\">{{ message.message }}</p>\r\n }\r\n\r\n <!-- HTML Content -->\r\n @if (message.data.config.htmlContent) {\r\n <div [innerHTML]=\"message.data.config.htmlContent\"\r\n [style.color]=\"message.data.config.styles?.subtitleColor ?? '#555'\"\r\n style=\"margin-bottom: 1.5rem; width: 100%;\"></div>\r\n }\r\n\r\n <!-- Buttons -->\r\n <div style=\"display: flex; gap: 0.75rem; justify-content: center; width: 100%; margin-top: 0.5rem;\">\r\n <!-- Cancel Button -->\r\n @if (message.data.showCancelButton) {\r\n <p-button [label]=\"message.data.cancelText\" [style]=\"message.data.cancelButtonStyle\"\r\n severity=\"secondary\" [outlined]=\"true\" (onClick)=\"onReject()\" />\r\n }\r\n <!-- Confirm Button -->\r\n <p-button [label]=\"message.data.confirmText\" [style]=\"message.data.confirmButtonStyle\"\r\n (onClick)=\"onAccept()\" />\r\n </div>\r\n </div>\r\n </ng-template>\r\n</p-confirmDialog>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ConfirmDialogModule }, { kind: "component", type: i1$3.ConfirmDialog, selector: "p-confirmDialog, p-confirmdialog, p-confirm-dialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "closeAriaLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "visible", "position", "draggable"], outputs: ["onHide"] }, { kind: "directive", type: i3$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "buttonProps", "autofocus", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }] });
5835
+ }
5836
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: IntelicaAlertComponent, decorators: [{
5837
+ type: Component,
5838
+ args: [{ selector: "intelica-alert", standalone: true, imports: [CommonModule, ConfirmDialogModule, ButtonModule], template: "<p-confirmDialog key=\"intelica-alert-dialog\" [style]=\"{width: 'auto', 'max-width': '90cw'}\" [closable]=\"false\"\r\n [visible]=\"undefined\">\r\n <!-- \r\n We use the headless template. \r\n 'message' contains the confirmation object.\r\n 'message.data' contains our custom 'presentationData' object from AlertService.\r\n -->\r\n <ng-template pTemplate=\"headless\" let-message let-onAccept=\"onAccept\" let-onReject=\"onReject\">\r\n <div [style]=\"message.data.dialogStyle\"\r\n style=\"background: white; display: flex; flex-direction: column; align-items: center; padding: 2rem; position: relative; text-align: center;\">\r\n\r\n <!-- Close Button -->\r\n @if (message.data.config.showCloseButton) {\r\n <button type=\"button\"\r\n style=\"position: absolute; top: 0.75rem; right: 0.75rem; background: transparent; border: none; cursor: pointer; padding: 0.5rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: background-color 0.2s;\"\r\n (click)=\"onReject()\" aria-label=\"Cerrar\">\r\n <i class=\"pi pi-times\" style=\"font-size: 1.25rem; color: #6c757d;\"></i>\r\n </button>\r\n }\r\n\r\n <!-- Icon -->\r\n <div [style.backgroundColor]=\"message.data.iconBackgroundColor\"\r\n style=\"width: 80px; height: 80px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 1.5rem;\">\r\n @if (message.data.config.customImageUrl) {\r\n <img [src]=\"message.data.config.customImageUrl\" style=\"width: 60px; height: 60px; object-fit: contain;\"\r\n alt=\"Alert icon\" />\r\n } @else {\r\n <i [class]=\"message.data.iconClass\" [style.color]=\"message.data.iconColor\"\r\n style=\"font-size: 2.5rem;\"></i>\r\n }\r\n </div>\r\n\r\n <!-- Title -->\r\n <h2 [style.color]=\"message.data.titleColor\"\r\n style=\"margin: 0 0 0.75rem 0; font-size: 1.5rem; font-weight: 600;\">{{ message.header }}</h2>\r\n\r\n <!-- Subtitle / Message -->\r\n @if (message.message) {\r\n <p [style.color]=\"message.data.config.styles?.subtitleColor ?? '#555'\"\r\n style=\"margin: 0 0 1.5rem 0; font-size: 1rem; line-height: 1.5;\">{{ message.message }}</p>\r\n }\r\n\r\n <!-- HTML Content -->\r\n @if (message.data.config.htmlContent) {\r\n <div [innerHTML]=\"message.data.config.htmlContent\"\r\n [style.color]=\"message.data.config.styles?.subtitleColor ?? '#555'\"\r\n style=\"margin-bottom: 1.5rem; width: 100%;\"></div>\r\n }\r\n\r\n <!-- Buttons -->\r\n <div style=\"display: flex; gap: 0.75rem; justify-content: center; width: 100%; margin-top: 0.5rem;\">\r\n <!-- Cancel Button -->\r\n @if (message.data.showCancelButton) {\r\n <p-button [label]=\"message.data.cancelText\" [style]=\"message.data.cancelButtonStyle\"\r\n severity=\"secondary\" [outlined]=\"true\" (onClick)=\"onReject()\" />\r\n }\r\n <!-- Confirm Button -->\r\n <p-button [label]=\"message.data.confirmText\" [style]=\"message.data.confirmButtonStyle\"\r\n (onClick)=\"onAccept()\" />\r\n </div>\r\n </div>\r\n </ng-template>\r\n</p-confirmDialog>\r\n" }]
5839
+ }] });
5840
+
5351
5841
  class CheckboxFilterDirective extends FilterDirective {
5352
5842
  constructor() {
5353
5843
  super(FilterTypeEnum.Checkbox);
@@ -5814,6 +6304,50 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
5814
6304
  args: ["onChange", ["$event"]]
5815
6305
  }] } });
5816
6306
 
6307
+ /**
6308
+ * Default configuration values for alerts.
6309
+ */
6310
+ const ALERT_DEFAULTS = {
6311
+ buttonMode: AlertButtonMode.OK_ONLY,
6312
+ showCloseButton: true,
6313
+ buttons: {
6314
+ confirmText: "Ok",
6315
+ cancelText: "Cancelar",
6316
+ },
6317
+ };
6318
+ /**
6319
+ * Paths to custom SVG icons for alerts.
6320
+ * Icons should be placed in: public/assets/icons/alerts/
6321
+ */
6322
+ const ALERT_ICON_PATHS = {
6323
+ error: "/assets/icons/alerts/alert-error.svg",
6324
+ // warning: "/assets/icons/alerts/alert-warning.svg",
6325
+ // success: "/assets/icons/alerts/alert-success.svg",
6326
+ };
6327
+ /**
6328
+ * Centralized configuration for each alert type using PrimeNG icons.
6329
+ */
6330
+ const ALERT_TYPE_CONFIG = {
6331
+ [AlertType.WARNING]: {
6332
+ titleColor: "#f0ad4e",
6333
+ icon: "pi pi-exclamation-triangle",
6334
+ iconBackgroundColor: "#fff3cd",
6335
+ iconColor: "#f0ad4e",
6336
+ },
6337
+ [AlertType.SUCCESS]: {
6338
+ titleColor: "#5cb85c",
6339
+ icon: "pi pi-check-circle",
6340
+ iconBackgroundColor: "#d4edda",
6341
+ iconColor: "#5cb85c",
6342
+ },
6343
+ [AlertType.ERROR]: {
6344
+ titleColor: "#d9534f",
6345
+ icon: "pi pi-times-circle",
6346
+ iconBackgroundColor: "#f8d7da",
6347
+ iconColor: "#d9534f",
6348
+ },
6349
+ };
6350
+
5817
6351
  class HtmlToExcelService {
5818
6352
  ExportTOExcel(idTabla, html, filename, tabname, extension) {
5819
6353
  let Table = document.getElementById(idTabla);
@@ -6207,6 +6741,239 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
6207
6741
  }]
6208
6742
  }] });
6209
6743
 
6744
+ class AlertService {
6745
+ confirmationService = inject(ConfirmationService);
6746
+ DIALOG_KEY = 'intelica-alert-dialog';
6747
+ /**
6748
+ * Displays a warning alert with yellow styling.
6749
+ * Can be called with (title, subtitle, buttonMode, buttons) OR (title, subtitle, buttons).
6750
+ */
6751
+ warning(title, subtitle, modeOrButtons, buttons) {
6752
+ const { buttonMode, buttonConfig } = this.resolveArgs(modeOrButtons, buttons);
6753
+ return this.show({
6754
+ type: AlertType.WARNING,
6755
+ title,
6756
+ subtitle,
6757
+ buttonMode,
6758
+ buttons: buttonConfig,
6759
+ });
6760
+ }
6761
+ /**
6762
+ * Displays a success alert with green styling.
6763
+ * Can be called with (title, subtitle, buttonMode, buttons) OR (title, subtitle, buttons).
6764
+ */
6765
+ success(title, subtitle, modeOrButtons, buttons) {
6766
+ const { buttonMode, buttonConfig } = this.resolveArgs(modeOrButtons, buttons);
6767
+ return this.show({
6768
+ type: AlertType.SUCCESS,
6769
+ title,
6770
+ subtitle,
6771
+ buttonMode,
6772
+ buttons: buttonConfig,
6773
+ });
6774
+ }
6775
+ /**
6776
+ * Displays an error alert with red styling.
6777
+ * Can be called with (title, subtitle, buttonMode, buttons) OR (title, subtitle, buttons).
6778
+ */
6779
+ error(title, subtitle, modeOrButtons, buttons) {
6780
+ const { buttonMode, buttonConfig } = this.resolveArgs(modeOrButtons, buttons);
6781
+ return this.show({
6782
+ type: AlertType.ERROR,
6783
+ title,
6784
+ subtitle,
6785
+ buttonMode,
6786
+ buttons: buttonConfig,
6787
+ });
6788
+ }
6789
+ /**
6790
+ * Helper to resolve flexible arguments.
6791
+ * If 3rd arg is object (not string enum), treat it as buttons config and default mode to OK_ONLY.
6792
+ * If 3rd arg is string (enum), treat it as mode and 4th as buttons config.
6793
+ */
6794
+ resolveArgs(modeOrButtons, buttons) {
6795
+ if (modeOrButtons && typeof modeOrButtons === 'object') {
6796
+ // USAGE: success(title, subtitle, { confirmText: 'Ok', cancelText: 'Cancel' })
6797
+ // Auto-detect mode based on presence of cancelText
6798
+ const hasCancel = !!modeOrButtons.cancelText;
6799
+ return {
6800
+ buttonMode: hasCancel ? AlertButtonMode.CONFIRM_CANCEL : AlertButtonMode.OK_ONLY,
6801
+ buttonConfig: modeOrButtons
6802
+ };
6803
+ }
6804
+ // USAGE: success(title, subtitle, AlertButtonMode.CONFIRM_CANCEL, { ... })
6805
+ // OR default
6806
+ return {
6807
+ buttonMode: modeOrButtons ?? AlertButtonMode.OK_ONLY,
6808
+ buttonConfig: buttons
6809
+ };
6810
+ }
6811
+ message(message, type = AlertType.WARNING) {
6812
+ return this.show({
6813
+ type,
6814
+ title: message,
6815
+ buttonMode: AlertButtonMode.OK_ONLY,
6816
+ });
6817
+ }
6818
+ confirm(title, subtitle, confirmText = "Confirmar", cancelText = "Cancelar", type = AlertType.WARNING) {
6819
+ return this.show({
6820
+ type,
6821
+ title,
6822
+ subtitle,
6823
+ buttonMode: AlertButtonMode.CONFIRM_CANCEL,
6824
+ buttons: { confirmText, cancelText },
6825
+ });
6826
+ }
6827
+ showHtml(title, htmlContent, type = AlertType.WARNING, buttonMode = AlertButtonMode.OK_ONLY) {
6828
+ return this.show({
6829
+ type,
6830
+ title,
6831
+ htmlContent,
6832
+ buttonMode,
6833
+ });
6834
+ }
6835
+ showWithStyles(config, styles) {
6836
+ return this.show({
6837
+ ...config,
6838
+ styles,
6839
+ });
6840
+ }
6841
+ show(config) {
6842
+ return new Promise((resolve) => {
6843
+ const mergedConfig = this.mergeWithDefaults(config);
6844
+ const typeConfig = ALERT_TYPE_CONFIG[mergedConfig.type];
6845
+ // Prepare data object for the view
6846
+ const data = {
6847
+ config: mergedConfig,
6848
+ typeConfig: typeConfig,
6849
+ iconClass: this.getIconClass(mergedConfig, typeConfig),
6850
+ iconBackgroundColor: this.getIconBackgroundColor(mergedConfig, typeConfig),
6851
+ iconColor: this.getIconColor(mergedConfig, typeConfig),
6852
+ titleColor: this.getTitleColor(mergedConfig, typeConfig),
6853
+ showCancelButton: this.showCancelButton(mergedConfig),
6854
+ confirmText: this.getConfirmText(mergedConfig),
6855
+ cancelText: this.getCancelText(mergedConfig),
6856
+ dialogStyle: {
6857
+ width: mergedConfig.styles?.width ?? "400px",
6858
+ maxWidth: "90vw",
6859
+ borderRadius: "12px",
6860
+ overflow: "hidden",
6861
+ },
6862
+ confirmButtonStyle: this.getConfirmButtonStyle(mergedConfig),
6863
+ cancelButtonStyle: this.getCancelButtonStyle(mergedConfig),
6864
+ // Add manual dismiss handler to data so template can call it if needed,
6865
+ // though explicit close button in template can just use reject or logic.
6866
+ // For custom headers/X buttons usually we initiate close.
6867
+ };
6868
+ const confirmation = {
6869
+ key: this.DIALOG_KEY,
6870
+ message: mergedConfig.subtitle,
6871
+ header: mergedConfig.title,
6872
+ icon: data.iconClass,
6873
+ dismissableMask: true,
6874
+ closeOnEscape: true,
6875
+ accept: () => {
6876
+ resolve({
6877
+ isConfirmed: true,
6878
+ isCancelled: false,
6879
+ isDismissed: false,
6880
+ });
6881
+ },
6882
+ reject: (type) => {
6883
+ resolve({
6884
+ isConfirmed: false,
6885
+ isCancelled: true,
6886
+ isDismissed: false,
6887
+ });
6888
+ },
6889
+ };
6890
+ // Cast to any to allow 'data' property if it doesn't exist on type
6891
+ confirmation.data = data;
6892
+ this.confirmationService.confirm(confirmation);
6893
+ });
6894
+ }
6895
+ // Private Helper Methods (Presentation Logic)
6896
+ mergeWithDefaults(config) {
6897
+ return {
6898
+ ...ALERT_DEFAULTS,
6899
+ ...config,
6900
+ buttons: {
6901
+ ...ALERT_DEFAULTS.buttons,
6902
+ ...config.buttons,
6903
+ },
6904
+ };
6905
+ }
6906
+ getIconClass(config, typeConfig) {
6907
+ if (config?.customIcon) {
6908
+ return config.customIcon;
6909
+ }
6910
+ return typeConfig?.icon ?? "pi pi-info-circle";
6911
+ }
6912
+ getIconBackgroundColor(config, typeConfig) {
6913
+ if (config?.styles?.iconBackgroundColor) {
6914
+ return config.styles.iconBackgroundColor;
6915
+ }
6916
+ return typeConfig?.iconBackgroundColor ?? "#e3f2fd";
6917
+ }
6918
+ getIconColor(config, typeConfig) {
6919
+ if (config?.styles?.iconColor) {
6920
+ return config.styles.iconColor;
6921
+ }
6922
+ return typeConfig?.iconColor ?? "#1976d2";
6923
+ }
6924
+ getTitleColor(config, typeConfig) {
6925
+ if (config?.styles?.titleColor) {
6926
+ return config.styles.titleColor;
6927
+ }
6928
+ return typeConfig?.titleColor ?? "#333";
6929
+ }
6930
+ showCancelButton(config) {
6931
+ return config?.buttonMode === AlertButtonMode.CONFIRM_CANCEL;
6932
+ }
6933
+ getConfirmText(config) {
6934
+ return config?.buttons?.confirmText ?? "Ok";
6935
+ }
6936
+ getCancelText(config) {
6937
+ return config?.buttons?.cancelText ?? "Cancelar";
6938
+ }
6939
+ getConfirmButtonStyle(config) {
6940
+ const styles = config?.styles;
6941
+ const baseStyle = {
6942
+ minWidth: "120px",
6943
+ };
6944
+ if (styles?.confirmButtonColor) {
6945
+ baseStyle["backgroundColor"] = styles.confirmButtonColor;
6946
+ baseStyle["borderColor"] = styles.confirmButtonColor;
6947
+ }
6948
+ if (styles?.confirmButtonTextColor) {
6949
+ baseStyle["color"] = styles.confirmButtonTextColor;
6950
+ }
6951
+ return baseStyle;
6952
+ }
6953
+ getCancelButtonStyle(config) {
6954
+ const styles = config?.styles;
6955
+ const baseStyle = {
6956
+ minWidth: "120px",
6957
+ };
6958
+ if (styles?.cancelButtonColor) {
6959
+ baseStyle["backgroundColor"] = styles.cancelButtonColor;
6960
+ baseStyle["borderColor"] = styles.cancelButtonColor;
6961
+ }
6962
+ if (styles?.cancelButtonTextColor) {
6963
+ baseStyle["color"] = styles.cancelButtonTextColor;
6964
+ }
6965
+ return baseStyle;
6966
+ }
6967
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: AlertService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
6968
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: AlertService, providedIn: "root" });
6969
+ }
6970
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: AlertService, decorators: [{
6971
+ type: Injectable,
6972
+ args: [{
6973
+ providedIn: "root",
6974
+ }]
6975
+ }] });
6976
+
6210
6977
  class LanguageService {
6211
6978
  _http = inject(HttpClient);
6212
6979
  _configService = inject(ConfigService);
@@ -6506,19 +7273,19 @@ class EchartService {
6506
7273
  lines.push(current);
6507
7274
  return prefix + lines.map((ln, i) => (i === 0 ? ln : `${sangria}${ln}`)).join('\n');
6508
7275
  };
6509
- y.inverse = true;
6510
- y.axisLabel = {
6511
- ...y.axisLabel,
6512
- color: Color.blue,
6513
- fontSize: 12,
6514
- width: categoryWidth,
6515
- overflow: "break",
6516
- align: "left",
6517
- verticalAlign: "middle",
6518
- margin: categoryWidth + 30,
6519
- lineHeight: 16,
6520
- formatter: categoryFormatter || defaultCategoryFormatter,
6521
- };
7276
+ // y.inverse = true;
7277
+ // y.axisLabel = {
7278
+ // ...y.axisLabel,
7279
+ // color: Color.blue,
7280
+ // fontSize: 12,
7281
+ // width: categoryWidth,
7282
+ // overflow: "break",
7283
+ // align: "left",
7284
+ // verticalAlign: "middle",
7285
+ // margin: categoryWidth + 30,
7286
+ // lineHeight: 16,
7287
+ // formatter: categoryFormatter || defaultCategoryFormatter,
7288
+ // };
6522
7289
  gr.top = "0%";
6523
7290
  gr.left = -1 * categoryWidth + 60;
6524
7291
  gr.right = 20;
@@ -9190,5 +9957,5 @@ const IntelicaTheme = definePreset(Aura, {
9190
9957
  * Generated bundle index. Do not edit.
9191
9958
  */
9192
9959
 
9193
- export { ActionDirective, ActionsMenuComponent, ButtonSplitComponent, CheckboxFilterDirective, Color, ColumnComponent, ColumnGroupComponent, CompareByField, ConfigService, CookieAttributesGeneral, DataDirective, DateFilterDirective, DateModeOptions, DynamicInputValidation, EchartComponent, EchartService, ElementService, EmailInputValidation, ErrorInterceptor, FeatureFlagService, FilterChipsComponent, FiltersComponent, FormatAmountPipe, GetCookieAttributes, GlobalFeatureFlagService, GlobalTermService, HtmlToExcelService, InitializeConfigService, InputValidation, IntelicaCellCheckboxDirective, IntelicaTheme, ItemSplitDirective, LanguageService, MatrixColumnComponent, MatrixColumnGroupComponent, MatrixTableComponent, ModalDialogComponent, MultiSelectComponent, OrderConstants, PaginatorComponent, Patterns, PopoverComponent, ProfileService, RecordPerPageComponent, RefreshTokenInterceptor, RouteGuard, RowResumenComponent, RowResumenTreeComponent, SearchComponent, SelectDetailFilterDirective, SelectFilterDirective, SharedService, SkeletonChartComponent, SkeletonComponent, SkeletonService, SkeletonTableComponent, SortingComponent, SpinnerComponent, SpinnerService, SweetAlertService, TableComponent, TableFetchComponent, TableSortOrder, TemplateDirective, TemplateMenuComponent, TermGuard, TermPipe, TermService, TextAreaFilterDirective, TextFilterDirective, TextRangeFilterDirective, TreeColumnComponent, TreeColumnGroupComponent, TreeTableComponent, TruncatePipe, decryptData, encryptData, getColor };
9960
+ export { ALERT_DEFAULTS, ALERT_ICON_PATHS, ALERT_TYPE_CONFIG, ActionDirective, ActionsMenuComponent, AlertButtonMode, AlertService, AlertType, ButtonSplitComponent, CheckboxFilterDirective, Color, ColumnComponent, ColumnGroupComponent, CompareByField, ConfigService, CookieAttributesGeneral, DATEPICKER_BUTTON_TYPES, DataDirective, DateFilterDirective, DateModeOptions, DatepickerComponent, DynamicInputValidation, EchartComponent, EchartService, ElementService, EmailInputValidation, ErrorInterceptor, FeatureFlagService, FilterChipsComponent, FiltersComponent, FormatAmountPipe, GetCookieAttributes, GlobalFeatureFlagService, GlobalTermService, HtmlToExcelService, InitializeConfigService, InputValidation, IntelicaAlertComponent, IntelicaCellCheckboxDirective, IntelicaTheme, ItemSplitDirective, LanguageService, MatrixColumnComponent, MatrixColumnGroupComponent, MatrixTableComponent, ModalDialogComponent, MultiSelectComponent, OrderConstants, PaginatorComponent, Patterns, PopoverComponent, ProfileService, RecordPerPageComponent, RefreshTokenInterceptor, RouteGuard, RowResumenComponent, RowResumenTreeComponent, SearchComponent, SelectDetailFilterDirective, SelectFilterDirective, SharedService, SkeletonChartComponent, SkeletonComponent, SkeletonService, SkeletonTableComponent, SortingComponent, SpinnerComponent, SpinnerService, SweetAlertService, TableComponent, TableFetchComponent, TableSortOrder, TemplateDirective, TemplateMenuComponent, TermGuard, TermPipe, TermService, TextAreaFilterDirective, TextFilterDirective, TextRangeFilterDirective, TreeColumnComponent, TreeColumnGroupComponent, TreeTableComponent, TruncatePipe, decryptData, encryptData, getColor };
9194
9961
  //# sourceMappingURL=intelica-library-components.mjs.map