@ercioko/meblotex-api 0.2.2 → 0.2.3

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 (181) hide show
  1. package/dist/api/Api.d.ts +33 -0
  2. package/dist/api/Api.js +152 -0
  3. package/dist/api/Endpoint.d.ts +13 -0
  4. package/dist/api/Endpoint.js +126 -0
  5. package/dist/api/createApi.d.ts +52 -0
  6. package/dist/api/createApi.js +81 -0
  7. package/dist/api/error.d.ts +15 -0
  8. package/dist/api/error.js +18 -0
  9. package/{src/api/index.ts → dist/api/index.d.ts} +0 -1
  10. package/dist/api/index.js +34 -0
  11. package/dist/api/status.d.ts +3 -0
  12. package/dist/api/status.js +6 -0
  13. package/dist/api/utils/getAlert.d.ts +6 -0
  14. package/dist/api/utils/getAlert.js +65 -0
  15. package/dist/api/utils/index.js +8 -0
  16. package/dist/app_types.d.ts +607 -0
  17. package/dist/app_types.js +75 -0
  18. package/dist/components/ApiHostProvider.d.ts +7 -0
  19. package/dist/components/ApiHostProvider.js +35 -0
  20. package/dist/components/StatusTag.d.ts +11 -0
  21. package/dist/components/StatusTag.js +86 -0
  22. package/dist/components/Table/DataTableWrapper.d.ts +3 -0
  23. package/dist/components/Table/DataTableWrapper.js +44 -0
  24. package/dist/components/Table/FloatingActions.d.ts +14 -0
  25. package/dist/components/Table/FloatingActions.js +32 -0
  26. package/dist/components/Table/Spinner.d.ts +2 -0
  27. package/dist/components/Table/Spinner.js +26 -0
  28. package/dist/components/Table/Table.d.ts +28 -0
  29. package/dist/components/Table/Table.js +330 -0
  30. package/dist/components/Table/addIndexToObject.d.ts +3 -0
  31. package/dist/components/Table/addIndexToObject.js +17 -0
  32. package/dist/components/Table/areProvidedColumnsDifferent.d.ts +2 -0
  33. package/dist/components/Table/areProvidedColumnsDifferent.js +16 -0
  34. package/dist/components/Table/hooks/useFetchPage.d.ts +18 -0
  35. package/dist/components/Table/hooks/useFetchPage.js +123 -0
  36. package/dist/components/Table/hooks/useGetCellRenderer.d.ts +25 -0
  37. package/dist/components/Table/hooks/useGetCellRenderer.js +166 -0
  38. package/dist/components/Table/hooks/useGetColumnsWithCheckbox.d.ts +5 -0
  39. package/dist/components/Table/hooks/useGetColumnsWithCheckbox.js +53 -0
  40. package/dist/components/Table/hooks/useGetDeleteRow.d.ts +9 -0
  41. package/dist/components/Table/hooks/useGetDeleteRow.js +74 -0
  42. package/dist/components/Table/hooks/useGetResizeColumn.d.ts +8 -0
  43. package/dist/components/Table/hooks/useGetResizeColumn.js +28 -0
  44. package/dist/components/Table/hooks/useGetRowCheckbox.d.ts +5 -0
  45. package/dist/components/Table/hooks/useGetRowCheckbox.js +54 -0
  46. package/dist/components/Table/hooks/useLoadDataSource.d.ts +10 -0
  47. package/dist/components/Table/hooks/useLoadDataSource.js +20 -0
  48. package/dist/components/Table/hooks/usePageSize.d.ts +5 -0
  49. package/dist/components/Table/hooks/usePageSize.js +16 -0
  50. package/dist/components/Table/hooks/useRenderRowActions.d.ts +6 -0
  51. package/dist/components/Table/hooks/useRenderRowActions.js +51 -0
  52. package/dist/components/Table/hooks/useResizeColumns.d.ts +9 -0
  53. package/dist/components/Table/hooks/useResizeColumns.js +60 -0
  54. package/dist/components/Table/index.d.ts +1 -0
  55. package/dist/components/Table/index.js +8 -0
  56. package/dist/components/Table/providers/OrderProvider.d.ts +9 -0
  57. package/dist/components/Table/providers/OrderProvider.js +17 -0
  58. package/dist/components/Table/styles.d.ts +6 -0
  59. package/dist/components/Table/styles.js +37 -0
  60. package/dist/components/index.js +26 -0
  61. package/dist/config.d.ts +6 -0
  62. package/dist/config.js +8 -0
  63. package/dist/db_types.d.ts +208 -0
  64. package/dist/db_types.js +2 -0
  65. package/dist/hooks/index.js +10 -0
  66. package/dist/hooks/useApi.d.ts +2 -0
  67. package/dist/hooks/useApi.js +42 -0
  68. package/dist/hooks/useEndpoint.d.ts +2 -0
  69. package/dist/hooks/useEndpoint.js +34 -0
  70. package/dist/index.js +19 -0
  71. package/dist/lib/index.js +18 -0
  72. package/dist/lib/jednostkaNazwa.d.ts +6 -0
  73. package/dist/lib/jednostkaNazwa.js +9 -0
  74. package/dist/lib/typDokumentuNazwa.d.ts +6 -0
  75. package/dist/lib/typDokumentuNazwa.js +11 -0
  76. package/dist/src/api/Api.js +316 -0
  77. package/dist/src/api/Endpoint.js +365 -0
  78. package/dist/src/api/createApi.js +50 -0
  79. package/dist/src/api/error.js +15 -0
  80. package/dist/src/api/index.js +5 -0
  81. package/dist/src/api/status.js +3 -0
  82. package/dist/src/api/utils/getAlert.js +63 -0
  83. package/dist/src/api/utils/index.js +1 -0
  84. package/dist/src/app_types.js +72 -0
  85. package/dist/src/components/ApiHostProvider.js +11 -0
  86. package/dist/src/components/StatusTag.js +153 -0
  87. package/dist/src/components/Table/DataTableWrapper.js +115 -0
  88. package/dist/src/components/Table/FloatingActions.js +60 -0
  89. package/dist/src/components/Table/Spinner.js +40 -0
  90. package/dist/src/components/Table/Summary.js +16 -0
  91. package/dist/src/components/Table/Table.js +498 -0
  92. package/dist/src/components/Table/addIndexToObject.js +57 -0
  93. package/dist/src/components/Table/areProvidedColumnsDifferent.js +19 -0
  94. package/dist/src/components/Table/clicked.js +12 -0
  95. package/dist/src/components/Table/displayActions.js +11 -0
  96. package/dist/src/components/Table/hooks/useFetchPage.js +254 -0
  97. package/dist/src/components/Table/hooks/useGetCellRenderer.js +231 -0
  98. package/dist/src/components/Table/hooks/useGetColumnsWithCheckbox.js +33 -0
  99. package/dist/src/components/Table/hooks/useGetDeleteRow.js +181 -0
  100. package/dist/src/components/Table/hooks/useGetResizeColumn.js +72 -0
  101. package/dist/src/components/Table/hooks/useGetRowCheckbox.js +55 -0
  102. package/dist/src/components/Table/hooks/useLoadDataSource.js +16 -0
  103. package/dist/src/components/Table/hooks/usePageSize.js +15 -0
  104. package/dist/src/components/Table/hooks/useRenderRowActions.js +50 -0
  105. package/dist/src/components/Table/hooks/useResizeColumns.js +70 -0
  106. package/dist/src/components/Table/index.js +1 -0
  107. package/dist/src/components/Table/providers/OrderProvider.js +65 -0
  108. package/dist/src/components/Table/styles.js +66 -0
  109. package/dist/src/components/index.js +4 -0
  110. package/dist/src/config.js +6 -0
  111. package/dist/src/db_types.js +1 -0
  112. package/dist/src/hooks/index.js +2 -0
  113. package/dist/src/hooks/useApi.js +84 -0
  114. package/dist/src/hooks/useEndpoint.js +60 -0
  115. package/dist/src/index.js +3 -0
  116. package/dist/src/lib/index.js +2 -0
  117. package/dist/src/lib/jednostkaNazwa.js +6 -0
  118. package/dist/src/lib/typDokumentuNazwa.js +16 -0
  119. package/dist/src/utils/Query.js +73 -0
  120. package/dist/src/utils/getWZNumber.js +4 -0
  121. package/dist/src/utils/getZamowienieDokumentNumber.js +4 -0
  122. package/{src/utils/index.ts → dist/src/utils/index.js} +2 -2
  123. package/dist/utils/Query.d.ts +6 -0
  124. package/dist/utils/Query.js +33 -0
  125. package/dist/utils/getWZNumber.d.ts +2 -0
  126. package/dist/utils/getWZNumber.js +10 -0
  127. package/dist/utils/getZamowienieDokumentNumber.d.ts +2 -0
  128. package/dist/utils/getZamowienieDokumentNumber.js +8 -0
  129. package/dist/utils/index.d.ts +3 -0
  130. package/dist/utils/index.js +12 -0
  131. package/package.json +3 -2
  132. package/.eslintrc +0 -6
  133. package/.nvmrc +0 -1
  134. package/.prettierrc +0 -11
  135. package/src/api/Api.ts +0 -140
  136. package/src/api/Endpoint.ts +0 -76
  137. package/src/api/createApi.ts +0 -116
  138. package/src/api/error.ts +0 -17
  139. package/src/api/status.ts +0 -3
  140. package/src/api/utils/getAlert.ts +0 -75
  141. package/src/app_types.ts +0 -695
  142. package/src/components/ApiHostProvider.tsx +0 -13
  143. package/src/components/StatusTag.tsx +0 -83
  144. package/src/components/Table/DataTableWrapper.tsx +0 -28
  145. package/src/components/Table/FloatingActions.tsx +0 -152
  146. package/src/components/Table/Spinner.tsx +0 -35
  147. package/src/components/Table/Summary.tsx +0 -18
  148. package/src/components/Table/Table.tsx +0 -474
  149. package/src/components/Table/addIndexToObject.ts +0 -6
  150. package/src/components/Table/areProvidedColumnsDifferent.ts +0 -26
  151. package/src/components/Table/clicked.js +0 -12
  152. package/src/components/Table/displayActions.tsx +0 -19
  153. package/src/components/Table/hooks/useFetchPage.tsx +0 -83
  154. package/src/components/Table/hooks/useGetCellRenderer.tsx +0 -197
  155. package/src/components/Table/hooks/useGetColumnsWithCheckbox.tsx +0 -34
  156. package/src/components/Table/hooks/useGetDeleteRow.tsx +0 -37
  157. package/src/components/Table/hooks/useGetResizeColumn.ts +0 -33
  158. package/src/components/Table/hooks/useGetRowCheckbox.tsx +0 -25
  159. package/src/components/Table/hooks/useLoadDataSource.ts +0 -24
  160. package/src/components/Table/hooks/usePageSize.tsx +0 -20
  161. package/src/components/Table/hooks/useRenderRowActions.tsx +0 -45
  162. package/src/components/Table/hooks/useResizeColumns.ts +0 -61
  163. package/src/components/Table/index.ts +0 -1
  164. package/src/components/Table/providers/OrderProvider.tsx +0 -20
  165. package/src/components/Table/styles.ts +0 -208
  166. package/src/config.ts +0 -7
  167. package/src/db_types.ts +0 -220
  168. package/src/hooks/useApi.ts +0 -43
  169. package/src/hooks/useEndpoint.ts +0 -35
  170. package/src/lib/jednostkaNazwa.ts +0 -6
  171. package/src/lib/typDokumentuNazwa.ts +0 -8
  172. package/src/utils/Query.ts +0 -30
  173. package/src/utils/getWZNumber.ts +0 -13
  174. package/src/utils/getZamowienieDokumentNumber.ts +0 -11
  175. package/tsconfig.json +0 -25
  176. package/tsconfig.tsbuildinfo +0 -1
  177. /package/{src/api/utils/index.ts → dist/api/utils/index.d.ts} +0 -0
  178. /package/{src/components/index.ts → dist/components/index.d.ts} +0 -0
  179. /package/{src/hooks/index.ts → dist/hooks/index.d.ts} +0 -0
  180. /package/{src/index.ts → dist/index.d.ts} +0 -0
  181. /package/{src/lib/index.ts → dist/lib/index.d.ts} +0 -0
