primevue 4.0.6 → 4.0.7

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.
@@ -78,7 +78,7 @@
78
78
  <div :class="cx('header')" v-bind="ptm('header')">
79
79
  <slot name="header"></slot>
80
80
  <Button
81
- v-show="showOtherMonths ? groupIndex === 0 : false"
81
+ v-show="groupIndex === 0"
82
82
  :ref="previousButtonRef"
83
83
  :class="cx('pcPrevButton')"
84
84
  :disabled="disabled"
@@ -158,7 +158,7 @@
158
158
  </span>
159
159
  </div>
160
160
  <Button
161
- v-show="showOtherMonths ? (numberOfMonths === 1 ? true : groupIndex === numberOfMonths - 1) : false"
161
+ v-show="numberOfMonths === 1 ? true : groupIndex === numberOfMonths - 1"
162
162
  :ref="nextButtonRef"
163
163
  :class="cx('pcNextButton')"
164
164
  :disabled="disabled"
@@ -223,6 +223,7 @@
223
223
  data-pc-group-section="tablebodycell"
224
224
  >
225
225
  <span
226
+ v-if="showOtherMonths || !date.otherMonth"
226
227
  v-ripple
227
228
  :class="cx('day', { date })"
228
229
  @click="onDateSelect($event, date)"
@@ -727,7 +728,7 @@ export default {
727
728
  return this.modelValue.some((currentValue) => currentValue.getMonth() === month && currentValue.getFullYear() === this.currentYear);
728
729
  } else if (this.isRangeSelection()) {
729
730
  if (!this.modelValue[1]) {
730
- return this.modelValue[0].getFullYear() === this.currentYear && this.modelValue[0].getMonth() === month;
731
+ return this.modelValue[0]?.getFullYear() === this.currentYear && this.modelValue[0]?.getMonth() === month;
731
732
  } else {
732
733
  const currentDate = new Date(this.currentYear, month, 1);
733
734
  const startDate = new Date(this.modelValue[0].getFullYear(), this.modelValue[0].getMonth(), 1);
@@ -906,16 +907,12 @@ export default {
906
907
  this.overlay = null;
907
908
  },
908
909
  onPrevButtonClick(event) {
909
- if (this.showOtherMonths) {
910
- this.navigationState = { backward: true, button: true };
911
- this.navBackward(event);
912
- }
910
+ this.navigationState = { backward: true, button: true };
911
+ this.navBackward(event);
913
912
  },
914
913
  onNextButtonClick(event) {
915
- if (this.showOtherMonths) {
916
- this.navigationState = { backward: false, button: true };
917
- this.navForward(event);
918
- }
914
+ this.navigationState = { backward: false, button: true };
915
+ this.navForward(event);
919
916
  },
920
917
  navBackward(event) {
921
918
  event.preventDefault();
@@ -471,7 +471,8 @@ var script = {
471
471
  });
472
472
  } else if (this.isRangeSelection()) {
473
473
  if (!this.modelValue[1]) {
474
- return this.modelValue[0].getFullYear() === this.currentYear && this.modelValue[0].getMonth() === month;
474
+ var _this$modelValue$, _this$modelValue$2;
475
+ return ((_this$modelValue$ = this.modelValue[0]) === null || _this$modelValue$ === void 0 ? void 0 : _this$modelValue$.getFullYear()) === this.currentYear && ((_this$modelValue$2 = this.modelValue[0]) === null || _this$modelValue$2 === void 0 ? void 0 : _this$modelValue$2.getMonth()) === month;
475
476
  } else {
476
477
  var currentDate = new Date(this.currentYear, month, 1);
477
478
  var startDate = new Date(this.modelValue[0].getFullYear(), this.modelValue[0].getMonth(), 1);
@@ -635,22 +636,18 @@ var script = {
635
636
  this.overlay = null;
636
637
  },
637
638
  onPrevButtonClick: function onPrevButtonClick(event) {
638
- if (this.showOtherMonths) {
639
- this.navigationState = {
640
- backward: true,
641
- button: true
642
- };
643
- this.navBackward(event);
644
- }
639
+ this.navigationState = {
640
+ backward: true,
641
+ button: true
642
+ };
643
+ this.navBackward(event);
645
644
  },
646
645
  onNextButtonClick: function onNextButtonClick(event) {
647
- if (this.showOtherMonths) {
648
- this.navigationState = {
649
- backward: false,
650
- button: true
651
- };
652
- this.navForward(event);
653
- }
646
+ this.navigationState = {
647
+ backward: false,
648
+ button: true
649
+ };
650
+ this.navForward(event);
654
651
  },
655
652
  navBackward: function navBackward(event) {
656
653
  event.preventDefault();
@@ -2684,7 +2681,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
2684
2681
  })];
2685
2682
  }),
