@ercioko/meblotex-api 0.1.6 → 0.1.8
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/api/Api.js +17 -17
- package/dist/api/Endpoint.js +1 -1
- package/dist/api/utils/getAlert.js +1 -1
- package/dist/app_types.d.ts +1 -2
- package/dist/app_types.js +12 -12
- package/dist/components/ApiHostProvider.js +1 -1
- package/dist/components/Table/DataTableWrapper.d.ts +2 -1
- package/dist/components/Table/FloatingActions.d.ts +0 -1
- package/dist/components/Table/FloatingActions.js +1 -1
- package/dist/components/Table/Spinner.js +1 -1
- package/dist/components/Table/Table.js +1 -1
- package/dist/components/Table/addIndexToObject.js +1 -1
- package/dist/components/Table/areProvidedColumnsDifferent.js +1 -1
- package/dist/components/Table/hooks/useFetchPage.js +1 -1
- package/dist/components/Table/hooks/useGetCellRenderer.js +1 -1
- package/dist/components/Table/hooks/useGetColumnsWithCheckbox.js +1 -1
- package/dist/components/Table/hooks/useGetDeleteRow.js +1 -1
- package/dist/components/Table/hooks/useGetResizeColumn.d.ts +0 -1
- package/dist/components/Table/hooks/useGetResizeColumn.js +1 -1
- package/dist/components/Table/hooks/useGetRowCheckbox.js +1 -1
- package/dist/components/Table/hooks/useLoadDataSource.js +1 -1
- package/dist/components/Table/hooks/usePageSize.js +1 -2
- package/dist/components/Table/hooks/useRenderRowActions.js +1 -1
- package/dist/components/Table/hooks/useResizeColumns.js +1 -1
- package/dist/components/Table/styles.d.ts +6 -6
- package/dist/hooks/useApi.js +1 -1
- package/dist/hooks/useEndpoint.js +1 -1
- package/dist/lib/jednostkaNazwa.js +2 -2
- package/dist/src/api/Api.js +5 -5
- package/dist/src/api/Endpoint.js +1 -1
- package/dist/src/components/ApiHostProvider.js +1 -1
- package/dist/utils/getWzNumber.d.ts +1 -1
- package/dist/utils/getZamowienieDokumentNumber.d.ts +1 -1
- package/package.json +11 -11
package/dist/api/Api.js
CHANGED
|
@@ -70,10 +70,10 @@ var Api = /** @class */ (function () {
|
|
|
70
70
|
this.endpoint = endpoint;
|
|
71
71
|
this.endpointUrl = "".concat(this.host).concat(this.namespace, "/").concat(this.endpoint);
|
|
72
72
|
}
|
|
73
|
-
Api.prototype.get = function (
|
|
74
|
-
|
|
75
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
73
|
+
Api.prototype.get = function () {
|
|
74
|
+
return __awaiter(this, arguments, void 0, function (opts) {
|
|
76
75
|
var headers, options, url;
|
|
76
|
+
if (opts === void 0) { opts = {}; }
|
|
77
77
|
return __generator(this, function (_a) {
|
|
78
78
|
headers = new Headers();
|
|
79
79
|
if (opts.token)
|
|
@@ -82,22 +82,22 @@ var Api = /** @class */ (function () {
|
|
|
82
82
|
credentials: 'include',
|
|
83
83
|
headers: headers,
|
|
84
84
|
};
|
|
85
|
-
url = "".concat(this.endpointUrl, "/").concat(opts.id || ''
|
|
85
|
+
url = "".concat(this.endpointUrl, "/").concat(opts.id || '').concat(this.getQuery(opts.query));
|
|
86
86
|
return [2 /*return*/, fetch(url, options).then(handleResponse)];
|
|
87
87
|
});
|
|
88
88
|
});
|
|
89
89
|
};
|
|
90
|
-
Api.prototype.post = function (
|
|
91
|
-
|
|
92
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
90
|
+
Api.prototype.post = function (data_1) {
|
|
91
|
+
return __awaiter(this, arguments, void 0, function (data, opts) {
|
|
93
92
|
var headers, body, url;
|
|
93
|
+
if (opts === void 0) { opts = {}; }
|
|
94
94
|
return __generator(this, function (_a) {
|
|
95
95
|
headers = new Headers();
|
|
96
96
|
body = JSON.stringify(data);
|
|
97
97
|
headers.append('Content-Type', 'application/json');
|
|
98
98
|
if (opts.token)
|
|
99
99
|
headers.append('Authorization', "Bearer ".concat(opts.token));
|
|
100
|
-
url = "".concat(this.endpointUrl
|
|
100
|
+
url = "".concat(this.endpointUrl).concat(this.getQuery(opts.query));
|
|
101
101
|
return [2 /*return*/, fetch(url, {
|
|
102
102
|
method: 'POST',
|
|
103
103
|
body: body,
|
|
@@ -107,17 +107,17 @@ var Api = /** @class */ (function () {
|
|
|
107
107
|
});
|
|
108
108
|
});
|
|
109
109
|
};
|
|
110
|
-
Api.prototype.put = function (
|
|
111
|
-
|
|
112
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
110
|
+
Api.prototype.put = function (id_1, data_1) {
|
|
111
|
+
return __awaiter(this, arguments, void 0, function (id, data, opts) {
|
|
113
112
|
var body, headers, url;
|
|
113
|
+
if (opts === void 0) { opts = {}; }
|
|
114
114
|
return __generator(this, function (_a) {
|
|
115
115
|
body = JSON.stringify(data);
|
|
116
116
|
headers = new Headers();
|
|
117
117
|
headers.append('Content-Type', 'application/json');
|
|
118
118
|
if (opts.token)
|
|
119
119
|
headers.append('Authorization', "Bearer ".concat(opts.token));
|
|
120
|
-
url = "".concat(this.endpointUrl).concat(opts.noId ? '' : '/').concat(id || ''
|
|
120
|
+
url = "".concat(this.endpointUrl).concat(opts.noId ? '' : '/').concat(id || '').concat(this.getQuery(opts.query));
|
|
121
121
|
return [2 /*return*/, fetch(url, {
|
|
122
122
|
method: 'PUT',
|
|
123
123
|
body: body,
|
|
@@ -127,15 +127,15 @@ var Api = /** @class */ (function () {
|
|
|
127
127
|
});
|
|
128
128
|
});
|
|
129
129
|
};
|
|
130
|
-
Api.prototype.delete = function (
|
|
131
|
-
|
|
132
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
130
|
+
Api.prototype.delete = function (id_1) {
|
|
131
|
+
return __awaiter(this, arguments, void 0, function (id, opts) {
|
|
133
132
|
var headers, url;
|
|
133
|
+
if (opts === void 0) { opts = {}; }
|
|
134
134
|
return __generator(this, function (_a) {
|
|
135
135
|
headers = new Headers();
|
|
136
136
|
if (opts.token)
|
|
137
137
|
headers.append('Authorization', "Bearer ".concat(opts.token));
|
|
138
|
-
url = "".concat(this.endpointUrl, "/").concat(id
|
|
138
|
+
url = "".concat(this.endpointUrl, "/").concat(id).concat(this.getQuery(opts.query));
|
|
139
139
|
return [2 /*return*/, fetch(url, {
|
|
140
140
|
headers: headers,
|
|
141
141
|
method: 'DELETE',
|
|
@@ -145,7 +145,7 @@ var Api = /** @class */ (function () {
|
|
|
145
145
|
});
|
|
146
146
|
};
|
|
147
147
|
Api.prototype.getQuery = function (query) {
|
|
148
|
-
return query ? new URLSearchParams(utils_1.Query.encode(query)).toString() : '';
|
|
148
|
+
return query ? "?".concat(new URLSearchParams(utils_1.Query.encode(query)).toString()) : '';
|
|
149
149
|
};
|
|
150
150
|
return Api;
|
|
151
151
|
}());
|
package/dist/api/Endpoint.js
CHANGED
|
@@ -58,7 +58,7 @@ var Api_1 = __importDefault(require("./Api"));
|
|
|
58
58
|
var Endpoint = /** @class */ (function (_super) {
|
|
59
59
|
__extends(Endpoint, _super);
|
|
60
60
|
function Endpoint(endpoint, host, errorCallback) {
|
|
61
|
-
if (host === void 0) { host = '
|
|
61
|
+
if (host === void 0) { host = ''; }
|
|
62
62
|
var _this = _super.call(this, endpoint, host) || this;
|
|
63
63
|
_this.endpoint = endpoint;
|
|
64
64
|
_this.errorCallback = errorCallback;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = getAlert;
|
|
3
4
|
var error_1 = require("../error");
|
|
4
5
|
var status_1 = require("../status");
|
|
5
6
|
var severity = {
|
|
@@ -62,4 +63,3 @@ function getAlert(status) {
|
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
65
|
}
|
|
65
|
-
exports.default = getAlert;
|
package/dist/app_types.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { UzytkownikAttributes, WplataAttributes, ZamowienieDokumentAttributes, ZamowienieDokumentMagazynAttributes } from './db_types';
|
|
3
2
|
type PrefixKeys<T, Prefix extends string> = {
|
|
4
3
|
[K in keyof T as `${Prefix}.${string & K}`]: T[K];
|
|
@@ -244,7 +243,7 @@ export declare enum Jednostka {
|
|
|
244
243
|
m2old = -2
|
|
245
244
|
}
|
|
246
245
|
export declare enum RabatPrefix {
|
|
247
|
-
Brak = "N"
|
|
246
|
+
Brak = "N",// TODO
|
|
248
247
|
Narzut = "P",
|
|
249
248
|
Rabat = "M"
|
|
250
249
|
}
|
package/dist/app_types.js
CHANGED
|
@@ -5,71 +5,71 @@ var Zrodlo;
|
|
|
5
5
|
(function (Zrodlo) {
|
|
6
6
|
Zrodlo["Web"] = "M";
|
|
7
7
|
Zrodlo["Producent"] = "P";
|
|
8
|
-
})(Zrodlo
|
|
8
|
+
})(Zrodlo || (exports.Zrodlo = Zrodlo = {}));
|
|
9
9
|
var Jednostka;
|
|
10
10
|
(function (Jednostka) {
|
|
11
11
|
Jednostka[Jednostka["m2"] = 3] = "m2";
|
|
12
12
|
Jednostka[Jednostka["systemowy"] = null] = "systemowy";
|
|
13
13
|
Jednostka[Jednostka["szt"] = 1] = "szt";
|
|
14
14
|
Jednostka[Jednostka["m2old"] = -2] = "m2old";
|
|
15
|
-
})(Jednostka
|
|
15
|
+
})(Jednostka || (exports.Jednostka = Jednostka = {}));
|
|
16
16
|
var RabatPrefix;
|
|
17
17
|
(function (RabatPrefix) {
|
|
18
18
|
RabatPrefix["Brak"] = "N";
|
|
19
19
|
RabatPrefix["Narzut"] = "P";
|
|
20
20
|
RabatPrefix["Rabat"] = "M";
|
|
21
|
-
})(RabatPrefix
|
|
21
|
+
})(RabatPrefix || (exports.RabatPrefix = RabatPrefix = {}));
|
|
22
22
|
var RabatSufix;
|
|
23
23
|
(function (RabatSufix) {
|
|
24
24
|
RabatSufix["Procent"] = "%";
|
|
25
25
|
RabatSufix["Brak"] = "";
|
|
26
|
-
})(RabatSufix
|
|
26
|
+
})(RabatSufix || (exports.RabatSufix = RabatSufix = {}));
|
|
27
27
|
var BuforStatus;
|
|
28
28
|
(function (BuforStatus) {
|
|
29
29
|
BuforStatus["False"] = "F";
|
|
30
30
|
BuforStatus["New"] = "N";
|
|
31
31
|
BuforStatus["Bufor"] = "B";
|
|
32
|
-
})(BuforStatus
|
|
32
|
+
})(BuforStatus || (exports.BuforStatus = BuforStatus = {}));
|
|
33
33
|
var CechaKontrolka;
|
|
34
34
|
(function (CechaKontrolka) {
|
|
35
35
|
CechaKontrolka["PC_EDIT"] = "pcEdit ";
|
|
36
36
|
CechaKontrolka["PC_CBX"] = "pcCbx ";
|
|
37
37
|
CechaKontrolka["PC_HIDE"] = "pcHide ";
|
|
38
38
|
CechaKontrolka["PT_BOOL"] = "ptBool ";
|
|
39
|
-
})(CechaKontrolka
|
|
39
|
+
})(CechaKontrolka || (exports.CechaKontrolka = CechaKontrolka = {}));
|
|
40
40
|
var CechaTyp;
|
|
41
41
|
(function (CechaTyp) {
|
|
42
42
|
CechaTyp["PT_INT"] = "ptInt ";
|
|
43
43
|
CechaTyp["PT_TXT"] = "ptTxt ";
|
|
44
|
-
})(CechaTyp
|
|
44
|
+
})(CechaTyp || (exports.CechaTyp = CechaTyp = {}));
|
|
45
45
|
var RownanieTyp;
|
|
46
46
|
(function (RownanieTyp) {
|
|
47
47
|
RownanieTyp["Kalkulacja"] = "K";
|
|
48
|
-
})(RownanieTyp
|
|
48
|
+
})(RownanieTyp || (exports.RownanieTyp = RownanieTyp = {}));
|
|
49
49
|
var TypWplaty;
|
|
50
50
|
(function (TypWplaty) {
|
|
51
51
|
TypWplaty["Gotowka"] = "KP";
|
|
52
52
|
TypWplaty["Zaliczka"] = "ZA";
|
|
53
53
|
TypWplaty["Karta"] = "DK";
|
|
54
54
|
TypWplaty["Przelew"] = "DB";
|
|
55
|
-
})(TypWplaty
|
|
55
|
+
})(TypWplaty || (exports.TypWplaty = TypWplaty = {}));
|
|
56
56
|
var FormaPlatnosci;
|
|
57
57
|
(function (FormaPlatnosci) {
|
|
58
58
|
FormaPlatnosci["Gotowka"] = "G";
|
|
59
59
|
FormaPlatnosci["Pobranie"] = "O";
|
|
60
60
|
FormaPlatnosci["Karta"] = "K";
|
|
61
61
|
FormaPlatnosci["Przelew"] = "P";
|
|
62
|
-
})(FormaPlatnosci
|
|
62
|
+
})(FormaPlatnosci || (exports.FormaPlatnosci = FormaPlatnosci = {}));
|
|
63
63
|
var TypDokumentu;
|
|
64
64
|
(function (TypDokumentu) {
|
|
65
65
|
TypDokumentu["Faktura"] = "FA";
|
|
66
66
|
TypDokumentu["FakturaDetal"] = "DE";
|
|
67
67
|
TypDokumentu["FakturaEksport"] = "EX";
|
|
68
68
|
TypDokumentu["Paragon"] = "PA";
|
|
69
|
-
})(TypDokumentu
|
|
69
|
+
})(TypDokumentu || (exports.TypDokumentu = TypDokumentu = {}));
|
|
70
70
|
var DokumentTyp;
|
|
71
71
|
(function (DokumentTyp) {
|
|
72
72
|
DokumentTyp["WydanieZewnetrzne"] = "WZ";
|
|
73
73
|
DokumentTyp["WydanieWewnetrzne"] = "WW";
|
|
74
74
|
DokumentTyp["PrzychodWewnetrzny"] = "PW";
|
|
75
|
-
})(DokumentTyp
|
|
75
|
+
})(DokumentTyp || (exports.DokumentTyp = DokumentTyp = {}));
|
|
@@ -25,7 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.useApiHost = exports.ApiHostProvider = void 0;
|
|
27
27
|
var react_1 = __importStar(require("react"));
|
|
28
|
-
var ApiHostContext = (0, react_1.createContext)('
|
|
28
|
+
var ApiHostContext = (0, react_1.createContext)('');
|
|
29
29
|
var ApiHostProvider = function (_a) {
|
|
30
30
|
var children = _a.children, host = _a.host;
|
|
31
31
|
return (react_1.default.createElement(ApiHostContext.Provider, { value: host }, children));
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const Wrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
2
3
|
export default Wrapper;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { ActionFunction, Actions, DataRow } from '../../app_types';
|
|
3
2
|
export default function FloatingActions<DataType = DataRow>({ actionsDimensions, actionsFor, floatingButtons, actionHover, actionLeave, hide, actions, }: {
|
|
4
3
|
actionsDimensions: {
|
|
@@ -7,6 +7,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
7
7
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
8
|
};
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.default = FloatingActions;
|
|
10
11
|
var antd_1 = require("antd");
|
|
11
12
|
var react_1 = __importDefault(require("react"));
|
|
12
13
|
var icons_1 = require("@ant-design/icons");
|
|
@@ -28,5 +29,4 @@ function FloatingActions(_a) {
|
|
|
28
29
|
// onClick={() => deleteRow(actionsFor.id)}
|
|
29
30
|
twoToneColor: "#F5222D" })))) : undefined)));
|
|
30
31
|
}
|
|
31
|
-
exports.default = FloatingActions;
|
|
32
32
|
var templateObject_1;
|
|
@@ -7,6 +7,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
7
7
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
8
|
};
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.default = Spinner;
|
|
10
11
|
var config_1 = __importDefault(require("../../config"));
|
|
11
12
|
var antd_1 = require("antd");
|
|
12
13
|
var react_1 = __importDefault(require("react"));
|
|
@@ -22,5 +23,4 @@ function Spinner() {
|
|
|
22
23
|
} },
|
|
23
24
|
react_1.default.createElement(antd_1.Spin, { style: { margin: 0 } })));
|
|
24
25
|
}
|
|
25
|
-
exports.default = Spinner;
|
|
26
26
|
var templateObject_1;
|
|
@@ -116,7 +116,7 @@ function BaseTable(_a) {
|
|
|
116
116
|
hoveredRow: hoveredRow,
|
|
117
117
|
selected: typeof selected === 'object'
|
|
118
118
|
? selected === null || selected === void 0 ? void 0 : selected.id
|
|
119
|
-
: selected,
|
|
119
|
+
: selected, // TODO fix types
|
|
120
120
|
checked: checked,
|
|
121
121
|
});
|
|
122
122
|
var RowActions = (0, useRenderRowActions_1.default)({ data: data, actions: actions, deleteRow: deleteRow });
|
|
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.default = addIndexToObject;
|
|
14
15
|
function addIndexToObject(e, i) {
|
|
15
16
|
return __assign(__assign({}, e), { index: i + 1 });
|
|
16
17
|
}
|
|
17
|
-
exports.default = addIndexToObject;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = areProvidedColumnsDifferent;
|
|
3
4
|
function areProvidedColumnsDifferent(providedColumns, currentColumns) {
|
|
4
5
|
var providedKeys = providedColumns.map(function (c) { return String(c.key).toLowerCase(); });
|
|
5
6
|
var currentKeys = currentColumns.map(function (c) { return String(c.key).toLowerCase(); });
|
|
@@ -13,4 +14,3 @@ function areProvidedColumnsDifferent(providedColumns, currentColumns) {
|
|
|
13
14
|
}
|
|
14
15
|
return (JSON.stringify(providedKeysWithAdditional) !== JSON.stringify(currentKeys));
|
|
15
16
|
}
|
|
16
|
-
exports.default = areProvidedColumnsDifferent;
|
|
@@ -48,6 +48,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
48
48
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
49
|
};
|
|
50
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
+
exports.default = useFetchPage;
|
|
51
52
|
var antd_1 = require("antd");
|
|
52
53
|
var react_1 = require("react");
|
|
53
54
|
var addIndexToObject_1 = __importDefault(require("../addIndexToObject"));
|
|
@@ -120,4 +121,3 @@ function useFetchPage(_a) {
|
|
|
120
121
|
});
|
|
121
122
|
}); }, [suspend, pageSize, loadPage, filters, data, order]);
|
|
122
123
|
}
|
|
123
|
-
exports.default = useFetchPage;
|
|
@@ -46,6 +46,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
46
46
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
47
47
|
};
|
|
48
48
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
|
+
exports.default = useGetCellRenderer;
|
|
49
50
|
var react_1 = __importStar(require("react"));
|
|
50
51
|
var react_draggable_1 = __importDefault(require("react-draggable"));
|
|
51
52
|
var OrderProvider_1 = require("../providers/OrderProvider");
|
|
@@ -163,4 +164,3 @@ function useGetCellRenderer(_a) {
|
|
|
163
164
|
sortByColumn,
|
|
164
165
|
]);
|
|
165
166
|
}
|
|
166
|
-
exports.default = useGetCellRenderer;
|
|
@@ -23,6 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.default = useGetColumnsWithCheckbox;
|
|
26
27
|
var antd_1 = require("antd");
|
|
27
28
|
var react_1 = __importStar(require("react"));
|
|
28
29
|
function useGetColumnsWithCheckbox(_a) {
|
|
@@ -41,7 +42,6 @@ function useGetColumnsWithCheckbox(_a) {
|
|
|
41
42
|
return updatedColumns;
|
|
42
43
|
}, [checked, data, RowCheckbox]);
|
|
43
44
|
}
|
|
44
|
-
exports.default = useGetColumnsWithCheckbox;
|
|
45
45
|
function getCheckboxColumn(_a) {
|
|
46
46
|
var allChecked = _a.allChecked, RowCheckbox = _a.RowCheckbox;
|
|
47
47
|
return {
|
|
@@ -39,6 +39,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
40
|
};
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.default = useGetDeleteRow;
|
|
42
43
|
var antd_1 = require("antd");
|
|
43
44
|
var react_1 = require("react");
|
|
44
45
|
var addIndexToObject_1 = __importDefault(require("../addIndexToObject"));
|
|
@@ -71,4 +72,3 @@ function useGetDeleteRow(_a) {
|
|
|
71
72
|
});
|
|
72
73
|
}); }, [data, onDelete, setData]);
|
|
73
74
|
}
|
|
74
|
-
exports.default = useGetDeleteRow;
|
|
@@ -11,6 +11,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.default = useGetResizeColumn;
|
|
14
15
|
// TODO: fix resizing
|
|
15
16
|
var react_1 = require("react");
|
|
16
17
|
function useGetResizeColumn(_a) {
|
|
@@ -25,4 +26,3 @@ function useGetResizeColumn(_a) {
|
|
|
25
26
|
// setColumns(updatedColumns);
|
|
26
27
|
}, [columns, setColumns]);
|
|
27
28
|
}
|
|
28
|
-
exports.default = useGetResizeColumn;
|
|
@@ -32,6 +32,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
32
32
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
exports.default = useGetRowCheckbox;
|
|
35
36
|
var antd_1 = require("antd");
|
|
36
37
|
var react_1 = __importStar(require("react"));
|
|
37
38
|
function useGetRowCheckbox(_a) {
|
|
@@ -51,4 +52,3 @@ function useGetRowCheckbox(_a) {
|
|
|
51
52
|
return react_1.default.createElement(antd_1.Checkbox, { checked: isInChecked, onChange: handleOnChange });
|
|
52
53
|
}, [checked]);
|
|
53
54
|
}
|
|
54
|
-
exports.default = useGetRowCheckbox;
|
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = useLoadDataSource;
|
|
6
7
|
var react_1 = require("react");
|
|
7
8
|
var addIndexToObject_1 = __importDefault(require("../addIndexToObject"));
|
|
8
9
|
function useLoadDataSource(_a) {
|
|
@@ -17,4 +18,3 @@ function useLoadDataSource(_a) {
|
|
|
17
18
|
}
|
|
18
19
|
}, [filters, added, dataSource]);
|
|
19
20
|
}
|
|
20
|
-
exports.default = useLoadDataSource;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.usePageSize =
|
|
3
|
+
exports.usePageSize = usePageSize;
|
|
4
4
|
var react_1 = require("react");
|
|
5
5
|
var Table_1 = require("../Table");
|
|
6
6
|
function usePageSize(_a) {
|
|
@@ -14,4 +14,3 @@ function usePageSize(_a) {
|
|
|
14
14
|
return 2;
|
|
15
15
|
}, [mainRef]);
|
|
16
16
|
}
|
|
17
|
-
exports.usePageSize = usePageSize;
|
|
@@ -30,6 +30,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
30
30
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
31
31
|
};
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
exports.default = useRenderRowActions;
|
|
33
34
|
var antd_1 = require("antd");
|
|
34
35
|
var react_1 = __importStar(require("react"));
|
|
35
36
|
var icons_1 = require("@ant-design/icons");
|
|
@@ -47,5 +48,4 @@ function useRenderRowActions(_a) {
|
|
|
47
48
|
react_1.default.createElement(icons_1.DeleteTwoTone, { onClick: function () { return deleteRow(data[rowIndex - 1]); }, twoToneColor: "#F5222D" }))) : undefined));
|
|
48
49
|
}, [data, actions, deleteRow]);
|
|
49
50
|
}
|
|
50
|
-
exports.default = useRenderRowActions;
|
|
51
51
|
var templateObject_1;
|
|
@@ -12,6 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.default = useResizeColumns;
|
|
15
16
|
var react_1 = require("react");
|
|
16
17
|
var areProvidedColumnsDifferent_1 = __importDefault(require("../areProvidedColumnsDifferent"));
|
|
17
18
|
var SCROLLBAR_WIDTH = 16;
|
|
@@ -57,4 +58,3 @@ function useResizeColumns(_a) {
|
|
|
57
58
|
grid,
|
|
58
59
|
]);
|
|
59
60
|
}
|
|
60
|
-
exports.default = useResizeColumns;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare const DataTable: import("styled-components").
|
|
2
|
-
export declare const StyledTable: import("styled-components").
|
|
3
|
-
export declare const TableHeader: import("styled-components").
|
|
4
|
-
export declare const TableData: import("styled-components").
|
|
5
|
-
$align?:
|
|
6
|
-
}
|
|
1
|
+
export declare const DataTable: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
2
|
+
export declare const StyledTable: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
|
+
export declare const TableHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
4
|
+
export declare const TableData: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
5
|
+
$align?: "right";
|
|
6
|
+
}>> & string;
|
package/dist/hooks/useApi.js
CHANGED
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = useApi;
|
|
6
7
|
var react_1 = require("react");
|
|
7
8
|
var createApi_1 = require("../api/createApi");
|
|
8
9
|
var Endpoint_1 = __importDefault(require("../api/Endpoint"));
|
|
@@ -39,4 +40,3 @@ function useApi(onUnauthorized) {
|
|
|
39
40
|
}, [onUnauthorized]);
|
|
40
41
|
return api;
|
|
41
42
|
}
|
|
42
|
-
exports.default = useApi;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = useEndpoint;
|
|
3
4
|
var react_1 = require("react");
|
|
4
5
|
var createApi_1 = require("../api/createApi");
|
|
5
6
|
var components_1 = require("../components");
|
|
@@ -31,4 +32,3 @@ function useEndpoint(path, onError) {
|
|
|
31
32
|
}, [path, handleErrors, host]);
|
|
32
33
|
return endpoint;
|
|
33
34
|
}
|
|
34
|
-
exports.default = useEndpoint;
|
package/dist/src/api/Api.js
CHANGED
|
@@ -220,7 +220,7 @@ var Api = /*#__PURE__*/ function() {
|
|
|
220
220
|
credentials: 'include',
|
|
221
221
|
headers: headers
|
|
222
222
|
};
|
|
223
|
-
url = "".concat(_this.endpointUrl, "/").concat(opts.id || ''
|
|
223
|
+
url = "".concat(_this.endpointUrl, "/").concat(opts.id || '').concat(_this.getQuery(opts.query));
|
|
224
224
|
return [
|
|
225
225
|
2,
|
|
226
226
|
fetch(url, options).then(handleResponse)
|
|
@@ -241,7 +241,7 @@ var Api = /*#__PURE__*/ function() {
|
|
|
241
241
|
body = JSON.stringify(data);
|
|
242
242
|
headers.append('Content-Type', 'application/json');
|
|
243
243
|
if (opts.token) headers.append('Authorization', "Bearer ".concat(opts.token));
|
|
244
|
-
url = "".concat(_this.endpointUrl
|
|
244
|
+
url = "".concat(_this.endpointUrl).concat(_this.getQuery(opts.query));
|
|
245
245
|
return [
|
|
246
246
|
2,
|
|
247
247
|
fetch(url, {
|
|
@@ -267,7 +267,7 @@ var Api = /*#__PURE__*/ function() {
|
|
|
267
267
|
headers = new Headers();
|
|
268
268
|
headers.append('Content-Type', 'application/json');
|
|
269
269
|
if (opts.token) headers.append('Authorization', "Bearer ".concat(opts.token));
|
|
270
|
-
url = "".concat(_this.endpointUrl).concat(opts.noId ? '' : '/').concat(id || ''
|
|
270
|
+
url = "".concat(_this.endpointUrl).concat(opts.noId ? '' : '/').concat(id || '').concat(_this.getQuery(opts.query));
|
|
271
271
|
return [
|
|
272
272
|
2,
|
|
273
273
|
fetch(url, {
|
|
@@ -291,7 +291,7 @@ var Api = /*#__PURE__*/ function() {
|
|
|
291
291
|
return _ts_generator(this, function(_state) {
|
|
292
292
|
headers = new Headers();
|
|
293
293
|
if (opts.token) headers.append('Authorization', "Bearer ".concat(opts.token));
|
|
294
|
-
url = "".concat(_this.endpointUrl, "/").concat(id
|
|
294
|
+
url = "".concat(_this.endpointUrl, "/").concat(id).concat(_this.getQuery(opts.query));
|
|
295
295
|
return [
|
|
296
296
|
2,
|
|
297
297
|
fetch(url, {
|
|
@@ -307,7 +307,7 @@ var Api = /*#__PURE__*/ function() {
|
|
|
307
307
|
{
|
|
308
308
|
key: "getQuery",
|
|
309
309
|
value: function getQuery(query) {
|
|
310
|
-
return query ? new URLSearchParams(Query.encode(query)).toString() : '';
|
|
310
|
+
return query ? "?".concat(new URLSearchParams(Query.encode(query)).toString()) : '';
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
313
|
]);
|
package/dist/src/api/Endpoint.js
CHANGED
|
@@ -249,7 +249,7 @@ var Endpoint = /*#__PURE__*/ function(Api) {
|
|
|
249
249
|
_inherits(Endpoint, Api);
|
|
250
250
|
var _super = _create_super(Endpoint);
|
|
251
251
|
function Endpoint(endpoint) {
|
|
252
|
-
var host = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : '
|
|
252
|
+
var host = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : '', errorCallback = arguments.length > 2 ? arguments[2] : void 0;
|
|
253
253
|
_class_call_check(this, Endpoint);
|
|
254
254
|
var _this;
|
|
255
255
|
_this = _super.call(this, endpoint, host);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { createContext, useContext } from 'react';
|
|
2
|
-
var ApiHostContext = /*#__PURE__*/ createContext('
|
|
2
|
+
var ApiHostContext = /*#__PURE__*/ createContext('');
|
|
3
3
|
export var ApiHostProvider = function(param) {
|
|
4
4
|
var children = param.children, host = param.host;
|
|
5
5
|
return /*#__PURE__*/ React.createElement(ApiHostContext.Provider, {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ZamowienieDokumentMagazynAttributes } from '../db_types';
|
|
2
|
-
export declare const getWZNumber: ({ numer, numer_idx, }: Pick<ZamowienieDokumentMagazynAttributes,
|
|
2
|
+
export declare const getWZNumber: ({ numer, numer_idx, }: Pick<ZamowienieDokumentMagazynAttributes, "numer_idx" | "numer">) => string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ZamowienieDokument } from '../app_types';
|
|
2
|
-
export declare const getZamowienieDokumentNumber: (row: Pick<ZamowienieDokument,
|
|
2
|
+
export declare const getZamowienieDokumentNumber: (row: Pick<ZamowienieDokument, "typ_dokumentu" | "numer_idx" | "numer">) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ercioko/meblotex-api",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Shared modules for Meblotex app",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"typings": "./dist/index.d.ts",
|
|
@@ -30,27 +30,27 @@
|
|
|
30
30
|
"react": "^17.0.2",
|
|
31
31
|
"react-dom": "^17.0.2",
|
|
32
32
|
"react-redux": "^8.1.3",
|
|
33
|
-
"styled-components": "^
|
|
33
|
+
"styled-components": "^6.1.12"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"antd": "^4.24.16",
|
|
37
37
|
"react-draggable": "^4.4.6",
|
|
38
38
|
"react-virtualized": "^9.22.5",
|
|
39
|
-
"typescript": "^
|
|
39
|
+
"typescript": "^5.5.4"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@babel/core": "^7.
|
|
42
|
+
"@babel/core": "^7.25.2",
|
|
43
43
|
"@swc/cli": "^0.4.0",
|
|
44
|
-
"@swc/core": "^1.
|
|
45
|
-
"@types/react": "^
|
|
44
|
+
"@swc/core": "^1.7.3",
|
|
45
|
+
"@types/react": "^17.0.80",
|
|
46
46
|
"@types/styled-components": "^5.1.34",
|
|
47
|
-
"babel-loader": "^
|
|
48
|
-
"eslint": "^8.
|
|
49
|
-
"eslint-config-prettier": "^
|
|
50
|
-
"prettier": "^
|
|
47
|
+
"babel-loader": "^9.1.3",
|
|
48
|
+
"eslint": "^9.8.0",
|
|
49
|
+
"eslint-config-prettier": "^9.1.0",
|
|
50
|
+
"prettier": "^3.3.3",
|
|
51
51
|
"sequelize": "^6.37.3",
|
|
52
52
|
"ts-loader": "^9.5.1",
|
|
53
|
-
"webpack-cli": "^
|
|
53
|
+
"webpack-cli": "^5.1.4"
|
|
54
54
|
},
|
|
55
55
|
"sideEffects": false,
|
|
56
56
|
"keywords": [
|