thm-p3-configurator 0.0.202 → 0.0.203
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.
|
@@ -619,7 +619,136 @@ const InternalAppointmentForm = _ref => {
|
|
|
619
619
|
options: Object.values(_constants__.VEHICLE_OWNERSHIP_TYPE),
|
|
620
620
|
isRequired: true,
|
|
621
621
|
errorMessage: errors === null || errors === void 0 ? void 0 : errors['ownershipType']
|
|
622
|
-
})
|
|
622
|
+
}), (vehicle === null || vehicle === void 0 ? void 0 : vehicle.ownershipType) === _constants__.VEHICLE_OWNERSHIP_TYPE.Leasemaatschappij && /*#__PURE__*/_react.default.createElement("div", {
|
|
623
|
+
className: (0, _helpers__.withStyle)('company-search-container position-relative mt-2 mb-2')
|
|
624
|
+
}, /*#__PURE__*/_react.default.createElement(_TextInput.default, {
|
|
625
|
+
placeholder: "Zoek leasemaatschappijen...",
|
|
626
|
+
value: customer.companyName,
|
|
627
|
+
name: "companyName",
|
|
628
|
+
onChange: value => {
|
|
629
|
+
dispatch({
|
|
630
|
+
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_COMPANY_NAME,
|
|
631
|
+
payload: {
|
|
632
|
+
companyName: value
|
|
633
|
+
}
|
|
634
|
+
});
|
|
635
|
+
|
|
636
|
+
// Also update search term if value is different
|
|
637
|
+
if (value !== companySearchTerm) {
|
|
638
|
+
setCompanySearchTerm(value);
|
|
639
|
+
setIsCompanyInputFocused(true);
|
|
640
|
+
}
|
|
641
|
+
},
|
|
642
|
+
onFocus: () => {
|
|
643
|
+
setIsCompanyInputFocused(true);
|
|
644
|
+
},
|
|
645
|
+
onBlur: () => {
|
|
646
|
+
setTimeout(() => {
|
|
647
|
+
setIsCompanyInputFocused(false);
|
|
648
|
+
}, 300); // Increased delay for better chance of click completion
|
|
649
|
+
},
|
|
650
|
+
isRequired: false,
|
|
651
|
+
form: "quotation",
|
|
652
|
+
label: "Leasemaatschappij:",
|
|
653
|
+
errorMessage: errors === null || errors === void 0 ? void 0 : errors['companyName']
|
|
654
|
+
}), isCompanyInputFocused && companySearchTerm && companySearchTerm.length >= 3 && branchesByType && branchesByType.length > 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
655
|
+
className: (0, _helpers__.withStyle)('dropdown-results position-absolute w-100 border rounded bg-white shadow'),
|
|
656
|
+
style: {
|
|
657
|
+
maxHeight: '200px',
|
|
658
|
+
overflowY: 'auto',
|
|
659
|
+
zIndex: 1050,
|
|
660
|
+
top: '100%',
|
|
661
|
+
left: 0,
|
|
662
|
+
right: 0
|
|
663
|
+
},
|
|
664
|
+
onMouseDown: e => {
|
|
665
|
+
e.preventDefault();
|
|
666
|
+
}
|
|
667
|
+
}, isLoadingBranchesByType && /*#__PURE__*/_react.default.createElement("div", {
|
|
668
|
+
className: (0, _helpers__.withStyle)('p-2 text-center')
|
|
669
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, "Zoeken...")), branchesByType.map(branch => /*#__PURE__*/_react.default.createElement("div", {
|
|
670
|
+
key: branch.entityId,
|
|
671
|
+
className: (0, _helpers__.withStyle)('dropdown-item p-2 border-bottom'),
|
|
672
|
+
style: {
|
|
673
|
+
cursor: 'pointer'
|
|
674
|
+
},
|
|
675
|
+
onMouseDown: e => {
|
|
676
|
+
e.preventDefault();
|
|
677
|
+
dispatch({
|
|
678
|
+
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_COMPANY_NAME,
|
|
679
|
+
payload: {
|
|
680
|
+
companyName: branch.name
|
|
681
|
+
}
|
|
682
|
+
});
|
|
683
|
+
if (branch.postalCode) {
|
|
684
|
+
dispatch({
|
|
685
|
+
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_ZIP_CODE,
|
|
686
|
+
payload: {
|
|
687
|
+
zipCode: branch.postalCode
|
|
688
|
+
}
|
|
689
|
+
});
|
|
690
|
+
}
|
|
691
|
+
if (branch.street) {
|
|
692
|
+
dispatch({
|
|
693
|
+
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_STREET_NAME,
|
|
694
|
+
payload: {
|
|
695
|
+
streetName: branch.street
|
|
696
|
+
}
|
|
697
|
+
});
|
|
698
|
+
}
|
|
699
|
+
if (branch.city) {
|
|
700
|
+
dispatch({
|
|
701
|
+
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_CITY,
|
|
702
|
+
payload: {
|
|
703
|
+
city: branch.city
|
|
704
|
+
}
|
|
705
|
+
});
|
|
706
|
+
}
|
|
707
|
+
if (branch.street2) {
|
|
708
|
+
dispatch({
|
|
709
|
+
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_HOUSE_NUMBER,
|
|
710
|
+
payload: {
|
|
711
|
+
houseNumber: branch.street2
|
|
712
|
+
}
|
|
713
|
+
});
|
|
714
|
+
}
|
|
715
|
+
if (branch.vatNumber) {
|
|
716
|
+
dispatch({
|
|
717
|
+
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_VAT_NUMBER,
|
|
718
|
+
payload: {
|
|
719
|
+
vatNumber: branch.vatNumber
|
|
720
|
+
}
|
|
721
|
+
});
|
|
722
|
+
}
|
|
723
|
+
if (branch.kvkNumber) {
|
|
724
|
+
dispatch({
|
|
725
|
+
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_KVK_NUMBER,
|
|
726
|
+
payload: {
|
|
727
|
+
kvkNumber: branch.kvkNumber
|
|
728
|
+
}
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
if (branch.huisnummerToevoeging) {
|
|
732
|
+
dispatch({
|
|
733
|
+
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_HOUSE_NUMBER_ADDITION,
|
|
734
|
+
payload: {
|
|
735
|
+
houseNumberAddition: branch.huisnummerToevoeging
|
|
736
|
+
}
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
if (branch.country && branch.country.entityId) {
|
|
740
|
+
dispatch({
|
|
741
|
+
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_COUNTRY_ID,
|
|
742
|
+
payload: {
|
|
743
|
+
countryId: branch.country.entityId
|
|
744
|
+
}
|
|
745
|
+
});
|
|
746
|
+
setRefreshKey(Date.now());
|
|
747
|
+
}
|
|
748
|
+
setCompanySearchTerm('');
|
|
749
|
+
setIsCompanyInputFocused(false);
|
|
750
|
+
}
|
|
751
|
+
}, branch.name))))), /*#__PURE__*/_react.default.createElement("h5", {
|
|
623
752
|
className: (0, _helpers__.withStyle)('my-2')
|
|
624
753
|
}, "Persoonlijke gegevens"), /*#__PURE__*/_react.default.createElement("div", {
|
|
625
754
|
className: (0, _helpers__.withStyle)('col-12 col-md-6 mb-2')
|
|
@@ -756,140 +885,7 @@ const InternalAppointmentForm = _ref => {
|
|
|
756
885
|
form: "appointment",
|
|
757
886
|
label: "E-mailadres:",
|
|
758
887
|
errorMessage: errors === null || errors === void 0 ? void 0 : errors['email']
|
|
759
|
-
}), /*#__PURE__*/_react.default.createElement(
|
|
760
|
-
className: (0, _helpers__.withStyle)('company-search-container position-relative mt-2 mb-2')
|
|
761
|
-
}, /*#__PURE__*/_react.default.createElement(_TextInput.default, {
|
|
762
|
-
placeholder: "Zoek leasemaatschappijen...",
|
|
763
|
-
value: customer.companyName,
|
|
764
|
-
name: "companyName",
|
|
765
|
-
onChange: value => {
|
|
766
|
-
// Update company name in state
|
|
767
|
-
dispatch({
|
|
768
|
-
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_COMPANY_NAME,
|
|
769
|
-
payload: {
|
|
770
|
-
companyName: value
|
|
771
|
-
}
|
|
772
|
-
});
|
|
773
|
-
|
|
774
|
-
// Also update search term if value is different
|
|
775
|
-
if (value !== companySearchTerm) {
|
|
776
|
-
console.log('value', value);
|
|
777
|
-
setCompanySearchTerm(value);
|
|
778
|
-
// Force focused state when typing
|
|
779
|
-
setIsCompanyInputFocused(true);
|
|
780
|
-
}
|
|
781
|
-
},
|
|
782
|
-
onFocus: () => {
|
|
783
|
-
setIsCompanyInputFocused(true);
|
|
784
|
-
},
|
|
785
|
-
onBlur: () => {
|
|
786
|
-
// Delay hiding the dropdown to allow click events to complete
|
|
787
|
-
setTimeout(() => {
|
|
788
|
-
setIsCompanyInputFocused(false);
|
|
789
|
-
}, 300); // Increased delay for better chance of click completion
|
|
790
|
-
},
|
|
791
|
-
isRequired: false,
|
|
792
|
-
form: "quotation",
|
|
793
|
-
label: "Leasemaatschappij:",
|
|
794
|
-
errorMessage: errors === null || errors === void 0 ? void 0 : errors['companyName']
|
|
795
|
-
}), isCompanyInputFocused && companySearchTerm && companySearchTerm.length >= 3 && branchesByType && branchesByType.length > 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
796
|
-
className: (0, _helpers__.withStyle)('dropdown-results position-absolute w-100 border rounded bg-white shadow'),
|
|
797
|
-
style: {
|
|
798
|
-
maxHeight: '200px',
|
|
799
|
-
overflowY: 'auto',
|
|
800
|
-
zIndex: 1050,
|
|
801
|
-
top: '100%',
|
|
802
|
-
left: 0,
|
|
803
|
-
right: 0
|
|
804
|
-
},
|
|
805
|
-
onMouseDown: e => {
|
|
806
|
-
e.preventDefault();
|
|
807
|
-
}
|
|
808
|
-
}, isLoadingBranchesByType && /*#__PURE__*/_react.default.createElement("div", {
|
|
809
|
-
className: (0, _helpers__.withStyle)('p-2 text-center')
|
|
810
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, "Zoeken...")), branchesByType.map(branch => /*#__PURE__*/_react.default.createElement("div", {
|
|
811
|
-
key: branch.entityId,
|
|
812
|
-
className: (0, _helpers__.withStyle)('dropdown-item p-2 border-bottom'),
|
|
813
|
-
style: {
|
|
814
|
-
cursor: 'pointer'
|
|
815
|
-
},
|
|
816
|
-
onMouseDown: e => {
|
|
817
|
-
e.preventDefault();
|
|
818
|
-
dispatch({
|
|
819
|
-
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_COMPANY_NAME,
|
|
820
|
-
payload: {
|
|
821
|
-
companyName: branch.name
|
|
822
|
-
}
|
|
823
|
-
});
|
|
824
|
-
if (branch.postalCode) {
|
|
825
|
-
dispatch({
|
|
826
|
-
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_ZIP_CODE,
|
|
827
|
-
payload: {
|
|
828
|
-
zipCode: branch.postalCode
|
|
829
|
-
}
|
|
830
|
-
});
|
|
831
|
-
}
|
|
832
|
-
if (branch.street) {
|
|
833
|
-
dispatch({
|
|
834
|
-
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_STREET_NAME,
|
|
835
|
-
payload: {
|
|
836
|
-
streetName: branch.street
|
|
837
|
-
}
|
|
838
|
-
});
|
|
839
|
-
}
|
|
840
|
-
if (branch.city) {
|
|
841
|
-
dispatch({
|
|
842
|
-
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_CITY,
|
|
843
|
-
payload: {
|
|
844
|
-
city: branch.city
|
|
845
|
-
}
|
|
846
|
-
});
|
|
847
|
-
}
|
|
848
|
-
if (branch.street2) {
|
|
849
|
-
dispatch({
|
|
850
|
-
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_HOUSE_NUMBER,
|
|
851
|
-
payload: {
|
|
852
|
-
houseNumber: branch.street2
|
|
853
|
-
}
|
|
854
|
-
});
|
|
855
|
-
}
|
|
856
|
-
if (branch.vatNumber) {
|
|
857
|
-
dispatch({
|
|
858
|
-
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_VAT_NUMBER,
|
|
859
|
-
payload: {
|
|
860
|
-
vatNumber: branch.vatNumber
|
|
861
|
-
}
|
|
862
|
-
});
|
|
863
|
-
}
|
|
864
|
-
if (branch.kvkNumber) {
|
|
865
|
-
dispatch({
|
|
866
|
-
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_KVK_NUMBER,
|
|
867
|
-
payload: {
|
|
868
|
-
kvkNumber: branch.kvkNumber
|
|
869
|
-
}
|
|
870
|
-
});
|
|
871
|
-
}
|
|
872
|
-
if (branch.huisnummerToevoeging) {
|
|
873
|
-
dispatch({
|
|
874
|
-
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_HOUSE_NUMBER_ADDITION,
|
|
875
|
-
payload: {
|
|
876
|
-
houseNumberAddition: branch.huisnummerToevoeging
|
|
877
|
-
}
|
|
878
|
-
});
|
|
879
|
-
}
|
|
880
|
-
if (branch.country && branch.country.entityId) {
|
|
881
|
-
dispatch({
|
|
882
|
-
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_COUNTRY_ID,
|
|
883
|
-
payload: {
|
|
884
|
-
countryId: branch.country.entityId
|
|
885
|
-
}
|
|
886
|
-
});
|
|
887
|
-
setRefreshKey(Date.now());
|
|
888
|
-
}
|
|
889
|
-
setCompanySearchTerm('');
|
|
890
|
-
setIsCompanyInputFocused(false);
|
|
891
|
-
}
|
|
892
|
-
}, branch.name)))), /*#__PURE__*/_react.default.createElement(_TextInput.default, {
|
|
888
|
+
}), /*#__PURE__*/_react.default.createElement(_TextInput.default, {
|
|
893
889
|
placeholder: "",
|
|
894
890
|
value: customer.phoneNumber,
|
|
895
891
|
name: "phoneNumber",
|