@telia-ace/knowledge-widget-components-notification-list 1.0.17 → 1.0.18
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 +1 -1
- package/dist/notification-list.682419d0.js +192 -0
- package/dist/notification-list.682419d0.js.map +1 -0
- package/dist/notification-list.d.ts +1 -1
- package/package.json +5 -5
- package/dist/notification-list.ba190f64.js +0 -47
- package/dist/notification-list.ba190f64.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import { DataType as D } from "@telia-ace/knowledge-widget-types-grid";
|
|
|
15
15
|
import { createReactComponent as P } from "@telia-ace/knowledge-widget-ui";
|
|
16
16
|
const E = (t) => {
|
|
17
17
|
const { events: e } = t.get("$widget"), [i, u] = L(e);
|
|
18
|
-
return P(t, "notification-list", import("./notification-list.
|
|
18
|
+
return P(t, "notification-list", import("./notification-list.682419d0.js"), (a) => {
|
|
19
19
|
const o = (r) => {
|
|
20
20
|
a.writeProperties(n(c({}, a.properties()), {
|
|
21
21
|
loading: !0,
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
var Y = Object.defineProperty, D = Object.defineProperties;
|
|
2
|
+
var H = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var m = Object.getOwnPropertySymbols;
|
|
4
|
+
var x = Object.prototype.hasOwnProperty, E = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var w = (t, e, a) => e in t ? Y(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a, h = (t, e) => {
|
|
6
|
+
for (var a in e || (e = {}))
|
|
7
|
+
x.call(e, a) && w(t, a, e[a]);
|
|
8
|
+
if (m)
|
|
9
|
+
for (var a of m(e))
|
|
10
|
+
E.call(e, a) && w(t, a, e[a]);
|
|
11
|
+
return t;
|
|
12
|
+
}, f = (t, e) => D(t, H(e));
|
|
13
|
+
var v = (t, e) => {
|
|
14
|
+
var a = {};
|
|
15
|
+
for (var n in t)
|
|
16
|
+
x.call(t, n) && e.indexOf(n) < 0 && (a[n] = t[n]);
|
|
17
|
+
if (t != null && m)
|
|
18
|
+
for (var n of m(t))
|
|
19
|
+
e.indexOf(n) < 0 && E.call(t, n) && (a[n] = t[n]);
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
import { useContainer as N, useProperties as P, createEmptyComponent as j, DateFormats as F, Loader as M, Button as O, borderTabStyle as _, ItemList as R, loadingOpacity as q, contentBox as A, itemList as G, headingElement as J, Paragraph as K, genericHtml as Q, SymbolBadge as U, Timestamp as V } from "@telia-ace/knowledge-widget-ui";
|
|
23
|
+
import { appendClassNames as S } from "@telia-ace/widget-utilities";
|
|
24
|
+
import o, { useState as W } from "react";
|
|
25
|
+
import l, { css as s } from "styled-components";
|
|
26
|
+
const re = (a) => {
|
|
27
|
+
var n = a, { className: t } = n, e = v(n, ["className"]);
|
|
28
|
+
const [r, z] = W(null), L = N(), {
|
|
29
|
+
showHeader: y,
|
|
30
|
+
notificationList: k,
|
|
31
|
+
loading: d = !1
|
|
32
|
+
} = P(), {
|
|
33
|
+
id: B,
|
|
34
|
+
title: C,
|
|
35
|
+
symbol: I,
|
|
36
|
+
notifications: g = [],
|
|
37
|
+
defaultHeaderOptions: T = { visible: !0 }
|
|
38
|
+
} = k || {};
|
|
39
|
+
return !g.length && !d ? j(L, f(h({}, e), {
|
|
40
|
+
className: S(t, "humany-notification-list")
|
|
41
|
+
})) : /* @__PURE__ */ o.createElement(Z, f(h({}, e), {
|
|
42
|
+
"data-loading": d,
|
|
43
|
+
"data-show-header": typeof y == "boolean" ? y : T.visible,
|
|
44
|
+
className: S(t, "humany-notification-list"),
|
|
45
|
+
"data-notification-category": B,
|
|
46
|
+
header: C,
|
|
47
|
+
symbol: I,
|
|
48
|
+
items: g,
|
|
49
|
+
renderItem: ({ id: i, title: p, body: u, modified: $, expandable: b }) => /* @__PURE__ */ o.createElement(ee, {
|
|
50
|
+
key: i,
|
|
51
|
+
"data-notification": i,
|
|
52
|
+
"data-expanded": b ? r === i : !0
|
|
53
|
+
}, b ? /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(X, {
|
|
54
|
+
title: p,
|
|
55
|
+
"aria-label": p,
|
|
56
|
+
"aria-expanded": r === i,
|
|
57
|
+
onClick: () => z(r === i ? null : i)
|
|
58
|
+
}, /* @__PURE__ */ o.createElement("span", null, p), /* @__PURE__ */ o.createElement(te, {
|
|
59
|
+
size: 11,
|
|
60
|
+
symbol: {
|
|
61
|
+
type: "Svg",
|
|
62
|
+
content: `caret-${r === i ? "up" : "down"}`
|
|
63
|
+
}
|
|
64
|
+
})), /* @__PURE__ */ o.createElement(c, {
|
|
65
|
+
html: u
|
|
66
|
+
}), $ && /* @__PURE__ */ o.createElement(ae, {
|
|
67
|
+
format: F.YYYY_MM_DD,
|
|
68
|
+
timestamp: $
|
|
69
|
+
})) : /* @__PURE__ */ o.createElement(c, {
|
|
70
|
+
html: u
|
|
71
|
+
}))
|
|
72
|
+
}), /* @__PURE__ */ o.createElement(M, {
|
|
73
|
+
loading: d
|
|
74
|
+
}));
|
|
75
|
+
}, X = l(O)`
|
|
76
|
+
display: flex;
|
|
77
|
+
justify-content: space-between;
|
|
78
|
+
align-items: center;
|
|
79
|
+
width: 100%;
|
|
80
|
+
text-align: left;
|
|
81
|
+
svg,
|
|
82
|
+
i {
|
|
83
|
+
color: ${(t) => {
|
|
84
|
+
var e;
|
|
85
|
+
return (e = t.theme.colors) == null ? void 0 : e.primary;
|
|
86
|
+
}};
|
|
87
|
+
}
|
|
88
|
+
span {
|
|
89
|
+
color: ${(t) => {
|
|
90
|
+
var e;
|
|
91
|
+
return (e = t.theme.colors) == null ? void 0 : e.text;
|
|
92
|
+
}};
|
|
93
|
+
font-size: ${(t) => {
|
|
94
|
+
var e;
|
|
95
|
+
return (e = t.theme.fonts) == null ? void 0 : e.normal;
|
|
96
|
+
}};
|
|
97
|
+
overflow: hidden;
|
|
98
|
+
text-overflow: ellipsis;
|
|
99
|
+
flex: 1;
|
|
100
|
+
white-space: nowrap;
|
|
101
|
+
}
|
|
102
|
+
&:focus {
|
|
103
|
+
${(t) => {
|
|
104
|
+
var e, a;
|
|
105
|
+
return ((e = t.theme.accessibility) == null ? void 0 : e.isTabbing) && s`
|
|
106
|
+
${_}
|
|
107
|
+
span {
|
|
108
|
+
color: ${(a = t.theme.colors) == null ? void 0 : a.primary};
|
|
109
|
+
text-decoration: underline;
|
|
110
|
+
}
|
|
111
|
+
`;
|
|
112
|
+
}};
|
|
113
|
+
}
|
|
114
|
+
`, Z = l(R)`
|
|
115
|
+
${q}
|
|
116
|
+
${A}
|
|
117
|
+
${G}
|
|
118
|
+
overflow: hidden;
|
|
119
|
+
justify-content: flex-start;
|
|
120
|
+
padding: ${(t) => {
|
|
121
|
+
var e;
|
|
122
|
+
return (e = t.theme.sizes) == null ? void 0 : e.large;
|
|
123
|
+
}};
|
|
124
|
+
${(t) => !t["data-show-header"] && s`
|
|
125
|
+
> div {
|
|
126
|
+
${J("h1", s`
|
|
127
|
+
display: none;
|
|
128
|
+
`)}
|
|
129
|
+
}
|
|
130
|
+
`}
|
|
131
|
+
|
|
132
|
+
@media (hover: hover) {
|
|
133
|
+
button:hover {
|
|
134
|
+
text-decoration: underline;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
`, c = l(K)`
|
|
138
|
+
${Q}
|
|
139
|
+
font-weight: 300;
|
|
140
|
+
|
|
141
|
+
p {
|
|
142
|
+
white-space: normal;
|
|
143
|
+
}
|
|
144
|
+
`, ee = l.li`
|
|
145
|
+
${c} {
|
|
146
|
+
display: none;
|
|
147
|
+
&:not(:only-child) {
|
|
148
|
+
${(t) => {
|
|
149
|
+
var e, a, n;
|
|
150
|
+
return ((e = t.theme.sizes) == null ? void 0 : e.cardinal) && ((a = t.theme.sizes) == null ? void 0 : a.normal) && s`
|
|
151
|
+
margin: ${(n = t.theme.sizes) == null ? void 0 : n.normal} 0;
|
|
152
|
+
`;
|
|
153
|
+
}}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
${(t) => t["data-expanded"] && s`
|
|
158
|
+
${c} {
|
|
159
|
+
display: block;
|
|
160
|
+
}
|
|
161
|
+
`}
|
|
162
|
+
|
|
163
|
+
> span {
|
|
164
|
+
display: block;
|
|
165
|
+
font-weight: 300;
|
|
166
|
+
color: ${(t) => {
|
|
167
|
+
var e;
|
|
168
|
+
return (e = t.theme.colors) == null ? void 0 : e.accent;
|
|
169
|
+
}};
|
|
170
|
+
}
|
|
171
|
+
`, te = l(U)`
|
|
172
|
+
margin: 0 0 0 ${(t) => {
|
|
173
|
+
var e;
|
|
174
|
+
return (e = t.theme.sizes) == null ? void 0 : e.small;
|
|
175
|
+
}};
|
|
176
|
+
line {
|
|
177
|
+
stroke: ${(t) => {
|
|
178
|
+
var e;
|
|
179
|
+
return (e = t.theme.colors) == null ? void 0 : e.primary;
|
|
180
|
+
}};
|
|
181
|
+
}
|
|
182
|
+
`, ae = l(V)`
|
|
183
|
+
font-size: ${(t) => {
|
|
184
|
+
var e;
|
|
185
|
+
return (e = t.theme.fonts) == null ? void 0 : e.small;
|
|
186
|
+
}};
|
|
187
|
+
font-weight: 300;
|
|
188
|
+
`;
|
|
189
|
+
export {
|
|
190
|
+
re as default
|
|
191
|
+
};
|
|
192
|
+
//# sourceMappingURL=notification-list.682419d0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-list.682419d0.js","sources":["../src/notification-list.tsx"],"sourcesContent":["import { Notification } from '@telia-ace/knowledge-widget-core';\r\nimport {\r\n borderTabStyle,\r\n Button,\r\n contentBox,\r\n createEmptyComponent,\r\n DateFormats,\r\n genericHtml,\r\n headingElement,\r\n ItemList,\r\n itemList,\r\n Loader,\r\n loadingOpacity,\r\n Paragraph,\r\n SymbolBadge,\r\n Timestamp,\r\n useContainer,\r\n useProperties,\r\n} from '@telia-ace/knowledge-widget-ui';\r\nimport { appendClassNames } from '@telia-ace/widget-utilities';\r\nimport React, { useState } from 'react';\r\nimport styled, { css } from 'styled-components';\r\nimport { NotificationListComponentProps } from './notification-list-component';\r\n\r\ntype Props = {\r\n className: string;\r\n};\r\n\r\nconst NotificationList: React.SFC<Props> = ({ className, ...other }) => {\r\n const [expanded, setExpanded] = useState<string | null>(null);\r\n const container = useContainer();\r\n const {\r\n showHeader,\r\n notificationList,\r\n loading = false,\r\n } = useProperties<NotificationListComponentProps>();\r\n\r\n const {\r\n id,\r\n title,\r\n symbol,\r\n notifications = [],\r\n defaultHeaderOptions = { visible: true },\r\n } = notificationList || {};\r\n\r\n if (!notifications.length && !loading) {\r\n return createEmptyComponent(container, {\r\n ...other,\r\n className: appendClassNames(className, 'humany-notification-list'),\r\n });\r\n }\r\n\r\n return (\r\n <StyledItemList\r\n {...other}\r\n data-loading={loading}\r\n data-show-header={\r\n typeof showHeader === 'boolean' ? showHeader : defaultHeaderOptions.visible\r\n }\r\n className={appendClassNames(className, 'humany-notification-list')}\r\n data-notification-category={id}\r\n header={title}\r\n symbol={symbol}\r\n items={notifications}\r\n renderItem={({ id, title, body, modified, expandable }: Notification) => (\r\n <StyledItem\r\n key={id}\r\n data-notification={id}\r\n data-expanded={expandable ? expanded === id : true}\r\n >\r\n {expandable ? (\r\n <>\r\n <StyledButton\r\n title={title}\r\n aria-label={title}\r\n aria-expanded={expanded === id}\r\n onClick={() => setExpanded(expanded === id ? null : id)}\r\n >\r\n <span>{title}</span>\r\n <StyledSymbolBadge\r\n size={11}\r\n symbol={{\r\n type: 'Svg',\r\n content: `caret-${expanded === id ? 'up' : 'down'}`,\r\n }}\r\n />\r\n </StyledButton>\r\n <StyledParagraph html={body} />\r\n {modified && (\r\n <StyledTimestamp\r\n format={DateFormats.YYYY_MM_DD}\r\n timestamp={modified}\r\n />\r\n )}\r\n </>\r\n ) : (\r\n <StyledParagraph html={body} />\r\n )}\r\n </StyledItem>\r\n )}\r\n >\r\n <Loader loading={loading} />\r\n </StyledItemList>\r\n );\r\n};\r\n\r\nconst StyledButton = styled(Button)`\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n width: 100%;\r\n text-align: left;\r\n svg,\r\n i {\r\n color: ${(p) => p.theme.colors?.primary};\r\n }\r\n span {\r\n color: ${(p) => p.theme.colors?.text};\r\n font-size: ${(p) => p.theme.fonts?.normal};\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n flex: 1;\r\n white-space: nowrap;\r\n }\r\n &:focus {\r\n ${(p) =>\r\n p.theme.accessibility?.isTabbing &&\r\n css`\r\n ${borderTabStyle}\r\n span {\r\n color: ${p.theme.colors?.primary};\r\n text-decoration: underline;\r\n }\r\n `};\r\n }\r\n`;\r\n\r\nconst StyledItemList = styled(ItemList)<\r\n {\r\n 'data-loading': boolean;\r\n 'data-show-header': boolean;\r\n } & any\r\n>`\r\n ${loadingOpacity}\r\n ${contentBox}\r\n ${itemList}\r\n overflow: hidden;\r\n justify-content: flex-start;\r\n padding: ${(p) => p.theme.sizes?.large};\r\n ${(p) =>\r\n !p['data-show-header'] &&\r\n css`\r\n > div {\r\n ${headingElement(\r\n 'h1',\r\n css`\r\n display: none;\r\n `\r\n )}\r\n }\r\n `}\r\n\r\n @media (hover: hover) {\r\n button:hover {\r\n text-decoration: underline;\r\n }\r\n }\r\n`;\r\n\r\nconst StyledParagraph = styled(Paragraph)`\r\n ${genericHtml}\r\n font-weight: 300;\r\n\r\n p {\r\n white-space: normal;\r\n }\r\n`;\r\n\r\nconst StyledItem = styled.li<{ 'data-expanded': boolean }>`\r\n ${StyledParagraph} {\r\n display: none;\r\n &:not(:only-child) {\r\n ${(p) =>\r\n p.theme.sizes?.cardinal &&\r\n p.theme.sizes?.normal &&\r\n css`\r\n margin: ${p.theme.sizes?.normal} 0;\r\n `}\r\n }\r\n }\r\n\r\n ${(p) =>\r\n p['data-expanded'] &&\r\n css`\r\n ${StyledParagraph} {\r\n display: block;\r\n }\r\n `}\r\n\r\n > span {\r\n display: block;\r\n font-weight: 300;\r\n color: ${(p) => p.theme.colors?.accent};\r\n }\r\n`;\r\n\r\nconst StyledSymbolBadge = styled(SymbolBadge)`\r\n margin: 0 0 0 ${(p) => p.theme.sizes?.small};\r\n line {\r\n stroke: ${(p) => p.theme.colors?.primary};\r\n }\r\n`;\r\n\r\nconst StyledTimestamp = styled(Timestamp)`\r\n font-size: ${(p) => p.theme.fonts?.small};\r\n font-weight: 300;\r\n`;\r\n\r\nexport default NotificationList;\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAM,KAAqC,CAAC,MAA4B;AAA5B,aAAE,mBAAF,GAAgB,MAAhB,GAAgB,CAAd;AAC1C,QAAM,CAAC,GAAU,KAAe,EAAwB,IAAI,GACtD,IAAY,KACZ;AAAA,IACF;AAAA,IACA;AAAA,IACA,aAAU;AAAA,MACV,EAA8C,GAE5C;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA,mBAAgB,CAAC;AAAA,IACjB,0BAAuB,EAAE,SAAS,GAAK;AAAA,MACvC,KAAoB,CAAA;AAExB,SAAI,CAAC,EAAc,UAAU,CAAC,IACnB,EAAqB,GAAW,QAChC,IADgC;AAAA,IAEnC,WAAW,EAAiB,GAAW,0BAA0B;AAAA,EAAA,EACpE,IAIA,kBAAA,cAAA,GAAA,QACO,IADP;AAAA,IAEG,gBAAc;AAAA,IACd,oBACI,OAAO,KAAe,YAAY,IAAa,EAAqB;AAAA,IAExE,WAAW,EAAiB,GAAW,0BAA0B;AAAA,IACjE,8BAA4B;AAAA,IAC5B,QAAQ;AAAA,IACR;AAAA,IACA,OAAO;AAAA,IACP,YAAY,CAAC,EAAE,IAAA,GAAI,UAAO,SAAM,aAAU,oBACrC,kBAAA,cAAA,IAAA;AAAA,MACG,KAAK;AAAA,MACL,qBAAmB;AAAA,MACnB,iBAAe,IAAa,MAAa,IAAK;AAAA,IAAA,GAE7C,sDAEQ,kBAAA,cAAA,GAAA;AAAA,MACG,OAAO;AAAA,MACP,cAAY;AAAA,MACZ,iBAAe,MAAa;AAAA,MAC5B,SAAS,MAAM,EAAY,MAAa,IAAK,OAAO,CAAE;AAAA,IAAA,GAErD,kBAAA,cAAA,QAAA,MAAM,CAAM,GACZ,kBAAA,cAAA,IAAA;AAAA,MACG,MAAM;AAAA,MACN,QAAQ;AAAA,QACJ,MAAM;AAAA,QACN,SAAS,SAAS,MAAa,IAAK,OAAO;AAAA,MAC/C;AAAA,IACJ,CAAA,CACJ,GACC,kBAAA,cAAA,GAAA;AAAA,MAAgB,MAAM;AAAA,IAAM,CAAA,GAC5B,KACI,kBAAA,cAAA,IAAA;AAAA,MACG,QAAQ,EAAY;AAAA,MACpB,WAAW;AAAA,IACf,CAAA,CAER,IAEC,kBAAA,cAAA,GAAA;AAAA,MAAgB,MAAM;AAAA,IAAA,CAAM,CAErC;AAAA,EAAA,IAGH,kBAAA,cAAA,GAAA;AAAA,IAAO;AAAA,EAAkB,CAAA,CAC9B;AAER,GAEM,IAAe,EAAO,CAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAQjB,CAAC,MAAM;;AAAA,gBAAE,MAAM,WAAR,kBAAgB;AAAA;AAAA;AAAA;AAAA,iBAGvB,CAAC,MAAM;;AAAA,gBAAE,MAAM,WAAR,kBAAgB;AAAA;AAAA,qBACnB,CAAC,MAAM;;AAAA,gBAAE,MAAM,UAAR,kBAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAOjC,CAAC,MAAA;;AACC,iBAAE,MAAM,kBAAR,kBAAuB,cACvB;AAAA,kBACM;AAAA;AAAA,6BAEW,OAAE,MAAM,WAAR,kBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAOvC,IAAiB,EAAO,CAAQ;AAAA,MAMhC;AAAA,MACA;AAAA,IACF;AAAA;AAAA;AAAA,eAGW,CAAC,MAAM;;AAAA,gBAAE,MAAM,UAAR,kBAAe;AAAA;AAAA,MAC/B,CAAC,MACC,CAAC,EAAE,uBACH;AAAA;AAAA,kBAEU,EACE,MACA;AAAA;AAAA,qBAGJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAWV,IAAkB,EAAO,CAAS;AAAA,MAClC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQA,KAAa,EAAO;AAAA,MACpB;AAAA;AAAA;AAAA,cAGQ,CAAC;;AACC,iBAAE,MAAM,UAAR,kBAAe,aACf,QAAE,MAAM,UAAR,kBAAe,WACf;AAAA,8BACc,OAAE,MAAM,UAAR,kBAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAKvC,CAAC,MACC,EAAE,oBACF;AAAA,cACM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAQG,CAAC,MAAM;;AAAA,gBAAE,MAAM,WAAR,kBAAgB;AAAA;AAAA;AAAA,GAIlC,KAAoB,EAAO,CAAW;AAAA,oBACxB,CAAC,MAAM;;AAAA,gBAAE,MAAM,UAAR,kBAAe;AAAA;AAAA;AAAA,kBAExB,CAAC,MAAM;;AAAA,gBAAE,MAAM,WAAR,kBAAgB;AAAA;AAAA;AAAA,GAInC,KAAkB,EAAO,CAAS;AAAA,iBACvB,CAAC,MAAM;;AAAA,gBAAE,MAAM,UAAR,kBAAe;AAAA;AAAA;AAAA;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/knowledge-widget-components-notification-list",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.18",
|
|
4
4
|
"description": "Notification list component for ACE Knowledge Widgets.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "Telia Company AB",
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
},
|
|
29
29
|
"sideEffects": false,
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@telia-ace/knowledge-widget-core": "^1.0.
|
|
32
|
-
"@telia-ace/knowledge-widget-types-grid": "^1.0.
|
|
33
|
-
"@telia-ace/knowledge-widget-ui": "^1.0.
|
|
31
|
+
"@telia-ace/knowledge-widget-core": "^1.0.16",
|
|
32
|
+
"@telia-ace/knowledge-widget-types-grid": "^1.0.25",
|
|
33
|
+
"@telia-ace/knowledge-widget-ui": "^1.0.22",
|
|
34
34
|
"@telia-ace/widget-utilities": "^1.0.2",
|
|
35
35
|
"@webprovisions/platform": "^1.1.2"
|
|
36
36
|
},
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"@types/react-dom": "^16.8.0",
|
|
45
45
|
"@types/styled-components": "^5.1.7"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "2bb53be0a4e6971998cc1d1c91f0e980df2ad485"
|
|
48
48
|
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
var N = Object.defineProperty, y = Object.defineProperties;
|
|
2
|
-
var C = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var a = Object.getOwnPropertySymbols;
|
|
4
|
-
var f = Object.prototype.hasOwnProperty, p = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var m = (t, o, i) => o in t ? N(t, o, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[o] = i, s = (t, o) => {
|
|
6
|
-
for (var i in o || (o = {}))
|
|
7
|
-
f.call(o, i) && m(t, i, o[i]);
|
|
8
|
-
if (a)
|
|
9
|
-
for (var i of a(o))
|
|
10
|
-
p.call(o, i) && m(t, i, o[i]);
|
|
11
|
-
return t;
|
|
12
|
-
}, r = (t, o) => y(t, C(o));
|
|
13
|
-
var l = (t, o) => {
|
|
14
|
-
var i = {};
|
|
15
|
-
for (var e in t)
|
|
16
|
-
f.call(t, e) && o.indexOf(e) < 0 && (i[e] = t[e]);
|
|
17
|
-
if (t != null && a)
|
|
18
|
-
for (var e of a(t))
|
|
19
|
-
o.indexOf(e) < 0 && p.call(t, e) && (i[e] = t[e]);
|
|
20
|
-
return i;
|
|
21
|
-
};
|
|
22
|
-
import { useContainer as L, useProperties as g, createEmptyComponent as h, NotificationList as x, contentBox as E } from "@telia-ace/knowledge-widget-ui";
|
|
23
|
-
import { appendClassNames as $ } from "@telia-ace/widget-utilities";
|
|
24
|
-
import w from "react";
|
|
25
|
-
import B from "styled-components";
|
|
26
|
-
const k = (i) => {
|
|
27
|
-
var e = i, { className: t } = e, o = l(e, ["className"]);
|
|
28
|
-
const d = L(), {
|
|
29
|
-
showHeader: u,
|
|
30
|
-
notificationList: n,
|
|
31
|
-
loading: c = !1
|
|
32
|
-
} = g();
|
|
33
|
-
return !(n != null && n.notifications.length) && !c ? h(d, r(s({}, o), {
|
|
34
|
-
className: $(t, "humany-notification-list")
|
|
35
|
-
})) : /* @__PURE__ */ w.createElement(H, r(s({}, o), {
|
|
36
|
-
className: t,
|
|
37
|
-
notificationList: n,
|
|
38
|
-
loading: c,
|
|
39
|
-
showHeader: u
|
|
40
|
-
}));
|
|
41
|
-
}, H = B(x)`
|
|
42
|
-
${E}
|
|
43
|
-
`;
|
|
44
|
-
export {
|
|
45
|
-
k as default
|
|
46
|
-
};
|
|
47
|
-
//# sourceMappingURL=notification-list.ba190f64.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notification-list.ba190f64.js","sources":["../src/notification-list.tsx"],"sourcesContent":["import {\r\n contentBox,\r\n createEmptyComponent,\r\n NotificationList as NotificationListUi,\r\n useContainer,\r\n useProperties,\r\n} from '@telia-ace/knowledge-widget-ui';\r\nimport { appendClassNames } from '@telia-ace/widget-utilities';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport { NotificationListComponentProps } from './notification-list-component';\r\n\r\ntype Props = {\r\n className: string;\r\n};\r\n\r\nconst NotificationList: React.FC<Props> = ({ className, ...other }) => {\r\n const container = useContainer();\r\n const {\r\n showHeader,\r\n notificationList,\r\n loading = false,\r\n } = useProperties<NotificationListComponentProps>();\r\n\r\n if (!notificationList?.notifications.length && !loading) {\r\n return createEmptyComponent(container, {\r\n ...other,\r\n className: appendClassNames(className, 'humany-notification-list'),\r\n });\r\n }\r\n\r\n return (\r\n <StyledNotificationList\r\n {...other}\r\n className={className}\r\n notificationList={notificationList}\r\n loading={loading}\r\n showHeader={showHeader}\r\n />\r\n );\r\n};\r\n\r\nconst StyledNotificationList = styled(NotificationListUi)`\r\n ${contentBox}\r\n`;\r\n\r\nexport default NotificationList;\r\n"],"names":["NotificationListUi"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,MAAM,IAAoC,CAAC,MAA4B;AAA5B,aAAE,mBAAF,GAAgB,MAAhB,GAAgB,CAAd;AACzC,QAAM,IAAY,KACZ;AAAA,IACF;AAAA,IACA;AAAA,IACA,aAAU;AAAA,MACV,EAA8C;AAElD,SAAI,CAAC,gBAAkB,cAAc,WAAU,CAAC,IACrC,EAAqB,GAAW,QAChC,IADgC;AAAA,IAEnC,WAAW,EAAiB,GAAW,0BAA0B;AAAA,EAAA,EACpE,IAIA,kBAAA,cAAA,GAAA,QACO,IADP;AAAA,IAEG;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,EACJ;AAER,GAEM,IAAyB,EAAOA,CAAkB;AAAA,MAClD;AAAA;"}
|