@nerdjs/sales-kit 1.0.1 → 1.0.3
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/entities/accessorial/accessorial.d.ts +12 -0
- package/dist/entities/accessorial/accessorial.js +41 -0
- package/dist/entities/accessorial/accessorial.js.map +1 -0
- package/dist/entities/accessorial/helper.d.ts +5 -0
- package/dist/entities/accessorial/helper.js +16 -0
- package/dist/entities/accessorial/helper.js.map +1 -0
- package/dist/entities/accessorial/index.d.ts +2 -0
- package/dist/entities/accessorial/index.js +3 -0
- package/dist/entities/accessorial/index.js.map +1 -0
- package/dist/entities/accessorials/accessorials.d.ts +7 -0
- package/dist/entities/accessorials/accessorials.js +29 -0
- package/dist/entities/accessorials/accessorials.js.map +1 -0
- package/dist/entities/accessorials/helper.d.ts +5 -0
- package/dist/entities/accessorials/helper.js +16 -0
- package/dist/entities/accessorials/helper.js.map +1 -0
- package/dist/entities/accessorials/index.d.ts +2 -0
- package/dist/entities/accessorials/index.js +3 -0
- package/dist/entities/accessorials/index.js.map +1 -0
- package/dist/{cjs/entities → entities}/customer/customer.d.ts +16 -16
- package/dist/entities/customer/customer.js +63 -0
- package/dist/entities/customer/customer.js.map +1 -0
- package/dist/{cjs/entities → entities}/customer/helper.d.ts +5 -5
- package/dist/entities/customer/helper.js +16 -0
- package/dist/entities/customer/helper.js.map +1 -0
- package/dist/{cjs/entities → entities}/customer/index.d.ts +1 -1
- package/dist/entities/customer/index.js +2 -0
- package/dist/entities/customer/index.js.map +1 -0
- package/dist/entities/holiday/helper.d.ts +5 -0
- package/dist/entities/holiday/helper.js +16 -0
- package/dist/entities/holiday/helper.js.map +1 -0
- package/dist/entities/holiday/holiday.d.ts +7 -0
- package/dist/entities/holiday/holiday.js +31 -0
- package/dist/entities/holiday/holiday.js.map +1 -0
- package/dist/entities/holiday/index.d.ts +2 -0
- package/dist/entities/holiday/index.js +3 -0
- package/dist/entities/holiday/index.js.map +1 -0
- package/dist/entities/index.d.ts +12 -0
- package/dist/entities/index.js +13 -0
- package/dist/entities/index.js.map +1 -0
- package/dist/entities/load/helper.d.ts +6 -0
- package/dist/entities/load/helper.js +28 -0
- package/dist/entities/load/helper.js.map +1 -0
- package/dist/entities/load/index.d.ts +2 -0
- package/dist/entities/load/index.js +3 -0
- package/dist/entities/load/index.js.map +1 -0
- package/dist/entities/load/load.d.ts +102 -0
- package/dist/entities/load/load.js +224 -0
- package/dist/entities/load/load.js.map +1 -0
- package/dist/entities/loadAdjustment/helper.d.ts +5 -0
- package/dist/entities/loadAdjustment/helper.js +16 -0
- package/dist/entities/loadAdjustment/helper.js.map +1 -0
- package/dist/entities/loadAdjustment/index.d.ts +2 -0
- package/dist/entities/loadAdjustment/index.js +3 -0
- package/dist/entities/loadAdjustment/index.js.map +1 -0
- package/dist/entities/loadAdjustment/loadAdjustment.d.ts +15 -0
- package/dist/entities/loadAdjustment/loadAdjustment.js +48 -0
- package/dist/entities/loadAdjustment/loadAdjustment.js.map +1 -0
- package/dist/{cjs/entities → entities}/location/helper.d.ts +5 -5
- package/dist/entities/location/helper.js +16 -0
- package/dist/entities/location/helper.js.map +1 -0
- package/dist/{cjs/entities → entities}/location/index.d.ts +2 -2
- package/dist/entities/location/index.js +3 -0
- package/dist/entities/location/index.js.map +1 -0
- package/dist/{cjs/entities → entities}/location/location.d.ts +33 -32
- package/dist/entities/location/location.js +47 -0
- package/dist/entities/location/location.js.map +1 -0
- package/dist/{cjs/entities → entities}/marketCosts/helper.d.ts +5 -5
- package/dist/entities/marketCosts/helper.js +16 -0
- package/dist/entities/marketCosts/helper.js.map +1 -0
- package/dist/{cjs/entities → entities}/marketCosts/index.d.ts +2 -2
- package/dist/entities/marketCosts/index.js +3 -0
- package/dist/entities/marketCosts/index.js.map +1 -0
- package/dist/{cjs/entities → entities}/marketCosts/marketCosts.d.ts +22 -22
- package/dist/entities/marketCosts/marketCosts.js +60 -0
- package/dist/entities/marketCosts/marketCosts.js.map +1 -0
- package/dist/{cjs/entities → entities}/quote/helper.d.ts +5 -5
- package/dist/entities/quote/helper.js +16 -0
- package/dist/entities/quote/helper.js.map +1 -0
- package/dist/{cjs/entities → entities}/quote/index.d.ts +2 -2
- package/dist/entities/quote/index.js +3 -0
- package/dist/entities/quote/index.js.map +1 -0
- package/dist/entities/quote/quote.d.ts +76 -0
- package/dist/entities/quote/quote.js +46 -0
- package/dist/entities/quote/quote.js.map +1 -0
- package/dist/entities/quoteAccessorial/helper.d.ts +5 -0
- package/dist/entities/quoteAccessorial/helper.js +16 -0
- package/dist/entities/quoteAccessorial/helper.js.map +1 -0
- package/dist/entities/quoteAccessorial/index.d.ts +2 -0
- package/dist/entities/quoteAccessorial/index.js +3 -0
- package/dist/entities/quoteAccessorial/index.js.map +1 -0
- package/dist/entities/quoteAccessorial/quoteAccessorial.d.ts +29 -0
- package/dist/entities/quoteAccessorial/quoteAccessorial.js +77 -0
- package/dist/entities/quoteAccessorial/quoteAccessorial.js.map +1 -0
- package/dist/entities/quoteResponse/helper.d.ts +5 -0
- package/dist/entities/quoteResponse/helper.js +16 -0
- package/dist/entities/quoteResponse/helper.js.map +1 -0
- package/dist/entities/quoteResponse/index.d.ts +2 -0
- package/dist/entities/quoteResponse/index.js +3 -0
- package/dist/entities/quoteResponse/index.js.map +1 -0
- package/dist/entities/quoteResponse/quoteResponse.d.ts +72 -0
- package/dist/entities/quoteResponse/quoteResponse.js +67 -0
- package/dist/entities/quoteResponse/quoteResponse.js.map +1 -0
- package/dist/entities/shipcon/helper.d.ts +6 -0
- package/dist/entities/shipcon/helper.js +20 -0
- package/dist/entities/shipcon/helper.js.map +1 -0
- package/dist/entities/shipcon/index.d.ts +2 -0
- package/dist/entities/shipcon/index.js +3 -0
- package/dist/entities/shipcon/index.js.map +1 -0
- package/dist/entities/shipcon/shipcon.d.ts +27 -0
- package/dist/entities/shipcon/shipcon.js +74 -0
- package/dist/entities/shipcon/shipcon.js.map +1 -0
- package/dist/helpers.d.ts +18 -0
- package/dist/helpers.js +29 -0
- package/dist/helpers.js.map +1 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +3 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/locationsForm/index.d.ts +1 -0
- package/dist/hooks/locationsForm/index.js +2 -0
- package/dist/hooks/locationsForm/index.js.map +1 -0
- package/dist/hooks/locationsForm/locationsForm.d.ts +2 -0
- package/dist/hooks/locationsForm/locationsForm.js +35 -0
- package/dist/hooks/locationsForm/locationsForm.js.map +1 -0
- package/dist/hooks/quote/constants.d.ts +187 -0
- package/dist/hooks/quote/constants.js +137 -0
- package/dist/hooks/quote/constants.js.map +1 -0
- package/dist/hooks/quote/form.d.ts +7 -0
- package/dist/hooks/quote/form.js +203 -0
- package/dist/hooks/quote/form.js.map +1 -0
- package/dist/hooks/quote/helpers.d.ts +39 -0
- package/dist/hooks/quote/helpers.js +366 -0
- package/dist/hooks/quote/helpers.js.map +1 -0
- package/dist/hooks/quote/index.d.ts +5 -0
- package/dist/hooks/quote/index.js +6 -0
- package/dist/hooks/quote/index.js.map +1 -0
- package/dist/hooks/quote/result.d.ts +7 -0
- package/dist/hooks/quote/result.js +196 -0
- package/dist/hooks/quote/result.js.map +1 -0
- package/dist/hooks/quote/template.d.ts +7 -0
- package/dist/hooks/quote/template.js +113 -0
- package/dist/hooks/quote/template.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/redux/appState.d.ts +4 -0
- package/dist/redux/appState.js +2 -0
- package/dist/redux/appState.js.map +1 -0
- package/dist/redux/customer/customerActions.d.ts +97 -0
- package/dist/redux/customer/customerActions.js +210 -0
- package/dist/redux/customer/customerActions.js.map +1 -0
- package/dist/redux/customer/customerReducer.d.ts +2 -0
- package/dist/redux/customer/customerReducer.js +42 -0
- package/dist/redux/customer/customerReducer.js.map +1 -0
- package/dist/redux/customer/customerSelector.d.ts +27 -0
- package/dist/redux/customer/customerSelector.js +38 -0
- package/dist/redux/customer/customerSelector.js.map +1 -0
- package/dist/redux/customer/customerState.d.ts +11 -0
- package/dist/redux/customer/customerState.js +2 -0
- package/dist/redux/customer/customerState.js.map +1 -0
- package/dist/redux/customer/index.d.ts +4 -0
- package/dist/redux/customer/index.js +5 -0
- package/dist/redux/customer/index.js.map +1 -0
- package/dist/redux/index.d.ts +8 -0
- package/dist/redux/index.js +9 -0
- package/dist/redux/index.js.map +1 -0
- package/dist/redux/load/index.d.ts +4 -0
- package/dist/redux/load/index.js +5 -0
- package/dist/redux/load/index.js.map +1 -0
- package/dist/redux/load/loadActions.d.ts +80 -0
- package/dist/redux/load/loadActions.js +172 -0
- package/dist/redux/load/loadActions.js.map +1 -0
- package/dist/redux/load/loadReducer.d.ts +2 -0
- package/dist/redux/load/loadReducer.js +35 -0
- package/dist/redux/load/loadReducer.js.map +1 -0
- package/dist/redux/load/loadSelector.d.ts +27 -0
- package/dist/redux/load/loadSelector.js +19 -0
- package/dist/redux/load/loadSelector.js.map +1 -0
- package/dist/redux/load/loadState.d.ts +8 -0
- package/dist/redux/load/loadState.js +2 -0
- package/dist/redux/load/loadState.js.map +1 -0
- package/dist/redux/loadAdjustment/index.d.ts +4 -0
- package/dist/redux/loadAdjustment/index.js +5 -0
- package/dist/redux/loadAdjustment/index.js.map +1 -0
- package/dist/redux/loadAdjustment/loadAdjustmentActions.d.ts +80 -0
- package/dist/redux/loadAdjustment/loadAdjustmentActions.js +172 -0
- package/dist/redux/loadAdjustment/loadAdjustmentActions.js.map +1 -0
- package/dist/redux/loadAdjustment/loadAdjustmentReducer.d.ts +2 -0
- package/dist/redux/loadAdjustment/loadAdjustmentReducer.js +35 -0
- package/dist/redux/loadAdjustment/loadAdjustmentReducer.js.map +1 -0
- package/dist/redux/loadAdjustment/loadAdjustmentSelector.d.ts +15 -0
- package/dist/redux/loadAdjustment/loadAdjustmentSelector.js +12 -0
- package/dist/redux/loadAdjustment/loadAdjustmentSelector.js.map +1 -0
- package/dist/redux/loadAdjustment/loadAdjustmentState.d.ts +8 -0
- package/dist/redux/loadAdjustment/loadAdjustmentState.js +2 -0
- package/dist/redux/loadAdjustment/loadAdjustmentState.js.map +1 -0
- package/dist/redux/location/index.d.ts +4 -0
- package/dist/redux/location/index.js +5 -0
- package/dist/redux/location/index.js.map +1 -0
- package/dist/redux/location/locationActions.d.ts +101 -0
- package/dist/redux/location/locationActions.js +218 -0
- package/dist/redux/location/locationActions.js.map +1 -0
- package/dist/redux/location/locationReducer.d.ts +2 -0
- package/dist/redux/location/locationReducer.js +54 -0
- package/dist/redux/location/locationReducer.js.map +1 -0
- package/dist/redux/location/locationSelector.d.ts +53 -0
- package/dist/redux/location/locationSelector.js +32 -0
- package/dist/redux/location/locationSelector.js.map +1 -0
- package/dist/redux/location/locationState.d.ts +15 -0
- package/dist/redux/location/locationState.js +2 -0
- package/dist/redux/location/locationState.js.map +1 -0
- package/dist/{cjs/redux → redux}/quote/index.d.ts +5 -4
- package/dist/redux/quote/index.js +6 -0
- package/dist/redux/quote/index.js.map +1 -0
- package/dist/redux/quote/quoteAction.d.ts +177 -0
- package/dist/redux/quote/quoteAction.js +351 -0
- package/dist/redux/quote/quoteAction.js.map +1 -0
- package/dist/redux/quote/quoteMiddleware.d.ts +2 -0
- package/dist/redux/quote/quoteMiddleware.js +31 -0
- package/dist/redux/quote/quoteMiddleware.js.map +1 -0
- package/dist/redux/quote/quoteReducer.d.ts +27 -0
- package/dist/redux/quote/quoteReducer.js +207 -0
- package/dist/redux/quote/quoteReducer.js.map +1 -0
- package/dist/redux/quote/quoteSelector.d.ts +199 -0
- package/dist/redux/quote/quoteSelector.js +141 -0
- package/dist/redux/quote/quoteSelector.js.map +1 -0
- package/dist/redux/quote/quoteState.d.ts +9 -0
- package/dist/redux/quote/quoteState.js +2 -0
- package/dist/redux/quote/quoteState.js.map +1 -0
- package/dist/redux/quoteAccessorial/index.d.ts +3 -0
- package/dist/redux/quoteAccessorial/index.js +4 -0
- package/dist/redux/quoteAccessorial/index.js.map +1 -0
- package/dist/redux/quoteAccessorial/quoteAccessorialActions.d.ts +70 -0
- package/dist/redux/quoteAccessorial/quoteAccessorialActions.js +149 -0
- package/dist/redux/quoteAccessorial/quoteAccessorialActions.js.map +1 -0
- package/dist/redux/quoteAccessorial/quoteAccessorialReducer.d.ts +2 -0
- package/dist/redux/quoteAccessorial/quoteAccessorialReducer.js +29 -0
- package/dist/redux/quoteAccessorial/quoteAccessorialReducer.js.map +1 -0
- package/dist/redux/quoteAccessorial/quoteAccessorialState.d.ts +8 -0
- package/dist/redux/quoteAccessorial/quoteAccessorialState.js +2 -0
- package/dist/redux/quoteAccessorial/quoteAccessorialState.js.map +1 -0
- package/dist/redux/salesKitReducer.d.ts +25 -0
- package/dist/redux/salesKitReducer.js +18 -0
- package/dist/redux/salesKitReducer.js.map +1 -0
- package/dist/redux/shipcon/index.d.ts +4 -0
- package/dist/redux/shipcon/index.js +5 -0
- package/dist/redux/shipcon/index.js.map +1 -0
- package/dist/redux/shipcon/shipconActions.d.ts +80 -0
- package/dist/redux/shipcon/shipconActions.js +172 -0
- package/dist/redux/shipcon/shipconActions.js.map +1 -0
- package/dist/redux/shipcon/shipconReducer.d.ts +2 -0
- package/dist/redux/shipcon/shipconReducer.js +35 -0
- package/dist/redux/shipcon/shipconReducer.js.map +1 -0
- package/dist/redux/shipcon/shipconSelector.d.ts +22 -0
- package/dist/redux/shipcon/shipconSelector.js +19 -0
- package/dist/redux/shipcon/shipconSelector.js.map +1 -0
- package/dist/redux/shipcon/shipconState.d.ts +8 -0
- package/dist/redux/shipcon/shipconState.js +2 -0
- package/dist/redux/shipcon/shipconState.js.map +1 -0
- package/package.json +40 -71
- package/dist/cjs/components/calendar/calendar.d.ts +0 -5
- package/dist/cjs/components/calendar/day/day.d.ts +0 -8
- package/dist/cjs/components/calendar/day/index.d.ts +0 -1
- package/dist/cjs/components/calendar/day/typings.d.ts +0 -16
- package/dist/cjs/components/calendar/index.d.ts +0 -2
- package/dist/cjs/components/calendar/typings.d.ts +0 -27
- package/dist/cjs/components/customerFinder/customerFinder.d.ts +0 -11
- package/dist/cjs/components/customerFinder/index.d.ts +0 -2
- package/dist/cjs/components/customerFinder/optionTemplate.d.ts +0 -6
- package/dist/cjs/components/index.d.ts +0 -4
- package/dist/cjs/components/locationFinder/editLocation.d.ts +0 -15
- package/dist/cjs/components/locationFinder/index.d.ts +0 -1
- package/dist/cjs/components/locationFinder/locationByAddress.d.ts +0 -18
- package/dist/cjs/components/locationFinder/locationFinder.d.ts +0 -7
- package/dist/cjs/components/locationFinder/locationsFound.d.ts +0 -12
- package/dist/cjs/components/locationFinder/newLocationForm.d.ts +0 -20
- package/dist/cjs/components/locationFinder/optionTemplate.d.ts +0 -8
- package/dist/cjs/components/locationFinder/typings.d.ts +0 -23
- package/dist/cjs/components/salesQuote/components/aboutQuote/aboutQuote.d.ts +0 -5
- package/dist/cjs/components/salesQuote/components/aboutQuote/commodityDescription.d.ts +0 -16
- package/dist/cjs/components/salesQuote/components/aboutQuote/index.d.ts +0 -2
- package/dist/cjs/components/salesQuote/components/aboutQuote/quoteCheck.d.ts +0 -6
- package/dist/cjs/components/salesQuote/components/pallet/editPallet.d.ts +0 -11
- package/dist/cjs/components/salesQuote/components/pallet/palletChecker.d.ts +0 -15
- package/dist/cjs/components/salesQuote/components/pallet/palletCount.d.ts +0 -13
- package/dist/cjs/components/salesQuote/components/quoteCalendar/quoteCalendar.d.ts +0 -24
- package/dist/cjs/components/salesQuote/components/quoteResultAccordion/costBreakdown.d.ts +0 -14
- package/dist/cjs/components/salesQuote/components/quoteResultAccordion/marketCosts.d.ts +0 -7
- package/dist/cjs/components/salesQuote/components/quoteResultAccordion/quoteResultAccessorials.d.ts +0 -13
- package/dist/cjs/components/salesQuote/components/quoteResultAccordion/quoteResultAccordion.d.ts +0 -17
- package/dist/cjs/components/salesQuote/components/quoteSelect.d.ts +0 -4
- package/dist/cjs/components/salesQuote/components/quoteSummary/quoteSummary.d.ts +0 -4
- package/dist/cjs/components/salesQuote/components/quoteSummary/quoteSummaryBody.d.ts +0 -12
- package/dist/cjs/components/salesQuote/components/quoteSummary/quoteSummaryHeader.d.ts +0 -10
- package/dist/cjs/components/salesQuote/components/quoteSummary/typings.d.ts +0 -47
- package/dist/cjs/components/salesQuote/index.d.ts +0 -4
- package/dist/cjs/components/salesQuote/salesQuote.d.ts +0 -17
- package/dist/cjs/components/salesQuote/typings.d.ts +0 -156
- package/dist/cjs/components/shared/bootstrapDialogTitle/bootstrapDialogTitle.d.ts +0 -11
- package/dist/cjs/components/shared/bootstrapDialogTitle/index.d.ts +0 -1
- package/dist/cjs/components/shared/index.d.ts +0 -2
- package/dist/cjs/components/shared/loading/index.d.ts +0 -1
- package/dist/cjs/components/shared/loading/loading.d.ts +0 -6
- package/dist/cjs/components/stop/index.d.ts +0 -2
- package/dist/cjs/components/stop/menuAccessorials.d.ts +0 -27
- package/dist/cjs/components/stop/stop.d.ts +0 -4
- package/dist/cjs/components/stop/stopDetail.d.ts +0 -5
- package/dist/cjs/components/stop/stopDetailHeader.d.ts +0 -6
- package/dist/cjs/entities/index.d.ts +0 -4
- package/dist/cjs/entities/quote/quote.d.ts +0 -80
- package/dist/cjs/index.d.ts +0 -4
- package/dist/cjs/index.js +0 -3170
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/redux/calendar/calendarSlice.d.ts +0 -12
- package/dist/cjs/redux/calendar/index.d.ts +0 -1
- package/dist/cjs/redux/index.d.ts +0 -3
- package/dist/cjs/redux/nerdSalesKitReducer.d.ts +0 -10
- package/dist/cjs/redux/quote/quoteAction.d.ts +0 -125
- package/dist/cjs/redux/quote/quoteReducer.d.ts +0 -28
- package/dist/cjs/redux/quote/quoteSelector.d.ts +0 -22
- package/dist/cjs/redux/quote/quoteState.d.ts +0 -124
- package/dist/cjs/utils/constants.d.ts +0 -5
- package/dist/cjs/utils/helpers.d.ts +0 -17
- package/dist/cjs/utils/index.d.ts +0 -2
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button as JoyButton, Chip } from "@mui/joy";
|
|
3
|
+
import { Alert, alpha, Autocomplete, Button, ButtonGroup, Grid, LinearProgress, MenuItem, Paper, TextField, Tooltip, Typography, useTheme, } from "@mui/material";
|
|
4
|
+
import { Box } from "@mui/system";
|
|
5
|
+
import { DataGridPro, useGridApiRef, } from "@mui/x-data-grid-pro";
|
|
6
|
+
import { useEffect, useLayoutEffect, useState } from "react";
|
|
7
|
+
import { useHotkeys } from "react-hotkeys-hook";
|
|
8
|
+
import { useTranslation } from "react-i18next";
|
|
9
|
+
import { useDispatch, useSelector } from "react-redux";
|
|
10
|
+
import { searchCustomer } from "../../redux/customer/customerActions";
|
|
11
|
+
import { customersByFilterSelector, customerSelector, } from "../../redux/customer/customerSelector";
|
|
12
|
+
import { addPallet, addStop, checkPallets, getQuoteCommodityDescription, reorderStop, restartQuote, runQuote, setCustomerID, setQuoteBody, setQuoteReefer, setQuoteTotalDimension, updatePallet, updateStop, } from "../../redux/quote";
|
|
13
|
+
import { checkPalletMessageSelector, checkPalletsSelector, palletDimensionsSelector, quoteBodySelector, quoteCommodityDescriptionSelector, quoteErrorsSelector, quoteRunningSelector, } from "../../redux/quote/quoteSelector";
|
|
14
|
+
import { CONSIGNEES, CONTINUOUS_RUNNING, DRY, DRY_VAN_ONLY, FREIGHT_CLASS, icons, keyboardShortcuts, loadTypeOptions, LTL, LTL_TEMPERATURE, PALLET, REEFER, SHIPPERS, STANDARD_IM, TL_TEMPERATURE, } from "./constants";
|
|
15
|
+
import { getPalletsColumnDef, getStopsColumnDef } from "./helpers";
|
|
16
|
+
/**
|
|
17
|
+
* Quote form
|
|
18
|
+
*
|
|
19
|
+
* @returns {ReactElement} Quote Form
|
|
20
|
+
*/
|
|
21
|
+
export function QuoteForm() {
|
|
22
|
+
const { t } = useTranslation();
|
|
23
|
+
const errors = useSelector(quoteErrorsSelector);
|
|
24
|
+
return (_jsxs(Box, { sx: { flex: 1 }, children: [_jsx(Toolbar, {}), _jsxs(Box, { sx: {
|
|
25
|
+
display: "flex",
|
|
26
|
+
flexDirection: "column",
|
|
27
|
+
gap: 2,
|
|
28
|
+
p: 2,
|
|
29
|
+
}, children: [errors ? (_jsx(Alert, { severity: "error", children: _jsx("ul", { style: { margin: 0 }, children: errors.map((e) => (_jsx("li", { children: e }, e))) }) })) : ([]), _jsx(AboutTheLoad, {}), _jsx(Stops, { stopKind: SHIPPERS }), _jsx(Stops, { stopKind: CONSIGNEES }), _jsx(Box, { sx: { textAlign: "center", opacity: 0.5, lineHeight: 0.6 }, children: _jsxs(Typography, { variant: "caption", children: [_jsx("i", { className: "fa-duotone fa-circle-info pright" }), t("inacurateWarning"), _jsx("br", {}), t("selectLocationWarning")] }) })] })] }));
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Quote toolbar. Contains actions like restart, run quote or find a quote.
|
|
33
|
+
*
|
|
34
|
+
* @returns {ReactElement} Quote toolbar
|
|
35
|
+
*/
|
|
36
|
+
function Toolbar() {
|
|
37
|
+
const [offsetTop, setOffsetTop] = useState(0);
|
|
38
|
+
const dispatch = useDispatch();
|
|
39
|
+
const { t } = useTranslation();
|
|
40
|
+
const running = useSelector(quoteRunningSelector);
|
|
41
|
+
const theme = useTheme();
|
|
42
|
+
useHotkeys("ctrl + r", () => {
|
|
43
|
+
dispatch(restartQuote());
|
|
44
|
+
}, {
|
|
45
|
+
enableOnTags: ["INPUT", "SELECT", "TEXTAREA"],
|
|
46
|
+
});
|
|
47
|
+
useLayoutEffect(() => {
|
|
48
|
+
const updatePosition = () => {
|
|
49
|
+
setOffsetTop(window.pageYOffset);
|
|
50
|
+
};
|
|
51
|
+
window.addEventListener("scroll", updatePosition);
|
|
52
|
+
updatePosition();
|
|
53
|
+
return () => window.removeEventListener("scroll", updatePosition);
|
|
54
|
+
}, []);
|
|
55
|
+
const shrink = offsetTop > 0;
|
|
56
|
+
return (_jsxs(Box, { sx: {
|
|
57
|
+
display: "flex",
|
|
58
|
+
alignItems: "center",
|
|
59
|
+
justifyContent: "space-between",
|
|
60
|
+
position: "sticky",
|
|
61
|
+
backdropFilter: shrink ? "blur(10px)" : "none",
|
|
62
|
+
borderBottom: shrink ? "solid 1px rgba(155,155,155,0.3)" : "none",
|
|
63
|
+
background: shrink
|
|
64
|
+
? alpha(theme.palette.background.paper, 0.6)
|
|
65
|
+
: "none",
|
|
66
|
+
zIndex: 1000,
|
|
67
|
+
top: 48,
|
|
68
|
+
p: 2,
|
|
69
|
+
pt: shrink ? 1 : 2,
|
|
70
|
+
pb: shrink ? 1 : 2,
|
|
71
|
+
}, children: [_jsx(LinearProgress, { sx: {
|
|
72
|
+
opacity: running ? 1 : 0,
|
|
73
|
+
height: 3,
|
|
74
|
+
position: "absolute",
|
|
75
|
+
top: 0,
|
|
76
|
+
zIndex: 999,
|
|
77
|
+
width: "100%",
|
|
78
|
+
marginLeft: -2,
|
|
79
|
+
transform: "opacity .5s",
|
|
80
|
+
} }), _jsx(Typography, { variant: "h4", sx: {
|
|
81
|
+
fontWeight: 600,
|
|
82
|
+
fontSize: shrink ? "22px !important" : "36px !important",
|
|
83
|
+
transition: "font-size .3s ease-in-out",
|
|
84
|
+
}, children: t("Form") }), _jsxs(Box, { sx: { display: "flex", gap: 1 }, children: [_jsxs(JoyButton, { variant: "outlined", size: shrink ? "sm" : "md", children: [_jsx("i", { className: "fa-solid fa-magnifying-glass pright" }), t("find")] }), _jsx(Tooltip, { title: "ctrl+r", children: _jsxs(JoyButton, { size: shrink ? "sm" : "md", onClick: () => dispatch(restartQuote()), variant: "outlined", children: [_jsx("i", { className: "fa-sharp fa-solid fa-arrows-rotate pright" }), t("restart")] }) }), _jsx(Tooltip, { title: "ctrl+x", children: _jsxs(JoyButton, { variant: running ? "solid" : "soft", size: shrink ? "sm" : "md", onClick: () => {
|
|
85
|
+
dispatch(runQuote());
|
|
86
|
+
}, children: [running ? (_jsx("i", { className: "fa-solid fa-spinner fa-spin-pulse" })) : (_jsx("i", { className: "fa-duotone fa-play" })), _jsx("span", { style: { paddingLeft: 4 }, children: running ? t("Running...") : t("runQuote") })] }) })] })] }));
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* About the load. Form that contains input to gather info about the load.
|
|
90
|
+
*
|
|
91
|
+
* @returns {ReactElement} About The Load
|
|
92
|
+
*/
|
|
93
|
+
function AboutTheLoad() {
|
|
94
|
+
const body = useSelector(quoteBodySelector);
|
|
95
|
+
const commodities = useSelector(quoteCommodityDescriptionSelector);
|
|
96
|
+
const palletsCheck = useSelector(checkPalletsSelector);
|
|
97
|
+
const palletDimensions = useSelector(palletDimensionsSelector);
|
|
98
|
+
const checkPalletsMessage = useSelector(checkPalletMessageSelector);
|
|
99
|
+
const customersSuggestions = useSelector(customersByFilterSelector);
|
|
100
|
+
const customer = useSelector(customerSelector(body.customerId));
|
|
101
|
+
const errors = useSelector(quoteErrorsSelector);
|
|
102
|
+
const { t } = useTranslation();
|
|
103
|
+
const [open, setOpen] = useState(false);
|
|
104
|
+
const [customerInputValue, setCustomerInputValue] = useState("");
|
|
105
|
+
const apiRef = useGridApiRef();
|
|
106
|
+
const dispatch = useDispatch();
|
|
107
|
+
useEffect(() => {
|
|
108
|
+
if (palletDimensions?.length) {
|
|
109
|
+
dispatch(checkPallets(palletDimensions));
|
|
110
|
+
}
|
|
111
|
+
}, [palletDimensions]);
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
dispatch(getQuoteCommodityDescription());
|
|
114
|
+
}, []);
|
|
115
|
+
useEffect(() => {
|
|
116
|
+
if (!body.customerId) {
|
|
117
|
+
setCustomerInputValue("");
|
|
118
|
+
}
|
|
119
|
+
}, [body]);
|
|
120
|
+
useHotkeys(keyboardShortcuts[PALLET], () => {
|
|
121
|
+
dispatch(addPallet());
|
|
122
|
+
}, {
|
|
123
|
+
enableOnTags: ["INPUT", "SELECT", "TEXTAREA"],
|
|
124
|
+
});
|
|
125
|
+
const s = (b) => dispatch(setQuoteBody(b));
|
|
126
|
+
const r = (b) => dispatch(setQuoteReefer(b));
|
|
127
|
+
const d = (b) => dispatch(setQuoteTotalDimension(b));
|
|
128
|
+
const palletUpdate = async (_pallet) => {
|
|
129
|
+
return new Promise((resolve) => {
|
|
130
|
+
dispatch(updatePallet(_pallet));
|
|
131
|
+
setTimeout(() => {
|
|
132
|
+
resolve({ ..._pallet });
|
|
133
|
+
}, 50);
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
const reeferTemp = body.reefer?.reeferTemp ?? "";
|
|
137
|
+
const temperatureError = body.service === LTL
|
|
138
|
+
? !LTL_TEMPERATURE.test(reeferTemp)
|
|
139
|
+
: !TL_TEMPERATURE.test(reeferTemp);
|
|
140
|
+
return (_jsxs(Paper, { sx: { p: 2 }, children: [_jsxs(Typography, { variant: "h6", children: [_jsx("i", { className: "fa-duotone fa-truck-ramp-box pright" }), " ", t("aboutTheLoad")] }), _jsxs(Grid, { container: true, spacing: 2, sx: { pt: 1 }, children: [_jsx(Grid, { item: true, xs: 12, children: _jsx(Autocomplete, { open: open, onOpen: () => {
|
|
141
|
+
setOpen(true);
|
|
142
|
+
}, onClose: () => {
|
|
143
|
+
setOpen(false);
|
|
144
|
+
}, value: customer ?? null, onChange: (_e, v) => {
|
|
145
|
+
dispatch(setCustomerID(v?.id));
|
|
146
|
+
}, inputValue: customerInputValue, onInputChange: (_e, v) => setCustomerInputValue(v), isOptionEqualToValue: (option, value) => option.name === value.name, getOptionLabel: (option) => option.name, options: customersSuggestions, renderOption: (props, c) => (_jsx(Box, { component: "li", ...props, children: _jsxs(Box, { children: [_jsxs(Typography, { variant: "body2", children: [" ", c.name] }), _jsxs(Box, { sx: { display: "flex", gap: 1, alignItems: "center" }, children: [_jsx(Typography, { variant: "caption", children: `${c.city}, ${c.state} ${c.zip}` }), !c.is_active ? (_jsx(Chip, { size: "sm", variant: "soft", color: "danger", children: t("Inactive") })) : ([]), c.inactivity_hold ? (_jsx(Chip, { size: "sm", variant: "soft", color: "warning", children: t("Inactivity Hold") })) : ([]), c.credit_on_hold ? (_jsx(Chip, { size: "sm", variant: "soft", color: "warning", children: t("Credit on Hold") })) : ([])] })] }) })), renderInput: (params) => (_jsx(TextField, { ...params, error: errors && !customer, variant: "filled", label: "Select the Customer", onChange: (e) => dispatch(searchCustomer(e.target.value)), InputProps: {
|
|
147
|
+
...params.InputProps,
|
|
148
|
+
} })) }) }), _jsx(Grid, { item: true, children: _jsx(ButtonGroup, { orientation: "vertical", children: loadTypeOptions.map((i) => (_jsxs(Button, { onClick: () => {
|
|
149
|
+
if (i === STANDARD_IM)
|
|
150
|
+
s({ mode: DRY });
|
|
151
|
+
s({ service: i });
|
|
152
|
+
}, sx: { display: "flex", justifyContent: "space-between" }, variant: body.service === i ? "contained" : "outlined", children: [icons[i], i] }, i))) }) }), _jsx(Grid, { item: true, children: _jsx(ButtonGroup, { orientation: "vertical", children: [DRY, REEFER].map((i) => (_jsxs(Button, { onClick: () => s({ mode: i }), disabled: i === REEFER && body.service === STANDARD_IM, sx: { display: "flex", justifyContent: "space-between" }, variant: body.mode === i ? "contained" : "outlined", children: [icons[i], i] }, i))) }) }), body.mode === REEFER ? (_jsx(Grid, { item: true, xs: 12, md: 3, children: _jsx(TextField, { fullWidth: true, label: t("temperature"), size: "small", autoFocus: true, value: body.reefer?.reeferTemp ?? "", onChange: (e) => r({ reeferTemp: e.target.value }), helperText: body.service === LTL
|
|
153
|
+
? "Between 40℉ and 80℉"
|
|
154
|
+
: "Between -20℉ and 80℉", error: temperatureError }) })) : ([]), body.mode === REEFER ? (_jsx(Grid, { item: true, xs: 12, md: 4, children: _jsxs(Button, { variant: body.reefer?.reeferCont ? "contained" : "outlined", onClick: () => r({ reeferCont: !(body.reefer?.reeferCont ?? false) }), children: [icons[CONTINUOUS_RUNNING], CONTINUOUS_RUNNING] }) })) : (_jsx(Grid, { item: true, children: _jsxs(Button, { variant: body.dryVanOnly ? "contained" : "outlined", onClick: () => s({ dryVanOnly: !(body.dryVanOnly ?? false) }), children: [icons[DRY_VAN_ONLY], DRY_VAN_ONLY] }) })), _jsx(Grid, { item: true, xs: 12 }), _jsx(Grid, { item: true, xs: 12, md: 4, children: _jsx(TextField, { select: true, fullWidth: true, label: t("commodityDescription"), size: "small", helperText: _jsx("span", { children: "Note: No Haz Mat, Ice Cream." }), value: body.commodityDescriptionId ?? "", onChange: (e) => s({ commodityDescriptionId: parseInt(e.target.value) }), children: commodities.map((c) => (_jsxs(MenuItem, { value: c.id, children: [c.id && icons[c.id], c.name] }, c.id))) }) }), _jsx(Grid, { item: true, xs: 12, md: 4, children: _jsx(TextField, { fullWidth: true, label: t("totalWeight"), error: errors && !body.units?.totalDimensions?.totalWeight, size: "small", value: body.units?.totalDimensions?.totalWeight ?? "", onChange: (e) => d({ totalWeight: e.target.value }) }) }), _jsx(Grid, { item: true, xs: 12, md: 4, children: _jsx(TextField, { select: true, fullWidth: true, label: t("freightClass"), size: "small", value: body.freightClass ?? "", onChange: (e) => s({ freightClass: e.target.value }), children: FREIGHT_CLASS.map((f) => (_jsx(MenuItem, { value: f, children: f }, f))) }) }), _jsxs(Grid, { item: true, xs: 12, children: [_jsx(Tooltip, { title: "ctrl+p", children: _jsxs(JoyButton, { size: "sm", sx: { mb: 2 }, variant: "soft", color: errors && body.units?.palletDimensions?.length === 0
|
|
155
|
+
? "danger"
|
|
156
|
+
: undefined, onClick: () => dispatch(addPallet()), children: [_jsx("i", { className: "fa-duotone fa-pallet-boxes pright" }), " ", t("newPallet")] }) }), body.units?.palletDimensions?.length ? (_jsx(DataGridPro, { density: "compact", apiRef: apiRef, onCellClick: (e) => {
|
|
157
|
+
apiRef.current?.startCellEditMode({ id: e.id, field: e.field });
|
|
158
|
+
}, autoHeight: true, hideFooter: true, componentsProps: {
|
|
159
|
+
cell: { tabIndex: 1 },
|
|
160
|
+
}, experimentalFeatures: { newEditingApi: true }, processRowUpdate: palletUpdate, getRowId: (p) => p.key, rows: body.units?.palletDimensions, columns: getPalletsColumnDef(dispatch) })) : ([])] }), palletsCheck ? (_jsx(Grid, { item: true, xs: 12, children: _jsxs(Alert, { severity: "success", children: [t("validSpecs"), _jsx("b", { children: t("totalSpecs", {
|
|
161
|
+
feet: palletsCheck.feet,
|
|
162
|
+
weight: palletsCheck.weight,
|
|
163
|
+
pallets: palletsCheck.pallets,
|
|
164
|
+
}) })] }) })) : ([]), checkPalletsMessage ? (_jsx(Grid, { item: true, xs: 12, children: _jsxs(Alert, { severity: "error", children: [t("equipmentIssue"), _jsx("br", {}), checkPalletsMessage] }) })) : ([])] })] }));
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Stops. Datagrid allowing the user to input quote's stops.
|
|
168
|
+
*
|
|
169
|
+
* @param {string} stopKind variant. Could be shippers or consignees
|
|
170
|
+
* @returns {ReactElement} About The Load
|
|
171
|
+
*/
|
|
172
|
+
function Stops({ stopKind }) {
|
|
173
|
+
const dispatch = useDispatch();
|
|
174
|
+
const body = useSelector(quoteBodySelector);
|
|
175
|
+
const shippers = body.shippers;
|
|
176
|
+
const consignees = body.consignees;
|
|
177
|
+
const errors = useSelector(quoteErrorsSelector);
|
|
178
|
+
const { t } = useTranslation();
|
|
179
|
+
const apiRef = useGridApiRef();
|
|
180
|
+
const stops = stopKind === SHIPPERS ? shippers : consignees;
|
|
181
|
+
useHotkeys(keyboardShortcuts[stopKind], () => {
|
|
182
|
+
dispatch(addStop(stopKind));
|
|
183
|
+
}, {
|
|
184
|
+
enableOnTags: ["INPUT", "SELECT", "TEXTAREA"],
|
|
185
|
+
});
|
|
186
|
+
const stopUpdate = async (_stop) => {
|
|
187
|
+
return new Promise((resolve) => {
|
|
188
|
+
dispatch(updateStop(_stop));
|
|
189
|
+
setTimeout(() => {
|
|
190
|
+
resolve({ ..._stop });
|
|
191
|
+
}, 50);
|
|
192
|
+
});
|
|
193
|
+
};
|
|
194
|
+
const stopPosition = (params) => {
|
|
195
|
+
dispatch(reorderStop(stopKind, params.oldIndex, params.targetIndex));
|
|
196
|
+
};
|
|
197
|
+
return (_jsxs(Paper, { sx: { p: 2 }, children: [_jsxs(Typography, { variant: "h6", sx: { textTransform: "capitalize" }, children: [icons[stopKind], stopKind] }), _jsx(Tooltip, { title: keyboardShortcuts[stopKind], children: _jsxs(JoyButton, { size: "sm", sx: { mb: 2 }, variant: "soft", onClick: () => dispatch(addStop(stopKind)), children: [_jsx("i", { className: "fa-solid fa-location-dot pright" }), t("newStop")] }) }), _jsx(DataGridPro, { density: "compact", autoHeight: true, rowReordering: true, hideFooter: true, componentsProps: {
|
|
198
|
+
cell: { tabIndex: 1 },
|
|
199
|
+
}, apiRef: apiRef, onCellClick: (e) => {
|
|
200
|
+
apiRef.current?.startCellEditMode({ id: e.id, field: e.field });
|
|
201
|
+
}, experimentalFeatures: { newEditingApi: true }, processRowUpdate: stopUpdate, onRowOrderChange: stopPosition, getRowId: (p) => p.key, rows: stops ?? [], columns: getStopsColumnDef(dispatch, stopKind, stops ?? [], errors) })] }));
|
|
202
|
+
}
|
|
203
|
+
//# sourceMappingURL=form.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form.js","sourceRoot":"","sources":["../../../src/hooks/quote/form.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EACL,KAAK,EACL,KAAK,EACL,YAAY,EACZ,MAAM,EACN,WAAW,EACX,IAAI,EACJ,cAAc,EACd,QAAQ,EACR,KAAK,EACL,SAAS,EACT,OAAO,EACP,UAAU,EACV,QAAQ,GACT,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EACL,WAAW,EAEX,aAAa,GACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAgB,SAAS,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3E,OAAO,EAAE,UAAU,EA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Y,EAC9B,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,EACtB,IAAI,EAAE,KAAK,IAAI,EAAE,EACjB,OAAO,EAAE,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,IAAI,EAAE,EAAE,MAAM,CAAC,GACnE,IACI,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { GridColumns, GridRenderCellParams, GridRowId } from "@mui/x-data-grid-pro";
|
|
3
|
+
import { Dispatch } from "@reduxjs/toolkit";
|
|
4
|
+
import { PalletDimensions_Entity, Stop_Entity } from "../../entities/quote";
|
|
5
|
+
export declare const getStopsColumnDef: (dispatch: Dispatch, stopKind: string, rows: Stop_Entity[], errors?: string[]) => GridColumns<Stop_Entity>;
|
|
6
|
+
export declare const getPalletsColumnDef: (dispatch: Dispatch) => GridColumns<PalletDimensions_Entity>;
|
|
7
|
+
/**
|
|
8
|
+
* RenderCell. A drawer that displays the quote body object.
|
|
9
|
+
*
|
|
10
|
+
* @param {GridRenderCellParams<number>} props grid params
|
|
11
|
+
* @returns {ReactElement} The location cell
|
|
12
|
+
*/
|
|
13
|
+
export declare function LocationCell(props: GridRenderCellParams<number>): JSX.Element;
|
|
14
|
+
/**
|
|
15
|
+
* DateInputCell. A calendar with holidays
|
|
16
|
+
*
|
|
17
|
+
* @param {GridRenderCellParams<number>} props grid params
|
|
18
|
+
* @returns {ReactElement} The autocomplete
|
|
19
|
+
*/
|
|
20
|
+
export declare function DateInputCell({ id, value, field, }: {
|
|
21
|
+
id: GridRowId;
|
|
22
|
+
value: number;
|
|
23
|
+
field: string;
|
|
24
|
+
stopKind: string;
|
|
25
|
+
}): JSX.Element;
|
|
26
|
+
/**
|
|
27
|
+
* AccessorialInputCell. A way to add accessorials
|
|
28
|
+
*
|
|
29
|
+
* @param {GridRenderCellParams<number>} props grid params
|
|
30
|
+
* @returns {ReactElement} The autocomplete
|
|
31
|
+
*/
|
|
32
|
+
export declare function AccessorialInputCell(props: GridRenderCellParams<number[]>): JSX.Element;
|
|
33
|
+
/**
|
|
34
|
+
* LocationInputCell. A autocomplete to show locations
|
|
35
|
+
*
|
|
36
|
+
* @param {GridRenderCellParams<number>} props grid params
|
|
37
|
+
* @returns {ReactElement} The autocomplete
|
|
38
|
+
*/
|
|
39
|
+
export declare function LocationInputCell(props: GridRenderCellParams<number>): JSX.Element;
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Avatar, Badge, Sheet } from "@mui/joy";
|
|
3
|
+
import { alpha, Autocomplete, Box, Divider, List, ListItem, ListItemAvatar, ListItemText, Popover, TextField, Tooltip, Typography, } from "@mui/material";
|
|
4
|
+
import { GridActionsCellItem, useGridApiContext, } from "@mui/x-data-grid-pro";
|
|
5
|
+
import { LocalizationProvider, PickersDay, StaticDatePicker, } from "@mui/x-date-pickers";
|
|
6
|
+
import { AdapterMoment } from "@mui/x-date-pickers/AdapterMoment";
|
|
7
|
+
import moment from "moment";
|
|
8
|
+
import { useEffect, useRef, useState, } from "react";
|
|
9
|
+
import { useHotkeys } from "react-hotkeys-hook";
|
|
10
|
+
import { useTranslation } from "react-i18next";
|
|
11
|
+
import { useDispatch, useSelector } from "react-redux";
|
|
12
|
+
import Location_Entity from "../../entities/location/location";
|
|
13
|
+
import { searchExistingLocation, searchLocation, } from "../../redux/location/locationActions";
|
|
14
|
+
import { locationsByFilterSelector, locationSelector, } from "../../redux/location/locationSelector";
|
|
15
|
+
import { removePallet, removeStop } from "../../redux/quote";
|
|
16
|
+
import { accessorialsSelector, holidaysSelector, quoteBodySelector, } from "../../redux/quote/quoteSelector";
|
|
17
|
+
import { SHIPPERS } from "./constants";
|
|
18
|
+
export const getStopsColumnDef = (dispatch, stopKind, rows, errors) => {
|
|
19
|
+
const date = {
|
|
20
|
+
headerName: "Date",
|
|
21
|
+
field: "date",
|
|
22
|
+
type: "date",
|
|
23
|
+
editable: true,
|
|
24
|
+
minWidth: 140,
|
|
25
|
+
flex: 1,
|
|
26
|
+
renderEditCell: (p) => (_jsx(DateInputCell, { value: p.value, field: p.field, id: p.id, stopKind: stopKind })),
|
|
27
|
+
renderCell: (p) => (_jsx(Typography, { variant: "body2", sx: {
|
|
28
|
+
opacity: p.value || errors ? 1 : 0.5,
|
|
29
|
+
color: errors && !p.value ? "#f44336" : undefined,
|
|
30
|
+
}, children: p.value ? moment(p.value).format("ll") : "Set a date..." })),
|
|
31
|
+
};
|
|
32
|
+
const ret = [
|
|
33
|
+
{
|
|
34
|
+
headerName: "Order",
|
|
35
|
+
field: "order",
|
|
36
|
+
type: "string",
|
|
37
|
+
editable: false,
|
|
38
|
+
width: 40,
|
|
39
|
+
valueGetter: (p) => {
|
|
40
|
+
return rows.findIndex((r) => r.key === p.row.key) + 1;
|
|
41
|
+
},
|
|
42
|
+
renderCell: (p) => (_jsx(Avatar, { size: "sm", variant: "soft", children: p.value })),
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
headerName: "Zipcode or City State",
|
|
46
|
+
field: "zip",
|
|
47
|
+
type: "string",
|
|
48
|
+
editable: true,
|
|
49
|
+
minWidth: 180,
|
|
50
|
+
flex: 1,
|
|
51
|
+
renderCell: (p) => (_jsx(Typography, { variant: "body2", sx: {
|
|
52
|
+
opacity: p.value || errors ? 1 : 0.5,
|
|
53
|
+
color: errors && !p.value ? "#f44336" : undefined,
|
|
54
|
+
}, children: p.value ? p.value : "Enter zip or city, state..." })),
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
headerName: "Facility",
|
|
58
|
+
field: "locationId",
|
|
59
|
+
type: "string",
|
|
60
|
+
renderEditCell: (p) => _jsx(LocationInputCell, { ...p }),
|
|
61
|
+
editable: true,
|
|
62
|
+
minWidth: 180,
|
|
63
|
+
flex: 1,
|
|
64
|
+
renderCell: (p) => _jsx(LocationCell, { ...p }),
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
headerName: "Accessorials",
|
|
68
|
+
field: "accessorialIds",
|
|
69
|
+
type: "string",
|
|
70
|
+
editable: true,
|
|
71
|
+
minWidth: 180,
|
|
72
|
+
flex: 1,
|
|
73
|
+
renderEditCell: (p) => _jsx(AccessorialInputCell, { ...p }),
|
|
74
|
+
renderCell: (p) => (_jsx(Typography, { variant: "body2", sx: { opacity: p.value.length ? 1 : 0.5 }, children: p.value.length
|
|
75
|
+
? `${p.value.length} selected`
|
|
76
|
+
: "Add Accessorials (Optionnal)" })),
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
field: "action",
|
|
80
|
+
type: "actions",
|
|
81
|
+
headerName: "Actions",
|
|
82
|
+
cellClassName: "actions",
|
|
83
|
+
width: 80,
|
|
84
|
+
getActions: (p) => [
|
|
85
|
+
_jsx(GridActionsCellItem, { icon: _jsx("i", { style: { fontSize: 14 }, className: "fa-sharp fa-solid fa-trash" }), label: `Delete`, onClick: () => {
|
|
86
|
+
dispatch(removeStop(p.row.key));
|
|
87
|
+
}, color: "inherit" }, "delete"),
|
|
88
|
+
],
|
|
89
|
+
},
|
|
90
|
+
];
|
|
91
|
+
if (stopKind === SHIPPERS) {
|
|
92
|
+
ret.splice(3, 0, date);
|
|
93
|
+
}
|
|
94
|
+
return ret;
|
|
95
|
+
};
|
|
96
|
+
export const getPalletsColumnDef = (dispatch) => {
|
|
97
|
+
return [
|
|
98
|
+
{
|
|
99
|
+
headerName: "Count",
|
|
100
|
+
field: "count",
|
|
101
|
+
type: "number",
|
|
102
|
+
editable: true,
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
headerName: "Stackable",
|
|
106
|
+
field: "stackable",
|
|
107
|
+
type: "boolean",
|
|
108
|
+
editable: true,
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
headerName: "Length",
|
|
112
|
+
field: "length",
|
|
113
|
+
type: "number",
|
|
114
|
+
editable: true,
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
headerName: "Width",
|
|
118
|
+
field: "width",
|
|
119
|
+
type: "number",
|
|
120
|
+
editable: true,
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
headerName: "Height",
|
|
124
|
+
field: "height",
|
|
125
|
+
type: "number",
|
|
126
|
+
editable: true,
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
headerName: "Weight",
|
|
130
|
+
field: "weight",
|
|
131
|
+
type: "number",
|
|
132
|
+
editable: true,
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
headerName: "Units",
|
|
136
|
+
field: "units",
|
|
137
|
+
type: "singleSelect",
|
|
138
|
+
editable: true,
|
|
139
|
+
valueOptions: [
|
|
140
|
+
{ value: "inches", label: "Inches" },
|
|
141
|
+
{ value: "feet", label: "Feet" },
|
|
142
|
+
],
|
|
143
|
+
flex: 1,
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
field: "action",
|
|
147
|
+
type: "actions",
|
|
148
|
+
headerName: "Actions",
|
|
149
|
+
cellClassName: "actions",
|
|
150
|
+
getActions: (p) => [
|
|
151
|
+
_jsx(GridActionsCellItem, { icon: _jsx("i", { style: { fontSize: 14 }, className: "fa-sharp fa-solid fa-trash" }), label: `Delete`, onClick: () => {
|
|
152
|
+
dispatch(removePallet(p.row.key));
|
|
153
|
+
}, color: "inherit" }, "delete"),
|
|
154
|
+
],
|
|
155
|
+
},
|
|
156
|
+
];
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* RenderCell. A drawer that displays the quote body object.
|
|
160
|
+
*
|
|
161
|
+
* @param {GridRenderCellParams<number>} props grid params
|
|
162
|
+
* @returns {ReactElement} The location cell
|
|
163
|
+
*/
|
|
164
|
+
export function LocationCell(props) {
|
|
165
|
+
const location = useSelector(locationSelector(props.value));
|
|
166
|
+
return (_jsx(Tooltip, { title: location?.name ?? "", children: _jsx(Typography, { sx: { opacity: location ? 1 : 0.5 }, variant: "body2", children: location ? location.name : "Pick a location..." }) }));
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* DateInputCell. A calendar with holidays
|
|
170
|
+
*
|
|
171
|
+
* @param {GridRenderCellParams<number>} props grid params
|
|
172
|
+
* @returns {ReactElement} The autocomplete
|
|
173
|
+
*/
|
|
174
|
+
export function DateInputCell({ id, value, field, }) {
|
|
175
|
+
const ref = useRef();
|
|
176
|
+
const apiRef = useGridApiContext();
|
|
177
|
+
const [open, setOpen] = useState(false);
|
|
178
|
+
const [date, setDate] = useState(value ? moment(value) : null);
|
|
179
|
+
useEffect(() => {
|
|
180
|
+
if (ref.current)
|
|
181
|
+
setOpen(true);
|
|
182
|
+
}, [ref]);
|
|
183
|
+
const handleChange = (newDate) => {
|
|
184
|
+
setDate(newDate);
|
|
185
|
+
setOpen(false);
|
|
186
|
+
apiRef.current.setEditCellValue({
|
|
187
|
+
id,
|
|
188
|
+
field,
|
|
189
|
+
value: newDate,
|
|
190
|
+
});
|
|
191
|
+
apiRef.current.stopCellEditMode({ id, field });
|
|
192
|
+
};
|
|
193
|
+
useHotkeys("enter", () => {
|
|
194
|
+
handleChange(date);
|
|
195
|
+
}, {
|
|
196
|
+
enableOnTags: ["INPUT", "SELECT", "TEXTAREA"],
|
|
197
|
+
});
|
|
198
|
+
const handleClose = () => {
|
|
199
|
+
apiRef.current.setEditCellValue({
|
|
200
|
+
id,
|
|
201
|
+
field,
|
|
202
|
+
value: value,
|
|
203
|
+
});
|
|
204
|
+
apiRef.current.stopCellEditMode({ id, field });
|
|
205
|
+
};
|
|
206
|
+
return (_jsxs(_Fragment, { children: [_jsx(Box, { ref: ref }), ref.current && open ? (_jsx(Popover, { open: open, anchorEl: ref.current, onClose: handleClose, children: _jsx(Box, { sx: { p: 1 }, children: _jsx(LocalizationProvider, { dateAdapter: AdapterMoment, children: _jsx(StaticDatePicker, { displayStaticWrapperAs: "desktop", value: date, disableHighlightToday: true, onChange: handleChange, shouldDisableDate: (d) => {
|
|
207
|
+
return d.isBefore(moment(), "day");
|
|
208
|
+
}, renderDay: (date, _s, pickersDayProps) => (_jsx(RenderDay, { date: date, pickersDayProps: pickersDayProps })), renderInput: (params) => _jsx(TextField, { ...params }) }) }) }) })) : ([])] }));
|
|
209
|
+
}
|
|
210
|
+
const RenderDay = ({ date, pickersDayProps, }) => {
|
|
211
|
+
const holidays = useSelector(holidaysSelector);
|
|
212
|
+
const isHoliday = holidays?.find((h) => moment(h.date).isSame(date, "day"));
|
|
213
|
+
const body = useSelector(quoteBodySelector);
|
|
214
|
+
const shippers = body.shippers;
|
|
215
|
+
const consignees = body.consignees;
|
|
216
|
+
const isShipper = shippers?.find((h) => h.date && moment(h.date).isSame(date, "day"));
|
|
217
|
+
const isConsignee = consignees?.find((h) => h.date && moment(h.date).isSame(date, "day"));
|
|
218
|
+
const tooltips = [];
|
|
219
|
+
let badgeContent;
|
|
220
|
+
if (isHoliday)
|
|
221
|
+
tooltips.push(isHoliday.name);
|
|
222
|
+
if (isShipper) {
|
|
223
|
+
tooltips.push(`Pickup`);
|
|
224
|
+
badgeContent = _jsx("i", { className: "fa-solid fa-arrow-up" });
|
|
225
|
+
}
|
|
226
|
+
if (isConsignee) {
|
|
227
|
+
tooltips.push(`Dropoff`);
|
|
228
|
+
badgeContent = _jsx("i", { className: "fa-solid fa-arrow-down" });
|
|
229
|
+
}
|
|
230
|
+
return (_jsx(Box, { sx: { display: "flex", alignItems: "center", justifyContent: "center" }, children: isHoliday || isShipper || isConsignee ? (_jsx(Tooltip, { title: tooltips.join(" - "), children: _jsx(Box, { children: _jsx(Badge, { size: "sm", badgeContent: badgeContent ?? 0, children: _jsx(PickersDay, { sx: {
|
|
231
|
+
background: isHoliday ? alpha("#ffc107", 0.1) : undefined,
|
|
232
|
+
border: isHoliday
|
|
233
|
+
? `dashed 2px ${alpha("#ffc107", 0.3)}`
|
|
234
|
+
: `solid 2px ${alpha("#2196f3", 0.3)}`,
|
|
235
|
+
}, ...pickersDayProps }) }) }) })) : (_jsx(PickersDay, { ...pickersDayProps })) }));
|
|
236
|
+
};
|
|
237
|
+
/**
|
|
238
|
+
* AccessorialInputCell. A way to add accessorials
|
|
239
|
+
*
|
|
240
|
+
* @param {GridRenderCellParams<number>} props grid params
|
|
241
|
+
* @returns {ReactElement} The autocomplete
|
|
242
|
+
*/
|
|
243
|
+
export function AccessorialInputCell(props) {
|
|
244
|
+
const { id, value, field } = props;
|
|
245
|
+
const ref = useRef();
|
|
246
|
+
const apiRef = useGridApiContext();
|
|
247
|
+
const [open, setOpen] = useState(false);
|
|
248
|
+
const [accessorialIds, setAccessorialIds] = useState(value ?? []);
|
|
249
|
+
const accessorials = useSelector(accessorialsSelector);
|
|
250
|
+
const { t } = useTranslation();
|
|
251
|
+
useEffect(() => {
|
|
252
|
+
if (ref.current)
|
|
253
|
+
setOpen(true);
|
|
254
|
+
}, [ref]);
|
|
255
|
+
const handleClose = () => {
|
|
256
|
+
setOpen(false);
|
|
257
|
+
apiRef.current.setEditCellValue({
|
|
258
|
+
id,
|
|
259
|
+
field,
|
|
260
|
+
value: accessorialIds,
|
|
261
|
+
});
|
|
262
|
+
apiRef.current.stopCellEditMode({ id, field });
|
|
263
|
+
};
|
|
264
|
+
const handleSelect = (a) => () => {
|
|
265
|
+
const s = [...accessorialIds];
|
|
266
|
+
if (s.indexOf(a.accessorialId) >= 0) {
|
|
267
|
+
s.splice(s.indexOf(a.accessorialId), 1);
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
s.push(a.accessorialId);
|
|
271
|
+
}
|
|
272
|
+
setAccessorialIds(s);
|
|
273
|
+
};
|
|
274
|
+
return (_jsxs(_Fragment, { children: [_jsx(Box, { ref: ref }), ref.current && open ? (_jsx(Popover, { open: open, anchorEl: ref.current, onClose: handleClose, children: _jsxs(Box, { sx: { width: 250, maxHeight: 600, overflow: "scroll" }, children: [_jsx(Sheet, { sx: {
|
|
275
|
+
position: "sticky",
|
|
276
|
+
top: 0,
|
|
277
|
+
zIndex: 100,
|
|
278
|
+
textAlign: "center",
|
|
279
|
+
}, variant: "soft", children: _jsx(Typography, { sx: { p: 1 }, variant: "body2", children: t("Select accessorials that apply") }) }), _jsx(Divider, {}), _jsx(List, { dense: true, children: accessorials.map((a) => (_jsxs(ListItem, { selected: accessorialIds.indexOf(a.accessorialId) >= 0, button: true, divider: true, onClick: handleSelect(a), children: [_jsx(ListItemAvatar, { children: accessorialIds.indexOf(a.accessorialId) >= 0 ? (_jsx("i", { className: "fa-sharp fa-solid fa-check" })) : (_jsx("i", { className: "fa-regular fa-plus", style: { opacity: 0.5 } })) }), _jsx(ListItemText, { primary: a.name, secondary: `$${a.costAmount}/${a.unitType}` })] }, a.accessorialId))) })] }) })) : ([])] }));
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* LocationInputCell. A autocomplete to show locations
|
|
283
|
+
*
|
|
284
|
+
* @param {GridRenderCellParams<number>} props grid params
|
|
285
|
+
* @returns {ReactElement} The autocomplete
|
|
286
|
+
*/
|
|
287
|
+
export function LocationInputCell(props) {
|
|
288
|
+
const { id, value, field } = props;
|
|
289
|
+
const apiRef = useGridApiContext();
|
|
290
|
+
// const body = useSelector(quoteBodySelector);
|
|
291
|
+
const locationSuggestions = useSelector(locationsByFilterSelector);
|
|
292
|
+
const location = useSelector(locationSelector(value));
|
|
293
|
+
const [locationInputValue, setLocationInputValue] = useState("");
|
|
294
|
+
const [bounds, setBounds] = useState();
|
|
295
|
+
const [googleMapsPredictions, setGoogleMapsPredictions] = useState([]);
|
|
296
|
+
const dispatch = useDispatch();
|
|
297
|
+
const googleMapsAutocompleteService = new google.maps.places.AutocompleteService();
|
|
298
|
+
const googleMapsGeocoder = new google.maps.Geocoder();
|
|
299
|
+
useEffect(() => {
|
|
300
|
+
if (props.row.zip) {
|
|
301
|
+
findBounds();
|
|
302
|
+
}
|
|
303
|
+
}, [props.row.zip]);
|
|
304
|
+
const handleValueChange = (_, newValue) => {
|
|
305
|
+
const updateCell = (v) => apiRef.current.setEditCellValue({
|
|
306
|
+
id,
|
|
307
|
+
field,
|
|
308
|
+
value: v,
|
|
309
|
+
});
|
|
310
|
+
let value;
|
|
311
|
+
if (newValue && newValue instanceof Location_Entity) {
|
|
312
|
+
value = newValue.id;
|
|
313
|
+
updateCell(value);
|
|
314
|
+
}
|
|
315
|
+
else if (newValue) {
|
|
316
|
+
googleMapsGeocoder.geocode({ address: newValue.description }, (results) => {
|
|
317
|
+
if (results?.length) {
|
|
318
|
+
dispatch(searchExistingLocation(results[0].place_id, updateCell));
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
else {
|
|
323
|
+
updateCell(value);
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
const findBounds = () => {
|
|
327
|
+
googleMapsGeocoder.geocode({ address: props.row.zip }, (results, status) => {
|
|
328
|
+
if (status === google.maps.GeocoderStatus.OK && results != undefined) {
|
|
329
|
+
const lat = results[0].geometry.location.lat();
|
|
330
|
+
const lng = results[0].geometry.location.lng();
|
|
331
|
+
const bounds = new google.maps.LatLngBounds(new google.maps.LatLng(lat, lng), new google.maps.LatLng(lat, lng));
|
|
332
|
+
setBounds(bounds);
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
};
|
|
336
|
+
const getGoogleAddresses = (searchText) => {
|
|
337
|
+
googleMapsAutocompleteService.getPlacePredictions({
|
|
338
|
+
input: searchText,
|
|
339
|
+
componentRestrictions: { country: "us" },
|
|
340
|
+
types: ["address"],
|
|
341
|
+
bounds,
|
|
342
|
+
}, (googleSuggestions) => setGoogleMapsPredictions(googleSuggestions));
|
|
343
|
+
};
|
|
344
|
+
return (_jsx(_Fragment, { children: _jsx(Autocomplete, { fullWidth: true, options: [...locationSuggestions, ...(googleMapsPredictions ?? [])], value: location, onChange: handleValueChange, inputValue: locationInputValue, onInputChange: (_e, v) => setLocationInputValue(v), getOptionLabel: (option) => {
|
|
345
|
+
if (option instanceof Location_Entity) {
|
|
346
|
+
return option.name;
|
|
347
|
+
}
|
|
348
|
+
return option.structured_formatting.main_text;
|
|
349
|
+
}, renderInput: (params) => (_jsx(TextField, { ...params, label: "Pick a location...", autoFocus: true, onChange: (e) => {
|
|
350
|
+
dispatch(searchLocation(props.row.zip, e.target.value));
|
|
351
|
+
getGoogleAddresses(e.target.value);
|
|
352
|
+
}, InputProps: {
|
|
353
|
+
...params.InputProps,
|
|
354
|
+
} })), renderOption: (props, c) => _jsx(LocationOption, { props: props, c: c }) }) }));
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
*
|
|
358
|
+
* @param {HTMLAttributes<HTMLLIElement>} props html attributes for the menuItem
|
|
359
|
+
*/
|
|
360
|
+
function LocationOption({ props, c, }) {
|
|
361
|
+
if (c instanceof Location_Entity) {
|
|
362
|
+
return (_jsx(Box, { component: "li", ...props, children: _jsxs(Box, { children: [_jsx(Typography, { variant: "body2", color: "primary", children: c.name }), _jsx(Box, { sx: { display: "flex", gap: 1, alignItems: "center" }, children: _jsx(Typography, { variant: "caption", children: `${c.address.city}, ${c.address.state} ${c.address.zip}` }) })] }) }));
|
|
363
|
+
}
|
|
364
|
+
return (_jsx(Box, { component: "li", ...props, children: _jsxs(Box, { children: [_jsx(Typography, { variant: "body2", children: c.structured_formatting.main_text }), _jsx(Box, { sx: { display: "flex", gap: 1, alignItems: "center" }, children: _jsx(Typography, { variant: "caption", children: c.structured_formatting.secondary_text }) })] }) }));
|
|
365
|
+
}
|
|
366
|
+
//# sourceMappingURL=helpers.js.map
|