@splunk/react-ui 4.21.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.
Files changed (83) hide show
  1. package/Accordion.js +425 -325
  2. package/Anchor.js +147 -117
  3. package/Animation.js +142 -94
  4. package/AnimationToggle.js +197 -193
  5. package/Box.js +145 -118
  6. package/Breadcrumbs.js +288 -206
  7. package/Button.js +488 -465
  8. package/ButtonGroup.js +160 -128
  9. package/ButtonSimple.js +543 -462
  10. package/CHANGELOG.md +7 -2
  11. package/Calendar.js +1111 -1001
  12. package/Card.js +771 -598
  13. package/CardLayout.js +205 -147
  14. package/Chip.js +509 -488
  15. package/Clickable.js +414 -352
  16. package/CloseButton.js +165 -142
  17. package/Code.js +1808 -2084
  18. package/Code.js.LICENSE.txt +8 -0
  19. package/CollapsiblePanel.js +586 -519
  20. package/Color.js +1066 -1069
  21. package/ColumnLayout.js +402 -363
  22. package/ComboBox.js +891 -794
  23. package/Concertina.js +997 -802
  24. package/ControlGroup.js +687 -594
  25. package/Date.js +567 -547
  26. package/DefinitionList.js +308 -234
  27. package/Divider.js +149 -118
  28. package/Dropdown.js +459 -416
  29. package/DualListbox.js +1479 -1541
  30. package/EventListener.js +94 -97
  31. package/File.js +1051 -969
  32. package/FormRows.js +883 -696
  33. package/Heading.js +216 -193
  34. package/Image.js +446 -402
  35. package/JSONTree.js +690 -551
  36. package/Layer.js +437 -410
  37. package/Link.js +336 -255
  38. package/List.js +213 -161
  39. package/Markdown.js +509 -487
  40. package/Menu.js +1105 -1056
  41. package/Message.js +475 -441
  42. package/MessageBar.js +387 -373
  43. package/Modal.js +810 -634
  44. package/ModalLayer.js +326 -243
  45. package/Monogram.js +308 -276
  46. package/Multiselect.js +3550 -3364
  47. package/Number.js +729 -687
  48. package/Paginator.js +510 -449
  49. package/Paragraph.js +145 -112
  50. package/Popover.js +1459 -1432
  51. package/Progress.js +301 -246
  52. package/RadioBar.js +610 -527
  53. package/RadioList.js +483 -444
  54. package/Resize.js +530 -489
  55. package/ResultsMenu.js +494 -455
  56. package/ScreenReaderContent.js +142 -111
  57. package/Scroll.js +595 -456
  58. package/ScrollContainerContext.js +197 -206
  59. package/Search.js +744 -650
  60. package/Select.js +2442 -2345
  61. package/SidePanel.js +390 -284
  62. package/Slider.js +669 -676
  63. package/SlidingPanels.js +639 -503
  64. package/SplitButton.js +464 -367
  65. package/StaticContent.js +161 -133
  66. package/StepBar.js +386 -358
  67. package/Switch.js +710 -640
  68. package/TabBar.js +726 -680
  69. package/TabLayout.js +406 -322
  70. package/Table.js +4842 -4616
  71. package/Text.js +1170 -1138
  72. package/TextArea.js +1102 -1090
  73. package/Tooltip.js +624 -581
  74. package/TransitionOpen.js +489 -422
  75. package/Typography.js +176 -153
  76. package/WaitSpinner.js +230 -206
  77. package/package.json +5 -5
  78. package/types/src/JSONTree/JSONTreeContext.d.ts +7 -0
  79. package/types/src/JSONTree/TreeNode.d.ts +5 -0
  80. package/useForceUpdate.js +112 -82
  81. package/useKeyPress.js +74 -71
  82. package/usePrevious.js +65 -65
  83. package/useRovingFocus.js +122 -138
