@splunk/react-ui 4.42.0 → 4.44.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.
Files changed (71) hide show
  1. package/ButtonGroup.js +10 -11
  2. package/ButtonSimple.js +209 -209
  3. package/CHANGELOG.md +41 -0
  4. package/Clickable.js +1 -1
  5. package/Code.js +611 -426
  6. package/ComboBox.js +25 -32
  7. package/Date.js +42 -27
  8. package/Dropdown.js +1 -1
  9. package/DualListbox.js +1 -1
  10. package/JSONTree.js +30 -24
  11. package/MIGRATION.mdx +70 -54
  12. package/Menu.js +13 -9
  13. package/Multiselect.js +1 -1
  14. package/Number.js +345 -317
  15. package/Paginator.js +269 -251
  16. package/Popover.js +412 -345
  17. package/RadioList.js +44 -43
  18. package/ResultsMenu.d.ts +2 -0
  19. package/Search.js +56 -65
  20. package/Select.js +1 -1
  21. package/Slider.js +17 -13
  22. package/StaticContent.js +15 -13
  23. package/TabBar.js +4 -0
  24. package/Table.js +162 -153
  25. package/TransitionOpen.js +16 -14
  26. package/Tree.d.ts +2 -0
  27. package/Tree.js +20 -14
  28. package/package.json +6 -6
  29. package/types/src/Button/Button.d.ts +1 -0
  30. package/types/src/Code/Code.d.ts +1 -1
  31. package/types/src/ComboBox/ComboBox.d.ts +6 -3
  32. package/types/src/Date/Date.d.ts +3 -3
  33. package/types/src/Dropdown/docs/examples/TooltipButtonToggle.d.ts +2 -0
  34. package/types/src/Multiselect/Multiselect.d.ts +2 -0
  35. package/types/src/Number/Number.d.ts +4 -10
  36. package/types/src/Number/utils.d.ts +29 -0
  37. package/types/src/Paginator/Paginator.d.ts +15 -2
  38. package/types/src/Paginator/docs/examples/CustomPages.d.ts +2 -0
  39. package/types/src/Popover/Popover.d.ts +17 -8
  40. package/types/src/Popover/PopoverMenuContext.d.ts +6 -0
  41. package/types/src/Popover/PopoverProvider.d.ts +23 -0
  42. package/types/src/Popover/index.d.ts +2 -1
  43. package/types/src/RadioList/RadioList.d.ts +1 -1
  44. package/types/src/Select/SelectBase.d.ts +1 -1
  45. package/types/src/Select/docs/examples/Appearance.d.ts +1 -11
  46. package/types/src/Select/docs/examples/Basic.d.ts +1 -9
  47. package/types/src/Select/docs/examples/Children.d.ts +1 -9
  48. package/types/src/Select/docs/examples/Descriptions.d.ts +1 -9
  49. package/types/src/Select/docs/examples/Fetching.d.ts +1 -22
  50. package/types/src/Select/docs/examples/Filter.d.ts +1 -9
  51. package/types/src/Select/docs/examples/Headings.d.ts +1 -9
  52. package/types/src/Select/docs/examples/LoadMoreOnScrollBottom.d.ts +1 -24
  53. package/types/src/Select/docs/examples/Prefix.d.ts +1 -9
  54. package/types/src/Select/docs/examples/Truncate.d.ts +1 -9
  55. package/types/src/Slider/Slider.d.ts +1 -1
  56. package/types/src/StaticContent/StaticContent.d.ts +3 -1
  57. package/types/src/Table/docs/examples/Click.d.ts +2 -16
  58. package/types/src/Table/docs/examples/ClickRows.d.ts +2 -16
  59. package/types/src/Table/docs/examples/Complex.d.ts +2 -50
  60. package/types/src/Table/docs/examples/FilterColumnValues.d.ts +1 -13
  61. package/types/src/Table/docs/examples/HeadDropdownCell.d.ts +1 -17
  62. package/types/src/Table/docs/examples/ReorderColumns.d.ts +2 -21
  63. package/types/src/Table/docs/examples/ReorderRows.d.ts +2 -21
  64. package/types/src/Table/docs/examples/Resizable.d.ts +2 -23
  65. package/types/src/Table/docs/examples/ResizableFill.d.ts +2 -23
  66. package/types/src/Table/docs/examples/RowActions.d.ts +2 -39
  67. package/types/src/Table/docs/examples/Selectable.d.ts +2 -18
  68. package/types/src/Table/docs/examples/SortableColumns.d.ts +1 -11
  69. package/useResizeObserver.js +122 -90
  70. package/types/src/Dropdown/docs/examples/OtherToggles.d.ts +0 -2
  71. package/types/src/Popover/PopoverContext.d.ts +0 -6
