@exhaustive-ui/core 22.0.0-alpha.10 → 22.0.0-alpha.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.
Files changed (122) hide show
  1. package/fesm2022/exhaustive-ui-core-autocomplete.mjs +5 -5
  2. package/fesm2022/exhaustive-ui-core-autocomplete.mjs.map +1 -1
  3. package/fesm2022/exhaustive-ui-core-basecomponent.mjs +6 -1
  4. package/fesm2022/exhaustive-ui-core-basecomponent.mjs.map +1 -1
  5. package/fesm2022/exhaustive-ui-core-breadcrumb.mjs +11 -4
  6. package/fesm2022/exhaustive-ui-core-breadcrumb.mjs.map +1 -1
  7. package/fesm2022/exhaustive-ui-core-card.mjs +0 -4
  8. package/fesm2022/exhaustive-ui-core-card.mjs.map +1 -1
  9. package/fesm2022/exhaustive-ui-core-cascadeselect.mjs +5 -5
  10. package/fesm2022/exhaustive-ui-core-cascadeselect.mjs.map +1 -1
  11. package/fesm2022/exhaustive-ui-core-chart.mjs.map +1 -1
  12. package/fesm2022/exhaustive-ui-core-confirmdialog.mjs +11 -9
  13. package/fesm2022/exhaustive-ui-core-confirmdialog.mjs.map +1 -1
  14. package/fesm2022/exhaustive-ui-core-confirmpopup.mjs +18 -1
  15. package/fesm2022/exhaustive-ui-core-confirmpopup.mjs.map +1 -1
  16. package/fesm2022/exhaustive-ui-core-contextmenu.mjs +6 -4
  17. package/fesm2022/exhaustive-ui-core-contextmenu.mjs.map +1 -1
  18. package/fesm2022/exhaustive-ui-core-datepicker.mjs +42 -7
  19. package/fesm2022/exhaustive-ui-core-datepicker.mjs.map +1 -1
  20. package/fesm2022/exhaustive-ui-core-dialog.mjs +2 -1
  21. package/fesm2022/exhaustive-ui-core-dialog.mjs.map +1 -1
  22. package/fesm2022/exhaustive-ui-core-drawer.mjs +11 -2
  23. package/fesm2022/exhaustive-ui-core-drawer.mjs.map +1 -1
  24. package/fesm2022/exhaustive-ui-core-fieldset.mjs +2 -2
  25. package/fesm2022/exhaustive-ui-core-fieldset.mjs.map +1 -1
  26. package/fesm2022/exhaustive-ui-core-fileupload.mjs +22 -11
  27. package/fesm2022/exhaustive-ui-core-fileupload.mjs.map +1 -1
  28. package/fesm2022/exhaustive-ui-core-iconfield.mjs +16 -1
  29. package/fesm2022/exhaustive-ui-core-iconfield.mjs.map +1 -1
  30. package/fesm2022/exhaustive-ui-core-inputgroup.mjs +9 -0
  31. package/fesm2022/exhaustive-ui-core-inputgroup.mjs.map +1 -1
  32. package/fesm2022/exhaustive-ui-core-inputnumber.mjs +54 -21
  33. package/fesm2022/exhaustive-ui-core-inputnumber.mjs.map +1 -1
  34. package/fesm2022/exhaustive-ui-core-inputtext.mjs +6 -5
  35. package/fesm2022/exhaustive-ui-core-inputtext.mjs.map +1 -1
  36. package/fesm2022/exhaustive-ui-core-listbox.mjs +4 -2
  37. package/fesm2022/exhaustive-ui-core-listbox.mjs.map +1 -1
  38. package/fesm2022/exhaustive-ui-core-megamenu.mjs +1 -0
  39. package/fesm2022/exhaustive-ui-core-megamenu.mjs.map +1 -1
  40. package/fesm2022/exhaustive-ui-core-menu.mjs +2 -2
  41. package/fesm2022/exhaustive-ui-core-menu.mjs.map +1 -1
  42. package/fesm2022/exhaustive-ui-core-metergroup.mjs +5 -5
  43. package/fesm2022/exhaustive-ui-core-metergroup.mjs.map +1 -1
  44. package/fesm2022/exhaustive-ui-core-multiselect.mjs +25 -14
  45. package/fesm2022/exhaustive-ui-core-multiselect.mjs.map +1 -1
  46. package/fesm2022/exhaustive-ui-core-orderlist.mjs +9 -2
  47. package/fesm2022/exhaustive-ui-core-orderlist.mjs.map +1 -1
  48. package/fesm2022/exhaustive-ui-core-overlaybadge.mjs +2 -2
  49. package/fesm2022/exhaustive-ui-core-overlaybadge.mjs.map +1 -1
  50. package/fesm2022/exhaustive-ui-core-paginator.mjs +4 -1
  51. package/fesm2022/exhaustive-ui-core-paginator.mjs.map +1 -1
  52. package/fesm2022/exhaustive-ui-core-panelmenu.mjs +7 -1
  53. package/fesm2022/exhaustive-ui-core-panelmenu.mjs.map +1 -1
  54. package/fesm2022/exhaustive-ui-core-password.mjs +34 -14
  55. package/fesm2022/exhaustive-ui-core-password.mjs.map +1 -1
  56. package/fesm2022/exhaustive-ui-core-picklist.mjs +4 -4
  57. package/fesm2022/exhaustive-ui-core-picklist.mjs.map +1 -1
  58. package/fesm2022/exhaustive-ui-core-popover.mjs +26 -7
  59. package/fesm2022/exhaustive-ui-core-popover.mjs.map +1 -1
  60. package/fesm2022/exhaustive-ui-core-select.mjs +20 -14
  61. package/fesm2022/exhaustive-ui-core-select.mjs.map +1 -1
  62. package/fesm2022/exhaustive-ui-core-selectbutton.mjs +10 -6
  63. package/fesm2022/exhaustive-ui-core-selectbutton.mjs.map +1 -1
  64. package/fesm2022/exhaustive-ui-core-slider.mjs +7 -3
  65. package/fesm2022/exhaustive-ui-core-slider.mjs.map +1 -1
  66. package/fesm2022/exhaustive-ui-core-splitter.mjs +5 -0
  67. package/fesm2022/exhaustive-ui-core-splitter.mjs.map +1 -1
  68. package/fesm2022/exhaustive-ui-core-stepper.mjs +3 -0
  69. package/fesm2022/exhaustive-ui-core-stepper.mjs.map +1 -1
  70. package/fesm2022/exhaustive-ui-core-table.mjs +97 -65
  71. package/fesm2022/exhaustive-ui-core-table.mjs.map +1 -1
  72. package/fesm2022/exhaustive-ui-core-tabs.mjs +37 -7
  73. package/fesm2022/exhaustive-ui-core-tabs.mjs.map +1 -1
  74. package/fesm2022/exhaustive-ui-core-tieredmenu.mjs +2 -1
  75. package/fesm2022/exhaustive-ui-core-tieredmenu.mjs.map +1 -1
  76. package/fesm2022/exhaustive-ui-core-toast.mjs +12 -1
  77. package/fesm2022/exhaustive-ui-core-toast.mjs.map +1 -1
  78. package/fesm2022/exhaustive-ui-core-togglebutton.mjs +9 -2
  79. package/fesm2022/exhaustive-ui-core-togglebutton.mjs.map +1 -1
  80. package/fesm2022/exhaustive-ui-core-toggleswitch.mjs +0 -2
  81. package/fesm2022/exhaustive-ui-core-toggleswitch.mjs.map +1 -1
  82. package/fesm2022/exhaustive-ui-core-tree.mjs +4 -4
  83. package/fesm2022/exhaustive-ui-core-tree.mjs.map +1 -1
  84. package/fesm2022/exhaustive-ui-core-treeselect.mjs +15 -3
  85. package/fesm2022/exhaustive-ui-core-treeselect.mjs.map +1 -1
  86. package/fesm2022/exhaustive-ui-core-treetable.mjs +4 -0
  87. package/fesm2022/exhaustive-ui-core-treetable.mjs.map +1 -1
  88. package/package.json +5 -5
  89. package/schematics/migrate-from-primeflex/index.js +4 -2
  90. package/schematics/migrate-from-primeflex/schema.json +5 -0
  91. package/schematics/utils/package-json.js +17 -0
  92. package/schematics/utils/primeflex.js +45 -10
  93. package/schematics/utils/versions.json +8 -8
  94. package/types/exhaustive-ui-core-api.d.ts +4 -0
  95. package/types/exhaustive-ui-core-basecomponent.d.ts +1 -0
  96. package/types/exhaustive-ui-core-breadcrumb.d.ts +7 -1
  97. package/types/exhaustive-ui-core-cascadeselect.d.ts +1 -1
  98. package/types/exhaustive-ui-core-chart.d.ts +2 -2
  99. package/types/exhaustive-ui-core-confirmdialog.d.ts +3 -2
  100. package/types/exhaustive-ui-core-confirmpopup.d.ts +4 -0
  101. package/types/exhaustive-ui-core-datepicker.d.ts +2 -1
  102. package/types/exhaustive-ui-core-drawer.d.ts +1 -0
  103. package/types/exhaustive-ui-core-fileupload.d.ts +4 -0
  104. package/types/exhaustive-ui-core-iconfield.d.ts +1 -2
  105. package/types/exhaustive-ui-core-inputnumber.d.ts +8 -0
  106. package/types/exhaustive-ui-core-megamenu.d.ts +1 -0
  107. package/types/exhaustive-ui-core-metergroup.d.ts +1 -1
  108. package/types/exhaustive-ui-core-orderlist.d.ts +6 -1
  109. package/types/exhaustive-ui-core-password.d.ts +7 -1
  110. package/types/exhaustive-ui-core-popover.d.ts +3 -0
  111. package/types/exhaustive-ui-core-select.d.ts +1 -0
  112. package/types/exhaustive-ui-core-selectbutton.d.ts +3 -0
  113. package/types/exhaustive-ui-core-splitter.d.ts +1 -0
  114. package/types/exhaustive-ui-core-stepper.d.ts +3 -2
  115. package/types/exhaustive-ui-core-table.d.ts +8 -1
  116. package/types/exhaustive-ui-core-tabs.d.ts +3 -0
  117. package/types/exhaustive-ui-core-togglebutton.d.ts +1 -0
  118. package/types/exhaustive-ui-core-treeselect.d.ts +6 -1
  119. package/types/exhaustive-ui-core-types-chart.d.ts +21 -1
  120. package/types/exhaustive-ui-core-types-confirmdialog.d.ts +1 -3
  121. package/types/exhaustive-ui-core-types-table.d.ts +1 -1
  122. package/types/exhaustive-ui-core-types-treetable.d.ts +2 -2