2686
2683
  _: 2
2687
- }, 1040, ["class", "disabled", "aria-label", "unstyled", "onClick", "onKeydown", "pt"]), [[vShow, _ctx.showOtherMonths ? groupIndex === 0 : false]]), createElementVNode("div", mergeProps({
2684
+ }, 1040, ["class", "disabled", "aria-label", "unstyled", "onClick", "onKeydown", "pt"]), [[vShow, groupIndex === 0]]), createElementVNode("div", mergeProps({
2688
2685
  "class": _ctx.cx('title'),
2689
2686
  ref_for: true
2690
2687
  }, _ctx.ptm('title')), [_ctx.$primevue.config.locale.showMonthAfterYear ? (openBlock(), createElementBlock(Fragment, {
@@ -2781,7 +2778,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
2781
2778
  })];
2782
2779
  }),
2783
2780
  _: 2
2784
- }, 1040, ["class", "disabled", "aria-label", "unstyled", "onClick", "onKeydown", "pt"]), [[vShow, _ctx.showOtherMonths ? _ctx.numberOfMonths === 1 ? true : groupIndex === _ctx.numberOfMonths - 1 : false]])], 16), $data.currentView === 'date' ? (openBlock(), createElementBlock("table", mergeProps({
2781
+ }, 1040, ["class", "disabled", "aria-label", "unstyled", "onClick", "onKeydown", "pt"]), [[vShow, _ctx.numberOfMonths === 1 ? true : groupIndex === _ctx.numberOfMonths - 1]])], 16), $data.currentView === 'date' ? (openBlock(), createElementBlock("table", mergeProps({
2785
2782
  key: 0,
2786
2783
  "class": _ctx.cx('dayView'),
2787
2784
  role: "grid",
@@ -2879,7 +2876,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
2879
2876
  "data-p-today": date.today,
2880
2877
  "data-p-other-month": date.otherMonth,
2881
2878
  "data-pc-group-section": "tablebodycell"
2882
- }), [withDirectives((openBlock(), createElementBlock("span", mergeProps({
2879
+ }), [_ctx.showOtherMonths || !date.otherMonth ? withDirectives((openBlock(), createElementBlock("span", mergeProps({
2880
+ key: 0,
2883
2881
  "class": _ctx.cx('day', {
2884
2882
  date: date
2885
2883
  }),
@@ -2909,8 +2907,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
2909
2907
  date: date
2910
2908
  }, function () {
2911
2909
  return [createTextVNode(toDisplayString(date.day), 1)];
2912
- })], 16, _hoisted_12)), [[_directive_ripple]]), $options.isSelected(date) ? (openBlock(), createElementBlock("div", mergeProps({
2913
- key: 0,
2910
+ })], 16, _hoisted_12)), [[_directive_ripple]]) : createCommentVNode("", true), $options.isSelected(date) ? (openBlock(), createElementBlock("div", mergeProps({
2911
+ key: 1,
2914
2912
  "class": "p-hidden-accessible",
2915
2913
  "aria-live": "polite",
2916
2914
  ref_for: true