@splunk/react-ui 4.22.1 → 4.23.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splunk/react-ui",
3
- "version": "4.22.1",
3
+ "version": "4.23.0",
4
4
  "description": "Library of React components that implement the Splunk design language",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Splunk Inc.",
@@ -41,8 +41,8 @@
41
41
  "@dnd-kit/core": "6.0.8",
42
42
  "@dnd-kit/sortable": "7.0.2",
43
43
  "@dnd-kit/utilities": "3.2.1",
44
- "@splunk/react-icons": "^4.1.0",
45
- "@splunk/themes": "^0.16.3",
44
+ "@splunk/react-icons": "^4.2.0",
45
+ "@splunk/themes": "^0.16.4",
46
46
  "@splunk/ui-utils": "^1.6.0",
47
47
  "@types/commonmark": "^0.27.6",
48
48
  "@types/lodash": "^4.14.156",
@@ -68,7 +68,7 @@
68
68
  "@splunk/babel-preset": "^4.0.0",
69
69
  "@splunk/docs-gen": "1.0.0-beta.8",
70
70
  "@splunk/eslint-config": "^4.0.0",
71
- "@splunk/react-docs": "1.0.0-beta.9",
71
+ "@splunk/react-docs": "1.0.0-beta.11",
72
72
  "@splunk/stylelint-config": "^4.0.0",
73
73
  "@splunk/test-runner-utils": "^0.4.1",
74
74
  "@splunk/webpack-configs": "^7.0.2",
@@ -85,6 +85,7 @@
85
85
  "@testing-library/jest-dom": "^5.16.1",
86
86
  "@testing-library/react": "^12.1.2",
87
87
  "@testing-library/react-hooks": "^7.0.2",
88
+ "@testing-library/user-event": "^14.4.3",
88
89
  "@types/jest": "^26.0.0",
89
90
  "@types/mocha": "^7.0.2",
90
91
  "@types/node": "^10.17.26",
@@ -100,8 +100,8 @@ interface DropdownPropsBase {
100
100
  */
101
101
  repositionMode?: 'none' | 'flip' | 'any';
102
102
  /**
103
- * Keeps focus within the Popover while open. Menu handles its own focus by default,
104
- * so this is only necessary when the popover contains other types of content.
103
+ * Keeps focus within the Popover while open. Only use this for inputs used in a form control.
104
+ * Do not use this when the Dropdown contains a Menu because Menu handles its own focus.
105
105
  */
106
106
  retainFocus?: boolean;
107
107
  /**
@@ -21,6 +21,19 @@ interface JSONTreePropsBase {
21
21
  * A React ref which is set to the DOM element when the component mounts and null when it unmounts.
22
22
  */
23
23
  elementRef?: React.Ref<HTMLElement>;
24
+ /**
25
+ * @deprecated The `expandChildren="withShiftModifier"` value is deprecated and will be removed in a future major version. Use the `expandChildrenOnShiftKey` prop instead.
26
+ *
27
+ * If set to `true`, `expandChildren` will expand all nodes on initial render
28
+ * and expand all descendant nodes of any expanded node. The default is `false`, which expands only the first
29
+ * level of properties. If set to `withShiftModifier`, using `shift + click` or `shift + enter` will
30
+ * expand or collapse all descendant nodes of the tree at once.
31
+ */
32
+ expandChildren?: boolean | 'withShiftModifier';
33
+ /**
34
+ * Number of space characters per level of indentation.
35
+ */
36
+ indent?: number;
24
37
  /**
25
38
  * The JSON string to visualize. Alternatively, this prop also accepts objects and other
26
39
  * possible return types of `JSON.parse`. `JSONTree` doesn't perform any runtime type
@@ -28,10 +41,6 @@ interface JSONTreePropsBase {
28
41
  * representable in JSON like functions and symbols, the component behavior is unspecified.
29
42
  */
30
43
  json: string | JSONElement;
31
- /**
32
- * Number of space characters per level of indentation.
33
- */
34
- indent?: number;
35
44
  /**
36
45
  * Optional event handler to call if keys are clicked on.
37
46
  * The function signature is `onClickKey({path, keyPath, value})`, where `path` is the property path
@@ -44,31 +53,31 @@ interface JSONTreePropsBase {
44
53
  *, `.a.b`; keyPath is an array of that property path, `['a', 'b']; and `value` is the value that was clicked.
45
54
  */
46
55
  onClickValue?: JSONTreeClickValueHandler;
47
- /**
48
- * Starts with all nodes expanded if set to `true`. The default is `false`, which expands only the first
49
- * level of properties. If set to `withShiftModifier`, using `SHIFT + CLICK” or `SHIFT + ENTER` will expand or collapse all
50
- * levels of the tree at once.
51
- */
52
- expandChildren?: boolean | 'withShiftModifier';
53
56
  /**
54
57
  * Handles overflow by wrapping values or by enabling scrolling.
55
58
  */
56
59
  overflow?: 'wrap' | 'scroll';
60
+ /**
61
+ * If set to `true`, using `shift + click` or `shift + enter` will expand or collapse all descendant nodes
62
+ * of the tree at once.
63
+ */
64
+ expandChildrenOnShiftKey?: boolean;
57
65
  }
58
66
  declare type JSONTreeProps = ComponentProps<JSONTreePropsBase, 'code'>;