@@ -29,6 +29,10 @@ ${style$1}
29
29
  .p-datepicker.ng-invalid.ng-dirty .p-inputtext {
30
30
  border-color: dt('inputtext.invalid.border.color');
31
31
  }
32
+
33
+ .p-datepicker.ng-invalid.ng-dirty .p-inputtext::placeholder {
34
+ color: dt('inputtext.invalid.placeholder.color');
35
+ }
32
36
  `;
33
37
  const inlineStyles = {
34
38
  root: () => ({ position: 'relative' })
@@ -430,8 +434,7 @@ class DatePicker extends BaseInput {
430
434
  * Specifies 12 or 24 hour format.
431
435
  * @group Props
432
436
  */
433
- hourFormat = input('24', /* @ts-ignore */
434
- ...(ngDevMode ? [{ debugName: "hourFormat" }] : /* istanbul ignore next */ []));
437
+ hourFormat = input('24', { ...(ngDevMode ? { debugName: "hourFormat" } : /* istanbul ignore next */ {}), transform: (value) => String(value) });
435
438
  /**
436
439
  * Whether to display timepicker only.
437
440
  * @group Props
@@ -1172,7 +1175,9 @@ class DatePicker extends BaseInput {
1172
1175
  }
1173
1176
  }
1174
1177
  if (this.showWeek()) {
1175
- weekNumbers.push(this.getWeekNumber(new Date(week[0].year, week[0].month, week[0].day)));
1178
+ // an ISO week is the one of its Thursday, so number the row by the Thursday it contains
1179
+ let weekDay = this.startWeekFromFirstDayOfYear() ? week[0] : week[(11 - +this.getFirstDateOfWeek()) % 7];
1180
+ weekNumbers.push(this.getWeekNumber(new Date(weekDay.year, weekDay.month, weekDay.day)));
1176
1181
  }
1177
1182
  dates.push(week);
1178
1183
  }
@@ -1224,6 +1229,7 @@ class DatePicker extends BaseInput {
1224
1229
  }
1225
1230
  this.onMonthChange.emit({ month: this.currentMonth() + 1, year: this.currentYear() });
1226
1231
  this.createMonths(this.currentMonth(), this.currentYear());
1232
+ this.realignOverlay();
1227
1233
  }
1228
1234
  }
1229
1235
  navForward(event) {
@@ -1254,6 +1260,7 @@ class DatePicker extends BaseInput {
1254
1260
  }
1255
1261
  this.onMonthChange.emit({ month: this.currentMonth() + 1, year: this.currentYear() });
1256
1262
  this.createMonths(this.currentMonth(), this.currentYear());
1263
+ this.realignOverlay();
1257
1264
  }
1258
1265
  }
1259
1266
  decrementYear() {
@@ -1403,7 +1410,7 @@ class DatePicker extends BaseInput {
1403
1410
  return new Date(dateMeta.year, dateMeta.month, dateMeta.day);
1404
1411
  }
1405
1412
  formatDateKey(date) {
1406
- return `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`;
1413
+ return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
1407
1414
  }
1408
1415
  setCurrentHourPM(hours) {
1409
1416
  if (this.hourFormat() == '12') {
@@ -1610,6 +1617,10 @@ class DatePicker extends BaseInput {
1610
1617
  }
1611
1618
  isYearSelected(year) {
1612
1619
  if (this.isComparable()) {
1620
+ if (this.isRangeSelection() && this.value()[1]) {
1621
+ // like isMonthSelected, a complete range highlights every year it spans
1622
+ return this.value()[0]?.getFullYear() <= year && year <= this.value()[1].getFullYear();
1623
+ }
1613
1624
  let value = this.isRangeSelection() ? this.value()[0] : this.value();
1614
1625
  return !this.isMultipleSelection() ? value?.getFullYear() === year : false;
1615
1626
  }
@@ -2576,7 +2587,9 @@ class DatePicker extends BaseInput {
2576
2587
  if (this.isMultipleSelection()) {
2577
2588
  value = this.value()[this.value().length - 1];
2578
2589
  }
2579
- value = value && isDate(value) ? new Date(value.getTime()) : new Date();
2590
+ // without a value, the time applies to the day the panel shows on opening: defaultDate when given, today otherwise
2591
+ const defaultDate = this.defaultDate();
2592
+ value = value && isDate(value) ? new Date(value.getTime()) : defaultDate && isDate(defaultDate) ? new Date(defaultDate.getTime()) : new Date();
2580
2593
  if (this.hourFormat() == '12') {
2581
2594
  if (this.currentHour() === 12)
2582
2595
  value.setHours(this.pm() ? 12 : 0);
@@ -2623,6 +2636,7 @@ class DatePicker extends BaseInput {
2623
2636
  value = Array.isArray(value) ? value.map((date) => date && constrain(date)) : constrain(value);
2624
2637
  this.updateModel(value);
2625
2638
  this.updateUI();
2639
+ this.realignOverlay();
2626
2640
  }
2627
2641
  else if (this.keepInvalid()) {
2628
2642
  this.updateModel(value);
@@ -2784,6 +2798,13 @@ class DatePicker extends BaseInput {
2784
2798
  this.el.nativeElement.appendChild(this.overlay());
2785
2799
  }
2786
2800
  }
2801
+ // a month can have 4 to 6 rows: a panel opened above the input has to move with its new height
2802
+ realignOverlay() {
2803
+ if (this.overlayVisible() && !this.inline()) {
2804
+ this.cd.detectChanges();
2805
+ this.alignOverlay();
2806
+ }
2807
+ }
2787
2808
  alignOverlay() {
2788
2809
  if (this.touchUI()) {
2789
2810
  this.enableModality(this.overlay());
@@ -3166,6 +3187,12 @@ class DatePicker extends BaseInput {
3166
3187
  today: true,
3167
3188
  selectable: true
3168
3189
  };
3190
+ // selectDate applies the time picker values: set them to now, not to the time of the current value
3191
+ if (this.showTime() || this.timeOnly()) {
3192
+ this.setCurrentHourPM(date.getHours());
3193
+ this.currentMinute.set(date.getMinutes());
3194
+ this.currentSecond.set(this.showSeconds() ? date.getSeconds() : 0);
3195
+ }
3169
3196
  this.createMonths(date.getMonth(), date.getFullYear());
3170
3197
  this.onDateSelect(event, dateMeta);
3171
3198
  this.onTodayClick.emit(date);
@@ -3405,7 +3432,11 @@ class DatePicker extends BaseInput {
3405
3432
  @if (iconDisplay() === 'input' && showIcon()) {
3406
3433
  <span [class]="cx('inputIconContainer')" [pBind]="ptm('inputIconContainer')" [attr.data-p]="inputIconDataP">
3407
3434
  @if (!inputIconTemplate() && !_inputIconTemplate()) {
3408
- <svg data-p-icon="calendar" (click)="onButtonClick($event)" [class]="cx('inputIcon')" [pBind]="ptm('inputIcon')" />
3435
+ @if (icon()) {
3436
+ <span (click)="onButtonClick($event)" [class]="cn(cx('inputIcon'), icon())" [pBind]="ptm('inputIcon')"></span>
3437
+ } @else {
3438
+ <svg data-p-icon="calendar" (click)="onButtonClick($event)" [class]="cx('inputIcon')" [pBind]="ptm('inputIcon')" />
3439
+ }
3409
3440
  }
3410
3441
 
3411
3442
  <ng-container *ngTemplateOutlet="inputIconTemplate() || _inputIconTemplate(); context: { clickCallBack: onButtonClick.bind(this) }"></ng-container>
@@ -3952,7 +3983,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
3952
3983
  @if (iconDisplay() === 'input' && showIcon()) {
3953
3984
  <span [class]="cx('inputIconContainer')" [pBind]="ptm('inputIconContainer')" [attr.data-p]="inputIconDataP">
3954
3985
  @if (!inputIconTemplate() && !_inputIconTemplate()) {
3955
- <svg data-p-icon="calendar" (click)="onButtonClick($event)" [class]="cx('inputIcon')" [pBind]="ptm('inputIcon')" />
3986
+ @if (icon()) {
3987
+ <span (click)="onButtonClick($event)" [class]="cn(cx('inputIcon'), icon())" [pBind]="ptm('inputIcon')"></span>
3988
+ } @else {
3989
+ <svg data-p-icon="calendar" (click)="onButtonClick($event)" [class]="cx('inputIcon')" [pBind]="ptm('inputIcon')" />
3990
+ }
3956
3991
  }
3957
3992
 
3958
3993
  <ng-container *ngTemplateOutlet="inputIconTemplate() || _inputIconTemplate(); context: { clickCallBack: onButtonClick.bind(this) }"></ng-container>