@digigov/ui 0.23.0 → 0.24.2
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/CHANGELOG.md +24 -1
- package/admin/Dropdown/index.js +20 -2
- package/admin/TaskList/TaskList.stories.d.ts +7 -0
- package/admin/TaskList/TaskList.stories.js +30 -0
- package/admin/TaskList/__stories__/Default.d.ts +3 -0
- package/admin/TaskList/__stories__/Default.js +97 -0
- package/admin/TaskList/index.d.ts +7 -0
- package/admin/TaskList/index.js +86 -0
- package/admin/Timeline/Timeline.stories.d.ts +7 -0
- package/admin/Timeline/Timeline.stories.js +30 -0
- package/admin/Timeline/__stories__/Default.d.ts +3 -0
- package/admin/Timeline/__stories__/Default.js +87 -0
- package/admin/Timeline/index.d.ts +7 -0
- package/admin/Timeline/index.js +86 -0
- package/admin/index.d.ts +2 -0
- package/admin/index.js +26 -0
- package/core/Table/Table.stories.d.ts +1 -0
- package/core/Table/Table.stories.js +14 -0
- package/core/Table/TableFloatingScroll.js +6 -4
- package/core/Table/__stories__/WithFloatingScroll.d.ts +3 -0
- package/core/Table/__stories__/WithFloatingScroll.js +111 -0
- package/core/Table/__stories__/WithLoader.js +3 -6
- package/es/admin/Dropdown/index.js +20 -2
- package/es/admin/TaskList/TaskList.stories.js +6 -0
- package/es/admin/TaskList/__stories__/Default.js +74 -0
- package/es/admin/TaskList/index.js +7 -0
- package/es/admin/Timeline/Timeline.stories.js +6 -0
- package/es/admin/Timeline/__stories__/Default.js +64 -0
- package/es/admin/Timeline/index.js +7 -0
- package/es/admin/index.js +3 -1
- package/es/core/Table/Table.stories.js +2 -1
- package/es/core/Table/TableFloatingScroll.js +6 -4
- package/es/core/Table/__stories__/WithFloatingScroll.js +95 -0
- package/es/core/Table/__stories__/WithLoader.js +3 -6
- package/es/registry.js +6 -2
- package/esm/admin/Dropdown/index.js +20 -2
- package/esm/admin/TaskList/TaskList.stories.js +6 -0
- package/esm/admin/TaskList/__stories__/Default.js +74 -0
- package/esm/admin/TaskList/index.js +7 -0
- package/esm/admin/Timeline/Timeline.stories.js +6 -0
- package/esm/admin/Timeline/__stories__/Default.js +64 -0
- package/esm/admin/Timeline/index.js +7 -0
- package/esm/admin/index.js +3 -1
- package/esm/core/Table/Table.stories.js +2 -1
- package/esm/core/Table/TableFloatingScroll.js +6 -4
- package/esm/core/Table/__stories__/WithFloatingScroll.js +95 -0
- package/esm/core/Table/__stories__/WithLoader.js +3 -6
- package/esm/index.js +1 -1
- package/esm/registry.js +6 -2
- package/package.json +3 -3
- package/registry.d.ts +3 -1
- package/registry.js +9 -3
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = exports.WithFloatingScroll = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _reactCore = require("@digigov/react-core");
|
|
13
|
+
|
|
14
|
+
var _admin = require("@digigov/ui/admin");
|
|
15
|
+
|
|
16
|
+
var _TableFloatingScroll = _interopRequireDefault(require("@digigov/ui/core/Table/TableFloatingScroll"));
|
|
17
|
+
|
|
18
|
+
var labels = {
|
|
19
|
+
name: 'Ονοματεπώνυμο',
|
|
20
|
+
email: 'Email',
|
|
21
|
+
phone: 'Τηλέφωνο',
|
|
22
|
+
role: 'Ρόλος',
|
|
23
|
+
status: 'Κατάσταση',
|
|
24
|
+
actions: 'Ενέργειες',
|
|
25
|
+
at: 'Αριθμός Ταυτότητας',
|
|
26
|
+
zip: 'Ταχυδρομικός Κώδικας',
|
|
27
|
+
address: 'Διεύθυνση',
|
|
28
|
+
city: 'Πόλη',
|
|
29
|
+
country: 'Χώρα',
|
|
30
|
+
active: 'Ενεργός',
|
|
31
|
+
last_login: 'Τελευταία Σύνδεση',
|
|
32
|
+
last_login_agent: 'Τελευταία Σύνδεση Αξεσουάρ',
|
|
33
|
+
last_login_ip: 'Τελευταία Σύνδεση IP',
|
|
34
|
+
afm: 'ΑΦΜ'
|
|
35
|
+
};
|
|
36
|
+
var data = new Array(20).fill({
|
|
37
|
+
name: 'Τάκης Τσούκαλος',
|
|
38
|
+
afm: '1111111114',
|
|
39
|
+
role: 'Χειριστής',
|
|
40
|
+
at: '1212121',
|
|
41
|
+
email: 'myhomeemail@gov.gr',
|
|
42
|
+
phone: '22222222',
|
|
43
|
+
address: 'Αγία Παρασκευής',
|
|
44
|
+
city: 'Αγία Παρασκευή',
|
|
45
|
+
country: 'Ελλάδα',
|
|
46
|
+
zip: '222233',
|
|
47
|
+
active: 'Ναι',
|
|
48
|
+
last_login: '12/12/12',
|
|
49
|
+
last_login_ip: '0.0.0.0',
|
|
50
|
+
last_login_agent: 'Firefox'
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
var _ref = /*#__PURE__*/_react["default"].createElement(_reactCore.TableHeadCell, null, "\u0395\u03BD\u03AD\u03C1\u03B3\u03B5\u03B9\u03B5\u03C2");
|
|
54
|
+
|
|
55
|
+
var _ref2 = /*#__PURE__*/_react["default"].createElement(_reactCore.TableDataCell, null, /*#__PURE__*/_react["default"].createElement(_admin.Dropdown, {
|
|
56
|
+
"float": true,
|
|
57
|
+
align: "left",
|
|
58
|
+
placement: "bottom"
|
|
59
|
+
}, /*#__PURE__*/_react["default"].createElement(_admin.DropdownButton, {
|
|
60
|
+
variant: "link"
|
|
61
|
+
}, "\u0395\u03BD\u03AD\u03C1\u03B3\u03B5\u03B9\u03B5\u03C2"), /*#__PURE__*/_react["default"].createElement(_admin.DropdownContent, null, /*#__PURE__*/_react["default"].createElement(_reactCore.NavVertical, null, /*#__PURE__*/_react["default"].createElement(_reactCore.NavVerticalItem, {
|
|
62
|
+
href: "#"
|
|
63
|
+
}, "Accept"), /*#__PURE__*/_react["default"].createElement(_reactCore.NavVerticalItem, {
|
|
64
|
+
href: "#"
|
|
65
|
+
}, "Dismiss")))));
|
|
66
|
+
|
|
67
|
+
var _ref3 = /*#__PURE__*/_react["default"].createElement(_reactCore.TableHeadCell, null, "\u0395\u03BD\u03AD\u03C1\u03B3\u03B5\u03B9\u03B5\u03C2");
|
|
68
|
+
|
|
69
|
+
var _ref4 = /*#__PURE__*/_react["default"].createElement(_reactCore.TableDataCell, null, /*#__PURE__*/_react["default"].createElement(_admin.Dropdown, {
|
|
70
|
+
"float": true,
|
|
71
|
+
align: "left",
|
|
72
|
+
placement: "bottom"
|
|
73
|
+
}, /*#__PURE__*/_react["default"].createElement(_admin.DropdownButton, {
|
|
74
|
+
variant: "link"
|
|
75
|
+
}, "\u0395\u03BD\u03AD\u03C1\u03B3\u03B5\u03B9\u03B5\u03C2"), /*#__PURE__*/_react["default"].createElement(_admin.DropdownContent, null, /*#__PURE__*/_react["default"].createElement(_reactCore.NavVertical, null, /*#__PURE__*/_react["default"].createElement(_reactCore.NavVerticalItem, {
|
|
76
|
+
href: "#"
|
|
77
|
+
}, "Accept"), /*#__PURE__*/_react["default"].createElement(_reactCore.NavVerticalItem, {
|
|
78
|
+
href: "#"
|
|
79
|
+
}, "Dismiss")))));
|
|
80
|
+
|
|
81
|
+
var WithFloatingScroll = function WithFloatingScroll() {
|
|
82
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_TableFloatingScroll["default"], null, /*#__PURE__*/_react["default"].createElement(_reactCore.Table, null, /*#__PURE__*/_react["default"].createElement(_reactCore.TableHead, null, /*#__PURE__*/_react["default"].createElement(_reactCore.TableRow, null, Object.keys(data[0]).map(function (key) {
|
|
83
|
+
return /*#__PURE__*/_react["default"].createElement(_reactCore.TableHeadCell, {
|
|
84
|
+
key: key
|
|
85
|
+
}, labels[key]);
|
|
86
|
+
}), _ref)), /*#__PURE__*/_react["default"].createElement(_reactCore.TableBody, null, data && data.map(function (dt, index) {
|
|
87
|
+
return /*#__PURE__*/_react["default"].createElement(_reactCore.TableRow, {
|
|
88
|
+
key: index
|
|
89
|
+
}, Object.keys(dt).map(function (key) {
|
|
90
|
+
return /*#__PURE__*/_react["default"].createElement(_reactCore.TableDataCell, {
|
|
91
|
+
key: key
|
|
92
|
+
}, dt[key]);
|
|
93
|
+
}), _ref2);
|
|
94
|
+
})))), /*#__PURE__*/_react["default"].createElement(_reactCore.Table, null, /*#__PURE__*/_react["default"].createElement(_reactCore.TableHead, null, /*#__PURE__*/_react["default"].createElement(_reactCore.TableRow, null, Object.keys(data[0]).map(function (key) {
|
|
95
|
+
return /*#__PURE__*/_react["default"].createElement(_reactCore.TableHeadCell, {
|
|
96
|
+
key: key
|
|
97
|
+
}, labels[key]);
|
|
98
|
+
}), _ref3)), /*#__PURE__*/_react["default"].createElement(_reactCore.TableBody, null, data && data.map(function (dt, index) {
|
|
99
|
+
return /*#__PURE__*/_react["default"].createElement(_reactCore.TableRow, {
|
|
100
|
+
key: index
|
|
101
|
+
}, Object.keys(dt).map(function (key) {
|
|
102
|
+
return /*#__PURE__*/_react["default"].createElement(_reactCore.TableDataCell, {
|
|
103
|
+
key: key
|
|
104
|
+
}, dt[key]);
|
|
105
|
+
}), _ref4);
|
|
106
|
+
}))));
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
exports.WithFloatingScroll = WithFloatingScroll;
|
|
110
|
+
var _default = WithFloatingScroll;
|
|
111
|
+
exports["default"] = _default;
|
|
@@ -85,7 +85,7 @@ var WithLoader = function WithLoader() {
|
|
|
85
85
|
|
|
86
86
|
setTimeout(function () {
|
|
87
87
|
setTableData(data);
|
|
88
|
-
},
|
|
88
|
+
}, 2000);
|
|
89
89
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
90
90
|
className: "example"
|
|
91
91
|
}, /*#__PURE__*/_react["default"].createElement(_reactCore.TableContainer, null, !tableData ? _ref : /*#__PURE__*/_react["default"].createElement(_reactCore.Table, null, _ref2, _ref3, /*#__PURE__*/_react["default"].createElement(_reactCore.TableBody, null, loading === true && _ref4, tableData && tableData.length > 0 ? tableData.map(function (d, index) {
|
|
@@ -94,12 +94,9 @@ var WithLoader = function WithLoader() {
|
|
|
94
94
|
}, /*#__PURE__*/_react["default"].createElement(_reactCore.TableDataCell, null, d.name), /*#__PURE__*/_react["default"].createElement(_reactCore.TableDataCell, null, d.job), /*#__PURE__*/_react["default"].createElement(_reactCore.TableDataCell, null, d.year), /*#__PURE__*/_react["default"].createElement(_reactCore.TableDataCell, null, d.salary));
|
|
95
95
|
}) : _ref5))), /*#__PURE__*/_react["default"].createElement(_reactCore.Button, {
|
|
96
96
|
onClick: function onClick() {
|
|
97
|
-
setLoading(
|
|
98
|
-
/* setTimeout(() => {
|
|
99
|
-
setLoading(false);
|
|
100
|
-
}, 7000); */
|
|
97
|
+
setLoading(!loading);
|
|
101
98
|
}
|
|
102
|
-
}, "
|
|
99
|
+
}, "Toggle Loading"));
|
|
103
100
|
};
|
|
104
101
|
|
|
105
102
|
exports.WithLoader = WithLoader;
|
|
@@ -29,19 +29,37 @@ export var Dropdown = function Dropdown(_ref) {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
var toggleFloat = function toggleFloat() {
|
|
32
|
+
var _innerRef$current;
|
|
33
|
+
|
|
34
|
+
var tbody = innerRef.current.closest('tbody');
|
|
35
|
+
var parentElement = (_innerRef$current = innerRef.current) === null || _innerRef$current === void 0 ? void 0 : _innerRef$current.parentElement;
|
|
36
|
+
|
|
32
37
|
if (innerRef.current.open) {
|
|
33
|
-
var
|
|
34
|
-
|
|
38
|
+
var _innerRef$current2;
|
|
39
|
+
|
|
40
|
+
tbody.style.position = 'static';
|
|
41
|
+
var rect = (_innerRef$current2 = innerRef.current) === null || _innerRef$current2 === void 0 ? void 0 : _innerRef$current2.getBoundingClientRect();
|
|
42
|
+
var parentRect = parentElement.getBoundingClientRect();
|
|
43
|
+
innerRef.current.style.position = 'static'; // arbitrary spacing of 12 pixels because CSS
|
|
44
|
+
|
|
35
45
|
var top = rect.top + window.pageYOffset;
|
|
36
46
|
var left = rect.left + window.pageXOffset;
|
|
47
|
+
parentElement.style.height = "".concat(parentRect.height, "px");
|
|
48
|
+
parentElement.style.width = "".concat(parentRect.width, "px");
|
|
37
49
|
innerRef.current.style.top = "".concat(top, "px");
|
|
38
50
|
innerRef.current.style.left = "".concat(left, "px");
|
|
39
51
|
innerRef.current.style.position = "absolute";
|
|
40
52
|
innerRef.current.style.display = "block";
|
|
53
|
+
innerRef.current.style.background = 'white';
|
|
41
54
|
} else {
|
|
55
|
+
tbody.style.position = 'relative';
|
|
56
|
+
parentElement.style.height = '';
|
|
57
|
+
parentElement.style.width = '';
|
|
42
58
|
innerRef.current.style.top = "0";
|
|
43
59
|
innerRef.current.style.left = "0";
|
|
44
60
|
innerRef.current.style.position = "relative";
|
|
61
|
+
innerRef.current.style.display = "table-cell";
|
|
62
|
+
innerRef.current.style.background = 'transparent';
|
|
45
63
|
}
|
|
46
64
|
};
|
|
47
65
|
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Link } from '@digigov/react-core';
|
|
3
|
+
import SummaryList, { SummaryListItem, SummaryListItemAction, SummaryListItemKey } from '@digigov/ui/core/SummaryList';
|
|
4
|
+
import { TaskList, TaskListItem, TaskListItemHeading, TaskListItemContent, TaskListItemTag } from '@digigov/ui/admin';
|
|
5
|
+
var fields = [{
|
|
6
|
+
title: 'Check before you start',
|
|
7
|
+
tasks: [{
|
|
8
|
+
text: 'Check eligibility',
|
|
9
|
+
status: 'Completed'
|
|
10
|
+
}, {
|
|
11
|
+
text: 'Read declaration',
|
|
12
|
+
status: 'Completed'
|
|
13
|
+
}]
|
|
14
|
+
}, {
|
|
15
|
+
title: 'Prepare application',
|
|
16
|
+
tasks: [{
|
|
17
|
+
text: 'Company information',
|
|
18
|
+
status: 'Completed'
|
|
19
|
+
}, {
|
|
20
|
+
text: 'Your contact details',
|
|
21
|
+
status: 'In progress'
|
|
22
|
+
}, {
|
|
23
|
+
text: 'List convictions',
|
|
24
|
+
status: 'Not started'
|
|
25
|
+
}, {
|
|
26
|
+
text: 'Provide financial evidence',
|
|
27
|
+
status: 'Cannot start yet'
|
|
28
|
+
}, {
|
|
29
|
+
text: 'Give medical information',
|
|
30
|
+
status: 'Cannot start yet'
|
|
31
|
+
}]
|
|
32
|
+
}, {
|
|
33
|
+
title: 'Apply',
|
|
34
|
+
tasks: [{
|
|
35
|
+
text: 'Submit and pay',
|
|
36
|
+
status: 'Cannot start yet'
|
|
37
|
+
}]
|
|
38
|
+
}];
|
|
39
|
+
export var Default = function Default() {
|
|
40
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(TaskList, null, fields && fields.map(function (field, index) {
|
|
41
|
+
return /*#__PURE__*/React.createElement(TaskListItem, {
|
|
42
|
+
key: index
|
|
43
|
+
}, /*#__PURE__*/React.createElement(TaskListItemHeading, {
|
|
44
|
+
size: "m"
|
|
45
|
+
}, "".concat(index + 1, ". ").concat(field.title)), /*#__PURE__*/React.createElement(TaskListItemContent, null, /*#__PURE__*/React.createElement(SummaryList, null, field.tasks.map(function (task, key) {
|
|
46
|
+
var tagColor;
|
|
47
|
+
|
|
48
|
+
switch (task.status) {
|
|
49
|
+
case 'Completed':
|
|
50
|
+
tagColor = 'completed';
|
|
51
|
+
break;
|
|
52
|
+
|
|
53
|
+
case 'In progress':
|
|
54
|
+
tagColor = 'in-progress';
|
|
55
|
+
break;
|
|
56
|
+
|
|
57
|
+
case 'Not started':
|
|
58
|
+
tagColor = 'not-started';
|
|
59
|
+
break;
|
|
60
|
+
|
|
61
|
+
case 'Cannot start yet':
|
|
62
|
+
tagColor = 'not-started';
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return /*#__PURE__*/React.createElement(SummaryListItem, {
|
|
67
|
+
key: key
|
|
68
|
+
}, /*#__PURE__*/React.createElement(SummaryListItemKey, null, /*#__PURE__*/React.createElement(Link, null, task.text)), /*#__PURE__*/React.createElement(SummaryListItemAction, null, /*#__PURE__*/React.createElement(TaskListItemTag, {
|
|
69
|
+
status: tagColor
|
|
70
|
+
}, task.status)));
|
|
71
|
+
}))));
|
|
72
|
+
})));
|
|
73
|
+
};
|
|
74
|
+
export default Default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from '@digigov/react-extensions/admin/TaskList';
|
|
2
|
+
export * from '@digigov/react-extensions/admin/TaskListItem';
|
|
3
|
+
export * from '@digigov/react-extensions/admin/TaskListItemContent';
|
|
4
|
+
export * from '@digigov/react-extensions/admin/TaskListItemHeading';
|
|
5
|
+
export * from '@digigov/react-extensions/admin/TaskListItemTag';
|
|
6
|
+
import TaskList from '@digigov/react-extensions/admin/TaskList';
|
|
7
|
+
export default TaskList;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button, Hint, Link, Paragraph } from '@digigov/react-core';
|
|
3
|
+
import { Timeline, TimelineItem, TimelineHeading, TimelineContent, TimelineActions } from '@digigov/ui/admin';
|
|
4
|
+
import Details, { DetailsSummary, DetailsContent } from '@digigov/ui/core/Details';
|
|
5
|
+
var data = [{
|
|
6
|
+
title: 'Application requires confirmation',
|
|
7
|
+
date: '14 June 2019 at 2:01pm',
|
|
8
|
+
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras non felis risus. Curabitur nec ante vitae felis ullamcorper tincidunt.',
|
|
9
|
+
links: [{
|
|
10
|
+
text: 'See application',
|
|
11
|
+
href: '#'
|
|
12
|
+
}]
|
|
13
|
+
}, {
|
|
14
|
+
title: 'Application review in progress ',
|
|
15
|
+
date: '7 June 2019 at 12:32pm',
|
|
16
|
+
text: 'Your application is being reviewed by one of our case workers.',
|
|
17
|
+
buttons: [{
|
|
18
|
+
text: 'Continue'
|
|
19
|
+
}, {
|
|
20
|
+
text: 'Cancel',
|
|
21
|
+
color: 'warning'
|
|
22
|
+
}]
|
|
23
|
+
}, {
|
|
24
|
+
title: 'Application received ',
|
|
25
|
+
date: '6 June 2019 at 9:12am ',
|
|
26
|
+
text: 'Your application has been received – reference MOJ-1234-5678'
|
|
27
|
+
}, {
|
|
28
|
+
title: 'Application details ',
|
|
29
|
+
date: '6 June 2019 at 9:12am ',
|
|
30
|
+
detailsSummary: 'More info regarding your application',
|
|
31
|
+
detailsContent: 'Your application has been received – reference MOJ-1234-5678'
|
|
32
|
+
}, {
|
|
33
|
+
title: 'Application submitted',
|
|
34
|
+
date: '28 May 2019 at 10:45am',
|
|
35
|
+
text: 'Your application is being reviewed by one of our case workers.',
|
|
36
|
+
buttons: [{
|
|
37
|
+
text: 'Continue'
|
|
38
|
+
}],
|
|
39
|
+
links: [{
|
|
40
|
+
text: 'Details',
|
|
41
|
+
href: '#'
|
|
42
|
+
}, {
|
|
43
|
+
text: 'Something else',
|
|
44
|
+
href: '#'
|
|
45
|
+
}]
|
|
46
|
+
}];
|
|
47
|
+
export var Default = function Default() {
|
|
48
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Timeline, null, data && data.map(function (field, index) {
|
|
49
|
+
return /*#__PURE__*/React.createElement(TimelineItem, {
|
|
50
|
+
key: index
|
|
51
|
+
}, /*#__PURE__*/React.createElement(TimelineHeading, null, field.title), /*#__PURE__*/React.createElement(TimelineContent, null, /*#__PURE__*/React.createElement(Hint, null, field.date), field.text && /*#__PURE__*/React.createElement(Paragraph, null, field.text), field.detailsSummary && /*#__PURE__*/React.createElement(Details, null, /*#__PURE__*/React.createElement(DetailsSummary, null, field.detailsSummary), /*#__PURE__*/React.createElement(DetailsContent, null, field.detailsContent))), (field.links || field.buttons) && /*#__PURE__*/React.createElement(TimelineActions, null, field.buttons && field.buttons.map(function (button, index) {
|
|
52
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
53
|
+
key: index,
|
|
54
|
+
color: button.color || 'secondary'
|
|
55
|
+
}, button.text);
|
|
56
|
+
}), field.links && field.links.map(function (link, index) {
|
|
57
|
+
return /*#__PURE__*/React.createElement(Link, {
|
|
58
|
+
key: index,
|
|
59
|
+
href: link.href
|
|
60
|
+
}, link.text);
|
|
61
|
+
})));
|
|
62
|
+
})));
|
|
63
|
+
};
|
|
64
|
+
export default Default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from '@digigov/react-extensions/admin/Timeline';
|
|
2
|
+
export * from '@digigov/react-extensions/admin/TimelineContent';
|
|
3
|
+
export * from '@digigov/react-extensions/admin/TimelineHeading';
|
|
4
|
+
export * from '@digigov/react-extensions/admin/TimelineItem';
|
|
5
|
+
export * from '@digigov/react-extensions/admin/TimelineActions';
|
|
6
|
+
import Timeline from '@digigov/react-extensions/admin/Timeline';
|
|
7
|
+
export default Timeline;
|
package/es/admin/index.js
CHANGED
|
@@ -14,4 +14,6 @@ export * from '@digigov/ui/admin/AdminLayout';
|
|
|
14
14
|
export * from '@digigov/ui/admin/ResultsHeading';
|
|
15
15
|
export * from '@digigov/ui/admin/SearchSection';
|
|
16
16
|
export * from '@digigov/ui/admin/FilterSection';
|
|
17
|
-
export * from '@digigov/ui/admin/AutoComplete';
|
|
17
|
+
export * from '@digigov/ui/admin/AutoComplete';
|
|
18
|
+
export * from '@digigov/ui/admin/Timeline';
|
|
19
|
+
export * from '@digigov/ui/admin/TaskList';
|
|
@@ -16,4 +16,5 @@ export * from './__stories__/DarkVariantWithVerticalHeaders';
|
|
|
16
16
|
export * from './__stories__/WithLoader';
|
|
17
17
|
export * from './__stories__/DefinedWidth';
|
|
18
18
|
export * from './__stories__/Densed';
|
|
19
|
-
export * from './__stories__/MultipleProps';
|
|
19
|
+
export * from './__stories__/MultipleProps';
|
|
20
|
+
export * from './__stories__/WithFloatingScroll';
|
|
@@ -30,11 +30,13 @@ export function TableFloatingScroll(props) {
|
|
|
30
30
|
var elementOffset = contentRef.current.offsetTop + contentRef.current.offsetHeight;
|
|
31
31
|
|
|
32
32
|
function onBodyScroll() {
|
|
33
|
-
var currentScroll = window.pageYOffset + window.innerHeight;
|
|
33
|
+
var currentScroll = window.pageYOffset + window.innerHeight;
|
|
34
34
|
|
|
35
|
-
if (currentScroll < elementOffset &&
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
if (currentScroll < elementOffset && // @ts-ignore
|
|
36
|
+
currentScroll > contentRef.current.offsetTop) {
|
|
37
|
+
setPosition('fixed');
|
|
38
|
+
} else if (currentScroll >= elementOffset || // @ts-ignore
|
|
39
|
+
currentScroll <= contentRef.current.offsetTop) {
|
|
38
40
|
setPosition('relative');
|
|
39
41
|
}
|
|
40
42
|
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Table, TableHead, TableRow, TableBody, TableHeadCell, TableDataCell, NavVertical, NavVerticalItem } from '@digigov/react-core';
|
|
3
|
+
import { Dropdown, DropdownButton, DropdownContent } from '@digigov/ui/admin';
|
|
4
|
+
import TableFloatingScroll from '@digigov/ui/core/Table/TableFloatingScroll';
|
|
5
|
+
var labels = {
|
|
6
|
+
name: 'Ονοματεπώνυμο',
|
|
7
|
+
email: 'Email',
|
|
8
|
+
phone: 'Τηλέφωνο',
|
|
9
|
+
role: 'Ρόλος',
|
|
10
|
+
status: 'Κατάσταση',
|
|
11
|
+
actions: 'Ενέργειες',
|
|
12
|
+
at: 'Αριθμός Ταυτότητας',
|
|
13
|
+
zip: 'Ταχυδρομικός Κώδικας',
|
|
14
|
+
address: 'Διεύθυνση',
|
|
15
|
+
city: 'Πόλη',
|
|
16
|
+
country: 'Χώρα',
|
|
17
|
+
active: 'Ενεργός',
|
|
18
|
+
last_login: 'Τελευταία Σύνδεση',
|
|
19
|
+
last_login_agent: 'Τελευταία Σύνδεση Αξεσουάρ',
|
|
20
|
+
last_login_ip: 'Τελευταία Σύνδεση IP',
|
|
21
|
+
afm: 'ΑΦΜ'
|
|
22
|
+
};
|
|
23
|
+
var data = new Array(20).fill({
|
|
24
|
+
name: 'Τάκης Τσούκαλος',
|
|
25
|
+
afm: '1111111114',
|
|
26
|
+
role: 'Χειριστής',
|
|
27
|
+
at: '1212121',
|
|
28
|
+
email: 'myhomeemail@gov.gr',
|
|
29
|
+
phone: '22222222',
|
|
30
|
+
address: 'Αγία Παρασκευής',
|
|
31
|
+
city: 'Αγία Παρασκευή',
|
|
32
|
+
country: 'Ελλάδα',
|
|
33
|
+
zip: '222233',
|
|
34
|
+
active: 'Ναι',
|
|
35
|
+
last_login: '12/12/12',
|
|
36
|
+
last_login_ip: '0.0.0.0',
|
|
37
|
+
last_login_agent: 'Firefox'
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
var _ref = /*#__PURE__*/React.createElement(TableHeadCell, null, "\u0395\u03BD\u03AD\u03C1\u03B3\u03B5\u03B9\u03B5\u03C2");
|
|
41
|
+
|
|
42
|
+
var _ref2 = /*#__PURE__*/React.createElement(TableDataCell, null, /*#__PURE__*/React.createElement(Dropdown, {
|
|
43
|
+
"float": true,
|
|
44
|
+
align: "left",
|
|
45
|
+
placement: "bottom"
|
|
46
|
+
}, /*#__PURE__*/React.createElement(DropdownButton, {
|
|
47
|
+
variant: "link"
|
|
48
|
+
}, "\u0395\u03BD\u03AD\u03C1\u03B3\u03B5\u03B9\u03B5\u03C2"), /*#__PURE__*/React.createElement(DropdownContent, null, /*#__PURE__*/React.createElement(NavVertical, null, /*#__PURE__*/React.createElement(NavVerticalItem, {
|
|
49
|
+
href: "#"
|
|
50
|
+
}, "Accept"), /*#__PURE__*/React.createElement(NavVerticalItem, {
|
|
51
|
+
href: "#"
|
|
52
|
+
}, "Dismiss")))));
|
|
53
|
+
|
|
54
|
+
var _ref3 = /*#__PURE__*/React.createElement(TableHeadCell, null, "\u0395\u03BD\u03AD\u03C1\u03B3\u03B5\u03B9\u03B5\u03C2");
|
|
55
|
+
|
|
56
|
+
var _ref4 = /*#__PURE__*/React.createElement(TableDataCell, null, /*#__PURE__*/React.createElement(Dropdown, {
|
|
57
|
+
"float": true,
|
|
58
|
+
align: "left",
|
|
59
|
+
placement: "bottom"
|
|
60
|
+
}, /*#__PURE__*/React.createElement(DropdownButton, {
|
|
61
|
+
variant: "link"
|
|
62
|
+
}, "\u0395\u03BD\u03AD\u03C1\u03B3\u03B5\u03B9\u03B5\u03C2"), /*#__PURE__*/React.createElement(DropdownContent, null, /*#__PURE__*/React.createElement(NavVertical, null, /*#__PURE__*/React.createElement(NavVerticalItem, {
|
|
63
|
+
href: "#"
|
|
64
|
+
}, "Accept"), /*#__PURE__*/React.createElement(NavVerticalItem, {
|
|
65
|
+
href: "#"
|
|
66
|
+
}, "Dismiss")))));
|
|
67
|
+
|
|
68
|
+
export var WithFloatingScroll = function WithFloatingScroll() {
|
|
69
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TableFloatingScroll, null, /*#__PURE__*/React.createElement(Table, null, /*#__PURE__*/React.createElement(TableHead, null, /*#__PURE__*/React.createElement(TableRow, null, Object.keys(data[0]).map(function (key) {
|
|
70
|
+
return /*#__PURE__*/React.createElement(TableHeadCell, {
|
|
71
|
+
key: key
|
|
72
|
+
}, labels[key]);
|
|
73
|
+
}), _ref)), /*#__PURE__*/React.createElement(TableBody, null, data && data.map(function (dt, index) {
|
|
74
|
+
return /*#__PURE__*/React.createElement(TableRow, {
|
|
75
|
+
key: index
|
|
76
|
+
}, Object.keys(dt).map(function (key) {
|
|
77
|
+
return /*#__PURE__*/React.createElement(TableDataCell, {
|
|
78
|
+
key: key
|
|
79
|
+
}, dt[key]);
|
|
80
|
+
}), _ref2);
|
|
81
|
+
})))), /*#__PURE__*/React.createElement(Table, null, /*#__PURE__*/React.createElement(TableHead, null, /*#__PURE__*/React.createElement(TableRow, null, Object.keys(data[0]).map(function (key) {
|
|
82
|
+
return /*#__PURE__*/React.createElement(TableHeadCell, {
|
|
83
|
+
key: key
|
|
84
|
+
}, labels[key]);
|
|
85
|
+
}), _ref3)), /*#__PURE__*/React.createElement(TableBody, null, data && data.map(function (dt, index) {
|
|
86
|
+
return /*#__PURE__*/React.createElement(TableRow, {
|
|
87
|
+
key: index
|
|
88
|
+
}, Object.keys(dt).map(function (key) {
|
|
89
|
+
return /*#__PURE__*/React.createElement(TableDataCell, {
|
|
90
|
+
key: key
|
|
91
|
+
}, dt[key]);
|
|
92
|
+
}), _ref4);
|
|
93
|
+
}))));
|
|
94
|
+
};
|
|
95
|
+
export default WithFloatingScroll;
|
|
@@ -64,7 +64,7 @@ export var WithLoader = function WithLoader() {
|
|
|
64
64
|
|
|
65
65
|
setTimeout(function () {
|
|
66
66
|
setTableData(data);
|
|
67
|
-
},
|
|
67
|
+
}, 2000);
|
|
68
68
|
return /*#__PURE__*/React.createElement("div", {
|
|
69
69
|
className: "example"
|
|
70
70
|
}, /*#__PURE__*/React.createElement(TableContainer, null, !tableData ? _ref : /*#__PURE__*/React.createElement(Table, null, _ref2, _ref3, /*#__PURE__*/React.createElement(TableBody, null, loading === true && _ref4, tableData && tableData.length > 0 ? tableData.map(function (d, index) {
|
|
@@ -73,11 +73,8 @@ export var WithLoader = function WithLoader() {
|
|
|
73
73
|
}, /*#__PURE__*/React.createElement(TableDataCell, null, d.name), /*#__PURE__*/React.createElement(TableDataCell, null, d.job), /*#__PURE__*/React.createElement(TableDataCell, null, d.year), /*#__PURE__*/React.createElement(TableDataCell, null, d.salary));
|
|
74
74
|
}) : _ref5))), /*#__PURE__*/React.createElement(Button, {
|
|
75
75
|
onClick: function onClick() {
|
|
76
|
-
setLoading(
|
|
77
|
-
/* setTimeout(() => {
|
|
78
|
-
setLoading(false);
|
|
79
|
-
}, 7000); */
|
|
76
|
+
setLoading(!loading);
|
|
80
77
|
}
|
|
81
|
-
}, "
|
|
78
|
+
}, "Toggle Loading"));
|
|
82
79
|
};
|
|
83
80
|
export default WithLoader;
|
package/es/registry.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as _digigov_ui from '@digigov/ui';
|
|
2
|
+
import * as _digigov_ui_admin from '@digigov/ui/admin';
|
|
2
3
|
import * as _digigov_ui_api_APIErrors from '@digigov/ui/api/APIErrors';
|
|
3
4
|
import * as _digigov_ui_api_APIProvider from '@digigov/ui/api/APIProvider';
|
|
4
5
|
import * as _digigov_ui_api_fetchAPI from '@digigov/ui/api/fetchAPI';
|
|
@@ -7,7 +8,6 @@ import * as _digigov_ui_api_useResource from '@digigov/ui/api/useResource';
|
|
|
7
8
|
import * as _digigov_ui_api_useResourceAction from '@digigov/ui/api/useResourceAction';
|
|
8
9
|
import * as _digigov_ui_api_useResourceQuery from '@digigov/ui/api/useResourceQuery';
|
|
9
10
|
import * as _digigov_ui_api_utils from '@digigov/ui/api/utils';
|
|
10
|
-
import * as _digigov_ui_admin from '@digigov/ui/admin';
|
|
11
11
|
import * as _digigov_ui_app_App from '@digigov/ui/app/App';
|
|
12
12
|
import * as _digigov_ui_app_I18nText from '@digigov/ui/app/I18nText';
|
|
13
13
|
import * as _digigov_ui_app_OutdatedBrowserBanner from '@digigov/ui/app/OutdatedBrowserBanner';
|
|
@@ -47,6 +47,8 @@ import * as _digigov_ui_admin_Pagination from '@digigov/ui/admin/Pagination';
|
|
|
47
47
|
import * as _digigov_ui_admin_ResultsHeading from '@digigov/ui/admin/ResultsHeading';
|
|
48
48
|
import * as _digigov_ui_admin_SearchSection from '@digigov/ui/admin/SearchSection';
|
|
49
49
|
import * as _digigov_ui_admin_TableLoaderBackground from '@digigov/ui/admin/TableLoaderBackground';
|
|
50
|
+
import * as _digigov_ui_admin_TaskList from '@digigov/ui/admin/TaskList';
|
|
51
|
+
import * as _digigov_ui_admin_Timeline from '@digigov/ui/admin/Timeline';
|
|
50
52
|
import * as _digigov_ui_app_Confirmation from '@digigov/ui/app/Confirmation';
|
|
51
53
|
import * as _digigov_ui_app_Footer from '@digigov/ui/app/Footer';
|
|
52
54
|
import * as _digigov_ui_app_Header_HeaderContent from '@digigov/ui/app/Header/HeaderContent';
|
|
@@ -149,6 +151,7 @@ function lazyImport(pkgImport) {
|
|
|
149
151
|
|
|
150
152
|
export default {
|
|
151
153
|
'@digigov/ui': lazyImport(_digigov_ui),
|
|
154
|
+
'@digigov/ui/admin': lazyImport(_digigov_ui_admin),
|
|
152
155
|
'@digigov/ui/api/APIErrors': lazyImport(_digigov_ui_api_APIErrors),
|
|
153
156
|
'@digigov/ui/api/APIProvider': lazyImport(_digigov_ui_api_APIProvider),
|
|
154
157
|
'@digigov/ui/api/fetchAPI': lazyImport(_digigov_ui_api_fetchAPI),
|
|
@@ -157,7 +160,6 @@ export default {
|
|
|
157
160
|
'@digigov/ui/api/useResourceAction': lazyImport(_digigov_ui_api_useResourceAction),
|
|
158
161
|
'@digigov/ui/api/useResourceQuery': lazyImport(_digigov_ui_api_useResourceQuery),
|
|
159
162
|
'@digigov/ui/api/utils': lazyImport(_digigov_ui_api_utils),
|
|
160
|
-
'@digigov/ui/admin': lazyImport(_digigov_ui_admin),
|
|
161
163
|
'@digigov/ui/app/App': lazyImport(_digigov_ui_app_App),
|
|
162
164
|
'@digigov/ui/app/I18nText': lazyImport(_digigov_ui_app_I18nText),
|
|
163
165
|
'@digigov/ui/app/OutdatedBrowserBanner': lazyImport(_digigov_ui_app_OutdatedBrowserBanner),
|
|
@@ -197,6 +199,8 @@ export default {
|
|
|
197
199
|
'@digigov/ui/admin/ResultsHeading': lazyImport(_digigov_ui_admin_ResultsHeading),
|
|
198
200
|
'@digigov/ui/admin/SearchSection': lazyImport(_digigov_ui_admin_SearchSection),
|
|
199
201
|
'@digigov/ui/admin/TableLoaderBackground': lazyImport(_digigov_ui_admin_TableLoaderBackground),
|
|
202
|
+
'@digigov/ui/admin/TaskList': lazyImport(_digigov_ui_admin_TaskList),
|
|
203
|
+
'@digigov/ui/admin/Timeline': lazyImport(_digigov_ui_admin_Timeline),
|
|
200
204
|
'@digigov/ui/app/Confirmation': lazyImport(_digigov_ui_app_Confirmation),
|
|
201
205
|
'@digigov/ui/app/Footer': lazyImport(_digigov_ui_app_Footer),
|
|
202
206
|
'@digigov/ui/app/Header/HeaderContent': lazyImport(_digigov_ui_app_Header_HeaderContent),
|
|
@@ -29,19 +29,37 @@ export var Dropdown = function Dropdown(_ref) {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
var toggleFloat = function toggleFloat() {
|
|
32
|
+
var _innerRef$current;
|
|
33
|
+
|
|
34
|
+
var tbody = innerRef.current.closest('tbody');
|
|
35
|
+
var parentElement = (_innerRef$current = innerRef.current) === null || _innerRef$current === void 0 ? void 0 : _innerRef$current.parentElement;
|
|
36
|
+
|
|
32
37
|
if (innerRef.current.open) {
|
|
33
|
-
var
|
|
34
|
-
|
|
38
|
+
var _innerRef$current2;
|
|
39
|
+
|
|
40
|
+
tbody.style.position = 'static';
|
|
41
|
+
var rect = (_innerRef$current2 = innerRef.current) === null || _innerRef$current2 === void 0 ? void 0 : _innerRef$current2.getBoundingClientRect();
|
|
42
|
+
var parentRect = parentElement.getBoundingClientRect();
|
|
43
|
+
innerRef.current.style.position = 'static'; // arbitrary spacing of 12 pixels because CSS
|
|
44
|
+
|
|
35
45
|
var top = rect.top + window.pageYOffset;
|
|
36
46
|
var left = rect.left + window.pageXOffset;
|
|
47
|
+
parentElement.style.height = "".concat(parentRect.height, "px");
|
|
48
|
+
parentElement.style.width = "".concat(parentRect.width, "px");
|
|
37
49
|
innerRef.current.style.top = "".concat(top, "px");
|
|
38
50
|
innerRef.current.style.left = "".concat(left, "px");
|
|
39
51
|
innerRef.current.style.position = "absolute";
|
|
40
52
|
innerRef.current.style.display = "block";
|
|
53
|
+
innerRef.current.style.background = 'white';
|
|
41
54
|
} else {
|
|
55
|
+
tbody.style.position = 'relative';
|
|
56
|
+
parentElement.style.height = '';
|
|
57
|
+
parentElement.style.width = '';
|
|
42
58
|
innerRef.current.style.top = "0";
|
|
43
59
|
innerRef.current.style.left = "0";
|
|
44
60
|
innerRef.current.style.position = "relative";
|
|
61
|
+
innerRef.current.style.display = "table-cell";
|
|
62
|
+
innerRef.current.style.background = 'transparent';
|
|
45
63
|
}
|
|
46
64
|
};
|
|
47
65
|
|