@telia-ace/widget-types-grid 1.0.6 → 1.0.9

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.
Files changed (96) hide show
  1. package/{lib-esm → dist}/component-platform-factory.d.ts +0 -0
  2. package/{lib → dist}/index.d.ts +2 -1
  3. package/dist/index.js +1416 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/render.js +95 -0
  6. package/dist/render.js.map +1 -0
  7. package/{lib-esm → dist}/services.d.ts +0 -0
  8. package/{lib-esm → dist}/site-provider.d.ts +0 -0
  9. package/{lib-esm → dist}/ui/animated-view.d.ts +0 -0
  10. package/{lib-esm → dist}/ui/component.d.ts +0 -5
  11. package/{lib-esm → dist}/ui/detached-component.d.ts +0 -0
  12. package/{lib-esm → dist}/ui/determine-slide-direction.d.ts +0 -0
  13. package/{lib-esm → dist}/ui/html-element-handlers.d.ts +0 -0
  14. package/{lib-esm → dist}/ui/index.d.ts +0 -0
  15. package/{lib-esm → dist}/ui/not-found.d.ts +0 -0
  16. package/{lib-esm → dist}/ui/prepare-dom.d.ts +0 -0
  17. package/{lib-esm → dist}/ui/render.d.ts +0 -0
  18. package/{lib-esm → dist}/ui/resolvable-component.d.ts +0 -0
  19. package/dist/ui/styles.d.ts +17 -0
  20. package/{lib-esm → dist}/ui/switch.d.ts +0 -0
  21. package/{lib-esm → dist}/ui/unmount.d.ts +0 -0
  22. package/{lib-esm → dist}/ui/use-component-node-properties.d.ts +0 -0
  23. package/{lib-esm → dist}/ui/use-router.d.ts +0 -0
  24. package/{lib-esm → dist}/ui/view-outlet.d.ts +0 -0
  25. package/{lib-esm → dist}/ui/view.d.ts +0 -0
  26. package/{lib-esm → dist}/ui/wrapper.d.ts +0 -0
  27. package/dist/unmount.js +4 -0
  28. package/dist/unmount.js.map +1 -0
  29. package/{lib-esm → dist}/widget.d.ts +0 -0
  30. package/package.json +16 -15
  31. package/lib/component-platform-factory.d.ts +0 -13
  32. package/lib/component-platform-factory.js +0 -105
  33. package/lib/index.js +0 -16
  34. package/lib/services.d.ts +0 -7
  35. package/lib/services.js +0 -99
  36. package/lib/site-provider.d.ts +0 -5
  37. package/lib/site-provider.js +0 -18
  38. package/lib/ui/animated-view.d.ts +0 -6
  39. package/lib/ui/animated-view.js +0 -142
  40. package/lib/ui/component.d.ts +0 -21
  41. package/lib/ui/component.js +0 -180
  42. package/lib/ui/detached-component.d.ts +0 -7
  43. package/lib/ui/detached-component.js +0 -73
  44. package/lib/ui/determine-slide-direction.d.ts +0 -26
  45. package/lib/ui/determine-slide-direction.js +0 -51
  46. package/lib/ui/html-element-handlers.d.ts +0 -18
  47. package/lib/ui/html-element-handlers.js +0 -128
  48. package/lib/ui/index.d.ts +0 -6
  49. package/lib/ui/index.js +0 -19
  50. package/lib/ui/not-found.d.ts +0 -6
  51. package/lib/ui/not-found.js +0 -83
  52. package/lib/ui/prepare-dom.d.ts +0 -20
  53. package/lib/ui/prepare-dom.js +0 -122
  54. package/lib/ui/render.d.ts +0 -3
  55. package/lib/ui/render.js +0 -11
  56. package/lib/ui/resolvable-component.d.ts +0 -7
  57. package/lib/ui/resolvable-component.js +0 -87
  58. package/lib/ui/switch.d.ts +0 -11
  59. package/lib/ui/switch.js +0 -58
  60. package/lib/ui/unmount.d.ts +0 -2
  61. package/lib/ui/unmount.js +0 -4
  62. package/lib/ui/use-component-node-properties.d.ts +0 -3
  63. package/lib/ui/use-component-node-properties.js +0 -44
  64. package/lib/ui/use-router.d.ts +0 -4
  65. package/lib/ui/use-router.js +0 -32
  66. package/lib/ui/view-outlet.d.ts +0 -32
  67. package/lib/ui/view-outlet.js +0 -151
  68. package/lib/ui/view.d.ts +0 -6
  69. package/lib/ui/view.js +0 -75
  70. package/lib/ui/wrapper.d.ts +0 -7
  71. package/lib/ui/wrapper.js +0 -108
  72. package/lib/widget.d.ts +0 -54
  73. package/lib/widget.js +0 -554
  74. package/lib-esm/component-platform-factory.js +0 -101
  75. package/lib-esm/index.d.ts +0 -4
  76. package/lib-esm/index.js +0 -4
  77. package/lib-esm/services.js +0 -67
  78. package/lib-esm/site-provider.js +0 -14
  79. package/lib-esm/ui/animated-view.js +0 -114
  80. package/lib-esm/ui/component.js +0 -151
  81. package/lib-esm/ui/detached-component.js +0 -45
  82. package/lib-esm/ui/determine-slide-direction.js +0 -46
  83. package/lib-esm/ui/html-element-handlers.js +0 -120
  84. package/lib-esm/ui/index.js +0 -6
  85. package/lib-esm/ui/not-found.js +0 -58
  86. package/lib-esm/ui/prepare-dom.js +0 -116
  87. package/lib-esm/ui/render.js +0 -6
  88. package/lib-esm/ui/resolvable-component.js +0 -62
  89. package/lib-esm/ui/switch.js +0 -53
  90. package/lib-esm/ui/unmount.js +0 -2
  91. package/lib-esm/ui/use-component-node-properties.js +0 -42
  92. package/lib-esm/ui/use-router.js +0 -30
  93. package/lib-esm/ui/view-outlet.js +0 -126
  94. package/lib-esm/ui/view.js +0 -70
  95. package/lib-esm/ui/wrapper.js +0 -80
  96. package/lib-esm/widget.js +0 -551
