@shipengine/elements 2.22.0 → 2.23.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.
Files changed (86) hide show
  1. package/cjs/components/grid-controller/grid-controller.cjs +29 -15
  2. package/cjs/components/grid-filters/components/index.cjs +2 -0
  3. package/cjs/components/grid-filters/components/label-status-filter/index.cjs +9 -0
  4. package/cjs/components/grid-filters/components/label-status-filter/label-status-filter-schema.cjs +12 -0
  5. package/cjs/components/grid-filters/components/label-status-filter/label-status-filter.cjs +174 -0
  6. package/cjs/components/grid-filters/components/label-status-filter/label-status-filter.styles.cjs +21 -0
  7. package/cjs/components/grid-filters/components/tracking-status-filter/tracking-status-filter.cjs +21 -12
  8. package/cjs/components/grid-filters/grid-filters.cjs +6 -1
  9. package/cjs/elements/labels-grid/hooks/use-labels-grid.cjs +25 -12
  10. package/cjs/elements/labels-grid/labels-grid.cjs +11 -2
  11. package/cjs/elements/purchase-label/components/customs-forms/customs-forms.cjs +10 -3
  12. package/cjs/elements/purchase-label/components/rate-form/rate-view.cjs +4 -9
  13. package/cjs/elements/purchase-label/components/shipment-form/shipment-form.cjs +11 -5
  14. package/cjs/elements/purchase-label/configure-shipment.cjs +3 -1
  15. package/cjs/elements/purchase-label/hooks/use-rates-form.cjs +38 -16
  16. package/cjs/elements/purchase-label/purchase-label.cjs +0 -1
  17. package/cjs/elements/shipments-grid/hooks/use-shipments-grid.cjs +5 -1
  18. package/cjs/elements/shipments-grid/shipments-grid.cjs +12 -5
  19. package/cjs/hooks/index.cjs +3 -0
  20. package/cjs/hooks/use-configure-shipment.cjs +1 -34
  21. package/cjs/index.cjs +5 -0
  22. package/cjs/locales/en/common.cjs +2 -1
  23. package/cjs/locales/en/purchase-label.cjs +2 -1
  24. package/cjs/package.cjs +1 -1
  25. package/cjs/workflows/label-workflow/label-workflow.cjs +0 -1
  26. package/esm/components/grid-controller/grid-controller.js +29 -15
  27. package/esm/components/grid-filters/components/index.js +1 -0
  28. package/esm/components/grid-filters/components/label-status-filter/index.js +1 -0
  29. package/esm/components/grid-filters/components/label-status-filter/label-status-filter-schema.js +8 -0
  30. package/esm/components/grid-filters/components/label-status-filter/label-status-filter.js +170 -0
  31. package/esm/components/grid-filters/components/label-status-filter/label-status-filter.styles.js +17 -0
  32. package/esm/components/grid-filters/components/tracking-status-filter/tracking-status-filter.js +21 -12
  33. package/esm/components/grid-filters/grid-filters.js +6 -1
  34. package/esm/elements/labels-grid/hooks/use-labels-grid.js +25 -12
  35. package/esm/elements/labels-grid/labels-grid.js +11 -2
  36. package/esm/elements/purchase-label/components/customs-forms/customs-forms.js +10 -3
  37. package/esm/elements/purchase-label/components/rate-form/rate-view.js +4 -9
  38. package/esm/elements/purchase-label/components/shipment-form/shipment-form.js +11 -5
  39. package/esm/elements/purchase-label/configure-shipment.js +3 -1
  40. package/esm/elements/purchase-label/hooks/use-rates-form.js +38 -16
  41. package/esm/elements/purchase-label/purchase-label.js +0 -1
  42. package/esm/elements/shipments-grid/hooks/use-shipments-grid.js +5 -1
  43. package/esm/elements/shipments-grid/shipments-grid.js +12 -5
  44. package/esm/hooks/index.js +1 -0
  45. package/esm/hooks/use-configure-shipment.js +3 -36
  46. package/esm/index.js +2 -0
  47. package/esm/locales/en/common.js +2 -1
  48. package/esm/locales/en/purchase-label.js +2 -1
  49. package/esm/package.js +1 -1
  50. package/esm/workflows/label-workflow/label-workflow.js +0 -1
  51. package/package.json +13 -2
  52. package/types/src/components/grid-controller/grid-controller.d.ts +2 -0
  53. package/types/src/components/grid-filters/components/index.d.ts +1 -0
  54. package/types/src/components/grid-filters/components/label-status-filter/index.d.ts +1 -0
  55. package/types/src/components/grid-filters/components/label-status-filter/label-status-filter-schema.d.ts +12 -0
  56. package/types/src/components/grid-filters/components/label-status-filter/label-status-filter.d.ts +24 -0
  57. package/types/src/components/grid-filters/components/label-status-filter/label-status-filter.styles.d.ts +13 -0
  58. package/types/src/components/grid-filters/grid-filters.d.ts +2 -0
  59. package/types/src/elements/labels-grid/hooks/use-labels-grid.d.ts +2 -1
  60. package/types/src/elements/labels-grid/labels-grid.d.ts +3 -4
  61. package/types/src/elements/manage-carriers/manage-carriers.d.ts +2 -0
  62. package/types/src/elements/manage-external-carriers/manage-external-carriers.d.ts +2 -0
  63. package/types/src/elements/manage-funding/manage-funding-element.d.ts +2 -0
  64. package/types/src/elements/manage-warehouses/manage-warehouses.d.ts +2 -0
  65. package/types/src/elements/payment-method-settings/payment-method-settings-element.d.ts +2 -0
  66. package/types/src/elements/purchase-label/hooks/use-rates-form.d.ts +1 -0
  67. package/types/src/elements/purchase-label/purchase-label.d.ts +11 -9
  68. package/types/src/elements/select-label-layout/select-label-layout-element.d.ts +2 -0
  69. package/types/src/elements/shipment-summary/shipment-summary.d.ts +2 -0
  70. package/types/src/elements/shipments-grid/hooks/use-shipments-grid.d.ts +11 -6
  71. package/types/src/elements/shipments-grid/shipments-grid.d.ts +31 -5
  72. package/types/src/elements/theme-creator/theme-creator.d.ts +2 -0
  73. package/types/src/elements/transaction-history/transaction-history-element.d.ts +2 -0
  74. package/types/src/elements/unit-settings/unit-settings-element.d.ts +2 -0
  75. package/types/src/elements/vat-settings/vat-settings-element.d.ts +2 -0
  76. package/types/src/elements/void-label/void-label.d.ts +33 -0
  77. package/types/src/hooks/index.d.ts +1 -0
  78. package/types/src/hooks/use-configure-shipment.d.ts +1 -2
  79. package/types/src/index.d.ts +5 -0
  80. package/types/src/locales/en/index.d.ts +2 -0
  81. package/types/src/utilities/feature-flags/types.d.ts +5 -1
  82. package/types/src/workflows/account-settings/account-settings.d.ts +2 -0
  83. package/types/src/workflows/carrier-services/carrier-services.d.ts +2 -0
  84. package/types/src/workflows/connect-external-carrier/connect-external-carrier.d.ts +2 -0
  85. package/types/src/workflows/label-workflow/label-workflow.d.ts +10 -1
  86. package/types/src/workflows/onboarding/onboarding.d.ts +2 -0
