@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/TextArea.js
CHANGED
|
@@ -1,1331 +1,1121 @@
|
|
|
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
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
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 */ je
|
|
65
|
+
});
|
|
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 i = e.n(a);
|
|
72
|
+
// CONCATENATED MODULE: external "lodash/defer"
|
|
73
|
+
const o = require("lodash/defer");
|
|
74
|
+
var l = e.n(o);
|
|
75
|
+
// CONCATENATED MODULE: external "lodash/has"
|
|
76
|
+
const s = require("lodash/has");
|
|
77
|
+
var c = e.n(s);
|
|
78
|
+
// CONCATENATED MODULE: external "lodash/keys"
|
|
79
|
+
const p = require("lodash/keys");
|
|
80
|
+
var d = e.n(p);
|
|
81
|
+
// CONCATENATED MODULE: external "lodash/noop"
|
|
82
|
+
const u = require("lodash/noop");
|
|
83
|
+
var f = e.n(u);
|
|
84
|
+
// CONCATENATED MODULE: external "lodash/omit"
|
|
85
|
+
const h = require("lodash/omit");
|
|
86
|
+
var m = e.n(h);
|
|
87
|
+
// CONCATENATED MODULE: external "lodash/pickBy"
|
|
88
|
+
const v = require("lodash/pickBy");
|
|
89
|
+
var b = e.n(v);
|
|
90
|
+
// CONCATENATED MODULE: external "lodash/throttle"
|
|
91
|
+
const y = require("lodash/throttle");
|
|
92
|
+
var g = e.n(y);
|
|
93
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/ControlGroup"
|
|
94
|
+
const x = require("@splunk/react-ui/ControlGroup");
|
|
95
|
+
// CONCATENATED MODULE: external "@splunk/react-icons/Cross"
|
|
96
|
+
const w = require("@splunk/react-icons/Cross");
|
|
97
|
+
var C = e.n(w);
|
|
98
|
+
// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Close"
|
|
99
|
+
const k = require("@splunk/react-icons/enterprise/Close");
|
|
100
|
+
var S = e.n(k);
|
|
101
|
+
// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Search"
|
|
102
|
+
const A = require("@splunk/react-icons/enterprise/Search");
|
|
103
|
+
var O = e.n(A);
|
|
104
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/EventListener"
|
|
105
|
+
const I = require("@splunk/react-ui/EventListener");
|
|
106
|
+
var E = e.n(I);
|
|
107
|
+
// CONCATENATED MODULE: external "@splunk/react-icons/Magnifier"
|
|
108
|
+
const j = require("@splunk/react-icons/Magnifier");
|
|
109
|
+
var P = e.n(j);
|
|
110
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/style"
|
|
111
|
+
const T = require("@splunk/ui-utils/style");
|
|
112
|
+
// CONCATENATED MODULE: external "@splunk/themes"
|
|
113
|
+
const _ = require("@splunk/themes");
|
|
114
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
|
|
115
|
+
const M = require("@splunk/ui-utils/i18n");
|
|
116
|
+
// CONCATENATED MODULE: external "styled-components"
|
|
117
|
+
const $ = require("styled-components");
|
|
118
|
+
var D = e.n($);
|
|
119
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Box"
|
|
120
|
+
const N = require("@splunk/react-ui/Box");
|
|
121
|
+
var R = e.n(N);
|
|
122
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Button"
|
|
123
|
+
const q = require("@splunk/react-ui/Button");
|
|
124
|
+
var B = e.n(q);
|
|
125
|
+
// CONCATENATED MODULE: ./src/TextArea/TextAreaStyles.ts
|
|
126
|
+
var W = (0, $.css)([ "cursor:not-allowed;color:", ";&::placeholder{color:", ";}" ], (0,
|
|
127
|
+
_.pick)({
|
|
128
|
+
enterprise: _.variables.textDisabledColor,
|
|
129
|
+
prisma: _.variables.contentColorDisabled
|
|
130
|
+
}), (0, _.pick)({
|
|
131
|
+
enterprise: _.variables.textDisabledColor,
|
|
132
|
+
prisma: _.variables.contentColorDisabled
|
|
133
|
+
}));
|
|
134
|
+
var z = (0, $.css)([ "border-radius:", ";cursor:pointer;font-size:0.83333em;flex-grow:0;", ";&:not([disabled]){color:", ";}" ], (0,
|
|
135
|
+
_.pick)({
|
|
136
|
+
enterprise: _.variables.borderRadius,
|
|
137
|
+
prisma: "50%"
|
|
138
|
+
}), (0, _.pick)({
|
|
139
|
+
enterprise: (0, $.css)([ "width:", ";height:", ";" ], _.variables.inputHeight, _.variables.inputHeight),
|
|
140
|
+
prisma: {
|
|
141
|
+
comfortable: (0, $.css)([ "width:26px;min-width:26px;min-height:26px;margin:8px;padding:0;" ]),
|
|
142
|
+
compact: (0, $.css)([ "width:22px;min-width:22px;min-height:22px;margin:8px;padding:0;" ])
|
|
143
|
+
}
|
|
144
|
+
}), (0, _.pick)({
|
|
145
|
+
enterprise: {
|
|
146
|
+
light: _.variables.gray60,
|
|
147
|
+
dark: _.variables.white
|
|
148
|
+
},
|
|
149
|
+
prisma: _.variables.contentColorMuted
|
|
150
|
+
}));
|
|
151
|
+
var F = D()(B()).withConfig({
|
|
152
|
+
displayName: "TextAreaStyles__StyledClearButton",
|
|
153
|
+
componentId: "gfy8yp-0"
|
|
154
|
+
})([ "display:none;visibility:hidden;", "" ], z);
|
|
155
|
+
var H = D().span.withConfig({
|
|
156
|
+
displayName: "TextAreaStyles__StyledSearchIconWrapper",
|
|
157
|
+
componentId: "gfy8yp-1"
|
|
158
|
+
})([ "", ";color:", ";pointer-events:none;padding:", ";", "" ], _.mixins.reset("inline-block"), (0,
|
|
159
|
+
_.pick)({
|
|
160
|
+
enterprise: {
|
|
161
|
+
light: _.variables.gray60,
|
|
162
|
+
dark: _.variables.white
|
|
163
|
+
},
|
|
164
|
+
prisma: _.variables.contentColorMuted
|
|
165
|
+
}), (0, _.pick)({
|
|
166
|
+
comfortable: "0 8px",
|
|
167
|
+
compact: "0 6px"
|
|
168
|
+
}), (function(e) {
|
|
169
|
+
var t = e.$disabled;
|
|
170
|
+
return t && (0, $.css)([ "", "" ], (0, _.pick)({
|
|
171
|
+
enterprise: (0, $.css)([ "color:", ";" ], _.variables.textDisabledColor),
|
|
172
|
+
prisma: (0, $.css)([ "color:", ";" ], _.variables.contentColorDisabled)
|
|
173
|
+
}));
|
|
174
|
+
}));
|
|
175
|
+
var V = D()(R()).withConfig({
|
|
176
|
+
displayName: "TextAreaStyles__StyledBox",
|
|
177
|
+
componentId: "gfy8yp-2"
|
|
178
|
+
})([ "display:flex;justify-content:space-between;flex-grow:1;flex-shrink:1;position:relative;&[data-inline]{width:230px;flex-basis:230px;[data-inline] + &{margin-left:", ";}}&:focus-within:not([disabled]){", "{", "}", "{visibility:visible;display:block;}}" ], (0,
|
|
179
|
+
_.pick)({
|
|
180
|
+
enterprise: _.variables.spacingHalf,
|
|
181
|
+
prisma: _.variables.spacingSmall
|
|
182
|
+
}),
|
|
183
|
+
/* sc-sel */
|
|
184
|
+
H, (0, _.pick)({
|
|
185
|
+
enterprise: (0, $.css)([ "display:none;" ])
|
|
186
|
+
}),
|
|
187
|
+
/* sc-sel */
|
|
188
|
+
F);
|
|
189
|
+
var K = D().span.withConfig({
|
|
190
|
+
displayName: "TextAreaStyles__StyledTextAreaWrapper",
|
|
191
|
+
componentId: "gfy8yp-3"
|
|
192
|
+
})([ "", " flex-grow:1;min-height:", ";position:relative;overflow:hidden;border:1px solid ", ";border-radius:", ";box-sizing:border-box;background-color:", ";box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);padding:", ";", " ", " &:hover:not([disabled]){border-color:", ";}&:focus-within:not([disabled]){", "}", " ", " ", " ", "" ], _.mixins.reset("inline-flex"), _.variables.inputHeight, (0,
|
|
193
|
+
_.pick)({
|
|
194
|
+
enterprise: {
|
|
195
|
+
light: _.variables.gray60,
|
|
196
|
+
dark: _.variables.gray20
|
|
197
|
+
},
|
|
198
|
+
prisma: _.variables.interactiveColorBorder
|
|
199
|
+
}), _.variables.borderRadius, (0, _.pick)({
|
|
200
|
+
enterprise: {
|
|
201
|
+
light: _.variables.white,
|
|
202
|
+
dark: _.variables.gray22
|
|
203
|
+
},
|
|
204
|
+
prisma: _.variables.transparent
|
|
205
|
+
}), (0, _.pick)({
|
|
206
|
+
enterprise: "0px 0px 0px 10px",
|
|
207
|
+
prisma: "0px 12px"
|
|
208
|
+
}), (function(e) {
|
|
209
|
+
var t = e.$hasEndAdornment;
|
|
210
|
+
return t && (0, $.css)([ "padding-right:0;" ]);
|
|
211
|
+
}), (function(e) {
|
|
212
|
+
var t = e.$hasStartAdornment;
|
|
213
|
+
return t && (0, $.css)([ "padding-left:0;" ]);
|
|
214
|
+
}), (0, _.pick)({
|
|
215
|
+
enterprise: {
|
|
216
|
+
light: _.variables.gray60,
|
|
217
|
+
dark: _.variables.gray20
|
|
218
|
+
},
|
|
219
|
+
prisma: _.variables.interactiveColorBorderHover
|
|
220
|
+
}), (0, _.pick)({
|
|
221
|
+
enterprise: (0, $.css)([ "box-shadow:", ";color:", ";" ], _.variables.focusShadow, _.variables.textColor),
|
|
222
|
+
prisma: (0, $.css)([ "border-color:", ";color:", ";" ], _.variables.interactiveColorPrimary, _.variables.contentColorActive)
|
|
223
|
+
}), (function(e) {
|
|
224
|
+
var t = e.$error;
|
|
225
|
+
return t && (0, $.css)([ "&,&:hover:not([disabled]){border-color:", ";}&:focus-within:not([disabled]){", "}" ], (0,
|
|
226
|
+
_.pick)({
|
|
227
|
+
enterprise: _.variables.errorColor,
|
|
228
|
+
prisma: _.variables.accentColorNegative
|
|
229
|
+
}), (0, _.pick)({
|
|
230
|
+
enterprise: (0, $.css)([ "box-shadow:", ";color:", ";" ], _.variables.focusShadow, _.variables.textColor),
|
|
231
|
+
prisma: (0, $.css)([ "border-color:", ";color:", ";" ], _.variables.interactiveColorPrimary, _.variables.contentColorActive)
|
|
232
|
+
}));
|
|
233
|
+
}), (function(e) {
|
|
234
|
+
var t = e.$append;
|
|
235
|
+
return t && (0, $.css)([ "margin-right:-1px;border-top-right-radius:0;border-bottom-right-radius:0;border-right:none;" ]);
|
|
236
|
+
}), (function(e) {
|
|
237
|
+
var t = e.$prepend;
|
|
238
|
+
return t && (0, $.css)([ "border-top-left-radius:0;border-bottom-left-radius:0;" ]);
|
|
239
|
+
}), (function(e) {
|
|
240
|
+
var t = e.disabled;
|
|
241
|
+
return t && (0, $.css)([ "", " box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);" ], (0,
|
|
242
|
+
_.pick)({
|
|
243
|
+
enterprise: {
|
|
244
|
+
light: (0, $.css)([ "background-color:", ";border-color:", ";" ], _.variables.gray96, _.variables.gray92),
|
|
245
|
+
dark: (0, $.css)([ "background-color:", ";border-color:", ";" ], _.variables.gray22, _.variables.gray30)
|
|
246
|
+
},
|
|
247
|
+
prisma: (0, $.css)([ "border-color:", ";" ], _.variables.interactiveColorBorderDisabled)
|
|
248
|
+
}));
|
|
249
|
+
}));
|
|
250
|
+
var L = D().textarea.withConfig({
|
|
251
|
+
displayName: "TextAreaStyles__StyledTextArea",
|
|
252
|
+
componentId: "gfy8yp-4"
|
|
253
|
+
})([ "", ";outline-style:none;border:0;background:transparent;color:", ";flex-grow:1;font-family:", ";font-size:inherit;line-height:inherit;padding-top:", ";padding-bottom:", ";padding-right:", ";position:relative;resize:none;overflow:auto;white-space:pre-wrap;&::placeholder{color:", ";opacity:1;}", " ", "" ], _.mixins.reset("inline-flex"), (0,
|
|
254
|
+
_.pick)({
|
|
255
|
+
enterprise: _.variables.textColor,
|
|
256
|
+
prisma: _.variables.contentColorActive
|
|
257
|
+
}), _.variables.sansFontFamily, (0, _.pick)({
|
|
258
|
+
enterprise: {
|
|
259
|
+
comfortable: _.variables.spacingQuarter,
|
|
260
|
+
compact: "3px"
|
|
261
|
+
},
|
|
262
|
+
prisma: {
|
|
263
|
+
comfortable: _.variables.spacingSmall,
|
|
264
|
+
compact: "5px"
|
|
265
|
+
}
|
|
266
|
+
}), (0, _.pick)({
|
|
267
|
+
enterprise: {
|
|
268
|
+
comfortable: _.variables.spacingQuarter,
|
|
269
|
+
compact: "3px"
|
|
270
|
+
},
|
|
271
|
+
prisma: {
|
|
272
|
+
comfortable: _.variables.spacingSmall,
|
|
273
|
+
compact: "5px"
|
|
274
|
+
}
|
|
275
|
+
}), (0, _.pick)({
|
|
276
|
+
enterprise: "10px",
|
|
277
|
+
prisma: "14px"
|
|
278
|
+
}), _.variables.contentColorMuted, (function(e) {
|
|
279
|
+
var t = e.$error;
|
|
280
|
+
return t && (0, $.css)([ "&,&:hover{color:", ";}" ], (0, _.pick)({
|
|
281
|
+
enterprise: {
|
|
282
|
+
light: _.variables.errorColorD10,
|
|
283
|
+
dark: _.variables.errorColorL20
|
|
284
|
+
},
|
|
285
|
+
prisma: _.variables.contentColorActive
|
|
286
|
+
}));
|
|
287
|
+
}), (function(e) {
|
|
288
|
+
var t = e.disabled;
|
|
289
|
+
return t && W;
|
|
290
|
+
}));
|
|
291
|
+
var G = D()(B()).withConfig({
|
|
292
|
+
displayName: "TextAreaStyles__StyledVisibilityToggle",
|
|
293
|
+
componentId: "gfy8yp-5"
|
|
294
|
+
})([ "", "" ], z);
|
|
295
|
+
var Q = D().span.withConfig({
|
|
296
|
+
displayName: "TextAreaStyles__StyledPlaceholder",
|
|
297
|
+
componentId: "gfy8yp-6"
|
|
298
|
+
})([ "pointer-events:none;color:", ";position:absolute;overflow:hidden;font-size:inherit;line-height:inherit;height:", ";margin-right:", ";", ";", ";", "" ], (0,
|
|
299
|
+
_.pick)({
|
|
300
|
+
enterprise: _.variables.textGray,
|
|
301
|
+
prisma: _.variables.contentColorMuted
|
|
302
|
+
}), _.variables.lineHeight, (0, _.pick)({
|
|
303
|
+
enterprise: "10px",
|
|
304
|
+
prisma: "14px"
|
|
305
|
+
}), (function(e) {
|
|
306
|
+
var t = e.$hasStartAdornment, r = e.$startAdornmentWidth;
|
|
307
|
+
return t && (r ? (0, $.css)([ "margin-left:", "px;" ], r) : (0, $.css)([ "margin-left:", ";" ], (0,
|
|
308
|
+
_.pick)({
|
|
309
|
+
enterprise: {
|
|
310
|
+
comfortable: "30px",
|
|
311
|
+
compact: "26px"
|
|
312
|
+
},
|
|
313
|
+
prisma: {
|
|
314
|
+
comfortable: "38px",
|
|
315
|
+
compact: "30px"
|
|
316
|
+
}
|
|
317
|
+
})));
|
|
318
|
+
}), (function(e) {
|
|
319
|
+
var t = e.$hasEndAdornment, r = e.$endAdornmentWidth;
|
|
320
|
+
return t && (r ? (0, $.css)([ "max-width:calc( 100% - ", " - ", "px );" ], (0, _.pick)({
|
|
321
|
+
enterprise: "10px",
|
|
322
|
+
prisma: "14px"
|
|
323
|
+
}), r) : (0, $.css)([ "max-width:calc( 100% - ", " - ", " );" ], (0, _.pick)({
|
|
324
|
+
enterprise: "10px",
|
|
325
|
+
prisma: "14px"
|
|
326
|
+
}), (0, _.pick)({
|
|
327
|
+
enterprise: {
|
|
328
|
+
comfortable: "30px",
|
|
329
|
+
compact: "26px"
|
|
330
|
+
},
|
|
331
|
+
prisma: {
|
|
332
|
+
comfortable: "38px",
|
|
333
|
+
compact: "30px"
|
|
334
|
+
}
|
|
335
|
+
})));
|
|
336
|
+
}), (function(e) {
|
|
337
|
+
var t = e.$hasBothAdornment, r = e.$endAdornmentWidth, n = e.$startAdornmentWidth;
|
|
338
|
+
return t && (0, $.css)([ "max-width:calc(100% - ", "px - ", "px);" ], n, r);
|
|
339
|
+
}));
|
|
340
|
+
var U = (0, $.css)([ "display:inline-flex;align-items:center;justify-content:center;height:", ";pointer-events:none;" ], (0,
|
|
341
|
+
_.pick)({
|
|
342
|
+
enterprise: {
|
|
343
|
+
comfortable: "30px",
|
|
344
|
+
compact: "26px"
|
|
345
|
+
},
|
|
346
|
+
prisma: {
|
|
347
|
+
comfortable: "38px",
|
|
348
|
+
compact: "30px"
|
|
349
|
+
}
|
|
350
|
+
}));
|
|
351
|
+
var J = D().div.withConfig({
|
|
352
|
+
displayName: "TextAreaStyles__StyledStartAdornmentHolder",
|
|
353
|
+
componentId: "gfy8yp-7"
|
|
354
|
+
})([ "", " ", ";" ], U, (function(e) {
|
|
355
|
+
var t = e.$width;
|
|
356
|
+
return t ? (0, $.css)([ "min-width:", "px;" ], t) : (0, $.css)([ "min-width:", ";" ], (0,
|
|
357
|
+
_.pick)({
|
|
358
|
+
enterprise: {
|
|
359
|
+
comfortable: "30px",
|
|
360
|
+
compact: "26px"
|
|
361
|
+
},
|
|
362
|
+
prisma: {
|
|
363
|
+
comfortable: "38px",
|
|
364
|
+
compact: "30px"
|
|
365
|
+
}
|
|
366
|
+
}));
|
|
367
|
+
}));
|
|
368
|
+
var X = D().div.withConfig({
|
|
369
|
+
displayName: "TextAreaStyles__StyledEndAdornmentHolder",
|
|
370
|
+
componentId: "gfy8yp-8"
|
|
371
|
+
})([ "", " ", ";" ], U, (function(e) {
|
|
372
|
+
var t = e.$width;
|
|
373
|
+
return t ? (0, $.css)([ "min-width:", "px;" ], t) : (0, $.css)([ "min-width:", ";" ], (0,
|
|
374
|
+
_.pick)({
|
|
375
|
+
enterprise: {
|
|
376
|
+
comfortable: "30px",
|
|
377
|
+
compact: "26px"
|
|
378
|
+
},
|
|
379
|
+
prisma: {
|
|
380
|
+
comfortable: "38px",
|
|
381
|
+
compact: "30px"
|
|
382
|
+
}
|
|
383
|
+
}));
|
|
384
|
+
}));
|
|
385
|
+
var Y = D().div.withConfig({
|
|
386
|
+
displayName: "TextAreaStyles__StyledAdornment",
|
|
387
|
+
componentId: "gfy8yp-9"
|
|
388
|
+
})([ "display:inline-flex;align-items:center;justify-content:center;position:absolute;pointer-events:none;z-index:1;height:", ";color:", ";", ";", ";", "" ], (0,
|
|
389
|
+
_.pick)({
|
|
390
|
+
enterprise: {
|
|
391
|
+
comfortable: "30px",
|
|
392
|
+
compact: "26px"
|
|
393
|
+
},
|
|
394
|
+
prisma: {
|
|
395
|
+
comfortable: "38px",
|
|
396
|
+
compact: "30px"
|
|
397
|
+
}
|
|
398
|
+
}), (0, _.pick)({
|
|
399
|
+
enterprise: {
|
|
400
|
+
light: _.variables.gray60,
|
|
401
|
+
dark: _.variables.white
|
|
402
|
+
},
|
|
403
|
+
prisma: _.variables.contentColorMuted
|
|
404
|
+
}), (function(e) {
|
|
405
|
+
var t = e.$position;
|
|
406
|
+
return t === "start" ? (0, $.css)([ "top:1px;left:1px;" ]) : (0, $.css)([ "top:1px;right:1px;" ]);
|
|
407
|
+
}), (function(e) {
|
|
408
|
+
var t = e.disabled;
|
|
409
|
+
return t && W;
|
|
410
|
+
}), (0, _.pick)({
|
|
411
|
+
enterprise: (0, $.css)([ "margin-left:-1px;margin-right:-1px;" ])
|
|
412
|
+
}));
|
|
413
|
+
// CONCATENATED MODULE: ./src/TextArea/syncHeightWithShadow.ts
|
|
414
|
+
// This file was adapted from [Call-Em-All's material-ui](https://github.com/mui-org/material-ui),
|
|
415
|
+
// which is MIT-licensed:
|
|
416
|
+
// The MIT License (MIT)
|
|
417
|
+
// Copyright (c) 2014 Call-Em-All
|
|
418
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
419
|
+
// of this software and associated documentation files (the "Software"), to deal
|
|
420
|
+
// in the Software without restriction, including without limitation the rights
|
|
421
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
422
|
+
// copies of the Software, and to permit persons to whom the Software is
|
|
423
|
+
// furnished to do so, subject to the following conditions:
|
|
424
|
+
// The above copyright notice and this permission notice shall be included in all
|
|
425
|
+
// copies or substantial portions of the Software.
|
|
426
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
427
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
428
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
429
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
430
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
431
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
432
|
+
// SOFTWARE.
|
|
433
|
+
// End of MIT license text.
|
|
434
|
+
function Z(e) {
|
|
435
|
+
var t = e.height, r = e.rowsMax, n = e.rowsMin, a = e.shadow;
|
|
436
|
+
if (a) {
|
|
437
|
+
var i = window.getComputedStyle(a);
|
|
438
|
+
var o = i.getPropertyValue("line-height");
|
|
439
|
+
// jsdom does not properly inherit/re-calculate the line-height property so we skip in these cases SUI-1943, SUI-2428
|
|
440
|
+
if (o === "inherit" || o === "normal") {
|
|
441
|
+
return false;
|
|
442
|
+
}
|
|
443
|
+
var l = parseInt(o, 10);
|
|
444
|
+
var s = parseInt(i.getPropertyValue("padding-top"), 10);
|
|
445
|
+
var c = parseInt(i.getPropertyValue("padding-bottom"), 10);
|
|
446
|
+
var p = parseInt(i.getPropertyValue("border-top-width"), 10);
|
|
447
|
+
var d = parseInt(i.getPropertyValue("border-bottom-width"), 10);
|
|
448
|
+
var u = a.scrollHeight + p + d;
|
|
449
|
+
/* eslint-disable no-restricted-globals */
|
|
450
|
+
// Leverage the global `isNaN` here for IE support, rather than Number.isNaN.
|
|
451
|
+
// We know newHeight is numeric because we parseInt() above, so `isNaN` should be reliable.
|
|
452
|
+
if (u === undefined || isNaN(u)) {
|
|
453
|
+
return false;
|
|
454
|
+
}
|
|
455
|
+
/* eslint-enable no-restricted-globals */ if (r >= n) {
|
|
456
|
+
var f = r * l + s + c + p + d + 1;
|
|
457
|
+
// need one extra.
|
|
458
|
+
u = Math.min(f, u);
|
|
459
|
+
}
|
|
460
|
+
var h = n * l + s + c + p + d + 1;
|
|
461
|
+
// need one extra.
|
|
462
|
+
u = Math.max(h, u);
|
|
463
|
+
if (t !== u) {
|
|
464
|
+
return u;
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
return false;
|
|
468
|
+
}
|
|
469
|
+
// CONCATENATED MODULE: ./src/utils/updateReactRef.ts
|
|
470
|
+
/**
|
|
110
471
|
* Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
|
|
111
472
|
*
|
|
112
473
|
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
113
474
|
* @param current - The new value of the ref.
|
|
114
475
|
*/
|
|
115
|
-
function
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
476
|
+
function ee(e, t) {
|
|
477
|
+
if (e) {
|
|
478
|
+
if (typeof e === "function") {
|
|
479
|
+
e(t);
|
|
480
|
+
} else {
|
|
481
|
+
// the public signature of this util uses React.Ref<T> to mirror the way React types refs.
|
|
482
|
+
// the intention here is to signal "we will take care of setting 'current', not you".
|
|
483
|
+
e.current = t;
|
|
484
|
+
// eslint-disable-line no-param-reassign
|
|
485
|
+
}
|
|
486
|
+
}
|
|
123
487
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
/***/ 11:
|
|
139
|
-
/***/ (function(module, exports) {
|
|
140
|
-
|
|
141
|
-
module.exports = require("lodash/has");
|
|
142
|
-
|
|
143
|
-
/***/ }),
|
|
144
|
-
|
|
145
|
-
/***/ 16:
|
|
146
|
-
/***/ (function(module, exports) {
|
|
147
|
-
|
|
148
|
-
module.exports = require("@splunk/react-ui/EventListener");
|
|
149
|
-
|
|
150
|
-
/***/ }),
|
|
151
|
-
|
|
152
|
-
/***/ 167:
|
|
153
|
-
/***/ (function(module, exports) {
|
|
154
|
-
|
|
155
|
-
module.exports = require("lodash/noop");
|
|
156
|
-
|
|
157
|
-
/***/ }),
|
|
158
|
-
|
|
159
|
-
/***/ 17:
|
|
160
|
-
/***/ (function(module, exports) {
|
|
161
|
-
|
|
162
|
-
module.exports = require("@splunk/react-ui/Button");
|
|
163
|
-
|
|
164
|
-
/***/ }),
|
|
165
|
-
|
|
166
|
-
/***/ 2:
|
|
167
|
-
/***/ (function(module, exports) {
|
|
168
|
-
|
|
169
|
-
module.exports = require("react");
|
|
170
|
-
|
|
171
|
-
/***/ }),
|
|
172
|
-
|
|
173
|
-
/***/ 211:
|
|
174
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
175
|
-
|
|
176
|
-
"use strict";
|
|
177
|
-
// ESM COMPAT FLAG
|
|
178
|
-
__webpack_require__.r(__webpack_exports__);
|
|
179
|
-
|
|
180
|
-
// EXPORTS
|
|
181
|
-
__webpack_require__.d(__webpack_exports__, "default", function() { return /* reexport */ src_TextArea_TextArea; });
|
|
182
|
-
|
|
183
|
-
// EXTERNAL MODULE: external "react"
|
|
184
|
-
var external_react_ = __webpack_require__(2);
|
|
185
|
-
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
|
|
186
|
-
|
|
187
|
-
// EXTERNAL MODULE: external "prop-types"
|
|
188
|
-
var external_prop_types_ = __webpack_require__(1);
|
|
189
|
-
var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
|
|
190
|
-
|
|
191
|
-
// EXTERNAL MODULE: external "lodash/defer"
|
|
192
|
-
var defer_ = __webpack_require__(58);
|
|
193
|
-
var defer_default = /*#__PURE__*/__webpack_require__.n(defer_);
|
|
194
|
-
|
|
195
|
-
// EXTERNAL MODULE: external "lodash/has"
|
|
196
|
-
var has_ = __webpack_require__(11);
|
|
197
|
-
var has_default = /*#__PURE__*/__webpack_require__.n(has_);
|
|
198
|
-
|
|
199
|
-
// EXTERNAL MODULE: external "lodash/keys"
|
|
200
|
-
var keys_ = __webpack_require__(9);
|
|
201
|
-
var keys_default = /*#__PURE__*/__webpack_require__.n(keys_);
|
|
202
|
-
|
|
203
|
-
// EXTERNAL MODULE: external "lodash/noop"
|
|
204
|
-
var noop_ = __webpack_require__(167);
|
|
205
|
-
var noop_default = /*#__PURE__*/__webpack_require__.n(noop_);
|
|
206
|
-
|
|
207
|
-
// EXTERNAL MODULE: external "lodash/omit"
|
|
208
|
-
var omit_ = __webpack_require__(5);
|
|
209
|
-
var omit_default = /*#__PURE__*/__webpack_require__.n(omit_);
|
|
210
|
-
|
|
211
|
-
// EXTERNAL MODULE: external "lodash/pickBy"
|
|
212
|
-
var pickBy_ = __webpack_require__(63);
|
|
213
|
-
var pickBy_default = /*#__PURE__*/__webpack_require__.n(pickBy_);
|
|
214
|
-
|
|
215
|
-
// EXTERNAL MODULE: external "lodash/throttle"
|
|
216
|
-
var throttle_ = __webpack_require__(33);
|
|
217
|
-
var throttle_default = /*#__PURE__*/__webpack_require__.n(throttle_);
|
|
218
|
-
|
|
219
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/ControlGroup"
|
|
220
|
-
var ControlGroup_ = __webpack_require__(107);
|
|
221
|
-
|
|
222
|
-
// EXTERNAL MODULE: external "@splunk/react-icons/Cross"
|
|
223
|
-
var Cross_ = __webpack_require__(26);
|
|
224
|
-
var Cross_default = /*#__PURE__*/__webpack_require__.n(Cross_);
|
|
225
|
-
|
|
226
|
-
// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Close"
|
|
227
|
-
var Close_ = __webpack_require__(27);
|
|
228
|
-
var Close_default = /*#__PURE__*/__webpack_require__.n(Close_);
|
|
229
|
-
|
|
230
|
-
// EXTERNAL MODULE: external "@splunk/react-icons/enterprise/Search"
|
|
231
|
-
var Search_ = __webpack_require__(54);
|
|
232
|
-
var Search_default = /*#__PURE__*/__webpack_require__.n(Search_);
|
|
233
|
-
|
|
234
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/EventListener"
|
|
235
|
-
var EventListener_ = __webpack_require__(16);
|
|
236
|
-
var EventListener_default = /*#__PURE__*/__webpack_require__.n(EventListener_);
|
|
237
|
-
|
|
238
|
-
// EXTERNAL MODULE: external "@splunk/react-icons/Magnifier"
|
|
239
|
-
var Magnifier_ = __webpack_require__(49);
|
|
240
|
-
var Magnifier_default = /*#__PURE__*/__webpack_require__.n(Magnifier_);
|
|
241
|
-
|
|
242
|
-
// EXTERNAL MODULE: external "@splunk/ui-utils/style"
|
|
243
|
-
var style_ = __webpack_require__(41);
|
|
244
|
-
|
|
245
|
-
// EXTERNAL MODULE: external "@splunk/themes"
|
|
246
|
-
var themes_ = __webpack_require__(0);
|
|
247
|
-
|
|
248
|
-
// EXTERNAL MODULE: external "@splunk/ui-utils/i18n"
|
|
249
|
-
var i18n_ = __webpack_require__(4);
|
|
250
|
-
|
|
251
|
-
// EXTERNAL MODULE: external "styled-components"
|
|
252
|
-
var external_styled_components_ = __webpack_require__(3);
|
|
253
|
-
var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
|
|
254
|
-
|
|
255
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/Box"
|
|
256
|
-
var Box_ = __webpack_require__(6);
|
|
257
|
-
var Box_default = /*#__PURE__*/__webpack_require__.n(Box_);
|
|
258
|
-
|
|
259
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/Button"
|
|
260
|
-
var Button_ = __webpack_require__(17);
|
|
261
|
-
var Button_default = /*#__PURE__*/__webpack_require__.n(Button_);
|
|
262
|
-
|
|
263
|
-
// CONCATENATED MODULE: ./src/TextArea/TextAreaStyles.ts
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
var disabledStyles = Object(external_styled_components_["css"])(["cursor:not-allowed;color:", ";&::placeholder{color:", ";}"], Object(themes_["pick"])({
|
|
269
|
-
enterprise: themes_["variables"].textDisabledColor,
|
|
270
|
-
prisma: themes_["variables"].contentColorDisabled
|
|
271
|
-
}), Object(themes_["pick"])({
|
|
272
|
-
enterprise: themes_["variables"].textDisabledColor,
|
|
273
|
-
prisma: themes_["variables"].contentColorDisabled
|
|
274
|
-
}));
|
|
275
|
-
var buttonStyles = Object(external_styled_components_["css"])(["border-radius:", ";cursor:pointer;font-size:0.83333em;flex-grow:0;", ";&:not([disabled]){color:", ";}"], Object(themes_["pick"])({
|
|
276
|
-
enterprise: themes_["variables"].borderRadius,
|
|
277
|
-
prisma: '50%'
|
|
278
|
-
}), Object(themes_["pick"])({
|
|
279
|
-
enterprise: Object(external_styled_components_["css"])(["width:", ";height:", ";"], themes_["variables"].inputHeight, themes_["variables"].inputHeight),
|
|
280
|
-
prisma: {
|
|
281
|
-
comfortable: Object(external_styled_components_["css"])(["width:26px;min-width:26px;min-height:26px;margin:8px;padding:0;"]),
|
|
282
|
-
compact: Object(external_styled_components_["css"])(["width:22px;min-width:22px;min-height:22px;margin:8px;padding:0;"])
|
|
283
|
-
}
|
|
284
|
-
}), Object(themes_["pick"])({
|
|
285
|
-
enterprise: {
|
|
286
|
-
light: themes_["variables"].gray60,
|
|
287
|
-
dark: themes_["variables"].white
|
|
288
|
-
},
|
|
289
|
-
prisma: themes_["variables"].contentColorMuted
|
|
290
|
-
}));
|
|
291
|
-
var StyledClearButton = external_styled_components_default()(Button_default.a).withConfig({
|
|
292
|
-
displayName: "TextAreaStyles__StyledClearButton",
|
|
293
|
-
componentId: "gfy8yp-0"
|
|
294
|
-
})(["display:none;visibility:hidden;", ""], buttonStyles);
|
|
295
|
-
var StyledSearchIconWrapper = external_styled_components_default.a.span.withConfig({
|
|
296
|
-
displayName: "TextAreaStyles__StyledSearchIconWrapper",
|
|
297
|
-
componentId: "gfy8yp-1"
|
|
298
|
-
})(["", ";color:", ";pointer-events:none;padding:", ";", ""], themes_["mixins"].reset('inline-block'), Object(themes_["pick"])({
|
|
299
|
-
enterprise: {
|
|
300
|
-
light: themes_["variables"].gray60,
|
|
301
|
-
dark: themes_["variables"].white
|
|
302
|
-
},
|
|
303
|
-
prisma: themes_["variables"].contentColorMuted
|
|
304
|
-
}), Object(themes_["pick"])({
|
|
305
|
-
comfortable: '0 8px',
|
|
306
|
-
compact: '0 6px'
|
|
307
|
-
}), function (_ref) {
|
|
308
|
-
var $disabled = _ref.$disabled;
|
|
309
|
-
return $disabled && Object(external_styled_components_["css"])(["", ""], Object(themes_["pick"])({
|
|
310
|
-
enterprise: Object(external_styled_components_["css"])(["color:", ";"], themes_["variables"].textDisabledColor),
|
|
311
|
-
prisma: Object(external_styled_components_["css"])(["color:", ";"], themes_["variables"].contentColorDisabled)
|
|
312
|
-
}));
|
|
313
|
-
});
|
|
314
|
-
var StyledBox = external_styled_components_default()(Box_default.a).withConfig({
|
|
315
|
-
displayName: "TextAreaStyles__StyledBox",
|
|
316
|
-
componentId: "gfy8yp-2"
|
|
317
|
-
})(["display:flex;justify-content:space-between;flex-grow:1;flex-shrink:1;position:relative;&[data-inline]{width:230px;flex-basis:230px;[data-inline] + &{margin-left:", ";}}&:focus-within:not([disabled]){", "{", "}", "{visibility:visible;display:block;}}"], Object(themes_["pick"])({
|
|
318
|
-
enterprise: themes_["variables"].spacingHalf,
|
|
319
|
-
prisma: themes_["variables"].spacingSmall
|
|
320
|
-
}),
|
|
321
|
-
/* sc-sel */
|
|
322
|
-
StyledSearchIconWrapper, Object(themes_["pick"])({
|
|
323
|
-
enterprise: Object(external_styled_components_["css"])(["display:none;"])
|
|
324
|
-
}),
|
|
325
|
-
/* sc-sel */
|
|
326
|
-
StyledClearButton);
|
|
327
|
-
var StyledTextAreaWrapper = external_styled_components_default.a.span.withConfig({
|
|
328
|
-
displayName: "TextAreaStyles__StyledTextAreaWrapper",
|
|
329
|
-
componentId: "gfy8yp-3"
|
|
330
|
-
})(["", " flex-grow:1;min-height:", ";position:relative;overflow:hidden;border:1px solid ", ";border-radius:", ";box-sizing:border-box;background-color:", ";box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);padding:", ";", " ", " &:hover:not([disabled]){border-color:", ";}&:focus-within:not([disabled]){", "}", " ", " ", " ", ""], themes_["mixins"].reset('inline-flex'), themes_["variables"].inputHeight, Object(themes_["pick"])({
|
|
331
|
-
enterprise: {
|
|
332
|
-
light: themes_["variables"].gray60,
|
|
333
|
-
dark: themes_["variables"].gray20
|
|
334
|
-
},
|
|
335
|
-
prisma: themes_["variables"].interactiveColorBorder
|
|
336
|
-
}), themes_["variables"].borderRadius, Object(themes_["pick"])({
|
|
337
|
-
enterprise: {
|
|
338
|
-
light: themes_["variables"].white,
|
|
339
|
-
dark: themes_["variables"].gray22
|
|
340
|
-
},
|
|
341
|
-
prisma: themes_["variables"].transparent
|
|
342
|
-
}), Object(themes_["pick"])({
|
|
343
|
-
enterprise: '0px 0px 0px 10px',
|
|
344
|
-
prisma: '0px 12px'
|
|
345
|
-
}), function (_ref2) {
|
|
346
|
-
var $hasEndAdornment = _ref2.$hasEndAdornment;
|
|
347
|
-
return $hasEndAdornment && Object(external_styled_components_["css"])(["padding-right:0;"]);
|
|
348
|
-
}, function (_ref3) {
|
|
349
|
-
var $hasStartAdornment = _ref3.$hasStartAdornment;
|
|
350
|
-
return $hasStartAdornment && Object(external_styled_components_["css"])(["padding-left:0;"]);
|
|
351
|
-
}, Object(themes_["pick"])({
|
|
352
|
-
enterprise: {
|
|
353
|
-
light: themes_["variables"].gray60,
|
|
354
|
-
dark: themes_["variables"].gray20
|
|
355
|
-
},
|
|
356
|
-
prisma: themes_["variables"].interactiveColorBorderHover
|
|
357
|
-
}), Object(themes_["pick"])({
|
|
358
|
-
enterprise: Object(external_styled_components_["css"])(["box-shadow:", ";color:", ";"], themes_["variables"].focusShadow, themes_["variables"].textColor),
|
|
359
|
-
prisma: Object(external_styled_components_["css"])(["border-color:", ";color:", ";"], themes_["variables"].interactiveColorPrimary, themes_["variables"].contentColorActive)
|
|
360
|
-
}), function (_ref4) {
|
|
361
|
-
var $error = _ref4.$error;
|
|
362
|
-
return $error && Object(external_styled_components_["css"])(["&,&:hover:not([disabled]){border-color:", ";}&:focus-within:not([disabled]){", "}"], Object(themes_["pick"])({
|
|
363
|
-
enterprise: themes_["variables"].errorColor,
|
|
364
|
-
prisma: themes_["variables"].accentColorNegative
|
|
365
|
-
}), Object(themes_["pick"])({
|
|
366
|
-
enterprise: Object(external_styled_components_["css"])(["box-shadow:", ";color:", ";"], themes_["variables"].focusShadow, themes_["variables"].textColor),
|
|
367
|
-
prisma: Object(external_styled_components_["css"])(["border-color:", ";color:", ";"], themes_["variables"].interactiveColorPrimary, themes_["variables"].contentColorActive)
|
|
368
|
-
}));
|
|
369
|
-
}, function (_ref5) {
|
|
370
|
-
var $append = _ref5.$append;
|
|
371
|
-
return $append && Object(external_styled_components_["css"])(["margin-right:-1px;border-top-right-radius:0;border-bottom-right-radius:0;border-right:none;"]);
|
|
372
|
-
}, function (_ref6) {
|
|
373
|
-
var $prepend = _ref6.$prepend;
|
|
374
|
-
return $prepend && Object(external_styled_components_["css"])(["border-top-left-radius:0;border-bottom-left-radius:0;"]);
|
|
375
|
-
}, function (_ref7) {
|
|
376
|
-
var disabled = _ref7.disabled;
|
|
377
|
-
return disabled && Object(external_styled_components_["css"])(["", " box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);"], Object(themes_["pick"])({
|
|
378
|
-
enterprise: {
|
|
379
|
-
light: Object(external_styled_components_["css"])(["background-color:", ";border-color:", ";"], themes_["variables"].gray96, themes_["variables"].gray92),
|
|
380
|
-
dark: Object(external_styled_components_["css"])(["background-color:", ";border-color:", ";"], themes_["variables"].gray22, themes_["variables"].gray30)
|
|
381
|
-
},
|
|
382
|
-
prisma: Object(external_styled_components_["css"])(["border-color:", ";"], themes_["variables"].interactiveColorBorderDisabled)
|
|
383
|
-
}));
|
|
384
|
-
});
|
|
385
|
-
var StyledTextArea = external_styled_components_default.a.textarea.withConfig({
|
|
386
|
-
displayName: "TextAreaStyles__StyledTextArea",
|
|
387
|
-
componentId: "gfy8yp-4"
|
|
388
|
-
})(["", ";outline-style:none;border:0;background:transparent;color:", ";flex-grow:1;font-family:", ";font-size:inherit;line-height:inherit;padding-top:", ";padding-bottom:", ";padding-right:", ";position:relative;resize:none;overflow:auto;white-space:pre-wrap;&::placeholder{color:", ";opacity:1;}", " ", ""], themes_["mixins"].reset('inline-flex'), Object(themes_["pick"])({
|
|
389
|
-
enterprise: themes_["variables"].textColor,
|
|
390
|
-
prisma: themes_["variables"].contentColorActive
|
|
391
|
-
}), themes_["variables"].sansFontFamily, Object(themes_["pick"])({
|
|
392
|
-
enterprise: {
|
|
393
|
-
comfortable: themes_["variables"].spacingQuarter,
|
|
394
|
-
compact: '3px'
|
|
395
|
-
},
|
|
396
|
-
prisma: {
|
|
397
|
-
comfortable: themes_["variables"].spacingSmall,
|
|
398
|
-
compact: '5px'
|
|
399
|
-
}
|
|
400
|
-
}), Object(themes_["pick"])({
|
|
401
|
-
enterprise: {
|
|
402
|
-
comfortable: themes_["variables"].spacingQuarter,
|
|
403
|
-
compact: '3px'
|
|
404
|
-
},
|
|
405
|
-
prisma: {
|
|
406
|
-
comfortable: themes_["variables"].spacingSmall,
|
|
407
|
-
compact: '5px'
|
|
408
|
-
}
|
|
409
|
-
}), Object(themes_["pick"])({
|
|
410
|
-
enterprise: '10px',
|
|
411
|
-
prisma: '14px'
|
|
412
|
-
}), themes_["variables"].contentColorMuted, function (_ref8) {
|
|
413
|
-
var $error = _ref8.$error;
|
|
414
|
-
return $error && Object(external_styled_components_["css"])(["&,&:hover{color:", ";}"], Object(themes_["pick"])({
|
|
415
|
-
enterprise: {
|
|
416
|
-
light: themes_["variables"].errorColorD10,
|
|
417
|
-
dark: themes_["variables"].errorColorL20
|
|
418
|
-
},
|
|
419
|
-
prisma: themes_["variables"].contentColorActive
|
|
420
|
-
}));
|
|
421
|
-
}, function (_ref9) {
|
|
422
|
-
var disabled = _ref9.disabled;
|
|
423
|
-
return disabled && disabledStyles;
|
|
424
|
-
});
|
|
425
|
-
var StyledVisibilityToggle = external_styled_components_default()(Button_default.a).withConfig({
|
|
426
|
-
displayName: "TextAreaStyles__StyledVisibilityToggle",
|
|
427
|
-
componentId: "gfy8yp-5"
|
|
428
|
-
})(["", ""], buttonStyles);
|
|
429
|
-
var StyledPlaceholder = external_styled_components_default.a.span.withConfig({
|
|
430
|
-
displayName: "TextAreaStyles__StyledPlaceholder",
|
|
431
|
-
componentId: "gfy8yp-6"
|
|
432
|
-
})(["pointer-events:none;color:", ";position:absolute;overflow:hidden;font-size:inherit;line-height:inherit;height:", ";margin-right:", ";", ";", ";", ""], Object(themes_["pick"])({
|
|
433
|
-
enterprise: themes_["variables"].textGray,
|
|
434
|
-
prisma: themes_["variables"].contentColorMuted
|
|
435
|
-
}), themes_["variables"].lineHeight, Object(themes_["pick"])({
|
|
436
|
-
enterprise: '10px',
|
|
437
|
-
prisma: '14px'
|
|
438
|
-
}), function (_ref10) {
|
|
439
|
-
var $hasStartAdornment = _ref10.$hasStartAdornment,
|
|
440
|
-
$startAdornmentWidth = _ref10.$startAdornmentWidth;
|
|
441
|
-
return $hasStartAdornment && ($startAdornmentWidth ? Object(external_styled_components_["css"])(["margin-left:", "px;"], $startAdornmentWidth) : Object(external_styled_components_["css"])(["margin-left:", ";"], Object(themes_["pick"])({
|
|
442
|
-
enterprise: {
|
|
443
|
-
comfortable: '30px',
|
|
444
|
-
compact: '26px'
|
|
445
|
-
},
|
|
446
|
-
prisma: {
|
|
447
|
-
comfortable: '38px',
|
|
448
|
-
compact: '30px'
|
|
488
|
+
// CONCATENATED MODULE: ./src/TextArea/TextArea.tsx
|
|
489
|
+
function te(e) {
|
|
490
|
+
"@babel/helpers - typeof";
|
|
491
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
492
|
+
te = function e(t) {
|
|
493
|
+
return typeof t;
|
|
494
|
+
};
|
|
495
|
+
} else {
|
|
496
|
+
te = function e(t) {
|
|
497
|
+
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
498
|
+
};
|
|
499
|
+
}
|
|
500
|
+
return te(e);
|
|
449
501
|
}
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
comfortable: '30px',
|
|
464
|
-
compact: '26px'
|
|
465
|
-
},
|
|
466
|
-
prisma: {
|
|
467
|
-
comfortable: '38px',
|
|
468
|
-
compact: '30px'
|
|
502
|
+
function re() {
|
|
503
|
+
re = Object.assign || function(e) {
|
|
504
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
505
|
+
var r = arguments[t];
|
|
506
|
+
for (var n in r) {
|
|
507
|
+
if (Object.prototype.hasOwnProperty.call(r, n)) {
|
|
508
|
+
e[n] = r[n];
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
return e;
|
|
513
|
+
};
|
|
514
|
+
return re.apply(this, arguments);
|
|
469
515
|
}
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
var $hasBothAdornment = _ref12.$hasBothAdornment,
|
|
473
|
-
$endAdornmentWidth = _ref12.$endAdornmentWidth,
|
|
474
|
-
$startAdornmentWidth = _ref12.$startAdornmentWidth;
|
|
475
|
-
return $hasBothAdornment && Object(external_styled_components_["css"])(["max-width:calc(100% - ", "px - ", "px);"], $startAdornmentWidth, $endAdornmentWidth);
|
|
476
|
-
});
|
|
477
|
-
var adornmentHolder = Object(external_styled_components_["css"])(["display:inline-flex;align-items:center;justify-content:center;height:", ";pointer-events:none;"], Object(themes_["pick"])({
|
|
478
|
-
enterprise: {
|
|
479
|
-
comfortable: '30px',
|
|
480
|
-
compact: '26px'
|
|
481
|
-
},
|
|
482
|
-
prisma: {
|
|
483
|
-
comfortable: '38px',
|
|
484
|
-
compact: '30px'
|
|
485
|
-
}
|
|
486
|
-
}));
|
|
487
|
-
var StyledStartAdornmentHolder = external_styled_components_default.a.div.withConfig({
|
|
488
|
-
displayName: "TextAreaStyles__StyledStartAdornmentHolder",
|
|
489
|
-
componentId: "gfy8yp-7"
|
|
490
|
-
})(["", " ", ";"], adornmentHolder, function (_ref13) {
|
|
491
|
-
var $width = _ref13.$width;
|
|
492
|
-
return $width ? Object(external_styled_components_["css"])(["min-width:", "px;"], $width) : Object(external_styled_components_["css"])(["min-width:", ";"], Object(themes_["pick"])({
|
|
493
|
-
enterprise: {
|
|
494
|
-
comfortable: '30px',
|
|
495
|
-
compact: '26px'
|
|
496
|
-
},
|
|
497
|
-
prisma: {
|
|
498
|
-
comfortable: '38px',
|
|
499
|
-
compact: '30px'
|
|
516
|
+
function ne(e) {
|
|
517
|
+
return le(e) || oe(e) || ie(e) || ae();
|
|
500
518
|
}
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
var StyledEndAdornmentHolder = external_styled_components_default.a.div.withConfig({
|
|
504
|
-
displayName: "TextAreaStyles__StyledEndAdornmentHolder",
|
|
505
|
-
componentId: "gfy8yp-8"
|
|
506
|
-
})(["", " ", ";"], adornmentHolder, function (_ref14) {
|
|
507
|
-
var $width = _ref14.$width;
|
|
508
|
-
return $width ? Object(external_styled_components_["css"])(["min-width:", "px;"], $width) : Object(external_styled_components_["css"])(["min-width:", ";"], Object(themes_["pick"])({
|
|
509
|
-
enterprise: {
|
|
510
|
-
comfortable: '30px',
|
|
511
|
-
compact: '26px'
|
|
512
|
-
},
|
|
513
|
-
prisma: {
|
|
514
|
-
comfortable: '38px',
|
|
515
|
-
compact: '30px'
|
|
519
|
+
function ae() {
|
|
520
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
516
521
|
}
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
comfortable: '30px',
|
|
525
|
-
compact: '26px'
|
|
526
|
-
},
|
|
527
|
-
prisma: {
|
|
528
|
-
comfortable: '38px',
|
|
529
|
-
compact: '30px'
|
|
530
|
-
}
|
|
531
|
-
}), Object(themes_["pick"])({
|
|
532
|
-
enterprise: {
|
|
533
|
-
light: themes_["variables"].gray60,
|
|
534
|
-
dark: themes_["variables"].white
|
|
535
|
-
},
|
|
536
|
-
prisma: themes_["variables"].contentColorMuted
|
|
537
|
-
}), function (_ref15) {
|
|
538
|
-
var $position = _ref15.$position;
|
|
539
|
-
return $position === 'start' ? Object(external_styled_components_["css"])(["top:1px;left:1px;"]) : Object(external_styled_components_["css"])(["top:1px;right:1px;"]);
|
|
540
|
-
}, function (_ref16) {
|
|
541
|
-
var disabled = _ref16.disabled;
|
|
542
|
-
return disabled && disabledStyles;
|
|
543
|
-
}, Object(themes_["pick"])({
|
|
544
|
-
enterprise: Object(external_styled_components_["css"])(["margin-left:-1px;margin-right:-1px;"])
|
|
545
|
-
}));
|
|
546
|
-
|
|
547
|
-
// CONCATENATED MODULE: ./src/TextArea/syncHeightWithShadow.ts
|
|
548
|
-
// This file was adapted from [Call-Em-All's material-ui](https://github.com/mui-org/material-ui),
|
|
549
|
-
// which is MIT-licensed:
|
|
550
|
-
//
|
|
551
|
-
// The MIT License (MIT)
|
|
552
|
-
//
|
|
553
|
-
// Copyright (c) 2014 Call-Em-All
|
|
554
|
-
//
|
|
555
|
-
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
556
|
-
// of this software and associated documentation files (the "Software"), to deal
|
|
557
|
-
// in the Software without restriction, including without limitation the rights
|
|
558
|
-
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
559
|
-
// copies of the Software, and to permit persons to whom the Software is
|
|
560
|
-
// furnished to do so, subject to the following conditions:
|
|
561
|
-
//
|
|
562
|
-
// The above copyright notice and this permission notice shall be included in all
|
|
563
|
-
// copies or substantial portions of the Software.
|
|
564
|
-
//
|
|
565
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
566
|
-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
567
|
-
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
568
|
-
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
569
|
-
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
570
|
-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
571
|
-
// SOFTWARE.
|
|
572
|
-
//
|
|
573
|
-
// End of MIT license text.
|
|
574
|
-
function syncHeightWithShadow(_ref) {
|
|
575
|
-
var height = _ref.height,
|
|
576
|
-
rowsMax = _ref.rowsMax,
|
|
577
|
-
rowsMin = _ref.rowsMin,
|
|
578
|
-
shadow = _ref.shadow;
|
|
579
|
-
|
|
580
|
-
if (shadow) {
|
|
581
|
-
var style = window.getComputedStyle(shadow);
|
|
582
|
-
var lineHeightValue = style.getPropertyValue('line-height'); // jsdom does not properly inherit/re-calculate the line-height property so we skip in these cases SUI-1943, SUI-2428
|
|
583
|
-
|
|
584
|
-
if (lineHeightValue === 'inherit' || lineHeightValue === 'normal') {
|
|
585
|
-
return false;
|
|
522
|
+
function ie(e, t) {
|
|
523
|
+
if (!e) return;
|
|
524
|
+
if (typeof e === "string") return se(e, t);
|
|
525
|
+
var r = Object.prototype.toString.call(e).slice(8, -1);
|
|
526
|
+
if (r === "Object" && e.constructor) r = e.constructor.name;
|
|
527
|
+
if (r === "Map" || r === "Set") return Array.from(e);
|
|
528
|
+
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return se(e, t);
|
|
586
529
|
}
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
var paddingTop = parseInt(style.getPropertyValue('padding-top'), 10);
|
|
590
|
-
var paddingBottom = parseInt(style.getPropertyValue('padding-bottom'), 10);
|
|
591
|
-
var borderTop = parseInt(style.getPropertyValue('border-top-width'), 10);
|
|
592
|
-
var borderBottom = parseInt(style.getPropertyValue('border-bottom-width'), 10);
|
|
593
|
-
var newHeight = shadow.scrollHeight + borderTop + borderBottom;
|
|
594
|
-
/* eslint-disable no-restricted-globals */
|
|
595
|
-
// Leverage the global `isNaN` here for IE support, rather than Number.isNaN.
|
|
596
|
-
// We know newHeight is numeric because we parseInt() above, so `isNaN` should be reliable.
|
|
597
|
-
|
|
598
|
-
if (newHeight === undefined || isNaN(newHeight)) {
|
|
599
|
-
return false;
|
|
530
|
+
function oe(e) {
|
|
531
|
+
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(e)) return Array.from(e);
|
|
600
532
|
}
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
if (rowsMax >= rowsMin) {
|
|
605
|
-
var maxHeight = rowsMax * lineHeight + paddingTop + paddingBottom + borderTop + borderBottom + 1; // need one extra.
|
|
606
|
-
|
|
607
|
-
newHeight = Math.min(maxHeight, newHeight);
|
|
533
|
+
function le(e) {
|
|
534
|
+
if (Array.isArray(e)) return se(e);
|
|
608
535
|
}
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
return newHeight;
|
|
536
|
+
function se(e, t) {
|
|
537
|
+
if (t == null || t > e.length) t = e.length;
|
|
538
|
+
for (var r = 0, n = new Array(t); r < t; r++) {
|
|
539
|
+
n[r] = e[r];
|
|
540
|
+
}
|
|
541
|
+
return n;
|
|
616
542
|
}
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
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); }
|
|
628
|
-
|
|
629
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
630
|
-
|
|
631
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
632
|
-
|
|
633
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
634
|
-
|
|
635
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
|
|
636
|
-
|
|
637
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
638
|
-
|
|
639
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
640
|
-
|
|
641
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
642
|
-
|
|
643
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
644
|
-
|
|
645
|
-
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; }
|
|
646
|
-
|
|
647
|
-
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; }
|
|
648
|
-
|
|
649
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
650
|
-
|
|
651
|
-
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); } }
|
|
652
|
-
|
|
653
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
654
|
-
|
|
655
|
-
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); }
|
|
656
|
-
|
|
657
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
658
|
-
|
|
659
|
-
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); }; }
|
|
660
|
-
|
|
661
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
662
|
-
|
|
663
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
664
|
-
|
|
665
|
-
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; } }
|
|
666
|
-
|
|
667
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
668
|
-
|
|
669
|
-
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; }
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
/** @public */
|
|
693
|
-
|
|
694
|
-
var propTypes = {
|
|
695
|
-
appearance: external_prop_types_default.a.oneOf(['default', 'search']),
|
|
696
|
-
append: external_prop_types_default.a.bool,
|
|
697
|
-
autoCapitalize: external_prop_types_default.a.string,
|
|
698
|
-
autoComplete: external_prop_types_default.a.string,
|
|
699
|
-
autoCorrect: external_prop_types_default.a.string,
|
|
700
|
-
autoFocus: external_prop_types_default.a.bool,
|
|
701
|
-
canClear: external_prop_types_default.a.bool,
|
|
702
|
-
children: external_prop_types_default.a.node,
|
|
703
|
-
|
|
704
|
-
/** @private. */
|
|
705
|
-
classNamePrivate: external_prop_types_default.a.string,
|
|
706
|
-
defaultValue: external_prop_types_default.a.string,
|
|
707
|
-
describedBy: external_prop_types_default.a.string,
|
|
708
|
-
disabled: external_prop_types_default.a.bool,
|
|
709
|
-
elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
|
|
710
|
-
endAdornment: external_prop_types_default.a.node,
|
|
711
|
-
error: external_prop_types_default.a.bool,
|
|
712
|
-
inline: external_prop_types_default.a.bool,
|
|
713
|
-
|
|
714
|
-
/** @private. */
|
|
715
|
-
inputClassName: external_prop_types_default.a.string,
|
|
716
|
-
inputId: external_prop_types_default.a.string,
|
|
717
|
-
inputRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
|
|
718
|
-
labelledBy: external_prop_types_default.a.string,
|
|
719
|
-
maxLength: external_prop_types_default.a.number,
|
|
720
|
-
name: external_prop_types_default.a.string,
|
|
721
|
-
onBlur: external_prop_types_default.a.func,
|
|
722
|
-
onChange: external_prop_types_default.a.func,
|
|
723
|
-
onFocus: external_prop_types_default.a.func,
|
|
724
|
-
onKeyDown: external_prop_types_default.a.func,
|
|
725
|
-
onSelect: external_prop_types_default.a.func,
|
|
726
|
-
onInputClick: external_prop_types_default.a.func,
|
|
727
|
-
placeholder: external_prop_types_default.a.string,
|
|
728
|
-
prepend: external_prop_types_default.a.bool,
|
|
729
|
-
|
|
730
|
-
/** @private. */
|
|
731
|
-
required: external_prop_types_default.a.bool,
|
|
732
|
-
rowsMax: external_prop_types_default.a.number,
|
|
733
|
-
rowsMin: external_prop_types_default.a.number,
|
|
734
|
-
spellCheck: external_prop_types_default.a.bool,
|
|
735
|
-
tabIndex: external_prop_types_default.a.number,
|
|
736
|
-
startAdornment: external_prop_types_default.a.node,
|
|
737
|
-
|
|
738
|
-
/** @private */
|
|
739
|
-
splunkTheme: external_prop_types_default.a.object,
|
|
740
|
-
value: external_prop_types_default.a.string
|
|
741
|
-
};
|
|
742
|
-
var defaultProps = {
|
|
743
|
-
appearance: 'default',
|
|
744
|
-
append: false,
|
|
745
|
-
autoFocus: false,
|
|
746
|
-
canClear: false,
|
|
747
|
-
disabled: false,
|
|
748
|
-
error: false,
|
|
749
|
-
inline: false,
|
|
750
|
-
placeholder: '',
|
|
751
|
-
prepend: false,
|
|
752
|
-
rowsMax: 8,
|
|
753
|
-
rowsMin: 2,
|
|
754
|
-
tabIndex: 0
|
|
755
|
-
};
|
|
756
|
-
|
|
757
|
-
/** Note: TextArea places role and aria props onto the input. All other props are placed on the wrapper. */
|
|
758
|
-
var TextArea_TextArea = /*#__PURE__*/function (_Component) {
|
|
759
|
-
_inherits(TextArea, _Component);
|
|
760
|
-
|
|
761
|
-
var _super = _createSuper(TextArea);
|
|
762
|
-
|
|
763
|
-
_createClass(TextArea, null, [{
|
|
764
|
-
key: "validateRows",
|
|
765
|
-
// @docs-props-type TextAreaPropsBase
|
|
766
|
-
value: function validateRows(_ref) {
|
|
767
|
-
var rowsMin = _ref.rowsMin,
|
|
768
|
-
rowsMax = _ref.rowsMax;
|
|
769
|
-
|
|
770
|
-
if (false) {}
|
|
543
|
+
function ce(e, t) {
|
|
544
|
+
var r = Object.keys(e);
|
|
545
|
+
if (Object.getOwnPropertySymbols) {
|
|
546
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
547
|
+
if (t) n = n.filter((function(t) {
|
|
548
|
+
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
549
|
+
}));
|
|
550
|
+
r.push.apply(r, n);
|
|
551
|
+
}
|
|
552
|
+
return r;
|
|
771
553
|
}
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
var _this$props$onSelect, _this$props3;
|
|
846
|
-
|
|
847
|
-
(_this$props$onSelect = (_this$props3 = _this.props).onSelect) === null || _this$props$onSelect === void 0 ? void 0 : _this$props$onSelect.call(_this$props3, e);
|
|
848
|
-
});
|
|
849
|
-
|
|
850
|
-
_defineProperty(_assertThisInitialized(_this), "handleInputClick", function (e) {
|
|
851
|
-
var _this$props$onInputCl, _this$props4;
|
|
852
|
-
|
|
853
|
-
(_this$props$onInputCl = (_this$props4 = _this.props).onInputClick) === null || _this$props$onInputCl === void 0 ? void 0 : _this$props$onInputCl.call(_this$props4, e);
|
|
854
|
-
});
|
|
855
|
-
|
|
856
|
-
_defineProperty(_assertThisInitialized(_this), "handleInputFocus", function (e) {
|
|
857
|
-
var _this$props$onFocus, _this$props5;
|
|
858
|
-
|
|
859
|
-
(_this$props$onFocus = (_this$props5 = _this.props).onFocus) === null || _this$props$onFocus === void 0 ? void 0 : _this$props$onFocus.call(_this$props5, e);
|
|
860
|
-
});
|
|
861
|
-
|
|
862
|
-
_defineProperty(_assertThisInitialized(_this), "handleInputBlur", function (e) {
|
|
863
|
-
var _this$props$onBlur, _this$props6;
|
|
864
|
-
|
|
865
|
-
(_this$props$onBlur = (_this$props6 = _this.props).onBlur) === null || _this$props$onBlur === void 0 ? void 0 : _this$props$onBlur.call(_this$props6, e);
|
|
866
|
-
});
|
|
867
|
-
|
|
868
|
-
_defineProperty(_assertThisInitialized(_this), "handleClear", function (e) {
|
|
869
|
-
var _this$props$onChange2, _this$props7;
|
|
870
|
-
|
|
871
|
-
e.preventDefault();
|
|
872
|
-
var value = '';
|
|
873
|
-
var name = _this.props.name;
|
|
874
|
-
|
|
875
|
-
if (!_this.isControlled()) {
|
|
876
|
-
_this.setState({
|
|
877
|
-
value: value
|
|
878
|
-
});
|
|
879
|
-
}
|
|
880
|
-
|
|
881
|
-
_this.focus();
|
|
882
|
-
|
|
883
|
-
(_this$props$onChange2 = (_this$props7 = _this.props).onChange) === null || _this$props$onChange2 === void 0 ? void 0 : _this$props$onChange2.call(_this$props7, e, {
|
|
884
|
-
value: value,
|
|
885
|
-
name: name
|
|
886
|
-
});
|
|
887
|
-
});
|
|
888
|
-
|
|
889
|
-
_defineProperty(_assertThisInitialized(_this), "syncHeightWithShadow", function () {
|
|
890
|
-
var newHeight = syncHeightWithShadow({
|
|
891
|
-
height: _this.state.height,
|
|
892
|
-
rowsMax: _this.props.rowsMax,
|
|
893
|
-
rowsMin: _this.props.rowsMin,
|
|
894
|
-
shadow: _this.shadow
|
|
895
|
-
});
|
|
896
|
-
|
|
897
|
-
if (newHeight !== false) {
|
|
898
|
-
_this.setState({
|
|
899
|
-
height: newHeight
|
|
554
|
+
function pe(e) {
|
|
555
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
556
|
+
var r = arguments[t] != null ? arguments[t] : {};
|
|
557
|
+
if (t % 2) {
|
|
558
|
+
ce(Object(r), true).forEach((function(t) {
|
|
559
|
+
ke(e, t, r[t]);
|
|
560
|
+
}));
|
|
561
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
|
562
|
+
Object.defineProperties(e, Object.getOwnPropertyDescriptors(r));
|
|
563
|
+
} else {
|
|
564
|
+
ce(Object(r)).forEach((function(t) {
|
|
565
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
|
|
566
|
+
}));
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
return e;
|
|
570
|
+
}
|
|
571
|
+
function de(e, t) {
|
|
572
|
+
if (e == null) return {};
|
|
573
|
+
var r = ue(e, t);
|
|
574
|
+
var n, a;
|
|
575
|
+
if (Object.getOwnPropertySymbols) {
|
|
576
|
+
var i = Object.getOwnPropertySymbols(e);
|
|
577
|
+
for (a = 0; a < i.length; a++) {
|
|
578
|
+
n = i[a];
|
|
579
|
+
if (t.indexOf(n) >= 0) continue;
|
|
580
|
+
if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
|
|
581
|
+
r[n] = e[n];
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
return r;
|
|
585
|
+
}
|
|
586
|
+
function ue(e, t) {
|
|
587
|
+
if (e == null) return {};
|
|
588
|
+
var r = {};
|
|
589
|
+
var n = Object.keys(e);
|
|
590
|
+
var a, i;
|
|
591
|
+
for (i = 0; i < n.length; i++) {
|
|
592
|
+
a = n[i];
|
|
593
|
+
if (t.indexOf(a) >= 0) continue;
|
|
594
|
+
r[a] = e[a];
|
|
595
|
+
}
|
|
596
|
+
return r;
|
|
597
|
+
}
|
|
598
|
+
function fe(e, t) {
|
|
599
|
+
if (!(e instanceof t)) {
|
|
600
|
+
throw new TypeError("Cannot call a class as a function");
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
function he(e, t) {
|
|
604
|
+
for (var r = 0; r < t.length; r++) {
|
|
605
|
+
var n = t[r];
|
|
606
|
+
n.enumerable = n.enumerable || false;
|
|
607
|
+
n.configurable = true;
|
|
608
|
+
if ("value" in n) n.writable = true;
|
|
609
|
+
Object.defineProperty(e, n.key, n);
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
function me(e, t, r) {
|
|
613
|
+
if (t) he(e.prototype, t);
|
|
614
|
+
if (r) he(e, r);
|
|
615
|
+
return e;
|
|
616
|
+
}
|
|
617
|
+
function ve(e, t) {
|
|
618
|
+
if (typeof t !== "function" && t !== null) {
|
|
619
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
620
|
+
}
|
|
621
|
+
e.prototype = Object.create(t && t.prototype, {
|
|
622
|
+
constructor: {
|
|
623
|
+
value: e,
|
|
624
|
+
writable: true,
|
|
625
|
+
configurable: true
|
|
626
|
+
}
|
|
900
627
|
});
|
|
901
|
-
|
|
902
|
-
});
|
|
903
|
-
|
|
904
|
-
_defineProperty(_assertThisInitialized(_this), "renderEndAdornment", function () {
|
|
905
|
-
var _controlGroupContext$;
|
|
906
|
-
|
|
907
|
-
var _this$props8 = _this.props,
|
|
908
|
-
appearance = _this$props8.appearance,
|
|
909
|
-
endAdornment = _this$props8.endAdornment,
|
|
910
|
-
disabled = _this$props8.disabled,
|
|
911
|
-
canClear = _this$props8.canClear,
|
|
912
|
-
splunkTheme = _this$props8.splunkTheme;
|
|
913
|
-
var isPrisma = splunkTheme.isPrisma,
|
|
914
|
-
isEnterprise = splunkTheme.isEnterprise,
|
|
915
|
-
isCompact = splunkTheme.isCompact;
|
|
916
|
-
var prismaSize = isCompact ? '20px' : '24px';
|
|
917
|
-
var adornmentProps = {
|
|
918
|
-
ref: function ref(el) {
|
|
919
|
-
_this.endAdornment = el;
|
|
920
|
-
},
|
|
921
|
-
disabled: disabled,
|
|
922
|
-
$position: 'end'
|
|
923
|
-
};
|
|
924
|
-
|
|
925
|
-
if (endAdornment) {
|
|
926
|
-
return /*#__PURE__*/external_react_default.a.createElement(StyledAdornment, adornmentProps, endAdornment);
|
|
927
|
-
}
|
|
928
|
-
|
|
929
|
-
var controlGroupContext = _this.context;
|
|
930
|
-
var controlGroupLabel = (_controlGroupContext$ = controlGroupContext.labelAttrs) === null || _controlGroupContext$ === void 0 ? void 0 : _controlGroupContext$.text;
|
|
931
|
-
var clearButtonText = controlGroupLabel ? Object(i18n_["_"])("Clear ".concat(controlGroupLabel, " text field")) : Object(i18n_["_"])('Clear text field');
|
|
932
|
-
|
|
933
|
-
if (!isPrisma && appearance === 'search') {
|
|
934
|
-
return /*#__PURE__*/external_react_default.a.createElement(StyledAdornment, adornmentProps, /*#__PURE__*/external_react_default.a.createElement(StyledClearButton, {
|
|
935
|
-
appearance: "pill",
|
|
936
|
-
"data-test": "clear",
|
|
937
|
-
inline: false,
|
|
938
|
-
icon: /*#__PURE__*/external_react_default.a.createElement(Close_default.a, {
|
|
939
|
-
size: 1,
|
|
940
|
-
screenReaderText: clearButtonText
|
|
941
|
-
}),
|
|
942
|
-
onClick: _this.handleClear
|
|
943
|
-
}), /*#__PURE__*/external_react_default.a.createElement(StyledSearchIconWrapper, {
|
|
944
|
-
$disabled: disabled
|
|
945
|
-
}, isEnterprise ? /*#__PURE__*/external_react_default.a.createElement(Search_default.a, {
|
|
946
|
-
hideDefaultTooltip: true,
|
|
947
|
-
inline: false,
|
|
948
|
-
screenReaderText: null,
|
|
949
|
-
size: "16px"
|
|
950
|
-
}) : /*#__PURE__*/external_react_default.a.createElement(Magnifier_default.a, {
|
|
951
|
-
height: prismaSize,
|
|
952
|
-
width: prismaSize
|
|
953
|
-
})));
|
|
954
|
-
}
|
|
955
|
-
|
|
956
|
-
var displayValue = _this.getDisplayValue();
|
|
957
|
-
|
|
958
|
-
if (!!displayValue && (isPrisma && appearance === 'search' || canClear)) {
|
|
959
|
-
return /*#__PURE__*/external_react_default.a.createElement(StyledAdornment, adornmentProps, !disabled && /*#__PURE__*/external_react_default.a.createElement(StyledClearButton, {
|
|
960
|
-
"data-test": "clear",
|
|
961
|
-
appearance: "secondary",
|
|
962
|
-
onClick: _this.handleClear,
|
|
963
|
-
icon: /*#__PURE__*/external_react_default.a.createElement(Cross_default.a, {
|
|
964
|
-
"aria-label": clearButtonText,
|
|
965
|
-
inline: false,
|
|
966
|
-
width: prismaSize,
|
|
967
|
-
height: prismaSize
|
|
968
|
-
})
|
|
969
|
-
}));
|
|
970
|
-
}
|
|
971
|
-
|
|
972
|
-
return undefined;
|
|
973
|
-
});
|
|
974
|
-
|
|
975
|
-
_defineProperty(_assertThisInitialized(_this), "renderStartAdornment", function () {
|
|
976
|
-
var _this$props9 = _this.props,
|
|
977
|
-
appearance = _this$props9.appearance,
|
|
978
|
-
startAdornment = _this$props9.startAdornment,
|
|
979
|
-
splunkTheme = _this$props9.splunkTheme,
|
|
980
|
-
disabled = _this$props9.disabled;
|
|
981
|
-
var isPrisma = splunkTheme.isPrisma,
|
|
982
|
-
isCompact = splunkTheme.isCompact;
|
|
983
|
-
var prismaSize = isCompact ? '20px' : '24px';
|
|
984
|
-
var adornmentProps = {
|
|
985
|
-
ref: function ref(el) {
|
|
986
|
-
_this.startAdornment = el;
|
|
987
|
-
},
|
|
988
|
-
disabled: disabled,
|
|
989
|
-
$position: 'start'
|
|
990
|
-
};
|
|
991
|
-
|
|
992
|
-
if (startAdornment) {
|
|
993
|
-
return /*#__PURE__*/external_react_default.a.createElement(StyledAdornment, adornmentProps, startAdornment);
|
|
994
|
-
}
|
|
995
|
-
|
|
996
|
-
if (isPrisma && appearance === 'search') {
|
|
997
|
-
return /*#__PURE__*/external_react_default.a.createElement(StyledAdornment, adornmentProps, /*#__PURE__*/external_react_default.a.createElement(StyledSearchIconWrapper, {
|
|
998
|
-
$disabled: disabled
|
|
999
|
-
}, /*#__PURE__*/external_react_default.a.createElement(Magnifier_default.a, {
|
|
1000
|
-
"aria-label": "Search",
|
|
1001
|
-
height: prismaSize,
|
|
1002
|
-
width: prismaSize
|
|
1003
|
-
})));
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
|
-
return undefined;
|
|
1007
|
-
});
|
|
1008
|
-
|
|
1009
|
-
_defineProperty(_assertThisInitialized(_this), "getDisplayValue", function () {
|
|
1010
|
-
var displayValue = _this.isControlled() ? _this.props.value : _this.state.value;
|
|
1011
|
-
return displayValue;
|
|
1012
|
-
});
|
|
1013
|
-
|
|
1014
|
-
_this.controlledExternally = has_default()(props, 'value');
|
|
1015
|
-
_this.state = {
|
|
1016
|
-
value: props.defaultValue || ''
|
|
1017
|
-
};
|
|
1018
|
-
|
|
1019
|
-
if (false) {}
|
|
1020
|
-
|
|
1021
|
-
if (false) {}
|
|
1022
|
-
|
|
1023
|
-
if (false) {}
|
|
1024
|
-
|
|
1025
|
-
TextArea.validateRows(props);
|
|
1026
|
-
_this.handleResize = throttle_default()(_this.handleResize, 100);
|
|
1027
|
-
return _this;
|
|
1028
|
-
}
|
|
1029
|
-
|
|
1030
|
-
_createClass(TextArea, [{
|
|
1031
|
-
key: "componentDidMount",
|
|
1032
|
-
value: function componentDidMount() {
|
|
1033
|
-
defer_default()(this.syncHeightWithShadow); // wait for styles to load
|
|
1034
|
-
|
|
1035
|
-
this.getAdornmentWidth();
|
|
628
|
+
if (t) be(e, t);
|
|
1036
629
|
}
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
this.syncHeightWithShadow();
|
|
1045
|
-
TextArea.validateRows(this.props);
|
|
1046
|
-
this.getAdornmentWidth();
|
|
630
|
+
function be(e, t) {
|
|
631
|
+
be = Object.setPrototypeOf || function e(t, r) {
|
|
632
|
+
t.__proto__ = r;
|
|
633
|
+
return t;
|
|
634
|
+
};
|
|
635
|
+
return be(e, t);
|
|
1047
636
|
}
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
637
|
+
function ye(e) {
|
|
638
|
+
var t = we();
|
|
639
|
+
return function r() {
|
|
640
|
+
var n = Ce(e), a;
|
|
641
|
+
if (t) {
|
|
642
|
+
var i = Ce(this).constructor;
|
|
643
|
+
a = Reflect.construct(n, arguments, i);
|
|
644
|
+
} else {
|
|
645
|
+
a = n.apply(this, arguments);
|
|
646
|
+
}
|
|
647
|
+
return ge(this, a);
|
|
648
|
+
};
|
|
1052
649
|
}
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
(_this$input = this.input) === null || _this$input === void 0 ? void 0 : _this$input.blur();
|
|
650
|
+
function ge(e, t) {
|
|
651
|
+
if (t && (te(t) === "object" || typeof t === "function")) {
|
|
652
|
+
return t;
|
|
653
|
+
}
|
|
654
|
+
return xe(e);
|
|
1059
655
|
}
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
key: "focus",
|
|
1066
|
-
value: function focus() {
|
|
1067
|
-
var _this$input2;
|
|
1068
|
-
|
|
1069
|
-
(_this$input2 = this.input) === null || _this$input2 === void 0 ? void 0 : _this$input2.focus();
|
|
656
|
+
function xe(e) {
|
|
657
|
+
if (e === void 0) {
|
|
658
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
659
|
+
}
|
|
660
|
+
return e;
|
|
1070
661
|
}
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
662
|
+
function we() {
|
|
663
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
664
|
+
if (Reflect.construct.sham) return false;
|
|
665
|
+
if (typeof Proxy === "function") return true;
|
|
666
|
+
try {
|
|
667
|
+
Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
|
|
668
|
+
return true;
|
|
669
|
+
} catch (e) {
|
|
670
|
+
return false;
|
|
671
|
+
}
|
|
1077
672
|
}
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
elementRef = _this$props10.elementRef,
|
|
1095
|
-
error = _this$props10.error,
|
|
1096
|
-
inline = _this$props10.inline,
|
|
1097
|
-
inputClassName = _this$props10.inputClassName,
|
|
1098
|
-
inputId = _this$props10.inputId,
|
|
1099
|
-
labelledBy = _this$props10.labelledBy,
|
|
1100
|
-
maxLength = _this$props10.maxLength,
|
|
1101
|
-
name = _this$props10.name,
|
|
1102
|
-
placeholder = _this$props10.placeholder,
|
|
1103
|
-
prepend = _this$props10.prepend,
|
|
1104
|
-
required = _this$props10.required,
|
|
1105
|
-
spellCheck = _this$props10.spellCheck,
|
|
1106
|
-
tabIndex = _this$props10.tabIndex,
|
|
1107
|
-
title = _this$props10.title,
|
|
1108
|
-
otherProps = _objectWithoutProperties(_this$props10, ["append", "autoCapitalize", "autoComplete", "autoCorrect", "autoFocus", "children", "className", "classNamePrivate", "disabled", "describedBy", "elementRef", "error", "inline", "inputClassName", "inputId", "labelledBy", "maxLength", "name", "placeholder", "prepend", "required", "spellCheck", "tabIndex", "title"]);
|
|
1109
|
-
|
|
1110
|
-
var ariaProps = _objectSpread(_objectSpread({}, pickBy_default()(otherProps, function (val, key) {
|
|
1111
|
-
return key === 'role' || key.indexOf('aria-') === 0;
|
|
1112
|
-
})), {}, {
|
|
1113
|
-
'aria-describedby': describedBy,
|
|
1114
|
-
'aria-labelledby': labelledBy,
|
|
1115
|
-
'aria-invalid': error || undefined,
|
|
1116
|
-
'aria-multiline': true
|
|
1117
|
-
});
|
|
1118
|
-
|
|
1119
|
-
var boxProps = omit_default()(otherProps, ['inputRef', 'onBlur', 'onChange', 'onFocus', 'onKeyDown', 'onSelect', 'onInputClick', 'rowsMax', 'rowsMin'].concat(_toConsumableArray(keys_default()(ariaProps))));
|
|
1120
|
-
var displayValue = this.getDisplayValue();
|
|
1121
|
-
var displayProps = {
|
|
1122
|
-
className: Object(style_["toClassName"])(className, inputClassName),
|
|
1123
|
-
$append: append || undefined,
|
|
1124
|
-
$error: error,
|
|
1125
|
-
$prepend: prepend || undefined
|
|
1126
|
-
};
|
|
1127
|
-
|
|
1128
|
-
var inputProps = _objectSpread(_objectSpread({}, ariaProps), {}, {
|
|
1129
|
-
'data-test': 'textbox',
|
|
1130
|
-
autoCapitalize: autoCapitalize,
|
|
1131
|
-
autoComplete: autoComplete,
|
|
1132
|
-
autoCorrect: autoCorrect,
|
|
1133
|
-
autoFocus: autoFocus,
|
|
1134
|
-
id: inputId,
|
|
1135
|
-
maxLength: maxLength,
|
|
1136
|
-
placeholder: placeholder,
|
|
1137
|
-
name: name,
|
|
1138
|
-
onChange: this.handleInputChange,
|
|
1139
|
-
onKeyDown: this.handleInputKeyDown,
|
|
1140
|
-
onSelect: this.handleInputSelect,
|
|
1141
|
-
onClick: this.handleInputClick,
|
|
1142
|
-
onFocus: this.handleInputFocus,
|
|
1143
|
-
onBlur: this.handleInputBlur,
|
|
1144
|
-
ref: this.handleInputMount,
|
|
1145
|
-
role: 'textbox',
|
|
1146
|
-
required: required,
|
|
1147
|
-
spellCheck: spellCheck,
|
|
1148
|
-
style: {
|
|
1149
|
-
height: this.state.height
|
|
1150
|
-
},
|
|
1151
|
-
title: title,
|
|
1152
|
-
tabIndex: tabIndex,
|
|
1153
|
-
value: displayValue,
|
|
1154
|
-
$error: error
|
|
1155
|
-
});
|
|
1156
|
-
|
|
1157
|
-
var hasEndAdornment = !!this.renderEndAdornment();
|
|
1158
|
-
var hasStartAdornment = !!this.renderStartAdornment();
|
|
1159
|
-
return /*#__PURE__*/external_react_default.a.createElement(StyledBox, _extends({
|
|
1160
|
-
tabIndex: -1,
|
|
1161
|
-
className: Object(style_["toClassName"])(className, classNamePrivate),
|
|
1162
|
-
"data-test": "text",
|
|
1163
|
-
"data-test-value": displayValue,
|
|
1164
|
-
elementRef: elementRef,
|
|
1165
|
-
flex: true,
|
|
1166
|
-
inline: inline
|
|
1167
|
-
}, boxProps), this.renderStartAdornment(), /*#__PURE__*/external_react_default.a.createElement(StyledTextAreaWrapper, _extends({
|
|
1168
|
-
$hasEndAdornment: hasEndAdornment,
|
|
1169
|
-
$hasStartAdornment: hasStartAdornment,
|
|
1170
|
-
disabled: disabled
|
|
1171
|
-
}, displayProps), hasStartAdornment && /*#__PURE__*/external_react_default.a.createElement(StyledStartAdornmentHolder, {
|
|
1172
|
-
$width: this.state.startAdornmentWidth
|
|
1173
|
-
}), /*#__PURE__*/external_react_default.a.createElement(StyledTextArea, {
|
|
1174
|
-
"aria-hidden": "true",
|
|
1175
|
-
onChange: noop_default.a,
|
|
1176
|
-
onClick: this.handleInputClick,
|
|
1177
|
-
style: {
|
|
1178
|
-
width: '100%',
|
|
1179
|
-
position: 'absolute',
|
|
1180
|
-
overflow: 'hidden',
|
|
1181
|
-
left: -10000,
|
|
1182
|
-
top: -10000
|
|
1183
|
-
},
|
|
1184
|
-
tabIndex: -1,
|
|
1185
|
-
ref: function ref(el) {
|
|
1186
|
-
_this2.shadow = el;
|
|
1187
|
-
},
|
|
1188
|
-
value: displayValue
|
|
1189
|
-
}), disabled ? /*#__PURE__*/external_react_default.a.createElement(StyledTextArea, _extends({
|
|
1190
|
-
as: "textarea",
|
|
1191
|
-
className: Object(style_["toClassName"])(className, classNamePrivate),
|
|
1192
|
-
"data-multiline": "true",
|
|
1193
|
-
"data-test": "text",
|
|
1194
|
-
disabled: true,
|
|
1195
|
-
readOnly: true,
|
|
1196
|
-
style: {
|
|
1197
|
-
height: this.state.height
|
|
1198
|
-
},
|
|
1199
|
-
value: displayValue,
|
|
1200
|
-
placeholder: placeholder,
|
|
1201
|
-
ref: function ref(el) {
|
|
1202
|
-
_this2.shadow = el;
|
|
673
|
+
function Ce(e) {
|
|
674
|
+
Ce = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
|
|
675
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
676
|
+
};
|
|
677
|
+
return Ce(e);
|
|
678
|
+
}
|
|
679
|
+
function ke(e, t, r) {
|
|
680
|
+
if (t in e) {
|
|
681
|
+
Object.defineProperty(e, t, {
|
|
682
|
+
value: r,
|
|
683
|
+
enumerable: true,
|
|
684
|
+
configurable: true,
|
|
685
|
+
writable: true
|
|
686
|
+
});
|
|
687
|
+
} else {
|
|
688
|
+
e[t] = r;
|
|
1203
689
|
}
|
|
1204
|
-
|
|
1205
|
-
as: "textarea"
|
|
1206
|
-
}, inputProps, {
|
|
1207
|
-
onClick: this.handleInputClick
|
|
1208
|
-
})), /*#__PURE__*/external_react_default.a.createElement(EventListener_default.a, {
|
|
1209
|
-
target: window,
|
|
1210
|
-
eventType: "resize",
|
|
1211
|
-
listener: this.handleResize
|
|
1212
|
-
}), children, hasEndAdornment && /*#__PURE__*/external_react_default.a.createElement(StyledEndAdornmentHolder, {
|
|
1213
|
-
$width: this.state.endAdornmentWidth
|
|
1214
|
-
})), this.renderEndAdornment());
|
|
690
|
+
return e;
|
|
1215
691
|
}
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
692
|
+
/** @public */ var Se = {
|
|
693
|
+
appearance: i().oneOf([ "default", "search" ]),
|
|
694
|
+
append: i().bool,
|
|
695
|
+
autoCapitalize: i().string,
|
|
696
|
+
autoComplete: i().string,
|
|
697
|
+
autoCorrect: i().string,
|
|
698
|
+
autoFocus: i().bool,
|
|
699
|
+
canClear: i().bool,
|
|
700
|
+
children: i().node,
|
|
701
|
+
/** @private. */
|
|
702
|
+
classNamePrivate: i().string,
|
|
703
|
+
defaultValue: i().string,
|
|
704
|
+
describedBy: i().string,
|
|
705
|
+
disabled: i().bool,
|
|
706
|
+
elementRef: i().oneOfType([ i().func, i().object ]),
|
|
707
|
+
endAdornment: i().node,
|
|
708
|
+
error: i().bool,
|
|
709
|
+
inline: i().bool,
|
|
710
|
+
/** @private. */
|
|
711
|
+
inputClassName: i().string,
|
|
712
|
+
inputId: i().string,
|
|
713
|
+
inputRef: i().oneOfType([ i().func, i().object ]),
|
|
714
|
+
labelledBy: i().string,
|
|
715
|
+
maxLength: i().number,
|
|
716
|
+
name: i().string,
|
|
717
|
+
onBlur: i().func,
|
|
718
|
+
onChange: i().func,
|
|
719
|
+
onFocus: i().func,
|
|
720
|
+
onKeyDown: i().func,
|
|
721
|
+
onSelect: i().func,
|
|
722
|
+
onInputClick: i().func,
|
|
723
|
+
placeholder: i().string,
|
|
724
|
+
prepend: i().bool,
|
|
725
|
+
/** @private. */
|
|
726
|
+
required: i().bool,
|
|
727
|
+
rowsMax: i().number,
|
|
728
|
+
rowsMin: i().number,
|
|
729
|
+
spellCheck: i().bool,
|
|
730
|
+
tabIndex: i().number,
|
|
731
|
+
startAdornment: i().node,
|
|
732
|
+
/** @private */
|
|
733
|
+
splunkTheme: i().object,
|
|
734
|
+
value: i().string
|
|
735
|
+
};
|
|
736
|
+
var Ae = {
|
|
737
|
+
appearance: "default",
|
|
738
|
+
append: false,
|
|
739
|
+
autoFocus: false,
|
|
740
|
+
canClear: false,
|
|
741
|
+
disabled: false,
|
|
742
|
+
error: false,
|
|
743
|
+
inline: false,
|
|
744
|
+
placeholder: "",
|
|
745
|
+
prepend: false,
|
|
746
|
+
rowsMax: 8,
|
|
747
|
+
rowsMin: 2,
|
|
748
|
+
tabIndex: 0
|
|
749
|
+
};
|
|
750
|
+
/** Note: TextArea places role and aria props onto the input. All other props are placed on the wrapper. */ var Oe = function(e) {
|
|
751
|
+
ve(r, e);
|
|
752
|
+
var t = ye(r);
|
|
753
|
+
me(r, null, [ {
|
|
754
|
+
key: "validateRows",
|
|
755
|
+
// @docs-props-type TextAreaPropsBase
|
|
756
|
+
value: function e(t) {
|
|
757
|
+
var r = t.rowsMin, n = t.rowsMax;
|
|
758
|
+
if (false) {}
|
|
759
|
+
}
|
|
760
|
+
} ]);
|
|
761
|
+
function r(e) {
|
|
762
|
+
var a;
|
|
763
|
+
fe(this, r);
|
|
764
|
+
a = t.call(this, e);
|
|
765
|
+
ke(xe(a), "controlledExternally", void 0);
|
|
766
|
+
ke(xe(a), "input", null);
|
|
767
|
+
ke(xe(a), "shadow", null);
|
|
768
|
+
ke(xe(a), "startAdornment", null);
|
|
769
|
+
ke(xe(a), "endAdornment", null);
|
|
770
|
+
ke(xe(a), "getAdornmentWidth", (function() {
|
|
771
|
+
var e = a.startAdornment ? a.startAdornment.getBoundingClientRect() : undefined;
|
|
772
|
+
var t = e && Math.round(e.width);
|
|
773
|
+
if (a.state.startAdornmentWidth !== t) {
|
|
774
|
+
a.setState({
|
|
775
|
+
startAdornmentWidth: t
|
|
776
|
+
});
|
|
777
|
+
}
|
|
778
|
+
var r = a.endAdornment ? a.endAdornment.getBoundingClientRect() : undefined;
|
|
779
|
+
var n = r && Math.round(r.width);
|
|
780
|
+
if (a.state.endAdornmentWidth !== n) {
|
|
781
|
+
a.setState({
|
|
782
|
+
endAdornmentWidth: n
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
}));
|
|
786
|
+
ke(xe(a), "handleResize", (function() {
|
|
787
|
+
a.syncHeightWithShadow();
|
|
788
|
+
}));
|
|
789
|
+
ke(xe(a), "handleInputMount", (function(e) {
|
|
790
|
+
a.input = e;
|
|
791
|
+
ee(a.props.inputRef, e);
|
|
792
|
+
}));
|
|
793
|
+
ke(xe(a), "handleInputChange", (function(e) {
|
|
794
|
+
var t, r;
|
|
795
|
+
var n = e.target.value;
|
|
796
|
+
var i = a.props.name;
|
|
797
|
+
if (!a.isControlled()) {
|
|
798
|
+
a.setState({
|
|
799
|
+
value: n
|
|
800
|
+
});
|
|
801
|
+
}
|
|
802
|
+
(t = (r = a.props).onChange) === null || t === void 0 ? void 0 : t.call(r, e, {
|
|
803
|
+
value: n,
|
|
804
|
+
name: i
|
|
805
|
+
});
|
|
806
|
+
}));
|
|
807
|
+
ke(xe(a), "handleInputKeyDown", (function(e) {
|
|
808
|
+
var t, r;
|
|
809
|
+
(t = (r = a.props).onKeyDown) === null || t === void 0 ? void 0 : t.call(r, e);
|
|
810
|
+
}));
|
|
811
|
+
ke(xe(a), "handleInputSelect", (function(e) {
|
|
812
|
+
var t, r;
|
|
813
|
+
(t = (r = a.props).onSelect) === null || t === void 0 ? void 0 : t.call(r, e);
|
|
814
|
+
}));
|
|
815
|
+
ke(xe(a), "handleInputClick", (function(e) {
|
|
816
|
+
var t, r;
|
|
817
|
+
(t = (r = a.props).onInputClick) === null || t === void 0 ? void 0 : t.call(r, e);
|
|
818
|
+
}));
|
|
819
|
+
ke(xe(a), "handleInputFocus", (function(e) {
|
|
820
|
+
var t, r;
|
|
821
|
+
(t = (r = a.props).onFocus) === null || t === void 0 ? void 0 : t.call(r, e);
|
|
822
|
+
}));
|
|
823
|
+
ke(xe(a), "handleInputBlur", (function(e) {
|
|
824
|
+
var t, r;
|
|
825
|
+
(t = (r = a.props).onBlur) === null || t === void 0 ? void 0 : t.call(r, e);
|
|
826
|
+
}));
|
|
827
|
+
ke(xe(a), "handleClear", (function(e) {
|
|
828
|
+
var t, r;
|
|
829
|
+
e.preventDefault();
|
|
830
|
+
var n = "";
|
|
831
|
+
var i = a.props.name;
|
|
832
|
+
if (!a.isControlled()) {
|
|
833
|
+
a.setState({
|
|
834
|
+
value: n
|
|
835
|
+
});
|
|
836
|
+
}
|
|
837
|
+
a.focus();
|
|
838
|
+
(t = (r = a.props).onChange) === null || t === void 0 ? void 0 : t.call(r, e, {
|
|
839
|
+
value: n,
|
|
840
|
+
name: i
|
|
841
|
+
});
|
|
842
|
+
}));
|
|
843
|
+
ke(xe(a), "syncHeightWithShadow", (function() {
|
|
844
|
+
var e = Z({
|
|
845
|
+
height: a.state.height,
|
|
846
|
+
rowsMax: a.props.rowsMax,
|
|
847
|
+
rowsMin: a.props.rowsMin,
|
|
848
|
+
shadow: a.shadow
|
|
849
|
+
});
|
|
850
|
+
if (e !== false) {
|
|
851
|
+
a.setState({
|
|
852
|
+
height: e
|
|
853
|
+
});
|
|
854
|
+
}
|
|
855
|
+
}));
|
|
856
|
+
ke(xe(a), "renderEndAdornment", (function() {
|
|
857
|
+
var e;
|
|
858
|
+
var t = a.props, r = t.appearance, i = t.endAdornment, o = t.disabled, l = t.canClear, s = t.splunkTheme;
|
|
859
|
+
var c = s.isPrisma, p = s.isEnterprise, d = s.isCompact;
|
|
860
|
+
var u = d ? "20px" : "24px";
|
|
861
|
+
var f = {
|
|
862
|
+
ref: function e(t) {
|
|
863
|
+
a.endAdornment = t;
|
|
864
|
+
},
|
|
865
|
+
disabled: o,
|
|
866
|
+
$position: "end"
|
|
867
|
+
};
|
|
868
|
+
if (i) {
|
|
869
|
+
|
|
870
|
+
return n().createElement(Y, f, i);
|
|
871
|
+
}
|
|
872
|
+
var h = a.context;
|
|
873
|
+
var m = (e = h.labelAttrs) === null || e === void 0 ? void 0 : e.text;
|
|
874
|
+
var v = m ? (0, M._)("Clear ".concat(m, " text field")) : (0, M._)("Clear text field");
|
|
875
|
+
if (!c && r === "search") {
|
|
876
|
+
|
|
877
|
+
return n().createElement(Y, f, n().createElement(F, {
|
|
878
|
+
appearance: "pill",
|
|
879
|
+
"data-test": "clear",
|
|
880
|
+
inline: false,
|
|
881
|
+
icon: n().createElement(S(), {
|
|
882
|
+
size: 1,
|
|
883
|
+
screenReaderText: v
|
|
884
|
+
}),
|
|
885
|
+
onClick: a.handleClear
|
|
886
|
+
}), n().createElement(H, {
|
|
887
|
+
$disabled: o
|
|
888
|
+
}, p ? n().createElement(O(), {
|
|
889
|
+
hideDefaultTooltip: true,
|
|
890
|
+
inline: false,
|
|
891
|
+
screenReaderText: null,
|
|
892
|
+
size: "16px"
|
|
893
|
+
}) : n().createElement(P(), {
|
|
894
|
+
height: u,
|
|
895
|
+
width: u
|
|
896
|
+
})));
|
|
897
|
+
}
|
|
898
|
+
var b = a.getDisplayValue();
|
|
899
|
+
if (!!b && (c && r === "search" || l)) {
|
|
900
|
+
|
|
901
|
+
return n().createElement(Y, f, !o && n().createElement(F, {
|
|
902
|
+
"data-test": "clear",
|
|
903
|
+
appearance: "secondary",
|
|
904
|
+
onClick: a.handleClear,
|
|
905
|
+
icon: n().createElement(C(), {
|
|
906
|
+
"aria-label": v,
|
|
907
|
+
inline: false,
|
|
908
|
+
width: u,
|
|
909
|
+
height: u
|
|
910
|
+
})
|
|
911
|
+
}));
|
|
912
|
+
}
|
|
913
|
+
return undefined;
|
|
914
|
+
}));
|
|
915
|
+
ke(xe(a), "renderStartAdornment", (function() {
|
|
916
|
+
var e = a.props, t = e.appearance, r = e.startAdornment, i = e.splunkTheme, o = e.disabled;
|
|
917
|
+
var l = i.isPrisma, s = i.isCompact;
|
|
918
|
+
var c = s ? "20px" : "24px";
|
|
919
|
+
var p = {
|
|
920
|
+
ref: function e(t) {
|
|
921
|
+
a.startAdornment = t;
|
|
922
|
+
},
|
|
923
|
+
disabled: o,
|
|
924
|
+
$position: "start"
|
|
925
|
+
};
|
|
926
|
+
if (r) {
|
|
927
|
+
|
|
928
|
+
return n().createElement(Y, p, r);
|
|
929
|
+
}
|
|
930
|
+
if (l && t === "search") {
|
|
931
|
+
|
|
932
|
+
return n().createElement(Y, p, n().createElement(H, {
|
|
933
|
+
$disabled: o
|
|
934
|
+
}, n().createElement(P(), {
|
|
935
|
+
"aria-label": "Search",
|
|
936
|
+
height: c,
|
|
937
|
+
width: c
|
|
938
|
+
})));
|
|
939
|
+
}
|
|
940
|
+
return undefined;
|
|
941
|
+
}));
|
|
942
|
+
ke(xe(a), "getDisplayValue", (function() {
|
|
943
|
+
var e = a.isControlled() ? a.props.value : a.state.value;
|
|
944
|
+
return e;
|
|
945
|
+
}));
|
|
946
|
+
a.controlledExternally = c()(e, "value");
|
|
947
|
+
a.state = {
|
|
948
|
+
value: e.defaultValue || ""
|
|
949
|
+
};
|
|
950
|
+
if (false) {}
|
|
951
|
+
if (false) {}
|
|
952
|
+
if (false) {}
|
|
953
|
+
r.validateRows(e);
|
|
954
|
+
a.handleResize = g()(a.handleResize, 100);
|
|
955
|
+
return a;
|
|
956
|
+
}
|
|
957
|
+
me(r, [ {
|
|
958
|
+
key: "componentDidMount",
|
|
959
|
+
value: function e() {
|
|
960
|
+
l()(this.syncHeightWithShadow);
|
|
961
|
+
// wait for styles to load
|
|
962
|
+
this.getAdornmentWidth();
|
|
963
|
+
}
|
|
964
|
+
}, {
|
|
965
|
+
key: "componentDidUpdate",
|
|
966
|
+
value: function e(t) {
|
|
967
|
+
if (false) {}
|
|
968
|
+
if (false) {}
|
|
969
|
+
this.syncHeightWithShadow();
|
|
970
|
+
r.validateRows(this.props);
|
|
971
|
+
this.getAdornmentWidth();
|
|
972
|
+
}
|
|
973
|
+
}, {
|
|
974
|
+
key: "isControlled",
|
|
975
|
+
value: function e() {
|
|
976
|
+
return this.controlledExternally;
|
|
977
|
+
}
|
|
978
|
+
}, {
|
|
979
|
+
key: "blur",
|
|
980
|
+
value: function e() {
|
|
981
|
+
var t;
|
|
982
|
+
(t = this.input) === null || t === void 0 ? void 0 : t.blur();
|
|
983
|
+
}
|
|
984
|
+
/**
|
|
985
|
+
* Place focus on the input.
|
|
986
|
+
*/ }, {
|
|
987
|
+
key: "focus",
|
|
988
|
+
value: function e() {
|
|
989
|
+
var t;
|
|
990
|
+
(t = this.input) === null || t === void 0 ? void 0 : t.focus();
|
|
991
|
+
}
|
|
992
|
+
}, {
|
|
993
|
+
key: "select",
|
|
994
|
+
value: function e() {
|
|
995
|
+
var t;
|
|
996
|
+
(t = this.input) === null || t === void 0 ? void 0 : t.select();
|
|
997
|
+
}
|
|
998
|
+
}, {
|
|
999
|
+
key: "render",
|
|
1000
|
+
value: function e() {
|
|
1001
|
+
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, v = 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
|
+
var D = pe(pe({}, b()($, (function(e, t) {
|
|
1004
|
+
return t === "role" || t.indexOf("aria-") === 0;
|
|
1005
|
+
}))), {}, {
|
|
1006
|
+
"aria-describedby": v,
|
|
1007
|
+
"aria-labelledby": k,
|
|
1008
|
+
"aria-invalid": g || undefined,
|
|
1009
|
+
"aria-multiline": true
|
|
1010
|
+
});
|
|
1011
|
+
var N = m()($, [ "inputRef", "onBlur", "onChange", "onFocus", "onKeyDown", "onSelect", "onInputClick", "rowsMax", "rowsMin" ].concat(ne(d()(D))));
|
|
1012
|
+
var R = this.getDisplayValue();
|
|
1013
|
+
var q = {
|
|
1014
|
+
className: (0, T.toClassName)(p, w),
|
|
1015
|
+
$append: a || undefined,
|
|
1016
|
+
$error: g,
|
|
1017
|
+
$prepend: I || undefined
|
|
1018
|
+
};
|
|
1019
|
+
var B = pe(pe({}, D), {}, {
|
|
1020
|
+
"data-test": "textbox",
|
|
1021
|
+
autoCapitalize: i,
|
|
1022
|
+
autoComplete: o,
|
|
1023
|
+
autoCorrect: l,
|
|
1024
|
+
autoFocus: s,
|
|
1025
|
+
id: C,
|
|
1026
|
+
maxLength: S,
|
|
1027
|
+
placeholder: O,
|
|
1028
|
+
name: A,
|
|
1029
|
+
onChange: this.handleInputChange,
|
|
1030
|
+
onKeyDown: this.handleInputKeyDown,
|
|
1031
|
+
onSelect: this.handleInputSelect,
|
|
1032
|
+
onClick: this.handleInputClick,
|
|
1033
|
+
onFocus: this.handleInputFocus,
|
|
1034
|
+
onBlur: this.handleInputBlur,
|
|
1035
|
+
ref: this.handleInputMount,
|
|
1036
|
+
role: "textbox",
|
|
1037
|
+
required: j,
|
|
1038
|
+
spellCheck: P,
|
|
1039
|
+
style: {
|
|
1040
|
+
height: this.state.height
|
|
1041
|
+
},
|
|
1042
|
+
title: M,
|
|
1043
|
+
tabIndex: _,
|
|
1044
|
+
value: R,
|
|
1045
|
+
$error: g
|
|
1046
|
+
});
|
|
1047
|
+
var W = !!this.renderEndAdornment();
|
|
1048
|
+
var z = !!this.renderStartAdornment();
|
|
1049
|
+
|
|
1050
|
+
return n().createElement(V, re({
|
|
1051
|
+
tabIndex: -1,
|
|
1052
|
+
className: (0, T.toClassName)(p, u),
|
|
1053
|
+
"data-test": "text",
|
|
1054
|
+
"data-test-value": R,
|
|
1055
|
+
elementRef: y,
|
|
1056
|
+
flex: true,
|
|
1057
|
+
inline: x
|
|
1058
|
+
}, N), this.renderStartAdornment(), n().createElement(K, re({
|
|
1059
|
+
$hasEndAdornment: W,
|
|
1060
|
+
$hasStartAdornment: z,
|
|
1061
|
+
disabled: h
|
|
1062
|
+
}, q), z && n().createElement(J, {
|
|
1063
|
+
$width: this.state.startAdornmentWidth
|
|
1064
|
+
}), n().createElement(L, {
|
|
1065
|
+
"aria-hidden": "true",
|
|
1066
|
+
onChange: f(),
|
|
1067
|
+
onClick: this.handleInputClick,
|
|
1068
|
+
style: {
|
|
1069
|
+
width: "100%",
|
|
1070
|
+
position: "absolute",
|
|
1071
|
+
overflow: "hidden",
|
|
1072
|
+
left: -1e4,
|
|
1073
|
+
top: -1e4
|
|
1074
|
+
},
|
|
1075
|
+
tabIndex: -1,
|
|
1076
|
+
ref: function e(r) {
|
|
1077
|
+
t.shadow = r;
|
|
1078
|
+
},
|
|
1079
|
+
value: R
|
|
1080
|
+
}), h ? n().createElement(L, re({
|
|
1081
|
+
as: "textarea",
|
|
1082
|
+
className: (0, T.toClassName)(p, u),
|
|
1083
|
+
"data-multiline": "true",
|
|
1084
|
+
"data-test": "text",
|
|
1085
|
+
disabled: true,
|
|
1086
|
+
readOnly: true,
|
|
1087
|
+
style: {
|
|
1088
|
+
height: this.state.height
|
|
1089
|
+
},
|
|
1090
|
+
value: R,
|
|
1091
|
+
placeholder: O,
|
|
1092
|
+
ref: function e(r) {
|
|
1093
|
+
t.shadow = r;
|
|
1094
|
+
}
|
|
1095
|
+
}, D)) : n().createElement(L, re({
|
|
1096
|
+
as: "textarea"
|
|
1097
|
+
}, B, {
|
|
1098
|
+
onClick: this.handleInputClick
|
|
1099
|
+
})), n().createElement(E(), {
|
|
1100
|
+
target: window,
|
|
1101
|
+
eventType: "resize",
|
|
1102
|
+
listener: this.handleResize
|
|
1103
|
+
}), c, W && n().createElement(X, {
|
|
1104
|
+
$width: this.state.endAdornmentWidth
|
|
1105
|
+
})), this.renderEndAdornment());
|
|
1106
|
+
}
|
|
1107
|
+
} ]);
|
|
1108
|
+
return r;
|
|
1109
|
+
}(r.Component);
|
|
1110
|
+
ke(Oe, "propTypes", Se);
|
|
1111
|
+
ke(Oe, "defaultProps", Ae);
|
|
1112
|
+
ke(Oe, "componentType", "TextArea");
|
|
1113
|
+
ke(Oe, "contextType", x.ControlGroupContext);
|
|
1114
|
+
var Ie = (0, _.withSplunkTheme)(Oe);
|
|
1115
|
+
var Ee = Ie;
|
|
1116
|
+
Ee.propTypes = Oe.propTypes;
|
|
1117
|
+
Ee.componentType = Oe.componentType;
|
|
1118
|
+
/* harmony default export */ const je = Ee;
|
|
1119
|
+
// CONCATENATED MODULE: ./src/TextArea/index.ts
|
|
1120
|
+
module.exports = t;
|
|
1121
|
+
/******/})();
|