@shipengine/elements 2.14.0 → 2.16.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/actions-menu.js +5 -5
- package/carrier.js +1 -1
- package/components.js +1 -1
- package/elements.js +1 -1
- package/hooks.js +1 -1
- package/index.js +1 -1
- package/package.json +4 -4
- package/src/components/add-funds-form/add-funds-form.d.ts +2 -2
- package/src/components/address-preference-context/address-preference-context.d.ts +1 -1
- package/src/components/pager/usePager.d.ts +1 -0
- package/src/components/templates/address-form/address-fields.d.ts +1 -2
- package/src/components/templates/address-form/address-form.d.ts +1 -2
- package/src/components/templates/product-form/product-form.d.ts +3 -1
- package/src/components/templates/products-display/products-display.d.ts +4 -4
- package/src/components/templates/products-display/products-display.styles.d.ts +2 -1
- package/src/components/templates/shipment-form/sections/customs-forms/customs-forms.d.ts +3 -2
- package/src/components/templates/shipment-form/shipment-form.d.ts +4 -3
- package/src/components/templates/wallet-form/edit-wallet-address-form.d.ts +1 -1
- package/src/components/vat-form/vat-form-schema.d.ts +21 -3
- package/src/components/vat-form/vat-form.d.ts +7 -2
- package/src/components/vat-form/vat-form.styles.d.ts +3 -0
- package/src/components/vat-form/vat-types.d.ts +6 -0
- package/src/components/warehouse-form/warehouse-form-schema.d.ts +6 -0
- package/src/components/warehouse-form/warehouse-form.d.ts +3 -1
- package/src/elements/labels-grid/hooks/use-labels-grid.d.ts +1 -0
- package/src/elements/labels-grid/labels-grid.d.ts +39 -16
- package/src/elements/manage-carriers/manage-carriers.d.ts +6 -2
- package/src/elements/manage-external-carriers/manage-external-carriers.d.ts +6 -2
- package/src/elements/manage-funding/manage-funding-element.d.ts +6 -2
- package/src/elements/manage-warehouses/manage-warehouses.d.ts +6 -2
- package/src/elements/payment-method-settings/payment-method-settings-element.d.ts +6 -2
- package/src/elements/purchase-label/configure-shipment.d.ts +2 -1
- package/src/elements/purchase-label/hooks/index.d.ts +0 -2
- package/src/elements/purchase-label/hooks/use-presets.d.ts +2 -1
- package/src/elements/purchase-label/hooks/use-shipment-form.d.ts +4 -3
- package/src/elements/purchase-label/purchase-label.d.ts +28 -39
- package/src/elements/select-label-layout/select-label-layout-element.d.ts +6 -2
- package/src/elements/shipment-summary/shipment-summary.d.ts +8 -2
- package/src/elements/shipments-grid/hooks/use-shipments-grid.d.ts +1 -0
- package/src/elements/shipments-grid/shipments-grid.d.ts +6 -5
- package/src/elements/theme-creator/theme-creator.d.ts +6 -2
- package/src/elements/transaction-history/transaction-history-element.d.ts +6 -2
- package/src/elements/unit-settings/unit-settings-element.d.ts +6 -2
- package/src/elements/vat-settings/vat-settings-element.d.ts +6 -2
- package/src/elements/void-label/void-label.d.ts +36 -52
- package/src/elements-provider/elements-provider.d.ts +1 -2
- package/src/features/manage-carriers/manage-carriers.d.ts +2 -2
- package/src/features/manage-funding/manage-funding.d.ts +2 -2
- package/src/features/vat-settings/use-vat-settings.d.ts +1 -1
- package/src/features/vat-settings/vat-settings.d.ts +1 -4
- package/src/features/vat-settings/vat-settings.styles.d.ts +7 -0
- package/src/hooks/index.d.ts +2 -0
- package/src/hooks/options/use-country-code-options.d.ts +1 -1
- package/src/hooks/options/use-state-code-options.d.ts +2 -2
- package/src/{elements/purchase-label/hooks → hooks}/use-configure-shipment.d.ts +5 -10
- package/src/hooks/use-helpers.stories.d.ts +3 -0
- package/src/locales/en/index.d.ts +6 -2
- package/src/types/harmonized-tariff-code.d.ts +10 -0
- package/src/types/index.d.ts +4 -3
- package/src/utilities/form-logger.d.ts +1 -1
- package/src/utilities/validation.d.ts +1 -1
- package/src/workflows/account-settings/account-settings.d.ts +6 -2
- package/src/workflows/carrier-services/carrier-services.d.ts +31 -50
- package/src/workflows/connect-external-carrier/connect-external-carrier.d.ts +6 -2
- package/src/workflows/label-workflow/label-workflow.d.ts +1126 -101
- package/src/workflows/onboarding/components/onboarding-wizard/onboarding-wizard.d.ts +2 -1
- package/src/workflows/onboarding/components/ship-from-address-step/ship-from-address-step.d.ts +1 -1
- package/src/workflows/onboarding/onboarding.d.ts +84 -8
- package/transaction-history-element.js +1 -1
- package/use-configure-shipment.js +1 -0
- package/use-toggle.js +1 -1
- package/use-unit-settings.js +1 -1
- package/usePager.js +1 -1
- package/utilities.js +1 -1
- package/validation.js +1 -1
- package/vat.js +1 -1
- package/wallet-form.js +1 -1
- package/warehouses.js +1 -0
- package/workflows.js +1 -1
- package/shipment.js +0 -1
- package/use-scrub-errors.js +0 -1
- /package/src/{elements/purchase-label/hooks → hooks}/use-import-sales-order.d.ts +0 -0
|
@@ -87,17 +87,17 @@ export declare const Element: ({ resources, ...props }: LabelsGridProps & {
|
|
|
87
87
|
rejected: string;
|
|
88
88
|
dpdwallet: string;
|
|
89
89
|
};
|
|
90
|
-
refund_process: string;
|
|
90
|
+
refund_process: string; /**
|
|
91
|
+
* `features` provides optional feature configuration for the Element
|
|
92
|
+
* If no value is defined, default configuration will be used.
|
|
93
|
+
*/
|
|
91
94
|
refund_rules: string;
|
|
92
95
|
resultTitles: {
|
|
93
96
|
approved: string;
|
|
94
97
|
rejected: string;
|
|
95
98
|
};
|
|
96
99
|
voidedOn: string;
|
|
97
|
-
};
|
|
98
|
-
* `onClickExternalOrderId` is an optional callback function that will be invoked when the user clicks the id number within the
|
|
99
|
-
* `External Order ID` column, if present.
|
|
100
|
-
*/
|
|
100
|
+
};
|
|
101
101
|
"view-shipment": {
|
|
102
102
|
title: string;
|
|
103
103
|
actions: {
|
|
@@ -152,16 +152,18 @@ export declare const Element: ({ resources, ...props }: LabelsGridProps & {
|
|
|
152
152
|
vatNumber: string;
|
|
153
153
|
vatRegistrationTooltip: string;
|
|
154
154
|
vatFormText: string;
|
|
155
|
-
vatFormRegisterLater: string;
|
|
156
155
|
vatNumberInputHint: string;
|
|
157
156
|
vatNumberInputPlaceholder: string;
|
|
158
157
|
verifiedVat: string;
|
|
158
|
+
vatNumberFieldLabel: string;
|
|
159
|
+
vatTypePlaceholder: string;
|
|
160
|
+
issuingAuthorityPlaceholder: string;
|
|
161
|
+
issuingAuthorityFieldLabel: string;
|
|
159
162
|
vatFormErrors: {
|
|
160
163
|
invalidFieldValue: string;
|
|
161
164
|
verificationFailure: string;
|
|
162
165
|
forbidden: string;
|
|
163
166
|
connectionNotSupported: string;
|
|
164
|
-
genericTitle: string;
|
|
165
167
|
genericText: string;
|
|
166
168
|
};
|
|
167
169
|
};
|
|
@@ -212,6 +214,10 @@ export declare const Element: ({ resources, ...props }: LabelsGridProps & {
|
|
|
212
214
|
error: {
|
|
213
215
|
title: string;
|
|
214
216
|
};
|
|
217
|
+
/**
|
|
218
|
+
* `onClickExternalOrderId` is an optional callback function that will be invoked when the user clicks the id number within the
|
|
219
|
+
* `External Order ID` column, if present.
|
|
220
|
+
*/
|
|
215
221
|
info: {
|
|
216
222
|
description: string;
|
|
217
223
|
};
|
|
@@ -222,6 +228,10 @@ export declare const Element: ({ resources, ...props }: LabelsGridProps & {
|
|
|
222
228
|
carrier: {
|
|
223
229
|
title: string;
|
|
224
230
|
confirmAddress: string;
|
|
231
|
+
/**
|
|
232
|
+
* `onClickPrintForm` is an optional callback function that will be invoked when the user clicks the
|
|
233
|
+
* `Print Forms` button.
|
|
234
|
+
*/
|
|
225
235
|
description: string;
|
|
226
236
|
};
|
|
227
237
|
blackBox: {
|
|
@@ -318,12 +328,18 @@ export declare const Element: ({ resources, ...props }: LabelsGridProps & {
|
|
|
318
328
|
};
|
|
319
329
|
fields: {
|
|
320
330
|
"requires-additional-handling": string;
|
|
321
|
-
addOns: string;
|
|
331
|
+
addOns: string; /**
|
|
332
|
+
* `onClickPrintForm` is an optional callback function that will be invoked when the user clicks the
|
|
333
|
+
* `Print Forms` button.
|
|
334
|
+
*/
|
|
322
335
|
contentDescription: string;
|
|
323
336
|
confirmation: string;
|
|
324
337
|
dimensions: {
|
|
325
338
|
length: string;
|
|
326
|
-
width: string;
|
|
339
|
+
width: string; /**
|
|
340
|
+
* `onClickPrintLabel` is an optional callback function that will be invoked when the user clicks the
|
|
341
|
+
* `Print Label` button.
|
|
342
|
+
*/
|
|
327
343
|
height: string;
|
|
328
344
|
};
|
|
329
345
|
dimensionsGroup: string;
|
|
@@ -597,7 +613,10 @@ export declare const Element: ({ resources, ...props }: LabelsGridProps & {
|
|
|
597
613
|
g: string;
|
|
598
614
|
kg: string;
|
|
599
615
|
};
|
|
600
|
-
};
|
|
616
|
+
}; /**
|
|
617
|
+
* `features` provides optional feature configuration for the Element
|
|
618
|
+
* If no value is defined, default configuration will be used.
|
|
619
|
+
*/
|
|
601
620
|
};
|
|
602
621
|
"list-shipments": {
|
|
603
622
|
title: string;
|
|
@@ -633,7 +652,10 @@ export declare const Element: ({ resources, ...props }: LabelsGridProps & {
|
|
|
633
652
|
title: string;
|
|
634
653
|
subtitle: string;
|
|
635
654
|
};
|
|
636
|
-
};
|
|
655
|
+
}; /**
|
|
656
|
+
* `labelStatus` is the status of the labels you wish to view.
|
|
657
|
+
* If no value is defined, all labels will be rendered.
|
|
658
|
+
*/
|
|
637
659
|
"list-labels": {
|
|
638
660
|
title: string;
|
|
639
661
|
headers: {
|
|
@@ -671,10 +693,6 @@ export declare const Element: ({ resources, ...props }: LabelsGridProps & {
|
|
|
671
693
|
error: string;
|
|
672
694
|
};
|
|
673
695
|
actions: {
|
|
674
|
-
/**
|
|
675
|
-
* `labelStatus` is the status of the labels you wish to view.
|
|
676
|
-
* If no value is defined, all labels will be rendered.
|
|
677
|
-
*/
|
|
678
696
|
title: string;
|
|
679
697
|
print: string;
|
|
680
698
|
void: string;
|
|
@@ -778,7 +796,10 @@ export declare const Element: ({ resources, ...props }: LabelsGridProps & {
|
|
|
778
796
|
};
|
|
779
797
|
billing: {
|
|
780
798
|
fields: {
|
|
781
|
-
differentBillingAddress: string;
|
|
799
|
+
differentBillingAddress: string; /**
|
|
800
|
+
* `onClickPrintLabel` is an optional callback function that will be invoked when the user clicks the
|
|
801
|
+
* `Print Label` button.
|
|
802
|
+
*/
|
|
782
803
|
name: string;
|
|
783
804
|
cardNumber: string;
|
|
784
805
|
expiration: string;
|
|
@@ -857,6 +878,7 @@ export declare const Element: ({ resources, ...props }: LabelsGridProps & {
|
|
|
857
878
|
taxIssuingAuthority: string;
|
|
858
879
|
entityType: string;
|
|
859
880
|
};
|
|
881
|
+
hsCode: string;
|
|
860
882
|
nonDelivery: {
|
|
861
883
|
returnToSender: string;
|
|
862
884
|
treatAsAbandoned: string;
|
|
@@ -894,6 +916,7 @@ export declare const Element: ({ resources, ...props }: LabelsGridProps & {
|
|
|
894
916
|
shipments: string;
|
|
895
917
|
warehouses: string;
|
|
896
918
|
};
|
|
919
|
+
labelHasBeenPurchased: string;
|
|
897
920
|
emailIsRequired: string;
|
|
898
921
|
unknown: string;
|
|
899
922
|
noRatesAvailable: string;
|
|
@@ -125,16 +125,18 @@ export declare const Element: ({ resources, ...props }: ShipEngineCarriersProps
|
|
|
125
125
|
vatNumber: string;
|
|
126
126
|
vatRegistrationTooltip: string;
|
|
127
127
|
vatFormText: string;
|
|
128
|
-
vatFormRegisterLater: string;
|
|
129
128
|
vatNumberInputHint: string;
|
|
130
129
|
vatNumberInputPlaceholder: string;
|
|
131
130
|
verifiedVat: string;
|
|
131
|
+
vatNumberFieldLabel: string;
|
|
132
|
+
vatTypePlaceholder: string;
|
|
133
|
+
issuingAuthorityPlaceholder: string;
|
|
134
|
+
issuingAuthorityFieldLabel: string;
|
|
132
135
|
vatFormErrors: {
|
|
133
136
|
invalidFieldValue: string;
|
|
134
137
|
verificationFailure: string;
|
|
135
138
|
forbidden: string;
|
|
136
139
|
connectionNotSupported: string;
|
|
137
|
-
genericTitle: string;
|
|
138
140
|
genericText: string;
|
|
139
141
|
};
|
|
140
142
|
};
|
|
@@ -870,6 +872,7 @@ export declare const Element: ({ resources, ...props }: ShipEngineCarriersProps
|
|
|
870
872
|
taxIssuingAuthority: string;
|
|
871
873
|
entityType: string;
|
|
872
874
|
};
|
|
875
|
+
hsCode: string;
|
|
873
876
|
nonDelivery: {
|
|
874
877
|
returnToSender: string;
|
|
875
878
|
treatAsAbandoned: string;
|
|
@@ -907,6 +910,7 @@ export declare const Element: ({ resources, ...props }: ShipEngineCarriersProps
|
|
|
907
910
|
shipments: string;
|
|
908
911
|
warehouses: string;
|
|
909
912
|
};
|
|
913
|
+
labelHasBeenPurchased: string;
|
|
910
914
|
emailIsRequired: string;
|
|
911
915
|
unknown: string;
|
|
912
916
|
noRatesAvailable: string;
|
|
@@ -147,16 +147,18 @@ export declare const Element: ({ resources, ...props }: ExternalCarriersProps &
|
|
|
147
147
|
vatNumber: string;
|
|
148
148
|
vatRegistrationTooltip: string;
|
|
149
149
|
vatFormText: string;
|
|
150
|
-
vatFormRegisterLater: string;
|
|
151
150
|
vatNumberInputHint: string;
|
|
152
151
|
vatNumberInputPlaceholder: string;
|
|
153
152
|
verifiedVat: string;
|
|
153
|
+
vatNumberFieldLabel: string;
|
|
154
|
+
vatTypePlaceholder: string;
|
|
155
|
+
issuingAuthorityPlaceholder: string;
|
|
156
|
+
issuingAuthorityFieldLabel: string;
|
|
154
157
|
vatFormErrors: {
|
|
155
158
|
invalidFieldValue: string;
|
|
156
159
|
verificationFailure: string;
|
|
157
160
|
forbidden: string;
|
|
158
161
|
connectionNotSupported: string;
|
|
159
|
-
genericTitle: string;
|
|
160
162
|
genericText: string;
|
|
161
163
|
};
|
|
162
164
|
};
|
|
@@ -870,6 +872,7 @@ export declare const Element: ({ resources, ...props }: ExternalCarriersProps &
|
|
|
870
872
|
taxIssuingAuthority: string;
|
|
871
873
|
entityType: string;
|
|
872
874
|
};
|
|
875
|
+
hsCode: string;
|
|
873
876
|
nonDelivery: {
|
|
874
877
|
returnToSender: string;
|
|
875
878
|
treatAsAbandoned: string;
|
|
@@ -907,6 +910,7 @@ export declare const Element: ({ resources, ...props }: ExternalCarriersProps &
|
|
|
907
910
|
shipments: string;
|
|
908
911
|
warehouses: string;
|
|
909
912
|
};
|
|
913
|
+
labelHasBeenPurchased: string;
|
|
910
914
|
emailIsRequired: string;
|
|
911
915
|
unknown: string;
|
|
912
916
|
noRatesAvailable: string;
|
|
@@ -102,16 +102,18 @@ export declare const Element: ({ resources, ...props }: ManageFundingProps & {
|
|
|
102
102
|
vatNumber: string;
|
|
103
103
|
vatRegistrationTooltip: string;
|
|
104
104
|
vatFormText: string;
|
|
105
|
-
vatFormRegisterLater: string;
|
|
106
105
|
vatNumberInputHint: string;
|
|
107
106
|
vatNumberInputPlaceholder: string;
|
|
108
107
|
verifiedVat: string;
|
|
108
|
+
vatNumberFieldLabel: string;
|
|
109
|
+
vatTypePlaceholder: string;
|
|
110
|
+
issuingAuthorityPlaceholder: string;
|
|
111
|
+
issuingAuthorityFieldLabel: string;
|
|
109
112
|
vatFormErrors: {
|
|
110
113
|
invalidFieldValue: string;
|
|
111
114
|
verificationFailure: string;
|
|
112
115
|
forbidden: string;
|
|
113
116
|
connectionNotSupported: string;
|
|
114
|
-
genericTitle: string;
|
|
115
117
|
genericText: string;
|
|
116
118
|
};
|
|
117
119
|
};
|
|
@@ -803,6 +805,7 @@ export declare const Element: ({ resources, ...props }: ManageFundingProps & {
|
|
|
803
805
|
taxIssuingAuthority: string;
|
|
804
806
|
entityType: string;
|
|
805
807
|
};
|
|
808
|
+
hsCode: string;
|
|
806
809
|
nonDelivery: {
|
|
807
810
|
returnToSender: string;
|
|
808
811
|
treatAsAbandoned: string;
|
|
@@ -840,6 +843,7 @@ export declare const Element: ({ resources, ...props }: ManageFundingProps & {
|
|
|
840
843
|
shipments: string;
|
|
841
844
|
warehouses: string;
|
|
842
845
|
};
|
|
846
|
+
labelHasBeenPurchased: string;
|
|
843
847
|
emailIsRequired: string;
|
|
844
848
|
unknown: string;
|
|
845
849
|
noRatesAvailable: string;
|
|
@@ -119,16 +119,18 @@ export declare const Element: ({ resources, ...props }: object & {
|
|
|
119
119
|
vatNumber: string;
|
|
120
120
|
vatRegistrationTooltip: string;
|
|
121
121
|
vatFormText: string;
|
|
122
|
-
vatFormRegisterLater: string;
|
|
123
122
|
vatNumberInputHint: string;
|
|
124
123
|
vatNumberInputPlaceholder: string;
|
|
125
124
|
verifiedVat: string;
|
|
125
|
+
vatNumberFieldLabel: string;
|
|
126
|
+
vatTypePlaceholder: string;
|
|
127
|
+
issuingAuthorityPlaceholder: string;
|
|
128
|
+
issuingAuthorityFieldLabel: string;
|
|
126
129
|
vatFormErrors: {
|
|
127
130
|
invalidFieldValue: string;
|
|
128
131
|
verificationFailure: string;
|
|
129
132
|
forbidden: string;
|
|
130
133
|
connectionNotSupported: string;
|
|
131
|
-
genericTitle: string;
|
|
132
134
|
genericText: string;
|
|
133
135
|
};
|
|
134
136
|
};
|
|
@@ -837,6 +839,7 @@ export declare const Element: ({ resources, ...props }: object & {
|
|
|
837
839
|
taxIssuingAuthority: string;
|
|
838
840
|
entityType: string;
|
|
839
841
|
};
|
|
842
|
+
hsCode: string;
|
|
840
843
|
nonDelivery: {
|
|
841
844
|
returnToSender: string;
|
|
842
845
|
treatAsAbandoned: string;
|
|
@@ -874,6 +877,7 @@ export declare const Element: ({ resources, ...props }: object & {
|
|
|
874
877
|
shipments: string;
|
|
875
878
|
warehouses: string;
|
|
876
879
|
};
|
|
880
|
+
labelHasBeenPurchased: string;
|
|
877
881
|
emailIsRequired: string;
|
|
878
882
|
unknown: string;
|
|
879
883
|
noRatesAvailable: string;
|
|
@@ -102,16 +102,18 @@ export declare const Element: ({ resources, ...props }: PaymentMethodSettingsPro
|
|
|
102
102
|
vatNumber: string;
|
|
103
103
|
vatRegistrationTooltip: string;
|
|
104
104
|
vatFormText: string;
|
|
105
|
-
vatFormRegisterLater: string;
|
|
106
105
|
vatNumberInputHint: string;
|
|
107
106
|
vatNumberInputPlaceholder: string;
|
|
108
107
|
verifiedVat: string;
|
|
108
|
+
vatNumberFieldLabel: string;
|
|
109
|
+
vatTypePlaceholder: string;
|
|
110
|
+
issuingAuthorityPlaceholder: string;
|
|
111
|
+
issuingAuthorityFieldLabel: string;
|
|
109
112
|
vatFormErrors: {
|
|
110
113
|
invalidFieldValue: string;
|
|
111
114
|
verificationFailure: string;
|
|
112
115
|
forbidden: string;
|
|
113
116
|
connectionNotSupported: string;
|
|
114
|
-
genericTitle: string;
|
|
115
117
|
genericText: string;
|
|
116
118
|
};
|
|
117
119
|
};
|
|
@@ -803,6 +805,7 @@ export declare const Element: ({ resources, ...props }: PaymentMethodSettingsPro
|
|
|
803
805
|
taxIssuingAuthority: string;
|
|
804
806
|
entityType: string;
|
|
805
807
|
};
|
|
808
|
+
hsCode: string;
|
|
806
809
|
nonDelivery: {
|
|
807
810
|
returnToSender: string;
|
|
808
811
|
treatAsAbandoned: string;
|
|
@@ -840,6 +843,7 @@ export declare const Element: ({ resources, ...props }: PaymentMethodSettingsPro
|
|
|
840
843
|
shipments: string;
|
|
841
844
|
warehouses: string;
|
|
842
845
|
};
|
|
846
|
+
labelHasBeenPurchased: string;
|
|
843
847
|
emailIsRequired: string;
|
|
844
848
|
unknown: string;
|
|
845
849
|
noRatesAvailable: string;
|
|
@@ -2,7 +2,7 @@ import { SE } from "@shipengine/react-api";
|
|
|
2
2
|
import { RateFormProps } from "../../components/templates/rate-form";
|
|
3
3
|
import { ShipmentFormProps } from "../../components/templates/shipment-form";
|
|
4
4
|
import { UseShippingPresetsOptionsProps } from "../../hooks";
|
|
5
|
-
import { PreferredRatesResponse, ShipFromAddress } from "../../types";
|
|
5
|
+
import { HarmonizedTariffCode, PreferredRatesResponse, ShipFromAddress } from "../../types";
|
|
6
6
|
import { PurchaseLabelFeatures } from "../../utilities";
|
|
7
7
|
import { UseRatesFormProps, UseShipmentFormProps } from "./hooks";
|
|
8
8
|
export type ShipmentFormMode = "browse_rates" | "select_service";
|
|
@@ -11,6 +11,7 @@ export type ConfigureShipmentProps = {
|
|
|
11
11
|
errors?: ShipmentFormProps["errors"];
|
|
12
12
|
features?: PurchaseLabelFeatures;
|
|
13
13
|
getPreferredRates?: (shipment: SE.SalesOrderShipment, isInternational: boolean) => Promise<PreferredRatesResponse | undefined>;
|
|
14
|
+
harmonizedTariffCodes?: HarmonizedTariffCode[];
|
|
14
15
|
insuranceAccount?: SE.InsuranceAccount;
|
|
15
16
|
isLoading?: ShipmentFormProps["isLoading"];
|
|
16
17
|
onAddressValidation?: UseShipmentFormProps["onAddressValidation"];
|
|
@@ -2,9 +2,10 @@ import { SE } from "@shipengine/react-api";
|
|
|
2
2
|
import { ShippingPreset } from "../../../types";
|
|
3
3
|
export type UsePresetsProps = {
|
|
4
4
|
onApply?: (preset: ShippingPreset, shipment: SE.SalesOrderShipment) => Promise<void> | void;
|
|
5
|
+
onShipmentUpdated?: (shipment: SE.SalesOrderShipment) => Promise<void> | void;
|
|
5
6
|
shipment?: SE.SalesOrderShipment;
|
|
6
7
|
};
|
|
7
|
-
export declare const usePresets: ({ onApply, shipment }: UsePresetsProps) => {
|
|
8
|
+
export declare const usePresets: ({ onApply, onShipmentUpdated, shipment }: UsePresetsProps) => {
|
|
8
9
|
handleApplyPreset: (preset: ShippingPreset) => Promise<void>;
|
|
9
10
|
presetErrors: SE.CodedError[] | null;
|
|
10
11
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { SE } from "@shipengine/react-api";
|
|
2
|
-
import {
|
|
2
|
+
import { HarmonizedTariffCode, ShipFromAddress } from "../../../types";
|
|
3
3
|
import { UseAddressProps } from "./use-address";
|
|
4
4
|
import { UsePresetsProps } from "./use-presets";
|
|
5
5
|
export type UseShipmentFormProps = {
|
|
6
6
|
compatibleCountryCodes?: UseAddressProps["compatibleCountryCodes"];
|
|
7
|
+
harmonizedTariffCodes?: HarmonizedTariffCode[];
|
|
7
8
|
onAddressValidation?: UseAddressProps["onValidation"];
|
|
8
9
|
onApplyPreset?: UsePresetsProps["onApply"];
|
|
9
10
|
onChangeAddress?: UseAddressProps["onChange"];
|
|
@@ -17,13 +18,12 @@ export type UseShipmentFormProps = {
|
|
|
17
18
|
export declare const useShipmentForm: ({ compatibleCountryCodes, onAddressValidation, onApplyPreset, onChangeAddress, onShipmentUpdated, onSubmit, salesOrder, shipment, shipFromAddresses: shipFromAddressesProp, useWarehouses, }: UseShipmentFormProps) => {
|
|
18
19
|
accountSettings: SE.ShipEngineAccountSettings | undefined;
|
|
19
20
|
addressLoading: boolean;
|
|
20
|
-
addressPreference: import("../../../components/templates").AddressPreference | undefined;
|
|
21
21
|
carriers: SE.Carrier[] | undefined;
|
|
22
22
|
charsetWarning: import("../../../components/templates").CharsetWarning | undefined;
|
|
23
23
|
customPackageTypes: SE.CustomPackage[] | undefined;
|
|
24
24
|
displayableErrors: string[] | undefined;
|
|
25
25
|
errors: SE.CodedError[] | undefined;
|
|
26
|
-
onApplyPreset: (preset: ShippingPreset) => Promise<void>;
|
|
26
|
+
onApplyPreset: (preset: import("../../../types").ShippingPreset) => Promise<void>;
|
|
27
27
|
onChangeAddress: (shipTo: SE.Address, { shouldValidate }: import("../../../components/templates").OnChangeAddressOptions) => Promise<SE.SalesOrderShipment>;
|
|
28
28
|
onChangeShipFromAddress: (id?: string, shipFromAddress?: ShipFromAddress) => Promise<void>;
|
|
29
29
|
onSubmit: (values: Partial<SE.SalesOrderShipment>) => Promise<SE.SalesOrderShipment>;
|
|
@@ -44,5 +44,6 @@ export declare const useShipmentForm: ({ compatibleCountryCodes, onAddressValida
|
|
|
44
44
|
name?: string | undefined;
|
|
45
45
|
}[] | undefined;
|
|
46
46
|
shipment: SE.SalesOrderShipment | undefined;
|
|
47
|
+
shipToAddressPreference: import("../../../components/templates").AddressPreference | undefined;
|
|
47
48
|
warehouses: SE.Warehouse[] | undefined;
|
|
48
49
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { SE } from "@shipengine/react-api";
|
|
3
|
-
import { UseShippingPresetsOptionsProps } from "../../hooks";
|
|
3
|
+
import { UseConfigureShipmentProps, UseImportSalesOrderProps, UseShippingPresetsOptionsProps } from "../../hooks";
|
|
4
|
+
import { HarmonizedTariffCode } from "../../types";
|
|
4
5
|
import { PurchaseLabelFeatures } from "../../utilities";
|
|
5
6
|
import { ConfigureShipmentProps } from "./configure-shipment";
|
|
6
|
-
import { UseConfigureShipmentProps, UseImportSalesOrderProps } from "./hooks";
|
|
7
7
|
/**
|
|
8
8
|
* # Purchase Label Component Props
|
|
9
9
|
*
|
|
@@ -45,6 +45,10 @@ export type PurchaseLabelCommonProps = {
|
|
|
45
45
|
* flag and green checkmark when the rate is selected.
|
|
46
46
|
*/
|
|
47
47
|
getPreferredRates?: ConfigureShipmentProps["getPreferredRates"];
|
|
48
|
+
/**
|
|
49
|
+
* `harmonizedTariffCodes` is an array of objects that contain the Harmonized Tariff Codes and descriptions used to populate the HS Codes dropdown within the Customs Form.
|
|
50
|
+
*/
|
|
51
|
+
harmonizedTariffCodes?: HarmonizedTariffCode[];
|
|
48
52
|
/**
|
|
49
53
|
* `onAddressValidation` is an async/sync callback function that will be invoked on each Address
|
|
50
54
|
* validation request. For example, whenever you update the `Ship To Address` or
|
|
@@ -262,10 +266,7 @@ export declare const Element: ({ resources, ...props }: PurchaseLabelCommonProps
|
|
|
262
266
|
refund_process: string;
|
|
263
267
|
refund_rules: string;
|
|
264
268
|
resultTitles: {
|
|
265
|
-
approved: string;
|
|
266
|
-
* A unique ID assigned during the creation of a sales order. It can be used to locate the
|
|
267
|
-
* sales order and any subsequent shipments related to that order.
|
|
268
|
-
*/
|
|
269
|
+
approved: string;
|
|
269
270
|
rejected: string;
|
|
270
271
|
};
|
|
271
272
|
voidedOn: string;
|
|
@@ -324,16 +325,18 @@ export declare const Element: ({ resources, ...props }: PurchaseLabelCommonProps
|
|
|
324
325
|
vatNumber: string;
|
|
325
326
|
vatRegistrationTooltip: string;
|
|
326
327
|
vatFormText: string;
|
|
327
|
-
vatFormRegisterLater: string;
|
|
328
328
|
vatNumberInputHint: string;
|
|
329
329
|
vatNumberInputPlaceholder: string;
|
|
330
330
|
verifiedVat: string;
|
|
331
|
+
vatNumberFieldLabel: string;
|
|
332
|
+
vatTypePlaceholder: string;
|
|
333
|
+
issuingAuthorityPlaceholder: string;
|
|
334
|
+
issuingAuthorityFieldLabel: string;
|
|
331
335
|
vatFormErrors: {
|
|
332
336
|
invalidFieldValue: string;
|
|
333
337
|
verificationFailure: string;
|
|
334
338
|
forbidden: string;
|
|
335
339
|
connectionNotSupported: string;
|
|
336
|
-
genericTitle: string;
|
|
337
340
|
genericText: string;
|
|
338
341
|
};
|
|
339
342
|
};
|
|
@@ -445,14 +448,6 @@ export declare const Element: ({ resources, ...props }: PurchaseLabelCommonProps
|
|
|
445
448
|
location_fee: string;
|
|
446
449
|
oversize: string;
|
|
447
450
|
returns: string;
|
|
448
|
-
/**
|
|
449
|
-
* # Purchase Label Component Props
|
|
450
|
-
*
|
|
451
|
-
* These are the shared props that will be passed into the `<PurchaseLabel.Element />`, and work
|
|
452
|
-
* for either shipment-based or sales order-based label purchasing.
|
|
453
|
-
*
|
|
454
|
-
* @see {@link PurchaseLabel.Element | This prop types usage in `<PurchaseLabel.Element />`}
|
|
455
|
-
*/
|
|
456
451
|
notifications: string;
|
|
457
452
|
tip: string;
|
|
458
453
|
duties_and_taxes: string;
|
|
@@ -530,7 +525,9 @@ export declare const Element: ({ resources, ...props }: PurchaseLabelCommonProps
|
|
|
530
525
|
};
|
|
531
526
|
hints: {
|
|
532
527
|
contentDescription: string;
|
|
533
|
-
};
|
|
528
|
+
}; /**
|
|
529
|
+
* `harmonizedTariffCodes` is an array of objects that contain the Harmonized Tariff Codes and descriptions used to populate the HS Codes dropdown within the Customs Form.
|
|
530
|
+
*/
|
|
534
531
|
loading: {
|
|
535
532
|
calculatingRates: string;
|
|
536
533
|
};
|
|
@@ -538,7 +535,11 @@ export declare const Element: ({ resources, ...props }: PurchaseLabelCommonProps
|
|
|
538
535
|
browseRates: string;
|
|
539
536
|
selectService: string;
|
|
540
537
|
};
|
|
541
|
-
multipleShippingServices: string;
|
|
538
|
+
multipleShippingServices: string; /**
|
|
539
|
+
* `onAddressValidation` is an async/sync callback function that will be invoked on each Address
|
|
540
|
+
* validation request. For example, whenever you update the `Ship To Address` or
|
|
541
|
+
* `Ship From Address` for a given shipment.
|
|
542
|
+
*/
|
|
542
543
|
schemaErrors: {
|
|
543
544
|
shipFromUnitedStatesOnly: string;
|
|
544
545
|
shipFromAddressRequired: string;
|
|
@@ -549,10 +550,7 @@ export declare const Element: ({ resources, ...props }: PurchaseLabelCommonProps
|
|
|
549
550
|
uspsMediaMailAcknowledgement: string;
|
|
550
551
|
uspsFirstClassMailAcknowledgement_leof: string;
|
|
551
552
|
rateSavings: string;
|
|
552
|
-
upsGroundSaverTermsAcknowledgement: string;
|
|
553
|
-
* `onChangeShipmentFormMode` is an async/sync callback function that will be invoked each time
|
|
554
|
-
* the user toggles the `Shipment Form Mode` between `Browse Rates` and `Selected Rate`.
|
|
555
|
-
*/
|
|
553
|
+
upsGroundSaverTermsAcknowledgement: string;
|
|
556
554
|
dhlExpressTermsAcknowledgement: string;
|
|
557
555
|
noRateService: string;
|
|
558
556
|
};
|
|
@@ -562,10 +560,7 @@ export declare const Element: ({ resources, ...props }: PurchaseLabelCommonProps
|
|
|
562
560
|
b2c: string;
|
|
563
561
|
c2b: string;
|
|
564
562
|
c2c: string;
|
|
565
|
-
b2b: string;
|
|
566
|
-
* `onLabelCreateSuccess` is an async/sync callback provided by the client that is invoked if the
|
|
567
|
-
* label is successfully created/purchased.
|
|
568
|
-
*/
|
|
563
|
+
b2b: string;
|
|
569
564
|
};
|
|
570
565
|
notAtRisk: string;
|
|
571
566
|
notAtRiskShipmentTootip: string;
|
|
@@ -603,9 +598,7 @@ export declare const Element: ({ resources, ...props }: PurchaseLabelCommonProps
|
|
|
603
598
|
windsorFramework: string;
|
|
604
599
|
shipment: string;
|
|
605
600
|
rate_one: string;
|
|
606
|
-
rate_other: string;
|
|
607
|
-
* A unique Id refering the API code used to identify the type of order source, e.g. "amazon_ca"
|
|
608
|
-
*/
|
|
601
|
+
rate_other: string;
|
|
609
602
|
payment: string;
|
|
610
603
|
};
|
|
611
604
|
};
|
|
@@ -938,15 +931,15 @@ export declare const Element: ({ resources, ...props }: PurchaseLabelCommonProps
|
|
|
938
931
|
subFields: {
|
|
939
932
|
optional: string;
|
|
940
933
|
};
|
|
941
|
-
/**
|
|
942
|
-
* The Currency used through out the label purchase process. Default to USD
|
|
943
|
-
*/
|
|
944
934
|
parserFields: {
|
|
945
935
|
fullAddress: string;
|
|
946
936
|
};
|
|
947
937
|
paste: string;
|
|
948
938
|
preference: {
|
|
949
|
-
confirm: string;
|
|
939
|
+
confirm: string; /**
|
|
940
|
+
* A unique ID assigned during the creation of a sales order. It can be used to locate the
|
|
941
|
+
* sales order and any subsequent shipments related to that order.
|
|
942
|
+
*/
|
|
950
943
|
addressNotValidated: string;
|
|
951
944
|
modified: string;
|
|
952
945
|
title: string;
|
|
@@ -1044,6 +1037,7 @@ export declare const Element: ({ resources, ...props }: PurchaseLabelCommonProps
|
|
|
1044
1037
|
taxIssuingAuthority: string;
|
|
1045
1038
|
entityType: string;
|
|
1046
1039
|
};
|
|
1040
|
+
hsCode: string;
|
|
1047
1041
|
nonDelivery: {
|
|
1048
1042
|
returnToSender: string;
|
|
1049
1043
|
treatAsAbandoned: string;
|
|
@@ -1053,12 +1047,6 @@ export declare const Element: ({ resources, ...props }: PurchaseLabelCommonProps
|
|
|
1053
1047
|
recipientPays: string;
|
|
1054
1048
|
tooltip: {
|
|
1055
1049
|
title: string;
|
|
1056
|
-
/**
|
|
1057
|
-
* `onToggleAddressPreferenceDisclosure` is an async/sync callback function that will be invoked
|
|
1058
|
-
* each time the user toggles the `Address Preference` disclosure. This disclosure component
|
|
1059
|
-
* allows the user to select whether they would like to use the address they entered, or
|
|
1060
|
-
* the formatted address that we return after validation.
|
|
1061
|
-
*/
|
|
1062
1050
|
restriction: string;
|
|
1063
1051
|
requirement1: string;
|
|
1064
1052
|
requirement2: string;
|
|
@@ -1087,6 +1075,7 @@ export declare const Element: ({ resources, ...props }: PurchaseLabelCommonProps
|
|
|
1087
1075
|
shipments: string;
|
|
1088
1076
|
warehouses: string;
|
|
1089
1077
|
};
|
|
1078
|
+
labelHasBeenPurchased: string;
|
|
1090
1079
|
emailIsRequired: string;
|
|
1091
1080
|
unknown: string;
|
|
1092
1081
|
noRatesAvailable: string;
|
|
@@ -101,16 +101,18 @@ export declare const Element: ({ resources, ...props }: object & {
|
|
|
101
101
|
vatNumber: string;
|
|
102
102
|
vatRegistrationTooltip: string;
|
|
103
103
|
vatFormText: string;
|
|
104
|
-
vatFormRegisterLater: string;
|
|
105
104
|
vatNumberInputHint: string;
|
|
106
105
|
vatNumberInputPlaceholder: string;
|
|
107
106
|
verifiedVat: string;
|
|
107
|
+
vatNumberFieldLabel: string;
|
|
108
|
+
vatTypePlaceholder: string;
|
|
109
|
+
issuingAuthorityPlaceholder: string;
|
|
110
|
+
issuingAuthorityFieldLabel: string;
|
|
108
111
|
vatFormErrors: {
|
|
109
112
|
invalidFieldValue: string;
|
|
110
113
|
verificationFailure: string;
|
|
111
114
|
forbidden: string;
|
|
112
115
|
connectionNotSupported: string;
|
|
113
|
-
genericTitle: string;
|
|
114
116
|
genericText: string;
|
|
115
117
|
};
|
|
116
118
|
};
|
|
@@ -802,6 +804,7 @@ export declare const Element: ({ resources, ...props }: object & {
|
|
|
802
804
|
taxIssuingAuthority: string;
|
|
803
805
|
entityType: string;
|
|
804
806
|
};
|
|
807
|
+
hsCode: string;
|
|
805
808
|
nonDelivery: {
|
|
806
809
|
returnToSender: string;
|
|
807
810
|
treatAsAbandoned: string;
|
|
@@ -839,6 +842,7 @@ export declare const Element: ({ resources, ...props }: object & {
|
|
|
839
842
|
shipments: string;
|
|
840
843
|
warehouses: string;
|
|
841
844
|
};
|
|
845
|
+
labelHasBeenPurchased: string;
|
|
842
846
|
emailIsRequired: string;
|
|
843
847
|
unknown: string;
|
|
844
848
|
noRatesAvailable: string;
|
|
@@ -192,16 +192,20 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
192
192
|
vatNumber: string;
|
|
193
193
|
vatRegistrationTooltip: string;
|
|
194
194
|
vatFormText: string;
|
|
195
|
-
vatFormRegisterLater: string;
|
|
196
195
|
vatNumberInputHint: string;
|
|
197
196
|
vatNumberInputPlaceholder: string;
|
|
198
197
|
verifiedVat: string;
|
|
198
|
+
vatNumberFieldLabel: string;
|
|
199
|
+
vatTypePlaceholder: string;
|
|
200
|
+
issuingAuthorityPlaceholder: string;
|
|
201
|
+
issuingAuthorityFieldLabel: string; /**
|
|
202
|
+
* `features` is a set of feature flags you would like to enable or disable in this component.
|
|
203
|
+
*/
|
|
199
204
|
vatFormErrors: {
|
|
200
205
|
invalidFieldValue: string;
|
|
201
206
|
verificationFailure: string;
|
|
202
207
|
forbidden: string;
|
|
203
208
|
connectionNotSupported: string;
|
|
204
|
-
genericTitle: string;
|
|
205
209
|
genericText: string;
|
|
206
210
|
};
|
|
207
211
|
};
|
|
@@ -933,6 +937,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
933
937
|
taxIssuingAuthority: string;
|
|
934
938
|
entityType: string;
|
|
935
939
|
};
|
|
940
|
+
hsCode: string;
|
|
936
941
|
nonDelivery: {
|
|
937
942
|
returnToSender: string;
|
|
938
943
|
treatAsAbandoned: string;
|
|
@@ -970,6 +975,7 @@ export declare const Element: ({ resources, ...props }: ComponentProps & {
|
|
|
970
975
|
shipments: string;
|
|
971
976
|
warehouses: string;
|
|
972
977
|
};
|
|
978
|
+
labelHasBeenPurchased: string;
|
|
973
979
|
emailIsRequired: string;
|
|
974
980
|
unknown: string;
|
|
975
981
|
noRatesAvailable: string;
|
|
@@ -84,6 +84,7 @@ export declare const useShipmentsGrid: ({ shipmentStatus, showShipmentIdFilter,
|
|
|
84
84
|
currentPageSize: number;
|
|
85
85
|
onPageSelect: (page: number) => void;
|
|
86
86
|
onPageSizeSelect: (pageSize: number) => void;
|
|
87
|
+
resetCurrentPage: () => void;
|
|
87
88
|
};
|
|
88
89
|
pagesAmount: number;
|
|
89
90
|
pageSize: number;
|