@@ -1,15 +1,13 @@
1
1
  import { __awaiter } from 'tslib';
2
- import { useQueryClient } from '@tanstack/react-query';
3
2
  import { getDefaultShipFromAddress } from '../utilities/shipengine/address.js';
4
3
  import { getIsCustomsRequiredForSalesOrder, getCustomsFromSalesOrder } from '../utilities/shipengine/sales-order.js';
5
- import { getShipmentByStatus, moveCustomsItemsToProducts } from '../utilities/shipengine/shipment.js';
4
+ import { getShipmentByStatus } from '../utilities/shipengine/shipment.js';
6
5
  import { getDefaultWarehouse, getWarehouseById } from '../utilities/shipengine/warehouses.js';
7
6
  import { useMemo, useCallback, useEffect } from 'react';
8
- import { useListCarriers, useListWarehouses, useUpdateSalesOrderShipment, useCreateShipment, useGetShipmentByExternalId, useListSalesOrderShipments, useCreateSalesOrderShipment, CodedError } from '@shipengine/react-api';
7
+ import { useListCarriers, useListWarehouses, useCreateShipment, useGetShipmentByExternalId, useListSalesOrderShipments, useCreateSalesOrderShipment, CodedError } from '@shipengine/react-api';
9
8
  import { useImportSalesOrder } from './use-import-sales-order.js';
10
9
 
11
10
  const useConfigureShipment = ({
12
- onShipmentUpdated,
13
11
  onLoad,
14
12
  errorWhenShipmentCancelled: _errorWhenShipmentCancelled = false,
15
13
  externalOrderId,
@@ -22,7 +20,6 @@ const useConfigureShipment = ({
22
20
  warehouseId,
23
21
  useWarehouses: _useWarehouses = true
24
22
  }) => {
25
- const queryClient = useQueryClient();
26
23
  // Queue of incomplete requirement keys (i.e., Ship From addresses, Warehouses, Carriers)
27
24
  const incompleteRequirementsKeys = useMemo(() => [], []);
28
25
  const {
@@ -50,10 +47,6 @@ const useConfigureShipment = ({
50
47
  orderSourceCode,
51
48
  salesOrderId
52
49
  });
53
- const {
54
- error: updateShipmentErrors,
55
- mutate: updateShipment
56
- } = useUpdateSalesOrderShipment();
57
50
  const {
58
51
  data: newV1Shipment,
59
52
  mutateAsync: createV1Shipment,
@@ -157,25 +150,6 @@ const useConfigureShipment = ({
157
150
  }
158
151
  }
159
152
  }), [createSalesOrderShipment, createV1Shipment, creatingSalesOrderShipment, creatingV1Shipment, defaultShipFromAddress, defaultWarehouse, externalOrderId, externalOrderNumber, externalShipmentId, incompleteRequirementsKeys, isExternalShipmentFetching, isExternalShipmentInitialLoading, isFetchingWarehouses, isInitialLoadingWarehouses, labelPurchasedSalesOrderShipment, listSalesOrderShipmentsInitiallyLoading, listSalesOrderShipmentsIsFetching, orderSourceCode, pendingSalesOrderShipment, refetchSalesOrderShipments, salesOrder, salesOrderId, salesOrderShipmentCreated, shipFromAddresses === null || shipFromAddresses === void 0 ? void 0 : shipFromAddresses.length, shipmentId, _useWarehouses, v1shipmentCreated, warehouseId, warehouses]);
160
- /**
161
- * Update a shipment with deprecated customs items. Move items to the products array on the Shipment's packages array
162
- *
163
- * Invalidate useGetShipment's cache
164
- */
165
- const formatCustoms = useCallback(shipment => {
166
- const formattedShipment = moveCustomsItemsToProducts(shipment);
167
- updateShipment(formattedShipment, {
168
- onSuccess(data) {
169
- void (onShipmentUpdated === null || onShipmentUpdated === void 0 ? void 0 : onShipmentUpdated(data));
170
- void queryClient.invalidateQueries(["useListSalesOrderShipments", {
171
- shipmentId: data.shipmentId
172
- }], {
173
- exact: false
174
- } // Invalidate queries with similar keys
175
- );
176
- }
177
- });
178
- }, [onShipmentUpdated, queryClient, updateShipment]);
179
153
  const refetchPendingSalesOrderShipments = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
180
154
  const {
181
155
  data: shipments
@@ -188,13 +162,6 @@ const useConfigureShipment = ({
188
162
  yield handleShipmentCreation();
189
163
  }))();
190
164
  }, [shipmentId, externalShipmentId, salesOrderId, salesOrder, warehouses, warehouseId, handleShipmentCreation]);
