@splunk/react-ui 5.2.0 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion.js +31 -31
- package/Avatar.js +64 -59
- package/Box.js +2 -1
- package/Breadcrumbs.js +66 -63
- package/ButtonSimple.js +52 -52
- package/CHANGELOG.md +47 -0
- package/Calendar.js +8 -4
- package/CardLayout.js +39 -36
- package/Checkbox.d.ts +2 -0
- package/Checkbox.js +350 -0
- package/Clickable.js +5 -6
- package/Code.js +451 -536
- package/CollapsiblePanel.js +184 -210
- package/Color.js +903 -1023
- package/ControlGroup.js +2 -1
- package/Date.js +123 -119
- package/DefinitionList.js +100 -77
- package/Dropdown.js +2 -2
- package/DualListbox.js +409 -353
- package/File.js +102 -99
- package/FormRows.js +13 -11
- package/JSONTree.js +679 -1391
- package/Link.js +7 -7
- package/MIGRATION.md +27 -0
- package/Markdown.js +171 -156
- package/Menu.js +107 -100
- package/Modal.js +3 -3
- package/Multiselect.js +2698 -2767
- package/Paginator.js +2 -1
- package/Popover.js +201 -196
- package/Resize.js +11 -8
- package/ResultsMenu.js +913 -1029
- package/ScreenReaderContent.js +86 -130
- package/Scroll.js +366 -424
- package/Search.js +131 -127
- package/Select.js +1741 -1831
- package/Slider.js +1 -1
- package/SlidingPanels.js +129 -127
- package/StepBar.js +123 -97
- package/Switch.js +214 -242
- package/TabBar.js +10 -10
- package/Table.js +1255 -1248
- package/Text.js +180 -206
- package/TextArea.js +596 -675
- package/Tooltip.js +144 -139
- package/Tree.js +638 -682
- package/package.json +15 -16
- package/tsconfig.check-docs.json +8 -0
- package/types/src/Avatar/docs/examples/Basic.d.ts +1 -1
- package/types/src/Breadcrumbs/Breadcrumbs.d.ts +1 -5
- package/types/src/Breadcrumbs/BreadcrumbsContext.d.ts +7 -0
- package/types/src/Breadcrumbs/Item.d.ts +1 -1
- package/types/src/ButtonSimple/mixin.d.ts +1 -1
- package/types/src/Checkbox/Checkbox.d.ts +90 -0
- package/types/src/Checkbox/docs/examples/Basic.d.ts +7 -0
- package/types/src/Checkbox/docs/examples/Disabled.d.ts +6 -0
- package/types/src/Checkbox/docs/examples/Error.d.ts +6 -0
- package/types/src/Checkbox/docs/examples/Uncontrolled.d.ts +7 -0
- package/types/src/Checkbox/index.d.ts +2 -0
- package/types/src/Code/Code.d.ts +4 -1
- package/types/src/Code/LineHighlights.d.ts +1 -0
- package/types/src/Code/LineNumbers.d.ts +2 -1
- package/types/src/Code/docs/examples/CustomizeContainer.d.ts +7 -0
- package/types/src/ControlGroup/docs/examples/CustomizedLabelTarget.d.ts +3 -3
- package/types/src/Date/Date.d.ts +7 -1
- package/types/src/DefinitionList/DefinitionList.d.ts +7 -2
- package/types/src/DefinitionList/DefinitionListContext.d.ts +1 -1
- package/types/src/DefinitionList/docs/examples/StackedLayout.d.ts +6 -0
- package/types/src/DualListbox/DualListbox.d.ts +1 -1
- package/types/src/DualListbox/Label.d.ts +7 -7
- package/types/src/DualListbox/Listbox.d.ts +2 -2
- package/types/src/DualListbox/ListboxContext.d.ts +1 -1
- package/types/src/File/File.d.ts +7 -1
- package/types/src/JSONTree/JSONTreeItem.d.ts +5 -3
- package/types/src/JSONTree/renderTreeItems.d.ts +3 -2
- package/types/src/Markdown/renderers/MarkdownCodeBlock.d.ts +2 -1
- package/types/src/Menu/docs/examples/Dimmed.d.ts +1 -1
- package/types/src/Menu/docs/examples/Disabled.d.ts +1 -0
- package/types/src/Modal/ModalContext.d.ts +1 -1
- package/types/src/Multiselect/Compact.d.ts +9 -3
- package/types/src/Multiselect/Multiselect.d.ts +7 -1
- package/types/src/Multiselect/Normal.d.ts +9 -3
- package/types/src/Number/utils.d.ts +1 -1
- package/types/src/Popover/getPlacement.d.ts +1 -1
- package/types/src/RadioList/Option.d.ts +1 -1
- package/types/src/RadioList/RadioListContext.d.ts +1 -1
- package/types/src/Search/Search.d.ts +5 -1
- package/types/src/StepBar/StepBar.d.ts +4 -1
- package/types/src/StepBar/StepBarContext.d.ts +1 -0
- package/types/src/StepBar/docs/examples/Vertical.d.ts +6 -0
- package/types/src/Switch/Switch.d.ts +13 -1
- package/types/src/Switch/docs/examples/Basic.d.ts +2 -10
- package/types/src/Switch/docs/examples/Disabled.d.ts +2 -9
- package/types/src/TabBar/Tab.d.ts +3 -1
- package/types/src/TabBar/docs/examples/Icons.d.ts +4 -0
- package/types/src/TabBar/docs/examples/Tooltips.d.ts +3 -0
- package/types/src/TabLayout/Panel.d.ts +2 -0
- package/types/src/Table/ExpandButton.d.ts +1 -1
- package/types/src/Table/Head.d.ts +1 -1
- package/types/src/Table/Row.d.ts +1 -1
- package/types/src/Table/Table.d.ts +1 -0
- package/types/src/Tooltip/Tooltip.d.ts +14 -1
- package/types/src/Tree/TreeContext.d.ts +1 -1
- package/useControlled.js +61 -97
- package/usePrevious.js +30 -62
- package/useResizeObserver.js +95 -127
- package/NonInteractiveCheckbox.js +0 -101
- package/types/src/CollapsiblePanel/icons/ExpandPanel.d.ts +0 -12
- package/types/src/NonInteractiveCheckbox/NonInteractiveCheckbox.d.ts +0 -22
- package/types/src/NonInteractiveCheckbox/index.d.ts +0 -1
- package/types/src/Switch/docs/examples/Error.d.ts +0 -6
- package/types/src/Text/IconOutlinedHide.d.ts +0 -3
- package/types/src/Text/IconOutlinedView.d.ts +0 -3
- /package/cypress/{tsconfig.cypress.json → tsconfig.check-cypress.json} +0 -0
package/TextArea.js
CHANGED
|
@@ -1,105 +1,19 @@
|
|
|
1
1
|
/******/ (() => {
|
|
2
2
|
// webpackBootstrap
|
|
3
3
|
/******/ "use strict";
|
|
4
|
-
/******/
|
|
5
|
-
|
|
6
|
-
/***/ (e, r, t) => {
|
|
7
|
-
// EXPORTS
|
|
8
|
-
t.d(r, {
|
|
9
|
-
default: () => /* reexport */ s
|
|
10
|
-
});
|
|
11
|
-
// UNUSED EXPORTS: isAllowedType, isPrimitive
|
|
12
|
-
// EXTERNAL MODULE: external "react"
|
|
13
|
-
var n = t(9497);
|
|
14
|
-
// CONCATENATED MODULE: external "lodash/isEqual"
|
|
15
|
-
const o = require("lodash/isEqual");
|
|
16
|
-
// EXTERNAL MODULE: external "lodash/has"
|
|
17
|
-
var a = t(5919);
|
|
18
|
-
var i = t.n(a);
|
|
19
|
-
// CONCATENATED MODULE: ./src/useControlled/useControlled.tsx
|
|
20
|
-
function l(e) {
|
|
21
|
-
return e === null || e === undefined || typeof e === "boolean" || typeof e === "string" || typeof e === "number";
|
|
22
|
-
}
|
|
23
|
-
function u(e) {
|
|
24
|
-
if (l(e)) {
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
if (Array.isArray(e)) {
|
|
28
|
-
return e.every(l);
|
|
29
|
-
}
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* This is a private component not intended for use outside @splunk/react-ui
|
|
34
|
-
*
|
|
35
|
-
* A hook that accepts a default value (as used in an uncontrolled component)
|
|
36
|
-
* and validates that actions that aren't valid in an uncontrolled component
|
|
37
|
-
* such as updating the default value, combining default value with value, etc.
|
|
38
|
-
* are not happening.
|
|
39
|
-
*
|
|
40
|
-
* Return the controlled state of the component.
|
|
41
|
-
*/ function c(e) {
|
|
42
|
-
var r = e.componentProps, t = e.componentName, o = t === void 0 ? "this component" : t, a = e.defaultValuePropName, l = a === void 0 ? "defaultValue" : a, u = e.valuePropName, c = u === void 0 ? "value" : u;
|
|
43
|
-
var s = (0, n.useRef)(i()(r, c));
|
|
44
|
-
var d = (0, n.useRef)(r[l]);
|
|
45
|
-
(0, n.useEffect)((function() {
|
|
46
|
-
if (false) {}
|
|
47
|
-
}), [ o, r, l, c ]);
|
|
48
|
-
(0, n.useEffect)((function() {
|
|
49
|
-
if (false) {}
|
|
50
|
-
if (false) {}
|
|
51
|
-
if (false) {}
|
|
52
|
-
}), [ o, r, l, c ]);
|
|
53
|
-
return s.current;
|
|
54
|
-
}
|
|
55
|
-
/* harmony default export */ const s = c;
|
|
56
|
-
} // CONCATENATED MODULE: ./src/useControlled/index.ts
|
|
57
|
-
/***/ ,
|
|
58
|
-
/***/ 5919:
|
|
59
|
-
/***/ e => {
|
|
60
|
-
e.exports = require("lodash/has");
|
|
61
|
-
/***/ },
|
|
62
|
-
/***/ 9497:
|
|
63
|
-
/***/ e => {
|
|
64
|
-
e.exports = require("react");
|
|
65
|
-
/***/
|
|
66
|
-
/******/ }
|
|
67
|
-
};
|
|
68
|
-
/************************************************************************/
|
|
69
|
-
/******/ // The module cache
|
|
70
|
-
/******/ var r = {};
|
|
71
|
-
/******/
|
|
72
|
-
/******/ // The require function
|
|
73
|
-
/******/ function t(n) {
|
|
74
|
-
/******/ // Check if module is in cache
|
|
75
|
-
/******/ var o = r[n];
|
|
76
|
-
/******/ if (o !== undefined) {
|
|
77
|
-
/******/ return o.exports;
|
|
78
|
-
/******/ }
|
|
79
|
-
/******/ // Create a new module (and put it into the cache)
|
|
80
|
-
/******/ var a = r[n] = {
|
|
81
|
-
/******/ // no module.id needed
|
|
82
|
-
/******/ // no module.loaded needed
|
|
83
|
-
/******/ exports: {}
|
|
84
|
-
/******/ };
|
|
85
|
-
/******/
|
|
86
|
-
/******/ // Execute the module function
|
|
87
|
-
/******/ e[n](a, a.exports, t);
|
|
88
|
-
/******/
|
|
89
|
-
/******/ // Return the exports of the module
|
|
90
|
-
/******/ return a.exports;
|
|
91
|
-
/******/ }
|
|
4
|
+
/******/ // The require scope
|
|
5
|
+
/******/ var e = {};
|
|
92
6
|
/******/
|
|
93
7
|
/************************************************************************/
|
|
94
8
|
/******/ /* webpack/runtime/compat get default export */
|
|
95
9
|
/******/ (() => {
|
|
96
10
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
97
|
-
/******/
|
|
98
|
-
/******/ var r =
|
|
99
|
-
/******/ () =>
|
|
100
|
-
/******/ : () =>
|
|
11
|
+
/******/ e.n = n => {
|
|
12
|
+
/******/ var r = n && n.__esModule ?
|
|
13
|
+
/******/ () => n["default"]
|
|
14
|
+
/******/ : () => n
|
|
101
15
|
/******/;
|
|
102
|
-
|
|
16
|
+
e.d(r, {
|
|
103
17
|
a: r
|
|
104
18
|
});
|
|
105
19
|
/******/ return r;
|
|
@@ -109,12 +23,12 @@
|
|
|
109
23
|
/******/ /* webpack/runtime/define property getters */
|
|
110
24
|
/******/ (() => {
|
|
111
25
|
/******/ // define getter functions for harmony exports
|
|
112
|
-
/******/
|
|
113
|
-
/******/ for (var
|
|
114
|
-
/******/ if (
|
|
115
|
-
/******/ Object.defineProperty(
|
|
26
|
+
/******/ e.d = (n, r) => {
|
|
27
|
+
/******/ for (var t in r) {
|
|
28
|
+
/******/ if (e.o(r, t) && !e.o(n, t)) {
|
|
29
|
+
/******/ Object.defineProperty(n, t, {
|
|
116
30
|
enumerable: true,
|
|
117
|
-
get: r[
|
|
31
|
+
get: r[t]
|
|
118
32
|
});
|
|
119
33
|
/******/ }
|
|
120
34
|
/******/ }
|
|
@@ -123,14 +37,14 @@
|
|
|
123
37
|
/******/
|
|
124
38
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
125
39
|
/******/ (() => {
|
|
126
|
-
/******/
|
|
40
|
+
/******/ e.o = (e, n) => Object.prototype.hasOwnProperty.call(e, n)
|
|
127
41
|
/******/;
|
|
128
42
|
})();
|
|
129
43
|
/******/
|
|
130
44
|
/******/ /* webpack/runtime/make namespace object */
|
|
131
45
|
/******/ (() => {
|
|
132
46
|
/******/ // define __esModule on exports
|
|
133
|
-
/******/
|
|
47
|
+
/******/ e.r = e => {
|
|
134
48
|
/******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
|
|
135
49
|
/******/ Object.defineProperty(e, Symbol.toStringTag, {
|
|
136
50
|
value: "Module"
|
|
@@ -143,615 +57,622 @@
|
|
|
143
57
|
/******/ })();
|
|
144
58
|
/******/
|
|
145
59
|
/************************************************************************/ var n = {};
|
|
146
|
-
//
|
|
147
|
-
(
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
return f;
|
|
225
|
-
}
|
|
60
|
+
// ESM COMPAT FLAG
|
|
61
|
+
e.r(n);
|
|
62
|
+
// EXPORTS
|
|
63
|
+
e.d(n, {
|
|
64
|
+
default: () => /* reexport */ de
|
|
65
|
+
});
|
|
66
|
+
// CONCATENATED MODULE: external "react"
|
|
67
|
+
const r = require("react");
|
|
68
|
+
var t = e.n(r);
|
|
69
|
+
// CONCATENATED MODULE: external "lodash/keys"
|
|
70
|
+
const o = require("lodash/keys");
|
|
71
|
+
var a = e.n(o);
|
|
72
|
+
// CONCATENATED MODULE: external "lodash/omit"
|
|
73
|
+
const i = require("lodash/omit");
|
|
74
|
+
var l = e.n(i);
|
|
75
|
+
// CONCATENATED MODULE: external "lodash/pickBy"
|
|
76
|
+
const u = require("lodash/pickBy");
|
|
77
|
+
var c = e.n(u);
|
|
78
|
+
// CONCATENATED MODULE: external "lodash/throttle"
|
|
79
|
+
const s = require("lodash/throttle");
|
|
80
|
+
var d = e.n(s);
|
|
81
|
+
// CONCATENATED MODULE: external "prop-types"
|
|
82
|
+
const f = require("prop-types");
|
|
83
|
+
var p = e.n(f);
|
|
84
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/EventListener"
|
|
85
|
+
const v = require("@splunk/react-ui/EventListener");
|
|
86
|
+
var b = e.n(v);
|
|
87
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/useControlled"
|
|
88
|
+
const m = require("@splunk/react-ui/useControlled");
|
|
89
|
+
var y = e.n(m);
|
|
90
|
+
// CONCATENATED MODULE: ./src/TextArea/syncHeightWithShadow.ts
|
|
91
|
+
// This file was adapted from [Call-Em-All's material-ui](https://github.com/mui-org/material-ui),
|
|
92
|
+
// which is MIT-licensed:
|
|
93
|
+
// The MIT License (MIT)
|
|
94
|
+
// Copyright (c) 2014 Call-Em-All
|
|
95
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
96
|
+
// of this software and associated documentation files (the "Software"), to deal
|
|
97
|
+
// in the Software without restriction, including without limitation the rights
|
|
98
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
99
|
+
// copies of the Software, and to permit persons to whom the Software is
|
|
100
|
+
// furnished to do so, subject to the following conditions:
|
|
101
|
+
// The above copyright notice and this permission notice shall be included in all
|
|
102
|
+
// copies or substantial portions of the Software.
|
|
103
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
104
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
105
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
106
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
107
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
108
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
109
|
+
// SOFTWARE.
|
|
110
|
+
// End of MIT license text.
|
|
111
|
+
function h(e) {
|
|
112
|
+
var n = e.height, r = e.rowsMax, t = e.rowsMin, o = e.shadow;
|
|
113
|
+
if (o) {
|
|
114
|
+
var a = window.getComputedStyle(o);
|
|
115
|
+
var i = a.getPropertyValue("line-height");
|
|
116
|
+
// jsdom does not properly inherit/re-calculate the line-height property so we skip in these cases SUI-1943, SUI-2428
|
|
117
|
+
if (i === "inherit" || i === "normal") {
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
var l = parseInt(i, 10);
|
|
121
|
+
var u = parseInt(a.getPropertyValue("border-top-width"), 10);
|
|
122
|
+
var c = parseInt(a.getPropertyValue("border-bottom-width"), 10);
|
|
123
|
+
var s = o.scrollHeight + u + c;
|
|
124
|
+
/* eslint-disable no-restricted-globals */
|
|
125
|
+
// Leverage the global `isNaN` here for IE support, rather than Number.isNaN.
|
|
126
|
+
// We know newHeight is numeric because we parseInt() above, so `isNaN` should be reliable.
|
|
127
|
+
if (s === undefined || isNaN(s)) {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
/* eslint-enable no-restricted-globals */ if (r >= t) {
|
|
131
|
+
var d = r * l + u + c;
|
|
132
|
+
s = Math.min(d, s);
|
|
133
|
+
}
|
|
134
|
+
var f = t * l + u + c;
|
|
135
|
+
s = Math.max(f, s);
|
|
136
|
+
if (n !== s) {
|
|
137
|
+
return s;
|
|
226
138
|
}
|
|
227
|
-
return false;
|
|
228
139
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
querySelectorAll: function e() {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
// CONCATENATED MODULE: external "styled-components"
|
|
143
|
+
const g = require("styled-components");
|
|
144
|
+
var w = e.n(g);
|
|
145
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Box"
|
|
146
|
+
const C = require("@splunk/react-ui/Box");
|
|
147
|
+
var x = e.n(C);
|
|
148
|
+
// CONCATENATED MODULE: external "@splunk/themes"
|
|
149
|
+
const S = require("@splunk/themes");
|
|
150
|
+
// CONCATENATED MODULE: ./src/TextArea/TextAreaStyles.ts
|
|
151
|
+
var A = "230px";
|
|
152
|
+
var O = S.variables.spacingSmall;
|
|
153
|
+
// variables.inputHeight can't be used with syncHeight/auto-expanding rows.
|
|
154
|
+
// Use a custom value here to ensure the single-line TextArea matches the Text height
|
|
155
|
+
// and keeps the vertical spacing above the label consistent (SUI-8053).
|
|
156
|
+
var E = (0, S.pick)({
|
|
157
|
+
comfortable: "5px",
|
|
158
|
+
compact: "3px"
|
|
159
|
+
});
|
|
160
|
+
var j = w()(x()).withConfig({
|
|
161
|
+
displayName: "TextAreaStyles__StyledBox",
|
|
162
|
+
componentId: "gfy8yp-0"
|
|
163
|
+
})([ "display:grid;grid-template-columns:[startAdornment] min-content [content] minmax(0,1fr) [endAdornment] min-content;position:relative;min-height:", ";overflow:hidden;border:", " solid ", ";border-radius:", ";background-color:", ";box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);align-items:center;padding:", " ", ";&:hover:not([disabled]){border-color:", ";}&:not([disabled]):has(textarea:focus){box-shadow:", ";color:", ";}", " ", " ", " ", " ", "" ], S.variables.inputHeight, S.variables.inputBorderWidth, S.variables.interactiveColorBorder, S.variables.borderRadius, S.variables.interactiveColorBackground, E, O, S.variables.interactiveColorBorderHover, S.variables.focusShadow, S.variables.contentColorActive, (function(e) {
|
|
164
|
+
var n = e.$error;
|
|
165
|
+
return n && (0, g.css)([ "border-color:", ";&:hover:not([disabled]){border-color:", ";}" ], S.variables.interactiveColorAccentError, S.variables.interactiveColorAccentErrorStrong);
|
|
166
|
+
}), (function(e) {
|
|
167
|
+
var n = e.$append;
|
|
168
|
+
return n && (0, g.css)([ "margin-right:-1px;border-top-right-radius:0;border-bottom-right-radius:0;border-right:none;" ]);
|
|
169
|
+
}), (function(e) {
|
|
170
|
+
var n = e.$prepend;
|
|
171
|
+
return n && (0, g.css)([ "border-top-left-radius:0;border-bottom-left-radius:0;" ]);
|
|
172
|
+
}), (function(e) {
|
|
173
|
+
var n = e.disabled;
|
|
174
|
+
return n && (0, g.css)([ "background-color:", ";border-color:", ";box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);" ], S.variables.interactiveColorBackgroundDisabled, S.variables.interactiveColorBorderDisabled);
|
|
175
|
+
}), (function(e) {
|
|
176
|
+
var n = e.$inline;
|
|
177
|
+
return n && (0, g.css)([ "display:inline-grid;width:", ";" ], A);
|
|
178
|
+
}));
|
|
179
|
+
// This wrapper ensures the textarea and shadow text area are the same width.
|
|
180
|
+
// The wrapper's size is determined by the parent grid layout: the textarea and shadow
|
|
181
|
+
// are both set to be 100% of the wrapper.
|
|
182
|
+
// Having the same width is necessary for the height to be calculated correctly
|
|
183
|
+
// so that the value wrapping behavior is correct
|
|
184
|
+
var k = w().div.withConfig({
|
|
185
|
+
displayName: "TextAreaStyles__StyledTextAreaAndShadowWrapper",
|
|
186
|
+
componentId: "gfy8yp-1"
|
|
187
|
+
})([ "", ";position:relative;overflow:hidden;flex-grow:1;grid-column:content;" ], S.mixins.reset("inline-flex"));
|
|
188
|
+
var I = w().textarea.withConfig({
|
|
189
|
+
displayName: "TextAreaStyles__StyledTextArea",
|
|
190
|
+
componentId: "gfy8yp-2"
|
|
191
|
+
})([ "", ";color:", ";position:relative;resize:none;overflow:auto;white-space:pre-wrap;width:100%;line-height:20px;&::placeholder{color:", ";opacity:1;}&[disabled]{cursor:not-allowed;color:", ";&::placeholder{color:", ";}}" ], S.mixins.reset(), S.variables.contentColorActive, S.variables.contentColorMuted, S.variables.contentColorDisabled, S.variables.contentColorDisabled);
|
|
192
|
+
var T = w()(I).withConfig({
|
|
193
|
+
displayName: "TextAreaStyles__StyledTextAreaShadow",
|
|
194
|
+
componentId: "gfy8yp-3"
|
|
195
|
+
})([ "position:absolute;overflow:hidden;left:-10000px;top:-10000px;visibility:hidden;pointer-events:none;" ]);
|
|
196
|
+
var P = (0, g.css)([ "display:inline-flex;min-height:1lh;align-self:start;align-items:center;justify-content:center;pointer-events:none;color:", ";", ";" ], S.variables.contentColorMuted, (function(e) {
|
|
197
|
+
var n = e.$disabled;
|
|
198
|
+
return n && (0, g.css)([ "cursor:not-allowed;color:", ";" ], S.variables.contentColorDisabled);
|
|
199
|
+
}));
|
|
200
|
+
var B = w().div.withConfig({
|
|
201
|
+
displayName: "TextAreaStyles__StyledStartAdornment",
|
|
202
|
+
componentId: "gfy8yp-4"
|
|
203
|
+
})([ "", " grid-column:startAdornment;margin-inline-end:", ";" ], P, S.variables.spacingSmall);
|
|
204
|
+
var M = w().div.withConfig({
|
|
205
|
+
displayName: "TextAreaStyles__StyledEndAdornment",
|
|
206
|
+
componentId: "gfy8yp-5"
|
|
207
|
+
})([ "", " grid-column:endAdornment;margin-inline-start:", ";" ], P, S.variables.spacingSmall);
|
|
208
|
+
// CONCATENATED MODULE: ./src/utils/ssrDocument.ts
|
|
209
|
+
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
210
|
+
var N = {
|
|
211
|
+
body: {
|
|
212
|
+
appendChild: function e() {
|
|
303
213
|
return [];
|
|
304
|
-
},
|
|
305
|
-
getElementById: function e() {
|
|
306
|
-
return null;
|
|
307
|
-
},
|
|
308
|
-
createEvent: function e() {
|
|
309
|
-
return {
|
|
310
|
-
initEvent: function e() {}
|
|
311
|
-
};
|
|
312
|
-
},
|
|
313
|
-
createElement: function e() {
|
|
314
|
-
return {
|
|
315
|
-
children: [],
|
|
316
|
-
childNodes: [],
|
|
317
|
-
style: {},
|
|
318
|
-
setAttribute: function e() {},
|
|
319
|
-
getElementsByTagName: function e() {
|
|
320
|
-
return [];
|
|
321
|
-
}
|
|
322
|
-
};
|
|
323
|
-
},
|
|
324
|
-
createElementNS: function e() {
|
|
325
|
-
return {};
|
|
326
|
-
},
|
|
327
|
-
importNode: function e() {
|
|
328
|
-
return null;
|
|
329
|
-
},
|
|
330
|
-
location: {
|
|
331
|
-
hash: "",
|
|
332
|
-
host: "",
|
|
333
|
-
hostname: "",
|
|
334
|
-
href: "",
|
|
335
|
-
origin: "",
|
|
336
|
-
pathname: "",
|
|
337
|
-
protocol: "",
|
|
338
|
-
search: ""
|
|
339
214
|
}
|
|
340
|
-
}
|
|
341
|
-
function
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
},
|
|
370
|
-
CustomEvent: function e() {
|
|
371
|
-
return this;
|
|
372
|
-
},
|
|
373
|
-
addEventListener: function e() {},
|
|
374
|
-
removeEventListener: function e() {},
|
|
375
|
-
getComputedStyle: function e() {
|
|
376
|
-
return {
|
|
377
|
-
getPropertyValue: function e() {
|
|
378
|
-
return "";
|
|
379
|
-
}
|
|
380
|
-
};
|
|
381
|
-
},
|
|
382
|
-
Image: function e() {},
|
|
383
|
-
Date: function e() {},
|
|
384
|
-
screen: {},
|
|
385
|
-
setTimeout: function e() {},
|
|
386
|
-
clearTimeout: function e() {},
|
|
387
|
-
matchMedia: function e() {
|
|
388
|
-
return {};
|
|
389
|
-
},
|
|
390
|
-
requestAnimationFrame: function e(r) {
|
|
391
|
-
if (typeof setTimeout === "undefined") {
|
|
392
|
-
r();
|
|
393
|
-
return null;
|
|
215
|
+
},
|
|
216
|
+
addEventListener: function e() {},
|
|
217
|
+
removeEventListener: function e() {},
|
|
218
|
+
activeElement: {
|
|
219
|
+
blur: function e() {},
|
|
220
|
+
nodeName: ""
|
|
221
|
+
},
|
|
222
|
+
querySelector: function e() {
|
|
223
|
+
return null;
|
|
224
|
+
},
|
|
225
|
+
querySelectorAll: function e() {
|
|
226
|
+
return [];
|
|
227
|
+
},
|
|
228
|
+
getElementById: function e() {
|
|
229
|
+
return null;
|
|
230
|
+
},
|
|
231
|
+
createEvent: function e() {
|
|
232
|
+
return {
|
|
233
|
+
initEvent: function e() {}
|
|
234
|
+
};
|
|
235
|
+
},
|
|
236
|
+
createElement: function e() {
|
|
237
|
+
return {
|
|
238
|
+
children: [],
|
|
239
|
+
childNodes: [],
|
|
240
|
+
style: {},
|
|
241
|
+
setAttribute: function e() {},
|
|
242
|
+
getElementsByTagName: function e() {
|
|
243
|
+
return [];
|
|
394
244
|
}
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
245
|
+
};
|
|
246
|
+
},
|
|
247
|
+
createElementNS: function e() {
|
|
248
|
+
return {};
|
|
249
|
+
},
|
|
250
|
+
importNode: function e() {
|
|
251
|
+
return null;
|
|
252
|
+
},
|
|
253
|
+
location: {
|
|
254
|
+
hash: "",
|
|
255
|
+
host: "",
|
|
256
|
+
hostname: "",
|
|
257
|
+
href: "",
|
|
258
|
+
origin: "",
|
|
259
|
+
pathname: "",
|
|
260
|
+
protocol: "",
|
|
261
|
+
search: ""
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
function q() {
|
|
265
|
+
var e = typeof document !== "undefined" ? document : N;
|
|
266
|
+
return e;
|
|
267
|
+
}
|
|
268
|
+
var _ = q();
|
|
269
|
+
/* harmony default export */ const D = /* unused pure expression or super */ null && _;
|
|
270
|
+
// CONCATENATED MODULE: ./src/utils/ssrWindow.ts
|
|
271
|
+
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
272
|
+
var $ = {
|
|
273
|
+
document: N,
|
|
274
|
+
navigator: {
|
|
275
|
+
userAgent: ""
|
|
276
|
+
},
|
|
277
|
+
location: {
|
|
278
|
+
hash: "",
|
|
279
|
+
host: "",
|
|
280
|
+
hostname: "",
|
|
281
|
+
href: "",
|
|
282
|
+
origin: "",
|
|
283
|
+
pathname: "",
|
|
284
|
+
protocol: "",
|
|
285
|
+
search: ""
|
|
286
|
+
},
|
|
287
|
+
history: {
|
|
288
|
+
replaceState: function e() {},
|
|
289
|
+
pushState: function e() {},
|
|
290
|
+
go: function e() {},
|
|
291
|
+
back: function e() {}
|
|
292
|
+
},
|
|
293
|
+
CustomEvent: function e() {
|
|
294
|
+
return this;
|
|
295
|
+
},
|
|
296
|
+
addEventListener: function e() {},
|
|
297
|
+
removeEventListener: function e() {},
|
|
298
|
+
getComputedStyle: function e() {
|
|
299
|
+
return {
|
|
300
|
+
getPropertyValue: function e() {
|
|
301
|
+
return "";
|
|
400
302
|
}
|
|
401
|
-
|
|
303
|
+
};
|
|
304
|
+
},
|
|
305
|
+
Image: function e() {},
|
|
306
|
+
Date: function e() {},
|
|
307
|
+
screen: {},
|
|
308
|
+
setTimeout: function e() {},
|
|
309
|
+
clearTimeout: function e() {},
|
|
310
|
+
matchMedia: function e() {
|
|
311
|
+
return {};
|
|
312
|
+
},
|
|
313
|
+
requestAnimationFrame: function e(n) {
|
|
314
|
+
if (typeof setTimeout === "undefined") {
|
|
315
|
+
n();
|
|
316
|
+
return null;
|
|
402
317
|
}
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
318
|
+
return setTimeout(n, 0);
|
|
319
|
+
},
|
|
320
|
+
cancelAnimationFrame: function e(n) {
|
|
321
|
+
if (typeof setTimeout === "undefined") {
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
clearTimeout(n);
|
|
407
325
|
}
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
326
|
+
};
|
|
327
|
+
function F() {
|
|
328
|
+
var e = typeof window !== "undefined" ? window : $;
|
|
329
|
+
return e;
|
|
330
|
+
}
|
|
331
|
+
var R = F();
|
|
332
|
+
/* harmony default export */ const L = R;
|
|
333
|
+
// CONCATENATED MODULE: ./src/utils/updateReactRef.ts
|
|
334
|
+
/**
|
|
412
335
|
* Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
|
|
413
336
|
*
|
|
414
337
|
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
415
338
|
* @param current - The new value of the ref.
|
|
416
339
|
*/
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
340
|
+
function V(e, n) {
|
|
341
|
+
if (e) {
|
|
342
|
+
if (typeof e === "function") {
|
|
343
|
+
e(n);
|
|
344
|
+
} else {
|
|
345
|
+
// the public signature of this util uses React.Ref<T> to mirror the way React types refs.
|
|
346
|
+
// the intention here is to signal "we will take care of setting 'current', not you".
|
|
347
|
+
e.current = n;
|
|
425
348
|
// eslint-disable-line no-param-reassign
|
|
426
|
-
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
// CONCATENATED MODULE: ./src/TextArea/TextArea.tsx
|
|
430
|
-
function V(e) {
|
|
431
|
-
"@babel/helpers - typeof";
|
|
432
|
-
return V = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
433
|
-
return typeof e;
|
|
434
|
-
} : function(e) {
|
|
435
|
-
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
436
|
-
}, V(e);
|
|
349
|
+
}
|
|
437
350
|
}
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
351
|
+
}
|
|
352
|
+
// CONCATENATED MODULE: ./src/TextArea/TextArea.tsx
|
|
353
|
+
function z(e) {
|
|
354
|
+
"@babel/helpers - typeof";
|
|
355
|
+
return z = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
|
|
356
|
+
return typeof e;
|
|
357
|
+
} : function(e) {
|
|
358
|
+
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
359
|
+
}, z(e);
|
|
360
|
+
}
|
|
361
|
+
function K() {
|
|
362
|
+
return K = Object.assign ? Object.assign.bind() : function(e) {
|
|
363
|
+
for (var n = 1; n < arguments.length; n++) {
|
|
364
|
+
var r = arguments[n];
|
|
365
|
+
for (var t in r) {
|
|
366
|
+
({}).hasOwnProperty.call(r, t) && (e[t] = r[t]);
|
|
445
367
|
}
|
|
446
|
-
return e;
|
|
447
|
-
}, $.apply(null, arguments);
|
|
448
|
-
}
|
|
449
|
-
function L(e) {
|
|
450
|
-
return H(e) || K(e) || Z(e) || z();
|
|
451
|
-
}
|
|
452
|
-
function z() {
|
|
453
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
454
|
-
}
|
|
455
|
-
function K(e) {
|
|
456
|
-
if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
|
|
457
|
-
}
|
|
458
|
-
function H(e) {
|
|
459
|
-
if (Array.isArray(e)) return ee(e);
|
|
460
|
-
}
|
|
461
|
-
function W(e, r) {
|
|
462
|
-
var t = Object.keys(e);
|
|
463
|
-
if (Object.getOwnPropertySymbols) {
|
|
464
|
-
var n = Object.getOwnPropertySymbols(e);
|
|
465
|
-
r && (n = n.filter((function(r) {
|
|
466
|
-
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
467
|
-
}))), t.push.apply(t, n);
|
|
468
|
-
}
|
|
469
|
-
return t;
|
|
470
|
-
}
|
|
471
|
-
function U(e) {
|
|
472
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
473
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
474
|
-
r % 2 ? W(Object(t), !0).forEach((function(r) {
|
|
475
|
-
G(e, r, t[r]);
|
|
476
|
-
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : W(Object(t)).forEach((function(r) {
|
|
477
|
-
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
478
|
-
}));
|
|
479
368
|
}
|
|
480
369
|
return e;
|
|
370
|
+
}, K.apply(null, arguments);
|
|
371
|
+
}
|
|
372
|
+
function H(e) {
|
|
373
|
+
return G(e) || U(e) || re(e) || W();
|
|
374
|
+
}
|
|
375
|
+
function W() {
|
|
376
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
377
|
+
}
|
|
378
|
+
function U(e) {
|
|
379
|
+
if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
|
|
380
|
+
}
|
|
381
|
+
function G(e) {
|
|
382
|
+
if (Array.isArray(e)) return te(e);
|
|
383
|
+
}
|
|
384
|
+
function J(e, n) {
|
|
385
|
+
var r = Object.keys(e);
|
|
386
|
+
if (Object.getOwnPropertySymbols) {
|
|
387
|
+
var t = Object.getOwnPropertySymbols(e);
|
|
388
|
+
n && (t = t.filter((function(n) {
|
|
389
|
+
return Object.getOwnPropertyDescriptor(e, n).enumerable;
|
|
390
|
+
}))), r.push.apply(r, t);
|
|
481
391
|
}
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
return "symbol" == V(r) ? r : r + "";
|
|
493
|
-
}
|
|
494
|
-
function Q(e, r) {
|
|
495
|
-
if ("object" != V(e) || !e) return e;
|
|
496
|
-
var t = e[Symbol.toPrimitive];
|
|
497
|
-
if (void 0 !== t) {
|
|
498
|
-
var n = t.call(e, r || "default");
|
|
499
|
-
if ("object" != V(n)) return n;
|
|
500
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
501
|
-
}
|
|
502
|
-
return ("string" === r ? String : Number)(e);
|
|
503
|
-
}
|
|
504
|
-
function X(e, r) {
|
|
505
|
-
return te(e) || re(e, r) || Z(e, r) || Y();
|
|
392
|
+
return r;
|
|
393
|
+
}
|
|
394
|
+
function Q(e) {
|
|
395
|
+
for (var n = 1; n < arguments.length; n++) {
|
|
396
|
+
var r = null != arguments[n] ? arguments[n] : {};
|
|
397
|
+
n % 2 ? J(Object(r), !0).forEach((function(n) {
|
|
398
|
+
X(e, n, r[n]);
|
|
399
|
+
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : J(Object(r)).forEach((function(n) {
|
|
400
|
+
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
401
|
+
}));
|
|
506
402
|
}
|
|
507
|
-
|
|
508
|
-
|
|
403
|
+
return e;
|
|
404
|
+
}
|
|
405
|
+
function X(e, n, r) {
|
|
406
|
+
return (n = Y(n)) in e ? Object.defineProperty(e, n, {
|
|
407
|
+
value: r,
|
|
408
|
+
enumerable: !0,
|
|
409
|
+
configurable: !0,
|
|
410
|
+
writable: !0
|
|
411
|
+
}) : e[n] = r, e;
|
|
412
|
+
}
|
|
413
|
+
function Y(e) {
|
|
414
|
+
var n = Z(e, "string");
|
|
415
|
+
return "symbol" == z(n) ? n : n + "";
|
|
416
|
+
}
|
|
417
|
+
function Z(e, n) {
|
|
418
|
+
if ("object" != z(e) || !e) return e;
|
|
419
|
+
var r = e[Symbol.toPrimitive];
|
|
420
|
+
if (void 0 !== r) {
|
|
421
|
+
var t = r.call(e, n || "default");
|
|
422
|
+
if ("object" != z(t)) return t;
|
|
423
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
509
424
|
}
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
425
|
+
return ("string" === n ? String : Number)(e);
|
|
426
|
+
}
|
|
427
|
+
function ee(e, n) {
|
|
428
|
+
return ae(e) || oe(e, n) || re(e, n) || ne();
|
|
429
|
+
}
|
|
430
|
+
function ne() {
|
|
431
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
432
|
+
}
|
|
433
|
+
function re(e, n) {
|
|
434
|
+
if (e) {
|
|
435
|
+
if ("string" == typeof e) return te(e, n);
|
|
436
|
+
var r = {}.toString.call(e).slice(8, -1);
|
|
437
|
+
return "Object" === r && e.constructor && (r = e.constructor.name), "Map" === r || "Set" === r ? Array.from(e) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? te(e, n) : void 0;
|
|
516
438
|
}
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
return n;
|
|
439
|
+
}
|
|
440
|
+
function te(e, n) {
|
|
441
|
+
(null == n || n > e.length) && (n = e.length);
|
|
442
|
+
for (var r = 0, t = Array(n); r < n; r++) {
|
|
443
|
+
t[r] = e[r];
|
|
523
444
|
}
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
445
|
+
return t;
|
|
446
|
+
}
|
|
447
|
+
function oe(e, n) {
|
|
448
|
+
var r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
449
|
+
if (null != r) {
|
|
450
|
+
var t, o, a, i, l = [], u = !0, c = !1;
|
|
451
|
+
try {
|
|
452
|
+
if (a = (r = r.call(e)).next, 0 === n) {
|
|
453
|
+
if (Object(r) !== r) return;
|
|
454
|
+
u = !1;
|
|
455
|
+
} else for (;!(u = (t = a.call(r)).done) && (l.push(t.value), l.length !== n); u = !0) {
|
|
456
|
+
}
|
|
457
|
+
} catch (e) {
|
|
458
|
+
c = !0, o = e;
|
|
459
|
+
} finally {
|
|
528
460
|
try {
|
|
529
|
-
if (
|
|
530
|
-
if (Object(t) !== t) return;
|
|
531
|
-
u = !1;
|
|
532
|
-
} else for (;!(u = (n = a.call(t)).done) && (l.push(n.value), l.length !== r); u = !0) {
|
|
533
|
-
}
|
|
534
|
-
} catch (e) {
|
|
535
|
-
c = !0, o = e;
|
|
461
|
+
if (!u && null != r["return"] && (i = r["return"](), Object(i) !== i)) return;
|
|
536
462
|
} finally {
|
|
537
|
-
|
|
538
|
-
if (!u && null != t["return"] && (i = t["return"](), Object(i) !== i)) return;
|
|
539
|
-
} finally {
|
|
540
|
-
if (c) throw o;
|
|
541
|
-
}
|
|
463
|
+
if (c) throw o;
|
|
542
464
|
}
|
|
543
|
-
return l;
|
|
544
465
|
}
|
|
466
|
+
return l;
|
|
545
467
|
}
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
}
|
|
468
|
+
}
|
|
469
|
+
function ae(e) {
|
|
470
|
+
if (Array.isArray(e)) return e;
|
|
471
|
+
}
|
|
472
|
+
function ie(e, n) {
|
|
473
|
+
if (null == e) return {};
|
|
474
|
+
var r, t, o = le(e, n);
|
|
475
|
+
if (Object.getOwnPropertySymbols) {
|
|
476
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
477
|
+
for (t = 0; t < a.length; t++) {
|
|
478
|
+
r = a[t], -1 === n.indexOf(r) && {}.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
|
|
557
479
|
}
|
|
558
|
-
return o;
|
|
559
480
|
}
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
481
|
+
return o;
|
|
482
|
+
}
|
|
483
|
+
function le(e, n) {
|
|
484
|
+
if (null == e) return {};
|
|
485
|
+
var r = {};
|
|
486
|
+
for (var t in e) {
|
|
487
|
+
if ({}.hasOwnProperty.call(e, t)) {
|
|
488
|
+
if (-1 !== n.indexOf(t)) continue;
|
|
489
|
+
r[t] = e[t];
|
|
568
490
|
}
|
|
569
|
-
return t;
|
|
570
491
|
}
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
492
|
+
return r;
|
|
493
|
+
}
|
|
494
|
+
/** @public */
|
|
495
|
+
/** @public */
|
|
496
|
+
/** @public */ var ue = {
|
|
497
|
+
append: p().bool,
|
|
498
|
+
autoCapitalize: p().string,
|
|
499
|
+
autoComplete: p().string,
|
|
500
|
+
autoCorrect: p().string,
|
|
501
|
+
autoFocus: p().bool,
|
|
502
|
+
children: p().node,
|
|
503
|
+
defaultValue: p().string,
|
|
504
|
+
describedBy: p().string,
|
|
505
|
+
disabled: p().bool,
|
|
506
|
+
elementRef: p().oneOfType([ p().func, p().object ]),
|
|
507
|
+
endAdornment: p().node,
|
|
508
|
+
error: p().bool,
|
|
509
|
+
inline: p().bool,
|
|
510
|
+
/** @private. */
|
|
511
|
+
inputClassName: p().string,
|
|
512
|
+
inputId: p().string,
|
|
513
|
+
inputRef: p().oneOfType([ p().func, p().object ]),
|
|
514
|
+
labelledBy: p().string,
|
|
515
|
+
maxLength: p().number,
|
|
516
|
+
name: p().string,
|
|
517
|
+
onBlur: p().func,
|
|
518
|
+
onChange: p().func,
|
|
519
|
+
onFocus: p().func,
|
|
520
|
+
onKeyDown: p().func,
|
|
521
|
+
onSelect: p().func,
|
|
522
|
+
onInputClick: p().func,
|
|
523
|
+
prepend: p().bool,
|
|
524
|
+
/** @private. */
|
|
525
|
+
required: p().bool,
|
|
526
|
+
rowsMax: p().number,
|
|
527
|
+
rowsMin: p().number,
|
|
528
|
+
spellCheck: p().bool,
|
|
529
|
+
tabIndex: p().number,
|
|
530
|
+
startAdornment: p().node,
|
|
531
|
+
value: p().string
|
|
532
|
+
};
|
|
533
|
+
var ce = function e() {};
|
|
534
|
+
/** Note: TextArea places role and aria props onto the input. All other props are placed on the wrapper. */ function se(e) {
|
|
535
|
+
var n = e.append, o = n === void 0 ? false : n, i = e.autoCapitalize, u = e.autoComplete, s = e.autoCorrect, f = e.autoFocus, p = f === void 0 ? false : f, v = e.children, m = e.disabled, g = m === void 0 ? false : m, w = e.describedBy, C = e.defaultValue, x = e.elementRef, S = e.error, A = S === void 0 ? false : S, O = e.endAdornment, E = e.inline, P = E === void 0 ? false : E, N = e.inputClassName, q = e.inputId, _ = e.inputRef, D = e.labelledBy, $ = e.maxLength, F = e.name, R = e.onBlur, z = e.onChange, W = e.onFocus, U = e.onInputClick, G = e.onKeyDown, J = e.onSelect, X = e.placeholder, Y = e.prepend, Z = Y === void 0 ? false : Y, ne = e.required, re = e.rowsMin, te = re === void 0 ? 2 : re, oe = e.rowsMax, ae = oe === void 0 ? 8 : oe, le = e.spellCheck, ue = e.startAdornment, se = e.tabIndex, de = se === void 0 ? 0 : se, fe = e.value, pe = ie(e, [ "append", "autoCapitalize", "autoComplete", "autoCorrect", "autoFocus", "children", "disabled", "describedBy", "defaultValue", "elementRef", "error", "endAdornment", "inline", "inputClassName", "inputId", "inputRef", "labelledBy", "maxLength", "name", "onBlur", "onChange", "onFocus", "onInputClick", "onKeyDown", "onSelect", "placeholder", "prepend", "required", "rowsMin", "rowsMax", "spellCheck", "startAdornment", "tabIndex", "value" ]);
|
|
536
|
+
// @docs-props-type TextAreaPropsBase
|
|
537
|
+
(0, r.useEffect)((function() {
|
|
538
|
+
if (false) {}
|
|
539
|
+
}), [ te, ae ]);
|
|
540
|
+
var ve = y()({
|
|
541
|
+
componentName: "TextArea",
|
|
542
|
+
/* eslint-disable-next-line prefer-rest-params */
|
|
543
|
+
componentProps: arguments[0]
|
|
544
|
+
});
|
|
545
|
+
var be = (0, r.useState)(C || ""), me = ee(be, 2), ye = me[0], he = me[1];
|
|
546
|
+
var ge = (0, r.useState)(), we = ee(ge, 2), Ce = we[0], xe = we[1];
|
|
547
|
+
var Se = (0, r.useRef)(null);
|
|
548
|
+
var Ae = (0, r.useRef)(null);
|
|
549
|
+
var Oe = ve ? fe : ye;
|
|
550
|
+
var Ee = (0, r.useCallback)((function(e) {
|
|
551
|
+
Se.current = e;
|
|
552
|
+
V(_, e);
|
|
553
|
+
}), [ _, Se ]);
|
|
554
|
+
var je = (0, r.useCallback)((function(e) {
|
|
555
|
+
G === null || G === void 0 ? void 0 : G(e);
|
|
556
|
+
}), [ G ]);
|
|
557
|
+
var ke = (0, r.useCallback)((function(e) {
|
|
558
|
+
J === null || J === void 0 ? void 0 : J(e);
|
|
559
|
+
}), [ J ]);
|
|
560
|
+
var Ie = (0, r.useCallback)((function(e) {
|
|
561
|
+
U === null || U === void 0 ? void 0 : U(e);
|
|
562
|
+
}), [ U ]);
|
|
563
|
+
var Te = (0, r.useCallback)((function(e) {
|
|
564
|
+
var n = e.target.value;
|
|
565
|
+
W === null || W === void 0 ? void 0 : W(e, {
|
|
566
|
+
value: n,
|
|
567
|
+
name: F
|
|
621
568
|
});
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
var
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
Ce.current = e;
|
|
629
|
-
F(M, e);
|
|
630
|
-
}), [ M, Ce ]);
|
|
631
|
-
var Ee = (0, e.useCallback)((function(e) {
|
|
632
|
-
G === null || G === void 0 ? void 0 : G(e);
|
|
633
|
-
}), [ G ]);
|
|
634
|
-
var je = (0, e.useCallback)((function(e) {
|
|
635
|
-
J === null || J === void 0 ? void 0 : J(e);
|
|
636
|
-
}), [ J ]);
|
|
637
|
-
var Ie = (0, e.useCallback)((function(e) {
|
|
638
|
-
W === null || W === void 0 ? void 0 : W(e);
|
|
639
|
-
}), [ W ]);
|
|
640
|
-
var ke = (0, e.useCallback)((function(e) {
|
|
641
|
-
var r = e.target.value;
|
|
642
|
-
H === null || H === void 0 ? void 0 : H(e, {
|
|
643
|
-
value: r,
|
|
644
|
-
name: V
|
|
645
|
-
});
|
|
646
|
-
}), [ V, H ]);
|
|
647
|
-
var Pe = (0, e.useCallback)((function(e) {
|
|
648
|
-
var r = e.target.value;
|
|
649
|
-
z === null || z === void 0 ? void 0 : z(e, {
|
|
650
|
-
value: r,
|
|
651
|
-
name: V
|
|
652
|
-
});
|
|
653
|
-
}), [ V, z ]);
|
|
654
|
-
var Te = (0, e.useCallback)((function(e) {
|
|
655
|
-
var r = e.target.value;
|
|
656
|
-
if (!pe) {
|
|
657
|
-
ye(r);
|
|
658
|
-
}
|
|
659
|
-
K === null || K === void 0 ? void 0 : K(e, {
|
|
660
|
-
value: r,
|
|
661
|
-
name: V
|
|
662
|
-
});
|
|
663
|
-
}), [ K, ye, pe, V ]);
|
|
664
|
-
var Be = (0, e.useCallback)((function() {
|
|
665
|
-
var e = m({
|
|
666
|
-
height: xe,
|
|
667
|
-
rowsMax: ae,
|
|
668
|
-
rowsMin: te,
|
|
669
|
-
shadow: Se.current
|
|
670
|
-
});
|
|
671
|
-
if (e !== false) {
|
|
672
|
-
we(e);
|
|
673
|
-
}
|
|
674
|
-
}), [ we, Se, ae, te, xe ]);
|
|
675
|
-
var Ne = (0, e.useMemo)((function() {
|
|
676
|
-
return d()(Be, 100);
|
|
677
|
-
}), [ Be ]);
|
|
678
|
-
(0, e.useLayoutEffect)((function() {
|
|
679
|
-
Be();
|
|
680
|
-
}));
|
|
681
|
-
var qe = U(U({}, c()(fe, (function(e, r) {
|
|
682
|
-
return r === "role" || r.indexOf("aria-") === 0;
|
|
683
|
-
}))), {}, {
|
|
684
|
-
"aria-describedby": g,
|
|
685
|
-
"aria-labelledby": D,
|
|
686
|
-
"aria-invalid": S || undefined
|
|
569
|
+
}), [ F, W ]);
|
|
570
|
+
var Pe = (0, r.useCallback)((function(e) {
|
|
571
|
+
var n = e.target.value;
|
|
572
|
+
R === null || R === void 0 ? void 0 : R(e, {
|
|
573
|
+
value: n,
|
|
574
|
+
name: F
|
|
687
575
|
});
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
autoComplete: u,
|
|
698
|
-
autoCorrect: s,
|
|
699
|
-
autoFocus: p,
|
|
700
|
-
className: N,
|
|
701
|
-
disabled: h,
|
|
702
|
-
id: q,
|
|
703
|
-
maxLength: _,
|
|
704
|
-
name: V,
|
|
705
|
-
onBlur: Pe,
|
|
706
|
-
onChange: Te,
|
|
707
|
-
onFocus: ke,
|
|
708
|
-
onKeyDown: Ee,
|
|
709
|
-
onSelect: je,
|
|
710
|
-
onClick: Ie,
|
|
711
|
-
placeholder: Q,
|
|
712
|
-
// support HTML attribute
|
|
713
|
-
ref: Ae,
|
|
714
|
-
required: ee,
|
|
715
|
-
spellCheck: le,
|
|
716
|
-
style: {
|
|
717
|
-
height: xe
|
|
718
|
-
},
|
|
719
|
-
tabIndex: se,
|
|
720
|
-
value: Oe,
|
|
721
|
-
$error: S
|
|
576
|
+
}), [ F, R ]);
|
|
577
|
+
var Be = (0, r.useCallback)((function(e) {
|
|
578
|
+
var n = e.target.value;
|
|
579
|
+
if (!ve) {
|
|
580
|
+
he(n);
|
|
581
|
+
}
|
|
582
|
+
z === null || z === void 0 ? void 0 : z(e, {
|
|
583
|
+
value: n,
|
|
584
|
+
name: F
|
|
722
585
|
});
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
}
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
})
|
|
755
|
-
|
|
586
|
+
}), [ z, he, ve, F ]);
|
|
587
|
+
var Me = (0, r.useCallback)((function() {
|
|
588
|
+
var e = h({
|
|
589
|
+
height: Ce,
|
|
590
|
+
rowsMax: ae,
|
|
591
|
+
rowsMin: te,
|
|
592
|
+
shadow: Ae.current
|
|
593
|
+
});
|
|
594
|
+
if (e !== false) {
|
|
595
|
+
xe(e);
|
|
596
|
+
}
|
|
597
|
+
}), [ xe, Ae, ae, te, Ce ]);
|
|
598
|
+
var Ne = (0, r.useMemo)((function() {
|
|
599
|
+
return d()(Me, 100);
|
|
600
|
+
}), [ Me ]);
|
|
601
|
+
(0, r.useLayoutEffect)((function() {
|
|
602
|
+
Me();
|
|
603
|
+
}));
|
|
604
|
+
var qe = Q(Q({}, c()(pe, (function(e, n) {
|
|
605
|
+
return n === "role" || n.indexOf("aria-") === 0;
|
|
606
|
+
}))), {}, {
|
|
607
|
+
"aria-describedby": w,
|
|
608
|
+
"aria-labelledby": D,
|
|
609
|
+
"aria-invalid": A || undefined
|
|
610
|
+
});
|
|
611
|
+
var _e = l()(pe, [ "inputRef", "onBlur", "onChange", "onFocus", "onKeyDown", "onSelect", "onInputClick" ].concat(H(a()(qe))));
|
|
612
|
+
var De = {
|
|
613
|
+
$append: o || undefined,
|
|
614
|
+
$error: A,
|
|
615
|
+
$prepend: Z || undefined
|
|
616
|
+
};
|
|
617
|
+
var $e = Q(Q({}, qe), {}, {
|
|
618
|
+
"data-test": "textbox",
|
|
619
|
+
autoCapitalize: i,
|
|
620
|
+
autoComplete: u,
|
|
621
|
+
autoCorrect: s,
|
|
622
|
+
autoFocus: p,
|
|
623
|
+
className: N,
|
|
624
|
+
disabled: g,
|
|
625
|
+
id: q,
|
|
626
|
+
maxLength: $,
|
|
627
|
+
name: F,
|
|
628
|
+
onBlur: Pe,
|
|
629
|
+
onChange: Be,
|
|
630
|
+
onFocus: Te,
|
|
631
|
+
onKeyDown: je,
|
|
632
|
+
onSelect: ke,
|
|
633
|
+
onClick: Ie,
|
|
634
|
+
placeholder: X,
|
|
635
|
+
// support HTML attribute
|
|
636
|
+
ref: Ee,
|
|
637
|
+
required: ne,
|
|
638
|
+
spellCheck: le,
|
|
639
|
+
style: {
|
|
640
|
+
height: Ce
|
|
641
|
+
},
|
|
642
|
+
tabIndex: de,
|
|
643
|
+
value: Oe,
|
|
644
|
+
$error: A
|
|
645
|
+
});
|
|
646
|
+
|
|
647
|
+
return t().createElement(t().Fragment, null, t().createElement(j, K({
|
|
648
|
+
tabIndex: -1,
|
|
649
|
+
"data-test": "text-area",
|
|
650
|
+
"data-test-value": Oe,
|
|
651
|
+
"data-test-disabled": g ? "disabled" : undefined,
|
|
652
|
+
elementRef: x,
|
|
653
|
+
$inline: P,
|
|
654
|
+
disabled: g
|
|
655
|
+
}, _e, De), ue && t().createElement(B, {
|
|
656
|
+
$disabled: !!g
|
|
657
|
+
}, ue), t().createElement(k, null, t().createElement(T, {
|
|
658
|
+
"aria-hidden": "true",
|
|
659
|
+
tabIndex: -1,
|
|
660
|
+
onChange: ce,
|
|
661
|
+
rows: te,
|
|
662
|
+
ref: Ae,
|
|
663
|
+
value: X && !Oe ? X : Oe
|
|
664
|
+
}), t().createElement(I, $e)), v, O && t().createElement(M, {
|
|
665
|
+
$disabled: !!g
|
|
666
|
+
}, O)), t().createElement(b(), {
|
|
667
|
+
target: L,
|
|
668
|
+
eventType: "resize",
|
|
669
|
+
listener: Ne
|
|
670
|
+
}));
|
|
671
|
+
}
|
|
672
|
+
se.propTypes = ue;
|
|
673
|
+
se.componentType = "TextArea";
|
|
674
|
+
/* harmony default export */ const de = se;
|
|
675
|
+
// only for styled components using TextArea
|
|
676
|
+
// CONCATENATED MODULE: ./src/TextArea/index.ts
|
|
756
677
|
module.exports = n;
|
|
757
678
|
/******/})();
|