@@ -1,70 +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 { Grid, useComponentNode, useContainer, useContext, useProperties, useScroll, } from '@telia-ace/widget-ui';
44
- import { appendClassNames } from '@telia-ace/widget-utilities';
45
- import React from 'react';
46
- import styled from 'styled-components';
47
- import Component from './component';
48
- import Switch from './switch';
49
- var StyledView = styled(Grid)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (p) { return !!p.scrollableCss && p.scrollableCss; });
50
- var View = function (_a) {
51
- var _b = _a.className, className = _b === void 0 ? '' : _b, other = __rest(_a, ["className"]);
52
- var properties = useProperties();
53
- var context = useContext();
54
- var container = useContainer();
55
- var node = useComponentNode();
56
- var views = container.get('$settings').views;
57
- var _c = context.gap, gap = _c === void 0 ? '0' : _c;
58
- var _d = properties.columns, columns = _d === void 0 ? 1 : _d, _e = properties.animation, animation = _e === void 0 ? 'none' : _e, _f = properties.scrollable, scrollable = _f === void 0 ? false : _f, areaProperties = __rest(properties, ["columns", "animation", "scrollable"]);
59
- var _g = __read(useScroll(scrollable), 2), scrollableCss = _g[0], elem = _g[1];
60
- if (!node) {
61
- return null;
62
- }
63
- return (React.createElement(StyledView, __assign({}, other, areaProperties, { scrollableCss: scrollableCss, ref: elem, columns: columns, gap: gap, className: appendClassNames(className, 'humany-view') }),
64
- React.createElement(Switch, { views: views, render: function (name) {
65
- var childNode = node.getChildren(name)[0];
66
- return React.createElement(Component, { id: childNode.id, node: childNode, branch: "default" });
67
- } })));
68
- };
69
- export default View;
70
- var templateObject_1;
@@ -1,80 +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 { ContainerContext, RoutingContext, useComponentPlatform } from '@telia-ace/widget-ui';
18
- import { appendClassNames } from '@telia-ace/widget-utilities';
19
- import React, { useEffect, useState } from 'react';
20
- import { Router } from 'react-router-dom';
21
- import Component from './component';
22
- import useRouter from './use-router';
23
- var keyNavigationKeys = ['Tab', 'ArrowDown', 'ArrowUp', 'ArrowRight', 'ArrowLeft'];
24
- var Wrapper = function (_a) {
25
- var container = _a.container;
26
- var components = useComponentPlatform(container);
27
- var router = useRouter(container);
28
- var env = container.get('$environment');
29
- var _b = __read(useState((env === null || env === void 0 ? void 0 : env.container.get('isTabbing')) || false), 2), isTabbing = _b[0], setIsTabbing = _b[1];
30
- var _c = __read(useState(null), 2), entry = _c[0], setEntry = _c[1];
31
- useEffect(function () {
32
- var keydown = function (event) {
33
- if (keyNavigationKeys.indexOf(event.key) > -1) {
34
- if (!isTabbing) {
35
- env === null || env === void 0 ? void 0 : env.container.register('isTabbing', true);
36
- }
37
- setIsTabbing(true);
38
- }
39
- };
40
- var click = function (event) {
41
- if (event.screenX === 0 && event.screenY === 0) {
42
- return;
43
- }
44
- if (isTabbing) {
45
- env === null || env === void 0 ? void 0 : env.container.register('isTabbing', false);
46
- }
47
- setIsTabbing(false);
48
- };
49
- window.addEventListener('keydown', keydown);
50
- window.addEventListener('click', click);
51
- return function () {
52
- window.removeEventListener('keydown', keydown);
53
- window.removeEventListener('click', click);
54
- };
55
- }, []);
56
- useEffect(function () {
57
- if (components) {
58
- setEntry(components.nodes.root.children.default[0].id || null);
59
- var unsubscribe = components.events.subscribe('components:root-children-changed', function (event, _a) {
60
- var node = _a.node;
61
- if (node.parent && node.parent.type === 'root') {
62
- var entry_1 = node.parent.children.default[0].id;
63
- setEntry(entry_1);
64
- }
65
- });
66
- return unsubscribe;
67
- }
68
- }, [components]);
69
- if (!router || !router.history || !components) {
70
- return null;
71
- }
72
- if (!entry) {
73
- return null;
74
- }
75
- return (React.createElement(Router, { history: router.history },
76
- React.createElement(ContainerContext.Provider, { value: container },
77
- React.createElement(RoutingContext.Provider, { value: router },
78
- React.createElement(Component, { className: appendClassNames([isTabbing, 'humany-is-tabbing']), isTabbing: isTabbing, id: entry, branch: "default" })))));
79
- };
80
- export default Wrapper;