@@ -1,208 +0,0 @@
1
- import styled, { css } from 'styled-components';
2
-
3
- export const DataTable = styled.div`
4
- position: relative;
5
- width: 100%;
6
- flex: 1;
7
-
8
- & > div {
9
- width: 100%;
10
- margin-top: 16px;
11
- }
12
- & .data-table-no-data {
13
- position: absolute;
14
- top: 0;
15
- left: 0;
16
- right: 0;
17
- bottom: 0;
18
- display: flex;
19
- justify-content: center;
20
- align-items: center;
21
- color: #262626;
22
- }
23
- & .resized {
24
- overflow: hidden;
25
- text-overflow: ellipsis;
26
- white-space: nowrap;
27
- display: block;
28
- }
29
- & .DragHandle {
30
- flex: 0 0 16px;
31
- z-index: 2;
32
- cursor: col-resize;
33
- color: #1890ff;
34
- right: 0;
35
- position: absolute;
36
- }
37
- & .DragHandle:hover {
38
- background-color: rgba(0, 0, 0, 0.1);
39
- }
40
- & .DragHandleActive,
41
- & .DragHandleActive:hover {
42
- color: #1890ff;
43
- z-index: 3;
44
- }
45
- & .DragHandleIcon {
46
- flex: 0 0 12px;
47
- display: flex;
48
- flex-direction: column;
49
- justify-content: center;
50
- align-items: center;
51
- }
52
-
53
- .data-table-wrapper .table .td.table-actions div .action span {
54
- padding: 6px;
55
- border-radius: 100px;
56
- transition: 150ms ease-in-out;
57
- display: flex;
58
- align-items: center;
59
- justify-content: center;
60
- }
61
- .data-table-wrapper .table .td.table-actions div .action span:hover {
62
- cursor: pointer;
63
- background: rgba(0, 0, 0, 0.1);
64
- }
65
- & .table .td p {
66
- margin: 0;
67
- }
68
- & .table .td .ant-tag {
69
- line-height: 16.5px;
70
- }
71
- & .spinner-wrapper {
72
- position: absolute;
73
- bottom: -34px;
74
- left: 50%;
75
- }
76
- & .ant-spin {
77
- display: flex;
78
- justify-content: center;
79
- margin: 15px 0;
80
- }
81
- `;
82
-
83
- export const StyledTable = styled.div`
84
- width: 100%;
85
- min-height: fit-content;
86
- background: #f5f5f5;
87
-
88
- &:focus {
89
- border: none;
90
- outline: none;
91
- }
92
-
93
- &:hover:not(.selected):not(:first-child):not(.summary) {
94
- background: #d5f0ff !important;
95
- }
96
-
97
- .td-light {
98
- background-color: white;
99
- }
100
-
101
- .header {
102
- background: #e8e8e8;
103
- }
104
- :not(:first-child) {
105
- height: 39px;
106
- }
107
- :nth-child(2n) {
108
- background: #fff;
109
- }
110
- .selected > td {
111
- background: #bae7ff;
112
- }
113
- .selectable:hover {
114
- cursor: pointer;
115
- }
116
- .summary {
117
- border-bottom: none;
118
- }
119
- .summary .td {
120
- color: #000;
121
- font-weight: 600;
122
- }
123
- .summary .td:not(.orphan) {
124
- border-bottom: 1px solid #e8e8e8;
125
- }
126
- `;
127
-
128
- const tableData = css`
129
- color: #000;
130
- line-height: 24px;
131
- font-size: 14px;
132
- padding: 0 8px;
133
- text-overflow: ellipsis;
134
- overflow: hidden;
135
- white-space: nowrap;
136
-
137
- &.checkbox-cell {
138
- display: flex;
139
- align-items: center;
140
- justify-content: center;
141
- }
142
- &.table-actions {
143
- padding-top: 0;
144
- padding-bottom: 0;
145
- }
146
- &.table-actions div {
147
- height: 100%;
148
- display: flex;
149
- align-items: center;
150
- }
151
- &.table-actions div .action {
152
- height: 24px;
153
- width: 24px;
154
- display: flex;
155
- align-items: center;
156
- justify-content: center;
157
- }
158
- `;
159
-
160
- export const TableHeader = styled.div`
161
- ${tableData};
162
- border: none;
163
- position: sticky;
164
- top: 0;
165
- z-index: 1;
166
- background: #e8e8e8;
167
- display: flex;
168
- align-items: center;
169
- background: #e8e8e8;
170
- color: #262626;
171
- padding: 0 5px 0 0;
172
- font-weight: 600;
173
- font-size: 16px;
174
- height: 55px;
175
-
176
- &:hover {
177
- cursor: pointer;
178
- }
179
-
180
- & > div {
181
- text-overflow: ellipsis;
182
- overflow: hidden;
183
- }
184
- &:not(:first-child) {
185
- border-left: 1px solid #fff;
186
- }
187
- & > span {
188
- padding: 15px 6px 15px 11px;
189
- width: 100%;
190
- text-overflow: ellipsis;
191
- overflow: hidden;
192
- white-space: nowrap;
193
- }
194
- & > span:hover,
195
- &.table-actions:hover {
196
- cursor: initial;
197
- }
198
- &.checkbox-header {
199
- align-items: center;
200
- justify-content: center;
201
- padding: 0;
202
- }
203
- `;
204
-
205
- export const TableData = styled.div<{ $align?: 'right' }>`
206
- ${tableData}
207
- ${(p) => (p.$align ? 'text-align: ' + p.$align + ';' : '')}
208
- `;
package/src/config.ts DELETED
@@ -1,7 +0,0 @@
1
- const config = {
2
- ROW_SIZE: 24,
3
- ROW_SIZE_MOBILE: 48,
4
- MOBILE_BREAKPOINT: 375,
5
- };
6
-
7
- export default config;
package/src/db_types.ts DELETED
@@ -1,220 +0,0 @@
1
- import { DokumentTyp, DokumentTypDowolny, FormaPlatnosci, TypDokumentu, TypWplaty } from './app_types';
2
-
3
- export interface BufferAttributes {
4
- id: number;
5
- date_buffer: Date;
6
- date_completion: Date;
7
- buffer_type: string;
8
- buffer_method: string;
9
- buffer_status: string;
10
- foreign_number: string;
11
- pieces: number;
12
- meters: number;
13
- sq_meters: number;
14
- value: number;
15
- file_path: string;
16
- comments: string;
17
- }
18
-
19
- export interface KlientAttributes {
20
- id_klient: number;
21
- nazwa_skrocona: string;
22
- nazwa1: string;
23
- nazwa2: string;
24
- nazwa3: string;
25
- kraj: string;
26
- miasto: string;
27
- wojewodztwo: string;
28
- ulica: string;
29
- numer_domu: string;
30
- numer_lokalu: string;
31
- ulica_txt: string;
32
- kod: string;
33
- poczta: string;
34
- nip_kraj: string;
35
- nip: string;
36
- vip: boolean;
37
- platnik_vat: boolean;
38
- regon: string;
39
- pesel: string;
40
- telefon1: string;
41
- telefon2: string;
42
- fax: string;
43
- email: string;
44
- www: string;
45
- uwagi: string;
46
- frontman: boolean;
47
- frontman_login: string;
48
- frontman_haslo: string;
49
- frontman_data_login: Date | number;
50
- frontman_data_logout: Date | number;
51
- portal: boolean;
52
- portal_login: string;
53
- portal_haslo: string;
54
- }
55
-
56
- export interface UzytkownikAttributes {
57
- id_uzytkownik: number;
58
- login: string;
59
- haslo: string;
60
- imie?: string;
61
- nazwisko?: string;
62
- inicjaly?: string;
63
- data_login?: Date | number;
64
- data_logout?: Date | number;
65
- czas_dodanie: Date;
66
- czas_edycja?: Date;
67
- }
68
-
69
- export interface WplataAttributes {
70
- id_wplata: number;
71
- data_wplaty: Date;
72
- typ_wplaty: TypWplaty;
73
- numer_idx: number;
74
- numer: number;
75
- kwota_wplaty: number;
76
- uwagi: string;
77
- rozliczono: number;
78
- id_klient?: number;
79
- id_zamowienie_dokument?: number;
80
- id_uzytkownik_dodanie?: number;
81
- }
82
-
83
- export interface ZamowienieDokumentAttributes {
84
- id_zamowienie_dokument: number;
85
- data_sprzedazy: Date;
86
- data_wystawienia: Date;
87
- data_platnosci: Date;
88
- typ_dokumentu: TypDokumentu;
89
- numer: number;
90
- numer_idx: number;
91
- forma_platnosci: FormaPlatnosci;
92
- wartosc: number;
93
- netto: number;
94
- nazwa_skrocona: string;
95
- nazwa1: string;
96
- nazwa2: string;
97
- nazwa3: string;
98
- kraj: string;
99
- miasto: string;
100
- ulica: string;
101
- numer_domu: string;
102
- numer_lokalu: string;
103
- ulica_txt: string;
104
- kod: string;
105
- nip_kraj: string;
106
- nip: string;
107
- id_klient?: number;
108
- id_klient_nabywca?: number;
109
- id_zamowienie_dokument_parent?: number;
110
- id_zamowienie?: number;
111
- id_uzytkownik_dodanie?: number;
112
- czas_edycja?: Date;
113
- }
114
-
115
- export interface ZamowienieElementAttributes {
116
- id_zamowienie_element: number;
117
- zrodlo: string;
118
- nazwa: string;
119
- towar_kategoria: string;
120
- sztuk: number;
121
- metry: string;
122
- metry_kw: string;
123
- jednostka: number;
124
- cena_jednostka: string;
125
- cena: string;
126
- podatek: number;
127
- rabat_cena: number;
128
- rabat_prefix: string;
129
- rabat_sufix: string;
130
- etykieta: boolean;
131
- id_atrybut_konfig_grupa?: number;
132
- id_zamowienie_element_parent?: number;
133
- id_zamowienie?: number;
134
- czas_dodanie?: Date;
135
- czas_edycja?: Date;
136
- }
137
-
138
- export interface ZamowienieElementAtrybutAttributes {
139
- id_zamowienie_element_atrybut: number;
140
- cecha: string;
141
- cecha_typ: string;
142
- wartosc_opis: string;
143
- wartosc: string;
144
- wartosc_rownanie: number;
145
- narzut_cena: number;
146
- narzut_prefix: string;
147
- narzut_sufix: string;
148
- nazwa_zasob: string;
149
- predef: boolean;
150
- czas_dodanie?: Date;
151
- czas_edycja?: Date;
152
- }
153
-
154
- export interface AtrybutKonfigGrupaAttributes {
155
- id_atrybut_konfig_grupa: number;
156
- data_utworzenia: Date;
157
- data_zamkniecia: Date;
158
- }
159
-
160
- export interface ZamowienieAttributes {
161
- id_zamowienie: number;
162
- data_przyjecia: Date;
163
- data_realizacji: Date;
164
- data_status: Date;
165
- zamowienie_status: string;
166
- zamowienie_typ: string;
167
- zamowienie_metoda: string;
168
- numer: number;
169
- numer_idx: number;
170
- numer_obcy: string;
171
- sztuk: number;
172
- metry: number;
173
- metry_kw: number;
174
- wartosc: number;
175
- paczki: number;
176
- plik_sciezka: string;
177
- uwagi: string;
178
- portal_archiwum: boolean;
179
- numer_konsumenta: string;
180
- numer_txt: string;
181
- id_klient?: number;
182
- id_zamowienie_wydanie?: number;
183
- id_zamowienie_dokument?: number;
184
- }
185
-
186
- export interface ZamowienieDokumentElementAttributes {
187
- id_zamowienie_dokument_element: number;
188
- korekta: boolean;
189
- nazwa: string;
190
- jednostka: number;
191
- cena_jednostka: number;
192
- cena_jednostka_netto: number;
193
- podatek: number;
194
- ilosc: number;
195
- wartosc: number;
196
- netto: number;
197
- czas_dodanie: string;
198
- czas_edycja: string;
199
- id_zamowienie_dokument?: number;
200
- id_uzytkownik?: number;
201
- }
202
-
203
- export interface ZamowienieDokumentMagazynAttributes {
204
- id_zamowienie_dokument_magazyn: number;
205
- data_wystawienia: Date;
206
- dokument_typ: DokumentTyp | DokumentTypDowolny;
207
- numer: number;
208
- numer_idx: number;
209
- id_zamowienie?: number;
210
- id_zamowienie_dokument?: number;
211
- id_uzytkownik_dodanie?: number;
212
- id_uzytkownik_edycja?: number;
213
- }
214
-
215
- export interface ZaliczkaRozliczenieAttributes {
216
- id_zaliczka_rozliczenie: number;
217
- kwota_rozliczenia: number;
218
- id_zamowienie_dokument?: number;
219
- id_wplata?: number;
220
- }
@@ -1,43 +0,0 @@
1
- import { useCallback, useEffect, useMemo, useState } from 'react';
2
-
3
- import { createApi } from '../api/createApi';
4
- import Endpoint from '../api/Endpoint';
5
- import { useApiHost } from '../components';
6
-
7
- export default function useApi(
8
- onUnauthorized = () => {}
9
- ): ReturnType<typeof createApi> | undefined {
10
- const host = useApiHost();
11
- const api = useMemo(
12
- () =>
13
- Object.fromEntries(
14
- Object.entries(createApi(host)).map(([key, { endpoint }]) => [
15
- key,
16
- new Endpoint(endpoint, host, errorCallback),
17
- ])
18
- ) as ReturnType<typeof createApi>,
19
- []
20
- );
21
-
22
- const errorCallback = useCallback(
23
- (e) => {
24
- let error;
25
- try {
26
- error = JSON.parse(e.message);
27
- } catch (syntaxError) {
28
- error = { statusText: e.message };
29
- }
30
- if (error.status === 401) {
31
- onUnauthorized();
32
- }
33
- if (error.status === 400) {
34
- throw Error(`${error.statusText}: ${error.text}`);
35
- } else {
36
- throw Error(error.statusText);
37
- }
38
- },
39
- [onUnauthorized]
40
- );
41
-
42
- return api;
43
- }
@@ -1,35 +0,0 @@
1
- import { useCallback, useMemo } from 'react';
2
- import Endpoint from '../api/Endpoint';
3
- import { createApi } from '../api/createApi';
4
- import { useApiHost } from '../components';
5
-
6
- export default function useEndpoint<GetResponseElement>(
7
- path: string,
8
- onError: (error: string) => void = () => {}
9
- ): Endpoint<GetResponseElement> {
10
- const host = useApiHost();
11
- const handleErrors = useCallback(
12
- (func: Function) =>
13
- (...args: any) => {
14
- try {
15
- func(...args);
16
- } catch (e) {
17
- const error = JSON.parse(e.message);
18
- onError(error);
19
- }
20
- },
21
- [onError]
22
- );
23
-
24
- const endpoint = useMemo(() => {
25
- const endpoint = createApi(host)[path];
26
-
27
- endpoint.get = handleErrors(endpoint.get);
28
- endpoint.post = handleErrors(endpoint.post);
29
- endpoint.put = handleErrors(endpoint.put);
30
- endpoint.delete = handleErrors(endpoint.delete);
31
- return endpoint;
32
- }, [path, handleErrors, host]);
33
-
34
- return endpoint;
35
- }
@@ -1,6 +0,0 @@
1
- export const jednostkaNazwa = {
2
- '-1': 'm2', // Front systemowy ?
3
- 0: '', // Front systemowy ?
4
- 1: 'szt',
5
- 3: 'm2',
6
- };
@@ -1,8 +0,0 @@
1
- import { TypDokumentu } from '../app_types';
2
-
3
- export const typDokumentuNazwa = {
4
- [TypDokumentu.Faktura]: 'Faktura VAT',
5
- [TypDokumentu.FakturaDetal]: 'Faktura FADET',
6
- [TypDokumentu.FakturaEksport]: 'Faktura Eksportowa',
7
- [TypDokumentu.Paragon]: 'Paragon',
8
- };
@@ -1,30 +0,0 @@
1
- function encode<T = Record<string, unknown>>(data: T): string {
2
- return data
3
- ? Object.entries(data)
4
- .filter(([k, v]) => k !== undefined && v !== undefined)
5
- .map(([k, v]) =>
6
- (Array.isArray(v) ? v : [v])
7
- .map((e) => `${encodeURIComponent(k)}=${encodeURIComponent(e)}`)
8
- .join('&')
9
- )
10
- .join('&')
11
- : '';
12
- }
13
- const Query = {
14
- decode: (query: string): Record<string, unknown> => {
15
- if (!query) return {};
16
-
17
- const q: Record<string, unknown> = {};
18
- const pairs = query.replace(/\?/g, '').split('&');
19
- pairs.forEach((pair) => {
20
- const p = pair.split('=');
21
- q[decodeURIComponent(p[0])] = decodeURIComponent(p[1] || '');
22
- });
23
-
24
- return q;
25
- },
26
-
27
- encode,
28
- };
29
-
30
- export default Query;
@@ -1,13 +0,0 @@
1
- import { ZamowienieDokumentMagazynAttributes } from '../db_types';
2
-
3
- export const getWZNumber = ({
4
- numer,
5
- numer_idx,
6
- }: Pick<
7
- ZamowienieDokumentMagazynAttributes,
8
- 'numer_idx' | 'numer'
9
- >): string => {
10
- return `WZ ${numer_idx.toString().slice(0, 4)}/${numer_idx
11
- .toString()
12
- .slice(4)}/${numer.toString().padStart(4, '0')}/M`;
13
- };
@@ -1,11 +0,0 @@
1
- import { ZamowienieDokument } from '../app_types';
2
-
3
- export const getZamowienieDokumentNumber = (
4
- row: Pick<ZamowienieDokument, 'typ_dokumentu' | 'numer_idx' | 'numer'>
5
- ): string => {
6
- return `${row?.typ_dokumentu}/${row?.numer_idx
7
- ?.toString()
8
- .slice(0, 4)}/${row?.numer_idx?.toString().slice(4)}/${row?.numer
9
- ?.toString()
10
- .padStart(4, '0')}/M`;
11
- };
package/tsconfig.json DELETED
@@ -1,25 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "allowSyntheticDefaultImports": true,
4
- "jsx": "react",
5
- "lib": [
6
- "dom",
7
- "dom.iterable",
8
- "esnext"
9
- ],
10
- "target": "ES5",
11
- "module": "CommonJS",
12
- "moduleResolution": "node",
13
- "declaration": true,
14
- "skipLibCheck": true,
15
- "esModuleInterop": true,
16
- "outDir": "./dist",
17
- },
18
- "exclude": [
19
- "node_modules",
20
- "dist"
21
- ],
22
- "include": [
23
- "src/**/*.ts",
24
- ]
25
- }
@@ -1 +0,0 @@
1
- {"program":{"fileNames":["./node_modules/typescript/lib/lib.es5.d.ts","./node_modules/typescript/lib/lib.es2015.d.ts","./node_modules/typescript/lib/lib.es2016.d.ts","./node_modules/typescript/lib/lib.es2017.d.ts","./node_modules/typescript/lib/lib.es2018.d.ts","./node_modules/typescript/lib/lib.es2019.d.ts","./node_modules/typescript/lib/lib.es2020.d.ts","./node_modules/typescript/lib/lib.es2021.d.ts","./node_modules/typescript/lib/lib.es2022.d.ts","./node_modules/typescript/lib/lib.esnext.d.ts","./node_modules/typescript/lib/lib.dom.d.ts","./node_modules/typescript/lib/lib.dom.iterable.d.ts","./node_modules/typescript/lib/lib.es2015.core.d.ts","./node_modules/typescript/lib/lib.es2015.collection.d.ts","./node_modules/typescript/lib/lib.es2015.generator.d.ts","./node_modules/typescript/lib/lib.es2015.iterable.d.ts","./node_modules/typescript/lib/lib.es2015.promise.d.ts","./node_modules/typescript/lib/lib.es2015.proxy.d.ts","./node_modules/typescript/lib/lib.es2015.reflect.d.ts","./node_modules/typescript/lib/lib.es2015.symbol.d.ts","./node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","./node_modules/typescript/lib/lib.es2016.array.include.d.ts","./node_modules/typescript/lib/lib.es2017.object.d.ts","./node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","./node_modules/typescript/lib/lib.es2017.string.d.ts","./node_modules/typescript/lib/lib.es2017.intl.d.ts","./node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","./node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","./node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","./node_modules/typescript/lib/lib.es2018.intl.d.ts","./node_modules/typescript/lib/lib.es2018.promise.d.ts","./node_modules/typescript/lib/lib.es2018.regexp.d.ts","./node_modules/typescript/lib/lib.es2019.array.d.ts","./node_modules/typescript/lib/lib.es2019.object.d.ts","./node_modules/typescript/lib/lib.es2019.string.d.ts","./node_modules/typescript/lib/lib.es2019.symbol.d.ts","./node_modules/typescript/lib/lib.es2020.bigint.d.ts","./node_modules/typescript/lib/lib.es2020.date.d.ts","./node_modules/typescript/lib/lib.es2020.promise.d.ts","./node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","./node_modules/typescript/lib/lib.es2020.string.d.ts","./node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","./node_modules/typescript/lib/lib.es2020.intl.d.ts","./node_modules/typescript/lib/lib.es2020.number.d.ts","./node_modules/typescript/lib/lib.es2021.promise.d.ts","./node_modules/typescript/lib/lib.es2021.string.d.ts","./node_modules/typescript/lib/lib.es2021.weakref.d.ts","./node_modules/typescript/lib/lib.es2021.intl.d.ts","./node_modules/typescript/lib/lib.es2022.array.d.ts","./node_modules/typescript/lib/lib.es2022.error.d.ts","./node_modules/typescript/lib/lib.es2022.intl.d.ts","./node_modules/typescript/lib/lib.es2022.object.d.ts","./node_modules/typescript/lib/lib.es2022.string.d.ts","./node_modules/typescript/lib/lib.esnext.intl.d.ts","./src/config.ts","./src/types.ts","./src/utils/query.ts","./src/utils/index.ts","./src/api/api.ts","./src/api/endpoint.ts","./src/api/error.ts","./src/api/hooks/useendpoint.ts","./node_modules/@types/react/global.d.ts","./node_modules/csstype/index.d.ts","./node_modules/@types/prop-types/index.d.ts","./node_modules/@types/scheduler/tracing.d.ts","./node_modules/@types/react/index.d.ts","./src/api/hooks/useapi.ts","./src/api/hooks/index.ts","./src/api/status.ts","./src/api/utils/getalert.ts","./src/api/utils/index.ts","./src/api/index.ts","./src/index.ts","./node_modules/@types/scheduler/index.d.ts","./node_modules/@types/node/util.d.ts","./node_modules/@types/react/jsx-runtime.d.ts"],"fileInfos":[{"version":"f5c28122bee592cfaf5c72ed7bcc47f453b79778ffa6e301f45d21a0970719d4","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9","746d62152361558ea6d6115cf0da4dd10ede041d14882ede3568bce5dc4b4f1f","3eb679a56cab01203a1ba7edeade937f6a2a4c718513b2cd930b579807fa9359","aea179452def8a6152f98f63b191b84e7cbd69b0e248c91e61fb2e52328abe8c",{"version":"3f149f903dd20dfeb7c80e228b659f0e436532de772469980dbd00702cc05cc1","affectsGlobalScope":true},{"version":"1272277fe7daa738e555eb6cc45ded42cc2d0f76c07294142283145d49e96186","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"181f1784c6c10b751631b24ce60c7f78b20665db4550b335be179217bacc0d5f","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"cd483c056da900716879771893a3c9772b66c3c88f8943b4205aec738a94b1d0","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"6c55633c733c8378db65ac3da7a767c3cf2cf3057f0565a9124a16a3a2019e87","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"ff667ee99e5a28c3dc5063a3cfd4d3436699e3fb035d4451037da7f567da542a","affectsGlobalScope":true},{"version":"34478567f8a80171f88f2f30808beb7da15eac0538ae91282dd33dce928d98ed","affectsGlobalScope":true},{"version":"6ea9ab679ea030cf46c16a711a316078e9e02619ebaf07a7fcd16964aba88f2d","affectsGlobalScope":true},{"version":"6bda95ea27a59a276e46043b7065b55bd4b316c25e70e29b572958fa77565d43","affectsGlobalScope":true},{"version":"aedb8de1abb2ff1095c153854a6df7deae4a5709c37297f9d6e9948b6806fa66","affectsGlobalScope":true},{"version":"11ffe3c281f375fff9ffdde8bbec7669b4dd671905509079f866f2354a788064","affectsGlobalScope":true},{"version":"c37f8a49593a0030eecb51bbfa270e709bec9d79a6cc3bb851ef348d4e6b26f8","affectsGlobalScope":true},{"version":"f127524561569c0c8ae3654369d31862bfbeff651177b8e9fa263b145d1ac435","signature":"267b5bf632fca35818b7b60d739a85f211f604ae69e7e2aed793f79cb36f4f18"},{"version":"8f9846744c5663ddf05433588c4924f257821963db5c37b63ab8f8b2014d191d","signature":"c6031808967f552d0d4e43fad99b9167b280908db795051b8d77e2a41e67421d"},{"version":"750b5eafecebace74dede83ff296213589664e5b51d51eeadd7b2cfcec4d53dc","signature":"7015a3fc7565ea2180b354bbbcc09bd803a20b0205cd8baf354501762bdffe1f"},"7e72df3cd147763b0f30cf0d71316f4be368ee820511764b5d3daff0de0aa8bf",{"version":"b657dd3ba938264f8959a147dbbd28cbba0fc07d4742acf26cb9256f3cd79818","signature":"ff673d12b8bd81e014bcb097cbc10664cbf7e90420f431b6656db1a6c8779cc2"},{"version":"ea5b3fa2424e4f6d1569f7f38c8963f79af481c5d4608330e9f78824db663c0d","signature":"15739ace61999bd4bc0df94bbd344e83b1e9dfa847a198fe0f8739c8aaf543d4"},{"version":"a1538a68802695aeba28c80fa92838732b51c9fcfb9c5f787354508153b6d535","signature":"5123edd9bcd15eb5a15ba3ee41694e92245e7ab6e7b74cb0970171c0bba87949"},{"version":"c7661305de295e02208a1165b95b0927f4b2335068b4e6910267c905bf3c46c5","signature":"0cfb63b0217ffd9b7f21428080343683c0931e09d918074e62087b5725140762"},{"version":"bbdf156fea2fabed31a569445835aeedcc33643d404fcbaa54541f06c109df3f","affectsGlobalScope":true},"ba7617784f6b9aeac5e20c5eea869bbc3ef31b905f59c796b0fd401dae17c111","6a386ff939f180ae8ef064699d8b7b6e62bc2731a62d7fbf5e02589383838dea","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"e870860b52176fc9c884bbd62b6dbb4982e84a3dd33782333b952653979911eb","affectsGlobalScope":true},{"version":"5b44f8d3baeea3c4acd81490b66fdb526b39b550f5380bb90768894b4c8cba70","signature":"c6c0a2976693234cb3bb9f46ba730f50639f5450567544269d3ec3958da4dd6c"},"81cc2c40f534e9e21df1c33e807fb6c010a4ac35ae698a03d8ec575426f63e5e",{"version":"2e33e0439dda626d9edd57357553cfe135df882b7c3833042a790852b74c4302","signature":"3c8835713a596081b171318c11cc6ce5b68da8eb40ea2e82b4e1d7b6d267ef1f"},{"version":"91f121781b852fa0be7830e0e49ff12e343dbbbffc2df9704b665fa603edc230","signature":"03035e6a172d121afd33f01c689f4c1b83a2390571c73aef9029440600549de8"},"b9d9b79b59e5aaef0dc0b388c55414ed565cb3e79b31bdf9eaa4428646a38f43",{"version":"d9bee74a43be46515c6d6b3b61558b8981fb1e2956fc90cf6b90d6680c7088ab","signature":"1a48434b56d422a0c943ffc74f0e36873004fe17bc861a214c5fc525138f69e9"},"a39f0d65b0963333f5718cb6e029a2c95070395ca1792cf8811debb3015a4c2e","74b0245c42990ed8a849df955db3f4362c81b13f799ebc981b7bec2d5b414a57"],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"esModuleInterop":true,"jsx":2,"module":99,"noUnusedLocals":true,"noUnusedParameters":true,"preserveConstEnums":true,"removeComments":true,"rootDir":"./src","skipLibCheck":true,"sourceMap":true,"target":1},"fileIdsList":[[63,64,65,66],[55,56,58,73],[56,59],[62,68],[60,67,73],[60,73],[56,60,61,69,70,72],[61,70],[71],[73],[57],[76],[63,64,65,66,76],[56,73],[62,68,76,77],[60],[71,76,77],[73,76,77],[57,76,77]],"referencedMap":[[67,1],[59,2],[60,3],[69,4],[68,5],[62,6],[73,7],[71,8],[72,9],[74,10],[58,11]],"exportedModulesMap":[[65,12],[63,12],[67,13],[75,12],[66,12],[64,12],[11,12],[12,12],[14,12],[13,12],[2,12],[15,12],[16,12],[17,12],[18,12],[19,12],[20,12],[21,12],[22,12],[3,12],[4,12],[26,12],[23,12],[24,12],[25,12],[27,12],[28,12],[29,12],[5,12],[30,12],[31,12],[32,12],[33,12],[6,12],[34,12],[35,12],[36,12],[37,12],[7,12],[38,12],[43,12],[44,12],[39,12],[40,12],[41,12],[42,12],[8,12],[48,12],[45,12],[46,12],[47,12],[49,12],[9,12],[50,12],[51,12],[52,12],[53,12],[1,12],[10,12],[54,12],[59,14],[60,3],[69,15],[68,10],[62,16],[73,7],[72,17],[74,18],[58,19]],"semanticDiagnosticsPerFile":[65,63,67,75,66,64,11,12,14,13,2,15,16,17,18,19,20,21,22,3,4,26,23,24,25,27,28,29,5,30,31,32,33,6,34,35,36,37,7,38,43,44,39,40,41,42,8,48,45,46,47,49,9,50,51,52,53,1,10,54,59,60,61,69,68,62,73,70,71,72,55,74,56,58,57]},"version":"4.7.4"}
File without changes
File without changes
File without changes