@haus-storefront-react/order-lines 0.0.7 → 0.0.8
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/CHANGELOG.md +10 -0
- package/{browser-ponyfill-DicrKK9y.js → browser-ponyfill-C2d1mOgA.js} +1 -1
- package/{browser-ponyfill-DvWJIATn.mjs → browser-ponyfill-D1gUcaIv.mjs} +1 -1
- package/index-CExwc_mr.js +118 -0
- package/{index-7xbm4Bku.mjs → index-rL_l9_5G.mjs} +2785 -2742
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/lib/order-lines.d.ts +4 -1
- package/lib/use-order-lines-props.d.ts +9 -6
- package/package.json +6 -6
- package/index-Ce7xqKjB.js +0 -118
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CExwc_mr.js");exports.OrderLines=e.OrderLines;exports.createOrderLinesScope=e.createOrderLinesScope;exports.useOrderLinesProps=e.useOrderLinesProps;
|
package/index.mjs
CHANGED
package/lib/order-lines.d.ts
CHANGED
|
@@ -23,6 +23,9 @@ interface OrderLinesRootProps {
|
|
|
23
23
|
orderCode?: string;
|
|
24
24
|
adjustable?: boolean;
|
|
25
25
|
removable?: boolean;
|
|
26
|
+
callbacks?: {
|
|
27
|
+
preAdjust?: (orderLineId: string, quantity: number) => Promise<void>;
|
|
28
|
+
};
|
|
26
29
|
}
|
|
27
30
|
interface OrderLineItemProps {
|
|
28
31
|
children?: React.ReactNode;
|
|
@@ -89,7 +92,7 @@ export declare const OrderLines: {
|
|
|
89
92
|
* @param props.children - Render prop that receives order lines data and functions
|
|
90
93
|
*/
|
|
91
94
|
Root: {
|
|
92
|
-
({ children, orderCode, adjustable, removable, __scopeOrderLines, }: ScopedProps<OrderLinesRootProps>): import("react/jsx-runtime").JSX.Element;
|
|
95
|
+
({ children, orderCode, adjustable, removable, callbacks, __scopeOrderLines, }: ScopedProps<OrderLinesRootProps>): import("react/jsx-runtime").JSX.Element;
|
|
93
96
|
displayName: string;
|
|
94
97
|
};
|
|
95
98
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Maybe, Order, OrderLine } from '@haus-storefront-react/shared-types';
|
|
2
|
+
import { ButtonHTMLAttributes, InputHTMLAttributes } from 'react';
|
|
2
3
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
3
|
-
import { WebButtonProps, NativeButtonProps, WebInputProps, NativeInputProps } from '@haus-storefront-react/common-utils';
|
|
4
4
|
export type UseOrderLinesResult = UseQueryResult<Maybe<Order>, Error> & {
|
|
5
5
|
orderLines: OrderLine[] | undefined;
|
|
6
6
|
adjustOrderLine: (orderLineId: string, quantity: number) => Promise<unknown>;
|
|
@@ -9,10 +9,10 @@ export type UseOrderLinesResult = UseQueryResult<Maybe<Order>, Error> & {
|
|
|
9
9
|
removeError: Error | null;
|
|
10
10
|
isAdjusting: boolean;
|
|
11
11
|
isRemoving: boolean;
|
|
12
|
-
getRemoveProps: (
|
|
13
|
-
getAdjustProps: (
|
|
14
|
-
getDecrementProps: (
|
|
15
|
-
getIncrementProps: (
|
|
12
|
+
getRemoveProps: (props?: Partial<ButtonHTMLAttributes<HTMLButtonElement>>) => ButtonHTMLAttributes<HTMLButtonElement>;
|
|
13
|
+
getAdjustProps: (props?: Partial<InputHTMLAttributes<HTMLInputElement>>) => InputHTMLAttributes<HTMLInputElement>;
|
|
14
|
+
getDecrementProps: (props?: Partial<ButtonHTMLAttributes<HTMLButtonElement>>) => ButtonHTMLAttributes<HTMLButtonElement>;
|
|
15
|
+
getIncrementProps: (props?: Partial<ButtonHTMLAttributes<HTMLButtonElement>>) => ButtonHTMLAttributes<HTMLButtonElement>;
|
|
16
16
|
};
|
|
17
17
|
interface UseOrderLinesOptions {
|
|
18
18
|
orderCode?: string;
|
|
@@ -22,6 +22,9 @@ interface UseOrderLinesOptions {
|
|
|
22
22
|
min?: number;
|
|
23
23
|
max?: number;
|
|
24
24
|
step?: number;
|
|
25
|
+
callbacks?: {
|
|
26
|
+
preAdjust?: (orderLineId: string, quantity: number) => Promise<void>;
|
|
27
|
+
};
|
|
25
28
|
}
|
|
26
|
-
export declare const useOrderLinesProps: ({ orderCode, adjustable, removable, fetchActiveOrder, min, max, step, }?: UseOrderLinesOptions) => UseOrderLinesResult;
|
|
29
|
+
export declare const useOrderLinesProps: ({ orderCode, adjustable, removable, fetchActiveOrder, min, max, step, callbacks, }?: UseOrderLinesOptions) => UseOrderLinesResult;
|
|
27
30
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haus-storefront-react/order-lines",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"main": "./index.js",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@haus-storefront-react/common-ui": "0.0.
|
|
15
|
-
"@haus-storefront-react/common-utils": "0.0.
|
|
16
|
-
"@haus-storefront-react/core": "0.0.
|
|
17
|
-
"@haus-storefront-react/hooks": "0.0.
|
|
18
|
-
"@haus-storefront-react/shared-types": "0.0.
|
|
14
|
+
"@haus-storefront-react/common-ui": "0.0.8",
|
|
15
|
+
"@haus-storefront-react/common-utils": "0.0.8",
|
|
16
|
+
"@haus-storefront-react/core": "0.0.8",
|
|
17
|
+
"@haus-storefront-react/hooks": "0.0.8",
|
|
18
|
+
"@haus-storefront-react/shared-types": "0.0.8"
|
|
19
19
|
}
|
|
20
20
|
}
|