@telia-ace/knowledge-widget-components-notification-list 1.0.14 → 1.0.17
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
|
@@ -1,82 +1,63 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
import { createReactComponent } from "@telia-ace/knowledge-widget-ui";
|
|
23
|
-
const NotificationListComponent = (container) => {
|
|
24
|
-
const { events } = container.get("$widget");
|
|
25
|
-
const [subscribe, unsubscribe] = createEventSubscriber(events);
|
|
26
|
-
return createReactComponent(container, "notification-list", import("./notification-list.js"), (component) => {
|
|
27
|
-
const fetch = (params) => {
|
|
28
|
-
component.writeProperties(__spreadProps(__spreadValues({}, component.properties()), {
|
|
29
|
-
loading: true,
|
|
1
|
+
var m = Object.defineProperty, b = Object.defineProperties;
|
|
2
|
+
var v = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var h = Object.getOwnPropertySymbols;
|
|
4
|
+
var y = Object.prototype.hasOwnProperty, C = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var d = (t, e, i) => e in t ? m(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i, c = (t, e) => {
|
|
6
|
+
for (var i in e || (e = {}))
|
|
7
|
+
y.call(e, i) && d(t, i, e[i]);
|
|
8
|
+
if (h)
|
|
9
|
+
for (var i of h(e))
|
|
10
|
+
C.call(e, i) && d(t, i, e[i]);
|
|
11
|
+
return t;
|
|
12
|
+
}, n = (t, e) => b(t, v(e));
|
|
13
|
+
import { createEventSubscriber as L, extendComponent as w } from "@telia-ace/knowledge-widget-core";
|
|
14
|
+
import { DataType as D } from "@telia-ace/knowledge-widget-types-grid";
|
|
15
|
+
import { createReactComponent as P } from "@telia-ace/knowledge-widget-ui";
|
|
16
|
+
const E = (t) => {
|
|
17
|
+
const { events: e } = t.get("$widget"), [i, u] = L(e);
|
|
18
|
+
return P(t, "notification-list", import("./notification-list.ba190f64.js"), (a) => {
|
|
19
|
+
const o = (r) => {
|
|
20
|
+
a.writeProperties(n(c({}, a.properties()), {
|
|
21
|
+
loading: !0,
|
|
30
22
|
error: void 0,
|
|
31
23
|
notificationList: void 0
|
|
32
|
-
}));
|
|
33
|
-
component.actions.dispatch("fetch", { params });
|
|
24
|
+
})), a.actions.dispatch("fetch", { params: r });
|
|
34
25
|
};
|
|
35
|
-
|
|
36
|
-
if (
|
|
37
|
-
return
|
|
38
|
-
error,
|
|
39
|
-
loading:
|
|
26
|
+
a.actions.create("fetch", ({ error: r, notificationLists: s }) => {
|
|
27
|
+
if (r)
|
|
28
|
+
return a.actions.dispatch("fetched", {
|
|
29
|
+
error: r,
|
|
30
|
+
loading: !0,
|
|
40
31
|
notificationList: void 0
|
|
41
32
|
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const properties = {
|
|
45
|
-
notificationList: notificationLists.find((n) => n.id === category) || notificationList
|
|
33
|
+
const { category: f, notificationList: p } = a.properties(), g = {
|
|
34
|
+
notificationList: s.find((l) => l.id === f) || p
|
|
46
35
|
};
|
|
47
|
-
return
|
|
48
|
-
loading:
|
|
36
|
+
return a.actions.dispatch("fetched", n(c({}, g), {
|
|
37
|
+
loading: !0
|
|
49
38
|
}));
|
|
39
|
+
}), a.actions.create("fetched", (r) => a.writeProperties(n(c({}, r), { loading: !1 }))), t.getAsync("router").then((r) => {
|
|
40
|
+
const { params: s } = r.getRouteData();
|
|
41
|
+
o(s);
|
|
42
|
+
}), i("router:changed", (r, { current: s }) => {
|
|
43
|
+
o(s.routeData.params);
|
|
50
44
|
});
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
return container.getAsync("dataClient").then((dataClient) => dataClient.fetch(DataType.NotificationLists, {
|
|
65
|
-
categories: [
|
|
66
|
-
input.params.guideCategory,
|
|
67
|
-
input.params.contactCategory
|
|
68
|
-
].filter((c) => !!c),
|
|
69
|
-
searchPhrase: input.params.phrase
|
|
70
|
-
})).then(next).catch((error) => {
|
|
71
|
-
if (error) {
|
|
72
|
-
return next(error);
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
}).then(() => {
|
|
78
|
-
unsubscribe();
|
|
45
|
+
}).then(() => w(t, "notification-list", (a) => {
|
|
46
|
+
a.actions.watch("notification-list.fetch", (o, r) => t.getAsync("dataClient").then((s) => s.fetch(D.NotificationLists, {
|
|
47
|
+
categories: [
|
|
48
|
+
o.params.guideCategory,
|
|
49
|
+
o.params.contactCategory
|
|
50
|
+
].filter((f) => !!f),
|
|
51
|
+
searchPhrase: o.params.phrase
|
|
52
|
+
})).then(r).catch((s) => {
|
|
53
|
+
if (s)
|
|
54
|
+
return r(s);
|
|
55
|
+
}));
|
|
56
|
+
})).then(() => {
|
|
57
|
+
u();
|
|
79
58
|
});
|
|
80
59
|
};
|
|
81
|
-
export {
|
|
60
|
+
export {
|
|
61
|
+
E as default
|
|
62
|
+
};
|
|
82
63
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/notification-list-component.ts"],"sourcesContent":["import {\r\n createEventSubscriber,\r\n extendComponent,\r\n NotificationList,\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\nexport type NotificationListComponentProps = {\r\n category?: string;\r\n showHeader?: boolean;\r\n notificationList?: NotificationList; // internal\r\n};\r\n\r\ntype FetchResults = NotificationResults & { error: any };\r\n\r\nexport const NotificationListComponent = (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-list',\r\n import('./notification-list'),\r\n (component) => {\r\n const fetch = (params: { [key: string]: any }) => {\r\n component.writeProperties({\r\n ...component.properties<NotificationListComponentProps>(),\r\n loading: true,\r\n error: undefined,\r\n notificationList: undefined,\r\n });\r\n component.actions.dispatch('fetch', { params });\r\n };\r\n\r\n component.actions.create('fetch', ({ error, notificationLists }: FetchResults) => {\r\n if (error) {\r\n return component.actions.dispatch('fetched', {\r\n error,\r\n loading: true,\r\n notificationList: undefined,\r\n });\r\n }\r\n\r\n const { category, notificationList } =\r\n component.properties<NotificationListComponentProps>();\r\n\r\n const properties = {\r\n notificationList:\r\n notificationLists.find((n) => n.id === category) || notificationList,\r\n };\r\n\r\n return component.actions.dispatch('fetched', {\r\n ...properties,\r\n loading: true,\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 )\r\n .then(() => {\r\n return extendComponent(container, 'notification-list', (component) => {\r\n component.actions.watch('notification-list.fetch', (input, next) => {\r\n return container\r\n .getAsync('dataClient')\r\n .then((dataClient: DataClient) =>\r\n dataClient.fetch(DataType.NotificationLists, {\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 NotificationListComponent;\r\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/notification-list-component.ts"],"sourcesContent":["import {\r\n createEventSubscriber,\r\n extendComponent,\r\n NotificationList,\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\nexport type NotificationListComponentProps = {\r\n category?: string;\r\n showHeader?: boolean;\r\n notificationList?: NotificationList; // internal\r\n};\r\n\r\ntype FetchResults = NotificationResults & { error: any };\r\n\r\nexport const NotificationListComponent = (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-list',\r\n import('./notification-list'),\r\n (component) => {\r\n const fetch = (params: { [key: string]: any }) => {\r\n component.writeProperties({\r\n ...component.properties<NotificationListComponentProps>(),\r\n loading: true,\r\n error: undefined,\r\n notificationList: undefined,\r\n });\r\n component.actions.dispatch('fetch', { params });\r\n };\r\n\r\n component.actions.create('fetch', ({ error, notificationLists }: FetchResults) => {\r\n if (error) {\r\n return component.actions.dispatch('fetched', {\r\n error,\r\n loading: true,\r\n notificationList: undefined,\r\n });\r\n }\r\n\r\n const { category, notificationList } =\r\n component.properties<NotificationListComponentProps>();\r\n\r\n const properties = {\r\n notificationList:\r\n notificationLists.find((n) => n.id === category) || notificationList,\r\n };\r\n\r\n return component.actions.dispatch('fetched', {\r\n ...properties,\r\n loading: true,\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 )\r\n .then(() => {\r\n return extendComponent(container, 'notification-list', (component) => {\r\n component.actions.watch('notification-list.fetch', (input, next) => {\r\n return container\r\n .getAsync('dataClient')\r\n .then((dataClient: DataClient) =>\r\n dataClient.fetch(DataType.NotificationLists, {\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 NotificationListComponent;\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAiBa,MAAA,IAA4B,CAAC,MAAyB;AAC/D,QAAM,EAAE,cAAmB,EAAU,IAAI,SAAS,GAC5C,CAAC,GAAW,KAAe,EAAsB,CAAM;AAE7D,SAAO,EACH,GACA,qBACA,OAAO,oCACP,CAAC,MAAc;AACL,UAAA,IAAQ,CAAC,MAAmC;AAC9C,QAAU,gBAAgB,QACnB,EAAU,WAA2C,IADlC;AAAA,QAEtB,SAAS;AAAA,QACT,OAAO;AAAA,QACP,kBAAkB;AAAA,MAAA,EACrB,GACD,EAAU,QAAQ,SAAS,SAAS,EAAE,UAAQ,CAAA;AAAA,IAAA;AAGlD,MAAU,QAAQ,OAAO,SAAS,CAAC,EAAE,UAAO,2BAAsC;AAC9E,UAAI;AACO,eAAA,EAAU,QAAQ,SAAS,WAAW;AAAA,UACzC;AAAA,UACA,SAAS;AAAA,UACT,kBAAkB;AAAA,QAAA,CACrB;AAGL,YAAM,EAAE,aAAU,wBACd,EAAU,WAA2C,GAEnD,IAAa;AAAA,QACf,kBACI,EAAkB,KAAK,CAAC,MAAM,EAAE,OAAO,CAAQ,KAAK;AAAA,MAAA;AAGrD,aAAA,EAAU,QAAQ,SAAS,WAAW,QACtC,IADsC;AAAA,QAEzC,SAAS;AAAA,MAAA,EACZ;AAAA,IAAA,CACJ,GAED,EAAU,QAAQ,OAAO,WAAW,CAAC,MAC1B,EAAU,gBAAgB,QAAK,IAAL,EAAY,SAAS,KAAO,CAChE,GAED,EAAU,SAAS,QAAQ,EAAE,KAAK,CAAC,MAAW;AACpC,YAAA,EAAE,cAAW,EAAO,aAAa;AACvC,QAAM,CAAM;AAAA,IAAA,CACf,GAED,EAAU,kBAAkB,CAAC,GAAY,EAAE,iBAAmB;AACpD,QAAA,EAAQ,UAAU,MAAM;AAAA,IAAA,CACjC;AAAA,EAAA,CAET,EACK,KAAK,MACK,EAAgB,GAAW,qBAAqB,CAAC,MAAc;AAClE,MAAU,QAAQ,MAAM,2BAA2B,CAAC,GAAO,MAChD,EACF,SAAS,YAAY,EACrB,KAAK,CAAC,MACH,EAAW,MAAM,EAAS,mBAAmB;AAAA,MACzC,YAAY;AAAA,QACR,EAAM,OAAO;AAAA,QACb,EAAM,OAAO;AAAA,QACf,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;AAAA,MACnB,cAAc,EAAM,OAAO;AAAA,IAAA,CAC9B,CACL,EACC,KAAK,CAAI,EACT,MAAM,CAAC,MAAU;AACd,UAAI;AACA,eAAO,EAAK,CAAK;AAAA,IACrB,CACH,CACR;AAAA,EAAA,CACJ,CACJ,EACA,KAAK,MAAM;AACI;EAAA,CACf;AACT;"}
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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;"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/knowledge-widget-components-notification-list",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.17",
|
|
4
4
|
"description": "Notification list component for ACE Knowledge Widgets.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "Telia Company AB",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"telia"
|
|
9
9
|
],
|
|
10
|
-
"
|
|
10
|
+
"exports": {
|
|
11
|
+
"development": "./src/index.ts",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
11
15
|
"types": "dist/index.d.ts",
|
|
12
16
|
"files": [
|
|
13
17
|
"LICENSE.txt",
|
|
@@ -24,9 +28,9 @@
|
|
|
24
28
|
},
|
|
25
29
|
"sideEffects": false,
|
|
26
30
|
"dependencies": {
|
|
27
|
-
"@telia-ace/knowledge-widget-core": "^1.0.
|
|
28
|
-
"@telia-ace/knowledge-widget-types-grid": "^1.0.
|
|
29
|
-
"@telia-ace/knowledge-widget-ui": "^1.0.
|
|
31
|
+
"@telia-ace/knowledge-widget-core": "^1.0.14",
|
|
32
|
+
"@telia-ace/knowledge-widget-types-grid": "^1.0.23",
|
|
33
|
+
"@telia-ace/knowledge-widget-ui": "^1.0.20",
|
|
30
34
|
"@telia-ace/widget-utilities": "^1.0.2",
|
|
31
35
|
"@webprovisions/platform": "^1.1.2"
|
|
32
36
|
},
|
|
@@ -40,5 +44,5 @@
|
|
|
40
44
|
"@types/react-dom": "^16.8.0",
|
|
41
45
|
"@types/styled-components": "^5.1.7"
|
|
42
46
|
},
|
|
43
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "ccf2f3c55b373a7e23227e155d7573259abfacb1"
|
|
44
48
|
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
|
-
import { useContainer, useProperties, createEmptyComponent, NotificationList as NotificationList$1 } from "@telia-ace/knowledge-widget-ui";
|
|
33
|
-
import { appendClassNames } from "@telia-ace/widget-utilities";
|
|
34
|
-
import React from "react";
|
|
35
|
-
const NotificationList = (_a) => {
|
|
36
|
-
var _b = _a, { className } = _b, other = __objRest(_b, ["className"]);
|
|
37
|
-
const container = useContainer();
|
|
38
|
-
const {
|
|
39
|
-
showHeader,
|
|
40
|
-
notificationList,
|
|
41
|
-
loading = false
|
|
42
|
-
} = useProperties();
|
|
43
|
-
if (!(notificationList == null ? void 0 : notificationList.notifications.length) && !loading) {
|
|
44
|
-
return createEmptyComponent(container, __spreadProps(__spreadValues({}, other), {
|
|
45
|
-
className: appendClassNames(className, "humany-notification-list")
|
|
46
|
-
}));
|
|
47
|
-
}
|
|
48
|
-
return /* @__PURE__ */ React.createElement(NotificationList$1, __spreadProps(__spreadValues({}, other), {
|
|
49
|
-
className,
|
|
50
|
-
notificationList,
|
|
51
|
-
loading,
|
|
52
|
-
showHeader
|
|
53
|
-
}));
|
|
54
|
-
};
|
|
55
|
-
export { NotificationList as default };
|
|
56
|
-
//# sourceMappingURL=notification-list.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notification-list.js","sources":["../src/notification-list.tsx"],"sourcesContent":["import {\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 { 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 <NotificationListUi\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\nexport default NotificationList;\r\n"],"names":["NotificationListUi"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,MAAM,mBAAoC,CAAC,OAA4B;AAA5B,eAAE,gBAAF,IAAgB,kBAAhB,IAAgB,CAAd;AACzC,QAAM,YAAY;AACZ,QAAA;AAAA,IACF;AAAA,IACA;AAAA,IACA,UAAU;AAAA,MACV,cAA8C;AAElD,MAAI,CAAC,sDAAkB,cAAc,WAAU,CAAC,SAAS;AACrD,WAAO,qBAAqB,WAAW,iCAChC,QADgC;AAAA,MAEnC,WAAW,iBAAiB,WAAW,0BAA0B;AAAA,IAAA,EACpE;AAAA,EACL;AAEA,SACK,sBAAA,cAAAA,oBAAA,iCACO,QADP;AAAA,IAEG;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,EACJ;AAER;;"}
|