@learningpool/ui 1.7.9 → 1.8.1

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.
@@ -5,8 +5,8 @@ var DEFAULT_COLOR_ADJUST_AMOUNT = 0.1;
5
5
  * @returns string
6
6
  */
7
7
  export var getNavigationBackground = function (theme) {
8
- var _a;
9
- return (_a = theme.palette.navigation.background) !== null && _a !== void 0 ? _a : theme.palette.background.paper;
8
+ var _a, _b;
9
+ return (_b = (_a = theme.palette.navigation) === null || _a === void 0 ? void 0 : _a.background) !== null && _b !== void 0 ? _b : theme.palette.background.paper;
10
10
  };
11
11
  /**
12
12
  * Returns the contrast color for the navigation
@@ -9,6 +9,17 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
12
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
24
  import { defaultMessages } from '../../../lang/en-us';
14
25
  import AppHubItem from './AppHubProduct';
@@ -29,8 +40,8 @@ var AppHub = function (props) {
29
40
  , __assign({
30
41
  // @ts-ignore
31
42
  component: isPageLayout ? 'h2' : 'div' }, { children: title })), _jsx(Grid, __assign({ container: true, spacing: { xs: 2, md: 3 }, rowSpacing: { xs: 3, md: 4 }, columns: { xs: 12 } }, { children: items.map(function (_a, index) {
32
- var subtitle = _a.subtitle, shortName = _a.shortName, internalName = _a.internalName, url = _a.url, children = _a.children;
33
- return (_jsxs(Grid, __assign({ xs: 12, sm: 6, md: 4 }, { children: [url && (_jsx(AppHubItem, { internalName: internalName, shortName: shortName, subtitle: subtitle, url: url })), children && (_jsx(AppHubItem, { internalName: internalName, shortName: shortName, subtitle: subtitle, options: children }))] }), "".concat(shortName, "_").concat(rowIndex, "_").concat(index)));
43
+ var subtitle = _a.subtitle, shortName = _a.shortName, internalName = _a.internalName, url = _a.url, children = _a.children, rest = __rest(_a, ["subtitle", "shortName", "internalName", "url", "children"]);
44
+ return (_jsxs(Grid, __assign({ xs: 12, sm: 6, md: 4 }, { children: [url && (_jsx(AppHubItem, __assign({ internalName: internalName, shortName: shortName, subtitle: subtitle, url: url }, rest))), children && (_jsx(AppHubItem, { internalName: internalName, shortName: shortName, subtitle: subtitle, options: children }))] }), "".concat(shortName, "_").concat(rowIndex, "_").concat(index)));
34
45
  }) }))] }, "row_".concat(rowIndex)));
35
46
  }
36
47
  case Constants.DataRowType.CustomLink: {
@@ -9,6 +9,17 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
12
23
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
24
  import { ListItemButton, Link, TextField, Tooltip } from '../../../index';
14
25
  import LaunchIcon from '@mui/icons-material/Launch';
@@ -37,7 +48,7 @@ var renderApplicationLogo = function (internalName, logoVariant) {
37
48
  return (_jsx("img", { src: urlToIcon, width: "90", height: "90", alt: internalName !== null && internalName !== void 0 ? internalName : '' }));
38
49
  };
39
50
  var AppHubItem = function (props) {
40
- var internalName = props.internalName, shortName = props.shortName, customName = props.customName, url = props.url, subtitle = props.subtitle, localization = props.localization, options = props.options;
51
+ var internalName = props.internalName, shortName = props.shortName, customName = props.customName, url = props.url, subtitle = props.subtitle, localization = props.localization, options = props.options, rest = __rest(props, ["internalName", "shortName", "customName", "url", "subtitle", "localization", "options"]);
41
52
  var initialOptions = __assign({}, options);
42
53
  var solidLogo = renderApplicationLogo(internalName, LogoVariants.Solid);
43
54
  var messages = __assign(__assign({}, defaultMessages), localization);
@@ -51,7 +62,7 @@ var AppHubItem = function (props) {
51
62
  // @ts-ignore
52
63
  component: 'div', className: 'appHubCardTitle' }, { children: customName !== null && customName !== void 0 ? customName : shortName })) })), url && (_jsxs(StyledButton, __assign({ href: url,
53
64
  // @ts-expect-error
54
- component: Link, target: '_blank', variant: 'outlined' }, { children: [messages.open, _jsxs("span", __assign({ style: visuallyHidden }, { children: [", ", messages['open-in-new-window']] }))] }))), options && options.length > 0 && (_jsx(StyledAutocomplete, { disablePortal: true, size: 'small', options: options.map(function (option) { return option.applicationName; }),
65
+ component: Link, target: '_blank', variant: 'outlined' }, rest, { children: [messages.open, _jsxs("span", __assign({ style: visuallyHidden }, { children: [", ", messages['open-in-new-window']] }))] }))), options && options.length > 0 && (_jsx(StyledAutocomplete, { disablePortal: true, size: 'small', options: options.map(function (option) { return option.applicationName; }),
55
66
  // TODO: Add link, icon and screen reader text here:
56
67
  renderOption: function (option) {
57
68
  // Autocomplete only uses applicationName and we need more properties
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "components",
10
10
  "ui"
11
11
  ],
12
- "version": "1.7.9",
12
+ "version": "1.8.1",
13
13
  "private": false,
14
14
  "main": "index.js",
15
15
  "module": "index.js",