@pingux/astro 1.14.0-alpha.9 → 1.14.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/CHANGELOG.md +20 -0
- package/NOTICE.html +4311 -0
- package/lib/cjs/components/PopoverMenu/PopoverMenu.js +2 -1
- package/lib/cjs/components/ScrollBox/ScrollBox.js +1 -2
- package/lib/cjs/recipes/AttributesAndPingOneMapping.stories.js +319 -0
- package/lib/cjs/recipes/TrialExperienceIndustryButtons.stories.js +692 -0
- package/lib/components/PopoverMenu/PopoverMenu.js +2 -1
- package/lib/components/ScrollBox/ScrollBox.js +1 -2
- package/lib/recipes/AttributesAndPingOneMapping.stories.js +284 -0
- package/lib/recipes/TrialExperienceIndustryButtons.stories.js +671 -0
- package/package.json +1 -1
@@ -110,7 +110,8 @@ var PopoverMenu = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
110
110
|
placement: placement,
|
111
111
|
onClose: state.close,
|
112
112
|
hasNoArrow: hasNoArrow,
|
113
|
-
isDismissable: true
|
113
|
+
isDismissable: true,
|
114
|
+
isNonModal: true
|
114
115
|
}, positionProps, menuProps), contents)));
|
115
116
|
});
|
116
117
|
PopoverMenu.propTypes = {
|
@@ -10,7 +10,7 @@ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
10
10
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
11
11
|
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
12
12
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
13
|
-
var _excluded = ["maxHeight", "children", "sx", "
|
13
|
+
var _excluded = ["maxHeight", "children", "sx", "hasShadows", "onScroll"];
|
14
14
|
|
15
15
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
16
16
|
|
@@ -25,7 +25,6 @@ var ScrollBox = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
25
25
|
var maxHeight = props.maxHeight,
|
26
26
|
children = props.children,
|
27
27
|
sx = props.sx,
|
28
|
-
className = props.className,
|
29
28
|
hasShadows = props.hasShadows,
|
30
29
|
scrollHandler = props.onScroll,
|
31
30
|
others = _objectWithoutProperties(props, _excluded);
|
@@ -0,0 +1,284 @@
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
|
+
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
3
|
+
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
4
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
5
|
+
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
6
|
+
import React, { useState, useRef, useEffect, memo } from 'react';
|
7
|
+
import CogsIcon from 'mdi-react/CogsIcon';
|
8
|
+
import DeleteIcon from 'mdi-react/DeleteIcon';
|
9
|
+
import AddIcon from 'mdi-react/AddIcon';
|
10
|
+
import { ScrollBox, ComboBoxField, IconButton, Text, Box, Item, Icon, TextField, Separator, Button } from '../index';
|
11
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
12
|
+
var items = [{
|
13
|
+
name: 'Aardvark',
|
14
|
+
id: '1'
|
15
|
+
}, {
|
16
|
+
name: 'Kangaroo',
|
17
|
+
id: '2'
|
18
|
+
}, {
|
19
|
+
name: 'Snake',
|
20
|
+
id: '3'
|
21
|
+
}];
|
22
|
+
export default {
|
23
|
+
title: 'Recipes/AttributesP1Mappings'
|
24
|
+
};
|
25
|
+
var Row = /*#__PURE__*/memo(function (props) {
|
26
|
+
var isDisabled = props.isDisabled,
|
27
|
+
isNewRow = props.isNewRow,
|
28
|
+
index = props.index,
|
29
|
+
textValue = props.textValue,
|
30
|
+
inputValue = props.inputValue,
|
31
|
+
updateRow = props.updateRow,
|
32
|
+
removeRow = props.removeRow,
|
33
|
+
areRowsValid = props.areRowsValid,
|
34
|
+
isSubmitted = props.isSubmitted,
|
35
|
+
submitFields = props.submitFields;
|
36
|
+
var rowRef = useRef();
|
37
|
+
var textFieldRef = useRef();
|
38
|
+
|
39
|
+
var setTextValue = function setTextValue(value) {
|
40
|
+
updateRow(index, value, 'textValue');
|
41
|
+
submitFields(false);
|
42
|
+
};
|
43
|
+
|
44
|
+
var setInputValue = function setInputValue(value) {
|
45
|
+
updateRow(index, value, 'inputValue');
|
46
|
+
submitFields(false);
|
47
|
+
};
|
48
|
+
|
49
|
+
useEffect(function () {
|
50
|
+
if (isNewRow) {
|
51
|
+
textFieldRef.current.focus();
|
52
|
+
textFieldRef.current.scrollIntoView();
|
53
|
+
}
|
54
|
+
}, []);
|
55
|
+
return ___EmotionJSX(Box, {
|
56
|
+
isRow: true,
|
57
|
+
alignItems: "center",
|
58
|
+
mb: "md",
|
59
|
+
ref: rowRef
|
60
|
+
}, ___EmotionJSX(Box, {
|
61
|
+
width: "310px",
|
62
|
+
sx: !areRowsValid && isSubmitted && inputValue === '' && textValue !== '' ? {
|
63
|
+
mb: '24.95px'
|
64
|
+
} : {}
|
65
|
+
}, ___EmotionJSX(TextField, {
|
66
|
+
name: "custom-name",
|
67
|
+
"aria-label": "text field",
|
68
|
+
labelProps: {
|
69
|
+
'aria-label': 'selection field',
|
70
|
+
mb: 0
|
71
|
+
},
|
72
|
+
controlProps: {
|
73
|
+
sx: {
|
74
|
+
height: '40px !important'
|
75
|
+
}
|
76
|
+
},
|
77
|
+
id: "textField ".concat(index),
|
78
|
+
key: "textField ".concat(index),
|
79
|
+
isReadOnly: isDisabled,
|
80
|
+
value: textValue,
|
81
|
+
onChange: function onChange(e) {
|
82
|
+
return setTextValue(e.target.value);
|
83
|
+
},
|
84
|
+
ref: textFieldRef,
|
85
|
+
status: !areRowsValid && isSubmitted && textValue === '' && inputValue !== '' ? 'error' : 'default',
|
86
|
+
helperText: !areRowsValid && isSubmitted && textValue === '' && inputValue !== '' ? 'Enter an attribute.' : null
|
87
|
+
})), ___EmotionJSX(Box, {
|
88
|
+
alignItems: "center",
|
89
|
+
ml: "12px",
|
90
|
+
isRow: true,
|
91
|
+
width: "378px",
|
92
|
+
sx: !areRowsValid && isSubmitted && textValue === '' && inputValue !== '' ? {
|
93
|
+
mb: '24.95px'
|
94
|
+
} : {}
|
95
|
+
}, ___EmotionJSX(Box, {
|
96
|
+
flexGrow: "1",
|
97
|
+
maxWidth: "310px"
|
98
|
+
}, ___EmotionJSX(ComboBoxField, {
|
99
|
+
items: items,
|
100
|
+
labelMode: "float",
|
101
|
+
id: "inputField ".concat(index),
|
102
|
+
key: "inputField ".concat(index),
|
103
|
+
status: !areRowsValid && isSubmitted && inputValue === '' && textValue !== '' ? 'error' : 'default',
|
104
|
+
helperText: !areRowsValid && isSubmitted && inputValue === '' && textValue !== '' ? 'Select an item.' : null,
|
105
|
+
labelProps: {
|
106
|
+
'aria-label': 'selection field',
|
107
|
+
mb: 0
|
108
|
+
},
|
109
|
+
"aria-label": "selection field",
|
110
|
+
controlProps: {
|
111
|
+
'aria-label': 'selection field',
|
112
|
+
sx: {
|
113
|
+
height: '40px !important',
|
114
|
+
pt: '5px !important'
|
115
|
+
}
|
116
|
+
},
|
117
|
+
containerProps: {
|
118
|
+
'aria-label': 'selection field',
|
119
|
+
width: '100%',
|
120
|
+
maxWidth: '310px',
|
121
|
+
sx: {
|
122
|
+
width: '100%'
|
123
|
+
}
|
124
|
+
},
|
125
|
+
inputValue: inputValue,
|
126
|
+
onInputChange: setInputValue
|
127
|
+
}, function (item) {
|
128
|
+
return ___EmotionJSX(Item, {
|
129
|
+
key: item.name,
|
130
|
+
"data-id": item.name
|
131
|
+
}, item.name);
|
132
|
+
})), ___EmotionJSX(Box, {
|
133
|
+
isRow: true,
|
134
|
+
alignItems: "center",
|
135
|
+
sx: !areRowsValid && isSubmitted && inputValue === '' && textValue !== '' ? {
|
136
|
+
mb: '22.475px',
|
137
|
+
ml: 'xs'
|
138
|
+
} : {
|
139
|
+
ml: 'xs'
|
140
|
+
}
|
141
|
+
}, ___EmotionJSX(IconButton, {
|
142
|
+
"aria-label": "icon button with tooltip",
|
143
|
+
title: "Advanced Expression"
|
144
|
+
}, ___EmotionJSX(Icon, {
|
145
|
+
icon: CogsIcon
|
146
|
+
})), ___EmotionJSX(IconButton, {
|
147
|
+
"aria-label": "icon button with tooltip",
|
148
|
+
title: "Delete",
|
149
|
+
sx: {
|
150
|
+
ml: 'xs'
|
151
|
+
},
|
152
|
+
onPress: function onPress() {
|
153
|
+
return removeRow(index);
|
154
|
+
}
|
155
|
+
}, ___EmotionJSX(Icon, {
|
156
|
+
icon: DeleteIcon
|
157
|
+
})))));
|
158
|
+
});
|
159
|
+
export var Default = function Default() {
|
160
|
+
var defaultRows = [{
|
161
|
+
isDisabled: false,
|
162
|
+
textValue: '',
|
163
|
+
inputValue: '',
|
164
|
+
name: 'first default'
|
165
|
+
}, {
|
166
|
+
isDisabled: false,
|
167
|
+
textValue: '',
|
168
|
+
inputValue: '',
|
169
|
+
name: 'second default'
|
170
|
+
}];
|
171
|
+
|
172
|
+
var _useState = useState(defaultRows),
|
173
|
+
_useState2 = _slicedToArray(_useState, 2),
|
174
|
+
rows = _useState2[0],
|
175
|
+
setRows = _useState2[1];
|
176
|
+
|
177
|
+
var _useState3 = useState(false),
|
178
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
179
|
+
isSubmitted = _useState4[0],
|
180
|
+
submitFields = _useState4[1];
|
181
|
+
|
182
|
+
var addRow = function addRow() {
|
183
|
+
var _context;
|
184
|
+
|
185
|
+
var newRow = {
|
186
|
+
isDisabled: false,
|
187
|
+
isNewRow: true,
|
188
|
+
textValue: '',
|
189
|
+
inputValue: '',
|
190
|
+
name: Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5)
|
191
|
+
};
|
192
|
+
setRows(_concatInstanceProperty(_context = []).call(_context, rows, [newRow]));
|
193
|
+
};
|
194
|
+
|
195
|
+
var removeRow = function removeRow(rowIndex) {
|
196
|
+
var _context2;
|
197
|
+
|
198
|
+
var newArray = _filterInstanceProperty(rows).call(rows, function (row, index) {
|
199
|
+
return rowIndex !== index;
|
200
|
+
});
|
201
|
+
|
202
|
+
setRows(_concatInstanceProperty(_context2 = []).call(_context2, newArray));
|
203
|
+
};
|
204
|
+
|
205
|
+
var updateRow = function updateRow(rowIndex, value, attribute) {
|
206
|
+
var _context3;
|
207
|
+
|
208
|
+
var newArray = _mapInstanceProperty(rows).call(rows, function (row, index) {
|
209
|
+
if (rowIndex === index) {
|
210
|
+
var thisRow = rows[index];
|
211
|
+
thisRow[attribute] = value;
|
212
|
+
return thisRow;
|
213
|
+
}
|
214
|
+
|
215
|
+
return row;
|
216
|
+
});
|
217
|
+
|
218
|
+
setRows(_concatInstanceProperty(_context3 = []).call(_context3, newArray));
|
219
|
+
};
|
220
|
+
|
221
|
+
return ___EmotionJSX(Box, {
|
222
|
+
maxWidth: "740px"
|
223
|
+
}, ___EmotionJSX(Box, {
|
224
|
+
isRow: true,
|
225
|
+
alignItems: "center",
|
226
|
+
mb: "md",
|
227
|
+
ml: "xs"
|
228
|
+
}, ___EmotionJSX(Text, {
|
229
|
+
sx: {
|
230
|
+
fontSize: 'sm',
|
231
|
+
fontWeight: 400,
|
232
|
+
color: 'neutral.40'
|
233
|
+
}
|
234
|
+
}, "Create new attributes and map predefined attributes with their PingOne Mappings."), ___EmotionJSX(Button, {
|
235
|
+
variant: "inline",
|
236
|
+
ml: "auto",
|
237
|
+
height: "22px",
|
238
|
+
minWidth: "0px",
|
239
|
+
width: "70px",
|
240
|
+
onPress: addRow
|
241
|
+
}, ___EmotionJSX(Box, {
|
242
|
+
isRow: true,
|
243
|
+
alignItems: "center",
|
244
|
+
width: "38px",
|
245
|
+
justifyContent: "center"
|
246
|
+
}, ___EmotionJSX(Icon, {
|
247
|
+
icon: AddIcon,
|
248
|
+
mr: "xs",
|
249
|
+
color: "active",
|
250
|
+
size: 15
|
251
|
+
}), "Add"))), ___EmotionJSX(Box, {
|
252
|
+
backgroundColor: "accent.99",
|
253
|
+
p: "16px"
|
254
|
+
}, ___EmotionJSX(Box, {
|
255
|
+
isRow: true
|
256
|
+
}, ___EmotionJSX(Text, {
|
257
|
+
sx: {
|
258
|
+
fontWeight: 3,
|
259
|
+
fontSize: 'md',
|
260
|
+
maxWidth: '310px',
|
261
|
+
width: 'calc(50% - 26px)',
|
262
|
+
minWidth: '153px'
|
263
|
+
}
|
264
|
+
}, "Attributes"), ___EmotionJSX(Text, {
|
265
|
+
sx: {
|
266
|
+
fontWeight: 3,
|
267
|
+
fontSize: 'md',
|
268
|
+
ml: '10px',
|
269
|
+
flexGrow: 1
|
270
|
+
}
|
271
|
+
}, "PingOne Mappings")), ___EmotionJSX(Separator, null), ___EmotionJSX(ScrollBox, {
|
272
|
+
mt: "md",
|
273
|
+
maxHeight: "700px"
|
274
|
+
}, ___EmotionJSX(Box, null, _mapInstanceProperty(rows).call(rows, function (row, index) {
|
275
|
+
return ___EmotionJSX(Row, _extends({}, row, {
|
276
|
+
index: index,
|
277
|
+
removeRow: removeRow,
|
278
|
+
updateRow: updateRow,
|
279
|
+
key: "row container ".concat(row.name),
|
280
|
+
isSubmitted: isSubmitted,
|
281
|
+
submitFields: submitFields
|
282
|
+
}));
|
283
|
+
})))));
|
284
|
+
};
|