@splunk/react-ui 4.19.0 → 4.21.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 +114 -230
- package/Anchor.js +74 -150
- package/Animation.js +52 -124
- package/AnimationToggle.js +86 -146
- package/Box.js +77 -153
- package/Breadcrumbs.d.ts +2 -0
- package/Breadcrumbs.js +207 -0
- package/Button.js +168 -316
- package/ButtonGroup.js +84 -168
- package/ButtonSimple.js +224 -324
- package/CHANGELOG.md +35 -0
- package/Calendar.js +264 -462
- package/Card.js +223 -371
- package/CardLayout.js +87 -163
- package/Chip.js +199 -323
- package/Clickable.js +132 -248
- package/CloseButton.js +92 -200
- package/Code.js +188 -251
- package/CollapsiblePanel.js +214 -370
- package/Color.js +267 -495
- package/ColumnLayout.js +152 -254
- package/ComboBox.js +197 -371
- package/Concertina.js +214 -374
- package/ControlGroup.js +164 -288
- package/Date.js +154 -304
- package/DefinitionList.js +104 -180
- package/Divider.js +80 -156
- package/Dropdown.js +121 -263
- package/DualListbox.js +408 -601
- package/EventListener.js +70 -138
- package/File.js +343 -547
- package/FormRows.js +232 -414
- package/Heading.js +94 -164
- package/Image.js +167 -323
- package/JSONTree.js +166 -314
- package/Layer.js +221 -388
- package/Link.js +133 -239
- package/List.js +85 -161
- package/Markdown.js +230 -355
- package/Menu.js +396 -647
- package/Message.js +248 -437
- package/MessageBar.js +220 -408
- package/Modal.js +201 -365
- package/ModalLayer.js +96 -196
- package/Monogram.js +112 -204
- package/Multiselect.js +2675 -2807
- package/Number.js +178 -334
- package/Paginator.js +170 -336
- package/Paragraph.js +77 -153
- package/Popover.js +436 -623
- package/Progress.js +139 -255
- package/RadioBar.js +156 -280
- package/RadioList.js +182 -282
- package/Resize.js +173 -307
- package/ResultsMenu.js +183 -304
- package/ScreenReaderContent.js +75 -151
- package/Scroll.js +125 -267
- package/ScrollContainerContext.js +129 -201
- package/Search.js +188 -354
- package/Select.js +1243 -1248
- package/SidePanel.js +106 -214
- package/Slider.js +198 -348
- package/SlidingPanels.js +138 -280
- package/SplitButton.js +141 -273
- package/StaticContent.js +84 -168
- package/StepBar.js +138 -246
- package/Switch.js +261 -385
- package/TabBar.js +261 -398
- package/TabLayout.js +122 -238
- package/Table.js +975 -1447
- package/Text.js +335 -549
- package/TextArea.js +315 -537
- package/Tooltip.js +152 -292
- package/TransitionOpen.js +118 -242
- package/Typography.js +81 -157
- package/WaitSpinner.js +117 -209
- package/package.json +20 -21
- package/stubs-splunkui.d.ts +4 -1
- package/types/src/Breadcrumbs/Breadcrumbs.d.ts +25 -0
- package/types/src/Breadcrumbs/Item.d.ts +42 -0
- package/types/src/Breadcrumbs/docs/examples/Adornments.d.ts +2 -0
- package/types/src/Breadcrumbs/docs/examples/Basic.d.ts +2 -0
- package/types/src/Breadcrumbs/index.d.ts +2 -0
- package/types/src/Code/Code.d.ts +1 -1
- package/types/src/ComboBox/Option.d.ts +1 -1
- package/types/src/Concertina/Concertina.d.ts +4 -0
- package/types/src/Link/Link.d.ts +12 -3
- package/types/src/Link/docs/examples/NewWindow.d.ts +2 -0
- package/types/src/Markdown/Markdown.d.ts +1 -1
- package/types/src/Markdown/renderers/MarkdownHeading.d.ts +1 -1
- package/types/src/Menu/Item.d.ts +1 -1
- package/types/src/Menu/Menu.d.ts +1 -0
- package/types/src/MessageBar/docs/examples/WithActions.d.ts +2 -0
- package/types/src/Multiselect/Compact.d.ts +4 -0
- package/types/src/Multiselect/Multiselect.d.ts +5 -0
- package/types/src/Multiselect/Option.d.ts +1 -1
- package/types/src/Multiselect/docs/examples/CompactSelectAll.d.ts +2 -0
- package/types/src/Search/Option.d.ts +1 -1
- package/types/src/Select/Option.d.ts +1 -1
- package/types/src/Select/OptionBase.d.ts +1 -1
- package/types/src/Select/SelectAllOption.d.ts +14 -0
- package/types/src/Select/SelectBase.d.ts +11 -3
- package/types/src/Table/Table.d.ts +4 -0
- package/types/src/Text/Text.d.ts +3 -3
- package/types/src/TextArea/TextArea.d.ts +3 -3
- package/types/src/fixtures/FetchOptions.d.ts +2 -8
- package/useForceUpdate.js +46 -110
- package/useKeyPress.js +50 -107
- package/usePrevious.js +47 -111
- package/useRovingFocus.js +53 -133
- package/types/src/Link/docs/examples/NewTab.d.ts +0 -2
- package/types/src/Typography/docs/examples/Variants.d.ts +0 -2
- /package/types/src/Table/docs/examples/{DockedHeader.d.ts → DockedHeaderScrollbar.d.ts} +0 -0
- /package/types/src/Table/docs/examples/prisma/{DockedHeader.d.ts → DockedHeaderScrollbar.d.ts} +0 -0
package/FormRows.js
CHANGED
|
@@ -1,344 +1,206 @@
|
|
|
1
|
-
|
|
2
|
-
/******/
|
|
3
|
-
/******/ // The
|
|
4
|
-
/******/ var
|
|
5
|
-
/******/
|
|
6
|
-
|
|
7
|
-
/******/
|
|
8
|
-
/******/
|
|
9
|
-
/******/ //
|
|
10
|
-
/******/
|
|
11
|
-
/******/
|
|
12
|
-
/******/
|
|
13
|
-
/******/
|
|
14
|
-
/******/
|
|
15
|
-
/******/
|
|
16
|
-
/******/
|
|
17
|
-
/******/
|
|
1
|
+
/******/ (() => { // webpackBootstrap
|
|
2
|
+
/******/ "use strict";
|
|
3
|
+
/******/ // The require scope
|
|
4
|
+
/******/ var __webpack_require__ = {};
|
|
5
|
+
/******/
|
|
6
|
+
/************************************************************************/
|
|
7
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
8
|
+
/******/ (() => {
|
|
9
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
10
|
+
/******/ __webpack_require__.n = (module) => {
|
|
11
|
+
/******/ var getter = module && module.__esModule ?
|
|
12
|
+
/******/ () => (module['default']) :
|
|
13
|
+
/******/ () => (module);
|
|
14
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
15
|
+
/******/ return getter;
|
|
16
|
+
/******/ };
|
|
17
|
+
/******/ })();
|
|
18
|
+
/******/
|
|
19
|
+
/******/ /* webpack/runtime/define property getters */
|
|
20
|
+
/******/ (() => {
|
|
21
|
+
/******/ // define getter functions for harmony exports
|
|
22
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
23
|
+
/******/ for(var key in definition) {
|
|
24
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
25
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
26
|
+
/******/ }
|
|
27
|
+
/******/ }
|
|
18
28
|
/******/ };
|
|
19
|
-
/******/
|
|
20
|
-
/******/
|
|
21
|
-
/******/
|
|
22
|
-
/******/
|
|
23
|
-
/******/
|
|
24
|
-
/******/
|
|
25
|
-
/******/
|
|
26
|
-
/******/
|
|
27
|
-
/******/
|
|
28
|
-
/******/
|
|
29
|
-
/******/
|
|
30
|
-
/******/
|
|
31
|
-
/******/
|
|
32
|
-
/******/
|
|
33
|
-
/******/
|
|
34
|
-
/******/
|
|
35
|
-
/******/
|
|
36
|
-
/******/
|
|
37
|
-
/******/ // define getter function for harmony exports
|
|
38
|
-
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
39
|
-
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
40
|
-
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
41
|
-
/******/ }
|
|
42
|
-
/******/ };
|
|
43
|
-
/******/
|
|
44
|
-
/******/ // define __esModule on exports
|
|
45
|
-
/******/ __webpack_require__.r = function(exports) {
|
|
46
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
47
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
48
|
-
/******/ }
|
|
49
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
50
|
-
/******/ };
|
|
51
|
-
/******/
|
|
52
|
-
/******/ // create a fake namespace object
|
|
53
|
-
/******/ // mode & 1: value is a module id, require it
|
|
54
|
-
/******/ // mode & 2: merge all properties of value into the ns
|
|
55
|
-
/******/ // mode & 4: return value when already ns object
|
|
56
|
-
/******/ // mode & 8|1: behave like require
|
|
57
|
-
/******/ __webpack_require__.t = function(value, mode) {
|
|
58
|
-
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
59
|
-
/******/ if(mode & 8) return value;
|
|
60
|
-
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
61
|
-
/******/ var ns = Object.create(null);
|
|
62
|
-
/******/ __webpack_require__.r(ns);
|
|
63
|
-
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
64
|
-
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
65
|
-
/******/ return ns;
|
|
66
|
-
/******/ };
|
|
67
|
-
/******/
|
|
68
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
69
|
-
/******/ __webpack_require__.n = function(module) {
|
|
70
|
-
/******/ var getter = module && module.__esModule ?
|
|
71
|
-
/******/ function getDefault() { return module['default']; } :
|
|
72
|
-
/******/ function getModuleExports() { return module; };
|
|
73
|
-
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
74
|
-
/******/ return getter;
|
|
75
|
-
/******/ };
|
|
76
|
-
/******/
|
|
77
|
-
/******/ // Object.prototype.hasOwnProperty.call
|
|
78
|
-
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
79
|
-
/******/
|
|
80
|
-
/******/ // __webpack_public_path__
|
|
81
|
-
/******/ __webpack_require__.p = "";
|
|
82
|
-
/******/
|
|
83
|
-
/******/
|
|
84
|
-
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s = 177);
|
|
86
|
-
/******/ })
|
|
29
|
+
/******/ })();
|
|
30
|
+
/******/
|
|
31
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
32
|
+
/******/ (() => {
|
|
33
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
34
|
+
/******/ })();
|
|
35
|
+
/******/
|
|
36
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
37
|
+
/******/ (() => {
|
|
38
|
+
/******/ // define __esModule on exports
|
|
39
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
40
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
41
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
42
|
+
/******/ }
|
|
43
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
44
|
+
/******/ };
|
|
45
|
+
/******/ })();
|
|
46
|
+
/******/
|
|
87
47
|
/************************************************************************/
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
/***/ 0:
|
|
91
|
-
/***/ (function(module, exports) {
|
|
92
|
-
|
|
93
|
-
module.exports = require("@splunk/themes");
|
|
94
|
-
|
|
95
|
-
/***/ }),
|
|
96
|
-
|
|
97
|
-
/***/ 1:
|
|
98
|
-
/***/ (function(module, exports) {
|
|
99
|
-
|
|
100
|
-
module.exports = require("prop-types");
|
|
101
|
-
|
|
102
|
-
/***/ }),
|
|
103
|
-
|
|
104
|
-
/***/ 10:
|
|
105
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
106
|
-
|
|
107
|
-
"use strict";
|
|
108
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return updateReactRef; });
|
|
109
|
-
/**
|
|
110
|
-
* Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
|
|
111
|
-
*
|
|
112
|
-
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
113
|
-
* @param current - The new value of the ref.
|
|
114
|
-
*/
|
|
115
|
-
function updateReactRef(ref, current) {
|
|
116
|
-
if (ref) {
|
|
117
|
-
if (typeof ref === 'function') {
|
|
118
|
-
ref(current);
|
|
119
|
-
} else {
|
|
120
|
-
// the public signature of this util uses React.Ref<T> to mirror the way React types refs.
|
|
121
|
-
// the intention here is to signal "we will take care of setting 'current', not you".
|
|
122
|
-
ref.current = current; // eslint-disable-line no-param-reassign
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
/***/ }),
|
|
130
|
-
|
|
131
|
-
/***/ 107:
|
|
132
|
-
/***/ (function(module, exports) {
|
|
133
|
-
|
|
134
|
-
module.exports = require("@dnd-kit/sortable");
|
|
135
|
-
|
|
136
|
-
/***/ }),
|
|
137
|
-
|
|
138
|
-
/***/ 133:
|
|
139
|
-
/***/ (function(module, exports) {
|
|
140
|
-
|
|
141
|
-
module.exports = require("@splunk/react-icons/Plus");
|
|
142
|
-
|
|
143
|
-
/***/ }),
|
|
144
|
-
|
|
145
|
-
/***/ 134:
|
|
146
|
-
/***/ (function(module, exports) {
|
|
147
|
-
|
|
148
|
-
module.exports = require("@splunk/react-icons/enterprise/Plus");
|
|
149
|
-
|
|
150
|
-
/***/ }),
|
|
151
|
-
|
|
152
|
-
/***/ 135:
|
|
153
|
-
/***/ (function(module, exports) {
|
|
154
|
-
|
|
155
|
-
module.exports = require("@dnd-kit/utilities");
|
|
156
|
-
|
|
157
|
-
/***/ }),
|
|
158
|
-
|
|
159
|
-
/***/ 14:
|
|
160
|
-
/***/ (function(module, exports) {
|
|
161
|
-
|
|
162
|
-
module.exports = require("@splunk/react-ui/ScreenReaderContent");
|
|
163
|
-
|
|
164
|
-
/***/ }),
|
|
165
|
-
|
|
166
|
-
/***/ 17:
|
|
167
|
-
/***/ (function(module, exports) {
|
|
168
|
-
|
|
169
|
-
module.exports = require("@splunk/react-ui/Button");
|
|
170
|
-
|
|
171
|
-
/***/ }),
|
|
172
|
-
|
|
173
|
-
/***/ 177:
|
|
174
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
175
|
-
|
|
176
|
-
"use strict";
|
|
48
|
+
var __webpack_exports__ = {};
|
|
177
49
|
// ESM COMPAT FLAG
|
|
178
50
|
__webpack_require__.r(__webpack_exports__);
|
|
179
51
|
|
|
180
52
|
// EXPORTS
|
|
181
|
-
__webpack_require__.d(__webpack_exports__,
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
var external_react_ = __webpack_require__(2);
|
|
186
|
-
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
|
|
187
|
-
|
|
188
|
-
// EXTERNAL MODULE: external "prop-types"
|
|
189
|
-
var external_prop_types_ = __webpack_require__(1);
|
|
190
|
-
var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
|
|
191
|
-
|
|
192
|
-
// EXTERNAL MODULE: external "@splunk/ui-utils/i18n"
|
|
193
|
-
var i18n_ = __webpack_require__(4);
|
|
194
|
-
|
|
195
|
-
// EXTERNAL MODULE: external "@splunk/ui-utils/keyboard"
|
|
196
|
-
var keyboard_ = __webpack_require__(7);
|
|
197
|
-
|
|
198
|
-
// CONCATENATED MODULE: ./src/FormRows/FormRowsContext.tsx
|
|
53
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
54
|
+
Row: () => (/* reexport */ FormRows_Row),
|
|
55
|
+
"default": () => (/* reexport */ FormRows_FormRows)
|
|
56
|
+
});
|
|
199
57
|
|
|
200
|
-
|
|
58
|
+
;// CONCATENATED MODULE: external "react"
|
|
59
|
+
const external_react_namespaceObject = require("react");
|
|
60
|
+
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_namespaceObject);
|
|
61
|
+
;// CONCATENATED MODULE: external "prop-types"
|
|
62
|
+
const external_prop_types_namespaceObject = require("prop-types");
|
|
63
|
+
var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_namespaceObject);
|
|
64
|
+
;// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
|
|
65
|
+
const i18n_namespaceObject = require("@splunk/ui-utils/i18n");
|
|
66
|
+
;// CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
|
|
67
|
+
const keyboard_namespaceObject = require("@splunk/ui-utils/keyboard");
|
|
68
|
+
;// CONCATENATED MODULE: ./src/FormRows/FormRowsContext.tsx
|
|
69
|
+
|
|
70
|
+
var FormRowsContext = /*#__PURE__*/(0,external_react_namespaceObject.createContext)({
|
|
201
71
|
disabledDeleteButton: false,
|
|
202
72
|
sortable: true
|
|
203
73
|
});
|
|
204
74
|
FormRowsContext.displayName = 'FormRows';
|
|
205
|
-
/* harmony default export */
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
var
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
var enterprise_Plus_default = /*#__PURE__*/__webpack_require__.n(enterprise_Plus_);
|
|
216
|
-
|
|
217
|
-
// CONCATENATED MODULE: ./src/FormRows/icons/FormRowsPlusIcon.tsx
|
|
75
|
+
/* harmony default export */ const FormRows_FormRowsContext = (FormRowsContext);
|
|
76
|
+
;// CONCATENATED MODULE: external "@splunk/themes"
|
|
77
|
+
const themes_namespaceObject = require("@splunk/themes");
|
|
78
|
+
;// CONCATENATED MODULE: external "@splunk/react-icons/Plus"
|
|
79
|
+
const Plus_namespaceObject = require("@splunk/react-icons/Plus");
|
|
80
|
+
var Plus_default = /*#__PURE__*/__webpack_require__.n(Plus_namespaceObject);
|
|
81
|
+
;// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Plus"
|
|
82
|
+
const enterprise_Plus_namespaceObject = require("@splunk/react-icons/enterprise/Plus");
|
|
83
|
+
var enterprise_Plus_default = /*#__PURE__*/__webpack_require__.n(enterprise_Plus_namespaceObject);
|
|
84
|
+
;// CONCATENATED MODULE: ./src/FormRows/icons/FormRowsPlusIcon.tsx
|
|
218
85
|
|
|
219
86
|
|
|
220
87
|
|
|
221
88
|
|
|
222
89
|
|
|
223
|
-
var
|
|
224
|
-
var _useSplunkTheme =
|
|
90
|
+
var FormRowsPlusIcon = function FormRowsPlusIcon() {
|
|
91
|
+
var _useSplunkTheme = (0,themes_namespaceObject.useSplunkTheme)(),
|
|
225
92
|
isEnterprise = _useSplunkTheme.isEnterprise,
|
|
226
93
|
isCompact = _useSplunkTheme.isCompact;
|
|
227
94
|
|
|
228
95
|
var prismaSize = isCompact ? '20px' : '24px';
|
|
229
|
-
return isEnterprise ? /*#__PURE__*/external_react_default.
|
|
96
|
+
return isEnterprise ? /*#__PURE__*/external_react_default().createElement((enterprise_Plus_default()), {
|
|
230
97
|
screenReaderText: null,
|
|
231
98
|
hideDefaultTooltip: true
|
|
232
|
-
}) : /*#__PURE__*/external_react_default.
|
|
99
|
+
}) : /*#__PURE__*/external_react_default().createElement((Plus_default()), {
|
|
233
100
|
width: prismaSize,
|
|
234
101
|
height: prismaSize
|
|
235
102
|
});
|
|
236
103
|
};
|
|
237
104
|
|
|
238
|
-
/* harmony default export */
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
var omit_default = /*#__PURE__*/__webpack_require__.n(
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
var
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
var
|
|
105
|
+
/* harmony default export */ const icons_FormRowsPlusIcon = (FormRowsPlusIcon);
|
|
106
|
+
;// CONCATENATED MODULE: external "lodash/omit"
|
|
107
|
+
const omit_namespaceObject = require("lodash/omit");
|
|
108
|
+
var omit_default = /*#__PURE__*/__webpack_require__.n(omit_namespaceObject);
|
|
109
|
+
;// CONCATENATED MODULE: external "@splunk/react-ui/CloseButton"
|
|
110
|
+
const CloseButton_namespaceObject = require("@splunk/react-ui/CloseButton");
|
|
111
|
+
var CloseButton_default = /*#__PURE__*/__webpack_require__.n(CloseButton_namespaceObject);
|
|
112
|
+
;// CONCATENATED MODULE: external "styled-components"
|
|
113
|
+
const external_styled_components_namespaceObject = require("styled-components");
|
|
114
|
+
var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_namespaceObject);
|
|
115
|
+
;// CONCATENATED MODULE: external "@splunk/react-ui/Box"
|
|
116
|
+
const Box_namespaceObject = require("@splunk/react-ui/Box");
|
|
117
|
+
var Box_default = /*#__PURE__*/__webpack_require__.n(Box_namespaceObject);
|
|
118
|
+
;// CONCATENATED MODULE: external "@splunk/react-ui/Button"
|
|
119
|
+
const Button_namespaceObject = require("@splunk/react-ui/Button");
|
|
120
|
+
var Button_default = /*#__PURE__*/__webpack_require__.n(Button_namespaceObject);
|
|
121
|
+
;// CONCATENATED MODULE: ./src/FormRows/FormRowsStyles.ts
|
|
254
122
|
|
|
255
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/Button"
|
|
256
|
-
var Button_ = __webpack_require__(17);
|
|
257
|
-
var Button_default = /*#__PURE__*/__webpack_require__.n(Button_);
|
|
258
123
|
|
|
259
|
-
// CONCATENATED MODULE: ./src/FormRows/FormRowsStyles.ts
|
|
260
124
|
|
|
261
125
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
var StyledBox = external_styled_components_default()(Box_default.a).withConfig({
|
|
126
|
+
var StyledBox = external_styled_components_default()((Box_default())).withConfig({
|
|
265
127
|
displayName: "FormRowsStyles__StyledBox",
|
|
266
128
|
componentId: "sc-1j4j7h3-0"
|
|
267
|
-
})(["", ";"],
|
|
268
|
-
var StyledHeader = external_styled_components_default.
|
|
129
|
+
})(["", ";"], themes_namespaceObject.mixins.reset('block'));
|
|
130
|
+
var StyledHeader = external_styled_components_default().div.withConfig({
|
|
269
131
|
displayName: "FormRowsStyles__StyledHeader",
|
|
270
132
|
componentId: "sc-1j4j7h3-1"
|
|
271
|
-
})(["padding-left:", ";", ""],
|
|
272
|
-
enterprise:
|
|
133
|
+
})(["padding-left:", ";", ""], (0,themes_namespaceObject.pick)({
|
|
134
|
+
enterprise: themes_namespaceObject.variables.spacingHalf,
|
|
273
135
|
prisma: '16px'
|
|
274
|
-
}),
|
|
136
|
+
}), (0,themes_namespaceObject.pick)({
|
|
275
137
|
prisma: {
|
|
276
|
-
comfortable:
|
|
277
|
-
compact:
|
|
138
|
+
comfortable: (0,external_styled_components_namespaceObject.css)(["padding-bottom:8px;"]),
|
|
139
|
+
compact: (0,external_styled_components_namespaceObject.css)(["padding-bottom:6px;"])
|
|
278
140
|
}
|
|
279
141
|
}));
|
|
280
|
-
var StyledAddRowButton = external_styled_components_default()(Button_default
|
|
142
|
+
var StyledAddRowButton = external_styled_components_default()((Button_default())).withConfig({
|
|
281
143
|
displayName: "FormRowsStyles__StyledAddRowButton",
|
|
282
144
|
componentId: "sc-1j4j7h3-2"
|
|
283
145
|
})(["", ""], function (_ref) {
|
|
284
146
|
var $sortable = _ref.$sortable;
|
|
285
|
-
return $sortable &&
|
|
286
|
-
prisma:
|
|
147
|
+
return $sortable && (0,themes_namespaceObject.pick)({
|
|
148
|
+
prisma: (0,external_styled_components_namespaceObject.css)(["margin-left:16px;"])
|
|
287
149
|
});
|
|
288
150
|
});
|
|
289
|
-
var StyledRows = external_styled_components_default.
|
|
151
|
+
var StyledRows = external_styled_components_default().div.withConfig({
|
|
290
152
|
displayName: "FormRowsStyles__StyledRows",
|
|
291
153
|
componentId: "sc-1j4j7h3-3"
|
|
292
|
-
})(["position:relative;", ""],
|
|
154
|
+
})(["position:relative;", ""], (0,themes_namespaceObject.pick)({
|
|
293
155
|
prisma: {
|
|
294
|
-
comfortable:
|
|
295
|
-
compact:
|
|
156
|
+
comfortable: (0,external_styled_components_namespaceObject.css)(["padding-bottom:12px;"]),
|
|
157
|
+
compact: (0,external_styled_components_namespaceObject.css)(["padding-bottom:10px;"])
|
|
296
158
|
}
|
|
297
159
|
}));
|
|
298
|
-
var Styled = external_styled_components_default.
|
|
160
|
+
var Styled = external_styled_components_default().div.withConfig({
|
|
299
161
|
displayName: "FormRowsStyles__Styled",
|
|
300
162
|
componentId: "sc-1j4j7h3-4"
|
|
301
|
-
})(["padding:", ";position:relative;&.sorting{z-index:calc(", " + 1);}", " &:focus{outline:0;box-shadow:", ";}"],
|
|
302
|
-
enterprise:
|
|
163
|
+
})(["padding:", ";position:relative;&.sorting{z-index:calc(", " + 1);}", " &:focus{outline:0;box-shadow:", ";}"], (0,themes_namespaceObject.pick)({
|
|
164
|
+
enterprise: (0,external_styled_components_namespaceObject.css)(["3px calc(", " + 3px) 3px 0"], themes_namespaceObject.variables.inputHeight),
|
|
303
165
|
prisma: {
|
|
304
|
-
comfortable:
|
|
305
|
-
compact:
|
|
166
|
+
comfortable: (0,external_styled_components_namespaceObject.css)(["8px calc(", " + 8px) 8px 0"], themes_namespaceObject.variables.inputHeight),
|
|
167
|
+
compact: (0,external_styled_components_namespaceObject.css)(["6px calc(", " + 8px) 6px 0"], themes_namespaceObject.variables.inputHeight)
|
|
306
168
|
}
|
|
307
|
-
}),
|
|
169
|
+
}), themes_namespaceObject.variables.zindexPopover, function (_ref2) {
|
|
308
170
|
var $sortable = _ref2.$sortable;
|
|
309
|
-
return $sortable &&
|
|
310
|
-
enterprise:
|
|
171
|
+
return $sortable && (0,external_styled_components_namespaceObject.css)(["padding-left:", ";"], (0,themes_namespaceObject.pick)({
|
|
172
|
+
enterprise: themes_namespaceObject.variables.spacingHalf,
|
|
311
173
|
prisma: '16px'
|
|
312
174
|
}));
|
|
313
|
-
},
|
|
314
|
-
var StyledButton = external_styled_components_default.
|
|
175
|
+
}, themes_namespaceObject.variables.focusShadow);
|
|
176
|
+
var StyledButton = external_styled_components_default().div.withConfig({
|
|
315
177
|
displayName: "FormRowsStyles__StyledButton",
|
|
316
178
|
componentId: "sc-1j4j7h3-5"
|
|
317
|
-
})(["position:absolute;right:0;top:", ";float:right;"],
|
|
179
|
+
})(["position:absolute;right:0;top:", ";float:right;"], (0,themes_namespaceObject.pick)({
|
|
318
180
|
enterprise: '3px',
|
|
319
181
|
prisma: {
|
|
320
182
|
comfortable: '8px',
|
|
321
183
|
compact: '6px'
|
|
322
184
|
}
|
|
323
185
|
}));
|
|
324
|
-
var StyledDrag = external_styled_components_default.
|
|
186
|
+
var StyledDrag = external_styled_components_default().div.withConfig({
|
|
325
187
|
displayName: "FormRowsStyles__StyledDrag",
|
|
326
188
|
componentId: "sc-1j4j7h3-6"
|
|
327
|
-
})(["position:absolute;left:0;right:0;content:'';cursor:move;background:", ";width:", ";top:", ";", ""],
|
|
189
|
+
})(["position:absolute;left:0;right:0;content:'';cursor:move;background:", ";width:", ";top:", ";", ""], themes_namespaceObject.variables.draggableBackground, (0,themes_namespaceObject.pick)({
|
|
328
190
|
enterprise: '7px',
|
|
329
191
|
prisma: '6px'
|
|
330
|
-
}),
|
|
192
|
+
}), (0,themes_namespaceObject.pick)({
|
|
331
193
|
enterprise: '4px',
|
|
332
194
|
prisma: {
|
|
333
195
|
comfortable: '18px',
|
|
334
196
|
compact: '12px'
|
|
335
197
|
}
|
|
336
|
-
}),
|
|
337
|
-
enterprise:
|
|
338
|
-
prisma:
|
|
198
|
+
}), (0,themes_namespaceObject.pick)({
|
|
199
|
+
enterprise: (0,external_styled_components_namespaceObject.css)(["bottom:3px;opacity:0.5;"]),
|
|
200
|
+
prisma: (0,external_styled_components_namespaceObject.css)(["height:20px;"])
|
|
339
201
|
}));
|
|
340
202
|
|
|
341
|
-
|
|
203
|
+
;// CONCATENATED MODULE: ./src/FormRows/RowInternal.tsx
|
|
342
204
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
343
205
|
|
|
344
206
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -355,33 +217,33 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
355
217
|
/** @public */
|
|
356
218
|
|
|
357
219
|
var propTypes = {
|
|
358
|
-
children: external_prop_types_default.
|
|
359
|
-
index: external_prop_types_default.
|
|
360
|
-
onRequestRemove: external_prop_types_default.
|
|
361
|
-
renderDragHandle: external_prop_types_default.
|
|
362
|
-
style: external_prop_types_default.
|
|
363
|
-
value: external_prop_types_default.
|
|
220
|
+
children: (external_prop_types_default()).node,
|
|
221
|
+
index: (external_prop_types_default()).number,
|
|
222
|
+
onRequestRemove: (external_prop_types_default()).func,
|
|
223
|
+
renderDragHandle: (external_prop_types_default()).func,
|
|
224
|
+
style: (external_prop_types_default()).object,
|
|
225
|
+
value: (external_prop_types_default()).node
|
|
364
226
|
};
|
|
365
|
-
var RowInternal = /*#__PURE__*/external_react_default.
|
|
227
|
+
var RowInternal = /*#__PURE__*/external_react_default().forwardRef(function (_ref, ref) {
|
|
366
228
|
var children = _ref.children,
|
|
367
229
|
index = _ref.index,
|
|
368
230
|
onRequestRemove = _ref.onRequestRemove,
|
|
369
231
|
renderDragHandle = _ref.renderDragHandle,
|
|
370
232
|
otherProps = _objectWithoutProperties(_ref, ["children", "index", "onRequestRemove", "renderDragHandle"]);
|
|
371
233
|
|
|
372
|
-
var _useContext =
|
|
234
|
+
var _useContext = (0,external_react_namespaceObject.useContext)(FormRows_FormRowsContext),
|
|
373
235
|
disabledDeleteButtonContext = _useContext.disabledDeleteButton,
|
|
374
236
|
hasOnRequestAddContext = _useContext.hasOnRequestAdd,
|
|
375
237
|
onKeyDownContext = _useContext.onKeyDown,
|
|
376
238
|
sortableContext = _useContext.sortable;
|
|
377
239
|
|
|
378
|
-
var handleKeyDown =
|
|
240
|
+
var handleKeyDown = (0,external_react_namespaceObject.useCallback)(function (e) {
|
|
379
241
|
// TODO: this callback doesn't work correctly if index isn't provided SUI-5639
|
|
380
242
|
onKeyDownContext === null || onKeyDownContext === void 0 ? void 0 : onKeyDownContext(e, {
|
|
381
243
|
index: index !== null && index !== void 0 ? index : 0
|
|
382
244
|
});
|
|
383
245
|
}, [onKeyDownContext, index]);
|
|
384
|
-
var handleRequestRemove =
|
|
246
|
+
var handleRequestRemove = (0,external_react_namespaceObject.useCallback)(function (e) {
|
|
385
247
|
// TODO: this callback doesn't work correctly if index isn't provided SUI-5639
|
|
386
248
|
onRequestRemove === null || onRequestRemove === void 0 ? void 0 : onRequestRemove(e, {
|
|
387
249
|
index: index !== null && index !== void 0 ? index : 0
|
|
@@ -395,34 +257,48 @@ var RowInternal = /*#__PURE__*/external_react_default.a.forwardRef(function (_re
|
|
|
395
257
|
|
|
396
258
|
if (false) {}
|
|
397
259
|
|
|
398
|
-
return /*#__PURE__*/external_react_default.
|
|
260
|
+
return /*#__PURE__*/external_react_default().createElement(Styled, _extends({
|
|
399
261
|
$sortable: sortableContext,
|
|
400
262
|
"data-test": "row",
|
|
401
263
|
ref: ref,
|
|
402
264
|
onKeyDown: handleKeyDown
|
|
403
|
-
}, omit_default()(otherProps, ['onKeyDown', 'onRequestRemove'])), renderDragHandle && renderDragHandle(), children, onRequestRemoveExists && /*#__PURE__*/external_react_default.
|
|
265
|
+
}, omit_default()(otherProps, ['onKeyDown', 'onRequestRemove'])), renderDragHandle && renderDragHandle(), children, onRequestRemoveExists && /*#__PURE__*/external_react_default().createElement(StyledButton, null, /*#__PURE__*/external_react_default().createElement((CloseButton_default()), {
|
|
404
266
|
disabled: disabledDeleteButtonContext,
|
|
405
267
|
"data-test": "remove",
|
|
406
268
|
onClick: handleRequestRemove,
|
|
407
|
-
screenReaderText:
|
|
269
|
+
screenReaderText: (0,i18n_namespaceObject._)('Remove Row')
|
|
408
270
|
})));
|
|
409
271
|
});
|
|
410
272
|
RowInternal.propTypes = propTypes;
|
|
411
|
-
/* harmony default export */
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
273
|
+
/* harmony default export */ const FormRows_RowInternal = (RowInternal);
|
|
274
|
+
;// CONCATENATED MODULE: external "@dnd-kit/sortable"
|
|
275
|
+
const sortable_namespaceObject = require("@dnd-kit/sortable");
|
|
276
|
+
;// CONCATENATED MODULE: external "@dnd-kit/utilities"
|
|
277
|
+
const utilities_namespaceObject = require("@dnd-kit/utilities");
|
|
278
|
+
;// CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
|
|
279
|
+
const ScreenReaderContent_namespaceObject = require("@splunk/react-ui/ScreenReaderContent");
|
|
280
|
+
var ScreenReaderContent_default = /*#__PURE__*/__webpack_require__.n(ScreenReaderContent_namespaceObject);
|
|
281
|
+
;// CONCATENATED MODULE: ./src/utils/updateReactRef.ts
|
|
282
|
+
/**
|
|
283
|
+
* Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
|
|
284
|
+
*
|
|
285
|
+
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
286
|
+
* @param current - The new value of the ref.
|
|
287
|
+
*/
|
|
288
|
+
function updateReactRef(ref, current) {
|
|
289
|
+
if (ref) {
|
|
290
|
+
if (typeof ref === 'function') {
|
|
291
|
+
ref(current);
|
|
292
|
+
} else {
|
|
293
|
+
// the public signature of this util uses React.Ref<T> to mirror the way React types refs.
|
|
294
|
+
// the intention here is to signal "we will take care of setting 'current', not you".
|
|
295
|
+
ref.current = current; // eslint-disable-line no-param-reassign
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
421
299
|
|
|
422
|
-
// EXTERNAL MODULE: ./src/utils/updateReactRef.ts
|
|
423
|
-
var updateReactRef = __webpack_require__(10);
|
|
424
300
|
|
|
425
|
-
|
|
301
|
+
;// CONCATENATED MODULE: ./src/FormRows/SortableRow.tsx
|
|
426
302
|
function SortableRow_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = SortableRow_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
427
303
|
|
|
428
304
|
function SortableRow_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -439,24 +315,24 @@ function SortableRow_extends() { SortableRow_extends = Object.assign || function
|
|
|
439
315
|
|
|
440
316
|
|
|
441
317
|
var SortableRow_propTypes = {
|
|
442
|
-
children: external_prop_types_default.
|
|
443
|
-
index: external_prop_types_default.
|
|
444
|
-
onRequestRemove: external_prop_types_default.
|
|
445
|
-
value: external_prop_types_default.
|
|
318
|
+
children: (external_prop_types_default()).node,
|
|
319
|
+
index: (external_prop_types_default()).number,
|
|
320
|
+
onRequestRemove: (external_prop_types_default()).func,
|
|
321
|
+
value: (external_prop_types_default()).node
|
|
446
322
|
};
|
|
447
|
-
var DragHandle = /*#__PURE__*/external_react_default.
|
|
448
|
-
return /*#__PURE__*/external_react_default.
|
|
323
|
+
var DragHandle = /*#__PURE__*/external_react_default().forwardRef(function (props, ref) {
|
|
324
|
+
return /*#__PURE__*/external_react_default().createElement(StyledDrag, SortableRow_extends({
|
|
449
325
|
"data-test": "drag-handle",
|
|
450
326
|
ref: ref
|
|
451
|
-
}, props), /*#__PURE__*/external_react_default.
|
|
327
|
+
}, props), /*#__PURE__*/external_react_default().createElement((ScreenReaderContent_default()), null, (0,i18n_namespaceObject._)('Press arrow up or arrow down to re-order items')));
|
|
452
328
|
});
|
|
453
|
-
var
|
|
329
|
+
var Row = /*#__PURE__*/external_react_default().forwardRef(function (_ref, ref) {
|
|
454
330
|
var children = _ref.children,
|
|
455
331
|
index = _ref.index,
|
|
456
332
|
otherProps = SortableRow_objectWithoutProperties(_ref, ["children", "index"]);
|
|
457
333
|
|
|
458
334
|
// @docs-props-type RowPropsBase
|
|
459
|
-
var _useSortable =
|
|
335
|
+
var _useSortable = (0,sortable_namespaceObject.useSortable)({
|
|
460
336
|
// @dnd-kit requires "id" to be greater than 0 https://github.com/clauderic/dnd-kit/issues/1150
|
|
461
337
|
// TODO: FormRows drag functionality doesn't work without an index, but it's not a required prop SUI-5639
|
|
462
338
|
id: (index || 0) + 1
|
|
@@ -469,29 +345,29 @@ var SortableRow_Row = /*#__PURE__*/external_react_default.a.forwardRef(function
|
|
|
469
345
|
transition = _useSortable.transition;
|
|
470
346
|
|
|
471
347
|
var style = {
|
|
472
|
-
transform:
|
|
348
|
+
transform: utilities_namespaceObject.CSS.Transform.toString(transform),
|
|
473
349
|
transition: transition
|
|
474
350
|
};
|
|
475
351
|
|
|
476
352
|
var handleRef = function handleRef(el) {
|
|
477
353
|
setNodeRef(el);
|
|
478
|
-
|
|
354
|
+
updateReactRef(ref, el);
|
|
479
355
|
};
|
|
480
356
|
|
|
481
|
-
return /*#__PURE__*/external_react_default.
|
|
357
|
+
return /*#__PURE__*/external_react_default().createElement(FormRows_RowInternal, SortableRow_extends({
|
|
482
358
|
index: index,
|
|
483
359
|
ref: handleRef,
|
|
484
360
|
renderDragHandle: function renderDragHandle() {
|
|
485
|
-
return /*#__PURE__*/external_react_default.
|
|
361
|
+
return /*#__PURE__*/external_react_default().createElement(DragHandle, SortableRow_extends({
|
|
486
362
|
ref: setActivatorNodeRef
|
|
487
363
|
}, listeners));
|
|
488
364
|
},
|
|
489
365
|
style: style
|
|
490
366
|
}, otherProps, attributes), children);
|
|
491
367
|
});
|
|
492
|
-
|
|
493
|
-
/* harmony default export */
|
|
494
|
-
|
|
368
|
+
Row.propTypes = SortableRow_propTypes;
|
|
369
|
+
/* harmony default export */ const SortableRow = (Row);
|
|
370
|
+
;// CONCATENATED MODULE: ./src/FormRows/Row.tsx
|
|
495
371
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
496
372
|
|
|
497
373
|
function Row_extends() { Row_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Row_extends.apply(this, arguments); }
|
|
@@ -529,11 +405,11 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
529
405
|
|
|
530
406
|
|
|
531
407
|
var Row_propTypes = {
|
|
532
|
-
children: external_prop_types_default.
|
|
533
|
-
elementRef: external_prop_types_default.
|
|
534
|
-
index: external_prop_types_default.
|
|
535
|
-
onRequestRemove: external_prop_types_default.
|
|
536
|
-
value: external_prop_types_default.
|
|
408
|
+
children: (external_prop_types_default()).node,
|
|
409
|
+
elementRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
|
|
410
|
+
index: (external_prop_types_default()).number,
|
|
411
|
+
onRequestRemove: (external_prop_types_default()).func,
|
|
412
|
+
value: (external_prop_types_default()).node
|
|
537
413
|
};
|
|
538
414
|
|
|
539
415
|
var Row_Row = /*#__PURE__*/function (_Component) {
|
|
@@ -559,33 +435,32 @@ var Row_Row = /*#__PURE__*/function (_Component) {
|
|
|
559
435
|
var sortableContext = this.context.sortable;
|
|
560
436
|
var rowProps = omit_default()(otherProps, ['onKeyDown']);
|
|
561
437
|
var RowComponent = sortableContext ? SortableRow : FormRows_RowInternal;
|
|
562
|
-
return /*#__PURE__*/external_react_default.
|
|
438
|
+
return /*#__PURE__*/external_react_default().createElement(RowComponent, Row_extends({
|
|
563
439
|
ref: elementRef
|
|
564
440
|
}, rowProps), children);
|
|
565
441
|
}
|
|
566
442
|
}]);
|
|
567
443
|
|
|
568
444
|
return Row;
|
|
569
|
-
}(
|
|
445
|
+
}(external_react_namespaceObject.Component);
|
|
570
446
|
|
|
571
447
|
_defineProperty(Row_Row, "propTypes", Row_propTypes);
|
|
572
448
|
|
|
573
449
|
_defineProperty(Row_Row, "contextType", FormRows_FormRowsContext);
|
|
574
450
|
|
|
575
|
-
/* harmony default export */
|
|
576
|
-
|
|
577
|
-
|
|
451
|
+
/* harmony default export */ const FormRows_Row = (Row_Row);
|
|
452
|
+
;// CONCATENATED MODULE: external "@dnd-kit/core"
|
|
453
|
+
const core_namespaceObject = require("@dnd-kit/core");
|
|
454
|
+
;// CONCATENATED MODULE: ./src/FormRows/SortableList.tsx
|
|
578
455
|
|
|
579
|
-
// CONCATENATED MODULE: ./src/FormRows/SortableList.tsx
|
|
580
456
|
|
|
581
457
|
|
|
582
458
|
|
|
583
|
-
|
|
584
|
-
var SortableList_SortableList = function SortableList(_ref) {
|
|
459
|
+
var SortableList = function SortableList(_ref) {
|
|
585
460
|
var children = _ref.children,
|
|
586
461
|
onSortEnd = _ref.onSortEnd;
|
|
587
|
-
var sensors =
|
|
588
|
-
var validChildren =
|
|
462
|
+
var sensors = (0,core_namespaceObject.useSensors)((0,core_namespaceObject.useSensor)(core_namespaceObject.PointerSensor), (0,core_namespaceObject.useSensor)(core_namespaceObject.MouseSensor));
|
|
463
|
+
var validChildren = external_react_namespaceObject.Children.toArray(children).filter(external_react_namespaceObject.isValidElement);
|
|
589
464
|
var items = validChildren.map(function (child) {
|
|
590
465
|
return (child.props.index || 0) + 1;
|
|
591
466
|
});
|
|
@@ -604,18 +479,18 @@ var SortableList_SortableList = function SortableList(_ref) {
|
|
|
604
479
|
}
|
|
605
480
|
}
|
|
606
481
|
|
|
607
|
-
return /*#__PURE__*/external_react_default.
|
|
482
|
+
return /*#__PURE__*/external_react_default().createElement(core_namespaceObject.DndContext, {
|
|
608
483
|
sensors: sensors,
|
|
609
|
-
collisionDetection:
|
|
484
|
+
collisionDetection: core_namespaceObject.closestCenter,
|
|
610
485
|
onDragEnd: handleDragEnd
|
|
611
|
-
}, /*#__PURE__*/external_react_default.
|
|
486
|
+
}, /*#__PURE__*/external_react_default().createElement(sortable_namespaceObject.SortableContext, {
|
|
612
487
|
items: items,
|
|
613
|
-
strategy:
|
|
488
|
+
strategy: sortable_namespaceObject.verticalListSortingStrategy
|
|
614
489
|
}, validChildren));
|
|
615
490
|
};
|
|
616
491
|
|
|
617
|
-
/* harmony default export */
|
|
618
|
-
|
|
492
|
+
/* harmony default export */ const FormRows_SortableList = (SortableList);
|
|
493
|
+
;// CONCATENATED MODULE: ./src/FormRows/FormRows.tsx
|
|
619
494
|
function FormRows_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FormRows_typeof = function _typeof(obj) { return typeof obj; }; } else { FormRows_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FormRows_typeof(obj); }
|
|
620
495
|
|
|
621
496
|
function FormRows_extends() { FormRows_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return FormRows_extends.apply(this, arguments); }
|
|
@@ -656,22 +531,22 @@ function FormRows_defineProperty(obj, key, value) { if (key in obj) { Object.def
|
|
|
656
531
|
|
|
657
532
|
|
|
658
533
|
var FormRows_propTypes = {
|
|
659
|
-
addLabel: external_prop_types_default.
|
|
660
|
-
children: external_prop_types_default.
|
|
661
|
-
disabled: external_prop_types_default.
|
|
662
|
-
elementRef: external_prop_types_default.
|
|
663
|
-
header: external_prop_types_default.
|
|
664
|
-
menu: external_prop_types_default.
|
|
665
|
-
onRequestAdd: external_prop_types_default.
|
|
666
|
-
onRequestMove: external_prop_types_default.
|
|
534
|
+
addLabel: (external_prop_types_default()).string,
|
|
535
|
+
children: (external_prop_types_default()).node,
|
|
536
|
+
disabled: (external_prop_types_default()).bool,
|
|
537
|
+
elementRef: external_prop_types_default().oneOfType([(external_prop_types_default()).func, (external_prop_types_default()).object]),
|
|
538
|
+
header: (external_prop_types_default()).node,
|
|
539
|
+
menu: (external_prop_types_default()).node,
|
|
540
|
+
onRequestAdd: (external_prop_types_default()).func,
|
|
541
|
+
onRequestMove: (external_prop_types_default()).func
|
|
667
542
|
};
|
|
668
543
|
var defaultProps = {
|
|
669
|
-
addLabel:
|
|
544
|
+
addLabel: (0,i18n_namespaceObject._)('Add Row'),
|
|
670
545
|
disabled: false,
|
|
671
546
|
header: null
|
|
672
547
|
};
|
|
673
548
|
|
|
674
|
-
var
|
|
549
|
+
var FormRows = /*#__PURE__*/function (_Component) {
|
|
675
550
|
FormRows_inherits(FormRows, _Component);
|
|
676
551
|
|
|
677
552
|
var _super = FormRows_createSuper(FormRows);
|
|
@@ -694,7 +569,7 @@ var FormRows_FormRows = /*#__PURE__*/function (_Component) {
|
|
|
694
569
|
return;
|
|
695
570
|
}
|
|
696
571
|
|
|
697
|
-
if (
|
|
572
|
+
if ((0,keyboard_namespaceObject.keycode)(e.nativeEvent) === 'up') {
|
|
698
573
|
e.preventDefault();
|
|
699
574
|
|
|
700
575
|
if (index > 0) {
|
|
@@ -705,10 +580,10 @@ var FormRows_FormRows = /*#__PURE__*/function (_Component) {
|
|
|
705
580
|
toIndex: index - 1
|
|
706
581
|
});
|
|
707
582
|
}
|
|
708
|
-
} else if (
|
|
583
|
+
} else if ((0,keyboard_namespaceObject.keycode)(e.nativeEvent) === 'down') {
|
|
709
584
|
e.preventDefault();
|
|
710
585
|
|
|
711
|
-
if (index < external_react_default.
|
|
586
|
+
if (index < external_react_default().Children.toArray(_this.props.children).length - 1) {
|
|
712
587
|
var _this$props$onRequest2, _this$props2;
|
|
713
588
|
|
|
714
589
|
(_this$props$onRequest2 = (_this$props2 = _this.props).onRequestMove) === null || _this$props$onRequest2 === void 0 ? void 0 : _this$props$onRequest2.call(_this$props2, {
|
|
@@ -749,22 +624,22 @@ var FormRows_FormRows = /*#__PURE__*/function (_Component) {
|
|
|
749
624
|
var sortable = onRequestMove !== undefined && !disabled;
|
|
750
625
|
var StyledHeaderComp = sortable ? StyledHeader : 'div';
|
|
751
626
|
var hasOnRequestAdd = onRequestAdd !== undefined;
|
|
752
|
-
return /*#__PURE__*/external_react_default.
|
|
627
|
+
return /*#__PURE__*/external_react_default().createElement(StyledBox, FormRows_extends({
|
|
753
628
|
"data-test": "form-rows"
|
|
754
|
-
}, otherProps), /*#__PURE__*/external_react_default.
|
|
629
|
+
}, otherProps), /*#__PURE__*/external_react_default().createElement(FormRows_FormRowsContext.Provider, {
|
|
755
630
|
value: {
|
|
756
631
|
disabledDeleteButton: disabled,
|
|
757
632
|
onKeyDown: this.handleKeyDown,
|
|
758
633
|
hasOnRequestAdd: hasOnRequestAdd,
|
|
759
634
|
sortable: sortable
|
|
760
635
|
}
|
|
761
|
-
}, header && /*#__PURE__*/external_react_default.
|
|
636
|
+
}, header && /*#__PURE__*/external_react_default().createElement(StyledHeaderComp, null, header), /*#__PURE__*/external_react_default().createElement(StyledRows, null, /*#__PURE__*/external_react_default().createElement(FormRows_SortableList, {
|
|
762
637
|
onSortEnd: this.handleSortEnd
|
|
763
|
-
}, children)), menu || hasOnRequestAdd && /*#__PURE__*/external_react_default.
|
|
638
|
+
}, children)), menu || hasOnRequestAdd && /*#__PURE__*/external_react_default().createElement(StyledAddRowButton, {
|
|
764
639
|
disabled: disabled,
|
|
765
640
|
appearance: "pill",
|
|
766
641
|
"data-test": "add-row",
|
|
767
|
-
icon: /*#__PURE__*/external_react_default.
|
|
642
|
+
icon: /*#__PURE__*/external_react_default().createElement(icons_FormRowsPlusIcon, null),
|
|
768
643
|
label: addLabel,
|
|
769
644
|
onClick: onRequestAdd,
|
|
770
645
|
$sortable: sortable
|
|
@@ -825,7 +700,7 @@ var FormRows_FormRows = /*#__PURE__*/function (_Component) {
|
|
|
825
700
|
});
|
|
826
701
|
tempArray.splice(toIndex, 0, items[fromIndex]);
|
|
827
702
|
return tempArray.map(function (item, index) {
|
|
828
|
-
return /*#__PURE__*/
|
|
703
|
+
return /*#__PURE__*/(0,external_react_namespaceObject.cloneElement)(item, {
|
|
829
704
|
index: index
|
|
830
705
|
});
|
|
831
706
|
});
|
|
@@ -852,7 +727,7 @@ var FormRows_FormRows = /*#__PURE__*/function (_Component) {
|
|
|
852
727
|
return items.filter(function (val, idx) {
|
|
853
728
|
return idx !== index;
|
|
854
729
|
}).map(function (item, idx) {
|
|
855
|
-
return /*#__PURE__*/
|
|
730
|
+
return /*#__PURE__*/(0,external_react_namespaceObject.cloneElement)(item, {
|
|
856
731
|
index: idx
|
|
857
732
|
});
|
|
858
733
|
});
|
|
@@ -860,76 +735,19 @@ var FormRows_FormRows = /*#__PURE__*/function (_Component) {
|
|
|
860
735
|
}]);
|
|
861
736
|
|
|
862
737
|
return FormRows;
|
|
863
|
-
}(
|
|
864
|
-
|
|
865
|
-
FormRows_defineProperty(FormRows_FormRows, "propTypes", FormRows_propTypes);
|
|
866
|
-
|
|
867
|
-
FormRows_defineProperty(FormRows_FormRows, "defaultProps", defaultProps);
|
|
868
|
-
|
|
869
|
-
FormRows_defineProperty(FormRows_FormRows, "Row", FormRows_Row);
|
|
870
|
-
|
|
871
|
-
/* harmony default export */ var src_FormRows_FormRows = (FormRows_FormRows);
|
|
872
|
-
|
|
873
|
-
// CONCATENATED MODULE: ./src/FormRows/index.ts
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
/***/ }),
|
|
878
|
-
|
|
879
|
-
/***/ 2:
|
|
880
|
-
/***/ (function(module, exports) {
|
|
881
|
-
|
|
882
|
-
module.exports = require("react");
|
|
883
|
-
|
|
884
|
-
/***/ }),
|
|
885
|
-
|
|
886
|
-
/***/ 3:
|
|
887
|
-
/***/ (function(module, exports) {
|
|
888
|
-
|
|
889
|
-
module.exports = require("styled-components");
|
|
890
|
-
|
|
891
|
-
/***/ }),
|
|
892
|
-
|
|
893
|
-
/***/ 4:
|
|
894
|
-
/***/ (function(module, exports) {
|
|
895
|
-
|
|
896
|
-
module.exports = require("@splunk/ui-utils/i18n");
|
|
897
|
-
|
|
898
|
-
/***/ }),
|
|
899
|
-
|
|
900
|
-
/***/ 5:
|
|
901
|
-
/***/ (function(module, exports) {
|
|
902
|
-
|
|
903
|
-
module.exports = require("lodash/omit");
|
|
904
|
-
|
|
905
|
-
/***/ }),
|
|
906
|
-
|
|
907
|
-
/***/ 6:
|
|
908
|
-
/***/ (function(module, exports) {
|
|
909
|
-
|
|
910
|
-
module.exports = require("@splunk/react-ui/Box");
|
|
911
|
-
|
|
912
|
-
/***/ }),
|
|
913
|
-
|
|
914
|
-
/***/ 7:
|
|
915
|
-
/***/ (function(module, exports) {
|
|
916
|
-
|
|
917
|
-
module.exports = require("@splunk/ui-utils/keyboard");
|
|
918
|
-
|
|
919
|
-
/***/ }),
|
|
738
|
+
}(external_react_namespaceObject.Component);
|
|
920
739
|
|
|
921
|
-
|
|
922
|
-
/***/ (function(module, exports) {
|
|
740
|
+
FormRows_defineProperty(FormRows, "propTypes", FormRows_propTypes);
|
|
923
741
|
|
|
924
|
-
|
|
742
|
+
FormRows_defineProperty(FormRows, "defaultProps", defaultProps);
|
|
925
743
|
|
|
926
|
-
|
|
744
|
+
FormRows_defineProperty(FormRows, "Row", FormRows_Row);
|
|
927
745
|
|
|
928
|
-
|
|
929
|
-
/***/ (function(module, exports) {
|
|
746
|
+
/* harmony default export */ const FormRows_FormRows = (FormRows);
|
|
930
747
|
|
|
931
|
-
|
|
748
|
+
;// CONCATENATED MODULE: ./src/FormRows/index.ts
|
|
932
749
|
|
|
933
|
-
/***/ })
|
|
934
750
|
|
|
935
|
-
|
|
751
|
+
module.exports = __webpack_exports__;
|
|
752
|
+
/******/ })()
|
|
753
|
+
;
|