@splunk/react-ui 4.22.0 → 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/CHANGELOG.md +22 -0
- package/Color.js +289 -293
- package/ComboBox.js +3 -3
- package/Date.js +3 -3
- package/DualListbox.js +2 -2
- package/File.js +15 -15
- package/JSONTree.js +204 -219
- package/List.js +17 -12
- package/MIGRATION.mdx +14 -0
- package/Message.js +1 -1
- package/Multiselect.js +168 -168
- package/Number.js +3 -3
- package/Search.js +2 -2
- package/Select.js +390 -390
- package/Text.js +25 -15
- package/TextArea.js +27 -17
- package/package.json +5 -4
- package/types/src/ComboBox/ComboBox.d.ts +13 -3
- package/types/src/Date/Date.d.ts +13 -3
- package/types/src/Dropdown/Dropdown.d.ts +2 -2
- package/types/src/JSONTree/JSONTree.d.ts +22 -13
- package/types/src/JSONTree/TreeNode.d.ts +4 -3
- package/types/src/JSONTree/docs/examples/ExpandChildrenOnShiftKey.d.ts +1 -0
- package/types/src/List/List.d.ts +11 -4
- package/types/src/Multiselect/Compact.d.ts +1 -1
- package/types/src/Multiselect/Multiselect.d.ts +1 -1
- package/types/src/Number/Number.d.ts +13 -3
- package/types/src/Search/Search.d.ts +13 -3
- package/types/src/Select/SelectBase.d.ts +1 -1
- package/types/src/Text/Text.d.ts +13 -3
- package/types/src/TextArea/TextArea.d.ts +13 -3
- package/types/src/JSONTree/docs/examples/WithShiftModifier.d.ts +0 -1
- /package/types/src/Card/docs/examples/{prisma/Actions.d.ts → Actions.d.ts} +0 -0
package/Text.js
CHANGED
|
@@ -84,8 +84,8 @@
|
|
|
84
84
|
// CONCATENATED MODULE: external "@splunk/react-ui/ControlGroup"
|
|
85
85
|
const m = require("@splunk/react-ui/ControlGroup");
|
|
86
86
|
// CONCATENATED MODULE: external "@splunk/react-icons/Cross"
|
|
87
|
-
const
|
|
88
|
-
var
|
|
87
|
+
const v = require("@splunk/react-icons/Cross");
|
|
88
|
+
var h = e.n(v);
|
|
89
89
|
// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Close"
|
|
90
90
|
const b = require("@splunk/react-icons/enterprise/Close");
|
|
91
91
|
var y = e.n(b);
|
|
@@ -622,7 +622,7 @@
|
|
|
622
622
|
}
|
|
623
623
|
function me(e, t) {
|
|
624
624
|
if (e == null) return {};
|
|
625
|
-
var r =
|
|
625
|
+
var r = ve(e, t);
|
|
626
626
|
var n, i;
|
|
627
627
|
if (Object.getOwnPropertySymbols) {
|
|
628
628
|
var a = Object.getOwnPropertySymbols(e);
|
|
@@ -635,7 +635,7 @@
|
|
|
635
635
|
}
|
|
636
636
|
return r;
|
|
637
637
|
}
|
|
638
|
-
function
|
|
638
|
+
function ve(e, t) {
|
|
639
639
|
if (e == null) return {};
|
|
640
640
|
var r = {};
|
|
641
641
|
var n = Object.keys(e);
|
|
@@ -647,7 +647,7 @@
|
|
|
647
647
|
}
|
|
648
648
|
return r;
|
|
649
649
|
}
|
|
650
|
-
function
|
|
650
|
+
function he(e, t) {
|
|
651
651
|
if (!(e instanceof t)) {
|
|
652
652
|
throw new TypeError("Cannot call a class as a function");
|
|
653
653
|
}
|
|
@@ -819,7 +819,7 @@
|
|
|
819
819
|
} ]);
|
|
820
820
|
function r(e) {
|
|
821
821
|
var i;
|
|
822
|
-
|
|
822
|
+
he(this, r);
|
|
823
823
|
i = t.call(this, e);
|
|
824
824
|
Ee(ke(i), "controlledExternally", void 0);
|
|
825
825
|
Ee(ke(i), "input", null);
|
|
@@ -873,11 +873,21 @@
|
|
|
873
873
|
}));
|
|
874
874
|
Ee(ke(i), "handleInputFocus", (function(e) {
|
|
875
875
|
var t, r;
|
|
876
|
-
|
|
876
|
+
var n = e.target.value;
|
|
877
|
+
var a = i.props.name;
|
|
878
|
+
(t = (r = i.props).onFocus) === null || t === void 0 ? void 0 : t.call(r, e, {
|
|
879
|
+
value: n,
|
|
880
|
+
name: a
|
|
881
|
+
});
|
|
877
882
|
}));
|
|
878
883
|
Ee(ke(i), "handleInputBlur", (function(e) {
|
|
879
884
|
var t, r;
|
|
880
|
-
|
|
885
|
+
var n = e.target.value;
|
|
886
|
+
var a = i.props.name;
|
|
887
|
+
(t = (r = i.props).onBlur) === null || t === void 0 ? void 0 : t.call(r, e, {
|
|
888
|
+
value: n,
|
|
889
|
+
name: a
|
|
890
|
+
});
|
|
881
891
|
}));
|
|
882
892
|
Ee(ke(i), "handleClear", (function(e) {
|
|
883
893
|
var t, r;
|
|
@@ -919,7 +929,7 @@
|
|
|
919
929
|
return n().createElement(re, m, a);
|
|
920
930
|
}
|
|
921
931
|
if (o && !l) {
|
|
922
|
-
var
|
|
932
|
+
var v = i.state.hideVisibility ? n().createElement(B, null) : n().createElement(P, null);
|
|
923
933
|
|
|
924
934
|
return n().createElement(re, m, n().createElement(Q, {
|
|
925
935
|
appearance: p ? "secondary" : "pill",
|
|
@@ -927,7 +937,7 @@
|
|
|
927
937
|
inline: false,
|
|
928
938
|
onClick: i.handleVisibilityToggle,
|
|
929
939
|
type: "button",
|
|
930
|
-
icon:
|
|
940
|
+
icon: v
|
|
931
941
|
}));
|
|
932
942
|
}
|
|
933
943
|
var b = i.context;
|
|
@@ -954,7 +964,7 @@
|
|
|
954
964
|
icon: u ? n().createElement(y(), {
|
|
955
965
|
size: 1,
|
|
956
966
|
screenReaderText: x
|
|
957
|
-
}) : n().createElement(
|
|
967
|
+
}) : n().createElement(h(), {
|
|
958
968
|
"aria-label": x
|
|
959
969
|
}),
|
|
960
970
|
onClick: i.handleClear
|
|
@@ -979,7 +989,7 @@
|
|
|
979
989
|
icon: u ? n().createElement(y(), {
|
|
980
990
|
inline: false,
|
|
981
991
|
screenReaderText: x
|
|
982
|
-
}) : n().createElement(
|
|
992
|
+
}) : n().createElement(h(), {
|
|
983
993
|
"aria-label": x,
|
|
984
994
|
height: f,
|
|
985
995
|
inline: false,
|
|
@@ -1077,13 +1087,13 @@
|
|
|
1077
1087
|
}, {
|
|
1078
1088
|
key: "render",
|
|
1079
1089
|
value: function e() {
|
|
1080
|
-
var t = this.props, r = t.append, i = t.autoCapitalize, a = t.autoComplete, o = t.autoCorrect, l = t.autoFocus, s = t.children, p = t.className, u = t.classNamePrivate, m = t.disabled,
|
|
1090
|
+
var t = this.props, r = t.append, i = t.autoCapitalize, a = t.autoComplete, o = t.autoCorrect, l = t.autoFocus, s = t.children, p = t.className, u = t.classNamePrivate, m = t.disabled, v = t.describedBy, h = t.elementRef, b = t.error, y = t.inline, C = t.inputClassName, g = t.inputId, x = t.labelledBy, w = t.multiline, k = t.maxLength, S = t.name, A = t.passwordVisibilityToggle, T = t.placeholder, I = t.prepend, j = t.required, M = t.spellCheck, R = t.tabIndex, P = t.title, $ = t.type, _ = t.useSyntheticPlaceholder, B = me(t, [ "append", "autoCapitalize", "autoComplete", "autoCorrect", "autoFocus", "children", "className", "classNamePrivate", "disabled", "describedBy", "elementRef", "error", "inline", "inputClassName", "inputId", "labelledBy", "multiline", "maxLength", "name", "passwordVisibilityToggle", "placeholder", "prepend", "required", "spellCheck", "tabIndex", "title", "type", "useSyntheticPlaceholder" ]);
|
|
1081
1091
|
var D = fe(fe({
|
|
1082
1092
|
role: "textbox"
|
|
1083
1093
|
}, f()(B, (function(e, t) {
|
|
1084
1094
|
return t === "role" || t.indexOf("aria-") === 0;
|
|
1085
1095
|
}))), {}, {
|
|
1086
|
-
"aria-describedby":
|
|
1096
|
+
"aria-describedby": v,
|
|
1087
1097
|
"aria-labelledby": x,
|
|
1088
1098
|
"aria-invalid": b || undefined
|
|
1089
1099
|
});
|
|
@@ -1143,7 +1153,7 @@
|
|
|
1143
1153
|
className: (0, O.toClassName)(p, u),
|
|
1144
1154
|
"data-test": "text",
|
|
1145
1155
|
"data-test-value": H,
|
|
1146
|
-
elementRef:
|
|
1156
|
+
elementRef: h,
|
|
1147
1157
|
flex: true,
|
|
1148
1158
|
inline: y
|
|
1149
1159
|
}, N), this.renderStartAdornment(), n().createElement(U, ae({
|
package/TextArea.js
CHANGED
|
@@ -83,10 +83,10 @@
|
|
|
83
83
|
var f = e.n(u);
|
|
84
84
|
// CONCATENATED MODULE: external "lodash/omit"
|
|
85
85
|
const h = require("lodash/omit");
|
|
86
|
-
var
|
|
86
|
+
var v = e.n(h);
|
|
87
87
|
// CONCATENATED MODULE: external "lodash/pickBy"
|
|
88
|
-
const
|
|
89
|
-
var b = e.n(
|
|
88
|
+
const m = require("lodash/pickBy");
|
|
89
|
+
var b = e.n(m);
|
|
90
90
|
// CONCATENATED MODULE: external "lodash/throttle"
|
|
91
91
|
const y = require("lodash/throttle");
|
|
92
92
|
var g = e.n(y);
|
|
@@ -609,12 +609,12 @@
|
|
|
609
609
|
Object.defineProperty(e, n.key, n);
|
|
610
610
|
}
|
|
611
611
|
}
|
|
612
|
-
function
|
|
612
|
+
function ve(e, t, r) {
|
|
613
613
|
if (t) he(e.prototype, t);
|
|
614
614
|
if (r) he(e, r);
|
|
615
615
|
return e;
|
|
616
616
|
}
|
|
617
|
-
function
|
|
617
|
+
function me(e, t) {
|
|
618
618
|
if (typeof t !== "function" && t !== null) {
|
|
619
619
|
throw new TypeError("Super expression must either be null or a function");
|
|
620
620
|
}
|
|
@@ -748,9 +748,9 @@
|
|
|
748
748
|
tabIndex: 0
|
|
749
749
|
};
|
|
750
750
|
/** Note: TextArea places role and aria props onto the input. All other props are placed on the wrapper. */ var Oe = function(e) {
|
|
751
|
-
|
|
751
|
+
me(r, e);
|
|
752
752
|
var t = ye(r);
|
|
753
|
-
|
|
753
|
+
ve(r, null, [ {
|
|
754
754
|
key: "validateRows",
|
|
755
755
|
// @docs-props-type TextAreaPropsBase
|
|
756
756
|
value: function e(t) {
|
|
@@ -818,11 +818,21 @@
|
|
|
818
818
|
}));
|
|
819
819
|
ke(xe(a), "handleInputFocus", (function(e) {
|
|
820
820
|
var t, r;
|
|
821
|
-
|
|
821
|
+
var n = e.target.value;
|
|
822
|
+
var i = a.props.name;
|
|
823
|
+
(t = (r = a.props).onFocus) === null || t === void 0 ? void 0 : t.call(r, e, {
|
|
824
|
+
value: n,
|
|
825
|
+
name: i
|
|
826
|
+
});
|
|
822
827
|
}));
|
|
823
828
|
ke(xe(a), "handleInputBlur", (function(e) {
|
|
824
829
|
var t, r;
|
|
825
|
-
|
|
830
|
+
var n = e.target.value;
|
|
831
|
+
var i = a.props.name;
|
|
832
|
+
(t = (r = a.props).onBlur) === null || t === void 0 ? void 0 : t.call(r, e, {
|
|
833
|
+
value: n,
|
|
834
|
+
name: i
|
|
835
|
+
});
|
|
826
836
|
}));
|
|
827
837
|
ke(xe(a), "handleClear", (function(e) {
|
|
828
838
|
var t, r;
|
|
@@ -870,8 +880,8 @@
|
|
|
870
880
|
return n().createElement(Y, f, i);
|
|
871
881
|
}
|
|
872
882
|
var h = a.context;
|
|
873
|
-
var
|
|
874
|
-
var
|
|
883
|
+
var v = (e = h.labelAttrs) === null || e === void 0 ? void 0 : e.text;
|
|
884
|
+
var m = v ? (0, M._)("Clear ".concat(v, " text field")) : (0, M._)("Clear text field");
|
|
875
885
|
if (!c && r === "search") {
|
|
876
886
|
|
|
877
887
|
return n().createElement(Y, f, n().createElement(F, {
|
|
@@ -880,7 +890,7 @@
|
|
|
880
890
|
inline: false,
|
|
881
891
|
icon: n().createElement(S(), {
|
|
882
892
|
size: 1,
|
|
883
|
-
screenReaderText:
|
|
893
|
+
screenReaderText: m
|
|
884
894
|
}),
|
|
885
895
|
onClick: a.handleClear
|
|
886
896
|
}), n().createElement(H, {
|
|
@@ -903,7 +913,7 @@
|
|
|
903
913
|
appearance: "secondary",
|
|
904
914
|
onClick: a.handleClear,
|
|
905
915
|
icon: n().createElement(C(), {
|
|
906
|
-
"aria-label":
|
|
916
|
+
"aria-label": m,
|
|
907
917
|
inline: false,
|
|
908
918
|
width: u,
|
|
909
919
|
height: u
|
|
@@ -954,7 +964,7 @@
|
|
|
954
964
|
a.handleResize = g()(a.handleResize, 100);
|
|
955
965
|
return a;
|
|
956
966
|
}
|
|
957
|
-
|
|
967
|
+
ve(r, [ {
|
|
958
968
|
key: "componentDidMount",
|
|
959
969
|
value: function e() {
|
|
960
970
|
l()(this.syncHeightWithShadow);
|
|
@@ -999,16 +1009,16 @@
|
|
|
999
1009
|
key: "render",
|
|
1000
1010
|
value: function e() {
|
|
1001
1011
|
var t = this;
|
|
1002
|
-
var r = this.props, a = r.append, i = r.autoCapitalize, o = r.autoComplete, l = r.autoCorrect, s = r.autoFocus, c = r.children, p = r.className, u = r.classNamePrivate, h = r.disabled,
|
|
1012
|
+
var r = this.props, a = r.append, i = r.autoCapitalize, o = r.autoComplete, l = r.autoCorrect, s = r.autoFocus, c = r.children, p = r.className, u = r.classNamePrivate, h = r.disabled, m = r.describedBy, y = r.elementRef, g = r.error, x = r.inline, w = r.inputClassName, C = r.inputId, k = r.labelledBy, S = r.maxLength, A = r.name, O = r.placeholder, I = r.prepend, j = r.required, P = r.spellCheck, _ = r.tabIndex, M = r.title, $ = de(r, [ "append", "autoCapitalize", "autoComplete", "autoCorrect", "autoFocus", "children", "className", "classNamePrivate", "disabled", "describedBy", "elementRef", "error", "inline", "inputClassName", "inputId", "labelledBy", "maxLength", "name", "placeholder", "prepend", "required", "spellCheck", "tabIndex", "title" ]);
|
|
1003
1013
|
var D = pe(pe({}, b()($, (function(e, t) {
|
|
1004
1014
|
return t === "role" || t.indexOf("aria-") === 0;
|
|
1005
1015
|
}))), {}, {
|
|
1006
|
-
"aria-describedby":
|
|
1016
|
+
"aria-describedby": m,
|
|
1007
1017
|
"aria-labelledby": k,
|
|
1008
1018
|
"aria-invalid": g || undefined,
|
|
1009
1019
|
"aria-multiline": true
|
|
1010
1020
|
});
|
|
1011
|
-
var N =
|
|
1021
|
+
var N = v()($, [ "inputRef", "onBlur", "onChange", "onFocus", "onKeyDown", "onSelect", "onInputClick", "rowsMax", "rowsMin" ].concat(ne(d()(D))));
|
|
1012
1022
|
var R = this.getDisplayValue();
|
|
1013
1023
|
var q = {
|
|
1014
1024
|
className: (0, T.toClassName)(p, w),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splunk/react-ui",
|
|
3
|
-
"version": "4.
|
|
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.
|
|
45
|
-
"@splunk/themes": "^0.16.
|
|
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.
|
|
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",
|
|
@@ -9,6 +9,16 @@ declare type ComboBoxChangeHandler = (event: React.ChangeEvent<HTMLInputElement
|
|
|
9
9
|
}) => void;
|
|
10
10
|
/** @public */
|
|
11
11
|
declare type ComboBoxScrollBottomHandler = (event: React.UIEvent<HTMLDivElement> | React.KeyboardEvent<HTMLInputElement> | null) => void;
|
|
12
|
+
/** @public */
|
|
13
|
+
declare type ComboBoxBlurHandler = (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>, data: {
|
|
14
|
+
name?: string;
|
|
15
|
+
value: string;
|
|
16
|
+
}) => void;
|
|
17
|
+
/** @public */
|
|
18
|
+
declare type ComboBoxFocusHandler = (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>, data: {
|
|
19
|
+
name?: string;
|
|
20
|
+
value: string;
|
|
21
|
+
}) => void;
|
|
12
22
|
interface ComboBoxPropsBase {
|
|
13
23
|
animateLoading?: boolean;
|
|
14
24
|
/** Append removes rounded borders and border from the right side. */
|
|
@@ -68,9 +78,9 @@ interface ComboBoxPropsBase {
|
|
|
68
78
|
* for example: "No matching dashboards". You can insert content such as an error message or
|
|
69
79
|
* communicate a minimum number of characters to enter to see results. */
|
|
70
80
|
noOptionsMessage?: React.ReactNode;
|
|
71
|
-
onBlur?:
|
|
81
|
+
onBlur?: ComboBoxBlurHandler;
|
|
72
82
|
onChange?: ComboBoxChangeHandler;
|
|
73
|
-
onFocus?:
|
|
83
|
+
onFocus?: ComboBoxFocusHandler;
|
|
74
84
|
onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
75
85
|
onSelect?: React.ReactEventHandler<HTMLInputElement>;
|
|
76
86
|
/**
|
|
@@ -165,4 +175,4 @@ declare class ComboBox extends Component<ComboBoxProps, ComboBoxState> {
|
|
|
165
175
|
render(): JSX.Element;
|
|
166
176
|
}
|
|
167
177
|
export default ComboBox;
|
|
168
|
-
export { ComboBoxChangeHandler, Option, Divider, Heading };
|
|
178
|
+
export { ComboBoxBlurHandler, ComboBoxChangeHandler, ComboBoxFocusHandler, Option, Divider, Heading, };
|
package/types/src/Date/Date.d.ts
CHANGED
|
@@ -7,6 +7,16 @@ declare type DateChangeHandler = (event: React.MouseEvent<HTMLButtonElement | HT
|
|
|
7
7
|
name?: string;
|
|
8
8
|
value: string;
|
|
9
9
|
}) => void;
|
|
10
|
+
/** @public */
|
|
11
|
+
declare type DateBlurHandler = (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>, data: {
|
|
12
|
+
name?: string;
|
|
13
|
+
value: string;
|
|
14
|
+
}) => void;
|
|
15
|
+
/** @public */
|
|
16
|
+
declare type DateFocusHandler = (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>, data: {
|
|
17
|
+
name?: string;
|
|
18
|
+
value: string;
|
|
19
|
+
}) => void;
|
|
10
20
|
interface DatePropsBase {
|
|
11
21
|
/** Default date to display. Set this instead of value to make the Date uncontrolled. */
|
|
12
22
|
defaultValue?: string;
|
|
@@ -50,14 +60,14 @@ interface DatePropsBase {
|
|
|
50
60
|
* control when multiple controls share an onChange callback. */
|
|
51
61
|
name?: string;
|
|
52
62
|
/** A callback for when the input loses focus. */
|
|
53
|
-
onBlur?:
|
|
63
|
+
onBlur?: DateBlurHandler;
|
|
54
64
|
/**
|
|
55
65
|
* Return event and data object with date string (in YYYY-MM-DD format) when a date is
|
|
56
66
|
* selected.
|
|
57
67
|
*/
|
|
58
68
|
onChange?: DateChangeHandler;
|
|
59
69
|
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
60
|
-
onFocus?:
|
|
70
|
+
onFocus?: DateFocusHandler;
|
|
61
71
|
onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
62
72
|
/** @private */
|
|
63
73
|
splunkTheme: AnyTheme;
|
|
@@ -140,5 +150,5 @@ declare const DateWithTheme: React.ForwardRefExoticComponent<Pick<Pick<Pick<Date
|
|
|
140
150
|
};
|
|
141
151
|
export default DateWithTheme;
|
|
142
152
|
export { Date as DateWithoutTheme };
|
|
143
|
-
export { DateChangeHandler };
|
|
153
|
+
export { DateBlurHandler, DateChangeHandler, DateFocusHandler };
|
|
144
154
|
export type { DatePropsBase, DatePropsBaseControlled, DatePropsBaseUncontrolled };
|
|
@@ -100,8 +100,8 @@ interface DropdownPropsBase {
|
|
|
100
100
|
*/
|
|
101
101
|
repositionMode?: 'none' | 'flip' | 'any';
|
|
102
102
|
/**
|
|
103
|
-
* Keeps focus within the Popover while open.
|
|
104
|
-
*
|
|
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
|
-
|
|
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;
|
package/types/src/List/List.d.ts
CHANGED
|
@@ -18,17 +18,23 @@ interface ListPropsBase {
|
|
|
18
18
|
*/
|
|
19
19
|
type?: 'disc' | 'decimal' | 'lower-alpha' | 'upper-alpha';
|
|
20
20
|
}
|
|
21
|
+
declare const defaultProps: Required<Pick<ListPropsBase, 'type'>>;
|
|
21
22
|
interface ListOrderedPropsBase extends ListPropsBase {
|
|
22
23
|
elementRef?: React.Ref<HTMLOListElement>;
|
|
23
|
-
ordered
|
|
24
|
-
type
|
|
24
|
+
ordered: true;
|
|
25
|
+
type?: never;
|
|
26
|
+
}
|
|
27
|
+
interface ListOrderedTypePropsBase extends ListPropsBase {
|
|
28
|
+
elementRef?: React.Ref<HTMLOListElement>;
|
|
29
|
+
ordered?: never;
|
|
30
|
+
type?: 'decimal' | 'lower-alpha' | 'upper-alpha';
|
|
25
31
|
}
|
|
26
32
|
interface ListUnorderedPropsBase extends ListPropsBase {
|
|
27
33
|
elementRef?: React.Ref<HTMLUListElement>;
|
|
28
34
|
type?: 'disc';
|
|
29
35
|
}
|
|
30
|
-
declare type ListOrderedProps = ComponentProps<ListOrderedPropsBase, 'ol'
|
|
31
|
-
declare type ListUnorderedProps = ComponentProps<ListUnorderedPropsBase, 'ul'
|
|
36
|
+
declare type ListOrderedProps = ComponentProps<ListOrderedPropsBase | ListOrderedTypePropsBase, 'ol'> & typeof defaultProps;
|
|
37
|
+
declare type ListUnorderedProps = ComponentProps<ListUnorderedPropsBase, 'ul'> & typeof defaultProps;
|
|
32
38
|
declare type ListProps = ListOrderedProps | ListUnorderedProps;
|
|
33
39
|
declare function List({ children, elementRef, type, ordered, ...otherProps }: ListProps): JSX.Element;
|
|
34
40
|
declare namespace List {
|
|
@@ -38,6 +44,7 @@ declare namespace List {
|
|
|
38
44
|
ordered: PropTypes.Requireable<boolean>;
|
|
39
45
|
type: PropTypes.Requireable<string>;
|
|
40
46
|
};
|
|
47
|
+
var defaultProps: Required<Pick<ListPropsBase, "type">>;
|
|
41
48
|
var Item: typeof import("./Item").default;
|
|
42
49
|
}
|
|
43
50
|
export default List;
|
|
@@ -125,7 +125,7 @@ interface CompactPropsBase {
|
|
|
125
125
|
*/
|
|
126
126
|
repositionMode?: 'none' | 'flip';
|
|
127
127
|
/**
|
|
128
|
-
* Determines how to display Select
|
|
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
|
|
146
|
+
* Determines how to display Select all/Clear all.
|
|
147
147
|
* Only supported when `compact=true`.
|
|
148
148
|
*/
|
|
149
149
|
selectAllAppearance?: 'buttongroup' | 'checkbox';
|
|
@@ -8,6 +8,16 @@ declare type NumberChangeHandler = (event: React.ChangeEvent<HTMLInputElement |
|
|
|
8
8
|
name?: string;
|
|
9
9
|
value?: number;
|
|
10
10
|
}) => void;
|
|
11
|
+
/** @public */
|
|
12
|
+
declare type NumberBlurHandler = (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>, data: {
|
|
13
|
+
name?: string;
|
|
14
|
+
value: string;
|
|
15
|
+
}) => void;
|
|
16
|
+
/** @public */
|
|
17
|
+
declare type NumberFocusHandler = (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>, data: {
|
|
18
|
+
name?: string;
|
|
19
|
+
value: string;
|
|
20
|
+
}) => void;
|
|
11
21
|
interface NumberPropsBase {
|
|
12
22
|
/** Append removes the rounded borders and the border from the right side and moves the
|
|
13
23
|
* increment and decrement buttons to the left. */
|
|
@@ -65,7 +75,7 @@ interface NumberPropsBase {
|
|
|
65
75
|
* control when multiple controls share an onChange callback. */
|
|
66
76
|
name?: string;
|
|
67
77
|
/** A callback for when the input loses focus. */
|
|
68
|
-
onBlur?:
|
|
78
|
+
onBlur?: NumberBlurHandler;
|
|
69
79
|
/**
|
|
70
80
|
* This is equivalent to onInput which is called on keydown, paste, and so on.
|
|
71
81
|
* If value is set, this callback is required. This must set the value prop to retain the
|
|
@@ -73,7 +83,7 @@ interface NumberPropsBase {
|
|
|
73
83
|
*/
|
|
74
84
|
onChange?: NumberChangeHandler;
|
|
75
85
|
/** A callback for when the input takes focus. */
|
|
76
|
-
onFocus?:
|
|
86
|
+
onFocus?: NumberFocusHandler;
|
|
77
87
|
/** A keydown callback can be used to prevent a certain input by utilizing the event argument. */
|
|
78
88
|
onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
79
89
|
/** A keyup callback. */
|
|
@@ -159,5 +169,5 @@ declare const NumberWithTheme: React.ForwardRefExoticComponent<Pick<Pick<Pick<Nu
|
|
|
159
169
|
}, "ref" | "slot" | "style" | "title" | "children" | "value" | "onChange" | "onPause" | "name" | "className" | "color" | "id" | "lang" | "max" | "min" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "disabled" | "step" | "inline" | "elementRef" | "error" | "inputId" | "append" | "prepend" | "inputRef" | "labelledBy" | "locale" | "describedBy" | "useSyntheticPlaceholder" | "hideStepButtons" | "roundTo">>;
|
|
160
170
|
export default NumberWithTheme;
|
|
161
171
|
export type { Number as NumberWithoutTheme };
|
|
162
|
-
export { NumberChangeHandler };
|
|
172
|
+
export { NumberBlurHandler, NumberChangeHandler, NumberFocusHandler };
|
|
163
173
|
export type { NumberPropsBase, NumberPropsBaseControlled, NumberPropsBaseUncontrolled };
|
|
@@ -7,6 +7,16 @@ declare type SearchChangeHandler = (event: React.ChangeEvent<HTMLInputElement |
|
|
|
7
7
|
name?: string;
|
|
8
8
|
value: string;
|
|
9
9
|
}) => void;
|
|
10
|
+
/** @public */
|
|
11
|
+
declare type SearchBlurHandler = (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>, data: {
|
|
12
|
+
name?: string;
|
|
13
|
+
value: string;
|
|
14
|
+
}) => void;
|
|
15
|
+
/** @public */
|
|
16
|
+
declare type SearchFocusHandler = (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>, data: {
|
|
17
|
+
name?: string;
|
|
18
|
+
value: string;
|
|
19
|
+
}) => void;
|
|
10
20
|
interface SearchPropsBase {
|
|
11
21
|
animateLoading?: boolean;
|
|
12
22
|
/** All children must be instances of `Search.Option`. */
|
|
@@ -59,9 +69,9 @@ interface SearchPropsBase {
|
|
|
59
69
|
* for example: "No matching dashboards". You can insert content such as an error message or
|
|
60
70
|
* communicate a minimum number of characters to enter to see results. */
|
|
61
71
|
noOptionsMessage?: React.ReactNode;
|
|
62
|
-
onBlur?:
|
|
72
|
+
onBlur?: SearchBlurHandler;
|
|
63
73
|
onChange?: SearchChangeHandler;
|
|
64
|
-
onFocus?:
|
|
74
|
+
onFocus?: SearchFocusHandler;
|
|
65
75
|
onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
66
76
|
/**
|
|
67
77
|
* A callback function invoked when the menu is scrolled.
|
|
@@ -98,4 +108,4 @@ declare namespace Search {
|
|
|
98
108
|
var Heading: typeof import("../Menu/Heading").default;
|
|
99
109
|
}
|
|
100
110
|
export default Search;
|
|
101
|
-
export { SearchChangeHandler, Option, Divider, Heading, SearchProps, SearchPropsBase, SearchPropsBaseControlled, SearchPropsBaseUncontrolled, };
|
|
111
|
+
export { SearchBlurHandler, SearchChangeHandler, SearchFocusHandler, Option, Divider, Heading, SearchProps, SearchPropsBase, SearchPropsBaseControlled, SearchPropsBaseUncontrolled, };
|
|
@@ -160,7 +160,7 @@ interface SelectBasePropsBase {
|
|
|
160
160
|
*/
|
|
161
161
|
repositionMode?: 'none' | 'flip';
|
|
162
162
|
/**
|
|
163
|
-
* Determines how to display Select
|
|
163
|
+
* Determines how to display Select all/Clear all.
|
|
164
164
|
*/
|
|
165
165
|
selectAllAppearance?: 'buttongroup' | 'checkbox';
|
|
166
166
|
showSelectedValuesFirst?: 'nextOpen' | 'immediately' | 'never';
|