@@ -1,21 +1,2 @@
1
- import { Component } from 'react';
2
- import { TableRequestMoveRowHandler } from '@splunk/react-ui/Table';
3
- interface Row {
4
- age: number;
5
- email: string;
6
- name: string;
7
- }
8
- interface Header {
9
- key: 'age' | 'email' | 'name';
10
- label: string;
11
- }
12
- interface ExampleState {
13
- data: Row[];
14
- headers: Header[];
15
- }
16
- export default class ReorderRows extends Component<{}, ExampleState> {
17
- constructor(props: {});
18
- handleRequestMoveRow: TableRequestMoveRowHandler;
19
- render(): JSX.Element;
20
- }
21
- export {};
1
+ declare function ReorderRows(): JSX.Element;
2
+ export default ReorderRows;
@@ -1,23 +1,2 @@
1
- import { Component } from 'react';
2
- import { TableRequestResizeColumnHandler } from '@splunk/react-ui/Table';
3
- interface Row {
4
- age: number;
5
- email: string;
6
- name: string;
7
- }
8
- interface Header {
9
- key: 'age' | 'email' | 'name';
10
- label: string;
11
- minWidth: number;
12
- width: number;
13
- }
14
- interface ExampleState {
15
- data: Row[];
16
- headers: Header[];
17
- }
18
- export default class Resizable extends Component<{}, ExampleState> {
19
- constructor(props: {});
20
- handleResizeColumn: TableRequestResizeColumnHandler;
21
- render(): JSX.Element;
22
- }
23
- export {};
1
+ declare function Resizable(): JSX.Element;
2
+ export default Resizable;
@@ -1,23 +1,2 @@
1
- import { Component } from 'react';
2
- import { TableRequestResizeColumnHandler } from '@splunk/react-ui/Table';
3
- interface Row {
4
- age: number;
5
- email: string;
6
- name: string;
7
- }
8
- interface Header {
9
- key: 'age' | 'email' | 'name';
10
- label: string;
11
- minWidth: number;
12
- width: number | 'auto';
13
- }
14
- interface ExampleState {
15
- data: Row[];
16
- headers: Header[];
17
- }
18
- export default class Resizable extends Component<{}, ExampleState> {
19
- constructor(props: {});
20
- handleResizeColumn: TableRequestResizeColumnHandler;
21
- render(): JSX.Element;
22
- }
23
- export {};
1
+ declare function ResizableFill(): JSX.Element;
2
+ export default ResizableFill;
@@ -1,39 +1,2 @@
1
- import React, { Component } from 'react';
2
- import { RowActionPrimaryClickHandler, RowActionSecondaryClickHandler } from '@splunk/react-ui/Table';
3
- interface Row {
4
- age: number;
5
- country: string;
6
- email: string;
7
- favoriteColor: string;
8
- favoriteDay: string;
9
- industry: string;
10
- name: string;
11
- occupation: string;
12
- state: string;
13
- }
14
- interface Column {
15
- label: string;
16
- name: keyof Row;
17
- visible: boolean;
18
- }
19
- interface ExampleState {
20
- columns: Column[];
21
- data: Row[];
22
- primaryAction?: string;
23
- primaryActionRowData?: string;
24
- secondaryAction?: string;
25
- secondaryActionRowData?: string;
26
- }
27
- export default class TableAction extends Component<{}, ExampleState> {
28
- constructor(props: {});
29
- handleRowClick: () => void;
30
- handleShowHide: (e: React.MouseEvent, { name }: {
31
- name: string;
32
- }) => void;
33
- handleEditActionClick: RowActionPrimaryClickHandler;
34
- handleSaveActionClick: RowActionSecondaryClickHandler;
35
- handleAddActionClick: RowActionSecondaryClickHandler;
36
- handleDeleteActionClick: RowActionSecondaryClickHandler;
37
- render(): JSX.Element;
38
- }
39
- export {};
1
+ declare function RowAction(): JSX.Element;
2
+ export default RowAction;
@@ -1,18 +1,2 @@
1
- import { Component } from 'react';
2
- import { RowRequestToggleHandler } from '@splunk/react-ui/Table';
3
- interface Row {
4
- email: string;
5
- name: string;
6
- selected: boolean;
7
- }
8
- interface ExampleState {
9
- data: Row[];
10
- }
11
- export default class Selectable extends Component<{}, ExampleState> {
12
- constructor(props: {});
13
- handleToggle: RowRequestToggleHandler;
14
- handleToggleAll: () => void;
15
- rowSelectionState(data: Row[]): "none" | "all" | "some";
16
- render(): JSX.Element;
17
- }
18
- export {};
1
+ declare function Selectable(): JSX.Element;
2
+ export default Selectable;
@@ -1,12 +1,2 @@
1
- import { Component } from 'react';
2
- import { HeadCellSortHandler } from '@splunk/react-ui/Table';
3
- interface ExampleState {
4
- sortDir: 'asc' | 'desc';
5
- sortKey: 'email' | 'name';
6
- }
7
- declare class SortableColumns extends Component<{}, ExampleState> {
8
- constructor(props: {});
9
- handleSort: HeadCellSortHandler;
10
- render(): JSX.Element;
11
- }
1
+ declare function SortableColumns(): JSX.Element;
12
2
  export default SortableColumns;
