@telia-ace/knowledge-widget-components-notification-list 1.0.39-next.5 → 1.0.39
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 +37 -38
- package/dist/index.js.map +1 -1
- package/package.json +5 -6
package/dist/index.js
CHANGED
|
@@ -2,70 +2,69 @@ var m = Object.defineProperty, C = Object.defineProperties;
|
|
|
2
2
|
var L = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var h = Object.getOwnPropertySymbols;
|
|
4
4
|
var b = Object.prototype.hasOwnProperty, v = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var d = (t,
|
|
6
|
-
for (var
|
|
7
|
-
b.call(
|
|
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
|
+
b.call(e, i) && d(t, i, e[i]);
|
|
8
8
|
if (h)
|
|
9
|
-
for (var
|
|
10
|
-
v.call(
|
|
9
|
+
for (var i of h(e))
|
|
10
|
+
v.call(e, i) && d(t, i, e[i]);
|
|
11
11
|
return t;
|
|
12
|
-
}, n = (t,
|
|
13
|
-
import { DataClient as y } from "@telia-ace/knowledge-data-client";
|
|
14
|
-
import { createEventSubscriber as
|
|
15
|
-
import { DataType as N } from "@telia-ace/knowledge-widget-types-grid";
|
|
12
|
+
}, n = (t, e) => C(t, L(e));
|
|
13
|
+
import { DataClient as y, DataType as w } from "@telia-ace/knowledge-data-client";
|
|
14
|
+
import { createEventSubscriber as D, extendComponent as N } from "@telia-ace/knowledge-widget-core";
|
|
16
15
|
import { createReactComponent as P } from "@telia-ace/knowledge-widget-ui";
|
|
17
16
|
const R = (t) => {
|
|
18
|
-
const { events:
|
|
17
|
+
const { events: e } = t.get("$widget"), [i, u] = D(e);
|
|
19
18
|
return P(
|
|
20
19
|
t,
|
|
21
20
|
"notification-list",
|
|
22
21
|
import("./notification-list.4eb10bb7.js"),
|
|
23
|
-
(
|
|
24
|
-
const
|
|
25
|
-
|
|
22
|
+
(r) => {
|
|
23
|
+
const o = (a) => {
|
|
24
|
+
r.writeProperties(n(c({}, r.properties()), {
|
|
26
25
|
loading: !0,
|
|
27
26
|
error: void 0,
|
|
28
27
|
notificationList: void 0
|
|
29
|
-
})),
|
|
28
|
+
})), r.actions.dispatch("fetch", { params: a });
|
|
30
29
|
};
|
|
31
|
-
|
|
32
|
-
if (
|
|
33
|
-
return
|
|
34
|
-
error:
|
|
30
|
+
r.actions.create("fetch", ({ error: a, notificationLists: s }) => {
|
|
31
|
+
if (a)
|
|
32
|
+
return r.actions.dispatch("fetched", {
|
|
33
|
+
error: a,
|
|
35
34
|
loading: !0,
|
|
36
35
|
notificationList: void 0
|
|
37
36
|
});
|
|
38
|
-
const { category: f, notificationList:
|
|
39
|
-
notificationList:
|
|
37
|
+
const { category: f, notificationList: p } = r.properties(), g = {
|
|
38
|
+
notificationList: s.find((l) => l.id === f) || p
|
|
40
39
|
};
|
|
41
|
-
return
|
|
40
|
+
return r.actions.dispatch("fetched", n(c({}, g), {
|
|
42
41
|
loading: !0
|
|
43
42
|
}));
|
|
44
|
-
}),
|
|
45
|
-
const { params:
|
|
46
|
-
s
|
|
47
|
-
}),
|
|
48
|
-
s
|
|
43
|
+
}), r.actions.create("fetched", (a) => r.writeProperties(n(c({}, a), { loading: !1 }))), t.getAsync("router").then((a) => {
|
|
44
|
+
const { params: s } = a.getRouteData();
|
|
45
|
+
o(s);
|
|
46
|
+
}), i("router:changed", (a, { current: s }) => {
|
|
47
|
+
o(s.routeData.params);
|
|
49
48
|
});
|
|
50
49
|
}
|
|
51
|
-
).then(() =>
|
|
52
|
-
|
|
53
|
-
(
|
|
50
|
+
).then(() => N(t, "notification-list", (r) => {
|
|
51
|
+
r.actions.watch("notification-list.fetch", (o, a) => y.getInstance(t).then(
|
|
52
|
+
(s) => s.fetch(w.NotificationLists, {
|
|
54
53
|
categories: [
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
o.params.guideCategory,
|
|
55
|
+
o.params.contactCategory
|
|
57
56
|
].filter((f) => !!f),
|
|
58
|
-
searchPhrase:
|
|
57
|
+
searchPhrase: o.params.phrase
|
|
59
58
|
})
|
|
60
|
-
).then(
|
|
61
|
-
if (
|
|
62
|
-
return
|
|
59
|
+
).then(a).catch((s) => {
|
|
60
|
+
if (s)
|
|
61
|
+
return a(s);
|
|
63
62
|
}));
|
|
64
63
|
})).then(() => {
|
|
65
|
-
|
|
64
|
+
u();
|
|
66
65
|
});
|
|
67
|
-
},
|
|
66
|
+
}, I = R;
|
|
68
67
|
export {
|
|
69
|
-
|
|
68
|
+
I as default
|
|
70
69
|
};
|
|
71
70
|
//# 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 { DataClient } from '@telia-ace/knowledge-data-client';\nimport {\n createEventSubscriber,\n extendComponent,\n NotificationList,\n} from '@telia-ace/knowledge-widget-core';\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/notification-list-component.ts"],"sourcesContent":["import { DataClient, DataType, NotificationResults } from '@telia-ace/knowledge-data-client';\nimport {\n createEventSubscriber,\n extendComponent,\n NotificationList,\n} from '@telia-ace/knowledge-widget-core';\nimport { createReactComponent } from '@telia-ace/knowledge-widget-ui';\nimport { Container, Widget } from '@webprovisions/platform';\n\nexport type NotificationListComponentProps = {\n category?: string;\n showHeader?: boolean;\n notificationList?: NotificationList; // internal\n};\n\ntype FetchResults = NotificationResults & { error: any };\n\nexport const NotificationListComponent = (container: Container) => {\n const { events }: Widget = container.get('$widget');\n const [subscribe, unsubscribe] = createEventSubscriber(events);\n\n return createReactComponent(\n container,\n 'notification-list',\n import('./notification-list'),\n (component) => {\n const fetch = (params: { [key: string]: any }) => {\n component.writeProperties({\n ...component.properties<NotificationListComponentProps>(),\n loading: true,\n error: undefined,\n notificationList: undefined,\n });\n component.actions.dispatch('fetch', { params });\n };\n\n component.actions.create('fetch', ({ error, notificationLists }: FetchResults) => {\n if (error) {\n return component.actions.dispatch('fetched', {\n error,\n loading: true,\n notificationList: undefined,\n });\n }\n\n const { category, notificationList } =\n component.properties<NotificationListComponentProps>();\n\n const properties = {\n notificationList:\n notificationLists.find((n) => n.id === category) || notificationList,\n };\n\n return component.actions.dispatch('fetched', {\n ...properties,\n loading: true,\n });\n });\n\n component.actions.create('fetched', (input) => {\n return component.writeProperties({ ...input, loading: false });\n });\n\n container.getAsync('router').then((router) => {\n const { params } = router.getRouteData();\n fetch(params);\n });\n\n subscribe('router:changed', (event: any, { current }: any) => {\n fetch(current.routeData.params);\n });\n }\n )\n .then(() => {\n return extendComponent(container, 'notification-list', (component) => {\n component.actions.watch('notification-list.fetch', (input, next) => {\n return DataClient.getInstance(container)\n .then((dataClient: DataClient) =>\n dataClient.fetch(DataType.NotificationLists, {\n categories: [\n input.params.guideCategory,\n input.params.contactCategory,\n ].filter((c) => !!c),\n searchPhrase: input.params.phrase,\n })\n )\n .then(next)\n .catch((error) => {\n if (error) {\n return next(error);\n }\n });\n });\n });\n })\n .then(() => {\n unsubscribe();\n });\n};\n\nexport default NotificationListComponent;\n"],"names":["NotificationListComponent","container","events","subscribe","unsubscribe","createEventSubscriber","createReactComponent","component","fetch","params","__spreadProps","__spreadValues","error","notificationLists","category","notificationList","properties","n","input","router","event","current","extendComponent","next","DataClient","dataClient","DataType","c","NotificationListComponent$1"],"mappings":";;;;;;;;;;;;;;;AAiBa,MAAAA,IAA4B,CAACC,MAAyB;AAC/D,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,Q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,EAClC;AAAA,MAAK,CAACwB,MACHA,EAAW,MAAMC,EAAS,mBAAmB;AAAA,QACzC,YAAY;AAAA,UACRR,EAAM,OAAO;AAAA,UACbA,EAAM,OAAO;AAAA,UACf,OAAO,CAACS,MAAM,CAAC,CAACA,CAAC;AAAA,QACnB,cAAcT,EAAM,OAAO;AAAA,MAAA,CAC9B;AAAA,MAEJ,KAAKK,CAAI,EACT,MAAM,CAACX,MAAU;AACd,UAAIA;AACA,eAAOW,EAAKX,CAAK;AAAA,IACrB,CACH,CACR;AAAA,EAAA,CACJ,CACJ,EACA,KAAK,MAAM;AACI,IAAAR;EAAA,CACf;AACT,GAEAwB,IAAe5B;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/knowledge-widget-components-notification-list",
|
|
3
|
-
"version": "1.0.39
|
|
3
|
+
"version": "1.0.39",
|
|
4
4
|
"description": "Notification list component for ACE Knowledge Widgets.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "Telia Company AB",
|
|
@@ -21,11 +21,10 @@
|
|
|
21
21
|
},
|
|
22
22
|
"sideEffects": false,
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@telia-ace/knowledge-data-client": "1.0.2
|
|
25
|
-
"@telia-ace/knowledge-widget-core": "1.0.35
|
|
26
|
-
"@telia-ace/knowledge-widget-
|
|
27
|
-
"@telia-ace/
|
|
28
|
-
"@telia-ace/widget-utilities": "^1.0.10-next.0",
|
|
24
|
+
"@telia-ace/knowledge-data-client": "1.0.2",
|
|
25
|
+
"@telia-ace/knowledge-widget-core": "1.0.35",
|
|
26
|
+
"@telia-ace/knowledge-widget-ui": "1.0.41",
|
|
27
|
+
"@telia-ace/widget-utilities": "^1.0.10",
|
|
29
28
|
"@webprovisions/platform": "^1.1.2"
|
|
30
29
|
},
|
|
31
30
|
"peerDependencies": {
|