@ercioko/meblotex-api 0.1.8 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc +6 -0
- package/.nvmrc +1 -0
- package/.prettierrc +11 -0
- package/package.json +11 -22
- package/src/api/Api.ts +140 -0
- package/src/api/Endpoint.ts +76 -0
- package/src/api/createApi.ts +116 -0
- package/src/api/error.ts +17 -0
- package/{dist/api/index.d.ts → src/api/index.ts} +1 -0
- package/src/api/status.ts +3 -0
- package/src/api/utils/getAlert.ts +75 -0
- package/src/app_types.ts +695 -0
- package/src/components/ApiHostProvider.tsx +13 -0
- package/src/components/StatusTag.tsx +83 -0
- package/src/components/Table/DataTableWrapper.tsx +28 -0
- package/src/components/Table/FloatingActions.tsx +152 -0
- package/src/components/Table/Spinner.tsx +35 -0
- package/src/components/Table/Summary.tsx +18 -0
- package/src/components/Table/Table.tsx +474 -0
- package/src/components/Table/addIndexToObject.ts +6 -0
- package/src/components/Table/areProvidedColumnsDifferent.ts +26 -0
- package/src/components/Table/clicked.js +12 -0
- package/src/components/Table/displayActions.tsx +19 -0
- package/src/components/Table/hooks/useFetchPage.tsx +83 -0
- package/src/components/Table/hooks/useGetCellRenderer.tsx +197 -0
- package/src/components/Table/hooks/useGetColumnsWithCheckbox.tsx +34 -0
- package/src/components/Table/hooks/useGetDeleteRow.tsx +37 -0
- package/src/components/Table/hooks/useGetResizeColumn.ts +33 -0
- package/src/components/Table/hooks/useGetRowCheckbox.tsx +25 -0
- package/src/components/Table/hooks/useLoadDataSource.ts +24 -0
- package/src/components/Table/hooks/usePageSize.tsx +20 -0
- package/src/components/Table/hooks/useRenderRowActions.tsx +45 -0
- package/src/components/Table/hooks/useResizeColumns.ts +61 -0
- package/src/components/Table/index.ts +1 -0
- package/src/components/Table/providers/OrderProvider.tsx +20 -0
- package/src/components/Table/styles.ts +208 -0
- package/src/config.ts +7 -0
- package/src/db_types.ts +220 -0
- package/src/hooks/useApi.ts +43 -0
- package/src/hooks/useEndpoint.ts +35 -0
- package/src/lib/jednostkaNazwa.ts +6 -0
- package/src/lib/typDokumentuNazwa.ts +8 -0
- package/src/utils/Query.ts +30 -0
- package/src/utils/getWZNumber.ts +13 -0
- package/src/utils/getZamowienieDokumentNumber.ts +11 -0
- package/{dist/src/utils/index.js → src/utils/index.ts} +2 -2
- package/tsconfig.json +25 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/dist/api/Api.d.ts +0 -33
- package/dist/api/Api.js +0 -152
- package/dist/api/Endpoint.d.ts +0 -13
- package/dist/api/Endpoint.js +0 -126
- package/dist/api/createApi.d.ts +0 -52
- package/dist/api/createApi.js +0 -81
- package/dist/api/error.d.ts +0 -15
- package/dist/api/error.js +0 -18
- package/dist/api/index.js +0 -34
- package/dist/api/status.d.ts +0 -3
- package/dist/api/status.js +0 -6
- package/dist/api/utils/getAlert.d.ts +0 -6
- package/dist/api/utils/getAlert.js +0 -65
- package/dist/api/utils/index.js +0 -8
- package/dist/app_types.d.ts +0 -607
- package/dist/app_types.js +0 -75
- package/dist/components/ApiHostProvider.d.ts +0 -7
- package/dist/components/ApiHostProvider.js +0 -35
- package/dist/components/StatusTag.d.ts +0 -11
- package/dist/components/StatusTag.js +0 -86
- package/dist/components/Table/DataTableWrapper.d.ts +0 -3
- package/dist/components/Table/DataTableWrapper.js +0 -44
- package/dist/components/Table/FloatingActions.d.ts +0 -14
- package/dist/components/Table/FloatingActions.js +0 -32
- package/dist/components/Table/Spinner.d.ts +0 -2
- package/dist/components/Table/Spinner.js +0 -26
- package/dist/components/Table/Summary.js +0 -16
- package/dist/components/Table/Table.d.ts +0 -28
- package/dist/components/Table/Table.js +0 -330
- package/dist/components/Table/addIndexToObject.d.ts +0 -3
- package/dist/components/Table/addIndexToObject.js +0 -17
- package/dist/components/Table/areProvidedColumnsDifferent.d.ts +0 -2
- package/dist/components/Table/areProvidedColumnsDifferent.js +0 -16
- package/dist/components/Table/clicked.js +0 -11
- package/dist/components/Table/displayActions.js +0 -11
- package/dist/components/Table/hooks/useFetchPage.d.ts +0 -18
- package/dist/components/Table/hooks/useFetchPage.js +0 -123
- package/dist/components/Table/hooks/useGetCellRenderer.d.ts +0 -18
- package/dist/components/Table/hooks/useGetCellRenderer.js +0 -166
- package/dist/components/Table/hooks/useGetColumnsWithCheckbox.d.ts +0 -5
- package/dist/components/Table/hooks/useGetColumnsWithCheckbox.js +0 -53
- package/dist/components/Table/hooks/useGetDeleteRow.d.ts +0 -9
- package/dist/components/Table/hooks/useGetDeleteRow.js +0 -74
- package/dist/components/Table/hooks/useGetResizeColumn.d.ts +0 -8
- package/dist/components/Table/hooks/useGetResizeColumn.js +0 -28
- package/dist/components/Table/hooks/useGetRowCheckbox.d.ts +0 -5
- package/dist/components/Table/hooks/useGetRowCheckbox.js +0 -54
- package/dist/components/Table/hooks/useLoadDataSource.d.ts +0 -10
- package/dist/components/Table/hooks/useLoadDataSource.js +0 -20
- package/dist/components/Table/hooks/usePageSize.d.ts +0 -5
- package/dist/components/Table/hooks/usePageSize.js +0 -16
- package/dist/components/Table/hooks/useRenderRowActions.d.ts +0 -6
- package/dist/components/Table/hooks/useRenderRowActions.js +0 -51
- package/dist/components/Table/hooks/useResizeColumns.d.ts +0 -9
- package/dist/components/Table/hooks/useResizeColumns.js +0 -60
- package/dist/components/Table/index.d.ts +0 -1
- package/dist/components/Table/index.js +0 -8
- package/dist/components/Table/providers/OrderProvider.d.ts +0 -9
- package/dist/components/Table/providers/OrderProvider.js +0 -17
- package/dist/components/Table/styles.d.ts +0 -6
- package/dist/components/Table/styles.js +0 -37
- package/dist/components/index.js +0 -26
- package/dist/config.d.ts +0 -6
- package/dist/config.js +0 -8
- package/dist/db_types.d.ts +0 -208
- package/dist/db_types.js +0 -2
- package/dist/hooks/index.js +0 -10
- package/dist/hooks/useApi.d.ts +0 -2
- package/dist/hooks/useApi.js +0 -42
- package/dist/hooks/useEndpoint.d.ts +0 -2
- package/dist/hooks/useEndpoint.js +0 -34
- package/dist/index.js +0 -19
- package/dist/lib/index.js +0 -18
- package/dist/lib/jednostka.d.ts +0 -6
- package/dist/lib/jednostkaNazwa.d.ts +0 -6
- package/dist/lib/jednostkaNazwa.js +0 -9
- package/dist/lib/typDokumentuNazwa.d.ts +0 -6
- package/dist/lib/typDokumentuNazwa.js +0 -11
- package/dist/lib/typ_dokument.d.ts +0 -0
- package/dist/lib/typ_dokumentu.d.ts +0 -6
- package/dist/lib/unit.d.ts +0 -0
- package/dist/src/api/Api.js +0 -316
- package/dist/src/api/Endpoint.js +0 -365
- package/dist/src/api/createApi.js +0 -50
- package/dist/src/api/error.js +0 -15
- package/dist/src/api/index.js +0 -5
- package/dist/src/api/status.js +0 -3
- package/dist/src/api/utils/getAlert.js +0 -63
- package/dist/src/api/utils/index.js +0 -1
- package/dist/src/app_types.js +0 -72
- package/dist/src/components/ApiHostProvider.js +0 -11
- package/dist/src/components/StatusTag.js +0 -153
- package/dist/src/components/Table/DataTableWrapper.js +0 -115
- package/dist/src/components/Table/FloatingActions.js +0 -60
- package/dist/src/components/Table/Spinner.js +0 -40
- package/dist/src/components/Table/Summary.js +0 -16
- package/dist/src/components/Table/Table.js +0 -498
- package/dist/src/components/Table/addIndexToObject.js +0 -57
- package/dist/src/components/Table/areProvidedColumnsDifferent.js +0 -19
- package/dist/src/components/Table/clicked.js +0 -12
- package/dist/src/components/Table/displayActions.js +0 -11
- package/dist/src/components/Table/hooks/useFetchPage.js +0 -254
- package/dist/src/components/Table/hooks/useGetCellRenderer.js +0 -231
- package/dist/src/components/Table/hooks/useGetColumnsWithCheckbox.js +0 -33
- package/dist/src/components/Table/hooks/useGetDeleteRow.js +0 -181
- package/dist/src/components/Table/hooks/useGetResizeColumn.js +0 -72
- package/dist/src/components/Table/hooks/useGetRowCheckbox.js +0 -55
- package/dist/src/components/Table/hooks/useLoadDataSource.js +0 -16
- package/dist/src/components/Table/hooks/usePageSize.js +0 -15
- package/dist/src/components/Table/hooks/useRenderRowActions.js +0 -50
- package/dist/src/components/Table/hooks/useResizeColumns.js +0 -70
- package/dist/src/components/Table/index.js +0 -1
- package/dist/src/components/Table/providers/OrderProvider.js +0 -65
- package/dist/src/components/Table/styles.js +0 -66
- package/dist/src/components/index.js +0 -4
- package/dist/src/config.js +0 -6
- package/dist/src/db_types.js +0 -1
- package/dist/src/hooks/index.js +0 -2
- package/dist/src/hooks/useApi.js +0 -84
- package/dist/src/hooks/useEndpoint.js +0 -60
- package/dist/src/index.js +0 -3
- package/dist/src/lib/index.js +0 -2
- package/dist/src/lib/jednostkaNazwa.js +0 -6
- package/dist/src/lib/typDokumentuNazwa.js +0 -16
- package/dist/src/utils/Query.js +0 -73
- package/dist/src/utils/getWZNumber.js +0 -4
- package/dist/src/utils/getZamowienieDokumentNumber.js +0 -4
- package/dist/utils/AlertContext.d.ts +0 -3
- package/dist/utils/AlertContext.js +0 -3
- package/dist/utils/Query.d.ts +0 -6
- package/dist/utils/Query.js +0 -33
- package/dist/utils/geNumber.d.ts +0 -2
- package/dist/utils/getDocNumber.d.ts +0 -2
- package/dist/utils/getWZNumber.js +0 -10
- package/dist/utils/getWzNumber.d.ts +0 -2
- package/dist/utils/getZamowienieDokumentNumber copy.d.ts +0 -2
- package/dist/utils/getZamowienieDokumentNumber.d.ts +0 -2
- package/dist/utils/getZamowienieDokumentNumber.js +0 -8
- package/dist/utils/index.d.ts +0 -3
- package/dist/utils/index.js +0 -12
- /package/{dist/api/utils/index.d.ts → src/api/utils/index.ts} +0 -0
- /package/{dist/components/index.d.ts → src/components/index.ts} +0 -0
- /package/{dist/hooks/index.d.ts → src/hooks/index.ts} +0 -0
- /package/{dist/index.d.ts → src/index.ts} +0 -0
- /package/{dist/lib/index.d.ts → src/lib/index.ts} +0 -0
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.default = useLoadDataSource;
|
|
7
|
-
var react_1 = require("react");
|
|
8
|
-
var addIndexToObject_1 = __importDefault(require("../addIndexToObject"));
|
|
9
|
-
function useLoadDataSource(_a) {
|
|
10
|
-
var filters = _a.filters, added = _a.added, data = _a.data, dataSource = _a.dataSource, setData = _a.setData, fetchPage = _a.fetchPage, pageSize = _a.pageSize, loadPage = _a.loadPage;
|
|
11
|
-
(0, react_1.useEffect)(function () {
|
|
12
|
-
if (dataSource !== undefined &&
|
|
13
|
-
JSON.stringify(data) !== JSON.stringify(dataSource.map(addIndexToObject_1.default))) {
|
|
14
|
-
setData(dataSource.map(addIndexToObject_1.default));
|
|
15
|
-
}
|
|
16
|
-
else if (loadPage !== undefined) {
|
|
17
|
-
fetchPage(0, pageSize() * 2);
|
|
18
|
-
}
|
|
19
|
-
}, [filters, added, dataSource]);
|
|
20
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.usePageSize = usePageSize;
|
|
4
|
-
var react_1 = require("react");
|
|
5
|
-
var Table_1 = require("../Table");
|
|
6
|
-
function usePageSize(_a) {
|
|
7
|
-
var mainRef = _a.mainRef, rowSize = _a.rowSize;
|
|
8
|
-
return (0, react_1.useCallback)(function () {
|
|
9
|
-
var _a;
|
|
10
|
-
var maxSpace = Math.ceil((((_a = mainRef.current) === null || _a === void 0 ? void 0 : _a.offsetHeight) || 0 - Table_1.MARGIN_FOR_SPINNER) / rowSize);
|
|
11
|
-
if (mainRef.current && maxSpace >= 0) {
|
|
12
|
-
return maxSpace;
|
|
13
|
-
}
|
|
14
|
-
return 2;
|
|
15
|
-
}, [mainRef]);
|
|
16
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
-
if (k2 === undefined) k2 = k;
|
|
8
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
-
}
|
|
12
|
-
Object.defineProperty(o, k2, desc);
|
|
13
|
-
}) : (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
o[k2] = m[k];
|
|
16
|
-
}));
|
|
17
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
-
}) : function(o, v) {
|
|
20
|
-
o["default"] = v;
|
|
21
|
-
});
|
|
22
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
-
if (mod && mod.__esModule) return mod;
|
|
24
|
-
var result = {};
|
|
25
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
-
__setModuleDefault(result, mod);
|
|
27
|
-
return result;
|
|
28
|
-
};
|
|
29
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
30
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
31
|
-
};
|
|
32
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.default = useRenderRowActions;
|
|
34
|
-
var antd_1 = require("antd");
|
|
35
|
-
var react_1 = __importStar(require("react"));
|
|
36
|
-
var icons_1 = require("@ant-design/icons");
|
|
37
|
-
var styled_components_1 = __importDefault(require("styled-components"));
|
|
38
|
-
var Action = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n span {\n svg {\n transition: 150ms ease-in-out;\n font-size: 16px;\n }\n\n img {\n width: 16px;\n height: 16px;\n }\n }\n"], ["\n span {\n svg {\n transition: 150ms ease-in-out;\n font-size: 16px;\n }\n\n img {\n width: 16px;\n height: 16px;\n }\n }\n"])));
|
|
39
|
-
function useRenderRowActions(_a) {
|
|
40
|
-
var data = _a.data, actions = _a.actions, deleteRow = _a.deleteRow;
|
|
41
|
-
return (0, react_1.useCallback)(function (v, row, rowIndex) {
|
|
42
|
-
var _a;
|
|
43
|
-
if (!data)
|
|
44
|
-
return null;
|
|
45
|
-
return (react_1.default.createElement(antd_1.Space, { size: 28 }, (_a = actions.buttons) === null || _a === void 0 ? void 0 :
|
|
46
|
-
_a.map(function (e, i) { return (react_1.default.createElement(Action, { key: i, className: "action" }, e(data[rowIndex - 1]))); }),
|
|
47
|
-
actions.delete ? (react_1.default.createElement(Action, { className: "action" },
|
|
48
|
-
react_1.default.createElement(icons_1.DeleteTwoTone, { onClick: function () { return deleteRow(data[rowIndex - 1]); }, twoToneColor: "#F5222D" }))) : undefined));
|
|
49
|
-
}, [data, actions, deleteRow]);
|
|
50
|
-
}
|
|
51
|
-
var templateObject_1;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export default function useResizeColumns({ providedColumns, columns, main, floatingActions, actions, setColumns, grid, }: {
|
|
2
|
-
providedColumns: any;
|
|
3
|
-
columns: any;
|
|
4
|
-
main: any;
|
|
5
|
-
floatingActions: any;
|
|
6
|
-
actions: any;
|
|
7
|
-
setColumns: any;
|
|
8
|
-
grid: any;
|
|
9
|
-
}): () => void;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
-
if (ar || !(i in from)) {
|
|
5
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
-
ar[i] = from[i];
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.default = useResizeColumns;
|
|
16
|
-
var react_1 = require("react");
|
|
17
|
-
var areProvidedColumnsDifferent_1 = __importDefault(require("../areProvidedColumnsDifferent"));
|
|
18
|
-
var SCROLLBAR_WIDTH = 16;
|
|
19
|
-
function useResizeColumns(_a) {
|
|
20
|
-
var providedColumns = _a.providedColumns, columns = _a.columns, main = _a.main, floatingActions = _a.floatingActions, actions = _a.actions, setColumns = _a.setColumns, grid = _a.grid;
|
|
21
|
-
return (0, react_1.useCallback)(function () {
|
|
22
|
-
var _a, _b;
|
|
23
|
-
if ((0, areProvidedColumnsDifferent_1.default)(providedColumns, columns)) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
var sum = columns.map(function (e) { return e.width; }).reduce(function (a, b) { return a + b; }, 0);
|
|
27
|
-
var restSum = columns
|
|
28
|
-
.slice(0, columns.length - 1)
|
|
29
|
-
.map(function (e) { return e.width; })
|
|
30
|
-
.reduce(function (a, b) { return a + b; }, 0);
|
|
31
|
-
var space = ((_a = main.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) - SCROLLBAR_WIDTH;
|
|
32
|
-
if (sum < space ||
|
|
33
|
-
(columns[columns.length - 1].modified &&
|
|
34
|
-
columns[columns.length - 1].width !== space - restSum)) {
|
|
35
|
-
if (!floatingActions &&
|
|
36
|
-
actions &&
|
|
37
|
-
columns[columns.length - 1].key !== 'akcje') {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
var updatedColumns = __spreadArray([], columns, true);
|
|
41
|
-
if (updatedColumns[columns.length - 1]) {
|
|
42
|
-
updatedColumns[columns.length - 1].width = space - restSum;
|
|
43
|
-
updatedColumns[columns.length - 1].modified = true;
|
|
44
|
-
setColumns(updatedColumns);
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
console.error('updating non-existent column');
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
(_b = grid.current) === null || _b === void 0 ? void 0 : _b.recomputeGridSize();
|
|
51
|
-
}, [
|
|
52
|
-
providedColumns,
|
|
53
|
-
setColumns,
|
|
54
|
-
columns,
|
|
55
|
-
main,
|
|
56
|
-
floatingActions,
|
|
57
|
-
actions,
|
|
58
|
-
grid,
|
|
59
|
-
]);
|
|
60
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './Table';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var Table_1 = require("./Table");
|
|
8
|
-
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(Table_1).default; } });
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Order } from '../../../app_types';
|
|
3
|
-
export declare const useOrder: () => {
|
|
4
|
-
order?: Order;
|
|
5
|
-
setOrder: (order: Order) => void;
|
|
6
|
-
};
|
|
7
|
-
export declare const OrderProvider: ({ children }: {
|
|
8
|
-
children: any;
|
|
9
|
-
}) => React.JSX.Element;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.OrderProvider = exports.useOrder = void 0;
|
|
7
|
-
var react_1 = __importDefault(require("react"));
|
|
8
|
-
var react_2 = require("react");
|
|
9
|
-
var OrderContext = (0, react_2.createContext)({ order: undefined, setOrder: function () { } });
|
|
10
|
-
var useOrder = function () { return (0, react_2.useContext)(OrderContext); };
|
|
11
|
-
exports.useOrder = useOrder;
|
|
12
|
-
var OrderProvider = function (_a) {
|
|
13
|
-
var children = _a.children;
|
|
14
|
-
var _b = (0, react_2.useState)(), order = _b[0], setOrder = _b[1];
|
|
15
|
-
return (react_1.default.createElement(OrderContext.Provider, { value: { order: order, setOrder: setOrder } }, children));
|
|
16
|
-
};
|
|
17
|
-
exports.OrderProvider = OrderProvider;
|
|
@@ -1,6 +0,0 @@
|
|
|
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;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
-
if (k2 === undefined) k2 = k;
|
|
8
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
-
}
|
|
12
|
-
Object.defineProperty(o, k2, desc);
|
|
13
|
-
}) : (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
o[k2] = m[k];
|
|
16
|
-
}));
|
|
17
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
-
}) : function(o, v) {
|
|
20
|
-
o["default"] = v;
|
|
21
|
-
});
|
|
22
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
-
if (mod && mod.__esModule) return mod;
|
|
24
|
-
var result = {};
|
|
25
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
-
__setModuleDefault(result, mod);
|
|
27
|
-
return result;
|
|
28
|
-
};
|
|
29
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.TableData = exports.TableHeader = exports.StyledTable = exports.DataTable = void 0;
|
|
31
|
-
var styled_components_1 = __importStar(require("styled-components"));
|
|
32
|
-
exports.DataTable = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n width: 100%;\n flex: 1;\n\n & > div {\n width: 100%;\n margin-top: 16px;\n }\n & .data-table-no-data {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n color: #262626;\n }\n & .resized {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n display: block;\n }\n & .DragHandle {\n flex: 0 0 16px;\n z-index: 2;\n cursor: col-resize;\n color: #1890ff;\n right: 0;\n position: absolute;\n }\n & .DragHandle:hover {\n background-color: rgba(0, 0, 0, 0.1);\n }\n & .DragHandleActive,\n & .DragHandleActive:hover {\n color: #1890ff;\n z-index: 3;\n }\n & .DragHandleIcon {\n flex: 0 0 12px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n }\n\n .data-table-wrapper .table .td.table-actions div .action span {\n padding: 6px;\n border-radius: 100px;\n transition: 150ms ease-in-out;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n .data-table-wrapper .table .td.table-actions div .action span:hover {\n cursor: pointer;\n background: rgba(0, 0, 0, 0.1);\n }\n & .table .td p {\n margin: 0;\n }\n & .table .td .ant-tag {\n line-height: 16.5px;\n }\n & .spinner-wrapper {\n position: absolute;\n bottom: -34px;\n left: 50%;\n }\n & .ant-spin {\n display: flex;\n justify-content: center;\n margin: 15px 0;\n }\n"], ["\n position: relative;\n width: 100%;\n flex: 1;\n\n & > div {\n width: 100%;\n margin-top: 16px;\n }\n & .data-table-no-data {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n color: #262626;\n }\n & .resized {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n display: block;\n }\n & .DragHandle {\n flex: 0 0 16px;\n z-index: 2;\n cursor: col-resize;\n color: #1890ff;\n right: 0;\n position: absolute;\n }\n & .DragHandle:hover {\n background-color: rgba(0, 0, 0, 0.1);\n }\n & .DragHandleActive,\n & .DragHandleActive:hover {\n color: #1890ff;\n z-index: 3;\n }\n & .DragHandleIcon {\n flex: 0 0 12px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n }\n\n .data-table-wrapper .table .td.table-actions div .action span {\n padding: 6px;\n border-radius: 100px;\n transition: 150ms ease-in-out;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n .data-table-wrapper .table .td.table-actions div .action span:hover {\n cursor: pointer;\n background: rgba(0, 0, 0, 0.1);\n }\n & .table .td p {\n margin: 0;\n }\n & .table .td .ant-tag {\n line-height: 16.5px;\n }\n & .spinner-wrapper {\n position: absolute;\n bottom: -34px;\n left: 50%;\n }\n & .ant-spin {\n display: flex;\n justify-content: center;\n margin: 15px 0;\n }\n"])));
|
|
33
|
-
exports.StyledTable = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 100%;\n min-height: fit-content;\n background: #f5f5f5;\n\n &:focus {\n border: none;\n outline: none;\n }\n\n &:hover:not(.selected):not(:first-child):not(.summary) {\n background: #d5f0ff !important;\n }\n\n .td-light {\n background-color: white;\n }\n\n .header {\n background: #e8e8e8;\n }\n :not(:first-child) {\n height: 39px;\n }\n :nth-child(2n) {\n background: #fff;\n }\n .selected > td {\n background: #bae7ff;\n }\n .selectable:hover {\n cursor: pointer;\n }\n .summary {\n border-bottom: none;\n }\n .summary .td {\n color: #000;\n font-weight: 600;\n }\n .summary .td:not(.orphan) {\n border-bottom: 1px solid #e8e8e8;\n }\n"], ["\n width: 100%;\n min-height: fit-content;\n background: #f5f5f5;\n\n &:focus {\n border: none;\n outline: none;\n }\n\n &:hover:not(.selected):not(:first-child):not(.summary) {\n background: #d5f0ff !important;\n }\n\n .td-light {\n background-color: white;\n }\n\n .header {\n background: #e8e8e8;\n }\n :not(:first-child) {\n height: 39px;\n }\n :nth-child(2n) {\n background: #fff;\n }\n .selected > td {\n background: #bae7ff;\n }\n .selectable:hover {\n cursor: pointer;\n }\n .summary {\n border-bottom: none;\n }\n .summary .td {\n color: #000;\n font-weight: 600;\n }\n .summary .td:not(.orphan) {\n border-bottom: 1px solid #e8e8e8;\n }\n"])));
|
|
34
|
-
var tableData = (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n color: #000;\n line-height: 24px;\n font-size: 14px;\n padding: 0 8px;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n\n &.checkbox-cell {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n &.table-actions {\n padding-top: 0;\n padding-bottom: 0;\n }\n &.table-actions div {\n height: 100%;\n display: flex;\n align-items: center;\n }\n &.table-actions div .action {\n height: 24px;\n width: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n"], ["\n color: #000;\n line-height: 24px;\n font-size: 14px;\n padding: 0 8px;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n\n &.checkbox-cell {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n &.table-actions {\n padding-top: 0;\n padding-bottom: 0;\n }\n &.table-actions div {\n height: 100%;\n display: flex;\n align-items: center;\n }\n &.table-actions div .action {\n height: 24px;\n width: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n"])));
|
|
35
|
-
exports.TableHeader = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", ";\n border: none;\n position: sticky;\n top: 0;\n z-index: 1;\n background: #e8e8e8;\n display: flex;\n align-items: center;\n background: #e8e8e8;\n color: #262626;\n padding: 0 5px 0 0;\n font-weight: 600;\n font-size: 16px;\n height: 55px;\n\n &:hover {\n cursor: pointer;\n }\n\n & > div {\n text-overflow: ellipsis;\n overflow: hidden;\n }\n &:not(:first-child) {\n border-left: 1px solid #fff;\n }\n & > span {\n padding: 15px 6px 15px 11px;\n width: 100%;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n & > span:hover,\n &.table-actions:hover {\n cursor: initial;\n }\n &.checkbox-header {\n align-items: center;\n justify-content: center;\n padding: 0;\n }\n"], ["\n ", ";\n border: none;\n position: sticky;\n top: 0;\n z-index: 1;\n background: #e8e8e8;\n display: flex;\n align-items: center;\n background: #e8e8e8;\n color: #262626;\n padding: 0 5px 0 0;\n font-weight: 600;\n font-size: 16px;\n height: 55px;\n\n &:hover {\n cursor: pointer;\n }\n\n & > div {\n text-overflow: ellipsis;\n overflow: hidden;\n }\n &:not(:first-child) {\n border-left: 1px solid #fff;\n }\n & > span {\n padding: 15px 6px 15px 11px;\n width: 100%;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n & > span:hover,\n &.table-actions:hover {\n cursor: initial;\n }\n &.checkbox-header {\n align-items: center;\n justify-content: center;\n padding: 0;\n }\n"])), tableData);
|
|
36
|
-
exports.TableData = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n ", "\n ", "\n"], ["\n ", "\n ", "\n"])), tableData, function (p) { return (p.$align ? 'text-align: ' + p.$align + ';' : ''); });
|
|
37
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
package/dist/components/index.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
-
};
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.StatusTag = exports.Table = void 0;
|
|
21
|
-
__exportStar(require("./ApiHostProvider"), exports);
|
|
22
|
-
__exportStar(require("./Table"), exports);
|
|
23
|
-
var Table_1 = require("./Table");
|
|
24
|
-
Object.defineProperty(exports, "Table", { enumerable: true, get: function () { return __importDefault(Table_1).default; } });
|
|
25
|
-
var StatusTag_1 = require("./StatusTag");
|
|
26
|
-
Object.defineProperty(exports, "StatusTag", { enumerable: true, get: function () { return __importDefault(StatusTag_1).default; } });
|
package/dist/config.d.ts
DELETED
package/dist/config.js
DELETED
package/dist/db_types.d.ts
DELETED
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
import { DokumentTyp, DokumentTypDowolny, FormaPlatnosci, TypDokumentu, TypWplaty } from './app_types';
|
|
2
|
-
export interface BufferAttributes {
|
|
3
|
-
id: number;
|
|
4
|
-
date_buffer: Date;
|
|
5
|
-
date_completion: Date;
|
|
6
|
-
buffer_type: string;
|
|
7
|
-
buffer_method: string;
|
|
8
|
-
buffer_status: string;
|
|
9
|
-
foreign_number: string;
|
|
10
|
-
pieces: number;
|
|
11
|
-
meters: number;
|
|
12
|
-
sq_meters: number;
|
|
13
|
-
value: number;
|
|
14
|
-
file_path: string;
|
|
15
|
-
comments: string;
|
|
16
|
-
}
|
|
17
|
-
export interface KlientAttributes {
|
|
18
|
-
id_klient: number;
|
|
19
|
-
nazwa_skrocona: string;
|
|
20
|
-
nazwa1: string;
|
|
21
|
-
nazwa2: string;
|
|
22
|
-
nazwa3: string;
|
|
23
|
-
kraj: string;
|
|
24
|
-
miasto: string;
|
|
25
|
-
wojewodztwo: string;
|
|
26
|
-
ulica: string;
|
|
27
|
-
numer_domu: string;
|
|
28
|
-
numer_lokalu: string;
|
|
29
|
-
ulica_txt: string;
|
|
30
|
-
kod: string;
|
|
31
|
-
poczta: string;
|
|
32
|
-
nip_kraj: string;
|
|
33
|
-
nip: string;
|
|
34
|
-
vip: boolean;
|
|
35
|
-
platnik_vat: boolean;
|
|
36
|
-
regon: string;
|
|
37
|
-
pesel: string;
|
|
38
|
-
telefon1: string;
|
|
39
|
-
telefon2: string;
|
|
40
|
-
fax: string;
|
|
41
|
-
email: string;
|
|
42
|
-
www: string;
|
|
43
|
-
uwagi: string;
|
|
44
|
-
frontman: boolean;
|
|
45
|
-
frontman_login: string;
|
|
46
|
-
frontman_haslo: string;
|
|
47
|
-
frontman_data_login: Date | number;
|
|
48
|
-
frontman_data_logout: Date | number;
|
|
49
|
-
portal: boolean;
|
|
50
|
-
portal_login: string;
|
|
51
|
-
portal_haslo: string;
|
|
52
|
-
}
|
|
53
|
-
export interface UzytkownikAttributes {
|
|
54
|
-
id_uzytkownik: number;
|
|
55
|
-
login: string;
|
|
56
|
-
haslo: string;
|
|
57
|
-
imie?: string;
|
|
58
|
-
nazwisko?: string;
|
|
59
|
-
inicjaly?: string;
|
|
60
|
-
data_login?: Date | number;
|
|
61
|
-
data_logout?: Date | number;
|
|
62
|
-
czas_dodanie: Date;
|
|
63
|
-
czas_edycja?: Date;
|
|
64
|
-
}
|
|
65
|
-
export interface WplataAttributes {
|
|
66
|
-
id_wplata: number;
|
|
67
|
-
data_wplaty: Date;
|
|
68
|
-
typ_wplaty: TypWplaty;
|
|
69
|
-
numer_idx: number;
|
|
70
|
-
numer: number;
|
|
71
|
-
kwota_wplaty: number;
|
|
72
|
-
uwagi: string;
|
|
73
|
-
rozliczono: number;
|
|
74
|
-
id_klient?: number;
|
|
75
|
-
id_zamowienie_dokument?: number;
|
|
76
|
-
id_uzytkownik_dodanie?: number;
|
|
77
|
-
}
|
|
78
|
-
export interface ZamowienieDokumentAttributes {
|
|
79
|
-
id_zamowienie_dokument: number;
|
|
80
|
-
data_sprzedazy: Date;
|
|
81
|
-
data_wystawienia: Date;
|
|
82
|
-
data_platnosci: Date;
|
|
83
|
-
typ_dokumentu: TypDokumentu;
|
|
84
|
-
numer: number;
|
|
85
|
-
numer_idx: number;
|
|
86
|
-
forma_platnosci: FormaPlatnosci;
|
|
87
|
-
wartosc: number;
|
|
88
|
-
netto: number;
|
|
89
|
-
nazwa_skrocona: string;
|
|
90
|
-
nazwa1: string;
|
|
91
|
-
nazwa2: string;
|
|
92
|
-
nazwa3: string;
|
|
93
|
-
kraj: string;
|
|
94
|
-
miasto: string;
|
|
95
|
-
ulica: string;
|
|
96
|
-
numer_domu: string;
|
|
97
|
-
numer_lokalu: string;
|
|
98
|
-
ulica_txt: string;
|
|
99
|
-
kod: string;
|
|
100
|
-
nip_kraj: string;
|
|
101
|
-
nip: string;
|
|
102
|
-
id_klient?: number;
|
|
103
|
-
id_klient_nabywca?: number;
|
|
104
|
-
id_zamowienie_dokument_parent?: number;
|
|
105
|
-
id_zamowienie?: number;
|
|
106
|
-
id_uzytkownik_dodanie?: number;
|
|
107
|
-
czas_edycja?: Date;
|
|
108
|
-
}
|
|
109
|
-
export interface ZamowienieElementAttributes {
|
|
110
|
-
id_zamowienie_element: number;
|
|
111
|
-
zrodlo: string;
|
|
112
|
-
nazwa: string;
|
|
113
|
-
towar_kategoria: string;
|
|
114
|
-
sztuk: number;
|
|
115
|
-
metry: string;
|
|
116
|
-
metry_kw: string;
|
|
117
|
-
jednostka: number;
|
|
118
|
-
cena_jednostka: string;
|
|
119
|
-
cena: string;
|
|
120
|
-
podatek: number;
|
|
121
|
-
rabat_cena: number;
|
|
122
|
-
rabat_prefix: string;
|
|
123
|
-
rabat_sufix: string;
|
|
124
|
-
etykieta: boolean;
|
|
125
|
-
id_atrybut_konfig_grupa?: number;
|
|
126
|
-
id_zamowienie_element_parent?: number;
|
|
127
|
-
id_zamowienie?: number;
|
|
128
|
-
czas_dodanie?: Date;
|
|
129
|
-
czas_edycja?: Date;
|
|
130
|
-
}
|
|
131
|
-
export interface ZamowienieElementAtrybutAttributes {
|
|
132
|
-
id_zamowienie_element_atrybut: number;
|
|
133
|
-
cecha: string;
|
|
134
|
-
cecha_typ: string;
|
|
135
|
-
wartosc_opis: string;
|
|
136
|
-
wartosc: string;
|
|
137
|
-
wartosc_rownanie: number;
|
|
138
|
-
narzut_cena: number;
|
|
139
|
-
narzut_prefix: string;
|
|
140
|
-
narzut_sufix: string;
|
|
141
|
-
nazwa_zasob: string;
|
|
142
|
-
predef: boolean;
|
|
143
|
-
czas_dodanie?: Date;
|
|
144
|
-
czas_edycja?: Date;
|
|
145
|
-
}
|
|
146
|
-
export interface AtrybutKonfigGrupaAttributes {
|
|
147
|
-
id_atrybut_konfig_grupa: number;
|
|
148
|
-
data_utworzenia: Date;
|
|
149
|
-
data_zamkniecia: Date;
|
|
150
|
-
}
|
|
151
|
-
export interface ZamowienieAttributes {
|
|
152
|
-
id_zamowienie: number;
|
|
153
|
-
data_przyjecia: Date;
|
|
154
|
-
data_realizacji: Date;
|
|
155
|
-
data_status: Date;
|
|
156
|
-
zamowienie_status: string;
|
|
157
|
-
zamowienie_typ: string;
|
|
158
|
-
zamowienie_metoda: string;
|
|
159
|
-
numer: number;
|
|
160
|
-
numer_idx: number;
|
|
161
|
-
numer_obcy: string;
|
|
162
|
-
sztuk: number;
|
|
163
|
-
metry: number;
|
|
164
|
-
metry_kw: number;
|
|
165
|
-
wartosc: number;
|
|
166
|
-
paczki: number;
|
|
167
|
-
plik_sciezka: string;
|
|
168
|
-
uwagi: string;
|
|
169
|
-
portal_archiwum: boolean;
|
|
170
|
-
numer_konsumenta: string;
|
|
171
|
-
numer_txt: string;
|
|
172
|
-
id_klient?: number;
|
|
173
|
-
id_zamowienie_wydanie?: number;
|
|
174
|
-
id_zamowienie_dokument?: number;
|
|
175
|
-
}
|
|
176
|
-
export interface ZamowienieDokumentElementAttributes {
|
|
177
|
-
id_zamowienie_dokument_element: number;
|
|
178
|
-
korekta: boolean;
|
|
179
|
-
nazwa: string;
|
|
180
|
-
jednostka: number;
|
|
181
|
-
cena_jednostka: number;
|
|
182
|
-
cena_jednostka_netto: number;
|
|
183
|
-
podatek: number;
|
|
184
|
-
ilosc: number;
|
|
185
|
-
wartosc: number;
|
|
186
|
-
netto: number;
|
|
187
|
-
czas_dodanie: string;
|
|
188
|
-
czas_edycja: string;
|
|
189
|
-
id_zamowienie_dokument?: number;
|
|
190
|
-
id_uzytkownik?: number;
|
|
191
|
-
}
|
|
192
|
-
export interface ZamowienieDokumentMagazynAttributes {
|
|
193
|
-
id_zamowienie_dokument_magazyn: number;
|
|
194
|
-
data_wystawienia: Date;
|
|
195
|
-
dokument_typ: DokumentTyp | DokumentTypDowolny;
|
|
196
|
-
numer: number;
|
|
197
|
-
numer_idx: number;
|
|
198
|
-
id_zamowienie?: number;
|
|
199
|
-
id_zamowienie_dokument?: number;
|
|
200
|
-
id_uzytkownik_dodanie?: number;
|
|
201
|
-
id_uzytkownik_edycja?: number;
|
|
202
|
-
}
|
|
203
|
-
export interface ZaliczkaRozliczenieAttributes {
|
|
204
|
-
id_zaliczka_rozliczenie: number;
|
|
205
|
-
kwota_rozliczenia: number;
|
|
206
|
-
id_zamowienie_dokument?: number;
|
|
207
|
-
id_wplata?: number;
|
|
208
|
-
}
|
package/dist/db_types.js
DELETED
package/dist/hooks/index.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.useApi = exports.useEndpoint = void 0;
|
|
7
|
-
var useEndpoint_1 = require("./useEndpoint");
|
|
8
|
-
Object.defineProperty(exports, "useEndpoint", { enumerable: true, get: function () { return __importDefault(useEndpoint_1).default; } });
|
|
9
|
-
var useApi_1 = require("./useApi");
|
|
10
|
-
Object.defineProperty(exports, "useApi", { enumerable: true, get: function () { return __importDefault(useApi_1).default; } });
|
package/dist/hooks/useApi.d.ts
DELETED
package/dist/hooks/useApi.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.default = useApi;
|
|
7
|
-
var react_1 = require("react");
|
|
8
|
-
var createApi_1 = require("../api/createApi");
|
|
9
|
-
var Endpoint_1 = __importDefault(require("../api/Endpoint"));
|
|
10
|
-
var components_1 = require("../components");
|
|
11
|
-
function useApi(onUnauthorized) {
|
|
12
|
-
if (onUnauthorized === void 0) { onUnauthorized = function () { }; }
|
|
13
|
-
var host = (0, components_1.useApiHost)();
|
|
14
|
-
var api = (0, react_1.useMemo)(function () {
|
|
15
|
-
return Object.fromEntries(Object.entries((0, createApi_1.createApi)(host)).map(function (_a) {
|
|
16
|
-
var key = _a[0], endpoint = _a[1].endpoint;
|
|
17
|
-
return [
|
|
18
|
-
key,
|
|
19
|
-
new Endpoint_1.default(endpoint, host, errorCallback),
|
|
20
|
-
];
|
|
21
|
-
}));
|
|
22
|
-
}, []);
|
|
23
|
-
var errorCallback = (0, react_1.useCallback)(function (e) {
|
|
24
|
-
var error;
|
|
25
|
-
try {
|
|
26
|
-
error = JSON.parse(e.message);
|
|
27
|
-
}
|
|
28
|
-
catch (syntaxError) {
|
|
29
|
-
error = { statusText: e.message };
|
|
30
|
-
}
|
|
31
|
-
if (error.status === 401) {
|
|
32
|
-
onUnauthorized();
|
|
33
|
-
}
|
|
34
|
-
if (error.status === 400) {
|
|
35
|
-
throw Error("".concat(error.statusText, ": ").concat(error.text));
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
throw Error(error.statusText);
|
|
39
|
-
}
|
|
40
|
-
}, [onUnauthorized]);
|
|
41
|
-
return api;
|
|
42
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = useEndpoint;
|
|
4
|
-
var react_1 = require("react");
|
|
5
|
-
var createApi_1 = require("../api/createApi");
|
|
6
|
-
var components_1 = require("../components");
|
|
7
|
-
function useEndpoint(path, onError) {
|
|
8
|
-
if (onError === void 0) { onError = function () { }; }
|
|
9
|
-
var host = (0, components_1.useApiHost)();
|
|
10
|
-
var handleErrors = (0, react_1.useCallback)(function (func) {
|
|
11
|
-
return function () {
|
|
12
|
-
var args = [];
|
|
13
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
14
|
-
args[_i] = arguments[_i];
|
|
15
|
-
}
|
|
16
|
-
try {
|
|
17
|
-
func.apply(void 0, args);
|
|
18
|
-
}
|
|
19
|
-
catch (e) {
|
|
20
|
-
var error = JSON.parse(e.message);
|
|
21
|
-
onError(error);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
}, [onError]);
|
|
25
|
-
var endpoint = (0, react_1.useMemo)(function () {
|
|
26
|
-
var endpoint = (0, createApi_1.createApi)(host)[path];
|
|
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
|
-
return endpoint;
|
|
34
|
-
}
|
package/dist/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./api"), exports);
|
|
18
|
-
__exportStar(require("./components"), exports);
|
|
19
|
-
__exportStar(require("./lib"), exports);
|