@orderingstack/front-hooks 0.0.1
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 +28 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.es.js +6956 -0
- package/dist/index.es.js.map +1 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/useAvailability.d.ts +10 -0
- package/dist/src/useAvailability.d.ts.map +1 -0
- package/dist/src/useDisplayPrice.d.ts +14 -0
- package/dist/src/useDisplayPrice.d.ts.map +1 -0
- package/dist/src/useInterval.d.ts +2 -0
- package/dist/src/useInterval.d.ts.map +1 -0
- package/dist/src/utils/timeAvailabilityFilter.d.ts +10 -0
- package/dist/src/utils/timeAvailabilityFilter.d.ts.map +1 -0
- package/package.json +41 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Product } from '@orderingstack/ordering-types';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param originalMenu
|
|
5
|
+
* @param markOnly - boolean to only mark products with "outsideAvailabilitySlot" flag, if false removes products
|
|
6
|
+
* @param timeZone - venue timezone
|
|
7
|
+
* @param interval - availability checking interval [seconds]
|
|
8
|
+
*/
|
|
9
|
+
export declare function useAvailability(originalMenu?: Product[], markOnly?: boolean, timeZone?: string | undefined, interval?: number): Product[] | undefined;
|
|
10
|
+
//# sourceMappingURL=useAvailability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAvailability.d.ts","sourceRoot":"","sources":["useAvailability.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAMxD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,YAAY,CAAC,EAAE,OAAO,EAAE,EACxB,QAAQ,UAAQ,EAChB,QAAQ,GAAE,MAAM,GAAG,SAAqB,EACxC,QAAQ,SAAK,GACZ,OAAO,EAAE,GAAG,SAAS,CA2BvB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Product, ProductConfig } from '@orderingstack/ordering-types';
|
|
2
|
+
interface UseDisplayPriceProps {
|
|
3
|
+
product: Product;
|
|
4
|
+
state?: ProductConfig;
|
|
5
|
+
selected?: boolean;
|
|
6
|
+
cheapestGroupOptionsProduct?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const useDisplayPrice: ({ product, state, selected, cheapestGroupOptionsProduct, }: UseDisplayPriceProps) => {
|
|
9
|
+
displayPrice: number;
|
|
10
|
+
showAsMinPrice: boolean | "" | undefined;
|
|
11
|
+
calculatedPriceDefaultProductState: number;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=useDisplayPrice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDisplayPrice.d.ts","sourceRoot":"","sources":["useDisplayPrice.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAEP,aAAa,EACd,MAAM,+BAA+B,CAAC;AAwEvC,UAAU,oBAAoB;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,2BAA2B,CAAC,EAAE,MAAM,CAAC;CACtC;AAED,eAAO,MAAM,eAAe,+DAKzB,oBAAoB;;;;CAsBtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInterval.d.ts","sourceRoot":"","sources":["useInterval.ts"],"names":[],"mappings":"AAGA,wBAAgB,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,QAmB5D"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ConfigType } from 'dayjs';
|
|
2
|
+
import { Product } from '@orderingstack/ordering-types';
|
|
3
|
+
export declare const getHourAndMinutes: (text: string) => {
|
|
4
|
+
hour: number;
|
|
5
|
+
minutes: number;
|
|
6
|
+
};
|
|
7
|
+
export declare function isProductAvailable(item: Product, timeZone: string | undefined, dueTime: ConfigType): boolean;
|
|
8
|
+
export declare const filterTimeAvailabilityOfItems: (items: Product[], timeZone?: string | undefined, dueTime?: ConfigType, markOnly?: boolean) => Product[];
|
|
9
|
+
export declare const filterTimeAvailabilityOfProducts: (products: Product[], timeZone?: string | undefined, dueTime?: ConfigType, markOnly?: boolean) => Product[];
|
|
10
|
+
//# sourceMappingURL=timeAvailabilityFilter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeAvailabilityFilter.d.ts","sourceRoot":"","sources":["timeAvailabilityFilter.ts"],"names":[],"mappings":"AAGA,OAAc,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAgB,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAetE,eAAO,MAAM,iBAAiB,SAAU,MAAM;;;CAM7C,CAAC;AAEF,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,OAAO,EACb,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,OAAO,EAAE,UAAU,GAClB,OAAO,CAuBT;AAED,eAAO,MAAM,6BAA6B,UACjC,OAAO,EAAE,aACN,MAAM,GAAG,SAAS,YACnB,UAAU,yBAElB,OAAO,EAmCT,CAAC;AAEF,eAAO,MAAM,gCAAgC,aACjC,OAAO,EAAE,aACT,MAAM,GAAG,SAAS,YACnB,UAAU,kCAuCpB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@orderingstack/front-hooks",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"main": "dist/index.cjs.js",
|
|
6
|
+
"module": "dist/index.es.js",
|
|
7
|
+
"types": "dist/src/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"dev": "vite",
|
|
13
|
+
"build": "vite build",
|
|
14
|
+
"test": "jest",
|
|
15
|
+
"prepublishOnly": "npm run build"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"dayjs": "^1.11.3",
|
|
19
|
+
"lodash": "^4.17.21"
|
|
20
|
+
},
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"react": ">=16.8.0"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/node": "^17.0.8",
|
|
26
|
+
"@types/react": "^17.0.38",
|
|
27
|
+
"@vitejs/plugin-react": "^1.1.4",
|
|
28
|
+
"react": "^18.2.0",
|
|
29
|
+
"typescript": "^4.5.4",
|
|
30
|
+
"vite": "^2.7.10",
|
|
31
|
+
"vite-plugin-dts": "^1.2.0",
|
|
32
|
+
"vite-tsconfig-paths": "^3.3.17"
|
|
33
|
+
},
|
|
34
|
+
"browserslist": [
|
|
35
|
+
"last 2 versions",
|
|
36
|
+
"> 1%",
|
|
37
|
+
"not dead",
|
|
38
|
+
"not ie <= 11",
|
|
39
|
+
"not op_mini all"
|
|
40
|
+
]
|
|
41
|
+
}
|