@telia-ace/knowledge-widget-components-contact-list 1.0.39-next.4 → 1.0.39-next.5
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 +30 -29
- package/dist/index.js.map +1 -1
- package/package.json +7 -6
package/dist/index.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var L = Object.defineProperty, S = Object.defineProperties;
|
|
2
|
+
var k = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var P = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var w = (t, e, s) => e in t ?
|
|
4
|
+
var x = Object.prototype.hasOwnProperty, E = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var w = (t, e, s) => e in t ? L(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s, u = (t, e) => {
|
|
6
6
|
for (var s in e || (e = {}))
|
|
7
|
-
|
|
7
|
+
x.call(e, s) && w(t, s, e[s]);
|
|
8
8
|
if (P)
|
|
9
9
|
for (var s of P(e))
|
|
10
|
-
|
|
10
|
+
E.call(e, s) && w(t, s, e[s]);
|
|
11
11
|
return t;
|
|
12
|
-
}, d = (t, e) =>
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
12
|
+
}, d = (t, e) => S(t, k(e));
|
|
13
|
+
import { DataClient as F } from "@telia-ace/knowledge-data-client";
|
|
14
|
+
import { updateForm as G, useForm as R, useExpand as $, fetchAccordionGuideIfMissing as j } from "@telia-ace/knowledge-widget-component-utilities";
|
|
15
|
+
import { createEventSubscriber as z, extendComponent as B } from "@telia-ace/knowledge-widget-core";
|
|
15
16
|
import { DataType as M } from "@telia-ace/knowledge-widget-types-grid";
|
|
16
|
-
import { createReactComponent as
|
|
17
|
-
const
|
|
18
|
-
const { events: e } = t.get("$widget"), [s,
|
|
19
|
-
return
|
|
17
|
+
import { createReactComponent as K } from "@telia-ace/knowledge-widget-ui";
|
|
18
|
+
const O = (t) => {
|
|
19
|
+
const { events: e } = t.get("$widget"), [s, D] = z(e);
|
|
20
|
+
return K(
|
|
20
21
|
t,
|
|
21
22
|
"contact-list",
|
|
22
23
|
import("./contact-list.5875aa00.js"),
|
|
@@ -40,41 +41,41 @@ const K = (t) => {
|
|
|
40
41
|
a(c);
|
|
41
42
|
}), s("router:changed", (o, { current: c }) => {
|
|
42
43
|
a(c.routeData.params);
|
|
43
|
-
}),
|
|
44
|
+
}), R(t, r), $(r);
|
|
44
45
|
}
|
|
45
|
-
).then(() =>
|
|
46
|
+
).then(() => B(t, "contact-list", (r) => {
|
|
46
47
|
r.actions.watch("contact-list.fetch", (a, o) => {
|
|
47
48
|
const {
|
|
48
49
|
deflection: c = {},
|
|
49
50
|
deflectionPageSize: h = 5,
|
|
50
51
|
deflectionAccordion: i
|
|
51
52
|
} = r.properties(), { params: v = {} } = a, {
|
|
52
|
-
contactCategory:
|
|
53
|
+
contactCategory: f,
|
|
53
54
|
guide: m,
|
|
54
|
-
accordion:
|
|
55
|
+
accordion: A
|
|
55
56
|
} = v;
|
|
56
|
-
return
|
|
57
|
-
contactMethodCategoryId:
|
|
58
|
-
}).then(({ contactMethods:
|
|
57
|
+
return F.getInstance(t).then((g) => g.fetch(M.ContactMethodCategories, {
|
|
58
|
+
contactMethodCategoryId: f
|
|
59
|
+
}).then(({ contactMethods: p, categories: l }) => {
|
|
59
60
|
var y;
|
|
60
|
-
const b = Object.keys(c), C = b.length === 1 && !
|
|
61
|
-
return (y = c[C]) != null && y.length ?
|
|
61
|
+
const b = Object.keys(c), C = b.length === 1 && !f ? b[0] : f;
|
|
62
|
+
return (y = c[C]) != null && y.length ? g.fetch(M.Guides, {
|
|
62
63
|
categories: c[C],
|
|
63
64
|
take: h
|
|
64
|
-
}).then((n) => i && m &&
|
|
65
|
+
}).then((n) => i && m && A === r.node.name ? j(
|
|
65
66
|
n,
|
|
66
|
-
|
|
67
|
+
g,
|
|
67
68
|
{ guide: m }
|
|
68
69
|
) : new Promise(
|
|
69
|
-
(
|
|
70
|
-
)).then(({ guides: n }) => o({ guides: n, contactMethods:
|
|
70
|
+
(I) => I(n)
|
|
71
|
+
)).then(({ guides: n }) => o({ guides: n, contactMethods: p, categories: l })) : o({ contactMethods: p, categories: l });
|
|
71
72
|
}));
|
|
72
73
|
});
|
|
73
74
|
})).then(() => {
|
|
74
|
-
|
|
75
|
+
D();
|
|
75
76
|
});
|
|
76
|
-
},
|
|
77
|
+
}, U = O;
|
|
77
78
|
export {
|
|
78
|
-
|
|
79
|
+
U as default
|
|
79
80
|
};
|
|
80
81
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/contact-list-component.ts"],"sourcesContent":["import { ContactMethodType } from '@telia-ace/knowledge-widget-adapters';\nimport {\n fetchAccordionGuideIfMissing,\n updateForm,\n useExpand,\n useForm,\n} from '@telia-ace/knowledge-widget-component-utilities';\nimport {\n Category,\n createEventSubscriber,\n extendComponent,\n Guide,\n} from '@telia-ace/knowledge-widget-core';\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/contact-list-component.ts"],"sourcesContent":["import { DataClient } from '@telia-ace/knowledge-data-client';\nimport { ContactMethodType } from '@telia-ace/knowledge-widget-adapters';\nimport {\n fetchAccordionGuideIfMissing,\n updateForm,\n useExpand,\n useForm,\n} from '@telia-ace/knowledge-widget-component-utilities';\nimport {\n Category,\n createEventSubscriber,\n extendComponent,\n Guide,\n} from '@telia-ace/knowledge-widget-core';\nimport { ContactsResult, DataType, MatchResult } from '@telia-ace/knowledge-widget-types-grid';\nimport { createReactComponent } from '@telia-ace/knowledge-widget-ui';\nimport { FormComponentInstanceProperties } from '@telia-ace/widget-forms';\nimport { Container } from '@webprovisions/platform';\n\nexport type ContactListComponentProps = {\n deflectionHeader?: string;\n deflection?: { [contactCategoryId: string]: string[] };\n deflectionPageSize?: number;\n routes?: {\n contactCategory?: string;\n guide?: string;\n };\n categories?: Category[]; // internal\n contactMethods?: ContactMethodType[]; // internal\n guides?: Guide[]; // internal\n deflectionAccordion?: boolean;\n} & FormComponentInstanceProperties;\n\nexport const ContactListComponent = (container: Container) => {\n const { events } = container.get('$widget');\n const [subscribe, unsubscribe] = createEventSubscriber(events);\n\n return createReactComponent(\n container,\n 'contact-list',\n import('./contact-list'),\n (component) => {\n const fetch = (params: { [key: string]: any }) => {\n component.writeProperties({ loading: true, contactMethods: [], categories: [] });\n component.actions.dispatch('fetch', { params });\n };\n\n component.actions.create('fetch', (data) => {\n const { submitButtonLabel = 'Submit' } =\n component.properties<ContactListComponentProps>();\n\n const contactMethods = (data.contactMethods || []).map((cm: ContactMethodType) => ({\n ...cm,\n body: updateForm(cm, { submit: submitButtonLabel }),\n }));\n\n return component.actions.dispatch('fetched', {\n ...data,\n contactMethods,\n loading: true,\n });\n });\n\n component.actions.create('fetched', (input) => {\n return component.writeProperties({\n ...input,\n guides: input.guides || [],\n loading: false,\n });\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 useForm(container, component);\n useExpand(component);\n }\n )\n .then(() => {\n return extendComponent(container, 'contact-list', (component) => {\n component.actions.watch('contact-list.fetch', (input, next) => {\n const {\n deflection = {},\n deflectionPageSize = 5,\n deflectionAccordion,\n } = component.properties<ContactListComponentProps>();\n const { params = {} } = input;\n const {\n contactCategory,\n guide: guideParam,\n accordion: accordionParam,\n } = params;\n return DataClient.getInstance(container).then((dataClient: DataClient) => {\n return dataClient\n .fetch(DataType.ContactMethodCategories, {\n contactMethodCategoryId: contactCategory,\n })\n .then(({ contactMethods, categories }: ContactsResult) => {\n const deflectionKeys = Object.keys(deflection);\n const currentCategory =\n deflectionKeys.length === 1 && !contactCategory\n ? deflectionKeys[0]\n : contactCategory;\n\n if (deflection[currentCategory]?.length) {\n return dataClient\n .fetch(DataType.Guides, {\n categories: deflection[currentCategory],\n take: deflectionPageSize,\n })\n .then((data: MatchResult) => {\n if (\n deflectionAccordion &&\n guideParam &&\n accordionParam === component.node.name\n ) {\n return fetchAccordionGuideIfMissing(\n data,\n dataClient,\n { guide: guideParam }\n );\n }\n return new Promise<MatchResult>((resolve) =>\n resolve(data)\n );\n })\n .then(({ guides }: MatchResult) => {\n return next({ guides, contactMethods, categories });\n });\n }\n\n return next({ contactMethods, categories });\n });\n });\n });\n });\n })\n .then(() => {\n unsubscribe();\n });\n};\n\nexport default ContactListComponent;\n"],"names":["ContactListComponent","container","events","subscribe","unsubscribe","createEventSubscriber","createReactComponent","component","fetch","params","data","submitButtonLabel","contactMethods","cm","__spreadProps","__spreadValues","updateForm","input","router","event","current","useForm","useExpand","extendComponent","next","deflection","deflectionPageSize","deflectionAccordion","contactCategory","guideParam","accordionParam","DataClient","dataClient","DataType","categories","deflectionKeys","currentCategory","_a","fetchAccordionGuideIfMissing","resolve","guides","ContactListComponent$1"],"mappings":";;;;;;;;;;;;;;;;;AAiCa,MAAAA,IAAuB,CAACC,MAAyB;AAC1D,QAAM,EAAE,QAAAC,EAAW,IAAAD,EAAU,IAAI,SAAS,GACpC,CAACE,GAAWC,CAAW,IAAIC,EAAsBH,CAAM;AAEtD,SAAAI;AAAA,IACHL;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP,CAACM,MAAc;AACL,YAAAC,IAAQ,CAACC,MAAmC;AACpC,QAAAF,EAAA,gBAAgB,EAAE,SAAS,IAAM,gBAAgB,IAAI,YAAY,CAAC,EAAA,CAAG,GAC/EA,EAAU,QAAQ,SAAS,SAAS,EAAE,QAAAE,EAAQ,CAAA;AAAA,MAAA;AAGlD,MAAAF,EAAU,QAAQ,OAAO,SAAS,CAACG,MAAS;AACxC,cAAM,EAAE,mBAAAC,IAAoB,SAAS,IACjCJ,EAAU,WAAsC,GAE9CK,KAAkBF,EAAK,kBAAkB,CAAA,GAAI,IAAI,CAAC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,CAAA,EACA,KAAK,CAAC,EAAE,gBAAAhB,GAAgB,YAAAsB,QAAiC;;AAChD,cAAAC,IAAiB,OAAO,KAAKV,CAAU,GACvCW,IACFD,EAAe,WAAW,KAAK,CAACP,IAC1BO,EAAe,KACfP;AAEN,gBAAAS,IAAAZ,EAAWW,OAAX,QAAAC,EAA6B,SACtBL,EACF,MAAMC,EAAS,QAAQ;AAAA,UACpB,YAAYR,EAAWW;AAAA,UACvB,MAAMV;AAAA,QAAA,CACT,EACA,KAAK,CAAChB,MAECiB,KACAE,KACAC,MAAmBvB,EAAU,KAAK,OAE3B+B;AAAA,UACH5B;AAAA,UACAsB;AAAA,UACA,EAAE,OAAOH,EAAW;AAAA,QAAA,IAGrB,IAAI;AAAA,UAAqB,CAACU,MAC7BA,EAAQ7B,CAAI;AAAA,QAAA,CAEnB,EACA,KAAK,CAAC,EAAE,QAAA8B,QACEhB,EAAK,EAAE,QAAAgB,GAAQ,gBAAA5B,GAAgB,YAAAsB,EAAY,CAAA,CACrD,IAGFV,EAAK,EAAE,gBAAAZ,GAAgB,YAAAsB,EAAY,CAAA;AAAA,MAAA,CAC7C,CACR;AAAA,IAAA,CACJ;AAAA,EAAA,CACJ,CACJ,EACA,KAAK,MAAM;AACI,IAAA9B;EAAA,CACf;AACT,GAEAqC,IAAezC;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/knowledge-widget-components-contact-list",
|
|
3
|
-
"version": "1.0.39-next.
|
|
3
|
+
"version": "1.0.39-next.5",
|
|
4
4
|
"description": "Contact list component for ACE Knowledge Widgets.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "Telia Company AB",
|
|
@@ -21,11 +21,12 @@
|
|
|
21
21
|
},
|
|
22
22
|
"sideEffects": false,
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@telia-ace/knowledge-
|
|
25
|
-
"@telia-ace/knowledge-widget-
|
|
26
|
-
"@telia-ace/knowledge-widget-
|
|
27
|
-
"@telia-ace/knowledge-widget-
|
|
28
|
-
"@telia-ace/knowledge-widget-
|
|
24
|
+
"@telia-ace/knowledge-data-client": "1.0.2-next.1",
|
|
25
|
+
"@telia-ace/knowledge-widget-adapters": "1.0.45-next.5",
|
|
26
|
+
"@telia-ace/knowledge-widget-component-utilities": "1.0.39-next.5",
|
|
27
|
+
"@telia-ace/knowledge-widget-core": "1.0.35-next.5",
|
|
28
|
+
"@telia-ace/knowledge-widget-types-grid": "1.0.46-next.5",
|
|
29
|
+
"@telia-ace/knowledge-widget-ui": "1.0.41-next.5",
|
|
29
30
|
"@telia-ace/widget-forms": "^1.0.28-next.0",
|
|
30
31
|
"@telia-ace/widget-utilities": "^1.0.10-next.0",
|
|
31
32
|
"@webprovisions/platform": "^1.1.2"
|