@voplus/morpho-csp 1.2.24 → 1.2.27
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/es/Modules.js.map +1 -1
- package/es/components/CurrencyView/state.d.ts +3 -3
- package/es/components/CurrencyView/state.js +3 -3
- package/es/components/CurrencyView/state.js.map +1 -1
- package/es/components/DragTableRow/FormRowContext.d.ts +4 -0
- package/es/components/DragTableRow/FormRowContext.js +5 -0
- package/es/components/DragTableRow/FormRowContext.js.map +1 -0
- package/es/components/DragTableRow/index.d.ts +3 -0
- package/es/components/DragTableRow/index.js +41 -0
- package/es/components/DragTableRow/index.js.map +1 -0
- package/es/components/LegalContactSelect/index.js +4 -2
- package/es/components/LegalContactSelect/index.js.map +1 -1
- package/es/data/account/hooks.d.ts +2 -2
- package/es/data/account/hooks.js +2 -2
- package/es/data/cart/hooks.d.ts +7 -0
- package/es/data/cart/hooks.js +14 -0
- package/es/data/cart/hooks.js.map +1 -0
- package/es/data/cart/index.d.ts +4 -0
- package/es/data/cart/index.js +5 -0
- package/es/data/cart/index.js.map +1 -0
- package/es/data/cart/interfaces.d.ts +58 -0
- package/es/data/cart/interfaces.js +2 -0
- package/es/data/cart/interfaces.js.map +1 -0
- package/es/data/cart/store.d.ts +22 -0
- package/es/data/cart/store.js +65 -0
- package/es/data/cart/store.js.map +1 -0
- package/es/data/cart/types.d.ts +29 -0
- package/es/data/cart/types.js +2 -0
- package/es/data/cart/types.js.map +1 -0
- package/es/data/corporate/hooks.d.ts +2 -2
- package/es/data/corporate/hooks.js +2 -2
- package/es/data/corporate/types.d.ts +1 -0
- package/es/data/entity/EntityStore.d.ts +17 -0
- package/es/data/entity/EntityStore.js +43 -0
- package/es/data/entity/EntityStore.js.map +1 -0
- package/es/data/entity/hooks.d.ts +7 -0
- package/es/data/entity/hooks.js +14 -0
- package/es/data/entity/hooks.js.map +1 -0
- package/es/data/entity/index.d.ts +3 -0
- package/es/data/entity/index.js +4 -0
- package/es/data/entity/index.js.map +1 -0
- package/es/data/entity/interface.d.ts +26 -0
- package/es/data/entity/interface.js +2 -0
- package/es/data/entity/interface.js.map +1 -0
- package/es/data/entity/types.d.ts +26 -0
- package/es/data/entity/types.js +2 -0
- package/es/data/entity/types.js.map +1 -0
- package/es/data/identity/types.d.ts +17 -0
- package/es/data/incorporation-clda/hooks.d.ts +9 -0
- package/es/data/incorporation-clda/hooks.js +20 -0
- package/es/data/incorporation-clda/hooks.js.map +1 -0
- package/es/data/incorporation-clda/index.d.ts +4 -0
- package/es/data/incorporation-clda/index.js +5 -0
- package/es/data/incorporation-clda/index.js.map +1 -0
- package/es/data/incorporation-clda/interfaces.d.ts +30 -0
- package/es/data/incorporation-clda/interfaces.js +2 -0
- package/es/data/incorporation-clda/interfaces.js.map +1 -0
- package/es/data/incorporation-clda/store.d.ts +13 -0
- package/es/data/incorporation-clda/store.js +28 -0
- package/es/data/incorporation-clda/store.js.map +1 -0
- package/es/data/incorporation-clda/types.d.ts +14 -0
- package/es/data/incorporation-clda/types.js +2 -0
- package/es/data/incorporation-clda/types.js.map +1 -0
- package/es/data/incorporation-form/hooks.d.ts +9 -0
- package/es/data/incorporation-form/hooks.js +20 -0
- package/es/data/incorporation-form/hooks.js.map +1 -0
- package/es/data/incorporation-form/index.d.ts +4 -0
- package/es/data/incorporation-form/index.js +5 -0
- package/es/data/incorporation-form/index.js.map +1 -0
- package/es/data/incorporation-form/interfaces.d.ts +31 -0
- package/es/data/incorporation-form/interfaces.js +2 -0
- package/es/data/incorporation-form/interfaces.js.map +1 -0
- package/es/data/incorporation-form/store.d.ts +13 -0
- package/es/data/incorporation-form/store.js +28 -0
- package/es/data/incorporation-form/store.js.map +1 -0
- package/es/data/incorporation-form/types.d.ts +32 -0
- package/es/data/incorporation-form/types.js +2 -0
- package/es/data/incorporation-form/types.js.map +1 -0
- package/es/data/member/hooks.d.ts +2 -2
- package/es/data/member/hooks.js +2 -2
- package/es/data/member/interfaces.d.ts +12 -0
- package/es/data/officer/hooks.d.ts +2 -2
- package/es/data/officer/hooks.js +2 -2
- package/es/data/order/OrderStore.d.ts +12 -0
- package/es/data/order/OrderStore.js +27 -0
- package/es/data/order/OrderStore.js.map +1 -0
- package/es/data/order/hooks.d.ts +13 -0
- package/es/data/order/hooks.js +24 -0
- package/es/data/order/hooks.js.map +1 -0
- package/es/data/order/index.d.ts +4 -0
- package/es/data/order/index.js +5 -0
- package/es/data/order/index.js.map +1 -0
- package/es/data/order/interfaces.d.ts +25 -0
- package/es/data/order/interfaces.js +2 -0
- package/es/data/order/interfaces.js.map +1 -0
- package/es/data/order/types.d.ts +17 -0
- package/es/data/order/types.js +2 -0
- package/es/data/order/types.js.map +1 -0
- package/es/data/service/hooks.d.ts +2 -2
- package/es/data/service/hooks.js +2 -2
- package/es/data/shareCertificate/hooks.d.ts +1 -1
- package/es/data/shareCertificate/hooks.js +1 -1
- package/es/data/shareOptionsRegister/hooks.d.ts +2 -2
- package/es/data/shareOptionsRegister/hooks.js +2 -2
- package/es/data/shareTransaction/hooks.d.ts +2 -2
- package/es/data/shareTransaction/hooks.js +2 -2
- package/es/data/shareTransaction/interfaces/IShareTransaction.d.ts +3 -3
- package/es/modules/account/AccountDefaultView/index.less +0 -18
- package/es/modules/corporate/CLDA/CLDAClientView/CLDAClientContext.js +2 -1
- package/es/modules/corporate/CLDA/CLDAClientView/CLDAClientContext.js.map +1 -1
- package/es/modules/corporate/CLDA/CLDAClientView/components/DigitalPreparationStep/index.js +11 -8
- package/es/modules/corporate/CLDA/CLDAClientView/components/DigitalPreparationStep/index.js.map +1 -1
- package/es/modules/corporate/CLDA/CLDAClientView/components/PhysicalPreparationStep/index.js +13 -10
- package/es/modules/corporate/CLDA/CLDAClientView/components/PhysicalPreparationStep/index.js.map +1 -1
- package/es/modules/corporate/CLDA/CLDAClientView/components/PhysicalSigningStep/index.js +13 -10
- package/es/modules/corporate/CLDA/CLDAClientView/components/PhysicalSigningStep/index.js.map +1 -1
- package/es/modules/corporate/CLDA/CLDAClientView/components/SelectStep/index.js +29 -23
- package/es/modules/corporate/CLDA/CLDAClientView/components/SelectStep/index.js.map +1 -1
- package/es/modules/corporate/CLDA/CLDAClientView/components/StartStep/index.js +13 -10
- package/es/modules/corporate/CLDA/CLDAClientView/components/StartStep/index.js.map +1 -1
- package/es/modules/corporate/CLDA/CLDAClientView/components/VerificationStep/index.js +1 -1
- package/es/modules/corporate/CLDA/CLDAClientView/components/VerificationStep/index.js.map +1 -1
- package/es/modules/corporate/CLDA/CLDAClientView/index.d.ts +9 -1
- package/es/modules/corporate/CLDA/CLDAClientView/index.js +21 -12
- package/es/modules/corporate/CLDA/CLDAClientView/index.js.map +1 -1
- package/es/modules/corporate/CLDA/CLDAClientView/index.less +10 -12
- package/es/modules/corporate/CLDA/CLDADefaultView/index.js.map +1 -1
- package/es/modules/corporate/CLDA/ChangeAddress2021/index.less +13 -18
- package/es/modules/corporate/LegalGeneration/index.less +0 -6
- package/es/modules/corporate/company/CompanyDefaultView/index.js +1 -1
- package/es/modules/corporate/company/CompanyDefaultView/index.js.map +1 -1
- package/es/modules/corporate/company/CompanyDetailsView/index.js +44 -42
- package/es/modules/corporate/company/CompanyDetailsView/index.js.map +1 -1
- package/es/modules/corporate/company/Identity/IdentifyDetail/index.js +13 -5
- package/es/modules/corporate/company/Identity/IdentifyDetail/index.js.map +1 -1
- package/es/modules/corporate/company/Identity/SelectLegalContactDialog/Page1.js +4 -2
- package/es/modules/corporate/company/Identity/SelectLegalContactDialog/Page1.js.map +1 -1
- package/es/modules/corporate/company/Identity/SelectLegalContactDialog/index.d.ts +1 -1
- package/es/modules/corporate/company/Identity/SelectLegalContactDialog/index.less +1 -2
- package/es/modules/corporate/company/Identity/SelectLegalContactDialog/state.d.ts +1 -1
- package/es/modules/order/OrderDefaultView/index.d.ts +4 -0
- package/es/modules/order/OrderDefaultView/index.js +52 -0
- package/es/modules/order/OrderDefaultView/index.js.map +1 -0
- package/es/modules/order/OrderDefaultView/index.less +13 -0
- package/es/modules/order/OrderItem/index.d.ts +6 -0
- package/es/modules/order/OrderItem/index.js +13 -0
- package/es/modules/order/OrderItem/index.js.map +1 -0
- package/es/modules/order/OrderItem/index.less +21 -0
- package/es/modules/order/OrderItems/DragTableCell.d.ts +3 -0
- package/es/modules/order/OrderItems/DragTableCell.js +75 -0
- package/es/modules/order/OrderItems/DragTableCell.js.map +1 -0
- package/es/modules/order/OrderItems/index.d.ts +4 -0
- package/es/modules/order/OrderItems/index.js +160 -0
- package/es/modules/order/OrderItems/index.js.map +1 -0
- package/es/modules/order/OrderItems/index.less +48 -0
- package/es/modules/order/OrderItems/state.d.ts +29 -0
- package/es/modules/order/OrderItems/state.js +89 -0
- package/es/modules/order/OrderItems/state.js.map +1 -0
- package/es/modules/order/OrderLabel/index.d.ts +6 -0
- package/es/modules/order/OrderLabel/index.js +40 -0
- package/es/modules/order/OrderLabel/index.js.map +1 -0
- package/es/modules/order/OrderLabel/index.less +21 -0
- package/es/modules/order/OrderLabel/state.d.ts +10 -0
- package/es/modules/order/OrderLabel/state.js +218 -0
- package/es/modules/order/OrderLabel/state.js.map +1 -0
- package/es/modules/order/OrderListView/index.d.ts +5 -0
- package/es/modules/order/OrderListView/index.js +47 -0
- package/es/modules/order/OrderListView/index.js.map +1 -0
- package/es/modules/order/OrderPropertiesView/index.d.ts +6 -0
- package/es/modules/order/OrderPropertiesView/index.js +39 -0
- package/es/modules/order/OrderPropertiesView/index.js.map +1 -0
- package/es/modules/order/OrderPropertiesView/index.less +13 -0
- package/es/modules/order/context/OrderContext.d.ts +31 -0
- package/es/modules/order/context/OrderContext.js +92 -0
- package/es/modules/order/context/OrderContext.js.map +1 -0
- package/es/modules/order/controls/IncorporationStatusLabel/index.d.ts +10 -0
- package/es/modules/order/controls/IncorporationStatusLabel/index.js +16 -0
- package/es/modules/order/controls/IncorporationStatusLabel/index.js.map +1 -0
- package/es/modules/order/controls/IncorporationStatusLabel/index.less +41 -0
- package/es/modules/order/controls/filters/IncorporationStatusFilter/index.d.ts +3 -0
- package/es/modules/order/controls/filters/IncorporationStatusFilter/index.js +21 -0
- package/es/modules/order/controls/filters/IncorporationStatusFilter/index.js.map +1 -0
- package/es/modules/order/controls/filters/IncorporationStatusFilter/state.d.ts +17 -0
- package/es/modules/order/controls/filters/IncorporationStatusFilter/state.js +48 -0
- package/es/modules/order/controls/filters/IncorporationStatusFilter/state.js.map +1 -0
- package/es/modules/self-registration/components/Card/index.d.ts +16 -0
- package/es/modules/self-registration/components/Card/index.js +20 -0
- package/es/modules/self-registration/components/Card/index.js.map +1 -0
- package/es/modules/self-registration/components/Card/index.less +52 -0
- package/es/modules/self-registration/components/CheckSection/index.d.ts +7 -0
- package/es/modules/self-registration/components/CheckSection/index.js +15 -0
- package/es/modules/self-registration/components/CheckSection/index.js.map +1 -0
- package/es/modules/self-registration/components/CheckSection/index.less +20 -0
- package/es/modules/self-registration/components/MemberCard/index.d.ts +11 -0
- package/es/modules/self-registration/components/MemberCard/index.js +58 -0
- package/es/modules/self-registration/components/MemberCard/index.js.map +1 -0
- package/es/modules/self-registration/components/MemberCard/index.less +53 -0
- package/es/modules/self-registration/components/StripeForm/index.d.ts +11 -0
- package/es/modules/self-registration/components/StripeForm/index.js +61 -0
- package/es/modules/self-registration/components/StripeForm/index.js.map +1 -0
- package/es/modules/self-registration/components/StripeForm/index.less +36 -0
- package/es/modules/self-registration/components/StripeForm/state.d.ts +11 -0
- package/es/modules/self-registration/components/StripeForm/state.js +81 -0
- package/es/modules/self-registration/components/StripeForm/state.js.map +1 -0
- package/es/modules/self-registration/components/index.d.ts +1 -0
- package/es/modules/self-registration/components/index.js +2 -0
- package/es/modules/self-registration/components/index.js.map +1 -0
- package/es/modules/self-registration/controls/Blink/index.d.ts +13 -0
- package/es/modules/self-registration/controls/Blink/index.js +13 -0
- package/es/modules/self-registration/controls/Blink/index.js.map +1 -0
- package/es/modules/self-registration/controls/Blink/index.less +27 -0
- package/es/modules/self-registration/controls/BusinessActivityInput/index.d.ts +9 -0
- package/es/modules/self-registration/controls/BusinessActivityInput/index.js +42 -0
- package/es/modules/self-registration/controls/BusinessActivityInput/index.js.map +1 -0
- package/es/modules/self-registration/controls/BusinessActivityInput/state.d.ts +17 -0
- package/es/modules/self-registration/controls/BusinessActivityInput/state.js +48 -0
- package/es/modules/self-registration/controls/BusinessActivityInput/state.js.map +1 -0
- package/es/modules/self-registration/controls/BusinessNameInput/index.d.ts +30 -0
- package/es/modules/self-registration/controls/BusinessNameInput/index.js +115 -0
- package/es/modules/self-registration/controls/BusinessNameInput/index.js.map +1 -0
- package/es/modules/self-registration/controls/BusinessNameInputFormItem/index.d.ts +11 -0
- package/es/modules/self-registration/controls/BusinessNameInputFormItem/index.js +19 -0
- package/es/modules/self-registration/controls/BusinessNameInputFormItem/index.js.map +1 -0
- package/es/modules/self-registration/controls/BusinessNameInputFormItem/state.d.ts +6 -0
- package/es/modules/self-registration/controls/BusinessNameInputFormItem/state.js +23 -0
- package/es/modules/self-registration/controls/BusinessNameInputFormItem/state.js.map +1 -0
- package/es/modules/self-registration/controls/Section/index.d.ts +13 -0
- package/es/modules/self-registration/controls/Section/index.js +15 -0
- package/es/modules/self-registration/controls/Section/index.js.map +1 -0
- package/es/modules/self-registration/controls/Section/index.less +79 -0
- package/es/modules/self-registration/controls/Tips/BusinessActivityTip.d.ts +3 -0
- package/es/modules/self-registration/controls/Tips/BusinessActivityTip.js +30 -0
- package/es/modules/self-registration/controls/Tips/BusinessActivityTip.js.map +1 -0
- package/es/modules/self-registration/controls/Tips/BusinessNameTip.d.ts +3 -0
- package/es/modules/self-registration/controls/Tips/BusinessNameTip.js +13 -0
- package/es/modules/self-registration/controls/Tips/BusinessNameTip.js.map +1 -0
- package/es/modules/self-registration/controls/Tips/CapitalTip.d.ts +3 -0
- package/es/modules/self-registration/controls/Tips/CapitalTip.js +11 -0
- package/es/modules/self-registration/controls/Tips/CapitalTip.js.map +1 -0
- package/es/modules/self-registration/controls/Tips/DirectorTip.d.ts +5 -0
- package/es/modules/self-registration/controls/Tips/DirectorTip.js +25 -0
- package/es/modules/self-registration/controls/Tips/DirectorTip.js.map +1 -0
- package/es/modules/self-registration/controls/Tips/FYETip.d.ts +3 -0
- package/es/modules/self-registration/controls/Tips/FYETip.js +13 -0
- package/es/modules/self-registration/controls/Tips/FYETip.js.map +1 -0
- package/es/modules/self-registration/controls/Tips/IncorporationTip.d.ts +3 -0
- package/es/modules/self-registration/controls/Tips/IncorporationTip.js +9 -0
- package/es/modules/self-registration/controls/Tips/IncorporationTip.js.map +1 -0
- package/es/modules/self-registration/controls/Tips/RegisteredAddressTip.d.ts +3 -0
- package/es/modules/self-registration/controls/Tips/RegisteredAddressTip.js +13 -0
- package/es/modules/self-registration/controls/Tips/RegisteredAddressTip.js.map +1 -0
- package/es/modules/self-registration/controls/Tips/SecretaryTip.d.ts +3 -0
- package/es/modules/self-registration/controls/Tips/SecretaryTip.js +15 -0
- package/es/modules/self-registration/controls/Tips/SecretaryTip.js.map +1 -0
- package/es/modules/self-registration/controls/Tips/ShareholderTip.d.ts +3 -0
- package/es/modules/self-registration/controls/Tips/ShareholderTip.js +11 -0
- package/es/modules/self-registration/controls/Tips/ShareholderTip.js.map +1 -0
- package/es/modules/self-registration/controls/Tips/SharesTip.d.ts +3 -0
- package/es/modules/self-registration/controls/Tips/SharesTip.js +9 -0
- package/es/modules/self-registration/controls/Tips/SharesTip.js.map +1 -0
- package/es/modules/self-registration/controls/Tips/Tip.d.ts +5 -0
- package/es/modules/self-registration/controls/Tips/Tip.js +10 -0
- package/es/modules/self-registration/controls/Tips/Tip.js.map +1 -0
- package/es/modules/self-registration/controls/Tips/index.d.ts +10 -0
- package/es/modules/self-registration/controls/Tips/index.js +11 -0
- package/es/modules/self-registration/controls/Tips/index.js.map +1 -0
- package/es/modules/self-registration/controls/index.d.ts +1 -0
- package/es/modules/self-registration/controls/index.js +2 -0
- package/es/modules/self-registration/controls/index.js.map +1 -0
- package/es/modules/self-registration/incorporation-clda/IncorporationCLDAClientView/IncorporationCLDAClientContext.d.ts +12 -0
- package/es/modules/self-registration/incorporation-clda/IncorporationCLDAClientView/IncorporationCLDAClientContext.js +42 -0
- package/es/modules/self-registration/incorporation-clda/IncorporationCLDAClientView/IncorporationCLDAClientContext.js.map +1 -0
- package/es/modules/self-registration/incorporation-clda/IncorporationCLDAClientView/index.d.ts +3 -0
- package/es/modules/self-registration/incorporation-clda/IncorporationCLDAClientView/index.js +44 -0
- package/es/modules/self-registration/incorporation-clda/IncorporationCLDAClientView/index.js.map +1 -0
- package/es/modules/self-registration/incorporation-clda/IncorporationCLDAClientView/index.less +9 -0
- package/es/modules/self-registration/incorporation-clda/IncorporationDefaultView/index.d.ts +6 -0
- package/es/modules/self-registration/incorporation-clda/IncorporationDefaultView/index.js +25 -0
- package/es/modules/self-registration/incorporation-clda/IncorporationDefaultView/index.js.map +1 -0
- package/es/modules/self-registration/incorporation-clda/IncorporationDefaultView/index.less +18 -0
- package/es/modules/self-registration/incorporation-clda/components/DetailsStep/index.d.ts +3 -0
- package/es/modules/self-registration/incorporation-clda/components/DetailsStep/index.js +33 -0
- package/es/modules/self-registration/incorporation-clda/components/DetailsStep/index.js.map +1 -0
- package/es/modules/self-registration/incorporation-clda/components/IncorporationCLDAProperties/index.d.ts +5 -0
- package/es/modules/self-registration/incorporation-clda/components/IncorporationCLDAProperties/index.js +30 -0
- package/es/modules/self-registration/incorporation-clda/components/IncorporationCLDAProperties/index.js.map +1 -0
- package/es/modules/self-registration/incorporation-clda/components/StartStep/index.d.ts +3 -0
- package/es/modules/self-registration/incorporation-clda/components/StartStep/index.js +16 -0
- package/es/modules/self-registration/incorporation-clda/components/StartStep/index.js.map +1 -0
- package/es/modules/self-registration/incorporation-form/ApplicationProcessing/index.d.ts +5 -0
- package/es/modules/self-registration/incorporation-form/ApplicationProcessing/index.js +54 -0
- package/es/modules/self-registration/incorporation-form/ApplicationProcessing/index.js.map +1 -0
- package/es/modules/self-registration/incorporation-form/ApplicationProcessing/index.less +37 -0
- package/es/modules/self-registration/incorporation-form/CLDAIncorporationDefaultView/index.d.ts +4 -0
- package/es/modules/self-registration/incorporation-form/CLDAIncorporationDefaultView/index.js +85 -0
- package/es/modules/self-registration/incorporation-form/CLDAIncorporationDefaultView/index.js.map +1 -0
- package/es/modules/self-registration/incorporation-form/CLDAIncorporationDefaultView/index.less +26 -0
- package/es/modules/self-registration/incorporation-form/CompanyInfoForm/CompanyInfo/index.d.ts +5 -0
- package/es/modules/self-registration/incorporation-form/CompanyInfoForm/CompanyInfo/index.js +91 -0
- package/es/modules/self-registration/incorporation-form/CompanyInfoForm/CompanyInfo/index.js.map +1 -0
- package/es/modules/self-registration/incorporation-form/CompanyInfoForm/CompanyInfo/index.less +7 -0
- package/es/modules/self-registration/incorporation-form/CompanyInfoForm/OfficerList/index.d.ts +6 -0
- package/es/modules/self-registration/incorporation-form/CompanyInfoForm/OfficerList/index.js +92 -0
- package/es/modules/self-registration/incorporation-form/CompanyInfoForm/OfficerList/index.js.map +1 -0
- package/es/modules/self-registration/incorporation-form/CompanyInfoForm/OfficerList/state.d.ts +11 -0
- package/es/modules/self-registration/incorporation-form/CompanyInfoForm/OfficerList/state.js +45 -0
- package/es/modules/self-registration/incorporation-form/CompanyInfoForm/OfficerList/state.js.map +1 -0
- package/es/modules/self-registration/incorporation-form/CompanyInfoForm/ShareCapital/index.d.ts +6 -0
- package/es/modules/self-registration/incorporation-form/CompanyInfoForm/ShareCapital/index.js +74 -0
- package/es/modules/self-registration/incorporation-form/CompanyInfoForm/ShareCapital/index.js.map +1 -0
- package/es/modules/self-registration/incorporation-form/CompanyInfoForm/ShareCapital/index.less +28 -0
- package/es/modules/self-registration/incorporation-form/CompanyInfoForm/ShareholderList/index.d.ts +6 -0
- package/es/modules/self-registration/incorporation-form/CompanyInfoForm/ShareholderList/index.js +106 -0
- package/es/modules/self-registration/incorporation-form/CompanyInfoForm/ShareholderList/index.js.map +1 -0
- package/es/modules/self-registration/incorporation-form/CompanyInfoForm/ShareholderList/state.d.ts +11 -0
- package/es/modules/self-registration/incorporation-form/CompanyInfoForm/ShareholderList/state.js +45 -0
- package/es/modules/self-registration/incorporation-form/CompanyInfoForm/ShareholderList/state.js.map +1 -0
- package/es/modules/self-registration/incorporation-form/CompanyInfoForm/index.d.ts +12 -0
- package/es/modules/self-registration/incorporation-form/CompanyInfoForm/index.js +63 -0
- package/es/modules/self-registration/incorporation-form/CompanyInfoForm/index.js.map +1 -0
- package/es/modules/self-registration/incorporation-form/CompanyInfoForm/index.less +25 -0
- package/es/modules/self-registration/incorporation-form/Download/index.d.ts +5 -0
- package/es/modules/self-registration/incorporation-form/Download/index.js +71 -0
- package/es/modules/self-registration/incorporation-form/Download/index.js.map +1 -0
- package/es/modules/self-registration/incorporation-form/Download/index.less +41 -0
- package/es/modules/self-registration/incorporation-form/IncorporationFormRoutes.d.ts +19 -0
- package/es/modules/self-registration/incorporation-form/IncorporationFormRoutes.js +33 -0
- package/es/modules/self-registration/incorporation-form/IncorporationFormRoutes.js.map +1 -0
- package/es/modules/self-registration/incorporation-form/Upload/index.d.ts +5 -0
- package/es/modules/self-registration/incorporation-form/Upload/index.js +48 -0
- package/es/modules/self-registration/incorporation-form/Upload/index.js.map +1 -0
- package/es/modules/self-registration/incorporation-form/Upload/index.less +15 -0
- package/es/modules/self-registration/incorporation-form/components/IncorporationFromProperties/index.d.ts +5 -0
- package/es/modules/self-registration/incorporation-form/components/IncorporationFromProperties/index.js +32 -0
- package/es/modules/self-registration/incorporation-form/components/IncorporationFromProperties/index.js.map +1 -0
- package/es/modules/self-registration/incorporation-form/components/IncorporationFromReview/index.d.ts +5 -0
- package/es/modules/self-registration/incorporation-form/components/IncorporationFromReview/index.js +55 -0
- package/es/modules/self-registration/incorporation-form/components/IncorporationFromReview/index.js.map +1 -0
- package/es/modules/self-registration/incorporation-form/components/MemberInfo/index.d.ts +11 -0
- package/es/modules/self-registration/incorporation-form/components/MemberInfo/index.js +75 -0
- package/es/modules/self-registration/incorporation-form/components/MemberInfo/index.js.map +1 -0
- package/es/modules/self-registration/incorporation-form/components/MemberInfo/index.less +74 -0
- package/es/modules/self-registration/incorporation-form/controls/IncorpoationFormMenu/index.d.ts +6 -0
- package/es/modules/self-registration/incorporation-form/controls/IncorpoationFormMenu/index.js +16 -0
- package/es/modules/self-registration/incorporation-form/controls/IncorpoationFormMenu/index.js.map +1 -0
- package/es/modules/self-registration/incorporation-form/pages/IncoprorationFormClientView/index.d.ts +3 -0
- package/es/modules/self-registration/incorporation-form/pages/IncoprorationFormClientView/index.js +11 -0
- package/es/modules/self-registration/incorporation-form/pages/IncoprorationFormClientView/index.js.map +1 -0
- package/es/modules/self-registration/incorporation-form/pages/IncorporationFromDefaultView/index.d.ts +5 -0
- package/es/modules/self-registration/incorporation-form/pages/IncorporationFromDefaultView/index.js +23 -0
- package/es/modules/self-registration/incorporation-form/pages/IncorporationFromDefaultView/index.js.map +1 -0
- package/es/modules/self-registration/incorporation-form/pages/IncorporationFromDefaultView/index.less +28 -0
- package/es/modules/self-registration/shopping-cart/CartState.d.ts +55 -0
- package/es/modules/self-registration/shopping-cart/CartState.js +245 -0
- package/es/modules/self-registration/shopping-cart/CartState.js.map +1 -0
- package/es/modules/self-registration/shopping-cart/ChooseService/index.d.ts +5 -0
- package/es/modules/self-registration/shopping-cart/ChooseService/index.js +79 -0
- package/es/modules/self-registration/shopping-cart/ChooseService/index.js.map +1 -0
- package/es/modules/self-registration/shopping-cart/ChooseService/index.less +12 -0
- package/es/modules/self-registration/shopping-cart/Paid.d.ts +5 -0
- package/es/modules/self-registration/shopping-cart/Paid.js +31 -0
- package/es/modules/self-registration/shopping-cart/Paid.js.map +1 -0
- package/es/modules/self-registration/shopping-cart/Payment/index.d.ts +5 -0
- package/es/modules/self-registration/shopping-cart/Payment/index.js +30 -0
- package/es/modules/self-registration/shopping-cart/Payment/index.js.map +1 -0
- package/es/modules/self-registration/shopping-cart/Payment/index.less +13 -0
- package/es/modules/self-registration/shopping-cart/components/Arrangement.d.ts +5 -0
- package/es/modules/self-registration/shopping-cart/components/Arrangement.js +16 -0
- package/es/modules/self-registration/shopping-cart/components/Arrangement.js.map +1 -0
- package/es/modules/self-registration/shopping-cart/components/Incorporation.d.ts +3 -0
- package/es/modules/self-registration/shopping-cart/components/Incorporation.js +35 -0
- package/es/modules/self-registration/shopping-cart/components/Incorporation.js.map +1 -0
- package/es/modules/self-registration/shopping-cart/components/NameAndActivities.d.ts +3 -0
- package/es/modules/self-registration/shopping-cart/components/NameAndActivities.js +37 -0
- package/es/modules/self-registration/shopping-cart/components/NameAndActivities.js.map +1 -0
- package/es/modules/self-registration/shopping-cart/components/Pay/index.d.ts +3 -0
- package/es/modules/self-registration/shopping-cart/components/Pay/index.js +28 -0
- package/es/modules/self-registration/shopping-cart/components/Pay/index.js.map +1 -0
- package/es/modules/self-registration/shopping-cart/components/Pay/index.less +14 -0
- package/es/modules/self-registration/shopping-cart/components/Register.d.ts +3 -0
- package/es/modules/self-registration/shopping-cart/components/Register.js +76 -0
- package/es/modules/self-registration/shopping-cart/components/Register.js.map +1 -0
- package/es/modules/self-registration/shopping-cart/components/Secretary.d.ts +3 -0
- package/es/modules/self-registration/shopping-cart/components/Secretary.js +63 -0
- package/es/modules/self-registration/shopping-cart/components/Secretary.js.map +1 -0
- package/es/modules/self-registration/shopping-cart/components/ShareHolders/index.d.ts +3 -0
- package/es/modules/self-registration/shopping-cart/components/ShareHolders/index.js +137 -0
- package/es/modules/self-registration/shopping-cart/components/ShareHolders/index.js.map +1 -0
- package/es/modules/self-registration/shopping-cart/components/ShareHolders/state.d.ts +12 -0
- package/es/modules/self-registration/shopping-cart/components/ShareHolders/state.js +48 -0
- package/es/modules/self-registration/shopping-cart/components/ShareHolders/state.js.map +1 -0
- package/es/modules/self-registration/shopping-cart/components/TotalCart/index.d.ts +11 -0
- package/es/modules/self-registration/shopping-cart/components/TotalCart/index.js +56 -0
- package/es/modules/self-registration/shopping-cart/components/TotalCart/index.js.map +1 -0
- package/es/modules/self-registration/shopping-cart/components/TotalCart/index.less +75 -0
- package/es/modules/self-registration/shopping-cart/components/index.d.ts +8 -0
- package/es/modules/self-registration/shopping-cart/components/index.js +9 -0
- package/es/modules/self-registration/shopping-cart/components/index.js.map +1 -0
- package/es/modules/self-registration/shopping-cart/components/styles.less +23 -0
- package/es/modules/self-registration/shopping-cart/index.d.ts +3 -0
- package/es/modules/self-registration/shopping-cart/index.js +4 -0
- package/es/modules/self-registration/shopping-cart/index.js.map +1 -0
- package/es/modules/self-registration/shopping-cart/pages.less +6 -0
- package/es/routes.d.ts +51 -1
- package/es/routes.js +81 -1
- package/es/routes.js.map +1 -1
- package/es/style/common.less +14 -1
- package/package.json +6 -3
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Button, Form, Input, InputNumber } from "@voplus/antd";
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
import { faBars, faTrashAlt } from "@fortawesome/pro-light-svg-icons";
|
|
4
|
+
import { FontAwesomeIcon as FAIcon } from "@fortawesome/react-fontawesome";
|
|
5
|
+
import classnames from "classnames";
|
|
6
|
+
import { isEqual } from "lodash-es";
|
|
7
|
+
import { observe } from "@voplus/morpho-ui";
|
|
8
|
+
import { useFormRowContext } from "../../../components/DragTableRow/FormRowContext";
|
|
9
|
+
import { useOrderContext } from "../context/OrderContext";
|
|
10
|
+
const DragTableCell = (props) => {
|
|
11
|
+
const { key, editable, dataIndex, record, rowIndex, children, connectDragSource, className, onAdd, onDel, ...restProps } = props;
|
|
12
|
+
const formContext = useFormRowContext();
|
|
13
|
+
const orderContext = useOrderContext();
|
|
14
|
+
const [editing, setEditing] = useState(false);
|
|
15
|
+
return observe(() => {
|
|
16
|
+
var _a;
|
|
17
|
+
return (React.createElement("td", { ...restProps, className: classnames({ "column-edit": ((record && record.added) || editing) && dataIndex === "description" }, className) }, dataIndex === "amount" ? (editable && orderContext.hoverKey === rowIndex ? (React.createElement(Button, { danger: true, shape: "circle", onClick: () => onDel(record.id) },
|
|
18
|
+
React.createElement(FAIcon, { icon: faTrashAlt }))) : ((_a = orderContext.getAmount(record)) === null || _a === void 0 ? void 0 : _a.toLocaleString(undefined, {
|
|
19
|
+
minimumFractionDigits: 2,
|
|
20
|
+
}))) : dataIndex === "Dnd" ? (formContext.connectDragSource(React.createElement("span", { style: { cursor: "move" } },
|
|
21
|
+
React.createElement(FAIcon, { icon: faBars })))) : editable ? (record.added || editing ? (React.createElement(Form.Item, { name: dataIndex, style: { margin: 0 }, rules: [{ required: true, message: `${dataIndex} is required.` }] }, dataIndex === "description" ? (React.createElement(Input.TextArea, { autoFocus: editing, rows: 4, onBlur: save })) : (React.createElement(InputNumber, { min: dataIndex === "qty" ? 1 : 0, max: dataIndex === "discount" ? 100 : 100000000000, precision: dataIndex === "price" ? 2 : 0, onPressEnter: save, onBlur: save, onKeyDown: onKeyDown })))) : (React.createElement("div", { className: "editable-cell-value-wrap", onClick: toggleEdit }, children))) : (children)));
|
|
22
|
+
});
|
|
23
|
+
function toggleEdit() {
|
|
24
|
+
formContext.form.setFieldsValue({ ...record });
|
|
25
|
+
setEditing(!editing);
|
|
26
|
+
}
|
|
27
|
+
function save() {
|
|
28
|
+
formContext.form
|
|
29
|
+
.validateFields()
|
|
30
|
+
.then((orderLine) => {
|
|
31
|
+
const { added, description, price, qty, discount } = record;
|
|
32
|
+
const line = {
|
|
33
|
+
description: orderLine.description || description,
|
|
34
|
+
price: orderLine.price >= 0 ? orderLine.price : price,
|
|
35
|
+
qty: orderLine.qty || qty,
|
|
36
|
+
discount: orderLine.discount >= 0 ? orderLine.discount : discount,
|
|
37
|
+
};
|
|
38
|
+
const hasChange = !isEqual(line, { description, price, qty, discount });
|
|
39
|
+
/** Add or edit Order line */
|
|
40
|
+
if (added || hasChange) {
|
|
41
|
+
setOrderLine(rowIndex, orderLine);
|
|
42
|
+
}
|
|
43
|
+
if (!added)
|
|
44
|
+
return toggleEdit();
|
|
45
|
+
})
|
|
46
|
+
.catch((errorInfo) => {
|
|
47
|
+
// console.log(errorInfo, "errorInfo");
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function onKeyDown(e) {
|
|
51
|
+
/** Esc to quit editing */
|
|
52
|
+
if (e.keyCode === 27)
|
|
53
|
+
return setEditing(false);
|
|
54
|
+
if (e.keyCode !== 9 || dataIndex !== "discount")
|
|
55
|
+
return;
|
|
56
|
+
formContext.form
|
|
57
|
+
.validateFields()
|
|
58
|
+
.then(() => {
|
|
59
|
+
onAdd();
|
|
60
|
+
})
|
|
61
|
+
.catch((errorInfo) => {
|
|
62
|
+
// console.log(errorInfo, "errorInfo");
|
|
63
|
+
});
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
function setOrderLine(index, orderLine) {
|
|
67
|
+
orderContext.orderLines[index] = {
|
|
68
|
+
...orderContext.orderLines[index],
|
|
69
|
+
...orderLine,
|
|
70
|
+
};
|
|
71
|
+
orderContext.orderLines = [...orderContext.orderLines];
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
export default DragTableCell;
|
|
75
|
+
//# sourceMappingURL=DragTableCell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DragTableCell.js","sourceRoot":"","sources":["../../../../src/modules/order/OrderItems/DragTableCell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAEtE,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAE3E,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAA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,GAAG,EAAE;YACV,KAAK,EAAE,CAAC;QACT,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,SAAc,EAAE,EAAE;YACzB,uCAAuC;QACxC,CAAC,CAAC,CAAC;QACJ,OAAO;IACR,CAAC;IACD,SAAS,YAAY,CAAC,KAAa,EAAE,SAAqB;QACzD,YAAY,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG;YAChC,GAAG,YAAY,CAAC,UAAU,CAAC,KAAK,CAAC;YACjC,GAAG,SAAS;SACZ,CAAC;QACF,YAAY,CAAC,UAAU,GAAG,CAAC,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC;IACxD,CAAC;AACF,CAAC,CAAC;AACF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { Button, Modal, Table } from "@voplus/antd";
|
|
2
|
+
import { useOrderStore } from "../../../data/order";
|
|
3
|
+
import { State } from "./state";
|
|
4
|
+
import React, { useEffect, useState } from "react";
|
|
5
|
+
import { clone, isEqual } from "lodash-es";
|
|
6
|
+
import { runInAction, toJS } from "mobx";
|
|
7
|
+
import { DndProvider } from "react-dnd";
|
|
8
|
+
import DragTableCell from "./DragTableCell";
|
|
9
|
+
import DragTableRow from "../../../components/DragTableRow";
|
|
10
|
+
import { HTML5Backend } from "react-dnd-html5-backend";
|
|
11
|
+
import { OrderContext } from "../context/OrderContext";
|
|
12
|
+
import { observe } from "@voplus/morpho-ui";
|
|
13
|
+
import styles from "./index.less";
|
|
14
|
+
import update from "immutability-helper";
|
|
15
|
+
import { useDocumentStore } from "@voplus/morpho-document-core";
|
|
16
|
+
const OrderItems = (props) => {
|
|
17
|
+
const { data } = props;
|
|
18
|
+
const [state] = useState(new State());
|
|
19
|
+
state.props = props;
|
|
20
|
+
const store = useOrderStore();
|
|
21
|
+
const documents = useDocumentStore();
|
|
22
|
+
const columnsList = [
|
|
23
|
+
{
|
|
24
|
+
title: "",
|
|
25
|
+
dataIndex: "Dnd",
|
|
26
|
+
width: 40,
|
|
27
|
+
align: "center",
|
|
28
|
+
className: "column-dnd",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
title: "Item",
|
|
32
|
+
dataIndex: "description",
|
|
33
|
+
editable: !state.readonly,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
title: "Unit Price",
|
|
37
|
+
dataIndex: "price",
|
|
38
|
+
editable: !state.readonly,
|
|
39
|
+
width: 120,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
title: "Qty",
|
|
43
|
+
dataIndex: "qty",
|
|
44
|
+
editable: !state.readonly,
|
|
45
|
+
width: 120,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
title: (React.createElement("div", null,
|
|
49
|
+
"Discount",
|
|
50
|
+
React.createElement("div", null, "(%)"))),
|
|
51
|
+
dataIndex: "discount",
|
|
52
|
+
editable: !state.readonly,
|
|
53
|
+
width: 120,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
title: "Amount",
|
|
57
|
+
dataIndex: "amount",
|
|
58
|
+
editable: !state.readonly,
|
|
59
|
+
width: 120,
|
|
60
|
+
align: "right",
|
|
61
|
+
},
|
|
62
|
+
];
|
|
63
|
+
const components = {
|
|
64
|
+
body: {
|
|
65
|
+
row: DragTableRow,
|
|
66
|
+
cell: DragTableCell,
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
const columns = columnsList.map((col) => {
|
|
70
|
+
return {
|
|
71
|
+
...col,
|
|
72
|
+
onCell: (record, rowIndex) => {
|
|
73
|
+
return {
|
|
74
|
+
record,
|
|
75
|
+
editable: col.editable,
|
|
76
|
+
dataIndex: col.dataIndex,
|
|
77
|
+
rowIndex: rowIndex,
|
|
78
|
+
onAdd,
|
|
79
|
+
onDel,
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
});
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
runInAction(() => (state.orderLines = clone(data.lines)));
|
|
86
|
+
}, [data.lines]);
|
|
87
|
+
return observe(() => (React.createElement(OrderContext.Provider, { value: state },
|
|
88
|
+
React.createElement(DndProvider, { backend: HTML5Backend },
|
|
89
|
+
React.createElement(Table, { className: styles["order-lines-table"], components: components, pagination: false, rowClassName: () => "editable-row", bordered: true, dataSource: state.orderLines, columns: columns, rowKey: "id", onRow: (record, index) => ({
|
|
90
|
+
index,
|
|
91
|
+
moveAfter: moveAfter,
|
|
92
|
+
onMouseEnter: () => runInAction(() => (state.hoverKey = index)),
|
|
93
|
+
onMouseLeave: () => runInAction(() => (state.hoverKey = -1)),
|
|
94
|
+
}), footer: () => {
|
|
95
|
+
var _a;
|
|
96
|
+
return (React.createElement(React.Fragment, null,
|
|
97
|
+
React.createElement("div", null, !state.readonly && (React.createElement(React.Fragment, null,
|
|
98
|
+
React.createElement(Button, { type: "link", onClick: onAdd }, "Add an item"),
|
|
99
|
+
React.createElement(Button, { type: "link", className: "cancel", onClick: getOrder }, "Reset"),
|
|
100
|
+
React.createElement(Button, { loading: state.loading, type: "link", disabled: isEqual(toJS(state.orderLines), data.lines), onClick: onSave }, "Save"))
|
|
101
|
+
// )}
|
|
102
|
+
// </React.Fragment>
|
|
103
|
+
)),
|
|
104
|
+
React.createElement("div", { className: "total" },
|
|
105
|
+
"TOTAL",
|
|
106
|
+
React.createElement("span", null, (_a = state.total) === null || _a === void 0 ? void 0 : _a.toLocaleString(undefined, {
|
|
107
|
+
minimumFractionDigits: 2,
|
|
108
|
+
})))));
|
|
109
|
+
} })))));
|
|
110
|
+
/** reload order */
|
|
111
|
+
function getOrder() {
|
|
112
|
+
const document = documents.items.get(data.id);
|
|
113
|
+
runInAction(() => {
|
|
114
|
+
state.orderLines = clone(document.lines);
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
/** Add Order */
|
|
118
|
+
function onAdd() {
|
|
119
|
+
const id = Math.floor(Math.random() * 100000 + 1);
|
|
120
|
+
runInAction(() => (state.orderLines = [...(state.orderLines || []), { id, added: true, ...state.orderLines }]));
|
|
121
|
+
}
|
|
122
|
+
/** */
|
|
123
|
+
function onDel(id) {
|
|
124
|
+
runInAction(() => {
|
|
125
|
+
if (state.isAdding)
|
|
126
|
+
return (state.orderLines = state.orderLines.filter((line) => line.id !== id));
|
|
127
|
+
return Modal.confirm({
|
|
128
|
+
title: "Do you want to delete this item?",
|
|
129
|
+
onOk() {
|
|
130
|
+
state.orderLines = state.orderLines.filter((line) => line.id !== id);
|
|
131
|
+
onSave();
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
async function onSave() {
|
|
137
|
+
const Lines = state.orderLines.map(({ description, price, qty, discount }) => ({
|
|
138
|
+
Description: description,
|
|
139
|
+
Price: price,
|
|
140
|
+
Qty: qty,
|
|
141
|
+
Discount: discount,
|
|
142
|
+
}));
|
|
143
|
+
state.loading = true;
|
|
144
|
+
await store.edit(data.id, { data: { Lines }, error: "message" });
|
|
145
|
+
runInAction(() => (state.loading = false));
|
|
146
|
+
getOrder();
|
|
147
|
+
}
|
|
148
|
+
function moveAfter(dragIndex, afterIndex) {
|
|
149
|
+
const dragRow = state.orderLines[dragIndex];
|
|
150
|
+
runInAction(() => (state.orderLines = update(state.orderLines, {
|
|
151
|
+
$splice: [
|
|
152
|
+
[dragIndex, 1],
|
|
153
|
+
[afterIndex, 0, dragRow],
|
|
154
|
+
],
|
|
155
|
+
})));
|
|
156
|
+
// onSave();
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
export default OrderItems;
|
|
160
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/order/OrderItems/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAsB,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAc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AC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
.order-lines-table {
|
|
2
|
+
padding: 0 20px;
|
|
3
|
+
:global {
|
|
4
|
+
.ant-table {
|
|
5
|
+
.ant-table-container {
|
|
6
|
+
overflow-x: auto;
|
|
7
|
+
}
|
|
8
|
+
.ant-input-number {
|
|
9
|
+
width: 100%;
|
|
10
|
+
}
|
|
11
|
+
.ant-table-thead > tr > th {
|
|
12
|
+
padding: 0 10px;
|
|
13
|
+
}
|
|
14
|
+
td {
|
|
15
|
+
padding: 0 10px;
|
|
16
|
+
min-width: 100px;
|
|
17
|
+
height: 54px;
|
|
18
|
+
textarea.ant-input {
|
|
19
|
+
margin: 0;
|
|
20
|
+
}
|
|
21
|
+
&.column-edit {
|
|
22
|
+
padding: 0;
|
|
23
|
+
}
|
|
24
|
+
&.column-dnd {
|
|
25
|
+
min-width: 40px;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
.ant-table-footer {
|
|
29
|
+
display: flex;
|
|
30
|
+
justify-content: space-between;
|
|
31
|
+
align-items: center;
|
|
32
|
+
padding: 10px 0;
|
|
33
|
+
.cancel {
|
|
34
|
+
color: #666;
|
|
35
|
+
}
|
|
36
|
+
.total {
|
|
37
|
+
font-size: 13px;
|
|
38
|
+
padding: 0 10px;
|
|
39
|
+
span {
|
|
40
|
+
margin-left: 5px;
|
|
41
|
+
font-size: 15px;
|
|
42
|
+
font-weight: 500;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { IOrder, IOrderLine } from "../../../data/order";
|
|
2
|
+
export declare type ItemsProps = {
|
|
3
|
+
data: IOrder;
|
|
4
|
+
};
|
|
5
|
+
export declare class State {
|
|
6
|
+
props: ItemsProps;
|
|
7
|
+
/** Array of new lines to be added. */
|
|
8
|
+
OrderLine: {
|
|
9
|
+
description: string;
|
|
10
|
+
price: number;
|
|
11
|
+
qty: number;
|
|
12
|
+
discount: number;
|
|
13
|
+
};
|
|
14
|
+
/** Id of Delete of line */
|
|
15
|
+
hoverKey: number;
|
|
16
|
+
/** lines of order */
|
|
17
|
+
orderLines: any[];
|
|
18
|
+
/** loading of saving */
|
|
19
|
+
loading: boolean;
|
|
20
|
+
constructor();
|
|
21
|
+
/** amount of order line */
|
|
22
|
+
getAmount: (line: IOrderLine) => number;
|
|
23
|
+
/** Total of Amount of OrderLine */
|
|
24
|
+
get total(): any;
|
|
25
|
+
/** readonly */
|
|
26
|
+
get readonly(): boolean;
|
|
27
|
+
/** Is Adding */
|
|
28
|
+
get isAdding(): boolean;
|
|
29
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { computed, makeAutoObservable, observable } from "mobx";
|
|
3
|
+
export class State {
|
|
4
|
+
constructor() {
|
|
5
|
+
Object.defineProperty(this, "props", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
configurable: true,
|
|
8
|
+
writable: true,
|
|
9
|
+
value: void 0
|
|
10
|
+
});
|
|
11
|
+
/** Array of new lines to be added. */
|
|
12
|
+
Object.defineProperty(this, "OrderLine", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
configurable: true,
|
|
15
|
+
writable: true,
|
|
16
|
+
value: {
|
|
17
|
+
description: "",
|
|
18
|
+
price: 0,
|
|
19
|
+
qty: 1,
|
|
20
|
+
discount: 0,
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
/** Id of Delete of line */
|
|
24
|
+
Object.defineProperty(this, "hoverKey", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
configurable: true,
|
|
27
|
+
writable: true,
|
|
28
|
+
value: void 0
|
|
29
|
+
});
|
|
30
|
+
/** lines of order */
|
|
31
|
+
Object.defineProperty(this, "orderLines", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
configurable: true,
|
|
34
|
+
writable: true,
|
|
35
|
+
value: []
|
|
36
|
+
});
|
|
37
|
+
/** loading of saving */
|
|
38
|
+
Object.defineProperty(this, "loading", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
configurable: true,
|
|
41
|
+
writable: true,
|
|
42
|
+
value: false
|
|
43
|
+
});
|
|
44
|
+
/** amount of order line */
|
|
45
|
+
Object.defineProperty(this, "getAmount", {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
configurable: true,
|
|
48
|
+
writable: true,
|
|
49
|
+
value: (line) => {
|
|
50
|
+
return line
|
|
51
|
+
? Number.parseFloat((line.price * (line.qty * ((100 - line.discount) / 100))).toFixed(2))
|
|
52
|
+
: 0;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
makeAutoObservable(this);
|
|
56
|
+
}
|
|
57
|
+
/** Total of Amount of OrderLine */
|
|
58
|
+
get total() {
|
|
59
|
+
var _a;
|
|
60
|
+
return (_a = this.orderLines) === null || _a === void 0 ? void 0 : _a.reduce((total, line) => Number.parseFloat((total + this.getAmount(line)).toFixed(2)), 0);
|
|
61
|
+
}
|
|
62
|
+
/** readonly */
|
|
63
|
+
get readonly() {
|
|
64
|
+
return this.props && this.props.data && !!this.props.data.readonly;
|
|
65
|
+
}
|
|
66
|
+
/** Is Adding */
|
|
67
|
+
get isAdding() {
|
|
68
|
+
return this.orderLines.some(({ added }) => !!added);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
__decorate([
|
|
72
|
+
observable
|
|
73
|
+
], State.prototype, "hoverKey", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
observable
|
|
76
|
+
], State.prototype, "orderLines", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
observable
|
|
79
|
+
], State.prototype, "loading", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
computed
|
|
82
|
+
], State.prototype, "total", null);
|
|
83
|
+
__decorate([
|
|
84
|
+
computed
|
|
85
|
+
], State.prototype, "readonly", null);
|
|
86
|
+
__decorate([
|
|
87
|
+
computed
|
|
88
|
+
], State.prototype, "isAdding", null);
|
|
89
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../src/modules/order/OrderItems/state.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAMhE,MAAM,OAAO,KAAK;IAgBjB;QAfA;;;;;WAAyB;QACzB,sCAAsC;QACtC;;;;mBAAmB;gBAClB,WAAW,EAAE,EAAE;gBACf,KAAK,EAAE,CAAC;gBACR,GAAG,EAAE,CAAC;gBACN,QAAQ,EAAE,CAAC;aACX;WAAC;QACF,2BAA2B;QACf;;;;;WAAwB;QACpC,qBAAqB;QACT;;;;mBAA2B,EAAE;WAAC;QAC1C,wBAAwB;QACZ;;;;mBAAiB,KAAK;WAAC;QAMnC,2BAA2B;QAC3B;;;;mBAAmB,CAAC,IAAgB,EAAE,EAAE;gBACvC,OAAO,IAAI;oBACV,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;oBACzF,CAAC,CAAC,CAAC,CAAC;YACN,CAAC;WAAC;QARD,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAQD,oCAAoC;IAEpC,IAAW,KAAK;;QACf,OAAO,MAAA,IAAI,CAAC,UAAU,0CAAE,MAAM,CAC7B,CAAC,KAAa,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EACrF,CAAC,CACD,CAAC;IACH,CAAC;IACD,eAAe;IAEf,IAAW,QAAQ;QAClB,OAAO,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC;IACpE,CAAC;IACD,gBAAgB;IAEhB,IAAW,QAAQ;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACrD,CAAC;CACD;AAlCY;IAAX,UAAU;uCAAyB;AAExB;IAAX,UAAU;yCAA+B;AAE9B;IAAX,UAAU;sCAAwB;AAcnC;IADC,QAAQ;kCAMR;AAGD;IADC,QAAQ;qCAGR;AAGD;IADC,QAAQ;qCAGR"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import "./index.less";
|
|
2
|
+
import { InlineEdit, observe } from "@voplus/morpho-ui";
|
|
3
|
+
import React, { useState } from "react";
|
|
4
|
+
import { State, currencyList } from "./state";
|
|
5
|
+
import DateInputEditor from "@voplus/morpho-ui/es/controls/InlineEdit/editors/DateInputEditor";
|
|
6
|
+
import { Select } from "@voplus/antd";
|
|
7
|
+
import classnames from "classnames";
|
|
8
|
+
import moment from "moment";
|
|
9
|
+
import { runInAction } from "mobx";
|
|
10
|
+
import { useOrderStore } from "../../../data/order";
|
|
11
|
+
const OrderLabel = (props) => {
|
|
12
|
+
const { order } = props;
|
|
13
|
+
const [state] = useState(new State());
|
|
14
|
+
const store = useOrderStore();
|
|
15
|
+
return observe(() => (React.createElement("div", { className: "order-label" },
|
|
16
|
+
React.createElement("div", null,
|
|
17
|
+
React.createElement("div", { className: "bold" }, "Quotation"),
|
|
18
|
+
React.createElement(InlineEdit, { editable: !order.readonly, defaultValue: order.number, content: (v) => (React.createElement("div", { className: classnames({ nothing: !v.store.value && !order.number }) }, v.store.value || order.number || "Quotation Number")), onSave: (v) => (v ? onEdit(order.number, v, { Number: v }) : null) })),
|
|
19
|
+
React.createElement("div", null,
|
|
20
|
+
React.createElement("div", { className: "bold" }, "Currency"),
|
|
21
|
+
state.currencyEdit ? (React.createElement(Select, { autoFocus: true, showSearch: true, open: state.currencyEdit, style: { width: "100%" }, value: order.currency, optionFilterProp: "children", onChange: changeCurrency, onBlur: () => runInAction(() => (state.currencyEdit = false)) }, currencyList.map((currency) => (React.createElement(Select.Option, { key: currency, value: currency }, currency))))) : (React.createElement("div", { onClick: () => !order.readonly && runInAction(() => (state.currencyEdit = true)) }, order.currency))),
|
|
22
|
+
React.createElement("div", null,
|
|
23
|
+
React.createElement("div", { className: "bold" }, "Date"),
|
|
24
|
+
React.createElement(InlineEdit, { editor: DateInputEditor, editable: !order.readonly, defaultValue: moment(order.date), content: (v) => (React.createElement("div", null, v.store.value ? moment(v.store.value).format("YYYY-MM-DD") : "Add Date")), onSave: (v) => v
|
|
25
|
+
? onEdit(moment(order.date).format("YYYY-MM-DD"), moment(v).format("YYYY-MM-DD"), {
|
|
26
|
+
Date: new Date(v),
|
|
27
|
+
})
|
|
28
|
+
: null })))));
|
|
29
|
+
function changeCurrency(value) {
|
|
30
|
+
runInAction(() => (state.currencyEdit = false));
|
|
31
|
+
onEdit(order.currency, value, { currency: value });
|
|
32
|
+
}
|
|
33
|
+
async function onEdit(oldData, data, option) {
|
|
34
|
+
if (oldData === data.trim())
|
|
35
|
+
return;
|
|
36
|
+
await store.edit(order.id, { data: option, error: "message" });
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
export default OrderLabel;
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/order/OrderLabel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,mBAAm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C,YAAY,CAAC,CAAC,CAAC,CAAC,UAAU,CAAO,CACpF,EACD,MAAM,EAAE,CAAC,CAAM,EAAE,EAAE,CAClB,CAAC;oBACA,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE;wBAChF,IAAI,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC;qBAChB,CAAC;oBACJ,CAAC,CAAC,IAAI,GAEP,CACG,CACD,CACN,CAAC,CAAC;IAEH,SAAS,cAAc,CAAC,KAAa;QACpC,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,CAAC,CAAC;QAChD,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;IACpD,CAAC;IACD,KAAK,UAAU,MAAM,CAAC,OAAe,EAAE,IAAY,EAAE,MAAW;QAC/D,IAAI,OAAO,KAAK,IAAI,CAAC,IAAI,EAAE;YAAE,OAAO;QACpC,MAAM,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IAChE,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
:global {
|
|
2
|
+
.order-label {
|
|
3
|
+
display: flex;
|
|
4
|
+
padding: 15px 20px;
|
|
5
|
+
margin: 0 -10px;
|
|
6
|
+
> div {
|
|
7
|
+
flex: 1;
|
|
8
|
+
color: #000;
|
|
9
|
+
padding: 0 10px;
|
|
10
|
+
}
|
|
11
|
+
.bold {
|
|
12
|
+
font-weight: 500;
|
|
13
|
+
font-size: 15px;
|
|
14
|
+
padding-bottom: 10px;
|
|
15
|
+
}
|
|
16
|
+
.nothing {
|
|
17
|
+
font-style: italic;
|
|
18
|
+
color: #999;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare class State {
|
|
2
|
+
/** EDit To of the order. */
|
|
3
|
+
contactEdit: boolean;
|
|
4
|
+
/** EDit To of the order. */
|
|
5
|
+
currencyEdit: boolean;
|
|
6
|
+
/** Edit Date of the order. */
|
|
7
|
+
dateEdit: boolean;
|
|
8
|
+
constructor();
|
|
9
|
+
}
|
|
10
|
+
export declare const currencyList: string[];
|