@commercelayer/react-components 3.0.0-beta.1 → 3.0.0-beta.10
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/README.md +1 -1
- package/dist/components/AddressStateSelector.d.ts +11 -0
- package/dist/components/AdyenPayment.d.ts +18 -0
- package/dist/components/BraintreePayment.d.ts +12 -1
- package/dist/components/LineItemOption.d.ts +8 -5
- package/dist/components/LineItemOptions.d.ts +8 -3
- package/dist/components/PaymentGateway.d.ts +8 -1
- package/dist/components/PaymentMethod.d.ts +10 -1
- package/dist/components/PaymentSource.d.ts +2 -0
- package/dist/components/PaypalPayment.d.ts +0 -7
- package/dist/components/Shipment.d.ts +2 -0
- package/dist/components/StripePayment.d.ts +2 -6
- package/dist/components/WireTransferPayment.d.ts +0 -7
- package/dist/components/gateways/AdyenGateway.d.ts +5 -0
- package/dist/components/gateways/BraintreeGateway.d.ts +5 -0
- package/dist/components/gateways/PaypalGateway.d.ts +5 -0
- package/dist/components/gateways/StripeGateway.d.ts +5 -0
- package/dist/components/gateways/WireTransferGateway.d.ts +5 -0
- package/dist/components/utils/BaseInput.d.ts +1 -1
- package/dist/config/components.d.ts +22 -16
- package/dist/context/AddressContext.d.ts +4 -3
- package/dist/context/BillingAddressFormContext.d.ts +3 -0
- package/dist/context/CustomerContext.d.ts +2 -0
- package/dist/context/LineItemOptionChildrenContext.d.ts +1 -0
- package/dist/context/PaymentMethodChildrenContext.d.ts +3 -0
- package/dist/context/PaymentMethodContext.d.ts +8 -1
- package/dist/context/PlaceOrderContext.d.ts +3 -1
- package/dist/index.d.ts +1 -2
- package/dist/react-components.cjs.development.js +4672 -4097
- package/dist/react-components.cjs.development.js.map +1 -1
- package/dist/react-components.cjs.production.min.js +1 -1
- package/dist/react-components.cjs.production.min.js.map +1 -1
- package/dist/react-components.esm.js +4485 -3909
- package/dist/react-components.esm.js.map +1 -1
- package/dist/reducers/AddressReducer.d.ts +7 -2
- package/dist/reducers/CustomerReducer.d.ts +2 -8
- package/dist/reducers/PaymentMethodReducer.d.ts +25 -2
- package/dist/reducers/PlaceOrderReducer.d.ts +1 -0
- package/dist/typings/index.d.ts +4 -28
- package/dist/utils/addressesManager.d.ts +1 -0
- package/dist/utils/browserInfo.d.ts +9 -0
- package/dist/utils/countryStateCity.d.ts +9 -0
- package/dist/utils/customerOrderOptions.d.ts +4 -0
- package/dist/utils/getLoaderComponent.d.ts +3 -0
- package/dist/utils/isEmptyStates.d.ts +1 -0
- package/dist/utils/isJSON.d.ts +1 -0
- package/dist/utils/localStorage.d.ts +6 -0
- package/dist/utils/promisify.d.ts +1 -0
- package/dist/utils/validateFormFields.d.ts +1 -1
- package/package.json +48 -43
- package/dist/components/OrderList.d.ts +0 -26
- package/dist/components/OrderListRow.d.ts +0 -14
- package/dist/context/OrderListChildrenContext.d.ts +0 -14
- package/dist/typings/order.d.ts +0 -120
- package/dist/utils/icons.d.ts +0 -3
- package/dist/utils/isDate.d.ts +0 -1
- package/dist/utils/scrollbarWidth.d.ts +0 -1
|
@@ -3,7 +3,7 @@ import { BaseError } from "../typings/errors";
|
|
|
3
3
|
import { CommerceLayerConfig } from "../context/CommerceLayerContext";
|
|
4
4
|
import { OrderCollection } from '@commercelayer/js-sdk';
|
|
5
5
|
export declare type AddressActionType = 'setErrors' | 'setAddress' | 'setShipToDifferentAddress' | 'setCloneAddress' | 'cleanup';
|
|
6
|
-
export declare type AddressField = 'city' | 'company' | 'country_code' | 'first_name' | 'last_name' | 'line_1' | 'line_2' | 'phone' | 'state_code' | 'zip_code';
|
|
6
|
+
export declare type AddressField = 'city' | 'company' | 'country_code' | 'first_name' | 'last_name' | 'line_1' | 'line_2' | 'phone' | 'state_code' | 'zip_code' | 'billing_info';
|
|
7
7
|
export declare type AddressFieldView = AddressField | 'full_address' | 'full_name';
|
|
8
8
|
export declare const addressFields: AddressField[];
|
|
9
9
|
export declare type AddressResource = 'billingAddress' | 'shippingAddress';
|
|
@@ -23,7 +23,12 @@ export interface AddressAction {
|
|
|
23
23
|
}
|
|
24
24
|
export declare const addressInitialState: AddressState;
|
|
25
25
|
export interface SetAddressErrors {
|
|
26
|
-
<V extends BaseError[]>(
|
|
26
|
+
<V extends BaseError[]>(args: {
|
|
27
|
+
errors: V;
|
|
28
|
+
resource: 'billingAddress' | 'shippingAddress';
|
|
29
|
+
dispatch?: Dispatch<AddressAction>;
|
|
30
|
+
currentErrors?: V;
|
|
31
|
+
}): void;
|
|
27
32
|
}
|
|
28
33
|
export declare type SetAddressParams<V extends AddressSchema> = {
|
|
29
34
|
values: V;
|
|
@@ -3,15 +3,14 @@ import { BaseError } from "../typings/errors";
|
|
|
3
3
|
import { AddressCollection, CustomerPaymentSourceCollection, OrderCollection } from '@commercelayer/js-sdk';
|
|
4
4
|
import { CommerceLayerConfig } from "../context/CommerceLayerContext";
|
|
5
5
|
import { getOrderContext } from './OrderReducer';
|
|
6
|
-
|
|
7
|
-
export declare type CustomerActionType = 'setErrors' | 'setCustomerEmail' | 'setAddresses' | 'setPayments' | 'setOrders';
|
|
6
|
+
export declare type CustomerActionType = 'setErrors' | 'setCustomerEmail' | 'setAddresses' | 'setPayments';
|
|
8
7
|
export interface CustomerActionPayload {
|
|
9
8
|
addresses: AddressCollection[];
|
|
10
9
|
payments: CustomerPaymentSourceCollection[];
|
|
11
10
|
customerEmail: string;
|
|
12
11
|
errors: BaseError[];
|
|
13
|
-
orders: OrderAttributes[];
|
|
14
12
|
isGuest: boolean;
|
|
13
|
+
getCustomerPaymentSources: () => Promise<void>;
|
|
15
14
|
}
|
|
16
15
|
export declare type CustomerState = Partial<CustomerActionPayload>;
|
|
17
16
|
export interface CustomerAction {
|
|
@@ -47,11 +46,6 @@ export declare type GetCustomerPaymentSources = (params: {
|
|
|
47
46
|
order?: OrderCollection;
|
|
48
47
|
}) => Promise<void>;
|
|
49
48
|
export declare const getCustomerPaymentSources: GetCustomerPaymentSources;
|
|
50
|
-
export declare type GetCustomerOrders = (params: {
|
|
51
|
-
config: CommerceLayerConfig;
|
|
52
|
-
dispatch: Dispatch<CustomerAction>;
|
|
53
|
-
}) => Promise<void>;
|
|
54
|
-
export declare const getCustomerOrders: GetCustomerOrders;
|
|
55
49
|
export declare const customerInitialState: CustomerState;
|
|
56
50
|
declare const customerReducer: (state: CustomerState, reducer: CustomerAction) => CustomerState;
|
|
57
51
|
export default customerReducer;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AdyenPaymentConfig } from "../components/AdyenPayment";
|
|
1
2
|
import { BraintreeConfig } from "../components/BraintreePayment";
|
|
2
3
|
import { PaypalConfig } from "../components/PaypalPayment";
|
|
3
4
|
import { StripeConfig } from "../components/StripePayment";
|
|
@@ -6,16 +7,28 @@ import { CommerceLayerConfig } from "../context/CommerceLayerContext";
|
|
|
6
7
|
import { getOrderContext } from "./OrderReducer";
|
|
7
8
|
import { BaseError } from "../typings/errors";
|
|
8
9
|
import { OrderCollection, PaymentMethodCollection, StripePaymentCollection, WireTransferCollection } from '@commercelayer/js-sdk';
|
|
9
|
-
import { Dispatch } from 'react';
|
|
10
|
-
export declare type PaymentMethodActionType = 'setErrors' | 'setPaymentMethods' | 'setPaymentMethodConfig' | 'setPaymentSource';
|
|
10
|
+
import { Dispatch, MutableRefObject } from 'react';
|
|
11
|
+
export declare type PaymentMethodActionType = 'setErrors' | 'setPaymentMethods' | 'setPaymentMethodConfig' | 'setPaymentSource' | 'setPaymentRef' | 'setLoading';
|
|
12
|
+
export declare type PaymentRef = MutableRefObject<null | HTMLFormElement>;
|
|
11
13
|
export interface PaymentMethodActionPayload {
|
|
12
14
|
errors: BaseError[];
|
|
13
15
|
paymentMethods: PaymentMethodCollection[];
|
|
14
16
|
currentPaymentMethodType: PaymentResource;
|
|
15
17
|
currentPaymentMethodId: string;
|
|
18
|
+
currentPaymentMethodRef: PaymentRef;
|
|
16
19
|
config: PaymentMethodConfig;
|
|
17
20
|
paymentSource: PaymentSourceTypes;
|
|
21
|
+
loading: boolean;
|
|
18
22
|
}
|
|
23
|
+
export declare function setLoading({ loading, dispatch, }: {
|
|
24
|
+
loading: boolean;
|
|
25
|
+
dispatch?: Dispatch<PaymentMethodAction>;
|
|
26
|
+
}): void;
|
|
27
|
+
export declare type SetPaymentRef = (args: {
|
|
28
|
+
ref: PaymentRef;
|
|
29
|
+
dispatch?: Dispatch<PaymentMethodAction>;
|
|
30
|
+
}) => void;
|
|
31
|
+
export declare const setPaymentRef: SetPaymentRef;
|
|
19
32
|
export declare type PaymentMethodState = Partial<PaymentMethodActionPayload>;
|
|
20
33
|
export interface PaymentMethodAction {
|
|
21
34
|
type: PaymentMethodActionType;
|
|
@@ -62,8 +75,17 @@ export declare type SetPaymentSource = (args: {
|
|
|
62
75
|
paymentResource: PaymentResource;
|
|
63
76
|
paymentSourceId?: string;
|
|
64
77
|
customerPaymentSourceId?: string;
|
|
78
|
+
rawResponse?: boolean;
|
|
65
79
|
} & PaymentMethodState) => Promise<SetPaymentSourceResponse>;
|
|
66
80
|
export declare const setPaymentSource: SetPaymentSource;
|
|
81
|
+
export declare type UpdatePaymentSource = (args: {
|
|
82
|
+
id: string;
|
|
83
|
+
attributes: Record<string, any>;
|
|
84
|
+
paymentResource: PaymentResource;
|
|
85
|
+
config?: CommerceLayerConfig;
|
|
86
|
+
dispatch?: Dispatch<PaymentMethodAction>;
|
|
87
|
+
}) => Promise<void>;
|
|
88
|
+
export declare const updatePaymentSource: UpdatePaymentSource;
|
|
67
89
|
export declare type DestroyPaymentSource = (args: {
|
|
68
90
|
paymentSourceId: string;
|
|
69
91
|
paymentResource: PaymentResource;
|
|
@@ -75,6 +97,7 @@ export declare type PaymentMethodConfig = {
|
|
|
75
97
|
braintreePayment?: BraintreeConfig;
|
|
76
98
|
wireTransfer?: Partial<WireTransferConfig>;
|
|
77
99
|
paypalPayment?: PaypalConfig;
|
|
100
|
+
adyenPayment?: AdyenPaymentConfig;
|
|
78
101
|
};
|
|
79
102
|
declare type SetPaymentMethodConfig = (config: PaymentMethodConfig, dispatch: Dispatch<PaymentMethodAction>) => void;
|
|
80
103
|
export declare const setPaymentMethodConfig: SetPaymentMethodConfig;
|
package/dist/typings/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Dispatch, ReactNode, RefObject } from 'react';
|
|
2
|
-
import PropTypes, { InferProps
|
|
2
|
+
import PropTypes, { InferProps } from 'prop-types';
|
|
3
3
|
import { BaseError } from './errors';
|
|
4
4
|
export declare const BC: {
|
|
5
5
|
id: PropTypes.Requireable<string>;
|
|
@@ -57,10 +57,11 @@ export interface BaseInputComponentProps {
|
|
|
57
57
|
}
|
|
58
58
|
export declare type LineItemType = 'gift_cards' | 'paymentMethods' | 'promotions' | 'shipments' | 'skus';
|
|
59
59
|
export declare type GiftCardInputName = 'balanceCents' | 'balanceMaxCents' | 'singleUse' | 'rechargeable' | 'imageUrl' | 'expiresAt' | 'referenceOrigin' | 'email' | 'firstName' | 'lastName' | 'reference';
|
|
60
|
-
export declare type AddressInputName = 'billing_address_city' | 'billing_address_company' | 'billing_address_first_name' | 'billing_address_email' | 'billing_address_last_name' | 'billing_address_line_1' | 'billing_address_line_2' | 'billing_address_phone' | 'billing_address_state_code' | 'billing_address_zip_code' | 'billing_address_save_to_customer_book' | 'shipping_address_city' | 'shipping_address_company' | 'shipping_address_email' | 'shipping_address_first_name' | 'shipping_address_last_name' | 'shipping_address_line_1' | 'shipping_address_line_2' | 'shipping_address_phone' | 'shipping_address_state_code' | 'shipping_address_zip_code' | 'shipping_address_save_to_customer_book';
|
|
60
|
+
export declare type AddressInputName = 'billing_address_city' | 'billing_address_company' | 'billing_address_first_name' | 'billing_address_email' | 'billing_address_last_name' | 'billing_address_line_1' | 'billing_address_line_2' | 'billing_address_phone' | 'billing_address_state_code' | 'billing_address_zip_code' | 'billing_address_billing_info' | 'billing_address_save_to_customer_book' | 'shipping_address_city' | 'shipping_address_company' | 'shipping_address_email' | 'shipping_address_first_name' | 'shipping_address_last_name' | 'shipping_address_line_1' | 'shipping_address_line_2' | 'shipping_address_phone' | 'shipping_address_state_code' | 'shipping_address_zip_code' | 'shipping_address_save_to_customer_book';
|
|
61
61
|
export declare type AddressCountrySelectName = 'billing_address_country_code' | 'shipping_address_country_code';
|
|
62
|
+
export declare type AddressStateSelectName = 'billing_address_state_code' | 'shipping_address_state_code';
|
|
62
63
|
export declare type BaseInputType = 'checkbox' | 'date' | 'email' | 'number' | 'tel' | 'text' | 'textarea';
|
|
63
|
-
export declare type LoaderType = string |
|
|
64
|
+
export declare type LoaderType = string | ReactNode;
|
|
64
65
|
export declare const BMObject: PropTypes.Requireable<{
|
|
65
66
|
[x: string]: string | null | undefined;
|
|
66
67
|
}>;
|
|
@@ -122,29 +123,4 @@ export declare type BaseAmountComponent = {
|
|
|
122
123
|
export interface FunctionChildren<P = Record<string, any>> {
|
|
123
124
|
(props: P): ReactNode;
|
|
124
125
|
}
|
|
125
|
-
export declare type Jwt = {
|
|
126
|
-
organization: {
|
|
127
|
-
id: string;
|
|
128
|
-
slug: string;
|
|
129
|
-
};
|
|
130
|
-
application: {
|
|
131
|
-
id: string;
|
|
132
|
-
kind: string;
|
|
133
|
-
public: boolean;
|
|
134
|
-
};
|
|
135
|
-
test: boolean;
|
|
136
|
-
owner?: {
|
|
137
|
-
id: string;
|
|
138
|
-
type: string;
|
|
139
|
-
};
|
|
140
|
-
exp: number;
|
|
141
|
-
market: {
|
|
142
|
-
id: string[];
|
|
143
|
-
price_list_id: string;
|
|
144
|
-
stock_location_ids: string[];
|
|
145
|
-
geocoder_id: null;
|
|
146
|
-
allows_external_prices: boolean;
|
|
147
|
-
};
|
|
148
|
-
rand: number;
|
|
149
|
-
};
|
|
150
126
|
export {};
|
|
@@ -3,6 +3,7 @@ declare type BillingAddressController = (params: {
|
|
|
3
3
|
billingAddress?: Record<string, any>;
|
|
4
4
|
billingAddressId?: string;
|
|
5
5
|
errors?: BaseError[];
|
|
6
|
+
requiresBillingInfo?: boolean;
|
|
6
7
|
}) => boolean;
|
|
7
8
|
export declare const billingAddressController: BillingAddressController;
|
|
8
9
|
declare type ShippingAddressController = (params: {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function getCountries(): {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
}[];
|
|
5
|
+
export declare function getStateOfCountry(country_code: string): {
|
|
6
|
+
label: string;
|
|
7
|
+
value: string;
|
|
8
|
+
}[];
|
|
9
|
+
export declare function isValidState(state_code: string, country_code: string): boolean;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { PlaceOrderOptions } from "../reducers/PlaceOrderReducer";
|
|
2
|
+
export declare function saveToWallet(options?: PlaceOrderOptions): boolean;
|
|
3
|
+
export declare function saveBillingAddress(options?: PlaceOrderOptions): boolean;
|
|
4
|
+
export declare function saveShippingAddress(options?: PlaceOrderOptions): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function isEmptyStates(countryCode: string): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function isJSON(str: string): boolean;
|
|
@@ -10,3 +10,9 @@ export interface DeleteLocalOrder {
|
|
|
10
10
|
(key: string): void;
|
|
11
11
|
}
|
|
12
12
|
export declare const deleteLocalOrder: DeleteLocalOrder;
|
|
13
|
+
export declare const getSavePaymentSourceToCustomerWallet: () => boolean;
|
|
14
|
+
export declare const getSaveBillingAddressToAddressBook: () => boolean;
|
|
15
|
+
export declare const getSaveShippingAddressToAddressBook: () => boolean;
|
|
16
|
+
declare type CustomerOrderParams = 'savePaymentSourceToCustomerWallet' | 'saveBillingAddressToCustomerAddressBook' | 'saveShippingAddressToCustomerAddressBook';
|
|
17
|
+
export declare function setCustomerOrderParam<T extends CustomerOrderParams>(key: T, value: string): void;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function promisify(cb: any, params?: any): Promise<any>;
|
|
@@ -13,7 +13,7 @@ export interface ValidateValue {
|
|
|
13
13
|
export declare const validateValue: ValidateValue;
|
|
14
14
|
declare const validateFormFields: ValidateFormFields;
|
|
15
15
|
export interface FieldsExist {
|
|
16
|
-
(
|
|
16
|
+
(address: AddressSchema, schema?: AddressField[]): boolean;
|
|
17
17
|
}
|
|
18
18
|
export declare const fieldsExist: FieldsExist;
|
|
19
19
|
export default validateFormFields;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercelayer/react-components",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.10",
|
|
4
4
|
"description": "The Official Commerce Layer React Components",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"version:fix": "npm version patch",
|
|
29
29
|
"version:feat": "npm version minor",
|
|
30
30
|
"version:perf": "npm version major",
|
|
31
|
+
"publish:beta": "git push --follow-tags && npm publish --public --tag beta",
|
|
31
32
|
"publish:fix": "npm run build && npm run version:fix && git push --follow-tags && npm publish --access public",
|
|
32
33
|
"publish:feat": "npm run build && npm run version:feat && git push --follow-tags && npm publish --access public",
|
|
33
34
|
"publish:perf": "npm run build && npm run version:perf && git push --follow-tags && npm publish --access public"
|
|
@@ -65,73 +66,77 @@
|
|
|
65
66
|
}
|
|
66
67
|
],
|
|
67
68
|
"dependencies": {
|
|
69
|
+
"@adyen/adyen-web": "^5.0.0",
|
|
68
70
|
"@commercelayer/js-sdk": "^3.9.2",
|
|
69
|
-
"@stripe/react-stripe-js": "^1.
|
|
70
|
-
"@stripe/stripe-js": "^1.
|
|
71
|
-
"braintree-web": "^3.
|
|
71
|
+
"@stripe/react-stripe-js": "^1.6.0",
|
|
72
|
+
"@stripe/stripe-js": "^1.20.3",
|
|
73
|
+
"braintree-web": "^3.82.0",
|
|
74
|
+
"countries-states-cities-service": "^1.2.1",
|
|
75
|
+
"deps": "^1.0.0",
|
|
72
76
|
"jwt-decode": "^3.1.2",
|
|
73
77
|
"lodash": "^4.17.21",
|
|
74
78
|
"lodash-es": "^4.17.21",
|
|
75
|
-
"rapid-form": "^1.
|
|
79
|
+
"rapid-form": "^1.5.3",
|
|
76
80
|
"react-table": "^7.7.0",
|
|
77
|
-
"react-window": "^1.8.6"
|
|
81
|
+
"react-window": "^1.8.6",
|
|
82
|
+
"react-windows": "^1.0.0"
|
|
78
83
|
},
|
|
79
84
|
"devDependencies": {
|
|
80
|
-
"@babel/plugin-proposal-class-properties": "^7.
|
|
81
|
-
"@babel/preset-env": "^7.
|
|
82
|
-
"@babel/preset-react": "^7.
|
|
83
|
-
"@babel/preset-typescript": "^7.
|
|
85
|
+
"@babel/plugin-proposal-class-properties": "^7.14.5",
|
|
86
|
+
"@babel/preset-env": "^7.15.8",
|
|
87
|
+
"@babel/preset-react": "^7.14.5",
|
|
88
|
+
"@babel/preset-typescript": "^7.15.0",
|
|
84
89
|
"@commercelayer/cypress-vcr": "^1.1.0",
|
|
85
|
-
"@commercelayer/js-auth": "^2.0.
|
|
86
|
-
"@cypress/code-coverage": "^3.9.
|
|
87
|
-
"@cypress/webpack-preprocessor": "^5.9.
|
|
88
|
-
"@rollup/plugin-alias": "^3.1.
|
|
89
|
-
"@size-limit/preset-big-lib": "^
|
|
90
|
-
"@tailwindcss/aspect-ratio": "^0.
|
|
91
|
-
"@tailwindcss/forms": "^0.3.
|
|
90
|
+
"@commercelayer/js-auth": "^2.0.8",
|
|
91
|
+
"@cypress/code-coverage": "^3.9.11",
|
|
92
|
+
"@cypress/webpack-preprocessor": "^5.9.1",
|
|
93
|
+
"@rollup/plugin-alias": "^3.1.6",
|
|
94
|
+
"@size-limit/preset-big-lib": "^6.0.3",
|
|
95
|
+
"@tailwindcss/aspect-ratio": "^0.3.0",
|
|
96
|
+
"@tailwindcss/forms": "^0.3.4",
|
|
92
97
|
"@tailwindcss/typography": "^0.4.1",
|
|
93
|
-
"@types/braintree-web": "^3.75.
|
|
94
|
-
"@types/jest": "^
|
|
95
|
-
"@types/lodash": "^4.14.
|
|
96
|
-
"@types/node": "^
|
|
97
|
-
"@types/prop-types": "^15.7.
|
|
98
|
-
"@types/react": "^17.0.
|
|
99
|
-
"@types/react-table": "^7.7.
|
|
98
|
+
"@types/braintree-web": "^3.75.7",
|
|
99
|
+
"@types/jest": "^27.0.2",
|
|
100
|
+
"@types/lodash": "^4.14.175",
|
|
101
|
+
"@types/node": "^16.11.1",
|
|
102
|
+
"@types/prop-types": "^15.7.4",
|
|
103
|
+
"@types/react": "^17.0.24",
|
|
104
|
+
"@types/react-table": "^7.7.5",
|
|
100
105
|
"@types/react-test-renderer": "^17.0.1",
|
|
101
|
-
"@types/react-window": "^1.8.
|
|
102
|
-
"@typescript-eslint/eslint-plugin": "^4.
|
|
103
|
-
"@typescript-eslint/parser": "^4.
|
|
106
|
+
"@types/react-window": "^1.8.5",
|
|
107
|
+
"@typescript-eslint/eslint-plugin": "^4.31.2",
|
|
108
|
+
"@typescript-eslint/parser": "^4.31.2",
|
|
104
109
|
"@zeit/next-css": "^1.0.1",
|
|
105
110
|
"@zerollup/ts-transform-paths": "^1.7.18",
|
|
106
|
-
"autoprefixer": "^10.
|
|
107
|
-
"babel-jest": "^27.
|
|
111
|
+
"autoprefixer": "^10.3.7",
|
|
112
|
+
"babel-jest": "^27.3.1",
|
|
108
113
|
"babel-loader": "^8.2.2",
|
|
109
|
-
"babel-plugin-istanbul": "^6.
|
|
110
|
-
"cypress": "^
|
|
111
|
-
"eslint": "^
|
|
114
|
+
"babel-plugin-istanbul": "^6.1.1",
|
|
115
|
+
"cypress": "^8.5.0",
|
|
116
|
+
"eslint": "^8.0.1",
|
|
112
117
|
"eslint-config-prettier": "^8.3.0",
|
|
113
118
|
"eslint-config-react-app": "^6.0.0",
|
|
114
|
-
"eslint-plugin-react": "^7.
|
|
119
|
+
"eslint-plugin-react": "^7.26.0",
|
|
115
120
|
"eslint-plugin-react-hooks": "^4.2.0",
|
|
116
|
-
"jest": "^27.
|
|
117
|
-
"next": "^
|
|
118
|
-
"postcss": "^8.3.
|
|
119
|
-
"postcss-loader": "^
|
|
120
|
-
"prettier": "^2.
|
|
121
|
+
"jest": "^27.3.1",
|
|
122
|
+
"next": "^11.1.2",
|
|
123
|
+
"postcss": "^8.3.9",
|
|
124
|
+
"postcss-loader": "^6.2.0",
|
|
125
|
+
"prettier": "^2.4.1",
|
|
121
126
|
"prop-types": "^15.7.2",
|
|
122
127
|
"react": "^17.0.2",
|
|
123
128
|
"react-dom": "^17.0.2",
|
|
124
129
|
"react-test-renderer": "^17.0.2",
|
|
125
130
|
"rollup-plugin-babel": "^4.4.0",
|
|
126
131
|
"rollup-plugin-node-resolve": "^5.2.0",
|
|
127
|
-
"size-limit": "^
|
|
128
|
-
"tailwindcss": "^2.
|
|
129
|
-
"ts-jest": "^27.0.
|
|
130
|
-
"ts-loader": "^9.2.
|
|
132
|
+
"size-limit": "^6.0.3",
|
|
133
|
+
"tailwindcss": "^2.2.17",
|
|
134
|
+
"ts-jest": "^27.0.7",
|
|
135
|
+
"ts-loader": "^9.2.6",
|
|
131
136
|
"tsconfig-paths-jest": "^0.0.1",
|
|
132
137
|
"tsdx": "^0.14.1",
|
|
133
138
|
"ttypescript": "^1.5.12",
|
|
134
|
-
"typescript": "^4.
|
|
139
|
+
"typescript": "^4.4.4"
|
|
135
140
|
},
|
|
136
141
|
"peerDependencies": {
|
|
137
142
|
"react": "^17.0.2",
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent, ReactNode, ReactElement } from 'react';
|
|
2
|
-
import { InitialOrderListContext } from "../context/OrderListChildrenContext";
|
|
3
|
-
import { Column } from 'react-table';
|
|
4
|
-
declare type OrderListProps = {
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
columns: (Column & {
|
|
7
|
-
className?: string;
|
|
8
|
-
})[];
|
|
9
|
-
loadingElement?: ReactElement;
|
|
10
|
-
actionsComponent?: InitialOrderListContext['actionsComponent'];
|
|
11
|
-
actionsContainerClassName?: string;
|
|
12
|
-
showActions?: boolean;
|
|
13
|
-
} & JSX.IntrinsicElements['table'] & ({
|
|
14
|
-
infiniteScroll: true;
|
|
15
|
-
windowOptions?: {
|
|
16
|
-
height?: number;
|
|
17
|
-
itemSize?: number;
|
|
18
|
-
width?: number;
|
|
19
|
-
column?: number;
|
|
20
|
-
};
|
|
21
|
-
} | {
|
|
22
|
-
infiniteScroll?: false;
|
|
23
|
-
windowOptions?: never;
|
|
24
|
-
});
|
|
25
|
-
declare const OrderList: FunctionComponent<OrderListProps>;
|
|
26
|
-
export default OrderList;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent, ReactNode } from 'react';
|
|
2
|
-
import { Cell, Row } from 'react-table';
|
|
3
|
-
import OrderAttributes from "../typings/order";
|
|
4
|
-
declare type OrderListHeaderChildrenProps = Omit<OrderListHeaderProps, 'children'> & {
|
|
5
|
-
order: Record<string, any>;
|
|
6
|
-
row: Row;
|
|
7
|
-
cell: Cell[];
|
|
8
|
-
};
|
|
9
|
-
declare type OrderListHeaderProps = {
|
|
10
|
-
children?: (props: OrderListHeaderChildrenProps) => ReactNode;
|
|
11
|
-
field: keyof OrderAttributes;
|
|
12
|
-
} & JSX.IntrinsicElements['td'];
|
|
13
|
-
declare const OrderListRow: FunctionComponent<OrderListHeaderProps>;
|
|
14
|
-
export default OrderListRow;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import OrderAttributes from "../typings/order";
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
import { Row } from 'react-table';
|
|
4
|
-
export interface InitialOrderListContext {
|
|
5
|
-
order: OrderAttributes | null;
|
|
6
|
-
row: Row<OrderAttributes>;
|
|
7
|
-
showActions: boolean;
|
|
8
|
-
actionsComponent?: (props: {
|
|
9
|
-
order: OrderAttributes;
|
|
10
|
-
}) => ReactNode;
|
|
11
|
-
actionsContainerClassName?: string;
|
|
12
|
-
}
|
|
13
|
-
declare const OrderListChildrenContext: import("react").Context<InitialOrderListContext>;
|
|
14
|
-
export default OrderListChildrenContext;
|
package/dist/typings/order.d.ts
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
export default interface OrderAttributes {
|
|
2
|
-
_approve: boolean;
|
|
3
|
-
_billing_address_clone_id: string;
|
|
4
|
-
_billing_address_same_as_shipping: boolean;
|
|
5
|
-
_cancel: boolean;
|
|
6
|
-
_capture: boolean;
|
|
7
|
-
_customer_payment_source_id: string;
|
|
8
|
-
_place: boolean;
|
|
9
|
-
_refresh: boolean;
|
|
10
|
-
_refund: boolean;
|
|
11
|
-
_saveBilling_address_to_customer_address_book: boolean;
|
|
12
|
-
_save_payment_source_to_customer_wallet: boolean;
|
|
13
|
-
_save_shipping_address_to_customer_address_book: boolean;
|
|
14
|
-
_shipping_address_clone_id: string;
|
|
15
|
-
_shipping_address_same_as_billing: boolean;
|
|
16
|
-
_update_taxes: boolean;
|
|
17
|
-
adjustment_amount_cents: number;
|
|
18
|
-
adjustment_amount_float: number;
|
|
19
|
-
adjustment_tax_amount_cents: number;
|
|
20
|
-
adjustment_tax_amount_float: number;
|
|
21
|
-
approved_at: string;
|
|
22
|
-
archived_at: string;
|
|
23
|
-
cancelled_at: string;
|
|
24
|
-
cart_url: string;
|
|
25
|
-
checkout_url: string;
|
|
26
|
-
country_code: string;
|
|
27
|
-
coupon_code: string;
|
|
28
|
-
created_at: string;
|
|
29
|
-
currency_code: string;
|
|
30
|
-
customer_email: string;
|
|
31
|
-
customer_password: string;
|
|
32
|
-
discount_amount_cents: number;
|
|
33
|
-
discount_amount_float: number;
|
|
34
|
-
discount_tax_amount_cents: number;
|
|
35
|
-
discount_tax_amount_float: number;
|
|
36
|
-
discount_taxable_amount_cents: number;
|
|
37
|
-
discount_taxable_amount_float: number;
|
|
38
|
-
editable: boolean;
|
|
39
|
-
fees_amount_cents: number;
|
|
40
|
-
fees_amount_float: number;
|
|
41
|
-
formatted_adjustment_amount: string;
|
|
42
|
-
formatted_adjustment_tax_amount: number;
|
|
43
|
-
formatted_discount_amount: string;
|
|
44
|
-
formatted_discount_tax_amount: string;
|
|
45
|
-
formatted_discount_taxable_amount: string;
|
|
46
|
-
formatted_fees_amount: string;
|
|
47
|
-
formatted_gift_card_amount: string;
|
|
48
|
-
formatted_payment_method_amount: string;
|
|
49
|
-
formatted_payment_method_tax_amount: string;
|
|
50
|
-
formatted_payment_method_taxable_amount: string;
|
|
51
|
-
formatted_shipping_amount: string;
|
|
52
|
-
formatted_shipping_tax_amount: string;
|
|
53
|
-
formatted_shipping_taxable_amount: string;
|
|
54
|
-
formatted_subtotal_amount: string;
|
|
55
|
-
formatted_subtotal_tax_amount: string;
|
|
56
|
-
formatted_subtotal_taxable_amount: string;
|
|
57
|
-
formatted_total_amount: string;
|
|
58
|
-
formatted_total_amount_with_taxes: string;
|
|
59
|
-
formatted_total_tax_amount: string;
|
|
60
|
-
formatted_total_taxable_amount: string;
|
|
61
|
-
freight_taxable: boolean;
|
|
62
|
-
fulfillment_status: string;
|
|
63
|
-
fulfillment_updated_at: string;
|
|
64
|
-
gift_card_amount_cents: number;
|
|
65
|
-
gift_card_amount_float: number;
|
|
66
|
-
gift_card_code: string;
|
|
67
|
-
gift_card_or_coupon_code: string;
|
|
68
|
-
guest: boolean;
|
|
69
|
-
id: string;
|
|
70
|
-
language_code: string;
|
|
71
|
-
line_item_options_count: number;
|
|
72
|
-
metadata: object;
|
|
73
|
-
number: number;
|
|
74
|
-
payment_method_amount_cents: number;
|
|
75
|
-
payment_method_amount_float: number;
|
|
76
|
-
payment_method_tax_amount_cents: number;
|
|
77
|
-
payment_method_tax_amount_float: number;
|
|
78
|
-
payment_method_taxable_amount_cents: number;
|
|
79
|
-
payment_method_taxable_amount_float: number;
|
|
80
|
-
payment_source_details: object;
|
|
81
|
-
payment_source_id: string;
|
|
82
|
-
payment_source_type: string;
|
|
83
|
-
payment_status: string;
|
|
84
|
-
payment_updated_at: string;
|
|
85
|
-
placeable: boolean;
|
|
86
|
-
placed_at: string;
|
|
87
|
-
privacy_url: string;
|
|
88
|
-
reference: string;
|
|
89
|
-
reference_origin: string;
|
|
90
|
-
return_url: string;
|
|
91
|
-
shipments_count: number;
|
|
92
|
-
shipping_amount_cents: number;
|
|
93
|
-
shipping_amount_float: number;
|
|
94
|
-
shipping_country_code_lock: string;
|
|
95
|
-
shipping_tax_amount_cents: number;
|
|
96
|
-
shipping_tax_amount_float: number;
|
|
97
|
-
shipping_taxable_amount_cents: number;
|
|
98
|
-
shipping_taxable_amount_float: number;
|
|
99
|
-
skus_count: string;
|
|
100
|
-
status: string;
|
|
101
|
-
subtotal_amount_cents: number;
|
|
102
|
-
subtotal_amount_float: number;
|
|
103
|
-
subtotal_tax_amount_cents: number;
|
|
104
|
-
subtotal_tax_amount_float: number;
|
|
105
|
-
subtotal_taxable_amount_cents: number;
|
|
106
|
-
subtotal_taxable_amount_float: number;
|
|
107
|
-
tax_included: boolean;
|
|
108
|
-
tax_rate: number;
|
|
109
|
-
terms_url: string;
|
|
110
|
-
token: string;
|
|
111
|
-
total_amount_cents: number;
|
|
112
|
-
total_amount_float: number;
|
|
113
|
-
total_amount_with_taxes_cents: number;
|
|
114
|
-
total_amount_with_taxes_float: number;
|
|
115
|
-
total_tax_amount_cents: number;
|
|
116
|
-
total_tax_amount_float: number;
|
|
117
|
-
total_taxable_amount_cents: number;
|
|
118
|
-
total_taxable_amount_float: number;
|
|
119
|
-
updated_at: string;
|
|
120
|
-
}
|
package/dist/utils/icons.d.ts
DELETED
package/dist/utils/isDate.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function isDate(value: string): boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function scrollbarWidth(): number;
|