@pdg/react-form 1.0.71 → 1.0.72

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/dist/index.js CHANGED
@@ -14238,6 +14238,18 @@ var FormMonthPicker = React.forwardRef(function (_a, ref) {
14238
14238
  lastData = data;
14239
14239
  setData(data);
14240
14240
  },
14241
+ getYear: function () { return (lastValue ? lastValue.year : null); },
14242
+ setYear: function (year) {
14243
+ lastValue = getFinalValue(lastValue
14244
+ ? { year: year, month: lastValue.month }
14245
+ : { year: year, month: year === new Date().getFullYear() ? new Date().getMonth() + 1 : 1 });
14246
+ setValue(lastValue);
14247
+ },
14248
+ getMonth: function () { return (lastValue ? lastValue.month : null); },
14249
+ setMonth: function (month) {
14250
+ lastValue = getFinalValue(lastValue ? { year: lastValue.year, month: month } : { year: new Date().getFullYear(), month: month });
14251
+ setValue(lastValue);
14252
+ },
14241
14253
  isExceptValue: function () { return !!exceptValue; },
14242
14254
  isDisabled: function () { return lastDisabled; },
14243
14255
  setDisabled: function (disabled) {
@@ -14608,6 +14620,42 @@ var FormMonthRangePicker = React.forwardRef(function (_a, ref) {
14608
14620
  lastValue = [lastValue[0], value];
14609
14621
  setValue(lastValue);
14610
14622
  },
14623
+ getFromYear: function () { return (lastValue[0] ? lastValue[0].year : null); },
14624
+ setFromYear: function (year) {
14625
+ lastValue = getFinalValue([
14626
+ lastValue[0]
14627
+ ? { year: year, month: lastValue[0].month }
14628
+ : { year: year, month: year === new Date().getFullYear() ? new Date().getMonth() + 1 : 1 },
14629
+ lastValue[1],
14630
+ ]);
14631
+ setValue(lastValue);
14632
+ },
14633
+ getFromMonth: function () { return (lastValue[0] ? lastValue[0].month : null); },
14634
+ setFromMonth: function (month) {
14635
+ lastValue = getFinalValue([
14636
+ lastValue[0] ? { year: lastValue[0].year, month: month } : { year: new Date().getFullYear(), month: month },
14637
+ lastValue[1],
14638
+ ]);
14639
+ setValue(lastValue);
14640
+ },
14641
+ getToYear: function () { return (lastValue[1] ? lastValue[1].year : null); },
14642
+ setToYear: function (year) {
14643
+ lastValue = getFinalValue([
14644
+ lastValue[0],
14645
+ lastValue[1]
14646
+ ? { year: year, month: lastValue[1].month }
14647
+ : { year: year, month: year === new Date().getFullYear() ? new Date().getMonth() + 1 : 1 },
14648
+ ]);
14649
+ setValue(lastValue);
14650
+ },
14651
+ getToMonth: function () { return (lastValue[1] ? lastValue[1].month : null); },
14652
+ setToMonth: function (month) {
14653
+ lastValue = getFinalValue([
14654
+ lastValue[0],
14655
+ lastValue[1] ? { year: lastValue[1].year, month: month } : { year: new Date().getFullYear(), month: month },
14656
+ ]);
14657
+ setValue(lastValue);
14658
+ },
14611
14659
  isExceptValue: function () { return !!exceptValue; },
14612
14660
  isDisabled: function () { return lastDisabled; },
14613
14661
  setDisabled: function (disabled) {