@telia-ace/knowledge-widget-components-notification-row 1.0.22 → 1.0.23
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/dist/index.js
CHANGED
|
@@ -15,48 +15,58 @@ import { DataType as D } from "@telia-ace/knowledge-widget-types-grid";
|
|
|
15
15
|
import { createReactComponent as O } from "@telia-ace/knowledge-widget-ui";
|
|
16
16
|
const S = (t) => {
|
|
17
17
|
const { events: e } = t.get("$widget"), [i, u] = x(e);
|
|
18
|
-
return O(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
};
|
|
26
|
-
return r.actions.create("fetch", ({
|
|
27
|
-
error: a,
|
|
28
|
-
topNotifications: o,
|
|
29
|
-
bottomNotifications: f,
|
|
30
|
-
middleNotifications: l
|
|
31
|
-
}) => {
|
|
32
|
-
if (a)
|
|
33
|
-
return r.actions.dispatch("fetched", {
|
|
34
|
-
error: a,
|
|
18
|
+
return O(
|
|
19
|
+
t,
|
|
20
|
+
"notification-row",
|
|
21
|
+
import("./notification-row.7efcaf9d.js"),
|
|
22
|
+
(r) => {
|
|
23
|
+
const c = (a) => {
|
|
24
|
+
r.writeProperties(d(h({}, r.properties()), {
|
|
35
25
|
loading: !0,
|
|
26
|
+
error: void 0,
|
|
36
27
|
notifications: []
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
28
|
+
})), r.actions.dispatch("fetch", { params: a });
|
|
29
|
+
};
|
|
30
|
+
return r.actions.create(
|
|
31
|
+
"fetch",
|
|
32
|
+
({
|
|
33
|
+
error: a,
|
|
34
|
+
topNotifications: o,
|
|
35
|
+
bottomNotifications: f,
|
|
36
|
+
middleNotifications: l
|
|
37
|
+
}) => {
|
|
38
|
+
if (a)
|
|
39
|
+
return r.actions.dispatch("fetched", {
|
|
40
|
+
error: a,
|
|
41
|
+
loading: !0,
|
|
42
|
+
notifications: []
|
|
43
|
+
});
|
|
44
|
+
let s = [];
|
|
45
|
+
const { notifications: w, types: n = [] } = r.properties();
|
|
46
|
+
return n.length ? (n.indexOf("top") > -1 && (s = s.concat(o)), n.indexOf("middle") > -1 && (s = s.concat(l)), n.indexOf("bottom") > -1 && (s = s.concat(f))) : s = o, r.actions.dispatch("fetched", {
|
|
47
|
+
notifications: s.length ? s : w,
|
|
48
|
+
loading: !1
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
), r.actions.create("fetched", (a) => r.writeProperties(d(h({}, a), { loading: !1 }))), t.getAsync("router").then((a) => {
|
|
52
|
+
const { params: o } = a.getRouteData();
|
|
53
|
+
c(o);
|
|
54
|
+
}), i("router:changed", (a, { current: o }) => {
|
|
55
|
+
c(o.routeData.params);
|
|
56
|
+
}), () => {
|
|
57
|
+
u();
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
).then(() => R(t, "notification-row", (r) => {
|
|
61
|
+
r.actions.watch("notification-row.fetch", (c, a) => t.getAsync("dataClient").then(
|
|
62
|
+
(o) => o.fetch(D.RowNotifications, {
|
|
63
|
+
categories: [
|
|
64
|
+
c.params.guideCategory,
|
|
65
|
+
c.params.contactCategory
|
|
66
|
+
].filter((f) => !!f),
|
|
67
|
+
searchPhrase: c.params.phrase
|
|
68
|
+
})
|
|
69
|
+
).then(a).catch((o) => {
|
|
60
70
|
if (o)
|
|
61
71
|
return a(o);
|
|
62
72
|
}));
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/notification-row-component.ts"],"sourcesContent":["import {\r\n createEventSubscriber,\r\n extendComponent,\r\n Notification,\r\n} from '@telia-ace/knowledge-widget-core';\r\nimport { DataClient, DataType, NotificationResults } from '@telia-ace/knowledge-widget-types-grid';\r\nimport { createReactComponent } from '@telia-ace/knowledge-widget-ui';\r\nimport { Container, Widget } from '@webprovisions/platform';\r\n\r\ntype NotificationType = 'top' | 'middle' | 'bottom';\r\nexport type NotificationRowComponentProps = {\r\n types: NotificationType[];\r\n allowPaging?: boolean;\r\n notifications?: Notification[]; // internal\r\n expandable?: boolean;\r\n pageNextAriaLabel?: string;\r\n pagePreviousAriaLabel?: string;\r\n closeAriaLabel?: string;\r\n expandAriaLabel?: string;\r\n};\r\n\r\ntype FetchResults = NotificationResults & { error: any };\r\n\r\nexport const NotificationRowComponent = (container: Container) => {\r\n const { events }: Widget = container.get('$widget');\r\n const [subscribe, unsubscribe] = createEventSubscriber(events);\r\n\r\n return createReactComponent(\r\n container,\r\n 'notification-row',\r\n import('./notification-row'),\r\n (component) => {\r\n const fetch = (params: { [key: string]: any }) => {\r\n component.writeProperties({\r\n ...component.properties<NotificationRowComponentProps>(),\r\n loading: true,\r\n error: undefined,\r\n notifications: [],\r\n });\r\n component.actions.dispatch('fetch', { params });\r\n };\r\n\r\n component.actions.create(\r\n 'fetch',\r\n ({\r\n error,\r\n topNotifications,\r\n bottomNotifications,\r\n middleNotifications,\r\n }: FetchResults) => {\r\n if (error) {\r\n return component.actions.dispatch('fetched', {\r\n error,\r\n loading: true,\r\n notifications: [],\r\n });\r\n }\r\n\r\n let newNotifications: Notification[] = [];\r\n const { notifications, types = [] } =\r\n component.properties<NotificationRowComponentProps>();\r\n if (types.length) {\r\n if (types.indexOf('top') > -1) {\r\n newNotifications = newNotifications.concat(topNotifications);\r\n }\r\n if (types.indexOf('middle') > -1) {\r\n newNotifications = newNotifications.concat(middleNotifications);\r\n }\r\n if (types.indexOf('bottom') > -1) {\r\n newNotifications = newNotifications.concat(bottomNotifications);\r\n }\r\n } else {\r\n newNotifications = topNotifications;\r\n }\r\n\r\n return component.actions.dispatch('fetched', {\r\n notifications: newNotifications.length ? newNotifications : notifications,\r\n loading: false,\r\n });\r\n }\r\n );\r\n\r\n component.actions.create('fetched', (input) => {\r\n return component.writeProperties({ ...input, loading: false });\r\n });\r\n\r\n container.getAsync('router').then((router) => {\r\n const { params } = router.getRouteData();\r\n fetch(params);\r\n });\r\n\r\n subscribe('router:changed', (event: any, { current }: any) => {\r\n fetch(current.routeData.params);\r\n });\r\n\r\n return () => {\r\n unsubscribe();\r\n };\r\n }\r\n )\r\n .then(() => {\r\n return extendComponent(container, 'notification-row', (component) => {\r\n component.actions.watch('notification-row.fetch', (input, next) => {\r\n return container\r\n .getAsync('dataClient')\r\n .then((dataClient: DataClient) =>\r\n dataClient.fetch(DataType.RowNotifications, {\r\n categories: [\r\n input.params.guideCategory,\r\n input.params.contactCategory,\r\n ].filter((c) => !!c),\r\n searchPhrase: input.params.phrase,\r\n })\r\n )\r\n .then(next)\r\n .catch((error) => {\r\n if (error) {\r\n return next(error);\r\n }\r\n });\r\n });\r\n });\r\n })\r\n .then(() => {\r\n unsubscribe();\r\n });\r\n};\r\n\r\nexport default NotificationRowComponent;\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAuBa,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/notification-row-component.ts"],"sourcesContent":["import {\r\n createEventSubscriber,\r\n extendComponent,\r\n Notification,\r\n} from '@telia-ace/knowledge-widget-core';\r\nimport { DataClient, DataType, NotificationResults } from '@telia-ace/knowledge-widget-types-grid';\r\nimport { createReactComponent } from '@telia-ace/knowledge-widget-ui';\r\nimport { Container, Widget } from '@webprovisions/platform';\r\n\r\ntype NotificationType = 'top' | 'middle' | 'bottom';\r\nexport type NotificationRowComponentProps = {\r\n types: NotificationType[];\r\n allowPaging?: boolean;\r\n notifications?: Notification[]; // internal\r\n expandable?: boolean;\r\n pageNextAriaLabel?: string;\r\n pagePreviousAriaLabel?: string;\r\n closeAriaLabel?: string;\r\n expandAriaLabel?: string;\r\n};\r\n\r\ntype FetchResults = NotificationResults & { error: any };\r\n\r\nexport const NotificationRowComponent = (container: Container) => {\r\n const { events }: Widget = container.get('$widget');\r\n const [subscribe, unsubscribe] = createEventSubscriber(events);\r\n\r\n return createReactComponent(\r\n container,\r\n 'notification-row',\r\n import('./notification-row'),\r\n (component) => {\r\n const fetch = (params: { [key: string]: any }) => {\r\n component.writeProperties({\r\n ...component.properties<NotificationRowComponentProps>(),\r\n loading: true,\r\n error: undefined,\r\n notifications: [],\r\n });\r\n component.actions.dispatch('fetch', { params });\r\n };\r\n\r\n component.actions.create(\r\n 'fetch',\r\n ({\r\n error,\r\n topNotifications,\r\n bottomNotifications,\r\n middleNotifications,\r\n }: FetchResults) => {\r\n if (error) {\r\n return component.actions.dispatch('fetched', {\r\n error,\r\n loading: true,\r\n notifications: [],\r\n });\r\n }\r\n\r\n let newNotifications: Notification[] = [];\r\n const { notifications, types = [] } =\r\n component.properties<NotificationRowComponentProps>();\r\n if (types.length) {\r\n if (types.indexOf('top') > -1) {\r\n newNotifications = newNotifications.concat(topNotifications);\r\n }\r\n if (types.indexOf('middle') > -1) {\r\n newNotifications = newNotifications.concat(middleNotifications);\r\n }\r\n if (types.indexOf('bottom') > -1) {\r\n newNotifications = newNotifications.concat(bottomNotifications);\r\n }\r\n } else {\r\n newNotifications = topNotifications;\r\n }\r\n\r\n return component.actions.dispatch('fetched', {\r\n notifications: newNotifications.length ? newNotifications : notifications,\r\n loading: false,\r\n });\r\n }\r\n );\r\n\r\n component.actions.create('fetched', (input) => {\r\n return component.writeProperties({ ...input, loading: false });\r\n });\r\n\r\n container.getAsync('router').then((router) => {\r\n const { params } = router.getRouteData();\r\n fetch(params);\r\n });\r\n\r\n subscribe('router:changed', (event: any, { current }: any) => {\r\n fetch(current.routeData.params);\r\n });\r\n\r\n return () => {\r\n unsubscribe();\r\n };\r\n }\r\n )\r\n .then(() => {\r\n return extendComponent(container, 'notification-row', (component) => {\r\n component.actions.watch('notification-row.fetch', (input, next) => {\r\n return container\r\n .getAsync('dataClient')\r\n .then((dataClient: DataClient) =>\r\n dataClient.fetch(DataType.RowNotifications, {\r\n categories: [\r\n input.params.guideCategory,\r\n input.params.contactCategory,\r\n ].filter((c) => !!c),\r\n searchPhrase: input.params.phrase,\r\n })\r\n )\r\n .then(next)\r\n .catch((error) => {\r\n if (error) {\r\n return next(error);\r\n }\r\n });\r\n });\r\n });\r\n })\r\n .then(() => {\r\n unsubscribe();\r\n });\r\n};\r\n\r\nexport default NotificationRowComponent;\r\n"],"names":["NotificationRowComponent","container","events","subscribe","unsubscribe","createEventSubscriber","createReactComponent","component","fetch","params","__spreadProps","__spreadValues","error","topNotifications","bottomNotifications","middleNotifications","newNotifications","notifications","types","input","router","event","current","extendComponent","next","dataClient","DataType","c"],"mappings":";;;;;;;;;;;;;;;AAuBa,MAAAA,IAA2B,CAACC,MAAyB;AAC9D,QAAM,EAAE,QAAAC,EAAmB,IAAAD,EAAU,IAAI,SAAS,GAC5C,CAACE,GAAWC,CAAW,IAAIC,EAAsBH,CAAM;AAEtD,SAAAI;AAAA,IACHL;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP,CAACM,MAAc;AACL,YAAAC,IAAQ,CAACC,MAAmC;AAC9C,QAAAF,EAAU,gBAAgBG,EAAAC,EAAA,IACnBJ,EAAU,WAA0C,IADjC;AAAA,UAEtB,SAAS;AAAA,UACT,OAAO;AAAA,UACP,eAAe,CAAC;AAAA,QAAA,EACnB,GACDA,EAAU,QAAQ,SAAS,SAAS,EAAE,QAAAE,EAAQ,CAAA;AAAA,MAAA;AAGlD,aAAAF,EAAU,QAAQ;AAAA,QACd;AAAA,QACA,CAAC;AAAA,UACG,OAAAK;AAAA,UACA,kBAAAC;AAAA,UACA,qBAAAC;AAAA,UACA,qBAAAC;AAAA,QAAA,MACgB;AAChB,cAAIH;AACO,mBAAAL,EAAU,QAAQ,SAAS,WAAW;AAAA,cACzC,OAAAK;AAAA,c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AO,CAACQ,MAAM,CAAC,CAACA,CAAC;AAAA,QACnB,cAAcR,EAAM,OAAO;AAAA,MAAA,CAC9B;AAAA,MAEJ,KAAKK,CAAI,EACT,MAAM,CAACZ,MAAU;AACd,UAAIA;AACA,eAAOY,EAAKZ,CAAK;AAAA,IACrB,CACH,CACR;AAAA,EAAA,CACJ,CACJ,EACA,KAAK,MAAM;AACI,IAAAR;EAAA,CACf;AACT;"}
|
|
@@ -1,126 +1,134 @@
|
|
|
1
1
|
var V = Object.defineProperty, X = Object.defineProperties;
|
|
2
2
|
var Z = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var y = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var L = Object.prototype.hasOwnProperty, N = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var I = (e, t, a) => t in e ? V(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a, f = (e, t) => {
|
|
6
6
|
for (var a in t || (t = {}))
|
|
7
|
-
|
|
7
|
+
L.call(t, a) && I(e, a, t[a]);
|
|
8
8
|
if (y)
|
|
9
9
|
for (var a of y(t))
|
|
10
|
-
|
|
10
|
+
N.call(t, a) && I(e, a, t[a]);
|
|
11
11
|
return e;
|
|
12
12
|
}, g = (e, t) => X(e, Z(t));
|
|
13
13
|
var k = (e, t) => {
|
|
14
14
|
var a = {};
|
|
15
15
|
for (var n in e)
|
|
16
|
-
|
|
16
|
+
L.call(e, n) && t.indexOf(n) < 0 && (a[n] = e[n]);
|
|
17
17
|
if (e != null && y)
|
|
18
18
|
for (var n of y(e))
|
|
19
|
-
t.indexOf(n) < 0 &&
|
|
19
|
+
t.indexOf(n) < 0 && N.call(e, n) && (a[n] = e[n]);
|
|
20
20
|
return a;
|
|
21
21
|
};
|
|
22
|
-
import { useProperties as ee, useContainer as te, createEmptyComponent as
|
|
23
|
-
import { readStorage as
|
|
22
|
+
import { useProperties as ee, useContainer as te, createEmptyComponent as R, SymbolBadge as F, genericHtml as ae, linkTabStyle as ne, borderTabStyle as G, Html as oe, Button as ie } from "@telia-ace/knowledge-widget-ui";
|
|
23
|
+
import { readStorage as T, StorageMedium as W, createStorageWriter as le, StorageCategory as re } from "@telia-ace/widget-services";
|
|
24
24
|
import { appendClassNames as w } from "@telia-ace/widget-utilities";
|
|
25
|
-
import
|
|
26
|
-
import c, { css as
|
|
25
|
+
import i, { useState as $, useEffect as K } from "react";
|
|
26
|
+
import c, { css as h } from "styled-components";
|
|
27
27
|
const z = "closed-notifications", se = {
|
|
28
28
|
transform: {
|
|
29
29
|
a: (a) => {
|
|
30
30
|
var n = a, { children: e } = n, t = k(n, ["children"]);
|
|
31
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ i.createElement("a", g(f({}, t), {
|
|
32
32
|
tabIndex: -1
|
|
33
33
|
}), e);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
},
|
|
36
|
+
}, he = (a) => {
|
|
37
37
|
var n = a, { className: e } = n, t = k(n, ["className"]);
|
|
38
38
|
const {
|
|
39
39
|
types: O = [],
|
|
40
|
-
allowPaging:
|
|
40
|
+
allowPaging: A = !0,
|
|
41
41
|
notifications: M = [],
|
|
42
42
|
expandable: m = !1,
|
|
43
43
|
closeAriaLabel: Y = "",
|
|
44
44
|
pageNextAriaLabel: _ = "",
|
|
45
45
|
pagePreviousAriaLabel: q = "",
|
|
46
46
|
expandAriaLabel: J = ""
|
|
47
|
-
} = ee(), [b, Q] = $(!1), [x,
|
|
47
|
+
} = ee(), [b, Q] = $(!1), [x, B] = $([]), [l, v] = $(0), r = te(), [E, U] = $();
|
|
48
48
|
K(() => {
|
|
49
|
-
r && (
|
|
49
|
+
r && (T(r, z, W.Session).then(
|
|
50
|
+
(o = []) => B(o)
|
|
51
|
+
), le(r, z, re.Functional).then(
|
|
52
|
+
(o) => U(() => o)
|
|
53
|
+
));
|
|
50
54
|
}, [r]), K(() => {
|
|
51
|
-
r &&
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
r && T(r, z, W.Session).then(
|
|
56
|
+
(o = []) => {
|
|
57
|
+
x.forEach(
|
|
58
|
+
(s) => o.indexOf(s) === -1 && o.push(s)
|
|
59
|
+
), E && E(o);
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
}, [x, r, E]);
|
|
63
|
+
const d = M.filter(({ id: o }) => x.indexOf(o) === -1), { length: p } = d;
|
|
56
64
|
if (!d.length)
|
|
57
|
-
return
|
|
65
|
+
return R(r, g(f({}, t), {
|
|
58
66
|
className: w(e, "humany-notification-row")
|
|
59
67
|
}));
|
|
60
|
-
if (
|
|
61
|
-
const
|
|
62
|
-
if (!
|
|
63
|
-
return
|
|
68
|
+
if (A) {
|
|
69
|
+
const o = d[l] || d[l + 1] || d[l - 1];
|
|
70
|
+
if (!o)
|
|
71
|
+
return R(r, g(f({}, t), {
|
|
64
72
|
className: w(e, "humany-notification-row")
|
|
65
73
|
}));
|
|
66
|
-
const { id: s, body: S } =
|
|
67
|
-
return /* @__PURE__ */
|
|
74
|
+
const { id: s, body: S } = o || {}, H = () => Q(!b);
|
|
75
|
+
return /* @__PURE__ */ i.createElement(j, g(f({}, t), {
|
|
68
76
|
"aria-expanded": m ? b : !0,
|
|
69
77
|
"aria-label": J,
|
|
70
78
|
tabIndex: m ? 0 : -1,
|
|
71
79
|
className: w(e, "humany-notification-row"),
|
|
72
80
|
"data-pageable": p > 1,
|
|
73
81
|
"data-types": O,
|
|
74
|
-
"data-allow-paging":
|
|
82
|
+
"data-allow-paging": A,
|
|
75
83
|
"data-expandable": m,
|
|
76
|
-
onKeyDown: (
|
|
77
|
-
|
|
84
|
+
onKeyDown: (u) => {
|
|
85
|
+
u.key === "Enter" && H();
|
|
78
86
|
},
|
|
79
|
-
onClick:
|
|
80
|
-
}), /* @__PURE__ */
|
|
87
|
+
onClick: H
|
|
88
|
+
}), /* @__PURE__ */ i.createElement(ce, {
|
|
81
89
|
"aria-label": Y,
|
|
82
90
|
onClick: () => {
|
|
83
|
-
|
|
91
|
+
v(d.indexOf(o)), B([...x, s]);
|
|
84
92
|
}
|
|
85
|
-
}, /* @__PURE__ */
|
|
93
|
+
}, /* @__PURE__ */ i.createElement(F, {
|
|
86
94
|
symbol: { type: "Svg", content: "close" }
|
|
87
|
-
})), /* @__PURE__ */
|
|
95
|
+
})), /* @__PURE__ */ i.createElement(C, {
|
|
88
96
|
htmlParseInstruction: !m || b ? void 0 : se,
|
|
89
97
|
"data-pageable": p > 1,
|
|
90
98
|
"data-notification": s,
|
|
91
99
|
"data-expandable": m,
|
|
92
100
|
"data-expanded": b,
|
|
93
101
|
html: S
|
|
94
|
-
}), p > 1 && /* @__PURE__ */
|
|
102
|
+
}), p > 1 && /* @__PURE__ */ i.createElement(de, null, /* @__PURE__ */ i.createElement(P, {
|
|
95
103
|
"aria-label": q,
|
|
96
104
|
"data-disabled": l === 0,
|
|
97
|
-
onClick: (
|
|
98
|
-
|
|
105
|
+
onClick: (u) => {
|
|
106
|
+
u.stopPropagation(), l > 0 && v(l - 1);
|
|
99
107
|
}
|
|
100
|
-
}, /* @__PURE__ */
|
|
108
|
+
}, /* @__PURE__ */ i.createElement(D, {
|
|
101
109
|
size: 10,
|
|
102
110
|
symbol: { type: "Svg", content: "caret-left" }
|
|
103
|
-
})), /* @__PURE__ */
|
|
111
|
+
})), /* @__PURE__ */ i.createElement("span", null, l + 1, "/", p), /* @__PURE__ */ i.createElement(P, {
|
|
104
112
|
"aria-label": _,
|
|
105
113
|
"data-disabled": l + 1 >= p,
|
|
106
|
-
onClick: (
|
|
107
|
-
|
|
114
|
+
onClick: (u) => {
|
|
115
|
+
u.stopPropagation(), l < p - 1 && v(l + 1);
|
|
108
116
|
}
|
|
109
|
-
}, /* @__PURE__ */
|
|
117
|
+
}, /* @__PURE__ */ i.createElement(D, {
|
|
110
118
|
size: 10,
|
|
111
119
|
symbol: { type: "Svg", content: "caret-right" }
|
|
112
120
|
}))));
|
|
113
121
|
}
|
|
114
|
-
return /* @__PURE__ */
|
|
122
|
+
return /* @__PURE__ */ i.createElement(j, g(f({}, t), {
|
|
115
123
|
className: w(e, "humany-notification-row"),
|
|
116
124
|
"data-pageable": !1,
|
|
117
125
|
"data-types": O,
|
|
118
126
|
"data-allow-paging": !1
|
|
119
|
-
}), d.map((
|
|
120
|
-
if (!
|
|
127
|
+
}), d.map((o) => {
|
|
128
|
+
if (!o)
|
|
121
129
|
return null;
|
|
122
|
-
const { id: s, body: S } =
|
|
123
|
-
return /* @__PURE__ */
|
|
130
|
+
const { id: s, body: S } = o;
|
|
131
|
+
return /* @__PURE__ */ i.createElement(C, {
|
|
124
132
|
key: s,
|
|
125
133
|
"data-pageable": !1,
|
|
126
134
|
"data-expandable": m,
|
|
@@ -131,7 +139,10 @@ const z = "closed-notifications", se = {
|
|
|
131
139
|
}));
|
|
132
140
|
}, j = c.div`
|
|
133
141
|
${ae}
|
|
134
|
-
padding: ${(e) =>
|
|
142
|
+
padding: ${(e) => {
|
|
143
|
+
var t;
|
|
144
|
+
return (t = e.theme.sizes) == null ? void 0 : t.normal;
|
|
145
|
+
}} ${(e) => {
|
|
135
146
|
var t;
|
|
136
147
|
return ((t = e.theme.sizes) == null ? void 0 : t.cardinal) * 12;
|
|
137
148
|
}}px;
|
|
@@ -163,17 +174,14 @@ const z = "closed-notifications", se = {
|
|
|
163
174
|
var t;
|
|
164
175
|
return (t = e.theme.colors) == null ? void 0 : t.link;
|
|
165
176
|
}};
|
|
166
|
-
&:focus {
|
|
167
|
-
${
|
|
168
|
-
var t;
|
|
169
|
-
return ((t = e.theme.accessibility) == null ? void 0 : t.isTabbing) && ne;
|
|
170
|
-
}}
|
|
177
|
+
&:focus-visible {
|
|
178
|
+
${ne}
|
|
171
179
|
}
|
|
172
180
|
}
|
|
173
181
|
|
|
174
182
|
${(e) => {
|
|
175
183
|
var t;
|
|
176
|
-
return !e["data-allow-paging"] &&
|
|
184
|
+
return !e["data-allow-paging"] && h`
|
|
177
185
|
flex-wrap: wrap;
|
|
178
186
|
|
|
179
187
|
> div {
|
|
@@ -183,17 +191,14 @@ const z = "closed-notifications", se = {
|
|
|
183
191
|
`;
|
|
184
192
|
}};
|
|
185
193
|
|
|
186
|
-
${(e) =>
|
|
187
|
-
|
|
188
|
-
return ((t = e.theme.accessibility) == null ? void 0 : t.isTabbing) && u`
|
|
189
|
-
&:focus {
|
|
194
|
+
${(e) => h`
|
|
195
|
+
&:focus-visible {
|
|
190
196
|
${C} {
|
|
191
197
|
${G}
|
|
192
198
|
}
|
|
193
199
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
`, C = c(ie)`
|
|
200
|
+
`}
|
|
201
|
+
`, C = c(oe)`
|
|
197
202
|
flex: 1;
|
|
198
203
|
font-size: ${(e) => {
|
|
199
204
|
var t;
|
|
@@ -202,7 +207,7 @@ const z = "closed-notifications", se = {
|
|
|
202
207
|
line-height: 1.6em;
|
|
203
208
|
font-weight: 300;
|
|
204
209
|
|
|
205
|
-
${(e) => e["data-expandable"] && !e["data-expanded"] &&
|
|
210
|
+
${(e) => e["data-expandable"] && !e["data-expanded"] && h`
|
|
206
211
|
max-width: 100%;
|
|
207
212
|
|
|
208
213
|
p {
|
|
@@ -228,7 +233,7 @@ const z = "closed-notifications", se = {
|
|
|
228
233
|
width: 30px;
|
|
229
234
|
text-align: center;
|
|
230
235
|
}
|
|
231
|
-
`, P = c(
|
|
236
|
+
`, P = c(ie)`
|
|
232
237
|
background-color: transparent;
|
|
233
238
|
border: none;
|
|
234
239
|
cursor: pointer;
|
|
@@ -242,16 +247,13 @@ const z = "closed-notifications", se = {
|
|
|
242
247
|
display: block;
|
|
243
248
|
}
|
|
244
249
|
|
|
245
|
-
&:focus {
|
|
246
|
-
${
|
|
247
|
-
var t;
|
|
248
|
-
return ((t = e.theme.accessibility) == null ? void 0 : t.isTabbing) && G;
|
|
249
|
-
}}
|
|
250
|
+
&:focus-visible {
|
|
251
|
+
${G}
|
|
250
252
|
}
|
|
251
253
|
|
|
252
|
-
${(e) => e["data-disabled"] ?
|
|
254
|
+
${(e) => e["data-disabled"] ? h`
|
|
253
255
|
opacity: 0.8;
|
|
254
|
-
` :
|
|
256
|
+
` : h`
|
|
255
257
|
@media (hover) {
|
|
256
258
|
&:hover {
|
|
257
259
|
opacity: 0.5;
|
|
@@ -267,7 +269,8 @@ const z = "closed-notifications", se = {
|
|
|
267
269
|
padding: ${(e) => {
|
|
268
270
|
var t, a;
|
|
269
271
|
return `calc(${(t = e.theme.sizes) == null ? void 0 : t.small}/2) ${(a = e.theme.sizes) == null ? void 0 : a.small}`;
|
|
270
|
-
}}
|
|
272
|
+
}};
|
|
273
|
+
svg {
|
|
271
274
|
vertical-align: middle;
|
|
272
275
|
line,
|
|
273
276
|
path {
|
|
@@ -286,6 +289,6 @@ c.div`
|
|
|
286
289
|
display: none;
|
|
287
290
|
`;
|
|
288
291
|
export {
|
|
289
|
-
|
|
292
|
+
he as default
|
|
290
293
|
};
|
|
291
|
-
//# sourceMappingURL=notification-row.
|
|
294
|
+
//# sourceMappingURL=notification-row.7efcaf9d.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-row.7efcaf9d.js","sources":["../src/notification-row.tsx"],"sourcesContent":["import {\r\n borderTabStyle,\r\n Button,\r\n createEmptyComponent,\r\n genericHtml,\r\n Html,\r\n linkTabStyle,\r\n SymbolBadge,\r\n useContainer,\r\n useProperties,\r\n} from '@telia-ace/knowledge-widget-ui';\r\nimport {\r\n createStorageWriter,\r\n readStorage,\r\n StorageCategory,\r\n StorageMedium,\r\n StorageWriter,\r\n} from '@telia-ace/widget-services';\r\nimport { appendClassNames } from '@telia-ace/widget-utilities';\r\nimport React, { useEffect, useState } from 'react';\r\nimport styled, { css } from 'styled-components';\r\nimport { NotificationRowComponentProps } from './notification-row-component';\r\n\r\ntype Props = {\r\n className: string;\r\n};\r\n\r\nconst STORAGE_KEY = 'closed-notifications';\r\n\r\nconst infocusableHtml = {\r\n transform: {\r\n a: ({ children, ...props }: React.ComponentProps<'a'>) => (\r\n <a {...props} tabIndex={-1}>\r\n {children}\r\n </a>\r\n ),\r\n },\r\n};\r\n\r\nconst NotificationRow: React.SFC<Props> = ({ className, ...other }) => {\r\n const {\r\n types = [],\r\n allowPaging = true,\r\n notifications = [],\r\n expandable = false,\r\n closeAriaLabel = '',\r\n pageNextAriaLabel = '',\r\n pagePreviousAriaLabel = '',\r\n expandAriaLabel = '',\r\n } = useProperties<NotificationRowComponentProps>();\r\n const [expanded, setExpanded] = useState(false);\r\n const [closed, setClosed] = useState<string[]>([]);\r\n const [index, setIndex] = useState(0);\r\n\r\n const container = useContainer();\r\n const [write, setWriter] = useState<StorageWriter | undefined>();\r\n\r\n useEffect(() => {\r\n if (container) {\r\n readStorage<string[]>(container, STORAGE_KEY, StorageMedium.Session).then(\r\n (closed = []) => setClosed(closed)\r\n );\r\n\r\n createStorageWriter(container, STORAGE_KEY, StorageCategory.Functional).then((writer) =>\r\n setWriter(() => writer)\r\n );\r\n }\r\n }, [container]);\r\n\r\n useEffect(() => {\r\n if (container) {\r\n readStorage<string[]>(container, STORAGE_KEY, StorageMedium.Session).then(\r\n (storedClosed = []) => {\r\n closed.forEach(\r\n (id) => storedClosed.indexOf(id) === -1 && storedClosed.push(id)\r\n );\r\n if (write) {\r\n write(storedClosed);\r\n }\r\n }\r\n );\r\n }\r\n }, [closed, container, write]);\r\n\r\n const filtered = notifications.filter(({ id }) => closed.indexOf(id) === -1);\r\n\r\n const { length } = filtered;\r\n\r\n if (!filtered.length) {\r\n return createEmptyComponent(container, {\r\n ...other,\r\n className: appendClassNames(className, 'humany-notification-row'),\r\n });\r\n }\r\n\r\n if (allowPaging) {\r\n const notification = filtered[index] || filtered[index + 1] || filtered[index - 1];\r\n\r\n if (!notification) {\r\n return createEmptyComponent(container, {\r\n ...other,\r\n className: appendClassNames(className, 'humany-notification-row'),\r\n });\r\n }\r\n\r\n const { id, body } = notification || {};\r\n const toggleExpand = () => setExpanded(!expanded);\r\n\r\n return (\r\n <Wrapper\r\n {...other}\r\n aria-expanded={expandable ? expanded : true}\r\n aria-label={expandAriaLabel}\r\n tabIndex={expandable ? 0 : -1}\r\n className={appendClassNames(className, 'humany-notification-row')}\r\n data-pageable={length > 1}\r\n data-types={types}\r\n data-allow-paging={allowPaging}\r\n data-expandable={expandable}\r\n onKeyDown={(e: React.KeyboardEvent) => {\r\n if (e.key === 'Enter') {\r\n toggleExpand();\r\n }\r\n }}\r\n onClick={toggleExpand}\r\n >\r\n <CloseButton\r\n aria-label={closeAriaLabel}\r\n onClick={() => {\r\n setIndex(filtered.indexOf(notification));\r\n setClosed([...closed, id]);\r\n }}\r\n >\r\n <SymbolBadge symbol={{ type: 'Svg', content: 'close' }} />\r\n </CloseButton>\r\n <StyledHtml\r\n htmlParseInstruction={!expandable || expanded ? undefined : infocusableHtml}\r\n data-pageable={length > 1}\r\n data-notification={id}\r\n data-expandable={expandable}\r\n data-expanded={expanded}\r\n html={body}\r\n />\r\n {length > 1 && (\r\n <Pager>\r\n <StyledButton\r\n aria-label={pagePreviousAriaLabel}\r\n data-disabled={index === 0}\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n if (index > 0) {\r\n setIndex(index - 1);\r\n }\r\n }}\r\n >\r\n <StyledSymbolBadge\r\n size={10}\r\n symbol={{ type: 'Svg', content: 'caret-left' }}\r\n />\r\n </StyledButton>\r\n <span>\r\n {index + 1}/{length}\r\n </span>\r\n <StyledButton\r\n aria-label={pageNextAriaLabel}\r\n data-disabled={index + 1 >= length}\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n if (index < length - 1) {\r\n setIndex(index + 1);\r\n }\r\n }}\r\n >\r\n <StyledSymbolBadge\r\n size={10}\r\n symbol={{ type: 'Svg', content: 'caret-right' }}\r\n />\r\n </StyledButton>\r\n </Pager>\r\n )}\r\n </Wrapper>\r\n );\r\n }\r\n\r\n return (\r\n <Wrapper\r\n {...other}\r\n className={appendClassNames(className, 'humany-notification-row')}\r\n data-pageable={false}\r\n data-types={types}\r\n data-allow-paging={false}\r\n >\r\n {filtered.map((notification) => {\r\n if (!notification) {\r\n return null;\r\n }\r\n\r\n const { id, body } = notification;\r\n\r\n return (\r\n <StyledHtml\r\n key={id}\r\n data-pageable={false}\r\n data-expandable={expandable}\r\n data-expanded={expanded}\r\n data-notification={id}\r\n html={body}\r\n />\r\n );\r\n })}\r\n </Wrapper>\r\n );\r\n};\r\n\r\nconst Wrapper = styled.div<{ 'data-types': string[]; 'data-allow-paging': boolean } & any>`\r\n ${genericHtml}\r\n padding: ${(p) => p.theme.sizes?.normal} ${(p) => p.theme.sizes?.cardinal * 12}px;\r\n background-color: ${(p) => {\r\n if (p['data-types'].length) {\r\n if (p['data-types'].indexOf('top') > -1) {\r\n return p.theme.colors?.warning;\r\n }\r\n if (p['data-types'].indexOf('bottom') > -1) {\r\n return 'transparent';\r\n }\r\n\r\n return p.theme.colors?.primary;\r\n }\r\n return p.theme.colors?.warning;\r\n }};\r\n color: ${(p) => p.theme.colors?.text};\r\n border-radius: ${(p) => p.theme.borderRadius};\r\n text-align: center;\r\n display: flex;\r\n flex-direction: column;\r\n position: relative;\r\n cursor: ${(p) => (p['data-expandable'] ? 'pointer' : 'default')};\r\n overflow: hidden;\r\n\r\n i {\r\n color: ${(p) => p.theme.colors?.text};\r\n }\r\n\r\n a {\r\n color: ${(p) => p.theme.colors?.link};\r\n &:focus-visible {\r\n ${linkTabStyle}\r\n }\r\n }\r\n\r\n ${(p) =>\r\n !p['data-allow-paging'] &&\r\n css`\r\n flex-wrap: wrap;\r\n\r\n > div {\r\n min-width: 100%;\r\n margin: ${p.theme.sizes?.cardinal * 2}px;\r\n }\r\n `};\r\n\r\n ${(p) =>\r\n css`\r\n &:focus-visible {\r\n ${StyledHtml} {\r\n ${borderTabStyle}\r\n }\r\n }\r\n `}\r\n`;\r\n\r\nconst StyledHtml = styled(Html)<{\r\n 'data-pageable': boolean;\r\n 'data-expandable': boolean;\r\n 'data-expanded': boolean;\r\n}>`\r\n flex: 1;\r\n font-size: ${(p) => p.theme.fonts?.normal};\r\n line-height: 1.6em;\r\n font-weight: 300;\r\n\r\n ${(p) =>\r\n p['data-expandable'] &&\r\n !p['data-expanded'] &&\r\n css`\r\n max-width: 100%;\r\n\r\n p {\r\n display: none;\r\n &:first-child {\r\n display: block;\r\n margin-bottom: 0;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n }\r\n }\r\n `}\r\n`;\r\n\r\nconst Pager = styled.div`\r\n text-align: center;\r\n width: 100%;\r\n span {\r\n font-size: ${(p) => p.theme.fonts?.small};\r\n display: inline-block;\r\n width: 30px;\r\n text-align: center;\r\n }\r\n`;\r\n\r\nconst StyledButton = styled(Button)<{ 'data-disabled'?: boolean }>`\r\n background-color: transparent;\r\n border: none;\r\n cursor: pointer;\r\n transition: opacity 200ms ease-out;\r\n justify-self: flex-end;\r\n align-self: flex-start;\r\n padding: ${(p) => p.theme.sizes?.small} svg {\r\n display: block;\r\n }\r\n\r\n &:focus-visible {\r\n ${borderTabStyle}\r\n }\r\n\r\n ${(p) =>\r\n p['data-disabled']\r\n ? css`\r\n opacity: 0.8;\r\n `\r\n : css`\r\n @media (hover) {\r\n &:hover {\r\n opacity: 0.5;\r\n }\r\n }\r\n `}\r\n`;\r\n\r\nconst CloseButton = styled(StyledButton)`\r\n position: absolute;\r\n top: 7.5px;\r\n right: 7.5px;\r\n width: 25px;\r\n height: auto;\r\n padding: ${(p) => `calc(${p.theme.sizes?.small}/2) ${p.theme.sizes?.small}`};\r\n svg {\r\n vertical-align: middle;\r\n line,\r\n path {\r\n stroke: ${(p) => p.theme.colors?.text};\r\n }\r\n }\r\n`;\r\n\r\nconst StyledSymbolBadge = styled(SymbolBadge)`\r\n line {\r\n stroke: #ffffff;\r\n }\r\n`;\r\n\r\nconst Empty = styled.div`\r\n display: none;\r\n`;\r\n\r\nexport default NotificationRow;\r\n"],"names":["STORAGE_KEY","infocusableHtml","_a","_b","children","props","__objRest","React","__spreadProps","__spreadValues","NotificationRow","className","other","types","allowPaging","notifications","expandable","closeAriaLabel","pageNextAriaLabel","pagePreviousAriaLabel","expandAriaLabel","useProperties","expanded","setExpanded","useState","closed","setClosed","index","setIndex","container","useContainer","write","setWriter","useEffect","readStorage","StorageMedium","createStorageWriter","StorageCategory","writer","storedClosed","id","filtered","length","createEmptyComponent","appendClassNames","notification","body","toggleExpand","Wrapper","e","CloseButton","SymbolBadge","StyledHtml","Pager","StyledButton","StyledSymbolBadge","styled","genericHtml","p","_c","linkTabStyle","css","borderTabStyle","Html","Button"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAMA,IAAc,wBAEdC,KAAkB;AAAA,EACpB,WAAW;AAAA,IACP,GAAG,CAACC;AAAA,UAAAC,IAAAD,GAAE,YAAAE,MAAFD,GAAeE,IAAAC,EAAfH,GAAe,CAAb;AACD,6BAAAI,EAAA,cAAA,KAAAC,EAAAC,EAAA,IAAMJ,IAAN;AAAA,QAAa,UAAU;AAAA,MAAA,IACnBD,CACL;AAAA;AAAA,EAER;AACJ,GAEMM,KAAoC,CAACR,MAA4B;AAA5B,MAAAC,IAAAD,GAAE,aAAAS,MAAFR,GAAgBS,IAAAN,EAAhBH,GAAgB,CAAd;AACnC,QAAA;AAAA,IACF,OAAAU,IAAQ,CAAC;AAAA,IACT,aAAAC,IAAc;AAAA,IACd,eAAAC,IAAgB,CAAC;AAAA,IACjB,YAAAC,IAAa;AAAA,IACb,gBAAAC,IAAiB;AAAA,IACjB,mBAAAC,IAAoB;AAAA,IACpB,uBAAAC,IAAwB;AAAA,IACxB,iBAAAC,IAAkB;AAAA,MAClBC,GAA6C,GAC3C,CAACC,GAAUC,CAAW,IAAIC,EAAS,EAAK,GACxC,CAACC,GAAQC,CAAS,IAAIF,EAAmB,CAAE,CAAA,GAC3C,CAACG,GAAOC,CAAQ,IAAIJ,EAAS,CAAC,GAE9BK,IAAYC,MACZ,CAACC,GAAOC,CAAS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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAgBFR,KAAQG,EAAO;AAAA;AAAA;AAAA;AAAA,qBAIA,CAACE,MAAM;;AAAA,UAAAxD,IAAAwD,EAAE,MAAM,UAAR,gBAAAxD,EAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAOrCoD,IAAeE,EAAOQ,EAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAOnB,CAACN,MAAM;;AAAA,UAAAxD,IAAAwD,EAAE,MAAM,UAAR,gBAAAxD,EAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAK3B4D;AAAA;AAAA;AAAA,MAGJ,CAACJ,MACCA,EAAE,mBACIG;AAAA;AAAA,kBAGAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GASRX,KAAcM,EAAOF,CAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAMxB,CAACI,MAAM;;AAAA,kBAAQxD,IAAAwD,EAAE,MAAM,UAAR,gBAAAxD,EAAe,aAAYC,IAAAuD,EAAE,MAAM,UAAR,gBAAAvD,EAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAKlD,CAACuD,MAAM;;AAAA,UAAAxD,IAAAwD,EAAE,MAAM,WAAR,gBAAAxD,EAAgB;AAAA;AAAA;AAAA;AAAA,GAKvCqD,IAAoBC,EAAOL,CAAW;AAAA;AAAA;AAAA;AAAA;AAM9BK,EAAO;AAAA;AAAA;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/knowledge-widget-components-notification-row",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.23",
|
|
4
4
|
"description": "Notification row component for ACE Knowledge Widgets.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "Telia Company AB",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"telia"
|
|
9
9
|
],
|
|
10
10
|
"main": "dist/index.js",
|
|
11
|
+
"sourceMain": "src/index.ts",
|
|
11
12
|
"type": "module",
|
|
12
13
|
"types": "dist/index.d.ts",
|
|
13
14
|
"files": [
|
|
@@ -25,11 +26,11 @@
|
|
|
25
26
|
},
|
|
26
27
|
"sideEffects": false,
|
|
27
28
|
"dependencies": {
|
|
28
|
-
"@telia-ace/knowledge-widget-core": "^1.0.
|
|
29
|
-
"@telia-ace/knowledge-widget-types-grid": "^1.0.
|
|
30
|
-
"@telia-ace/knowledge-widget-ui": "^1.0.
|
|
31
|
-
"@telia-ace/widget-services": "^1.0.
|
|
32
|
-
"@telia-ace/widget-utilities": "^1.0.
|
|
29
|
+
"@telia-ace/knowledge-widget-core": "^1.0.19",
|
|
30
|
+
"@telia-ace/knowledge-widget-types-grid": "^1.0.30",
|
|
31
|
+
"@telia-ace/knowledge-widget-ui": "^1.0.25",
|
|
32
|
+
"@telia-ace/widget-services": "^1.0.15",
|
|
33
|
+
"@telia-ace/widget-utilities": "^1.0.4",
|
|
33
34
|
"@webprovisions/platform": "^1.1.2"
|
|
34
35
|
},
|
|
35
36
|
"peerDependencies": {
|
|
@@ -42,5 +43,5 @@
|
|
|
42
43
|
"@types/react-dom": "^16.8.0",
|
|
43
44
|
"@types/styled-components": "^5.1.7"
|
|
44
45
|
},
|
|
45
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "db190a67f912245c4145c037972fac2039bda698"
|
|
46
47
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notification-row.41523207.js","sources":["../src/notification-row.tsx"],"sourcesContent":["import {\r\n borderTabStyle,\r\n Button,\r\n createEmptyComponent,\r\n genericHtml,\r\n Html,\r\n linkTabStyle,\r\n SymbolBadge,\r\n useContainer,\r\n useProperties,\r\n} from '@telia-ace/knowledge-widget-ui';\r\nimport {\r\n createStorageWriter,\r\n readStorage,\r\n StorageCategory,\r\n StorageMedium,\r\n StorageWriter,\r\n} from '@telia-ace/widget-services';\r\nimport { appendClassNames } from '@telia-ace/widget-utilities';\r\nimport React, { useEffect, useState } from 'react';\r\nimport styled, { css } from 'styled-components';\r\nimport { NotificationRowComponentProps } from './notification-row-component';\r\n\r\ntype Props = {\r\n className: string;\r\n};\r\n\r\nconst STORAGE_KEY = 'closed-notifications';\r\n\r\nconst infocusableHtml = {\r\n transform: {\r\n a: ({ children, ...props }: React.ComponentProps<'a'>) => (\r\n <a {...props} tabIndex={-1}>\r\n {children}\r\n </a>\r\n ),\r\n },\r\n};\r\n\r\nconst NotificationRow: React.SFC<Props> = ({ className, ...other }) => {\r\n const {\r\n types = [],\r\n allowPaging = true,\r\n notifications = [],\r\n expandable = false,\r\n closeAriaLabel = '',\r\n pageNextAriaLabel = '',\r\n pagePreviousAriaLabel = '',\r\n expandAriaLabel = '',\r\n } = useProperties<NotificationRowComponentProps>();\r\n const [expanded, setExpanded] = useState(false);\r\n const [closed, setClosed] = useState<string[]>([]);\r\n const [index, setIndex] = useState(0);\r\n\r\n const container = useContainer();\r\n const [write, setWriter] = useState<StorageWriter | undefined>();\r\n\r\n useEffect(() => {\r\n if (container) {\r\n readStorage<string[]>(container, STORAGE_KEY, StorageMedium.Session).then(\r\n (closed = []) => setClosed(closed)\r\n );\r\n\r\n createStorageWriter(container, STORAGE_KEY, StorageCategory.Functional).then((writer) =>\r\n setWriter(() => writer)\r\n );\r\n }\r\n }, [container]);\r\n\r\n useEffect(() => {\r\n if (container) {\r\n readStorage<string[]>(container, STORAGE_KEY, StorageMedium.Session).then(\r\n (storedClosed = []) => {\r\n closed.forEach(\r\n (id) => storedClosed.indexOf(id) === -1 && storedClosed.push(id)\r\n );\r\n if (write) {\r\n write(storedClosed);\r\n }\r\n }\r\n );\r\n }\r\n }, [closed, container, write]);\r\n\r\n const filtered = notifications.filter(({ id }) => closed.indexOf(id) === -1);\r\n\r\n const { length } = filtered;\r\n\r\n if (!filtered.length) {\r\n return createEmptyComponent(container, {\r\n ...other,\r\n className: appendClassNames(className, 'humany-notification-row'),\r\n });\r\n }\r\n\r\n if (allowPaging) {\r\n const notification = filtered[index] || filtered[index + 1] || filtered[index - 1];\r\n\r\n if (!notification) {\r\n return createEmptyComponent(container, {\r\n ...other,\r\n className: appendClassNames(className, 'humany-notification-row'),\r\n });\r\n }\r\n\r\n const { id, body } = notification || {};\r\n const toggleExpand = () => setExpanded(!expanded);\r\n\r\n return (\r\n <Wrapper\r\n {...other}\r\n aria-expanded={expandable ? expanded : true}\r\n aria-label={expandAriaLabel}\r\n tabIndex={expandable ? 0 : -1}\r\n className={appendClassNames(className, 'humany-notification-row')}\r\n data-pageable={length > 1}\r\n data-types={types}\r\n data-allow-paging={allowPaging}\r\n data-expandable={expandable}\r\n onKeyDown={(e: React.KeyboardEvent) => {\r\n if (e.key === 'Enter') {\r\n toggleExpand();\r\n }\r\n }}\r\n onClick={toggleExpand}\r\n >\r\n <CloseButton\r\n aria-label={closeAriaLabel}\r\n onClick={() => {\r\n setIndex(filtered.indexOf(notification));\r\n setClosed([...closed, id]);\r\n }}\r\n >\r\n <SymbolBadge symbol={{ type: 'Svg', content: 'close' }} />\r\n </CloseButton>\r\n <StyledHtml\r\n htmlParseInstruction={!expandable || expanded ? undefined : infocusableHtml}\r\n data-pageable={length > 1}\r\n data-notification={id}\r\n data-expandable={expandable}\r\n data-expanded={expanded}\r\n html={body}\r\n />\r\n {length > 1 && (\r\n <Pager>\r\n <StyledButton\r\n aria-label={pagePreviousAriaLabel}\r\n data-disabled={index === 0}\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n if (index > 0) {\r\n setIndex(index - 1);\r\n }\r\n }}\r\n >\r\n <StyledSymbolBadge\r\n size={10}\r\n symbol={{ type: 'Svg', content: 'caret-left' }}\r\n />\r\n </StyledButton>\r\n <span>\r\n {index + 1}/{length}\r\n </span>\r\n <StyledButton\r\n aria-label={pageNextAriaLabel}\r\n data-disabled={index + 1 >= length}\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n if (index < length - 1) {\r\n setIndex(index + 1);\r\n }\r\n }}\r\n >\r\n <StyledSymbolBadge\r\n size={10}\r\n symbol={{ type: 'Svg', content: 'caret-right' }}\r\n />\r\n </StyledButton>\r\n </Pager>\r\n )}\r\n </Wrapper>\r\n );\r\n }\r\n\r\n return (\r\n <Wrapper\r\n {...other}\r\n className={appendClassNames(className, 'humany-notification-row')}\r\n data-pageable={false}\r\n data-types={types}\r\n data-allow-paging={false}\r\n >\r\n {filtered.map((notification) => {\r\n if (!notification) {\r\n return null;\r\n }\r\n\r\n const { id, body } = notification;\r\n\r\n return (\r\n <StyledHtml\r\n key={id}\r\n data-pageable={false}\r\n data-expandable={expandable}\r\n data-expanded={expanded}\r\n data-notification={id}\r\n html={body}\r\n />\r\n );\r\n })}\r\n </Wrapper>\r\n );\r\n};\r\n\r\nconst Wrapper = styled.div<{ 'data-types': string[]; 'data-allow-paging': boolean } & any>`\r\n ${genericHtml}\r\n padding: ${(p) => p.theme.sizes.normal} ${(p) => p.theme.sizes?.cardinal * 12}px;\r\n background-color: ${(p) => {\r\n if (p['data-types'].length) {\r\n if (p['data-types'].indexOf('top') > -1) {\r\n return p.theme.colors?.warning;\r\n }\r\n if (p['data-types'].indexOf('bottom') > -1) {\r\n return 'transparent';\r\n }\r\n\r\n return p.theme.colors?.primary;\r\n }\r\n return p.theme.colors?.warning;\r\n }};\r\n color: ${(p) => p.theme.colors?.text};\r\n border-radius: ${(p) => p.theme.borderRadius};\r\n text-align: center;\r\n display: flex;\r\n flex-direction: column;\r\n position: relative;\r\n cursor: ${(p) => (p['data-expandable'] ? 'pointer' : 'default')};\r\n overflow: hidden;\r\n\r\n i {\r\n color: ${(p) => p.theme.colors?.text};\r\n }\r\n\r\n a {\r\n color: ${(p) => p.theme.colors?.link};\r\n &:focus {\r\n ${(p) => p.theme.accessibility?.isTabbing && linkTabStyle}\r\n }\r\n }\r\n\r\n ${(p) =>\r\n !p['data-allow-paging'] &&\r\n css`\r\n flex-wrap: wrap;\r\n\r\n > div {\r\n min-width: 100%;\r\n margin: ${p.theme.sizes?.cardinal * 2}px;\r\n }\r\n `};\r\n\r\n ${(p) =>\r\n p.theme.accessibility?.isTabbing &&\r\n css`\r\n &:focus {\r\n ${StyledHtml} {\r\n ${borderTabStyle}\r\n }\r\n }\r\n `}\r\n`;\r\n\r\nconst StyledHtml = styled(Html)<{\r\n 'data-pageable': boolean;\r\n 'data-expandable': boolean;\r\n 'data-expanded': boolean;\r\n}>`\r\n flex: 1;\r\n font-size: ${(p) => p.theme.fonts?.normal};\r\n line-height: 1.6em;\r\n font-weight: 300;\r\n\r\n ${(p) =>\r\n p['data-expandable'] &&\r\n !p['data-expanded'] &&\r\n css`\r\n max-width: 100%;\r\n\r\n p {\r\n display: none;\r\n &:first-child {\r\n display: block;\r\n margin-bottom: 0;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n }\r\n }\r\n `}\r\n`;\r\n\r\nconst Pager = styled.div`\r\n text-align: center;\r\n width: 100%;\r\n span {\r\n font-size: ${(p) => p.theme.fonts?.small};\r\n display: inline-block;\r\n width: 30px;\r\n text-align: center;\r\n }\r\n`;\r\n\r\nconst StyledButton = styled(Button)<{ 'data-disabled'?: boolean }>`\r\n background-color: transparent;\r\n border: none;\r\n cursor: pointer;\r\n transition: opacity 200ms ease-out;\r\n justify-self: flex-end;\r\n align-self: flex-start;\r\n padding: ${(p) => p.theme.sizes?.small} svg {\r\n display: block;\r\n }\r\n\r\n &:focus {\r\n ${(p) => p.theme.accessibility?.isTabbing && borderTabStyle}\r\n }\r\n\r\n ${(p) =>\r\n p['data-disabled']\r\n ? css`\r\n opacity: 0.8;\r\n `\r\n : css`\r\n @media (hover) {\r\n &:hover {\r\n opacity: 0.5;\r\n }\r\n }\r\n `}\r\n`;\r\n\r\nconst CloseButton = styled(StyledButton)`\r\n position: absolute;\r\n top: 7.5px;\r\n right: 7.5px;\r\n width: 25px;\r\n height: auto;\r\n padding: ${(p) => `calc(${p.theme.sizes?.small}/2) ${p.theme.sizes?.small}`} svg {\r\n vertical-align: middle;\r\n line,\r\n path {\r\n stroke: ${(p) => p.theme.colors?.text};\r\n }\r\n }\r\n`;\r\n\r\nconst StyledSymbolBadge = styled(SymbolBadge)`\r\n line {\r\n stroke: #ffffff;\r\n }\r\n`;\r\n\r\nconst Empty = styled.div`\r\n display: none;\r\n`;\r\n\r\nexport default NotificationRow;\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,IAAc,wBAEd,KAAkB;AAAA,EACpB,WAAW;AAAA,IACP,GAAG,CAAC;AAAA,iBAAE,kBAAF,GAAe,MAAf,GAAe,CAAb;AACD,+BAAA,cAAA,KAAA,QAAM,IAAN;AAAA,QAAa,UAAU;AAAA,MAAA,IACnB,CACL;AAAA;AAAA,EAER;AACJ,GAEM,KAAoC,CAAC,MAA4B;AAA5B,aAAE,mBAAF,GAAgB,MAAhB,GAAgB,CAAd;AACnC,QAAA;AAAA,IACF,WAAQ,CAAC;AAAA,IACT,iBAAc;AAAA,IACd,mBAAgB,CAAC;AAAA,IACjB,gBAAa;AAAA,IACb,oBAAiB;AAAA,IACjB,uBAAoB;AAAA,IACpB,2BAAwB;AAAA,IACxB,qBAAkB;AAAA,MAClB,GAA6C,GAC3C,CAAC,GAAU,KAAe,EAAS,EAAK,GACxC,CAAC,GAAQ,KAAa,EAAmB,CAAE,CAAA,GAC3C,CAAC,GAAO,KAAY,EAAS,CAAC,GAE9B,IAAY,MACZ,CAAC,GAAO,KAAa,EAAoC;AAE/D,IAAU,MAAM;AACZ,IAAI,KACA,GAAsB,GAAW,GAAa,EAAc,OAAO,EAAE,KACjE,CAAC,IAAS,CAAC,MAAM,EAAU,CAAM,CACrC,GAEoB,GAAA,GAAW,GAAa,GAAgB,UAAU,EAAE,KAAK,CAAC,MAC1E,EAAU,MAAM,CAAM,CAC1B;AAAA,EACJ,GACD,CAAC,CAAS,CAAC,GAEd,EAAU,MAAM;AACZ,IAAI,KACsB,E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