@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.cjs
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
6
|
-
var giger = require('@
|
|
7
|
-
var gigerTheme = require('@
|
|
6
|
+
var giger = require('@shipengine/giger');
|
|
7
|
+
var gigerTheme = require('@shipengine/giger-theme');
|
|
8
8
|
var humps = require('humps');
|
|
9
9
|
var React = require('react');
|
|
10
10
|
var reactI18next = require('react-i18next');
|
|
@@ -23,7 +23,7 @@ var Locales = require('date-fns/locale');
|
|
|
23
23
|
var css = require('@emotion/css');
|
|
24
24
|
var min$3 = require('libphonenumber-js/min');
|
|
25
25
|
var copy = require('copy-to-clipboard');
|
|
26
|
-
var reactQuery = require('react-query');
|
|
26
|
+
var reactQuery = require('@tanstack/react-query');
|
|
27
27
|
var cardValidator = require('card-validator');
|
|
28
28
|
|
|
29
29
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -2118,13 +2118,19 @@ const usStates = [new UsState("Alabama", "AL"), new UsState("Alaska", "AK"), new
|
|
|
2118
2118
|
isMilitary
|
|
2119
2119
|
}), 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", {
|
|
2120
2120
|
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2121
|
-
}), 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("
|
|
2121
|
+
}), 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", {
|
|
2122
2122
|
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2123
|
-
}), new UsState("
|
|
2123
|
+
}), new UsState("Maryland", "MD"), new UsState("Massachusetts", "MA"), new UsState("Michigan", "MI"), new UsState("Micronesia", "FM", {
|
|
2124
|
+
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2125
|
+
}), 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", {
|
|
2126
|
+
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2127
|
+
}), new UsState("Ohio", "OH"), new UsState("Oklahoma", "OK"), new UsState("Oregon", "OR"), new UsState("Palau", "PW", {
|
|
2124
2128
|
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2125
|
-
}), new UsState("
|
|
2129
|
+
}), new UsState("Pennsylvania", "PA"), new UsState("Puerto Rico", "PR", {
|
|
2130
|
+
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2131
|
+
}), 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", {
|
|
2126
2132
|
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2127
|
-
}), new UsState("U.S. Minor Outlying Islands", "UM", {
|
|
2133
|
+
}), 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", {
|
|
2128
2134
|
isUnitedStatesTerritory: isUnitedStatesTerritory$1
|
|
2129
2135
|
})];
|
|
2130
2136
|
/**
|
|
@@ -2744,7 +2750,7 @@ const formLogger = {
|
|
|
2744
2750
|
// event bubbling doesn't handle the formId target properly when passed through a portal.
|
|
2745
2751
|
e === null || e === void 0 ? void 0 : e.stopPropagation();
|
|
2746
2752
|
this.isSubmitting = true;
|
|
2747
|
-
handleSubmit(e);
|
|
2753
|
+
void handleSubmit(e);
|
|
2748
2754
|
this.isSubmitting = false;
|
|
2749
2755
|
};
|
|
2750
2756
|
},
|
|
@@ -4994,6 +5000,7 @@ RootPortalContext.displayName = "RootPortalContext";
|
|
|
4994
5000
|
const RootPortalProvider = ({
|
|
4995
5001
|
children
|
|
4996
5002
|
}) => {
|
|
5003
|
+
// eslint-disable-next-line react/hook-use-state -- We don't need the setter
|
|
4997
5004
|
const [rootPortal] = React.useState(() => {
|
|
4998
5005
|
let rootPortal = document.getElementById("root-portal");
|
|
4999
5006
|
if (!rootPortal) {
|
|
@@ -7642,7 +7649,7 @@ const AddFundsForm = ({
|
|
|
7642
7649
|
const {
|
|
7643
7650
|
t
|
|
7644
7651
|
} = reactI18next.useTranslation();
|
|
7645
|
-
const addFunds = alchemy.useAddFunds(
|
|
7652
|
+
const addFunds = alchemy.useAddFunds();
|
|
7646
7653
|
const carrier = alchemy.useGetCarrierById(carrierId);
|
|
7647
7654
|
const chips = [{
|
|
7648
7655
|
label: "$20",
|
|
@@ -7678,13 +7685,16 @@ const AddFundsForm = ({
|
|
|
7678
7685
|
const handleSubmit = formLogger.capture(form.handleSubmit(values => __awaiter(void 0, void 0, void 0, function* () {
|
|
7679
7686
|
const payload = values;
|
|
7680
7687
|
try {
|
|
7681
|
-
yield addFunds.mutateAsync(
|
|
7688
|
+
yield addFunds.mutateAsync({
|
|
7689
|
+
carrierId,
|
|
7690
|
+
funds: payload
|
|
7691
|
+
});
|
|
7682
7692
|
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
|
|
7683
7693
|
} catch (_a) {
|
|
7684
7694
|
// Noop; errors available on RQ object
|
|
7685
7695
|
}
|
|
7686
7696
|
})));
|
|
7687
|
-
if (carrier.
|
|
7697
|
+
if (carrier.isInitialLoading) return jsxRuntime.jsx(Loader, {
|
|
7688
7698
|
message: t("loading.carrier")
|
|
7689
7699
|
});
|
|
7690
7700
|
if (!carrier.data) throw new Error("errorMessages.unableToLoad.carrier");
|
|
@@ -7922,11 +7932,16 @@ const AutoFundingForm = ({
|
|
|
7922
7932
|
const {
|
|
7923
7933
|
t
|
|
7924
7934
|
} = reactI18next.useTranslation();
|
|
7925
|
-
const updateAutoFunding = alchemy.useUpdateAutoFunding(carrierId);
|
|
7926
|
-
const autoFundingConfiguration = alchemy.useGetAutoFundingConfiguration(carrierId);
|
|
7927
7935
|
const {
|
|
7928
|
-
|
|
7929
|
-
|
|
7936
|
+
mutate: updateAutoFunding,
|
|
7937
|
+
isLoading: updateAutoFundingIsLoading
|
|
7938
|
+
} = alchemy.useUpdateAutoFunding(carrierId);
|
|
7939
|
+
const {
|
|
7940
|
+
data: autoFundingConfig,
|
|
7941
|
+
refetch: autoFundingConfigRefetch,
|
|
7942
|
+
isInitialLoading: isLoadingAutoFundingConfig,
|
|
7943
|
+
error: autoFundingConfigErrors
|
|
7944
|
+
} = alchemy.useGetAutoFundingConfiguration(carrierId);
|
|
7930
7945
|
const [showForm, setShowForm] = React.useState(false);
|
|
7931
7946
|
const [isSwitchOn, setIsSwitchOn] = React.useState(false);
|
|
7932
7947
|
const form = reactHookForm.useForm({
|
|
@@ -7942,8 +7957,8 @@ const AutoFundingForm = ({
|
|
|
7942
7957
|
setShowForm(prev => !prev);
|
|
7943
7958
|
setIsSwitchOn(true);
|
|
7944
7959
|
const payload = values;
|
|
7945
|
-
updateAutoFunding
|
|
7946
|
-
onSuccess: () =>
|
|
7960
|
+
updateAutoFunding(payload, {
|
|
7961
|
+
onSuccess: () => autoFundingConfigRefetch()
|
|
7947
7962
|
});
|
|
7948
7963
|
}));
|
|
7949
7964
|
/**
|
|
@@ -7957,19 +7972,19 @@ const AutoFundingForm = ({
|
|
|
7957
7972
|
formReset(isEnabled);
|
|
7958
7973
|
if (!isEnabled) {
|
|
7959
7974
|
setIsSwitchOn(isEnabled);
|
|
7960
|
-
updateAutoFunding
|
|
7961
|
-
onSuccess: () =>
|
|
7975
|
+
updateAutoFunding(form.getValues(), {
|
|
7976
|
+
onSuccess: () => autoFundingConfigRefetch()
|
|
7962
7977
|
});
|
|
7963
7978
|
}
|
|
7964
7979
|
};
|
|
7965
|
-
if (
|
|
7980
|
+
if (isLoadingAutoFundingConfig || updateAutoFundingIsLoading) return jsxRuntime.jsx(Loader, {
|
|
7966
7981
|
message: t("manage-funding:autoFunding.isLoading")
|
|
7967
7982
|
});
|
|
7968
|
-
if (!
|
|
7983
|
+
if (!autoFundingConfig) throw new Error(t("errorMessages:unableToLoad.autoFundingSettings"));
|
|
7969
7984
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
7970
7985
|
children: [jsxRuntime.jsxs(Spread, {
|
|
7971
7986
|
children: [jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
7972
|
-
bold: !!(
|
|
7987
|
+
bold: !!(autoFundingConfig === null || autoFundingConfig === void 0 ? void 0 : autoFundingConfig.isAutoPurchaseEnabled),
|
|
7973
7988
|
variant: "body1"
|
|
7974
7989
|
}, {
|
|
7975
7990
|
children: t("manage-funding:autoFunding:isEnabledCTA")
|
|
@@ -7982,11 +7997,11 @@ const AutoFundingForm = ({
|
|
|
7982
7997
|
})]
|
|
7983
7998
|
}), jsxRuntime.jsx(Spacer, {
|
|
7984
7999
|
multiplier: 1
|
|
7985
|
-
}), !!(
|
|
8000
|
+
}), !!(autoFundingConfig === null || autoFundingConfig === void 0 ? void 0 : autoFundingConfig.isAutoPurchaseEnabled) && !showForm && jsxRuntime.jsxs(Spread, {
|
|
7986
8001
|
children: [jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
7987
8002
|
variant: "body1"
|
|
7988
8003
|
}, {
|
|
7989
|
-
children: t("manage-funding:autoFunding.readSettings", Object.assign({},
|
|
8004
|
+
children: t("manage-funding:autoFunding.readSettings", Object.assign({}, autoFundingConfig))
|
|
7990
8005
|
})), jsxRuntime.jsx(LinkAction, {
|
|
7991
8006
|
css: styles$t.edit,
|
|
7992
8007
|
onClick: () => handleToggle(true),
|
|
@@ -8011,7 +8026,7 @@ const AutoFundingForm = ({
|
|
|
8011
8026
|
css: styles$t.input,
|
|
8012
8027
|
"data-testid": "auto-funding-threshold-input",
|
|
8013
8028
|
defaultValue: {
|
|
8014
|
-
amount:
|
|
8029
|
+
amount: autoFundingConfig === null || autoFundingConfig === void 0 ? void 0 : autoFundingConfig.autoPurchaseThreshold,
|
|
8015
8030
|
currency: alchemy.Currency.USD
|
|
8016
8031
|
},
|
|
8017
8032
|
disabled: !watchIsEnabled,
|
|
@@ -8028,7 +8043,7 @@ const AutoFundingForm = ({
|
|
|
8028
8043
|
css: styles$t.input,
|
|
8029
8044
|
"data-testid": "auto-funding-purchase-amount-input",
|
|
8030
8045
|
defaultValue: {
|
|
8031
|
-
amount:
|
|
8046
|
+
amount: autoFundingConfig === null || autoFundingConfig === void 0 ? void 0 : autoFundingConfig.autoPurchaseAmount,
|
|
8032
8047
|
currency: alchemy.Currency.USD
|
|
8033
8048
|
},
|
|
8034
8049
|
disabled: !watchIsEnabled,
|
|
@@ -8044,7 +8059,7 @@ const AutoFundingForm = ({
|
|
|
8044
8059
|
control: form.control,
|
|
8045
8060
|
css: styles$t.input,
|
|
8046
8061
|
"data-testid": "auto-funding-max-per-day-input",
|
|
8047
|
-
defaultValue:
|
|
8062
|
+
defaultValue: autoFundingConfig === null || autoFundingConfig === void 0 ? void 0 : autoFundingConfig.autoPurchaseCutoff,
|
|
8048
8063
|
disabled: !watchIsEnabled,
|
|
8049
8064
|
isInteger: true,
|
|
8050
8065
|
label: t("manage-funding:autoFunding.maximumPurchasesPerDay"),
|
|
@@ -8069,14 +8084,14 @@ const AutoFundingForm = ({
|
|
|
8069
8084
|
children: t("manage-funding:actions.saveRule")
|
|
8070
8085
|
}))]
|
|
8071
8086
|
}))]
|
|
8072
|
-
})),
|
|
8087
|
+
})), autoFundingConfigErrors && jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
8073
8088
|
children: [jsxRuntime.jsx(Spacer, {
|
|
8074
8089
|
multiplier: 1
|
|
8075
8090
|
}), jsxRuntime.jsx(giger.InlineNotification, Object.assign({
|
|
8076
8091
|
title: t("manage-funding:autoFunding.error.title"),
|
|
8077
8092
|
type: giger.NotificationType.ERROR
|
|
8078
8093
|
}, {
|
|
8079
|
-
children:
|
|
8094
|
+
children: autoFundingConfigErrors[0].message
|
|
8080
8095
|
}))]
|
|
8081
8096
|
})]
|
|
8082
8097
|
});
|
|
@@ -8135,14 +8150,13 @@ const CarrierBalance = ({
|
|
|
8135
8150
|
} = reactI18next.useTranslation();
|
|
8136
8151
|
const {
|
|
8137
8152
|
data: carrier,
|
|
8138
|
-
|
|
8139
|
-
isRefetching: isRefetchingCarrier
|
|
8153
|
+
isFetching: isFetchingCarrier
|
|
8140
8154
|
} = alchemy.useGetCarrierById(carrierId);
|
|
8141
8155
|
const carrierBalance = (_a = carrier === null || carrier === void 0 ? void 0 : carrier.balance) !== null && _a !== void 0 ? _a : balance;
|
|
8142
8156
|
return jsxRuntime.jsx(InlineLabel, Object.assign({
|
|
8143
8157
|
label: t("manage-funding:currentBalance")
|
|
8144
8158
|
}, {
|
|
8145
|
-
children:
|
|
8159
|
+
children: isFetchingCarrier ? jsxRuntime.jsx(giger.Spinner, {}) : jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
8146
8160
|
bold: true,
|
|
8147
8161
|
css: styles$r.getBalanceText(carrierBalance)
|
|
8148
8162
|
}, {
|
|
@@ -8517,7 +8531,7 @@ const FundAndPurchase = ({
|
|
|
8517
8531
|
const [isAddFundsFormOpen, setIsAddFundsFormOpen] = React.useState(false);
|
|
8518
8532
|
const {
|
|
8519
8533
|
data: carrier,
|
|
8520
|
-
|
|
8534
|
+
isInitialLoading: isLoadingCarrier
|
|
8521
8535
|
} = alchemy.useGetCarrierById(isPreferredRate ? undefined : carrierId);
|
|
8522
8536
|
const {
|
|
8523
8537
|
isSubmitting: isRateFormSubmitting,
|
|
@@ -8728,14 +8742,14 @@ const styles$n = createStyles({
|
|
|
8728
8742
|
verticalAlign: "top"
|
|
8729
8743
|
}),
|
|
8730
8744
|
itemName: theme => ({
|
|
8731
|
-
// Set item name to max 3 lines and truncate with ellipsis
|
|
8732
|
-
"-webkit-box-orient": "vertical",
|
|
8733
|
-
"-webkit-line-clamp": "3",
|
|
8734
8745
|
display: "-webkit-box",
|
|
8735
8746
|
lineHeight: `${theme.spacing(2.5)}px`,
|
|
8736
8747
|
maxHeight: `${theme.spacing(7.5)}px`,
|
|
8737
8748
|
overflow: "hidden",
|
|
8738
8749
|
textOverflow: "ellipsis",
|
|
8750
|
+
// Set item name to max 3 lines and truncate with ellipsis
|
|
8751
|
+
WebkitBoxOrient: "vertical",
|
|
8752
|
+
WebkitLineClamp: "3",
|
|
8739
8753
|
whiteSpace: "normal"
|
|
8740
8754
|
}),
|
|
8741
8755
|
numericCell: () => ({
|
|
@@ -8855,7 +8869,7 @@ const ManageFunding = ({
|
|
|
8855
8869
|
} = reactI18next.useTranslation();
|
|
8856
8870
|
const queryClient = reactQuery.useQueryClient();
|
|
8857
8871
|
const {
|
|
8858
|
-
|
|
8872
|
+
isInitialLoading: isLoadingCarrier
|
|
8859
8873
|
} = alchemy.useGetCarrierById(carrierId);
|
|
8860
8874
|
const [isAddFundsFormOpen, setIsAddFundsFormOpen] = React.useState(false);
|
|
8861
8875
|
return jsxRuntime.jsx(CollapsiblePanel, Object.assign({
|
|
@@ -9577,7 +9591,7 @@ const AddressPreferenceSelect = ({
|
|
|
9577
9591
|
};
|
|
9578
9592
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
9579
9593
|
children: [jsxRuntime.jsxs(giger.Grid, Object.assign({
|
|
9580
|
-
"data-testid": "
|
|
9594
|
+
"data-testid": "addressPreferenceSelect",
|
|
9581
9595
|
noPadding: true
|
|
9582
9596
|
}, {
|
|
9583
9597
|
children: [jsxRuntime.jsx(giger.GridChild, Object.assign({
|
|
@@ -9952,6 +9966,7 @@ const WalletForm = ({
|
|
|
9952
9966
|
},
|
|
9953
9967
|
resolver: validationResolver(walletSchema)
|
|
9954
9968
|
});
|
|
9969
|
+
const formSetValue = form.setValue;
|
|
9955
9970
|
useBlackboxDetection({
|
|
9956
9971
|
onError: React.useCallback(() => {
|
|
9957
9972
|
setCodedErrors(errors => {
|
|
@@ -9963,8 +9978,8 @@ const WalletForm = ({
|
|
|
9963
9978
|
};
|
|
9964
9979
|
return [...(errors !== null && errors !== void 0 ? errors : []), blackBoxError];
|
|
9965
9980
|
});
|
|
9966
|
-
}, [
|
|
9967
|
-
onSuccess: React.useCallback(bb =>
|
|
9981
|
+
}, [t]),
|
|
9982
|
+
onSuccess: React.useCallback(bb => formSetValue("iovationBlackbox", bb), [formSetValue])
|
|
9968
9983
|
});
|
|
9969
9984
|
const watchAddress = form.watch("address");
|
|
9970
9985
|
const handleSubmit = form.handleSubmit(values => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -10823,7 +10838,7 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
10823
10838
|
} : {
|
|
10824
10839
|
name: "111ty02-css",
|
|
10825
10840
|
styles: "align-items:center;display:flex;label:css;",
|
|
10826
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
10841
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxpc3QtY2FycmllcnMtcm93LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFvQmtkIiwiZmlsZSI6Imxpc3QtY2FycmllcnMtcm93LnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IF9fYXdhaXRlciB9IGZyb20gXCJ0c2xpYlwiO1xyXG5pbXBvcnQgeyBqc3ggYXMgX2pzeCwganN4cyBhcyBfanN4cyB9IGZyb20gXCJAZW1vdGlvbi9yZWFjdC9qc3gtcnVudGltZVwiO1xyXG5pbXBvcnQgeyBjc3MgfSBmcm9tIFwiQGVtb3Rpb24vcmVhY3RcIjtcclxuaW1wb3J0IHsgdXNlU3RhdGUgfSBmcm9tIFwicmVhY3RcIjtcclxuaW1wb3J0IHsgdXNlVHJhbnNsYXRpb24gfSBmcm9tIFwicmVhY3QtaTE4bmV4dFwiO1xyXG5pbXBvcnQgeyBUeXBvZ3JhcGh5IH0gZnJvbSBcIkBzaGlwZW5naW5lL2dpZ2VyXCI7XHJcbmltcG9ydCB7IExpbmtBY3Rpb24gfSBmcm9tIFwiLi4vLi4vLi4vY29tcG9uZW50cy9saW5rLWFjdGlvblwiO1xyXG5pbXBvcnQgeyBBZGRDYXJyaWVyRm9ybSB9IGZyb20gXCIuLi8uLi8uLi9jb21wb25lbnRzL3RlbXBsYXRlcy9hZGQtY2Fycmllci1mb3JtXCI7XHJcbmltcG9ydCB7IHN0eWxlcyB9IGZyb20gXCIuL2xpc3QtY2FycmllcnMtcm93LnN0eWxlc1wiO1xyXG5leHBvcnQgY29uc3QgTGlzdENhcnJpZXJzUm93ID0gKHsgY29ubmVjdGVkQ2FycmllcjogeyBjYXJyaWVyLCBpc0Nvbm5lY3RlZCB9LCByZWdpc3RlckNhcnJpZXIsIHJlZ2lzdGVyQ2FycmllckVycm9ycywgfSkgPT4ge1xyXG4gICAgY29uc3QgeyBzaG9ydG5hbWU6IG5hbWUsIGxvZ28sIHJlcXVpcmVkRmllbGRzIH0gPSBjYXJyaWVyO1xyXG4gICAgY29uc3QgeyB0IH0gPSB1c2VUcmFuc2xhdGlvbihbXCJsaXN0LWNhcnJpZXJzXCJdKTtcclxuICAgIGNvbnN0IFtzaG93RHJvcERvd24sIHNldFNob3dEcm9wRG93bl0gPSB1c2VTdGF0ZShmYWxzZSk7XHJcbiAgICBjb25zdCBbaXNTdWJtaXR0aW5nLCBzZXRJc1N1Ym1pdHRpbmddID0gdXNlU3RhdGUoZmFsc2UpO1xyXG4gICAgY29uc3QgaGFuZGxlUmVnaXN0ZXIgPSAodmFsdWVzKSA9PiBfX2F3YWl0ZXIodm9pZCAwLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHtcclxuICAgICAgICBzZXRJc1N1Ym1pdHRpbmcodHJ1ZSk7XHJcbiAgICAgICAgeWllbGQgcmVnaXN0ZXJDYXJyaWVyKHZhbHVlcyk7XHJcbiAgICAgICAgc2hvd0Ryb3BEb3duICYmIHNldFNob3dEcm9wRG93bihmYWxzZSk7XHJcbiAgICAgICAgc2V0SXNTdWJtaXR0aW5nKGZhbHNlKTtcclxuICAgIH0pO1xyXG4gICAgcmV0dXJuIChfanN4cyhcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgY3NzOiBzdHlsZXMuY29udGFpbmVyLCBcImRhdGEtdGVzdGlkXCI6IFwiY2Fycmllci1yb3dcIiB9LCB7IGNoaWxkcmVuOiBbX2pzeHMoXCJkaXZcIiwgT2JqZWN0LmFzc2lnbih7IGNzczogc3R5bGVzLnJvd0NvbnRhaW5lciB9LCB7IGNoaWxkcmVuOiBbX2pzeHMoXCJkaXZcIiwgT2JqZWN0LmFzc2lnbih7IGNzczogc3R5bGVzLmxvZ29Db250YWluZXIgfSwgeyBjaGlsZHJlbjogW19qc3goXCJkaXZcIiwgeyBjaGlsZHJlbjogX2pzeChcImltZ1wiLCB7IGFsdDogYCR7bmFtZX0tbG9nb2AsIGhlaWdodDogNDAsIHNyYzogbG9nbywgd2lkdGg6IDQwIH0pIH0pLCBfanN4KFR5cG9ncmFwaHksIE9iamVjdC5hc3NpZ24oeyB2YXJpYW50OiBcInN1YnRpdGxlMVwiIH0sIHsgY2hpbGRyZW46IG5hbWUgfSkpXSB9KSksIF9qc3goXCJkaXZcIiwgT2JqZWN0LmFzc2lnbih7IGNzczogY3NzKHsgYWxpZ25JdGVtczogXCJjZW50ZXJcIiwgZGlzcGxheTogXCJmbGV4XCIgfSkgfSwgeyBjaGlsZHJlbjogX2pzeChMaW5rQWN0aW9uLCB7IGNzczogc3R5bGVzLmdldENvbm5lY3RCdXR0b24oaXNDb25uZWN0ZWQpLCBpc0Rpc2FibGVkOiBpc0Nvbm5lY3RlZCB8fCBzaG93RHJvcERvd24sIGlzTG9hZGluZzogaXNTdWJtaXR0aW5nLCBvbkNsaWNrOiAoKSA9PiBfX2F3YWl0ZXIodm9pZCAwLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVxdWlyZWRGaWVsZHMgPT09IG51bGwgfHwgcmVxdWlyZWRGaWVsZHMgPT09IHZvaWQgMCA/IHZvaWQgMCA6IHJlcXVpcmVkRmllbGRzLmluY2x1ZGVzKFwiYWRkcmVzc1wiKSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0U2hvd0Ryb3BEb3duKHRydWUpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2VcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeWllbGQgaGFuZGxlUmVnaXN0ZXIoKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLCB0aXRsZTogaXNDb25uZWN0ZWRcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IHQoXCJsaXN0LWNhcnJpZXJzOmFjdGlvbnMuc3RhdHVzLmNvbm5lY3RlZFwiKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogdChcImxpc3QtY2FycmllcnM6YWN0aW9ucy5zdGF0dXMubm90Q29ubmVjdGVkXCIpIH0pIH0pKV0gfSkpLCBzaG93RHJvcERvd24gJiYgKF9qc3goQWRkQ2FycmllckZvcm0sIHsgY2FycmllclRlcm1zOiBjYXJyaWVyLnRlcm1zICYmIGNhcnJpZXIudGVybXMsIG9uQ2FuY2VsOiAoKSA9PiBzZXRTaG93RHJvcERvd24oZmFsc2UpLCBvblN1Ym1pdDogKHZhbHVlcykgPT4gaGFuZGxlUmVnaXN0ZXIodmFsdWVzKSwgcmVnaXN0ZXJDYXJyaWVyRXJyb3JzOiByZWdpc3RlckNhcnJpZXJFcnJvcnMgfSkpXSB9KSkpO1xyXG59O1xyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1saXN0LWNhcnJpZXJzLXJvdy5qcy5tYXAiXX0= */",
|
|
10827
10842
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
10828
10843
|
};
|
|
10829
10844
|
const ListCarriersRow = ({
|
|
@@ -11009,7 +11024,7 @@ const useListConnectedCarriers = () => {
|
|
|
11009
11024
|
const {
|
|
11010
11025
|
data: carriers,
|
|
11011
11026
|
error,
|
|
11012
|
-
|
|
11027
|
+
isInitialLoading,
|
|
11013
11028
|
refetch
|
|
11014
11029
|
} = alchemy.useListCarriers();
|
|
11015
11030
|
const carrierMetadatas = useCarrierMetadata();
|
|
@@ -11020,7 +11035,7 @@ const useListConnectedCarriers = () => {
|
|
|
11020
11035
|
isConnected: normalizedCarrierCodes.has(m.carrierCode)
|
|
11021
11036
|
})),
|
|
11022
11037
|
error: error,
|
|
11023
|
-
isLoading,
|
|
11038
|
+
isLoading: isInitialLoading,
|
|
11024
11039
|
refetch
|
|
11025
11040
|
};
|
|
11026
11041
|
};
|
|
@@ -11498,7 +11513,7 @@ const Component$5 = ({
|
|
|
11498
11513
|
const {
|
|
11499
11514
|
data: warehouses,
|
|
11500
11515
|
error: listWarehouseErrors,
|
|
11501
|
-
|
|
11516
|
+
isInitialLoading: isLoadingWarehouses,
|
|
11502
11517
|
refetch: refreshListWarehouses
|
|
11503
11518
|
} = alchemy.useListWarehouses();
|
|
11504
11519
|
const {
|
|
@@ -12960,7 +12975,7 @@ const WalletHistory = () => {
|
|
|
12960
12975
|
const queryRange = React.useMemo(() => selectedOption && selectedOption.value === "custom" && customRange ? customRange : selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.range, [customRange, selectedOption]);
|
|
12961
12976
|
const {
|
|
12962
12977
|
data: walletHistoryData,
|
|
12963
|
-
|
|
12978
|
+
isInitialLoading: isWalletHistoryDataLoading,
|
|
12964
12979
|
isFetching: isWalletHistoryFetching,
|
|
12965
12980
|
error: errors
|
|
12966
12981
|
} = alchemy.useGetWalletHistory({
|
|
@@ -13453,7 +13468,7 @@ const UnitSettings = () => {
|
|
|
13453
13468
|
const {
|
|
13454
13469
|
data: accountSettings,
|
|
13455
13470
|
error: getAccountSettingsErrors,
|
|
13456
|
-
|
|
13471
|
+
isInitialLoading: isLoadingAccountSettings,
|
|
13457
13472
|
refetch: refreshAccountSettings
|
|
13458
13473
|
} = alchemy.useGetAccountSettings();
|
|
13459
13474
|
const {
|
|
@@ -14283,9 +14298,6 @@ var en = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(O
|
|
|
14283
14298
|
* - The `<AccountSettings />` component is used to display the user's account settings, as well as
|
|
14284
14299
|
* allowing them to make changes to various aspects of their account.
|
|
14285
14300
|
*
|
|
14286
|
-
* @param onSaveSettings Any `void` function you wish to execute when the user saves any changes
|
|
14287
|
-
* to their account settings.
|
|
14288
|
-
*
|
|
14289
14301
|
* @returns Element An EmotionJSX.Element that will render the `<AccountSettings />` component
|
|
14290
14302
|
* with all the appropriate wrappers.
|
|
14291
14303
|
*
|
|
@@ -14309,8 +14321,7 @@ const Component$4 = ({
|
|
|
14309
14321
|
data: carriers
|
|
14310
14322
|
} = alchemy.useListCarriers();
|
|
14311
14323
|
return jsxRuntime.jsx(AccountSettings, {
|
|
14312
|
-
carriers: carriers
|
|
14313
|
-
onSaveSettings: onSaveSettings
|
|
14324
|
+
carriers: carriers
|
|
14314
14325
|
});
|
|
14315
14326
|
};
|
|
14316
14327
|
/**
|
|
@@ -14326,9 +14337,7 @@ const Component$4 = ({
|
|
|
14326
14337
|
* The `<Component />` is the source JSX that is rendered when you make use of the `AccountSettings`
|
|
14327
14338
|
* Element directly. Here is a brief example of how you would use it within your application.
|
|
14328
14339
|
* ```tsx
|
|
14329
|
-
* <AccountSettings.Element
|
|
14330
|
-
* onSaveSettings={() => console.log('Settings Saved!')}
|
|
14331
|
-
* />
|
|
14340
|
+
* <AccountSettings.Element/>
|
|
14332
14341
|
* ```
|
|
14333
14342
|
*
|
|
14334
14343
|
* <br />
|
|
@@ -15522,10 +15531,10 @@ const RateForm = ({
|
|
|
15522
15531
|
} finally {
|
|
15523
15532
|
// Invalidate carrier queries after the rate form is submitted, regardless of success.
|
|
15524
15533
|
// This allows the carrier balance to refresh if the purchase failed but funding succeeded.
|
|
15525
|
-
queryClient.invalidateQueries(["useGetCarrierById", selectedRate === null || selectedRate === void 0 ? void 0 : selectedRate.carrierId], {
|
|
15534
|
+
void queryClient.invalidateQueries(["useGetCarrierById", selectedRate === null || selectedRate === void 0 ? void 0 : selectedRate.carrierId], {
|
|
15526
15535
|
exact: true
|
|
15527
15536
|
});
|
|
15528
|
-
queryClient.invalidateQueries(["useListCarriers"], {
|
|
15537
|
+
void queryClient.invalidateQueries(["useListCarriers"], {
|
|
15529
15538
|
exact: true
|
|
15530
15539
|
});
|
|
15531
15540
|
}
|
|
@@ -16729,7 +16738,7 @@ const ShipmentForm = ({
|
|
|
16729
16738
|
React.useEffect(() => {
|
|
16730
16739
|
if (!requireMeasurements) {
|
|
16731
16740
|
form.resetField("packages.0.dimensions");
|
|
16732
|
-
form.trigger("packages.0.dimensions");
|
|
16741
|
+
void form.trigger("packages.0.dimensions");
|
|
16733
16742
|
}
|
|
16734
16743
|
}, [requireMeasurements, form]);
|
|
16735
16744
|
React.useEffect(() => {
|
|
@@ -17020,7 +17029,7 @@ const ShipmentForm = ({
|
|
|
17020
17029
|
children: presetCategory.options.map(preset => jsxRuntime.jsx(giger.Option, Object.assign({
|
|
17021
17030
|
onClick: () => {
|
|
17022
17031
|
onDirty(); // bypass rate cache
|
|
17023
|
-
handleApplyPreset(preset.value);
|
|
17032
|
+
void handleApplyPreset(preset.value);
|
|
17024
17033
|
},
|
|
17025
17034
|
selected: ___default["default"].isEqual(selectedPreset, preset.value),
|
|
17026
17035
|
value: JSON.stringify(preset.value)
|
|
@@ -17791,7 +17800,7 @@ const useRatesForm = ({
|
|
|
17791
17800
|
} = alchemy.useListCarriers();
|
|
17792
17801
|
const {
|
|
17793
17802
|
data: labels,
|
|
17794
|
-
|
|
17803
|
+
isInitialLoading: labelsLoading
|
|
17795
17804
|
} = alchemy.useListLabels();
|
|
17796
17805
|
const {
|
|
17797
17806
|
mutateAsync: updateShipment
|
|
@@ -18160,13 +18169,14 @@ const ConfigureShipment = _a => {
|
|
|
18160
18169
|
const _d = useShipmentForm({
|
|
18161
18170
|
compatibleCountryCodes: features === null || features === void 0 ? void 0 : features.compatibleCountryCodes,
|
|
18162
18171
|
onAddressValidation,
|
|
18163
|
-
onApplyPreset: React.useCallback((
|
|
18172
|
+
onApplyPreset: React.useCallback((preset, shipment) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18164
18173
|
var _e;
|
|
18165
18174
|
if (shipment.packages[0].weight.value) {
|
|
18166
18175
|
yield requestRates(shipment, isInternational);
|
|
18167
18176
|
}
|
|
18168
18177
|
(_e = hydrateRef.current) === null || _e === void 0 ? void 0 : _e.call(hydrateRef, shipment);
|
|
18169
|
-
|
|
18178
|
+
void (onApplyPreset === null || onApplyPreset === void 0 ? void 0 : onApplyPreset(preset, shipment));
|
|
18179
|
+
}), [onApplyPreset, requestRates, isInternational]),
|
|
18170
18180
|
onChangeAddress,
|
|
18171
18181
|
onShipmentUpdated,
|
|
18172
18182
|
onSubmit: React.useCallback(shipment => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -18233,7 +18243,7 @@ const usePendingShipment = ({
|
|
|
18233
18243
|
const {
|
|
18234
18244
|
data: shipments,
|
|
18235
18245
|
error: listShipmentsErrors,
|
|
18236
|
-
|
|
18246
|
+
isInitialLoading: isListShipmentsLoading,
|
|
18237
18247
|
isFetching: isListShipmentsValidating,
|
|
18238
18248
|
refetch: reloadShipments
|
|
18239
18249
|
} = alchemy.useListSalesOrderShipments({
|
|
@@ -18299,7 +18309,6 @@ const useConfigureShipment = ({
|
|
|
18299
18309
|
warehouseId,
|
|
18300
18310
|
printLabelLayout
|
|
18301
18311
|
}) => {
|
|
18302
|
-
var _a, _b;
|
|
18303
18312
|
const {
|
|
18304
18313
|
isPendingShipmentLoading,
|
|
18305
18314
|
pendingShipment,
|
|
@@ -18315,12 +18324,16 @@ const useConfigureShipment = ({
|
|
|
18315
18324
|
yield reloadPendingShipment();
|
|
18316
18325
|
yield onShipmentUpdated === null || onShipmentUpdated === void 0 ? void 0 : onShipmentUpdated(shipment);
|
|
18317
18326
|
}), [onShipmentUpdated, reloadPendingShipment]);
|
|
18318
|
-
const
|
|
18327
|
+
const {
|
|
18328
|
+
data: {
|
|
18329
|
+
defaultLabelLayout = "4x6"
|
|
18330
|
+
} = {}
|
|
18331
|
+
} = alchemy.useGetAccountSettings();
|
|
18319
18332
|
return {
|
|
18320
18333
|
errors: pendingShipmentErrors,
|
|
18321
18334
|
isLoading: isPendingShipmentLoading,
|
|
18322
18335
|
onShipmentUpdated: handleShipmentUpdated,
|
|
18323
|
-
printLabelLayout: printLabelLayout ? printLabelLayout :
|
|
18336
|
+
printLabelLayout: printLabelLayout ? printLabelLayout : defaultLabelLayout,
|
|
18324
18337
|
shipment: pendingShipment,
|
|
18325
18338
|
warehouseId
|
|
18326
18339
|
};
|
|
@@ -18337,7 +18350,7 @@ const useImportSalesOrder = ({
|
|
|
18337
18350
|
data: salesOrders,
|
|
18338
18351
|
error: listSalesOrdersErrors,
|
|
18339
18352
|
isFetching: isFetchingSalesOrders,
|
|
18340
|
-
|
|
18353
|
+
isInitialLoading: isInitialLoadingSalesOrders,
|
|
18341
18354
|
refetch: refetchSalesOrders
|
|
18342
18355
|
} = alchemy.useListSalesOrders({
|
|
18343
18356
|
externalOrderId,
|
|
@@ -18347,7 +18360,7 @@ const useImportSalesOrder = ({
|
|
|
18347
18360
|
data: salesOrder,
|
|
18348
18361
|
error: getSalesOrderErrors,
|
|
18349
18362
|
isFetching: isFetchingSalesOrder,
|
|
18350
|
-
|
|
18363
|
+
isInitialLoading: isInitialLoadingSalesOrder,
|
|
18351
18364
|
refetch: refetchSalesOrder
|
|
18352
18365
|
} = alchemy.useGetSalesOrder(salesOrderId !== null && salesOrderId !== void 0 ? salesOrderId : salesOrders && salesOrders[0] ? salesOrders[0].salesOrderId : undefined);
|
|
18353
18366
|
const {
|
|
@@ -18365,7 +18378,7 @@ const useImportSalesOrder = ({
|
|
|
18365
18378
|
// to handle scenarios where the sales order has not yet been imported. If the
|
|
18366
18379
|
// order source has already refreshed and there is still no matching order, bubble it up
|
|
18367
18380
|
// to the error boundary.
|
|
18368
|
-
(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
18381
|
+
void (() => __awaiter(void 0, void 0, void 0, function* () {
|
|
18369
18382
|
const selectedOrderSources = orderSourceCode ? orderSources === null || orderSources === void 0 ? void 0 : orderSources.filter(o => o.orderSourceCode.includes(orderSourceCode) && o.active) : orderSources;
|
|
18370
18383
|
if (selectedOrderSources && !salesOrder && !isFetchingSalesOrder && !isFetchingSalesOrders && !hasRefreshedOrderSource) {
|
|
18371
18384
|
yield Promise.all(selectedOrderSources.map(o => refreshOrderSource(o.orderSourceId)));
|
|
@@ -18377,7 +18390,7 @@ const useImportSalesOrder = ({
|
|
|
18377
18390
|
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 : [])];
|
|
18378
18391
|
return {
|
|
18379
18392
|
errors: errors.length > 0 ? errors : undefined,
|
|
18380
|
-
isLoading:
|
|
18393
|
+
isLoading: isInitialLoadingSalesOrder || isInitialLoadingSalesOrders || isRefreshingOrderSource || !hasRefreshedOrderSource && !salesOrder && (salesOrders === null || salesOrders === void 0 ? void 0 : salesOrders.length) === 0 && errors.length === 0,
|
|
18381
18394
|
salesOrder
|
|
18382
18395
|
};
|
|
18383
18396
|
};
|
|
@@ -18488,16 +18501,16 @@ const useGetOrCreateShipment = (onShipmentUpdated, shipmentId) => {
|
|
|
18488
18501
|
const getShipment = alchemy.useGetShipment(shipmentId !== null && shipmentId !== void 0 ? shipmentId : createdShipment === null || createdShipment === void 0 ? void 0 : createdShipment.shipmentId);
|
|
18489
18502
|
React.useEffect(() => {
|
|
18490
18503
|
if (shouldTriggerUpdate && getShipment.data) {
|
|
18491
|
-
onShipmentUpdated === null || onShipmentUpdated === void 0 ? void 0 : onShipmentUpdated(getShipment.data);
|
|
18504
|
+
void (onShipmentUpdated === null || onShipmentUpdated === void 0 ? void 0 : onShipmentUpdated(getShipment.data));
|
|
18492
18505
|
setShouldTriggerUpdate(false);
|
|
18493
18506
|
}
|
|
18494
|
-
}, [shouldTriggerUpdate, getShipment]);
|
|
18507
|
+
}, [shouldTriggerUpdate, getShipment, onShipmentUpdated]);
|
|
18495
18508
|
const errors = [...((_a = getShipment.error) !== null && _a !== void 0 ? _a : []), ...((_b = createShipment.error) !== null && _b !== void 0 ? _b : [])];
|
|
18496
18509
|
return {
|
|
18497
18510
|
errors: errors.length > 0 ? errors : undefined,
|
|
18498
18511
|
isLoading:
|
|
18499
18512
|
//bootstrap isLoading to true if one off and create shipment mutation hasn't been triggered yet
|
|
18500
|
-
!createShipment.isError && createShipment.isIdle && shipmentId === undefined || getShipment.
|
|
18513
|
+
!createShipment.isError && createShipment.isIdle && shipmentId === undefined || getShipment.isInitialLoading || createShipment.isLoading,
|
|
18501
18514
|
refetchShipment: getShipment.refetch,
|
|
18502
18515
|
shipment: getShipment.data
|
|
18503
18516
|
};
|
|
@@ -18521,7 +18534,7 @@ const PurchaseLabelByShipment = _a => {
|
|
|
18521
18534
|
};
|
|
18522
18535
|
const {
|
|
18523
18536
|
data: insuranceAccount,
|
|
18524
|
-
|
|
18537
|
+
isInitialLoading: insuranceIsLoading
|
|
18525
18538
|
} = alchemy.useGetInsuranceAccount("shipsurance");
|
|
18526
18539
|
return jsxRuntime.jsx(SuspendShipment, Object.assign({
|
|
18527
18540
|
shipment: shipment
|
|
@@ -19042,7 +19055,7 @@ const Component$1 = ({
|
|
|
19042
19055
|
const salesOrder = alchemy.useGetSalesOrder((_b = (_a = shipment.data) === null || _a === void 0 ? void 0 : _a.salesOrderIds) === null || _b === void 0 ? void 0 : _b[0]);
|
|
19043
19056
|
const warehouses = alchemy.useListWarehouses();
|
|
19044
19057
|
const carriers = alchemy.useListCarriers();
|
|
19045
|
-
if (
|
|
19058
|
+
if (shipment.isInitialLoading) return jsxRuntime.jsx(Loader, {
|
|
19046
19059
|
message: t("loading.shipment")
|
|
19047
19060
|
});
|
|
19048
19061
|
if (shipment.error) throw new Error(shipment.error.map(e => e.message).join(", "));
|
|
@@ -19262,10 +19275,10 @@ const Component = ({
|
|
|
19262
19275
|
const label = alchemy.useGetLabel(labelId);
|
|
19263
19276
|
const shipment = alchemy.useGetSalesOrderShipment((_a = label.data) === null || _a === void 0 ? void 0 : _a.shipmentId);
|
|
19264
19277
|
const voidLabel = alchemy.useVoidLabel();
|
|
19265
|
-
if (label.
|
|
19278
|
+
if (label.isInitialLoading) return jsxRuntime.jsx(Loader, {
|
|
19266
19279
|
message: t("loading.label")
|
|
19267
19280
|
});
|
|
19268
|
-
if (shipment.
|
|
19281
|
+
if (shipment.isInitialLoading) return jsxRuntime.jsx(Loader, {
|
|
19269
19282
|
message: t("loading.shipment")
|
|
19270
19283
|
});
|
|
19271
19284
|
throwAny(label.error);
|