@canonical/react-components 0.24.0 → 0.32.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/dist/components/Accordion/Accordion.js +9 -6
- package/dist/components/AccordionSection/AccordionSection.js +7 -24
- package/dist/components/ActionButton/ActionButton.js +9 -10
- package/dist/components/ArticlePagination/ArticlePagination.js +3 -1
- package/dist/components/Button/Button.d.ts +1 -2
- package/dist/components/Button/Button.js +5 -17
- package/dist/components/Button/index.js +7 -7
- package/dist/components/Card/Card.js +3 -1
- package/dist/components/CheckableInput/CheckableInput.d.ts +9 -1
- package/dist/components/CheckableInput/CheckableInput.js +13 -10
- package/dist/components/CheckboxInput/CheckboxInput.js +3 -1
- package/dist/components/Chip/Chip.d.ts +13 -2
- package/dist/components/Chip/Chip.js +45 -31
- package/dist/components/Code/Code.js +6 -4
- package/dist/components/CodeSnippet/CodeSnippetBlock.js +2 -13
- package/dist/components/CodeSnippet/CodeSnippetDropdown.js +6 -10
- package/dist/components/CodeSnippet/index.js +4 -4
- package/dist/components/Col/Col.js +3 -1
- package/dist/components/Col/index.js +7 -7
- package/dist/components/ContextualMenu/ContextualMenu.js +14 -11
- package/dist/components/ContextualMenu/ContextualMenuDropdown/ContextualMenuDropdown.js +11 -24
- package/dist/components/Field/Field.js +0 -16
- package/dist/components/Form/Form.js +3 -1
- package/dist/components/Icon/Icon.js +3 -1
- package/dist/components/Icon/index.js +7 -7
- package/dist/components/Input/Input.js +40 -14
- package/dist/components/Label/Label.js +3 -1
- package/dist/components/Link/Link.d.ts +1 -5
- package/dist/components/Link/Link.js +3 -4
- package/dist/components/List/List.js +9 -19
- package/dist/components/MainTable/MainTable.d.ts +4 -0
- package/dist/components/MainTable/MainTable.js +23 -11
- package/dist/components/Modal/Modal.js +14 -12
- package/dist/components/Notification/Notification.js +6 -4
- package/dist/components/Notification/index.js +7 -7
- package/dist/components/Pagination/Pagination.js +3 -1
- package/dist/components/PaginationButton/PaginationButton.js +1 -8
- package/dist/components/PaginationItem/PaginationItem.js +0 -7
- package/dist/components/PasswordToggle/PasswordToggle.d.ts +9 -1
- package/dist/components/PasswordToggle/PasswordToggle.js +10 -6
- package/dist/components/RadioInput/RadioInput.js +3 -1
- package/dist/components/Row/Row.js +3 -1
- package/dist/components/SearchAndFilter/FilterPanelSection/FilterPanelSection.js +7 -8
- package/dist/components/SearchAndFilter/SearchAndFilter.js +8 -6
- package/dist/components/SearchAndFilter/utils.js +1 -1
- package/dist/components/Select/Select.js +8 -5
- package/dist/components/Slider/Slider.d.ts +1 -0
- package/dist/components/Slider/Slider.js +7 -3
- package/dist/components/Spinner/Spinner.d.ts +11 -2
- package/dist/components/Spinner/Spinner.js +24 -6
- package/dist/components/Strip/Strip.js +3 -1
- package/dist/components/SummaryButton/SummaryButton.js +0 -11
- package/dist/components/Switch/Switch.d.ts +14 -0
- package/dist/components/Switch/Switch.js +42 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Switch/index.js +15 -0
- package/dist/components/Table/Table.js +3 -1
- package/dist/components/TableCell/TableCell.js +3 -1
- package/dist/components/TableHeader/TableHeader.js +3 -1
- package/dist/components/TableRow/TableRow.js +3 -1
- package/dist/components/Tabs/Tabs.js +3 -7
- package/dist/components/Textarea/Textarea.js +8 -6
- package/dist/components/Tooltip/Tooltip.js +4 -15
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +11 -3
- package/dist/hooks/useId.d.ts +6 -0
- package/dist/hooks/useId.js +21 -0
- package/dist/hooks/useListener.js +1 -7
- package/dist/hooks/usePrevious.js +1 -7
- package/dist/hooks/useThrottle.js +2 -8
- package/dist/hooks/useWindowFitment.js +1 -7
- package/dist/index.d.ts +3 -0
- package/dist/index.js +51 -11
- package/package.json +57 -51
|
@@ -5,12 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
|
|
10
8
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
9
|
|
|
12
10
|
var _react = _interopRequireDefault(require("react"));
|
|
13
11
|
|
|
12
|
+
var _excluded = ["title", "className", "content", "titleElement"],
|
|
13
|
+
_excluded2 = ["title", "className", "content"],
|
|
14
|
+
_excluded3 = ["className", "detailed", "divided", "inline", "isDark", "items", "middot", "stretch", "split", "stepped", "ticked"];
|
|
15
|
+
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
17
|
|
|
16
18
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
@@ -19,7 +21,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
19
21
|
|
|
20
22
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
21
23
|
|
|
22
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
24
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
23
25
|
|
|
24
26
|
var generateItems = function generateItems(items, ticked, inline, stepped) {
|
|
25
27
|
return items.map(function (item, i) {
|
|
@@ -30,7 +32,7 @@ var generateItems = function generateItems(items, ticked, inline, stepped) {
|
|
|
30
32
|
var TitleComponent = "h3";
|
|
31
33
|
var liProps;
|
|
32
34
|
|
|
33
|
-
if (_react.default.isValidElement(item) || typeof item === "string" || typeof item === "number") {
|
|
35
|
+
if ( /*#__PURE__*/_react.default.isValidElement(item) || typeof item === "string" || typeof item === "number") {
|
|
34
36
|
content = item;
|
|
35
37
|
} else if (item && _typeof(item) === "object" && "content" in item) {
|
|
36
38
|
if ("titleElement" in item) {
|
|
@@ -40,14 +42,14 @@ var generateItems = function generateItems(items, ticked, inline, stepped) {
|
|
|
40
42
|
content = _item.content;
|
|
41
43
|
var _item$titleElement = _item.titleElement;
|
|
42
44
|
TitleComponent = _item$titleElement === void 0 ? "h3" : _item$titleElement;
|
|
43
|
-
liProps = _objectWithoutProperties(_item,
|
|
45
|
+
liProps = _objectWithoutProperties(_item, _excluded);
|
|
44
46
|
_item;
|
|
45
47
|
} else {
|
|
46
48
|
var _item2 = item;
|
|
47
49
|
title = _item2.title;
|
|
48
50
|
className = _item2.className;
|
|
49
51
|
content = _item2.content;
|
|
50
|
-
liProps = _objectWithoutProperties(_item2,
|
|
52
|
+
liProps = _objectWithoutProperties(_item2, _excluded2);
|
|
51
53
|
_item2;
|
|
52
54
|
}
|
|
53
55
|
}
|
|
@@ -86,7 +88,7 @@ var List = function List(_ref) {
|
|
|
86
88
|
split = _ref.split,
|
|
87
89
|
stepped = _ref.stepped,
|
|
88
90
|
ticked = _ref.ticked,
|
|
89
|
-
props = _objectWithoutProperties(_ref,
|
|
91
|
+
props = _objectWithoutProperties(_ref, _excluded3);
|
|
90
92
|
|
|
91
93
|
var Component = stepped ? "ol" : "ul";
|
|
92
94
|
return /*#__PURE__*/_react.default.createElement(Component, _extends({
|
|
@@ -104,17 +106,5 @@ var List = function List(_ref) {
|
|
|
104
106
|
}, props), generateItems(items, ticked, inline || middot || stretch, stepped));
|
|
105
107
|
};
|
|
106
108
|
|
|
107
|
-
List.propTypes = {
|
|
108
|
-
items: _propTypes.default.oneOfType([_propTypes.default.array, _propTypes.default.array]).isRequired,
|
|
109
|
-
detailed: _propTypes.default.bool,
|
|
110
|
-
divided: _propTypes.default.bool,
|
|
111
|
-
inline: _propTypes.default.bool,
|
|
112
|
-
isDark: _propTypes.default.bool,
|
|
113
|
-
middot: _propTypes.default.bool,
|
|
114
|
-
split: _propTypes.default.bool,
|
|
115
|
-
stepped: _propTypes.default.bool,
|
|
116
|
-
stretch: _propTypes.default.bool,
|
|
117
|
-
ticked: _propTypes.default.bool
|
|
118
|
-
};
|
|
119
109
|
var _default = List;
|
|
120
110
|
exports.default = _default;
|
|
@@ -15,6 +15,10 @@ export declare type MainTableHeader = PropsWithSpread<{
|
|
|
15
15
|
* A key to sort the rows by. It should match a key given to the row `sortData`.
|
|
16
16
|
*/
|
|
17
17
|
sortKey?: string | null;
|
|
18
|
+
/**
|
|
19
|
+
* Replacement value for data-heading if content is not a string.
|
|
20
|
+
*/
|
|
21
|
+
heading?: string;
|
|
18
22
|
}, HTMLProps<HTMLTableHeaderCellElement>>;
|
|
19
23
|
export declare type MainTableCell = PropsWithSpread<{
|
|
20
24
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -19,19 +19,24 @@ var _TableHeader = _interopRequireDefault(require("../TableHeader"));
|
|
|
19
19
|
|
|
20
20
|
var _TableCell = _interopRequireDefault(require("../TableCell"));
|
|
21
21
|
|
|
22
|
+
var _excluded = ["content", "sortKey"],
|
|
23
|
+
_excluded2 = ["columns", "expanded", "expandedContent", "key", "sortData"],
|
|
24
|
+
_excluded3 = ["content"],
|
|
25
|
+
_excluded4 = ["defaultSort", "defaultSortDirection", "emptyStateMsg", "expanding", "headers", "onUpdateSort", "paginate", "rows", "responsive", "sortable", "sortFunction"];
|
|
26
|
+
|
|
22
27
|
var _this = void 0;
|
|
23
28
|
|
|
24
29
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
30
|
|
|
26
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var
|
|
31
|
+
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); }
|
|
27
32
|
|
|
28
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }
|
|
33
|
+
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; }
|
|
29
34
|
|
|
30
35
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
31
36
|
|
|
32
37
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
33
38
|
|
|
34
|
-
function _iterableToArrayLimit(arr, i) {
|
|
39
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
35
40
|
|
|
36
41
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
42
|
|
|
@@ -41,7 +46,7 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
|
|
|
41
46
|
|
|
42
47
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
43
48
|
|
|
44
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator
|
|
49
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
45
50
|
|
|
46
51
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
47
52
|
|
|
@@ -72,7 +77,7 @@ var generateHeaders = function generateHeaders(currentSortKey, currentSortDirect
|
|
|
72
77
|
var headerItems = headers.map(function (_ref, index) {
|
|
73
78
|
var content = _ref.content,
|
|
74
79
|
sortKey = _ref.sortKey,
|
|
75
|
-
props = _objectWithoutProperties(_ref,
|
|
80
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
76
81
|
|
|
77
82
|
var sortDirection;
|
|
78
83
|
|
|
@@ -97,7 +102,7 @@ var generateHeaders = function generateHeaders(currentSortKey, currentSortDirect
|
|
|
97
102
|
})));
|
|
98
103
|
};
|
|
99
104
|
|
|
100
|
-
var generateRows = function generateRows(currentSortDirection, currentSortKey, emptyStateMsg, expanding, paginate, rows, currentPage, setCurrentPage, sortable, sortFunction) {
|
|
105
|
+
var generateRows = function generateRows(currentSortDirection, currentSortKey, emptyStateMsg, expanding, responsive, headers, paginate, rows, currentPage, setCurrentPage, sortable, sortFunction) {
|
|
101
106
|
// If the table has no rows, return empty state message
|
|
102
107
|
if (Object.entries(rows).length === 0 && emptyStateMsg) {
|
|
103
108
|
return /*#__PURE__*/_react.default.createElement("caption", null, emptyStateMsg);
|
|
@@ -148,11 +153,18 @@ var generateRows = function generateRows(currentSortDirection, currentSortKey, e
|
|
|
148
153
|
expandedContent = _ref2.expandedContent,
|
|
149
154
|
key = _ref2.key,
|
|
150
155
|
sortData = _ref2.sortData,
|
|
151
|
-
rowProps = _objectWithoutProperties(_ref2,
|
|
156
|
+
rowProps = _objectWithoutProperties(_ref2, _excluded2);
|
|
152
157
|
|
|
153
158
|
var cellItems = columns.map(function (_ref3, index) {
|
|
154
159
|
var content = _ref3.content,
|
|
155
|
-
cellProps = _objectWithoutProperties(_ref3,
|
|
160
|
+
cellProps = _objectWithoutProperties(_ref3, _excluded3);
|
|
161
|
+
|
|
162
|
+
var headerContent = headers && headers[index]["content"];
|
|
163
|
+
var headerReplacement = headers && headers[index]["heading"];
|
|
164
|
+
|
|
165
|
+
if (responsive) {
|
|
166
|
+
cellProps["data-heading"] = typeof headerContent === "string" ? headerContent : headerReplacement;
|
|
167
|
+
}
|
|
156
168
|
|
|
157
169
|
return /*#__PURE__*/_react.default.createElement(_TableCell.default, _extends({
|
|
158
170
|
key: index
|
|
@@ -188,7 +200,7 @@ var MainTable = function MainTable(_ref4) {
|
|
|
188
200
|
responsive = _ref4.responsive,
|
|
189
201
|
sortable = _ref4.sortable,
|
|
190
202
|
sortFunction = _ref4.sortFunction,
|
|
191
|
-
props = _objectWithoutProperties(_ref4,
|
|
203
|
+
props = _objectWithoutProperties(_ref4, _excluded4);
|
|
192
204
|
|
|
193
205
|
var _useState = (0, _react.useState)(defaultSort),
|
|
194
206
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -222,7 +234,7 @@ var MainTable = function MainTable(_ref4) {
|
|
|
222
234
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Table.default, _extends({
|
|
223
235
|
expanding: expanding,
|
|
224
236
|
responsive: responsive
|
|
225
|
-
}, props), !!headers && generateHeaders(currentSortKey, currentSortDirection, expanding, headers, sortable, updateSort, setSortDirection), !!rows && generateRows(currentSortDirection, currentSortKey, emptyStateMsg, expanding, paginate, rows, currentPage, setCurrentPage, sortable, sortFunction)), paginate && rows && rows.length > 0 && /*#__PURE__*/_react.default.createElement(_Pagination.default, {
|
|
237
|
+
}, props), !!headers && generateHeaders(currentSortKey, currentSortDirection, expanding, headers, sortable, updateSort, setSortDirection), !!rows && generateRows(currentSortDirection, currentSortKey, emptyStateMsg, expanding, responsive, headers, paginate, rows, currentPage, setCurrentPage, sortable, sortFunction)), paginate && rows && rows.length > 0 && /*#__PURE__*/_react.default.createElement(_Pagination.default, {
|
|
226
238
|
currentPage: currentPage,
|
|
227
239
|
itemsPerPage: paginate,
|
|
228
240
|
paginate: setCurrentPage,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -9,13 +9,15 @@ exports.default = exports.Modal = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
11
|
|
|
12
|
-
var _nanoid = require("nanoid");
|
|
13
|
-
|
|
14
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
13
|
|
|
16
|
-
|
|
14
|
+
var _useId = require("../../hooks/useId");
|
|
15
|
+
|
|
16
|
+
var _excluded = ["buttonRow", "children", "className", "close", "title"];
|
|
17
|
+
|
|
18
|
+
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); }
|
|
17
19
|
|
|
18
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }
|
|
20
|
+
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; }
|
|
19
21
|
|
|
20
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
23
|
|
|
@@ -31,13 +33,13 @@ var Modal = function Modal(_ref) {
|
|
|
31
33
|
className = _ref.className,
|
|
32
34
|
close = _ref.close,
|
|
33
35
|
title = _ref.title,
|
|
34
|
-
wrapperProps = _objectWithoutProperties(_ref,
|
|
36
|
+
wrapperProps = _objectWithoutProperties(_ref, _excluded);
|
|
35
37
|
|
|
36
38
|
// list of focusable selectors is based on this Stack Overflow answer:
|
|
37
39
|
// https://stackoverflow.com/a/30753870/3732840
|
|
38
40
|
var focusableElementSelectors = 'a[href]:not([tabindex="-1"]), button:not([disabled]), textarea:not([disabled]):not([tabindex="-1"]), input:not([disabled]):not([tabindex="-1"]), select:not([disabled]):not([tabindex="-1"]), area[href]:not([tabindex="-1"]), iframe:not([tabindex="-1"]), [tabindex]:not([tabindex="-1"]), [contentEditable=true]:not([tabindex="-1"])';
|
|
39
|
-
var descriptionId = (0,
|
|
40
|
-
var titleId = (0,
|
|
41
|
+
var descriptionId = (0, _useId.useId)();
|
|
42
|
+
var titleId = (0, _useId.useId)();
|
|
41
43
|
var shouldClose = (0, _react.useRef)(false);
|
|
42
44
|
var modalRef = (0, _react.useRef)(null);
|
|
43
45
|
var focusableModalElements = (0, _react.useRef)(null);
|
|
@@ -111,21 +113,21 @@ var Modal = function Modal(_ref) {
|
|
|
111
113
|
className: "p-modal__dialog",
|
|
112
114
|
role: "dialog",
|
|
113
115
|
"aria-modal": "true",
|
|
114
|
-
"aria-labelledby": titleId
|
|
115
|
-
"aria-describedby": descriptionId
|
|
116
|
+
"aria-labelledby": titleId,
|
|
117
|
+
"aria-describedby": descriptionId,
|
|
116
118
|
onMouseDown: handleContentOnMouseDown,
|
|
117
119
|
onMouseUp: handleContentOnMouseUp
|
|
118
120
|
}, !!title && /*#__PURE__*/_react.default.createElement("header", {
|
|
119
121
|
className: "p-modal__header"
|
|
120
122
|
}, /*#__PURE__*/_react.default.createElement("h2", {
|
|
121
123
|
className: "p-modal__title",
|
|
122
|
-
id: titleId
|
|
124
|
+
id: titleId
|
|
123
125
|
}, title), !!close && /*#__PURE__*/_react.default.createElement("button", {
|
|
124
126
|
className: "p-modal__close",
|
|
125
127
|
"aria-label": "Close active modal",
|
|
126
128
|
onClick: close
|
|
127
129
|
}, "Close")), /*#__PURE__*/_react.default.createElement("div", {
|
|
128
|
-
id: descriptionId
|
|
130
|
+
id: descriptionId
|
|
129
131
|
}, children), !!buttonRow && /*#__PURE__*/_react.default.createElement("footer", {
|
|
130
132
|
className: "p-modal__footer"
|
|
131
133
|
}, buttonRow)));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -15,9 +15,11 @@ var _Button = _interopRequireWildcard(require("../Button"));
|
|
|
15
15
|
|
|
16
16
|
var _utils = require("../../utils");
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
var _excluded = ["actions", "borderless", "children", "className", "close", "inline", "onDismiss", "severity", "status", "timeout", "timestamp", "title", "type"];
|
|
19
19
|
|
|
20
|
-
function
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
21
23
|
|
|
22
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
25
|
|
|
@@ -56,7 +58,7 @@ var Notification = function Notification(_ref) {
|
|
|
56
58
|
timestamp = _ref.timestamp,
|
|
57
59
|
title = _ref.title,
|
|
58
60
|
type = _ref.type,
|
|
59
|
-
props = _objectWithoutProperties(_ref,
|
|
61
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
60
62
|
|
|
61
63
|
var timeoutId = (0, _react.useRef)(null);
|
|
62
64
|
var hasActions = (actions === null || actions === void 0 ? void 0 : actions.length) > 0;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
Object.defineProperty(exports, "
|
|
8
|
+
Object.defineProperty(exports, "NotificationSeverity", {
|
|
9
9
|
enumerable: true,
|
|
10
10
|
get: function get() {
|
|
11
|
-
return _Notification.
|
|
11
|
+
return _Notification.NotificationSeverity;
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
|
-
Object.defineProperty(exports, "
|
|
14
|
+
Object.defineProperty(exports, "default", {
|
|
15
15
|
enumerable: true,
|
|
16
16
|
get: function get() {
|
|
17
|
-
return _Notification.
|
|
17
|
+
return _Notification.default;
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
var _Notification = _interopRequireWildcard(require("./Notification"));
|
|
22
22
|
|
|
23
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var
|
|
23
|
+
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); }
|
|
24
24
|
|
|
25
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }
|
|
25
|
+
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; }
|
|
@@ -11,6 +11,8 @@ var _PaginationButton = _interopRequireDefault(require("../PaginationButton"));
|
|
|
11
11
|
|
|
12
12
|
var _PaginationItem = _interopRequireDefault(require("../PaginationItem"));
|
|
13
13
|
|
|
14
|
+
var _excluded = ["itemsPerPage", "totalItems", "paginate", "currentPage", "scrollToTop", "truncateThreshold"];
|
|
15
|
+
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
17
|
|
|
16
18
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -119,7 +121,7 @@ var Pagination = function Pagination(_ref) {
|
|
|
119
121
|
scrollToTop = _ref.scrollToTop,
|
|
120
122
|
_ref$truncateThreshol = _ref.truncateThreshold,
|
|
121
123
|
truncateThreshold = _ref$truncateThreshol === void 0 ? 10 : _ref$truncateThreshol,
|
|
122
|
-
navProps = _objectWithoutProperties(_ref,
|
|
124
|
+
navProps = _objectWithoutProperties(_ref, _excluded);
|
|
123
125
|
|
|
124
126
|
// return early if no pagination is required
|
|
125
127
|
if (totalItems <= itemsPerPage) {
|
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
|
|
10
8
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
9
|
|
|
12
10
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -29,14 +27,9 @@ var PaginationButton = function PaginationButton(_ref) {
|
|
|
29
27
|
disabled: disabled,
|
|
30
28
|
onClick: onClick
|
|
31
29
|
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
32
|
-
className: "p-icon--
|
|
30
|
+
className: "p-icon--chevron-down"
|
|
33
31
|
}, label)));
|
|
34
32
|
};
|
|
35
33
|
|
|
36
|
-
PaginationButton.propTypes = {
|
|
37
|
-
direction: _propTypes.default.oneOf(["forward", "back"]).isRequired,
|
|
38
|
-
disabled: _propTypes.default.bool,
|
|
39
|
-
onClick: _propTypes.default.func.isRequired
|
|
40
|
-
};
|
|
41
34
|
var _default = PaginationButton;
|
|
42
35
|
exports.default = _default;
|
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
|
|
10
8
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
9
|
|
|
12
10
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -28,10 +26,5 @@ var PaginationItem = function PaginationItem(_ref) {
|
|
|
28
26
|
}, number));
|
|
29
27
|
};
|
|
30
28
|
|
|
31
|
-
PaginationItem.propTypes = {
|
|
32
|
-
isActive: _propTypes.default.bool,
|
|
33
|
-
number: _propTypes.default.number.isRequired,
|
|
34
|
-
onClick: _propTypes.default.func.isRequired
|
|
35
|
-
};
|
|
36
29
|
var _default = PaginationItem;
|
|
37
30
|
exports.default = _default;
|
|
@@ -41,6 +41,10 @@ export declare type Props = PropsWithSpread<{
|
|
|
41
41
|
* The content for success validation.
|
|
42
42
|
*/
|
|
43
43
|
success?: ReactNode;
|
|
44
|
+
/**
|
|
45
|
+
* The content for success validation.
|
|
46
|
+
*/
|
|
47
|
+
type?: "submit" | "reset" | "button";
|
|
44
48
|
/**
|
|
45
49
|
* Optional class(es) to pass to the wrapping Field component
|
|
46
50
|
*/
|
|
@@ -83,9 +87,13 @@ declare const PasswordToggle: React.ForwardRefExoticComponent<{
|
|
|
83
87
|
* The content for success validation.
|
|
84
88
|
*/
|
|
85
89
|
success?: ReactNode;
|
|
90
|
+
/**
|
|
91
|
+
* The content for success validation.
|
|
92
|
+
*/
|
|
93
|
+
type?: "submit" | "reset" | "button";
|
|
86
94
|
/**
|
|
87
95
|
* Optional class(es) to pass to the wrapping Field component
|
|
88
96
|
*/
|
|
89
97
|
wrapperClassName?: string;
|
|
90
|
-
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, "label" | "className" | "error" | "id" | "readOnly" | "required" | "help" | "success" | "caution" | "wrapperClassName"> & React.RefAttributes<HTMLInputElement>>;
|
|
98
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, "label" | "className" | "error" | "id" | "type" | "readOnly" | "required" | "help" | "success" | "caution" | "wrapperClassName"> & React.RefAttributes<HTMLInputElement>>;
|
|
91
99
|
export default PasswordToggle;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -17,9 +17,11 @@ var _Field = _interopRequireDefault(require("../Field"));
|
|
|
17
17
|
|
|
18
18
|
var _Label = _interopRequireDefault(require("../Label"));
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
var _excluded = ["caution", "className", "error", "help", "id", "label", "readOnly", "required", "success", "type", "wrapperClassName"];
|
|
21
21
|
|
|
22
|
-
function
|
|
22
|
+
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); }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
23
25
|
|
|
24
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
27
|
|
|
@@ -33,7 +35,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
33
35
|
|
|
34
36
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
35
37
|
|
|
36
|
-
function _iterableToArrayLimit(arr, i) {
|
|
38
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
37
39
|
|
|
38
40
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
39
41
|
|
|
@@ -41,7 +43,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
41
43
|
|
|
42
44
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
43
45
|
|
|
44
|
-
var PasswordToggle = _react.default.forwardRef(function (_ref, ref) {
|
|
46
|
+
var PasswordToggle = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
45
47
|
var caution = _ref.caution,
|
|
46
48
|
className = _ref.className,
|
|
47
49
|
error = _ref.error,
|
|
@@ -51,8 +53,9 @@ var PasswordToggle = _react.default.forwardRef(function (_ref, ref) {
|
|
|
51
53
|
readOnly = _ref.readOnly,
|
|
52
54
|
required = _ref.required,
|
|
53
55
|
success = _ref.success,
|
|
56
|
+
type = _ref.type,
|
|
54
57
|
wrapperClassName = _ref.wrapperClassName,
|
|
55
|
-
inputProps = _objectWithoutProperties(_ref,
|
|
58
|
+
inputProps = _objectWithoutProperties(_ref, _excluded);
|
|
56
59
|
|
|
57
60
|
var _useState = (0, _react.useState)(true),
|
|
58
61
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -81,6 +84,7 @@ var PasswordToggle = _react.default.forwardRef(function (_ref, ref) {
|
|
|
81
84
|
required: required
|
|
82
85
|
}, label), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
83
86
|
appearance: "base",
|
|
87
|
+
type: type ? type : "button",
|
|
84
88
|
className: "u-no-margin--bottom",
|
|
85
89
|
hasIcon: true,
|
|
86
90
|
"aria-controls": id,
|
|
@@ -9,6 +9,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _CheckableInput = _interopRequireDefault(require("../CheckableInput"));
|
|
11
11
|
|
|
12
|
+
var _excluded = ["label"];
|
|
13
|
+
|
|
12
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
15
|
|
|
14
16
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
@@ -19,7 +21,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
19
21
|
|
|
20
22
|
var RadioInput = function RadioInput(_ref) {
|
|
21
23
|
var label = _ref.label,
|
|
22
|
-
radioProps = _objectWithoutProperties(_ref,
|
|
24
|
+
radioProps = _objectWithoutProperties(_ref, _excluded);
|
|
23
25
|
|
|
24
26
|
return /*#__PURE__*/_react.default.createElement(_CheckableInput.default, _extends({
|
|
25
27
|
inputType: "radio",
|
|
@@ -9,6 +9,8 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
|
|
12
|
+
var _excluded = ["children", "className"];
|
|
13
|
+
|
|
12
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
15
|
|
|
14
16
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
@@ -20,7 +22,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
20
22
|
var Row = function Row(_ref) {
|
|
21
23
|
var children = _ref.children,
|
|
22
24
|
className = _ref.className,
|
|
23
|
-
props = _objectWithoutProperties(_ref,
|
|
25
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
24
26
|
|
|
25
27
|
return /*#__PURE__*/_react.default.createElement("div", _extends({
|
|
26
28
|
className: (0, _classnames.default)(className, "row")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -17,9 +17,9 @@ var _utils = require("../utils");
|
|
|
17
17
|
|
|
18
18
|
var _utils2 = require("../../../utils");
|
|
19
19
|
|
|
20
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var
|
|
20
|
+
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); }
|
|
21
21
|
|
|
22
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }
|
|
22
|
+
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; }
|
|
23
23
|
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
25
|
|
|
@@ -31,7 +31,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
31
31
|
|
|
32
32
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
33
33
|
|
|
34
|
-
function _iterableToArrayLimit(arr, i) {
|
|
34
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
35
35
|
|
|
36
36
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
37
|
|
|
@@ -123,9 +123,8 @@ var FilterPanelSection = function FilterPanelSection(_ref) {
|
|
|
123
123
|
// should display
|
|
124
124
|
var searchTermInChip = (0, _utils2.highlightSubString)(chip.value, searchTerm).match;
|
|
125
125
|
var chipVisible = searchTermInChip || searchTerm === "" || (0, _utils2.highlightSubString)(heading, searchTerm).match;
|
|
126
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
127
|
-
key: "".concat(chip.lead, "+").concat(chip.value)
|
|
128
|
-
}, chipVisible && !sectionHidden && /*#__PURE__*/_react.default.createElement(_Chip.default, {
|
|
126
|
+
return chipVisible && !sectionHidden && /*#__PURE__*/_react.default.createElement(_Chip.default, {
|
|
127
|
+
key: "".concat(chip.lead, "+").concat(chip.value),
|
|
129
128
|
lead: chip.lead,
|
|
130
129
|
value: chip.value,
|
|
131
130
|
selected: (0, _utils.isChipInArray)(chip, searchData),
|
|
@@ -133,7 +132,7 @@ var FilterPanelSection = function FilterPanelSection(_ref) {
|
|
|
133
132
|
onClick: function onClick() {
|
|
134
133
|
return handleChipClick(chip);
|
|
135
134
|
}
|
|
136
|
-
})
|
|
135
|
+
});
|
|
137
136
|
}), overflowCounter > 0 && !expanded && /*#__PURE__*/_react.default.createElement("span", {
|
|
138
137
|
className: "p-filter-panel-section__counter",
|
|
139
138
|
onClick: showAllChips,
|