npm-pkg-hook 1.0.2 → 1.0.5

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.
Files changed (85) hide show
  1. package/.babelrc +13 -13
  2. package/.env +1 -0
  3. package/.eslintrc.js +132 -0
  4. package/.eslintrc.json +107 -107
  5. package/.github/pull_request_template.md +17 -17
  6. package/.github/workflows/pepeline.yaml +29 -29
  7. package/.vscode/extensions.json +6 -0
  8. package/.vscode/settings.json +12 -0
  9. package/README.md +1 -1
  10. package/jsconfig.json +27 -27
  11. package/next.config.js +128 -128
  12. package/package.json +8 -6
  13. package/script.txt +7 -0
  14. package/src/cookies/index.ts +3 -3
  15. package/src/hooks/index.js +47 -19
  16. package/src/hooks/updateExtProductFoodsOptional/index.js +38 -0
  17. package/src/hooks/useAcumulateDate/index.js +16 -16
  18. package/src/hooks/useAnimationText/index.jsx +31 -30
  19. package/src/hooks/useBanner/index.js +19 -0
  20. package/src/hooks/useCatWithProduct/index.js +42 -0
  21. package/src/hooks/useCatWithProduct/queries.js +172 -0
  22. package/src/hooks/useCategoryInStore/index.js +94 -0
  23. package/src/hooks/{useGetCategorieStore → useCategoryInStore}/queries.js +77 -77
  24. package/src/hooks/useCategoryStore/index.js +7 -7
  25. package/src/hooks/useCategoryStore/queries.js +16 -16
  26. package/src/hooks/useChartData/index.js +170 -0
  27. package/src/hooks/useCheckbox/index.js +114 -114
  28. package/src/hooks/useClients/index.js +13 -13
  29. package/src/hooks/useClients/queries.js +117 -117
  30. package/src/hooks/useConnection/index.js +23 -0
  31. package/src/hooks/useCreateProduct/helpers/useEditImageProduct/index.js +165 -0
  32. package/src/hooks/useCreateProduct/index.js +268 -0
  33. package/src/hooks/useDessert/index.js +141 -0
  34. package/src/hooks/useDrag/index.js +62 -57
  35. package/src/hooks/useEvent/index.js +33 -33
  36. package/src/hooks/useFetchJson/index.js +24 -24
  37. package/src/hooks/useFetchMoreInteractions/index.jsx +37 -34
  38. package/src/hooks/useFormTools/index.js +83 -70
  39. package/src/hooks/useFormatDate/index.js +34 -0
  40. package/src/hooks/useFullScreenMode/index.js +65 -65
  41. package/src/hooks/useHover/index.js +28 -28
  42. package/src/hooks/useImageOptimization/index.js +28 -0
  43. package/src/hooks/useImageWeight/index.js +52 -0
  44. package/src/hooks/useImagesStore/index.js +171 -0
  45. package/src/hooks/useImagesStore/queries.js +216 -0
  46. package/src/hooks/useInnerHtml/index.js +37 -37
  47. package/src/hooks/useIntersection/index.js +84 -31
  48. package/src/hooks/useKeypress/index.js +27 -27
  49. package/src/hooks/useLazyScript/index.js +72 -0
  50. package/src/hooks/useLocalSorage/index.js +35 -35
  51. package/src/hooks/useLocationNavigate/index.js +54 -54
  52. package/src/hooks/useMobile/index.js +37 -37
  53. package/src/hooks/useMutateHeight/index.js +37 -0
  54. package/src/hooks/useProductsFood/index.js +190 -0
  55. package/src/hooks/{useGetProductsFood → useProductsFood}/queriesStore.js +780 -765
  56. package/src/hooks/useProductsFood/usetagsProducts.js +57 -0
  57. package/src/hooks/useReactToPrint/index.js +1201 -0
  58. package/src/hooks/useReport/index.js +35 -0
  59. package/src/hooks/useReport/queries.js +122 -0
  60. package/src/hooks/useRestaurant/index.js +19 -19
  61. package/src/hooks/useRestaurant/queries.js +79 -69
  62. package/src/hooks/useSales/index.js +589 -489
  63. package/src/hooks/useSales/queries.js +290 -229
  64. package/src/hooks/useSales/useGetSale.js +12 -0
  65. package/src/hooks/useSales/useTotalSales.js +17 -0
  66. package/src/hooks/useSaveAvailableProduct/helpers/index.js +30 -0
  67. package/src/hooks/useSaveAvailableProduct/index.js +26 -0
  68. package/src/hooks/useSaveAvailableProduct/queries.js +10 -0
  69. package/src/hooks/useSchedule/index.jsx +23 -0
  70. package/src/hooks/useSetState/index.js +24 -24
  71. package/src/hooks/useStore/index.js +17 -17
  72. package/src/hooks/useStore/queries.js +135 -135
  73. package/src/hooks/useStoreCalendar/index.js +7 -0
  74. package/src/hooks/useTimeAgo/useTimeAgo.js +39 -39
  75. package/src/hooks/useUpdateCart/index.js +124 -124
  76. package/src/hooks/useUpdateExtProductFoodsSubOptional/index.js +37 -0
  77. package/src/hooks/useUser/index.js +7 -3
  78. package/src/hooks/useUser/queries.js +69 -0
  79. package/src/hooks/useWindowSize/index.js +37 -37
  80. package/src/index.jsx +2 -1
  81. package/src/mock/dessert/index.js +16 -0
  82. package/src/mock/index.js +2 -0
  83. package/src/utils/index.js +106 -54
  84. package/src/hooks/useGetCategorieStore/index.js +0 -21
  85. package/src/hooks/useGetProductsFood/index.js +0 -46
