@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,72 @@
|
|
|
1
|
+
// TODO: fix resizing
|
|
2
|
+
function _define_property(obj, key, value) {
|
|
3
|
+
if (key in obj) {
|
|
4
|
+
Object.defineProperty(obj, key, {
|
|
5
|
+
value: value,
|
|
6
|
+
enumerable: true,
|
|
7
|
+
configurable: true,
|
|
8
|
+
writable: true
|
|
9
|
+
});
|
|
10
|
+
} else {
|
|
11
|
+
obj[key] = value;
|
|
12
|
+
}
|
|
13
|
+
return obj;
|
|
14
|
+
}
|
|
15
|
+
function _object_spread(target) {
|
|
16
|
+
for(var i = 1; i < arguments.length; i++){
|
|
17
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
18
|
+
var ownKeys = Object.keys(source);
|
|
19
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
20
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
21
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
ownKeys.forEach(function(key) {
|
|
25
|
+
_define_property(target, key, source[key]);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return target;
|
|
29
|
+
}
|
|
30
|
+
function ownKeys(object, enumerableOnly) {
|
|
31
|
+
var keys = Object.keys(object);
|
|
32
|
+
if (Object.getOwnPropertySymbols) {
|
|
33
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
34
|
+
if (enumerableOnly) {
|
|
35
|
+
symbols = symbols.filter(function(sym) {
|
|
36
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
keys.push.apply(keys, symbols);
|
|
40
|
+
}
|
|
41
|
+
return keys;
|
|
42
|
+
}
|
|
43
|
+
function _object_spread_props(target, source) {
|
|
44
|
+
source = source != null ? source : {};
|
|
45
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
46
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
47
|
+
} else {
|
|
48
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
49
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
return target;
|
|
53
|
+
}
|
|
54
|
+
import { useCallback } from 'react';
|
|
55
|
+
export default function useGetResizeColumn(param) {
|
|
56
|
+
var columns = param.columns, setColumns = param.setColumns;
|
|
57
|
+
return useCallback(function(columnIndex, deltaX) {
|
|
58
|
+
var updatedColumns = columns.map(function(colCfg, index) {
|
|
59
|
+
if (columnIndex === index) {
|
|
60
|
+
return _object_spread_props(_object_spread({}, colCfg), {
|
|
61
|
+
width: Math.max(colCfg.width + deltaX, 50),
|
|
62
|
+
resized: true
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return _object_spread({}, colCfg);
|
|
66
|
+
});
|
|
67
|
+
// setColumns(updatedColumns);
|
|
68
|
+
}, [
|
|
69
|
+
columns,
|
|
70
|
+
setColumns
|
|
71
|
+
]);
|
|
72
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
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_without_holes(arr) {
|
|
7
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
8
|
+
}
|
|
9
|
+
function _iterable_to_array(iter) {
|
|
10
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
11
|
+
}
|
|
12
|
+
function _non_iterable_spread() {
|
|
13
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
14
|
+
}
|
|
15
|
+
function _to_consumable_array(arr) {
|
|
16
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
17
|
+
}
|
|
18
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
19
|
+
if (!o) return;
|
|
20
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
21
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
22
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
23
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
24
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
25
|
+
}
|
|
26
|
+
import { Checkbox } from 'antd';
|
|
27
|
+
import React, { useCallback } from 'react';
|
|
28
|
+
export default function useGetRowCheckbox(param) {
|
|
29
|
+
var checked = param.checked, setChecked = param.setChecked;
|
|
30
|
+
return useCallback(function RowCheckbox(v, row, index) {
|
|
31
|
+
var isInChecked = checked.indexOf(index) !== -1;
|
|
32
|
+
var handleOnChange = useCallback(function(param) {
|
|
33
|
+
var _param_target = param.target, hasBeenChecked = _param_target.checked;
|
|
34
|
+
var shouldBeInChecked = !isInChecked && hasBeenChecked;
|
|
35
|
+
if (shouldBeInChecked) {
|
|
36
|
+
setChecked(_to_consumable_array(checked).concat([
|
|
37
|
+
index
|
|
38
|
+
]));
|
|
39
|
+
} else {
|
|
40
|
+
setChecked(checked.filter(function(e) {
|
|
41
|
+
return e !== index;
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
}, [
|
|
45
|
+
checked,
|
|
46
|
+
isInChecked
|
|
47
|
+
]);
|
|
48
|
+
return /*#__PURE__*/ React.createElement(Checkbox, {
|
|
49
|
+
checked: isInChecked,
|
|
50
|
+
onChange: handleOnChange
|
|
51
|
+
});
|
|
52
|
+
}, [
|
|
53
|
+
checked
|
|
54
|
+
]);
|
|
55
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import addIndexToObject from '../addIndexToObject';
|
|
3
|
+
export default function useLoadDataSource(param) {
|
|
4
|
+
var filters = param.filters, added = param.added, data = param.data, dataSource = param.dataSource, setData = param.setData, fetchPage = param.fetchPage, pageSize = param.pageSize, loadPage = param.loadPage;
|
|
5
|
+
useEffect(function() {
|
|
6
|
+
if (dataSource !== undefined && JSON.stringify(data) !== JSON.stringify(dataSource.map(addIndexToObject))) {
|
|
7
|
+
setData(dataSource.map(addIndexToObject));
|
|
8
|
+
} else if (loadPage !== undefined) {
|
|
9
|
+
fetchPage(0, pageSize() * 2);
|
|
10
|
+
}
|
|
11
|
+
}, [
|
|
12
|
+
filters,
|
|
13
|
+
added,
|
|
14
|
+
dataSource
|
|
15
|
+
]);
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import { MARGIN_FOR_SPINNER } from '../Table';
|
|
3
|
+
export function usePageSize(param) {
|
|
4
|
+
var mainRef = param.mainRef, rowSize = param.rowSize;
|
|
5
|
+
return useCallback(function() {
|
|
6
|
+
var _mainRef_current;
|
|
7
|
+
var maxSpace = Math.ceil((((_mainRef_current = mainRef.current) === null || _mainRef_current === void 0 ? void 0 : _mainRef_current.offsetHeight) || 0 - MARGIN_FOR_SPINNER) / rowSize);
|
|
8
|
+
if (mainRef.current && maxSpace >= 0) {
|
|
9
|
+
return maxSpace;
|
|
10
|
+
}
|
|
11
|
+
return 2;
|
|
12
|
+
}, [
|
|
13
|
+
mainRef
|
|
14
|
+
]);
|
|
15
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
function _tagged_template_literal(strings, raw) {
|
|
2
|
+
if (!raw) {
|
|
3
|
+
raw = strings.slice(0);
|
|
4
|
+
}
|
|
5
|
+
return Object.freeze(Object.defineProperties(strings, {
|
|
6
|
+
raw: {
|
|
7
|
+
value: Object.freeze(raw)
|
|
8
|
+
}
|
|
9
|
+
}));
|
|
10
|
+
}
|
|
11
|
+
function _templateObject() {
|
|
12
|
+
var data = _tagged_template_literal([
|
|
13
|
+
"\n 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"
|
|
14
|
+
]);
|
|
15
|
+
_templateObject = function _templateObject() {
|
|
16
|
+
return data;
|
|
17
|
+
};
|
|
18
|
+
return data;
|
|
19
|
+
}
|
|
20
|
+
import { Space } from 'antd';
|
|
21
|
+
import React, { useCallback } from 'react';
|
|
22
|
+
import { DeleteTwoTone } from '@ant-design/icons';
|
|
23
|
+
import styled from 'styled-components';
|
|
24
|
+
var Action = styled.div(_templateObject());
|
|
25
|
+
export default function useRenderRowActions(param) {
|
|
26
|
+
var data = param.data, actions = param.actions, deleteRow = param.deleteRow;
|
|
27
|
+
return useCallback(function(v, row, rowIndex) {
|
|
28
|
+
var _actions_buttons;
|
|
29
|
+
if (!data) return null;
|
|
30
|
+
return /*#__PURE__*/ React.createElement(Space, {
|
|
31
|
+
size: 28
|
|
32
|
+
}, (_actions_buttons = actions.buttons) === null || _actions_buttons === void 0 ? void 0 : _actions_buttons.map(function(e, i) {
|
|
33
|
+
return /*#__PURE__*/ React.createElement(Action, {
|
|
34
|
+
key: i,
|
|
35
|
+
className: "action"
|
|
36
|
+
}, e(data[rowIndex - 1]));
|
|
37
|
+
}), actions.delete ? /*#__PURE__*/ React.createElement(Action, {
|
|
38
|
+
className: "action"
|
|
39
|
+
}, /*#__PURE__*/ React.createElement(DeleteTwoTone, {
|
|
40
|
+
onClick: function() {
|
|
41
|
+
return deleteRow(data[rowIndex - 1]);
|
|
42
|
+
},
|
|
43
|
+
twoToneColor: "#F5222D"
|
|
44
|
+
})) : undefined);
|
|
45
|
+
}, [
|
|
46
|
+
data,
|
|
47
|
+
actions,
|
|
48
|
+
deleteRow
|
|
49
|
+
]);
|
|
50
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
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_without_holes(arr) {
|
|
7
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
8
|
+
}
|
|
9
|
+
function _iterable_to_array(iter) {
|
|
10
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
11
|
+
}
|
|
12
|
+
function _non_iterable_spread() {
|
|
13
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
14
|
+
}
|
|
15
|
+
function _to_consumable_array(arr) {
|
|
16
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
17
|
+
}
|
|
18
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
19
|
+
if (!o) return;
|
|
20
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
21
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
22
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
23
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
24
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
25
|
+
}
|
|
26
|
+
import { useCallback } from 'react';
|
|
27
|
+
import areProvidedColumnsDifferent from '../areProvidedColumnsDifferent';
|
|
28
|
+
var SCROLLBAR_WIDTH = 16;
|
|
29
|
+
export default function useResizeColumns(param) {
|
|
30
|
+
var providedColumns = param.providedColumns, columns = param.columns, main = param.main, floatingActions = param.floatingActions, actions = param.actions, setColumns = param.setColumns, grid = param.grid;
|
|
31
|
+
return useCallback(function() {
|
|
32
|
+
var _main_current, _grid_current;
|
|
33
|
+
if (areProvidedColumnsDifferent(providedColumns, columns)) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
var sum = columns.map(function(e) {
|
|
37
|
+
return e.width;
|
|
38
|
+
}).reduce(function(a, b) {
|
|
39
|
+
return a + b;
|
|
40
|
+
}, 0);
|
|
41
|
+
var restSum = columns.slice(0, columns.length - 1).map(function(e) {
|
|
42
|
+
return e.width;
|
|
43
|
+
}).reduce(function(a, b) {
|
|
44
|
+
return a + b;
|
|
45
|
+
}, 0);
|
|
46
|
+
var space = ((_main_current = main.current) === null || _main_current === void 0 ? void 0 : _main_current.offsetWidth) - SCROLLBAR_WIDTH;
|
|
47
|
+
if (sum < space || columns[columns.length - 1].modified && columns[columns.length - 1].width !== space - restSum) {
|
|
48
|
+
if (!floatingActions && actions && columns[columns.length - 1].key !== 'akcje') {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
var updatedColumns = _to_consumable_array(columns);
|
|
52
|
+
if (updatedColumns[columns.length - 1]) {
|
|
53
|
+
updatedColumns[columns.length - 1].width = space - restSum;
|
|
54
|
+
updatedColumns[columns.length - 1].modified = true;
|
|
55
|
+
setColumns(updatedColumns);
|
|
56
|
+
} else {
|
|
57
|
+
console.error('updating non-existent column');
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
(_grid_current = grid.current) === null || _grid_current === void 0 ? void 0 : _grid_current.recomputeGridSize();
|
|
61
|
+
}, [
|
|
62
|
+
providedColumns,
|
|
63
|
+
setColumns,
|
|
64
|
+
columns,
|
|
65
|
+
main,
|
|
66
|
+
floatingActions,
|
|
67
|
+
actions,
|
|
68
|
+
grid
|
|
69
|
+
]);
|
|
70
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Table';
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
import React from 'react';
|
|
48
|
+
import { createContext, useContext, useState } from 'react';
|
|
49
|
+
var OrderContext = /*#__PURE__*/ createContext({
|
|
50
|
+
order: undefined,
|
|
51
|
+
setOrder: function() {}
|
|
52
|
+
});
|
|
53
|
+
export var useOrder = function() {
|
|
54
|
+
return useContext(OrderContext);
|
|
55
|
+
};
|
|
56
|
+
export var OrderProvider = function(param) {
|
|
57
|
+
var children = param.children;
|
|
58
|
+
var _useState = _sliced_to_array(useState(), 2), order = _useState[0], setOrder = _useState[1];
|
|
59
|
+
return /*#__PURE__*/ React.createElement(OrderContext.Provider, {
|
|
60
|
+
value: {
|
|
61
|
+
order: order,
|
|
62
|
+
setOrder: setOrder
|
|
63
|
+
}
|
|
64
|
+
}, children);
|
|
65
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
function _tagged_template_literal(strings, raw) {
|
|
2
|
+
if (!raw) {
|
|
3
|
+
raw = strings.slice(0);
|
|
4
|
+
}
|
|
5
|
+
return Object.freeze(Object.defineProperties(strings, {
|
|
6
|
+
raw: {
|
|
7
|
+
value: Object.freeze(raw)
|
|
8
|
+
}
|
|
9
|
+
}));
|
|
10
|
+
}
|
|
11
|
+
function _templateObject() {
|
|
12
|
+
var data = _tagged_template_literal([
|
|
13
|
+
"\n 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"
|
|
14
|
+
]);
|
|
15
|
+
_templateObject = function _templateObject() {
|
|
16
|
+
return data;
|
|
17
|
+
};
|
|
18
|
+
return data;
|
|
19
|
+
}
|
|
20
|
+
function _templateObject1() {
|
|
21
|
+
var data = _tagged_template_literal([
|
|
22
|
+
"\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"
|
|
23
|
+
]);
|
|
24
|
+
_templateObject1 = function _templateObject() {
|
|
25
|
+
return data;
|
|
26
|
+
};
|
|
27
|
+
return data;
|
|
28
|
+
}
|
|
29
|
+
function _templateObject2() {
|
|
30
|
+
var data = _tagged_template_literal([
|
|
31
|
+
"\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"
|
|
32
|
+
]);
|
|
33
|
+
_templateObject2 = function _templateObject() {
|
|
34
|
+
return data;
|
|
35
|
+
};
|
|
36
|
+
return data;
|
|
37
|
+
}
|
|
38
|
+
function _templateObject3() {
|
|
39
|
+
var data = _tagged_template_literal([
|
|
40
|
+
"\n ",
|
|
41
|
+
";\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"
|
|
42
|
+
]);
|
|
43
|
+
_templateObject3 = function _templateObject() {
|
|
44
|
+
return data;
|
|
45
|
+
};
|
|
46
|
+
return data;
|
|
47
|
+
}
|
|
48
|
+
function _templateObject4() {
|
|
49
|
+
var data = _tagged_template_literal([
|
|
50
|
+
"\n ",
|
|
51
|
+
"\n ",
|
|
52
|
+
"\n"
|
|
53
|
+
]);
|
|
54
|
+
_templateObject4 = function _templateObject() {
|
|
55
|
+
return data;
|
|
56
|
+
};
|
|
57
|
+
return data;
|
|
58
|
+
}
|
|
59
|
+
import styled, { css } from 'styled-components';
|
|
60
|
+
export var DataTable = styled.div(_templateObject());
|
|
61
|
+
export var StyledTable = styled.div(_templateObject1());
|
|
62
|
+
var tableData = css(_templateObject2());
|
|
63
|
+
export var TableHeader = styled.div(_templateObject3(), tableData);
|
|
64
|
+
export var TableData = styled.div(_templateObject4(), tableData, function(p) {
|
|
65
|
+
return p.$align ? 'text-align: ' + p.$align + ';' : '';
|
|
66
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var nextHost = process.env.NEXT_PUBLIC_HOST;
|
|
2
|
+
var config = {
|
|
3
|
+
api: {
|
|
4
|
+
host: process.env.API_HOST || nextHost && "".concat(nextHost, "/api") || 'http://localhost:8443'
|
|
5
|
+
},
|
|
6
|
+
ROW_SIZE: 24,
|
|
7
|
+
ROW_SIZE_MOBILE: 48,
|
|
8
|
+
MOBILE_BREAKPOINT: 375
|
|
9
|
+
};
|
|
10
|
+
export default config;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,82 @@
|
|
|
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
|
+
import { useCallback, useMemo } from 'react';
|
|
48
|
+
import { createApi } from '../api/createApi';
|
|
49
|
+
import Endpoint from '../api/Endpoint';
|
|
50
|
+
export default function useApi() {
|
|
51
|
+
var onUnauthorized = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function() {};
|
|
52
|
+
var api = useMemo(function() {
|
|
53
|
+
return Object.fromEntries(Object.entries(createApi()).map(function(param) {
|
|
54
|
+
var _param = _sliced_to_array(param, 2), key = _param[0], endpoint = _param[1].endpoint;
|
|
55
|
+
return [
|
|
56
|
+
key,
|
|
57
|
+
new Endpoint(endpoint, errorCallback)
|
|
58
|
+
];
|
|
59
|
+
}));
|
|
60
|
+
}, []);
|
|
61
|
+
var errorCallback = useCallback(function(e) {
|
|
62
|
+
var error;
|
|
63
|
+
try {
|
|
64
|
+
error = JSON.parse(e.message);
|
|
65
|
+
} catch (syntaxError) {
|
|
66
|
+
error = {
|
|
67
|
+
statusText: e.message
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
if (error.status === 401) {
|
|
71
|
+
onUnauthorized();
|
|
72
|
+
}
|
|
73
|
+
if (error.status === 400) {
|
|
74
|
+
throw Error("".concat(error.statusText, ": ").concat(error.text));
|
|
75
|
+
} else {
|
|
76
|
+
throw Error(error.statusText);
|
|
77
|
+
}
|
|
78
|
+
}, [
|
|
79
|
+
onUnauthorized
|
|
80
|
+
]);
|
|
81
|
+
return api;
|
|
82
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
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_without_holes(arr) {
|
|
7
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
8
|
+
}
|
|
9
|
+
function _iterable_to_array(iter) {
|
|
10
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
11
|
+
}
|
|
12
|
+
function _non_iterable_spread() {
|
|
13
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
14
|
+
}
|
|
15
|
+
function _to_consumable_array(arr) {
|
|
16
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
17
|
+
}
|
|
18
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
19
|
+
if (!o) return;
|
|
20
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
21
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
22
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
23
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
24
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
25
|
+
}
|
|
26
|
+
import { useCallback, useMemo } from 'react';
|
|
27
|
+
import { createApi } from '../api/createApi';
|
|
28
|
+
export default function useEndpoint(path) {
|
|
29
|
+
var onError = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : function() {};
|
|
30
|
+
var handleErrors = useCallback(function(func) {
|
|
31
|
+
return function() {
|
|
32
|
+
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
|
33
|
+
args[_key] = arguments[_key];
|
|
34
|
+
}
|
|
35
|
+
try {
|
|
36
|
+
func.apply(void 0, _to_consumable_array(args));
|
|
37
|
+
} catch (e) {
|
|
38
|
+
var error = JSON.parse(e.message);
|
|
39
|
+
onError(error);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}, [
|
|
43
|
+
onError
|
|
44
|
+
]);
|
|
45
|
+
var endpoint = useMemo(function() {
|
|
46
|
+
var endpoint = createApi()[path];
|
|
47
|
+
endpoint.get = handleErrors(endpoint.get);
|
|
48
|
+
endpoint.post = handleErrors(endpoint.post);
|
|
49
|
+
endpoint.put = handleErrors(endpoint.put);
|
|
50
|
+
endpoint.delete = handleErrors(endpoint.delete);
|
|
51
|
+
return endpoint;
|
|
52
|
+
}, [
|
|
53
|
+
path,
|
|
54
|
+
handleErrors
|
|
55
|
+
]);
|
|
56
|
+
return endpoint;
|
|
57
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
import { TypDokumentu } from '../app_types';
|
|
15
|
+
var _obj;
|
|
16
|
+
export var typDokumentuNazwa = (_obj = {}, _define_property(_obj, TypDokumentu.Faktura, 'Faktura VAT'), _define_property(_obj, TypDokumentu.FakturaDetal, 'Faktura FADET'), _define_property(_obj, TypDokumentu.FakturaEksport, 'Faktura Eksportowa'), _define_property(_obj, TypDokumentu.Paragon, 'Paragon'), _obj);
|