59
67
  /**
60
68
  * Used to visualize a JSON string.
61
69
  */
62
- declare function JSONTree({ elementRef, expandChildren, indent, json, onClickKey, onClickValue, overflow, ...otherProps }: JSONTreeProps): JSX.Element;
70
+ declare function JSONTree({ elementRef, expandChildren, indent, json, onClickKey, onClickValue, overflow, expandChildrenOnShiftKey, ...otherProps }: JSONTreeProps): JSX.Element;
63
71
  declare namespace JSONTree {
64
72
  var propTypes: {
65
73
  elementRef: PropTypes.Requireable<object>;
66
- json: PropTypes.Validator<string | number | boolean | object>;
74
+ expandChildren: PropTypes.Requireable<string | boolean>;
67
75
  indent: PropTypes.Requireable<number>;
76
+ json: PropTypes.Validator<string | number | boolean | object>;
68
77
  onClickKey: PropTypes.Requireable<(...args: any[]) => any>;
69
78
  onClickValue: PropTypes.Requireable<(...args: any[]) => any>;
70
- expandChildren: PropTypes.Requireable<string | boolean>;
71
79
  overflow: PropTypes.Requireable<string>;
80
+ expandChildrenOnShiftKey: PropTypes.Requireable<boolean>;
72
81
  };
73
82
  }
74
83
  export default JSONTree;
@@ -13,8 +13,9 @@ interface JSONTreeNodePropsBase {
13
13
  onClickValue?: JSONTreeClickValueHandler;
14
14
  overflow?: 'wrap' | 'scroll';
15
15
  shift?: boolean;
16
+ expandChildrenOnShiftKey?: boolean;
16
17
  }
17
- declare const defaultProps: Required<Pick<JSONTreeNodePropsBase, 'path' | 'defaultOpen' | 'expandChildren' | 'indent' | 'indentLevel' | 'overflow'>>;
18
+ declare const defaultProps: Required<Pick<JSONTreeNodePropsBase, 'path' | 'defaultOpen' | 'expandChildren' | 'indent' | 'indentLevel' | 'overflow' | 'expandChildrenOnShiftKey'>>;
18
19
  declare type JSONTreeNodeProps = ClassComponentProps<JSONTreeNodePropsBase, typeof defaultProps, 'span'>;
19
20
  interface JSONTreeNodeState {
20
21
  open: boolean;
@@ -28,8 +29,8 @@ declare class JSONTreeNode extends Component<JSONTreeNodeProps, JSONTreeNodeStat
28
29
  private mutableShift;
29
30
  context: React.ContextType<typeof JSONTreeContext>;
30
31
  static contextType: React.Context<JSONTreeContext>;
31
- static propTypes: React.WeakValidationMap<ClassComponentProps<JSONTreeNodePropsBase, Required<Pick<JSONTreeNodePropsBase, "path" | "overflow" | "defaultOpen" | "expandChildren" | "indent" | "indentLevel">>, "span", never>>;
32
- static defaultProps: Required<Pick<JSONTreeNodePropsBase, "path" | "overflow" | "defaultOpen" | "expandChildren" | "indent" | "indentLevel">>;
32
+ static propTypes: React.WeakValidationMap<ClassComponentProps<JSONTreeNodePropsBase, Required<Pick<JSONTreeNodePropsBase, "path" | "overflow" | "defaultOpen" | "expandChildren" | "indent" | "indentLevel" | "expandChildrenOnShiftKey">>, "span", never>>;
33
+ static defaultProps: Required<Pick<JSONTreeNodePropsBase, "path" | "overflow" | "defaultOpen" | "expandChildren" | "indent" | "indentLevel" | "expandChildrenOnShiftKey">>;
33
34
  constructor(props: JSONTreeNodeProps);
34
35
  private handleExpandClick;
35
36
  private handleClickKey;
@@ -0,0 +1 @@
1
+ export default function ExpandChildrenOnShiftKey(): JSX.Element;
@@ -125,7 +125,7 @@ interface CompactPropsBase {
125
125
  */
126
126
  repositionMode?: 'none' | 'flip';
127
127
  /**
128
- * Determines how to display Select All/Clear All.
128
+ * Determines how to display Select all/Clear all.
129
129
  */
130
130
  selectAllAppearance?: 'buttongroup' | 'checkbox';
131
131
  /**
@@ -143,7 +143,7 @@ interface MultiselectPropsBase {
143
143
  */
144
144
  repositionMode?: 'none' | 'flip';
145
145
  /**
146
- * Determines how to display Select All/Clear All.
146
+ * Determines how to display Select all/Clear all.
147
147
  * Only supported when `compact=true`.
148
148
  */
149
149
  selectAllAppearance?: 'buttongroup' | 'checkbox';
@@ -160,7 +160,7 @@ interface SelectBasePropsBase {
160
160
  */
161
161
  repositionMode?: 'none' | 'flip';
162
162
  /**
163
- * Determines how to display Select All/Clear All.
163
+ * Determines how to display Select all/Clear all.
164
164
  */
165
165
  selectAllAppearance?: 'buttongroup' | 'checkbox';
166
166
  showSelectedValuesFirst?: 'nextOpen' | 'immediately' | 'never';
@@ -1 +0,0 @@
1
- export default function WithShiftModifier(): JSX.Element;