@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
@@ -0,0 +1,50 @@
1
+ import Endpoint from './Endpoint';
2
+ import * as error from './error';
3
+ import * as hooks from '../hooks';
4
+ import * as status from './status';
5
+ import * as utils from './utils';
6
+ export { status, error, utils, hooks };
7
+ export var createApi = function(host) {
8
+ return {
9
+ atrybut_konfig: new Endpoint('atrybut_konfig', host),
10
+ bufor: new Endpoint('bufor', host),
11
+ bufor_element: new Endpoint('bufor_element', host),
12
+ bufor_element_atrybut: new Endpoint('bufor_element_atrybut', host),
13
+ buforinfo: new Endpoint('buforinfo', host),
14
+ cecha_wartosc: new Endpoint('cecha_wartosc', host),
15
+ get_set_param_number: new Endpoint('get_set_param_number', host),
16
+ klient: new Endpoint('klient', host),
17
+ klient_kategoria: new Endpoint('klient_kategoria', host),
18
+ klient_rabat: new Endpoint('klient_rabat', host),
19
+ klient_zamowienie: new Endpoint('klient_zamowienie', host),
20
+ login: new Endpoint('auth/login', host),
21
+ logout: new Endpoint('auth/logout', host),
22
+ web_login: new Endpoint('web_auth/login', host),
23
+ web_logout: new Endpoint('web_auth/logout', host),
24
+ nowe_zamowienie_cecha_wartosc: new Endpoint('nowe_zamowienie/cecha_wartosc', host),
25
+ nowe_zamowienie_towar: new Endpoint('nowe_zamowienie/towar', host),
26
+ nowe_zamowienie_towar_atrybut: new Endpoint('nowe_zamowienie/towar_atrybut', host),
27
+ nowe_zamowienie_towar_atrybut2: new Endpoint('nowe_zamowienie/towar_atrybut2', host),
28
+ nowe_zamowienie_towar_kategoria: new Endpoint('nowe_zamowienie/towar_kategoria', host),
29
+ nowe_zamowienie_towar_cecha_wartosc_pre: new Endpoint('nowe_zamowienie/towar_cecha_wartosc_pre', host),
30
+ nowe_zamowienie_atrybut_konfig: new Endpoint('nowe_zamowienie/atrybut_konfig', host),
31
+ rownanie: new Endpoint('rownanie', host),
32
+ rownanie_zmienna: new Endpoint('rownanie_zmienna', host),
33
+ rownanie_zmienna_kategoria: new Endpoint('rownanie_zmienna_kategoria', host),
34
+ rownanie_js: new Endpoint('rownanie/js', host),
35
+ towar: new Endpoint('towar', host),
36
+ towar_atrybut: new Endpoint('towar_atrybut', host),
37
+ towar_kategoria: new Endpoint('towar_kategoria', host),
38
+ towar_cecha_wartosc_pre: new Endpoint('towar_cecha_wartosc_pre', host),
39
+ wplata: new Endpoint('wplata', host),
40
+ wplata_zamowienie_dokument: new Endpoint('wplata_zamowienie_dokument', host),
41
+ zamowienie: new Endpoint('zamowienie', host),
42
+ zamowienie_dokument: new Endpoint('zamowienie_dokument', host),
43
+ zamowienieinfo: new Endpoint('zamowienieinfo', host),
44
+ zaliczka_zamowienie_dokument: new Endpoint('zaliczka_zamowienie_dokument', host),
45
+ zamowienie_nowy_dokument_element: new Endpoint('zamowienie_nowy_dokument_element', host),
46
+ zamowienie_nowy_dokument: new Endpoint('zamowienie_nowy_dokument', host),
47
+ zamowienie_dokument_element: new Endpoint('zamowienie_dokument_element', host),
48
+ zamowienie_dokument_magazyn: new Endpoint('zamowienie_dokument_magazyn', host)
49
+ };
50
+ };
@@ -0,0 +1,15 @@
1
+ export var NOT_FOUND = 'not_found';
2
+ export var INVALID_DATA = 'invalid_data';
3
+ export var INVALID_REQUEST = 'invalid_request';
4
+ export var UNAUTHORIZED = 'unauthorized';
5
+ export var ALREADY_EXISTS = 'already_exists';
6
+ export var FAILED_TO_FETCH = 'Failed to fetch';
7
+ export var field = {
8
+ NEW_PASSWORD: 'new_password',
9
+ OLD_PASSWORD: 'old_password',
10
+ EMAIL: 'email',
11
+ LAST_NAME: 'surname',
12
+ FIRST_NAME: 'name',
13
+ COMPANY: 'company_name',
14
+ PHONE: 'phone_number'
15
+ };
@@ -0,0 +1,5 @@
1
+ import * as error from './error';
2
+ import * as hooks from '../hooks';
3
+ import * as status from './status';
4
+ import * as utils from './utils';
5
+ export { status, error, utils, hooks };
@@ -0,0 +1,3 @@
1
+ export var OK = 'ok';
2
+ export var INVALID_PASSWORD = 'invalid_password';
3
+ export var ALREADY_LOGGED_IN = 'already_logged_in';
@@ -0,0 +1,63 @@
1
+ import { FAILED_TO_FETCH, INVALID_DATA, INVALID_REQUEST, UNAUTHORIZED, field } from "../error";
2
+ import { ALREADY_LOGGED_IN, INVALID_PASSWORD, OK } from "../status";
3
+ var severity = {
4
+ SUCCESS: "success",
5
+ ERROR: "error",
6
+ WARNING: "warning",
7
+ INFO: "info"
8
+ };
9
+ var createAlert = function(severity, message) {
10
+ return {
11
+ severity: severity,
12
+ message: message
13
+ };
14
+ };
15
+ export default function getAlert(status) {
16
+ try {
17
+ var error = JSON.parse(status);
18
+ switch(error.error){
19
+ case INVALID_DATA:
20
+ switch(error.field){
21
+ case field.EMAIL:
22
+ return createAlert(severity.ERROR, "Błędny email");
23
+ case field.FIRST_NAME:
24
+ return createAlert(severity.ERROR, "Błędne imię");
25
+ case field.LAST_NAME:
26
+ return createAlert(severity.ERROR, "Błędne nazwisko");
27
+ case field.PHONE:
28
+ return createAlert(severity.ERROR, "Błędny numer telefonu");
29
+ case field.COMPANY:
30
+ return createAlert(severity.ERROR, "Błędna nazwa firmy");
31
+ default:
32
+ return createAlert(severity.ERROR, error.error);
33
+ }
34
+ default:
35
+ return createAlert(severity.ERROR, error.error);
36
+ }
37
+ } catch (e) {
38
+ switch(status){
39
+ case OK:
40
+ return createAlert(severity.SUCCESS, "Sukces!");
41
+ case INVALID_PASSWORD:
42
+ return createAlert(severity.ERROR, "Błędne hasło lub email!");
43
+ case ALREADY_LOGGED_IN:
44
+ return createAlert(severity.ERROR, "Jesteś już zalogowany!");
45
+ case FAILED_TO_FETCH:
46
+ return createAlert(severity.ERROR, "Wystąpił błąd!");
47
+ case INVALID_REQUEST:
48
+ return createAlert(severity.ERROR, "Błąd zapytania!");
49
+ case UNAUTHORIZED:
50
+ return createAlert(severity.ERROR, "Błąd autoryzacji!");
51
+ case field.NEW_PASSWORD:
52
+ return createAlert(severity.ERROR, "Nowe hasło jest zbyt słabe!");
53
+ case field.OLD_PASSWORD:
54
+ return createAlert(severity.ERROR, "Stare hasło jest nieprawidłowe!");
55
+ case "name_empty":
56
+ return createAlert(severity.ERROR, "Nazwa jest pusta!");
57
+ case "name_taken":
58
+ return createAlert(severity.ERROR, "Nazwa jest zajęta!");
59
+ default:
60
+ return createAlert(severity.ERROR, status);
61
+ }
62
+ }
63
+ }
@@ -0,0 +1 @@
1
+ export { default as getAlert } from "./getAlert";
@@ -0,0 +1,72 @@
1
+ export var Zrodlo;
2
+ (function(Zrodlo) {
3
+ Zrodlo["Web"] = "M";
4
+ Zrodlo["Producent"] = "P";
5
+ })(Zrodlo || (Zrodlo = {}));
6
+ export var Jednostka;
7
+ (function(Jednostka) {
8
+ Jednostka[Jednostka["m2"] = 3] = "m2";
9
+ Jednostka[Jednostka["systemowy"] = null] = "systemowy";
10
+ Jednostka[Jednostka["szt"] = 1] = "szt";
11
+ Jednostka[Jednostka["m2old"] = -2] = "m2old";
12
+ })(Jednostka || (Jednostka = {}));
13
+ export var RabatPrefix;
14
+ (function(RabatPrefix) {
15
+ RabatPrefix["Brak"] = "N";
16
+ RabatPrefix["Narzut"] = "P";
17
+ RabatPrefix["Rabat"] = "M";
18
+ })(RabatPrefix || (RabatPrefix = {}));
19
+ export var RabatSufix;
20
+ (function(RabatSufix) {
21
+ RabatSufix["Procent"] = "%";
22
+ RabatSufix["Brak"] = "";
23
+ })(RabatSufix || (RabatSufix = {}));
24
+ export var BuforStatus;
25
+ (function(BuforStatus) {
26
+ BuforStatus["False"] = "F";
27
+ BuforStatus["New"] = "N";
28
+ BuforStatus["Bufor"] = "B";
29
+ })(BuforStatus || (BuforStatus = {}));
30
+ export var CechaKontrolka;
31
+ (function(CechaKontrolka) {
32
+ CechaKontrolka["PC_EDIT"] = "pcEdit ";
33
+ CechaKontrolka["PC_CBX"] = "pcCbx ";
34
+ CechaKontrolka["PC_HIDE"] = "pcHide ";
35
+ CechaKontrolka["PT_BOOL"] = "ptBool ";
36
+ })(CechaKontrolka || (CechaKontrolka = {}));
37
+ export var CechaTyp;
38
+ (function(CechaTyp) {
39
+ CechaTyp["PT_INT"] = "ptInt ";
40
+ CechaTyp["PT_TXT"] = "ptTxt ";
41
+ })(CechaTyp || (CechaTyp = {}));
42
+ export var RownanieTyp;
43
+ (function(RownanieTyp) {
44
+ RownanieTyp["Kalkulacja"] = "K";
45
+ })(RownanieTyp || (RownanieTyp = {}));
46
+ export var TypWplaty;
47
+ (function(TypWplaty) {
48
+ TypWplaty["Gotowka"] = "KP";
49
+ TypWplaty["Zaliczka"] = "ZA";
50
+ TypWplaty["Karta"] = "DK";
51
+ TypWplaty["Przelew"] = "DB";
52
+ })(TypWplaty || (TypWplaty = {}));
53
+ export var FormaPlatnosci;
54
+ (function(FormaPlatnosci) {
55
+ FormaPlatnosci["Gotowka"] = "G";
56
+ FormaPlatnosci["Pobranie"] = "O";
57
+ FormaPlatnosci["Karta"] = "K";
58
+ FormaPlatnosci["Przelew"] = "P";
59
+ })(FormaPlatnosci || (FormaPlatnosci = {}));
60
+ export var TypDokumentu;
61
+ (function(TypDokumentu) {
62
+ TypDokumentu["Faktura"] = "FA";
63
+ TypDokumentu["FakturaDetal"] = "DE";
64
+ TypDokumentu["FakturaEksport"] = "EX";
65
+ TypDokumentu["Paragon"] = "PA";
66
+ })(TypDokumentu || (TypDokumentu = {}));
67
+ export var DokumentTyp;
68
+ (function(DokumentTyp) {
69
+ DokumentTyp["WydanieZewnetrzne"] = "WZ";
70
+ DokumentTyp["WydanieWewnetrzne"] = "WW";
71
+ DokumentTyp["PrzychodWewnetrzny"] = "PW";
72
+ })(DokumentTyp || (DokumentTyp = {}));
@@ -0,0 +1,11 @@
1
+ import React, { createContext, useContext } from 'react';
2
+ var ApiHostContext = /*#__PURE__*/ createContext('');
3
+ export var ApiHostProvider = function(param) {
4
+ var children = param.children, host = param.host;
5
+ return /*#__PURE__*/ React.createElement(ApiHostContext.Provider, {
6
+ value: host
7
+ }, children);
8
+ };
9
+ export var useApiHost = function() {
10
+ return useContext(ApiHostContext);
11
+ };
@@ -0,0 +1,153 @@
1
+ function _define_property(obj, key, value) {
2
+ if (key in obj) {
3
+ Object.defineProperty(obj, key, {
4
+ value: value,
5
+ enumerable: true,
6
+ configurable: true,
7
+ writable: true
8
+ });
9
+ } else {
10
+ obj[key] = value;
11
+ }
12
+ return obj;
13
+ }
14
+ function _object_spread(target) {
15
+ for(var i = 1; i < arguments.length; i++){
16
+ var source = arguments[i] != null ? arguments[i] : {};
17
+ var ownKeys = Object.keys(source);
18
+ if (typeof Object.getOwnPropertySymbols === "function") {
19
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
20
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
21
+ }));
22
+ }
23
+ ownKeys.forEach(function(key) {
24
+ _define_property(target, key, source[key]);
25
+ });
26
+ }
27
+ return target;
28
+ }
29
+ function _object_without_properties(source, excluded) {
30
+ if (source == null) return {};
31
+ var target = _object_without_properties_loose(source, excluded);
32
+ var key, i;
33
+ if (Object.getOwnPropertySymbols) {
34
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
35
+ for(i = 0; i < sourceSymbolKeys.length; i++){
36
+ key = sourceSymbolKeys[i];
37
+ if (excluded.indexOf(key) >= 0) continue;
38
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
39
+ target[key] = source[key];
40
+ }
41
+ }
42
+ return target;
43
+ }
44
+ function _object_without_properties_loose(source, excluded) {
45
+ if (source == null) return {};
46
+ var target = {};
47
+ var sourceKeys = Object.keys(source);
48
+ var key, i;
49
+ for(i = 0; i < sourceKeys.length; i++){
50
+ key = sourceKeys[i];
51
+ if (excluded.indexOf(key) >= 0) continue;
52
+ target[key] = source[key];
53
+ }
54
+ return target;
55
+ }
56
+ import React from 'react';
57
+ import { Tag as AntTag } from 'antd';
58
+ export var statuses = [
59
+ 'ZAM',
60
+ 'PRZ',
61
+ 'PRO',
62
+ 'WYP',
63
+ 'DWY',
64
+ 'WYB',
65
+ 'PDM',
66
+ 'WZM',
67
+ 'N',
68
+ 'B',
69
+ 'ARC',
70
+ 'WZ',
71
+ 'PW'
72
+ ];
73
+ export var StyledTag = function(_param) {
74
+ var style = _param.style, props = _object_without_properties(_param, [
75
+ "style"
76
+ ]);
77
+ return /*#__PURE__*/ React.createElement(AntTag, _object_spread({
78
+ style: _object_spread({
79
+ textAlign: 'center',
80
+ overflow: 'hidden',
81
+ textOverflow: 'ellipsis',
82
+ position: 'absolute',
83
+ top: '50%',
84
+ transform: 'translateY(-50%)',
85
+ right: '0',
86
+ left: '0'
87
+ }, style)
88
+ }, props));
89
+ };
90
+ var StatusTag = function(param) {
91
+ var status = param.status, _param_Tag = param.Tag, Tag = _param_Tag === void 0 ? StyledTag : _param_Tag;
92
+ switch(status){
93
+ case 'ZAM':
94
+ return /*#__PURE__*/ React.createElement(Tag, {
95
+ color: "cyan"
96
+ }, "Zam\xf3wione");
97
+ case 'PRZ':
98
+ return /*#__PURE__*/ React.createElement(Tag, {
99
+ color: "blue"
100
+ }, "Przyjete");
101
+ case 'PRO':
102
+ return /*#__PURE__*/ React.createElement(Tag, {
103
+ color: "gold"
104
+ }, "W produkcji");
105
+ case 'WYP':
106
+ return /*#__PURE__*/ React.createElement(Tag, {
107
+ color: "orange"
108
+ }, "Wyprodukowane");
109
+ case 'DWY':
110
+ return /*#__PURE__*/ React.createElement(Tag, {
111
+ color: "green"
112
+ }, "Do wydania");
113
+ case 'WYB':
114
+ return /*#__PURE__*/ React.createElement(Tag, {
115
+ color: "lime"
116
+ }, "Wybieranie");
117
+ case 'PDM':
118
+ return /*#__PURE__*/ React.createElement(Tag, {
119
+ color: "gray"
120
+ }, "Przyjęte do magazynu");
121
+ case 'WZM':
122
+ return /*#__PURE__*/ React.createElement(Tag, {
123
+ color: "green"
124
+ }, "Wydane z magazynu");
125
+ case 'N':
126
+ return /*#__PURE__*/ React.createElement(Tag, {
127
+ color: "gold"
128
+ }, "Bufor portal");
129
+ case 'B':
130
+ return /*#__PURE__*/ React.createElement(Tag, {
131
+ color: "blue"
132
+ }, "Bufor");
133
+ case 'ARC':
134
+ return /*#__PURE__*/ React.createElement(Tag, {
135
+ color: "black"
136
+ }, "Archiwum");
137
+ case 'WZ':
138
+ return /*#__PURE__*/ React.createElement(Tag, {
139
+ color: "blue"
140
+ }, "Wydanie zewnętrzne");
141
+ case 'PW':
142
+ return /*#__PURE__*/ React.createElement(Tag, {
143
+ color: "green"
144
+ }, "Przych\xf3d wewnętrzny");
145
+ default:
146
+ // eslint-disable-next-line no-console
147
+ console.log('nieznany: ', status);
148
+ return /*#__PURE__*/ React.createElement(Tag, {
149
+ color: "red"
150
+ }, "Nieznany");
151
+ }
152
+ };
153
+ export default StatusTag;
@@ -0,0 +1,115 @@
1
+ function _define_property(obj, key, value) {
2
+ if (key in obj) {
3
+ Object.defineProperty(obj, key, {
4
+ value: value,
5
+ enumerable: true,
6
+ configurable: true,
7
+ writable: true
8
+ });
9
+ } else {
10
+ obj[key] = value;
11
+ }
12
+ return obj;
13
+ }
14
+ function _object_spread(target) {
15
+ for(var i = 1; i < arguments.length; i++){
16
+ var source = arguments[i] != null ? arguments[i] : {};
17
+ var ownKeys = Object.keys(source);
18
+ if (typeof Object.getOwnPropertySymbols === "function") {
19
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
20
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
21
+ }));
22
+ }
23
+ ownKeys.forEach(function(key) {
24
+ _define_property(target, key, source[key]);
25
+ });
26
+ }
27
+ return target;
28
+ }
29
+ function ownKeys(object, enumerableOnly) {
30
+ var keys = Object.keys(object);
31
+ if (Object.getOwnPropertySymbols) {
32
+ var symbols = Object.getOwnPropertySymbols(object);
33
+ if (enumerableOnly) {
34
+ symbols = symbols.filter(function(sym) {
35
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
36
+ });
37
+ }
38
+ keys.push.apply(keys, symbols);
39
+ }
40
+ return keys;
41
+ }
42
+ function _object_spread_props(target, source) {
43
+ source = source != null ? source : {};
44
+ if (Object.getOwnPropertyDescriptors) {
45
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
46
+ } else {
47
+ ownKeys(Object(source)).forEach(function(key) {
48
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
49
+ });
50
+ }
51
+ return target;
52
+ }
53
+ function _object_without_properties(source, excluded) {
54
+ if (source == null) return {};
55
+ var target = _object_without_properties_loose(source, excluded);
56
+ var key, i;
57
+ if (Object.getOwnPropertySymbols) {
58
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
59
+ for(i = 0; i < sourceSymbolKeys.length; i++){
60
+ key = sourceSymbolKeys[i];
61
+ if (excluded.indexOf(key) >= 0) continue;
62
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
63
+ target[key] = source[key];
64
+ }
65
+ }
66
+ return target;
67
+ }
68
+ function _object_without_properties_loose(source, excluded) {
69
+ if (source == null) return {};
70
+ var target = {};
71
+ var sourceKeys = Object.keys(source);
72
+ var key, i;
73
+ for(i = 0; i < sourceKeys.length; i++){
74
+ key = sourceKeys[i];
75
+ if (excluded.indexOf(key) >= 0) continue;
76
+ target[key] = source[key];
77
+ }
78
+ return target;
79
+ }
80
+ function _tagged_template_literal(strings, raw) {
81
+ if (!raw) {
82
+ raw = strings.slice(0);
83
+ }
84
+ return Object.freeze(Object.defineProperties(strings, {
85
+ raw: {
86
+ value: Object.freeze(raw)
87
+ }
88
+ }));
89
+ }
90
+ function _templateObject() {
91
+ var data = _tagged_template_literal([
92
+ "\n position: relative;\n width: 100%;\n max-height: 100%;\n border-bottom: 1px solid #e8e8e8;\n margin-top: 0;\n"
93
+ ]);
94
+ _templateObject = function _templateObject() {
95
+ return data;
96
+ };
97
+ return data;
98
+ }
99
+ import React from 'react';
100
+ import styled from 'styled-components';
101
+ var Wrapper = styled.div(_templateObject());
102
+ Wrapper.defaultProps = {
103
+ className: 'data-table-wrapper'
104
+ };
105
+ function DataTableWrapper(_param, ref) {
106
+ var children = _param.children, props = _object_without_properties(_param, [
107
+ "children"
108
+ ]);
109
+ return /*#__PURE__*/ React.createElement(Wrapper, _object_spread_props(_object_spread({
110
+ className: "data-table-wrapper"
111
+ }, props), {
112
+ ref: ref
113
+ }), children);
114
+ }
115
+ export default Wrapper; // export default forwardRef(DataTableWrapper);
@@ -0,0 +1,60 @@
1
+ function _tagged_template_literal(strings, raw) {
2
+ if (!raw) {
3
+ raw = strings.slice(0);
4
+ }
5
+ return Object.freeze(Object.defineProperties(strings, {
6
+ raw: {
7
+ value: Object.freeze(raw)
8
+ }
9
+ }));
10
+ }
11
+ function _templateObject() {
12
+ var data = _tagged_template_literal([
13
+ "\n & {\n position: absolute;\n left: 100px;\n pointer-events: none;\n transition: width 300ms ease-in-out, padding 300ms ease-in-out;\n box-sizing: content-box;\n overflow: hidden;\n padding-top: 20px;\n z-index: 2;\n }\n &.shown {\n pointer-events: all;\n }\n & > div {\n box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.15);\n height: 58px;\n background: #fff;\n border-radius: 10px;\n margin: 10px;\n }\n & > div > div:first-child {\n margin-left: 27px;\n }\n & > div > div:last-child {\n margin-right: 27px;\n }\n & > div .action {\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: 150ms ease-in-out;\n position: relative;\n }\n & > div .action .action-tooltip {\n position: absolute;\n top: -35px;\n background: #595959;\n color: #fff;\n border-radius: 8px;\n padding: 2px 10px;\n display: none;\n }\n & > div .action .action-tooltip::after {\n content: '';\n position: absolute;\n top: 100%;\n left: calc(50% - 8px);\n display: block;\n width: 0;\n height: 0;\n border-width: 8px;\n border-style: solid;\n border-color: #595959 transparent transparent transparent;\n }\n & > div .action:hover {\n width: 48px;\n height: 48px;\n }\n & > div .action:hover:enabled {\n cursor: pointer;\n }\n & > div .action:hover .action-tooltip {\n display: initial;\n }\n & > div .action:hover span {\n background: rgba(0, 0, 0, 0.1);\n }\n & > div .action:hover span svg {\n font-size: 28px;\n }\n & > div .action span {\n padding: 10px;\n border-radius: 100px;\n transition: 150ms ease-in-out;\n }\n & > div .action span svg {\n transition: 150ms ease-in-out;\n font-size: 24px;\n }\n"
14
+ ]);
15
+ _templateObject = function _templateObject() {
16
+ return data;
17
+ };
18
+ return data;
19
+ }
20
+ import { Space } from 'antd';
21
+ import React from 'react';
22
+ import { DeleteTwoTone } from '@ant-design/icons';
23
+ import styled from 'styled-components';
24
+ var StyledFloatingActions = styled.div(_templateObject());
25
+ export default function FloatingActions(param) {
26
+ var actionsDimensions = param.actionsDimensions, actionsFor = param.actionsFor, floatingButtons = param.floatingButtons, actionHover = param.actionHover, actionLeave = param.actionLeave, hide = param.hide, actions = param.actions;
27
+ return /*#__PURE__*/ React.createElement(StyledFloatingActions, {
28
+ role: "button",
29
+ style: actionsDimensions,
30
+ className: "floating-actions ".concat(actionsFor ? 'shown' : ''),
31
+ onClick: function(e) {
32
+ e.stopPropagation();
33
+ e.preventDefault();
34
+ }
35
+ }, /*#__PURE__*/ React.createElement(Space, {
36
+ size: 28
37
+ }, floatingButtons === null || floatingButtons === void 0 ? void 0 : floatingButtons.map(function(_, i) {
38
+ return /*#__PURE__*/ React.createElement("div", {
39
+ role: "button",
40
+ key: i.toString(),
41
+ className: "action",
42
+ onMouseEnter: actionHover,
43
+ onMouseLeave: actionLeave,
44
+ onClick: function() {
45
+ return hide();
46
+ }
47
+ }, actions.tooltips && actions.tooltips[i] ? /*#__PURE__*/ React.createElement("div", {
48
+ className: "action-tooltip"
49
+ }, actions.tooltips[i]) : undefined);
50
+ }), actions.delete ? /*#__PURE__*/ React.createElement("div", {
51
+ className: "action",
52
+ onMouseEnter: actionHover,
53
+ onMouseLeave: actionLeave
54
+ }, /*#__PURE__*/ React.createElement("div", {
55
+ className: "action-tooltip"
56
+ }, "Usuń"), typeof actionsFor !== 'undefined' && /*#__PURE__*/ React.createElement(DeleteTwoTone, {
57
+ // onClick={() => deleteRow(actionsFor.id)}
58
+ twoToneColor: "#F5222D"
59
+ })) : undefined));
60
+ }
@@ -0,0 +1,40 @@
1
+ function _tagged_template_literal(strings, raw) {
2
+ if (!raw) {
3
+ raw = strings.slice(0);
4
+ }
5
+ return Object.freeze(Object.defineProperties(strings, {
6
+ raw: {
7
+ value: Object.freeze(raw)
8
+ }
9
+ }));
10
+ }
11
+ function _templateObject() {
12
+ var data = _tagged_template_literal([
13
+ "\n & {\n position: absolute;\n bottom: -34px;\n left: 50%;\n }\n\n .ant-spin {\n display: flex;\n justify-content: center;\n margin: 15px 0;\n }\n"
14
+ ]);
15
+ _templateObject = function _templateObject() {
16
+ return data;
17
+ };
18
+ return data;
19
+ }
20
+ import config from '../../config';
21
+ import { Spin } from 'antd';
22
+ import React from 'react';
23
+ import styled from 'styled-components';
24
+ var ROW_SIZE = config.ROW_SIZE;
25
+ var StyledSpinner = styled.div(_templateObject());
26
+ export default function Spinner() {
27
+ return /*#__PURE__*/ React.createElement(StyledSpinner, {
28
+ className: "spinner-wrapper",
29
+ style: {
30
+ height: ROW_SIZE,
31
+ display: 'flex',
32
+ justifyContent: 'center',
33
+ alignItems: 'center'
34
+ }
35
+ }, /*#__PURE__*/ React.createElement(Spin, {
36
+ style: {
37
+ margin: 0
38
+ }
39
+ }));
40
+ }
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { TableData } from './styles';
3
+ export default function Summary(param) {
4
+ var summary = param.summary, widths = param.widths;
5
+ return summary ? /*#__PURE__*/ React.createElement("div", {
6
+ className: "tr summary"
7
+ }, summary.map(function(e, i) {
8
+ return /*#__PURE__*/ React.createElement(TableData, {
9
+ key: i,
10
+ style: {
11
+ width: "".concat(widths[i], "px")
12
+ },
13
+ className: e === undefined ? 'td orphan' : 'td'
14
+ }, e);
15
+ })) : null;
16
+ }