@pdg/react-form 1.0.71 → 1.0.73

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.
@@ -74,12 +74,28 @@ export interface FormRangeValueItemNameCommands {
74
74
  getFormValueFromName(): string;
75
75
  getFormValueToName(): string;
76
76
  }
77
+ export interface FormYearMonthValueItemCommands {
78
+ getYear(): number | null;
79
+ setYear(year: number | null): void;
80
+ getMonth(): number | null;
81
+ setMonth(month: number | null): void;
82
+ }
77
83
  export interface FormYearMonthValueItemNameCommands {
78
84
  getFormValueYearNameSuffix(): string;
79
85
  getFormValueMonthNameSuffix(): string;
80
86
  getFormValueYearName(): string;
81
87
  getFormValueMonthName(): string;
82
88
  }
89
+ export interface FormYearMonthRangeValueItemCommands {
90
+ getFromYear(): number | null;
91
+ setFromYear(year: number | null): void;
92
+ getFromMonth(): number | null;
93
+ setFromMonth(month: number | null): void;
94
+ getToYear(): number | null;
95
+ setToYear(year: number | null): void;
96
+ getToMonth(): number | null;
97
+ setToMonth(month: number | null): void;
98
+ }
83
99
  export interface FormYearMonthRangeValueItemNameCommands {
84
100
  getFormValueFromYearNameSuffix(): string;
85
101
  getFormValueFromMonthNameSuffix(): string;
@@ -90,7 +106,7 @@ export interface FormYearMonthRangeValueItemNameCommands {
90
106
  getFormValueToYearName(): string;
91
107
  getFormValueToMonthName(): string;
92
108
  }
93
- export interface FormValueItemCommands<T, AllowUndefinedValue extends boolean = true, ItemType = any> extends FormValueItemBaseCommands<T, AllowUndefinedValue>, Partial<FormArrayValueItemCommands>, Partial<FormItemsValueItemCommands<ItemType>>, Partial<FormCheckValueItemCommands<T>>, Partial<FormMultipleValueItemCommands>, Partial<FormLoadingValueItemCommands>, Partial<FormDateValueItemCommands>, Partial<FormRangeValueItemCommands<T>>, Partial<FormRangeValueItemNameCommands>, Partial<FormYearMonthValueItemNameCommands>, Partial<FormYearMonthRangeValueItemNameCommands> {
109
+ export interface FormValueItemCommands<T, AllowUndefinedValue extends boolean = true, ItemType = any> extends FormValueItemBaseCommands<T, AllowUndefinedValue>, Partial<FormArrayValueItemCommands>, Partial<FormItemsValueItemCommands<ItemType>>, Partial<FormCheckValueItemCommands<T>>, Partial<FormMultipleValueItemCommands>, Partial<FormLoadingValueItemCommands>, Partial<FormDateValueItemCommands>, Partial<FormRangeValueItemCommands<T>>, Partial<FormRangeValueItemNameCommands>, Partial<FormYearMonthValueItemCommands>, Partial<FormYearMonthValueItemNameCommands>, Partial<FormYearMonthRangeValueItemCommands>, Partial<FormYearMonthRangeValueItemNameCommands> {
94
110
  }
95
111
  export interface FormValueItemCommandsMap<T, AllowUndefinedValue extends boolean = true, ItemType = any> {
96
112
  [key: string]: FormValueItemCommands<T, AllowUndefinedValue, ItemType> | undefined;
@@ -1,4 +1,4 @@
1
- import { FormValueItemProps, FormValueItemBaseCommands, FormYearMonthValueItemNameCommands } from '../../@types';
1
+ import { FormValueItemProps, FormValueItemBaseCommands, FormYearMonthValueItemNameCommands, FormYearMonthValueItemCommands } from '../../@types';
2
2
  import { CommonSxProps } from '../../@types';
3
3
  import { ReactNode } from 'react';
4
4
  import { PrivateMonthPickerBaseValue, PrivateMonthPickerValue } from '../../@private';
@@ -24,5 +24,5 @@ export interface FormMonthPickerProps extends CommonSxProps, FormValueItemProps<
24
24
  formValueMonthNameSuffix?: string;
25
25
  }
26
26
  export declare const FormMonthPickerDefaultProps: Required<Pick<FormMonthPickerProps, 'format' | 'formValueYearNameSuffix' | 'formValueMonthNameSuffix' | 'minValue' | 'maxValue'>>;
27
- export interface FormMonthPickerCommands extends FormValueItemBaseCommands<FormMonthPickerValue, false>, FormYearMonthValueItemNameCommands {
27
+ export interface FormMonthPickerCommands extends FormValueItemBaseCommands<FormMonthPickerValue, false>, FormYearMonthValueItemCommands, FormYearMonthValueItemNameCommands {
28
28
  }
@@ -1,4 +1,4 @@
1
- import { FormValueItemProps, FormValueItemBaseCommands, FormRangeValueItemCommands, FormYearMonthRangeValueItemNameCommands } from '../../@types';
1
+ import { FormValueItemProps, FormValueItemBaseCommands, FormRangeValueItemCommands, FormYearMonthRangeValueItemNameCommands, FormYearMonthRangeValueItemCommands } from '../../@types';
2
2
  import { CommonSxProps } from '../../@types';
3
3
  import { ReactNode } from 'react';
4
4
  import { PrivateInputDatePickerProps, PrivateMonthRangePickerBaseValue, PrivateMonthRangePickerValue } from '../../@private';
@@ -32,5 +32,5 @@ export interface FormMonthRangePickerProps extends CommonSxProps, Omit<FormValue
32
32
  formValueToMonthNameSuffix?: string;
33
33
  }
34
34
  export declare const FormMonthRangePickerDefaultProps: Required<Pick<FormMonthRangePickerProps, 'format' | 'minValue' | 'maxValue' | 'formValueFromYearNameSuffix' | 'formValueFromMonthNameSuffix' | 'formValueToYearNameSuffix' | 'formValueToMonthNameSuffix'>>;
35
- export interface FormMonthRangePickerCommands extends FormValueItemBaseCommands<FormMonthRangePickerValue, false>, FormRangeValueItemCommands<FormMonthRangePickerBaseValue>, FormYearMonthRangeValueItemNameCommands {
35
+ export interface FormMonthRangePickerCommands extends FormValueItemBaseCommands<FormMonthRangePickerValue, false>, FormRangeValueItemCommands<FormMonthRangePickerBaseValue>, FormYearMonthRangeValueItemCommands, FormYearMonthRangeValueItemNameCommands {
36
36
  }
package/dist/index.esm.js CHANGED
@@ -14238,6 +14238,24 @@ var FormMonthPicker = React__default.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(year === null
14244
+ ? null
14245
+ : lastValue
14246
+ ? { year: year, month: lastValue.month }
14247
+ : { year: year, month: year === new Date().getFullYear() ? new Date().getMonth() + 1 : 1 });
14248
+ setValue(lastValue);
14249
+ },
14250
+ getMonth: function () { return (lastValue ? lastValue.month : null); },
14251
+ setMonth: function (month) {
14252
+ lastValue = getFinalValue(month === null
14253
+ ? null
14254
+ : lastValue
14255
+ ? { year: lastValue.year, month: month }
14256
+ : { year: new Date().getFullYear(), month: month });
14257
+ setValue(lastValue);
14258
+ },
14241
14259
  isExceptValue: function () { return !!exceptValue; },
14242
14260
  isDisabled: function () { return lastDisabled; },
14243
14261
  setDisabled: function (disabled) {
@@ -14608,6 +14626,54 @@ var FormMonthRangePicker = React__default.forwardRef(function (_a, ref) {
14608
14626
  lastValue = [lastValue[0], value];
14609
14627
  setValue(lastValue);
14610
14628
  },
14629
+ getFromYear: function () { return (lastValue[0] ? lastValue[0].year : null); },
14630
+ setFromYear: function (year) {
14631
+ lastValue = getFinalValue([
14632
+ year === null
14633
+ ? null
14634
+ : lastValue[0]
14635
+ ? { year: year, month: lastValue[0].month }
14636
+ : { year: year, month: year === new Date().getFullYear() ? new Date().getMonth() + 1 : 1 },
14637
+ lastValue[1],
14638
+ ]);
14639
+ setValue(lastValue);
14640
+ },
14641
+ getFromMonth: function () { return (lastValue[0] ? lastValue[0].month : null); },
14642
+ setFromMonth: function (month) {
14643
+ lastValue = getFinalValue([
14644
+ month === null
14645
+ ? null
14646
+ : lastValue[0]
14647
+ ? { year: lastValue[0].year, month: month }
14648
+ : { year: new Date().getFullYear(), month: month },
14649
+ lastValue[1],
14650
+ ]);
14651
+ setValue(lastValue);
14652
+ },
14653
+ getToYear: function () { return (lastValue[1] ? lastValue[1].year : null); },
14654
+ setToYear: function (year) {
14655
+ lastValue = getFinalValue([
14656
+ lastValue[0],
14657
+ year === null
14658
+ ? null
14659
+ : lastValue[1]
14660
+ ? { year: year, month: lastValue[1].month }
14661
+ : { year: year, month: year === new Date().getFullYear() ? new Date().getMonth() + 1 : 1 },
14662
+ ]);
14663
+ setValue(lastValue);
14664
+ },
14665
+ getToMonth: function () { return (lastValue[1] ? lastValue[1].month : null); },
14666
+ setToMonth: function (month) {
14667
+ lastValue = getFinalValue([
14668
+ lastValue[0],
14669
+ month === null
14670
+ ? null
14671
+ : lastValue[1]
14672
+ ? { year: lastValue[1].year, month: month }
14673
+ : { year: new Date().getFullYear(), month: month },
14674
+ ]);
14675
+ setValue(lastValue);
14676
+ },
14611
14677
  isExceptValue: function () { return !!exceptValue; },
14612
14678
  isDisabled: function () { return lastDisabled; },
14613
14679
  setDisabled: function (disabled) {