@splunk/react-ui 4.21.0 → 4.22.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 +425 -325
- package/Anchor.js +147 -117
- package/Animation.js +142 -94
- package/AnimationToggle.js +197 -193
- package/Box.js +145 -118
- package/Breadcrumbs.js +288 -206
- package/Button.js +488 -465
- package/ButtonGroup.js +160 -128
- package/ButtonSimple.js +543 -462
- package/CHANGELOG.md +24 -3
- package/Calendar.js +1111 -1001
- package/Card.js +771 -598
- package/CardLayout.js +205 -147
- package/Chip.js +509 -488
- package/Clickable.js +414 -352
- package/CloseButton.js +165 -142
- package/Code.js +1807 -2084
- package/CollapsiblePanel.js +586 -519
- package/Color.js +1068 -1068
- package/ColumnLayout.js +402 -363
- package/ComboBox.js +903 -794
- package/Concertina.js +997 -802
- package/ControlGroup.js +687 -594
- package/Date.js +567 -547
- package/DefinitionList.js +308 -234
- package/Divider.js +149 -118
- package/Dropdown.js +459 -416
- package/DualListbox.js +1479 -1541
- package/EventListener.js +94 -97
- package/File.js +1051 -969
- package/FormRows.js +883 -696
- package/Heading.js +216 -193
- package/Image.js +446 -402
- package/JSONTree.js +690 -551
- package/Layer.js +437 -410
- package/Link.js +336 -255
- package/List.js +213 -161
- package/Markdown.js +509 -487
- package/Menu.js +1104 -1056
- package/Message.js +475 -441
- package/MessageBar.js +387 -373
- package/Modal.js +810 -634
- package/ModalLayer.js +326 -243
- package/Monogram.js +308 -276
- package/Multiselect.js +3564 -3364
- package/Number.js +729 -687
- package/Paginator.js +510 -449
- package/Paragraph.js +145 -112
- package/Popover.js +1459 -1432
- package/Progress.js +301 -246
- package/RadioBar.js +634 -527
- package/RadioList.js +483 -444
- package/Resize.js +530 -489
- package/ResultsMenu.js +479 -455
- package/ScreenReaderContent.js +142 -111
- package/Scroll.js +595 -456
- package/ScrollContainerContext.js +197 -206
- package/Search.js +756 -650
- package/Select.js +2446 -2345
- package/SidePanel.js +390 -284
- package/Slider.js +680 -676
- package/SlidingPanels.js +639 -503
- package/SplitButton.js +464 -367
- package/StaticContent.js +161 -133
- package/StepBar.js +386 -358
- package/Switch.js +710 -640
- package/TabBar.js +741 -680
- package/TabLayout.js +406 -322
- package/Table.js +4974 -4616
- package/Text.js +1170 -1138
- package/TextArea.js +1102 -1090
- package/Tooltip.js +624 -581
- package/TransitionOpen.js +489 -422
- package/Typography.js +176 -153
- package/WaitSpinner.js +230 -206
- package/package.json +7 -7
- package/types/src/Color/Color.d.ts +0 -1
- package/types/src/JSONTree/JSONTreeContext.d.ts +7 -0
- package/types/src/JSONTree/TreeNode.d.ts +5 -0
- package/types/src/RadioBar/RadioBar.d.ts +1 -0
- package/types/src/ResultsMenu/ResultsMenu.d.ts +0 -2
- package/types/src/Select/docs/examples/Icons.d.ts +1 -9
- package/types/src/Slider/Slider.d.ts +1 -0
- package/types/src/TabBar/Tab.d.ts +10 -1
- package/types/src/TabBar/TabBar.d.ts +4 -2
- package/types/src/Table/Head.d.ts +7 -3
- package/types/src/Table/Table.d.ts +3 -2
- package/types/src/Table/TableContext.d.ts +2 -0
- package/useForceUpdate.js +112 -82
- package/useKeyPress.js +74 -71
- package/usePrevious.js +65 -65
- package/useRovingFocus.js +122 -138
package/FormRows.js
CHANGED
|
@@ -1,654 +1,852 @@
|
|
|
1
|
-
/******/ (() => {
|
|
2
|
-
|
|
3
|
-
/******/
|
|
4
|
-
/******/
|
|
5
|
-
/******/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/******/
|
|
9
|
-
/******/
|
|
10
|
-
/******/
|
|
11
|
-
/******/
|
|
12
|
-
/******/
|
|
13
|
-
/******/
|
|
14
|
-
/******/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/******/
|
|
20
|
-
/******/
|
|
21
|
-
/******/
|
|
22
|
-
/******/
|
|
23
|
-
/******/
|
|
24
|
-
/******/
|
|
25
|
-
/******/
|
|
26
|
-
/******/
|
|
27
|
-
/******/
|
|
28
|
-
/******/
|
|
29
|
-
/******/
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
/******/
|
|
34
|
-
/******/
|
|
35
|
-
/******/
|
|
36
|
-
/******/
|
|
37
|
-
/******/
|
|
38
|
-
/******/
|
|
39
|
-
/******/
|
|
40
|
-
/******/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
/******/
|
|
44
|
-
/******/
|
|
45
|
-
/******/
|
|
46
|
-
/******/
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
;// 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)({
|
|
71
|
-
disabledDeleteButton: false,
|
|
72
|
-
sortable: true
|
|
73
|
-
});
|
|
74
|
-
FormRowsContext.displayName = 'FormRows';
|
|
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
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
var FormRowsPlusIcon = function FormRowsPlusIcon() {
|
|
91
|
-
var _useSplunkTheme = (0,themes_namespaceObject.useSplunkTheme)(),
|
|
92
|
-
isEnterprise = _useSplunkTheme.isEnterprise,
|
|
93
|
-
isCompact = _useSplunkTheme.isCompact;
|
|
94
|
-
|
|
95
|
-
var prismaSize = isCompact ? '20px' : '24px';
|
|
96
|
-
return isEnterprise ? /*#__PURE__*/external_react_default().createElement((enterprise_Plus_default()), {
|
|
97
|
-
screenReaderText: null,
|
|
98
|
-
hideDefaultTooltip: true
|
|
99
|
-
}) : /*#__PURE__*/external_react_default().createElement((Plus_default()), {
|
|
100
|
-
width: prismaSize,
|
|
101
|
-
height: prismaSize
|
|
102
|
-
});
|
|
103
|
-
};
|
|
104
|
-
|
|
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
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
var StyledBox = external_styled_components_default()((Box_default())).withConfig({
|
|
127
|
-
displayName: "FormRowsStyles__StyledBox",
|
|
128
|
-
componentId: "sc-1j4j7h3-0"
|
|
129
|
-
})(["", ";"], themes_namespaceObject.mixins.reset('block'));
|
|
130
|
-
var StyledHeader = external_styled_components_default().div.withConfig({
|
|
131
|
-
displayName: "FormRowsStyles__StyledHeader",
|
|
132
|
-
componentId: "sc-1j4j7h3-1"
|
|
133
|
-
})(["padding-left:", ";", ""], (0,themes_namespaceObject.pick)({
|
|
134
|
-
enterprise: themes_namespaceObject.variables.spacingHalf,
|
|
135
|
-
prisma: '16px'
|
|
136
|
-
}), (0,themes_namespaceObject.pick)({
|
|
137
|
-
prisma: {
|
|
138
|
-
comfortable: (0,external_styled_components_namespaceObject.css)(["padding-bottom:8px;"]),
|
|
139
|
-
compact: (0,external_styled_components_namespaceObject.css)(["padding-bottom:6px;"])
|
|
140
|
-
}
|
|
141
|
-
}));
|
|
142
|
-
var StyledAddRowButton = external_styled_components_default()((Button_default())).withConfig({
|
|
143
|
-
displayName: "FormRowsStyles__StyledAddRowButton",
|
|
144
|
-
componentId: "sc-1j4j7h3-2"
|
|
145
|
-
})(["", ""], function (_ref) {
|
|
146
|
-
var $sortable = _ref.$sortable;
|
|
147
|
-
return $sortable && (0,themes_namespaceObject.pick)({
|
|
148
|
-
prisma: (0,external_styled_components_namespaceObject.css)(["margin-left:16px;"])
|
|
149
|
-
});
|
|
150
|
-
});
|
|
151
|
-
var StyledRows = external_styled_components_default().div.withConfig({
|
|
152
|
-
displayName: "FormRowsStyles__StyledRows",
|
|
153
|
-
componentId: "sc-1j4j7h3-3"
|
|
154
|
-
})(["position:relative;", ""], (0,themes_namespaceObject.pick)({
|
|
155
|
-
prisma: {
|
|
156
|
-
comfortable: (0,external_styled_components_namespaceObject.css)(["padding-bottom:12px;"]),
|
|
157
|
-
compact: (0,external_styled_components_namespaceObject.css)(["padding-bottom:10px;"])
|
|
158
|
-
}
|
|
159
|
-
}));
|
|
160
|
-
var Styled = external_styled_components_default().div.withConfig({
|
|
161
|
-
displayName: "FormRowsStyles__Styled",
|
|
162
|
-
componentId: "sc-1j4j7h3-4"
|
|
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),
|
|
165
|
-
prisma: {
|
|
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)
|
|
168
|
-
}
|
|
169
|
-
}), themes_namespaceObject.variables.zindexPopover, function (_ref2) {
|
|
170
|
-
var $sortable = _ref2.$sortable;
|
|
171
|
-
return $sortable && (0,external_styled_components_namespaceObject.css)(["padding-left:", ";"], (0,themes_namespaceObject.pick)({
|
|
172
|
-
enterprise: themes_namespaceObject.variables.spacingHalf,
|
|
173
|
-
prisma: '16px'
|
|
174
|
-
}));
|
|
175
|
-
}, themes_namespaceObject.variables.focusShadow);
|
|
176
|
-
var StyledButton = external_styled_components_default().div.withConfig({
|
|
177
|
-
displayName: "FormRowsStyles__StyledButton",
|
|
178
|
-
componentId: "sc-1j4j7h3-5"
|
|
179
|
-
})(["position:absolute;right:0;top:", ";float:right;"], (0,themes_namespaceObject.pick)({
|
|
180
|
-
enterprise: '3px',
|
|
181
|
-
prisma: {
|
|
182
|
-
comfortable: '8px',
|
|
183
|
-
compact: '6px'
|
|
184
|
-
}
|
|
185
|
-
}));
|
|
186
|
-
var StyledDrag = external_styled_components_default().div.withConfig({
|
|
187
|
-
displayName: "FormRowsStyles__StyledDrag",
|
|
188
|
-
componentId: "sc-1j4j7h3-6"
|
|
189
|
-
})(["position:absolute;left:0;right:0;content:'';cursor:move;background:", ";width:", ";top:", ";", ""], themes_namespaceObject.variables.draggableBackground, (0,themes_namespaceObject.pick)({
|
|
190
|
-
enterprise: '7px',
|
|
191
|
-
prisma: '6px'
|
|
192
|
-
}), (0,themes_namespaceObject.pick)({
|
|
193
|
-
enterprise: '4px',
|
|
194
|
-
prisma: {
|
|
195
|
-
comfortable: '18px',
|
|
196
|
-
compact: '12px'
|
|
197
|
-
}
|
|
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;"])
|
|
201
|
-
}));
|
|
202
|
-
|
|
203
|
-
;// CONCATENATED MODULE: ./src/FormRows/RowInternal.tsx
|
|
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); }
|
|
205
|
-
|
|
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; }
|
|
207
|
-
|
|
208
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
/** @public */
|
|
218
|
-
|
|
219
|
-
var propTypes = {
|
|
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
|
|
226
|
-
};
|
|
227
|
-
var RowInternal = /*#__PURE__*/external_react_default().forwardRef(function (_ref, ref) {
|
|
228
|
-
var children = _ref.children,
|
|
229
|
-
index = _ref.index,
|
|
230
|
-
onRequestRemove = _ref.onRequestRemove,
|
|
231
|
-
renderDragHandle = _ref.renderDragHandle,
|
|
232
|
-
otherProps = _objectWithoutProperties(_ref, ["children", "index", "onRequestRemove", "renderDragHandle"]);
|
|
233
|
-
|
|
234
|
-
var _useContext = (0,external_react_namespaceObject.useContext)(FormRows_FormRowsContext),
|
|
235
|
-
disabledDeleteButtonContext = _useContext.disabledDeleteButton,
|
|
236
|
-
hasOnRequestAddContext = _useContext.hasOnRequestAdd,
|
|
237
|
-
onKeyDownContext = _useContext.onKeyDown,
|
|
238
|
-
sortableContext = _useContext.sortable;
|
|
239
|
-
|
|
240
|
-
var handleKeyDown = (0,external_react_namespaceObject.useCallback)(function (e) {
|
|
241
|
-
// TODO: this callback doesn't work correctly if index isn't provided SUI-5639
|
|
242
|
-
onKeyDownContext === null || onKeyDownContext === void 0 ? void 0 : onKeyDownContext(e, {
|
|
243
|
-
index: index !== null && index !== void 0 ? index : 0
|
|
1
|
+
/******/ (() => {
|
|
2
|
+
// webpackBootstrap
|
|
3
|
+
/******/ "use strict";
|
|
4
|
+
/******/ // The require scope
|
|
5
|
+
/******/ var e = {};
|
|
6
|
+
/******/
|
|
7
|
+
/************************************************************************/
|
|
8
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
9
|
+
/******/ (() => {
|
|
10
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
11
|
+
/******/ e.n = t => {
|
|
12
|
+
/******/ var r = t && t.__esModule ?
|
|
13
|
+
/******/ () => t["default"]
|
|
14
|
+
/******/ : () => t
|
|
15
|
+
/******/;
|
|
16
|
+
e.d(r, {
|
|
17
|
+
a: r
|
|
18
|
+
});
|
|
19
|
+
/******/ return r;
|
|
20
|
+
/******/ };
|
|
21
|
+
/******/ })();
|
|
22
|
+
/******/
|
|
23
|
+
/******/ /* webpack/runtime/define property getters */
|
|
24
|
+
/******/ (() => {
|
|
25
|
+
/******/ // define getter functions for harmony exports
|
|
26
|
+
/******/ e.d = (t, r) => {
|
|
27
|
+
/******/ for (var n in r) {
|
|
28
|
+
/******/ if (e.o(r, n) && !e.o(t, n)) {
|
|
29
|
+
/******/ Object.defineProperty(t, n, {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: r[n]
|
|
32
|
+
});
|
|
33
|
+
/******/ }
|
|
34
|
+
/******/ }
|
|
35
|
+
/******/ };
|
|
36
|
+
/******/ })();
|
|
37
|
+
/******/
|
|
38
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
39
|
+
/******/ (() => {
|
|
40
|
+
/******/ e.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t)
|
|
41
|
+
/******/;
|
|
42
|
+
})();
|
|
43
|
+
/******/
|
|
44
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
45
|
+
/******/ (() => {
|
|
46
|
+
/******/ // define __esModule on exports
|
|
47
|
+
/******/ e.r = e => {
|
|
48
|
+
/******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
|
|
49
|
+
/******/ Object.defineProperty(e, Symbol.toStringTag, {
|
|
50
|
+
value: "Module"
|
|
51
|
+
});
|
|
52
|
+
/******/ }
|
|
53
|
+
/******/ Object.defineProperty(e, "__esModule", {
|
|
54
|
+
value: true
|
|
55
|
+
});
|
|
56
|
+
/******/ };
|
|
57
|
+
/******/ })();
|
|
58
|
+
/******/
|
|
59
|
+
/************************************************************************/ var t = {};
|
|
60
|
+
// ESM COMPAT FLAG
|
|
61
|
+
e.r(t);
|
|
62
|
+
// EXPORTS
|
|
63
|
+
e.d(t, {
|
|
64
|
+
Row: () => /* reexport */ ye,
|
|
65
|
+
default: () => /* reexport */ He
|
|
244
66
|
});
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
67
|
+
// CONCATENATED MODULE: external "react"
|
|
68
|
+
const r = require("react");
|
|
69
|
+
var n = e.n(r);
|
|
70
|
+
// CONCATENATED MODULE: external "prop-types"
|
|
71
|
+
const o = require("prop-types");
|
|
72
|
+
var i = e.n(o);
|
|
73
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
|
|
74
|
+
const a = require("@splunk/ui-utils/i18n");
|
|
75
|
+
// CONCATENATED MODULE: external "@splunk/ui-utils/keyboard"
|
|
76
|
+
const u = require("@splunk/ui-utils/keyboard");
|
|
77
|
+
// CONCATENATED MODULE: ./src/FormRows/FormRowsContext.tsx
|
|
78
|
+
var l = (0, r.createContext)({
|
|
79
|
+
disabledDeleteButton: false,
|
|
80
|
+
sortable: true
|
|
250
81
|
});
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
});
|
|
272
|
-
|
|
273
|
-
/* harmony default export */
|
|
274
|
-
|
|
275
|
-
const
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
82
|
+
l.displayName = "FormRows";
|
|
83
|
+
/* harmony default export */ const c = l;
|
|
84
|
+
// CONCATENATED MODULE: external "@splunk/themes"
|
|
85
|
+
const s = require("@splunk/themes");
|
|
86
|
+
// CONCATENATED MODULE: external "@splunk/react-icons/Plus"
|
|
87
|
+
const f = require("@splunk/react-icons/Plus");
|
|
88
|
+
var p = e.n(f);
|
|
89
|
+
// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Plus"
|
|
90
|
+
const d = require("@splunk/react-icons/enterprise/Plus");
|
|
91
|
+
var v = e.n(d);
|
|
92
|
+
// CONCATENATED MODULE: ./src/FormRows/icons/FormRowsPlusIcon.tsx
|
|
93
|
+
var y = function e() {
|
|
94
|
+
var t = (0, s.useSplunkTheme)(), r = t.isEnterprise, o = t.isCompact;
|
|
95
|
+
var i = o ? "20px" : "24px";
|
|
96
|
+
return r ? n().createElement(v(), {
|
|
97
|
+
screenReaderText: null,
|
|
98
|
+
hideDefaultTooltip: true
|
|
99
|
+
}) : n().createElement(p(), {
|
|
100
|
+
width: i,
|
|
101
|
+
height: i
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
/* harmony default export */ const b = y;
|
|
105
|
+
// CONCATENATED MODULE: external "lodash/omit"
|
|
106
|
+
const m = require("lodash/omit");
|
|
107
|
+
var h = e.n(m);
|
|
108
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/CloseButton"
|
|
109
|
+
const g = require("@splunk/react-ui/CloseButton");
|
|
110
|
+
var x = e.n(g);
|
|
111
|
+
// CONCATENATED MODULE: external "styled-components"
|
|
112
|
+
const w = require("styled-components");
|
|
113
|
+
var O = e.n(w);
|
|
114
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Box"
|
|
115
|
+
const R = require("@splunk/react-ui/Box");
|
|
116
|
+
var j = e.n(R);
|
|
117
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Button"
|
|
118
|
+
const S = require("@splunk/react-ui/Button");
|
|
119
|
+
var k = e.n(S);
|
|
120
|
+
// CONCATENATED MODULE: ./src/FormRows/FormRowsStyles.ts
|
|
121
|
+
var E = O()(j()).withConfig({
|
|
122
|
+
displayName: "FormRowsStyles__StyledBox",
|
|
123
|
+
componentId: "sc-1j4j7h3-0"
|
|
124
|
+
})([ "", ";" ], s.mixins.reset("block"));
|
|
125
|
+
var P = O().div.withConfig({
|
|
126
|
+
displayName: "FormRowsStyles__StyledHeader",
|
|
127
|
+
componentId: "sc-1j4j7h3-1"
|
|
128
|
+
})([ "padding-left:", ";", "" ], (0, s.pick)({
|
|
129
|
+
enterprise: s.variables.spacingHalf,
|
|
130
|
+
prisma: "16px"
|
|
131
|
+
}), (0, s.pick)({
|
|
132
|
+
prisma: {
|
|
133
|
+
comfortable: (0, w.css)([ "padding-bottom:8px;" ]),
|
|
134
|
+
compact: (0, w.css)([ "padding-bottom:6px;" ])
|
|
135
|
+
}
|
|
136
|
+
}));
|
|
137
|
+
var _ = O()(k()).withConfig({
|
|
138
|
+
displayName: "FormRowsStyles__StyledAddRowButton",
|
|
139
|
+
componentId: "sc-1j4j7h3-2"
|
|
140
|
+
})([ "", "" ], (function(e) {
|
|
141
|
+
var t = e.$sortable;
|
|
142
|
+
return t && (0, s.pick)({
|
|
143
|
+
prisma: (0, w.css)([ "margin-left:16px;" ])
|
|
144
|
+
});
|
|
145
|
+
}));
|
|
146
|
+
var q = O().div.withConfig({
|
|
147
|
+
displayName: "FormRowsStyles__StyledRows",
|
|
148
|
+
componentId: "sc-1j4j7h3-3"
|
|
149
|
+
})([ "position:relative;", "" ], (0, s.pick)({
|
|
150
|
+
prisma: {
|
|
151
|
+
comfortable: (0, w.css)([ "padding-bottom:12px;" ]),
|
|
152
|
+
compact: (0, w.css)([ "padding-bottom:10px;" ])
|
|
153
|
+
}
|
|
154
|
+
}));
|
|
155
|
+
var C = O().div.withConfig({
|
|
156
|
+
displayName: "FormRowsStyles__Styled",
|
|
157
|
+
componentId: "sc-1j4j7h3-4"
|
|
158
|
+
})([ "padding:", ";position:relative;&.sorting{z-index:calc(", " + 1);}", " &:focus{outline:0;box-shadow:", ";}" ], (0,
|
|
159
|
+
s.pick)({
|
|
160
|
+
enterprise: (0, w.css)([ "3px calc(", " + 3px) 3px 0" ], s.variables.inputHeight),
|
|
161
|
+
prisma: {
|
|
162
|
+
comfortable: (0, w.css)([ "8px calc(", " + 8px) 8px 0" ], s.variables.inputHeight),
|
|
163
|
+
compact: (0, w.css)([ "6px calc(", " + 8px) 6px 0" ], s.variables.inputHeight)
|
|
164
|
+
}
|
|
165
|
+
}), s.variables.zindexPopover, (function(e) {
|
|
166
|
+
var t = e.$sortable;
|
|
167
|
+
return t && (0, w.css)([ "padding-left:", ";" ], (0, s.pick)({
|
|
168
|
+
enterprise: s.variables.spacingHalf,
|
|
169
|
+
prisma: "16px"
|
|
170
|
+
}));
|
|
171
|
+
}), s.variables.focusShadow);
|
|
172
|
+
var D = O().div.withConfig({
|
|
173
|
+
displayName: "FormRowsStyles__StyledButton",
|
|
174
|
+
componentId: "sc-1j4j7h3-5"
|
|
175
|
+
})([ "position:absolute;right:0;top:", ";float:right;" ], (0, s.pick)({
|
|
176
|
+
enterprise: "3px",
|
|
177
|
+
prisma: {
|
|
178
|
+
comfortable: "8px",
|
|
179
|
+
compact: "6px"
|
|
180
|
+
}
|
|
181
|
+
}));
|
|
182
|
+
var I = O().div.withConfig({
|
|
183
|
+
displayName: "FormRowsStyles__StyledDrag",
|
|
184
|
+
componentId: "sc-1j4j7h3-6"
|
|
185
|
+
})([ "position:absolute;left:0;right:0;content:'';cursor:move;background:", ";width:", ";top:", ";", "" ], s.variables.draggableBackground, (0,
|
|
186
|
+
s.pick)({
|
|
187
|
+
enterprise: "7px",
|
|
188
|
+
prisma: "6px"
|
|
189
|
+
}), (0, s.pick)({
|
|
190
|
+
enterprise: "4px",
|
|
191
|
+
prisma: {
|
|
192
|
+
comfortable: "18px",
|
|
193
|
+
compact: "12px"
|
|
194
|
+
}
|
|
195
|
+
}), (0, s.pick)({
|
|
196
|
+
enterprise: (0, w.css)([ "bottom:3px;opacity:0.5;" ]),
|
|
197
|
+
prisma: (0, w.css)([ "height:20px;" ])
|
|
198
|
+
}));
|
|
199
|
+
// CONCATENATED MODULE: ./src/FormRows/RowInternal.tsx
|
|
200
|
+
function T() {
|
|
201
|
+
T = Object.assign || function(e) {
|
|
202
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
203
|
+
var r = arguments[t];
|
|
204
|
+
for (var n in r) {
|
|
205
|
+
if (Object.prototype.hasOwnProperty.call(r, n)) {
|
|
206
|
+
e[n] = r[n];
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return e;
|
|
211
|
+
};
|
|
212
|
+
return T.apply(this, arguments);
|
|
213
|
+
}
|
|
214
|
+
function A(e, t) {
|
|
215
|
+
if (e == null) return {};
|
|
216
|
+
var r = B(e, t);
|
|
217
|
+
var n, o;
|
|
218
|
+
if (Object.getOwnPropertySymbols) {
|
|
219
|
+
var i = Object.getOwnPropertySymbols(e);
|
|
220
|
+
for (o = 0; o < i.length; o++) {
|
|
221
|
+
n = i[o];
|
|
222
|
+
if (t.indexOf(n) >= 0) continue;
|
|
223
|
+
if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
|
|
224
|
+
r[n] = e[n];
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return r;
|
|
228
|
+
}
|
|
229
|
+
function B(e, t) {
|
|
230
|
+
if (e == null) return {};
|
|
231
|
+
var r = {};
|
|
232
|
+
var n = Object.keys(e);
|
|
233
|
+
var o, i;
|
|
234
|
+
for (i = 0; i < n.length; i++) {
|
|
235
|
+
o = n[i];
|
|
236
|
+
if (t.indexOf(o) >= 0) continue;
|
|
237
|
+
r[o] = e[o];
|
|
238
|
+
}
|
|
239
|
+
return r;
|
|
240
|
+
}
|
|
241
|
+
/** @public */ var H = {
|
|
242
|
+
children: i().node,
|
|
243
|
+
index: i().number,
|
|
244
|
+
onRequestRemove: i().func,
|
|
245
|
+
renderDragHandle: i().func,
|
|
246
|
+
style: i().object,
|
|
247
|
+
value: i().node
|
|
248
|
+
};
|
|
249
|
+
var M = n().forwardRef((function(e, t) {
|
|
250
|
+
var o = e.children, i = e.index, u = e.onRequestRemove, l = e.renderDragHandle, s = A(e, [ "children", "index", "onRequestRemove", "renderDragHandle" ]);
|
|
251
|
+
var f = (0, r.useContext)(c), p = f.disabledDeleteButton, d = f.hasOnRequestAdd, v = f.onKeyDown, y = f.sortable;
|
|
252
|
+
var b = (0, r.useCallback)((function(e) {
|
|
253
|
+
// TODO: this callback doesn't work correctly if index isn't provided SUI-5639
|
|
254
|
+
v === null || v === void 0 ? void 0 : v(e, {
|
|
255
|
+
index: i !== null && i !== void 0 ? i : 0
|
|
256
|
+
});
|
|
257
|
+
}), [ v, i ]);
|
|
258
|
+
var m = (0, r.useCallback)((function(e) {
|
|
259
|
+
// TODO: this callback doesn't work correctly if index isn't provided SUI-5639
|
|
260
|
+
u === null || u === void 0 ? void 0 : u(e, {
|
|
261
|
+
index: i !== null && i !== void 0 ? i : 0
|
|
262
|
+
});
|
|
263
|
+
}), [ u, i ]);
|
|
264
|
+
var g = u !== undefined;
|
|
265
|
+
if (false) {}
|
|
266
|
+
if (false) {}
|
|
267
|
+
if (false) {}
|
|
268
|
+
|
|
269
|
+
return n().createElement(C, T({
|
|
270
|
+
$sortable: y,
|
|
271
|
+
"data-test": "row",
|
|
272
|
+
ref: t,
|
|
273
|
+
onKeyDown: b
|
|
274
|
+
}, h()(s, [ "onKeyDown", "onRequestRemove" ])), l && l(), o, g && n().createElement(D, null, n().createElement(x(), {
|
|
275
|
+
disabled: p,
|
|
276
|
+
"data-test": "remove",
|
|
277
|
+
onClick: m,
|
|
278
|
+
screenReaderText: (0, a._)("Remove Row")
|
|
279
|
+
})));
|
|
280
|
+
}));
|
|
281
|
+
M.propTypes = H;
|
|
282
|
+
/* harmony default export */ const N = M;
|
|
283
|
+
// CONCATENATED MODULE: external "@dnd-kit/sortable"
|
|
284
|
+
const F = require("@dnd-kit/sortable");
|
|
285
|
+
// CONCATENATED MODULE: external "@dnd-kit/utilities"
|
|
286
|
+
const K = require("@dnd-kit/utilities");
|
|
287
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
|
|
288
|
+
const L = require("@splunk/react-ui/ScreenReaderContent");
|
|
289
|
+
var $ = e.n(L);
|
|
290
|
+
// CONCATENATED MODULE: ./src/utils/updateReactRef.ts
|
|
291
|
+
/**
|
|
283
292
|
* Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
|
|
284
293
|
*
|
|
285
294
|
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
286
295
|
* @param current - The new value of the ref.
|
|
287
296
|
*/
|
|
288
|
-
function
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
function
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
function
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
function
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
function
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
297
|
+
function z(e, t) {
|
|
298
|
+
if (e) {
|
|
299
|
+
if (typeof e === "function") {
|
|
300
|
+
e(t);
|
|
301
|
+
} else {
|
|
302
|
+
// the public signature of this util uses React.Ref<T> to mirror the way React types refs.
|
|
303
|
+
// the intention here is to signal "we will take care of setting 'current', not you".
|
|
304
|
+
e.current = t;
|
|
305
|
+
// eslint-disable-line no-param-reassign
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
// CONCATENATED MODULE: ./src/FormRows/SortableRow.tsx
|
|
310
|
+
function V(e, t) {
|
|
311
|
+
if (e == null) return {};
|
|
312
|
+
var r = G(e, t);
|
|
313
|
+
var n, o;
|
|
314
|
+
if (Object.getOwnPropertySymbols) {
|
|
315
|
+
var i = Object.getOwnPropertySymbols(e);
|
|
316
|
+
for (o = 0; o < i.length; o++) {
|
|
317
|
+
n = i[o];
|
|
318
|
+
if (t.indexOf(n) >= 0) continue;
|
|
319
|
+
if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
|
|
320
|
+
r[n] = e[n];
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
return r;
|
|
324
|
+
}
|
|
325
|
+
function G(e, t) {
|
|
326
|
+
if (e == null) return {};
|
|
327
|
+
var r = {};
|
|
328
|
+
var n = Object.keys(e);
|
|
329
|
+
var o, i;
|
|
330
|
+
for (i = 0; i < n.length; i++) {
|
|
331
|
+
o = n[i];
|
|
332
|
+
if (t.indexOf(o) >= 0) continue;
|
|
333
|
+
r[o] = e[o];
|
|
334
|
+
}
|
|
335
|
+
return r;
|
|
336
|
+
}
|
|
337
|
+
function J() {
|
|
338
|
+
J = Object.assign || function(e) {
|
|
339
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
340
|
+
var r = arguments[t];
|
|
341
|
+
for (var n in r) {
|
|
342
|
+
if (Object.prototype.hasOwnProperty.call(r, n)) {
|
|
343
|
+
e[n] = r[n];
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
return e;
|
|
348
|
+
};
|
|
349
|
+
return J.apply(this, arguments);
|
|
350
|
+
}
|
|
351
|
+
var Q = {
|
|
352
|
+
children: i().node,
|
|
353
|
+
index: i().number,
|
|
354
|
+
onRequestRemove: i().func,
|
|
355
|
+
value: i().node
|
|
356
|
+
};
|
|
357
|
+
var U = n().forwardRef((function(e, t) {
|
|
358
|
+
|
|
359
|
+
return n().createElement(I, J({
|
|
360
|
+
"data-test": "drag-handle",
|
|
361
|
+
ref: t
|
|
362
|
+
}, e), n().createElement($(), null, (0, a._)("Press arrow up or arrow down to re-order items")));
|
|
363
|
+
}));
|
|
364
|
+
var W = n().forwardRef((function(e, t) {
|
|
365
|
+
var r = e.children, o = e.index, i = V(e, [ "children", "index" ]);
|
|
366
|
+
// @docs-props-type RowPropsBase
|
|
367
|
+
var a = (0, F.useSortable)({
|
|
368
|
+
// @dnd-kit requires "id" to be greater than 0 https://github.com/clauderic/dnd-kit/issues/1150
|
|
369
|
+
// TODO: FormRows drag functionality doesn't work without an index, but it's not a required prop SUI-5639
|
|
370
|
+
id: (o || 0) + 1
|
|
371
|
+
}), u = a.attributes, l = a.listeners, c = a.setActivatorNodeRef, s = a.setNodeRef, f = a.transform, p = a.transition;
|
|
372
|
+
var d = {
|
|
373
|
+
transform: K.CSS.Transform.toString(f),
|
|
374
|
+
transition: p
|
|
375
|
+
};
|
|
376
|
+
var v = function e(r) {
|
|
377
|
+
s(r);
|
|
378
|
+
z(t, r);
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
return n().createElement(N, J({
|
|
382
|
+
index: o,
|
|
383
|
+
ref: v,
|
|
384
|
+
renderDragHandle: function e() {
|
|
385
|
+
|
|
386
|
+
return n().createElement(U, J({
|
|
387
|
+
ref: c
|
|
388
|
+
}, l));
|
|
389
|
+
},
|
|
390
|
+
style: d
|
|
391
|
+
}, i, u), r);
|
|
392
|
+
}));
|
|
393
|
+
W.propTypes = Q;
|
|
394
|
+
/* harmony default export */ const X = W;
|
|
395
|
+
// CONCATENATED MODULE: ./src/FormRows/Row.tsx
|
|
396
|
+
function Y(e) {
|
|
397
|
+
"@babel/helpers - typeof";
|
|
398
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
399
|
+
Y = function e(t) {
|
|
400
|
+
return typeof t;
|
|
401
|
+
};
|
|
402
|
+
} else {
|
|
403
|
+
Y = function e(t) {
|
|
404
|
+
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
return Y(e);
|
|
408
|
+
}
|
|
409
|
+
function Z() {
|
|
410
|
+
Z = Object.assign || function(e) {
|
|
411
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
412
|
+
var r = arguments[t];
|
|
413
|
+
for (var n in r) {
|
|
414
|
+
if (Object.prototype.hasOwnProperty.call(r, n)) {
|
|
415
|
+
e[n] = r[n];
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
return e;
|
|
420
|
+
};
|
|
421
|
+
return Z.apply(this, arguments);
|
|
422
|
+
}
|
|
423
|
+
function ee(e, t) {
|
|
424
|
+
if (e == null) return {};
|
|
425
|
+
var r = te(e, t);
|
|
426
|
+
var n, o;
|
|
427
|
+
if (Object.getOwnPropertySymbols) {
|
|
428
|
+
var i = Object.getOwnPropertySymbols(e);
|
|
429
|
+
for (o = 0; o < i.length; o++) {
|
|
430
|
+
n = i[o];
|
|
431
|
+
if (t.indexOf(n) >= 0) continue;
|
|
432
|
+
if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
|
|
433
|
+
r[n] = e[n];
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
return r;
|
|
437
|
+
}
|
|
438
|
+
function te(e, t) {
|
|
439
|
+
if (e == null) return {};
|
|
440
|
+
var r = {};
|
|
441
|
+
var n = Object.keys(e);
|
|
442
|
+
var o, i;
|
|
443
|
+
for (i = 0; i < n.length; i++) {
|
|
444
|
+
o = n[i];
|
|
445
|
+
if (t.indexOf(o) >= 0) continue;
|
|
446
|
+
r[o] = e[o];
|
|
447
|
+
}
|
|
448
|
+
return r;
|
|
449
|
+
}
|
|
450
|
+
function re(e, t) {
|
|
451
|
+
if (!(e instanceof t)) {
|
|
452
|
+
throw new TypeError("Cannot call a class as a function");
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
function ne(e, t) {
|
|
456
|
+
for (var r = 0; r < t.length; r++) {
|
|
457
|
+
var n = t[r];
|
|
458
|
+
n.enumerable = n.enumerable || false;
|
|
459
|
+
n.configurable = true;
|
|
460
|
+
if ("value" in n) n.writable = true;
|
|
461
|
+
Object.defineProperty(e, n.key, n);
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
function oe(e, t, r) {
|
|
465
|
+
if (t) ne(e.prototype, t);
|
|
466
|
+
if (r) ne(e, r);
|
|
467
|
+
return e;
|
|
468
|
+
}
|
|
469
|
+
function ie(e, t) {
|
|
470
|
+
if (typeof t !== "function" && t !== null) {
|
|
471
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
472
|
+
}
|
|
473
|
+
e.prototype = Object.create(t && t.prototype, {
|
|
474
|
+
constructor: {
|
|
475
|
+
value: e,
|
|
476
|
+
writable: true,
|
|
477
|
+
configurable: true
|
|
478
|
+
}
|
|
479
|
+
});
|
|
480
|
+
if (t) ae(e, t);
|
|
481
|
+
}
|
|
482
|
+
function ae(e, t) {
|
|
483
|
+
ae = Object.setPrototypeOf || function e(t, r) {
|
|
484
|
+
t.__proto__ = r;
|
|
485
|
+
return t;
|
|
486
|
+
};
|
|
487
|
+
return ae(e, t);
|
|
488
|
+
}
|
|
489
|
+
function ue(e) {
|
|
490
|
+
var t = se();
|
|
491
|
+
return function r() {
|
|
492
|
+
var n = fe(e), o;
|
|
493
|
+
if (t) {
|
|
494
|
+
var i = fe(this).constructor;
|
|
495
|
+
o = Reflect.construct(n, arguments, i);
|
|
496
|
+
} else {
|
|
497
|
+
o = n.apply(this, arguments);
|
|
498
|
+
}
|
|
499
|
+
return le(this, o);
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
function le(e, t) {
|
|
503
|
+
if (t && (Y(t) === "object" || typeof t === "function")) {
|
|
504
|
+
return t;
|
|
505
|
+
}
|
|
506
|
+
return ce(e);
|
|
507
|
+
}
|
|
508
|
+
function ce(e) {
|
|
509
|
+
if (e === void 0) {
|
|
510
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
511
|
+
}
|
|
512
|
+
return e;
|
|
513
|
+
}
|
|
514
|
+
function se() {
|
|
515
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
516
|
+
if (Reflect.construct.sham) return false;
|
|
517
|
+
if (typeof Proxy === "function") return true;
|
|
518
|
+
try {
|
|
519
|
+
Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
|
|
520
|
+
return true;
|
|
521
|
+
} catch (e) {
|
|
522
|
+
return false;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
function fe(e) {
|
|
526
|
+
fe = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
|
|
527
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
528
|
+
};
|
|
529
|
+
return fe(e);
|
|
530
|
+
}
|
|
531
|
+
function pe(e, t, r) {
|
|
532
|
+
if (t in e) {
|
|
533
|
+
Object.defineProperty(e, t, {
|
|
534
|
+
value: r,
|
|
535
|
+
enumerable: true,
|
|
536
|
+
configurable: true,
|
|
537
|
+
writable: true
|
|
538
|
+
});
|
|
539
|
+
} else {
|
|
540
|
+
e[t] = r;
|
|
541
|
+
}
|
|
542
|
+
return e;
|
|
543
|
+
}
|
|
544
|
+
var de = {
|
|
545
|
+
children: i().node,
|
|
546
|
+
elementRef: i().oneOfType([ i().func, i().object ]),
|
|
547
|
+
index: i().number,
|
|
548
|
+
onRequestRemove: i().func,
|
|
549
|
+
value: i().node
|
|
550
|
+
};
|
|
551
|
+
var ve = function(e) {
|
|
552
|
+
ie(r, e);
|
|
553
|
+
var t = ue(r);
|
|
554
|
+
function r() {
|
|
555
|
+
re(this, r);
|
|
556
|
+
return t.apply(this, arguments);
|
|
557
|
+
}
|
|
558
|
+
oe(r, [ {
|
|
559
|
+
key: "render",
|
|
560
|
+
// @docs-props-type RowPropsBase
|
|
561
|
+
value: function e() {
|
|
562
|
+
var t = this.props, r = t.children, o = t.elementRef, i = ee(t, [ "children", "elementRef" ]);
|
|
563
|
+
var a = this.context.sortable;
|
|
564
|
+
var u = h()(i, [ "onKeyDown" ]);
|
|
565
|
+
var l = a ? X : N;
|
|
566
|
+
|
|
567
|
+
return n().createElement(l, Z({
|
|
568
|
+
ref: o
|
|
569
|
+
}, u), r);
|
|
570
|
+
}
|
|
571
|
+
} ]);
|
|
572
|
+
return r;
|
|
573
|
+
}(r.Component);
|
|
574
|
+
pe(ve, "propTypes", de);
|
|
575
|
+
pe(ve, "contextType", c);
|
|
576
|
+
/* harmony default export */ const ye = ve;
|
|
577
|
+
// CONCATENATED MODULE: external "@dnd-kit/core"
|
|
578
|
+
const be = require("@dnd-kit/core");
|
|
579
|
+
// CONCATENATED MODULE: ./src/FormRows/SortableList.tsx
|
|
580
|
+
var me = function e(t) {
|
|
581
|
+
var o = t.children, i = t.onSortEnd;
|
|
582
|
+
var a = (0, be.useSensors)((0, be.useSensor)(be.PointerSensor), (0, be.useSensor)(be.MouseSensor));
|
|
583
|
+
var u = r.Children.toArray(o).filter(r.isValidElement);
|
|
584
|
+
var l = u.map((function(e) {
|
|
585
|
+
return (e.props.index || 0) + 1;
|
|
586
|
+
}));
|
|
587
|
+
function c(e) {
|
|
588
|
+
var t = e.active, r = e.over;
|
|
589
|
+
if (r && t.id !== r.id) {
|
|
590
|
+
var n = l.indexOf(t.id);
|
|
591
|
+
var o = l.indexOf(r.id);
|
|
592
|
+
i({
|
|
593
|
+
oldIndex: n,
|
|
594
|
+
newIndex: o
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
return n().createElement(be.DndContext, {
|
|
600
|
+
sensors: a,
|
|
601
|
+
collisionDetection: be.closestCenter,
|
|
602
|
+
onDragEnd: c
|
|
603
|
+
}, n().createElement(F.SortableContext, {
|
|
604
|
+
items: l,
|
|
605
|
+
strategy: F.verticalListSortingStrategy
|
|
606
|
+
}, u));
|
|
607
|
+
};
|
|
608
|
+
/* harmony default export */ const he = me;
|
|
609
|
+
// CONCATENATED MODULE: ./src/FormRows/FormRows.tsx
|
|
610
|
+
function ge(e) {
|
|
611
|
+
"@babel/helpers - typeof";
|
|
612
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
613
|
+
ge = function e(t) {
|
|
614
|
+
return typeof t;
|
|
615
|
+
};
|
|
616
|
+
} else {
|
|
617
|
+
ge = function e(t) {
|
|
618
|
+
return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
return ge(e);
|
|
622
|
+
}
|
|
623
|
+
function xe() {
|
|
624
|
+
xe = Object.assign || function(e) {
|
|
625
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
626
|
+
var r = arguments[t];
|
|
627
|
+
for (var n in r) {
|
|
628
|
+
if (Object.prototype.hasOwnProperty.call(r, n)) {
|
|
629
|
+
e[n] = r[n];
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
return e;
|
|
634
|
+
};
|
|
635
|
+
return xe.apply(this, arguments);
|
|
636
|
+
}
|
|
637
|
+
function we(e, t) {
|
|
638
|
+
if (e == null) return {};
|
|
639
|
+
var r = Oe(e, t);
|
|
640
|
+
var n, o;
|
|
641
|
+
if (Object.getOwnPropertySymbols) {
|
|
642
|
+
var i = Object.getOwnPropertySymbols(e);
|
|
643
|
+
for (o = 0; o < i.length; o++) {
|
|
644
|
+
n = i[o];
|
|
645
|
+
if (t.indexOf(n) >= 0) continue;
|
|
646
|
+
if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
|
|
647
|
+
r[n] = e[n];
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
return r;
|
|
651
|
+
}
|
|
652
|
+
function Oe(e, t) {
|
|
653
|
+
if (e == null) return {};
|
|
654
|
+
var r = {};
|
|
655
|
+
var n = Object.keys(e);
|
|
656
|
+
var o, i;
|
|
657
|
+
for (i = 0; i < n.length; i++) {
|
|
658
|
+
o = n[i];
|
|
659
|
+
if (t.indexOf(o) >= 0) continue;
|
|
660
|
+
r[o] = e[o];
|
|
661
|
+
}
|
|
662
|
+
return r;
|
|
663
|
+
}
|
|
664
|
+
function Re(e, t) {
|
|
665
|
+
if (!(e instanceof t)) {
|
|
666
|
+
throw new TypeError("Cannot call a class as a function");
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
function je(e, t) {
|
|
670
|
+
for (var r = 0; r < t.length; r++) {
|
|
671
|
+
var n = t[r];
|
|
672
|
+
n.enumerable = n.enumerable || false;
|
|
673
|
+
n.configurable = true;
|
|
674
|
+
if ("value" in n) n.writable = true;
|
|
675
|
+
Object.defineProperty(e, n.key, n);
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
function Se(e, t, r) {
|
|
679
|
+
if (t) je(e.prototype, t);
|
|
680
|
+
if (r) je(e, r);
|
|
681
|
+
return e;
|
|
682
|
+
}
|
|
683
|
+
function ke(e, t) {
|
|
684
|
+
if (typeof t !== "function" && t !== null) {
|
|
685
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
686
|
+
}
|
|
687
|
+
e.prototype = Object.create(t && t.prototype, {
|
|
688
|
+
constructor: {
|
|
689
|
+
value: e,
|
|
690
|
+
writable: true,
|
|
691
|
+
configurable: true
|
|
692
|
+
}
|
|
693
|
+
});
|
|
694
|
+
if (t) Ee(e, t);
|
|
695
|
+
}
|
|
696
|
+
function Ee(e, t) {
|
|
697
|
+
Ee = Object.setPrototypeOf || function e(t, r) {
|
|
698
|
+
t.__proto__ = r;
|
|
699
|
+
return t;
|
|
700
|
+
};
|
|
701
|
+
return Ee(e, t);
|
|
702
|
+
}
|
|
703
|
+
function Pe(e) {
|
|
704
|
+
var t = Ce();
|
|
705
|
+
return function r() {
|
|
706
|
+
var n = De(e), o;
|
|
707
|
+
if (t) {
|
|
708
|
+
var i = De(this).constructor;
|
|
709
|
+
o = Reflect.construct(n, arguments, i);
|
|
710
|
+
} else {
|
|
711
|
+
o = n.apply(this, arguments);
|
|
712
|
+
}
|
|
713
|
+
return _e(this, o);
|
|
714
|
+
};
|
|
715
|
+
}
|
|
716
|
+
function _e(e, t) {
|
|
717
|
+
if (t && (ge(t) === "object" || typeof t === "function")) {
|
|
718
|
+
return t;
|
|
719
|
+
}
|
|
720
|
+
return qe(e);
|
|
721
|
+
}
|
|
722
|
+
function qe(e) {
|
|
723
|
+
if (e === void 0) {
|
|
724
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
725
|
+
}
|
|
726
|
+
return e;
|
|
727
|
+
}
|
|
728
|
+
function Ce() {
|
|
729
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
730
|
+
if (Reflect.construct.sham) return false;
|
|
731
|
+
if (typeof Proxy === "function") return true;
|
|
732
|
+
try {
|
|
733
|
+
Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
|
|
734
|
+
return true;
|
|
735
|
+
} catch (e) {
|
|
736
|
+
return false;
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
function De(e) {
|
|
740
|
+
De = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
|
|
741
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
742
|
+
};
|
|
743
|
+
return De(e);
|
|
744
|
+
}
|
|
745
|
+
function Ie(e, t, r) {
|
|
746
|
+
if (t in e) {
|
|
747
|
+
Object.defineProperty(e, t, {
|
|
748
|
+
value: r,
|
|
749
|
+
enumerable: true,
|
|
750
|
+
configurable: true,
|
|
751
|
+
writable: true
|
|
752
|
+
});
|
|
753
|
+
} else {
|
|
754
|
+
e[t] = r;
|
|
755
|
+
}
|
|
756
|
+
return e;
|
|
757
|
+
}
|
|
758
|
+
var Te = {
|
|
759
|
+
addLabel: i().string,
|
|
760
|
+
children: i().node,
|
|
761
|
+
disabled: i().bool,
|
|
762
|
+
elementRef: i().oneOfType([ i().func, i().object ]),
|
|
763
|
+
header: i().node,
|
|
764
|
+
menu: i().node,
|
|
765
|
+
onRequestAdd: i().func,
|
|
766
|
+
onRequestMove: i().func
|
|
767
|
+
};
|
|
768
|
+
var Ae = {
|
|
769
|
+
addLabel: (0, a._)("Add Row"),
|
|
770
|
+
disabled: false,
|
|
771
|
+
header: null
|
|
772
|
+
};
|
|
773
|
+
var Be = function(e) {
|
|
774
|
+
ke(o, e);
|
|
775
|
+
var t = Pe(o);
|
|
776
|
+
function o() {
|
|
777
|
+
var e;
|
|
778
|
+
Re(this, o);
|
|
779
|
+
for (var r = arguments.length, i = new Array(r), a = 0; a < r; a++) {
|
|
780
|
+
i[a] = arguments[a];
|
|
781
|
+
}
|
|
782
|
+
e = t.call.apply(t, [ this ].concat(i));
|
|
783
|
+
Ie(qe(e), "handleKeyDown", (function(t, r) {
|
|
784
|
+
var o = r.index;
|
|
785
|
+
if (t.currentTarget !== t.target) {
|
|
786
|
+
return;
|
|
787
|
+
}
|
|
788
|
+
if ((0, u.keycode)(t.nativeEvent) === "up") {
|
|
789
|
+
t.preventDefault();
|
|
790
|
+
if (o > 0) {
|
|
791
|
+
var i, a;
|
|
792
|
+
(i = (a = e.props).onRequestMove) === null || i === void 0 ? void 0 : i.call(a, {
|
|
793
|
+
fromIndex: o,
|
|
794
|
+
toIndex: o - 1
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
} else if ((0, u.keycode)(t.nativeEvent) === "down") {
|
|
798
|
+
t.preventDefault();
|
|
799
|
+
if (o < n().Children.toArray(e.props.children).length - 1) {
|
|
800
|
+
var l, c;
|
|
801
|
+
(l = (c = e.props).onRequestMove) === null || l === void 0 ? void 0 : l.call(c, {
|
|
802
|
+
fromIndex: o,
|
|
803
|
+
toIndex: o + 1
|
|
804
|
+
});
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
}));
|
|
808
|
+
Ie(qe(e), "handleSortEnd", (function(t) {
|
|
809
|
+
var r, n;
|
|
810
|
+
var o = t.oldIndex, i = t.newIndex;
|
|
811
|
+
(r = (n = e.props).onRequestMove) === null || r === void 0 ? void 0 : r.call(n, {
|
|
812
|
+
fromIndex: o,
|
|
813
|
+
toIndex: i
|
|
814
|
+
});
|
|
815
|
+
}));
|
|
816
|
+
return e;
|
|
817
|
+
}
|
|
818
|
+
Se(o, [ {
|
|
819
|
+
key: "render",
|
|
820
|
+
value: function e() {
|
|
821
|
+
var t = this.props, r = t.addLabel, o = t.children, i = t.disabled, a = t.header, u = t.menu, l = t.onRequestAdd, s = t.onRequestMove, f = we(t, [ "addLabel", "children", "disabled", "header", "menu", "onRequestAdd", "onRequestMove" ]);
|
|
822
|
+
var p = s !== undefined && !i;
|
|
823
|
+
var d = p ? P : "div";
|
|
824
|
+
var v = l !== undefined;
|
|
825
|
+
|
|
826
|
+
return n().createElement(E, xe({
|
|
827
|
+
"data-test": "form-rows"
|
|
828
|
+
}, f), n().createElement(c.Provider, {
|
|
829
|
+
value: {
|
|
830
|
+
disabledDeleteButton: i,
|
|
831
|
+
onKeyDown: this.handleKeyDown,
|
|
832
|
+
hasOnRequestAdd: v,
|
|
833
|
+
sortable: p
|
|
834
|
+
}
|
|
835
|
+
}, a && n().createElement(d, null, a), n().createElement(q, null, n().createElement(he, {
|
|
836
|
+
onSortEnd: this.handleSortEnd
|
|
837
|
+
}, o)), u || v && n().createElement(_, {
|
|
838
|
+
disabled: i,
|
|
839
|
+
appearance: "pill",
|
|
840
|
+
"data-test": "add-row",
|
|
841
|
+
icon: n().createElement(b, null),
|
|
842
|
+
label: r,
|
|
843
|
+
onClick: l,
|
|
844
|
+
$sortable: p
|
|
845
|
+
})));
|
|
846
|
+
}
|
|
847
|
+
} ], [ {
|
|
848
|
+
key: "addRow",
|
|
849
|
+
/**
|
|
652
850
|
* Static function for adding a row.
|
|
653
851
|
*
|
|
654
852
|
* Example Use:
|
|
@@ -672,10 +870,10 @@ var FormRows = /*#__PURE__*/function (_Component) {
|
|
|
672
870
|
* @param items Array of current FormRows to add to.
|
|
673
871
|
* @return New array of FormRows with new Row added.
|
|
674
872
|
*/
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
873
|
+
value: function e(t, r) {
|
|
874
|
+
return r.concat(t);
|
|
875
|
+
}
|
|
876
|
+
/**
|
|
679
877
|
* Static function for moving a row.
|
|
680
878
|
*
|
|
681
879
|
* Example Use:
|
|
@@ -690,22 +888,21 @@ var FormRows = /*#__PURE__*/function (_Component) {
|
|
|
690
888
|
* @param toIndex New index to move row to.
|
|
691
889
|
* @param items Array of current FormRows.
|
|
692
890
|
* @return New array of FormRows arranged in new order.
|
|
693
|
-
*/
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
/**
|
|
891
|
+
*/ }, {
|
|
892
|
+
key: "moveRow",
|
|
893
|
+
value: function e(t, n, o) {
|
|
894
|
+
var i = o.filter((function(e, r) {
|
|
895
|
+
return r !== t;
|
|
896
|
+
}));
|
|
897
|
+
i.splice(n, 0, o[t]);
|
|
898
|
+
return i.map((function(e, t) {
|
|
899
|
+
|
|
900
|
+
return (0, r.cloneElement)(e, {
|
|
901
|
+
index: t
|
|
902
|
+
});
|
|
903
|
+
}));
|
|
904
|
+
}
|
|
905
|
+
/**
|
|
709
906
|
* Static function for removing a row.
|
|
710
907
|
*
|
|
711
908
|
* Example Use:
|
|
@@ -719,35 +916,25 @@ var FormRows = /*#__PURE__*/function (_Component) {
|
|
|
719
916
|
* @param index Index of Row to delete.
|
|
720
917
|
* @param items Array of current FormRows.
|
|
721
918
|
* @return New array of FormRows with Row of given index deleted.
|
|
722
|
-
*/
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
FormRows_defineProperty(FormRows, "Row", FormRows_Row);
|
|
745
|
-
|
|
746
|
-
/* harmony default export */ const FormRows_FormRows = (FormRows);
|
|
747
|
-
|
|
748
|
-
;// CONCATENATED MODULE: ./src/FormRows/index.ts
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
module.exports = __webpack_exports__;
|
|
752
|
-
/******/ })()
|
|
753
|
-
;
|
|
919
|
+
*/ }, {
|
|
920
|
+
key: "removeRow",
|
|
921
|
+
value: function e(t, n) {
|
|
922
|
+
return n.filter((function(e, r) {
|
|
923
|
+
return r !== t;
|
|
924
|
+
})).map((function(e, t) {
|
|
925
|
+
|
|
926
|
+
return (0, r.cloneElement)(e, {
|
|
927
|
+
index: t
|
|
928
|
+
});
|
|
929
|
+
}));
|
|
930
|
+
}
|
|
931
|
+
} ]);
|
|
932
|
+
return o;
|
|
933
|
+
}(r.Component);
|
|
934
|
+
Ie(Be, "propTypes", Te);
|
|
935
|
+
Ie(Be, "defaultProps", Ae);
|
|
936
|
+
Ie(Be, "Row", ye);
|
|
937
|
+
/* harmony default export */ const He = Be;
|
|
938
|
+
// CONCATENATED MODULE: ./src/FormRows/index.ts
|
|
939
|
+
module.exports = t;
|
|
940
|
+
/******/})();
|