@pdg/react-form 1.0.74 → 1.0.76
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/@types/types.d.ts +2 -2
- package/dist/index.esm.js +31 -29
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +31 -29
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -565,7 +565,10 @@ function AutoTypeForwardRef(render) {
|
|
|
565
565
|
{
|
|
566
566
|
var startValue = value[0];
|
|
567
567
|
var endValue = value[1];
|
|
568
|
-
value = [
|
|
568
|
+
value = [
|
|
569
|
+
startValue ? startValue : { year: '', month: '' },
|
|
570
|
+
endValue ? endValue : { year: '', month: '' },
|
|
571
|
+
];
|
|
569
572
|
}
|
|
570
573
|
break;
|
|
571
574
|
default:
|
|
@@ -594,40 +597,36 @@ function AutoTypeForwardRef(render) {
|
|
|
594
597
|
switch (itemCommands.getType()) {
|
|
595
598
|
case 'FormDateRangePicker':
|
|
596
599
|
{
|
|
600
|
+
var commands = itemCommands;
|
|
597
601
|
var value = getItemFormValue(itemCommands);
|
|
598
|
-
data[
|
|
599
|
-
data[
|
|
602
|
+
data[commands.getFormValueFromName()] = value[0];
|
|
603
|
+
data[commands.getFormValueToName()] = value[1];
|
|
600
604
|
}
|
|
601
605
|
break;
|
|
602
606
|
case 'FormMonthPicker':
|
|
603
607
|
{
|
|
608
|
+
var commands = itemCommands;
|
|
604
609
|
var value = getItemFormValue(itemCommands);
|
|
605
|
-
data[
|
|
606
|
-
data[
|
|
610
|
+
data[commands.getFormValueYearName()] = value.year;
|
|
611
|
+
data[commands.getFormValueMonthName()] = value.month;
|
|
607
612
|
}
|
|
608
613
|
break;
|
|
609
614
|
case 'FormYearRangePicker':
|
|
610
615
|
{
|
|
616
|
+
var commands = itemCommands;
|
|
611
617
|
var value = getItemFormValue(itemCommands);
|
|
612
|
-
data[
|
|
613
|
-
data[
|
|
618
|
+
data[commands.getFormValueFromName()] = value[0];
|
|
619
|
+
data[commands.getFormValueToName()] = value[1];
|
|
614
620
|
}
|
|
615
621
|
break;
|
|
616
622
|
case 'FormMonthRangePicker':
|
|
617
623
|
{
|
|
624
|
+
var commands = itemCommands;
|
|
618
625
|
var value = getItemFormValue(itemCommands);
|
|
619
|
-
data[
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
data[
|
|
623
|
-
? value[0].month
|
|
624
|
-
: '';
|
|
625
|
-
data[itemCommands.getFormValueToYearName()] = notEmpty(value[1])
|
|
626
|
-
? value[1].year
|
|
627
|
-
: '';
|
|
628
|
-
data[itemCommands.getFormValueToMonthName()] = notEmpty(value[1])
|
|
629
|
-
? value[1].month
|
|
630
|
-
: '';
|
|
626
|
+
data[commands.getFormValueFromYearName()] = value[0].year;
|
|
627
|
+
data[commands.getFormValueFromMonthName()] = value[0].month;
|
|
628
|
+
data[commands.getFormValueToYearName()] = value[1].year;
|
|
629
|
+
data[commands.getFormValueToMonthName()] = value[1].month;
|
|
631
630
|
}
|
|
632
631
|
break;
|
|
633
632
|
default:
|
|
@@ -719,12 +718,13 @@ function AutoTypeForwardRef(render) {
|
|
|
719
718
|
switch (valueItem.getType()) {
|
|
720
719
|
case 'FormDateRangePicker':
|
|
721
720
|
case 'FormYearRangePicker': {
|
|
721
|
+
var commands_1 = valueItem;
|
|
722
722
|
var value = getItemFormValue(valueItem, !!isReset);
|
|
723
723
|
if (notEmpty(subKey)) {
|
|
724
|
-
if (subKey ===
|
|
724
|
+
if (subKey === commands_1.getFormValueFromNameSuffix()) {
|
|
725
725
|
return value[0];
|
|
726
726
|
}
|
|
727
|
-
else if (subKey ===
|
|
727
|
+
else if (subKey === commands_1.getFormValueToNameSuffix()) {
|
|
728
728
|
return value[1];
|
|
729
729
|
}
|
|
730
730
|
else {
|
|
@@ -736,13 +736,14 @@ function AutoTypeForwardRef(render) {
|
|
|
736
736
|
}
|
|
737
737
|
}
|
|
738
738
|
case 'FormMonthPicker': {
|
|
739
|
+
var commands_2 = valueItem;
|
|
739
740
|
var value = getItemFormValue(valueItem, !!isReset);
|
|
740
741
|
if (notEmpty(subKey)) {
|
|
741
|
-
if (subKey ===
|
|
742
|
-
return value;
|
|
742
|
+
if (subKey === commands_2.getFormValueYearNameSuffix()) {
|
|
743
|
+
return value.year;
|
|
743
744
|
}
|
|
744
|
-
else if (subKey ===
|
|
745
|
-
return value;
|
|
745
|
+
else if (subKey === commands_2.getFormValueMonthNameSuffix()) {
|
|
746
|
+
return value.month;
|
|
746
747
|
}
|
|
747
748
|
else {
|
|
748
749
|
throw new Error("Form::getFormReset - ".concat(valueItem.getType(), " \uC758 subKey \uAC12\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."));
|
|
@@ -753,18 +754,19 @@ function AutoTypeForwardRef(render) {
|
|
|
753
754
|
}
|
|
754
755
|
}
|
|
755
756
|
case 'FormMonthRangePicker': {
|
|
757
|
+
var commands_3 = valueItem;
|
|
756
758
|
var value = getItemFormValue(valueItem, !!isReset);
|
|
757
759
|
if (notEmpty(subKey)) {
|
|
758
|
-
if (subKey ===
|
|
760
|
+
if (subKey === commands_3.getFormValueFromYearNameSuffix()) {
|
|
759
761
|
return value[0].year;
|
|
760
762
|
}
|
|
761
|
-
else if (subKey ===
|
|
763
|
+
else if (subKey === commands_3.getFormValueFromMonthNameSuffix()) {
|
|
762
764
|
return value[0].month;
|
|
763
765
|
}
|
|
764
|
-
else if (subKey ===
|
|
766
|
+
else if (subKey === commands_3.getFormValueToYearNameSuffix()) {
|
|
765
767
|
return value[1].year;
|
|
766
768
|
}
|
|
767
|
-
else if (subKey ===
|
|
769
|
+
else if (subKey === commands_3.getFormValueToMonthNameSuffix()) {
|
|
768
770
|
return value[1].month;
|
|
769
771
|
}
|
|
770
772
|
else {
|