package/TextArea.js CHANGED
@@ -1,1109 +1,1121 @@
1
- /******/ (() => { // webpackBootstrap
2
- /******/ "use strict";
3
- /******/ // The require scope
4
- /******/ var __webpack_require__ = {};
5
- /******/
6
- /************************************************************************/
7
- /******/ /* webpack/runtime/compat get default export */
8
- /******/ (() => {
9
- /******/ // getDefaultExport function for compatibility with non-harmony modules
10
- /******/ __webpack_require__.n = (module) => {
11
- /******/ var getter = module && module.__esModule ?
12
- /******/ () => (module['default']) :
13
- /******/ () => (module);
14
- /******/ __webpack_require__.d(getter, { a: getter });
15
- /******/ return getter;
16
- /******/ };
17
- /******/ })();
18
- /******/
19
- /******/ /* webpack/runtime/define property getters */
20
- /******/ (() => {
21
- /******/ // define getter functions for harmony exports
22
- /******/ __webpack_require__.d = (exports, definition) => {
23
- /******/ for(var key in definition) {
24
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
25
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
26
- /******/ }
27
- /******/ }
28
- /******/ };
29
- /******/ })();
30
- /******/
31
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
32
- /******/ (() => {
33
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
34
- /******/ })();
35
- /******/
36
- /******/ /* webpack/runtime/make namespace object */
37
- /******/ (() => {
38
- /******/ // define __esModule on exports
39
- /******/ __webpack_require__.r = (exports) => {
40
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
41
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
42
- /******/ }
43
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
44
- /******/ };
45
- /******/ })();
46
- /******/
47
- /************************************************************************/
48
- var __webpack_exports__ = {};
49
- // ESM COMPAT FLAG
50
- __webpack_require__.r(__webpack_exports__);
51
-
52
- // EXPORTS
53
- __webpack_require__.d(__webpack_exports__, {
54
- "default": () => (/* reexport */ TextArea_TextArea)
55
- });
56
-
57
- ;// CONCATENATED MODULE: external "react"
58
- const external_react_namespaceObject = require("react");
59
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_namespaceObject);
60
- ;// CONCATENATED MODULE: external "prop-types"
61
- const external_prop_types_namespaceObject = require("prop-types");
62
- var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_namespaceObject);
63
- ;// CONCATENATED MODULE: external "lodash/defer"
64
- const defer_namespaceObject = require("lodash/defer");
65
- var defer_default = /*#__PURE__*/__webpack_require__.n(defer_namespaceObject);
66
- ;// CONCATENATED MODULE: external "lodash/has"
67
- const has_namespaceObject = require("lodash/has");
68
- var has_default = /*#__PURE__*/__webpack_require__.n(has_namespaceObject);
69
- ;// CONCATENATED MODULE: external "lodash/keys"
70
- const keys_namespaceObject = require("lodash/keys");
71
- var keys_default = /*#__PURE__*/__webpack_require__.n(keys_namespaceObject);
72
- ;// CONCATENATED MODULE: external "lodash/noop"
73
- const noop_namespaceObject = require("lodash/noop");
74
- var noop_default = /*#__PURE__*/__webpack_require__.n(noop_namespaceObject);
75
- ;// CONCATENATED MODULE: external "lodash/omit"
76
- const omit_namespaceObject = require("lodash/omit");
77
- var omit_default = /*#__PURE__*/__webpack_require__.n(omit_namespaceObject);
78
- ;// CONCATENATED MODULE: external "lodash/pickBy"
79
- const pickBy_namespaceObject = require("lodash/pickBy");
80
- var pickBy_default = /*#__PURE__*/__webpack_require__.n(pickBy_namespaceObject);
81
- ;// CONCATENATED MODULE: external "lodash/throttle"
82
- const throttle_namespaceObject = require("lodash/throttle");
83
- var throttle_default = /*#__PURE__*/__webpack_require__.n(throttle_namespaceObject);
84
- ;// CONCATENATED MODULE: external "@splunk/react-ui/ControlGroup"
85
- const ControlGroup_namespaceObject = require("@splunk/react-ui/ControlGroup");
86
- ;// CONCATENATED MODULE: external "@splunk/react-icons/Cross"
87
- const Cross_namespaceObject = require("@splunk/react-icons/Cross");
88
- var Cross_default = /*#__PURE__*/__webpack_require__.n(Cross_namespaceObject);
89
- ;// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Close"
90
- const Close_namespaceObject = require("@splunk/react-icons/enterprise/Close");
91
- var Close_default = /*#__PURE__*/__webpack_require__.n(Close_namespaceObject);
92
- ;// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Search"
93
- const Search_namespaceObject = require("@splunk/react-icons/enterprise/Search");
94
- var Search_default = /*#__PURE__*/__webpack_require__.n(Search_namespaceObject);
95
- ;// CONCATENATED MODULE: external "@splunk/react-ui/EventListener"
96
- const EventListener_namespaceObject = require("@splunk/react-ui/EventListener");
97
- var EventListener_default = /*#__PURE__*/__webpack_require__.n(EventListener_namespaceObject);
98
- ;// CONCATENATED MODULE: external "@splunk/react-icons/Magnifier"
99
- const Magnifier_namespaceObject = require("@splunk/react-icons/Magnifier");
100
- var Magnifier_default = /*#__PURE__*/__webpack_require__.n(Magnifier_namespaceObject);
101
- ;// CONCATENATED MODULE: external "@splunk/ui-utils/style"
102
- const style_namespaceObject = require("@splunk/ui-utils/style");
103
- ;// CONCATENATED MODULE: external "@splunk/themes"
104
- const themes_namespaceObject = require("@splunk/themes");
105
- ;// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
106
- const i18n_namespaceObject = require("@splunk/ui-utils/i18n");
107
- ;// CONCATENATED MODULE: external "styled-components"
108
- const external_styled_components_namespaceObject = require("styled-components");
109
- var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_namespaceObject);
110
- ;// CONCATENATED MODULE: external "@splunk/react-ui/Box"
111
- const Box_namespaceObject = require("@splunk/react-ui/Box");
112
- var Box_default = /*#__PURE__*/__webpack_require__.n(Box_namespaceObject);
113
- ;// CONCATENATED MODULE: external "@splunk/react-ui/Button"
114
- const Button_namespaceObject = require("@splunk/react-ui/Button");
115
- var Button_default = /*#__PURE__*/__webpack_require__.n(Button_namespaceObject);
116
- ;// CONCATENATED MODULE: ./src/TextArea/TextAreaStyles.ts
117
-
118
-
119
-
120
-
121
- var disabledStyles = (0,external_styled_components_namespaceObject.css)(["cursor:not-allowed;color:", ";&::placeholder{color:", ";}"], (0,themes_namespaceObject.pick)({
122
- enterprise: themes_namespaceObject.variables.textDisabledColor,
123
- prisma: themes_namespaceObject.variables.contentColorDisabled
124
- }), (0,themes_namespaceObject.pick)({
125
- enterprise: themes_namespaceObject.variables.textDisabledColor,
126
- prisma: themes_namespaceObject.variables.contentColorDisabled
127
- }));
128
- var buttonStyles = (0,external_styled_components_namespaceObject.css)(["border-radius:", ";cursor:pointer;font-size:0.83333em;flex-grow:0;", ";&:not([disabled]){color:", ";}"], (0,themes_namespaceObject.pick)({
129
- enterprise: themes_namespaceObject.variables.borderRadius,
130
- prisma: '50%'
131
- }), (0,themes_namespaceObject.pick)({
132
- enterprise: (0,external_styled_components_namespaceObject.css)(["width:", ";height:", ";"], themes_namespaceObject.variables.inputHeight, themes_namespaceObject.variables.inputHeight),
133
- prisma: {
134
- comfortable: (0,external_styled_components_namespaceObject.css)(["width:26px;min-width:26px;min-height:26px;margin:8px;padding:0;"]),
135
- compact: (0,external_styled_components_namespaceObject.css)(["width:22px;min-width:22px;min-height:22px;margin:8px;padding:0;"])
136
- }
137
- }), (0,themes_namespaceObject.pick)({
138
- enterprise: {
139
- light: themes_namespaceObject.variables.gray60,
140
- dark: themes_namespaceObject.variables.white
141
- },
142
- prisma: themes_namespaceObject.variables.contentColorMuted
143
- }));
144
- var StyledClearButton = external_styled_components_default()((Button_default())).withConfig({
145
- displayName: "TextAreaStyles__StyledClearButton",
146
- componentId: "gfy8yp-0"
147
- })(["display:none;visibility:hidden;", ""], buttonStyles);
148
- var StyledSearchIconWrapper = external_styled_components_default().span.withConfig({
149
- displayName: "TextAreaStyles__StyledSearchIconWrapper",
150
- componentId: "gfy8yp-1"
151
- })(["", ";color:", ";pointer-events:none;padding:", ";", ""], themes_namespaceObject.mixins.reset('inline-block'), (0,themes_namespaceObject.pick)({
152
- enterprise: {
153
- light: themes_namespaceObject.variables.gray60,
154
- dark: themes_namespaceObject.variables.white
155
- },
156
- prisma: themes_namespaceObject.variables.contentColorMuted
157
- }), (0,themes_namespaceObject.pick)({
158
- comfortable: '0 8px',
159
- compact: '0 6px'
160
- }), function (_ref) {
161
- var $disabled = _ref.$disabled;
162
- return $disabled && (0,external_styled_components_namespaceObject.css)(["", ""], (0,themes_namespaceObject.pick)({
163
- enterprise: (0,external_styled_components_namespaceObject.css)(["color:", ";"], themes_namespaceObject.variables.textDisabledColor),
164
- prisma: (0,external_styled_components_namespaceObject.css)(["color:", ";"], themes_namespaceObject.variables.contentColorDisabled)
165
- }));
166
- });
167
- var StyledBox = external_styled_components_default()((Box_default())).withConfig({
168
- displayName: "TextAreaStyles__StyledBox",
169
- componentId: "gfy8yp-2"
170
- })(["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,themes_namespaceObject.pick)({
171
- enterprise: themes_namespaceObject.variables.spacingHalf,
172
- prisma: themes_namespaceObject.variables.spacingSmall
173
- }),
174
- /* sc-sel */
175
- StyledSearchIconWrapper, (0,themes_namespaceObject.pick)({
176
- enterprise: (0,external_styled_components_namespaceObject.css)(["display:none;"])
177
- }),
178
- /* sc-sel */
179
- StyledClearButton);
180
- var StyledTextAreaWrapper = external_styled_components_default().span.withConfig({
181
- displayName: "TextAreaStyles__StyledTextAreaWrapper",
182
- componentId: "gfy8yp-3"
183
- })(["", " 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_namespaceObject.mixins.reset('inline-flex'), themes_namespaceObject.variables.inputHeight, (0,themes_namespaceObject.pick)({
184
- enterprise: {
185
- light: themes_namespaceObject.variables.gray60,
186
- dark: themes_namespaceObject.variables.gray20
187
- },
188
- prisma: themes_namespaceObject.variables.interactiveColorBorder
189
- }), themes_namespaceObject.variables.borderRadius, (0,themes_namespaceObject.pick)({
190
- enterprise: {
191
- light: themes_namespaceObject.variables.white,
192
- dark: themes_namespaceObject.variables.gray22
193
- },
194
- prisma: themes_namespaceObject.variables.transparent
195
- }), (0,themes_namespaceObject.pick)({
196
- enterprise: '0px 0px 0px 10px',
197
- prisma: '0px 12px'
198
- }), function (_ref2) {
199
- var $hasEndAdornment = _ref2.$hasEndAdornment;
200
- return $hasEndAdornment && (0,external_styled_components_namespaceObject.css)(["padding-right:0;"]);
201
- }, function (_ref3) {
202
- var $hasStartAdornment = _ref3.$hasStartAdornment;
203
- return $hasStartAdornment && (0,external_styled_components_namespaceObject.css)(["padding-left:0;"]);
204
- }, (0,themes_namespaceObject.pick)({
205
- enterprise: {
206
- light: themes_namespaceObject.variables.gray60,
207
- dark: themes_namespaceObject.variables.gray20
208
- },
209
- prisma: themes_namespaceObject.variables.interactiveColorBorderHover
210
- }), (0,themes_namespaceObject.pick)({
211
- enterprise: (0,external_styled_components_namespaceObject.css)(["box-shadow:", ";color:", ";"], themes_namespaceObject.variables.focusShadow, themes_namespaceObject.variables.textColor),
212
- prisma: (0,external_styled_components_namespaceObject.css)(["border-color:", ";color:", ";"], themes_namespaceObject.variables.interactiveColorPrimary, themes_namespaceObject.variables.contentColorActive)
213
- }), function (_ref4) {
214
- var $error = _ref4.$error;
215
- return $error && (0,external_styled_components_namespaceObject.css)(["&,&:hover:not([disabled]){border-color:", ";}&:focus-within:not([disabled]){", "}"], (0,themes_namespaceObject.pick)({
216
- enterprise: themes_namespaceObject.variables.errorColor,
217
- prisma: themes_namespaceObject.variables.accentColorNegative
218
- }), (0,themes_namespaceObject.pick)({
219
- enterprise: (0,external_styled_components_namespaceObject.css)(["box-shadow:", ";color:", ";"], themes_namespaceObject.variables.focusShadow, themes_namespaceObject.variables.textColor),
220
- prisma: (0,external_styled_components_namespaceObject.css)(["border-color:", ";color:", ";"], themes_namespaceObject.variables.interactiveColorPrimary, themes_namespaceObject.variables.contentColorActive)
221
- }));
222
- }, function (_ref5) {
223
- var $append = _ref5.$append;
224
- return $append && (0,external_styled_components_namespaceObject.css)(["margin-right:-1px;border-top-right-radius:0;border-bottom-right-radius:0;border-right:none;"]);
225
- }, function (_ref6) {
226
- var $prepend = _ref6.$prepend;
227
- return $prepend && (0,external_styled_components_namespaceObject.css)(["border-top-left-radius:0;border-bottom-left-radius:0;"]);
228
- }, function (_ref7) {
229
- var disabled = _ref7.disabled;
230
- return disabled && (0,external_styled_components_namespaceObject.css)(["", " box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);"], (0,themes_namespaceObject.pick)({
231
- enterprise: {
232
- light: (0,external_styled_components_namespaceObject.css)(["background-color:", ";border-color:", ";"], themes_namespaceObject.variables.gray96, themes_namespaceObject.variables.gray92),
233
- dark: (0,external_styled_components_namespaceObject.css)(["background-color:", ";border-color:", ";"], themes_namespaceObject.variables.gray22, themes_namespaceObject.variables.gray30)
234
- },
235
- prisma: (0,external_styled_components_namespaceObject.css)(["border-color:", ";"], themes_namespaceObject.variables.interactiveColorBorderDisabled)
236
- }));
237
- });
238
- var StyledTextArea = external_styled_components_default().textarea.withConfig({
239
- displayName: "TextAreaStyles__StyledTextArea",
240
- componentId: "gfy8yp-4"
241
- })(["", ";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_namespaceObject.mixins.reset('inline-flex'), (0,themes_namespaceObject.pick)({
242
- enterprise: themes_namespaceObject.variables.textColor,
243
- prisma: themes_namespaceObject.variables.contentColorActive
244
- }), themes_namespaceObject.variables.sansFontFamily, (0,themes_namespaceObject.pick)({
245
- enterprise: {
246
- comfortable: themes_namespaceObject.variables.spacingQuarter,
247
- compact: '3px'
248
- },
249
- prisma: {
250
- comfortable: themes_namespaceObject.variables.spacingSmall,
251
- compact: '5px'
252
- }
253
- }), (0,themes_namespaceObject.pick)({
254
- enterprise: {
255
- comfortable: themes_namespaceObject.variables.spacingQuarter,
256
- compact: '3px'
257
- },
258
- prisma: {
259
- comfortable: themes_namespaceObject.variables.spacingSmall,
260
- compact: '5px'
261
- }
262
- }), (0,themes_namespaceObject.pick)({
263
- enterprise: '10px',
264
- prisma: '14px'
265
- }), themes_namespaceObject.variables.contentColorMuted, function (_ref8) {
266
- var $error = _ref8.$error;
267
- return $error && (0,external_styled_components_namespaceObject.css)(["&,&:hover{color:", ";}"], (0,themes_namespaceObject.pick)({
268
- enterprise: {
269
- light: themes_namespaceObject.variables.errorColorD10,
270
- dark: themes_namespaceObject.variables.errorColorL20
271
- },
272
- prisma: themes_namespaceObject.variables.contentColorActive
273
- }));
274
- }, function (_ref9) {
275
- var disabled = _ref9.disabled;
276
- return disabled && disabledStyles;
277
- });
278
- var StyledVisibilityToggle = external_styled_components_default()((Button_default())).withConfig({
279
- displayName: "TextAreaStyles__StyledVisibilityToggle",
280
- componentId: "gfy8yp-5"
281
- })(["", ""], buttonStyles);
282
- var StyledPlaceholder = external_styled_components_default().span.withConfig({
283
- displayName: "TextAreaStyles__StyledPlaceholder",
284
- componentId: "gfy8yp-6"
285
- })(["pointer-events:none;color:", ";position:absolute;overflow:hidden;font-size:inherit;line-height:inherit;height:", ";margin-right:", ";", ";", ";", ""], (0,themes_namespaceObject.pick)({
286
- enterprise: themes_namespaceObject.variables.textGray,
287
- prisma: themes_namespaceObject.variables.contentColorMuted
288
- }), themes_namespaceObject.variables.lineHeight, (0,themes_namespaceObject.pick)({
289
- enterprise: '10px',
290
- prisma: '14px'
291
- }), function (_ref10) {
292
- var $hasStartAdornment = _ref10.$hasStartAdornment,
293
- $startAdornmentWidth = _ref10.$startAdornmentWidth;
294
- return $hasStartAdornment && ($startAdornmentWidth ? (0,external_styled_components_namespaceObject.css)(["margin-left:", "px;"], $startAdornmentWidth) : (0,external_styled_components_namespaceObject.css)(["margin-left:", ";"], (0,themes_namespaceObject.pick)({
295
- enterprise: {
296
- comfortable: '30px',
297
- compact: '26px'
298
- },
299
- prisma: {
300
- comfortable: '38px',
301
- compact: '30px'
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;
302
468
  }
303
- })));
304
- }, function (_ref11) {
305
- var $hasEndAdornment = _ref11.$hasEndAdornment,
306
- $endAdornmentWidth = _ref11.$endAdornmentWidth;
307
- return $hasEndAdornment && ($endAdornmentWidth // calc(100% - padding - adorment width)
308
- ? (0,external_styled_components_namespaceObject.css)(["max-width:calc( 100% - ", " - ", "px );"], (0,themes_namespaceObject.pick)({
309
- enterprise: '10px',
310
- prisma: '14px'
311
- }), $endAdornmentWidth) : (0,external_styled_components_namespaceObject.css)(["max-width:calc( 100% - ", " - ", " );"], (0,themes_namespaceObject.pick)({
312
- enterprise: '10px',
313
- prisma: '14px'
314
- }), (0,themes_namespaceObject.pick)({
315
- enterprise: {
316
- comfortable: '30px',
317
- compact: '26px'
318
- },
319
- prisma: {
320
- comfortable: '38px',
321
- compact: '30px'
469
+ // CONCATENATED MODULE: ./src/utils/updateReactRef.ts
470
+ /**
471
+ * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
472
+ *
473
+ * @param ref - The React callback or object ref. Can be `null` or `undefined`.
474
+ * @param current - The new value of the ref.
475
+ */
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
+ }
322
487
  }
323
- })));
324
- }, function (_ref12) {
325
- var $hasBothAdornment = _ref12.$hasBothAdornment,
326
- $endAdornmentWidth = _ref12.$endAdornmentWidth,
327
- $startAdornmentWidth = _ref12.$startAdornmentWidth;
328
- return $hasBothAdornment && (0,external_styled_components_namespaceObject.css)(["max-width:calc(100% - ", "px - ", "px);"], $startAdornmentWidth, $endAdornmentWidth);
329
- });
330
- var adornmentHolder = (0,external_styled_components_namespaceObject.css)(["display:inline-flex;align-items:center;justify-content:center;height:", ";pointer-events:none;"], (0,themes_namespaceObject.pick)({
331
- enterprise: {
332
- comfortable: '30px',
333
- compact: '26px'
334
- },
335
- prisma: {
336
- comfortable: '38px',
337
- compact: '30px'
338
- }
339
- }));
340
- var StyledStartAdornmentHolder = external_styled_components_default().div.withConfig({
341
- displayName: "TextAreaStyles__StyledStartAdornmentHolder",
342
- componentId: "gfy8yp-7"
343
- })(["", " ", ";"], adornmentHolder, function (_ref13) {
344
- var $width = _ref13.$width;
345
- return $width ? (0,external_styled_components_namespaceObject.css)(["min-width:", "px;"], $width) : (0,external_styled_components_namespaceObject.css)(["min-width:", ";"], (0,themes_namespaceObject.pick)({
346
- enterprise: {
347
- comfortable: '30px',
348
- compact: '26px'
349
- },
350
- prisma: {
351
- comfortable: '38px',
352
- 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);
353
501
  }
354
- }));
355
- });
356
- var StyledEndAdornmentHolder = external_styled_components_default().div.withConfig({
357
- displayName: "TextAreaStyles__StyledEndAdornmentHolder",
358
- componentId: "gfy8yp-8"
359
- })(["", " ", ";"], adornmentHolder, function (_ref14) {
360
- var $width = _ref14.$width;
361
- return $width ? (0,external_styled_components_namespaceObject.css)(["min-width:", "px;"], $width) : (0,external_styled_components_namespaceObject.css)(["min-width:", ";"], (0,themes_namespaceObject.pick)({
362
- enterprise: {
363
- comfortable: '30px',
364
- compact: '26px'
365
- },
366
- prisma: {
367
- comfortable: '38px',
368
- 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);
369
515
  }
370
- }));
371
- });
372
- var StyledAdornment = external_styled_components_default().div.withConfig({
373
- displayName: "TextAreaStyles__StyledAdornment",
374
- componentId: "gfy8yp-9"
375
- })(["display:inline-flex;align-items:center;justify-content:center;position:absolute;pointer-events:none;z-index:1;height:", ";color:", ";", ";", ";", ""], (0,themes_namespaceObject.pick)({
376
- enterprise: {
377
- comfortable: '30px',
378
- compact: '26px'
379
- },
380
- prisma: {
381
- comfortable: '38px',
382
- compact: '30px'
383
- }
384
- }), (0,themes_namespaceObject.pick)({
385
- enterprise: {
386
- light: themes_namespaceObject.variables.gray60,
387
- dark: themes_namespaceObject.variables.white
388
- },
389
- prisma: themes_namespaceObject.variables.contentColorMuted
390
- }), function (_ref15) {
391
- var $position = _ref15.$position;
392
- return $position === 'start' ? (0,external_styled_components_namespaceObject.css)(["top:1px;left:1px;"]) : (0,external_styled_components_namespaceObject.css)(["top:1px;right:1px;"]);
393
- }, function (_ref16) {
394
- var disabled = _ref16.disabled;
395
- return disabled && disabledStyles;
396
- }, (0,themes_namespaceObject.pick)({
397
- enterprise: (0,external_styled_components_namespaceObject.css)(["margin-left:-1px;margin-right:-1px;"])
398
- }));
399
-
400
- ;// CONCATENATED MODULE: ./src/TextArea/syncHeightWithShadow.ts
401
- // This file was adapted from [Call-Em-All's material-ui](https://github.com/mui-org/material-ui),
402
- // which is MIT-licensed:
403
- //
404
- // The MIT License (MIT)
405
- //
406
- // Copyright (c) 2014 Call-Em-All
407
- //
408
- // Permission is hereby granted, free of charge, to any person obtaining a copy
409
- // of this software and associated documentation files (the "Software"), to deal
410
- // in the Software without restriction, including without limitation the rights
411
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
412
- // copies of the Software, and to permit persons to whom the Software is
413
- // furnished to do so, subject to the following conditions:
414
- //
415
- // The above copyright notice and this permission notice shall be included in all
416
- // copies or substantial portions of the Software.
417
- //
418
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
419
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
420
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
421
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
422
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
423
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
424
- // SOFTWARE.
425
- //
426
- // End of MIT license text.
427
- function syncHeightWithShadow(_ref) {
428
- var height = _ref.height,
429
- rowsMax = _ref.rowsMax,
430
- rowsMin = _ref.rowsMin,
431
- shadow = _ref.shadow;
432
-
433
- if (shadow) {
434
- var style = window.getComputedStyle(shadow);
435
- 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
436
-
437
- if (lineHeightValue === 'inherit' || lineHeightValue === 'normal') {
438
- return false;
516
+ function ne(e) {
517
+ return le(e) || oe(e) || ie(e) || ae();
439
518
  }
440
-
441
- var lineHeight = parseInt(lineHeightValue, 10);
442
- var paddingTop = parseInt(style.getPropertyValue('padding-top'), 10);
443
- var paddingBottom = parseInt(style.getPropertyValue('padding-bottom'), 10);
444
- var borderTop = parseInt(style.getPropertyValue('border-top-width'), 10);
445
- var borderBottom = parseInt(style.getPropertyValue('border-bottom-width'), 10);
446
- var newHeight = shadow.scrollHeight + borderTop + borderBottom;
447
- /* eslint-disable no-restricted-globals */
448
- // Leverage the global `isNaN` here for IE support, rather than Number.isNaN.
449
- // We know newHeight is numeric because we parseInt() above, so `isNaN` should be reliable.
450
-
451
- if (newHeight === undefined || isNaN(newHeight)) {
452
- return false;
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.");
453
521
  }
454
- /* eslint-enable no-restricted-globals */
455
-
456
-
457
- if (rowsMax >= rowsMin) {
458
- var maxHeight = rowsMax * lineHeight + paddingTop + paddingBottom + borderTop + borderBottom + 1; // need one extra.
459
-
460
- newHeight = Math.min(maxHeight, newHeight);
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);
461
529
  }
462
-
463
- var minHeight = rowsMin * lineHeight + paddingTop + paddingBottom + borderTop + borderBottom + 1; // need one extra.
464
-
465
- newHeight = Math.max(minHeight, newHeight);
466
-
467
- if (height !== newHeight) {
468
- return newHeight;
530
+ function oe(e) {
531
+ if (typeof Symbol !== "undefined" && Symbol.iterator in Object(e)) return Array.from(e);
469
532
  }
470
- }
471
-
472
- return false;
473
- }
474
- ;// CONCATENATED MODULE: ./src/utils/updateReactRef.ts
475
- /**
476
- * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
477
- *
478
- * @param ref - The React callback or object ref. Can be `null` or `undefined`.
479
- * @param current - The new value of the ref.
480
- */
481
- function updateReactRef(ref, current) {
482
- if (ref) {
483
- if (typeof ref === 'function') {
484
- ref(current);
485
- } else {
486
- // the public signature of this util uses React.Ref<T> to mirror the way React types refs.
487
- // the intention here is to signal "we will take care of setting 'current', not you".
488
- ref.current = current; // eslint-disable-line no-param-reassign
533
+ function le(e) {
534
+ if (Array.isArray(e)) return se(e);
489
535
  }
490
- }
491
- }
492
-
493
-
494
- ;// CONCATENATED MODULE: ./src/TextArea/TextArea.tsx
495
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
496
-
497
- 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); }
498
-
499
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
500
-
501
- 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."); }
502
-
503
- 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); }
504
-
505
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
506
-
507
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
508
-
509
- 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; }
510
-
511
- 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; }
512
-
513
- 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; }
514
-
515
- 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; }
516
-
517
- 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; }
518
-
519
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
520
-
521
- 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); } }
522
-
523
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
524
-
525
- 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); }
526
-
527
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
528
-
529
- 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); }; }
530
-
531
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
532
-
533
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
534
-
535
- 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; } }
536
-
537
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
538
-
539
- 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; }
540
-
541
-
542
-
543
-
544
-
545
-
546
-
547
-
548
-
549
-
550
-
551
-
552
-
553
-
554
-
555
-
556
-
557
-
558
-
559
-
560
-
561
-
562
- /** @public */
563
-
564
- var propTypes = {
565
- appearance: external_prop_types_default().oneOf(['default', 'search']),
566
- append: (external_prop_types_default()).bool,
567
- autoCapitalize: (external_prop_types_default()).string,
568
- autoComplete: (external_prop_types_default()).string,
569
- autoCorrect: (external_prop_types_default()).string,
570
- autoFocus: (external_prop_types_default()).bool,
571
- canClear: (external_prop_types_default()).bool,
572
- children: (external_prop_types_default()).node,
573
-
574
- /** @private. */
575
- classNamePrivate: (external_prop_types_default()).string,
576
- defaultValue: (external_prop_types_default()).string,
577
- describedBy: (external_prop_types_default()).string,
578
- disabled: (external_prop_types_default()).bool,
579
- elementRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
580
- endAdornment: (external_prop_types_default()).node,
581
- error: (external_prop_types_default()).bool,
582
- inline: (external_prop_types_default()).bool,
583
-
584
- /** @private. */
585
- inputClassName: (external_prop_types_default()).string,
586
- inputId: (external_prop_types_default()).string,
587
- inputRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
588
- labelledBy: (external_prop_types_default()).string,
589
- maxLength: (external_prop_types_default()).number,
590
- name: (external_prop_types_default()).string,
591
- onBlur: (external_prop_types_default()).func,
592
- onChange: (external_prop_types_default()).func,
593
- onFocus: (external_prop_types_default()).func,
594
- onKeyDown: (external_prop_types_default()).func,
595
- onSelect: (external_prop_types_default()).func,
596
- onInputClick: (external_prop_types_default()).func,
597
- placeholder: (external_prop_types_default()).string,
598
- prepend: (external_prop_types_default()).bool,
599
-
600
- /** @private. */
601
- required: (external_prop_types_default()).bool,
602
- rowsMax: (external_prop_types_default()).number,
603
- rowsMin: (external_prop_types_default()).number,
604
- spellCheck: (external_prop_types_default()).bool,
605
- tabIndex: (external_prop_types_default()).number,
606
- startAdornment: (external_prop_types_default()).node,
607
-
608
- /** @private */
609
- splunkTheme: (external_prop_types_default()).object,
610
- value: (external_prop_types_default()).string
611
- };
612
- var defaultProps = {
613
- appearance: 'default',
614
- append: false,
615
- autoFocus: false,
616
- canClear: false,
617
- disabled: false,
618
- error: false,
619
- inline: false,
620
- placeholder: '',
621
- prepend: false,
622
- rowsMax: 8,
623
- rowsMin: 2,
624
- tabIndex: 0
625
- };
626
-
627
- /** Note: TextArea places role and aria props onto the input. All other props are placed on the wrapper. */
628
- var TextArea = /*#__PURE__*/function (_Component) {
629
- _inherits(TextArea, _Component);
630
-
631
- var _super = _createSuper(TextArea);
632
-
633
- _createClass(TextArea, null, [{
634
- key: "validateRows",
635
- // @docs-props-type TextAreaPropsBase
636
- value: function validateRows(_ref) {
637
- var rowsMin = _ref.rowsMin,
638
- rowsMax = _ref.rowsMax;
639
-
640
- if (false) {}
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;
641
542
  }
642
- }]);
643
-
644
- function TextArea(props) {
645
- var _this;
646
-
647
- _classCallCheck(this, TextArea);
648
-
649
- _this = _super.call(this, props);
650
-
651
- _defineProperty(_assertThisInitialized(_this), "controlledExternally", void 0);
652
-
653
- _defineProperty(_assertThisInitialized(_this), "input", null);
654
-
655
- _defineProperty(_assertThisInitialized(_this), "shadow", null);
656
-
657
- _defineProperty(_assertThisInitialized(_this), "startAdornment", null);
658
-
659
- _defineProperty(_assertThisInitialized(_this), "endAdornment", null);
660
-
661
- _defineProperty(_assertThisInitialized(_this), "getAdornmentWidth", function () {
662
- var startIconRect = _this.startAdornment ? _this.startAdornment.getBoundingClientRect() : undefined;
663
- var startIconWidth = startIconRect && Math.round(startIconRect.width);
664
-
665
- if (_this.state.startAdornmentWidth !== startIconWidth) {
666
- _this.setState({
667
- startAdornmentWidth: startIconWidth
668
- });
669
- }
670
-
671
- var endIconRect = _this.endAdornment ? _this.endAdornment.getBoundingClientRect() : undefined;
672
- var endIconWidth = endIconRect && Math.round(endIconRect.width);
673
-
674
- if (_this.state.endAdornmentWidth !== endIconWidth) {
675
- _this.setState({
676
- endAdornmentWidth: endIconWidth
677
- });
678
- }
679
- });
680
-
681
- _defineProperty(_assertThisInitialized(_this), "handleResize", function () {
682
- _this.syncHeightWithShadow();
683
- });
684
-
685
- _defineProperty(_assertThisInitialized(_this), "handleInputMount", function (el) {
686
- _this.input = el;
687
- updateReactRef(_this.props.inputRef, el);
688
- });
689
-
690
- _defineProperty(_assertThisInitialized(_this), "handleInputChange", function (e) {
691
- var _this$props$onChange, _this$props;
692
-
693
- var value = e.target.value;
694
- var name = _this.props.name;
695
-
696
- if (!_this.isControlled()) {
697
- _this.setState({
698
- value: value
699
- });
700
- }
701
-
702
- (_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, e, {
703
- value: value,
704
- name: name
705
- });
706
- });
707
-
708
- _defineProperty(_assertThisInitialized(_this), "handleInputKeyDown", function (e) {
709
- var _this$props$onKeyDown, _this$props2;
710
-
711
- (_this$props$onKeyDown = (_this$props2 = _this.props).onKeyDown) === null || _this$props$onKeyDown === void 0 ? void 0 : _this$props$onKeyDown.call(_this$props2, e);
712
- });
713
-
714
- _defineProperty(_assertThisInitialized(_this), "handleInputSelect", function (e) {
715
- var _this$props$onSelect, _this$props3;
716
-
717
- (_this$props$onSelect = (_this$props3 = _this.props).onSelect) === null || _this$props$onSelect === void 0 ? void 0 : _this$props$onSelect.call(_this$props3, e);
718
- });
719
-
720
- _defineProperty(_assertThisInitialized(_this), "handleInputClick", function (e) {
721
- var _this$props$onInputCl, _this$props4;
722
-
723
- (_this$props$onInputCl = (_this$props4 = _this.props).onInputClick) === null || _this$props$onInputCl === void 0 ? void 0 : _this$props$onInputCl.call(_this$props4, e);
724
- });
725
-
726
- _defineProperty(_assertThisInitialized(_this), "handleInputFocus", function (e) {
727
- var _this$props$onFocus, _this$props5;
728
-
729
- (_this$props$onFocus = (_this$props5 = _this.props).onFocus) === null || _this$props$onFocus === void 0 ? void 0 : _this$props$onFocus.call(_this$props5, e);
730
- });
731
-
732
- _defineProperty(_assertThisInitialized(_this), "handleInputBlur", function (e) {
733
- var _this$props$onBlur, _this$props6;
734
-
735
- (_this$props$onBlur = (_this$props6 = _this.props).onBlur) === null || _this$props$onBlur === void 0 ? void 0 : _this$props$onBlur.call(_this$props6, e);
736
- });
737
-
738
- _defineProperty(_assertThisInitialized(_this), "handleClear", function (e) {
739
- var _this$props$onChange2, _this$props7;
740
-
741
- e.preventDefault();
742
- var value = '';
743
- var name = _this.props.name;
744
-
745
- if (!_this.isControlled()) {
746
- _this.setState({
747
- value: value
748
- });
749
- }
750
-
751
- _this.focus();
752
-
753
- (_this$props$onChange2 = (_this$props7 = _this.props).onChange) === null || _this$props$onChange2 === void 0 ? void 0 : _this$props$onChange2.call(_this$props7, e, {
754
- value: value,
755
- name: name
756
- });
757
- });
758
-
759
- _defineProperty(_assertThisInitialized(_this), "syncHeightWithShadow", function () {
760
- var newHeight = syncHeightWithShadow({
761
- height: _this.state.height,
762
- rowsMax: _this.props.rowsMax,
763
- rowsMin: _this.props.rowsMin,
764
- shadow: _this.shadow
765
- });
766
-
767
- if (newHeight !== false) {
768
- _this.setState({
769
- height: newHeight
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;
553
+ }
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
+ }
770
627
  });
771
- }
772
- });
773
-
774
- _defineProperty(_assertThisInitialized(_this), "renderEndAdornment", function () {
775
- var _controlGroupContext$;
776
-
777
- var _this$props8 = _this.props,
778
- appearance = _this$props8.appearance,
779
- endAdornment = _this$props8.endAdornment,
780
- disabled = _this$props8.disabled,
781
- canClear = _this$props8.canClear,
782
- splunkTheme = _this$props8.splunkTheme;
783
- var isPrisma = splunkTheme.isPrisma,
784
- isEnterprise = splunkTheme.isEnterprise,
785
- isCompact = splunkTheme.isCompact;
786
- var prismaSize = isCompact ? '20px' : '24px';
787
- var adornmentProps = {
788
- ref: function ref(el) {
789
- _this.endAdornment = el;
790
- },
791
- disabled: disabled,
792
- $position: 'end'
793
- };
794
-
795
- if (endAdornment) {
796
- return /*#__PURE__*/external_react_default().createElement(StyledAdornment, adornmentProps, endAdornment);
797
- }
798
-
799
- var controlGroupContext = _this.context;
800
- var controlGroupLabel = (_controlGroupContext$ = controlGroupContext.labelAttrs) === null || _controlGroupContext$ === void 0 ? void 0 : _controlGroupContext$.text;
801
- var clearButtonText = controlGroupLabel ? (0,i18n_namespaceObject._)("Clear ".concat(controlGroupLabel, " text field")) : (0,i18n_namespaceObject._)('Clear text field');
802
-
803
- if (!isPrisma && appearance === 'search') {
804
- return /*#__PURE__*/external_react_default().createElement(StyledAdornment, adornmentProps, /*#__PURE__*/external_react_default().createElement(StyledClearButton, {
805
- appearance: "pill",
806
- "data-test": "clear",
807
- inline: false,
808
- icon: /*#__PURE__*/external_react_default().createElement((Close_default()), {
809
- size: 1,
810
- screenReaderText: clearButtonText
811
- }),
812
- onClick: _this.handleClear
813
- }), /*#__PURE__*/external_react_default().createElement(StyledSearchIconWrapper, {
814
- $disabled: disabled
815
- }, isEnterprise ? /*#__PURE__*/external_react_default().createElement((Search_default()), {
816
- hideDefaultTooltip: true,
817
- inline: false,
818
- screenReaderText: null,
819
- size: "16px"
820
- }) : /*#__PURE__*/external_react_default().createElement((Magnifier_default()), {
821
- height: prismaSize,
822
- width: prismaSize
823
- })));
824
- }
825
-
826
- var displayValue = _this.getDisplayValue();
827
-
828
- if (!!displayValue && (isPrisma && appearance === 'search' || canClear)) {
829
- return /*#__PURE__*/external_react_default().createElement(StyledAdornment, adornmentProps, !disabled && /*#__PURE__*/external_react_default().createElement(StyledClearButton, {
830
- "data-test": "clear",
831
- appearance: "secondary",
832
- onClick: _this.handleClear,
833
- icon: /*#__PURE__*/external_react_default().createElement((Cross_default()), {
834
- "aria-label": clearButtonText,
835
- inline: false,
836
- width: prismaSize,
837
- height: prismaSize
838
- })
839
- }));
840
- }
841
-
842
- return undefined;
843
- });
844
-
845
- _defineProperty(_assertThisInitialized(_this), "renderStartAdornment", function () {
846
- var _this$props9 = _this.props,
847
- appearance = _this$props9.appearance,
848
- startAdornment = _this$props9.startAdornment,
849
- splunkTheme = _this$props9.splunkTheme,
850
- disabled = _this$props9.disabled;
851
- var isPrisma = splunkTheme.isPrisma,
852
- isCompact = splunkTheme.isCompact;
853
- var prismaSize = isCompact ? '20px' : '24px';
854
- var adornmentProps = {
855
- ref: function ref(el) {
856
- _this.startAdornment = el;
857
- },
858
- disabled: disabled,
859
- $position: 'start'
860
- };
861
-
862
- if (startAdornment) {
863
- return /*#__PURE__*/external_react_default().createElement(StyledAdornment, adornmentProps, startAdornment);
864
- }
865
-
866
- if (isPrisma && appearance === 'search') {
867
- return /*#__PURE__*/external_react_default().createElement(StyledAdornment, adornmentProps, /*#__PURE__*/external_react_default().createElement(StyledSearchIconWrapper, {
868
- $disabled: disabled
869
- }, /*#__PURE__*/external_react_default().createElement((Magnifier_default()), {
870
- "aria-label": "Search",
871
- height: prismaSize,
872
- width: prismaSize
873
- })));
874
- }
875
-
876
- return undefined;
877
- });
878
-
879
- _defineProperty(_assertThisInitialized(_this), "getDisplayValue", function () {
880
- var displayValue = _this.isControlled() ? _this.props.value : _this.state.value;
881
- return displayValue;
882
- });
883
-
884
- _this.controlledExternally = has_default()(props, 'value');
885
- _this.state = {
886
- value: props.defaultValue || ''
887
- };
888
-
889
- if (false) {}
890
-
891
- if (false) {}
892
-
893
- if (false) {}
894
-
895
- TextArea.validateRows(props);
896
- _this.handleResize = throttle_default()(_this.handleResize, 100);
897
- return _this;
898
- }
899
-
900
- _createClass(TextArea, [{
901
- key: "componentDidMount",
902
- value: function componentDidMount() {
903
- defer_default()(this.syncHeightWithShadow); // wait for styles to load
904
-
905
- this.getAdornmentWidth();
628
+ if (t) be(e, t);
906
629
  }
907
- }, {
908
- key: "componentDidUpdate",
909
- value: function componentDidUpdate(prevProps) {
910
- if (false) {}
911
-
912
- if (false) {}
913
-
914
- this.syncHeightWithShadow();
915
- TextArea.validateRows(this.props);
916
- 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);
917
636
  }
918
- }, {
919
- key: "isControlled",
920
- value: function isControlled() {
921
- return this.controlledExternally;
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
+ };
922
649
  }
923
- }, {
924
- key: "blur",
925
- value: function blur() {
926
- var _this$input;
927
-
928
- (_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);
929
655
  }
930
- /**
931
- * Place focus on the input.
932
- */
933
-
934
- }, {
935
- key: "focus",
936
- value: function focus() {
937
- var _this$input2;
938
-
939
- (_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;
940
661
  }
941
- }, {
942
- key: "select",
943
- value: function select() {
944
- var _this$input3;
945
-
946
- (_this$input3 = this.input) === null || _this$input3 === void 0 ? void 0 : _this$input3.select();
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
+ }
947
672
  }
948
- }, {
949
- key: "render",
950
- value: function render() {
951
- var _this2 = this;
952
-
953
- var _this$props10 = this.props,
954
- append = _this$props10.append,
955
- autoCapitalize = _this$props10.autoCapitalize,
956
- autoComplete = _this$props10.autoComplete,
957
- autoCorrect = _this$props10.autoCorrect,
958
- autoFocus = _this$props10.autoFocus,
959
- children = _this$props10.children,
960
- className = _this$props10.className,
961
- classNamePrivate = _this$props10.classNamePrivate,
962
- disabled = _this$props10.disabled,
963
- describedBy = _this$props10.describedBy,
964
- elementRef = _this$props10.elementRef,
965
- error = _this$props10.error,
966
- inline = _this$props10.inline,
967
- inputClassName = _this$props10.inputClassName,
968
- inputId = _this$props10.inputId,
969
- labelledBy = _this$props10.labelledBy,
970
- maxLength = _this$props10.maxLength,
971
- name = _this$props10.name,
972
- placeholder = _this$props10.placeholder,
973
- prepend = _this$props10.prepend,
974
- required = _this$props10.required,
975
- spellCheck = _this$props10.spellCheck,
976
- tabIndex = _this$props10.tabIndex,
977
- title = _this$props10.title,
978
- 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"]);
979
-
980
- var ariaProps = _objectSpread(_objectSpread({}, pickBy_default()(otherProps, function (val, key) {
981
- return key === 'role' || key.indexOf('aria-') === 0;
982
- })), {}, {
983
- 'aria-describedby': describedBy,
984
- 'aria-labelledby': labelledBy,
985
- 'aria-invalid': error || undefined,
986
- 'aria-multiline': true
987
- });
988
-
989
- var boxProps = omit_default()(otherProps, ['inputRef', 'onBlur', 'onChange', 'onFocus', 'onKeyDown', 'onSelect', 'onInputClick', 'rowsMax', 'rowsMin'].concat(_toConsumableArray(keys_default()(ariaProps))));
990
- var displayValue = this.getDisplayValue();
991
- var displayProps = {
992
- className: (0,style_namespaceObject.toClassName)(className, inputClassName),
993
- $append: append || undefined,
994
- $error: error,
995
- $prepend: prepend || undefined
996
- };
997
-
998
- var inputProps = _objectSpread(_objectSpread({}, ariaProps), {}, {
999
- 'data-test': 'textbox',
1000
- autoCapitalize: autoCapitalize,
1001
- autoComplete: autoComplete,
1002
- autoCorrect: autoCorrect,
1003
- autoFocus: autoFocus,
1004
- id: inputId,
1005
- maxLength: maxLength,
1006
- placeholder: placeholder,
1007
- name: name,
1008
- onChange: this.handleInputChange,
1009
- onKeyDown: this.handleInputKeyDown,
1010
- onSelect: this.handleInputSelect,
1011
- onClick: this.handleInputClick,
1012
- onFocus: this.handleInputFocus,
1013
- onBlur: this.handleInputBlur,
1014
- ref: this.handleInputMount,
1015
- role: 'textbox',
1016
- required: required,
1017
- spellCheck: spellCheck,
1018
- style: {
1019
- height: this.state.height
1020
- },
1021
- title: title,
1022
- tabIndex: tabIndex,
1023
- value: displayValue,
1024
- $error: error
1025
- });
1026
-
1027
- var hasEndAdornment = !!this.renderEndAdornment();
1028
- var hasStartAdornment = !!this.renderStartAdornment();
1029
- return /*#__PURE__*/external_react_default().createElement(StyledBox, _extends({
1030
- tabIndex: -1,
1031
- className: (0,style_namespaceObject.toClassName)(className, classNamePrivate),
1032
- "data-test": "text",
1033
- "data-test-value": displayValue,
1034
- elementRef: elementRef,
1035
- flex: true,
1036
- inline: inline
1037
- }, boxProps), this.renderStartAdornment(), /*#__PURE__*/external_react_default().createElement(StyledTextAreaWrapper, _extends({
1038
- $hasEndAdornment: hasEndAdornment,
1039
- $hasStartAdornment: hasStartAdornment,
1040
- disabled: disabled
1041
- }, displayProps), hasStartAdornment && /*#__PURE__*/external_react_default().createElement(StyledStartAdornmentHolder, {
1042
- $width: this.state.startAdornmentWidth
1043
- }), /*#__PURE__*/external_react_default().createElement(StyledTextArea, {
1044
- "aria-hidden": "true",
1045
- onChange: (noop_default()),
1046
- onClick: this.handleInputClick,
1047
- style: {
1048
- width: '100%',
1049
- position: 'absolute',
1050
- overflow: 'hidden',
1051
- left: -10000,
1052
- top: -10000
1053
- },
1054
- tabIndex: -1,
1055
- ref: function ref(el) {
1056
- _this2.shadow = el;
1057
- },
1058
- value: displayValue
1059
- }), disabled ? /*#__PURE__*/external_react_default().createElement(StyledTextArea, _extends({
1060
- as: "textarea",
1061
- className: (0,style_namespaceObject.toClassName)(className, classNamePrivate),
1062
- "data-multiline": "true",
1063
- "data-test": "text",
1064
- disabled: true,
1065
- readOnly: true,
1066
- style: {
1067
- height: this.state.height
1068
- },
1069
- value: displayValue,
1070
- placeholder: placeholder,
1071
- ref: function ref(el) {
1072
- _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;
1073
689
  }
1074
- }, ariaProps)) : /*#__PURE__*/external_react_default().createElement(StyledTextArea, _extends({
1075
- as: "textarea"
1076
- }, inputProps, {
1077
- onClick: this.handleInputClick
1078
- })), /*#__PURE__*/external_react_default().createElement((EventListener_default()), {
1079
- target: window,
1080
- eventType: "resize",
1081
- listener: this.handleResize
1082
- }), children, hasEndAdornment && /*#__PURE__*/external_react_default().createElement(StyledEndAdornmentHolder, {
1083
- $width: this.state.endAdornmentWidth
1084
- })), this.renderEndAdornment());
690
+ return e;
1085
691
  }
1086
- }]);
1087
-
1088
- return TextArea;
1089
- }(external_react_namespaceObject.Component);
1090
-
1091
- _defineProperty(TextArea, "propTypes", propTypes);
1092
-
1093
- _defineProperty(TextArea, "defaultProps", defaultProps);
1094
-
1095
- _defineProperty(TextArea, "componentType", 'TextArea');
1096
-
1097
- _defineProperty(TextArea, "contextType", ControlGroup_namespaceObject.ControlGroupContext);
1098
-
1099
- var TextAreaWithThemeBase = (0,themes_namespaceObject.withSplunkTheme)(TextArea);
1100
- var TextAreaWithTheme = TextAreaWithThemeBase;
1101
- TextAreaWithTheme.propTypes = TextArea.propTypes;
1102
- TextAreaWithTheme.componentType = TextArea.componentType;
1103
- /* harmony default export */ const TextArea_TextArea = (TextAreaWithTheme);
1104
- ;// CONCATENATED MODULE: ./src/TextArea/index.ts
1105
-
1106
-
1107
- module.exports = __webpack_exports__;
1108
- /******/ })()
1109
- ;
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
+ /******/})();