@splunk/react-ui 4.3.0 → 4.5.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 +37 -21
- package/Anchor.js +2 -2
- package/Animation.js +2 -2
- package/AnimationToggle.js +2 -2
- package/Box.js +2 -2
- package/Button.js +36 -12
- package/ButtonGroup.js +27 -6
- package/ButtonSimple.js +6 -6
- package/CHANGELOG.md +57 -0
- package/Calendar.js +14 -14
- package/Card.js +51 -25
- package/CardLayout.js +31 -10
- package/Chip.js +77 -53
- package/Clickable.js +6 -6
- package/CloseButton.js +6 -6
- package/Code.js +1279 -1120
- package/CollapsiblePanel.js +6 -6
- package/Color.js +180 -209
- package/ColumnLayout.js +4 -4
- package/ComboBox.js +22 -17
- package/Concertina.js +56 -51
- package/ControlGroup.js +121 -32
- package/Date.js +62 -25
- package/DefinitionList.js +2 -2
- package/Dropdown.js +12 -12
- package/EventListener.js +168 -0
- package/FetchOptions.js +8 -8
- package/File.js +122 -96
- package/FormRows.js +66 -58
- package/Heading.js +2 -2
- package/Image.js +14 -14
- package/JSONTree.js +5 -5
- package/Layer.js +32 -20
- package/Link.js +8 -8
- package/List.js +2 -2
- package/Markdown.js +250 -88
- package/Menu.js +70 -64
- package/Message.js +18 -18
- package/Modal.js +70 -16
- package/ModalLayer.js +4 -4
- package/Monogram.js +12 -11
- package/Multiselect.js +124 -80
- package/Number.js +44 -34
- package/Paginator.js +10 -10
- package/Paragraph.js +2 -2
- package/Popover.js +54 -40
- package/Progress.js +8 -8
- package/RadioBar.js +45 -38
- package/RadioList.js +2 -2
- package/Resize.js +19 -15
- package/ResultsMenu.js +6 -6
- package/ScreenReaderContent.js +2 -2
- package/Scroll.js +25 -23
- package/ScrollContainerContext.js +5 -5
- package/Search.d.ts +2 -0
- package/Search.js +797 -0
- package/Select.js +85 -45
- package/SidePanel.js +6 -6
- package/Slider.js +34 -30
- package/SlidingPanels.js +6 -6
- package/StaticContent.js +2 -2
- package/StepBar.js +56 -52
- package/Switch.js +8 -8
- package/TabBar.js +126 -85
- package/TabLayout.js +4 -5
- package/Table.js +266 -155
- package/Text.js +486 -401
- package/Tooltip.js +11 -11
- package/TransitionOpen.js +11 -11
- package/WaitSpinner.js +3 -4
- package/package.json +5 -6
- package/types/src/Accordion/AccordionContext.d.ts +10 -0
- package/types/src/Accordion/Panel.d.ts +0 -9
- package/types/src/Button/Button.d.ts +4 -2
- package/types/src/ButtonGroup/ButtonGroupContext.d.ts +7 -0
- package/types/src/ButtonSimple/ButtonSimple.d.ts +5 -5
- package/types/src/Card/Card.d.ts +2 -0
- package/types/src/CardLayout/CardLayoutContext.d.ts +8 -0
- package/types/src/Color/Color.d.ts +2 -2
- package/types/src/Color/Swatch.d.ts +4 -15
- package/types/src/ComboBox/ComboBox.d.ts +4 -3
- package/types/src/Concertina/ConcertinaContext.d.ts +8 -0
- package/types/src/Concertina/Panel.d.ts +2 -4
- package/types/src/ControlGroup/ControlGroup.d.ts +11 -1
- package/types/src/ControlGroup/ControlGroupContext.d.ts +15 -0
- package/types/src/Date/Date.d.ts +6 -4
- package/types/src/EventListener/EventListener.d.ts +18 -0
- package/types/src/EventListener/index.d.ts +2 -0
- package/types/src/File/File.d.ts +6 -4
- package/types/src/File/FileContext.d.ts +9 -0
- package/types/src/File/Item.d.ts +5 -10
- package/types/src/FormRows/FormRows.d.ts +2 -2
- package/types/src/FormRows/FormRowsContext.d.ts +10 -0
- package/types/src/FormRows/Row.d.ts +5 -16
- package/types/src/Markdown/Markdown.d.ts +2 -0
- package/types/src/Markdown/renderers/MarkdownBlockquote.d.ts +14 -0
- package/types/src/Markdown/renderers/MarkdownCode.d.ts +15 -0
- package/types/src/Markdown/renderers/MarkdownCodeBlock.d.ts +16 -0
- package/types/src/Markdown/renderers/MarkdownHeading.d.ts +15 -0
- package/types/src/Markdown/renderers/MarkdownImage.d.ts +18 -0
- package/types/src/Markdown/renderers/MarkdownItem.d.ts +14 -0
- package/types/src/Markdown/renderers/MarkdownLink.d.ts +18 -0
- package/types/src/Markdown/renderers/MarkdownList.d.ts +26 -0
- package/types/src/Markdown/renderers/MarkdownParagraph.d.ts +14 -0
- package/types/src/Markdown/renderers/index.d.ts +10 -0
- package/types/src/Modal/Modal.d.ts +15 -3
- package/types/src/Monogram/Monogram.d.ts +5 -1
- package/types/src/Multiselect/Compact.d.ts +12 -4
- package/types/src/Multiselect/Multiselect.d.ts +14 -4
- package/types/src/Multiselect/Normal.d.ts +7 -2
- package/types/src/Number/Number.d.ts +11 -7
- package/types/src/Popover/Popover.d.ts +2 -2
- package/types/src/RadioBar/Option.d.ts +1 -15
- package/types/src/RadioBar/RadioBar.d.ts +2 -2
- package/types/src/RadioBar/RadioBarContext.d.ts +9 -0
- package/types/src/Scroll/Inner.d.ts +2 -2
- package/types/src/ScrollContainerContext/ScrollContainerContext.d.ts +4 -4
- package/types/src/Search/Option.d.ts +60 -0
- package/types/src/Search/Search.d.ts +97 -0
- package/types/src/Search/index.d.ts +2 -0
- package/types/src/Select/Select.d.ts +6 -2
- package/types/src/Select/SelectBase.d.ts +12 -5
- package/types/src/Slider/Slider.d.ts +2 -2
- package/types/src/StepBar/Step.d.ts +1 -13
- package/types/src/StepBar/StepBarContext.d.ts +8 -0
- package/types/src/TabBar/Tab.d.ts +5 -13
- package/types/src/TabBar/TabBarContext.d.ts +14 -0
- package/types/src/Table/Body.d.ts +1 -1
- package/types/src/Table/Head.d.ts +3 -1
- package/types/src/Table/HeadCell.d.ts +1 -1
- package/types/src/Table/HeadInner.d.ts +3 -3
- package/types/src/Table/Row.d.ts +10 -3
- package/types/src/Table/Table.d.ts +10 -5
- package/types/src/Text/Text.d.ts +33 -12
- package/types/src/icons/Sort.d.ts +3 -0
- package/types/src/usePrevious/index.d.ts +2 -0
- package/types/src/usePrevious/usePrevious.d.ts +12 -0
- package/usePrevious.js +137 -0
package/Text.js
CHANGED
|
@@ -82,7 +82,7 @@ module.exports =
|
|
|
82
82
|
/******/
|
|
83
83
|
/******/
|
|
84
84
|
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 122);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -101,21 +101,48 @@ module.exports = require("prop-types");
|
|
|
101
101
|
|
|
102
102
|
/***/ }),
|
|
103
103
|
|
|
104
|
-
/***/
|
|
104
|
+
/***/ 104:
|
|
105
105
|
/***/ (function(module, exports) {
|
|
106
106
|
|
|
107
|
-
module.exports = require("@splunk/react-
|
|
107
|
+
module.exports = require("@splunk/react-ui/ControlGroup");
|
|
108
108
|
|
|
109
109
|
/***/ }),
|
|
110
110
|
|
|
111
|
-
/***/
|
|
111
|
+
/***/ 105:
|
|
112
112
|
/***/ (function(module, exports) {
|
|
113
113
|
|
|
114
|
-
module.exports = require("
|
|
114
|
+
module.exports = require("@splunk/react-icons/Search");
|
|
115
|
+
|
|
116
|
+
/***/ }),
|
|
117
|
+
|
|
118
|
+
/***/ 11:
|
|
119
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
120
|
+
|
|
121
|
+
"use strict";
|
|
122
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return updateReactRef; });
|
|
123
|
+
/**
|
|
124
|
+
* Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
|
|
125
|
+
*
|
|
126
|
+
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
127
|
+
* @param current - The new value of the ref.
|
|
128
|
+
*/
|
|
129
|
+
function updateReactRef(ref, current) {
|
|
130
|
+
if (ref) {
|
|
131
|
+
if (typeof ref === 'function') {
|
|
132
|
+
ref(current);
|
|
133
|
+
} else {
|
|
134
|
+
// the public signature of this util uses React.Ref<T> to mirror the way React types refs.
|
|
135
|
+
// the intention here is to signal "we will take care of setting 'current', not you".
|
|
136
|
+
ref.current = current; // eslint-disable-line no-param-reassign
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
|
|
115
142
|
|
|
116
143
|
/***/ }),
|
|
117
144
|
|
|
118
|
-
/***/
|
|
145
|
+
/***/ 122:
|
|
119
146
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
120
147
|
|
|
121
148
|
"use strict";
|
|
@@ -133,28 +160,31 @@ var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_)
|
|
|
133
160
|
var external_prop_types_ = __webpack_require__(1);
|
|
134
161
|
var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
|
|
135
162
|
|
|
136
|
-
// EXTERNAL MODULE: external "react-event-listener"
|
|
137
|
-
var external_react_event_listener_ = __webpack_require__(15);
|
|
138
|
-
var external_react_event_listener_default = /*#__PURE__*/__webpack_require__.n(external_react_event_listener_);
|
|
139
|
-
|
|
140
163
|
// EXTERNAL MODULE: external "lodash"
|
|
141
164
|
var external_lodash_ = __webpack_require__(4);
|
|
142
165
|
|
|
143
166
|
// EXTERNAL MODULE: external "@splunk/ui-utils/style"
|
|
144
|
-
var style_ = __webpack_require__(
|
|
167
|
+
var style_ = __webpack_require__(39);
|
|
168
|
+
|
|
169
|
+
// EXTERNAL MODULE: external "@splunk/react-ui/EventListener"
|
|
170
|
+
var EventListener_ = __webpack_require__(14);
|
|
171
|
+
var EventListener_default = /*#__PURE__*/__webpack_require__.n(EventListener_);
|
|
145
172
|
|
|
146
173
|
// EXTERNAL MODULE: external "@splunk/react-ui/ScreenReaderContent"
|
|
147
|
-
var ScreenReaderContent_ = __webpack_require__(
|
|
174
|
+
var ScreenReaderContent_ = __webpack_require__(15);
|
|
148
175
|
var ScreenReaderContent_default = /*#__PURE__*/__webpack_require__.n(ScreenReaderContent_);
|
|
149
176
|
|
|
150
177
|
// EXTERNAL MODULE: external "@splunk/themes"
|
|
151
178
|
var themes_ = __webpack_require__(0);
|
|
152
179
|
|
|
180
|
+
// EXTERNAL MODULE: external "@splunk/react-ui/ControlGroup"
|
|
181
|
+
var ControlGroup_ = __webpack_require__(104);
|
|
182
|
+
|
|
153
183
|
// EXTERNAL MODULE: external "@splunk/ui-utils/i18n"
|
|
154
184
|
var i18n_ = __webpack_require__(5);
|
|
155
185
|
|
|
156
186
|
// EXTERNAL MODULE: external "@splunk/react-icons/Search"
|
|
157
|
-
var Search_ = __webpack_require__(
|
|
187
|
+
var Search_ = __webpack_require__(105);
|
|
158
188
|
var Search_default = /*#__PURE__*/__webpack_require__.n(Search_);
|
|
159
189
|
|
|
160
190
|
// EXTERNAL MODULE: ./src/icons/ThemedIcon.tsx
|
|
@@ -201,7 +231,7 @@ function Search(props) {
|
|
|
201
231
|
}, props));
|
|
202
232
|
}
|
|
203
233
|
// EXTERNAL MODULE: ./src/icons/CrossMark.tsx
|
|
204
|
-
var CrossMark = __webpack_require__(
|
|
234
|
+
var CrossMark = __webpack_require__(22);
|
|
205
235
|
|
|
206
236
|
// CONCATENATED MODULE: ./src/Text/syncHeightWithShadow.ts
|
|
207
237
|
// This file was adapted from [Call-Em-All's material-ui](https://github.com/mui-org/material-ui),
|
|
@@ -279,10 +309,10 @@ function syncHeightWithShadow(_ref) {
|
|
|
279
309
|
return false;
|
|
280
310
|
}
|
|
281
311
|
// EXTERNAL MODULE: ./src/utils/updateReactRef.ts
|
|
282
|
-
var updateReactRef = __webpack_require__(
|
|
312
|
+
var updateReactRef = __webpack_require__(11);
|
|
283
313
|
|
|
284
314
|
// EXTERNAL MODULE: external "@splunk/react-icons/SVG"
|
|
285
|
-
var SVG_ = __webpack_require__(
|
|
315
|
+
var SVG_ = __webpack_require__(23);
|
|
286
316
|
var SVG_default = /*#__PURE__*/__webpack_require__.n(SVG_);
|
|
287
317
|
|
|
288
318
|
// CONCATENATED MODULE: ./src/Text/IconOutlinedHide.tsx
|
|
@@ -301,7 +331,7 @@ function IconOutlinedHide(props) {
|
|
|
301
331
|
if (family === 'enterprise') {
|
|
302
332
|
return /*#__PURE__*/external_react_default.a.createElement(SVG_default.a, IconOutlinedHide_extends({
|
|
303
333
|
viewBox: "0 0 24 24",
|
|
304
|
-
size: 1,
|
|
334
|
+
size: 1.2,
|
|
305
335
|
screenReaderText: Object(i18n_["_"])('Hide password')
|
|
306
336
|
}, props), /*#__PURE__*/external_react_default.a.createElement("path", {
|
|
307
337
|
fillRule: "evenodd",
|
|
@@ -357,7 +387,7 @@ function IconOutlinedView(props) {
|
|
|
357
387
|
if (family === 'enterprise') {
|
|
358
388
|
return /*#__PURE__*/external_react_default.a.createElement(SVG_default.a, IconOutlinedView_extends({
|
|
359
389
|
viewBox: "0 0 24 24",
|
|
360
|
-
size: 1,
|
|
390
|
+
size: 1.2,
|
|
361
391
|
screenReaderText: Object(i18n_["_"])('View password')
|
|
362
392
|
}, props), /*#__PURE__*/external_react_default.a.createElement("path", {
|
|
363
393
|
fillRule: "evenodd",
|
|
@@ -395,10 +425,6 @@ function IconOutlinedView(props) {
|
|
|
395
425
|
}
|
|
396
426
|
|
|
397
427
|
/* harmony default export */ var Text_IconOutlinedView = (IconOutlinedView);
|
|
398
|
-
// EXTERNAL MODULE: external "lodash/startCase"
|
|
399
|
-
var startCase_ = __webpack_require__(102);
|
|
400
|
-
var startCase_default = /*#__PURE__*/__webpack_require__.n(startCase_);
|
|
401
|
-
|
|
402
428
|
// EXTERNAL MODULE: external "styled-components"
|
|
403
429
|
var external_styled_components_ = __webpack_require__(3);
|
|
404
430
|
var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
|
|
@@ -408,7 +434,7 @@ var Box_ = __webpack_require__(8);
|
|
|
408
434
|
var Box_default = /*#__PURE__*/__webpack_require__.n(Box_);
|
|
409
435
|
|
|
410
436
|
// EXTERNAL MODULE: external "@splunk/react-ui/Button"
|
|
411
|
-
var Button_ = __webpack_require__(
|
|
437
|
+
var Button_ = __webpack_require__(17);
|
|
412
438
|
var Button_default = /*#__PURE__*/__webpack_require__.n(Button_);
|
|
413
439
|
|
|
414
440
|
// CONCATENATED MODULE: ./src/Text/TextStyles.ts
|
|
@@ -416,210 +442,135 @@ var Button_default = /*#__PURE__*/__webpack_require__.n(Button_);
|
|
|
416
442
|
|
|
417
443
|
|
|
418
444
|
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
var TextStyles_addPadding = function addPadding(property, type, base) {
|
|
422
|
-
return Object(external_styled_components_["css"])(["", ":", ";"],
|
|
423
|
-
/* sc-prop */
|
|
424
|
-
property, function (_ref) {
|
|
425
|
-
var $customStyle = _ref.$customStyle;
|
|
426
|
-
var custom = $customStyle && $customStyle["padding".concat(startCase_default()(type))] || '0px';
|
|
427
|
-
return custom ? Object(external_styled_components_["css"])(["calc(", " + ", ")"], base, custom) : base;
|
|
428
|
-
});
|
|
429
|
-
};
|
|
430
|
-
|
|
431
|
-
var leftIconPadding = Object(external_styled_components_["css"])(["", ""], function (props) {
|
|
432
|
-
var padding = Object(themes_["pick"])({
|
|
433
|
-
prisma: {
|
|
434
|
-
compact: '35px',
|
|
435
|
-
comfortable: '39px'
|
|
436
|
-
}
|
|
437
|
-
});
|
|
438
|
-
|
|
439
|
-
if (padding) {
|
|
440
|
-
var paddingResult = padding(props);
|
|
441
|
-
return TextStyles_addPadding('padding-left', 'left', paddingResult);
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
return '';
|
|
445
|
-
});
|
|
446
|
-
var rightIconPadding = Object(external_styled_components_["css"])(["", ""], function (props) {
|
|
447
|
-
var padding = Object(themes_["pick"])({
|
|
448
|
-
enterprise: {
|
|
449
|
-
comfortable: '28px',
|
|
450
|
-
compact: '24px'
|
|
451
|
-
},
|
|
452
|
-
prisma: {
|
|
453
|
-
comfortable: '40px',
|
|
454
|
-
compact: '36px'
|
|
455
|
-
}
|
|
456
|
-
});
|
|
457
|
-
|
|
458
|
-
if (padding) {
|
|
459
|
-
var paddingResult = padding(props);
|
|
460
|
-
return TextStyles_addPadding('padding-right', 'right', paddingResult);
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
return '';
|
|
464
|
-
});
|
|
465
|
-
var disabledStyles = Object(external_styled_components_["css"])(["&,&[type]{color:", ";&::placeholder{color:", ";}", " box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);cursor:not-allowed;}"], Object(themes_["pick"])({
|
|
445
|
+
var disabledStyles = Object(external_styled_components_["css"])(["&,&[type]{cursor:not-allowed;color:", ";&::placeholder{color:", ";}}"], Object(themes_["pick"])({
|
|
466
446
|
enterprise: themes_["variables"].textDisabledColor,
|
|
467
447
|
prisma: themes_["variables"].contentColorDisabled
|
|
468
448
|
}), Object(themes_["pick"])({
|
|
469
449
|
enterprise: themes_["variables"].textDisabledColor,
|
|
470
450
|
prisma: themes_["variables"].contentColorDisabled
|
|
471
|
-
}), Object(themes_["pick"])({
|
|
472
|
-
enterprise: {
|
|
473
|
-
light: Object(external_styled_components_["css"])(["background-color:", ";border-color:", ";"], themes_["variables"].gray96, themes_["variables"].gray92),
|
|
474
|
-
dark: Object(external_styled_components_["css"])(["background-color:", ";border-color:", ";"], themes_["variables"].gray22, themes_["variables"].gray30)
|
|
475
|
-
},
|
|
476
|
-
prisma: Object(external_styled_components_["css"])(["border-color:", ";"], themes_["variables"].interactiveColorBorderDisabled)
|
|
477
451
|
}));
|
|
478
|
-
var
|
|
479
|
-
displayName: "TextStyles__StyledClearButton",
|
|
480
|
-
componentId: "eg7n6t-0"
|
|
481
|
-
})(["", ";border-radius:", ";cursor:pointer;font-size:0.83333em;position:absolute;top:", ";visibility:hidden;z-index:1;", " &:not([disabled]){color:", ";}", ""], themes_["mixins"].reset('inline'), Object(themes_["pick"])({
|
|
452
|
+
var buttonStyles = Object(external_styled_components_["css"])(["border-radius:", ";cursor:pointer;font-size:0.83333em;flex-grow:0;", ";&:not([disabled]){color:", ";}"], Object(themes_["pick"])({
|
|
482
453
|
enterprise: themes_["variables"].borderRadius,
|
|
483
454
|
prisma: '50%'
|
|
484
455
|
}), Object(themes_["pick"])({
|
|
485
|
-
enterprise:
|
|
456
|
+
enterprise: Object(external_styled_components_["css"])(["width:", ";height:", ";"], themes_["variables"].inputHeight, themes_["variables"].inputHeight),
|
|
486
457
|
prisma: {
|
|
487
|
-
comfortable:
|
|
488
|
-
compact:
|
|
458
|
+
comfortable: Object(external_styled_components_["css"])(["width:26px;min-width:26px;min-height:26px;margin:8px;padding:0;"]),
|
|
459
|
+
compact: Object(external_styled_components_["css"])(["width:22px;min-width:22px;min-height:22px;margin:8px;padding:0;"])
|
|
489
460
|
}
|
|
490
461
|
}), Object(themes_["pick"])({
|
|
491
462
|
enterprise: {
|
|
492
|
-
|
|
493
|
-
|
|
463
|
+
light: themes_["variables"].gray60,
|
|
464
|
+
dark: themes_["variables"].white
|
|
494
465
|
},
|
|
495
|
-
prisma:
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
466
|
+
prisma: themes_["variables"].contentColorDefault
|
|
467
|
+
}));
|
|
468
|
+
var StyledClearButton = external_styled_components_default()(Button_default.a).withConfig({
|
|
469
|
+
displayName: "TextStyles__StyledClearButton",
|
|
470
|
+
componentId: "eg7n6t-0"
|
|
471
|
+
})(["display:none;visibility:hidden;", ""], buttonStyles);
|
|
472
|
+
var StyledSearchIconWrapper = external_styled_components_default.a.span.withConfig({
|
|
473
|
+
displayName: "TextStyles__StyledSearchIconWrapper",
|
|
474
|
+
componentId: "eg7n6t-1"
|
|
475
|
+
})(["", ";color:", ";pointer-events:none;padding:", ";&[disabled]{", ";}"], themes_["mixins"].reset('inline-block'), Object(themes_["pick"])({
|
|
500
476
|
enterprise: {
|
|
501
477
|
light: themes_["variables"].gray60,
|
|
502
478
|
dark: themes_["variables"].white
|
|
503
479
|
},
|
|
504
|
-
prisma: themes_["variables"].
|
|
505
|
-
}),
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
if (padding) {
|
|
512
|
-
var paddingResult = padding(props);
|
|
513
|
-
return TextStyles_addPadding('right', 'right', paddingResult);
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
return '';
|
|
517
|
-
});
|
|
480
|
+
prisma: themes_["variables"].contentColorMuted
|
|
481
|
+
}), Object(themes_["pick"])({
|
|
482
|
+
comfortable: '0 8px',
|
|
483
|
+
compact: '0 6px'
|
|
484
|
+
}), Object(themes_["pick"])({
|
|
485
|
+
prisma: Object(external_styled_components_["css"])(["color:", ";"], themes_["variables"].contentColorDisabled)
|
|
486
|
+
}));
|
|
518
487
|
var StyledBox = external_styled_components_default()(Box_default.a).withConfig({
|
|
519
488
|
displayName: "TextStyles__StyledBox",
|
|
520
|
-
componentId: "eg7n6t-
|
|
521
|
-
})(["flex-grow:1;flex-shrink:1;position:relative;&[data-inline]{width:230px;flex-basis:230px;[data-inline] + &{margin-left:", ";}}", "
|
|
489
|
+
componentId: "eg7n6t-2"
|
|
490
|
+
})(["display:flex;justify-content:space-between;flex-grow:1;flex-shrink:1;position:relative;&[data-inline]{width:230px;flex-basis:230px;[data-inline] + &{margin-left:", ";}}&:focus-within:not([disabled]){", "{", "}", "{visibility:visible;display:block;}}", ""], Object(themes_["pick"])({
|
|
522
491
|
enterprise: themes_["variables"].spacingHalf,
|
|
523
492
|
prisma: themes_["variables"].spacingSmall
|
|
524
|
-
}),
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
/* sc-sel */
|
|
533
|
-
StyledClearButton);
|
|
534
|
-
}, function (_ref4) {
|
|
535
|
-
var $isTimeInput = _ref4.$isTimeInput;
|
|
493
|
+
}),
|
|
494
|
+
/* sc-sel */
|
|
495
|
+
StyledSearchIconWrapper, Object(themes_["pick"])({
|
|
496
|
+
enterprise: Object(external_styled_components_["css"])(["display:none;"])
|
|
497
|
+
}),
|
|
498
|
+
/* sc-sel */
|
|
499
|
+
StyledClearButton, function (_ref) {
|
|
500
|
+
var $isTimeInput = _ref.$isTimeInput;
|
|
536
501
|
return $isTimeInput && Object(external_styled_components_["css"])(["@media screen and (min--moz-device-pixel-ratio:0){", "{display:none;}}"],
|
|
537
502
|
/* sc-sel */
|
|
538
503
|
StyledClearButton);
|
|
539
504
|
});
|
|
540
|
-
var
|
|
541
|
-
displayName: "
|
|
542
|
-
componentId: "eg7n6t-
|
|
543
|
-
})(["", ";
|
|
505
|
+
var StyledInputWrapper = external_styled_components_default.a.span.withConfig({
|
|
506
|
+
displayName: "TextStyles__StyledInputWrapper",
|
|
507
|
+
componentId: "eg7n6t-3"
|
|
508
|
+
})(["", ";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:", ";align-items:center;", " ", " &:hover:not([disabled]){border-color:", ";}&:focus-within:not([disabled]){", "}", " ", " ", " ", " ", ""], themes_["mixins"].reset('inline-flex'), themes_["variables"].inputHeight, Object(themes_["pick"])({
|
|
544
509
|
enterprise: {
|
|
545
|
-
|
|
546
|
-
|
|
510
|
+
light: themes_["variables"].gray60,
|
|
511
|
+
dark: themes_["variables"].gray20
|
|
547
512
|
},
|
|
548
|
-
prisma:
|
|
549
|
-
|
|
550
|
-
compact: '1px'
|
|
551
|
-
}
|
|
552
|
-
}), Object(themes_["pick"])({
|
|
553
|
-
enterprise: '1px',
|
|
554
|
-
prisma: {
|
|
555
|
-
comfortable: '6px',
|
|
556
|
-
compact: '5px'
|
|
557
|
-
}
|
|
558
|
-
}), Object(themes_["pick"])({
|
|
559
|
-
enterprise: themes_["variables"].borderRadius,
|
|
560
|
-
prisma: '50%'
|
|
561
|
-
}), Object(themes_["pick"])({
|
|
562
|
-
enterprise: '1px',
|
|
563
|
-
prisma: '8px'
|
|
564
|
-
}), Object(themes_["pick"])({
|
|
565
|
-
enterprise: themes_["variables"].textGray,
|
|
566
|
-
prisma: themes_["variables"].contentColorMuted
|
|
567
|
-
}), Object(themes_["pick"])({
|
|
568
|
-
light: themes_["variables"].linkColor,
|
|
569
|
-
dark: themes_["variables"].white
|
|
570
|
-
}), Object(themes_["pick"])({
|
|
571
|
-
enterprise: themes_["variables"].backgroundColorHover,
|
|
572
|
-
prisma: themes_["variables"].interactiveColorOverlayHover
|
|
573
|
-
}), Object(themes_["pick"])({
|
|
574
|
-
prisma: Object(external_styled_components_["css"])(["box-shadow:", ";"], themes_["variables"].hoverShadow)
|
|
575
|
-
}), themes_["variables"].focusShadow, Object(themes_["pick"])({
|
|
576
|
-
prisma: Object(external_styled_components_["css"])(["background-color:", ";"], themes_["variables"].interactiveColorOverlayHover)
|
|
577
|
-
}));
|
|
578
|
-
/* Some of these need greater specificity than input[type=text] */
|
|
579
|
-
|
|
580
|
-
var StyledInput = external_styled_components_default.a.input.withConfig({
|
|
581
|
-
displayName: "TextStyles__StyledInput",
|
|
582
|
-
componentId: "eg7n6t-3"
|
|
583
|
-
})(["&,&[type]{background-color:", ";border:1px solid ", ";border-radius:", ";box-sizing:border-box;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);color:", ";display:block;font-family:", ";font-size:inherit;height:inherit;line-height:inherit;margin:0;min-height:", ";width:100%;", " ", " ", " &[type=\"time\"]{&::-webkit-calendar-picker-indicator{display:none;}height:", ";@media screen and (min--moz-device-pixel-ratio:0){padding-right:", "}}position:relative;", " ", " &:hover:not([disabled]){border-color:", ";}&:focus:not([disabled]){", " outline:0;border-collapse:separate;z-index:1;}", " &::-ms-clear{display:none;width:0;height:0;}&::placeholder{color:", ";opacity:1;}", " ", "}textarea&{resize:none;overflow:auto;}"], Object(themes_["pick"])({
|
|
513
|
+
prisma: themes_["variables"].interactiveColorBorder
|
|
514
|
+
}), themes_["variables"].borderRadius, Object(themes_["pick"])({
|
|
584
515
|
enterprise: {
|
|
585
516
|
light: themes_["variables"].white,
|
|
586
517
|
dark: themes_["variables"].gray22
|
|
587
518
|
},
|
|
588
519
|
prisma: themes_["variables"].transparent
|
|
589
520
|
}), Object(themes_["pick"])({
|
|
521
|
+
enterprise: '0px 10px',
|
|
522
|
+
prisma: '0px 14px'
|
|
523
|
+
}), function (_ref2) {
|
|
524
|
+
var $hasEndAdornment = _ref2.$hasEndAdornment;
|
|
525
|
+
return $hasEndAdornment && Object(external_styled_components_["css"])(["padding-right:0;"]);
|
|
526
|
+
}, function (_ref3) {
|
|
527
|
+
var $hasStartAdornment = _ref3.$hasStartAdornment;
|
|
528
|
+
return $hasStartAdornment && Object(external_styled_components_["css"])(["padding-left:0;"]);
|
|
529
|
+
}, Object(themes_["pick"])({
|
|
590
530
|
enterprise: {
|
|
591
531
|
light: themes_["variables"].gray60,
|
|
592
532
|
dark: themes_["variables"].gray20
|
|
593
533
|
},
|
|
594
|
-
prisma: themes_["variables"].
|
|
595
|
-
}),
|
|
596
|
-
enterprise: themes_["variables"].textColor,
|
|
597
|
-
prisma: themes_["variables"].contentColorActive
|
|
598
|
-
}),
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
}
|
|
608
|
-
var
|
|
609
|
-
|
|
610
|
-
|
|
534
|
+
prisma: themes_["variables"].interactiveColorBorderHover
|
|
535
|
+
}), Object(themes_["pick"])({
|
|
536
|
+
enterprise: Object(external_styled_components_["css"])(["box-shadow:", ";color:", ";"], themes_["variables"].focusShadow, themes_["variables"].textColor),
|
|
537
|
+
prisma: Object(external_styled_components_["css"])(["border-color:", ";color:", ";"], themes_["variables"].interactiveColorPrimary, themes_["variables"].contentColorActive)
|
|
538
|
+
}), function (_ref4) {
|
|
539
|
+
var $error = _ref4.$error;
|
|
540
|
+
return $error && Object(external_styled_components_["css"])(["&,&:hover{border-color:", ";}"], Object(themes_["pick"])({
|
|
541
|
+
enterprise: themes_["variables"].errorColor,
|
|
542
|
+
prisma: themes_["variables"].accentColorNegative
|
|
543
|
+
}));
|
|
544
|
+
}, function (_ref5) {
|
|
545
|
+
var $append = _ref5.$append;
|
|
546
|
+
return $append && Object(external_styled_components_["css"])(["margin-right:-1px;border-top-right-radius:0;border-bottom-right-radius:0;border-right:none;"]);
|
|
547
|
+
}, function (_ref6) {
|
|
548
|
+
var $prepend = _ref6.$prepend;
|
|
549
|
+
return $prepend && Object(external_styled_components_["css"])(["border-top-left-radius:0;border-bottom-left-radius:0;"]);
|
|
550
|
+
}, function (_ref7) {
|
|
551
|
+
var disabled = _ref7.disabled;
|
|
552
|
+
return disabled && Object(external_styled_components_["css"])(["", " box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);"], Object(themes_["pick"])({
|
|
553
|
+
enterprise: {
|
|
554
|
+
light: Object(external_styled_components_["css"])(["background-color:", ";border-color:", ";"], themes_["variables"].gray96, themes_["variables"].gray92),
|
|
555
|
+
dark: Object(external_styled_components_["css"])(["background-color:", ";border-color:", ";"], themes_["variables"].gray22, themes_["variables"].gray30)
|
|
556
|
+
},
|
|
557
|
+
prisma: Object(external_styled_components_["css"])(["border-color:", ";"], themes_["variables"].interactiveColorBorderDisabled)
|
|
558
|
+
}));
|
|
559
|
+
}, function (_ref8) {
|
|
560
|
+
var $multiline = _ref8.$multiline;
|
|
561
|
+
return $multiline && Object(themes_["pick"])({
|
|
562
|
+
enterprise: Object(external_styled_components_["css"])(["padding-right:0;"])
|
|
611
563
|
});
|
|
564
|
+
});
|
|
565
|
+
/* Some of these need greater specificity than input[type=text] */
|
|
612
566
|
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
},
|
|
620
|
-
var $rightIconPadding = _ref5.$rightIconPadding;
|
|
621
|
-
return $rightIconPadding && rightIconPadding;
|
|
622
|
-
}, Object(themes_["pick"])({
|
|
567
|
+
var StyledInput = external_styled_components_default.a.input.withConfig({
|
|
568
|
+
displayName: "TextStyles__StyledInput",
|
|
569
|
+
componentId: "eg7n6t-4"
|
|
570
|
+
})(["", ";&,&[type]{outline-style:none;border:0;background:transparent;color:", ";flex-grow:1;font-family:", ";font-size:inherit;line-height:inherit;&[type='time']{&::-webkit-calendar-picker-indicator{display:none;}height:", ";@media screen and (min--moz-device-pixel-ratio:0){padding-right:", ";}}position:relative;&::placeholder{color:", ";opacity:1;}", " ", "}textarea&{resize:none;overflow:auto;padding-top:", ";padding-bottom:", ";padding-right:", ";}"], themes_["mixins"].reset('inline-flex'), Object(themes_["pick"])({
|
|
571
|
+
enterprise: themes_["variables"].textColor,
|
|
572
|
+
prisma: themes_["variables"].contentColorActive
|
|
573
|
+
}), themes_["variables"].sansFontFamily, Object(themes_["pick"])({
|
|
623
574
|
enterprise: '20px',
|
|
624
575
|
prisma: {
|
|
625
576
|
comfortable: '24px',
|
|
@@ -628,95 +579,152 @@ var StyledInput = external_styled_components_default.a.input.withConfig({
|
|
|
628
579
|
}), Object(themes_["pick"])({
|
|
629
580
|
enterprise: themes_["variables"].spacingHalf,
|
|
630
581
|
prisma: '14px'
|
|
631
|
-
}), function (
|
|
632
|
-
var $
|
|
633
|
-
return $
|
|
634
|
-
}, function (_ref7) {
|
|
635
|
-
var $prepend = _ref7.$prepend;
|
|
636
|
-
return $prepend && Object(external_styled_components_["css"])(["border-top-left-radius:0;border-bottom-left-radius:0;"]);
|
|
637
|
-
}, Object(themes_["pick"])({
|
|
638
|
-
enterprise: {
|
|
639
|
-
light: themes_["variables"].gray60,
|
|
640
|
-
dark: themes_["variables"].gray20
|
|
641
|
-
},
|
|
642
|
-
prisma: themes_["variables"].interactiveColorBorderHover
|
|
643
|
-
}), Object(themes_["pick"])({
|
|
644
|
-
enterprise: Object(external_styled_components_["css"])(["box-shadow:", ";color:", ";"], themes_["variables"].focusShadow, themes_["variables"].textColor),
|
|
645
|
-
prisma: Object(external_styled_components_["css"])(["border-color:", ";color:", ";"], themes_["variables"].interactiveColorPrimary, themes_["variables"].contentColorActive)
|
|
646
|
-
}), function (_ref8) {
|
|
647
|
-
var $error = _ref8.$error;
|
|
648
|
-
return $error && Object(external_styled_components_["css"])(["&,&:hover{border-color:", ";color:", ";}"], Object(themes_["pick"])({
|
|
649
|
-
enterprise: themes_["variables"].errorColor,
|
|
650
|
-
prisma: themes_["variables"].accentColorNegative
|
|
651
|
-
}), Object(themes_["pick"])({
|
|
582
|
+
}), themes_["variables"].contentColorMuted, function (_ref9) {
|
|
583
|
+
var $error = _ref9.$error;
|
|
584
|
+
return $error && Object(external_styled_components_["css"])(["&,&:hover{color:", ";}"], Object(themes_["pick"])({
|
|
652
585
|
enterprise: themes_["variables"].errorColor,
|
|
653
586
|
prisma: themes_["variables"].contentColorActive
|
|
654
587
|
}));
|
|
655
|
-
}, themes_["variables"].contentColorMuted, function (_ref9) {
|
|
656
|
-
var disabled = _ref9.disabled;
|
|
657
|
-
return disabled && disabledStyles;
|
|
658
588
|
}, function (_ref10) {
|
|
659
|
-
var
|
|
660
|
-
return
|
|
661
|
-
})
|
|
662
|
-
var StyledSearchIconWrapper = external_styled_components_default.a.span.withConfig({
|
|
663
|
-
displayName: "TextStyles__StyledSearchIconWrapper",
|
|
664
|
-
componentId: "eg7n6t-4"
|
|
665
|
-
})(["color:", ";pointer-events:none;position:absolute;z-index:1;", ";&[disabled]{", ";}"], Object(themes_["pick"])({
|
|
589
|
+
var disabled = _ref10.disabled;
|
|
590
|
+
return disabled && disabledStyles;
|
|
591
|
+
}, Object(themes_["pick"])({
|
|
666
592
|
enterprise: {
|
|
667
|
-
|
|
668
|
-
|
|
593
|
+
comfortable: themes_["variables"].spacingQuarter,
|
|
594
|
+
compact: '3px'
|
|
669
595
|
},
|
|
670
|
-
prisma:
|
|
596
|
+
prisma: {
|
|
597
|
+
comfortable: themes_["variables"].spacingSmall,
|
|
598
|
+
compact: '5px'
|
|
599
|
+
}
|
|
671
600
|
}), Object(themes_["pick"])({
|
|
672
601
|
enterprise: {
|
|
673
|
-
comfortable:
|
|
674
|
-
compact:
|
|
602
|
+
comfortable: themes_["variables"].spacingQuarter,
|
|
603
|
+
compact: '3px'
|
|
675
604
|
},
|
|
676
605
|
prisma: {
|
|
677
|
-
comfortable:
|
|
678
|
-
compact:
|
|
606
|
+
comfortable: themes_["variables"].spacingSmall,
|
|
607
|
+
compact: '5px'
|
|
679
608
|
}
|
|
680
609
|
}), Object(themes_["pick"])({
|
|
681
|
-
|
|
610
|
+
enterprise: '10px',
|
|
611
|
+
prisma: '14px'
|
|
682
612
|
}));
|
|
613
|
+
var StyledVisibilityToggle = external_styled_components_default()(Button_default.a).withConfig({
|
|
614
|
+
displayName: "TextStyles__StyledVisibilityToggle",
|
|
615
|
+
componentId: "eg7n6t-5"
|
|
616
|
+
})(["", ""], buttonStyles);
|
|
683
617
|
var StyledPlaceholder = external_styled_components_default.a.span.withConfig({
|
|
684
618
|
displayName: "TextStyles__StyledPlaceholder",
|
|
685
|
-
componentId: "eg7n6t-
|
|
686
|
-
})(["color:", ";position:absolute;
|
|
619
|
+
componentId: "eg7n6t-6"
|
|
620
|
+
})(["pointer-events:none;color:", ";position:absolute;overflow:hidden;font-size:inherit;line-height:inherit;height:", ";margin-right:", ";", ";", ";", ""], Object(themes_["pick"])({
|
|
687
621
|
enterprise: themes_["variables"].textGray,
|
|
688
622
|
prisma: themes_["variables"].contentColorMuted
|
|
689
|
-
}), Object(themes_["pick"])({
|
|
623
|
+
}), themes_["variables"].lineHeight, Object(themes_["pick"])({
|
|
624
|
+
enterprise: '10px',
|
|
625
|
+
prisma: '14px'
|
|
626
|
+
}), function (_ref11) {
|
|
627
|
+
var $hasStartAdornment = _ref11.$hasStartAdornment,
|
|
628
|
+
$startAdornmentWidth = _ref11.$startAdornmentWidth;
|
|
629
|
+
return $hasStartAdornment && ($startAdornmentWidth ? Object(external_styled_components_["css"])(["margin-left:", "px;"], $startAdornmentWidth) : Object(external_styled_components_["css"])(["margin-left:", ";"], Object(themes_["pick"])({
|
|
630
|
+
enterprise: {
|
|
631
|
+
comfortable: '30px',
|
|
632
|
+
compact: '26px'
|
|
633
|
+
},
|
|
634
|
+
prisma: {
|
|
635
|
+
comfortable: '38px',
|
|
636
|
+
compact: '30px'
|
|
637
|
+
}
|
|
638
|
+
})));
|
|
639
|
+
}, function (_ref12) {
|
|
640
|
+
var $hasEndAdornment = _ref12.$hasEndAdornment,
|
|
641
|
+
$endAdornmentWidth = _ref12.$endAdornmentWidth;
|
|
642
|
+
return $hasEndAdornment && ($endAdornmentWidth // calc(100% - padding - adorment width)
|
|
643
|
+
? Object(external_styled_components_["css"])(["max-width:calc( 100% - ", " - ", "px );"], Object(themes_["pick"])({
|
|
644
|
+
enterprise: '10px',
|
|
645
|
+
prisma: '14px'
|
|
646
|
+
}), $endAdornmentWidth) : Object(external_styled_components_["css"])(["max-width:calc( 100% - ", " - ", " );"], Object(themes_["pick"])({
|
|
647
|
+
enterprise: '10px',
|
|
648
|
+
prisma: '14px'
|
|
649
|
+
}), Object(themes_["pick"])({
|
|
650
|
+
enterprise: {
|
|
651
|
+
comfortable: '30px',
|
|
652
|
+
compact: '26px'
|
|
653
|
+
},
|
|
654
|
+
prisma: {
|
|
655
|
+
comfortable: '38px',
|
|
656
|
+
compact: '30px'
|
|
657
|
+
}
|
|
658
|
+
})));
|
|
659
|
+
}, function (_ref13) {
|
|
660
|
+
var $hasBothAdornment = _ref13.$hasBothAdornment,
|
|
661
|
+
$endAdornmentWidth = _ref13.$endAdornmentWidth,
|
|
662
|
+
$startAdornmentWidth = _ref13.$startAdornmentWidth;
|
|
663
|
+
return $hasBothAdornment && Object(external_styled_components_["css"])(["max-width:calc(100% - ", "px - ", "px);"], $startAdornmentWidth, $endAdornmentWidth);
|
|
664
|
+
});
|
|
665
|
+
var adornmentHolder = Object(external_styled_components_["css"])(["display:inline-flex;align-items:center;justify-content:center;height:", ";pointer-events:none;"], Object(themes_["pick"])({
|
|
690
666
|
enterprise: {
|
|
691
|
-
comfortable:
|
|
692
|
-
|
|
693
|
-
enterprise: '11px',
|
|
694
|
-
prisma: '40px'
|
|
695
|
-
}) : Object(themes_["pick"])({
|
|
696
|
-
enterprise: '11px',
|
|
697
|
-
prisma: '16px'
|
|
698
|
-
});
|
|
699
|
-
|
|
700
|
-
if (padding) {
|
|
701
|
-
var paddingResult = padding(props);
|
|
702
|
-
return TextStyles_addPadding('left', 'left', paddingResult);
|
|
703
|
-
}
|
|
704
|
-
|
|
705
|
-
return '';
|
|
706
|
-
}),
|
|
707
|
-
compact: Object(external_styled_components_["css"])(["top:5px;", ";"], TextStyles_addPadding('left', 'left', '7px'))
|
|
667
|
+
comfortable: '30px',
|
|
668
|
+
compact: '26px'
|
|
708
669
|
},
|
|
709
670
|
prisma: {
|
|
710
|
-
comfortable:
|
|
711
|
-
|
|
712
|
-
return $renderSearchIcon ? '40px' : '14px';
|
|
713
|
-
}),
|
|
714
|
-
compact: Object(external_styled_components_["css"])(["top:6px;left:", ";"], function (_ref12) {
|
|
715
|
-
var $renderSearchIcon = _ref12.$renderSearchIcon;
|
|
716
|
-
return $renderSearchIcon ? '40px' : '14px';
|
|
717
|
-
})
|
|
671
|
+
comfortable: '38px',
|
|
672
|
+
compact: '30px'
|
|
718
673
|
}
|
|
719
674
|
}));
|
|
675
|
+
var StyledStartAdornmentHolder = external_styled_components_default.a.div.withConfig({
|
|
676
|
+
displayName: "TextStyles__StyledStartAdornmentHolder",
|
|
677
|
+
componentId: "eg7n6t-7"
|
|
678
|
+
})(["", " ", ";"], adornmentHolder, function (_ref14) {
|
|
679
|
+
var $width = _ref14.$width;
|
|
680
|
+
return $width ? Object(external_styled_components_["css"])(["min-width:", "px;"], $width) : Object(external_styled_components_["css"])(["min-width:", ";"], Object(themes_["pick"])({
|
|
681
|
+
enterprise: {
|
|
682
|
+
comfortable: '30px',
|
|
683
|
+
compact: '26px'
|
|
684
|
+
},
|
|
685
|
+
prisma: {
|
|
686
|
+
comfortable: '38px',
|
|
687
|
+
compact: '30px'
|
|
688
|
+
}
|
|
689
|
+
}));
|
|
690
|
+
});
|
|
691
|
+
var StyledEndAdornmentHolder = external_styled_components_default.a.div.withConfig({
|
|
692
|
+
displayName: "TextStyles__StyledEndAdornmentHolder",
|
|
693
|
+
componentId: "eg7n6t-8"
|
|
694
|
+
})(["", " ", ";"], adornmentHolder, function (_ref15) {
|
|
695
|
+
var $width = _ref15.$width;
|
|
696
|
+
return $width ? Object(external_styled_components_["css"])(["min-width:", "px;"], $width) : Object(external_styled_components_["css"])(["min-width:", ";"], Object(themes_["pick"])({
|
|
697
|
+
enterprise: {
|
|
698
|
+
comfortable: '30px',
|
|
699
|
+
compact: '26px'
|
|
700
|
+
},
|
|
701
|
+
prisma: {
|
|
702
|
+
comfortable: '38px',
|
|
703
|
+
compact: '30px'
|
|
704
|
+
}
|
|
705
|
+
}));
|
|
706
|
+
});
|
|
707
|
+
var StyledAdornment = external_styled_components_default.a.div.withConfig({
|
|
708
|
+
displayName: "TextStyles__StyledAdornment",
|
|
709
|
+
componentId: "eg7n6t-9"
|
|
710
|
+
})(["display:inline-flex;align-items:center;justify-content:center;position:absolute;pointer-events:none;z-index:1;height:", ";", ";", ";", ""], Object(themes_["pick"])({
|
|
711
|
+
enterprise: {
|
|
712
|
+
comfortable: '30px',
|
|
713
|
+
compact: '26px'
|
|
714
|
+
},
|
|
715
|
+
prisma: {
|
|
716
|
+
comfortable: '38px',
|
|
717
|
+
compact: '30px'
|
|
718
|
+
}
|
|
719
|
+
}), function (_ref16) {
|
|
720
|
+
var $position = _ref16.$position;
|
|
721
|
+
return $position === 'start' ? Object(external_styled_components_["css"])(["top:1px;left:1px;"]) : Object(external_styled_components_["css"])(["top:1px;right:1px;"]);
|
|
722
|
+
}, function (_ref17) {
|
|
723
|
+
var disabled = _ref17.disabled;
|
|
724
|
+
return disabled && disabledStyles;
|
|
725
|
+
}, Object(themes_["pick"])({
|
|
726
|
+
enterprise: Object(external_styled_components_["css"])(["margin-left:-1px;margin-right:-1px;"])
|
|
727
|
+
}));
|
|
720
728
|
|
|
721
729
|
// CONCATENATED MODULE: ./src/Text/Text.tsx
|
|
722
730
|
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); }
|
|
@@ -780,6 +788,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
780
788
|
|
|
781
789
|
|
|
782
790
|
|
|
791
|
+
|
|
783
792
|
/** @public */
|
|
784
793
|
|
|
785
794
|
var propTypes = {
|
|
@@ -798,6 +807,7 @@ var propTypes = {
|
|
|
798
807
|
describedBy: external_prop_types_default.a.string,
|
|
799
808
|
disabled: external_prop_types_default.a.bool,
|
|
800
809
|
elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
|
|
810
|
+
endAdornment: external_prop_types_default.a.node,
|
|
801
811
|
error: external_prop_types_default.a.bool,
|
|
802
812
|
inline: external_prop_types_default.a.bool,
|
|
803
813
|
|
|
@@ -805,9 +815,6 @@ var propTypes = {
|
|
|
805
815
|
inputClassName: external_prop_types_default.a.string,
|
|
806
816
|
inputId: external_prop_types_default.a.string,
|
|
807
817
|
inputRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
|
|
808
|
-
|
|
809
|
-
/** @private */
|
|
810
|
-
inputStyle: external_prop_types_default.a.object,
|
|
811
818
|
labelledBy: external_prop_types_default.a.string,
|
|
812
819
|
maxLength: external_prop_types_default.a.number,
|
|
813
820
|
multiline: external_prop_types_default.a.bool,
|
|
@@ -823,10 +830,11 @@ var propTypes = {
|
|
|
823
830
|
rowsMin: external_prop_types_default.a.number,
|
|
824
831
|
spellCheck: external_prop_types_default.a.bool,
|
|
825
832
|
tabIndex: external_prop_types_default.a.number,
|
|
833
|
+
startAdornment: external_prop_types_default.a.node,
|
|
826
834
|
|
|
827
835
|
/** @private */
|
|
828
836
|
splunkTheme: external_prop_types_default.a.object,
|
|
829
|
-
type: external_prop_types_default.a.
|
|
837
|
+
type: external_prop_types_default.a.string,
|
|
830
838
|
passwordVisibilityToggle: external_prop_types_default.a.bool,
|
|
831
839
|
useSyntheticPlaceholder: external_prop_types_default.a.bool,
|
|
832
840
|
value: external_prop_types_default.a.string
|
|
@@ -839,7 +847,6 @@ var defaultProps = {
|
|
|
839
847
|
disabled: false,
|
|
840
848
|
error: false,
|
|
841
849
|
inline: false,
|
|
842
|
-
inputStyle: {},
|
|
843
850
|
multiline: false,
|
|
844
851
|
placeholder: '',
|
|
845
852
|
prepend: false,
|
|
@@ -847,8 +854,7 @@ var defaultProps = {
|
|
|
847
854
|
rowsMin: 2,
|
|
848
855
|
tabIndex: 0,
|
|
849
856
|
type: 'text',
|
|
850
|
-
passwordVisibilityToggle: false
|
|
851
|
-
useSyntheticPlaceholder: false
|
|
857
|
+
passwordVisibilityToggle: false
|
|
852
858
|
};
|
|
853
859
|
|
|
854
860
|
/** Note: Text places role and aria props onto the input. All other props are placed on the wrapper. */
|
|
@@ -881,6 +887,30 @@ var Text_Text = /*#__PURE__*/function (_Component) {
|
|
|
881
887
|
|
|
882
888
|
_defineProperty(_assertThisInitialized(_this), "shadow", null);
|
|
883
889
|
|
|
890
|
+
_defineProperty(_assertThisInitialized(_this), "startAdornment", null);
|
|
891
|
+
|
|
892
|
+
_defineProperty(_assertThisInitialized(_this), "endAdornment", null);
|
|
893
|
+
|
|
894
|
+
_defineProperty(_assertThisInitialized(_this), "getAdornmentWidth", function () {
|
|
895
|
+
var startIconRect = _this.startAdornment ? _this.startAdornment.getBoundingClientRect() : undefined;
|
|
896
|
+
var startIconWidth = startIconRect && Math.round(startIconRect.width);
|
|
897
|
+
|
|
898
|
+
if (_this.state.startAdornmentWidth !== startIconWidth) {
|
|
899
|
+
_this.setState({
|
|
900
|
+
startAdornmentWidth: startIconWidth
|
|
901
|
+
});
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
var endIconRect = _this.endAdornment ? _this.endAdornment.getBoundingClientRect() : undefined;
|
|
905
|
+
var endIconWidth = endIconRect && Math.round(endIconRect.width);
|
|
906
|
+
|
|
907
|
+
if (_this.state.endAdornmentWidth !== endIconWidth) {
|
|
908
|
+
_this.setState({
|
|
909
|
+
endAdornmentWidth: endIconWidth
|
|
910
|
+
});
|
|
911
|
+
}
|
|
912
|
+
});
|
|
913
|
+
|
|
884
914
|
_defineProperty(_assertThisInitialized(_this), "handleResize", function () {
|
|
885
915
|
_this.syncHeightWithShadow();
|
|
886
916
|
});
|
|
@@ -962,10 +992,6 @@ var Text_Text = /*#__PURE__*/function (_Component) {
|
|
|
962
992
|
});
|
|
963
993
|
});
|
|
964
994
|
|
|
965
|
-
_defineProperty(_assertThisInitialized(_this), "handlePlaceholderMouseDown", function () {
|
|
966
|
-
_this.focus();
|
|
967
|
-
});
|
|
968
|
-
|
|
969
995
|
_defineProperty(_assertThisInitialized(_this), "syncHeightWithShadow", function () {
|
|
970
996
|
var newHeight = syncHeightWithShadow({
|
|
971
997
|
height: _this.state.height,
|
|
@@ -982,6 +1008,111 @@ var Text_Text = /*#__PURE__*/function (_Component) {
|
|
|
982
1008
|
}
|
|
983
1009
|
});
|
|
984
1010
|
|
|
1011
|
+
_defineProperty(_assertThisInitialized(_this), "renderEndAdornment", function () {
|
|
1012
|
+
var _controlGroupContext$;
|
|
1013
|
+
|
|
1014
|
+
var _this$props7 = _this.props,
|
|
1015
|
+
appearance = _this$props7.appearance,
|
|
1016
|
+
endAdornment = _this$props7.endAdornment,
|
|
1017
|
+
passwordVisibilityToggle = _this$props7.passwordVisibilityToggle,
|
|
1018
|
+
disabled = _this$props7.disabled,
|
|
1019
|
+
canClear = _this$props7.canClear,
|
|
1020
|
+
splunkTheme = _this$props7.splunkTheme;
|
|
1021
|
+
var isPrisma = splunkTheme.isPrisma;
|
|
1022
|
+
var adornmentProps = {
|
|
1023
|
+
ref: function ref(el) {
|
|
1024
|
+
_this.endAdornment = el;
|
|
1025
|
+
},
|
|
1026
|
+
disabled: disabled,
|
|
1027
|
+
$position: 'end'
|
|
1028
|
+
};
|
|
1029
|
+
|
|
1030
|
+
if (endAdornment) {
|
|
1031
|
+
return /*#__PURE__*/external_react_default.a.createElement(StyledAdornment, adornmentProps, endAdornment);
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
if (passwordVisibilityToggle && !disabled) {
|
|
1035
|
+
var eyeIcon = _this.state.hideVisibility ? /*#__PURE__*/external_react_default.a.createElement(Text_IconOutlinedView, null) : /*#__PURE__*/external_react_default.a.createElement(Text_IconOutlinedHide, null);
|
|
1036
|
+
return /*#__PURE__*/external_react_default.a.createElement(StyledAdornment, adornmentProps, /*#__PURE__*/external_react_default.a.createElement(StyledVisibilityToggle, {
|
|
1037
|
+
appearance: isPrisma ? 'secondary' : 'pill',
|
|
1038
|
+
"data-test": "password-toggle",
|
|
1039
|
+
inline: false,
|
|
1040
|
+
onClick: _this.handleVisibilityToggle,
|
|
1041
|
+
type: "button",
|
|
1042
|
+
icon: eyeIcon
|
|
1043
|
+
}));
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
var controlGroupContext = _this.context;
|
|
1047
|
+
var controlGroupLabel = (_controlGroupContext$ = controlGroupContext.labelAttrs) === null || _controlGroupContext$ === void 0 ? void 0 : _controlGroupContext$.text;
|
|
1048
|
+
var clearButtonText = controlGroupLabel ? Object(i18n_["_"])("Clear ".concat(controlGroupLabel, " text field")) : Object(i18n_["_"])('Clear text field');
|
|
1049
|
+
|
|
1050
|
+
if (!isPrisma && appearance === 'search') {
|
|
1051
|
+
return /*#__PURE__*/external_react_default.a.createElement(StyledAdornment, adornmentProps, /*#__PURE__*/external_react_default.a.createElement(StyledClearButton, {
|
|
1052
|
+
appearance: isPrisma ? 'secondary' : 'pill',
|
|
1053
|
+
"data-test": "clear",
|
|
1054
|
+
inline: false,
|
|
1055
|
+
icon: /*#__PURE__*/external_react_default.a.createElement(CrossMark["a" /* default */], {
|
|
1056
|
+
enterpriseSize: 1,
|
|
1057
|
+
screenReaderText: clearButtonText
|
|
1058
|
+
}),
|
|
1059
|
+
onClick: _this.handleClear
|
|
1060
|
+
}), /*#__PURE__*/external_react_default.a.createElement(StyledSearchIconWrapper, {
|
|
1061
|
+
$disabled: disabled
|
|
1062
|
+
}, /*#__PURE__*/external_react_default.a.createElement(Search, {
|
|
1063
|
+
enterpriseSize: "16px",
|
|
1064
|
+
inline: false
|
|
1065
|
+
})));
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
if (isPrisma && appearance === 'search' || canClear) {
|
|
1069
|
+
return /*#__PURE__*/external_react_default.a.createElement(StyledAdornment, adornmentProps, /*#__PURE__*/external_react_default.a.createElement(StyledClearButton, {
|
|
1070
|
+
"data-test": "clear",
|
|
1071
|
+
appearance: isPrisma ? 'secondary' : 'pill',
|
|
1072
|
+
onClick: _this.handleClear,
|
|
1073
|
+
icon: /*#__PURE__*/external_react_default.a.createElement(CrossMark["a" /* default */], {
|
|
1074
|
+
inline: false,
|
|
1075
|
+
enterpriseSize: 1,
|
|
1076
|
+
screenReaderText: clearButtonText
|
|
1077
|
+
})
|
|
1078
|
+
}));
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
return undefined;
|
|
1082
|
+
});
|
|
1083
|
+
|
|
1084
|
+
_defineProperty(_assertThisInitialized(_this), "renderStartAdornment", function () {
|
|
1085
|
+
var _this$props8 = _this.props,
|
|
1086
|
+
appearance = _this$props8.appearance,
|
|
1087
|
+
startAdornment = _this$props8.startAdornment,
|
|
1088
|
+
splunkTheme = _this$props8.splunkTheme,
|
|
1089
|
+
disabled = _this$props8.disabled;
|
|
1090
|
+
var isPrisma = splunkTheme.isPrisma;
|
|
1091
|
+
var adornmentProps = {
|
|
1092
|
+
ref: function ref(el) {
|
|
1093
|
+
_this.startAdornment = el;
|
|
1094
|
+
},
|
|
1095
|
+
disabled: disabled,
|
|
1096
|
+
$position: 'start'
|
|
1097
|
+
};
|
|
1098
|
+
|
|
1099
|
+
if (startAdornment) {
|
|
1100
|
+
return /*#__PURE__*/external_react_default.a.createElement(StyledAdornment, adornmentProps, startAdornment);
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
if (isPrisma && appearance === 'search') {
|
|
1104
|
+
return /*#__PURE__*/external_react_default.a.createElement(StyledAdornment, adornmentProps, /*#__PURE__*/external_react_default.a.createElement(StyledSearchIconWrapper, {
|
|
1105
|
+
$disabled: disabled
|
|
1106
|
+
}, /*#__PURE__*/external_react_default.a.createElement(Search, {
|
|
1107
|
+
enterpriseSize: "16px",
|
|
1108
|
+
inline: false,
|
|
1109
|
+
screenReaderText: "Search"
|
|
1110
|
+
})));
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
return undefined;
|
|
1114
|
+
});
|
|
1115
|
+
|
|
985
1116
|
_this.controlledExternally = Object(external_lodash_["has"])(props, 'value');
|
|
986
1117
|
_this.state = {
|
|
987
1118
|
value: props.defaultValue || '',
|
|
@@ -992,6 +1123,11 @@ var Text_Text = /*#__PURE__*/function (_Component) {
|
|
|
992
1123
|
|
|
993
1124
|
if (false) {}
|
|
994
1125
|
|
|
1126
|
+
if (Object(external_lodash_["has"])(props, 'useSyntheticPlaceholder')) {
|
|
1127
|
+
// eslint-disable-next-line no-console
|
|
1128
|
+
console.warn("The 'Text' prop 'useSyntheticPlaceholder' has been marked for deprecation.");
|
|
1129
|
+
}
|
|
1130
|
+
|
|
995
1131
|
Text.validateRows(props);
|
|
996
1132
|
_this.handleResize = Object(external_lodash_["throttle"])(_this.handleResize, 100);
|
|
997
1133
|
return _this;
|
|
@@ -1001,6 +1137,8 @@ var Text_Text = /*#__PURE__*/function (_Component) {
|
|
|
1001
1137
|
key: "componentDidMount",
|
|
1002
1138
|
value: function componentDidMount() {
|
|
1003
1139
|
Object(external_lodash_["defer"])(this.syncHeightWithShadow); // wait for styles to load
|
|
1140
|
+
|
|
1141
|
+
this.getAdornmentWidth();
|
|
1004
1142
|
}
|
|
1005
1143
|
}, {
|
|
1006
1144
|
key: "componentDidUpdate",
|
|
@@ -1014,6 +1152,7 @@ var Text_Text = /*#__PURE__*/function (_Component) {
|
|
|
1014
1152
|
if (false) {}
|
|
1015
1153
|
|
|
1016
1154
|
Text.validateRows(this.props);
|
|
1155
|
+
this.getAdornmentWidth();
|
|
1017
1156
|
}
|
|
1018
1157
|
}, {
|
|
1019
1158
|
key: "isControlled",
|
|
@@ -1050,43 +1189,36 @@ var Text_Text = /*#__PURE__*/function (_Component) {
|
|
|
1050
1189
|
value: function render() {
|
|
1051
1190
|
var _this2 = this;
|
|
1052
1191
|
|
|
1053
|
-
var _this$
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
type = _this$props7.type,
|
|
1084
|
-
useSyntheticPlaceholder = _this$props7.useSyntheticPlaceholder,
|
|
1085
|
-
value = _this$props7.value,
|
|
1086
|
-
otherProps = _objectWithoutProperties(_this$props7, ["appearance", "append", "autoCapitalize", "autoComplete", "autoCorrect", "autoFocus", "canClear", "children", "className", "classNamePrivate", "disabled", "describedBy", "elementRef", "error", "inline", "inputClassName", "inputId", "inputStyle", "labelledBy", "multiline", "maxLength", "name", "passwordVisibilityToggle", "placeholder", "prepend", "spellCheck", "splunkTheme", "tabIndex", "title", "type", "useSyntheticPlaceholder", "value"]);
|
|
1087
|
-
|
|
1088
|
-
var family = splunkTheme.family;
|
|
1089
|
-
var isPrisma = family === 'prisma';
|
|
1192
|
+
var _this$props9 = this.props,
|
|
1193
|
+
append = _this$props9.append,
|
|
1194
|
+
autoCapitalize = _this$props9.autoCapitalize,
|
|
1195
|
+
autoComplete = _this$props9.autoComplete,
|
|
1196
|
+
autoCorrect = _this$props9.autoCorrect,
|
|
1197
|
+
autoFocus = _this$props9.autoFocus,
|
|
1198
|
+
children = _this$props9.children,
|
|
1199
|
+
className = _this$props9.className,
|
|
1200
|
+
classNamePrivate = _this$props9.classNamePrivate,
|
|
1201
|
+
disabled = _this$props9.disabled,
|
|
1202
|
+
describedBy = _this$props9.describedBy,
|
|
1203
|
+
elementRef = _this$props9.elementRef,
|
|
1204
|
+
error = _this$props9.error,
|
|
1205
|
+
inline = _this$props9.inline,
|
|
1206
|
+
inputClassName = _this$props9.inputClassName,
|
|
1207
|
+
inputId = _this$props9.inputId,
|
|
1208
|
+
labelledBy = _this$props9.labelledBy,
|
|
1209
|
+
multiline = _this$props9.multiline,
|
|
1210
|
+
maxLength = _this$props9.maxLength,
|
|
1211
|
+
name = _this$props9.name,
|
|
1212
|
+
passwordVisibilityToggle = _this$props9.passwordVisibilityToggle,
|
|
1213
|
+
placeholder = _this$props9.placeholder,
|
|
1214
|
+
prepend = _this$props9.prepend,
|
|
1215
|
+
spellCheck = _this$props9.spellCheck,
|
|
1216
|
+
tabIndex = _this$props9.tabIndex,
|
|
1217
|
+
title = _this$props9.title,
|
|
1218
|
+
type = _this$props9.type,
|
|
1219
|
+
useSyntheticPlaceholder = _this$props9.useSyntheticPlaceholder,
|
|
1220
|
+
value = _this$props9.value,
|
|
1221
|
+
otherProps = _objectWithoutProperties(_this$props9, ["append", "autoCapitalize", "autoComplete", "autoCorrect", "autoFocus", "children", "className", "classNamePrivate", "disabled", "describedBy", "elementRef", "error", "inline", "inputClassName", "inputId", "labelledBy", "multiline", "maxLength", "name", "passwordVisibilityToggle", "placeholder", "prepend", "spellCheck", "tabIndex", "title", "type", "useSyntheticPlaceholder", "value"]);
|
|
1090
1222
|
|
|
1091
1223
|
var ariaProps = _objectSpread(_objectSpread({}, Object(external_lodash_["pickBy"])(otherProps, function (val, key) {
|
|
1092
1224
|
return key === 'role' || key.indexOf('aria-') === 0;
|
|
@@ -1099,22 +1231,17 @@ var Text_Text = /*#__PURE__*/function (_Component) {
|
|
|
1099
1231
|
|
|
1100
1232
|
var boxProps = Object(external_lodash_["omit"])(otherProps, ['inputRef', 'onBlur', 'onChange', 'onFocus', 'onKeyDown', 'onSelect', 'rowsMax', 'rowsMin'].concat(_toConsumableArray(Object(external_lodash_["keys"])(ariaProps))));
|
|
1101
1233
|
var displayValue = this.isControlled() ? value : this.state.value;
|
|
1102
|
-
var clearIconPadding = !disabled && (canClear || appearance === 'search');
|
|
1103
|
-
var reserveIconSpace = displayValue && clearIconPadding || passwordVisibilityToggle || undefined; // These props are used by both the input and its shadow.
|
|
1104
|
-
|
|
1105
1234
|
var displayProps = {
|
|
1106
1235
|
className: Object(style_["toClassName"])(className, inputClassName),
|
|
1107
1236
|
$append: append || undefined,
|
|
1108
1237
|
$error: error,
|
|
1109
|
-
$prepend: prepend || undefined
|
|
1110
|
-
value: displayValue
|
|
1238
|
+
$prepend: prepend || undefined
|
|
1111
1239
|
};
|
|
1112
1240
|
var passwordVisibility = this.state.hideVisibility ? 'password' : 'text';
|
|
1113
1241
|
var computedType = passwordVisibilityToggle ? passwordVisibility : type;
|
|
1114
1242
|
|
|
1115
|
-
var inputProps = _objectSpread(_objectSpread(
|
|
1243
|
+
var inputProps = _objectSpread(_objectSpread({}, ariaProps), {}, {
|
|
1116
1244
|
'data-test': 'textbox',
|
|
1117
|
-
$customStyle: inputStyle,
|
|
1118
1245
|
autoCapitalize: autoCapitalize,
|
|
1119
1246
|
autoComplete: autoComplete,
|
|
1120
1247
|
autoCorrect: autoCorrect,
|
|
@@ -1131,38 +1258,40 @@ var Text_Text = /*#__PURE__*/function (_Component) {
|
|
|
1131
1258
|
ref: this.handleInputMount,
|
|
1132
1259
|
role: 'textbox',
|
|
1133
1260
|
spellCheck: spellCheck,
|
|
1134
|
-
style:
|
|
1261
|
+
style: {
|
|
1135
1262
|
height: this.state.height
|
|
1136
|
-
},
|
|
1263
|
+
},
|
|
1137
1264
|
title: title,
|
|
1138
1265
|
tabIndex: tabIndex,
|
|
1139
|
-
type: multiline ? null : computedType
|
|
1266
|
+
type: multiline ? null : computedType,
|
|
1267
|
+
value: displayValue,
|
|
1268
|
+
$error: error
|
|
1140
1269
|
});
|
|
1141
1270
|
|
|
1142
|
-
var haveSyntheticPlaceholder = useSyntheticPlaceholder && placeholder && !displayValue;
|
|
1143
|
-
var searchIconPosition = isPrisma ? 'left' : 'right';
|
|
1144
|
-
var placeholderPadding = appearance === 'search' && (!displayValue && searchIconPosition !== 'left' || searchIconPosition === 'left');
|
|
1145
|
-
var eyeIcon = this.state.hideVisibility ? /*#__PURE__*/external_react_default.a.createElement(Text_IconOutlinedView, null) : /*#__PURE__*/external_react_default.a.createElement(Text_IconOutlinedHide, null);
|
|
1146
|
-
var showClearIconWhenValue = clearIconPadding && !!displayValue;
|
|
1147
|
-
var showClearIconForSearchAppearance = !isPrisma && showClearIconWhenValue && appearance === 'search'; // Do not render value in DOM when type is password, or passwordVisibiltyToggle is enabled
|
|
1271
|
+
var haveSyntheticPlaceholder = useSyntheticPlaceholder && placeholder && !displayValue; // Do not render value in DOM when type is password, or passwordVisibiltyToggle is enabled
|
|
1148
1272
|
|
|
1149
1273
|
var dataTestValue = type === 'password' || passwordVisibilityToggle ? undefined : displayValue; // Firefox hack (SUI-2716). Remove when fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=1427173
|
|
1150
1274
|
|
|
1151
1275
|
var isTimeInput = type === 'time';
|
|
1276
|
+
var hasEndAdornment = !!this.renderEndAdornment();
|
|
1277
|
+
var hasStartAdornment = !!this.renderStartAdornment();
|
|
1152
1278
|
return /*#__PURE__*/external_react_default.a.createElement(StyledBox, Text_extends({
|
|
1153
|
-
$showClearIconFocused: showClearIconWhenValue,
|
|
1154
|
-
$showClearIconForSearchAppearance: showClearIconForSearchAppearance,
|
|
1155
1279
|
$isTimeInput: isTimeInput,
|
|
1156
1280
|
className: Object(style_["toClassName"])(className, classNamePrivate),
|
|
1157
1281
|
"data-test": "text",
|
|
1158
1282
|
"data-test-value": dataTestValue,
|
|
1159
1283
|
elementRef: elementRef,
|
|
1284
|
+
flex: true,
|
|
1160
1285
|
inline: inline
|
|
1161
|
-
}, boxProps),
|
|
1162
|
-
$
|
|
1163
|
-
$
|
|
1164
|
-
|
|
1165
|
-
|
|
1286
|
+
}, boxProps), this.renderStartAdornment(), /*#__PURE__*/external_react_default.a.createElement(StyledInputWrapper, Text_extends({
|
|
1287
|
+
$hasEndAdornment: hasEndAdornment,
|
|
1288
|
+
$hasStartAdornment: hasStartAdornment,
|
|
1289
|
+
$multiline: multiline,
|
|
1290
|
+
disabled: disabled
|
|
1291
|
+
}, displayProps), hasStartAdornment && /*#__PURE__*/external_react_default.a.createElement(StyledStartAdornmentHolder, {
|
|
1292
|
+
$width: this.state.startAdornmentWidth
|
|
1293
|
+
}), !disabled && multiline && /*#__PURE__*/external_react_default.a.createElement(StyledInput, {
|
|
1294
|
+
as: "textarea",
|
|
1166
1295
|
"aria-hidden": "true",
|
|
1167
1296
|
onChange: external_lodash_["noop"],
|
|
1168
1297
|
style: {
|
|
@@ -1175,15 +1304,13 @@ var Text_Text = /*#__PURE__*/function (_Component) {
|
|
|
1175
1304
|
tabIndex: -1,
|
|
1176
1305
|
ref: function ref(el) {
|
|
1177
1306
|
_this2.shadow = el;
|
|
1178
|
-
}
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
$rightIconPadding: reserveIconSpace,
|
|
1182
|
-
$search: appearance === 'search',
|
|
1307
|
+
},
|
|
1308
|
+
value: displayValue
|
|
1309
|
+
}), disabled ? /*#__PURE__*/external_react_default.a.createElement(StyledInput, Text_extends({
|
|
1183
1310
|
as: multiline ? 'textarea' : undefined,
|
|
1184
1311
|
className: Object(style_["toClassName"])(className, classNamePrivate),
|
|
1185
1312
|
"data-multiline": multiline || null,
|
|
1186
|
-
"data-test": "
|
|
1313
|
+
"data-test": "textbox",
|
|
1187
1314
|
disabled: true,
|
|
1188
1315
|
readOnly: true,
|
|
1189
1316
|
style: multiline ? {
|
|
@@ -1197,40 +1324,23 @@ var Text_Text = /*#__PURE__*/function (_Component) {
|
|
|
1197
1324
|
_this2.shadow = el;
|
|
1198
1325
|
} : undefined
|
|
1199
1326
|
}, ariaProps)) : /*#__PURE__*/external_react_default.a.createElement(StyledInput, Text_extends({
|
|
1200
|
-
$rightIconPadding: reserveIconSpace,
|
|
1201
|
-
$search: appearance === 'search',
|
|
1202
1327
|
as: multiline ? 'textarea' : undefined
|
|
1203
|
-
}, inputProps)), !disabled && multiline && /*#__PURE__*/external_react_default.a.createElement(
|
|
1204
|
-
target:
|
|
1205
|
-
|
|
1328
|
+
}, inputProps)), !disabled && multiline && /*#__PURE__*/external_react_default.a.createElement(EventListener_default.a, {
|
|
1329
|
+
target: window,
|
|
1330
|
+
eventType: "resize",
|
|
1331
|
+
listener: this.handleResize
|
|
1206
1332
|
}), haveSyntheticPlaceholder && /*#__PURE__*/external_react_default.a.createElement(ScreenReaderContent_default.a, null, placeholder), haveSyntheticPlaceholder && /*#__PURE__*/external_react_default.a.createElement(StyledPlaceholder, {
|
|
1207
|
-
$
|
|
1208
|
-
$
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
"
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
$
|
|
1217
|
-
|
|
1218
|
-
inline: false,
|
|
1219
|
-
enterpriseSize: 1 // TODO SUI-2696 to make explicit which input this button clears
|
|
1220
|
-
,
|
|
1221
|
-
screenReaderText: Object(i18n_["_"])('Clear text field')
|
|
1222
|
-
})
|
|
1223
|
-
}), passwordVisibilityToggle && !disabled && /*#__PURE__*/external_react_default.a.createElement(StyledVisibilityToggle, {
|
|
1224
|
-
"data-test": "password-toggle",
|
|
1225
|
-
type: "button",
|
|
1226
|
-
onClick: this.handleVisibilityToggle
|
|
1227
|
-
}, eyeIcon), appearance === 'search' && placeholderPadding && /*#__PURE__*/external_react_default.a.createElement(StyledSearchIconWrapper, {
|
|
1228
|
-
$customStyle: inputStyle,
|
|
1229
|
-
$disabled: disabled
|
|
1230
|
-
}, /*#__PURE__*/external_react_default.a.createElement(Search, {
|
|
1231
|
-
enterpriseSize: "16px",
|
|
1232
|
-
inline: false
|
|
1233
|
-
})), children);
|
|
1333
|
+
$endAdornmentWidth: this.state.endAdornmentWidth,
|
|
1334
|
+
$hasBothAdornment: hasStartAdornment && hasEndAdornment // used to calculate the max-width
|
|
1335
|
+
,
|
|
1336
|
+
$hasEndAdornment: hasEndAdornment,
|
|
1337
|
+
$hasStartAdornment: hasStartAdornment,
|
|
1338
|
+
$startAdornmentWidth: this.state.startAdornmentWidth,
|
|
1339
|
+
"aria-hidden": true,
|
|
1340
|
+
"data-role": "placeholder"
|
|
1341
|
+
}, placeholder), children, hasEndAdornment && /*#__PURE__*/external_react_default.a.createElement(StyledEndAdornmentHolder, {
|
|
1342
|
+
$width: this.state.endAdornmentWidth
|
|
1343
|
+
})), this.renderEndAdornment());
|
|
1234
1344
|
}
|
|
1235
1345
|
}]);
|
|
1236
1346
|
|
|
@@ -1243,6 +1353,8 @@ _defineProperty(Text_Text, "defaultProps", defaultProps);
|
|
|
1243
1353
|
|
|
1244
1354
|
_defineProperty(Text_Text, "componentType", 'Text');
|
|
1245
1355
|
|
|
1356
|
+
_defineProperty(Text_Text, "contextType", ControlGroup_["ControlGroupContext"]);
|
|
1357
|
+
|
|
1246
1358
|
var TextWithThemeBase = Object(themes_["withSplunkTheme"])(Text_Text);
|
|
1247
1359
|
var TextWithTheme = TextWithThemeBase;
|
|
1248
1360
|
TextWithTheme.propTypes = Text_Text.propTypes;
|
|
@@ -1252,50 +1364,23 @@ TextWithTheme.componentType = Text_Text.componentType;
|
|
|
1252
1364
|
|
|
1253
1365
|
|
|
1254
1366
|
|
|
1255
|
-
/***/ }),
|
|
1256
|
-
|
|
1257
|
-
/***/ 12:
|
|
1258
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1259
|
-
|
|
1260
|
-
"use strict";
|
|
1261
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return updateReactRef; });
|
|
1262
|
-
/**
|
|
1263
|
-
* Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
|
|
1264
|
-
*
|
|
1265
|
-
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
1266
|
-
* @param current - The new value of the ref.
|
|
1267
|
-
*/
|
|
1268
|
-
function updateReactRef(ref, current) {
|
|
1269
|
-
if (ref) {
|
|
1270
|
-
if (typeof ref === 'function') {
|
|
1271
|
-
ref(current);
|
|
1272
|
-
} else {
|
|
1273
|
-
// the public signature of this util uses React.Ref<T> to mirror the way React types refs.
|
|
1274
|
-
// the intention here is to signal "we will take care of setting 'current', not you".
|
|
1275
|
-
ref.current = current; // eslint-disable-line no-param-reassign
|
|
1276
|
-
}
|
|
1277
|
-
}
|
|
1278
|
-
}
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
1367
|
/***/ }),
|
|
1283
1368
|
|
|
1284
1369
|
/***/ 14:
|
|
1285
1370
|
/***/ (function(module, exports) {
|
|
1286
1371
|
|
|
1287
|
-
module.exports = require("@splunk/react-ui/
|
|
1372
|
+
module.exports = require("@splunk/react-ui/EventListener");
|
|
1288
1373
|
|
|
1289
1374
|
/***/ }),
|
|
1290
1375
|
|
|
1291
1376
|
/***/ 15:
|
|
1292
1377
|
/***/ (function(module, exports) {
|
|
1293
1378
|
|
|
1294
|
-
module.exports = require("react-
|
|
1379
|
+
module.exports = require("@splunk/react-ui/ScreenReaderContent");
|
|
1295
1380
|
|
|
1296
1381
|
/***/ }),
|
|
1297
1382
|
|
|
1298
|
-
/***/
|
|
1383
|
+
/***/ 17:
|
|
1299
1384
|
/***/ (function(module, exports) {
|
|
1300
1385
|
|
|
1301
1386
|
module.exports = require("@splunk/react-ui/Button");
|
|
@@ -1309,14 +1394,14 @@ module.exports = require("react");
|
|
|
1309
1394
|
|
|
1310
1395
|
/***/ }),
|
|
1311
1396
|
|
|
1312
|
-
/***/
|
|
1397
|
+
/***/ 22:
|
|
1313
1398
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1314
1399
|
|
|
1315
1400
|
"use strict";
|
|
1316
1401
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CrossMark; });
|
|
1317
1402
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
|
1318
1403
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
1319
|
-
/* harmony import */ var _splunk_react_icons_Close__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
1404
|
+
/* harmony import */ var _splunk_react_icons_Close__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26);
|
|
1320
1405
|
/* harmony import */ var _splunk_react_icons_Close__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_react_icons_Close__WEBPACK_IMPORTED_MODULE_1__);
|
|
1321
1406
|
/* harmony import */ var _ThemedIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
|
|
1322
1407
|
/* harmony import */ var _SVG__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6);
|
|
@@ -1359,14 +1444,14 @@ function CrossMark(props) {
|
|
|
1359
1444
|
|
|
1360
1445
|
/***/ }),
|
|
1361
1446
|
|
|
1362
|
-
/***/
|
|
1447
|
+
/***/ 23:
|
|
1363
1448
|
/***/ (function(module, exports) {
|
|
1364
1449
|
|
|
1365
1450
|
module.exports = require("@splunk/react-icons/SVG");
|
|
1366
1451
|
|
|
1367
1452
|
/***/ }),
|
|
1368
1453
|
|
|
1369
|
-
/***/
|
|
1454
|
+
/***/ 26:
|
|
1370
1455
|
/***/ (function(module, exports) {
|
|
1371
1456
|
|
|
1372
1457
|
module.exports = require("@splunk/react-icons/Close");
|
|
@@ -1380,17 +1465,17 @@ module.exports = require("styled-components");
|
|
|
1380
1465
|
|
|
1381
1466
|
/***/ }),
|
|
1382
1467
|
|
|
1383
|
-
/***/
|
|
1468
|
+
/***/ 39:
|
|
1384
1469
|
/***/ (function(module, exports) {
|
|
1385
1470
|
|
|
1386
|
-
module.exports = require("
|
|
1471
|
+
module.exports = require("@splunk/ui-utils/style");
|
|
1387
1472
|
|
|
1388
1473
|
/***/ }),
|
|
1389
1474
|
|
|
1390
|
-
/***/
|
|
1475
|
+
/***/ 4:
|
|
1391
1476
|
/***/ (function(module, exports) {
|
|
1392
1477
|
|
|
1393
|
-
module.exports = require("
|
|
1478
|
+
module.exports = require("lodash");
|
|
1394
1479
|
|
|
1395
1480
|
/***/ }),
|
|
1396
1481
|
|