@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,127 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
|
-
var __assign = (this && this.__assign) || function () {
|
|
7
|
-
__assign = Object.assign || function(t) {
|
|
8
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
-
s = arguments[i];
|
|
10
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
-
t[p] = s[p];
|
|
12
|
-
}
|
|
13
|
-
return t;
|
|
14
|
-
};
|
|
15
|
-
return __assign.apply(this, arguments);
|
|
16
|
-
};
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
-
}
|
|
23
|
-
Object.defineProperty(o, k2, desc);
|
|
24
|
-
}) : (function(o, m, k, k2) {
|
|
25
|
-
if (k2 === undefined) k2 = k;
|
|
26
|
-
o[k2] = m[k];
|
|
27
|
-
}));
|
|
28
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
-
}) : function(o, v) {
|
|
31
|
-
o["default"] = v;
|
|
32
|
-
});
|
|
33
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
-
if (mod && mod.__esModule) return mod;
|
|
35
|
-
var result = {};
|
|
36
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
-
__setModuleDefault(result, mod);
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
41
|
-
var t = {};
|
|
42
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
43
|
-
t[p] = s[p];
|
|
44
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
45
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
46
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
47
|
-
t[p[i]] = s[p[i]];
|
|
48
|
-
}
|
|
49
|
-
return t;
|
|
50
|
-
};
|
|
51
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
52
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
53
|
-
if (!m) return o;
|
|
54
|
-
var i = m.call(o), r, ar = [], e;
|
|
55
|
-
try {
|
|
56
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
57
|
-
}
|
|
58
|
-
catch (error) { e = { error: error }; }
|
|
59
|
-
finally {
|
|
60
|
-
try {
|
|
61
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
62
|
-
}
|
|
63
|
-
finally { if (e) throw e.error; }
|
|
64
|
-
}
|
|
65
|
-
return ar;
|
|
66
|
-
};
|
|
67
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
68
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
69
|
-
};
|
|
70
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
71
|
-
var widget_utilities_1 = require("@telia-ace/widget-utilities");
|
|
72
|
-
var react_1 = __importStar(require("react"));
|
|
73
|
-
var styled_components_1 = __importDefault(require("styled-components"));
|
|
74
|
-
var dropdown_1 = require("./dropdown");
|
|
75
|
-
var portal_1 = __importDefault(require("./portal"));
|
|
76
|
-
var Tooltip = function (_a) {
|
|
77
|
-
var className = _a.className, children = _a.children, content = _a.content, _b = _a.sticky, sticky = _b === void 0 ? false : _b, other = __rest(_a, ["className", "children", "content", "sticky"]);
|
|
78
|
-
var _c = __read((0, react_1.useState)(false), 2), open = _c[0], setOpen = _c[1];
|
|
79
|
-
var id = (0, react_1.useRef)((0, widget_utilities_1.uuid)());
|
|
80
|
-
var ref = (0, react_1.useRef)();
|
|
81
|
-
var _d = __read((0, dropdown_1.useCursorPosition)(open, id.current, ref.current), 2), _e = _d[0], x = _e.x, y = _e.y, set = _d[1];
|
|
82
|
-
var clickHandler = function (event) {
|
|
83
|
-
var target = event.target;
|
|
84
|
-
if (!ref.current || !target) {
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
if (ref.current !== target && !ref.current.contains(target)) {
|
|
88
|
-
setOpen(false);
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
(0, react_1.useEffect)(function () {
|
|
92
|
-
if (!sticky) {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
window.addEventListener('click', clickHandler);
|
|
96
|
-
return function () {
|
|
97
|
-
window.removeEventListener('click', clickHandler);
|
|
98
|
-
};
|
|
99
|
-
}, [open, sticky]);
|
|
100
|
-
var handleMouseEvent = (0, react_1.useCallback)(function (e, value) {
|
|
101
|
-
set(e, ref.current);
|
|
102
|
-
setOpen(value);
|
|
103
|
-
}, [set, setOpen]);
|
|
104
|
-
return (react_1.default.createElement(Trigger, { ref: ref, className: "humany-tooltip-trigger", onMouseEnter: !sticky ? function (e) { return handleMouseEvent(e, true); } : undefined, onMouseLeave: !sticky ? function (e) { return handleMouseEvent(e, false); } : undefined, onTouchEnd: sticky ? function (e) { return handleMouseEvent(e, !open); } : undefined, onClick: sticky ? function (e) { return handleMouseEvent(e, !open); } : undefined },
|
|
105
|
-
children,
|
|
106
|
-
open && (react_1.default.createElement(portal_1.default, null,
|
|
107
|
-
react_1.default.createElement(TooltipContainer, __assign({ className: (0, widget_utilities_1.appendClassNames)(className, 'humany-tooltip-container'), x: x, y: y }, other), content)))));
|
|
108
|
-
};
|
|
109
|
-
var Trigger = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n"], ["\n display: flex;\n align-items: center;\n"])));
|
|
110
|
-
var TooltipContainer = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n color: #ffffff;\n background: #161616;\n border-radius: ", ";\n padding: calc(", " * 2);\n font-size: ", ";\n font-family: ", ";\n position: absolute;\n z-index: 10;\n\n a {\n color: ", ";\n text-decoration: none;\n }\n\n i,\n svg {\n margin-right: ", ";\n }\n\n ", ";\n"], ["\n color: #ffffff;\n background: #161616;\n border-radius: ", ";\n padding: calc(", " * 2);\n font-size: ", ";\n font-family: ", ";\n position: absolute;\n z-index: 10;\n\n a {\n color: ", ";\n text-decoration: none;\n }\n\n i,\n svg {\n margin-right: ", ";\n }\n\n ", ";\n"])), function (p) { return p.theme.borderRadius; }, 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.fonts) === null || _a === void 0 ? void 0 : _a.normal; }, function (p) { var _a; return (_a = p.theme.fonts) === null || _a === void 0 ? void 0 : _a.type; }, function (p) { return (p.color ? p.color : 'inherit'); }, function (p) { return p.theme.sizes.small; }, function (p) {
|
|
111
|
-
var css = '';
|
|
112
|
-
if (p.y > 0) {
|
|
113
|
-
css += "top: calc(2px + ".concat(p.y || '0', "px);");
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
css += "bottom: 2px;";
|
|
117
|
-
}
|
|
118
|
-
if (p.x > 0) {
|
|
119
|
-
css += "right: calc(2px + ".concat(p.x || '0', "px);");
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
css += "left: 2px;";
|
|
123
|
-
}
|
|
124
|
-
return css;
|
|
125
|
-
});
|
|
126
|
-
exports.default = Tooltip;
|
|
127
|
-
var templateObject_1, templateObject_2;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare type Props = {
|
|
3
|
-
in: boolean;
|
|
4
|
-
timeout?: number | {
|
|
5
|
-
enter?: number;
|
|
6
|
-
exit?: number;
|
|
7
|
-
};
|
|
8
|
-
mountOnEnter?: boolean;
|
|
9
|
-
unmountOnExit?: boolean;
|
|
10
|
-
children?: any;
|
|
11
|
-
transitions?: string | {
|
|
12
|
-
enter: TransitionInfo;
|
|
13
|
-
exit: TransitionInfo;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
declare type TransitionInfo = {
|
|
17
|
-
type: string;
|
|
18
|
-
easing?: string;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Wrapper component for Transition from 'react-transition-group'
|
|
22
|
-
* Controls animated enter/exit transitions of a child component bu dynamically creating
|
|
23
|
-
* css that is forwarded to the child component.
|
|
24
|
-
*
|
|
25
|
-
* TODO:
|
|
26
|
-
* Extend to accept more specific transitions (TransitionStateSettings) to enable different
|
|
27
|
-
* enter and exit animations, timings and easings
|
|
28
|
-
*/
|
|
29
|
-
declare const TransitionComponent: React.FC<Props>;
|
|
30
|
-
export default TransitionComponent;
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var react_1 = __importDefault(require("react"));
|
|
7
|
-
var react_transition_group_1 = require("react-transition-group");
|
|
8
|
-
var utils_1 = require("../utils");
|
|
9
|
-
/**
|
|
10
|
-
* Wrapper component for Transition from 'react-transition-group'
|
|
11
|
-
* Controls animated enter/exit transitions of a child component bu dynamically creating
|
|
12
|
-
* css that is forwarded to the child component.
|
|
13
|
-
*
|
|
14
|
-
* TODO:
|
|
15
|
-
* Extend to accept more specific transitions (TransitionStateSettings) to enable different
|
|
16
|
-
* enter and exit animations, timings and easings
|
|
17
|
-
*/
|
|
18
|
-
var TransitionComponent = function (props) {
|
|
19
|
-
var inState = props.in, _a = props.mountOnEnter, mountOnEnter = _a === void 0 ? true : _a, _b = props.unmountOnExit, unmountOnExit = _b === void 0 ? true : _b, timeout = props.timeout, children = props.children, transitions = props.transitions;
|
|
20
|
-
var generateTransitionDefinition = function () {
|
|
21
|
-
var _a, _b;
|
|
22
|
-
if (!transitions || transitions === 'none') {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
if (typeof transitions === 'string') {
|
|
26
|
-
return {
|
|
27
|
-
enter: {
|
|
28
|
-
transitionKeys: transitions,
|
|
29
|
-
duration: !!timeout
|
|
30
|
-
? typeof timeout === 'number'
|
|
31
|
-
? timeout
|
|
32
|
-
: timeout.enter
|
|
33
|
-
: 200,
|
|
34
|
-
easing: 'ease-in',
|
|
35
|
-
},
|
|
36
|
-
exit: {
|
|
37
|
-
transitionKeys: transitions,
|
|
38
|
-
duration: !!timeout
|
|
39
|
-
? typeof timeout === 'number'
|
|
40
|
-
? timeout
|
|
41
|
-
: timeout.exit
|
|
42
|
-
: 200,
|
|
43
|
-
easing: 'ease-out',
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
if (typeof transitions === 'object') {
|
|
48
|
-
var enter = transitions.enter, exit = transitions.exit;
|
|
49
|
-
return {
|
|
50
|
-
enter: {
|
|
51
|
-
transitionKeys: (_a = transitions.enter) === null || _a === void 0 ? void 0 : _a.type,
|
|
52
|
-
duration: !!timeout
|
|
53
|
-
? typeof timeout === 'number'
|
|
54
|
-
? timeout
|
|
55
|
-
: timeout.enter
|
|
56
|
-
: 200,
|
|
57
|
-
easing: !!enter.easing ? enter.easing : 'ease-in',
|
|
58
|
-
},
|
|
59
|
-
exit: {
|
|
60
|
-
transitionKeys: (_b = transitions.enter) === null || _b === void 0 ? void 0 : _b.type,
|
|
61
|
-
duration: !!timeout
|
|
62
|
-
? typeof timeout === 'number'
|
|
63
|
-
? timeout
|
|
64
|
-
: timeout.enter
|
|
65
|
-
: 200,
|
|
66
|
-
easing: !!exit.easing ? exit.easing : 'ease-out',
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
var def = generateTransitionDefinition();
|
|
72
|
-
return (react_1.default.createElement(react_transition_group_1.Transition, { timeout: {
|
|
73
|
-
enter: (def && def.enter.duration) || 0,
|
|
74
|
-
exit: (def && def.exit.duration) || 0,
|
|
75
|
-
}, in: inState, appear: true, mountOnEnter: mountOnEnter, unmountOnExit: unmountOnExit, onEnter: function (node) { return node.clientHeight; } }, function (state) { return children && children(state, def && utils_1.transitionComposer.compose(state, def)); }));
|
|
76
|
-
};
|
|
77
|
-
exports.default = TransitionComponent;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
|
-
var __assign = (this && this.__assign) || function () {
|
|
7
|
-
__assign = Object.assign || function(t) {
|
|
8
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
-
s = arguments[i];
|
|
10
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
-
t[p] = s[p];
|
|
12
|
-
}
|
|
13
|
-
return t;
|
|
14
|
-
};
|
|
15
|
-
return __assign.apply(this, arguments);
|
|
16
|
-
};
|
|
17
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
-
};
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
var react_1 = __importDefault(require("react"));
|
|
22
|
-
var styled_components_1 = __importDefault(require("styled-components"));
|
|
23
|
-
var hooks_1 = require("../hooks");
|
|
24
|
-
var defaultVariantMapping = {
|
|
25
|
-
h1: 'h1',
|
|
26
|
-
h2: 'h2',
|
|
27
|
-
h3: 'h3',
|
|
28
|
-
h4: 'h4',
|
|
29
|
-
h5: 'h5',
|
|
30
|
-
h6: 'h6',
|
|
31
|
-
p: 'p',
|
|
32
|
-
span: 'span',
|
|
33
|
-
};
|
|
34
|
-
var Typography = function (_a) {
|
|
35
|
-
var variant = _a.variant, component = _a.component, className = _a.className, children = _a.children;
|
|
36
|
-
var _b = (0, hooks_1.useContext)().typographyVariantMapping, typographyVariantMapping = _b === void 0 ? {} : _b;
|
|
37
|
-
var variantMapping = __assign(__assign({}, defaultVariantMapping), typographyVariantMapping);
|
|
38
|
-
var Component = component || variantMapping[variant] || 'span';
|
|
39
|
-
return (react_1.default.createElement(Base, { className: className, as: Component }, children));
|
|
40
|
-
};
|
|
41
|
-
var Base = styled_components_1.default.span(templateObject_1 || (templateObject_1 = __makeTemplateObject([""], [""])));
|
|
42
|
-
exports.default = Typography;
|
|
43
|
-
var templateObject_1;
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
-
}) : function(o, v) {
|
|
27
|
-
o["default"] = v;
|
|
28
|
-
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
-
if (mod && mod.__esModule) return mod;
|
|
31
|
-
var result = {};
|
|
32
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
-
__setModuleDefault(result, mod);
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
37
|
-
var t = {};
|
|
38
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
39
|
-
t[p] = s[p];
|
|
40
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
41
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
42
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
43
|
-
t[p[i]] = s[p[i]];
|
|
44
|
-
}
|
|
45
|
-
return t;
|
|
46
|
-
};
|
|
47
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
48
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
|
-
};
|
|
50
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
-
var widget_core_1 = require("@telia-ace/widget-core");
|
|
52
|
-
var widget_utilities_1 = require("@telia-ace/widget-utilities");
|
|
53
|
-
var platform_1 = require("@webprovisions/platform");
|
|
54
|
-
var react_1 = __importStar(require("react"));
|
|
55
|
-
var hooks_1 = require("../hooks");
|
|
56
|
-
var link_1 = __importDefault(require("./link"));
|
|
57
|
-
exports.default = (0, react_1.forwardRef)(function (_a, ref) {
|
|
58
|
-
var className = _a.className, children = _a.children, _b = _a.onClick, onClick = _b === void 0 ? function () { } : _b, widgetName = _a.widgetName, activationOptions = _a.activationOptions, other = __rest(_a, ["className", "children", "onClick", "widgetName", "activationOptions"]);
|
|
59
|
-
var container = (0, hooks_1.useContainer)();
|
|
60
|
-
var getWidget = function () {
|
|
61
|
-
var implementation = container.get('$widget').implementation;
|
|
62
|
-
return implementation.widgets.get(widgetName);
|
|
63
|
-
};
|
|
64
|
-
(0, react_1.useEffect)(function () {
|
|
65
|
-
var widget = getWidget();
|
|
66
|
-
widget === null || widget === void 0 ? void 0 : widget.activate(activationOptions).then(function () { return widget.invoke('attach'); });
|
|
67
|
-
return function () {
|
|
68
|
-
widget === null || widget === void 0 ? void 0 : widget.deactivate();
|
|
69
|
-
};
|
|
70
|
-
}, [widgetName]);
|
|
71
|
-
var openWidget = function (e) {
|
|
72
|
-
var widget = getWidget();
|
|
73
|
-
var target = e.currentTarget;
|
|
74
|
-
if (widget) {
|
|
75
|
-
var toggle = function () {
|
|
76
|
-
widget
|
|
77
|
-
.invoke('renderState')
|
|
78
|
-
.then(function (renderState) {
|
|
79
|
-
return renderState === widget_core_1.WidgetRenderState.open
|
|
80
|
-
? widget.invoke('close')
|
|
81
|
-
: widget.invoke('open');
|
|
82
|
-
})
|
|
83
|
-
.then(function () {
|
|
84
|
-
widget.events.subscribeOnce('widget:area-rendered', function (event, data) {
|
|
85
|
-
var widgetDOMElement = container.get('widgetDOMElement');
|
|
86
|
-
if (widgetDOMElement) {
|
|
87
|
-
widget.events.dispatch('widget:modal-opened', {
|
|
88
|
-
name: widget.name,
|
|
89
|
-
ref: target,
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
};
|
|
95
|
-
if (widget.state === platform_1.WidgetState.Deactivated) {
|
|
96
|
-
widget
|
|
97
|
-
.activate(activationOptions)
|
|
98
|
-
.then(function () { return widget.invoke('attach'); })
|
|
99
|
-
.then(toggle);
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
toggle();
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
var onEnter = function (e) {
|
|
107
|
-
if (e.key === 'Enter') {
|
|
108
|
-
e.preventDefault();
|
|
109
|
-
openWidget(e);
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
return (react_1.default.createElement(link_1.default, __assign({ className: (0, widget_utilities_1.appendClassNames)(className, 'humany-widget-link'), onKeyDown: onEnter, onClick: function (e) {
|
|
113
|
-
onClick(e);
|
|
114
|
-
openWidget(e);
|
|
115
|
-
} }, other, { ref: ref }), children));
|
|
116
|
-
});
|
package/lib/contexts/index.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RoutingContext = exports.ComponentPropertyContext = exports.ComponentNodeContext = exports.ColumnContext = exports.ContainerContext = void 0;
|
|
4
|
-
var platform_1 = require("@webprovisions/platform");
|
|
5
|
-
var react_1 = require("react");
|
|
6
|
-
exports.ContainerContext = (0, react_1.createContext)(new platform_1.Container());
|
|
7
|
-
exports.ColumnContext = (0, react_1.createContext)(1);
|
|
8
|
-
exports.ComponentNodeContext = (0, react_1.createContext)({
|
|
9
|
-
id: '',
|
|
10
|
-
type: '',
|
|
11
|
-
name: '',
|
|
12
|
-
branch: '',
|
|
13
|
-
});
|
|
14
|
-
exports.ComponentPropertyContext = (0, react_1.createContext)({});
|
|
15
|
-
exports.RoutingContext = (0, react_1.createContext)(null);
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ExtendComponentHandler, ExtendComponentOptions, ReactComponent } from '@telia-ace/widget-core';
|
|
2
|
-
import { Container } from '@webprovisions/platform';
|
|
3
|
-
/**
|
|
4
|
-
* Registers a React component on the component platform.
|
|
5
|
-
* @param container Container to register the component on.
|
|
6
|
-
* @param type Type name to resolve the component from configuration.
|
|
7
|
-
* @param reactComponent Promise resolving to the React component for rendering.
|
|
8
|
-
* @param fn Handler for controlling the component.
|
|
9
|
-
*/
|
|
10
|
-
declare const createReactComponent: (container: Container, type: string, reactComponent: ReactComponent, fn?: ExtendComponentHandler | undefined, options?: ExtendComponentOptions | undefined) => Promise<void>;
|
|
11
|
-
export default createReactComponent;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var widget_core_1 = require("@telia-ace/widget-core");
|
|
4
|
-
var react_1 = require("react");
|
|
5
|
-
/**
|
|
6
|
-
* Registers a React component on the component platform.
|
|
7
|
-
* @param container Container to register the component on.
|
|
8
|
-
* @param type Type name to resolve the component from configuration.
|
|
9
|
-
* @param reactComponent Promise resolving to the React component for rendering.
|
|
10
|
-
* @param fn Handler for controlling the component.
|
|
11
|
-
*/
|
|
12
|
-
var createReactComponent = function (container, type, reactComponent, fn, options) {
|
|
13
|
-
return container.getAsync('componentResolver').then(function (componentResolver) {
|
|
14
|
-
componentResolver.registerComponent(type, (0, react_1.lazy)(function () { return reactComponent; }));
|
|
15
|
-
return (0, widget_core_1.extendComponent)(container, type, fn || (function () { }), type, options);
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
exports.default = createReactComponent;
|
package/lib/hooks/index.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export { default as useAction } from './use-action';
|
|
2
|
-
export { default as useChildren } from './use-children';
|
|
3
|
-
export { default as useColumns } from './use-columns';
|
|
4
|
-
export { default as useComponent } from './use-component';
|
|
5
|
-
export { default as useComponentDescriptor } from './use-component-descriptor';
|
|
6
|
-
export { default as useComponentNode } from './use-component-node';
|
|
7
|
-
export { default as useComponentPlatform } from './use-component-platform';
|
|
8
|
-
export { default as useContainer } from './use-container';
|
|
9
|
-
export { default as useContext } from './use-context';
|
|
10
|
-
export { default as useDispatch } from './use-dispatch';
|
|
11
|
-
export type { DispatchAction } from './use-dispatch';
|
|
12
|
-
export { default as useEventListener } from './use-event-listener';
|
|
13
|
-
export { default as useEvents } from './use-events';
|
|
14
|
-
export { default as useIsMounted } from './use-is-mounted';
|
|
15
|
-
export { default as useKeyPress } from './use-key-press';
|
|
16
|
-
export { default as useLayout } from './use-layout';
|
|
17
|
-
export { default as usePrevious } from './use-previous';
|
|
18
|
-
export { default as useProperties } from './use-properties';
|
|
19
|
-
export { default as useRenderState } from './use-render-state';
|
|
20
|
-
export { default as useRouteData } from './use-route-data';
|
|
21
|
-
export { default as useRouter } from './use-router';
|
|
22
|
-
export { default as useScroll } from './use-scroll';
|
|
23
|
-
export { default as useSettings } from './use-settings';
|
|
24
|
-
export { default as useToggle } from './use-toggle';
|
|
25
|
-
export { default as useTransitionEnd } from './use-transition-end';
|
|
26
|
-
export { default as useUniqueMenu } from './use-unique-menu';
|
|
27
|
-
export { default as useWidgetEvent } from './use-widget-event';
|
package/lib/hooks/index.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.useWidgetEvent = exports.useUniqueMenu = exports.useTransitionEnd = exports.useToggle = exports.useSettings = exports.useScroll = exports.useRouter = exports.useRouteData = exports.useRenderState = exports.useProperties = exports.usePrevious = exports.useLayout = exports.useKeyPress = exports.useIsMounted = exports.useEvents = exports.useEventListener = exports.useDispatch = exports.useContext = exports.useContainer = exports.useComponentPlatform = exports.useComponentNode = exports.useComponentDescriptor = exports.useComponent = exports.useColumns = exports.useChildren = exports.useAction = void 0;
|
|
7
|
-
var use_action_1 = require("./use-action");
|
|
8
|
-
Object.defineProperty(exports, "useAction", { enumerable: true, get: function () { return __importDefault(use_action_1).default; } });
|
|
9
|
-
var use_children_1 = require("./use-children");
|
|
10
|
-
Object.defineProperty(exports, "useChildren", { enumerable: true, get: function () { return __importDefault(use_children_1).default; } });
|
|
11
|
-
var use_columns_1 = require("./use-columns");
|
|
12
|
-
Object.defineProperty(exports, "useColumns", { enumerable: true, get: function () { return __importDefault(use_columns_1).default; } });
|
|
13
|
-
var use_component_1 = require("./use-component");
|
|
14
|
-
Object.defineProperty(exports, "useComponent", { enumerable: true, get: function () { return __importDefault(use_component_1).default; } });
|
|
15
|
-
var use_component_descriptor_1 = require("./use-component-descriptor");
|
|
16
|
-
Object.defineProperty(exports, "useComponentDescriptor", { enumerable: true, get: function () { return __importDefault(use_component_descriptor_1).default; } });
|
|
17
|
-
var use_component_node_1 = require("./use-component-node");
|
|
18
|
-
Object.defineProperty(exports, "useComponentNode", { enumerable: true, get: function () { return __importDefault(use_component_node_1).default; } });
|
|
19
|
-
var use_component_platform_1 = require("./use-component-platform");
|
|
20
|
-
Object.defineProperty(exports, "useComponentPlatform", { enumerable: true, get: function () { return __importDefault(use_component_platform_1).default; } });
|
|
21
|
-
var use_container_1 = require("./use-container");
|
|
22
|
-
Object.defineProperty(exports, "useContainer", { enumerable: true, get: function () { return __importDefault(use_container_1).default; } });
|
|
23
|
-
var use_context_1 = require("./use-context");
|
|
24
|
-
Object.defineProperty(exports, "useContext", { enumerable: true, get: function () { return __importDefault(use_context_1).default; } });
|
|
25
|
-
var use_dispatch_1 = require("./use-dispatch");
|
|
26
|
-
Object.defineProperty(exports, "useDispatch", { enumerable: true, get: function () { return __importDefault(use_dispatch_1).default; } });
|
|
27
|
-
var use_event_listener_1 = require("./use-event-listener");
|
|
28
|
-
Object.defineProperty(exports, "useEventListener", { enumerable: true, get: function () { return __importDefault(use_event_listener_1).default; } });
|
|
29
|
-
var use_events_1 = require("./use-events");
|
|
30
|
-
Object.defineProperty(exports, "useEvents", { enumerable: true, get: function () { return __importDefault(use_events_1).default; } });
|
|
31
|
-
var use_is_mounted_1 = require("./use-is-mounted");
|
|
32
|
-
Object.defineProperty(exports, "useIsMounted", { enumerable: true, get: function () { return __importDefault(use_is_mounted_1).default; } });
|
|
33
|
-
var use_key_press_1 = require("./use-key-press");
|
|
34
|
-
Object.defineProperty(exports, "useKeyPress", { enumerable: true, get: function () { return __importDefault(use_key_press_1).default; } });
|
|
35
|
-
var use_layout_1 = require("./use-layout");
|
|
36
|
-
Object.defineProperty(exports, "useLayout", { enumerable: true, get: function () { return __importDefault(use_layout_1).default; } });
|
|
37
|
-
var use_previous_1 = require("./use-previous");
|
|
38
|
-
Object.defineProperty(exports, "usePrevious", { enumerable: true, get: function () { return __importDefault(use_previous_1).default; } });
|
|
39
|
-
var use_properties_1 = require("./use-properties");
|
|
40
|
-
Object.defineProperty(exports, "useProperties", { enumerable: true, get: function () { return __importDefault(use_properties_1).default; } });
|
|
41
|
-
var use_render_state_1 = require("./use-render-state");
|
|
42
|
-
Object.defineProperty(exports, "useRenderState", { enumerable: true, get: function () { return __importDefault(use_render_state_1).default; } });
|
|
43
|
-
var use_route_data_1 = require("./use-route-data");
|
|
44
|
-
Object.defineProperty(exports, "useRouteData", { enumerable: true, get: function () { return __importDefault(use_route_data_1).default; } });
|
|
45
|
-
var use_router_1 = require("./use-router");
|
|
46
|
-
Object.defineProperty(exports, "useRouter", { enumerable: true, get: function () { return __importDefault(use_router_1).default; } });
|
|
47
|
-
var use_scroll_1 = require("./use-scroll");
|
|
48
|
-
Object.defineProperty(exports, "useScroll", { enumerable: true, get: function () { return __importDefault(use_scroll_1).default; } });
|
|
49
|
-
var use_settings_1 = require("./use-settings");
|
|
50
|
-
Object.defineProperty(exports, "useSettings", { enumerable: true, get: function () { return __importDefault(use_settings_1).default; } });
|
|
51
|
-
var use_toggle_1 = require("./use-toggle");
|
|
52
|
-
Object.defineProperty(exports, "useToggle", { enumerable: true, get: function () { return __importDefault(use_toggle_1).default; } });
|
|
53
|
-
var use_transition_end_1 = require("./use-transition-end");
|
|
54
|
-
Object.defineProperty(exports, "useTransitionEnd", { enumerable: true, get: function () { return __importDefault(use_transition_end_1).default; } });
|
|
55
|
-
var use_unique_menu_1 = require("./use-unique-menu");
|
|
56
|
-
Object.defineProperty(exports, "useUniqueMenu", { enumerable: true, get: function () { return __importDefault(use_unique_menu_1).default; } });
|
|
57
|
-
var use_widget_event_1 = require("./use-widget-event");
|
|
58
|
-
Object.defineProperty(exports, "useWidgetEvent", { enumerable: true, get: function () { return __importDefault(use_widget_event_1).default; } });
|
package/lib/hooks/use-action.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.useAction = void 0;
|
|
7
|
-
var use_component_descriptor_1 = __importDefault(require("./use-component-descriptor"));
|
|
8
|
-
var use_container_1 = __importDefault(require("./use-container"));
|
|
9
|
-
var useAction = function (passedOrigin, passedContainer) {
|
|
10
|
-
var origin = (0, use_component_descriptor_1.default)().id;
|
|
11
|
-
var container = (0, use_container_1.default)();
|
|
12
|
-
return function (action, value) {
|
|
13
|
-
(passedContainer || container)
|
|
14
|
-
.getAsync('actionResolver')
|
|
15
|
-
.then(function (resolver) {
|
|
16
|
-
resolver.action(passedOrigin || origin, action, value);
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
exports.useAction = useAction;
|
|
21
|
-
exports.default = exports.useAction;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
-
if (!m) return o;
|
|
5
|
-
var i = m.call(o), r, ar = [], e;
|
|
6
|
-
try {
|
|
7
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
-
}
|
|
9
|
-
catch (error) { e = { error: error }; }
|
|
10
|
-
finally {
|
|
11
|
-
try {
|
|
12
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
-
}
|
|
14
|
-
finally { if (e) throw e.error; }
|
|
15
|
-
}
|
|
16
|
-
return ar;
|
|
17
|
-
};
|
|
18
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
19
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
20
|
-
};
|
|
21
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
var widget_core_1 = require("@telia-ace/widget-core");
|
|
23
|
-
var react_1 = require("react");
|
|
24
|
-
var use_component_node_1 = __importDefault(require("./use-component-node"));
|
|
25
|
-
var use_component_platform_1 = __importDefault(require("./use-component-platform"));
|
|
26
|
-
var use_is_mounted_1 = __importDefault(require("./use-is-mounted"));
|
|
27
|
-
var useChildren = function () {
|
|
28
|
-
var node = (0, use_component_node_1.default)();
|
|
29
|
-
var components = (0, use_component_platform_1.default)();
|
|
30
|
-
var _a = __read((0, react_1.useState)([]), 2), children = _a[0], setChildren = _a[1];
|
|
31
|
-
var isMounted = (0, use_is_mounted_1.default)();
|
|
32
|
-
var updateChildren = (0, react_1.useCallback)(function (node) {
|
|
33
|
-
if (components && isMounted.current) {
|
|
34
|
-
var branch = components.getBranch(node);
|
|
35
|
-
var children_1 = node.getChildren(branch).map(function (child) { return (0, widget_core_1.asDescriptor)(child); });
|
|
36
|
-
setChildren(children_1);
|
|
37
|
-
}
|
|
38
|
-
}, [isMounted, components, setChildren]);
|
|
39
|
-
(0, react_1.useEffect)(function () {
|
|
40
|
-
if (node) {
|
|
41
|
-
updateChildren(node);
|
|
42
|
-
}
|
|
43
|
-
}, [node, components]);
|
|
44
|
-
(0, react_1.useEffect)(function () {
|
|
45
|
-
if (components) {
|
|
46
|
-
var _a = __read((0, widget_core_1.createEventSubscriber)(components.events), 2), subscribe = _a[0], unsubscribe_1 = _a[1];
|
|
47
|
-
subscribe('components:set-layout', function (event, data) {
|
|
48
|
-
if (node === data.node.parent || data.node.parent === components.nodes.root) {
|
|
49
|
-
updateChildren(data.node.parent);
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
subscribe('components:node-appended', function (event, data) {
|
|
53
|
-
if (node === data.node.parent || data.node.parent === components.nodes.root) {
|
|
54
|
-
updateChildren(data.node.parent);
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
subscribe('components:node-removed', function (event, _a) {
|
|
58
|
-
var parentNode = _a.parentNode;
|
|
59
|
-
if (parentNode === node || parentNode === components.nodes.root) {
|
|
60
|
-
updateChildren(parentNode);
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
return function () {
|
|
64
|
-
unsubscribe_1();
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
}, [node, components, updateChildren]);
|
|
68
|
-
return children;
|
|
69
|
-
};
|
|
70
|
-
exports.default = useChildren;
|
package/lib/hooks/use-columns.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var react_1 = require("react");
|
|
4
|
-
var contexts_1 = require("../contexts");
|
|
5
|
-
var useColumns = function () { return (0, react_1.useContext)(contexts_1.ColumnContext); };
|
|
6
|
-
exports.default = useColumns;
|