@orderingstack/front-hooks 3.7.1 → 3.8.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/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +72 -29
- package/dist/index.es.js.map +1 -1
- package/dist/src/useAvailability.d.ts +7 -1
- package/dist/src/useAvailability.d.ts.map +1 -1
- package/dist/src/utils/timeAvailabilityFilter.d.ts +2 -2
- package/dist/src/utils/timeAvailabilityFilter.d.ts.map +1 -1
- package/dist/src/utils.d.ts +2 -1
- package/dist/src/utils.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -5,7 +5,13 @@ import { IProduct } from '@orderingstack/ordering-types';
|
|
|
5
5
|
* @param markOnly - boolean to only mark products with "outsideAvailabilitySlot" flag, if false removes products
|
|
6
6
|
* @param timeZone - venue timezone
|
|
7
7
|
* @param interval - availability checking interval [seconds]
|
|
8
|
-
* @param prefetchImageSizes - images sizes to be pre-fetched from OST media storage on menu loaded
|
|
9
8
|
*/
|
|
10
9
|
export declare function useAvailability(originalMenu?: IProduct[], markOnly?: boolean, timeZone?: string | undefined, interval?: number): IProduct[] | undefined;
|
|
10
|
+
export declare function useMenu({ originalMenu, markOnly, timeZone, interval, enableKeys, }: {
|
|
11
|
+
originalMenu?: IProduct[];
|
|
12
|
+
markOnly: boolean;
|
|
13
|
+
timeZone?: string;
|
|
14
|
+
interval?: number;
|
|
15
|
+
enableKeys?: string[];
|
|
16
|
+
}): IProduct[] | undefined;
|
|
11
17
|
//# sourceMappingURL=useAvailability.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAvailability.d.ts","sourceRoot":"","sources":["useAvailability.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"useAvailability.d.ts","sourceRoot":"","sources":["useAvailability.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAOzD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,YAAY,CAAC,EAAE,QAAQ,EAAE,EACzB,QAAQ,UAAQ,EAChB,QAAQ,GAAE,MAAM,GAAG,SAAqB,EACxC,QAAQ,SAAK,GACZ,QAAQ,EAAE,GAAG,SAAS,CAiCxB;AA6BD,wBAAgB,OAAO,CAAC,EACtB,YAAY,EACZ,QAAgB,EAChB,QAAQ,EACR,QAAa,EACb,UAAe,GAChB,EAAE;IACD,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB,0BAGA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConfigType } from 'dayjs';
|
|
2
|
-
import { IProduct,
|
|
2
|
+
import { IProduct, ISaleChannel } from '@orderingstack/ordering-types';
|
|
3
3
|
export declare const getHourAndMinutes: (text: string) => {
|
|
4
4
|
hour: number;
|
|
5
5
|
minutes: number;
|
|
@@ -7,5 +7,5 @@ export declare const getHourAndMinutes: (text: string) => {
|
|
|
7
7
|
export declare function isProductAvailable(item: IProduct, timeZone: string | undefined, dueTime: ConfigType): boolean;
|
|
8
8
|
export declare const filterTimeAvailabilityOfItems: (items: IProduct[], timeZone?: string | undefined, dueTime?: ConfigType, markOnly?: boolean) => IProduct[];
|
|
9
9
|
export declare const filterTimeAvailabilityOfProducts: (products: IProduct[], timeZone?: string | undefined, dueTime?: ConfigType, markOnly?: boolean) => IProduct[];
|
|
10
|
-
export declare function isChannelOpen(channel:
|
|
10
|
+
export declare function isChannelOpen(channel: ISaleChannel | undefined): boolean;
|
|
11
11
|
//# sourceMappingURL=timeAvailabilityFilter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeAvailabilityFilter.d.ts","sourceRoot":"","sources":["timeAvailabilityFilter.ts"],"names":[],"mappings":"AAGA,OAAc,EAAE,UAAU,EAAS,MAAM,OAAO,CAAC;AACjD,OAAO,EAEL,QAAQ,EACR,
|
|
1
|
+
{"version":3,"file":"timeAvailabilityFilter.d.ts","sourceRoot":"","sources":["timeAvailabilityFilter.ts"],"names":[],"mappings":"AAGA,OAAc,EAAE,UAAU,EAAS,MAAM,OAAO,CAAC;AACjD,OAAO,EAEL,QAAQ,EACR,YAAY,EAEb,MAAM,+BAA+B,CAAC;AAevC,eAAO,MAAM,iBAAiB,SAAU,MAAM;;;CAM7C,CAAC;AAEF,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,QAAQ,EACd,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,OAAO,EAAE,UAAU,GAClB,OAAO,CAuBT;AAED,eAAO,MAAM,6BAA6B,UACjC,QAAQ,EAAE,aACP,MAAM,GAAG,SAAS,YACnB,UAAU,yBAElB,QAAQ,EAmCV,CAAC;AAEF,eAAO,MAAM,gCAAgC,aACjC,QAAQ,EAAE,aACV,MAAM,GAAG,SAAS,YACnB,UAAU,mCAuCpB,CAAC;AAEF,wBAAgB,aAAa,CAAC,OAAO,EAAE,YAAY,GAAG,SAAS,WAY9D"}
|
package/dist/src/utils.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { IOrderLine, IDiscount } from '@orderingstack/ordering-types';
|
|
1
|
+
import { IOrderLine, IDiscount, IProduct } from '@orderingstack/ordering-types';
|
|
2
2
|
export declare function addDiscounts(discounts: IDiscount[] | undefined): number;
|
|
3
3
|
export declare function summarizeLineDiscounts(line: IOrderLine): number;
|
|
4
4
|
export declare function formatPrice(value: string | number, currency?: string | null, separator?: string, decimals?: number): string;
|
|
5
|
+
export declare function isProductEnabled(item: IProduct, enableKeys?: string[]): boolean;
|
|
5
6
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/src/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAEhF,wBAAgB,YAAY,CAAC,SAAS,EAAE,SAAS,EAAE,GAAG,SAAS,GAAG,MAAM,CAIvE;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAE/D;AAED,wBAAgB,WAAW,CACzB,KAAK,EAAE,MAAM,GAAG,MAAM,EACtB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,EACxB,SAAS,SAAM,EACf,QAAQ,SAAI,GACX,MAAM,CAKR;AAED,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,QAAQ,EACd,UAAU,CAAC,EAAE,MAAM,EAAE,GACpB,OAAO,CAQT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orderingstack/front-hooks",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.8.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.es.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@orderingstack/ordering-core": "^0.3.0",
|
|
19
|
-
"@orderingstack/ordering-types": "^1.0
|
|
19
|
+
"@orderingstack/ordering-types": "^1.2.0",
|
|
20
20
|
"dayjs": "^1.11.3",
|
|
21
21
|
"lodash": "^4.17.21",
|
|
22
22
|
"query-string": "7.1.3"
|