@shipengine/elements 0.37.21 → 0.39.0
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/index.cjs +89 -76
- package/index.js +89 -76
- package/package.json +6 -7
- package/src/components/add-funds-form/add-funds-form.styles.d.ts +3 -3
- package/src/components/auto-funding-form/auto-funding-form.styles.d.ts +1 -1
- package/src/components/carrier-balance/carrier-balance.styles.d.ts +1 -1
- package/src/components/collapsible-panel/collapsible-panel.d.ts +1 -1
- package/src/components/collapsible-panel/collapsible-panel.styles.d.ts +4 -4
- package/src/components/date-range-select/date-range-select.styles.d.ts +1 -1
- package/src/components/disclosure/disclosure.styles.d.ts +3 -3
- package/src/components/error-display/error-display.styles.d.ts +3 -3
- package/src/components/field/checkbox-input/checkbox-input.d.ts +1 -1
- package/src/components/field/credit-card-input/credit-card-input.d.ts +1 -1
- package/src/components/field/date-picker/date-picker.styles.d.ts +1 -1
- package/src/components/field/expiration-input/expiration-input.d.ts +1 -1
- package/src/components/field/field.styles.d.ts +1 -1
- package/src/components/field/money-input/money-input.d.ts +1 -1
- package/src/components/field/number-input/number-input.d.ts +1 -1
- package/src/components/field/rate-card/cost-breakdown/cost-breakdown.styles.d.ts +1 -1
- package/src/components/field/rate-card/rate-card.d.ts +1 -1
- package/src/components/field/rate-card/rate-card.styles.d.ts +1 -1
- package/src/components/field/rate-select/rate-select.styles.d.ts +1 -1
- package/src/components/field/select-auto-complete/select-auto-complete.d.ts +1 -1
- package/src/components/field/submit-button/submit-button.d.ts +1 -1
- package/src/components/field/switch/switch.d.ts +1 -1
- package/src/components/field/text-area/text-area.d.ts +1 -1
- package/src/components/field/text-input/text-input.d.ts +1 -1
- package/src/components/fund-and-purchase/fund-and-purchase.styles.d.ts +3 -3
- package/src/components/history/history-card/history-card.styles.d.ts +8 -8
- package/src/components/history/history-card-extension/history-card-extension.styles.d.ts +3 -3
- package/src/components/inline-label/inline-label.d.ts +1 -1
- package/src/components/inline-label/inline-label.styles.d.ts +1 -1
- package/src/components/items-breakdown/items-breakdown.styles.d.ts +6 -6
- package/src/components/label/label.d.ts +1 -1
- package/src/components/label/label.styles.d.ts +1 -1
- package/src/components/label-layout/label-layout.styles.d.ts +12 -12
- package/src/components/link-action/link-action.d.ts +2 -2
- package/src/components/loader/loader.d.ts +1 -1
- package/src/components/preset-descriptor/preset-descriptor.styles.d.ts +1 -1
- package/src/components/save-status/save-status-styles.d.ts +4 -4
- package/src/components/section/section.d.ts +1 -1
- package/src/components/section/section.styles.d.ts +4 -4
- package/src/components/settings-card/settings-card.styles.d.ts +5 -5
- package/src/components/spacer/spacer.d.ts +1 -1
- package/src/components/templates/account-settings/account-settings.d.ts +0 -1
- package/src/components/templates/address-form/address-fields.styles.d.ts +1 -1
- package/src/components/templates/carrier-recovery-form/carrier-recovery-form.styles.d.ts +1 -1
- package/src/components/templates/carrier-terms-form/carrier-terms-form.styles.d.ts +6 -6
- package/src/components/templates/customs-items-display/customs-items-display.styles.d.ts +16 -16
- package/src/components/templates/edit-billing-form/edit-billing-form.styles.d.ts +3 -3
- package/src/components/templates/label/label.styles.d.ts +2 -2
- package/src/components/templates/landing-page/landing-page.styles.d.ts +1 -1
- package/src/components/templates/list-carriers/list-carriers.styles.d.ts +3 -3
- package/src/components/templates/list-carriers-row/list-carriers-row.styles.d.ts +3 -3
- package/src/components/templates/manage-warehouses/manage-warehouse.styles.d.ts +2 -2
- package/src/components/templates/onboarding/onboarding.styles.d.ts +4 -4
- package/src/components/templates/rate-form/rate-form.styles.d.ts +1 -1
- package/src/components/templates/suspend-sales-order/suspend-sales-order.d.ts +1 -1
- package/src/components/templates/suspend-shipment/suspend-shipment.d.ts +1 -1
- package/src/components/templates/wallet-card/wallet-card.styles.d.ts +1 -1
- package/src/components/templates/wallet-form/wallet-form.styles.d.ts +1 -1
- package/src/constants/shipengine/address.d.ts +2 -2
- package/src/elements/account-settings/account-settings.d.ts +1 -9
- package/src/elements/configure-shipment/hooks/use-request-preferred-rates.d.ts +1 -1
- package/src/elements/configure-shipment/hooks/use-request-rates.d.ts +1 -1
- package/src/elements/list-carriers/hooks/use-list-connected-carriers.d.ts +1 -1
- package/src/elements/purchase-label/hooks/use-load-shipment.d.ts +1 -1
- package/src/elements/view-shipment/view-shipment.d.ts +7 -1
- package/src/features/wallet-history/wallet-history.styles.d.ts +11 -11
- package/src/hooks/options/use-state-code-options.d.ts +2 -2
- package/src/hooks/use-elements.d.ts +1 -3
- package/src/hooks/use-get-or-create-shipment.d.ts +1 -1
- package/src/testing/extensions/queries/by-icon-name.d.ts +1 -1
- package/src/testing/extensions/queries/index.d.ts +6 -6
- package/src/testing/test-utils.d.ts +1 -2
- package/src/utilities/styles.d.ts +1 -1
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
|
|
2
|
-
import { InlineNotification, NotificationType, Spinner, SpinnerSize, Typography, Icon, Link, IconSize, FormField, FieldMessageType, Checkbox, Input, Divider, SelectAutocomplete, Select as Select$1, OptionGroup, Option, Button, Switch as Switch$1, Textarea, ChipList, Chip, ButtonVariant, ButtonSize, DatePicker as DatePicker$1, Table, TableBody, TableBaseRow, TableBodyCell, TableHeader, TableHeaderCell, Grid, GridChild, RadioGroup, Radio, ButtonColor, Tag, TagColor, Skeleton, SkeletonAnimation, SkeletonVariant, SkeletonBackgroundColor, Pagination, Stepper, Step, IconTooltip, Popover, DropdownOptionList, BottomSheet } from '@
|
|
3
|
-
import { IconNames } from '@
|
|
2
|
+
import { InlineNotification, NotificationType, Spinner, SpinnerSize, Typography, Icon, Link, IconSize, FormField, FieldMessageType, Checkbox, Input, Divider, SelectAutocomplete, Select as Select$1, OptionGroup, Option, Button, Switch as Switch$1, Textarea, ChipList, Chip, ButtonVariant, ButtonSize, DatePicker as DatePicker$1, Table, TableBody, TableBaseRow, TableBodyCell, TableHeader, TableHeaderCell, Grid, GridChild, RadioGroup, Radio, ButtonColor, Tag, TagColor, Skeleton, SkeletonAnimation, SkeletonVariant, SkeletonBackgroundColor, Pagination, Stepper, Step, IconTooltip, Popover, DropdownOptionList, BottomSheet } from '@shipengine/giger';
|
|
3
|
+
import { IconNames } from '@shipengine/giger-theme';
|
|
4
4
|
import { camelize } from 'humps';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { useMemo, createContext, useState, useContext, useReducer, useCallback, createElement as createElement$2, useRef, useEffect, forwardRef, memo, Fragment as Fragment$1 } from 'react';
|
|
@@ -20,7 +20,7 @@ import * as Locales from 'date-fns/locale';
|
|
|
20
20
|
import { css as css$1 } from '@emotion/css';
|
|
21
21
|
import { isValidPhoneNumber } from 'libphonenumber-js/min';
|
|
22
22
|
import copy from 'copy-to-clipboard';
|
|
23
|
-
import { useQueryClient, useMutation } from 'react-query';
|
|
23
|
+
import { useQueryClient, useMutation } from '@tanstack/react-query';
|
|
24
24
|
import cardValidator from 'card-validator';
|
|
25
25
|
|
|
26
26
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -2086,13 +2086,19 @@ const usStates = [new UsState("Alabama", "AL"), new UsState("Alaska", "AK"), new
|
|
|
2086
2086
|
isMilitary
|
|
2087
2087
|
}), new UsState("California", "CA"), new UsState("Colorado", "CO"), new UsState("Connecticut", "CT"), new UsState("Delaware", "DE"), new UsState("District of Columbia", "DC"), new UsState("Florida", "FL"), new UsState("Georgia", "GA"), new UsState("Guam", "GU", {
|
|
2088
2088
|
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2089
|
-
}), new UsState("Hawaii", "HI"), new UsState("Idaho", "ID"), new UsState("Illinois", "IL"), new UsState("Indiana", "IN"), new UsState("Iowa", "IA"), new UsState("Kansas", "KS"), new UsState("Kentucky", "KY"), new UsState("Louisiana", "LA"), new UsState("Maine", "ME"), new UsState("
|
|
2089
|
+
}), new UsState("Hawaii", "HI"), new UsState("Idaho", "ID"), new UsState("Illinois", "IL"), new UsState("Indiana", "IN"), new UsState("Iowa", "IA"), new UsState("Kansas", "KS"), new UsState("Kentucky", "KY"), new UsState("Louisiana", "LA"), new UsState("Maine", "ME"), new UsState("Marshall Islands", "MH", {
|
|
2090
2090
|
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2091
|
-
}), new UsState("
|
|
2091
|
+
}), new UsState("Maryland", "MD"), new UsState("Massachusetts", "MA"), new UsState("Michigan", "MI"), new UsState("Micronesia", "FM", {
|
|
2092
|
+
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2093
|
+
}), new UsState("Minnesota", "MN"), new UsState("Mississippi", "MS"), new UsState("Missouri", "MO"), new UsState("Montana", "MT"), new UsState("Nebraska", "NE"), new UsState("Nevada", "NV"), new UsState("New Hampshire", "NH"), new UsState("New Jersey", "NJ"), new UsState("New Mexico", "NM"), new UsState("New York", "NY"), new UsState("North Carolina", "NC"), new UsState("North Dakota", "ND"), new UsState("Northern Mariana Islands", "MP", {
|
|
2094
|
+
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2095
|
+
}), new UsState("Ohio", "OH"), new UsState("Oklahoma", "OK"), new UsState("Oregon", "OR"), new UsState("Palau", "PW", {
|
|
2092
2096
|
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2093
|
-
}), new UsState("
|
|
2097
|
+
}), new UsState("Pennsylvania", "PA"), new UsState("Puerto Rico", "PR", {
|
|
2098
|
+
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2099
|
+
}), new UsState("Rhode Island", "RI"), new UsState("South Carolina", "SC"), new UsState("South Dakota", "SD"), new UsState("Tennessee", "TN"), new UsState("Texas", "TX"), new UsState("Utah", "UT"), new UsState("Vermont", "VT"), new UsState("Virgin Islands", "VI", {
|
|
2094
2100
|
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2095
|
-
}), new UsState("U.S. Minor Outlying Islands", "UM", {
|
|
2101
|
+
}), new UsState("Virginia", "VA"), new UsState("Washington", "WA"), new UsState("West Virginia", "WV"), new UsState("Wisconsin", "WI"), new UsState("Wyoming", "WY"), new UsState("U.S. Minor Outlying Islands", "UM", {
|
|
2096
2102
|
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2097
2103
|
})];
|
|
2098
2104
|
/**
|
|
@@ -2712,7 +2718,7 @@ const formLogger = {
|
|
|
2712
2718
|
// event bubbling doesn't handle the formId target properly when passed through a portal.
|
|
2713
2719
|
e === null || e === void 0 ? void 0 : e.stopPropagation();
|
|
2714
2720
|
this.isSubmitting = true;
|
|
2715
|
-
handleSubmit(e);
|
|
2721
|
+
void handleSubmit(e);
|
|
2716
2722
|
this.isSubmitting = false;
|
|
2717
2723
|
};
|
|
2718
2724
|
},
|
|
@@ -4962,6 +4968,7 @@ RootPortalContext.displayName = "RootPortalContext";
|
|
|
4962
4968
|
const RootPortalProvider = ({
|
|
4963
4969
|
children
|
|
4964
4970
|
}) => {
|
|
4971
|
+
// eslint-disable-next-line react/hook-use-state -- We don't need the setter
|
|
4965
4972
|
const [rootPortal] = useState(() => {
|
|
4966
4973
|
let rootPortal = document.getElementById("root-portal");
|
|
4967
4974
|
if (!rootPortal) {
|
|
@@ -7610,7 +7617,7 @@ const AddFundsForm = ({
|
|
|
7610
7617
|
const {
|
|
7611
7618
|
t
|
|
7612
7619
|
} = useTranslation();
|
|
7613
|
-
const addFunds = useAddFunds(
|
|
7620
|
+
const addFunds = useAddFunds();
|
|
7614
7621
|
const carrier = useGetCarrierById(carrierId);
|
|
7615
7622
|
const chips = [{
|
|
7616
7623
|
label: "$20",
|
|
@@ -7646,13 +7653,16 @@ const AddFundsForm = ({
|
|
|
7646
7653
|
const handleSubmit = formLogger.capture(form.handleSubmit(values => __awaiter(void 0, void 0, void 0, function* () {
|
|
7647
7654
|
const payload = values;
|
|
7648
7655
|
try {
|
|
7649
|
-
yield addFunds.mutateAsync(
|
|
7656
|
+
yield addFunds.mutateAsync({
|
|
7657
|
+
carrierId,
|
|
7658
|
+
funds: payload
|
|
7659
|
+
});
|
|
7650
7660
|
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
|
|
7651
7661
|
} catch (_a) {
|
|
7652
7662
|
// Noop; errors available on RQ object
|
|
7653
7663
|
}
|
|
7654
7664
|
})));
|
|
7655
|
-
if (carrier.
|
|
7665
|
+
if (carrier.isInitialLoading) return jsx(Loader, {
|
|
7656
7666
|
message: t("loading.carrier")
|
|
7657
7667
|
});
|
|
7658
7668
|
if (!carrier.data) throw new Error("errorMessages.unableToLoad.carrier");
|
|
@@ -7890,11 +7900,16 @@ const AutoFundingForm = ({
|
|
|
7890
7900
|
const {
|
|
7891
7901
|
t
|
|
7892
7902
|
} = useTranslation();
|
|
7893
|
-
const updateAutoFunding = useUpdateAutoFunding(carrierId);
|
|
7894
|
-
const autoFundingConfiguration = useGetAutoFundingConfiguration(carrierId);
|
|
7895
7903
|
const {
|
|
7896
|
-
|
|
7897
|
-
|
|
7904
|
+
mutate: updateAutoFunding,
|
|
7905
|
+
isLoading: updateAutoFundingIsLoading
|
|
7906
|
+
} = useUpdateAutoFunding(carrierId);
|
|
7907
|
+
const {
|
|
7908
|
+
data: autoFundingConfig,
|
|
7909
|
+
refetch: autoFundingConfigRefetch,
|
|
7910
|
+
isInitialLoading: isLoadingAutoFundingConfig,
|
|
7911
|
+
error: autoFundingConfigErrors
|
|
7912
|
+
} = useGetAutoFundingConfiguration(carrierId);
|
|
7898
7913
|
const [showForm, setShowForm] = useState(false);
|
|
7899
7914
|
const [isSwitchOn, setIsSwitchOn] = useState(false);
|
|
7900
7915
|
const form = useForm({
|
|
@@ -7910,8 +7925,8 @@ const AutoFundingForm = ({
|
|
|
7910
7925
|
setShowForm(prev => !prev);
|
|
7911
7926
|
setIsSwitchOn(true);
|
|
7912
7927
|
const payload = values;
|
|
7913
|
-
updateAutoFunding
|
|
7914
|
-
onSuccess: () =>
|
|
7928
|
+
updateAutoFunding(payload, {
|
|
7929
|
+
onSuccess: () => autoFundingConfigRefetch()
|
|
7915
7930
|
});
|
|
7916
7931
|
}));
|
|
7917
7932
|
/**
|
|
@@ -7925,19 +7940,19 @@ const AutoFundingForm = ({
|
|
|
7925
7940
|
formReset(isEnabled);
|
|
7926
7941
|
if (!isEnabled) {
|
|
7927
7942
|
setIsSwitchOn(isEnabled);
|
|
7928
|
-
updateAutoFunding
|
|
7929
|
-
onSuccess: () =>
|
|
7943
|
+
updateAutoFunding(form.getValues(), {
|
|
7944
|
+
onSuccess: () => autoFundingConfigRefetch()
|
|
7930
7945
|
});
|
|
7931
7946
|
}
|
|
7932
7947
|
};
|
|
7933
|
-
if (
|
|
7948
|
+
if (isLoadingAutoFundingConfig || updateAutoFundingIsLoading) return jsx(Loader, {
|
|
7934
7949
|
message: t("manage-funding:autoFunding.isLoading")
|
|
7935
7950
|
});
|
|
7936
|
-
if (!
|
|
7951
|
+
if (!autoFundingConfig) throw new Error(t("errorMessages:unableToLoad.autoFundingSettings"));
|
|
7937
7952
|
return jsxs(Fragment, {
|
|
7938
7953
|
children: [jsxs(Spread, {
|
|
7939
7954
|
children: [jsx(Typography, Object.assign({
|
|
7940
|
-
bold: !!(
|
|
7955
|
+
bold: !!(autoFundingConfig === null || autoFundingConfig === void 0 ? void 0 : autoFundingConfig.isAutoPurchaseEnabled),
|
|
7941
7956
|
variant: "body1"
|
|
7942
7957
|
}, {
|
|
7943
7958
|
children: t("manage-funding:autoFunding:isEnabledCTA")
|
|
@@ -7950,11 +7965,11 @@ const AutoFundingForm = ({
|
|
|
7950
7965
|
})]
|
|
7951
7966
|
}), jsx(Spacer, {
|
|
7952
7967
|
multiplier: 1
|
|
7953
|
-
}), !!(
|
|
7968
|
+
}), !!(autoFundingConfig === null || autoFundingConfig === void 0 ? void 0 : autoFundingConfig.isAutoPurchaseEnabled) && !showForm && jsxs(Spread, {
|
|
7954
7969
|
children: [jsx(Typography, Object.assign({
|
|
7955
7970
|
variant: "body1"
|
|
7956
7971
|
}, {
|
|
7957
|
-
children: t("manage-funding:autoFunding.readSettings", Object.assign({},
|
|
7972
|
+
children: t("manage-funding:autoFunding.readSettings", Object.assign({}, autoFundingConfig))
|
|
7958
7973
|
})), jsx(LinkAction, {
|
|
7959
7974
|
css: styles$t.edit,
|
|
7960
7975
|
onClick: () => handleToggle(true),
|
|
@@ -7979,7 +7994,7 @@ const AutoFundingForm = ({
|
|
|
7979
7994
|
css: styles$t.input,
|
|
7980
7995
|
"data-testid": "auto-funding-threshold-input",
|
|
7981
7996
|
defaultValue: {
|
|
7982
|
-
amount:
|
|
7997
|
+
amount: autoFundingConfig === null || autoFundingConfig === void 0 ? void 0 : autoFundingConfig.autoPurchaseThreshold,
|
|
7983
7998
|
currency: Currency.USD
|
|
7984
7999
|
},
|
|
7985
8000
|
disabled: !watchIsEnabled,
|
|
@@ -7996,7 +8011,7 @@ const AutoFundingForm = ({
|
|
|
7996
8011
|
css: styles$t.input,
|
|
7997
8012
|
"data-testid": "auto-funding-purchase-amount-input",
|
|
7998
8013
|
defaultValue: {
|
|
7999
|
-
amount:
|
|
8014
|
+
amount: autoFundingConfig === null || autoFundingConfig === void 0 ? void 0 : autoFundingConfig.autoPurchaseAmount,
|
|
8000
8015
|
currency: Currency.USD
|
|
8001
8016
|
},
|
|
8002
8017
|
disabled: !watchIsEnabled,
|
|
@@ -8012,7 +8027,7 @@ const AutoFundingForm = ({
|
|
|
8012
8027
|
control: form.control,
|
|
8013
8028
|
css: styles$t.input,
|
|
8014
8029
|
"data-testid": "auto-funding-max-per-day-input",
|
|
8015
|
-
defaultValue:
|
|
8030
|
+
defaultValue: autoFundingConfig === null || autoFundingConfig === void 0 ? void 0 : autoFundingConfig.autoPurchaseCutoff,
|
|
8016
8031
|
disabled: !watchIsEnabled,
|
|
8017
8032
|
isInteger: true,
|
|
8018
8033
|
label: t("manage-funding:autoFunding.maximumPurchasesPerDay"),
|
|
@@ -8037,14 +8052,14 @@ const AutoFundingForm = ({
|
|
|
8037
8052
|
children: t("manage-funding:actions.saveRule")
|
|
8038
8053
|
}))]
|
|
8039
8054
|
}))]
|
|
8040
|
-
})),
|
|
8055
|
+
})), autoFundingConfigErrors && jsxs(Fragment, {
|
|
8041
8056
|
children: [jsx(Spacer, {
|
|
8042
8057
|
multiplier: 1
|
|
8043
8058
|
}), jsx(InlineNotification, Object.assign({
|
|
8044
8059
|
title: t("manage-funding:autoFunding.error.title"),
|
|
8045
8060
|
type: NotificationType.ERROR
|
|
8046
8061
|
}, {
|
|
8047
|
-
children:
|
|
8062
|
+
children: autoFundingConfigErrors[0].message
|
|
8048
8063
|
}))]
|
|
8049
8064
|
})]
|
|
8050
8065
|
});
|
|
@@ -8103,14 +8118,13 @@ const CarrierBalance = ({
|
|
|
8103
8118
|
} = useTranslation();
|
|
8104
8119
|
const {
|
|
8105
8120
|
data: carrier,
|
|
8106
|
-
|
|
8107
|
-
isRefetching: isRefetchingCarrier
|
|
8121
|
+
isFetching: isFetchingCarrier
|
|
8108
8122
|
} = useGetCarrierById(carrierId);
|
|
8109
8123
|
const carrierBalance = (_a = carrier === null || carrier === void 0 ? void 0 : carrier.balance) !== null && _a !== void 0 ? _a : balance;
|
|
8110
8124
|
return jsx(InlineLabel, Object.assign({
|
|
8111
8125
|
label: t("manage-funding:currentBalance")
|
|
8112
8126
|
}, {
|
|
8113
|
-
children:
|
|
8127
|
+
children: isFetchingCarrier ? jsx(Spinner, {}) : jsx(Typography, Object.assign({
|
|
8114
8128
|
bold: true,
|
|
8115
8129
|
css: styles$r.getBalanceText(carrierBalance)
|
|
8116
8130
|
}, {
|
|
@@ -8485,7 +8499,7 @@ const FundAndPurchase = ({
|
|
|
8485
8499
|
const [isAddFundsFormOpen, setIsAddFundsFormOpen] = useState(false);
|
|
8486
8500
|
const {
|
|
8487
8501
|
data: carrier,
|
|
8488
|
-
|
|
8502
|
+
isInitialLoading: isLoadingCarrier
|
|
8489
8503
|
} = useGetCarrierById(isPreferredRate ? undefined : carrierId);
|
|
8490
8504
|
const {
|
|
8491
8505
|
isSubmitting: isRateFormSubmitting,
|
|
@@ -8696,14 +8710,14 @@ const styles$n = createStyles({
|
|
|
8696
8710
|
verticalAlign: "top"
|
|
8697
8711
|
}),
|
|
8698
8712
|
itemName: theme => ({
|
|
8699
|
-
// Set item name to max 3 lines and truncate with ellipsis
|
|
8700
|
-
"-webkit-box-orient": "vertical",
|
|
8701
|
-
"-webkit-line-clamp": "3",
|
|
8702
8713
|
display: "-webkit-box",
|
|
8703
8714
|
lineHeight: `${theme.spacing(2.5)}px`,
|
|
8704
8715
|
maxHeight: `${theme.spacing(7.5)}px`,
|
|
8705
8716
|
overflow: "hidden",
|
|
8706
8717
|
textOverflow: "ellipsis",
|
|
8718
|
+
// Set item name to max 3 lines and truncate with ellipsis
|
|
8719
|
+
WebkitBoxOrient: "vertical",
|
|
8720
|
+
WebkitLineClamp: "3",
|
|
8707
8721
|
whiteSpace: "normal"
|
|
8708
8722
|
}),
|
|
8709
8723
|
numericCell: () => ({
|
|
@@ -8823,7 +8837,7 @@ const ManageFunding = ({
|
|
|
8823
8837
|
} = useTranslation();
|
|
8824
8838
|
const queryClient = useQueryClient();
|
|
8825
8839
|
const {
|
|
8826
|
-
|
|
8840
|
+
isInitialLoading: isLoadingCarrier
|
|
8827
8841
|
} = useGetCarrierById(carrierId);
|
|
8828
8842
|
const [isAddFundsFormOpen, setIsAddFundsFormOpen] = useState(false);
|
|
8829
8843
|
return jsx(CollapsiblePanel, Object.assign({
|
|
@@ -9545,7 +9559,7 @@ const AddressPreferenceSelect = ({
|
|
|
9545
9559
|
};
|
|
9546
9560
|
return jsxs(Fragment, {
|
|
9547
9561
|
children: [jsxs(Grid, Object.assign({
|
|
9548
|
-
"data-testid": "
|
|
9562
|
+
"data-testid": "addressPreferenceSelect",
|
|
9549
9563
|
noPadding: true
|
|
9550
9564
|
}, {
|
|
9551
9565
|
children: [jsx(GridChild, Object.assign({
|
|
@@ -9920,6 +9934,7 @@ const WalletForm = ({
|
|
|
9920
9934
|
},
|
|
9921
9935
|
resolver: validationResolver(walletSchema)
|
|
9922
9936
|
});
|
|
9937
|
+
const formSetValue = form.setValue;
|
|
9923
9938
|
useBlackboxDetection({
|
|
9924
9939
|
onError: useCallback(() => {
|
|
9925
9940
|
setCodedErrors(errors => {
|
|
@@ -9931,8 +9946,8 @@ const WalletForm = ({
|
|
|
9931
9946
|
};
|
|
9932
9947
|
return [...(errors !== null && errors !== void 0 ? errors : []), blackBoxError];
|
|
9933
9948
|
});
|
|
9934
|
-
}, [
|
|
9935
|
-
onSuccess: useCallback(bb =>
|
|
9949
|
+
}, [t]),
|
|
9950
|
+
onSuccess: useCallback(bb => formSetValue("iovationBlackbox", bb), [formSetValue])
|
|
9936
9951
|
});
|
|
9937
9952
|
const watchAddress = form.watch("address");
|
|
9938
9953
|
const handleSubmit = form.handleSubmit(values => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -10791,7 +10806,7 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
10791
10806
|
} : {
|
|
10792
10807
|
name: "111ty02-css",
|
|
10793
10808
|
styles: "align-items:center;display:flex;label:css;",
|
|
10794
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
10809
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxpc3QtY2FycmllcnMtcm93LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFvQmtkIiwiZmlsZSI6Imxpc3QtY2FycmllcnMtcm93LnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IF9fYXdhaXRlciB9IGZyb20gXCJ0c2xpYlwiO1xyXG5pbXBvcnQgeyBqc3ggYXMgX2pzeCwganN4cyBhcyBfanN4cyB9IGZyb20gXCJAZW1vdGlvbi9yZWFjdC9qc3gtcnVudGltZVwiO1xyXG5pbXBvcnQgeyBjc3MgfSBmcm9tIFwiQGVtb3Rpb24vcmVhY3RcIjtcclxuaW1wb3J0IHsgdXNlU3RhdGUgfSBmcm9tIFwicmVhY3RcIjtcclxuaW1wb3J0IHsgdXNlVHJhbnNsYXRpb24gfSBmcm9tIFwicmVhY3QtaTE4bmV4dFwiO1xyXG5pbXBvcnQgeyBUeXBvZ3JhcGh5IH0gZnJvbSBcIkBzaGlwZW5naW5lL2dpZ2VyXCI7XHJcbmltcG9ydCB7IExpbmtBY3Rpb24gfSBmcm9tIFwiLi4vLi4vLi4vY29tcG9uZW50cy9saW5rLWFjdGlvblwiO1xyXG5pbXBvcnQgeyBBZGRDYXJyaWVyRm9ybSB9IGZyb20gXCIuLi8uLi8uLi9jb21wb25lbnRzL3RlbXBsYXRlcy9hZGQtY2Fycmllci1mb3JtXCI7XHJcbmltcG9ydCB7IHN0eWxlcyB9IGZyb20gXCIuL2xpc3QtY2FycmllcnMtcm93LnN0eWxlc1wiO1xyXG5leHBvcnQgY29uc3QgTGlzdENhcnJpZXJzUm93ID0gKHsgY29ubmVjdGVkQ2FycmllcjogeyBjYXJyaWVyLCBpc0Nvbm5lY3RlZCB9LCByZWdpc3RlckNhcnJpZXIsIHJlZ2lzdGVyQ2FycmllckVycm9ycywgfSkgPT4ge1xyXG4gICAgY29uc3QgeyBzaG9ydG5hbWU6IG5hbWUsIGxvZ28sIHJlcXVpcmVkRmllbGRzIH0gPSBjYXJyaWVyO1xyXG4gICAgY29uc3QgeyB0IH0gPSB1c2VUcmFuc2xhdGlvbihbXCJsaXN0LWNhcnJpZXJzXCJdKTtcclxuICAgIGNvbnN0IFtzaG93RHJvcERvd24sIHNldFNob3dEcm9wRG93bl0gPSB1c2VTdGF0ZShmYWxzZSk7XHJcbiAgICBjb25zdCBbaXNTdWJtaXR0aW5nLCBzZXRJc1N1Ym1pdHRpbmddID0gdXNlU3RhdGUoZmFsc2UpO1xyXG4gICAgY29uc3QgaGFuZGxlUmVnaXN0ZXIgPSAodmFsdWVzKSA9PiBfX2F3YWl0ZXIodm9pZCAwLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHtcclxuICAgICAgICBzZXRJc1N1Ym1pdHRpbmcodHJ1ZSk7XHJcbiAgICAgICAgeWllbGQgcmVnaXN0ZXJDYXJyaWVyKHZhbHVlcyk7XHJcbiAgICAgICAgc2hvd0Ryb3BEb3duICYmIHNldFNob3dEcm9wRG93bihmYWxzZSk7XHJcbiAgICAgICAgc2V0SXNTdWJtaXR0aW5nKGZhbHNlKTtcclxuICAgIH0pO1xyXG4gICAgcmV0dXJuIChfanN4cyhcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgY3NzOiBzdHlsZXMuY29udGFpbmVyLCBcImRhdGEtdGVzdGlkXCI6IFwiY2Fycmllci1yb3dcIiB9LCB7IGNoaWxkcmVuOiBbX2pzeHMoXCJkaXZcIiwgT2JqZWN0LmFzc2lnbih7IGNzczogc3R5bGVzLnJvd0NvbnRhaW5lciB9LCB7IGNoaWxkcmVuOiBbX2pzeHMoXCJkaXZcIiwgT2JqZWN0LmFzc2lnbih7IGNzczogc3R5bGVzLmxvZ29Db250YWluZXIgfSwgeyBjaGlsZHJlbjogW19qc3goXCJkaXZcIiwgeyBjaGlsZHJlbjogX2pzeChcImltZ1wiLCB7IGFsdDogYCR7bmFtZX0tbG9nb2AsIGhlaWdodDogNDAsIHNyYzogbG9nbywgd2lkdGg6IDQwIH0pIH0pLCBfanN4KFR5cG9ncmFwaHksIE9iamVjdC5hc3NpZ24oeyB2YXJpYW50OiBcInN1YnRpdGxlMVwiIH0sIHsgY2hpbGRyZW46IG5hbWUgfSkpXSB9KSksIF9qc3goXCJkaXZcIiwgT2JqZWN0LmFzc2lnbih7IGNzczogY3NzKHsgYWxpZ25JdGVtczogXCJjZW50ZXJcIiwgZGlzcGxheTogXCJmbGV4XCIgfSkgfSwgeyBjaGlsZHJlbjogX2pzeChMaW5rQWN0aW9uLCB7IGNzczogc3R5bGVzLmdldENvbm5lY3RCdXR0b24oaXNDb25uZWN0ZWQpLCBpc0Rpc2FibGVkOiBpc0Nvbm5lY3RlZCB8fCBzaG93RHJvcERvd24sIGlzTG9hZGluZzogaXNTdWJtaXR0aW5nLCBvbkNsaWNrOiAoKSA9PiBfX2F3YWl0ZXIodm9pZCAwLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVxdWlyZWRGaWVsZHMgPT09IG51bGwgfHwgcmVxdWlyZWRGaWVsZHMgPT09IHZvaWQgMCA/IHZvaWQgMCA6IHJlcXVpcmVkRmllbGRzLmluY2x1ZGVzKFwiYWRkcmVzc1wiKSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0U2hvd0Ryb3BEb3duKHRydWUpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2VcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeWllbGQgaGFuZGxlUmVnaXN0ZXIoKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLCB0aXRsZTogaXNDb25uZWN0ZWRcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IHQoXCJsaXN0LWNhcnJpZXJzOmFjdGlvbnMuc3RhdHVzLmNvbm5lY3RlZFwiKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogdChcImxpc3QtY2FycmllcnM6YWN0aW9ucy5zdGF0dXMubm90Q29ubmVjdGVkXCIpIH0pIH0pKV0gfSkpLCBzaG93RHJvcERvd24gJiYgKF9qc3goQWRkQ2FycmllckZvcm0sIHsgY2FycmllclRlcm1zOiBjYXJyaWVyLnRlcm1zICYmIGNhcnJpZXIudGVybXMsIG9uQ2FuY2VsOiAoKSA9PiBzZXRTaG93RHJvcERvd24oZmFsc2UpLCBvblN1Ym1pdDogKHZhbHVlcykgPT4gaGFuZGxlUmVnaXN0ZXIodmFsdWVzKSwgcmVnaXN0ZXJDYXJyaWVyRXJyb3JzOiByZWdpc3RlckNhcnJpZXJFcnJvcnMgfSkpXSB9KSkpO1xyXG59O1xyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1saXN0LWNhcnJpZXJzLXJvdy5qcy5tYXAiXX0= */",
|
|
10795
10810
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
10796
10811
|
};
|
|
10797
10812
|
const ListCarriersRow = ({
|
|
@@ -10977,7 +10992,7 @@ const useListConnectedCarriers = () => {
|
|
|
10977
10992
|
const {
|
|
10978
10993
|
data: carriers,
|
|
10979
10994
|
error,
|
|
10980
|
-
|
|
10995
|
+
isInitialLoading,
|
|
10981
10996
|
refetch
|
|
10982
10997
|
} = useListCarriers();
|
|
10983
10998
|
const carrierMetadatas = useCarrierMetadata();
|
|
@@ -10988,7 +11003,7 @@ const useListConnectedCarriers = () => {
|
|
|
10988
11003
|
isConnected: normalizedCarrierCodes.has(m.carrierCode)
|
|
10989
11004
|
})),
|
|
10990
11005
|
error: error,
|
|
10991
|
-
isLoading,
|
|
11006
|
+
isLoading: isInitialLoading,
|
|
10992
11007
|
refetch
|
|
10993
11008
|
};
|
|
10994
11009
|
};
|
|
@@ -11466,7 +11481,7 @@ const Component$5 = ({
|
|
|
11466
11481
|
const {
|
|
11467
11482
|
data: warehouses,
|
|
11468
11483
|
error: listWarehouseErrors,
|
|
11469
|
-
|
|
11484
|
+
isInitialLoading: isLoadingWarehouses,
|
|
11470
11485
|
refetch: refreshListWarehouses
|
|
11471
11486
|
} = useListWarehouses();
|
|
11472
11487
|
const {
|
|
@@ -12928,7 +12943,7 @@ const WalletHistory = () => {
|
|
|
12928
12943
|
const queryRange = useMemo(() => selectedOption && selectedOption.value === "custom" && customRange ? customRange : selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.range, [customRange, selectedOption]);
|
|
12929
12944
|
const {
|
|
12930
12945
|
data: walletHistoryData,
|
|
12931
|
-
|
|
12946
|
+
isInitialLoading: isWalletHistoryDataLoading,
|
|
12932
12947
|
isFetching: isWalletHistoryFetching,
|
|
12933
12948
|
error: errors
|
|
12934
12949
|
} = useGetWalletHistory({
|
|
@@ -13421,7 +13436,7 @@ const UnitSettings = () => {
|
|
|
13421
13436
|
const {
|
|
13422
13437
|
data: accountSettings,
|
|
13423
13438
|
error: getAccountSettingsErrors,
|
|
13424
|
-
|
|
13439
|
+
isInitialLoading: isLoadingAccountSettings,
|
|
13425
13440
|
refetch: refreshAccountSettings
|
|
13426
13441
|
} = useGetAccountSettings();
|
|
13427
13442
|
const {
|
|
@@ -14251,9 +14266,6 @@ var en = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(O
|
|
|
14251
14266
|
* - The `<AccountSettings />` component is used to display the user's account settings, as well as
|
|
14252
14267
|
* allowing them to make changes to various aspects of their account.
|
|
14253
14268
|
*
|
|
14254
|
-
* @param onSaveSettings Any `void` function you wish to execute when the user saves any changes
|
|
14255
|
-
* to their account settings.
|
|
14256
|
-
*
|
|
14257
14269
|
* @returns Element An EmotionJSX.Element that will render the `<AccountSettings />` component
|
|
14258
14270
|
* with all the appropriate wrappers.
|
|
14259
14271
|
*
|
|
@@ -14277,8 +14289,7 @@ const Component$4 = ({
|
|
|
14277
14289
|
data: carriers
|
|
14278
14290
|
} = useListCarriers();
|
|
14279
14291
|
return jsx(AccountSettings, {
|
|
14280
|
-
carriers: carriers
|
|
14281
|
-
onSaveSettings: onSaveSettings
|
|
14292
|
+
carriers: carriers
|
|
14282
14293
|
});
|
|
14283
14294
|
};
|
|
14284
14295
|
/**
|
|
@@ -14294,9 +14305,7 @@ const Component$4 = ({
|
|
|
14294
14305
|
* The `<Component />` is the source JSX that is rendered when you make use of the `AccountSettings`
|
|
14295
14306
|
* Element directly. Here is a brief example of how you would use it within your application.
|
|
14296
14307
|
* ```tsx
|
|
14297
|
-
* <AccountSettings.Element
|
|
14298
|
-
* onSaveSettings={() => console.log('Settings Saved!')}
|
|
14299
|
-
* />
|
|
14308
|
+
* <AccountSettings.Element/>
|
|
14300
14309
|
* ```
|
|
14301
14310
|
*
|
|
14302
14311
|
* <br />
|
|
@@ -15490,10 +15499,10 @@ const RateForm = ({
|
|
|
15490
15499
|
} finally {
|
|
15491
15500
|
// Invalidate carrier queries after the rate form is submitted, regardless of success.
|
|
15492
15501
|
// This allows the carrier balance to refresh if the purchase failed but funding succeeded.
|
|
15493
|
-
queryClient.invalidateQueries(["useGetCarrierById", selectedRate === null || selectedRate === void 0 ? void 0 : selectedRate.carrierId], {
|
|
15502
|
+
void queryClient.invalidateQueries(["useGetCarrierById", selectedRate === null || selectedRate === void 0 ? void 0 : selectedRate.carrierId], {
|
|
15494
15503
|
exact: true
|
|
15495
15504
|
});
|
|
15496
|
-
queryClient.invalidateQueries(["useListCarriers"], {
|
|
15505
|
+
void queryClient.invalidateQueries(["useListCarriers"], {
|
|
15497
15506
|
exact: true
|
|
15498
15507
|
});
|
|
15499
15508
|
}
|
|
@@ -16697,7 +16706,7 @@ const ShipmentForm = ({
|
|
|
16697
16706
|
useEffect(() => {
|
|
16698
16707
|
if (!requireMeasurements) {
|
|
16699
16708
|
form.resetField("packages.0.dimensions");
|
|
16700
|
-
form.trigger("packages.0.dimensions");
|
|
16709
|
+
void form.trigger("packages.0.dimensions");
|
|
16701
16710
|
}
|
|
16702
16711
|
}, [requireMeasurements, form]);
|
|
16703
16712
|
useEffect(() => {
|
|
@@ -16988,7 +16997,7 @@ const ShipmentForm = ({
|
|
|
16988
16997
|
children: presetCategory.options.map(preset => jsx(Option, Object.assign({
|
|
16989
16998
|
onClick: () => {
|
|
16990
16999
|
onDirty(); // bypass rate cache
|
|
16991
|
-
handleApplyPreset(preset.value);
|
|
17000
|
+
void handleApplyPreset(preset.value);
|
|
16992
17001
|
},
|
|
16993
17002
|
selected: _$3.isEqual(selectedPreset, preset.value),
|
|
16994
17003
|
value: JSON.stringify(preset.value)
|
|
@@ -17759,7 +17768,7 @@ const useRatesForm = ({
|
|
|
17759
17768
|
} = useListCarriers();
|
|
17760
17769
|
const {
|
|
17761
17770
|
data: labels,
|
|
17762
|
-
|
|
17771
|
+
isInitialLoading: labelsLoading
|
|
17763
17772
|
} = useListLabels();
|
|
17764
17773
|
const {
|
|
17765
17774
|
mutateAsync: updateShipment
|
|
@@ -18128,13 +18137,14 @@ const ConfigureShipment = _a => {
|
|
|
18128
18137
|
const _d = useShipmentForm({
|
|
18129
18138
|
compatibleCountryCodes: features === null || features === void 0 ? void 0 : features.compatibleCountryCodes,
|
|
18130
18139
|
onAddressValidation,
|
|
18131
|
-
onApplyPreset: useCallback((
|
|
18140
|
+
onApplyPreset: useCallback((preset, shipment) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18132
18141
|
var _e;
|
|
18133
18142
|
if (shipment.packages[0].weight.value) {
|
|
18134
18143
|
yield requestRates(shipment, isInternational);
|
|
18135
18144
|
}
|
|
18136
18145
|
(_e = hydrateRef.current) === null || _e === void 0 ? void 0 : _e.call(hydrateRef, shipment);
|
|
18137
|
-
|
|
18146
|
+
void (onApplyPreset === null || onApplyPreset === void 0 ? void 0 : onApplyPreset(preset, shipment));
|
|
18147
|
+
}), [onApplyPreset, requestRates, isInternational]),
|
|
18138
18148
|
onChangeAddress,
|
|
18139
18149
|
onShipmentUpdated,
|
|
18140
18150
|
onSubmit: useCallback(shipment => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -18201,7 +18211,7 @@ const usePendingShipment = ({
|
|
|
18201
18211
|
const {
|
|
18202
18212
|
data: shipments,
|
|
18203
18213
|
error: listShipmentsErrors,
|
|
18204
|
-
|
|
18214
|
+
isInitialLoading: isListShipmentsLoading,
|
|
18205
18215
|
isFetching: isListShipmentsValidating,
|
|
18206
18216
|
refetch: reloadShipments
|
|
18207
18217
|
} = useListSalesOrderShipments({
|
|
@@ -18267,7 +18277,6 @@ const useConfigureShipment = ({
|
|
|
18267
18277
|
warehouseId,
|
|
18268
18278
|
printLabelLayout
|
|
18269
18279
|
}) => {
|
|
18270
|
-
var _a, _b;
|
|
18271
18280
|
const {
|
|
18272
18281
|
isPendingShipmentLoading,
|
|
18273
18282
|
pendingShipment,
|
|
@@ -18283,12 +18292,16 @@ const useConfigureShipment = ({
|
|
|
18283
18292
|
yield reloadPendingShipment();
|
|
18284
18293
|
yield onShipmentUpdated === null || onShipmentUpdated === void 0 ? void 0 : onShipmentUpdated(shipment);
|
|
18285
18294
|
}), [onShipmentUpdated, reloadPendingShipment]);
|
|
18286
|
-
const
|
|
18295
|
+
const {
|
|
18296
|
+
data: {
|
|
18297
|
+
defaultLabelLayout = "4x6"
|
|
18298
|
+
} = {}
|
|
18299
|
+
} = useGetAccountSettings();
|
|
18287
18300
|
return {
|
|
18288
18301
|
errors: pendingShipmentErrors,
|
|
18289
18302
|
isLoading: isPendingShipmentLoading,
|
|
18290
18303
|
onShipmentUpdated: handleShipmentUpdated,
|
|
18291
|
-
printLabelLayout: printLabelLayout ? printLabelLayout :
|
|
18304
|
+
printLabelLayout: printLabelLayout ? printLabelLayout : defaultLabelLayout,
|
|
18292
18305
|
shipment: pendingShipment,
|
|
18293
18306
|
warehouseId
|
|
18294
18307
|
};
|
|
@@ -18305,7 +18318,7 @@ const useImportSalesOrder = ({
|
|
|
18305
18318
|
data: salesOrders,
|
|
18306
18319
|
error: listSalesOrdersErrors,
|
|
18307
18320
|
isFetching: isFetchingSalesOrders,
|
|
18308
|
-
|
|
18321
|
+
isInitialLoading: isInitialLoadingSalesOrders,
|
|
18309
18322
|
refetch: refetchSalesOrders
|
|
18310
18323
|
} = useListSalesOrders({
|
|
18311
18324
|
externalOrderId,
|
|
@@ -18315,7 +18328,7 @@ const useImportSalesOrder = ({
|
|
|
18315
18328
|
data: salesOrder,
|
|
18316
18329
|
error: getSalesOrderErrors,
|
|
18317
18330
|
isFetching: isFetchingSalesOrder,
|
|
18318
|
-
|
|
18331
|
+
isInitialLoading: isInitialLoadingSalesOrder,
|
|
18319
18332
|
refetch: refetchSalesOrder
|
|
18320
18333
|
} = useGetSalesOrder(salesOrderId !== null && salesOrderId !== void 0 ? salesOrderId : salesOrders && salesOrders[0] ? salesOrders[0].salesOrderId : undefined);
|
|
18321
18334
|
const {
|
|
@@ -18333,7 +18346,7 @@ const useImportSalesOrder = ({
|
|
|
18333
18346
|
// to handle scenarios where the sales order has not yet been imported. If the
|
|
18334
18347
|
// order source has already refreshed and there is still no matching order, bubble it up
|
|
18335
18348
|
// to the error boundary.
|
|
18336
|
-
(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
18349
|
+
void (() => __awaiter(void 0, void 0, void 0, function* () {
|
|
18337
18350
|
const selectedOrderSources = orderSourceCode ? orderSources === null || orderSources === void 0 ? void 0 : orderSources.filter(o => o.orderSourceCode.includes(orderSourceCode) && o.active) : orderSources;
|
|
18338
18351
|
if (selectedOrderSources && !salesOrder && !isFetchingSalesOrder && !isFetchingSalesOrders && !hasRefreshedOrderSource) {
|
|
18339
18352
|
yield Promise.all(selectedOrderSources.map(o => refreshOrderSource(o.orderSourceId)));
|
|
@@ -18345,7 +18358,7 @@ const useImportSalesOrder = ({
|
|
|
18345
18358
|
const errors = [...(listOrderSourcesErrors !== null && listOrderSourcesErrors !== void 0 ? listOrderSourcesErrors : []), ...(listSalesOrdersErrors !== null && listSalesOrdersErrors !== void 0 ? listSalesOrdersErrors : []), ...(getSalesOrderErrors !== null && getSalesOrderErrors !== void 0 ? getSalesOrderErrors : []), ...(refreshOrderSourceErrors !== null && refreshOrderSourceErrors !== void 0 ? refreshOrderSourceErrors : [])];
|
|
18346
18359
|
return {
|
|
18347
18360
|
errors: errors.length > 0 ? errors : undefined,
|
|
18348
|
-
isLoading:
|
|
18361
|
+
isLoading: isInitialLoadingSalesOrder || isInitialLoadingSalesOrders || isRefreshingOrderSource || !hasRefreshedOrderSource && !salesOrder && (salesOrders === null || salesOrders === void 0 ? void 0 : salesOrders.length) === 0 && errors.length === 0,
|
|
18349
18362
|
salesOrder
|
|
18350
18363
|
};
|
|
18351
18364
|
};
|
|
@@ -18456,16 +18469,16 @@ const useGetOrCreateShipment = (onShipmentUpdated, shipmentId) => {
|
|
|
18456
18469
|
const getShipment = useGetShipment(shipmentId !== null && shipmentId !== void 0 ? shipmentId : createdShipment === null || createdShipment === void 0 ? void 0 : createdShipment.shipmentId);
|
|
18457
18470
|
useEffect(() => {
|
|
18458
18471
|
if (shouldTriggerUpdate && getShipment.data) {
|
|
18459
|
-
onShipmentUpdated === null || onShipmentUpdated === void 0 ? void 0 : onShipmentUpdated(getShipment.data);
|
|
18472
|
+
void (onShipmentUpdated === null || onShipmentUpdated === void 0 ? void 0 : onShipmentUpdated(getShipment.data));
|
|
18460
18473
|
setShouldTriggerUpdate(false);
|
|
18461
18474
|
}
|
|
18462
|
-
}, [shouldTriggerUpdate, getShipment]);
|
|
18475
|
+
}, [shouldTriggerUpdate, getShipment, onShipmentUpdated]);
|
|
18463
18476
|
const errors = [...((_a = getShipment.error) !== null && _a !== void 0 ? _a : []), ...((_b = createShipment.error) !== null && _b !== void 0 ? _b : [])];
|
|
18464
18477
|
return {
|
|
18465
18478
|
errors: errors.length > 0 ? errors : undefined,
|
|
18466
18479
|
isLoading:
|
|
18467
18480
|
//bootstrap isLoading to true if one off and create shipment mutation hasn't been triggered yet
|
|
18468
|
-
!createShipment.isError && createShipment.isIdle && shipmentId === undefined || getShipment.
|
|
18481
|
+
!createShipment.isError && createShipment.isIdle && shipmentId === undefined || getShipment.isInitialLoading || createShipment.isLoading,
|
|
18469
18482
|
refetchShipment: getShipment.refetch,
|
|
18470
18483
|
shipment: getShipment.data
|
|
18471
18484
|
};
|
|
@@ -18489,7 +18502,7 @@ const PurchaseLabelByShipment = _a => {
|
|
|
18489
18502
|
};
|
|
18490
18503
|
const {
|
|
18491
18504
|
data: insuranceAccount,
|
|
18492
|
-
|
|
18505
|
+
isInitialLoading: insuranceIsLoading
|
|
18493
18506
|
} = useGetInsuranceAccount("shipsurance");
|
|
18494
18507
|
return jsx(SuspendShipment, Object.assign({
|
|
18495
18508
|
shipment: shipment
|
|
@@ -19010,7 +19023,7 @@ const Component$1 = ({
|
|
|
19010
19023
|
const salesOrder = useGetSalesOrder((_b = (_a = shipment.data) === null || _a === void 0 ? void 0 : _a.salesOrderIds) === null || _b === void 0 ? void 0 : _b[0]);
|
|
19011
19024
|
const warehouses = useListWarehouses();
|
|
19012
19025
|
const carriers = useListCarriers();
|
|
19013
|
-
if (
|
|
19026
|
+
if (shipment.isInitialLoading) return jsx(Loader, {
|
|
19014
19027
|
message: t("loading.shipment")
|
|
19015
19028
|
});
|
|
19016
19029
|
if (shipment.error) throw new Error(shipment.error.map(e => e.message).join(", "));
|
|
@@ -19230,10 +19243,10 @@ const Component = ({
|
|
|
19230
19243
|
const label = useGetLabel(labelId);
|
|
19231
19244
|
const shipment = useGetSalesOrderShipment((_a = label.data) === null || _a === void 0 ? void 0 : _a.shipmentId);
|
|
19232
19245
|
const voidLabel = useVoidLabel();
|
|
19233
|
-
if (label.
|
|
19246
|
+
if (label.isInitialLoading) return jsx(Loader, {
|
|
19234
19247
|
message: t("loading.label")
|
|
19235
19248
|
});
|
|
19236
|
-
if (shipment.
|
|
19249
|
+
if (shipment.isInitialLoading) return jsx(Loader, {
|
|
19237
19250
|
message: t("loading.shipment")
|
|
19238
19251
|
});
|
|
19239
19252
|
throwAny(label.error);
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shipengine/elements",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.39.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@
|
|
5
|
+
"@shipengine/giger": "0.x.x",
|
|
6
6
|
"react-i18next": "*",
|
|
7
7
|
"i18next": "*"
|
|
8
8
|
},
|
|
@@ -23,15 +23,15 @@
|
|
|
23
23
|
"@faker-js/faker": "7.6.0",
|
|
24
24
|
"@hookform/resolvers": "2.9.1",
|
|
25
25
|
"@jest/globals": "28.1.3",
|
|
26
|
-
"@
|
|
27
|
-
"@
|
|
28
|
-
"@shipengine/
|
|
29
|
-
"@shipengine/js-api": "0.23.0",
|
|
26
|
+
"@shipengine/alchemy": "4.2.2",
|
|
27
|
+
"@shipengine/giger-theme": "0.4.0",
|
|
28
|
+
"@shipengine/js-api": "0.39.0",
|
|
30
29
|
"@storybook/addons": "6.5.16",
|
|
31
30
|
"@storybook/components": "7.0.0-rc.1",
|
|
32
31
|
"@storybook/core-events": "7.0.0-rc.1",
|
|
33
32
|
"@storybook/manager-api": "7.0.0-rc.1",
|
|
34
33
|
"@storybook/theming": "7.0.0-rc.1",
|
|
34
|
+
"@tanstack/react-query": "4.36.1",
|
|
35
35
|
"@testing-library/dom": "8.19.0",
|
|
36
36
|
"@vitejs/plugin-react": "1.3.2",
|
|
37
37
|
"axios": "0.26.1",
|
|
@@ -47,7 +47,6 @@
|
|
|
47
47
|
"react-datepicker": "4.11.0",
|
|
48
48
|
"react-dom": "18.2.0",
|
|
49
49
|
"react-hook-form": "7.40.0",
|
|
50
|
-
"react-query": "3.39.3",
|
|
51
50
|
"zod": "3.19.1"
|
|
52
51
|
}
|
|
53
52
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export declare const styles: {
|
|
2
|
-
chipList: (theme: import("@
|
|
2
|
+
chipList: (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
|
|
3
3
|
gap: number;
|
|
4
4
|
};
|
|
5
|
-
fundsInput: (theme: import("@
|
|
5
|
+
fundsInput: (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
|
|
6
6
|
maxWidth: number;
|
|
7
7
|
};
|
|
8
8
|
getChip: ({ isDisabled, isSelected }: {
|
|
9
9
|
isDisabled?: boolean | undefined;
|
|
10
10
|
isSelected?: boolean | undefined;
|
|
11
|
-
}) => (theme: import("@
|
|
11
|
+
}) => (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => (false | {
|
|
12
12
|
backgroundColor: string;
|
|
13
13
|
color: string;
|
|
14
14
|
cursor?: undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const styles: {
|
|
2
|
-
getBalanceText: (balance?: number) => (theme: import("@
|
|
2
|
+
getBalanceText: (balance?: number) => (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
|
|
3
3
|
color: string;
|
|
4
4
|
};
|
|
5
5
|
};
|