@pingux/astro 2.54.0 → 2.55.0-alpha.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/lib/cjs/recipes/ListAndPanel.stories.js +315 -115
- package/lib/cjs/recipes/PanelContent.stories.js +26 -168
- package/lib/cjs/recipes/items.js +152 -2
- package/lib/recipes/ListAndPanel.stories.js +315 -115
- package/lib/recipes/PanelContent.stories.js +16 -158
- package/lib/recipes/items.js +148 -1
- package/package.json +1 -1
@@ -1,18 +1,21 @@
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
1
2
|
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
2
3
|
import _findIndexInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find-index";
|
4
|
+
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
5
|
+
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
3
6
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
4
7
|
import React, { useRef, useState } from 'react';
|
5
8
|
import { FocusScope } from 'react-aria';
|
6
9
|
import { Item } from 'react-stately';
|
7
10
|
import AccountIcon from '@pingux/mdi-react/AccountIcon';
|
8
|
-
import
|
9
|
-
import MoreVertIcon from '@pingux/mdi-react/MoreVertIcon';
|
10
|
-
import PencilIcon from '@pingux/mdi-react/PencilIcon';
|
11
|
+
import ChevronRightIcon from '@pingux/mdi-react/ChevronRightIcon';
|
11
12
|
import PlusIcon from '@pingux/mdi-react/PlusIcon';
|
12
13
|
import { useOverlappingMenuHoverState, useOverlayPanelState } from '../hooks';
|
13
|
-
import { Box, Icon, IconButton, Link, ListView, ListViewItem, ListViewItemMenu, ListViewItemSwitchField,
|
14
|
+
import { AccordionGroup, Badge, Box, Breadcrumbs, Button, ButtonBar, EditButton, Icon, IconButton, Image, ImageUploadField, Link, ListView, ListViewItem, ListViewItemMenu, ListViewItemSwitchField, OverlayPanel, PanelHeader, PanelHeaderCloseButton, PanelHeaderMenu, PanelHeaderSwitchField, SearchField, SelectField, Separator, Tab, Tabs, Text, TextField } from '../index';
|
14
15
|
import { FIGMA_LINKS } from '../utils/designUtils/figmaLinks';
|
15
|
-
import
|
16
|
+
import UserImage from '../utils/devUtils/assets/UserImage.png';
|
17
|
+
import { colorBlockButtons, editData, items, personalData } from './items';
|
18
|
+
import { AddAttributeButton, ColorBlockButton, LabelValuePairs } from './PanelContent.stories';
|
16
19
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
17
20
|
export default {
|
18
21
|
title: 'Recipes/List And Panel',
|
@@ -120,15 +123,16 @@ var title = ___EmotionJSX(Box, null, ___EmotionJSX(Box, {
|
|
120
123
|
}
|
121
124
|
}, " Learn more")));
|
122
125
|
export var ListAndPanel = function ListAndPanel() {
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
126
|
+
var _context, _context2, _context4, _context5, _context6;
|
127
|
+
/* Example of items data structure
|
128
|
+
const items = [
|
129
|
+
{
|
130
|
+
email: 'dburkitt5@columbia.edu',
|
131
|
+
firstName: 'Nicola',
|
132
|
+
lastName: 'Burkitt',
|
133
|
+
icon: AccountIcon,
|
134
|
+
},
|
135
|
+
] */
|
132
136
|
|
133
137
|
var _useState = useState(),
|
134
138
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -138,6 +142,10 @@ export var ListAndPanel = function ListAndPanel() {
|
|
138
142
|
_useState4 = _slicedToArray(_useState3, 2),
|
139
143
|
selectedKeys = _useState4[0],
|
140
144
|
setSelectedKeys = _useState4[1];
|
145
|
+
var _useState5 = useState(false),
|
146
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
147
|
+
isEditPanel = _useState6[0],
|
148
|
+
setEditPanel = _useState6[1];
|
141
149
|
var _useOverlayPanelState = useOverlayPanelState(),
|
142
150
|
panelState = _useOverlayPanelState.state,
|
143
151
|
onPanelClose = _useOverlayPanelState.onClose;
|
@@ -146,6 +154,7 @@ export var ListAndPanel = function ListAndPanel() {
|
|
146
154
|
onPanelClose(panelState, panelTriggerRef);
|
147
155
|
setSelectedItemId(-1);
|
148
156
|
setSelectedKeys([]);
|
157
|
+
setEditPanel(false);
|
149
158
|
};
|
150
159
|
var selectItemHandler = function selectItemHandler(e) {
|
151
160
|
if (e.size) {
|
@@ -153,11 +162,234 @@ export var ListAndPanel = function ListAndPanel() {
|
|
153
162
|
return item.email === e.currentKey;
|
154
163
|
}));
|
155
164
|
setSelectedKeys([e.currentKey]);
|
165
|
+
setEditPanel(false);
|
156
166
|
panelState.open();
|
157
167
|
} else {
|
158
168
|
closePanelHandler();
|
159
169
|
}
|
160
170
|
};
|
171
|
+
var renderProfileTab = selectedItemId >= 0 && ___EmotionJSX(React.Fragment, null, ___EmotionJSX(Box, {
|
172
|
+
isRow: true,
|
173
|
+
gap: "md",
|
174
|
+
mb: "20px"
|
175
|
+
}, _mapInstanceProperty(colorBlockButtons).call(colorBlockButtons, function (tileData) {
|
176
|
+
return ___EmotionJSX(ColorBlockButton, {
|
177
|
+
buttonData: tileData,
|
178
|
+
key: "".concat(tileData.text, "-key")
|
179
|
+
});
|
180
|
+
})), ___EmotionJSX(Box, {
|
181
|
+
isRow: true,
|
182
|
+
justifyContent: "space-between"
|
183
|
+
}, ___EmotionJSX(AccordionGroup, {
|
184
|
+
defaultExpandedKeys: _mapInstanceProperty(_context = _Object$keys(personalData)).call(_context, function (item) {
|
185
|
+
return personalData[item].key;
|
186
|
+
}),
|
187
|
+
labelHeadingTag: "h2"
|
188
|
+
}, _mapInstanceProperty(_context2 = _Object$keys(personalData)).call(_context2, function (item) {
|
189
|
+
var _context3;
|
190
|
+
return ___EmotionJSX(Item, {
|
191
|
+
"data-id": personalData[item].label,
|
192
|
+
key: personalData[item].key,
|
193
|
+
label: personalData[item].label,
|
194
|
+
textValue: personalData[item].label
|
195
|
+
}, personalData[item].image ? ___EmotionJSX(Box, {
|
196
|
+
isRow: true,
|
197
|
+
gap: "md"
|
198
|
+
}, ___EmotionJSX(Image, {
|
199
|
+
src: UserImage,
|
200
|
+
alt: "user"
|
201
|
+
}), ___EmotionJSX(LabelValuePairs, {
|
202
|
+
fields: personalData[item].fields
|
203
|
+
})) : ___EmotionJSX(LabelValuePairs, {
|
204
|
+
fields: personalData[item].fields
|
205
|
+
}), personalData[item].badges && ___EmotionJSX(Box, {
|
206
|
+
isRow: true,
|
207
|
+
gap: "sm"
|
208
|
+
}, _mapInstanceProperty(_context3 = personalData[item].badges).call(_context3, function (badge) {
|
209
|
+
return ___EmotionJSX(Badge, {
|
210
|
+
label: badge,
|
211
|
+
variant: "defaultBadge",
|
212
|
+
key: "".concat(badge, "-key")
|
213
|
+
});
|
214
|
+
})));
|
215
|
+
})), ___EmotionJSX(EditButton, {
|
216
|
+
size: "lg",
|
217
|
+
onPress: function onPress() {
|
218
|
+
return setEditPanel(!isEditPanel);
|
219
|
+
}
|
220
|
+
})));
|
221
|
+
var tabs = [{
|
222
|
+
name: 'Profile',
|
223
|
+
children: renderProfileTab
|
224
|
+
}, {
|
225
|
+
name: 'Groups',
|
226
|
+
children: 'Groups'
|
227
|
+
}, {
|
228
|
+
name: 'Roles',
|
229
|
+
children: 'Roles'
|
230
|
+
}, {
|
231
|
+
name: 'Services',
|
232
|
+
list: [{
|
233
|
+
key: 'service1',
|
234
|
+
name: 'Service 1',
|
235
|
+
children: 'Service 1',
|
236
|
+
role: 'listitem'
|
237
|
+
}, {
|
238
|
+
key: 'service2',
|
239
|
+
name: 'Service 2',
|
240
|
+
children: 'Service 2',
|
241
|
+
role: 'listitem'
|
242
|
+
}]
|
243
|
+
}, {
|
244
|
+
name: 'API',
|
245
|
+
children: 'API'
|
246
|
+
}];
|
247
|
+
var renderDisplayPanel = selectedItemId >= 0 && ___EmotionJSX(Box, {
|
248
|
+
sx: sx.tabsWrapper
|
249
|
+
}, ___EmotionJSX(Tabs, {
|
250
|
+
items: tabs,
|
251
|
+
mode: "list",
|
252
|
+
tabListProps: {
|
253
|
+
justifyContent: 'center',
|
254
|
+
mb: 'lg'
|
255
|
+
},
|
256
|
+
tabPanelProps: {
|
257
|
+
sx: {
|
258
|
+
position: 'relative'
|
259
|
+
}
|
260
|
+
}
|
261
|
+
}, function (item) {
|
262
|
+
return ___EmotionJSX(Tab, _extends({
|
263
|
+
key: item.name,
|
264
|
+
title: item.name
|
265
|
+
}, item), item.children);
|
266
|
+
}));
|
267
|
+
var renderHeader = function renderHeader() {
|
268
|
+
var selectedItem = items[selectedItemId];
|
269
|
+
if (selectedItem) {
|
270
|
+
var data = {
|
271
|
+
fname: selectedItem.firstName,
|
272
|
+
lname: selectedItem.lastName,
|
273
|
+
subtext: selectedItem.email,
|
274
|
+
icon: selectedItem.icon,
|
275
|
+
personalInfo: {
|
276
|
+
image: personalData.personalInfo.image
|
277
|
+
}
|
278
|
+
};
|
279
|
+
return ___EmotionJSX(OverlayPanelHeader, {
|
280
|
+
headerData: data,
|
281
|
+
isEditPanel: isEditPanel,
|
282
|
+
closePanelHandler: closePanelHandler
|
283
|
+
});
|
284
|
+
}
|
285
|
+
return null;
|
286
|
+
};
|
287
|
+
var renderEditPanel = selectedItemId >= 0 && ___EmotionJSX(React.Fragment, null, ___EmotionJSX(Box, {
|
288
|
+
p: "lg",
|
289
|
+
pb: "50px"
|
290
|
+
}, ___EmotionJSX(Box, {
|
291
|
+
gap: "md",
|
292
|
+
mb: "20px",
|
293
|
+
width: "500px"
|
294
|
+
}, ___EmotionJSX(TextField, {
|
295
|
+
defaultValue: "ednepomuceno",
|
296
|
+
isRequired: true,
|
297
|
+
label: "Username"
|
298
|
+
}), ___EmotionJSX(SelectField, {
|
299
|
+
label: "Population",
|
300
|
+
isRequired: true,
|
301
|
+
defaultSelectedKey: "population"
|
302
|
+
}, ___EmotionJSX(Item, {
|
303
|
+
key: "population"
|
304
|
+
}, "Denver"))), ___EmotionJSX(AccordionGroup, {
|
305
|
+
defaultExpandedKeys: _concatInstanceProperty(_context4 = []).call(_context4, _mapInstanceProperty(_context5 = _Object$keys(editData)).call(_context5, function (item) {
|
306
|
+
return editData[item].key;
|
307
|
+
}), ['preferencesKey', 'customAttributesKey', 'jsonAttributesKey']),
|
308
|
+
labelHeadingTag: "h2"
|
309
|
+
}, _mapInstanceProperty(_context6 = _Object$keys(editData)).call(_context6, function (item) {
|
310
|
+
var _context7;
|
311
|
+
return ___EmotionJSX(Item, {
|
312
|
+
"data-id": editData[item].label,
|
313
|
+
key: editData[item].key,
|
314
|
+
label: editData[item].label,
|
315
|
+
textValue: editData[item].label
|
316
|
+
}, ___EmotionJSX(Box, {
|
317
|
+
gap: "md",
|
318
|
+
width: "500px"
|
319
|
+
}, editData[item].image && ___EmotionJSX(ImageUploadField, {
|
320
|
+
label: "Photo",
|
321
|
+
previewHeight: 40,
|
322
|
+
previewWidth: 40,
|
323
|
+
previewImage: UserImage
|
324
|
+
}), _mapInstanceProperty(_context7 = editData[item].fields).call(_context7, function (_ref) {
|
325
|
+
var label = _ref.label,
|
326
|
+
value = _ref.value,
|
327
|
+
slot = _ref.slot;
|
328
|
+
return ___EmotionJSX(Box, {
|
329
|
+
key: "".concat(label, "-key")
|
330
|
+
}, ___EmotionJSX(TextField, {
|
331
|
+
label: label,
|
332
|
+
defaultValue: value
|
333
|
+
}), slot);
|
334
|
+
})));
|
335
|
+
}), ___EmotionJSX(Item, {
|
336
|
+
"data-id": "preferences",
|
337
|
+
key: "preferencesKey",
|
338
|
+
label: "Preferences",
|
339
|
+
textValue: "Preferences"
|
340
|
+
}, ___EmotionJSX(Box, {
|
341
|
+
gap: "md",
|
342
|
+
width: "500px"
|
343
|
+
}, ___EmotionJSX(SelectField, {
|
344
|
+
label: "Preferred Language",
|
345
|
+
defaultSelectedKey: "language"
|
346
|
+
}, ___EmotionJSX(Item, {
|
347
|
+
key: "language"
|
348
|
+
}, "Select a Language")), ___EmotionJSX(SelectField, {
|
349
|
+
label: "Locale",
|
350
|
+
defaultSelectedKey: "language"
|
351
|
+
}, ___EmotionJSX(Item, {
|
352
|
+
key: "language"
|
353
|
+
}, "Select a locale")), ___EmotionJSX(SelectField, {
|
354
|
+
label: "Timezone",
|
355
|
+
defaultSelectedKey: "language"
|
356
|
+
}, ___EmotionJSX(Item, {
|
357
|
+
key: "language"
|
358
|
+
}, "Select a timezone")))), ___EmotionJSX(Item, {
|
359
|
+
"data-id": "customAttributes",
|
360
|
+
key: "customAttributesKey",
|
361
|
+
label: "Custom Attributes",
|
362
|
+
textValue: "Custom Attributes"
|
363
|
+
}, ___EmotionJSX(AddAttributeButton, null), ___EmotionJSX(Text, {
|
364
|
+
fontWeight: "-1",
|
365
|
+
fontSize: "md",
|
366
|
+
textAlign: "center"
|
367
|
+
}, "Click + Add to select a custom attribute")), ___EmotionJSX(Item, {
|
368
|
+
"data-id": "jsonAttributes",
|
369
|
+
key: "jsonAttributesKey",
|
370
|
+
label: "JSON Attributes",
|
371
|
+
textValue: "JSON Attributes"
|
372
|
+
}, ___EmotionJSX(AddAttributeButton, null), ___EmotionJSX(Text, {
|
373
|
+
fontWeight: "-1",
|
374
|
+
fontSize: "md",
|
375
|
+
textAlign: "center"
|
376
|
+
}, "Click + Add to select a JSON attribute")))), ___EmotionJSX(ButtonBar, {
|
377
|
+
sx: {
|
378
|
+
position: 'fixed',
|
379
|
+
bottom: '0',
|
380
|
+
width: '100%'
|
381
|
+
}
|
382
|
+
}, ___EmotionJSX(Button, {
|
383
|
+
variant: "primary",
|
384
|
+
onPress: function onPress() {
|
385
|
+
return setEditPanel(!isEditPanel);
|
386
|
+
}
|
387
|
+
}, "Save"), ___EmotionJSX(Button, {
|
388
|
+
variant: "link",
|
389
|
+
onPress: function onPress() {
|
390
|
+
return setEditPanel(!isEditPanel);
|
391
|
+
}
|
392
|
+
}, "Cancel")));
|
161
393
|
return ___EmotionJSX(Box, {
|
162
394
|
sx: sx.wrapper
|
163
395
|
}, title, ___EmotionJSX(SearchField, {
|
@@ -175,12 +407,12 @@ export var ListAndPanel = function ListAndPanel() {
|
|
175
407
|
ref: panelTriggerRef,
|
176
408
|
selectedKeys: selectedKeys
|
177
409
|
}, function (item) {
|
178
|
-
var
|
410
|
+
var _context8;
|
179
411
|
return ___EmotionJSX(Item, {
|
180
412
|
key: item.email
|
181
413
|
}, ___EmotionJSX(ListElement, {
|
182
414
|
data: {
|
183
|
-
text: _concatInstanceProperty(
|
415
|
+
text: _concatInstanceProperty(_context8 = "".concat(item.lastName, ", ")).call(_context8, item.firstName),
|
184
416
|
subtext: item.email,
|
185
417
|
icon: item.icon
|
186
418
|
}
|
@@ -195,67 +427,30 @@ export var ListAndPanel = function ListAndPanel() {
|
|
195
427
|
contain: true,
|
196
428
|
restoreFocus: true,
|
197
429
|
autoFocus: true
|
198
|
-
},
|
199
|
-
item: selectedItemId >= 0 ? items[selectedItemId] : [],
|
200
|
-
onClosePanel: closePanelHandler
|
201
|
-
}), ___EmotionJSX(Separator, {
|
202
|
-
margin: 0,
|
203
|
-
sx: sx.separator
|
204
|
-
}), ___EmotionJSX(Box, {
|
205
|
-
sx: sx.tabsWrapper
|
206
|
-
}, ___EmotionJSX(Tabs, {
|
207
|
-
tabListProps: {
|
208
|
-
justifyContent: 'center'
|
209
|
-
},
|
210
|
-
tabPanelProps: {
|
211
|
-
sx: {
|
212
|
-
position: 'relative'
|
213
|
-
}
|
214
|
-
}
|
215
|
-
}, ___EmotionJSX(Tab, {
|
216
|
-
title: "Profile"
|
217
|
-
}, selectedItemId >= 0 && ___EmotionJSX(React.Fragment, null, ___EmotionJSX(IconButton, {
|
218
|
-
variant: "inverted",
|
219
|
-
"aria-label": "pencil icon button",
|
220
|
-
sx: sx.iconButton
|
221
|
-
}, ___EmotionJSX(Icon, {
|
222
|
-
icon: PencilIcon,
|
223
|
-
size: "sm"
|
224
|
-
})), ___EmotionJSX(Text, {
|
225
|
-
sx: sx.itemLabel
|
226
|
-
}, "Full Name"), ___EmotionJSX(Text, {
|
227
|
-
sx: sx.itemValue
|
228
|
-
}, items[selectedItemId].firstName, ' ', items[selectedItemId].lastName), ___EmotionJSX(Text, {
|
229
|
-
sx: sx.itemLabel
|
230
|
-
}, "First Name"), ___EmotionJSX(Text, {
|
231
|
-
sx: sx.itemValue
|
232
|
-
}, items[selectedItemId].firstName), ___EmotionJSX(Text, {
|
233
|
-
sx: sx.itemLabel
|
234
|
-
}, "Last Name"), ___EmotionJSX(Text, {
|
235
|
-
sx: sx.itemValue
|
236
|
-
}, items[selectedItemId].lastName), ___EmotionJSX(Text, {
|
237
|
-
sx: sx.itemLabel
|
238
|
-
}, "Email"), ___EmotionJSX(Text, {
|
239
|
-
sx: sx.itemValue
|
240
|
-
}, items[selectedItemId].email))), ___EmotionJSX(Tab, {
|
241
|
-
title: "Group Memberships"
|
242
|
-
}, ___EmotionJSX(Text, null, "Group Memberships")), ___EmotionJSX(Tab, {
|
243
|
-
title: "Account Info"
|
244
|
-
}, ___EmotionJSX(Text, null, "Account Info")))))));
|
430
|
+
}, renderHeader(), isEditPanel ? renderEditPanel : renderDisplayPanel)));
|
245
431
|
};
|
246
432
|
ListAndPanel.parameters = {
|
247
433
|
design: {
|
248
434
|
type: 'figma',
|
249
435
|
url: FIGMA_LINKS.listAndPanel.listAndPanel
|
436
|
+
},
|
437
|
+
a11y: {
|
438
|
+
config: {
|
439
|
+
rules: [{
|
440
|
+
id: 'color-contrast',
|
441
|
+
enabled: false
|
442
|
+
}] // Added to bypass color contrast issue due to virtualizer
|
443
|
+
}
|
250
444
|
}
|
251
445
|
};
|
252
|
-
|
253
|
-
|
254
|
-
|
446
|
+
|
447
|
+
export var ListElement = function ListElement(_ref2) {
|
448
|
+
var _ref2$data = _ref2.data,
|
449
|
+
data = _ref2$data === void 0 ? {
|
255
450
|
subtext: 'dburkitt5@columbia.edu',
|
256
451
|
text: 'Burkitt, Nicola',
|
257
452
|
icon: AccountIcon
|
258
|
-
} :
|
453
|
+
} : _ref2$data;
|
259
454
|
var listItemRef = useRef();
|
260
455
|
var _useOverlappingMenuHo = useOverlappingMenuHoverState({
|
261
456
|
listItemRef: listItemRef
|
@@ -284,57 +479,62 @@ export var ListElement = function ListElement(_ref) {
|
|
284
479
|
key: "delete"
|
285
480
|
}, "Delete user")));
|
286
481
|
};
|
287
|
-
|
288
|
-
var
|
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
|
-
|
482
|
+
var renderBreadcrumbs = function renderBreadcrumbs(headerData) {
|
483
|
+
var _context9;
|
484
|
+
return ___EmotionJSX(Breadcrumbs, {
|
485
|
+
icon: ChevronRightIcon
|
486
|
+
}, ___EmotionJSX(Item, {
|
487
|
+
"aria-label": headerData.fname,
|
488
|
+
href: "https://www.pingidentity.com",
|
489
|
+
key: headerData.fname,
|
490
|
+
variant: "buttons.link"
|
491
|
+
}, _concatInstanceProperty(_context9 = "".concat(headerData.fname, " ")).call(_context9, headerData.lname)), ___EmotionJSX(Item, {
|
492
|
+
"aria-label": "Edit",
|
493
|
+
key: "editKey",
|
494
|
+
variant: "buttons.link"
|
495
|
+
}, "Edit"));
|
496
|
+
};
|
497
|
+
export var OverlayPanelHeader = function OverlayPanelHeader(_ref3) {
|
498
|
+
var _context10, _context11, _context12;
|
499
|
+
var _ref3$headerData = _ref3.headerData,
|
500
|
+
headerData = _ref3$headerData === void 0 ? {
|
501
|
+
fname: 'John',
|
502
|
+
lname: 'Doe',
|
503
|
+
subtext: 'dburkitt5@columbia.edu',
|
504
|
+
icon: AccountIcon
|
505
|
+
} : _ref3$headerData,
|
506
|
+
isEditPanel = _ref3.isEditPanel,
|
507
|
+
closePanelHandler = _ref3.closePanelHandler;
|
508
|
+
var fname = headerData.fname,
|
509
|
+
lname = headerData.lname,
|
510
|
+
subtext = headerData.subtext,
|
511
|
+
icon = headerData.icon,
|
512
|
+
personalInfo = headerData.personalInfo;
|
513
|
+
var headerProps = isEditPanel ? {
|
514
|
+
data: {
|
515
|
+
image: {
|
516
|
+
src: personalInfo.image,
|
517
|
+
alt: _concatInstanceProperty(_context10 = "".concat(fname, " ")).call(_context10, lname),
|
518
|
+
'aria-label': _concatInstanceProperty(_context11 = "".concat(fname, " ")).call(_context11, lname)
|
519
|
+
}
|
520
|
+
},
|
521
|
+
slots: {
|
522
|
+
rightOfData: renderBreadcrumbs(headerData)
|
523
|
+
}
|
524
|
+
} : {
|
525
|
+
data: {
|
526
|
+
text: _concatInstanceProperty(_context12 = "".concat(lname, ", ")).call(_context12, fname),
|
527
|
+
subtext: subtext,
|
528
|
+
icon: icon
|
529
|
+
}
|
530
|
+
};
|
531
|
+
return ___EmotionJSX(PanelHeader, headerProps, !isEditPanel && ___EmotionJSX(PanelHeaderSwitchField, null), !isEditPanel && ___EmotionJSX(PanelHeaderMenu, null, ___EmotionJSX(Item, {
|
328
532
|
key: "enable"
|
329
533
|
}, "Enable user"), ___EmotionJSX(Item, {
|
330
534
|
key: "disable"
|
331
535
|
}, "Disable user"), ___EmotionJSX(Item, {
|
332
536
|
key: "delete"
|
333
|
-
}, "Delete user"))
|
334
|
-
|
335
|
-
|
336
|
-
}, ___EmotionJSX(Icon, {
|
337
|
-
size: "md",
|
338
|
-
icon: CloseIcon
|
339
|
-
})))));
|
537
|
+
}, "Delete user")), ___EmotionJSX(PanelHeaderCloseButton, {
|
538
|
+
onPress: closePanelHandler
|
539
|
+
}));
|
340
540
|
};
|