@@ -1,19 +1,48 @@
1
1
  /******/ (() => {
2
2
  // webpackBootstrap
3
3
  /******/ "use strict";
4
- /******/ // The require scope
5
- /******/ var e = {};
4
+ /******/ var e = {
5
+ /***/ 9497:
6
+ /***/ e => {
7
+ e.exports = require("react");
8
+ /***/
9
+ /******/ }
10
+ };
11
+ /************************************************************************/
12
+ /******/ // The module cache
13
+ /******/ var r = {};
14
+ /******/
15
+ /******/ // The require function
16
+ /******/ function t(n) {
17
+ /******/ // Check if module is in cache
18
+ /******/ var o = r[n];
19
+ /******/ if (o !== undefined) {
20
+ /******/ return o.exports;
21
+ /******/ }
22
+ /******/ // Create a new module (and put it into the cache)
23
+ /******/ var i = r[n] = {
24
+ /******/ // no module.id needed
25
+ /******/ // no module.loaded needed
26
+ /******/ exports: {}
27
+ /******/ };
28
+ /******/
29
+ /******/ // Execute the module function
30
+ /******/ e[n](i, i.exports, t);
31
+ /******/
32
+ /******/ // Return the exports of the module
33
+ /******/ return i.exports;
34
+ /******/ }
6
35
  /******/
7
36
  /************************************************************************/
8
37
  /******/ /* webpack/runtime/define property getters */
9
38
  /******/ (() => {
10
39
  /******/ // define getter functions for harmony exports
11
- /******/ e.d = (r, t) => {
12
- /******/ for (var n in t) {
13
- /******/ if (e.o(t, n) && !e.o(r, n)) {
14
- /******/ Object.defineProperty(r, n, {
40
+ /******/ t.d = (e, r) => {
41
+ /******/ for (var n in r) {
42
+ /******/ if (t.o(r, n) && !t.o(e, n)) {
43
+ /******/ Object.defineProperty(e, n, {
15
44
  enumerable: true,
16
- get: t[n]
45
+ get: r[n]
17
46
  });
18
47
  /******/ }
19
48
  /******/ }
@@ -22,14 +51,14 @@
22
51
  /******/
23
52
  /******/ /* webpack/runtime/hasOwnProperty shorthand */
24
53
  /******/ (() => {
25
- /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r)
54
+ /******/ t.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r)
26
55
  /******/;
27
56
  })();
28
57
  /******/
29
58
  /******/ /* webpack/runtime/make namespace object */
30
59
  /******/ (() => {
31
60
  /******/ // define __esModule on exports
32
- /******/ e.r = e => {
61
+ /******/ t.r = e => {
33
62
  /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
34
63
  /******/ Object.defineProperty(e, Symbol.toStringTag, {
35
64
  value: "Module"
@@ -41,97 +70,100 @@
41
70
  /******/ };
42
71
  /******/ })();
43
72
  /******/
44
- /************************************************************************/ var r = {};
45
- // ESM COMPAT FLAG
46
- e.r(r);
47
- // EXPORTS
48
- e.d(r, {
49
- default: () => /* reexport */ c
50
- });
51
- // CONCATENATED MODULE: external "react"
52
- const t = require("react");
53
- // CONCATENATED MODULE: ./src/useResizeObserver/useResizeObserver.ts
54
- function n(e, r) {
55
- return a(e) || l(e, r) || i(e, r) || o();
56
- }
57
- function o() {
58
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
59
- }
60
- function i(e, r) {
61
- if (e) {
62
- if ("string" == typeof e) return u(e, r);
63
- var t = {}.toString.call(e).slice(8, -1);
64
- return "Object" === t && e.constructor && (t = e.constructor.name), "Map" === t || "Set" === t ? Array.from(e) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? u(e, r) : void 0;
73
+ /************************************************************************/ var n = {};
74
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
75
+ (() => {
76
+ // ESM COMPAT FLAG
77
+ t.r(n);
78
+ // EXPORTS
79
+ t.d(n, {
80
+ default: () => /* reexport */ c
81
+ });
82
+ // EXTERNAL MODULE: external "react"
83
+ var e = t(9497);
84
+ // CONCATENATED MODULE: ./src/useResizeObserver/useResizeObserver.ts
85
+ function r(e, r) {
86
+ return a(e) || l(e, r) || i(e, r) || o();
65
87
  }
66
- }
67
- function u(e, r) {
68
- (null == r || r > e.length) && (r = e.length);
69
- for (var t = 0, n = Array(r); t < r; t++) {
70
- n[t] = e[t];
88
+ function o() {
89
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
71
90
  }
72
- return n;
73
- }
74
- function l(e, r) {
75
- var t = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
76
- if (null != t) {
77
- var n, o, i, u, l = [], a = !0, f = !1;
78
- try {
79
- if (i = (t = t.call(e)).next, 0 === r) {
80
- if (Object(t) !== t) return;
81
- a = !1;
82
- } else for (;!(a = (n = i.call(t)).done) && (l.push(n.value), l.length !== r); a = !0) {
83
- }
84
- } catch (e) {
85
- f = !0, o = e;
86
- } finally {
91
+ function i(e, r) {
92
+ if (e) {
93
+ if ("string" == typeof e) return u(e, r);
94
+ var t = {}.toString.call(e).slice(8, -1);
95
+ return "Object" === t && e.constructor && (t = e.constructor.name), "Map" === t || "Set" === t ? Array.from(e) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? u(e, r) : void 0;
96
+ }
97
+ }
98
+ function u(e, r) {
99
+ (null == r || r > e.length) && (r = e.length);
100
+ for (var t = 0, n = Array(r); t < r; t++) {
101
+ n[t] = e[t];
102
+ }
103
+ return n;
104
+ }
105
+ function l(e, r) {
106
+ var t = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
107
+ if (null != t) {
108
+ var n, o, i, u, l = [], a = !0, f = !1;
87
109
  try {
88
- if (!a && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
110
+ if (i = (t = t.call(e)).next, 0 === r) {
111
+ if (Object(t) !== t) return;
112
+ a = !1;
113
+ } else for (;!(a = (n = i.call(t)).done) && (l.push(n.value), l.length !== r); a = !0) {
114
+ }
115
+ } catch (e) {
116
+ f = !0, o = e;
89
117
  } finally {
90
- if (f) throw o;
118
+ try {
119
+ if (!a && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
120
+ } finally {
121
+ if (f) throw o;
122
+ }
91
123
  }
124
+ return l;
92
125
  }
93
- return l;
94
126
  }
95
- }
96
- function a(e) {
97
- if (Array.isArray(e)) return e;
98
- }
99
- /**
127
+ function a(e) {
128
+ if (Array.isArray(e)) return e;
129
+ }
130
+ /**
100
131
  * Watches a React ref element for changes in size.
101
132
  *
102
133
  * @param ref - The React ref to observe size changes on
103
- */ var f = function e(r) {
104
- var o = (0, t.useState)({
105
- width: 0,
106
- height: 0
107
- }), i = n(o, 2), u = i[0], l = i[1];
108
- (0, t.useEffect)((function() {
109
- var e = r.current;
110
- if (typeof window !== "undefined" && window.ResizeObserver) {
111
- var t = new ResizeObserver((function(e) {
112
- if (e[0]) {
113
- var t, n;
114
- l({
115
- width: (r === null || r === void 0 ? void 0 : (t = r.current) === null || t === void 0 ? void 0 : t.getBoundingClientRect().width) || 0,
116
- height: (r === null || r === void 0 ? void 0 : (n = r.current) === null || n === void 0 ? void 0 : n.getBoundingClientRect().height) || 0
117
- });
118
- }
119
- }));
120
- if (e) {
121
- t.observe(e);
122
- }
123
- return function() {
134
+ */ var f = function t(n) {
135
+ var o = (0, e.useState)({
136
+ width: 0,
137
+ height: 0
138
+ }), i = r(o, 2), u = i[0], l = i[1];
139
+ (0, e.useEffect)((function() {
140
+ var e = n.current;
141
+ if (typeof window !== "undefined" && window.ResizeObserver) {
142
+ var r = new ResizeObserver((function(e) {
143
+ if (e[0]) {
144
+ var r, t;
145
+ l({
146
+ width: (n === null || n === void 0 ? void 0 : (r = n.current) === null || r === void 0 ? void 0 : r.getBoundingClientRect().width) || 0,
147
+ height: (n === null || n === void 0 ? void 0 : (t = n.current) === null || t === void 0 ? void 0 : t.getBoundingClientRect().height) || 0
148
+ });
149
+ }
150
+ }));
124
151
  if (e) {
125
- t.unobserve(e);
152
+ r.observe(e);
126
153
  }
127
- };
128
- }
129
- // Return a no-op function to satisfy consistent-return rule
130
- return function() {};
131
- }), [ r ]);
132
- return u;
133
- };
134
- /* harmony default export */ const c = f;
135
- // CONCATENATED MODULE: ./src/useResizeObserver/index.ts
136
- module.exports = r;
154
+ return function() {
155
+ if (e) {
156
+ r.unobserve(e);
157
+ }
158
+ };
159
+ }
160
+ // Return a no-op function to satisfy consistent-return rule
161
+ return function() {};
162
+ }), [ n ]);
163
+ return u;
164
+ };
165
+ /* harmony default export */ const c = f;
166
+ }) // CONCATENATED MODULE: ./src/useResizeObserver/index.ts
167
+ ();
168
+ module.exports = n;
137
169
  /******/})();
@@ -1,2 +0,0 @@
1
- declare function OtherToggles(): JSX.Element;
2
- export default OtherToggles;
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- interface PopoverContextValue {
3
- retainFocus?: boolean;
4
- }
5
- declare const PopoverContext: import("react").Context<PopoverContextValue>;
6
- export { PopoverContext };