@telia-ace/widget-ui 1.0.8 → 1.0.11
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/LICENSE.txt +5 -5
- package/README.md +3 -3
- package/{lib-esm → dist}/components/anchor-link.d.ts +4 -4
- package/{lib → dist}/components/button.d.ts +4 -4
- package/{lib-esm → dist}/components/checkbox.d.ts +7 -7
- package/{lib-esm → dist}/components/drawer/drawer.d.ts +21 -21
- package/{lib-esm → dist}/components/drawer/index.d.ts +3 -3
- package/{lib-esm → dist}/components/dropdown/dropdown.d.ts +9 -9
- package/{lib → dist}/components/dropdown/index.d.ts +4 -4
- package/{lib-esm → dist}/components/dropdown/use-position.d.ts +5 -5
- package/{lib → dist}/components/empty.d.ts +4 -4
- package/{lib → dist}/components/grid.d.ts +7 -7
- package/{lib-esm → dist}/components/html.d.ts +12 -12
- package/{lib → dist}/components/icon.d.ts +7 -7
- package/{lib-esm → dist}/components/index.d.ts +58 -58
- package/{lib-esm → dist}/components/input.d.ts +10 -10
- package/{lib → dist}/components/item-list.d.ts +10 -10
- package/{lib → dist}/components/item-tree.d.ts +13 -13
- package/{lib-esm → dist}/components/lightbox.d.ts +6 -6
- package/{lib-esm → dist}/components/link.d.ts +11 -11
- package/{lib-esm → dist}/components/list.d.ts +9 -9
- package/{lib-esm → dist}/components/modal/confirm.d.ts +12 -12
- package/{lib → dist}/components/modal/index.d.ts +4 -4
- package/{lib-esm → dist}/components/modal/modal.d.ts +10 -10
- package/{lib → dist}/components/not-found.d.ts +9 -9
- package/{lib → dist}/components/overlay.d.ts +8 -8
- package/{lib-esm → dist}/components/paragraph.d.ts +11 -11
- package/{lib → dist}/components/portal.d.ts +7 -7
- package/{lib-esm → dist}/components/route-link.d.ts +11 -11
- package/{lib → dist}/components/symbol-badge.d.ts +15 -15
- package/{lib-esm → dist}/components/tab-stop.d.ts +18 -18
- package/{lib-esm → dist}/components/text-link.d.ts +8 -8
- package/{lib-esm → dist}/components/text.d.ts +4 -4
- package/{lib-esm → dist}/components/timestamp.d.ts +13 -13
- package/{lib-esm → dist}/components/tooltip.d.ts +8 -8
- package/{lib-esm → dist}/components/transition-component.d.ts +30 -30
- package/{lib → dist}/components/typography.d.ts +9 -9
- package/{lib → dist}/components/widget-link.d.ts +10 -10
- package/{lib → dist}/contexts/index.d.ts +9 -9
- package/{lib-esm → dist}/create-react-component.d.ts +11 -11
- package/{lib-esm → dist}/hooks/index.d.ts +27 -27
- package/{lib → dist}/hooks/use-action.d.ts +4 -4
- package/{lib-esm → dist}/hooks/use-children.d.ts +4 -4
- package/{lib-esm → dist}/hooks/use-columns.d.ts +2 -2
- package/{lib-esm → dist}/hooks/use-component-descriptor.d.ts +2 -2
- package/{lib-esm → dist}/hooks/use-component-node.d.ts +6 -6
- package/{lib → dist}/hooks/use-component-platform.d.ts +4 -4
- package/{lib → dist}/hooks/use-component.d.ts +3 -3
- package/{lib-esm → dist}/hooks/use-container.d.ts +2 -2
- package/{lib-esm → dist}/hooks/use-context.d.ts +3 -3
- package/{lib-esm → dist}/hooks/use-dispatch.d.ts +3 -3
- package/{lib-esm → dist}/hooks/use-event-listener.d.ts +2 -2
- package/{lib-esm → dist}/hooks/use-events.d.ts +3 -3
- package/{lib-esm → dist}/hooks/use-is-mounted.d.ts +3 -3
- package/{lib-esm → dist}/hooks/use-key-press.d.ts +2 -2
- package/{lib-esm → dist}/hooks/use-layout.d.ts +3 -3
- package/{lib-esm → dist}/hooks/use-previous.d.ts +2 -2
- package/{lib-esm → dist}/hooks/use-properties.d.ts +6 -6
- package/{lib-esm → dist}/hooks/use-render-state.d.ts +4 -4
- package/{lib → dist}/hooks/use-route-data.d.ts +4 -4
- package/{lib-esm → dist}/hooks/use-router.d.ts +3 -3
- package/{lib → dist}/hooks/use-scroll.d.ts +2 -2
- package/{lib-esm → dist}/hooks/use-settings.d.ts +3 -3
- package/{lib-esm → dist}/hooks/use-toggle.d.ts +2 -2
- package/{lib → dist}/hooks/use-transition-end.d.ts +2 -2
- package/{lib-esm → dist}/hooks/use-unique-menu.d.ts +2 -2
- package/{lib-esm → dist}/hooks/use-widget-event.d.ts +3 -3
- package/{lib-esm → dist}/index.d.ts +9 -9
- package/dist/index.js +2988 -0
- package/dist/index.js.map +1 -0
- package/{lib-esm → dist}/styles.d.ts +19 -19
- package/{lib-esm → dist}/utils/animations.d.ts +18 -18
- package/{lib → dist}/utils/browser.d.ts +12 -12
- package/{lib-esm → dist}/utils/convert-to-string-attributes.d.ts +2 -2
- package/{lib → dist}/utils/create-empty-component.d.ts +3 -3
- package/{lib → dist}/utils/embedded-link-mapper.d.ts +3 -3
- package/{lib-esm → dist}/utils/filter-css-props.d.ts +8 -8
- package/{lib → dist}/utils/generic-hash-link.d.ts +8 -8
- package/{lib-esm → dist}/utils/heading-styles.d.ts +1 -1
- package/{lib-esm → dist}/utils/index.d.ts +12 -12
- package/{lib → dist}/utils/process-html-string.d.ts +4 -4
- package/{lib-esm → dist}/utils/render-instructions.d.ts +8 -8
- package/package.json +11 -12
- package/lib/components/anchor-link.d.ts +0 -4
- package/lib/components/anchor-link.js +0 -7
- package/lib/components/button.js +0 -64
- package/lib/components/checkbox.d.ts +0 -7
- package/lib/components/checkbox.js +0 -39
- package/lib/components/drawer/drawer.d.ts +0 -21
- package/lib/components/drawer/drawer.js +0 -150
- package/lib/components/drawer/index.d.ts +0 -3
- package/lib/components/drawer/index.js +0 -29
- package/lib/components/dropdown/dropdown.d.ts +0 -9
- package/lib/components/dropdown/dropdown.js +0 -155
- package/lib/components/dropdown/index.js +0 -10
- package/lib/components/dropdown/use-position.d.ts +0 -5
- package/lib/components/dropdown/use-position.js +0 -57
- package/lib/components/empty.js +0 -40
- package/lib/components/grid.js +0 -64
- package/lib/components/html.d.ts +0 -12
- package/lib/components/html.js +0 -78
- package/lib/components/icon.js +0 -35
- package/lib/components/index.d.ts +0 -58
- package/lib/components/index.js +0 -69
- package/lib/components/input.d.ts +0 -10
- package/lib/components/input.js +0 -94
- package/lib/components/item-list.js +0 -62
- package/lib/components/item-tree.js +0 -55
- package/lib/components/lightbox.d.ts +0 -6
- package/lib/components/lightbox.js +0 -92
- package/lib/components/link.d.ts +0 -11
- package/lib/components/link.js +0 -99
- package/lib/components/list.d.ts +0 -9
- package/lib/components/list.js +0 -56
- package/lib/components/modal/confirm.d.ts +0 -12
- package/lib/components/modal/confirm.js +0 -61
- package/lib/components/modal/index.js +0 -10
- package/lib/components/modal/modal.d.ts +0 -10
- package/lib/components/modal/modal.js +0 -127
- package/lib/components/not-found.js +0 -55
- package/lib/components/overlay.js +0 -73
- package/lib/components/paragraph.d.ts +0 -11
- package/lib/components/paragraph.js +0 -66
- package/lib/components/portal.js +0 -61
- package/lib/components/route-link.d.ts +0 -11
- package/lib/components/route-link.js +0 -115
- package/lib/components/symbol-badge.js +0 -205
- package/lib/components/tab-stop.d.ts +0 -18
- package/lib/components/tab-stop.js +0 -100
- package/lib/components/text-link.d.ts +0 -8
- package/lib/components/text-link.js +0 -62
- package/lib/components/text.d.ts +0 -4
- package/lib/components/text.js +0 -35
- package/lib/components/timestamp.d.ts +0 -13
- package/lib/components/timestamp.js +0 -39
- package/lib/components/tooltip.d.ts +0 -8
- package/lib/components/tooltip.js +0 -127
- package/lib/components/transition-component.d.ts +0 -30
- package/lib/components/transition-component.js +0 -77
- package/lib/components/typography.js +0 -43
- package/lib/components/widget-link.js +0 -116
- package/lib/contexts/index.js +0 -15
- package/lib/create-react-component.d.ts +0 -11
- package/lib/create-react-component.js +0 -18
- package/lib/hooks/index.d.ts +0 -27
- package/lib/hooks/index.js +0 -58
- package/lib/hooks/use-action.js +0 -21
- package/lib/hooks/use-children.d.ts +0 -4
- package/lib/hooks/use-children.js +0 -70
- package/lib/hooks/use-columns.d.ts +0 -2
- package/lib/hooks/use-columns.js +0 -6
- package/lib/hooks/use-component-descriptor.d.ts +0 -2
- package/lib/hooks/use-component-descriptor.js +0 -6
- package/lib/hooks/use-component-node.d.ts +0 -6
- package/lib/hooks/use-component-node.js +0 -37
- package/lib/hooks/use-component-platform.js +0 -39
- package/lib/hooks/use-component.js +0 -57
- package/lib/hooks/use-container.d.ts +0 -2
- package/lib/hooks/use-container.js +0 -6
- package/lib/hooks/use-context.d.ts +0 -3
- package/lib/hooks/use-context.js +0 -50
- package/lib/hooks/use-dispatch.d.ts +0 -3
- package/lib/hooks/use-dispatch.js +0 -64
- package/lib/hooks/use-event-listener.d.ts +0 -2
- package/lib/hooks/use-event-listener.js +0 -21
- package/lib/hooks/use-events.d.ts +0 -3
- package/lib/hooks/use-events.js +0 -12
- package/lib/hooks/use-is-mounted.d.ts +0 -3
- package/lib/hooks/use-is-mounted.js +0 -14
- package/lib/hooks/use-key-press.d.ts +0 -2
- package/lib/hooks/use-key-press.js +0 -46
- package/lib/hooks/use-layout.d.ts +0 -3
- package/lib/hooks/use-layout.js +0 -50
- package/lib/hooks/use-previous.d.ts +0 -2
- package/lib/hooks/use-previous.js +0 -11
- package/lib/hooks/use-properties.d.ts +0 -6
- package/lib/hooks/use-properties.js +0 -9
- package/lib/hooks/use-render-state.d.ts +0 -4
- package/lib/hooks/use-render-state.js +0 -70
- package/lib/hooks/use-route-data.js +0 -58
- package/lib/hooks/use-router.d.ts +0 -3
- package/lib/hooks/use-router.js +0 -9
- package/lib/hooks/use-scroll.js +0 -71
- package/lib/hooks/use-settings.d.ts +0 -3
- package/lib/hooks/use-settings.js +0 -38
- package/lib/hooks/use-toggle.d.ts +0 -2
- package/lib/hooks/use-toggle.js +0 -28
- package/lib/hooks/use-transition-end.js +0 -62
- package/lib/hooks/use-unique-menu.d.ts +0 -2
- package/lib/hooks/use-unique-menu.js +0 -15
- package/lib/hooks/use-widget-event.d.ts +0 -3
- package/lib/hooks/use-widget-event.js +0 -21
- package/lib/index.d.ts +0 -9
- package/lib/index.js +0 -98
- package/lib/styles.d.ts +0 -19
- package/lib/styles.js +0 -53
- package/lib/utils/animations.d.ts +0 -18
- package/lib/utils/animations.js +0 -104
- package/lib/utils/browser.js +0 -54
- package/lib/utils/convert-to-string-attributes.d.ts +0 -2
- package/lib/utils/convert-to-string-attributes.js +0 -23
- package/lib/utils/create-empty-component.js +0 -25
- package/lib/utils/embedded-link-mapper.js +0 -62
- package/lib/utils/filter-css-props.d.ts +0 -8
- package/lib/utils/filter-css-props.js +0 -28
- package/lib/utils/generic-hash-link.js +0 -70
- package/lib/utils/heading-styles.d.ts +0 -1
- package/lib/utils/heading-styles.js +0 -48
- package/lib/utils/index.d.ts +0 -12
- package/lib/utils/index.js +0 -28
- package/lib/utils/process-html-string.js +0 -16
- package/lib/utils/render-instructions.d.ts +0 -8
- package/lib/utils/render-instructions.js +0 -19
- package/lib-esm/components/anchor-link.js +0 -5
- package/lib-esm/components/button.d.ts +0 -4
- package/lib-esm/components/button.js +0 -36
- package/lib-esm/components/checkbox.js +0 -34
- package/lib-esm/components/drawer/drawer.js +0 -121
- package/lib-esm/components/drawer/index.js +0 -3
- package/lib-esm/components/dropdown/dropdown.js +0 -127
- package/lib-esm/components/dropdown/index.d.ts +0 -4
- package/lib-esm/components/dropdown/index.js +0 -3
- package/lib-esm/components/dropdown/use-position.js +0 -53
- package/lib-esm/components/empty.d.ts +0 -4
- package/lib-esm/components/empty.js +0 -35
- package/lib-esm/components/grid.d.ts +0 -7
- package/lib-esm/components/grid.js +0 -36
- package/lib-esm/components/html.js +0 -53
- package/lib-esm/components/icon.d.ts +0 -7
- package/lib-esm/components/icon.js +0 -30
- package/lib-esm/components/index.js +0 -30
- package/lib-esm/components/input.js +0 -69
- package/lib-esm/components/item-list.d.ts +0 -10
- package/lib-esm/components/item-list.js +0 -34
- package/lib-esm/components/item-tree.d.ts +0 -13
- package/lib-esm/components/item-tree.js +0 -50
- package/lib-esm/components/lightbox.js +0 -64
- package/lib-esm/components/link.js +0 -71
- package/lib-esm/components/list.js +0 -31
- package/lib-esm/components/modal/confirm.js +0 -33
- package/lib-esm/components/modal/index.d.ts +0 -4
- package/lib-esm/components/modal/index.js +0 -3
- package/lib-esm/components/modal/modal.js +0 -99
- package/lib-esm/components/not-found.d.ts +0 -9
- package/lib-esm/components/not-found.js +0 -27
- package/lib-esm/components/overlay.d.ts +0 -8
- package/lib-esm/components/overlay.js +0 -45
- package/lib-esm/components/paragraph.js +0 -38
- package/lib-esm/components/portal.d.ts +0 -7
- package/lib-esm/components/portal.js +0 -36
- package/lib-esm/components/route-link.js +0 -90
- package/lib-esm/components/symbol-badge.d.ts +0 -15
- package/lib-esm/components/symbol-badge.js +0 -200
- package/lib-esm/components/tab-stop.js +0 -75
- package/lib-esm/components/text-link.js +0 -34
- package/lib-esm/components/text.js +0 -30
- package/lib-esm/components/timestamp.js +0 -33
- package/lib-esm/components/tooltip.js +0 -99
- package/lib-esm/components/transition-component.js +0 -72
- package/lib-esm/components/typography.d.ts +0 -9
- package/lib-esm/components/typography.js +0 -38
- package/lib-esm/components/widget-link.d.ts +0 -10
- package/lib-esm/components/widget-link.js +0 -88
- package/lib-esm/contexts/index.d.ts +0 -9
- package/lib-esm/contexts/index.js +0 -12
- package/lib-esm/create-react-component.js +0 -16
- package/lib-esm/hooks/index.js +0 -26
- package/lib-esm/hooks/use-action.d.ts +0 -4
- package/lib-esm/hooks/use-action.js +0 -14
- package/lib-esm/hooks/use-children.js +0 -65
- package/lib-esm/hooks/use-columns.js +0 -4
- package/lib-esm/hooks/use-component-descriptor.js +0 -4
- package/lib-esm/hooks/use-component-node.js +0 -35
- package/lib-esm/hooks/use-component-platform.d.ts +0 -4
- package/lib-esm/hooks/use-component-platform.js +0 -34
- package/lib-esm/hooks/use-component.d.ts +0 -3
- package/lib-esm/hooks/use-component.js +0 -52
- package/lib-esm/hooks/use-container.js +0 -4
- package/lib-esm/hooks/use-context.js +0 -45
- package/lib-esm/hooks/use-dispatch.js +0 -59
- package/lib-esm/hooks/use-event-listener.js +0 -19
- package/lib-esm/hooks/use-events.js +0 -7
- package/lib-esm/hooks/use-is-mounted.js +0 -12
- package/lib-esm/hooks/use-key-press.js +0 -41
- package/lib-esm/hooks/use-layout.js +0 -45
- package/lib-esm/hooks/use-previous.js +0 -9
- package/lib-esm/hooks/use-properties.js +0 -7
- package/lib-esm/hooks/use-render-state.js +0 -65
- package/lib-esm/hooks/use-route-data.d.ts +0 -4
- package/lib-esm/hooks/use-route-data.js +0 -53
- package/lib-esm/hooks/use-router.js +0 -7
- package/lib-esm/hooks/use-scroll.d.ts +0 -2
- package/lib-esm/hooks/use-scroll.js +0 -66
- package/lib-esm/hooks/use-settings.js +0 -33
- package/lib-esm/hooks/use-toggle.js +0 -26
- package/lib-esm/hooks/use-transition-end.d.ts +0 -2
- package/lib-esm/hooks/use-transition-end.js +0 -60
- package/lib-esm/hooks/use-unique-menu.js +0 -10
- package/lib-esm/hooks/use-widget-event.js +0 -16
- package/lib-esm/index.js +0 -7
- package/lib-esm/styles.js +0 -26
- package/lib-esm/utils/animations.js +0 -101
- package/lib-esm/utils/browser.d.ts +0 -12
- package/lib-esm/utils/browser.js +0 -51
- package/lib-esm/utils/convert-to-string-attributes.js +0 -21
- package/lib-esm/utils/create-empty-component.d.ts +0 -3
- package/lib-esm/utils/create-empty-component.js +0 -20
- package/lib-esm/utils/embedded-link-mapper.d.ts +0 -3
- package/lib-esm/utils/embedded-link-mapper.js +0 -57
- package/lib-esm/utils/filter-css-props.js +0 -25
- package/lib-esm/utils/generic-hash-link.d.ts +0 -8
- package/lib-esm/utils/generic-hash-link.js +0 -63
- package/lib-esm/utils/heading-styles.js +0 -44
- package/lib-esm/utils/index.js +0 -10
- package/lib-esm/utils/process-html-string.d.ts +0 -4
- package/lib-esm/utils/process-html-string.js +0 -10
- package/lib-esm/utils/render-instructions.js +0 -12
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
var __assign = (this && this.__assign) || function () {
|
|
6
|
-
__assign = Object.assign || function(t) {
|
|
7
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
-
s = arguments[i];
|
|
9
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
-
t[p] = s[p];
|
|
11
|
-
}
|
|
12
|
-
return t;
|
|
13
|
-
};
|
|
14
|
-
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
|
-
var t = {};
|
|
18
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
19
|
-
t[p] = s[p];
|
|
20
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
21
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
23
|
-
t[p[i]] = s[p[i]];
|
|
24
|
-
}
|
|
25
|
-
return t;
|
|
26
|
-
};
|
|
27
|
-
import { appendClassNames } from '@telia-ace/widget-utilities';
|
|
28
|
-
import React, { forwardRef } from 'react';
|
|
29
|
-
import styled from 'styled-components';
|
|
30
|
-
import { convertToStringAttributes } from '../utils';
|
|
31
|
-
import RouteLink from './route-link';
|
|
32
|
-
export default forwardRef(function (_a, ref) {
|
|
33
|
-
var className = _a.className, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.role, role = _c === void 0 ? 'link' : _c, _d = _a.tabIndex, tabIndex = _d === void 0 ? 0 : _d, _e = _a.onClick, onClick = _e === void 0 ? function () { } : _e, _f = _a.onKeyDown, onKeyDown = _f === void 0 ? function () { } : _f, title = _a.title, href = _a.href, children = _a.children, target = _a.target, routeName = _a.routeName, params = _a.params, other = __rest(_a, ["className", "disabled", "role", "tabIndex", "onClick", "onKeyDown", "title", "href", "children", "target", "routeName", "params"]);
|
|
34
|
-
var props = {
|
|
35
|
-
title: title,
|
|
36
|
-
disabled: disabled,
|
|
37
|
-
role: role,
|
|
38
|
-
tabIndex: tabIndex,
|
|
39
|
-
className: appendClassNames(className, 'humany-link', [!!disabled, 'humany-disabled']),
|
|
40
|
-
onClick: function (e) {
|
|
41
|
-
e.persist();
|
|
42
|
-
if (disabled) {
|
|
43
|
-
e.preventDefault();
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
onClick(e);
|
|
47
|
-
},
|
|
48
|
-
onKeyDown: function (e) {
|
|
49
|
-
e.persist();
|
|
50
|
-
if (disabled) {
|
|
51
|
-
if (e.key !== 'Tab') {
|
|
52
|
-
e.preventDefault();
|
|
53
|
-
}
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
onKeyDown(e);
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
return routeName ? (React.createElement(StyledRouteLink, __assign({ name: routeName, params: params }, props, convertToStringAttributes(other), { ref: ref }), children)) : (React.createElement(StyledLink, __assign({ href: href, target: target }, props, convertToStringAttributes(other), { ref: ref }), children));
|
|
60
|
-
});
|
|
61
|
-
var StyledRouteLink = styled(RouteLink)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (p) {
|
|
62
|
-
return p.disabled
|
|
63
|
-
? "\n pointer-events: none;\n opacity: .7;\n "
|
|
64
|
-
: 'cursor: pointer;';
|
|
65
|
-
});
|
|
66
|
-
var StyledLink = styled.a(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (p) {
|
|
67
|
-
return p.disabled
|
|
68
|
-
? "\n pointer-events: none;\n opacity: .7;\n "
|
|
69
|
-
: 'cursor: pointer;';
|
|
70
|
-
});
|
|
71
|
-
var templateObject_1, templateObject_2;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
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
|
-
};
|
|
23
|
-
import { appendClassNames } from '@telia-ace/widget-utilities';
|
|
24
|
-
import React, { forwardRef } from 'react';
|
|
25
|
-
import { convertToStringAttributes } from '../utils';
|
|
26
|
-
export default forwardRef(function (_a, ref) {
|
|
27
|
-
var className = _a.className, items = _a.items, renderItem = _a.renderItem, _b = _a.renderLi, renderLi = _b === void 0 ? false : _b, other = __rest(_a, ["className", "items", "renderItem", "renderLi"]);
|
|
28
|
-
return (React.createElement("ul", __assign({ className: appendClassNames(className, 'humany-list'), "data-item-count": items.length }, convertToStringAttributes(other), { ref: ref }), items.map(function (item, index, items) {
|
|
29
|
-
return renderLi ? (React.createElement("li", { className: "humany-list-item", key: item.id }, renderItem(item, index, items))) : (renderItem(item, index, items));
|
|
30
|
-
})));
|
|
31
|
-
});
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
import React, { useCallback, useRef } from 'react';
|
|
6
|
-
import styled from 'styled-components';
|
|
7
|
-
import { Button } from '..';
|
|
8
|
-
import { borderTabStyle, StyledText } from '../../styles';
|
|
9
|
-
import Modal from './modal';
|
|
10
|
-
var Confirm = function (_a) {
|
|
11
|
-
var className = _a.className, trigger = _a.trigger, _b = _a.header, header = _b === void 0 ? '' : _b, _c = _a.text, text = _c === void 0 ? '' : _c, _d = _a.onCancel, onCancel = _d === void 0 ? function () { } : _d, _e = _a.onConfirm, onConfirm = _e === void 0 ? function () { } : _e, _f = _a.cancelLabel, cancelLabel = _f === void 0 ? '' : _f, _g = _a.confirmLabel, confirmLabel = _g === void 0 ? '' : _g;
|
|
12
|
-
var ref = useRef();
|
|
13
|
-
var cancel = useCallback(function () {
|
|
14
|
-
var _a;
|
|
15
|
-
onCancel();
|
|
16
|
-
(_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
17
|
-
}, [onCancel]);
|
|
18
|
-
var confirm = useCallback(function () {
|
|
19
|
-
var _a;
|
|
20
|
-
onConfirm();
|
|
21
|
-
(_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
22
|
-
}, [onConfirm]);
|
|
23
|
-
return (React.createElement(StyledModal, { className: className, trigger: trigger, ref: ref, onOverlayClick: cancel },
|
|
24
|
-
header && React.createElement(StyledText, null, header),
|
|
25
|
-
text && React.createElement(StyledText, null, text),
|
|
26
|
-
confirmLabel && (React.createElement(StyledConfirmButton, { onClick: confirm }, confirmLabel)),
|
|
27
|
-
cancelLabel && React.createElement(StyledCancelButton, { onClick: cancel }, cancelLabel)));
|
|
28
|
-
};
|
|
29
|
-
export default Confirm;
|
|
30
|
-
var StyledModal = styled(Modal)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: block;\n\n span {\n display: block;\n margin: 0 0 ", ";\n\n &:first-of-type:not(:only-of-type) {\n font-weight: 700;\n margin: 0 0 ", ";\n }\n }\n"], ["\n display: block;\n\n span {\n display: block;\n margin: 0 0 ", ";\n\n &:first-of-type:not(:only-of-type) {\n font-weight: 700;\n margin: 0 0 ", ";\n }\n }\n"])), function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.normal; }, function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.small; });
|
|
31
|
-
var StyledConfirmButton = styled(Button)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: inline-block;\n min-width: 50px;\n ", "\n ", "\n color: #FFFFFF;\n background-color: ", ";\n border: 1px solid ", ";\n\n margin: 0 ", " 0 0;\n\n &:focus {\n ", ";\n background-color: transparent;\n }\n"], ["\n display: inline-block;\n min-width: 50px;\n ", "\n ", "\n color: #FFFFFF;\n background-color: ", ";\n border: 1px solid ", ";\n\n margin: 0 ", " 0 0;\n\n &:focus {\n ", ";\n background-color: transparent;\n }\n"])), function (p) { var _a, _b; return "padding: ".concat((_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.small, " ").concat((_b = p.theme.sizes) === null || _b === void 0 ? void 0 : _b.normal, ";"); }, function (p) { return p.theme.borderRadius && "border-radius: ".concat(p.theme.borderRadius, ";"); }, function (p) { var _a; return (_a = p.theme.colors) === null || _a === void 0 ? void 0 : _a.primary; }, function (p) { var _a; return (_a = p.theme.colors) === null || _a === void 0 ? void 0 : _a.primary; }, function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.small; }, function (p) { var _a; return ((_a = p.theme.accessibility) === null || _a === void 0 ? void 0 : _a.isTabbing) && borderTabStyle; });
|
|
32
|
-
var StyledCancelButton = styled(Button)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: inline-block;\n min-width: 50px;\n ", "\n ", "\n background-color: transparent;\n color: ", ";\n border: 1px solid ", ";\n\n &:focus {\n ", ";\n }\n"], ["\n display: inline-block;\n min-width: 50px;\n ", "\n ", "\n background-color: transparent;\n color: ", ";\n border: 1px solid ", ";\n\n &:focus {\n ", ";\n }\n"])), function (p) { var _a, _b; return "padding: ".concat((_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.small, " ").concat((_b = p.theme.sizes) === null || _b === void 0 ? void 0 : _b.normal, ";"); }, function (p) { return p.theme.borderRadius && "border-radius: ".concat(p.theme.borderRadius, ";"); }, function (p) { var _a; return (_a = p.theme.colors) === null || _a === void 0 ? void 0 : _a.text; }, function (p) { var _a; return (_a = p.theme.colors) === null || _a === void 0 ? void 0 : _a.text; }, function (p) { var _a; return ((_a = p.theme.accessibility) === null || _a === void 0 ? void 0 : _a.isTabbing) && borderTabStyle; });
|
|
33
|
-
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
var __assign = (this && this.__assign) || function () {
|
|
6
|
-
__assign = Object.assign || function(t) {
|
|
7
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
-
s = arguments[i];
|
|
9
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
-
t[p] = s[p];
|
|
11
|
-
}
|
|
12
|
-
return t;
|
|
13
|
-
};
|
|
14
|
-
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
|
-
var t = {};
|
|
18
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
19
|
-
t[p] = s[p];
|
|
20
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
21
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
23
|
-
t[p[i]] = s[p[i]];
|
|
24
|
-
}
|
|
25
|
-
return t;
|
|
26
|
-
};
|
|
27
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
28
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
29
|
-
if (!m) return o;
|
|
30
|
-
var i = m.call(o), r, ar = [], e;
|
|
31
|
-
try {
|
|
32
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
33
|
-
}
|
|
34
|
-
catch (error) { e = { error: error }; }
|
|
35
|
-
finally {
|
|
36
|
-
try {
|
|
37
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
38
|
-
}
|
|
39
|
-
finally { if (e) throw e.error; }
|
|
40
|
-
}
|
|
41
|
-
return ar;
|
|
42
|
-
};
|
|
43
|
-
import { appendClassNames, uuid } from '@telia-ace/widget-utilities';
|
|
44
|
-
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useRef } from 'react';
|
|
45
|
-
import styled from 'styled-components';
|
|
46
|
-
import { useKeyPress, useScroll, useToggle, useUniqueMenu, useWidgetEvent } from '../../hooks';
|
|
47
|
-
import { CloseButton, contentBox } from '../../styles';
|
|
48
|
-
import Overlay from '../overlay';
|
|
49
|
-
import SymbolBadge from '../symbol-badge';
|
|
50
|
-
var Modal = forwardRef(function (_a, ref) {
|
|
51
|
-
var className = _a.className, children = _a.children, trigger = _a.trigger, _b = _a.onOverlayClick, onOverlayClick = _b === void 0 ? function () { } : _b, _c = _a.close, close = _c === void 0 ? false : _c, other = __rest(_a, ["className", "children", "trigger", "onOverlayClick", "close"]);
|
|
52
|
-
var _d = __read(useToggle(), 2), visible = _d[0], toggleVisible = _d[1];
|
|
53
|
-
var _e = __read(useScroll(true), 2), css = _e[0], innerRef = _e[1];
|
|
54
|
-
var closeButtonRef = useRef();
|
|
55
|
-
var id = useRef(uuid());
|
|
56
|
-
var esc = useKeyPress('Escape');
|
|
57
|
-
useEffect(function () {
|
|
58
|
-
if (esc || close) {
|
|
59
|
-
toggleVisible(false);
|
|
60
|
-
}
|
|
61
|
-
}, [esc, close]);
|
|
62
|
-
useEffect(function () {
|
|
63
|
-
if (visible && closeButtonRef.current) {
|
|
64
|
-
closeButtonRef.current.focus();
|
|
65
|
-
}
|
|
66
|
-
}, [visible, closeButtonRef.current]);
|
|
67
|
-
useWidgetEvent('router:changed', function () {
|
|
68
|
-
toggleVisible(false);
|
|
69
|
-
});
|
|
70
|
-
var overlayClick = useCallback(function (e) {
|
|
71
|
-
toggleVisible(false);
|
|
72
|
-
onOverlayClick(e);
|
|
73
|
-
}, [onOverlayClick, toggleVisible]);
|
|
74
|
-
useImperativeHandle(ref, function () { return ({
|
|
75
|
-
close: function () {
|
|
76
|
-
toggleVisible(false);
|
|
77
|
-
},
|
|
78
|
-
}); });
|
|
79
|
-
var closeMenus = useCallback(function () {
|
|
80
|
-
return useUniqueMenu(id.current, function () {
|
|
81
|
-
toggleVisible(false);
|
|
82
|
-
});
|
|
83
|
-
}, [id.current]);
|
|
84
|
-
return (React.createElement(React.Fragment, null,
|
|
85
|
-
React.createElement(Overlay, { visible: visible, onClick: overlayClick },
|
|
86
|
-
React.createElement(Wrapper, __assign({ className: appendClassNames(className, 'humany-modal', "humany-modal-".concat(id.current)), css: css, tabIndex: -1 }, other, { ref: innerRef }),
|
|
87
|
-
React.createElement(CloseButton, { onClick: function () { return toggleVisible(false); }, tabIndex: 0, ref: closeButtonRef },
|
|
88
|
-
React.createElement(SymbolBadge, { symbol: { type: 'Svg', content: 'close' } })),
|
|
89
|
-
children)),
|
|
90
|
-
React.cloneElement(trigger, {
|
|
91
|
-
onClick: function (event) {
|
|
92
|
-
toggleVisible();
|
|
93
|
-
closeMenus();
|
|
94
|
-
},
|
|
95
|
-
})));
|
|
96
|
-
});
|
|
97
|
-
export default Modal;
|
|
98
|
-
var Wrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n position: relative;\n max-width: 50%;\n min-width: 200px;\n padding: ", ";\n ", "\n ", "\n outline: none;\n"], ["\n font-family: ", ";\n font-size: ", ";\n position: relative;\n max-width: 50%;\n min-width: 200px;\n padding: ", ";\n ", "\n ", "\n outline: none;\n"])), function (p) { var _a; return (_a = p.theme.fonts) === null || _a === void 0 ? void 0 : _a.type; }, function (p) { var _a; return (_a = p.theme.fonts) === null || _a === void 0 ? void 0 : _a.normal; }, function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.medium; }, contentBox, function (p) { return p.css && p.css; });
|
|
99
|
-
var templateObject_1;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import styled, { css } from 'styled-components';
|
|
7
|
-
import { TextLink, Typography } from '../components';
|
|
8
|
-
import { headingElement } from '../utils/heading-styles';
|
|
9
|
-
var NotFound = function (_a) {
|
|
10
|
-
var _b = _a.header, header = _b === void 0 ? '' : _b, _c = _a.link, link = _c === void 0 ? '' : _c, _d = _a.suggestionHeader, suggestionHeader = _d === void 0 ? '' : _d, _e = _a.suggestion, suggestion = _e === void 0 ? '' : _e;
|
|
11
|
-
return (React.createElement(Wrapper, null,
|
|
12
|
-
React.createElement(Status, null,
|
|
13
|
-
React.createElement(Typography, { variant: "h2" }, "404")),
|
|
14
|
-
React.createElement(Header, null,
|
|
15
|
-
React.createElement(Typography, { variant: "h3" }, header),
|
|
16
|
-
React.createElement(TextLink, { routeName: "index", "aria-label": link, text: link })),
|
|
17
|
-
React.createElement(Content, null,
|
|
18
|
-
React.createElement("span", null, suggestionHeader),
|
|
19
|
-
React.createElement("ul", null,
|
|
20
|
-
React.createElement("li", null, suggestion)))));
|
|
21
|
-
};
|
|
22
|
-
export default NotFound;
|
|
23
|
-
var Wrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n"], ["\n display: flex;\n flex-wrap: wrap;\n"])));
|
|
24
|
-
var Status = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), headingElement('h2', css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 0;\n margin: 0;\n color: gray;\n font-size: 7em;\n "], ["\n padding: 0;\n margin: 0;\n color: gray;\n font-size: 7em;\n "])))));
|
|
25
|
-
var Header = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n margin-left: ", ";\n\n ", "\n\n a {\n color: ", ";\n font-size: ", ";\n }\n"], ["\n margin-left: ", ";\n\n ", "\n\n a {\n color: ", ";\n font-size: ", ";\n }\n"])), function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.medium; }, headingElement('h3', css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n text-transform: uppercase;\n font-size: ", ";\n "], ["\n text-transform: uppercase;\n font-size: ", ";\n "])), function (p) { var _a; return (_a = p.theme.fonts) === null || _a === void 0 ? void 0 : _a.normal; })), function (p) { var _a; return (_a = p.theme.colors) === null || _a === void 0 ? void 0 : _a.link; }, function (p) { var _a; return (_a = p.theme.fonts) === null || _a === void 0 ? void 0 : _a.small; });
|
|
26
|
-
var Content = styled.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n margin-top: ", ";\n min-width: 100%;\n\n span {\n font-weight: bold;\n }\n"], ["\n margin-top: ", ";\n min-width: 100%;\n\n span {\n font-weight: bold;\n }\n"])), function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.medium; });
|
|
27
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
var __assign = (this && this.__assign) || function () {
|
|
6
|
-
__assign = Object.assign || function(t) {
|
|
7
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
-
s = arguments[i];
|
|
9
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
-
t[p] = s[p];
|
|
11
|
-
}
|
|
12
|
-
return t;
|
|
13
|
-
};
|
|
14
|
-
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
|
-
var t = {};
|
|
18
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
19
|
-
t[p] = s[p];
|
|
20
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
21
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
23
|
-
t[p[i]] = s[p[i]];
|
|
24
|
-
}
|
|
25
|
-
return t;
|
|
26
|
-
};
|
|
27
|
-
import React, { useCallback, useRef } from 'react';
|
|
28
|
-
import { CSSTransition } from 'react-transition-group';
|
|
29
|
-
import styled from 'styled-components';
|
|
30
|
-
import Portal from './portal';
|
|
31
|
-
var Overlay = function (_a) {
|
|
32
|
-
var visible = _a.visible, _b = _a.duration, duration = _b === void 0 ? 500 : _b, children = _a.children, _c = _a.onClick, onClick = _c === void 0 ? function () { } : _c, other = __rest(_a, ["visible", "duration", "children", "onClick"]);
|
|
33
|
-
var ref = useRef();
|
|
34
|
-
var onOverlayClick = useCallback(function (e) {
|
|
35
|
-
if (e.target === ref.current) {
|
|
36
|
-
onClick(e);
|
|
37
|
-
}
|
|
38
|
-
}, [onClick]);
|
|
39
|
-
return (React.createElement(CSSTransition, { in: visible, className: "humany-overlay-transition", classNames: "humany-overlay-transition", unmountOnExit: true, timeout: duration },
|
|
40
|
-
React.createElement(Portal, null,
|
|
41
|
-
React.createElement(Wrapper, __assign({ className: "humany-overlay", duration: duration, ref: ref, onClick: onOverlayClick }, other), children))));
|
|
42
|
-
};
|
|
43
|
-
var Wrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background: rgba(0, 0, 0, 0.6);\n min-width: 100%;\n min-height: 100%;\n position: fixed;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 7;\n\n transition: ", "ms;\n opacity: 0;\n\n &.humany-overlay-transition-enter {\n opacity: 0.1;\n }\n &.humany-overlay-transition-enter-active,\n &.humany-overlay-transition-enter-done,\n &.humany-overlay-transition-exit {\n opacity: 1;\n }\n\n &.humany-overlay-transition-exit-active,\n &.humany-overlay-transition-exit-done {\n opacity: 0;\n }\n"], ["\n background: rgba(0, 0, 0, 0.6);\n min-width: 100%;\n min-height: 100%;\n position: fixed;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 7;\n\n transition: ", "ms;\n opacity: 0;\n\n &.humany-overlay-transition-enter {\n opacity: 0.1;\n }\n &.humany-overlay-transition-enter-active,\n &.humany-overlay-transition-enter-done,\n &.humany-overlay-transition-exit {\n opacity: 1;\n }\n\n &.humany-overlay-transition-exit-active,\n &.humany-overlay-transition-exit-done {\n opacity: 0;\n }\n"])), function (p) { return p.duration; });
|
|
44
|
-
export default Overlay;
|
|
45
|
-
var templateObject_1;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
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
|
-
};
|
|
23
|
-
import { appendClassNames } from '@telia-ace/widget-utilities';
|
|
24
|
-
import React, { forwardRef } from 'react';
|
|
25
|
-
import { convertToStringAttributes } from '../utils';
|
|
26
|
-
import Html from './html';
|
|
27
|
-
import SymbolBadge from './symbol-badge';
|
|
28
|
-
import Text from './text';
|
|
29
|
-
import Typography from './typography';
|
|
30
|
-
export default forwardRef(function (_a, ref) {
|
|
31
|
-
var text = _a.text, html = _a.html, header = _a.header, className = _a.className, htmlParseInstruction = _a.htmlParseInstruction, symbol = _a.symbol, other = __rest(_a, ["text", "html", "header", "className", "htmlParseInstruction", "symbol"]);
|
|
32
|
-
return (React.createElement("div", __assign({ className: appendClassNames(className, 'humany-paragraph') }, convertToStringAttributes(other), { ref: ref }),
|
|
33
|
-
header ? (React.createElement(Typography, { variant: "h1" },
|
|
34
|
-
symbol ? React.createElement(SymbolBadge, { symbol: symbol }) : null,
|
|
35
|
-
header)) : null,
|
|
36
|
-
html ? React.createElement(Html, { html: html, htmlParseInstruction: htmlParseInstruction }) : null,
|
|
37
|
-
text ? React.createElement(Text, null, text) : null));
|
|
38
|
-
});
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
2
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
3
|
-
if (!m) return o;
|
|
4
|
-
var i = m.call(o), r, ar = [], e;
|
|
5
|
-
try {
|
|
6
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
7
|
-
}
|
|
8
|
-
catch (error) { e = { error: error }; }
|
|
9
|
-
finally {
|
|
10
|
-
try {
|
|
11
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
12
|
-
}
|
|
13
|
-
finally { if (e) throw e.error; }
|
|
14
|
-
}
|
|
15
|
-
return ar;
|
|
16
|
-
};
|
|
17
|
-
import React, { useEffect } from 'react';
|
|
18
|
-
import { createPortal } from 'react-dom';
|
|
19
|
-
var Portal = function (_a) {
|
|
20
|
-
var _b = _a.elementId, elementId = _b === void 0 ? 'humany-portal-elements' : _b, children = _a.children;
|
|
21
|
-
var _c = __read(React.useState(function () {
|
|
22
|
-
var el = document.getElementById(elementId) || document.createElement('div');
|
|
23
|
-
el.id = elementId;
|
|
24
|
-
return el;
|
|
25
|
-
}), 1), container = _c[0];
|
|
26
|
-
useEffect(function () {
|
|
27
|
-
document.body.appendChild(container);
|
|
28
|
-
return function () {
|
|
29
|
-
if (container.childElementCount <= 1) {
|
|
30
|
-
document.body.removeChild(container);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
}, [container]);
|
|
34
|
-
return createPortal(children, container);
|
|
35
|
-
};
|
|
36
|
-
export default Portal;
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
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
|
-
};
|
|
23
|
-
import { getSpecificWidgetPath, HistoryMode } from '@telia-ace/widget-routing';
|
|
24
|
-
import { appendClassNames, Logger } from '@telia-ace/widget-utilities';
|
|
25
|
-
import React, { forwardRef } from 'react';
|
|
26
|
-
import { Link } from 'react-router-dom';
|
|
27
|
-
import { useContainer, useRouter } from '../hooks';
|
|
28
|
-
export default forwardRef(function (_a, forwardedRef) {
|
|
29
|
-
var className = _a.className, _b = _a.onClick, onClick = _b === void 0 ? function () { } : _b, _c = _a.name, name = _c === void 0 ? '' : _c, _d = _a.to, to = _d === void 0 ? '' : _d, _e = _a.params, params = _e === void 0 ? {} : _e, children = _a.children, other = __rest(_a, ["className", "onClick", "name", "to", "params", "children"]);
|
|
30
|
-
var router = useRouter();
|
|
31
|
-
var container = useContainer();
|
|
32
|
-
if (!router) {
|
|
33
|
-
return null;
|
|
34
|
-
}
|
|
35
|
-
var path = '';
|
|
36
|
-
var props = __assign(__assign({ onClick: onClick, className: appendClassNames(className, 'humany-route-link'), to: path, innerRef: forwardedRef }, other), { ref: null });
|
|
37
|
-
if (name) {
|
|
38
|
-
var routes = router.routes || [];
|
|
39
|
-
var route = routes.find(function (r) { return r.name === name; });
|
|
40
|
-
if (!route) {
|
|
41
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
42
|
-
Logger.warn("Unable to create route. No route named \"".concat(name, "\" exist."));
|
|
43
|
-
}
|
|
44
|
-
return (React.createElement(Link, __assign({}, props, { onClick: function (e) {
|
|
45
|
-
onClick(e);
|
|
46
|
-
e.preventDefault();
|
|
47
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
48
|
-
Logger.warn("Unable to navigate. No route named \"".concat(name, "\" exist."));
|
|
49
|
-
}
|
|
50
|
-
} }), children));
|
|
51
|
-
}
|
|
52
|
-
var encodedParams = Object.keys(params).reduce(function (acc, key) {
|
|
53
|
-
acc[key] =
|
|
54
|
-
typeof params[key] === 'string' ? encodeURIComponent(params[key]) : params[key];
|
|
55
|
-
return acc;
|
|
56
|
-
}, {});
|
|
57
|
-
try {
|
|
58
|
-
path = router.generate(name, encodedParams || {});
|
|
59
|
-
}
|
|
60
|
-
catch (e) {
|
|
61
|
-
return React.createElement(Link, __assign({}, props), children);
|
|
62
|
-
}
|
|
63
|
-
if (path &&
|
|
64
|
-
router.settings.mode &&
|
|
65
|
-
router.settings.mode === HistoryMode.browser &&
|
|
66
|
-
path[0] !== '/') {
|
|
67
|
-
path = "/".concat(path);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
else if (to && router.history) {
|
|
71
|
-
path = router.history.createHref({
|
|
72
|
-
hash: '',
|
|
73
|
-
pathname: to,
|
|
74
|
-
search: '',
|
|
75
|
-
state: undefined,
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
80
|
-
Logger.warn('Unable to generate path for route link. Either specify route name or use the "to" prop.');
|
|
81
|
-
}
|
|
82
|
-
return null;
|
|
83
|
-
}
|
|
84
|
-
// Get the path for the specific widget
|
|
85
|
-
if (router.settings && router.settings.mode === HistoryMode.scopedHash) {
|
|
86
|
-
var widgetName = container.get('$widget').name;
|
|
87
|
-
path = getSpecificWidgetPath(path, widgetName);
|
|
88
|
-
}
|
|
89
|
-
return (React.createElement(Link, __assign({}, props, { to: path }), children));
|
|
90
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare type Symbol = {
|
|
3
|
-
type: 'Uri' | 'Svg' | 'FontAwesome' | 'Text' | string;
|
|
4
|
-
content: string;
|
|
5
|
-
};
|
|
6
|
-
export declare type HtmlIconProps = Merge<React.ComponentProps<'i'>, React.ComponentProps<'svg'>>;
|
|
7
|
-
export declare type Props = Merge<HtmlIconProps, {
|
|
8
|
-
symbol: Symbol;
|
|
9
|
-
backgroundSize?: string;
|
|
10
|
-
size?: number;
|
|
11
|
-
text?: string;
|
|
12
|
-
elementStyle?: Object;
|
|
13
|
-
}>;
|
|
14
|
-
declare const SymbolBadge: React.SFC<Props>;
|
|
15
|
-
export default SymbolBadge;
|