@splunk/react-ui 4.20.0 → 4.21.1
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/Accordion.js +425 -441
- package/Anchor.js +147 -193
- package/Animation.js +142 -166
- package/AnimationToggle.js +197 -253
- package/Box.js +145 -194
- package/Breadcrumbs.js +288 -298
- package/Button.js +488 -613
- package/ButtonGroup.js +160 -212
- package/ButtonSimple.js +543 -562
- package/CHANGELOG.md +26 -0
- package/Calendar.js +1107 -1195
- package/Card.js +771 -746
- package/CardLayout.js +205 -223
- package/Chip.js +509 -612
- package/Clickable.js +416 -472
- package/CloseButton.js +165 -250
- package/Code.js +1808 -2172
- package/Code.js.LICENSE.txt +8 -0
- package/CollapsiblePanel.js +586 -675
- package/Color.js +1066 -1297
- package/ColumnLayout.js +402 -465
- package/ComboBox.js +892 -969
- package/Concertina.js +998 -963
- package/ControlGroup.js +687 -718
- package/Date.js +567 -697
- package/DefinitionList.js +308 -310
- package/Divider.js +149 -194
- package/Dropdown.js +459 -558
- package/DualListbox.js +1480 -1735
- package/EventListener.js +94 -165
- package/File.js +1051 -1173
- package/FormRows.js +885 -880
- package/Heading.js +216 -263
- package/Image.js +446 -558
- package/JSONTree.js +690 -699
- package/Layer.js +442 -582
- package/Link.js +336 -361
- package/List.js +213 -237
- package/Markdown.js +510 -612
- package/Menu.js +1109 -1331
- package/Message.js +474 -629
- package/MessageBar.js +387 -561
- package/Modal.js +810 -798
- package/ModalLayer.js +326 -343
- package/Monogram.js +308 -368
- package/Multiselect.js +3558 -3998
- package/Number.js +729 -843
- package/Paginator.js +510 -615
- package/Paragraph.js +145 -188
- package/Popover.js +1470 -1693
- package/Progress.js +301 -362
- package/RadioBar.js +610 -651
- package/RadioList.js +483 -544
- package/Resize.js +530 -623
- package/ResultsMenu.js +494 -597
- package/ScreenReaderContent.js +142 -187
- package/Scroll.js +595 -598
- package/ScrollContainerContext.js +197 -278
- package/Search.js +745 -817
- package/Select.js +2441 -2746
- package/SidePanel.js +390 -392
- package/Slider.js +668 -825
- package/SlidingPanels.js +639 -645
- package/SplitButton.js +464 -499
- package/StaticContent.js +161 -217
- package/StepBar.js +386 -466
- package/Switch.js +710 -764
- package/TabBar.js +724 -815
- package/TabLayout.js +406 -438
- package/Table.js +4842 -5121
- package/Text.js +1169 -1351
- package/TextArea.js +1097 -1307
- package/Tooltip.js +624 -721
- package/TransitionOpen.js +489 -546
- package/Typography.js +176 -229
- package/WaitSpinner.js +230 -298
- package/package.json +14 -15
- package/stubs-splunkui.d.ts +4 -1
- package/types/src/ComboBox/Option.d.ts +1 -1
- package/types/src/Concertina/Concertina.d.ts +4 -0
- package/types/src/JSONTree/JSONTreeContext.d.ts +7 -0
- package/types/src/JSONTree/TreeNode.d.ts +5 -0
- package/types/src/Link/Link.d.ts +7 -3
- package/types/src/Link/docs/examples/NewWindow.d.ts +2 -0
- package/types/src/Markdown/Markdown.d.ts +1 -1
- package/types/src/Markdown/renderers/MarkdownHeading.d.ts +1 -1
- package/types/src/Menu/Item.d.ts +1 -1
- package/types/src/Menu/Menu.d.ts +1 -0
- package/types/src/MessageBar/docs/examples/WithActions.d.ts +2 -0
- package/types/src/Multiselect/Option.d.ts +1 -1
- package/types/src/Search/Option.d.ts +1 -1
- package/types/src/Select/Option.d.ts +1 -1
- package/types/src/Select/OptionBase.d.ts +1 -1
- package/types/src/fixtures/FetchOptions.d.ts +2 -8
- package/useForceUpdate.js +112 -146
- package/useKeyPress.js +74 -128
- package/usePrevious.js +65 -129
- package/useRovingFocus.js +122 -218
- package/types/src/Link/docs/examples/NewTab.d.ts +0 -2
- /package/types/src/Table/docs/examples/{DockedHeader.d.ts → DockedHeaderScrollbar.d.ts} +0 -0
- /package/types/src/Table/docs/examples/prisma/{DockedHeader.d.ts → DockedHeaderScrollbar.d.ts} +0 -0
package/Paginator.js
CHANGED
|
@@ -1,622 +1,517 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/******/
|
|
4
|
-
/******/
|
|
5
|
-
/******/
|
|
6
|
-
/******/
|
|
7
|
-
|
|
8
|
-
/******/
|
|
9
|
-
/******/
|
|
10
|
-
/******/
|
|
11
|
-
/******/
|
|
12
|
-
/******/
|
|
13
|
-
/******/
|
|
14
|
-
/******/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/******/
|
|
20
|
-
/******/
|
|
21
|
-
/******/
|
|
22
|
-
/******/
|
|
23
|
-
/******/
|
|
24
|
-
/******/
|
|
25
|
-
/******/
|
|
26
|
-
/******/
|
|
27
|
-
/******/
|
|
28
|
-
/******/
|
|
29
|
-
/******/
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
/******/
|
|
34
|
-
/******/
|
|
35
|
-
/******/
|
|
36
|
-
/******/
|
|
37
|
-
/******/
|
|
38
|
-
/******/
|
|
39
|
-
/******/
|
|
40
|
-
/******/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
/******/
|
|
44
|
-
/******/
|
|
45
|
-
/******/
|
|
46
|
-
/******/
|
|
47
|
-
/******/
|
|
48
|
-
/******/
|
|
49
|
-
/******/
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
/******/
|
|
53
|
-
/******/
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
/******/
|
|
57
|
-
/******/
|
|
58
|
-
/******/
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
/******/ return ns;
|
|
66
|
-
/******/ };
|
|
67
|
-
/******/
|
|
68
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
69
|
-
/******/ __webpack_require__.n = function(module) {
|
|
70
|
-
/******/ var getter = module && module.__esModule ?
|
|
71
|
-
/******/ function getDefault() { return module['default']; } :
|
|
72
|
-
/******/ function getModuleExports() { return module; };
|
|
73
|
-
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
74
|
-
/******/ return getter;
|
|
75
|
-
/******/ };
|
|
76
|
-
/******/
|
|
77
|
-
/******/ // Object.prototype.hasOwnProperty.call
|
|
78
|
-
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
79
|
-
/******/
|
|
80
|
-
/******/ // __webpack_public_path__
|
|
81
|
-
/******/ __webpack_require__.p = "";
|
|
82
|
-
/******/
|
|
83
|
-
/******/
|
|
84
|
-
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s = 184);
|
|
86
|
-
/******/ })
|
|
87
|
-
/************************************************************************/
|
|
88
|
-
/******/ ({
|
|
89
|
-
|
|
90
|
-
/***/ 0:
|
|
91
|
-
/***/ (function(module, exports) {
|
|
92
|
-
|
|
93
|
-
module.exports = require("@splunk/themes");
|
|
94
|
-
|
|
95
|
-
/***/ }),
|
|
96
|
-
|
|
97
|
-
/***/ 1:
|
|
98
|
-
/***/ (function(module, exports) {
|
|
99
|
-
|
|
100
|
-
module.exports = require("prop-types");
|
|
101
|
-
|
|
102
|
-
/***/ }),
|
|
103
|
-
|
|
104
|
-
/***/ 149:
|
|
105
|
-
/***/ (function(module, exports) {
|
|
106
|
-
|
|
107
|
-
module.exports = require("@splunk/react-icons/DotsThreeHorizontal");
|
|
108
|
-
|
|
109
|
-
/***/ }),
|
|
110
|
-
|
|
111
|
-
/***/ 184:
|
|
112
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
113
|
-
|
|
114
|
-
"use strict";
|
|
115
|
-
// ESM COMPAT FLAG
|
|
116
|
-
__webpack_require__.r(__webpack_exports__);
|
|
117
|
-
|
|
118
|
-
// EXPORTS
|
|
119
|
-
__webpack_require__.d(__webpack_exports__, "default", function() { return /* reexport */ Paginator_Paginator; });
|
|
120
|
-
|
|
121
|
-
// EXTERNAL MODULE: external "react"
|
|
122
|
-
var external_react_ = __webpack_require__(2);
|
|
123
|
-
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
|
|
124
|
-
|
|
125
|
-
// EXTERNAL MODULE: external "prop-types"
|
|
126
|
-
var external_prop_types_ = __webpack_require__(1);
|
|
127
|
-
var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
|
|
128
|
-
|
|
129
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/Box"
|
|
130
|
-
var Box_ = __webpack_require__(6);
|
|
131
|
-
var Box_default = /*#__PURE__*/__webpack_require__.n(Box_);
|
|
132
|
-
|
|
133
|
-
// EXTERNAL MODULE: external "@splunk/themes"
|
|
134
|
-
var themes_ = __webpack_require__(0);
|
|
135
|
-
|
|
136
|
-
// EXTERNAL MODULE: external "@splunk/ui-utils/format"
|
|
137
|
-
var format_ = __webpack_require__(29);
|
|
138
|
-
|
|
139
|
-
// EXTERNAL MODULE: external "@splunk/ui-utils/i18n"
|
|
140
|
-
var i18n_ = __webpack_require__(4);
|
|
141
|
-
|
|
142
|
-
// EXTERNAL MODULE: external "@splunk/react-icons/DotsThreeHorizontal"
|
|
143
|
-
var DotsThreeHorizontal_ = __webpack_require__(149);
|
|
144
|
-
var DotsThreeHorizontal_default = /*#__PURE__*/__webpack_require__.n(DotsThreeHorizontal_);
|
|
145
|
-
|
|
146
|
-
// EXTERNAL MODULE: external "styled-components"
|
|
147
|
-
var external_styled_components_ = __webpack_require__(3);
|
|
148
|
-
var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
|
|
149
|
-
|
|
150
|
-
// CONCATENATED MODULE: ./src/Paginator/PageSeparatorStyles.ts
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
var StyledEllipsisWrapper = external_styled_components_default.a.span.withConfig({
|
|
154
|
-
displayName: "PageSeparatorStyles__StyledEllipsisWrapper",
|
|
155
|
-
componentId: "j50fqf-0"
|
|
156
|
-
})(["display:flex;align-items:center;margin:", ";color:", ";"], Object(themes_["pick"])({
|
|
157
|
-
enterprise: '0px 11px',
|
|
158
|
-
prisma: '0px 20px'
|
|
159
|
-
}), themes_["variables"].contentColorActive);
|
|
160
|
-
|
|
161
|
-
// CONCATENATED MODULE: ./src/Paginator/PageSeparator.tsx
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
function PageSeparator() {
|
|
168
|
-
var _useSplunkTheme = Object(themes_["useSplunkTheme"])(),
|
|
169
|
-
family = _useSplunkTheme.family;
|
|
170
|
-
|
|
171
|
-
var content = family === 'enterprise' ? /*#__PURE__*/external_react_default.a.createElement("span", {
|
|
172
|
-
role: "separator"
|
|
173
|
-
}, "\u2026") : /*#__PURE__*/external_react_default.a.createElement(DotsThreeHorizontal_default.a, null);
|
|
174
|
-
return /*#__PURE__*/external_react_default.a.createElement(StyledEllipsisWrapper, {
|
|
175
|
-
role: "separator"
|
|
176
|
-
}, content);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
/* harmony default export */ var Paginator_PageSeparator = (PageSeparator);
|
|
180
|
-
// EXTERNAL MODULE: external "lodash/keys"
|
|
181
|
-
var keys_ = __webpack_require__(9);
|
|
182
|
-
var keys_default = /*#__PURE__*/__webpack_require__.n(keys_);
|
|
183
|
-
|
|
184
|
-
// EXTERNAL MODULE: external "lodash/omit"
|
|
185
|
-
var omit_ = __webpack_require__(5);
|
|
186
|
-
var omit_default = /*#__PURE__*/__webpack_require__.n(omit_);
|
|
187
|
-
|
|
188
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/ButtonSimple"
|
|
189
|
-
var ButtonSimple_ = __webpack_require__(64);
|
|
190
|
-
var ButtonSimple_default = /*#__PURE__*/__webpack_require__.n(ButtonSimple_);
|
|
191
|
-
|
|
192
|
-
// CONCATENATED MODULE: ./src/Paginator/ButtonStyles.ts
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
var StyledButtonSimple = external_styled_components_default()(ButtonSimple_default.a).withConfig({
|
|
197
|
-
displayName: "ButtonStyles__StyledButtonSimple",
|
|
198
|
-
componentId: "sc-1neztq7-0"
|
|
199
|
-
})(["min-width:", ";min-height:", ";text-align:center;flex-shrink:0;", ""], themes_["variables"].inputHeight, themes_["variables"].inputHeight, Object(themes_["pick"])({
|
|
200
|
-
enterprise: {
|
|
201
|
-
comfortable: Object(external_styled_components_["css"])(["padding:", ";"], themes_["variables"].spacingQuarter),
|
|
202
|
-
compact: Object(external_styled_components_["css"])(["padding:3px;"])
|
|
203
|
-
},
|
|
204
|
-
prisma: Object(external_styled_components_["css"])(["padding:", ";", " & + &{margin-left:8px;}"], Object(themes_["pick"])({
|
|
205
|
-
comfortable: '5px 8px',
|
|
206
|
-
compact: '4px'
|
|
207
|
-
}), function (_ref) {
|
|
208
|
-
var selected = _ref.selected;
|
|
209
|
-
return selected && Object(external_styled_components_["css"])(["font-weight:", ";"], themes_["variables"].fontWeightBold);
|
|
210
|
-
})
|
|
211
|
-
}));
|
|
212
|
-
var StyledPrevNext = external_styled_components_default.a.div.withConfig({
|
|
213
|
-
displayName: "ButtonStyles__StyledPrevNext",
|
|
214
|
-
componentId: "sc-1neztq7-1"
|
|
215
|
-
})(["padding:", ";white-space:nowrap;"], Object(themes_["pick"])({
|
|
216
|
-
enterprise: '0 3px',
|
|
217
|
-
prisma: '0 8px'
|
|
218
|
-
}));
|
|
219
|
-
|
|
220
|
-
// CONCATENATED MODULE: ./src/Paginator/Button.tsx
|
|
221
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
222
|
-
|
|
223
|
-
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); }
|
|
224
|
-
|
|
225
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
226
|
-
|
|
227
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
228
|
-
|
|
229
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
230
|
-
|
|
231
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
232
|
-
|
|
233
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
234
|
-
|
|
235
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
236
|
-
|
|
237
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
238
|
-
|
|
239
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
240
|
-
|
|
241
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
242
|
-
|
|
243
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
244
|
-
|
|
245
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
var propTypes = {
|
|
253
|
-
children: external_prop_types_default.a.node,
|
|
254
|
-
label: external_prop_types_default.a.node,
|
|
255
|
-
onClick: external_prop_types_default.a.func,
|
|
256
|
-
page: external_prop_types_default.a.number,
|
|
257
|
-
|
|
258
|
-
/** @private */
|
|
259
|
-
selected: external_prop_types_default.a.bool
|
|
260
|
-
};
|
|
261
|
-
var defaultProps = {
|
|
262
|
-
selected: false
|
|
263
|
-
};
|
|
264
|
-
|
|
265
|
-
var Button_PaginatorButton = /*#__PURE__*/function (_Component) {
|
|
266
|
-
_inherits(PaginatorButton, _Component);
|
|
267
|
-
|
|
268
|
-
var _super = _createSuper(PaginatorButton);
|
|
269
|
-
|
|
270
|
-
function PaginatorButton() {
|
|
271
|
-
var _this;
|
|
272
|
-
|
|
273
|
-
_classCallCheck(this, PaginatorButton);
|
|
274
|
-
|
|
275
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
276
|
-
args[_key] = arguments[_key];
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
280
|
-
|
|
281
|
-
_defineProperty(_assertThisInitialized(_this), "handleClick", function (e) {
|
|
282
|
-
var _this$props = _this.props,
|
|
283
|
-
onClick = _this$props.onClick,
|
|
284
|
-
page = _this$props.page;
|
|
285
|
-
onClick === null || onClick === void 0 ? void 0 : onClick(e, {
|
|
286
|
-
// @ts-expect-error - guaranteed by onClick on StyleButtonSimple below
|
|
287
|
-
page: page
|
|
288
|
-
});
|
|
1
|
+
/******/ (() => {
|
|
2
|
+
// webpackBootstrap
|
|
3
|
+
/******/ "use strict";
|
|
4
|
+
/******/ // The require scope
|
|
5
|
+
/******/ var e = {};
|
|
6
|
+
/******/
|
|
7
|
+
/************************************************************************/
|
|
8
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
9
|
+
/******/ (() => {
|
|
10
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
11
|
+
/******/ e.n = t => {
|
|
12
|
+
/******/ var r = t && t.__esModule ?
|
|
13
|
+
/******/ () => t["default"]
|
|
14
|
+
/******/ : () => t
|
|
15
|
+
/******/;
|
|
16
|
+
e.d(r, {
|
|
17
|
+
a: r
|
|
18
|
+
});
|
|
19
|
+
/******/ return r;
|
|
20
|
+
/******/ };
|
|
21
|
+
/******/ })();
|
|
22
|
+
/******/
|
|
23
|
+
/******/ /* webpack/runtime/define property getters */
|
|
24
|
+
/******/ (() => {
|
|
25
|
+
/******/ // define getter functions for harmony exports
|
|
26
|
+
/******/ e.d = (t, r) => {
|
|
27
|
+
/******/ for (var n in r) {
|
|
28
|
+
/******/ if (e.o(r, n) && !e.o(t, n)) {
|
|
29
|
+
/******/ Object.defineProperty(t, n, {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: r[n]
|
|
32
|
+
});
|
|
33
|
+
/******/ }
|
|
34
|
+
/******/ }
|
|
35
|
+
/******/ };
|
|
36
|
+
/******/ })();
|
|
37
|
+
/******/
|
|
38
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
39
|
+
/******/ (() => {
|
|
40
|
+
/******/ e.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t)
|
|
41
|
+
/******/;
|
|
42
|
+
})();
|
|
43
|
+
/******/
|
|
44
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
45
|
+
/******/ (() => {
|
|
46
|
+
/******/ // define __esModule on exports
|
|
47
|
+
/******/ e.r = e => {
|
|
48
|
+
/******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
|
|
49
|
+
/******/ Object.defineProperty(e, Symbol.toStringTag, {
|
|
50
|
+
value: "Module"
|
|
51
|
+
});
|
|
52
|
+
/******/ }
|
|
53
|
+
/******/ Object.defineProperty(e, "__esModule", {
|
|
54
|
+
value: true
|
|
55
|
+
});
|
|
56
|
+
/******/ };
|
|
57
|
+
/******/ })();
|
|
58
|
+
/******/
|
|
59
|
+
/************************************************************************/ var t = {};
|
|
60
|
+
// ESM COMPAT FLAG
|
|
61
|
+
e.r(t);
|
|
62
|
+
// EXPORTS
|
|
63
|
+
e.d(t, {
|
|
64
|
+
default: () => /* reexport */ se
|
|
289
65
|
});
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
66
|
+
// CONCATENATED MODULE: external "react"
|
|
67
|
+
const r = require("react");
|
|
68
|
+
var n = e.n(r);
|
|
69
|
+
// CONCATENATED MODULE: external "prop-types"
|
|
70
|
+
const a = require("prop-types");
|
|
71
|
+
var o = e.n(a);
|
|
72
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Box"
|
|
73
|
+
const i = require("@splunk/react-ui/Box");
|
|
74
|
+
var l = e.n(i);
|
|
75
|
+
// CONCATENATED MODULE: external "@splunk/themes"
|
|
76
|
+
const s = require("@splunk/themes");
|
|
77
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/format"
|
|
78
|
+
const c = require("@splunk/ui-utils/format");
|
|
79
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
|
|
80
|
+
const p = require("@splunk/ui-utils/i18n");
|
|
81
|
+
// CONCATENATED MODULE: external "@splunk/react-icons/DotsThreeHorizontal"
|
|
82
|
+
const u = require("@splunk/react-icons/DotsThreeHorizontal");
|
|
83
|
+
var f = e.n(u);
|
|
84
|
+
// CONCATENATED MODULE: external "styled-components"
|
|
85
|
+
const d = require("styled-components");
|
|
86
|
+
var v = e.n(d);
|
|
87
|
+
// CONCATENATED MODULE: ./src/Paginator/PageSeparatorStyles.ts
|
|
88
|
+
var y = v().span.withConfig({
|
|
89
|
+
displayName: "PageSeparatorStyles__StyledEllipsisWrapper",
|
|
90
|
+
componentId: "j50fqf-0"
|
|
91
|
+
})([ "display:flex;align-items:center;margin:", ";color:", ";" ], (0, s.pick)({
|
|
92
|
+
enterprise: "0px 11px",
|
|
93
|
+
prisma: "0px 20px"
|
|
94
|
+
}), s.variables.contentColorActive);
|
|
95
|
+
// CONCATENATED MODULE: ./src/Paginator/PageSeparator.tsx
|
|
96
|
+
function m() {
|
|
97
|
+
var e = (0, s.useSplunkTheme)(), t = e.family;
|
|
98
|
+
var r = t === "enterprise" ? n().createElement("span", {
|
|
99
|
+
role: "separator"
|
|
100
|
+
}, "…") : n().createElement(f(), null);
|
|
101
|
+
|
|
102
|
+
return n().createElement(y, {
|
|
103
|
+
role: "separator"
|
|
104
|
+
}, r);
|
|
310
105
|
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
//
|
|
322
|
-
var
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
var
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
var StyledEnterpriseChevronLeftIcon = external_styled_components_default()(ChevronLeft_default.a).withConfig({
|
|
345
|
-
displayName: "PaginatorStyles__StyledEnterpriseChevronLeftIcon",
|
|
346
|
-
componentId: "pmabsp-0"
|
|
347
|
-
})(["margin:-1px 3px 0 0;"]);
|
|
348
|
-
var StyledEnterpriseChevronRightIcon = external_styled_components_default()(ChevronRight_default.a).withConfig({
|
|
349
|
-
displayName: "PaginatorStyles__StyledEnterpriseChevronRightIcon",
|
|
350
|
-
componentId: "pmabsp-1"
|
|
351
|
-
})(["margin:-1px 0 0 3px;"]);
|
|
352
|
-
var compact = Object(external_styled_components_["css"])(["height:20px;width:20px;"]);
|
|
353
|
-
var comfortable = Object(external_styled_components_["css"])(["height:24px;width:24px;"]);
|
|
354
|
-
var StyledChevronLeftIcon = external_styled_components_default()(react_icons_ChevronLeft_default.a).withConfig({
|
|
355
|
-
displayName: "PaginatorStyles__StyledChevronLeftIcon",
|
|
356
|
-
componentId: "pmabsp-2"
|
|
357
|
-
})(["margin:-2px 6px 0 0;color:", ";", ""], function (_ref) {
|
|
358
|
-
var $disabled = _ref.$disabled;
|
|
359
|
-
return $disabled ? themes_["variables"].contentColorDisabled : themes_["variables"].contentColorMuted;
|
|
360
|
-
}, Object(themes_["pick"])({
|
|
361
|
-
compact: compact,
|
|
362
|
-
comfortable: comfortable
|
|
363
|
-
}));
|
|
364
|
-
var StyledChevronRightIcon = external_styled_components_default()(react_icons_ChevronRight_default.a).withConfig({
|
|
365
|
-
displayName: "PaginatorStyles__StyledChevronRightIcon",
|
|
366
|
-
componentId: "pmabsp-3"
|
|
367
|
-
})(["margin:-2px 0 0 6px;color:", ";", ""], function (_ref2) {
|
|
368
|
-
var $disabled = _ref2.$disabled;
|
|
369
|
-
return $disabled ? themes_["variables"].contentColorDisabled : themes_["variables"].contentColorMuted;
|
|
370
|
-
}, Object(themes_["pick"])({
|
|
371
|
-
compact: compact,
|
|
372
|
-
comfortable: comfortable
|
|
373
|
-
}));
|
|
374
|
-
|
|
375
|
-
// CONCATENATED MODULE: ./src/Paginator/Paginator.tsx
|
|
376
|
-
function Paginator_extends() { Paginator_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 Paginator_extends.apply(this, arguments); }
|
|
377
|
-
|
|
378
|
-
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; }
|
|
379
|
-
|
|
380
|
-
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; }
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
var Paginator_propTypes = {
|
|
392
|
-
alwaysShowLastPageLink: external_prop_types_default.a.bool,
|
|
393
|
-
current: external_prop_types_default.a.number,
|
|
394
|
-
elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
|
|
395
|
-
numPageLinks: external_prop_types_default.a.number,
|
|
396
|
-
onChange: external_prop_types_default.a.func,
|
|
397
|
-
totalPages: external_prop_types_default.a.number
|
|
398
|
-
};
|
|
399
|
-
|
|
400
|
-
function Paginator(_ref) {
|
|
401
|
-
var onChange = _ref.onChange,
|
|
402
|
-
_ref$current = _ref.current,
|
|
403
|
-
current = _ref$current === void 0 ? 1 : _ref$current,
|
|
404
|
-
_ref$alwaysShowLastPa = _ref.alwaysShowLastPageLink,
|
|
405
|
-
alwaysShowLastPageLink = _ref$alwaysShowLastPa === void 0 ? false : _ref$alwaysShowLastPa,
|
|
406
|
-
_ref$numPageLinks = _ref.numPageLinks,
|
|
407
|
-
numPageLinks = _ref$numPageLinks === void 0 ? 5 : _ref$numPageLinks,
|
|
408
|
-
totalPages = _ref.totalPages,
|
|
409
|
-
otherProps = _objectWithoutProperties(_ref, ["onChange", "current", "alwaysShowLastPageLink", "numPageLinks", "totalPages"]);
|
|
410
|
-
|
|
411
|
-
// @docs-props-type PaginatorPropsBase
|
|
412
|
-
var _useSplunkTheme = Object(themes_["useSplunkTheme"])(),
|
|
413
|
-
isEnterprise = _useSplunkTheme.isEnterprise; // Can't show more links than total number of pages.
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
var numLinks = Math.min(numPageLinks, totalPages);
|
|
417
|
-
var loMid = Math.ceil(numLinks / 2);
|
|
418
|
-
var hiMid = Math.ceil(totalPages - numLinks / 2);
|
|
419
|
-
var pages = [];
|
|
420
|
-
|
|
421
|
-
if (totalPages <= 1) {
|
|
422
|
-
return null;
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
if ((current > totalPages || current < 1) && process.env.NODE_ENV !== "production") {
|
|
426
|
-
throw new Error('Error in Paginator: Current page is out of bounds');
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
var firstPage;
|
|
430
|
-
var lastPage;
|
|
431
|
-
|
|
432
|
-
if (current <= loMid + 1) {
|
|
433
|
-
// + 1 to avoid ellipsis between 1 and 2
|
|
434
|
-
firstPage = 1;
|
|
435
|
-
lastPage = firstPage + Math.min(totalPages, numLinks) - 1;
|
|
436
|
-
} else if (current > loMid && current < hiMid) {
|
|
437
|
-
lastPage = Math.ceil(current + (numLinks - 2) / 2);
|
|
438
|
-
firstPage = lastPage - numLinks + 2;
|
|
439
|
-
} else {
|
|
440
|
-
// include page #1 to avoid ellipsis between 1 and 2
|
|
441
|
-
firstPage = totalPages - numLinks === 1 ? 1 : totalPages - numLinks + 1;
|
|
442
|
-
lastPage = totalPages;
|
|
443
|
-
} // bump up the last page to avoid ellipsis
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
lastPage = alwaysShowLastPageLink && lastPage + 1 === totalPages ? totalPages : lastPage;
|
|
447
|
-
pages.push( /*#__PURE__*/external_react_default.a.createElement(Button, {
|
|
448
|
-
"data-test": "prev",
|
|
449
|
-
disabled: current === 1,
|
|
450
|
-
onClick: onChange,
|
|
451
|
-
page: current - 1,
|
|
452
|
-
key: "prev",
|
|
453
|
-
"aria-label": Object(i18n_["_"])('Go to previous page')
|
|
454
|
-
}, isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(StyledEnterpriseChevronLeftIcon, {
|
|
455
|
-
hideDefaultTooltip: true,
|
|
456
|
-
screenReaderText: null
|
|
457
|
-
}) : /*#__PURE__*/external_react_default.a.createElement(StyledChevronLeftIcon, {
|
|
458
|
-
$disabled: current === 1
|
|
459
|
-
}), Object(i18n_["_"])('Prev')));
|
|
460
|
-
|
|
461
|
-
if (current > loMid && totalPages > numLinks && firstPage !== 1) {
|
|
462
|
-
pages.push( /*#__PURE__*/external_react_default.a.createElement(Button, {
|
|
463
|
-
label: "1",
|
|
464
|
-
key: "first",
|
|
465
|
-
onClick: onChange,
|
|
466
|
-
page: 1,
|
|
467
|
-
"aria-label": Object(i18n_["_"])('Go to first page')
|
|
106
|
+
/* harmony default export */ const g = m;
|
|
107
|
+
// CONCATENATED MODULE: external "lodash/keys"
|
|
108
|
+
const b = require("lodash/keys");
|
|
109
|
+
var h = e.n(b);
|
|
110
|
+
// CONCATENATED MODULE: external "lodash/omit"
|
|
111
|
+
const k = require("lodash/omit");
|
|
112
|
+
var x = e.n(k);
|
|
113
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/ButtonSimple"
|
|
114
|
+
const S = require("@splunk/react-ui/ButtonSimple");
|
|
115
|
+
var C = e.n(S);
|
|
116
|
+
// CONCATENATED MODULE: ./src/Paginator/ButtonStyles.ts
|
|
117
|
+
var _ = v()(C()).withConfig({
|
|
118
|
+
displayName: "ButtonStyles__StyledButtonSimple",
|
|
119
|
+
componentId: "sc-1neztq7-0"
|
|
120
|
+
})([ "min-width:", ";min-height:", ";text-align:center;flex-shrink:0;", "" ], s.variables.inputHeight, s.variables.inputHeight, (0,
|
|
121
|
+
s.pick)({
|
|
122
|
+
enterprise: {
|
|
123
|
+
comfortable: (0, d.css)([ "padding:", ";" ], s.variables.spacingQuarter),
|
|
124
|
+
compact: (0, d.css)([ "padding:3px;" ])
|
|
125
|
+
},
|
|
126
|
+
prisma: (0, d.css)([ "padding:", ";", " & + &{margin-left:8px;}" ], (0, s.pick)({
|
|
127
|
+
comfortable: "5px 8px",
|
|
128
|
+
compact: "4px"
|
|
129
|
+
}), (function(e) {
|
|
130
|
+
var t = e.selected;
|
|
131
|
+
return t && (0, d.css)([ "font-weight:", ";" ], s.variables.fontWeightBold);
|
|
132
|
+
}))
|
|
468
133
|
}));
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
134
|
+
var w = v().div.withConfig({
|
|
135
|
+
displayName: "ButtonStyles__StyledPrevNext",
|
|
136
|
+
componentId: "sc-1neztq7-1"
|
|
137
|
+
})([ "padding:", ";white-space:nowrap;" ], (0, s.pick)({
|
|
138
|
+
enterprise: "0 3px",
|
|
139
|
+
prisma: "0 8px"
|
|
472
140
|
}));
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
141
|
+
// CONCATENATED MODULE: ./src/Paginator/Button.tsx
|
|
142
|
+
function P(e) {
|
|
143
|
+
"@babel/helpers - typeof";
|
|
144
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
145
|
+
P = function e(t) {
|
|
146
|
+
return typeof t;
|
|
147
|
+
};
|
|
148
|
+
} else {
|
|
149
|
+
P = function e(t) {
|
|
150
|
+
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
return P(e);
|
|
154
|
+
}
|
|
155
|
+
function O() {
|
|
156
|
+
O = Object.assign || function(e) {
|
|
157
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
158
|
+
var r = arguments[t];
|
|
159
|
+
for (var n in r) {
|
|
160
|
+
if (Object.prototype.hasOwnProperty.call(r, n)) {
|
|
161
|
+
e[n] = r[n];
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return e;
|
|
166
|
+
};
|
|
167
|
+
return O.apply(this, arguments);
|
|
168
|
+
}
|
|
169
|
+
function E(e, t) {
|
|
170
|
+
if (!(e instanceof t)) {
|
|
171
|
+
throw new TypeError("Cannot call a class as a function");
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
function j(e, t) {
|
|
175
|
+
for (var r = 0; r < t.length; r++) {
|
|
176
|
+
var n = t[r];
|
|
177
|
+
n.enumerable = n.enumerable || false;
|
|
178
|
+
n.configurable = true;
|
|
179
|
+
if ("value" in n) n.writable = true;
|
|
180
|
+
Object.defineProperty(e, n.key, n);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
function q(e, t, r) {
|
|
184
|
+
if (t) j(e.prototype, t);
|
|
185
|
+
if (r) j(e, r);
|
|
186
|
+
return e;
|
|
187
|
+
}
|
|
188
|
+
function T(e, t) {
|
|
189
|
+
if (typeof t !== "function" && t !== null) {
|
|
190
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
191
|
+
}
|
|
192
|
+
e.prototype = Object.create(t && t.prototype, {
|
|
193
|
+
constructor: {
|
|
194
|
+
value: e,
|
|
195
|
+
writable: true,
|
|
196
|
+
configurable: true
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
if (t) L(e, t);
|
|
200
|
+
}
|
|
201
|
+
function L(e, t) {
|
|
202
|
+
L = Object.setPrototypeOf || function e(t, r) {
|
|
203
|
+
t.__proto__ = r;
|
|
204
|
+
return t;
|
|
205
|
+
};
|
|
206
|
+
return L(e, t);
|
|
207
|
+
}
|
|
208
|
+
function N(e) {
|
|
209
|
+
var t = M();
|
|
210
|
+
return function r() {
|
|
211
|
+
var n = D(e), a;
|
|
212
|
+
if (t) {
|
|
213
|
+
var o = D(this).constructor;
|
|
214
|
+
a = Reflect.construct(n, arguments, o);
|
|
215
|
+
} else {
|
|
216
|
+
a = n.apply(this, arguments);
|
|
217
|
+
}
|
|
218
|
+
return R(this, a);
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
function R(e, t) {
|
|
222
|
+
if (t && (P(t) === "object" || typeof t === "function")) {
|
|
223
|
+
return t;
|
|
224
|
+
}
|
|
225
|
+
return I(e);
|
|
226
|
+
}
|
|
227
|
+
function I(e) {
|
|
228
|
+
if (e === void 0) {
|
|
229
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
230
|
+
}
|
|
231
|
+
return e;
|
|
232
|
+
}
|
|
233
|
+
function M() {
|
|
234
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
235
|
+
if (Reflect.construct.sham) return false;
|
|
236
|
+
if (typeof Proxy === "function") return true;
|
|
237
|
+
try {
|
|
238
|
+
Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
|
|
239
|
+
return true;
|
|
240
|
+
} catch (e) {
|
|
241
|
+
return false;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
function D(e) {
|
|
245
|
+
D = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
|
|
246
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
247
|
+
};
|
|
248
|
+
return D(e);
|
|
249
|
+
}
|
|
250
|
+
function B(e, t, r) {
|
|
251
|
+
if (t in e) {
|
|
252
|
+
Object.defineProperty(e, t, {
|
|
253
|
+
value: r,
|
|
254
|
+
enumerable: true,
|
|
255
|
+
configurable: true,
|
|
256
|
+
writable: true
|
|
257
|
+
});
|
|
258
|
+
} else {
|
|
259
|
+
e[t] = r;
|
|
260
|
+
}
|
|
261
|
+
return e;
|
|
262
|
+
}
|
|
263
|
+
var G = {
|
|
264
|
+
children: o().node,
|
|
265
|
+
label: o().node,
|
|
266
|
+
onClick: o().func,
|
|
267
|
+
page: o().number,
|
|
268
|
+
/** @private */
|
|
269
|
+
selected: o().bool
|
|
270
|
+
};
|
|
271
|
+
var $ = {
|
|
272
|
+
selected: false
|
|
273
|
+
};
|
|
274
|
+
var z = function(e) {
|
|
275
|
+
T(r, e);
|
|
276
|
+
var t = N(r);
|
|
277
|
+
function r() {
|
|
278
|
+
var e;
|
|
279
|
+
E(this, r);
|
|
280
|
+
for (var n = arguments.length, a = new Array(n), o = 0; o < n; o++) {
|
|
281
|
+
a[o] = arguments[o];
|
|
282
|
+
}
|
|
283
|
+
e = t.call.apply(t, [ this ].concat(a));
|
|
284
|
+
B(I(e), "handleClick", (function(t) {
|
|
285
|
+
var r = e.props, n = r.onClick, a = r.page;
|
|
286
|
+
n === null || n === void 0 ? void 0 : n(t, {
|
|
287
|
+
// @ts-expect-error - guaranteed by onClick on StyleButtonSimple below
|
|
288
|
+
page: a
|
|
289
|
+
});
|
|
290
|
+
}));
|
|
291
|
+
return e;
|
|
292
|
+
}
|
|
293
|
+
q(r, [ {
|
|
294
|
+
key: "render",
|
|
295
|
+
value: function e() {
|
|
296
|
+
var t = this.props, a = t.children, o = t.label, i = t.page, l = t.selected;
|
|
297
|
+
|
|
298
|
+
return n().createElement(_, O({
|
|
299
|
+
"data-test": "page",
|
|
300
|
+
"data-test-page": i,
|
|
301
|
+
appearance: "pill",
|
|
302
|
+
onClick: i !== undefined ? this.handleClick : undefined,
|
|
303
|
+
inline: false,
|
|
304
|
+
selected: l
|
|
305
|
+
}, x()(this.props, h()(r.propTypes))), o, a && n().createElement(w, null, a));
|
|
306
|
+
}
|
|
307
|
+
} ]);
|
|
308
|
+
return r;
|
|
309
|
+
}(r.Component);
|
|
310
|
+
B(z, "propTypes", G);
|
|
311
|
+
B(z, "defaultProps", $);
|
|
312
|
+
/* harmony default export */ const H = z;
|
|
313
|
+
// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/ChevronLeft"
|
|
314
|
+
const A = require("@splunk/react-icons/enterprise/ChevronLeft");
|
|
315
|
+
var W = e.n(A);
|
|
316
|
+
// CONCATENATED MODULE: external "@splunk/react-icons/ChevronLeft"
|
|
317
|
+
const Q = require("@splunk/react-icons/ChevronLeft");
|
|
318
|
+
var V = e.n(Q);
|
|
319
|
+
// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/ChevronRight"
|
|
320
|
+
const F = require("@splunk/react-icons/enterprise/ChevronRight");
|
|
321
|
+
var J = e.n(F);
|
|
322
|
+
// CONCATENATED MODULE: external "@splunk/react-icons/ChevronRight"
|
|
323
|
+
const K = require("@splunk/react-icons/ChevronRight");
|
|
324
|
+
var U = e.n(K);
|
|
325
|
+
// CONCATENATED MODULE: ./src/Paginator/PaginatorStyles.ts
|
|
326
|
+
var X = v()(W()).withConfig({
|
|
327
|
+
displayName: "PaginatorStyles__StyledEnterpriseChevronLeftIcon",
|
|
328
|
+
componentId: "pmabsp-0"
|
|
329
|
+
})([ "margin:-1px 3px 0 0;" ]);
|
|
330
|
+
var Y = v()(J()).withConfig({
|
|
331
|
+
displayName: "PaginatorStyles__StyledEnterpriseChevronRightIcon",
|
|
332
|
+
componentId: "pmabsp-1"
|
|
333
|
+
})([ "margin:-1px 0 0 3px;" ]);
|
|
334
|
+
var Z = (0, d.css)([ "height:20px;width:20px;" ]);
|
|
335
|
+
var ee = (0, d.css)([ "height:24px;width:24px;" ]);
|
|
336
|
+
var te = v()(V()).withConfig({
|
|
337
|
+
displayName: "PaginatorStyles__StyledChevronLeftIcon",
|
|
338
|
+
componentId: "pmabsp-2"
|
|
339
|
+
})([ "margin:-2px 6px 0 0;color:", ";", "" ], (function(e) {
|
|
340
|
+
var t = e.$disabled;
|
|
341
|
+
return t ? s.variables.contentColorDisabled : s.variables.contentColorMuted;
|
|
342
|
+
}), (0, s.pick)({
|
|
343
|
+
compact: Z,
|
|
344
|
+
comfortable: ee
|
|
486
345
|
}));
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
346
|
+
var re = v()(U()).withConfig({
|
|
347
|
+
displayName: "PaginatorStyles__StyledChevronRightIcon",
|
|
348
|
+
componentId: "pmabsp-3"
|
|
349
|
+
})([ "margin:-2px 0 0 6px;color:", ";", "" ], (function(e) {
|
|
350
|
+
var t = e.$disabled;
|
|
351
|
+
return t ? s.variables.contentColorDisabled : s.variables.contentColorMuted;
|
|
352
|
+
}), (0, s.pick)({
|
|
353
|
+
compact: Z,
|
|
354
|
+
comfortable: ee
|
|
493
355
|
}));
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
356
|
+
// CONCATENATED MODULE: ./src/Paginator/Paginator.tsx
|
|
357
|
+
function ne() {
|
|
358
|
+
ne = Object.assign || function(e) {
|
|
359
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
360
|
+
var r = arguments[t];
|
|
361
|
+
for (var n in r) {
|
|
362
|
+
if (Object.prototype.hasOwnProperty.call(r, n)) {
|
|
363
|
+
e[n] = r[n];
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
return e;
|
|
368
|
+
};
|
|
369
|
+
return ne.apply(this, arguments);
|
|
370
|
+
}
|
|
371
|
+
function ae(e, t) {
|
|
372
|
+
if (e == null) return {};
|
|
373
|
+
var r = oe(e, t);
|
|
374
|
+
var n, a;
|
|
375
|
+
if (Object.getOwnPropertySymbols) {
|
|
376
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
377
|
+
for (a = 0; a < o.length; a++) {
|
|
378
|
+
n = o[a];
|
|
379
|
+
if (t.indexOf(n) >= 0) continue;
|
|
380
|
+
if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
|
|
381
|
+
r[n] = e[n];
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
return r;
|
|
385
|
+
}
|
|
386
|
+
function oe(e, t) {
|
|
387
|
+
if (e == null) return {};
|
|
388
|
+
var r = {};
|
|
389
|
+
var n = Object.keys(e);
|
|
390
|
+
var a, o;
|
|
391
|
+
for (o = 0; o < n.length; o++) {
|
|
392
|
+
a = n[o];
|
|
393
|
+
if (t.indexOf(a) >= 0) continue;
|
|
394
|
+
r[a] = e[a];
|
|
395
|
+
}
|
|
396
|
+
return r;
|
|
397
|
+
}
|
|
398
|
+
var ie = {
|
|
399
|
+
alwaysShowLastPageLink: o().bool,
|
|
400
|
+
current: o().number,
|
|
401
|
+
elementRef: o().oneOfType([ o().func, o().object ]),
|
|
402
|
+
numPageLinks: o().number,
|
|
403
|
+
onChange: o().func,
|
|
404
|
+
totalPages: o().number
|
|
405
|
+
};
|
|
406
|
+
function le(e) {
|
|
407
|
+
var t = e.onChange, r = e.current, a = r === void 0 ? 1 : r, o = e.alwaysShowLastPageLink, i = o === void 0 ? false : o, u = e.numPageLinks, f = u === void 0 ? 5 : u, d = e.totalPages, v = ae(e, [ "onChange", "current", "alwaysShowLastPageLink", "numPageLinks", "totalPages" ]);
|
|
408
|
+
// @docs-props-type PaginatorPropsBase
|
|
409
|
+
var y = (0, s.useSplunkTheme)(), m = y.isEnterprise;
|
|
410
|
+
// Can't show more links than total number of pages.
|
|
411
|
+
var b = Math.min(f, d);
|
|
412
|
+
var h = Math.ceil(b / 2);
|
|
413
|
+
var k = Math.ceil(d - b / 2);
|
|
414
|
+
var x = [];
|
|
415
|
+
if (d <= 1) {
|
|
416
|
+
return null;
|
|
417
|
+
}
|
|
418
|
+
if ((a > d || a < 1) && process.env.NODE_ENV !== "production") {}
|
|
419
|
+
var S;
|
|
420
|
+
var C;
|
|
421
|
+
if (a <= h + 1) {
|
|
422
|
+
// + 1 to avoid ellipsis between 1 and 2
|
|
423
|
+
S = 1;
|
|
424
|
+
C = S + Math.min(d, b) - 1;
|
|
425
|
+
} else if (a > h && a < k) {
|
|
426
|
+
C = Math.ceil(a + (b - 2) / 2);
|
|
427
|
+
S = C - b + 2;
|
|
428
|
+
} else {
|
|
429
|
+
// include page #1 to avoid ellipsis between 1 and 2
|
|
430
|
+
S = d - b === 1 ? 1 : d - b + 1;
|
|
431
|
+
C = d;
|
|
432
|
+
}
|
|
433
|
+
// bump up the last page to avoid ellipsis
|
|
434
|
+
C = i && C + 1 === d ? d : C;
|
|
435
|
+
x.push( n().createElement(H, {
|
|
436
|
+
"data-test": "prev",
|
|
437
|
+
disabled: a === 1,
|
|
438
|
+
onClick: t,
|
|
439
|
+
page: a - 1,
|
|
440
|
+
key: "prev",
|
|
441
|
+
"aria-label": (0, p._)("Go to previous page")
|
|
442
|
+
}, m ? n().createElement(X, {
|
|
443
|
+
hideDefaultTooltip: true,
|
|
444
|
+
screenReaderText: null
|
|
445
|
+
}) : n().createElement(te, {
|
|
446
|
+
$disabled: a === 1
|
|
447
|
+
}), (0, p._)("Prev")));
|
|
448
|
+
if (a > h && d > b && S !== 1) {
|
|
449
|
+
x.push( n().createElement(H, {
|
|
450
|
+
label: "1",
|
|
451
|
+
key: "first",
|
|
452
|
+
onClick: t,
|
|
453
|
+
page: 1,
|
|
454
|
+
"aria-label": (0, p._)("Go to first page")
|
|
455
|
+
}));
|
|
456
|
+
x.push( n().createElement(g, {
|
|
457
|
+
"data-test": "page",
|
|
458
|
+
key: "prevEllipsis"
|
|
459
|
+
}));
|
|
460
|
+
}
|
|
461
|
+
for (var _ = S; _ <= C; _ += 1) {
|
|
462
|
+
var w = _ === a;
|
|
463
|
+
x.push( n().createElement(H, {
|
|
464
|
+
label: String(_),
|
|
465
|
+
selected: w,
|
|
466
|
+
onClick: t,
|
|
467
|
+
page: _,
|
|
468
|
+
key: _,
|
|
469
|
+
"aria-label": w ? (0, p._)("Current page") : (0, c.sprintf)((0, p._)("Go to page %(pageNumber)d"), {
|
|
470
|
+
pageNumber: _
|
|
471
|
+
})
|
|
472
|
+
}));
|
|
473
|
+
}
|
|
474
|
+
if (a <= k && d > b && C !== d) {
|
|
475
|
+
x.push( n().createElement(g, {
|
|
476
|
+
"data-test": "page",
|
|
477
|
+
key: "nextEllipsis"
|
|
478
|
+
}));
|
|
479
|
+
if (i) {
|
|
480
|
+
x.push( n().createElement(H, {
|
|
481
|
+
"data-test": "last",
|
|
482
|
+
label: String(d),
|
|
483
|
+
key: "last",
|
|
484
|
+
onClick: t,
|
|
485
|
+
page: d,
|
|
486
|
+
"aria-label": (0, p._)("Go to last page")
|
|
487
|
+
}));
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
x.push( n().createElement(H, {
|
|
491
|
+
"data-test": "next",
|
|
492
|
+
disabled: a === d,
|
|
493
|
+
onClick: t,
|
|
494
|
+
page: a + 1,
|
|
495
|
+
key: "next",
|
|
496
|
+
"aria-label": (0, p._)("Go to next page")
|
|
497
|
+
}, (0, p._)("Next"), m ? n().createElement(Y, {
|
|
498
|
+
hideDefaultTooltip: true,
|
|
499
|
+
screenReaderText: null
|
|
500
|
+
}) : n().createElement(re, {
|
|
501
|
+
$disabled: a === d
|
|
502
|
+
})));
|
|
503
|
+
|
|
504
|
+
return n().createElement(l(), ne({
|
|
505
|
+
"data-test": "paginator",
|
|
506
|
+
"data-test-current": a,
|
|
507
|
+
flex: true,
|
|
508
|
+
inline: true,
|
|
509
|
+
role: "navigation",
|
|
510
|
+
"aria-label": (0, p._)("Pagination navigation")
|
|
511
|
+
}, v), x);
|
|
504
512
|
}
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
onClick: onChange,
|
|
511
|
-
page: current + 1,
|
|
512
|
-
key: "next",
|
|
513
|
-
"aria-label": Object(i18n_["_"])('Go to next page')
|
|
514
|
-
}, Object(i18n_["_"])('Next'), isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(StyledEnterpriseChevronRightIcon, {
|
|
515
|
-
hideDefaultTooltip: true,
|
|
516
|
-
screenReaderText: null
|
|
517
|
-
}) : /*#__PURE__*/external_react_default.a.createElement(StyledChevronRightIcon, {
|
|
518
|
-
$disabled: current === totalPages
|
|
519
|
-
})));
|
|
520
|
-
return /*#__PURE__*/external_react_default.a.createElement(Box_default.a, Paginator_extends({
|
|
521
|
-
"data-test": "paginator",
|
|
522
|
-
"data-test-current": current,
|
|
523
|
-
flex: true,
|
|
524
|
-
inline: true,
|
|
525
|
-
role: "navigation",
|
|
526
|
-
"aria-label": Object(i18n_["_"])('Pagination navigation')
|
|
527
|
-
}, otherProps), pages);
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
Paginator.propTypes = Paginator_propTypes;
|
|
531
|
-
/* harmony default export */ var Paginator_Paginator = (Paginator);
|
|
532
|
-
// CONCATENATED MODULE: ./src/Paginator/index.ts
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
/***/ }),
|
|
537
|
-
|
|
538
|
-
/***/ 2:
|
|
539
|
-
/***/ (function(module, exports) {
|
|
540
|
-
|
|
541
|
-
module.exports = require("react");
|
|
542
|
-
|
|
543
|
-
/***/ }),
|
|
544
|
-
|
|
545
|
-
/***/ 29:
|
|
546
|
-
/***/ (function(module, exports) {
|
|
547
|
-
|
|
548
|
-
module.exports = require("@splunk/ui-utils/format");
|
|
549
|
-
|
|
550
|
-
/***/ }),
|
|
551
|
-
|
|
552
|
-
/***/ 3:
|
|
553
|
-
/***/ (function(module, exports) {
|
|
554
|
-
|
|
555
|
-
module.exports = require("styled-components");
|
|
556
|
-
|
|
557
|
-
/***/ }),
|
|
558
|
-
|
|
559
|
-
/***/ 38:
|
|
560
|
-
/***/ (function(module, exports) {
|
|
561
|
-
|
|
562
|
-
module.exports = require("@splunk/react-icons/enterprise/ChevronRight");
|
|
563
|
-
|
|
564
|
-
/***/ }),
|
|
565
|
-
|
|
566
|
-
/***/ 4:
|
|
567
|
-
/***/ (function(module, exports) {
|
|
568
|
-
|
|
569
|
-
module.exports = require("@splunk/ui-utils/i18n");
|
|
570
|
-
|
|
571
|
-
/***/ }),
|
|
572
|
-
|
|
573
|
-
/***/ 46:
|
|
574
|
-
/***/ (function(module, exports) {
|
|
575
|
-
|
|
576
|
-
module.exports = require("@splunk/react-icons/ChevronRight");
|
|
577
|
-
|
|
578
|
-
/***/ }),
|
|
579
|
-
|
|
580
|
-
/***/ 5:
|
|
581
|
-
/***/ (function(module, exports) {
|
|
582
|
-
|
|
583
|
-
module.exports = require("lodash/omit");
|
|
584
|
-
|
|
585
|
-
/***/ }),
|
|
586
|
-
|
|
587
|
-
/***/ 6:
|
|
588
|
-
/***/ (function(module, exports) {
|
|
589
|
-
|
|
590
|
-
module.exports = require("@splunk/react-ui/Box");
|
|
591
|
-
|
|
592
|
-
/***/ }),
|
|
593
|
-
|
|
594
|
-
/***/ 64:
|
|
595
|
-
/***/ (function(module, exports) {
|
|
596
|
-
|
|
597
|
-
module.exports = require("@splunk/react-ui/ButtonSimple");
|
|
598
|
-
|
|
599
|
-
/***/ }),
|
|
600
|
-
|
|
601
|
-
/***/ 66:
|
|
602
|
-
/***/ (function(module, exports) {
|
|
603
|
-
|
|
604
|
-
module.exports = require("@splunk/react-icons/enterprise/ChevronLeft");
|
|
605
|
-
|
|
606
|
-
/***/ }),
|
|
607
|
-
|
|
608
|
-
/***/ 86:
|
|
609
|
-
/***/ (function(module, exports) {
|
|
610
|
-
|
|
611
|
-
module.exports = require("@splunk/react-icons/ChevronLeft");
|
|
612
|
-
|
|
613
|
-
/***/ }),
|
|
614
|
-
|
|
615
|
-
/***/ 9:
|
|
616
|
-
/***/ (function(module, exports) {
|
|
617
|
-
|
|
618
|
-
module.exports = require("lodash/keys");
|
|
619
|
-
|
|
620
|
-
/***/ })
|
|
621
|
-
|
|
622
|
-
/******/ });
|
|
513
|
+
le.propTypes = ie;
|
|
514
|
+
/* harmony default export */ const se = le;
|
|
515
|
+
// CONCATENATED MODULE: ./src/Paginator/index.ts
|
|
516
|
+
module.exports = t;
|
|
517
|
+
/******/})();
|