@digigov/ui 0.14.0 → 0.15.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/CHANGELOG.md +9 -1
- package/admin/Dropdown/index.d.ts +15 -0
- package/admin/Dropdown/index.js +90 -0
- package/admin/index.d.ts +1 -0
- package/admin/index.js +18 -0
- package/core/Table/index.d.ts +1 -1
- package/core/Table/index.js +4 -4
- package/core/index.d.ts +8 -5
- package/core/index.js +78 -22
- package/es/admin/Dropdown/index.js +41 -0
- package/es/admin/index.js +1 -0
- package/es/core/Table/index.js +1 -1
- package/es/core/index.js +8 -5
- package/es/index.js +2 -1
- package/esm/admin/Dropdown/index.js +41 -0
- package/esm/admin/index.js +1 -0
- package/esm/core/Table/index.js +1 -1
- package/esm/core/index.js +8 -5
- package/esm/index.js +3 -2
- package/index.d.ts +1 -0
- package/index.js +13 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
# Change Log - @digigov/ui
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 17 Mar 2022 10:24:06 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 0.15.0
|
|
6
|
+
Thu, 17 Mar 2022 10:24:06 GMT
|
|
7
|
+
|
|
8
|
+
### Minor changes
|
|
9
|
+
|
|
10
|
+
- Integrate @digigov/react-extensions/Dropdown component
|
|
11
|
+
- rename TableHeaderCell to TableHeadCell export
|
|
4
12
|
|
|
5
13
|
## 0.14.0
|
|
6
14
|
Wed, 09 Mar 2022 13:21:47 GMT
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DropdownProps as CoreDropdownProps } from '@digigov/react-extensions/admin/Dropdown';
|
|
3
|
+
export * from '@digigov/react-extensions/admin/DropdownButton';
|
|
4
|
+
export * from '@digigov/react-extensions/admin/DropdownContent';
|
|
5
|
+
export interface DropdownProps extends CoreDropdownProps {
|
|
6
|
+
/**
|
|
7
|
+
* Use closeBehaviour to set the way that the Dropdown will close.
|
|
8
|
+
*/
|
|
9
|
+
closeBehaviour?: 'clickButton' | 'clickOutside';
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Dropdown component is used for showing more options with a button.
|
|
13
|
+
*/
|
|
14
|
+
export declare const Dropdown: ({ closeBehaviour, ...props }: DropdownProps) => React.ReactElement;
|
|
15
|
+
export default Dropdown;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
var _exportNames = {
|
|
11
|
+
Dropdown: true
|
|
12
|
+
};
|
|
13
|
+
exports["default"] = exports.Dropdown = void 0;
|
|
14
|
+
|
|
15
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
16
|
+
|
|
17
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
18
|
+
|
|
19
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
20
|
+
|
|
21
|
+
var _Dropdown = _interopRequireDefault(require("@digigov/react-extensions/admin/Dropdown"));
|
|
22
|
+
|
|
23
|
+
var _DropdownButton = require("@digigov/react-extensions/admin/DropdownButton");
|
|
24
|
+
|
|
25
|
+
Object.keys(_DropdownButton).forEach(function (key) {
|
|
26
|
+
if (key === "default" || key === "__esModule") return;
|
|
27
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
28
|
+
if (key in exports && exports[key] === _DropdownButton[key]) return;
|
|
29
|
+
Object.defineProperty(exports, key, {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: function get() {
|
|
32
|
+
return _DropdownButton[key];
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
var _DropdownContent = require("@digigov/react-extensions/admin/DropdownContent");
|
|
38
|
+
|
|
39
|
+
Object.keys(_DropdownContent).forEach(function (key) {
|
|
40
|
+
if (key === "default" || key === "__esModule") return;
|
|
41
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
42
|
+
if (key in exports && exports[key] === _DropdownContent[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function get() {
|
|
46
|
+
return _DropdownContent[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
var _excluded = ["closeBehaviour"];
|
|
51
|
+
|
|
52
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
53
|
+
|
|
54
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Dropdown component is used for showing more options with a button.
|
|
58
|
+
*/
|
|
59
|
+
var Dropdown = function Dropdown(_ref) {
|
|
60
|
+
var _ref$closeBehaviour = _ref.closeBehaviour,
|
|
61
|
+
closeBehaviour = _ref$closeBehaviour === void 0 ? 'clickOutside' : _ref$closeBehaviour,
|
|
62
|
+
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
63
|
+
var innerRef = (0, _react.useRef)();
|
|
64
|
+
(0, _react.useEffect)(function () {
|
|
65
|
+
var handleClickOutside = function handleClickOutside(event) {
|
|
66
|
+
if (innerRef.current && !innerRef.current.contains(event.target)) {
|
|
67
|
+
innerRef.current.open = false;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
if (closeBehaviour === 'clickOutside') {
|
|
72
|
+
document.addEventListener('click', handleClickOutside, true);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return function () {
|
|
76
|
+
if (closeBehaviour === 'clickOutside') {
|
|
77
|
+
document.removeEventListener('click', handleClickOutside, true);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
}, []); // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
81
|
+
// @ts-ignore
|
|
82
|
+
|
|
83
|
+
return /*#__PURE__*/_react["default"].createElement(_Dropdown["default"], (0, _extends2["default"])({
|
|
84
|
+
ref: innerRef
|
|
85
|
+
}, props));
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
exports.Dropdown = Dropdown;
|
|
89
|
+
var _default = Dropdown;
|
|
90
|
+
exports["default"] = _default;
|
package/admin/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@digigov/ui/admin/Dropdown';
|
package/admin/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _Dropdown = require("@digigov/ui/admin/Dropdown");
|
|
8
|
+
|
|
9
|
+
Object.keys(_Dropdown).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
if (key in exports && exports[key] === _Dropdown[key]) return;
|
|
12
|
+
Object.defineProperty(exports, key, {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _Dropdown[key];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
package/core/Table/index.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ export * from '@digigov/react-core/TableBody';
|
|
|
3
3
|
export * from '@digigov/react-core/TableCaption';
|
|
4
4
|
export * from '@digigov/react-core/TableDataCell';
|
|
5
5
|
export * from '@digigov/react-core/TableHead';
|
|
6
|
-
export * from '@digigov/react-core/
|
|
6
|
+
export * from '@digigov/react-core/TableHeadCell';
|
|
7
7
|
export * from '@digigov/react-core/TableRow';
|
package/core/Table/index.js
CHANGED
|
@@ -69,15 +69,15 @@ Object.keys(_TableHead).forEach(function (key) {
|
|
|
69
69
|
});
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
-
var
|
|
72
|
+
var _TableHeadCell = require("@digigov/react-core/TableHeadCell");
|
|
73
73
|
|
|
74
|
-
Object.keys(
|
|
74
|
+
Object.keys(_TableHeadCell).forEach(function (key) {
|
|
75
75
|
if (key === "default" || key === "__esModule") return;
|
|
76
|
-
if (key in exports && exports[key] ===
|
|
76
|
+
if (key in exports && exports[key] === _TableHeadCell[key]) return;
|
|
77
77
|
Object.defineProperty(exports, key, {
|
|
78
78
|
enumerable: true,
|
|
79
79
|
get: function get() {
|
|
80
|
-
return
|
|
80
|
+
return _TableHeadCell[key];
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
83
|
});
|
package/core/index.d.ts
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
export { default as Button } from '@digigov/ui/core/Button';
|
|
2
2
|
export * from '@digigov/ui/core/Button';
|
|
3
|
-
export { default as WarningText } from '@digigov/ui/core/WarningText';
|
|
4
3
|
export * from '@digigov/ui/core/Accordion';
|
|
5
4
|
export * from '@digigov/ui/core/Blockquote';
|
|
5
|
+
export * from '@digigov/ui/core/Breadcrumbs';
|
|
6
|
+
export * from '@digigov/ui/core/Card';
|
|
6
7
|
export * from '@digigov/ui/core/Details';
|
|
8
|
+
export * from '@digigov/ui/core/Divider';
|
|
7
9
|
export * from '@digigov/ui/core/ErrorSummary';
|
|
10
|
+
export * from '@digigov/ui/core/Hidden';
|
|
8
11
|
export * from '@digigov/ui/core/Link';
|
|
9
12
|
export * from '@digigov/ui/core/List';
|
|
10
13
|
export * from '@digigov/ui/core/NavList';
|
|
11
14
|
export * from '@digigov/ui/core/ServiceBadge';
|
|
12
|
-
export * from '@digigov/ui/core/SummaryList';
|
|
13
|
-
export * from '@digigov/ui/core/Tabs';
|
|
14
15
|
export * from '@digigov/ui/core/NotificationBanner';
|
|
16
|
+
export * from '@digigov/ui/core/SummaryList';
|
|
15
17
|
export * from '@digigov/ui/core/Table';
|
|
16
|
-
export * from '@digigov/ui/core/
|
|
17
|
-
export * from '@digigov/ui/core/
|
|
18
|
+
export * from '@digigov/ui/core/Tabs';
|
|
19
|
+
export * from '@digigov/ui/core/VisuallyHidden';
|
|
20
|
+
export { default as WarningText } from '@digigov/ui/core/WarningText';
|
|
18
21
|
export * from '@digigov/ui/core/PaginationLabel';
|
package/core/index.js
CHANGED
|
@@ -38,8 +38,6 @@ Object.keys(_Button).forEach(function (key) {
|
|
|
38
38
|
});
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
-
var _WarningText = _interopRequireDefault(require("@digigov/ui/core/WarningText"));
|
|
42
|
-
|
|
43
41
|
var _Accordion = require("@digigov/ui/core/Accordion");
|
|
44
42
|
|
|
45
43
|
Object.keys(_Accordion).forEach(function (key) {
|
|
@@ -68,6 +66,34 @@ Object.keys(_Blockquote).forEach(function (key) {
|
|
|
68
66
|
});
|
|
69
67
|
});
|
|
70
68
|
|
|
69
|
+
var _Breadcrumbs = require("@digigov/ui/core/Breadcrumbs");
|
|
70
|
+
|
|
71
|
+
Object.keys(_Breadcrumbs).forEach(function (key) {
|
|
72
|
+
if (key === "default" || key === "__esModule") return;
|
|
73
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
74
|
+
if (key in exports && exports[key] === _Breadcrumbs[key]) return;
|
|
75
|
+
Object.defineProperty(exports, key, {
|
|
76
|
+
enumerable: true,
|
|
77
|
+
get: function get() {
|
|
78
|
+
return _Breadcrumbs[key];
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
var _Card = require("@digigov/ui/core/Card");
|
|
84
|
+
|
|
85
|
+
Object.keys(_Card).forEach(function (key) {
|
|
86
|
+
if (key === "default" || key === "__esModule") return;
|
|
87
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
88
|
+
if (key in exports && exports[key] === _Card[key]) return;
|
|
89
|
+
Object.defineProperty(exports, key, {
|
|
90
|
+
enumerable: true,
|
|
91
|
+
get: function get() {
|
|
92
|
+
return _Card[key];
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
|
|
71
97
|
var _Details = require("@digigov/ui/core/Details");
|
|
72
98
|
|
|
73
99
|
Object.keys(_Details).forEach(function (key) {
|
|
@@ -82,6 +108,20 @@ Object.keys(_Details).forEach(function (key) {
|
|
|
82
108
|
});
|
|
83
109
|
});
|
|
84
110
|
|
|
111
|
+
var _Divider = require("@digigov/ui/core/Divider");
|
|
112
|
+
|
|
113
|
+
Object.keys(_Divider).forEach(function (key) {
|
|
114
|
+
if (key === "default" || key === "__esModule") return;
|
|
115
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
116
|
+
if (key in exports && exports[key] === _Divider[key]) return;
|
|
117
|
+
Object.defineProperty(exports, key, {
|
|
118
|
+
enumerable: true,
|
|
119
|
+
get: function get() {
|
|
120
|
+
return _Divider[key];
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
|
|
85
125
|
var _ErrorSummary = require("@digigov/ui/core/ErrorSummary");
|
|
86
126
|
|
|
87
127
|
Object.keys(_ErrorSummary).forEach(function (key) {
|
|
@@ -96,6 +136,20 @@ Object.keys(_ErrorSummary).forEach(function (key) {
|
|
|
96
136
|
});
|
|
97
137
|
});
|
|
98
138
|
|
|
139
|
+
var _Hidden = require("@digigov/ui/core/Hidden");
|
|
140
|
+
|
|
141
|
+
Object.keys(_Hidden).forEach(function (key) {
|
|
142
|
+
if (key === "default" || key === "__esModule") return;
|
|
143
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
144
|
+
if (key in exports && exports[key] === _Hidden[key]) return;
|
|
145
|
+
Object.defineProperty(exports, key, {
|
|
146
|
+
enumerable: true,
|
|
147
|
+
get: function get() {
|
|
148
|
+
return _Hidden[key];
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
|
|
99
153
|
var _Link = require("@digigov/ui/core/Link");
|
|
100
154
|
|
|
101
155
|
Object.keys(_Link).forEach(function (key) {
|
|
@@ -152,76 +206,78 @@ Object.keys(_ServiceBadge).forEach(function (key) {
|
|
|
152
206
|
});
|
|
153
207
|
});
|
|
154
208
|
|
|
155
|
-
var
|
|
209
|
+
var _NotificationBanner = require("@digigov/ui/core/NotificationBanner");
|
|
156
210
|
|
|
157
|
-
Object.keys(
|
|
211
|
+
Object.keys(_NotificationBanner).forEach(function (key) {
|
|
158
212
|
if (key === "default" || key === "__esModule") return;
|
|
159
213
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
160
|
-
if (key in exports && exports[key] ===
|
|
214
|
+
if (key in exports && exports[key] === _NotificationBanner[key]) return;
|
|
161
215
|
Object.defineProperty(exports, key, {
|
|
162
216
|
enumerable: true,
|
|
163
217
|
get: function get() {
|
|
164
|
-
return
|
|
218
|
+
return _NotificationBanner[key];
|
|
165
219
|
}
|
|
166
220
|
});
|
|
167
221
|
});
|
|
168
222
|
|
|
169
|
-
var
|
|
223
|
+
var _SummaryList = require("@digigov/ui/core/SummaryList");
|
|
170
224
|
|
|
171
|
-
Object.keys(
|
|
225
|
+
Object.keys(_SummaryList).forEach(function (key) {
|
|
172
226
|
if (key === "default" || key === "__esModule") return;
|
|
173
227
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
174
|
-
if (key in exports && exports[key] ===
|
|
228
|
+
if (key in exports && exports[key] === _SummaryList[key]) return;
|
|
175
229
|
Object.defineProperty(exports, key, {
|
|
176
230
|
enumerable: true,
|
|
177
231
|
get: function get() {
|
|
178
|
-
return
|
|
232
|
+
return _SummaryList[key];
|
|
179
233
|
}
|
|
180
234
|
});
|
|
181
235
|
});
|
|
182
236
|
|
|
183
|
-
var
|
|
237
|
+
var _Table = require("@digigov/ui/core/Table");
|
|
184
238
|
|
|
185
|
-
Object.keys(
|
|
239
|
+
Object.keys(_Table).forEach(function (key) {
|
|
186
240
|
if (key === "default" || key === "__esModule") return;
|
|
187
241
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
188
|
-
if (key in exports && exports[key] ===
|
|
242
|
+
if (key in exports && exports[key] === _Table[key]) return;
|
|
189
243
|
Object.defineProperty(exports, key, {
|
|
190
244
|
enumerable: true,
|
|
191
245
|
get: function get() {
|
|
192
|
-
return
|
|
246
|
+
return _Table[key];
|
|
193
247
|
}
|
|
194
248
|
});
|
|
195
249
|
});
|
|
196
250
|
|
|
197
|
-
var
|
|
251
|
+
var _Tabs = require("@digigov/ui/core/Tabs");
|
|
198
252
|
|
|
199
|
-
Object.keys(
|
|
253
|
+
Object.keys(_Tabs).forEach(function (key) {
|
|
200
254
|
if (key === "default" || key === "__esModule") return;
|
|
201
255
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
202
|
-
if (key in exports && exports[key] ===
|
|
256
|
+
if (key in exports && exports[key] === _Tabs[key]) return;
|
|
203
257
|
Object.defineProperty(exports, key, {
|
|
204
258
|
enumerable: true,
|
|
205
259
|
get: function get() {
|
|
206
|
-
return
|
|
260
|
+
return _Tabs[key];
|
|
207
261
|
}
|
|
208
262
|
});
|
|
209
263
|
});
|
|
210
264
|
|
|
211
|
-
var
|
|
265
|
+
var _VisuallyHidden = require("@digigov/ui/core/VisuallyHidden");
|
|
212
266
|
|
|
213
|
-
Object.keys(
|
|
267
|
+
Object.keys(_VisuallyHidden).forEach(function (key) {
|
|
214
268
|
if (key === "default" || key === "__esModule") return;
|
|
215
269
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
216
|
-
if (key in exports && exports[key] ===
|
|
270
|
+
if (key in exports && exports[key] === _VisuallyHidden[key]) return;
|
|
217
271
|
Object.defineProperty(exports, key, {
|
|
218
272
|
enumerable: true,
|
|
219
273
|
get: function get() {
|
|
220
|
-
return
|
|
274
|
+
return _VisuallyHidden[key];
|
|
221
275
|
}
|
|
222
276
|
});
|
|
223
277
|
});
|
|
224
278
|
|
|
279
|
+
var _WarningText = _interopRequireDefault(require("@digigov/ui/core/WarningText"));
|
|
280
|
+
|
|
225
281
|
var _PaginationLabel = require("@digigov/ui/core/PaginationLabel");
|
|
226
282
|
|
|
227
283
|
Object.keys(_PaginationLabel).forEach(function (key) {
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["closeBehaviour"];
|
|
4
|
+
import React, { useEffect, useRef } from 'react';
|
|
5
|
+
import CoreDropdown from '@digigov/react-extensions/admin/Dropdown';
|
|
6
|
+
export * from '@digigov/react-extensions/admin/DropdownButton';
|
|
7
|
+
export * from '@digigov/react-extensions/admin/DropdownContent';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Dropdown component is used for showing more options with a button.
|
|
11
|
+
*/
|
|
12
|
+
export var Dropdown = function Dropdown(_ref) {
|
|
13
|
+
var _ref$closeBehaviour = _ref.closeBehaviour,
|
|
14
|
+
closeBehaviour = _ref$closeBehaviour === void 0 ? 'clickOutside' : _ref$closeBehaviour,
|
|
15
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
16
|
+
|
|
17
|
+
var innerRef = useRef();
|
|
18
|
+
useEffect(function () {
|
|
19
|
+
var handleClickOutside = function handleClickOutside(event) {
|
|
20
|
+
if (innerRef.current && !innerRef.current.contains(event.target)) {
|
|
21
|
+
innerRef.current.open = false;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
if (closeBehaviour === 'clickOutside') {
|
|
26
|
+
document.addEventListener('click', handleClickOutside, true);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return function () {
|
|
30
|
+
if (closeBehaviour === 'clickOutside') {
|
|
31
|
+
document.removeEventListener('click', handleClickOutside, true);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}, []); // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
|
|
37
|
+
return /*#__PURE__*/React.createElement(CoreDropdown, _extends({
|
|
38
|
+
ref: innerRef
|
|
39
|
+
}, props));
|
|
40
|
+
};
|
|
41
|
+
export default Dropdown;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@digigov/ui/admin/Dropdown';
|
package/es/core/Table/index.js
CHANGED
|
@@ -3,5 +3,5 @@ export * from '@digigov/react-core/TableBody';
|
|
|
3
3
|
export * from '@digigov/react-core/TableCaption';
|
|
4
4
|
export * from '@digigov/react-core/TableDataCell';
|
|
5
5
|
export * from '@digigov/react-core/TableHead';
|
|
6
|
-
export * from '@digigov/react-core/
|
|
6
|
+
export * from '@digigov/react-core/TableHeadCell';
|
|
7
7
|
export * from '@digigov/react-core/TableRow';
|
package/es/core/index.js
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
export { default as Button } from '@digigov/ui/core/Button';
|
|
2
2
|
export * from '@digigov/ui/core/Button';
|
|
3
|
-
export { default as WarningText } from '@digigov/ui/core/WarningText';
|
|
4
3
|
export * from '@digigov/ui/core/Accordion';
|
|
5
4
|
export * from '@digigov/ui/core/Blockquote';
|
|
5
|
+
export * from '@digigov/ui/core/Breadcrumbs';
|
|
6
|
+
export * from '@digigov/ui/core/Card';
|
|
6
7
|
export * from '@digigov/ui/core/Details';
|
|
8
|
+
export * from '@digigov/ui/core/Divider';
|
|
7
9
|
export * from '@digigov/ui/core/ErrorSummary';
|
|
10
|
+
export * from '@digigov/ui/core/Hidden';
|
|
8
11
|
export * from '@digigov/ui/core/Link';
|
|
9
12
|
export * from '@digigov/ui/core/List';
|
|
10
13
|
export * from '@digigov/ui/core/NavList';
|
|
11
14
|
export * from '@digigov/ui/core/ServiceBadge';
|
|
12
|
-
export * from '@digigov/ui/core/SummaryList';
|
|
13
|
-
export * from '@digigov/ui/core/Tabs';
|
|
14
15
|
export * from '@digigov/ui/core/NotificationBanner';
|
|
16
|
+
export * from '@digigov/ui/core/SummaryList';
|
|
15
17
|
export * from '@digigov/ui/core/Table';
|
|
16
|
-
export * from '@digigov/ui/core/
|
|
17
|
-
export * from '@digigov/ui/core/
|
|
18
|
+
export * from '@digigov/ui/core/Tabs';
|
|
19
|
+
export * from '@digigov/ui/core/VisuallyHidden';
|
|
20
|
+
export { default as WarningText } from '@digigov/ui/core/WarningText';
|
|
18
21
|
export * from '@digigov/ui/core/PaginationLabel';
|
package/es/index.js
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["closeBehaviour"];
|
|
4
|
+
import React, { useEffect, useRef } from 'react';
|
|
5
|
+
import CoreDropdown from '@digigov/react-extensions/admin/Dropdown';
|
|
6
|
+
export * from '@digigov/react-extensions/admin/DropdownButton';
|
|
7
|
+
export * from '@digigov/react-extensions/admin/DropdownContent';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Dropdown component is used for showing more options with a button.
|
|
11
|
+
*/
|
|
12
|
+
export var Dropdown = function Dropdown(_ref) {
|
|
13
|
+
var _ref$closeBehaviour = _ref.closeBehaviour,
|
|
14
|
+
closeBehaviour = _ref$closeBehaviour === void 0 ? 'clickOutside' : _ref$closeBehaviour,
|
|
15
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
16
|
+
|
|
17
|
+
var innerRef = useRef();
|
|
18
|
+
useEffect(function () {
|
|
19
|
+
var handleClickOutside = function handleClickOutside(event) {
|
|
20
|
+
if (innerRef.current && !innerRef.current.contains(event.target)) {
|
|
21
|
+
innerRef.current.open = false;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
if (closeBehaviour === 'clickOutside') {
|
|
26
|
+
document.addEventListener('click', handleClickOutside, true);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return function () {
|
|
30
|
+
if (closeBehaviour === 'clickOutside') {
|
|
31
|
+
document.removeEventListener('click', handleClickOutside, true);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}, []); // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
|
|
37
|
+
return /*#__PURE__*/React.createElement(CoreDropdown, _extends({
|
|
38
|
+
ref: innerRef
|
|
39
|
+
}, props));
|
|
40
|
+
};
|
|
41
|
+
export default Dropdown;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@digigov/ui/admin/Dropdown';
|
package/esm/core/Table/index.js
CHANGED
|
@@ -3,5 +3,5 @@ export * from '@digigov/react-core/TableBody';
|
|
|
3
3
|
export * from '@digigov/react-core/TableCaption';
|
|
4
4
|
export * from '@digigov/react-core/TableDataCell';
|
|
5
5
|
export * from '@digigov/react-core/TableHead';
|
|
6
|
-
export * from '@digigov/react-core/
|
|
6
|
+
export * from '@digigov/react-core/TableHeadCell';
|
|
7
7
|
export * from '@digigov/react-core/TableRow';
|
package/esm/core/index.js
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
export { default as Button } from '@digigov/ui/core/Button';
|
|
2
2
|
export * from '@digigov/ui/core/Button';
|
|
3
|
-
export { default as WarningText } from '@digigov/ui/core/WarningText';
|
|
4
3
|
export * from '@digigov/ui/core/Accordion';
|
|
5
4
|
export * from '@digigov/ui/core/Blockquote';
|
|
5
|
+
export * from '@digigov/ui/core/Breadcrumbs';
|
|
6
|
+
export * from '@digigov/ui/core/Card';
|
|
6
7
|
export * from '@digigov/ui/core/Details';
|
|
8
|
+
export * from '@digigov/ui/core/Divider';
|
|
7
9
|
export * from '@digigov/ui/core/ErrorSummary';
|
|
10
|
+
export * from '@digigov/ui/core/Hidden';
|
|
8
11
|
export * from '@digigov/ui/core/Link';
|
|
9
12
|
export * from '@digigov/ui/core/List';
|
|
10
13
|
export * from '@digigov/ui/core/NavList';
|
|
11
14
|
export * from '@digigov/ui/core/ServiceBadge';
|
|
12
|
-
export * from '@digigov/ui/core/SummaryList';
|
|
13
|
-
export * from '@digigov/ui/core/Tabs';
|
|
14
15
|
export * from '@digigov/ui/core/NotificationBanner';
|
|
16
|
+
export * from '@digigov/ui/core/SummaryList';
|
|
15
17
|
export * from '@digigov/ui/core/Table';
|
|
16
|
-
export * from '@digigov/ui/core/
|
|
17
|
-
export * from '@digigov/ui/core/
|
|
18
|
+
export * from '@digigov/ui/core/Tabs';
|
|
19
|
+
export * from '@digigov/ui/core/VisuallyHidden';
|
|
20
|
+
export { default as WarningText } from '@digigov/ui/core/WarningText';
|
|
18
21
|
export * from '@digigov/ui/core/PaginationLabel';
|
package/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license Digigov v0.
|
|
1
|
+
/** @license Digigov v0.15.0
|
|
2
2
|
*
|
|
3
3
|
* This source code is licensed under the MIT license found in the
|
|
4
4
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -7,4 +7,5 @@ export * from '@digigov/ui/core';
|
|
|
7
7
|
export * from '@digigov/ui/layouts';
|
|
8
8
|
export * from '@digigov/ui/typography';
|
|
9
9
|
export * from '@digigov/ui/app';
|
|
10
|
-
export * from '@digigov/ui/govgr';
|
|
10
|
+
export * from '@digigov/ui/govgr';
|
|
11
|
+
export * from '@digigov/ui/admin';
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -67,4 +67,17 @@ Object.keys(_govgr).forEach(function (key) {
|
|
|
67
67
|
return _govgr[key];
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
var _admin = require("@digigov/ui/admin");
|
|
73
|
+
|
|
74
|
+
Object.keys(_admin).forEach(function (key) {
|
|
75
|
+
if (key === "default" || key === "__esModule") return;
|
|
76
|
+
if (key in exports && exports[key] === _admin[key]) return;
|
|
77
|
+
Object.defineProperty(exports, key, {
|
|
78
|
+
enumerable: true,
|
|
79
|
+
get: function get() {
|
|
80
|
+
return _admin[key];
|
|
81
|
+
}
|
|
82
|
+
});
|
|
70
83
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digigov/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "@digigov reusable components toolkit",
|
|
5
5
|
"module": "./esm/index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"clsx": "1.1.1",
|
|
19
19
|
"react": "16.14.0",
|
|
20
20
|
"react-dom": "16.14.0",
|
|
21
|
-
"@digigov/react-core": "0.
|
|
22
|
-
"@digigov/react-extensions": "0.
|
|
21
|
+
"@digigov/react-core": "0.9.0",
|
|
22
|
+
"@digigov/react-extensions": "0.9.0"
|
|
23
23
|
},
|
|
24
24
|
"gitHead": "c903a46306f77f55ad7fc4d2e274006f39a6c871",
|
|
25
25
|
"private": false,
|