@hitachivantara/uikit-react-core 3.62.5 → 3.63.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 +40 -0
- package/dist/AppSwitcher/Action/Action.d.ts +75 -0
- package/dist/AppSwitcher/Action/Action.js +304 -0
- package/dist/AppSwitcher/Action/Action.js.map +1 -0
- package/dist/AppSwitcher/Action/index.d.ts +2 -0
- package/dist/AppSwitcher/Action/index.js +14 -0
- package/dist/AppSwitcher/Action/index.js.map +1 -0
- package/dist/AppSwitcher/Action/styles.js +60 -0
- package/dist/AppSwitcher/Action/styles.js.map +1 -0
- package/dist/AppSwitcher/AppSwitcher.d.ts +67 -0
- package/dist/AppSwitcher/AppSwitcher.js +282 -0
- package/dist/AppSwitcher/AppSwitcher.js.map +1 -0
- package/dist/AppSwitcher/TitleWithTooltip.js +76 -0
- package/dist/AppSwitcher/TitleWithTooltip.js.map +1 -0
- package/dist/AppSwitcher/index.d.ts +5 -0
- package/dist/AppSwitcher/index.js +24 -0
- package/dist/AppSwitcher/index.js.map +1 -0
- package/dist/AppSwitcher/styles.js +95 -0
- package/dist/AppSwitcher/styles.js.map +1 -0
- package/dist/Avatar/Avatar.d.ts +4 -0
- package/dist/Avatar/Avatar.js +19 -8
- package/dist/Avatar/Avatar.js.map +1 -1
- package/dist/Chart/chartPlotlyOverrides.js +2 -2
- package/dist/Chart/chartPlotlyOverrides.js.map +1 -1
- package/dist/FileUploader/File/styles.js +2 -1
- package/dist/FileUploader/File/styles.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/legacy/AppSwitcher/Action/Action.d.ts +75 -0
- package/dist/legacy/AppSwitcher/Action/Action.js +259 -0
- package/dist/legacy/AppSwitcher/Action/Action.js.map +1 -0
- package/dist/legacy/AppSwitcher/Action/index.d.ts +2 -0
- package/dist/legacy/AppSwitcher/Action/index.js +3 -0
- package/dist/legacy/AppSwitcher/Action/index.js.map +1 -0
- package/dist/legacy/AppSwitcher/Action/styles.js +52 -0
- package/dist/legacy/AppSwitcher/Action/styles.js.map +1 -0
- package/dist/legacy/AppSwitcher/AppSwitcher.d.ts +67 -0
- package/dist/legacy/AppSwitcher/AppSwitcher.js +260 -0
- package/dist/legacy/AppSwitcher/AppSwitcher.js.map +1 -0
- package/dist/legacy/AppSwitcher/TitleWithTooltip.js +45 -0
- package/dist/legacy/AppSwitcher/TitleWithTooltip.js.map +1 -0
- package/dist/legacy/AppSwitcher/index.d.ts +5 -0
- package/dist/legacy/AppSwitcher/index.js +3 -0
- package/dist/legacy/AppSwitcher/index.js.map +1 -0
- package/dist/legacy/AppSwitcher/styles.js +78 -0
- package/dist/legacy/AppSwitcher/styles.js.map +1 -0
- package/dist/legacy/Avatar/Avatar.d.ts +4 -0
- package/dist/legacy/Avatar/Avatar.js +19 -8
- package/dist/legacy/Avatar/Avatar.js.map +1 -1
- package/dist/legacy/Chart/chartPlotlyOverrides.js +2 -2
- package/dist/legacy/Chart/chartPlotlyOverrides.js.map +1 -1
- package/dist/legacy/FileUploader/File/styles.js +2 -1
- package/dist/legacy/FileUploader/File/styles.js.map +1 -1
- package/dist/legacy/index.d.ts +3 -0
- package/dist/legacy/index.js +1 -0
- package/dist/legacy/index.js.map +1 -1
- package/dist/modern/AppSwitcher/Action/Action.d.ts +75 -0
- package/dist/modern/AppSwitcher/Action/Action.js +242 -0
- package/dist/modern/AppSwitcher/Action/Action.js.map +1 -0
- package/dist/modern/AppSwitcher/Action/index.d.ts +2 -0
- package/dist/modern/AppSwitcher/Action/index.js +3 -0
- package/dist/modern/AppSwitcher/Action/index.js.map +1 -0
- package/dist/modern/AppSwitcher/Action/styles.js +50 -0
- package/dist/modern/AppSwitcher/Action/styles.js.map +1 -0
- package/dist/modern/AppSwitcher/AppSwitcher.d.ts +67 -0
- package/dist/modern/AppSwitcher/AppSwitcher.js +254 -0
- package/dist/modern/AppSwitcher/AppSwitcher.js.map +1 -0
- package/dist/modern/AppSwitcher/TitleWithTooltip.js +41 -0
- package/dist/modern/AppSwitcher/TitleWithTooltip.js.map +1 -0
- package/dist/modern/AppSwitcher/index.d.ts +5 -0
- package/dist/modern/AppSwitcher/index.js +3 -0
- package/dist/modern/AppSwitcher/index.js.map +1 -0
- package/dist/modern/AppSwitcher/styles.js +67 -0
- package/dist/modern/AppSwitcher/styles.js.map +1 -0
- package/dist/modern/Avatar/Avatar.d.ts +4 -0
- package/dist/modern/Avatar/Avatar.js +20 -9
- package/dist/modern/Avatar/Avatar.js.map +1 -1
- package/dist/modern/Chart/chartPlotlyOverrides.js +2 -2
- package/dist/modern/Chart/chartPlotlyOverrides.js.map +1 -1
- package/dist/modern/FileUploader/File/styles.js +2 -1
- package/dist/modern/FileUploader/File/styles.js.map +1 -1
- package/dist/modern/index.d.ts +3 -0
- package/dist/modern/index.js +1 -0
- package/dist/modern/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
require("core-js/modules/es.array.map.js");
|
|
11
|
+
|
|
12
|
+
require("core-js/modules/es.function.name.js");
|
|
13
|
+
|
|
14
|
+
require("core-js/modules/es.array.concat.js");
|
|
15
|
+
|
|
16
|
+
var _react = _interopRequireDefault(require("react"));
|
|
17
|
+
|
|
18
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
|
+
|
|
20
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
21
|
+
|
|
22
|
+
var _core = require("@material-ui/core");
|
|
23
|
+
|
|
24
|
+
var _ = require("..");
|
|
25
|
+
|
|
26
|
+
var _styles = _interopRequireDefault(require("./styles"));
|
|
27
|
+
|
|
28
|
+
var _TitleWithTooltip = _interopRequireDefault(require("./TitleWithTooltip"));
|
|
29
|
+
|
|
30
|
+
var _Action = _interopRequireDefault(require("./Action"));
|
|
31
|
+
|
|
32
|
+
var AppSwitcher = function AppSwitcher(props) {
|
|
33
|
+
var id = props.id,
|
|
34
|
+
className = props.className,
|
|
35
|
+
classes = props.classes,
|
|
36
|
+
_props$layout = props.layout,
|
|
37
|
+
layout = _props$layout === void 0 ? "single" : _props$layout,
|
|
38
|
+
title = props.title,
|
|
39
|
+
applications = props.applications,
|
|
40
|
+
_props$onActionClicke = props.onActionClickedCallback,
|
|
41
|
+
onActionClickedCallback = _props$onActionClicke === void 0 ? function () {} : _props$onActionClicke,
|
|
42
|
+
_props$isActionSelect = props.isActionSelectedCallback,
|
|
43
|
+
isActionSelectedCallback = _props$isActionSelect === void 0 ? function () {
|
|
44
|
+
return false;
|
|
45
|
+
} : _props$isActionSelect,
|
|
46
|
+
header = props.header,
|
|
47
|
+
footer = props.footer,
|
|
48
|
+
isOpen = props.isOpen;
|
|
49
|
+
|
|
50
|
+
var actionClicked = function actionClicked(event, application) {
|
|
51
|
+
onActionClickedCallback === null || onActionClickedCallback === void 0 ? void 0 : onActionClickedCallback(event, application);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
var panelActions = applications.map(function (application) {
|
|
55
|
+
if (application.name) {
|
|
56
|
+
return /*#__PURE__*/_react.default.createElement(_Action.default, {
|
|
57
|
+
key: application.id || "".concat(application.name, "_").concat(application.url),
|
|
58
|
+
application: application,
|
|
59
|
+
onClickCallback: actionClicked,
|
|
60
|
+
isSelectedCallback: isActionSelectedCallback,
|
|
61
|
+
classes: {
|
|
62
|
+
root: classes.item,
|
|
63
|
+
selected: classes.itemSelected,
|
|
64
|
+
disabled: classes.itemDisabled,
|
|
65
|
+
typography: classes.itemTrigger,
|
|
66
|
+
icon: classes.itemIcon,
|
|
67
|
+
title: classes.itemTitle,
|
|
68
|
+
iconInfo: classes.itemInfoIcon
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return undefined;
|
|
74
|
+
});
|
|
75
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
76
|
+
id: id,
|
|
77
|
+
className: (0, _clsx.default)(className, classes.root, classes[layout], isOpen === false && classes.closed, isOpen && classes.open)
|
|
78
|
+
}, header && /*#__PURE__*/_react.default.createElement("div", {
|
|
79
|
+
className: classes.title
|
|
80
|
+
}, header) || title && /*#__PURE__*/_react.default.createElement(_TitleWithTooltip.default, {
|
|
81
|
+
className: classes.title,
|
|
82
|
+
title: title
|
|
83
|
+
}), /*#__PURE__*/_react.default.createElement(_.HvListContainer, {
|
|
84
|
+
disableGutters: true,
|
|
85
|
+
className: classes.actionsContainer
|
|
86
|
+
}, panelActions), footer && /*#__PURE__*/_react.default.createElement("div", {
|
|
87
|
+
className: classes.footerContainer
|
|
88
|
+
}, footer));
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
process.env.NODE_ENV !== "production" ? AppSwitcher.propTypes = {
|
|
92
|
+
/**
|
|
93
|
+
* Identifier to be applied to the root element.
|
|
94
|
+
*/
|
|
95
|
+
id: _propTypes.default.string,
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Class names to be applied to the root element.
|
|
99
|
+
*/
|
|
100
|
+
className: _propTypes.default.string,
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* A Jss Object used to override or extend the styles applied.
|
|
104
|
+
*/
|
|
105
|
+
classes: _propTypes.default.shape({
|
|
106
|
+
/**
|
|
107
|
+
* Styles applied to the component root class.
|
|
108
|
+
*/
|
|
109
|
+
root: _propTypes.default.string,
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Styles applied to the component root class when in single layout mode.
|
|
113
|
+
*/
|
|
114
|
+
single: _propTypes.default.string,
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Styles applied to the component root class when in single dual mode.
|
|
118
|
+
*/
|
|
119
|
+
dual: _propTypes.default.string,
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Styles applied to the component root class when in single fluid mode.
|
|
123
|
+
*/
|
|
124
|
+
fluid: _propTypes.default.string,
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Styles applied to the title element.
|
|
128
|
+
*/
|
|
129
|
+
title: _propTypes.default.string,
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Styles applied to the actions container.
|
|
133
|
+
*/
|
|
134
|
+
actionsContainer: _propTypes.default.string,
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Styles applied to the footer container.
|
|
138
|
+
*/
|
|
139
|
+
footerContainer: _propTypes.default.string,
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Styles applied to the panel when closed.
|
|
143
|
+
*/
|
|
144
|
+
closed: _propTypes.default.string,
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Styles applied to the panel when open.
|
|
148
|
+
*/
|
|
149
|
+
open: _propTypes.default.string,
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Styles applied to the action item root.
|
|
153
|
+
*/
|
|
154
|
+
item: _propTypes.default.string,
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Styles applied to the action item when selected.
|
|
158
|
+
*/
|
|
159
|
+
itemSelected: _propTypes.default.string,
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Styles applied to the action item when disabled.
|
|
163
|
+
*/
|
|
164
|
+
itemDisabled: _propTypes.default.string,
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Styles applied to the action item typography.
|
|
168
|
+
*/
|
|
169
|
+
itemTrigger: _propTypes.default.string,
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Styles applied to the action item icon.
|
|
173
|
+
*/
|
|
174
|
+
itemIcon: _propTypes.default.string,
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Styles applied to the action item title.
|
|
178
|
+
*/
|
|
179
|
+
itemTitle: _propTypes.default.string,
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Styles applied to the action item info icon.
|
|
183
|
+
*/
|
|
184
|
+
itemInfoIcon: _propTypes.default.string
|
|
185
|
+
}).isRequired,
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Number of columns to render. One, two, or whatever fits the component's width.
|
|
189
|
+
*/
|
|
190
|
+
layout: _propTypes.default.oneOf(["single", "dual", "fluid"]),
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Title to be displayed on the header of the component.
|
|
194
|
+
*/
|
|
195
|
+
title: _propTypes.default.string,
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* The list of applications to be used to render the actions on the component.
|
|
199
|
+
*/
|
|
200
|
+
applications: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
201
|
+
/**
|
|
202
|
+
* Id of the application.
|
|
203
|
+
*/
|
|
204
|
+
id: _propTypes.default.string,
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Name of the application, this is the value that will be displayed on the component.
|
|
208
|
+
*/
|
|
209
|
+
name: _propTypes.default.string.isRequired,
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* URL with the icon location to be used to represent the application.
|
|
213
|
+
* iconUrl will only be used if no iconElement is provided.
|
|
214
|
+
*/
|
|
215
|
+
iconUrl: _propTypes.default.string,
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Element to be added as the icon representing the application.
|
|
219
|
+
* The iconElement will be the primary option to be displayed.
|
|
220
|
+
*/
|
|
221
|
+
iconElement: _propTypes.default.element,
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Small description of the application.
|
|
225
|
+
*/
|
|
226
|
+
description: _propTypes.default.string,
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* URL where the application is accesible.
|
|
230
|
+
*/
|
|
231
|
+
url: _propTypes.default.string,
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Defines if the application should be opened in the same tab or in a new one.
|
|
235
|
+
*/
|
|
236
|
+
target: _propTypes.default.oneOf(["_top", "_blank"]),
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* If true, the item will be disabled.
|
|
240
|
+
*/
|
|
241
|
+
disabled: _propTypes.default.bool,
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* True when the application is selected, false otherwise.
|
|
245
|
+
*/
|
|
246
|
+
isSelected: _propTypes.default.bool
|
|
247
|
+
})).isRequired,
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Triggered when an action is clicked.
|
|
251
|
+
*/
|
|
252
|
+
onActionClickedCallback: _propTypes.default.func,
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Must return a boolean stating if the action element is selected or not.
|
|
256
|
+
*/
|
|
257
|
+
isActionSelectedCallback: _propTypes.default.func,
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Element to be added to the header container, if none is provided a label with the title will be added.
|
|
261
|
+
*/
|
|
262
|
+
header: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]),
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Element to be added to the footer container.
|
|
266
|
+
*/
|
|
267
|
+
footer: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]),
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Flag stating if the panel is opened or closed.
|
|
271
|
+
*
|
|
272
|
+
* @deprecated This logic should be external, i.e. using the HvAppSwitcher inside a Drawer component.
|
|
273
|
+
*/
|
|
274
|
+
isOpen: (0, _core.deprecatedPropType)(_propTypes.default.bool)
|
|
275
|
+
} : void 0;
|
|
276
|
+
|
|
277
|
+
var _default = (0, _core.withStyles)(_styles.default, {
|
|
278
|
+
name: "HvAppSwitcher"
|
|
279
|
+
})(AppSwitcher);
|
|
280
|
+
|
|
281
|
+
exports.default = _default;
|
|
282
|
+
//# sourceMappingURL=AppSwitcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/AppSwitcher/AppSwitcher.js"],"names":["AppSwitcher","props","id","className","classes","layout","title","applications","onActionClickedCallback","isActionSelectedCallback","header","footer","isOpen","actionClicked","event","application","panelActions","map","name","url","root","item","selected","itemSelected","disabled","itemDisabled","typography","itemTrigger","icon","itemIcon","itemTitle","iconInfo","itemInfoIcon","undefined","closed","open","actionsContainer","footerContainer","propTypes","PropTypes","string","shape","single","dual","fluid","isRequired","oneOf","arrayOf","iconUrl","iconElement","element","description","target","bool","isSelected","func","oneOfType","node","styles"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AAEA;;AAEA;;AAEA;;AACA;;AAEA,IAAMA,WAAW,GAAG,SAAdA,WAAc,CAACC,KAAD,EAAW;AAC7B,MACEC,EADF,GAkBID,KAlBJ,CACEC,EADF;AAAA,MAGEC,SAHF,GAkBIF,KAlBJ,CAGEE,SAHF;AAAA,MAIEC,OAJF,GAkBIH,KAlBJ,CAIEG,OAJF;AAAA,sBAkBIH,KAlBJ,CAMEI,MANF;AAAA,MAMEA,MANF,8BAMW,QANX;AAAA,MAQEC,KARF,GAkBIL,KAlBJ,CAQEK,KARF;AAAA,MASEC,YATF,GAkBIN,KAlBJ,CASEM,YATF;AAAA,8BAkBIN,KAlBJ,CAWEO,uBAXF;AAAA,MAWEA,uBAXF,sCAW4B,YAAM,CAAE,CAXpC;AAAA,8BAkBIP,KAlBJ,CAYEQ,wBAZF;AAAA,MAYEA,wBAZF,sCAY6B;AAAA,WAAM,KAAN;AAAA,GAZ7B;AAAA,MAcEC,MAdF,GAkBIT,KAlBJ,CAcES,MAdF;AAAA,MAeEC,MAfF,GAkBIV,KAlBJ,CAeEU,MAfF;AAAA,MAiBEC,MAjBF,GAkBIX,KAlBJ,CAiBEW,MAjBF;;AAoBA,MAAMC,aAAa,GAAG,SAAhBA,aAAgB,CAACC,KAAD,EAAQC,WAA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,UArIoB;;AAuItB;AACF;AACA;AACErC,EAAAA,uBAAuB,EAAE+B,mBAAUgB,IA1Ib;;AA2ItB;AACF;AACA;AACE9C,EAAAA,wBAAwB,EAAE8B,mBAAUgB,IA9Id;;AAgJtB;AACF;AACA;AACE7C,EAAAA,MAAM,EAAE6B,mBAAUiB,SAAV,CAAoB,CAACjB,mBAAUC,MAAX,EAAmBD,mBAAUkB,IAA7B,CAApB,CAnJc;;AAoJtB;AACF;AACA;AACE9C,EAAAA,MAAM,EAAE4B,mBAAUiB,SAAV,CAAoB,CAACjB,mBAAUC,MAAX,EAAmBD,mBAAUkB,IAA7B,CAApB,CAvJc;;AAyJtB;AACF;AACA;AACA;AACA;AACE7C,EAAAA,MAAM,EAAE,8BAAmB2B,mBAAUc,IAA7B;AA9Jc,CAAxB;;eAiKe,sBAAWK,eAAX,EAAmB;AAAExC,EAAAA,IAAI,EAAE;AAAR,CAAnB,EAA8ClB,WAA9C,C","sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport clsx from \"clsx\";\nimport { deprecatedPropType, withStyles } from \"@material-ui/core\";\n\nimport { HvListContainer } from \"..\";\n\nimport styles from \"./styles\";\n\nimport TitleWithTooltip from \"./TitleWithTooltip\";\nimport Action from \"./Action\";\n\nconst AppSwitcher = (props) => {\n const {\n id,\n\n className,\n classes,\n\n layout = \"single\",\n\n title,\n applications,\n\n onActionClickedCallback = () => {},\n isActionSelectedCallback = () => false,\n\n header,\n footer,\n\n isOpen,\n } = props;\n\n const actionClicked = (event, application) => {\n onActionClickedCallback?.(event, application);\n };\n\n const panelActions = applications.map((application) => {\n if (application.name) {\n return (\n <Action\n key={application.id || `${application.name}_${application.url}`}\n application={application}\n onClickCallback={actionClicked}\n isSelectedCallback={isActionSelectedCallback}\n classes={{\n root: classes.item,\n selected: classes.itemSelected,\n disabled: classes.itemDisabled,\n typography: classes.itemTrigger,\n icon: classes.itemIcon,\n title: classes.itemTitle,\n iconInfo: classes.itemInfoIcon,\n }}\n />\n );\n }\n\n return undefined;\n });\n\n return (\n <div\n id={id}\n className={clsx(className, classes.root, classes[layout], {\n [classes.closed]: isOpen === false,\n [classes.open]: isOpen,\n })}\n >\n {(header && <div className={classes.title}>{header}</div>) ||\n (title && <TitleWithTooltip className={classes.title} title={title} />)}\n <HvListContainer disableGutters className={classes.actionsContainer}>\n {panelActions}\n </HvListContainer>\n {footer && <div className={classes.footerContainer}>{footer}</div>}\n </div>\n );\n};\n\nAppSwitcher.propTypes = {\n /**\n * Identifier to be applied to the root element.\n */\n id: PropTypes.string,\n\n /**\n * Class names to be applied to the root element.\n */\n className: PropTypes.string,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the component root class when in single layout mode.\n */\n single: PropTypes.string,\n /**\n * Styles applied to the component root class when in single dual mode.\n */\n dual: PropTypes.string,\n /**\n * Styles applied to the component root class when in single fluid mode.\n */\n fluid: PropTypes.string,\n /**\n * Styles applied to the title element.\n */\n title: PropTypes.string,\n /**\n * Styles applied to the actions container.\n */\n actionsContainer: PropTypes.string,\n /**\n * Styles applied to the footer container.\n */\n footerContainer: PropTypes.string,\n /**\n * Styles applied to the panel when closed.\n */\n closed: PropTypes.string,\n /**\n * Styles applied to the panel when open.\n */\n open: PropTypes.string,\n /**\n * Styles applied to the action item root.\n */\n item: PropTypes.string,\n /**\n * Styles applied to the action item when selected.\n */\n itemSelected: PropTypes.string,\n /**\n * Styles applied to the action item when disabled.\n */\n itemDisabled: PropTypes.string,\n /**\n * Styles applied to the action item typography.\n */\n itemTrigger: PropTypes.string,\n /**\n * Styles applied to the action item icon.\n */\n itemIcon: PropTypes.string,\n /**\n * Styles applied to the action item title.\n */\n itemTitle: PropTypes.string,\n /**\n * Styles applied to the action item info icon.\n */\n itemInfoIcon: PropTypes.string,\n }).isRequired,\n\n /**\n * Number of columns to render. One, two, or whatever fits the component's width.\n */\n layout: PropTypes.oneOf([\"single\", \"dual\", \"fluid\"]),\n\n /**\n * Title to be displayed on the header of the component.\n */\n title: PropTypes.string,\n /**\n * The list of applications to be used to render the actions on the component.\n */\n applications: PropTypes.arrayOf(\n PropTypes.shape({\n /**\n * Id of the application.\n */\n id: PropTypes.string,\n /**\n * Name of the application, this is the value that will be displayed on the component.\n */\n name: PropTypes.string.isRequired,\n /**\n * URL with the icon location to be used to represent the application.\n * iconUrl will only be used if no iconElement is provided.\n */\n iconUrl: PropTypes.string,\n /**\n * Element to be added as the icon representing the application.\n * The iconElement will be the primary option to be displayed.\n */\n iconElement: PropTypes.element,\n /**\n * Small description of the application.\n */\n description: PropTypes.string,\n /**\n * URL where the application is accesible.\n */\n url: PropTypes.string,\n /**\n * Defines if the application should be opened in the same tab or in a new one.\n */\n target: PropTypes.oneOf([\"_top\", \"_blank\"]),\n /**\n * If true, the item will be disabled.\n */\n disabled: PropTypes.bool,\n /**\n * True when the application is selected, false otherwise.\n */\n isSelected: PropTypes.bool,\n })\n ).isRequired,\n\n /**\n * Triggered when an action is clicked.\n */\n onActionClickedCallback: PropTypes.func,\n /**\n * Must return a boolean stating if the action element is selected or not.\n */\n isActionSelectedCallback: PropTypes.func,\n\n /**\n * Element to be added to the header container, if none is provided a label with the title will be added.\n */\n header: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n /**\n * Element to be added to the footer container.\n */\n footer: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n\n /**\n * Flag stating if the panel is opened or closed.\n *\n * @deprecated This logic should be external, i.e. using the HvAppSwitcher inside a Drawer component.\n */\n isOpen: deprecatedPropType(PropTypes.bool),\n};\n\nexport default withStyles(styles, { name: \"HvAppSwitcher\" })(AppSwitcher);\n"],"file":"AppSwitcher.js"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.array.iterator.js");
|
|
4
|
+
|
|
5
|
+
require("core-js/modules/es.object.to-string.js");
|
|
6
|
+
|
|
7
|
+
require("core-js/modules/es.string.iterator.js");
|
|
8
|
+
|
|
9
|
+
require("core-js/modules/es.weak-map.js");
|
|
10
|
+
|
|
11
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
12
|
+
|
|
13
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
14
|
+
|
|
15
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
16
|
+
|
|
17
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
18
|
+
|
|
19
|
+
Object.defineProperty(exports, "__esModule", {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
exports.default = void 0;
|
|
23
|
+
|
|
24
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
25
|
+
|
|
26
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
27
|
+
|
|
28
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
29
|
+
|
|
30
|
+
var _ = require("..");
|
|
31
|
+
|
|
32
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
33
|
+
|
|
34
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
35
|
+
|
|
36
|
+
var TitleWithTooltip = function TitleWithTooltip(_ref) {
|
|
37
|
+
var className = _ref.className,
|
|
38
|
+
title = _ref.title;
|
|
39
|
+
|
|
40
|
+
var _useState = (0, _react.useState)(false),
|
|
41
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
42
|
+
isOverflowed = _useState2[0],
|
|
43
|
+
setIsOverflowed = _useState2[1];
|
|
44
|
+
|
|
45
|
+
var textRef = (0, _react.useRef)();
|
|
46
|
+
(0, _react.useEffect)(function () {
|
|
47
|
+
if (textRef !== null && textRef !== void 0 && textRef.current) {
|
|
48
|
+
setIsOverflowed(textRef.current.scrollWidth > textRef.current.clientWidth || textRef.current.scrollHeight > textRef.current.clientHeight);
|
|
49
|
+
}
|
|
50
|
+
}, []);
|
|
51
|
+
return /*#__PURE__*/_react.default.createElement(_.HvTooltip, {
|
|
52
|
+
disableHoverListener: !isOverflowed,
|
|
53
|
+
placement: "top-start",
|
|
54
|
+
title: /*#__PURE__*/_react.default.createElement(_.HvTypography, null, title)
|
|
55
|
+
}, /*#__PURE__*/_react.default.createElement(_.HvTypography, {
|
|
56
|
+
variant: "highlightText",
|
|
57
|
+
component: "span",
|
|
58
|
+
ref: textRef,
|
|
59
|
+
className: className
|
|
60
|
+
}, title));
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
process.env.NODE_ENV !== "production" ? TitleWithTooltip.propTypes = {
|
|
64
|
+
/**
|
|
65
|
+
* Class names to be applied to the root element.
|
|
66
|
+
*/
|
|
67
|
+
className: _propTypes.default.string,
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Title to be displayed.
|
|
71
|
+
*/
|
|
72
|
+
title: _propTypes.default.string
|
|
73
|
+
} : void 0;
|
|
74
|
+
var _default = TitleWithTooltip;
|
|
75
|
+
exports.default = _default;
|
|
76
|
+
//# sourceMappingURL=TitleWithTooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/AppSwitcher/TitleWithTooltip.js"],"names":["TitleWithTooltip","className","title","isOverflowed","setIsOverflowed","textRef","current","scrollWidth","clientWidth","scrollHeight","clientHeight","propTypes","PropTypes","string"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;;;;;AAEA,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAmB,OAA0B;AAAA,MAAvBC,SAAuB,QAAvBA,SAAuB;AAAA,MAAZC,KAAY,QAAZA,KAAY;;AACjD,kBAAwC,qBAAS,KAAT,CAAxC;AAAA;AAAA,MAAOC,YAAP;AAAA,MAAqBC,eAArB;;AACA,MAAMC,OAAO,GAAG,oBAAhB;AAEA,wBAAU,YAAM;AACd,QAAIA,OAAJ,aAAIA,OAAJ,eAAIA,OAAO,CAAEC,OAAb,EAAsB;AACpBF,MAAAA,eAAe,CACbC,OAAO,CAACC,OAAR,CAAgBC,WAAhB,GAA8BF,OAAO,CAACC,OAAR,CAAgBE,WAA9C,IACEH,OAAO,CAACC,OAAR,CAAgBG,YAAhB,GAA+BJ,OAAO,CAACC,OAAR,CAAgBI,YAFpC,CAAf;AAID;AACF,GAPD,EAOG,EAPH;AASA,sBACE,6BAAC,WAAD;AACE,IAAA,oBAAoB,EAAE,CAACP,YADzB;AAEE,IAAA,SAAS,EAAC,WAFZ;AAGE,IAAA,KAAK,eAAE,6BAAC,cAAD,QAAeD,KAAf;AAHT,kBAKE,6BAAC,cAAD;AAAc,IAAA,OAAO,EAAC,eAAtB;AAAsC,IAAA,SAAS,EAAC,MAAhD;AAAuD,IAAA,GAAG,EAAEG,OAA5D;AAAqE,IAAA,SAAS,EAAEJ;AAAhF,KACGC,KADH,CALF,CADF;AAWD,CAxBD;;AA0BA,wCAAAF,gBAAgB,CAACW,SAAjB,GAA6B;AAC3B;AACF;AACA;AACEV,EAAAA,SAAS,EAAEW,mBAAUC,MAJM;;AAK3B;AACF;AACA;AACEX,EAAAA,KAAK,EAAEU,mBAAUC;AARU,CAA7B;eAWeb,gB","sourcesContent":["import React, { useEffect, useRef, useState } from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport { HvTooltip, HvTypography } from \"..\";\n\nconst TitleWithTooltip = ({ className, title }) => {\n const [isOverflowed, setIsOverflowed] = useState(false);\n const textRef = useRef();\n\n useEffect(() => {\n if (textRef?.current) {\n setIsOverflowed(\n textRef.current.scrollWidth > textRef.current.clientWidth ||\n textRef.current.scrollHeight > textRef.current.clientHeight\n );\n }\n }, []);\n\n return (\n <HvTooltip\n disableHoverListener={!isOverflowed}\n placement=\"top-start\"\n title={<HvTypography>{title}</HvTypography>}\n >\n <HvTypography variant=\"highlightText\" component=\"span\" ref={textRef} className={className}>\n {title}\n </HvTypography>\n </HvTooltip>\n );\n};\n\nTitleWithTooltip.propTypes = {\n /**\n * Class names to be applied to the root element.\n */\n className: PropTypes.string,\n /**\n * Title to be displayed.\n */\n title: PropTypes.string,\n};\n\nexport default TitleWithTooltip;\n"],"file":"TitleWithTooltip.js"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports, "HvAppSwitcherAction", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return _Action.default;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
Object.defineProperty(exports, "default", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function get() {
|
|
17
|
+
return _AppSwitcher.default;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
var _AppSwitcher = _interopRequireDefault(require("./AppSwitcher"));
|
|
22
|
+
|
|
23
|
+
var _Action = _interopRequireDefault(require("./Action"));
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/AppSwitcher/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;AACA","sourcesContent":["export { default } from \"./AppSwitcher\";\nexport { default as HvAppSwitcherAction } from \"./Action\";\n"],"file":"index.js"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.keys.js");
|
|
4
|
+
|
|
5
|
+
require("core-js/modules/es.symbol.js");
|
|
6
|
+
|
|
7
|
+
require("core-js/modules/es.array.filter.js");
|
|
8
|
+
|
|
9
|
+
require("core-js/modules/es.object.to-string.js");
|
|
10
|
+
|
|
11
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
12
|
+
|
|
13
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
14
|
+
|
|
15
|
+
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
16
|
+
|
|
17
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
18
|
+
|
|
19
|
+
Object.defineProperty(exports, "__esModule", {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
exports.default = void 0;
|
|
23
|
+
|
|
24
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
|
+
|
|
26
|
+
require("core-js/modules/es.array.concat.js");
|
|
27
|
+
|
|
28
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
29
|
+
|
|
30
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
31
|
+
|
|
32
|
+
var styles = function styles(theme) {
|
|
33
|
+
return {
|
|
34
|
+
root: {
|
|
35
|
+
display: "flex",
|
|
36
|
+
flexDirection: "column",
|
|
37
|
+
overflow: "hidden",
|
|
38
|
+
// we need to play with the 4px because of the focus ring
|
|
39
|
+
padding: "".concat(theme.hv.spacing.sm - 4, "px 0 ").concat(theme.hv.spacing.sm - 4, "px ").concat(theme.hv.spacing.sm - 4, "px"),
|
|
40
|
+
backgroundColor: theme.hv.palette.atmosphere.atmo1
|
|
41
|
+
},
|
|
42
|
+
single: {
|
|
43
|
+
width: 320
|
|
44
|
+
},
|
|
45
|
+
dual: {
|
|
46
|
+
width: 620
|
|
47
|
+
},
|
|
48
|
+
fluid: {},
|
|
49
|
+
closed: {
|
|
50
|
+
display: "none"
|
|
51
|
+
},
|
|
52
|
+
open: {
|
|
53
|
+
zIndex: "1200",
|
|
54
|
+
position: "absolute",
|
|
55
|
+
top: "50px",
|
|
56
|
+
overflowX: "hidden",
|
|
57
|
+
boxShadow: theme.hv.shadows[1]
|
|
58
|
+
},
|
|
59
|
+
title: {
|
|
60
|
+
minHeight: 36,
|
|
61
|
+
// we need to play with the 4px because of the focus ring
|
|
62
|
+
padding: "4px ".concat(theme.hv.spacing.sm, "px ").concat(theme.hv.spacing.sm - 4, "px 4px"),
|
|
63
|
+
overflow: "hidden",
|
|
64
|
+
whiteSpace: "nowrap",
|
|
65
|
+
textOverflow: "ellipsis"
|
|
66
|
+
},
|
|
67
|
+
actionsContainer: {
|
|
68
|
+
display: "flex",
|
|
69
|
+
flexWrap: "wrap",
|
|
70
|
+
justifyContent: "flex-start",
|
|
71
|
+
overflowY: "auto",
|
|
72
|
+
// we need to play with the 4px because of the focus ring
|
|
73
|
+
padding: "4px 0 4px 4px"
|
|
74
|
+
},
|
|
75
|
+
footerContainer: _objectSpread({
|
|
76
|
+
display: "flex",
|
|
77
|
+
alignItems: "center",
|
|
78
|
+
marginTop: "auto",
|
|
79
|
+
height: 52,
|
|
80
|
+
// we need to play with the 4px because of the focus ring
|
|
81
|
+
padding: "".concat(theme.hv.spacing.sm - 4, "px ").concat(theme.hv.spacing.sm + 4, "px 4px 4px")
|
|
82
|
+
}, theme.hv.typography.highlightText),
|
|
83
|
+
item: {},
|
|
84
|
+
itemSelected: {},
|
|
85
|
+
itemDisabled: {},
|
|
86
|
+
itemTypography: {},
|
|
87
|
+
itemIcon: {},
|
|
88
|
+
itemTitle: {},
|
|
89
|
+
itemInfo: {}
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
var _default = styles;
|
|
94
|
+
exports.default = _default;
|
|
95
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/AppSwitcher/styles.js"],"names":["styles","theme","root","display","flexDirection","overflow","padding","hv","spacing","sm","backgroundColor","palette","atmosphere","atmo1","single","width","dual","fluid","closed","open","zIndex","position","top","overflowX","boxShadow","shadows","title","minHeight","whiteSpace","textOverflow","actionsContainer","flexWrap","justifyContent","overflowY","footerContainer","alignItems","marginTop","height","typography","highlightText","item","itemSelected","itemDisabled","itemTypography","itemIcon","itemTitle","itemInfo"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AACzBC,IAAAA,IAAI,EAAE;AACJC,MAAAA,OAAO,EAAE,MADL;AAEJC,MAAAA,aAAa,EAAE,QAFX;AAIJC,MAAAA,QAAQ,EAAE,QAJN;AAMJ;AACAC,MAAAA,OAAO,YAAKL,KAAK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C,MAAAA,SAAS,EAAE,MALK;AAOhB;AACA3B,MAAAA,OAAO,EAAE;AARO,KA7CO;AAwDzB4B,IAAAA,eAAe;AACb/B,MAAAA,OAAO,EAAE,MADI;AAEbgC,MAAAA,UAAU,EAAE,QAFC;AAIbC,MAAAA,SAAS,EAAE,MAJE;AAMbC,MAAAA,MAAM,EAAE,EANK;AAQb;AACA/B,MAAAA,OAAO,YAAKL,KAAK,CAACM,EAAN,CAASC,OAAT,CAAiBC,EAAjB,GAAsB,CAA3B,gBAAkCR,KAAK,CAACM,EAAN,CAASC,OAAT,CAAiBC,EAAjB,GAAsB,CAAxD;AATM,OAWVR,KAAK,CAACM,EAAN,CAAS+B,UAAT,CAAoBC,aAXV,CAxDU;AAsEzBC,IAAAA,IAAI,EAAE,EAtEmB;AAuEzBC,IAAAA,YAAY,EAAE,EAvEW;AAwEzBC,IAAAA,YAAY,EAAE,EAxEW;AAyEzBC,IAAAA,cAAc,EAAE,EAzES;AA0EzBC,IAAAA,QAAQ,EAAE,EA1Ee;AA2EzBC,IAAAA,SAAS,EAAE,EA3Ec;AA4EzBC,IAAAA,QAAQ,EAAE;AA5Ee,GAAZ;AAAA,CAAf;;eA+Ee9C,M","sourcesContent":["const styles = (theme) => ({\n root: {\n display: \"flex\",\n flexDirection: \"column\",\n\n overflow: \"hidden\",\n\n // we need to play with the 4px because of the focus ring\n padding: `${theme.hv.spacing.sm - 4}px 0 ${theme.hv.spacing.sm - 4}px ${\n theme.hv.spacing.sm - 4\n }px`,\n\n backgroundColor: theme.hv.palette.atmosphere.atmo1,\n },\n\n single: {\n width: 320,\n },\n dual: {\n width: 620,\n },\n fluid: {},\n\n closed: {\n display: \"none\",\n },\n open: {\n zIndex: \"1200\",\n position: \"absolute\",\n top: \"50px\",\n overflowX: \"hidden\",\n boxShadow: theme.hv.shadows[1],\n },\n\n title: {\n minHeight: 36,\n\n // we need to play with the 4px because of the focus ring\n padding: `4px ${theme.hv.spacing.sm}px ${theme.hv.spacing.sm - 4}px 4px`,\n\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n textOverflow: \"ellipsis\",\n },\n\n actionsContainer: {\n display: \"flex\",\n flexWrap: \"wrap\",\n justifyContent: \"flex-start\",\n\n overflowY: \"auto\",\n\n // we need to play with the 4px because of the focus ring\n padding: \"4px 0 4px 4px\",\n },\n\n footerContainer: {\n display: \"flex\",\n alignItems: \"center\",\n\n marginTop: \"auto\",\n\n height: 52,\n\n // we need to play with the 4px because of the focus ring\n padding: `${theme.hv.spacing.sm - 4}px ${theme.hv.spacing.sm + 4}px 4px 4px`,\n\n ...theme.hv.typography.highlightText,\n },\n\n item: {},\n itemSelected: {},\n itemDisabled: {},\n itemTypography: {},\n itemIcon: {},\n itemTitle: {},\n itemInfo: {},\n});\n\nexport default styles;\n"],"file":"styles.js"}
|
package/dist/Avatar/Avatar.d.ts
CHANGED
|
@@ -76,6 +76,10 @@ export interface HvAvatarProps
|
|
|
76
76
|
* A string representing the color of the avatar badge.
|
|
77
77
|
*/
|
|
78
78
|
badge?: "sema0" | HvSemanticColorKeys | HvAtmosphereColorKeys;
|
|
79
|
+
/**
|
|
80
|
+
* Attributes applied to the container element.
|
|
81
|
+
*/
|
|
82
|
+
containerProps: object;
|
|
79
83
|
}
|
|
80
84
|
|
|
81
85
|
export default function HvAvatar(props: HvAvatarProps): JSX.Element | null;
|
package/dist/Avatar/Avatar.js
CHANGED
|
@@ -43,7 +43,7 @@ var _utils = require("../utils");
|
|
|
43
43
|
|
|
44
44
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
45
45
|
|
|
46
|
-
var _excluded = ["className", "style", "classes", "children", "component", "size", "backgroundColor", "color", "src", "srcSet", "sizes", "alt", "imgProps", "status", "badge", "variant"];
|
|
46
|
+
var _excluded = ["className", "style", "classes", "children", "component", "size", "backgroundColor", "color", "src", "srcSet", "sizes", "alt", "imgProps", "status", "badge", "variant", "containerProps"];
|
|
47
47
|
|
|
48
48
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
49
49
|
|
|
@@ -104,6 +104,7 @@ var HvAvatar = function HvAvatar(props) {
|
|
|
104
104
|
badge = props.badge,
|
|
105
105
|
_props$variant = props.variant,
|
|
106
106
|
variant = _props$variant === void 0 ? "circular" : _props$variant,
|
|
107
|
+
containerProps = props.containerProps,
|
|
107
108
|
others = (0, _objectWithoutProperties2.default)(props, _excluded); // S, M and L are now deprecated, this intends to normalize the size to the new norm of XS, SM, MD, LG and XL
|
|
108
109
|
|
|
109
110
|
var normalizedSize = normalizeSize(size);
|
|
@@ -159,12 +160,17 @@ var HvAvatar = function HvAvatar(props) {
|
|
|
159
160
|
}
|
|
160
161
|
|
|
161
162
|
var badgeColor = getColor(theme, badge, theme.hv.palette.semantic.sema1);
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
163
|
+
/**
|
|
164
|
+
* Note: on the next major release this should be updated. the `others` prop should be
|
|
165
|
+
* used in the container instead of the `containerProps` and a new `avatarProps`
|
|
166
|
+
* should be created to pass on any props down to the avatar component. This wasn't
|
|
167
|
+
* done now in order to not break the current API. Also, consider using the `root` class
|
|
168
|
+
* on the container element as it makes more semantic sense.
|
|
169
|
+
*/
|
|
170
|
+
|
|
171
|
+
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
|
|
172
|
+
className: classes.container
|
|
173
|
+
}, containerProps), /*#__PURE__*/_react.default.createElement("div", {
|
|
168
174
|
className: (0, _clsx.default)(classes.status, classes[variant], classes[normalizedSize]),
|
|
169
175
|
style: statusInlineStyle
|
|
170
176
|
}, badge && /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -332,7 +338,12 @@ process.env.NODE_ENV !== "production" ? HvAvatar.propTypes = {
|
|
|
332
338
|
/**
|
|
333
339
|
* A string representing the color of the avatar badge.
|
|
334
340
|
*/
|
|
335
|
-
badge: _propTypes.default.string
|
|
341
|
+
badge: _propTypes.default.string,
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Attributes applied to the container element.
|
|
345
|
+
*/
|
|
346
|
+
containerProps: _propTypes.default.instanceOf(Object)
|
|
336
347
|
} : void 0;
|
|
337
348
|
|
|
338
349
|
var _default = (0, _core.withStyles)(_styles.default, {
|