@shipengine/elements 2.21.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.
- package/cjs/components/grid-controller/grid-controller.cjs +49 -17
- package/cjs/components/grid-controller/grid-controller.styles.cjs +7 -2
- package/cjs/components/grid-controller/grid-footer.cjs +30 -15
- package/cjs/components/grid-controller/grid-footer.styles.cjs +24 -0
- package/cjs/components/grid-controller/index.cjs +1 -1
- package/cjs/components/grid-controller/sortable-header/index.cjs +9 -0
- package/cjs/components/grid-controller/{sortable-header.cjs → sortable-header/sortable-header.cjs} +3 -5
- package/cjs/components/grid-controller/sortable-header/sortable-header.styles.cjs +18 -0
- package/cjs/components/grid-filters/components/created-date-filter/created-date-filter.cjs +3 -0
- package/cjs/components/grid-filters/components/index.cjs +2 -0
- package/cjs/components/grid-filters/components/label-id-filter/label-id-filter.cjs +2 -0
- package/cjs/components/grid-filters/components/label-status-filter/index.cjs +9 -0
- package/cjs/components/grid-filters/components/label-status-filter/label-status-filter-schema.cjs +12 -0
- package/cjs/components/grid-filters/components/label-status-filter/label-status-filter.cjs +174 -0
- package/cjs/components/grid-filters/components/label-status-filter/label-status-filter.styles.cjs +21 -0
- package/cjs/components/grid-filters/components/shipment-id-filter/shipment-id-filter.cjs +2 -0
- package/cjs/components/grid-filters/components/tracking-status-filter/tracking-status-filter.cjs +23 -12
- package/cjs/components/grid-filters/grid-filters.cjs +12 -1
- package/cjs/elements/labels-grid/hooks/use-labels-grid.cjs +78 -31
- package/cjs/elements/labels-grid/hooks/use-tracking-status-filter.cjs +109 -0
- package/cjs/elements/labels-grid/labels-grid.cjs +56 -30
- package/cjs/elements/purchase-label/components/customs-forms/customs-forms.cjs +10 -3
- package/cjs/elements/purchase-label/components/fund-and-purchase/fund-and-purchase.cjs +22 -14
- package/cjs/elements/purchase-label/components/rate-form/rate-form.cjs +1 -1
- package/cjs/elements/purchase-label/components/rate-form/rate-view.cjs +4 -9
- package/cjs/elements/purchase-label/components/shipment-form/shipment-form.cjs +11 -5
- package/cjs/elements/purchase-label/configure-shipment.cjs +3 -1
- package/cjs/elements/purchase-label/hooks/use-rates-form.cjs +38 -16
- package/cjs/elements/purchase-label/purchase-label.cjs +0 -1
- package/cjs/elements/shipments-grid/hooks/use-shipments-grid.cjs +11 -6
- package/cjs/elements/shipments-grid/shipments-grid.cjs +67 -28
- package/cjs/hooks/index.cjs +3 -0
- package/cjs/hooks/use-configure-shipment.cjs +1 -34
- package/cjs/hooks/use-sortable-query.cjs +36 -0
- package/cjs/index.cjs +5 -0
- package/cjs/locales/en/common.cjs +3 -1
- package/cjs/locales/en/purchase-label.cjs +2 -1
- package/cjs/package.cjs +1 -1
- package/cjs/utilities/feature-flags/feature-flags.cjs +1 -1
- package/cjs/workflows/label-workflow/label-workflow.cjs +0 -1
- package/esm/components/grid-controller/grid-controller.js +51 -19
- package/esm/components/grid-controller/grid-controller.styles.js +7 -2
- package/esm/components/grid-controller/grid-footer.js +32 -17
- package/esm/components/grid-controller/grid-footer.styles.js +20 -0
- package/esm/components/grid-controller/index.js +1 -1
- package/esm/components/grid-controller/sortable-header/index.js +1 -0
- package/esm/components/grid-controller/{sortable-header.js → sortable-header/sortable-header.js} +3 -5
- package/esm/components/grid-controller/sortable-header/sortable-header.styles.js +14 -0
- package/esm/components/grid-filters/components/created-date-filter/created-date-filter.js +3 -0
- package/esm/components/grid-filters/components/index.js +1 -0
- package/esm/components/grid-filters/components/label-id-filter/label-id-filter.js +2 -0
- package/esm/components/grid-filters/components/label-status-filter/index.js +1 -0
- package/esm/components/grid-filters/components/label-status-filter/label-status-filter-schema.js +8 -0
- package/esm/components/grid-filters/components/label-status-filter/label-status-filter.js +170 -0
- package/esm/components/grid-filters/components/label-status-filter/label-status-filter.styles.js +17 -0
- package/esm/components/grid-filters/components/shipment-id-filter/shipment-id-filter.js +2 -0
- package/esm/components/grid-filters/components/tracking-status-filter/tracking-status-filter.js +23 -12
- package/esm/components/grid-filters/grid-filters.js +12 -1
- package/esm/elements/labels-grid/hooks/use-labels-grid.js +79 -32
- package/esm/elements/labels-grid/hooks/use-tracking-status-filter.js +105 -0
- package/esm/elements/labels-grid/labels-grid.js +57 -31
- package/esm/elements/purchase-label/components/customs-forms/customs-forms.js +10 -3
- package/esm/elements/purchase-label/components/fund-and-purchase/fund-and-purchase.js +22 -14
- package/esm/elements/purchase-label/components/rate-form/rate-form.js +1 -1
- package/esm/elements/purchase-label/components/rate-form/rate-view.js +4 -9
- package/esm/elements/purchase-label/components/shipment-form/shipment-form.js +11 -5
- package/esm/elements/purchase-label/configure-shipment.js +3 -1
- package/esm/elements/purchase-label/hooks/use-rates-form.js +38 -16
- package/esm/elements/purchase-label/purchase-label.js +0 -1
- package/esm/elements/shipments-grid/hooks/use-shipments-grid.js +11 -6
- package/esm/elements/shipments-grid/shipments-grid.js +68 -29
- package/esm/hooks/index.js +1 -0
- package/esm/hooks/use-configure-shipment.js +3 -36
- package/esm/hooks/use-sortable-query.js +32 -0
- package/esm/index.js +2 -0
- package/esm/locales/en/common.js +3 -1
- package/esm/locales/en/purchase-label.js +2 -1
- package/esm/package.js +1 -1
- package/esm/utilities/feature-flags/feature-flags.js +1 -1
- package/esm/workflows/label-workflow/label-workflow.js +0 -1
- package/package.json +15 -4
- package/types/src/components/grid-controller/grid-controller.d.ts +4 -1
- package/types/src/components/grid-controller/grid-controller.styles.d.ts +6 -1
- package/types/src/components/grid-controller/grid-footer.d.ts +9 -1
- package/types/src/components/grid-controller/grid-footer.styles.d.ts +16 -0
- package/types/src/components/grid-controller/sortable-header/index.d.ts +1 -0
- package/types/src/components/grid-controller/{sortable-header.d.ts → sortable-header/sortable-header.d.ts} +2 -2
- package/types/src/components/grid-controller/sortable-header/sortable-header.styles.d.ts +10 -0
- package/types/src/components/grid-filters/components/created-date-filter/created-date-filter.d.ts +2 -1
- package/types/src/components/grid-filters/components/index.d.ts +1 -0
- package/types/src/components/grid-filters/components/label-id-filter/label-id-filter.d.ts +2 -1
- package/types/src/components/grid-filters/components/label-status-filter/index.d.ts +1 -0
- package/types/src/components/grid-filters/components/label-status-filter/label-status-filter-schema.d.ts +12 -0
- package/types/src/components/grid-filters/components/label-status-filter/label-status-filter.d.ts +24 -0
- package/types/src/components/grid-filters/components/label-status-filter/label-status-filter.styles.d.ts +13 -0
- package/types/src/components/grid-filters/components/shipment-id-filter/shipment-id-filter.d.ts +2 -1
- package/types/src/components/grid-filters/components/tracking-status-filter/tracking-status-filter.d.ts +2 -1
- package/types/src/components/grid-filters/grid-filters.d.ts +4 -1
- package/types/src/elements/labels-grid/hooks/use-labels-grid.d.ts +5 -3
- package/types/src/elements/labels-grid/hooks/use-tracking-status-filter.d.ts +25 -0
- package/types/src/elements/labels-grid/labels-grid.d.ts +34 -20
- package/types/src/elements/manage-carriers/manage-carriers.d.ts +3 -0
- package/types/src/elements/manage-external-carriers/manage-external-carriers.d.ts +3 -0
- package/types/src/elements/manage-funding/manage-funding-element.d.ts +3 -0
- package/types/src/elements/manage-warehouses/manage-warehouses.d.ts +3 -0
- package/types/src/elements/payment-method-settings/payment-method-settings-element.d.ts +3 -0
- package/types/src/elements/purchase-label/components/fund-and-purchase/fund-and-purchase.d.ts +2 -2
- package/types/src/elements/purchase-label/hooks/use-rates-form.d.ts +1 -0
- package/types/src/elements/purchase-label/purchase-label.d.ts +12 -9
- package/types/src/elements/select-label-layout/select-label-layout-element.d.ts +3 -0
- package/types/src/elements/shipment-summary/shipment-summary.d.ts +3 -0
- package/types/src/elements/shipments-grid/hooks/use-shipments-grid.d.ts +13 -2
- package/types/src/elements/shipments-grid/shipments-grid.d.ts +41 -6
- package/types/src/elements/theme-creator/theme-creator.d.ts +3 -0
- package/types/src/elements/transaction-history/transaction-history-element.d.ts +3 -0
- package/types/src/elements/unit-settings/unit-settings-element.d.ts +3 -0
- package/types/src/elements/vat-settings/vat-settings-element.d.ts +3 -0
- package/types/src/elements/void-label/void-label.d.ts +34 -0
- package/types/src/hooks/index.d.ts +1 -0
- package/types/src/hooks/use-configure-shipment.d.ts +1 -2
- package/types/src/hooks/use-sortable-query.d.ts +13 -0
- package/types/src/index.d.ts +5 -0
- package/types/src/locales/en/index.d.ts +3 -0
- package/types/src/utilities/feature-flags/types.d.ts +5 -1
- package/types/src/workflows/account-settings/account-settings.d.ts +3 -0
- package/types/src/workflows/carrier-services/carrier-services.d.ts +3 -0
- package/types/src/workflows/connect-external-carrier/connect-external-carrier.d.ts +3 -0
- package/types/src/workflows/label-workflow/label-workflow.d.ts +11 -1
- package/types/src/workflows/onboarding/onboarding.d.ts +3 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
|
|
3
|
+
const useSortableQuery = ({
|
|
4
|
+
defaultSortBy: _defaultSortBy = "modified_at",
|
|
5
|
+
defaultSortDir: _defaultSortDir = "desc"
|
|
6
|
+
}) => {
|
|
7
|
+
const [sortState, setSortState] = useState({
|
|
8
|
+
by: _defaultSortBy,
|
|
9
|
+
createdAtDir: _defaultSortDir,
|
|
10
|
+
dir: _defaultSortDir,
|
|
11
|
+
modifiedAtDir: _defaultSortDir
|
|
12
|
+
});
|
|
13
|
+
const toggleSort = sortQuery => {
|
|
14
|
+
const newSortState = Object.assign({}, sortState);
|
|
15
|
+
if (sortQuery === "created_at") {
|
|
16
|
+
newSortState.createdAtDir = sortState.createdAtDir === "asc" ? "desc" : "asc";
|
|
17
|
+
newSortState.dir = newSortState.createdAtDir;
|
|
18
|
+
newSortState.by = "created_at";
|
|
19
|
+
} else if (sortQuery === "modified_at") {
|
|
20
|
+
newSortState.modifiedAtDir = sortState.modifiedAtDir === "asc" ? "desc" : "asc";
|
|
21
|
+
newSortState.dir = newSortState.modifiedAtDir;
|
|
22
|
+
newSortState.by = "modified_at";
|
|
23
|
+
}
|
|
24
|
+
setSortState(newSortState);
|
|
25
|
+
};
|
|
26
|
+
return {
|
|
27
|
+
sortState,
|
|
28
|
+
toggleSort
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export { useSortableQuery };
|
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';
|
package/esm/locales/en/common.js
CHANGED
|
@@ -212,12 +212,14 @@ var common = {
|
|
|
212
212
|
grid: {
|
|
213
213
|
"row-count_one": "Showing {{firstIndex}}-{{lastIndex}} of <0>{{count}} item</0>",
|
|
214
214
|
"row-count_other": "Showing {{firstIndex}}-{{lastIndex}} of <0>{{count}} items</0>",
|
|
215
|
+
"row-count-plus_other": "Showing {{firstIndex}}-{{lastIndex}} of <0>{{count}}+ items</0>",
|
|
215
216
|
rows: "Rows",
|
|
216
217
|
clearAll: "Clear all",
|
|
217
218
|
shipmentId: "Shipment ID",
|
|
218
219
|
labelId: "Label ID",
|
|
219
220
|
labelIdFilter: "{{name}}: {{labelId}}",
|
|
220
|
-
|
|
221
|
+
filteredStatus: "{{name}}: {{filter}}",
|
|
222
|
+
filteredTrackingStatus: "{{name}}: {{filter}}",
|
|
221
223
|
more: ", +{{count}} more",
|
|
222
224
|
createdDate: "Created Date",
|
|
223
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
|
@@ -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.
|
|
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-
|
|
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": {
|
|
@@ -269,8 +280,8 @@
|
|
|
269
280
|
"@rollup/plugin-node-resolve": "13.3.0",
|
|
270
281
|
"@shipengine/giger": "1.20.18",
|
|
271
282
|
"@shipengine/giger-theme": "1.8.1",
|
|
272
|
-
"@shipengine/js-api": "3.
|
|
273
|
-
"@shipengine/react-api": "3.
|
|
283
|
+
"@shipengine/js-api": "3.8.0",
|
|
284
|
+
"@shipengine/react-api": "3.11.0",
|
|
274
285
|
"@tanstack/react-query": "4.36.1",
|
|
275
286
|
"@testing-library/dom": "8.19.0",
|
|
276
287
|
"axios": "1.8.4",
|
|
@@ -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
|
|
@@ -22,6 +24,7 @@ type GridProps<T extends GridDataType> = {
|
|
|
22
24
|
emptyContent?: ReactNode;
|
|
23
25
|
filters?: ReactNode;
|
|
24
26
|
footerContent?: ReactNode;
|
|
27
|
+
isLoading?: boolean;
|
|
25
28
|
onRowClick?: (data: T) => void;
|
|
26
29
|
useCheckboxes?: boolean;
|
|
27
30
|
};
|
|
@@ -34,5 +37,5 @@ type GridProps<T extends GridDataType> = {
|
|
|
34
37
|
*
|
|
35
38
|
* @see {@link GridProps | The props for the `<GridController />` component}
|
|
36
39
|
*/
|
|
37
|
-
export declare const GridController: <T extends GridDataType>({ columns, data, footerContent, onRowClick, useCheckboxes, filters, emptyContent, }: GridProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
40
|
+
export declare const GridController: <T extends GridDataType>({ columns, data, footerContent, onRowClick, isLoading, useCheckboxes, filters, emptyContent, }: GridProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
38
41
|
export {};
|
|
@@ -3,8 +3,12 @@ export declare const styles: {
|
|
|
3
3
|
width: number;
|
|
4
4
|
};
|
|
5
5
|
filters: (theme: import("../../utilities/styles").ScopedGigerTheme) => {
|
|
6
|
+
backgroundColor: string;
|
|
6
7
|
borderBottom: string;
|
|
7
|
-
padding:
|
|
8
|
+
padding: number;
|
|
9
|
+
};
|
|
10
|
+
skeletonTableRow: () => {
|
|
11
|
+
height: string;
|
|
8
12
|
};
|
|
9
13
|
table: {
|
|
10
14
|
tableLayout: "initial";
|
|
@@ -24,5 +28,6 @@ export declare const styles: {
|
|
|
24
28
|
borderRadius?: string | undefined;
|
|
25
29
|
boxShadow?: string | undefined;
|
|
26
30
|
height: string;
|
|
31
|
+
overflow: "hidden";
|
|
27
32
|
};
|
|
28
33
|
};
|
|
@@ -7,6 +7,14 @@
|
|
|
7
7
|
* @see {@link GridFooter | The `<GridFooter />` component}
|
|
8
8
|
*/
|
|
9
9
|
interface GridFooterProps {
|
|
10
|
+
/**
|
|
11
|
+
* If true, indicates there might be more results beyond what's been fetched
|
|
12
|
+
*/
|
|
13
|
+
hasMoreUnfetchedResults?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* If true, displays a loading indicator in the pagination area
|
|
16
|
+
*/
|
|
17
|
+
isLoadingMore?: boolean;
|
|
10
18
|
onPageChange: (nextPage: number) => void;
|
|
11
19
|
page: number;
|
|
12
20
|
pages: number;
|
|
@@ -23,5 +31,5 @@ interface GridFooterProps {
|
|
|
23
31
|
*
|
|
24
32
|
* @see {@link GridFooterProps | The props for the `<GridFooter />` component}
|
|
25
33
|
*/
|
|
26
|
-
export declare const GridFooter: ({ page, pages, pageSize, total, showPagination, onPageChange, }: GridFooterProps) => JSX.Element;
|
|
34
|
+
export declare const GridFooter: ({ page, pages, pageSize, total, showPagination, onPageChange, isLoadingMore, hasMoreUnfetchedResults, }: GridFooterProps) => JSX.Element;
|
|
27
35
|
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const styles: {
|
|
2
|
+
countWrapper: (theme: import("../../utilities/styles").ScopedGigerTheme) => {
|
|
3
|
+
alignItems: "center";
|
|
4
|
+
display: "flex";
|
|
5
|
+
gap: number;
|
|
6
|
+
};
|
|
7
|
+
loader: (theme: import("../../utilities/styles").ScopedGigerTheme) => {
|
|
8
|
+
color: string;
|
|
9
|
+
};
|
|
10
|
+
wrapper: {
|
|
11
|
+
alignItems: "center";
|
|
12
|
+
display: "flex";
|
|
13
|
+
justifyContent: "space-between";
|
|
14
|
+
width: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./sortable-header";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { SE } from "@shipengine/js-api";
|
|
2
2
|
export interface SortableHeaderProps {
|
|
3
3
|
/**
|
|
4
4
|
* The text to display in the header
|
|
@@ -11,7 +11,7 @@ export interface SortableHeaderProps {
|
|
|
11
11
|
/**
|
|
12
12
|
* The current sort direction
|
|
13
13
|
*/
|
|
14
|
-
sortDirection:
|
|
14
|
+
sortDirection: SE.SortableQuery["sortDir"];
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* A reusable component for creating sortable table headers
|
package/types/src/components/grid-filters/components/created-date-filter/created-date-filter.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { IGridFilters } from "../../grid-filters";
|
|
|
7
7
|
* @see {@link CreatedDateFilter | The `<CreatedDateFilter />` component}
|
|
8
8
|
*/
|
|
9
9
|
type CreatedDateFilterProps = {
|
|
10
|
+
disabled?: boolean;
|
|
10
11
|
filters: IGridFilters;
|
|
11
12
|
onFiltersUpdated: (params: IGridFilters) => void;
|
|
12
13
|
};
|
|
@@ -19,5 +20,5 @@ type CreatedDateFilterProps = {
|
|
|
19
20
|
*
|
|
20
21
|
* @see {@link CreatedDateFilterProps | The props for the `<CreatedDateFilter />` component}
|
|
21
22
|
*/
|
|
22
|
-
export declare const CreatedDateFilter: ({ filters, onFiltersUpdated }: CreatedDateFilterProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const CreatedDateFilter: ({ disabled, filters, onFiltersUpdated, }: CreatedDateFilterProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
23
24
|
export {};
|
|
@@ -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";
|
|
@@ -7,6 +7,7 @@ import { IGridFilters } from "../../grid-filters";
|
|
|
7
7
|
* @see {@link LabelIdFilter | The `<LabelIdFilter />` component}
|
|
8
8
|
*/
|
|
9
9
|
type LabelIdFilterProps = {
|
|
10
|
+
disabled?: boolean;
|
|
10
11
|
filters: IGridFilters;
|
|
11
12
|
onFiltersUpdated: (params: IGridFilters) => void;
|
|
12
13
|
};
|
|
@@ -19,5 +20,5 @@ type LabelIdFilterProps = {
|
|
|
19
20
|
*
|
|
20
21
|
* @see {@link LabelIdFilterProps | The props for the `<LabelIdFilter />` component}
|
|
21
22
|
*/
|
|
22
|
-
export declare const LabelIdFilter: ({ filters, onFiltersUpdated }: LabelIdFilterProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const LabelIdFilter: ({ disabled, filters, onFiltersUpdated, }: LabelIdFilterProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
23
24
|
export {};
|
|
@@ -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
|
+
};
|
package/types/src/components/grid-filters/components/label-status-filter/label-status-filter.d.ts
ADDED
|
@@ -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
|
+
};
|
package/types/src/components/grid-filters/components/shipment-id-filter/shipment-id-filter.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { IGridFilters } from "../../grid-filters";
|
|
|
7
7
|
* @see {@link ShipmentIdFilter | The `<ShipmentIdFilter />` component}
|
|
8
8
|
*/
|
|
9
9
|
type ShipmentIdFilterProps = {
|
|
10
|
+
disabled?: boolean;
|
|
10
11
|
filters: IGridFilters;
|
|
11
12
|
onFiltersUpdated: (params: IGridFilters) => void;
|
|
12
13
|
};
|
|
@@ -19,5 +20,5 @@ type ShipmentIdFilterProps = {
|
|
|
19
20
|
*
|
|
20
21
|
* @see {@link ShipmentIdFilterProps | The props for the `<ShipmentIdFilter />` component}
|
|
21
22
|
*/
|
|
22
|
-
export declare const ShipmentIdFilter: ({ filters, onFiltersUpdated }: ShipmentIdFilterProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const ShipmentIdFilter: ({ disabled, filters, onFiltersUpdated, }: ShipmentIdFilterProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
23
24
|
export {};
|
|
@@ -7,6 +7,7 @@ import { IGridFilters } from "../../grid-filters";
|
|
|
7
7
|
* @see {@link TrackingStatusFilter | The `<TrackingStatusFilter />` component}
|
|
8
8
|
*/
|
|
9
9
|
type TrackingStatusFilterProps = {
|
|
10
|
+
disabled?: boolean;
|
|
10
11
|
filters: IGridFilters;
|
|
11
12
|
onFiltersUpdated: (params: IGridFilters) => void;
|
|
12
13
|
};
|
|
@@ -19,5 +20,5 @@ type TrackingStatusFilterProps = {
|
|
|
19
20
|
*
|
|
20
21
|
* @see {@link TrackingStatusFilterProps | The props for the `<TrackingStatusFilter />` component}
|
|
21
22
|
*/
|
|
22
|
-
export declare const TrackingStatusFilter: ({ filters, onFiltersUpdated }: TrackingStatusFilterProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const TrackingStatusFilter: ({ disabled, filters, onFiltersUpdated, }: TrackingStatusFilterProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
23
24
|
export {};
|
|
@@ -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
|
*
|
|
@@ -8,6 +9,7 @@ import { LabelTrackingStatus } from "@shipengine/js-api";
|
|
|
8
9
|
*/
|
|
9
10
|
type GridFilterProps = {
|
|
10
11
|
filters: IGridFilters;
|
|
12
|
+
filtersDisabled?: boolean;
|
|
11
13
|
onClearAllFilters: () => void;
|
|
12
14
|
onFiltersUpdated: (params: IGridFilters) => void;
|
|
13
15
|
};
|
|
@@ -24,6 +26,7 @@ export interface IGridFilters {
|
|
|
24
26
|
}>;
|
|
25
27
|
labelId?: IGridFilter<string>;
|
|
26
28
|
shipmentId: IGridFilter<string>;
|
|
29
|
+
status?: IGridFilter<SE.LabelStatus | "">;
|
|
27
30
|
trackingStatus?: IGridFilter<LabelTrackingStatusWithVoided[]>;
|
|
28
31
|
}
|
|
29
32
|
/**
|
|
@@ -35,5 +38,5 @@ export interface IGridFilters {
|
|
|
35
38
|
*
|
|
36
39
|
* @see {@link GridFiltersProps | The props for the `<GridFilters />` component}
|
|
37
40
|
*/
|
|
38
|
-
export declare const GridFilters: ({ filters, onFiltersUpdated, onClearAllFilters }: GridFilterProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
41
|
+
export declare const GridFilters: ({ filters, onFiltersUpdated, filtersDisabled, onClearAllFilters, }: GridFilterProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
39
42
|
export {};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { SortDirection } from "../../../components/grid-controller";
|
|
2
1
|
import { IGridFilters } from "../../../components/grid-filters";
|
|
3
2
|
import { LabelTrackingStatus, SE } from "@shipengine/react-api";
|
|
4
3
|
import { LabelsGridProps } from "../";
|
|
5
4
|
import { Label } from "../labels-grid";
|
|
6
|
-
export declare const useLabelsGrid: ({
|
|
7
|
-
createdDateSortBy?: SortDirection | undefined;
|
|
5
|
+
export declare const useLabelsGrid: ({ labelStatus, showShipmentIdFilter, showLabelIdFilter, showStatusFilter, showTrackingStatusFilter, fetchShipments, sortDir, }: {
|
|
8
6
|
fetchShipments?: boolean | undefined;
|
|
9
7
|
labelStatus: LabelsGridProps["labelStatus"];
|
|
10
8
|
showLabelIdFilter?: boolean | undefined;
|
|
11
9
|
showShipmentIdFilter?: boolean | undefined;
|
|
10
|
+
showStatusFilter?: boolean | undefined;
|
|
12
11
|
showTrackingStatusFilter?: boolean | undefined;
|
|
12
|
+
sortDir?: SE.SortableQuery["sortDir"];
|
|
13
13
|
}) => {
|
|
14
14
|
clearAllFilters: () => void;
|
|
15
15
|
filters: IGridFilters;
|
|
@@ -62,8 +62,10 @@ export declare const useLabelsGrid: ({ createdDateSortBy, labelStatus, showShipm
|
|
|
62
62
|
voided: boolean;
|
|
63
63
|
voidedAt: string | null;
|
|
64
64
|
}[];
|
|
65
|
+
hasMoreUnfetchedResults: boolean | undefined;
|
|
65
66
|
isAnyFilterActive: boolean;
|
|
66
67
|
isError: boolean | undefined;
|
|
68
|
+
isFetchingNextPage: boolean;
|
|
67
69
|
isLoading: boolean | undefined;
|
|
68
70
|
labels: Label[];
|
|
69
71
|
pageConfig: {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { LabelTrackingStatus, SE } from "@shipengine/js-api";
|
|
2
|
+
export declare const useTrackingStatusFilter: ({ isActive, labelStatus, shipmentId, trackingStatusFilters, sortDir, currentPage, pageSize, }: {
|
|
3
|
+
currentPage: number;
|
|
4
|
+
isActive: boolean;
|
|
5
|
+
labelStatus?: SE.LabelStatus | undefined;
|
|
6
|
+
pageSize: number;
|
|
7
|
+
shipmentId?: string | undefined;
|
|
8
|
+
sortDir: SE.SortableQuery["sortDir"];
|
|
9
|
+
trackingStatusFilters: LabelTrackingStatus[];
|
|
10
|
+
}) => {
|
|
11
|
+
allLabelsCount: number;
|
|
12
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions | undefined) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<SE.ListLabelsResult, SE.CodedError[]>>;
|
|
13
|
+
filteredLabelsCount: number;
|
|
14
|
+
hasMorePages: boolean | undefined;
|
|
15
|
+
hasMoreUnfetchedResults: boolean | undefined;
|
|
16
|
+
isFetchingNextPage: boolean;
|
|
17
|
+
isLoading: boolean;
|
|
18
|
+
labels: SE.Label[];
|
|
19
|
+
paginationInfo: {
|
|
20
|
+
currentPage: number;
|
|
21
|
+
pageSize: number;
|
|
22
|
+
totalCount: number;
|
|
23
|
+
totalPages: number;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -143,18 +143,14 @@ export declare const Element: ({ resources, ...props }: LabelsGridProps & import
|
|
|
143
143
|
};
|
|
144
144
|
registerSuccess: {
|
|
145
145
|
title: string;
|
|
146
|
-
description: string;
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
146
|
+
description: string; /**
|
|
147
|
+
* `onClickExternalOrderId` is an optional callback function that will be invoked when the user clicks the id number within the
|
|
148
|
+
* `External Order ID` column, if present.
|
|
149
|
+
*/
|
|
150
|
+
};
|
|
151
151
|
};
|
|
152
152
|
};
|
|
153
153
|
highVolumeForms: string;
|
|
154
|
-
/**
|
|
155
|
-
* `onClickExternalShipmentId` is an optional callback function that will be invoked when the user clicks the id number within
|
|
156
|
-
* `External Shipment Id` column, if present.
|
|
157
|
-
*/
|
|
158
154
|
multipleShippingServices: string;
|
|
159
155
|
sections: {
|
|
160
156
|
labels: string;
|
|
@@ -234,10 +230,7 @@ export declare const Element: ({ resources, ...props }: LabelsGridProps & import
|
|
|
234
230
|
};
|
|
235
231
|
poBox: {
|
|
236
232
|
title: string;
|
|
237
|
-
description: string;
|
|
238
|
-
* `onClickExternalOrderId` is an optional callback function that will be invoked when the user clicks the id number within the
|
|
239
|
-
* `External Order ID` column, if present.
|
|
240
|
-
*/
|
|
233
|
+
description: string;
|
|
241
234
|
};
|
|
242
235
|
carrier: {
|
|
243
236
|
title: string;
|
|
@@ -255,10 +248,7 @@ export declare const Element: ({ resources, ...props }: LabelsGridProps & import
|
|
|
255
248
|
title: string;
|
|
256
249
|
subtitleCard: string;
|
|
257
250
|
subtitleBilling: string;
|
|
258
|
-
};
|
|
259
|
-
* `onClickPrintLabel` is an optional callback function that will be invoked when the user clicks the
|
|
260
|
-
* `Print Label` button.
|
|
261
|
-
*/
|
|
251
|
+
};
|
|
262
252
|
};
|
|
263
253
|
};
|
|
264
254
|
"register-carrier": {
|
|
@@ -336,10 +326,15 @@ export declare const Element: ({ resources, ...props }: LabelsGridProps & import
|
|
|
336
326
|
saveRateFailedMessage: string;
|
|
337
327
|
saveRateFailedTitle: string;
|
|
338
328
|
};
|
|
329
|
+
/**
|
|
330
|
+
* `onClickExternalOrderId` is an optional callback function that will be invoked when the user clicks the id number within the
|
|
331
|
+
* `External Order ID` column, if present.
|
|
332
|
+
*/
|
|
339
333
|
errorTypes: {
|
|
340
334
|
results: string;
|
|
341
335
|
};
|
|
342
336
|
fields: {
|
|
337
|
+
"requires-additional-handling-link": string;
|
|
343
338
|
"requires-additional-handling": string;
|
|
344
339
|
addOns: string;
|
|
345
340
|
contentDescription: string;
|
|
@@ -713,7 +708,10 @@ export declare const Element: ({ resources, ...props }: LabelsGridProps & import
|
|
|
713
708
|
printForms: string;
|
|
714
709
|
};
|
|
715
710
|
errorMessages: {
|
|
716
|
-
title: string;
|
|
711
|
+
title: string; /**
|
|
712
|
+
* `labelStatus` is the status of the labels you wish to view.
|
|
713
|
+
* If no value is defined, all labels will be rendered.
|
|
714
|
+
*/
|
|
717
715
|
subtitle: string;
|
|
718
716
|
};
|
|
719
717
|
};
|
|
@@ -746,7 +744,10 @@ export declare const Element: ({ resources, ...props }: LabelsGridProps & import
|
|
|
746
744
|
settingsModal: {
|
|
747
745
|
closeDialog: string;
|
|
748
746
|
header: string;
|
|
749
|
-
};
|
|
747
|
+
}; /**
|
|
748
|
+
* `features` provides optional feature configuration for the Element
|
|
749
|
+
* If no value is defined, default configuration will be used.
|
|
750
|
+
*/
|
|
750
751
|
status: {
|
|
751
752
|
connected: string;
|
|
752
753
|
};
|
|
@@ -804,9 +805,17 @@ export declare const Element: ({ resources, ...props }: LabelsGridProps & import
|
|
|
804
805
|
paste: string;
|
|
805
806
|
preference: {
|
|
806
807
|
confirm: string;
|
|
808
|
+
/**
|
|
809
|
+
* `features` provides optional feature configuration for the Element
|
|
810
|
+
* If no value is defined, default configuration will be used.
|
|
811
|
+
*/
|
|
807
812
|
addressNotValidated: string;
|
|
808
813
|
modified: string;
|
|
809
814
|
title: string;
|
|
815
|
+
/**
|
|
816
|
+
* `labelStatus` is the status of the labels you wish to view.
|
|
817
|
+
* If no value is defined, all labels will be rendered.
|
|
818
|
+
*/
|
|
810
819
|
originalAddress: string;
|
|
811
820
|
matchedAddress: string;
|
|
812
821
|
unableToValidate: string;
|
|
@@ -830,7 +839,10 @@ export declare const Element: ({ resources, ...props }: LabelsGridProps & import
|
|
|
830
839
|
cvvPlaceholder: string;
|
|
831
840
|
expirationPlaceholder: string;
|
|
832
841
|
cardNumberPlaceholder: string;
|
|
833
|
-
};
|
|
842
|
+
}; /**
|
|
843
|
+
* `onClickPrintLabel` is an optional callback function that will be invoked when the user clicks the
|
|
844
|
+
* `Print Label` button.
|
|
845
|
+
*/
|
|
834
846
|
};
|
|
835
847
|
carriers: {
|
|
836
848
|
fields: {
|
|
@@ -972,11 +984,13 @@ export declare const Element: ({ resources, ...props }: LabelsGridProps & import
|
|
|
972
984
|
grid: {
|
|
973
985
|
"row-count_one": string;
|
|
974
986
|
"row-count_other": string;
|
|
987
|
+
"row-count-plus_other": string;
|
|
975
988
|
rows: string;
|
|
976
989
|
clearAll: string;
|
|
977
990
|
shipmentId: string;
|
|
978
991
|
labelId: string;
|
|
979
992
|
labelIdFilter: string;
|
|
993
|
+
filteredStatus: string;
|
|
980
994
|
filteredTrackingStatus: string;
|
|
981
995
|
more: string;
|
|
982
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;
|
|
@@ -928,11 +929,13 @@ export declare const Element: ({ resources, ...props }: ComponentProps & import(
|
|
|
928
929
|
grid: {
|
|
929
930
|
"row-count_one": string;
|
|
930
931
|
"row-count_other": string;
|
|
932
|
+
"row-count-plus_other": string;
|
|
931
933
|
rows: string;
|
|
932
934
|
clearAll: string;
|
|
933
935
|
shipmentId: string;
|
|
934
936
|
labelId: string;
|
|
935
937
|
labelIdFilter: string;
|
|
938
|
+
filteredStatus: string;
|
|
936
939
|
filteredTrackingStatus: string;
|
|
937
940
|
more: string;
|
|
938
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;
|
|
@@ -971,11 +972,13 @@ export declare const Element: ({ resources, ...props }: ExternalCarriersProps &
|
|
|
971
972
|
grid: {
|
|
972
973
|
"row-count_one": string;
|
|
973
974
|
"row-count_other": string;
|
|
975
|
+
"row-count-plus_other": string;
|
|
974
976
|
rows: string;
|
|
975
977
|
clearAll: string;
|
|
976
978
|
shipmentId: string;
|
|
977
979
|
labelId: string;
|
|
978
980
|
labelIdFilter: string;
|
|
981
|
+
filteredStatus: string;
|
|
979
982
|
filteredTrackingStatus: string;
|
|
980
983
|
more: string;
|
|
981
984
|
createdDate: string;
|