191
- // useEffect to handle formating customs
192
- useEffect(() => {
193
- var _a, _b;
194
- if ((_b = (_a = pendingSalesOrderShipment === null || pendingSalesOrderShipment === void 0 ? void 0 : pendingSalesOrderShipment.customs) === null || _a === void 0 ? void 0 : _a.customsItems) === null || _b === void 0 ? void 0 : _b.length) {
195
- formatCustoms(pendingSalesOrderShipment);
196
- }
197
- }, [formatCustoms, pendingSalesOrderShipment]);
198
165
  // useEffect to check and run the onLoad prop
199
166
  useEffect(() => {
200
167
  if ((salesOrderShipments === null || salesOrderShipments === void 0 ? void 0 : salesOrderShipments.length) && salesOrderShipments.every(s => s.shipmentStatus === "label_purchased")) {
@@ -206,7 +173,7 @@ const useConfigureShipment = ({
206
173
  if (isInitialLoadingCarriers || isFetchingCarriers) return;
207
174
  if ((carriers === null || carriers === void 0 ? void 0 : carriers.length) === 0) incompleteRequirementsKeys.push("no_carriers");
208
175
  }, [carriers, incompleteRequirementsKeys, isFetchingCarriers, isInitialLoadingCarriers]);
209
- const errors = [...(listWarehouseErrors !== null && listWarehouseErrors !== void 0 ? listWarehouseErrors : []), ...(createSalesOrderShipmentErrors !== null && createSalesOrderShipmentErrors !== void 0 ? createSalesOrderShipmentErrors : []), ...(createV1ShipmentErrors !== null && createV1ShipmentErrors !== void 0 ? createV1ShipmentErrors : []), ...(listSalesOrderShipmentsErrors !== null && listSalesOrderShipmentsErrors !== void 0 ? listSalesOrderShipmentsErrors : []), ...(getExternalShipmentErrors !== null && getExternalShipmentErrors !== void 0 ? getExternalShipmentErrors : []), ...(importSalesOrderErrors !== null && importSalesOrderErrors !== void 0 ? importSalesOrderErrors : []), ...(updateShipmentErrors !== null && updateShipmentErrors !== void 0 ? updateShipmentErrors : []), ...(_errorWhenShipmentCancelled && cancelledShipment ? [new CodedError("shipment_cancelled", {
176
+ const errors = [...(listWarehouseErrors !== null && listWarehouseErrors !== void 0 ? listWarehouseErrors : []), ...(createSalesOrderShipmentErrors !== null && createSalesOrderShipmentErrors !== void 0 ? createSalesOrderShipmentErrors : []), ...(createV1ShipmentErrors !== null && createV1ShipmentErrors !== void 0 ? createV1ShipmentErrors : []), ...(listSalesOrderShipmentsErrors !== null && listSalesOrderShipmentsErrors !== void 0 ? listSalesOrderShipmentsErrors : []), ...(getExternalShipmentErrors !== null && getExternalShipmentErrors !== void 0 ? getExternalShipmentErrors : []), ...(importSalesOrderErrors !== null && importSalesOrderErrors !== void 0 ? importSalesOrderErrors : []), ...(_errorWhenShipmentCancelled && cancelledShipment ? [new CodedError("shipment_cancelled", {
210
177
  errorCode: "invalid_status",
211
178
  errorSource: "elements",
212
179
  errorType: "business_rules"
package/esm/index.js CHANGED
@@ -39,6 +39,7 @@ export { useHelpers } from './hooks/use-helpers.js';
39
39
  export { useConfigureShipment } from './hooks/use-configure-shipment.js';
40
40
  export { useImportSalesOrder } from './hooks/use-import-sales-order.js';
41
41
  export { useBalanceServices } from './hooks/use-balance-services.js';
42
+ export { RootPortalProvider, useRootPortal } from './hooks/use-root-portal.js';
42
43
  export { CanadaDeliveredDutyOptions } from './types/canada-ddp.js';
43
44
  export { PudoType } from './types/pudo.js';
44
45
  import * as onboarding from './workflows/onboarding/onboarding.js';
@@ -52,3 +53,4 @@ export { connectExternalCarrier as ConnectExternalCarrier };
52
53
  export { ElementsContext, ElementsContextProvider, useElements } from './elements-provider/elements-context-provider.js';
53
54
  export { ElementsProvider } from './elements-provider/elements-provider.js';
54
55
  export { ElementsTestProvider } from './elements-provider/elements-test-provider.js';
56
+ export { createElement } from './create-element/create-element.js';
@@ -218,7 +218,8 @@ var common = {
218
218
  shipmentId: "Shipment ID",
219
219
  labelId: "Label ID",
220
220
  labelIdFilter: "{{name}}: {{labelId}}",
221
- filteredTrackingStatus: "Delivery Status: {{filter}}",
221
+ filteredStatus: "{{name}}: {{filter}}",
222
+ filteredTrackingStatus: "{{name}}: {{filter}}",
222
223
  more: ", +{{count}} more",
223
224
  createdDate: "Created Date",
224
225
  shipmentIdFilter: "{{name}}: {{shipmentId}}",
@@ -33,7 +33,8 @@ var purchaseLabel = {
33
33
  results: "No results returned"
34
34
  },
35
35
  fields: {
36
- "requires-additional-handling": "This package requires <Link>additional handling</Link>",
36
+ "requires-additional-handling-link": "This package requires <Link>additional handling</Link>",
37
+ "requires-additional-handling": "This package requires additional handling",
37
38
  addOns: "Add-Ons",
38
39
  contentDescription: "Contents Description",
39
40
  confirmation: "Delivery Confirmation",
package/esm/package.js CHANGED
@@ -1,3 +1,3 @@
1
- var version = "2.22.0";
1
+ var version = "2.23.0";
2
2
 
3
3
  export { version };
@@ -52,7 +52,6 @@ const Component = _a => {
52
52
  carriers
53
53
  } = useConfigureShipment(Object.assign(Object.assign({}, _multiplexedId), {
54
54
  onLoad: onLoad,
55
- onShipmentUpdated: onShipmentUpdated,
56
55
  shipFromAddresses,
57
56
  useWarehouses: (_b = propFeatures === null || propFeatures === void 0 ? void 0 : propFeatures.shipmentForm) === null || _b === void 0 ? void 0 : _b.useWarehouses,
58
57
  warehouseId
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/elements",
3
- "version": "2.22.0",
3
+ "version": "2.23.0",
4
4
  "module": "./index.js",
5
5
  "main": "./index.js",
6
6
  "types": "./src/index.d.ts",
@@ -39,7 +39,7 @@
39
39
  }
40
40
  },
41
41
  "./labels-grid": {
42
- "source": "./src/elements-provider/index.ts",
42
+ "source": "./src/elements/labels-grid/index.ts",
43
43
  "import": {
44
44
  "types": "./types/src/elements/labels-grid/index.d.ts",
45
45
  "default": "./esm/elements/labels-grid/index.js"
@@ -49,6 +49,17 @@
49
49
  "default": "./cjs/elements/labels-grid/index.cjs"
50
50
  }
51
51
  },
52
+ "./create-element": {
53
+ "source": "./src/create-element/index.ts",
54
+ "import": {
55
+ "types": "./types/src/create-element/index.d.ts",
56
+ "default": "./esm/create-element/index.js"
57
+ },
58
+ "require": {
59
+ "types": "./types/src/create-element/index.d.ts",
60
+ "default": "./cjs/create-element/index.cjs"
61
+ }
62
+ },
52
63
  "./manage-carriers": {
53
64
  "source": "./src/elements/manage-carriers/index.ts",
54
65
  "import": {
@@ -8,6 +8,8 @@ type GridDataType = object & {
8
8
  bodyCellStyles?: Interpolation<Theme>;
9
9
  /** Flag to disable (false by default) the onClick handler of the TableRow */
10
10
  disableOnRowClick?: boolean;
11
+ /** Flag to set the row as loading */
12
+ isLoading?: boolean;
11
13
  };
12
14
  /**
13
15
  * @internal
@@ -1,4 +1,5 @@
1
1
  export { ShipmentIdFilter } from "./shipment-id-filter";
2
2
  export { CreatedDateFilter } from "./created-date-filter";
3
3
  export { LabelIdFilter } from "./label-id-filter";
4
+ export { LabelStatusFilter } from "./label-status-filter";
4
5
  export { TrackingStatusFilter } from "./tracking-status-filter";
@@ -0,0 +1 @@
1
+ export * from "./label-status-filter";
@@ -0,0 +1,12 @@
1
+ import { z } from "zod";
2
+ import { SE } from "@shipengine/react-api";
3
+ export declare const labelStatusFormSchema: z.ZodObject<{
4
+ labelStatus: z.ZodUnion<[z.ZodLiteral<SE.LabelStatus>, z.ZodLiteral<SE.LabelStatus>, z.ZodLiteral<SE.LabelStatus>, z.ZodLiteral<SE.LabelStatus>, z.ZodLiteral<"">]>;
5
+ }, "strip", z.ZodTypeAny, {
6
+ labelStatus: "" | SE.LabelStatus;
7
+ }, {
8
+ labelStatus: "" | SE.LabelStatus;
9
+ }>;
10
+ export type LabelStatusFormFields = {
11
+ labelStatus: SE.LabelStatus | "";
12
+ };
@@ -0,0 +1,24 @@
1
+ import { IGridFilters } from "../../grid-filters";
2
+ /**
3
+ * @internal
4
+ *
5
+ * # Status Filter Props
6
+ *
7
+ * @see {@link StatusFilter | The `<StatusFilter />` component}
8
+ */
9
+ type LabelStatusFilterProps = {
10
+ disabled?: boolean;
11
+ filters: IGridFilters;
12
+ onFiltersUpdated: (params: IGridFilters) => void;
13
+ };
14
+ /**
15
+ * @internal
16
+ *
17
+ * # StatusFilter
18
+ *
19
+ * - The `<StatusFilter />` component handles the label status filter used in Labels Grid.
20
+ *
21
+ * @see {@link StatusFilterProps | The props for the `<StatusFilter />` component}
22
+ */
23
+ export declare const LabelStatusFilter: ({ disabled, filters, onFiltersUpdated, }: LabelStatusFilterProps) => import("@emotion/react/jsx-runtime").JSX.Element;
24
+ export {};
@@ -0,0 +1,13 @@
1
+ export declare const styles: {
2
+ buttons: (theme: import("../../../../utilities/styles").ScopedGigerTheme) => {
3
+ display: "flex";
4
+ gap: number;
5
+ justifyContent: "end";
6
+ paddingTop: number;
7
+ };
8
+ radioGroup: (theme: import("../../../../utilities/styles").ScopedGigerTheme) => {
9
+ display: "flex";
10
+ flexDirection: "column";
11
+ gap: number;
12
+ };
13
+ };
@@ -1,4 +1,5 @@
1
1
  import { LabelTrackingStatus } from "@shipengine/js-api";
2
+ import { SE } from "@shipengine/react-api";
2
3
  /**
3
4
  * @internal
4
5
  *
@@ -25,6 +26,7 @@ export interface IGridFilters {
25
26
  }>;
26
27
  labelId?: IGridFilter<string>;
27
28
  shipmentId: IGridFilter<string>;
29
+ status?: IGridFilter<SE.LabelStatus | "">;
28
30
  trackingStatus?: IGridFilter<LabelTrackingStatusWithVoided[]>;
29
31
  }
30
32
  /**
@@ -2,11 +2,12 @@ import { IGridFilters } from "../../../components/grid-filters";
2
2
  import { LabelTrackingStatus, SE } from "@shipengine/react-api";
3
3
  import { LabelsGridProps } from "../";
4
4
  import { Label } from "../labels-grid";
5
- export declare const useLabelsGrid: ({ labelStatus, showShipmentIdFilter, showLabelIdFilter, showTrackingStatusFilter, fetchShipments, sortDir, }: {
5
+ export declare const useLabelsGrid: ({ labelStatus, showShipmentIdFilter, showLabelIdFilter, showStatusFilter, showTrackingStatusFilter, fetchShipments, sortDir, }: {
6
6
  fetchShipments?: boolean | undefined;
7
7
  labelStatus: LabelsGridProps["labelStatus"];
8
8
  showLabelIdFilter?: boolean | undefined;
9
9
  showShipmentIdFilter?: boolean | undefined;
10
+ showStatusFilter?: boolean | undefined;
10
11
  showTrackingStatusFilter?: boolean | undefined;
11
12
  sortDir?: SE.SortableQuery["sortDir"];
12
13
  }) => {
@@ -334,6 +334,7 @@ export declare const Element: ({ resources, ...props }: LabelsGridProps & import
334
334
  results: string;
335
335
  };
336
336
  fields: {
337
+ "requires-additional-handling-link": string;
337
338
  "requires-additional-handling": string;
338
339
  addOns: string;
339
340
  contentDescription: string;
@@ -363,10 +364,7 @@ export declare const Element: ({ resources, ...props }: LabelsGridProps & import
363
364
  fractional: string;
364
365
  };
365
366
  weightGroup: string;
366
- today: string; /**
367
- * `onViewDetails` is a callback function that controls the "View Details" action button and
368
- * will be invoked when the user clicks on it.
369
- */
367
+ today: string;
370
368
  };
371
369
  hints: {
372
370
  contentDescription: string;
@@ -992,6 +990,7 @@ export declare const Element: ({ resources, ...props }: LabelsGridProps & import
992
990
  shipmentId: string;
993
991
  labelId: string;
994
992
  labelIdFilter: string;
993
+ filteredStatus: string;
995
994
  filteredTrackingStatus: string;
996
995
  more: string;
997
996
  createdDate: string;
@@ -296,6 +296,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & import(
296
296
  results: string;
297
297
  };
298
298
  fields: {
299
+ "requires-additional-handling-link": string;
299
300
  "requires-additional-handling": string;
300
301
  addOns: string;
301
302
  contentDescription: string;
@@ -934,6 +935,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & import(
934
935
  shipmentId: string;
935
936
  labelId: string;
936
937
  labelIdFilter: string;
938
+ filteredStatus: string;
937
939
  filteredTrackingStatus: string;
938
940
  more: string;
939
941
  createdDate: string;
@@ -295,6 +295,7 @@ export declare const Element: ({ resources, ...props }: ExternalCarriersProps &
295
295
  results: string;
296
296
  };
297
297
  fields: {
298
+ "requires-additional-handling-link": string;
298
299
  "requires-additional-handling": string;
299
300
  addOns: string;
300
301
  contentDescription: string;
@@ -977,6 +978,7 @@ export declare const Element: ({ resources, ...props }: ExternalCarriersProps &
977
978
  shipmentId: string;
978
979
  labelId: string;
979
980
  labelIdFilter: string;
981
+ filteredStatus: string;
980
982
  filteredTrackingStatus: string;
981
983
  more: string;
982
984
  createdDate: string;
@@ -273,6 +273,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & import(
273
273
  results: string;
274
274
  };
275
275
  fields: {
276
+ "requires-additional-handling-link": string;
276
277
  "requires-additional-handling": string;
277
278
  addOns: string;
278
279
  contentDescription: string;
@@ -911,6 +912,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & import(
911
912
  shipmentId: string;
912
913
  labelId: string;
913
914
  labelIdFilter: string;
915
+ filteredStatus: string;
914
916
  filteredTrackingStatus: string;
915
917
  more: string;
916
918
  createdDate: string;
@@ -289,6 +289,7 @@ export declare const Element: ({ resources, ...props }: import("../../create-ele
289
289
  results: string;
290
290
  };
291
291
  fields: {
292
+ "requires-additional-handling-link": string;
292
293
  "requires-additional-handling": string;
293
294
  addOns: string;
294
295
  contentDescription: string;
@@ -945,6 +946,7 @@ export declare const Element: ({ resources, ...props }: import("../../create-ele
945
946
  shipmentId: string;
946
947
  labelId: string;
947
948
  labelIdFilter: string;
949
+ filteredStatus: string;
948
950
  filteredTrackingStatus: string;
949
951
  more: string;
950
952
  createdDate: string;
@@ -272,6 +272,7 @@ export declare const Element: ({ resources, ...props }: PaymentMethodSettingsPro
272
272
  results: string;
273
273
  };
274
274
  fields: {
275
+ "requires-additional-handling-link": string;
275
276
  "requires-additional-handling": string;
276
277
  addOns: string;
277
278
  contentDescription: string;
@@ -910,6 +911,7 @@ export declare const Element: ({ resources, ...props }: PaymentMethodSettingsPro
910
911
  shipmentId: string;
911
912
  labelId: string;
912
913
  labelIdFilter: string;
914
+ filteredStatus: string;
913
915
  filteredTrackingStatus: string;
914
916
  more: string;
915
917
  createdDate: string;
@@ -8,6 +8,7 @@ export type UseRatesFormProps = {
8
8
  onBeforeLabelCreate?: (rate: SE.Rate, shipment: SE.SalesOrderShipment) => Promise<void> | Promise<{
9
9
  error?: SE.CodedError;
10
10
  rate?: SE.Rate;
11
+ labelMessages?: SE.SalesOrderShipment["packages"][0]["labelMessages"];
11
12
  } | undefined> | void;
12
13
  onBeforeRateSaved?: (carrierId: string, serviceCode: string) => Promise<void> | Promise<{
13
14
  data?: {
@@ -517,6 +517,7 @@ export declare const Element: ({ resources, ...props }: PurchaseLabelCommonProps
517
517
  results: string;
518
518
  };
519
519
  fields: {
520
+ "requires-additional-handling-link": string;
520
521
  "requires-additional-handling": string;
521
522
  addOns: string;
522
523
  contentDescription: string;
@@ -570,6 +571,10 @@ export declare const Element: ({ resources, ...props }: PurchaseLabelCommonProps
570
571
  uspsMediaMailAcknowledgement: string;
571
572
  uspsFirstClassMailAcknowledgement_leof: string;
572
573
  rateSavings: string;
574
+ /**
575
+ * `onBeforeRateSave` is an async/sync callback function that will be invoked before each time a user
576
+ * saves a rate.
577
+ */
573
578
  upsGroundSaverTermsAcknowledgement: string;
574
579
  dhlExpressTermsAcknowledgement: string;
575
580
  noRateService: string;
@@ -600,23 +605,19 @@ export declare const Element: ({ resources, ...props }: PurchaseLabelCommonProps
600
605
  moreLocations: string;
601
606
  nearestLocation: string;
602
607
  open: string;
603
- nextOpeningDay: string; /**
604
- * `onRateSaved` is an async/sync callback function that will be invoked each time a rate is
605
- * saved by the user when rate shopping in the host application.
606
- */
608
+ nextOpeningDay: string;
607
609
  until: string;
608
610
  selected: string;
609
611
  select: string;
610
612
  today: string;
611
- viewMap: string;
613
+ viewMap: string; /**
614
+ * `onRatesCalculated` is an async/sync callback function that will be invoked each time rates
615
+ * are calculated for a given shipment.
616
+ */
612
617
  otherLocations: string;
613
618
  noServicePointsForService: string;
614
619
  error: string;
615
620
  paperless: string;
616
- /**
617
- * `onShipmentUpdated` is an async/sync callback function that will be invoked each time a
618
- * shipment is updated with a new `ShipTo/ShipFrom Address`, `rate`, `preset`, etc.
619
- */
620
621
  localTimeDisclaimer: string;
621
622
  };
622
623
  shipToAddressFormFields: string;
@@ -1169,6 +1170,7 @@ export declare const Element: ({ resources, ...props }: PurchaseLabelCommonProps
1169
1170
  shipmentId: string;
1170
1171
  labelId: string;
1171
1172
  labelIdFilter: string;
1173
+ filteredStatus: string;
1172
1174
  filteredTrackingStatus: string;
1173
1175
  more: string;
1174
1176
  createdDate: string;
@@ -271,6 +271,7 @@ export declare const Element: ({ resources, ...props }: import("../../create-ele
271
271
  results: string;
272
272
  };
273
273
  fields: {
274
+ "requires-additional-handling-link": string;
274
275
  "requires-additional-handling": string;
275
276
  addOns: string;
276
277
  contentDescription: string;
@@ -909,6 +910,7 @@ export declare const Element: ({ resources, ...props }: import("../../create-ele
909
910
  shipmentId: string;
910
911
  labelId: string;
911
912
  labelIdFilter: string;
913
+ filteredStatus: string;
912
914
  filteredTrackingStatus: string;
913
915
  more: string;
914
916
  createdDate: string;
@@ -364,6 +364,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & import(
364
364
  results: string;
365
365
  };
366
366
  fields: {
367
+ "requires-additional-handling-link": string;
367
368
  "requires-additional-handling": string;
368
369
  addOns: string;
369
370
  contentDescription: string;
@@ -1038,6 +1039,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & import(
1038
1039
  shipmentId: string;
1039
1040
  labelId: string;
1040
1041
  labelIdFilter: string;
1042
+ filteredStatus: string;
1041
1043
  filteredTrackingStatus: string;
1042
1044
  more: string;
1043
1045
  createdDate: string;
@@ -1,17 +1,19 @@
1
+ /// <reference types="react" />
1
2
  import { IGridFilters } from "../../../components/grid-filters";
2
3
  import { SE } from "@shipengine/js-api";
3
- import { ShipmentsGridProps } from "../shipments-grid";
4
- export declare const useShipmentsGrid: ({ shipmentStatus, showShipmentIdFilter, showCreatedDateFilter, sortBy, sortDir, }: {
5
- shipmentStatus: ShipmentsGridProps["shipmentStatus"];
6
- showCreatedDateFilter: ShipmentsGridProps["showCreatedDateFilter"];
7
- showShipmentIdFilter: ShipmentsGridProps["showShipmentIdFilter"];
4
+ type ShipmentsGridHookProps = {
5
+ shipmentStatus?: SE.ShipmentStatus;
6
+ showCreatedDateFilter?: boolean;
7
+ showShipmentIdFilter?: boolean;
8
8
  sortBy?: SE.SortableQuery["sortBy"];
9
9
  sortDir?: SE.SortableQuery["sortDir"];
10
- }) => {
10
+ };
11
+ export declare const useShipmentsGrid: ({ shipmentStatus, showShipmentIdFilter, showCreatedDateFilter, sortBy, sortDir, }: ShipmentsGridHookProps) => {
11
12
  clearAllFilters: () => void;
12
13
  filters: IGridFilters;
13
14
  getGridData: () => {
14
15
  disableOnRowClick: boolean;
16
+ isLoading: boolean;
15
17
  serviceName: string | null | undefined;
16
18
  addressValidation?: SE.AddressValidation | undefined;
17
19
  advancedOptions?: {
@@ -109,9 +111,11 @@ export declare const useShipmentsGrid: ({ shipmentStatus, showShipmentIdFilter,
109
111
  showPagination: boolean;
110
112
  totalElements: number;
111
113
  };
114
+ setActiveShipmentId: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
112
115
  setFilters: (newFilters: IGridFilters) => void;
113
116
  shipments: {
114
117
  disableOnRowClick: boolean;
118
+ isLoading: boolean;
115
119
  serviceName: string | null | undefined;
116
120
  addressValidation?: SE.AddressValidation | undefined;
117
121
  advancedOptions?: {
@@ -194,3 +198,4 @@ export declare const useShipmentsGrid: ({ shipmentStatus, showShipmentIdFilter,
194
198
  }[] | undefined;
195
199
  shouldShowFilters: boolean;
196
200
  };
201
+ export {};
@@ -12,9 +12,11 @@ export type ShipmentsGridProps = {
12
12
  */
13
13
  onClickCancelShipment?: (shipment: SE.Shipment) => void;
14
14
  /**
15
- * `onRowClick` callback invoked when a row is clicked.
15
+ * `onRowClick` callback invoked when a row is clicked. You can pass a Promise, when you do the selected Shipment
16
+ * will be marked as "active", and we’ll wait for the Promise to resolve before removing that "active" state.
17
+ * An "active" Shipment is displayed in a "loading" state within the table.
16
18
  */
17
- onRowClick?: (data: SE.Shipment) => void;
19
+ onRowClick?: (data: SE.Shipment) => void | Promise<void>;
18
20
  /**
19
21
  * `shipmentStatus` is the status of the shipments you wish to view.
20
22
  * If no value is defined, all shipments will be rendered.
@@ -50,7 +52,7 @@ export type ShipmentsGridProps = {
50
52
  *
51
53
  * @see {@link ShipmentsGrid.Element | The **Element** created to render `<ShipmentsGrid />`}
52
54
  */
53
- export declare const Component: ({ onRowClick, onClickCancelShipment, shipmentStatus, showShipmentIdFilter, showCreatedDateFilter, }: ShipmentsGridProps) => import("@emotion/react/jsx-runtime").JSX.Element;
55
+ export declare const Component: ({ onRowClick: onRowClickProp, onClickCancelShipment, shipmentStatus, showShipmentIdFilter, showCreatedDateFilter, }: ShipmentsGridProps) => import("@emotion/react/jsx-runtime").JSX.Element;
54
56
  /**
55
57
  * # Registered Shipments Grid Element
56
58
  *
@@ -348,6 +350,7 @@ export declare const Element: ({ resources, ...props }: ShipmentsGridProps & imp
348
350
  results: string;
349
351
  };
350
352
  fields: {
353
+ "requires-additional-handling-link": string;
351
354
  "requires-additional-handling": string;
352
355
  addOns: string;
353
356
  contentDescription: string;
@@ -504,7 +507,9 @@ export declare const Element: ({ resources, ...props }: ShipmentsGridProps & imp
504
507
  shipEngineToS: string;
505
508
  auctanePrivacyPolicy: string;
506
509
  aHR0cHM6Ly9teWRobC5leHByZXNzLmRobC91cy9lbi9sZWdhbC90ZXJtcy1hbmQtY29uZGl0aW9ucy5odG1s: string;
507
- "aHR0cHM6Ly93d3cuc3RhbXBzLmNvbS9wcml2YWN5LXBvbGljeQ==": string;
510
+ "aHR0cHM6Ly93d3cuc3RhbXBzLmNvbS9wcml2YWN5LXBvbGljeQ==": string; /**
511
+ * `showCreatedDateFilter` controls the display of the Created Date filter
512
+ */
508
513
  "aHR0cHM6Ly93d3cuc3RhbXBzLmNvbS9jb25kaXRpb25zLw==": string;
509
514
  "aHR0cHM6Ly93d3cudXBzLmNvbS91cy9lbi9zdXBwb3J0L3NoaXBwaW5nLXN1cHBvcnQvc2hpcHBpbmctc3BlY2lhbC1jYXJlLXJlZ3VsYXRlZC1pdGVtcy9wcm9oaWJpdGVkLWl0ZW1zLnBhZ2U=": string;
510
515
  aHR0cHM6Ly93d3cudXBzLmNvbS9hc3NldHMvcmVzb3VyY2VzL21lZGlhL2VuX1VTL1VQU19EQVBfVEMucGRm: string;
@@ -989,6 +994,7 @@ export declare const Element: ({ resources, ...props }: ShipmentsGridProps & imp
989
994
  shipmentId: string;
990
995
  labelId: string;
991
996
  labelIdFilter: string;
997
+ filteredStatus: string;
992
998
  filteredTrackingStatus: string;
993
999
  more: string;
994
1000
  createdDate: string;
@@ -1010,7 +1016,27 @@ export declare const Element: ({ resources, ...props }: ShipmentsGridProps & imp
1010
1016
  none: string;
1011
1017
  parcelguard: string;
1012
1018
  shipsurance: string;
1013
- thirdParty: string;
1019
+ thirdParty: string; /**
1020
+ * # Registered Shipments Grid Element
1021
+ *
1022
+ * @param ShipmentsGridProps The props necessary to render the `<ShipmentsGrid.Element />`.
1023
+ *
1024
+ * @example
1025
+ * The `<Component />` is the source JSX that is rendered when you make use of the `ShipmentsGrid`
1026
+ * Element directly.
1027
+ *
1028
+ * ```tsx
1029
+ * <ShipmentsGrid.Element
1030
+ * shipmentStatus="pending"
1031
+ * onRowClick={(shipment) => console.log('Row clicked', shipment)}
1032
+ * />
1033
+ * ```
1034
+ *
1035
+ * <br />
1036
+ *
1037
+ * @see {@link ShipmentsGrid.ShipmentsGridProps | The **Base props** used in `<ShipmentsGrid.Element />`}
1038
+ *
1039
+ */
1014
1040
  x_cover: string;
1015
1041
  };
1016
1042
  loading: {
@@ -273,6 +273,7 @@ export declare const Element: ({ resources, ...props }: ConfigureThemeProps & im
273
273
  results: string;
274
274
  };
275
275
  fields: {
276
+ "requires-additional-handling-link": string;
276
277
  "requires-additional-handling": string;
277
278
  addOns: string;
278
279
  contentDescription: string;
@@ -911,6 +912,7 @@ export declare const Element: ({ resources, ...props }: ConfigureThemeProps & im
911
912
  shipmentId: string;
912
913
  labelId: string;
913
914
  labelIdFilter: string;
915
+ filteredStatus: string;
914
916
  filteredTrackingStatus: string;
915
917
  more: string;
916
918
  createdDate: string;
@@ -271,6 +271,7 @@ export declare const Element: ({ resources, ...props }: import("../../create-ele
271
271
  results: string;
272
272
  };
273
273
  fields: {
274
+ "requires-additional-handling-link": string;
274
275
  "requires-additional-handling": string;
275
276
  addOns: string;
276
277
  contentDescription: string;
@@ -909,6 +910,7 @@ export declare const Element: ({ resources, ...props }: import("../../create-ele
909
910
  shipmentId: string;
910
911
  labelId: string;
911
912
  labelIdFilter: string;
913
+ filteredStatus: string;
912
914
  filteredTrackingStatus: string;
913
915
  more: string;
914
916
  createdDate: string;