@shipengine/elements 0.20.1 → 0.20.2
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 +253 -84
- package/index.js +251 -86
- package/package.json +3 -3
- package/src/components/accordion/accordion.d.ts +2 -1
- package/src/components/date-range-combo/date-range-combo.d.ts +12 -0
- package/src/components/date-range-combo/index.d.ts +1 -0
- package/src/components/date-range-select/date-range-select.d.ts +8 -0
- package/src/components/date-range-select/date-range-select.styles.d.ts +1 -0
- package/src/components/date-range-select/index.d.ts +1 -0
- package/src/components/history/history-body/history-body.d.ts +1 -2
- package/src/components/history/history-body/history-body.styles.d.ts +1 -0
- package/src/components/history/history.d.ts +2 -3
- package/src/components/history/index.d.ts +3 -0
- package/src/components/index.d.ts +2 -0
- package/src/components/label-layout/index.d.ts +2 -0
- package/src/components/label-layout/label-layout-purchase.d.ts +4 -3
- package/src/components/label-layout/label-layout-settings.d.ts +3 -2
- package/src/components/label-layout/label-layout.styles.d.ts +1 -1
- package/src/components/templates/add-carrier-form/add-carrier-form-schema.d.ts +1 -1
- package/src/components/templates/address-form/address-form-schema.d.ts +1 -1
- package/src/components/templates/address-form/address-schema.d.ts +2 -1
- package/src/components/templates/carrier-recovery-form/carrier-recovery-form-schema.d.ts +2 -2
- package/src/components/templates/edit-billing-form/edit-billing-form.styles.d.ts +1 -1
- package/src/components/templates/wallet-card/wallet-card.styles.d.ts +1 -1
- package/src/components/templates/wallet-form/wallet-schema.d.ts +2 -2
- package/src/components/templates/warehouse-form/warehouse-form-schema.d.ts +3 -3
- package/src/components/unit-settings/index.d.ts +1 -0
- package/src/components/unit-settings/unit-settings.d.ts +4 -0
- package/src/hooks/options/index.d.ts +1 -0
- package/src/hooks/options/use-date-range-options.d.ts +14 -0
- package/src/locales/en/index.d.ts +19 -3
- package/src/utilities/date.d.ts +8 -0
- package/src/components/history/history-actions/history-actions.d.ts +0 -1
- package/src/components/history/history-actions/history-actions.styles.d.ts +0 -1
- package/src/components/history/history-actions/index.d.ts +0 -1
package/index.cjs
CHANGED
|
@@ -1846,6 +1846,17 @@ const isNowOrInTheFuture = shipDate => {
|
|
|
1846
1846
|
if (shipDate) return new Date(shipDate) >= new Date();
|
|
1847
1847
|
return false;
|
|
1848
1848
|
};
|
|
1849
|
+
const getRelativeDates = from => {
|
|
1850
|
+
const origin = from !== null && from !== void 0 ? from : new Date();
|
|
1851
|
+
return {
|
|
1852
|
+
firstDayOfMonth: new Date(origin.getFullYear(), origin.getMonth(), 1),
|
|
1853
|
+
lastDayOfTheMonth: new Date(origin.getFullYear(), origin.getMonth() + 1, 0),
|
|
1854
|
+
origin,
|
|
1855
|
+
previousMonthFirstDay: new Date(origin.getFullYear(), origin.getMonth() - 1, 1),
|
|
1856
|
+
previousMonthLastDay: new Date(origin.getFullYear(), origin.getMonth() - 1 + 1, 0),
|
|
1857
|
+
thirtyDaysAgo: new Date(new Date().setDate(origin.getDate() - 30))
|
|
1858
|
+
};
|
|
1859
|
+
};
|
|
1849
1860
|
|
|
1850
1861
|
/**
|
|
1851
1862
|
* @category Utilities
|
|
@@ -5026,6 +5037,37 @@ const useCustomsNonDeliveryOptions = () => {
|
|
|
5026
5037
|
})), [t]);
|
|
5027
5038
|
};
|
|
5028
5039
|
|
|
5040
|
+
/**
|
|
5041
|
+
* A curated list of date range options relative to the immediate date
|
|
5042
|
+
*/
|
|
5043
|
+
const useDateRangeOptions = () => {
|
|
5044
|
+
const {
|
|
5045
|
+
t
|
|
5046
|
+
} = reactI18next.useTranslation();
|
|
5047
|
+
const relativeDates = React.useMemo(() => getRelativeDates(), []);
|
|
5048
|
+
const options = React.useMemo(() => [{
|
|
5049
|
+
label: t("wallet-history:historyOptions.custom"),
|
|
5050
|
+
range: undefined,
|
|
5051
|
+
value: "custom"
|
|
5052
|
+
}, {
|
|
5053
|
+
label: t("wallet-history:historyOptions.last30days"),
|
|
5054
|
+
range: [relativeDates.thirtyDaysAgo, relativeDates.origin],
|
|
5055
|
+
value: "last30days"
|
|
5056
|
+
}, {
|
|
5057
|
+
label: t("wallet-history:historyOptions.thisMonth"),
|
|
5058
|
+
range: [relativeDates.firstDayOfMonth, relativeDates.lastDayOfTheMonth],
|
|
5059
|
+
value: "thisMonth"
|
|
5060
|
+
}, {
|
|
5061
|
+
label: t("wallet-history:historyOptions.lastMonth"),
|
|
5062
|
+
range: [relativeDates.previousMonthFirstDay, relativeDates.previousMonthLastDay],
|
|
5063
|
+
value: "lastMonth"
|
|
5064
|
+
}], [relativeDates, t]);
|
|
5065
|
+
const optionsByValue = createDictionary(options, o => ({
|
|
5066
|
+
[o.value]: o
|
|
5067
|
+
}));
|
|
5068
|
+
return [options, optionsByValue];
|
|
5069
|
+
};
|
|
5070
|
+
|
|
5029
5071
|
const useExpirationMonthOptions = () => {
|
|
5030
5072
|
const {
|
|
5031
5073
|
t
|
|
@@ -6120,14 +6162,15 @@ fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNa
|
|
|
6120
6162
|
});
|
|
6121
6163
|
|
|
6122
6164
|
extendZod();
|
|
6123
|
-
const refineName = n => n.match(/^[a-zA-Z]{2,} [a-zA-Z]{2,}/);
|
|
6165
|
+
const refineName = n => n.match(/^[a-zA-Z']{2,} [a-zA-Z']{2,}/);
|
|
6124
6166
|
const addressLine1Schema = zod.z.string().trim().min(1);
|
|
6125
6167
|
const addressLine2Schema = zod.z.string().trim().nullishDefault(undefined);
|
|
6168
|
+
const companyNameSchema = zod.z.string().trim().min(2).max(40).nullishDefault(undefined).or(zod.z.literal("")).transform(companyName => companyName || undefined);
|
|
6126
6169
|
const addressSchema = zod.z.object({
|
|
6127
6170
|
addressLine1: addressLine1Schema,
|
|
6128
6171
|
addressLine2: addressLine2Schema,
|
|
6129
6172
|
cityLocality: zod.z.string().trim().min(1),
|
|
6130
|
-
companyName:
|
|
6173
|
+
companyName: companyNameSchema,
|
|
6131
6174
|
countryCode: zod.z.enum(countryCodes),
|
|
6132
6175
|
name: zod.z.string().trim().min(1).refine(refineName, "schemaErrors.invalidAddressName"),
|
|
6133
6176
|
phone: zod.z.string().trim().nullishDefault(""),
|
|
@@ -7465,37 +7508,38 @@ const getAccordionSummaryStyles = theme => /*#__PURE__*/react$1.css({
|
|
|
7465
7508
|
listStyle: "none",
|
|
7466
7509
|
padding: `${theme.spacing()}px ${theme.spacing(4)}px`,
|
|
7467
7510
|
width: "100%"
|
|
7468
|
-
}, process.env.NODE_ENV === "production" ? "" : ";label:getAccordionSummaryStyles;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFjY29yZGlvbi5zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ29EIiwiZmlsZSI6ImFjY29yZGlvbi5zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBjc3MgfSBmcm9tIFwiQGVtb3Rpb24vcmVhY3RcIjtcclxuZXhwb3J0IGNvbnN0IGdldEFjY29yZGlvblN1bW1hcnlTdHlsZXMgPSAodGhlbWUpID0+IGNzcyh7XHJcbiAgICAvLyBOZWVkZWQgdG8gaGlkZSBtYXJrZXIgaW4gc2FmYXJpXHJcbiAgICBcIiY6Oi13ZWJraXQtZGV0YWlscy1tYXJrZXJcIjoge1xyXG4gICAgICAgIGRpc3BsYXk6IFwibm9uZVwiLFxyXG4gICAgfSxcclxuICAgIFwiJjo6bWFya2VyXCI6IHtcclxuICAgICAgICBjb250ZW50OiAnXCJcIicsXHJcbiAgICB9LFxyXG4gICAgYmFja2dyb3VuZENvbG9yOiB0aGVtZS5wYWxldHRlLmdyYXkudWx0cmFMaWdodCxcclxuICAgIGJveFNpemluZzogXCJib3JkZXItYm94XCIsXHJcbiAgICBsaXN0U3R5bGU6IFwibm9uZVwiLFxyXG4gICAgcGFkZGluZzogYCR7dGhlbWUuc3BhY2luZygpfXB4ICR7dGhlbWUuc3BhY2luZyg0KX1weGAsXHJcbiAgICB3aWR0aDogXCIxMDAlXCIsXHJcbn0pO1xyXG5leHBvcnQgY29uc3QgZ2V0QWNjb3JkaW9uU3VtbWFyeVdyYXBwZXJTdHlsZXMgPSAodGhlbWUpID0+
|
|
7511
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:getAccordionSummaryStyles;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFjY29yZGlvbi5zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ29EIiwiZmlsZSI6ImFjY29yZGlvbi5zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBjc3MgfSBmcm9tIFwiQGVtb3Rpb24vcmVhY3RcIjtcclxuZXhwb3J0IGNvbnN0IGdldEFjY29yZGlvblN1bW1hcnlTdHlsZXMgPSAodGhlbWUpID0+IGNzcyh7XHJcbiAgICAvLyBOZWVkZWQgdG8gaGlkZSBtYXJrZXIgaW4gc2FmYXJpXHJcbiAgICBcIiY6Oi13ZWJraXQtZGV0YWlscy1tYXJrZXJcIjoge1xyXG4gICAgICAgIGRpc3BsYXk6IFwibm9uZVwiLFxyXG4gICAgfSxcclxuICAgIFwiJjo6bWFya2VyXCI6IHtcclxuICAgICAgICBjb250ZW50OiAnXCJcIicsXHJcbiAgICB9LFxyXG4gICAgYmFja2dyb3VuZENvbG9yOiB0aGVtZS5wYWxldHRlLmdyYXkudWx0cmFMaWdodCxcclxuICAgIGJveFNpemluZzogXCJib3JkZXItYm94XCIsXHJcbiAgICBsaXN0U3R5bGU6IFwibm9uZVwiLFxyXG4gICAgcGFkZGluZzogYCR7dGhlbWUuc3BhY2luZygpfXB4ICR7dGhlbWUuc3BhY2luZyg0KX1weGAsXHJcbiAgICB3aWR0aDogXCIxMDAlXCIsXHJcbn0pO1xyXG5leHBvcnQgY29uc3QgZ2V0QWNjb3JkaW9uU3VtbWFyeVdyYXBwZXJTdHlsZXMgPSAodGhlbWUpID0+IGNzcyh7XHJcbiAgICBhbGlnbkl0ZW1zOiBcImNlbnRlclwiLFxyXG4gICAgY29sb3I6IHRoZW1lLnBhbGV0dGUuYmxhY2ssXHJcbiAgICBkaXNwbGF5OiBcImZsZXhcIixcclxuICAgIHdpZHRoOiBcIjEwMCVcIixcclxufSk7XHJcbmV4cG9ydCBjb25zdCBnZXRJY29uU3R5bGVzID0gKHRoZW1lKSA9PiBjc3Moe1xyXG4gICAgY29sb3I6IHRoZW1lLnBhbGV0dGUucHJpbWFyeS5tYWluLFxyXG4gICAgbWFyZ2luUmlnaHQ6IHRoZW1lLnNwYWNpbmcoMiksXHJcbn0pO1xyXG5leHBvcnQgY29uc3QgZ2V0U2VjdGlvblN0eWxlcyA9ICh0aGVtZSkgPT4gY3NzKHtcclxuICAgIGJveFNpemluZzogXCJib3JkZXItYm94XCIsXHJcbiAgICBwYWRkaW5nOiBgJHt0aGVtZS5zcGFjaW5nKDMpfXB4ICR7dGhlbWUuc3BhY2luZyg0KX1weGAsXHJcbiAgICB3aWR0aDogXCIxMDAlXCIsXHJcbn0pO1xyXG5leHBvcnQgY29uc3QgZ2V0UmlnaHRDb250ZW50V3JhcHBlclN0eWxlcyA9ICgpID0+IGNzcyh7XHJcbiAgICBtYXJnaW5MZWZ0OiBcImF1dG9cIixcclxufSk7XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPWFjY29yZGlvbi5zdHlsZXMuanMubWFwIl19 */");
|
|
7469
7512
|
const getAccordionSummaryWrapperStyles = theme => /*#__PURE__*/react$1.css({
|
|
7470
7513
|
alignItems: "center",
|
|
7471
7514
|
color: theme.palette.black,
|
|
7472
7515
|
display: "flex",
|
|
7473
7516
|
width: "100%"
|
|
7474
|
-
}, process.env.NODE_ENV === "production" ? "" : ";label:getAccordionSummaryWrapperStyles;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFjY29yZGlvbi5zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBZTJEIiwiZmlsZSI6ImFjY29yZGlvbi5zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBjc3MgfSBmcm9tIFwiQGVtb3Rpb24vcmVhY3RcIjtcclxuZXhwb3J0IGNvbnN0IGdldEFjY29yZGlvblN1bW1hcnlTdHlsZXMgPSAodGhlbWUpID0+IGNzcyh7XHJcbiAgICAvLyBOZWVkZWQgdG8gaGlkZSBtYXJrZXIgaW4gc2FmYXJpXHJcbiAgICBcIiY6Oi13ZWJraXQtZGV0YWlscy1tYXJrZXJcIjoge1xyXG4gICAgICAgIGRpc3BsYXk6IFwibm9uZVwiLFxyXG4gICAgfSxcclxuICAgIFwiJjo6bWFya2VyXCI6IHtcclxuICAgICAgICBjb250ZW50OiAnXCJcIicsXHJcbiAgICB9LFxyXG4gICAgYmFja2dyb3VuZENvbG9yOiB0aGVtZS5wYWxldHRlLmdyYXkudWx0cmFMaWdodCxcclxuICAgIGJveFNpemluZzogXCJib3JkZXItYm94XCIsXHJcbiAgICBsaXN0U3R5bGU6IFwibm9uZVwiLFxyXG4gICAgcGFkZGluZzogYCR7dGhlbWUuc3BhY2luZygpfXB4ICR7dGhlbWUuc3BhY2luZyg0KX1weGAsXHJcbiAgICB3aWR0aDogXCIxMDAlXCIsXHJcbn0pO1xyXG5leHBvcnQgY29uc3QgZ2V0QWNjb3JkaW9uU3VtbWFyeVdyYXBwZXJTdHlsZXMgPSAodGhlbWUpID0+
|
|
7517
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:getAccordionSummaryWrapperStyles;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFjY29yZGlvbi5zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBZTJEIiwiZmlsZSI6ImFjY29yZGlvbi5zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBjc3MgfSBmcm9tIFwiQGVtb3Rpb24vcmVhY3RcIjtcclxuZXhwb3J0IGNvbnN0IGdldEFjY29yZGlvblN1bW1hcnlTdHlsZXMgPSAodGhlbWUpID0+IGNzcyh7XHJcbiAgICAvLyBOZWVkZWQgdG8gaGlkZSBtYXJrZXIgaW4gc2FmYXJpXHJcbiAgICBcIiY6Oi13ZWJraXQtZGV0YWlscy1tYXJrZXJcIjoge1xyXG4gICAgICAgIGRpc3BsYXk6IFwibm9uZVwiLFxyXG4gICAgfSxcclxuICAgIFwiJjo6bWFya2VyXCI6IHtcclxuICAgICAgICBjb250ZW50OiAnXCJcIicsXHJcbiAgICB9LFxyXG4gICAgYmFja2dyb3VuZENvbG9yOiB0aGVtZS5wYWxldHRlLmdyYXkudWx0cmFMaWdodCxcclxuICAgIGJveFNpemluZzogXCJib3JkZXItYm94XCIsXHJcbiAgICBsaXN0U3R5bGU6IFwibm9uZVwiLFxyXG4gICAgcGFkZGluZzogYCR7dGhlbWUuc3BhY2luZygpfXB4ICR7dGhlbWUuc3BhY2luZyg0KX1weGAsXHJcbiAgICB3aWR0aDogXCIxMDAlXCIsXHJcbn0pO1xyXG5leHBvcnQgY29uc3QgZ2V0QWNjb3JkaW9uU3VtbWFyeVdyYXBwZXJTdHlsZXMgPSAodGhlbWUpID0+IGNzcyh7XHJcbiAgICBhbGlnbkl0ZW1zOiBcImNlbnRlclwiLFxyXG4gICAgY29sb3I6IHRoZW1lLnBhbGV0dGUuYmxhY2ssXHJcbiAgICBkaXNwbGF5OiBcImZsZXhcIixcclxuICAgIHdpZHRoOiBcIjEwMCVcIixcclxufSk7XHJcbmV4cG9ydCBjb25zdCBnZXRJY29uU3R5bGVzID0gKHRoZW1lKSA9PiBjc3Moe1xyXG4gICAgY29sb3I6IHRoZW1lLnBhbGV0dGUucHJpbWFyeS5tYWluLFxyXG4gICAgbWFyZ2luUmlnaHQ6IHRoZW1lLnNwYWNpbmcoMiksXHJcbn0pO1xyXG5leHBvcnQgY29uc3QgZ2V0U2VjdGlvblN0eWxlcyA9ICh0aGVtZSkgPT4gY3NzKHtcclxuICAgIGJveFNpemluZzogXCJib3JkZXItYm94XCIsXHJcbiAgICBwYWRkaW5nOiBgJHt0aGVtZS5zcGFjaW5nKDMpfXB4ICR7dGhlbWUuc3BhY2luZyg0KX1weGAsXHJcbiAgICB3aWR0aDogXCIxMDAlXCIsXHJcbn0pO1xyXG5leHBvcnQgY29uc3QgZ2V0UmlnaHRDb250ZW50V3JhcHBlclN0eWxlcyA9ICgpID0+IGNzcyh7XHJcbiAgICBtYXJnaW5MZWZ0OiBcImF1dG9cIixcclxufSk7XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPWFjY29yZGlvbi5zdHlsZXMuanMubWFwIl19 */");
|
|
7475
7518
|
const getSectionStyles = theme => /*#__PURE__*/react$1.css({
|
|
7476
7519
|
boxSizing: "border-box",
|
|
7477
|
-
padding: theme.spacing(4)
|
|
7520
|
+
padding: `${theme.spacing(3)}px ${theme.spacing(4)}px`,
|
|
7478
7521
|
width: "100%"
|
|
7479
|
-
}, process.env.NODE_ENV === "production" ? "" : ";label:getSectionStyles;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFjY29yZGlvbi5zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBeUIyQyIsImZpbGUiOiJhY2NvcmRpb24uc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSBcIkBlbW90aW9uL3JlYWN0XCI7XHJcbmV4cG9ydCBjb25zdCBnZXRBY2NvcmRpb25TdW1tYXJ5U3R5bGVzID0gKHRoZW1lKSA9PiBjc3Moe1xyXG4gICAgLy8gTmVlZGVkIHRvIGhpZGUgbWFya2VyIGluIHNhZmFyaVxyXG4gICAgXCImOjotd2Via2l0LWRldGFpbHMtbWFya2VyXCI6IHtcclxuICAgICAgICBkaXNwbGF5OiBcIm5vbmVcIixcclxuICAgIH0sXHJcbiAgICBcIiY6Om1hcmtlclwiOiB7XHJcbiAgICAgICAgY29udGVudDogJ1wiXCInLFxyXG4gICAgfSxcclxuICAgIGJhY2tncm91bmRDb2xvcjogdGhlbWUucGFsZXR0ZS5ncmF5LnVsdHJhTGlnaHQsXHJcbiAgICBib3hTaXppbmc6IFwiYm9yZGVyLWJveFwiLFxyXG4gICAgbGlzdFN0eWxlOiBcIm5vbmVcIixcclxuICAgIHBhZGRpbmc6IGAke3RoZW1lLnNwYWNpbmcoKX1weCAke3RoZW1lLnNwYWNpbmcoNCl9cHhgLFxyXG4gICAgd2lkdGg6IFwiMTAwJVwiLFxyXG59KTtcclxuZXhwb3J0IGNvbnN0IGdldEFjY29yZGlvblN1bW1hcnlXcmFwcGVyU3R5bGVzID0gKHRoZW1lKSA9PiBjc3Moe1xyXG4gICAgYWxpZ25JdGVtczogXCJjZW50ZXJcIixcclxuICAgIGNvbG9yOiB0aGVtZS5wYWxldHRlLmJsYWNrLFxyXG4gICAgZGlzcGxheTogXCJmbGV4XCIsXHJcbiAgICB3aWR0aDogXCIxMDAlXCIsXHJcbn0pO1xyXG5leHBvcnQgY29uc3QgZ2V0SWNvblN0eWxlcyA9ICh0aGVtZSkgPT4gY3NzKHtcclxuICAgIGNvbG9yOiB0aGVtZS5wYWxldHRlLnByaW1hcnkubWFpbixcclxuICAgIG1hcmdpblJpZ2h0OiB0aGVtZS5zcGFjaW5nKDIpLFxyXG59KTtcclxuZXhwb3J0IGNvbnN0IGdldFNlY3Rpb25TdHlsZXMgPSAodGhlbWUpID0+
|
|
7522
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:getSectionStyles;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFjY29yZGlvbi5zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBeUIyQyIsImZpbGUiOiJhY2NvcmRpb24uc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSBcIkBlbW90aW9uL3JlYWN0XCI7XHJcbmV4cG9ydCBjb25zdCBnZXRBY2NvcmRpb25TdW1tYXJ5U3R5bGVzID0gKHRoZW1lKSA9PiBjc3Moe1xyXG4gICAgLy8gTmVlZGVkIHRvIGhpZGUgbWFya2VyIGluIHNhZmFyaVxyXG4gICAgXCImOjotd2Via2l0LWRldGFpbHMtbWFya2VyXCI6IHtcclxuICAgICAgICBkaXNwbGF5OiBcIm5vbmVcIixcclxuICAgIH0sXHJcbiAgICBcIiY6Om1hcmtlclwiOiB7XHJcbiAgICAgICAgY29udGVudDogJ1wiXCInLFxyXG4gICAgfSxcclxuICAgIGJhY2tncm91bmRDb2xvcjogdGhlbWUucGFsZXR0ZS5ncmF5LnVsdHJhTGlnaHQsXHJcbiAgICBib3hTaXppbmc6IFwiYm9yZGVyLWJveFwiLFxyXG4gICAgbGlzdFN0eWxlOiBcIm5vbmVcIixcclxuICAgIHBhZGRpbmc6IGAke3RoZW1lLnNwYWNpbmcoKX1weCAke3RoZW1lLnNwYWNpbmcoNCl9cHhgLFxyXG4gICAgd2lkdGg6IFwiMTAwJVwiLFxyXG59KTtcclxuZXhwb3J0IGNvbnN0IGdldEFjY29yZGlvblN1bW1hcnlXcmFwcGVyU3R5bGVzID0gKHRoZW1lKSA9PiBjc3Moe1xyXG4gICAgYWxpZ25JdGVtczogXCJjZW50ZXJcIixcclxuICAgIGNvbG9yOiB0aGVtZS5wYWxldHRlLmJsYWNrLFxyXG4gICAgZGlzcGxheTogXCJmbGV4XCIsXHJcbiAgICB3aWR0aDogXCIxMDAlXCIsXHJcbn0pO1xyXG5leHBvcnQgY29uc3QgZ2V0SWNvblN0eWxlcyA9ICh0aGVtZSkgPT4gY3NzKHtcclxuICAgIGNvbG9yOiB0aGVtZS5wYWxldHRlLnByaW1hcnkubWFpbixcclxuICAgIG1hcmdpblJpZ2h0OiB0aGVtZS5zcGFjaW5nKDIpLFxyXG59KTtcclxuZXhwb3J0IGNvbnN0IGdldFNlY3Rpb25TdHlsZXMgPSAodGhlbWUpID0+IGNzcyh7XHJcbiAgICBib3hTaXppbmc6IFwiYm9yZGVyLWJveFwiLFxyXG4gICAgcGFkZGluZzogYCR7dGhlbWUuc3BhY2luZygzKX1weCAke3RoZW1lLnNwYWNpbmcoNCl9cHhgLFxyXG4gICAgd2lkdGg6IFwiMTAwJVwiLFxyXG59KTtcclxuZXhwb3J0IGNvbnN0IGdldFJpZ2h0Q29udGVudFdyYXBwZXJTdHlsZXMgPSAoKSA9PiBjc3Moe1xyXG4gICAgbWFyZ2luTGVmdDogXCJhdXRvXCIsXHJcbn0pO1xyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1hY2NvcmRpb24uc3R5bGVzLmpzLm1hcCJdfQ== */");
|
|
7480
7523
|
var _ref$2 = process.env.NODE_ENV === "production" ? {
|
|
7481
7524
|
name: "1o3nkn",
|
|
7482
7525
|
styles: "margin-left:auto"
|
|
7483
7526
|
} : {
|
|
7484
7527
|
name: "14rm3c-getRightContentWrapperStyles",
|
|
7485
7528
|
styles: "margin-left:auto;label:getRightContentWrapperStyles;",
|
|
7486
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFjY29yZGlvbi5zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBOEJrRCIsImZpbGUiOiJhY2NvcmRpb24uc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSBcIkBlbW90aW9uL3JlYWN0XCI7XHJcbmV4cG9ydCBjb25zdCBnZXRBY2NvcmRpb25TdW1tYXJ5U3R5bGVzID0gKHRoZW1lKSA9PiBjc3Moe1xyXG4gICAgLy8gTmVlZGVkIHRvIGhpZGUgbWFya2VyIGluIHNhZmFyaVxyXG4gICAgXCImOjotd2Via2l0LWRldGFpbHMtbWFya2VyXCI6IHtcclxuICAgICAgICBkaXNwbGF5OiBcIm5vbmVcIixcclxuICAgIH0sXHJcbiAgICBcIiY6Om1hcmtlclwiOiB7XHJcbiAgICAgICAgY29udGVudDogJ1wiXCInLFxyXG4gICAgfSxcclxuICAgIGJhY2tncm91bmRDb2xvcjogdGhlbWUucGFsZXR0ZS5ncmF5LnVsdHJhTGlnaHQsXHJcbiAgICBib3hTaXppbmc6IFwiYm9yZGVyLWJveFwiLFxyXG4gICAgbGlzdFN0eWxlOiBcIm5vbmVcIixcclxuICAgIHBhZGRpbmc6IGAke3RoZW1lLnNwYWNpbmcoKX1weCAke3RoZW1lLnNwYWNpbmcoNCl9cHhgLFxyXG4gICAgd2lkdGg6IFwiMTAwJVwiLFxyXG59KTtcclxuZXhwb3J0IGNvbnN0IGdldEFjY29yZGlvblN1bW1hcnlXcmFwcGVyU3R5bGVzID0gKHRoZW1lKSA9PiBjc3Moe1xyXG4gICAgYWxpZ25JdGVtczogXCJjZW50ZXJcIixcclxuICAgIGNvbG9yOiB0aGVtZS5wYWxldHRlLmJsYWNrLFxyXG4gICAgZGlzcGxheTogXCJmbGV4XCIsXHJcbiAgICB3aWR0aDogXCIxMDAlXCIsXHJcbn0pO1xyXG5leHBvcnQgY29uc3QgZ2V0SWNvblN0eWxlcyA9ICh0aGVtZSkgPT4gY3NzKHtcclxuICAgIGNvbG9yOiB0aGVtZS5wYWxldHRlLnByaW1hcnkubWFpbixcclxuICAgIG1hcmdpblJpZ2h0OiB0aGVtZS5zcGFjaW5nKDIpLFxyXG59KTtcclxuZXhwb3J0IGNvbnN0IGdldFNlY3Rpb25TdHlsZXMgPSAodGhlbWUpID0+
|
|
7529
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFjY29yZGlvbi5zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBOEJrRCIsImZpbGUiOiJhY2NvcmRpb24uc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSBcIkBlbW90aW9uL3JlYWN0XCI7XHJcbmV4cG9ydCBjb25zdCBnZXRBY2NvcmRpb25TdW1tYXJ5U3R5bGVzID0gKHRoZW1lKSA9PiBjc3Moe1xyXG4gICAgLy8gTmVlZGVkIHRvIGhpZGUgbWFya2VyIGluIHNhZmFyaVxyXG4gICAgXCImOjotd2Via2l0LWRldGFpbHMtbWFya2VyXCI6IHtcclxuICAgICAgICBkaXNwbGF5OiBcIm5vbmVcIixcclxuICAgIH0sXHJcbiAgICBcIiY6Om1hcmtlclwiOiB7XHJcbiAgICAgICAgY29udGVudDogJ1wiXCInLFxyXG4gICAgfSxcclxuICAgIGJhY2tncm91bmRDb2xvcjogdGhlbWUucGFsZXR0ZS5ncmF5LnVsdHJhTGlnaHQsXHJcbiAgICBib3hTaXppbmc6IFwiYm9yZGVyLWJveFwiLFxyXG4gICAgbGlzdFN0eWxlOiBcIm5vbmVcIixcclxuICAgIHBhZGRpbmc6IGAke3RoZW1lLnNwYWNpbmcoKX1weCAke3RoZW1lLnNwYWNpbmcoNCl9cHhgLFxyXG4gICAgd2lkdGg6IFwiMTAwJVwiLFxyXG59KTtcclxuZXhwb3J0IGNvbnN0IGdldEFjY29yZGlvblN1bW1hcnlXcmFwcGVyU3R5bGVzID0gKHRoZW1lKSA9PiBjc3Moe1xyXG4gICAgYWxpZ25JdGVtczogXCJjZW50ZXJcIixcclxuICAgIGNvbG9yOiB0aGVtZS5wYWxldHRlLmJsYWNrLFxyXG4gICAgZGlzcGxheTogXCJmbGV4XCIsXHJcbiAgICB3aWR0aDogXCIxMDAlXCIsXHJcbn0pO1xyXG5leHBvcnQgY29uc3QgZ2V0SWNvblN0eWxlcyA9ICh0aGVtZSkgPT4gY3NzKHtcclxuICAgIGNvbG9yOiB0aGVtZS5wYWxldHRlLnByaW1hcnkubWFpbixcclxuICAgIG1hcmdpblJpZ2h0OiB0aGVtZS5zcGFjaW5nKDIpLFxyXG59KTtcclxuZXhwb3J0IGNvbnN0IGdldFNlY3Rpb25TdHlsZXMgPSAodGhlbWUpID0+IGNzcyh7XHJcbiAgICBib3hTaXppbmc6IFwiYm9yZGVyLWJveFwiLFxyXG4gICAgcGFkZGluZzogYCR7dGhlbWUuc3BhY2luZygzKX1weCAke3RoZW1lLnNwYWNpbmcoNCl9cHhgLFxyXG4gICAgd2lkdGg6IFwiMTAwJVwiLFxyXG59KTtcclxuZXhwb3J0IGNvbnN0IGdldFJpZ2h0Q29udGVudFdyYXBwZXJTdHlsZXMgPSAoKSA9PiBjc3Moe1xyXG4gICAgbWFyZ2luTGVmdDogXCJhdXRvXCIsXHJcbn0pO1xyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1hY2NvcmRpb24uc3R5bGVzLmpzLm1hcCJdfQ== */",
|
|
7487
7530
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__$3
|
|
7488
7531
|
};
|
|
7489
7532
|
const getRightContentWrapperStyles = () => _ref$2;
|
|
7490
7533
|
|
|
7491
7534
|
const Accordion = _a => {
|
|
7492
7535
|
var {
|
|
7536
|
+
bold,
|
|
7493
7537
|
initialExpanded,
|
|
7494
7538
|
title,
|
|
7495
7539
|
children,
|
|
7496
7540
|
rightContent
|
|
7497
7541
|
} = _a,
|
|
7498
|
-
rest = __rest(_a, ["initialExpanded", "title", "children", "rightContent"]);
|
|
7542
|
+
rest = __rest(_a, ["bold", "initialExpanded", "title", "children", "rightContent"]);
|
|
7499
7543
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
7500
7544
|
children: [title && jsxRuntime.jsx("summary", Object.assign({
|
|
7501
7545
|
css: getAccordionSummaryStyles
|
|
@@ -7504,6 +7548,7 @@ const Accordion = _a => {
|
|
|
7504
7548
|
css: getAccordionSummaryWrapperStyles
|
|
7505
7549
|
}, {
|
|
7506
7550
|
children: [jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
7551
|
+
bold: bold,
|
|
7507
7552
|
variant: "heading5"
|
|
7508
7553
|
}, {
|
|
7509
7554
|
children: title
|
|
@@ -7521,7 +7566,7 @@ const Accordion = _a => {
|
|
|
7521
7566
|
});
|
|
7522
7567
|
};
|
|
7523
7568
|
|
|
7524
|
-
const getStyles$
|
|
7569
|
+
const getStyles$5 = (isConnected = false) => createStyles({
|
|
7525
7570
|
connectButton: theme => [{
|
|
7526
7571
|
padding: `0 ${theme.spacing(.5)}px`
|
|
7527
7572
|
}, isConnected && {
|
|
@@ -7581,14 +7626,14 @@ const ListCarriersRow = ({
|
|
|
7581
7626
|
setIsSubmitting(false);
|
|
7582
7627
|
});
|
|
7583
7628
|
return jsxRuntime.jsxs("div", Object.assign({
|
|
7584
|
-
css: getStyles$
|
|
7629
|
+
css: getStyles$5().container,
|
|
7585
7630
|
"data-testid": "carrier-row"
|
|
7586
7631
|
}, {
|
|
7587
7632
|
children: [jsxRuntime.jsxs("div", Object.assign({
|
|
7588
|
-
css: getStyles$
|
|
7633
|
+
css: getStyles$5().rowContainer
|
|
7589
7634
|
}, {
|
|
7590
7635
|
children: [jsxRuntime.jsxs("div", Object.assign({
|
|
7591
|
-
css: getStyles$
|
|
7636
|
+
css: getStyles$5().logoContainer
|
|
7592
7637
|
}, {
|
|
7593
7638
|
children: [jsxRuntime.jsx("div", {
|
|
7594
7639
|
children: jsxRuntime.jsx("img", {
|
|
@@ -7606,7 +7651,7 @@ const ListCarriersRow = ({
|
|
|
7606
7651
|
css: _ref$1
|
|
7607
7652
|
}, {
|
|
7608
7653
|
children: jsxRuntime.jsx(LinkAction, {
|
|
7609
|
-
css: getStyles$
|
|
7654
|
+
css: getStyles$5(isConnected).connectButton,
|
|
7610
7655
|
isDisabled: isConnected || showDropDown,
|
|
7611
7656
|
isLoading: isSubmitting,
|
|
7612
7657
|
onClick: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -10077,7 +10122,7 @@ const Loader = props => {
|
|
|
10077
10122
|
}));
|
|
10078
10123
|
};
|
|
10079
10124
|
|
|
10080
|
-
const getStyles$
|
|
10125
|
+
const getStyles$4 = ({
|
|
10081
10126
|
isDisabled,
|
|
10082
10127
|
isSelected
|
|
10083
10128
|
} = {}) => createStyles({
|
|
@@ -10188,7 +10233,7 @@ const AddFundsForm = ({
|
|
|
10188
10233
|
})), jsxRuntime.jsx(Spacer, {
|
|
10189
10234
|
multiplier: 2
|
|
10190
10235
|
}), jsxRuntime.jsx(giger.ChipList, Object.assign({
|
|
10191
|
-
css: getStyles$
|
|
10236
|
+
css: getStyles$4().chipList,
|
|
10192
10237
|
onChange: idx => {
|
|
10193
10238
|
const chip = chips[idx];
|
|
10194
10239
|
setSelectedChip(chip);
|
|
@@ -10203,7 +10248,7 @@ const AddFundsForm = ({
|
|
|
10203
10248
|
}
|
|
10204
10249
|
}, {
|
|
10205
10250
|
children: chips.map(chip => jsxRuntime.jsx(giger.Chip, Object.assign({
|
|
10206
|
-
css: getStyles$
|
|
10251
|
+
css: getStyles$4({
|
|
10207
10252
|
isDisabled: chip.value < _minimumAmount,
|
|
10208
10253
|
isSelected: chip.value === selectedChip.value
|
|
10209
10254
|
}).chip,
|
|
@@ -10220,7 +10265,7 @@ const AddFundsForm = ({
|
|
|
10220
10265
|
multiplier: 1
|
|
10221
10266
|
}), jsxRuntime.jsx(MoneyInput, {
|
|
10222
10267
|
control: form.control,
|
|
10223
|
-
css: getStyles$
|
|
10268
|
+
css: getStyles$4().fundsInput,
|
|
10224
10269
|
defaultValue: {
|
|
10225
10270
|
amount: undefined,
|
|
10226
10271
|
currency: api.SE.Currency.USD
|
|
@@ -10288,7 +10333,7 @@ const InlineLabel = ({
|
|
|
10288
10333
|
}), children]
|
|
10289
10334
|
}));
|
|
10290
10335
|
|
|
10291
|
-
const getStyles$
|
|
10336
|
+
const getStyles$3 = balance => createStyles({
|
|
10292
10337
|
balanceText: theme => ({
|
|
10293
10338
|
color: balance === undefined ? theme.palette.alert.main : balance >= 0 ? theme.palette.secondary.dark : theme.palette.error.main
|
|
10294
10339
|
})
|
|
@@ -10311,7 +10356,7 @@ const CarrierBalance = ({
|
|
|
10311
10356
|
}, {
|
|
10312
10357
|
children: isLoadingCarrier || isRefetchingCarrier ? jsxRuntime.jsx(giger.Spinner, {}) : jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
10313
10358
|
bold: true,
|
|
10314
|
-
css: getStyles$
|
|
10359
|
+
css: getStyles$3(balance).balanceText
|
|
10315
10360
|
}, {
|
|
10316
10361
|
children: balance === undefined ? t("manage-funding:errors.balanceUnknown") : formatMoney({
|
|
10317
10362
|
amount: balance,
|
|
@@ -10375,7 +10420,7 @@ const Spread = ({
|
|
|
10375
10420
|
children: children
|
|
10376
10421
|
}));
|
|
10377
10422
|
|
|
10378
|
-
const getStyles$
|
|
10423
|
+
const getStyles$2 = isCustomAmount => createStyles({
|
|
10379
10424
|
balanceText: theme => ({
|
|
10380
10425
|
color: theme.palette.secondary.dark
|
|
10381
10426
|
}),
|
|
@@ -10443,7 +10488,7 @@ const FundAndPurchase = ({
|
|
|
10443
10488
|
}, {
|
|
10444
10489
|
children: [jsxRuntime.jsx(giger.Button, Object.assign({
|
|
10445
10490
|
bold: false,
|
|
10446
|
-
css: getStyles$
|
|
10491
|
+
css: getStyles$2().saveRateButton,
|
|
10447
10492
|
disabled: disabled || !carrierId || addFundsForm.isSubmitting || isRateFormSubmitting,
|
|
10448
10493
|
isLoading: isSavingRate,
|
|
10449
10494
|
onClick: handleSaveRate,
|
|
@@ -10463,7 +10508,7 @@ const FundAndPurchase = ({
|
|
|
10463
10508
|
// don't show balance or funding form
|
|
10464
10509
|
if (!isFundingRequired) return jsxRuntime.jsx("div", Object.assign({
|
|
10465
10510
|
className: className,
|
|
10466
|
-
css: getStyles$
|
|
10511
|
+
css: getStyles$2().container
|
|
10467
10512
|
}, {
|
|
10468
10513
|
children: renderActionButtons()
|
|
10469
10514
|
}));
|
|
@@ -10476,7 +10521,7 @@ const FundAndPurchase = ({
|
|
|
10476
10521
|
// show balance, but not the funding form.
|
|
10477
10522
|
if (!isFundingEnabled) return jsxRuntime.jsxs("div", Object.assign({
|
|
10478
10523
|
className: className,
|
|
10479
|
-
css: getStyles$
|
|
10524
|
+
css: getStyles$2().container
|
|
10480
10525
|
}, {
|
|
10481
10526
|
children: [jsxRuntime.jsx(CarrierBalance, {
|
|
10482
10527
|
carrierId: carrierId
|
|
@@ -10488,7 +10533,7 @@ const FundAndPurchase = ({
|
|
|
10488
10533
|
// show balance and funding form
|
|
10489
10534
|
return jsxRuntime.jsxs("div", Object.assign({
|
|
10490
10535
|
className: className,
|
|
10491
|
-
css: getStyles$
|
|
10536
|
+
css: getStyles$2().container
|
|
10492
10537
|
}, {
|
|
10493
10538
|
children: [jsxRuntime.jsxs(Spread, {
|
|
10494
10539
|
children: [jsxRuntime.jsx(CarrierBalance, {
|
|
@@ -10519,13 +10564,13 @@ const FundAndPurchase = ({
|
|
|
10519
10564
|
var _a, _b;
|
|
10520
10565
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
10521
10566
|
children: [jsxRuntime.jsxs("section", Object.assign({
|
|
10522
|
-
css: getStyles$
|
|
10567
|
+
css: getStyles$2(addFundsForm.isCustomAmount).formExtension
|
|
10523
10568
|
}, {
|
|
10524
10569
|
children: [jsxRuntime.jsx(InlineLabel, Object.assign({
|
|
10525
10570
|
label: t("manage-funding:fundAndPurchase.newBalance")
|
|
10526
10571
|
}, {
|
|
10527
10572
|
children: jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
10528
|
-
css: getStyles$
|
|
10573
|
+
css: getStyles$2().balanceText
|
|
10529
10574
|
}, {
|
|
10530
10575
|
children: formatMoney({
|
|
10531
10576
|
amount: balance + ((_a = addFundsForm.selectedAmount) !== null && _a !== void 0 ? _a : 0),
|
|
@@ -10536,7 +10581,7 @@ const FundAndPurchase = ({
|
|
|
10536
10581
|
label: t("manage-funding:fundAndPurchase.finalBalance")
|
|
10537
10582
|
}, {
|
|
10538
10583
|
children: jsxRuntime.jsx(giger.Typography, Object.assign({
|
|
10539
|
-
css: getStyles$
|
|
10584
|
+
css: getStyles$2().balanceText
|
|
10540
10585
|
}, {
|
|
10541
10586
|
children: formatMoney({
|
|
10542
10587
|
amount: balance + ((_b = addFundsForm.selectedAmount) !== null && _b !== void 0 ? _b : 0) - purchaseAmount,
|
|
@@ -12218,49 +12263,86 @@ const SuspendShipment = ({
|
|
|
12218
12263
|
}));
|
|
12219
12264
|
};
|
|
12220
12265
|
|
|
12221
|
-
const
|
|
12222
|
-
|
|
12223
|
-
|
|
12266
|
+
const getStyles$1 = fullWidth => createStyles({
|
|
12267
|
+
dateRangeSelect: theme => ({
|
|
12268
|
+
minWidth: theme.spacing(30),
|
|
12269
|
+
position: "relative",
|
|
12270
|
+
width: !fullWidth ? "auto" : theme.spacing(30)
|
|
12224
12271
|
})
|
|
12225
12272
|
});
|
|
12226
12273
|
|
|
12227
|
-
const
|
|
12274
|
+
const DateRangeSelect = ({
|
|
12275
|
+
fullWidth,
|
|
12276
|
+
onChange,
|
|
12277
|
+
options,
|
|
12278
|
+
value
|
|
12279
|
+
}) => {
|
|
12228
12280
|
const {
|
|
12229
12281
|
t
|
|
12230
12282
|
} = reactI18next.useTranslation();
|
|
12231
|
-
const
|
|
12232
|
-
|
|
12233
|
-
|
|
12234
|
-
|
|
12235
|
-
|
|
12236
|
-
|
|
12237
|
-
|
|
12238
|
-
|
|
12239
|
-
|
|
12283
|
+
const styles = getStyles$1(fullWidth);
|
|
12284
|
+
const handleChange = (_name, nextOption) => {
|
|
12285
|
+
if (!nextOption) throw new Error("DateRangeSelect requires non-null options");
|
|
12286
|
+
onChange(nextOption);
|
|
12287
|
+
};
|
|
12288
|
+
return jsxRuntime.jsx(giger.Select, Object.assign({
|
|
12289
|
+
css: styles.dateRangeSelect,
|
|
12290
|
+
"data-testid": "date-range-select",
|
|
12291
|
+
label: t("wallet-history:dateRange"),
|
|
12292
|
+
leftContent: jsxRuntime.jsx(giger.Icon, {
|
|
12293
|
+
name: brands.IconNames.FILTER
|
|
12294
|
+
}),
|
|
12295
|
+
name: "date-range-select",
|
|
12296
|
+
onChange: handleChange,
|
|
12297
|
+
value: value
|
|
12240
12298
|
}, {
|
|
12241
|
-
|
|
12242
|
-
|
|
12243
|
-
|
|
12244
|
-
const [selectValue, setSelectValue] = React.useState();
|
|
12245
|
-
return jsxRuntime.jsxs(Spread, {
|
|
12246
|
-
children: [jsxRuntime.jsx(giger.Select, Object.assign({
|
|
12247
|
-
css: styles.dateRangeInput,
|
|
12248
|
-
label: "Date range",
|
|
12249
|
-
leftContent: jsxRuntime.jsx(giger.Icon, {
|
|
12250
|
-
name: brands.IconNames.FILTER
|
|
12251
|
-
}),
|
|
12252
|
-
name: "date-range-select",
|
|
12253
|
-
onChange: newValue => setSelectValue(newValue),
|
|
12254
|
-
onClear: c => console.log("SELECT ON CLEAR CALLBACK:", c)
|
|
12299
|
+
children: options.map(option => jsxRuntime.jsx(giger.Option, Object.assign({
|
|
12300
|
+
selected: (value === null || value === void 0 ? void 0 : value.value) === option.value,
|
|
12301
|
+
value: option
|
|
12255
12302
|
}, {
|
|
12256
|
-
children:
|
|
12257
|
-
|
|
12258
|
-
|
|
12259
|
-
|
|
12260
|
-
|
|
12261
|
-
|
|
12262
|
-
|
|
12263
|
-
|
|
12303
|
+
children: option.label
|
|
12304
|
+
}), option.value))
|
|
12305
|
+
}));
|
|
12306
|
+
};
|
|
12307
|
+
|
|
12308
|
+
const DateRangeCombo = ({
|
|
12309
|
+
children: renderChildren,
|
|
12310
|
+
onChange,
|
|
12311
|
+
options,
|
|
12312
|
+
values: {
|
|
12313
|
+
customRange,
|
|
12314
|
+
selectedOption
|
|
12315
|
+
}
|
|
12316
|
+
}) => {
|
|
12317
|
+
const {
|
|
12318
|
+
t
|
|
12319
|
+
} = reactI18next.useTranslation();
|
|
12320
|
+
const handleChangeSelected = nextOption => {
|
|
12321
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(nextOption, customRange);
|
|
12322
|
+
};
|
|
12323
|
+
const handleChangeCustomRange = nextCustomRange => {
|
|
12324
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(selectedOption, nextCustomRange);
|
|
12325
|
+
};
|
|
12326
|
+
const dateRangeSelect = jsxRuntime.jsx(DateRangeSelect, {
|
|
12327
|
+
fullWidth: !!renderChildren,
|
|
12328
|
+
onChange: handleChangeSelected,
|
|
12329
|
+
options: options,
|
|
12330
|
+
value: selectedOption
|
|
12331
|
+
});
|
|
12332
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
12333
|
+
children: [renderChildren ? renderChildren(dateRangeSelect) : dateRangeSelect, (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) === "custom" && jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
12334
|
+
children: [jsxRuntime.jsx(Spacer, {
|
|
12335
|
+
multiplier: 2
|
|
12336
|
+
}), jsxRuntime.jsx(giger.DatePicker, {
|
|
12337
|
+
dateFormat: "MM/dd/yyyy",
|
|
12338
|
+
// TODO - [LMNT-666] the X displayed from isClearable doesn't fire any prop callbacks
|
|
12339
|
+
isClearable: true,
|
|
12340
|
+
label: t("wallet-history:actions.chooseDate"),
|
|
12341
|
+
onChange: dates => {
|
|
12342
|
+
if (Array.isArray(dates) && dates.length === 2 && dates[1] !== null) handleChangeCustomRange(dates);
|
|
12343
|
+
},
|
|
12344
|
+
selectsRange: true
|
|
12345
|
+
})]
|
|
12264
12346
|
})]
|
|
12265
12347
|
});
|
|
12266
12348
|
};
|
|
@@ -12291,25 +12373,91 @@ const HistoryList = ({
|
|
|
12291
12373
|
});
|
|
12292
12374
|
};
|
|
12293
12375
|
|
|
12376
|
+
const styles = createStyles({
|
|
12377
|
+
action: theme => ({
|
|
12378
|
+
minWidth: theme.spacing(30),
|
|
12379
|
+
placeContent: "center",
|
|
12380
|
+
width: theme.spacing(30)
|
|
12381
|
+
}),
|
|
12382
|
+
gridContainer: theme => ({
|
|
12383
|
+
display: "grid",
|
|
12384
|
+
gap: theme.spacing(2),
|
|
12385
|
+
gridTemplateColumns: "1fr 1fr 1fr",
|
|
12386
|
+
gridTemplateRows: "1fr",
|
|
12387
|
+
placeItems: "center"
|
|
12388
|
+
}),
|
|
12389
|
+
linkAction: theme => ({
|
|
12390
|
+
minWidth: theme.spacing(30),
|
|
12391
|
+
placeContent: "center",
|
|
12392
|
+
width: theme.spacing(30)
|
|
12393
|
+
}),
|
|
12394
|
+
pagination: {
|
|
12395
|
+
display: "grid",
|
|
12396
|
+
placeItems: "center"
|
|
12397
|
+
}
|
|
12398
|
+
});
|
|
12399
|
+
|
|
12294
12400
|
const HistoryBody = ({
|
|
12295
12401
|
historyData
|
|
12296
12402
|
}) => {
|
|
12297
|
-
const
|
|
12403
|
+
const {
|
|
12404
|
+
t
|
|
12405
|
+
} = reactI18next.useTranslation();
|
|
12406
|
+
const [currentPage, setCurrentPage] = React.useState(1);
|
|
12407
|
+
const [dateRangeOptions, {
|
|
12408
|
+
last30days
|
|
12409
|
+
}] = useDateRangeOptions();
|
|
12410
|
+
const [selectedOption, setSelectedOption] = React.useState(last30days);
|
|
12411
|
+
const [customRange, setCustomRange] = React.useState();
|
|
12412
|
+
React.useMemo(() => (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) === "custom" ? customRange : selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.range, [customRange, selectedOption]);
|
|
12413
|
+
// const { data: walletHistory } = useGetWalletHistory({
|
|
12414
|
+
// enabled: !!queryRange,
|
|
12415
|
+
// page: currentPage,
|
|
12416
|
+
// range: queryRange
|
|
12417
|
+
// })
|
|
12298
12418
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
12299
|
-
children: [jsxRuntime.jsx(
|
|
12419
|
+
children: [jsxRuntime.jsx(DateRangeCombo, Object.assign({
|
|
12420
|
+
onChange: (nextOption, nextCustomRange) => {
|
|
12421
|
+
setCurrentPage(1);
|
|
12422
|
+
setSelectedOption(nextOption);
|
|
12423
|
+
setCustomRange(nextCustomRange);
|
|
12424
|
+
},
|
|
12425
|
+
options: dateRangeOptions,
|
|
12426
|
+
values: {
|
|
12427
|
+
customRange,
|
|
12428
|
+
selectedOption
|
|
12429
|
+
}
|
|
12430
|
+
}, {
|
|
12431
|
+
children: renderedSelect => jsxRuntime.jsxs(giger.Grid, Object.assign({
|
|
12432
|
+
css: styles.gridContainer,
|
|
12433
|
+
noPadding: true
|
|
12434
|
+
}, {
|
|
12435
|
+
children: [jsxRuntime.jsx(giger.GridChild, {
|
|
12436
|
+
children: renderedSelect
|
|
12437
|
+
}), jsxRuntime.jsx(giger.GridChild, {}), jsxRuntime.jsx(giger.GridChild, {
|
|
12438
|
+
children: jsxRuntime.jsx(LinkAction, {
|
|
12439
|
+
css: styles.linkAction,
|
|
12440
|
+
icon: "download",
|
|
12441
|
+
onClick: () => alert("Download a CSV from HistoryBody! - a link will go here once we have a data hook"),
|
|
12442
|
+
title: t("wallet-history:actions.downloadCsv")
|
|
12443
|
+
})
|
|
12444
|
+
})]
|
|
12445
|
+
}))
|
|
12446
|
+
})), jsxRuntime.jsx(Spacer, {
|
|
12447
|
+
multiplier: 2
|
|
12448
|
+
}), jsxRuntime.jsx(HistoryList, {
|
|
12300
12449
|
historyData: historyData
|
|
12301
|
-
}), jsxRuntime.jsxs(
|
|
12302
|
-
children: [jsxRuntime.
|
|
12303
|
-
children:
|
|
12304
|
-
|
|
12305
|
-
|
|
12306
|
-
|
|
12307
|
-
|
|
12308
|
-
|
|
12309
|
-
|
|
12310
|
-
|
|
12311
|
-
|
|
12312
|
-
})]
|
|
12450
|
+
}), jsxRuntime.jsxs("p", {
|
|
12451
|
+
children: ["Page ", jsxRuntime.jsx("strong", {
|
|
12452
|
+
children: currentPage
|
|
12453
|
+
}), " selected."]
|
|
12454
|
+
}), jsxRuntime.jsx(giger.Pagination, {
|
|
12455
|
+
boundaryPagesToShow: 7,
|
|
12456
|
+
css: styles.pagination,
|
|
12457
|
+
currentPage: currentPage,
|
|
12458
|
+
onPageChange: selectedPage => setCurrentPage(selectedPage),
|
|
12459
|
+
siblingCount: 2,
|
|
12460
|
+
totalPages: 20
|
|
12313
12461
|
})]
|
|
12314
12462
|
});
|
|
12315
12463
|
};
|
|
@@ -12443,6 +12591,7 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
12443
12591
|
AddressFields: AddressFields,
|
|
12444
12592
|
addressLine1Schema: addressLine1Schema,
|
|
12445
12593
|
addressLine2Schema: addressLine2Schema,
|
|
12594
|
+
companyNameSchema: companyNameSchema,
|
|
12446
12595
|
addressSchema: addressSchema,
|
|
12447
12596
|
AddressParser: AddressParser,
|
|
12448
12597
|
addressParserSchema: addressParserSchema,
|
|
@@ -13139,20 +13288,34 @@ var listCarriers = {
|
|
|
13139
13288
|
|
|
13140
13289
|
var manageDefaults = {
|
|
13141
13290
|
"manage-defaults": {
|
|
13142
|
-
|
|
13143
|
-
|
|
13144
|
-
|
|
13145
|
-
|
|
13291
|
+
units: {
|
|
13292
|
+
title: "Units of Measure",
|
|
13293
|
+
dimensions: {
|
|
13294
|
+
title: "Dimensions",
|
|
13295
|
+
standard: "Inches",
|
|
13296
|
+
metric: "Centimeters"
|
|
13146
13297
|
},
|
|
13147
|
-
|
|
13298
|
+
weight: {
|
|
13299
|
+
title: "Weight",
|
|
13300
|
+
standard: "Pounds & Ounces",
|
|
13301
|
+
g: "Grams",
|
|
13302
|
+
kg: "Kilograms"
|
|
13303
|
+
}
|
|
13304
|
+
},
|
|
13305
|
+
label: {
|
|
13148
13306
|
letter: {
|
|
13149
13307
|
title: "Letter (8.5 x 11 inch)",
|
|
13150
13308
|
description: "For desktop printers"
|
|
13151
13309
|
},
|
|
13310
|
+
purchase: {
|
|
13311
|
+
title: "Set for all labels",
|
|
13312
|
+
description: "This setting applies to all future labels and can be changed in your Account Settings."
|
|
13313
|
+
},
|
|
13152
13314
|
thermal: {
|
|
13153
13315
|
title: "Thermal (4 x 6 inch)",
|
|
13154
13316
|
description: "For label printers"
|
|
13155
|
-
}
|
|
13317
|
+
},
|
|
13318
|
+
title: "Shipping Label Layout"
|
|
13156
13319
|
}
|
|
13157
13320
|
}
|
|
13158
13321
|
};
|
|
@@ -13458,8 +13621,10 @@ var voidLabel = {
|
|
|
13458
13621
|
var walletHistory = {
|
|
13459
13622
|
"wallet-history": {
|
|
13460
13623
|
actions: {
|
|
13461
|
-
downloadCsv: "Download a CSV"
|
|
13624
|
+
downloadCsv: "Download a CSV",
|
|
13625
|
+
chooseDate: "Choose a date"
|
|
13462
13626
|
},
|
|
13627
|
+
dateRange: "Date range",
|
|
13463
13628
|
historyOptions: {
|
|
13464
13629
|
custom: "Custom",
|
|
13465
13630
|
last30days: "Last 30 days",
|
|
@@ -13469,7 +13634,7 @@ var walletHistory = {
|
|
|
13469
13634
|
}
|
|
13470
13635
|
};
|
|
13471
13636
|
|
|
13472
|
-
var index = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, common$1), listCarriers), manageFunding), manageWarehouses), manageDefaults), onboarding$1), purchaseLabel), registerCarrier), registerWallet), viewShipment), voidLabel), walletHistory);
|
|
13637
|
+
var index = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, common$1), listCarriers), manageDefaults), manageFunding), manageWarehouses), manageDefaults), onboarding$1), purchaseLabel), registerCarrier), registerWallet), viewShipment), voidLabel), walletHistory);
|
|
13473
13638
|
|
|
13474
13639
|
var resources = /*#__PURE__*/Object.freeze({
|
|
13475
13640
|
__proto__: null,
|
|
@@ -14888,6 +15053,8 @@ exports.ButtonGroup = ButtonGroup;
|
|
|
14888
15053
|
exports.CarrierBalance = CarrierBalance;
|
|
14889
15054
|
exports.Country = Country;
|
|
14890
15055
|
exports.Cube = Cube;
|
|
15056
|
+
exports.DateRangeCombo = DateRangeCombo;
|
|
15057
|
+
exports.DateRangeSelect = DateRangeSelect;
|
|
14891
15058
|
exports.ElementsContext = ElementsContext;
|
|
14892
15059
|
exports.ElementsProvider = ElementsProvider;
|
|
14893
15060
|
exports.ErrorBoundary = ErrorBoundary;
|
|
@@ -14947,6 +15114,7 @@ exports.getIsCustomsRequiredForShipment = getIsCustomsRequiredForShipment;
|
|
|
14947
15114
|
exports.getIsInternationalShipment = getIsInternationalShipment;
|
|
14948
15115
|
exports.getPendingShipment = getPendingShipment;
|
|
14949
15116
|
exports.getRateRequiresAcknowledgement = getRateRequiresAcknowledgement;
|
|
15117
|
+
exports.getRelativeDates = getRelativeDates;
|
|
14950
15118
|
exports.getRequestedServices = getRequestedServices;
|
|
14951
15119
|
exports.getSalesOrderItemsFromSalesOrderOrShipment = getSalesOrderItemsFromSalesOrderOrShipment;
|
|
14952
15120
|
exports.getTotalRateAmount = getTotalRateAmount;
|
|
@@ -14976,6 +15144,7 @@ exports.useConfirmationOptions = useConfirmationOptions;
|
|
|
14976
15144
|
exports.useCountryCodeOptions = useCountryCodeOptions;
|
|
14977
15145
|
exports.useCustomsContentsOptions = useCustomsContentsOptions;
|
|
14978
15146
|
exports.useCustomsNonDeliveryOptions = useCustomsNonDeliveryOptions;
|
|
15147
|
+
exports.useDateRangeOptions = useDateRangeOptions;
|
|
14979
15148
|
exports.useElements = useElements;
|
|
14980
15149
|
exports.useExpirationMonthOptions = useExpirationMonthOptions;
|
|
14981
15150
|
exports.useInsuranceProviderOptions = useInsuranceProviderOptions;
|