@ercioko/meblotex-api 0.1.0
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/LICENSE +21 -0
- package/dist/api/Api.d.ts +31 -0
- package/dist/api/Api.js +167 -0
- package/dist/api/Endpoint.d.ts +13 -0
- package/dist/api/Endpoint.js +125 -0
- package/dist/api/createApi.d.ts +52 -0
- package/dist/api/createApi.js +81 -0
- package/dist/api/error.d.ts +15 -0
- package/dist/api/error.js +18 -0
- package/dist/api/index.d.ts +50 -0
- package/dist/api/index.js +37 -0
- package/dist/api/status.d.ts +3 -0
- package/dist/api/status.js +6 -0
- package/dist/api/utils/getAlert.d.ts +6 -0
- package/dist/api/utils/getAlert.js +65 -0
- package/dist/api/utils/index.d.ts +1 -0
- package/dist/api/utils/index.js +8 -0
- package/dist/app_types.d.ts +608 -0
- package/dist/app_types.js +75 -0
- package/dist/components/StatusTag.d.ts +11 -0
- package/dist/components/StatusTag.js +86 -0
- package/dist/components/Table/DataTableWrapper.d.ts +2 -0
- package/dist/components/Table/DataTableWrapper.js +44 -0
- package/dist/components/Table/FloatingActions.d.ts +15 -0
- package/dist/components/Table/FloatingActions.js +32 -0
- package/dist/components/Table/Spinner.d.ts +2 -0
- package/dist/components/Table/Spinner.js +26 -0
- package/dist/components/Table/Summary.js +16 -0
- package/dist/components/Table/Table.d.ts +28 -0
- package/dist/components/Table/Table.js +330 -0
- package/dist/components/Table/addIndexToObject.d.ts +3 -0
- package/dist/components/Table/addIndexToObject.js +17 -0
- package/dist/components/Table/areProvidedColumnsDifferent.d.ts +2 -0
- package/dist/components/Table/areProvidedColumnsDifferent.js +16 -0
- package/dist/components/Table/clicked.js +11 -0
- package/dist/components/Table/displayActions.js +11 -0
- package/dist/components/Table/hooks/useFetchPage.d.ts +18 -0
- package/dist/components/Table/hooks/useFetchPage.js +123 -0
- package/dist/components/Table/hooks/useGetCellRenderer.d.ts +18 -0
- package/dist/components/Table/hooks/useGetCellRenderer.js +166 -0
- package/dist/components/Table/hooks/useGetColumnsWithCheckbox.d.ts +5 -0
- package/dist/components/Table/hooks/useGetColumnsWithCheckbox.js +53 -0
- package/dist/components/Table/hooks/useGetDeleteRow.d.ts +9 -0
- package/dist/components/Table/hooks/useGetDeleteRow.js +74 -0
- package/dist/components/Table/hooks/useGetResizeColumn.d.ts +9 -0
- package/dist/components/Table/hooks/useGetResizeColumn.js +28 -0
- package/dist/components/Table/hooks/useGetRowCheckbox.d.ts +5 -0
- package/dist/components/Table/hooks/useGetRowCheckbox.js +54 -0
- package/dist/components/Table/hooks/useLoadDataSource.d.ts +10 -0
- package/dist/components/Table/hooks/useLoadDataSource.js +20 -0
- package/dist/components/Table/hooks/usePageSize.d.ts +5 -0
- package/dist/components/Table/hooks/usePageSize.js +17 -0
- package/dist/components/Table/hooks/useRenderRowActions.d.ts +6 -0
- package/dist/components/Table/hooks/useRenderRowActions.js +51 -0
- package/dist/components/Table/hooks/useResizeColumns.d.ts +9 -0
- package/dist/components/Table/hooks/useResizeColumns.js +60 -0
- package/dist/components/Table/index.d.ts +1 -0
- package/dist/components/Table/index.js +8 -0
- package/dist/components/Table/providers/OrderProvider.d.ts +9 -0
- package/dist/components/Table/providers/OrderProvider.js +17 -0
- package/dist/components/Table/styles.d.ts +6 -0
- package/dist/components/Table/styles.js +37 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +25 -0
- package/dist/config.d.ts +9 -0
- package/dist/config.js +12 -0
- package/dist/db_types.d.ts +208 -0
- package/dist/db_types.js +2 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +10 -0
- package/dist/hooks/useApi.d.ts +2 -0
- package/dist/hooks/useApi.js +40 -0
- package/dist/hooks/useEndpoint.d.ts +2 -0
- package/dist/hooks/useEndpoint.js +32 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +25 -0
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/index.js +18 -0
- package/dist/lib/jednostka.d.ts +6 -0
- package/dist/lib/jednostkaNazwa.d.ts +6 -0
- package/dist/lib/jednostkaNazwa.js +9 -0
- package/dist/lib/typDokumentuNazwa.d.ts +6 -0
- package/dist/lib/typDokumentuNazwa.js +11 -0
- package/dist/lib/typ_dokument.d.ts +0 -0
- package/dist/lib/typ_dokumentu.d.ts +6 -0
- package/dist/lib/unit.d.ts +0 -0
- package/dist/src/api/Api.js +313 -0
- package/dist/src/api/Endpoint.js +364 -0
- package/dist/src/api/createApi.js +50 -0
- package/dist/src/api/error.js +15 -0
- package/dist/src/api/index.js +8 -0
- package/dist/src/api/status.js +3 -0
- package/dist/src/api/utils/getAlert.js +63 -0
- package/dist/src/api/utils/index.js +1 -0
- package/dist/src/app_types.js +72 -0
- package/dist/src/components/StatusTag.js +153 -0
- package/dist/src/components/Table/DataTableWrapper.js +115 -0
- package/dist/src/components/Table/FloatingActions.js +60 -0
- package/dist/src/components/Table/Spinner.js +40 -0
- package/dist/src/components/Table/Summary.js +16 -0
- package/dist/src/components/Table/Table.js +498 -0
- package/dist/src/components/Table/addIndexToObject.js +57 -0
- package/dist/src/components/Table/areProvidedColumnsDifferent.js +19 -0
- package/dist/src/components/Table/clicked.js +12 -0
- package/dist/src/components/Table/displayActions.js +11 -0
- package/dist/src/components/Table/hooks/useFetchPage.js +254 -0
- package/dist/src/components/Table/hooks/useGetCellRenderer.js +231 -0
- package/dist/src/components/Table/hooks/useGetColumnsWithCheckbox.js +33 -0
- package/dist/src/components/Table/hooks/useGetDeleteRow.js +181 -0
- package/dist/src/components/Table/hooks/useGetResizeColumn.js +72 -0
- package/dist/src/components/Table/hooks/useGetRowCheckbox.js +55 -0
- package/dist/src/components/Table/hooks/useLoadDataSource.js +16 -0
- package/dist/src/components/Table/hooks/usePageSize.js +15 -0
- package/dist/src/components/Table/hooks/useRenderRowActions.js +50 -0
- package/dist/src/components/Table/hooks/useResizeColumns.js +70 -0
- package/dist/src/components/Table/index.js +1 -0
- package/dist/src/components/Table/providers/OrderProvider.js +65 -0
- package/dist/src/components/Table/styles.js +66 -0
- package/dist/src/components/index.js +3 -0
- package/dist/src/config.js +10 -0
- package/dist/src/db_types.js +1 -0
- package/dist/src/hooks/index.js +2 -0
- package/dist/src/hooks/useApi.js +82 -0
- package/dist/src/hooks/useEndpoint.js +57 -0
- package/dist/src/index.js +4 -0
- package/dist/src/lib/index.js +2 -0
- package/dist/src/lib/jednostkaNazwa.js +6 -0
- package/dist/src/lib/typDokumentuNazwa.js +16 -0
- package/dist/src/utils/Query.js +73 -0
- package/dist/src/utils/getWZNumber.js +4 -0
- package/dist/src/utils/getZamowienieDokumentNumber.js +4 -0
- package/dist/src/utils/index.js +3 -0
- package/dist/utils/AlertContext.d.ts +3 -0
- package/dist/utils/AlertContext.js +3 -0
- package/dist/utils/Query.d.ts +6 -0
- package/dist/utils/Query.js +33 -0
- package/dist/utils/geNumber.d.ts +2 -0
- package/dist/utils/getDocNumber.d.ts +2 -0
- package/dist/utils/getWZNumber.js +10 -0
- package/dist/utils/getWzNumber.d.ts +2 -0
- package/dist/utils/getZamowienieDokumentNumber copy.d.ts +2 -0
- package/dist/utils/getZamowienieDokumentNumber.d.ts +2 -0
- package/dist/utils/getZamowienieDokumentNumber.js +8 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +12 -0
- package/package.json +60 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
|
2
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
3
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
|
+
return arr2;
|
|
5
|
+
}
|
|
6
|
+
function _array_with_holes(arr) {
|
|
7
|
+
if (Array.isArray(arr)) return arr;
|
|
8
|
+
}
|
|
9
|
+
function _iterable_to_array_limit(arr, i) {
|
|
10
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
11
|
+
if (_i == null) return;
|
|
12
|
+
var _arr = [];
|
|
13
|
+
var _n = true;
|
|
14
|
+
var _d = false;
|
|
15
|
+
var _s, _e;
|
|
16
|
+
try {
|
|
17
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
18
|
+
_arr.push(_s.value);
|
|
19
|
+
if (i && _arr.length === i) break;
|
|
20
|
+
}
|
|
21
|
+
} catch (err) {
|
|
22
|
+
_d = true;
|
|
23
|
+
_e = err;
|
|
24
|
+
} finally{
|
|
25
|
+
try {
|
|
26
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
27
|
+
} finally{
|
|
28
|
+
if (_d) throw _e;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return _arr;
|
|
32
|
+
}
|
|
33
|
+
function _non_iterable_rest() {
|
|
34
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
35
|
+
}
|
|
36
|
+
function _sliced_to_array(arr, i) {
|
|
37
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
38
|
+
}
|
|
39
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
40
|
+
if (!o) return;
|
|
41
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
42
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
43
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
44
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
45
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
46
|
+
}
|
|
47
|
+
function encode(data) {
|
|
48
|
+
return data ? Object.entries(data).filter(function(param) {
|
|
49
|
+
var _param = _sliced_to_array(param, 2), k = _param[0], v = _param[1];
|
|
50
|
+
return k !== undefined && v !== undefined;
|
|
51
|
+
}).map(function(param) {
|
|
52
|
+
var _param = _sliced_to_array(param, 2), k = _param[0], v = _param[1];
|
|
53
|
+
return (Array.isArray(v) ? v : [
|
|
54
|
+
v
|
|
55
|
+
]).map(function(e) {
|
|
56
|
+
return "".concat(encodeURIComponent(k), "=").concat(encodeURIComponent(e));
|
|
57
|
+
}).join('&');
|
|
58
|
+
}).join('&') : '';
|
|
59
|
+
}
|
|
60
|
+
var Query = {
|
|
61
|
+
decode: function(query) {
|
|
62
|
+
if (!query) return {};
|
|
63
|
+
var q = {};
|
|
64
|
+
var pairs = query.replace(/\?/g, '').split('&');
|
|
65
|
+
pairs.forEach(function(pair) {
|
|
66
|
+
var p = pair.split('=');
|
|
67
|
+
q[decodeURIComponent(p[0])] = decodeURIComponent(p[1] || '');
|
|
68
|
+
});
|
|
69
|
+
return q;
|
|
70
|
+
},
|
|
71
|
+
encode: encode
|
|
72
|
+
};
|
|
73
|
+
export default Query;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export var getZamowienieDokumentNumber = function(row) {
|
|
2
|
+
var _row_numer_idx, _row_numer_idx1, _row_numer;
|
|
3
|
+
return "".concat(row === null || row === void 0 ? void 0 : row.typ_dokumentu, "/").concat(row === null || row === void 0 ? void 0 : (_row_numer_idx = row.numer_idx) === null || _row_numer_idx === void 0 ? void 0 : _row_numer_idx.toString().slice(0, 4), "/").concat(row === null || row === void 0 ? void 0 : (_row_numer_idx1 = row.numer_idx) === null || _row_numer_idx1 === void 0 ? void 0 : _row_numer_idx1.toString().slice(4), "/").concat(row === null || row === void 0 ? void 0 : (_row_numer = row.numer) === null || _row_numer === void 0 ? void 0 : _row_numer.toString().padStart(4, '0'), "/M");
|
|
4
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
function encode(data) {
|
|
4
|
+
return data
|
|
5
|
+
? Object.entries(data)
|
|
6
|
+
.filter(function (_a) {
|
|
7
|
+
var k = _a[0], v = _a[1];
|
|
8
|
+
return k !== undefined && v !== undefined;
|
|
9
|
+
})
|
|
10
|
+
.map(function (_a) {
|
|
11
|
+
var k = _a[0], v = _a[1];
|
|
12
|
+
return (Array.isArray(v) ? v : [v])
|
|
13
|
+
.map(function (e) { return "".concat(encodeURIComponent(k), "=").concat(encodeURIComponent(e)); })
|
|
14
|
+
.join('&');
|
|
15
|
+
})
|
|
16
|
+
.join('&')
|
|
17
|
+
: '';
|
|
18
|
+
}
|
|
19
|
+
var Query = {
|
|
20
|
+
decode: function (query) {
|
|
21
|
+
if (!query)
|
|
22
|
+
return {};
|
|
23
|
+
var q = {};
|
|
24
|
+
var pairs = query.replace(/\?/g, '').split('&');
|
|
25
|
+
pairs.forEach(function (pair) {
|
|
26
|
+
var p = pair.split('=');
|
|
27
|
+
q[decodeURIComponent(p[0])] = decodeURIComponent(p[1] || '');
|
|
28
|
+
});
|
|
29
|
+
return q;
|
|
30
|
+
},
|
|
31
|
+
encode: encode,
|
|
32
|
+
};
|
|
33
|
+
exports.default = Query;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getWZNumber = void 0;
|
|
4
|
+
var getWZNumber = function (_a) {
|
|
5
|
+
var numer = _a.numer, numer_idx = _a.numer_idx;
|
|
6
|
+
return "WZ ".concat(numer_idx.toString().slice(0, 4), "/").concat(numer_idx
|
|
7
|
+
.toString()
|
|
8
|
+
.slice(4), "/").concat(numer.toString().padStart(4, '0'), "/M");
|
|
9
|
+
};
|
|
10
|
+
exports.getWZNumber = getWZNumber;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getZamowienieDokumentNumber = void 0;
|
|
4
|
+
var getZamowienieDokumentNumber = function (row) {
|
|
5
|
+
var _a, _b, _c;
|
|
6
|
+
return "".concat(row === null || row === void 0 ? void 0 : row.typ_dokumentu, "/").concat((_a = row === null || row === void 0 ? void 0 : row.numer_idx) === null || _a === void 0 ? void 0 : _a.toString().slice(0, 4), "/").concat((_b = row === null || row === void 0 ? void 0 : row.numer_idx) === null || _b === void 0 ? void 0 : _b.toString().slice(4), "/").concat((_c = row === null || row === void 0 ? void 0 : row.numer) === null || _c === void 0 ? void 0 : _c.toString().padStart(4, '0'), "/M");
|
|
7
|
+
};
|
|
8
|
+
exports.getZamowienieDokumentNumber = getZamowienieDokumentNumber;
|
|
@@ -0,0 +1,12 @@
|
|
|
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.getWZNumber = exports.getZamowienieDokumentNumber = exports.Query = void 0;
|
|
7
|
+
var Query_1 = require("./Query");
|
|
8
|
+
Object.defineProperty(exports, "Query", { enumerable: true, get: function () { return __importDefault(Query_1).default; } });
|
|
9
|
+
var getZamowienieDokumentNumber_1 = require("./getZamowienieDokumentNumber");
|
|
10
|
+
Object.defineProperty(exports, "getZamowienieDokumentNumber", { enumerable: true, get: function () { return getZamowienieDokumentNumber_1.getZamowienieDokumentNumber; } });
|
|
11
|
+
var getWZNumber_1 = require("./getWZNumber");
|
|
12
|
+
Object.defineProperty(exports, "getWZNumber", { enumerable: true, get: function () { return getWZNumber_1.getWZNumber; } });
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ercioko/meblotex-api",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Shared modules for Meblotex app",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"typings": "./dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"dev": "npm run watch::types & npm run watch::dist",
|
|
9
|
+
"watch::dist": "swc src -d dist --watch",
|
|
10
|
+
"watch::types": "tsc --project tsconfig.json --outDir dist --watch",
|
|
11
|
+
"build": "npm run build::types && npm run build::dist",
|
|
12
|
+
"build::types": "tsc --project tsconfig.json --outDir dist",
|
|
13
|
+
"build::dist": "swc src -d dist",
|
|
14
|
+
"clean": "rm -rf node_modules && rm -rf dist"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/erykdziedzic/meblotex-api.git"
|
|
19
|
+
},
|
|
20
|
+
"author": "Eryk Dziedzic",
|
|
21
|
+
"license": "ISC",
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/erykdziedzic/meblotex-api/issues"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://github.com/erykdziedzic/meblotex-api#readme",
|
|
26
|
+
"files": [
|
|
27
|
+
"./dist"
|
|
28
|
+
],
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"react": "^16.13.1",
|
|
31
|
+
"react-dom": "^16.13.1",
|
|
32
|
+
"react-redux": "^8.1.3",
|
|
33
|
+
"styled-components": "^5.3.5"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"antd": "^4.24.16",
|
|
37
|
+
"react-draggable": "^4.4.6",
|
|
38
|
+
"react-virtualized": "^9.22.5",
|
|
39
|
+
"typescript": "^4.9.5"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@babel/core": "^7.24.7",
|
|
43
|
+
"@swc/cli": "^0.4.0",
|
|
44
|
+
"@swc/core": "^1.6.13",
|
|
45
|
+
"@types/react": "^16.14.60",
|
|
46
|
+
"@types/styled-components": "^5.1.34",
|
|
47
|
+
"babel-loader": "^8.3.0",
|
|
48
|
+
"eslint": "^8.57.0",
|
|
49
|
+
"eslint-config-prettier": "^8.10.0",
|
|
50
|
+
"prettier": "^2.8.8",
|
|
51
|
+
"sequelize": "^6.37.3",
|
|
52
|
+
"ts-loader": "^9.5.1",
|
|
53
|
+
"webpack-cli": "^4.10.0"
|
|
54
|
+
},
|
|
55
|
+
"sideEffects": false,
|
|
56
|
+
"keywords": [
|
|
57
|
+
"meblotex",
|
|
58
|
+
"design-system"
|
|
59
|
+
]
|
|
60
|
+
}
|