@@ -0,0 +1,35 @@
1
+ import { useQuery } from '@apollo/client'
2
+ import { GET_ALL_SALES, GET_ALL_TOTAL_SALES } from './queries'
3
+
4
+ export const useReport = ({
5
+ more,
6
+ fromDate,
7
+ toDate
8
+ }) => {
9
+ const { data, fetchMore, loading } = useQuery(GET_ALL_SALES,{
10
+ fetchPolicy: 'network-only',
11
+ variables: {
12
+ min: 0,
13
+ fromDate,
14
+ toDate,
15
+ max: more
16
+ }
17
+ })
18
+ // get total sales
19
+ const { data: totalSales } = useQuery(GET_ALL_TOTAL_SALES, {
20
+ variables: {
21
+ fromDate,
22
+ toDate,
23
+ }
24
+ })
25
+ // console.log({totalSales})
26
+
27
+ return {
28
+ data,
29
+ loading,
30
+ totalSales: totalSales?.getAllSalesStoreTotal.TOTAL ?? 0,
31
+ restaurant: totalSales?.getAllSalesStoreTotal.restaurant ?? 0,
32
+ delivery: totalSales?.getAllSalesStoreTotal.delivery ?? 0,
33
+ fetchMore
34
+ }
35
+ }
@@ -0,0 +1,122 @@
1
+ import { gql } from '@apollo/client'
2
+
3
+ export const GET_ALL_SALES = gql`
4
+ query getAllSalesStore($idStore: ID,$search: String, $min: Int, $max: Int $fromDate: DateTime, $toDate: DateTime ) {
5
+ getAllSalesStore(idStore: $idStore, search: $search, min: $min, max: $max, toDate: $toDate, fromDate: $fromDate) {
6
+ totalProductsPrice
7
+ pDatCre,
8
+ pCodeRef
9
+ }
10
+ }
11
+ `
12
+
13
+ export const GET_ALL_TOTAL_SALES = gql`
14
+ query getAllSalesStoreTotal($idStore: ID,$search: String, $min: Int, $max: Int $fromDate: DateTime, $toDate: DateTime ) {
15
+ getAllSalesStoreTotal(idStore: $idStore, search: $search, min: $min, max: $max, toDate: $toDate, fromDate: $fromDate) {
16
+ restaurant
17
+ delivery
18
+ TOTAL
19
+ }
20
+ }
21
+ `
22
+ export const GET_ALL_SALES_STATISTICS = gql`
23
+ query getAllSalesStoreStatistic($idStore: ID,$search: String, $min: Int, $max: Int $fromDate: DateTime, $toDate: DateTime ) {
24
+ getAllSalesStoreStatistic(idStore: $idStore, search: $search, min: $min, max: $max, toDate: $toDate, fromDate: $fromDate) {
25
+ pdpId
26
+ idStore
27
+ pCodeRef
28
+ payMethodPState
29
+ pPRecoger
30
+ totalProductsPrice
31
+ pSState
32
+ pDatCre
33
+ locationUser
34
+ pDatMod
35
+ getAllPedidoStore{
36
+ pdpId
37
+ pId
38
+ idStore
39
+ ShoppingCard
40
+ pCodeRef
41
+ pPStateP
42
+ payMethodPState
43
+ pPRecoger
44
+ pDatCre
45
+ pDatMod
46
+ getAllShoppingCard {
47
+ ShoppingCard
48
+ comments
49
+ cantProducts
50
+ pId
51
+ productFood{
52
+ pId
53
+ carProId
54
+ colorId
55
+ idStore
56
+ pName
57
+ ProPrice
58
+ ProDescuento
59
+ ProDescription
60
+ ValueDelivery
61
+ ProImage
62
+ ProStar
63
+ pState
64
+ pDatCre
65
+ pDatMod
66
+ }
67
+ }
68
+ }
69
+ }
70
+ }
71
+ `
72
+
73
+ export const GET_ONE_SALES = gql`
74
+ query getOneSalesStore($pCodeRef: String) {
75
+ getOneSalesStore(pCodeRef: $pCodeRef) {
76
+ pdpId
77
+ idStore
78
+ pCodeRef
79
+ payMethodPState
80
+ pPRecoger
81
+ totalProductsPrice
82
+ pSState
83
+ pDatCre
84
+ locationUser
85
+ pDatMod
86
+ getAllPedidoStore{
87
+ pdpId
88
+ pId
89
+ idStore
90
+ ShoppingCard
91
+ pCodeRef
92
+ pPStateP
93
+ payMethodPState
94
+ pPRecoger
95
+ pDatCre
96
+ pDatMod
97
+ getAllShoppingCard {
98
+ ShoppingCard
99
+ comments
100
+ cantProducts
101
+ pId
102
+ productFood{
103
+ pId
104
+ carProId
105
+ colorId
106
+ idStore
107
+ pName
108
+ ProPrice
109
+ ProDescuento
110
+ ProDescription
111
+ ValueDelivery
112
+ ProImage
113
+ ProStar
114
+ pState
115
+ pDatCre
116
+ pDatMod
117
+ }
118
+ }
119
+ }
120
+ }
121
+ }
122
+ `
@@ -1,19 +1,19 @@
1
- import { useQuery } from '@apollo/client'
2
- import { GET_ALL_RESTAURANT } from './queries'
3
-
4
- export const useRestaurant = () => {
5
- const {
6
- data,
7
- loading,
8
- error,
9
- fetchMore
10
- } = useQuery(GET_ALL_RESTAURANT, {
11
- fetchPolicy: 'cache-and-network',
12
- notifyOnNetworkStatusChange: true,
13
- nextFetchPolicy: 'cache-first',
14
- refetchWritePolicy: 'merge',
15
- context: { clientName: 'admin-store'
16
- }
17
- })
18
- return [data, { loading, error, fetchMore }]
19
- }
1
+ import { useQuery } from '@apollo/client'
2
+ import { GET_ALL_RESTAURANT } from './queries'
3
+
4
+ export const useRestaurant = () => {
5
+ const {
6
+ data,
7
+ loading,
8
+ error,
9
+ fetchMore
10
+ } = useQuery(GET_ALL_RESTAURANT, {
11
+ fetchPolicy: 'cache-and-network',
12
+ notifyOnNetworkStatusChange: true,
13
+ nextFetchPolicy: 'cache-first',
14
+ refetchWritePolicy: 'merge',
15
+ context: { clientName: 'admin-store'
16
+ }
17
+ })
18
+ return [data, { loading, error, fetchMore }]
19
+ }
@@ -1,70 +1,80 @@
1
- import { gql } from '@apollo/client'
2
- export const GET_ALL_RESTAURANT = gql`
3
- query getAllStoreInStore($search: String, $min: Int, $max: Int){
4
- getAllStoreInStore(search: $search, min: $min, max: $max) {
5
- idStore
6
- cId
7
- id
8
- dId
9
- ctId
10
- catStore
11
- neighborhoodStore
12
- Viaprincipal
13
- storeOwner
14
- storeName
15
- cateStore{
16
- catStore
17
- cName
18
- }
19
- emailStore
20
- storePhone
21
- socialRaz
22
- Image
23
- banner
24
- documentIdentifier
25
- uPhoNum
26
- ULocation
27
- upLat
28
- upLon
29
- uState
30
- siteWeb
31
- description
32
- NitStore
33
- typeRegiments
34
- typeContribute
35
- secVia
36
- addressStore
37
- createdAt
38
- pais{
39
- cId
40
- cName
41
- cCalCod
42
- cState
43
- cDatCre
44
- cDatMod
45
- }
46
- city {
47
- ctId
48
- dId
49
- cName
50
- cState
51
- cDatCre
52
- cDatMod
53
- }
54
- department {
55
- dId
56
- cId
57
- dName
58
- dState
59
- dDatCre
60
- dDatMod
61
- }
62
- getAllRatingStar {
63
- rSId
64
- rScore
65
- idStore
66
- createAt
67
- }
68
- }
69
- }
1
+ import { gql } from '@apollo/client'
2
+ export const GET_ALL_RESTAURANT = gql`
3
+ query getAllStoreInStore($search: String, $min: Int, $max: Int){
4
+ getAllStoreInStore(search: $search, min: $min, max: $max) {
5
+ open
6
+ getStoreSchedules {
7
+ idStore
8
+ schId
9
+ schDay
10
+ schHoSta
11
+ schHoEnd
12
+ schState
13
+ }
14
+ idStore
15
+ cId
16
+ id
17
+ dId
18
+ ctId
19
+ catStore
20
+ neighborhoodStore
21
+ Viaprincipal
22
+ storeOwner
23
+ storeName
24
+ cateStore{
25
+ catStore
26
+ cName
27
+ }
28
+ emailStore
29
+ storePhone
30
+ socialRaz
31
+ Image
32
+ banner
33
+ documentIdentifier
34
+ uPhoNum
35
+ ULocation
36
+ upLat
37
+ upLon
38
+ uState
39
+ siteWeb
40
+ description
41
+ NitStore
42
+ typeRegiments
43
+ typeContribute
44
+ secVia
45
+ addressStore
46
+ createdAt
47
+ pais{
48
+ cId
49
+ cName
50
+ cCalCod
51
+ cState
52
+ cDatCre
53
+ cDatMod
54
+ }
55
+ city {
56
+ ctId
57
+ dId
58
+ cName
59
+ cState
60
+ cDatCre
61
+ cDatMod
62
+ }
63
+ department {
64
+ dId
65
+ cId
66
+ dName
67
+ dState
68
+ dDatCre
69
+ dDatMod
70
+ }
71
+ getAllRatingStar {
72
+ rSId
73
+ rScore
74
+ idStore
75
+ createAt
76
+ }
77
+ }
78
+
79
+ }
70
80
  `