@telia-ace/knowledge-widget-types-grid 1.0.11 → 1.0.14
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/{lib-esm → dist}/data/data-client.d.ts +0 -0
- package/{lib-esm → dist}/data/index.d.ts +0 -0
- package/{lib-esm → dist}/data/legacy-conversion.d.ts +0 -0
- package/{lib-esm → dist}/index.d.ts +0 -0
- package/dist/index.js +686 -0
- package/dist/index.js.map +1 -0
- package/dist/index2.js +6 -0
- package/dist/index2.js.map +1 -0
- package/{lib-esm → dist}/widget/extended-widget.d.ts +0 -0
- package/{lib-esm → dist}/widget/index.d.ts +0 -0
- package/{lib-esm → dist}/widget/services.d.ts +1 -1
- package/package.json +12 -13
- package/lib/data/data-client.d.ts +0 -91
- package/lib/data/data-client.js +0 -504
- package/lib/data/index.d.ts +0 -3
- package/lib/data/index.js +0 -24
- package/lib/data/legacy-conversion.d.ts +0 -75
- package/lib/data/legacy-conversion.js +0 -308
- package/lib/index.d.ts +0 -3
- package/lib/index.js +0 -25
- package/lib/widget/extended-widget.d.ts +0 -5
- package/lib/widget/extended-widget.js +0 -32
- package/lib/widget/index.d.ts +0 -1
- package/lib/widget/index.js +0 -8
- package/lib/widget/services.d.ts +0 -3
- package/lib/widget/services.js +0 -40
- package/lib-esm/data/data-client.js +0 -500
- package/lib-esm/data/index.js +0 -3
- package/lib-esm/data/legacy-conversion.js +0 -304
- package/lib-esm/index.js +0 -3
- package/lib-esm/widget/extended-widget.js +0 -30
- package/lib-esm/widget/index.js +0 -1
- package/lib-esm/widget/services.js +0 -12
|
@@ -1,308 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
-
if (!m) return o;
|
|
5
|
-
var i = m.call(o), r, ar = [], e;
|
|
6
|
-
try {
|
|
7
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
-
}
|
|
9
|
-
catch (error) { e = { error: error }; }
|
|
10
|
-
finally {
|
|
11
|
-
try {
|
|
12
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
-
}
|
|
14
|
-
finally { if (e) throw e.error; }
|
|
15
|
-
}
|
|
16
|
-
return ar;
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.formatLegacyData = void 0;
|
|
20
|
-
var knowledge_widget_core_1 = require("@telia-ace/knowledge-widget-core");
|
|
21
|
-
var widget_forms_1 = require("@telia-ace/widget-forms");
|
|
22
|
-
var data_client_1 = require("./data-client");
|
|
23
|
-
var convertLegacySymbol = function (symbol) {
|
|
24
|
-
if (symbol) {
|
|
25
|
-
var Type = symbol.Type, Content = symbol.Content;
|
|
26
|
-
if (Type && Content) {
|
|
27
|
-
return { type: Type, content: Content };
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
var mapLegacyCategoriesRecursively = function (categories) {
|
|
32
|
-
return categories.map(function (c) {
|
|
33
|
-
var category = {
|
|
34
|
-
id: c.Id.toString(),
|
|
35
|
-
title: c.Name,
|
|
36
|
-
symbol: convertLegacySymbol(c.DefaultIcon),
|
|
37
|
-
activeSymbol: c.ActiveIcon && convertLegacySymbol(c.ActiveIcon),
|
|
38
|
-
description: c.Description || (c.Attributes && c.Attributes.description) || '',
|
|
39
|
-
matches: c.GuidesCount,
|
|
40
|
-
};
|
|
41
|
-
if (c.Children && c.Children.length) {
|
|
42
|
-
category.items = mapLegacyCategoriesRecursively(c.Children);
|
|
43
|
-
}
|
|
44
|
-
return category;
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
var mapNotices = function (source, type) {
|
|
48
|
-
return source
|
|
49
|
-
.filter(function (_a) {
|
|
50
|
-
var Type = _a.Type;
|
|
51
|
-
return Type === type;
|
|
52
|
-
})
|
|
53
|
-
.map(function (_a) {
|
|
54
|
-
var Id = _a.Id, Title = _a.Title, Body = _a.Body;
|
|
55
|
-
return ({
|
|
56
|
-
id: Id.toString(),
|
|
57
|
-
title: Title,
|
|
58
|
-
body: Body,
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
var mapNotificationLists = function (source) {
|
|
63
|
-
return source.map(function (_a) {
|
|
64
|
-
var Id = _a.Id, Title = _a.Title, DefaultIcon = _a.DefaultIcon, ListNotices = _a.ListNotices, Notices = _a.Notices;
|
|
65
|
-
return ({
|
|
66
|
-
id: Id.toString(),
|
|
67
|
-
title: Title,
|
|
68
|
-
symbol: convertLegacySymbol(DefaultIcon),
|
|
69
|
-
defaultHeaderOptions: {
|
|
70
|
-
visible: !!ListNotices.length,
|
|
71
|
-
},
|
|
72
|
-
notifications: (ListNotices || [])
|
|
73
|
-
.concat(Notices || [])
|
|
74
|
-
.map(function (_a) {
|
|
75
|
-
var Id = _a.Id, Title = _a.Title, Body = _a.Body, Type = _a.Type, Modified = _a.Modified;
|
|
76
|
-
return ({
|
|
77
|
-
id: Id.toString(),
|
|
78
|
-
title: Title,
|
|
79
|
-
body: Body,
|
|
80
|
-
modified: Modified,
|
|
81
|
-
expandable: Type === 'listNotice',
|
|
82
|
-
});
|
|
83
|
-
}),
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
};
|
|
87
|
-
var mapContactMethodSettings = function (_a, Validation) {
|
|
88
|
-
var Id = _a.Id, Title = _a.Title, DefaultIcon = _a.DefaultIcon, _b = __read(_a.Exits, 1), Exit = _b[0], ExitType = _a.ExitType, ConfirmationText = _a.ConfirmationText, ExpandFormAutomatically = _a.ExpandFormAutomatically, Form = _a.Form, Description = _a.Description;
|
|
89
|
-
var Adapter = (Exit || { Adapter: {} }).Adapter;
|
|
90
|
-
var _c = Adapter.ClientName, ClientName = _c === void 0 ? '' : _c, _d = Adapter.Settings, Settings = _d === void 0 ? {} : _d, _e = Adapter.CustomClientName, CustomClientName = _e === void 0 ? '' : _e;
|
|
91
|
-
var settings = {
|
|
92
|
-
id: Id.toString(),
|
|
93
|
-
title: Title,
|
|
94
|
-
description: Description,
|
|
95
|
-
symbol: convertLegacySymbol(DefaultIcon),
|
|
96
|
-
clientName: ClientName === 'custom.adapter' ? CustomClientName : ClientName,
|
|
97
|
-
expanded: true,
|
|
98
|
-
inline: true,
|
|
99
|
-
body: {},
|
|
100
|
-
};
|
|
101
|
-
if (ClientName.indexOf('phone') > -1 || ClientName.indexOf('freetext') > -1) {
|
|
102
|
-
var displayTextBeforeClick = Settings.displayTextBeforeClick, textBeforeClick = Settings.textBeforeClick;
|
|
103
|
-
if (displayTextBeforeClick === 'true') {
|
|
104
|
-
settings.expanded = false;
|
|
105
|
-
settings.title = textBeforeClick;
|
|
106
|
-
}
|
|
107
|
-
if (ClientName.indexOf('phone.text') > -1) {
|
|
108
|
-
settings.body.phoneNumber = Settings.phoneNumber;
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
settings.body.freetext = Settings.freetext;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
if (ClientName.indexOf('chat.popup') > -1 ||
|
|
115
|
-
ClientName.indexOf('link') > -1 ||
|
|
116
|
-
(ClientName === 'custom.adapter' && ExitType === 'custom')) {
|
|
117
|
-
settings.body = Settings;
|
|
118
|
-
settings.body.confirmationFallback = ConfirmationText;
|
|
119
|
-
}
|
|
120
|
-
if (ClientName.indexOf('ace') > -1) {
|
|
121
|
-
settings.body = Settings;
|
|
122
|
-
}
|
|
123
|
-
if (Form && Form.HasValueComponents) {
|
|
124
|
-
if (Validation) {
|
|
125
|
-
settings.body.form = widget_forms_1.FormBuilder.fromLegacyForm(Id.toString(), Form, Validation).get();
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
settings.body.form = widget_forms_1.FormBuilder.fromLegacyForm(Id.toString(), Form).get();
|
|
129
|
-
}
|
|
130
|
-
if (!ExpandFormAutomatically) {
|
|
131
|
-
settings.expanded = settings.inline = false;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
return settings;
|
|
135
|
-
};
|
|
136
|
-
var mapTags = function (tags) {
|
|
137
|
-
if (tags === void 0) { tags = []; }
|
|
138
|
-
return tags.map(function (_a) {
|
|
139
|
-
var Id = _a.Id, Title = _a.Title, TotalMatches = _a.TotalMatches, Symbol = _a.Symbol, DefaultIcon = _a.DefaultIcon, ActiveIcon = _a.ActiveIcon;
|
|
140
|
-
return ({
|
|
141
|
-
id: Id.toString(),
|
|
142
|
-
title: Title,
|
|
143
|
-
matches: TotalMatches,
|
|
144
|
-
symbol: convertLegacySymbol(DefaultIcon || Symbol),
|
|
145
|
-
defaultIcon: convertLegacySymbol(DefaultIcon),
|
|
146
|
-
activeIcon: convertLegacySymbol(ActiveIcon),
|
|
147
|
-
});
|
|
148
|
-
});
|
|
149
|
-
};
|
|
150
|
-
var mapGuides = function (guides) {
|
|
151
|
-
return guides.map(function (_a) {
|
|
152
|
-
var Id = _a.Id, Title = _a.Title, Tags = _a.Tags, FirstPublishedDate = _a.FirstPublishedDate, Modified = _a.Modified;
|
|
153
|
-
return ({
|
|
154
|
-
id: Id.toString(),
|
|
155
|
-
title: Title,
|
|
156
|
-
tags: mapTags(Tags),
|
|
157
|
-
published: FirstPublishedDate,
|
|
158
|
-
modified: Modified,
|
|
159
|
-
});
|
|
160
|
-
});
|
|
161
|
-
};
|
|
162
|
-
var formatLegacyData = function (type, data) {
|
|
163
|
-
switch (type) {
|
|
164
|
-
case data_client_1.ServiceClientQueryType.MatchByCategory:
|
|
165
|
-
case data_client_1.ServiceClientQueryType.Match: {
|
|
166
|
-
var result = {
|
|
167
|
-
guides: [],
|
|
168
|
-
matches: 0,
|
|
169
|
-
topNotifications: [],
|
|
170
|
-
middleNotifications: [],
|
|
171
|
-
bottomNotifications: [],
|
|
172
|
-
notificationLists: [],
|
|
173
|
-
tags: [],
|
|
174
|
-
byCategory: [],
|
|
175
|
-
};
|
|
176
|
-
var Matches = data.Matches, TotalMatches = data.TotalMatches, Notices = data.Notices, NoticeLists = data.NoticeLists, Tags = data.Tags, ByCategory = data.ByCategory;
|
|
177
|
-
result.guides = mapGuides(Matches);
|
|
178
|
-
result.matches = TotalMatches;
|
|
179
|
-
result.byCategory = (ByCategory || []).map(function (_a) {
|
|
180
|
-
var Id = _a.Id, Matches = _a.Matches, TotalMatches = _a.TotalMatches;
|
|
181
|
-
return ({
|
|
182
|
-
id: Id,
|
|
183
|
-
guides: mapGuides(Matches),
|
|
184
|
-
matches: TotalMatches,
|
|
185
|
-
});
|
|
186
|
-
});
|
|
187
|
-
result.tags = mapTags(Tags);
|
|
188
|
-
result.notificationLists = mapNotificationLists(NoticeLists || []);
|
|
189
|
-
result.topNotifications = mapNotices(Notices || [], 'noticeRowTop');
|
|
190
|
-
result.middleNotifications = mapNotices(Notices || [], 'noticeRowMiddle');
|
|
191
|
-
result.bottomNotifications = mapNotices(Notices || [], 'footerNotice');
|
|
192
|
-
return result;
|
|
193
|
-
}
|
|
194
|
-
case data_client_1.ServiceClientQueryType.Categories: {
|
|
195
|
-
var Children = data.Children, GuidesCountTotal = data.GuidesCountTotal;
|
|
196
|
-
var result = {
|
|
197
|
-
categories: mapLegacyCategoriesRecursively(Children || []),
|
|
198
|
-
matches: GuidesCountTotal,
|
|
199
|
-
};
|
|
200
|
-
return result;
|
|
201
|
-
}
|
|
202
|
-
case data_client_1.ServiceClientQueryType.Guide: {
|
|
203
|
-
var Id_1 = data.Id, Title_1 = data.Title, Body = data.Body, Related = data.Related, Options = data.Options, ConnectionId_1 = data.ConnectionId, ContactMethods = data.ContactMethods, EnableFeedback = data.EnableFeedback, HandoverExists = data.HandoverExists, FirstPublishedDate = data.FirstPublishedDate, Modified = data.Modified, ModifiedByDisplayName = data.ModifiedByDisplayName, FirstPublishedByDisplayName = data.FirstPublishedByDisplayName, Categories = data.Categories, Tags_1 = data.Tags, SeoMetaDescription = data.SeoMetaDescription, SeoAllowIndex = data.SeoAllowIndex, Perspectives = data.Perspectives, PerspectiveKey = data.PerspectiveKey, Translations_1 = data.Translations;
|
|
204
|
-
/*
|
|
205
|
-
PerspectiveKey is always null when on the "top level" of a dialog tree
|
|
206
|
-
OR when navigating down a dialog tree in the "Default answer version"
|
|
207
|
-
Note: The "Default answer version" is not the same as a given guides
|
|
208
|
-
default answer version. The "Default answer version" is always the answer
|
|
209
|
-
version in Perspectives with the key "Default".
|
|
210
|
-
*/
|
|
211
|
-
var perspective = PerspectiveKey ||
|
|
212
|
-
Object.values(Perspectives).find(function (connection) { return connection === ConnectionId_1; }) ||
|
|
213
|
-
Perspectives['Default'] ||
|
|
214
|
-
null;
|
|
215
|
-
var result_1 = {
|
|
216
|
-
guide: {
|
|
217
|
-
id: Id_1.toString(),
|
|
218
|
-
title: Title_1,
|
|
219
|
-
body: Body,
|
|
220
|
-
modified: Modified,
|
|
221
|
-
published: FirstPublishedDate,
|
|
222
|
-
modifiedBy: ModifiedByDisplayName,
|
|
223
|
-
publishedBy: FirstPublishedByDisplayName,
|
|
224
|
-
connection: ConnectionId_1,
|
|
225
|
-
categories: Categories,
|
|
226
|
-
hasHandover: HandoverExists,
|
|
227
|
-
allowFeedback: EnableFeedback,
|
|
228
|
-
seoMetaDescription: SeoMetaDescription,
|
|
229
|
-
seoAllowIndex: SeoAllowIndex,
|
|
230
|
-
perspectives: Perspectives,
|
|
231
|
-
perspective: perspective,
|
|
232
|
-
translations: Object.keys(Translations_1 || {}).reduce(function (acc, key) {
|
|
233
|
-
acc[key] = Translations_1[key].toString();
|
|
234
|
-
return acc;
|
|
235
|
-
}, {}),
|
|
236
|
-
},
|
|
237
|
-
related: mapGuides(Related || []),
|
|
238
|
-
dialog: [],
|
|
239
|
-
contactMethods: (ContactMethods || []).map(function (cm) { return mapContactMethodSettings(cm); }),
|
|
240
|
-
tags: mapTags(Tags_1),
|
|
241
|
-
};
|
|
242
|
-
(Options || []).forEach(function (_a) {
|
|
243
|
-
var CanAccess = _a.CanAccess, Description = _a.Description, ConnectionId = _a.ConnectionId, Properties = _a.Properties;
|
|
244
|
-
if (!CanAccess) {
|
|
245
|
-
return;
|
|
246
|
-
}
|
|
247
|
-
var item = {
|
|
248
|
-
id: Id_1.toString(),
|
|
249
|
-
title: Description,
|
|
250
|
-
connection: ConnectionId,
|
|
251
|
-
type: knowledge_widget_core_1.DialogItemType.default,
|
|
252
|
-
parent: {
|
|
253
|
-
id: Id_1.toString(),
|
|
254
|
-
title: Title_1,
|
|
255
|
-
tags: mapTags(Tags_1),
|
|
256
|
-
},
|
|
257
|
-
};
|
|
258
|
-
if (Properties.Type === 'Guide' || Properties.Type === 'Link') {
|
|
259
|
-
Properties.Id && (item.id = Properties.Id.toString());
|
|
260
|
-
Properties.Uri && (item.href = Properties.Uri);
|
|
261
|
-
Properties.Target && (item.target = Properties.Target);
|
|
262
|
-
switch (Properties.Type) {
|
|
263
|
-
case 'Guide':
|
|
264
|
-
item.type = knowledge_widget_core_1.DialogItemType.guide;
|
|
265
|
-
break;
|
|
266
|
-
case 'Link':
|
|
267
|
-
item.type = knowledge_widget_core_1.DialogItemType.link;
|
|
268
|
-
break;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
result_1.dialog.push(item);
|
|
272
|
-
});
|
|
273
|
-
return result_1;
|
|
274
|
-
}
|
|
275
|
-
case data_client_1.ServiceClientQueryType.Contacts: {
|
|
276
|
-
var Children = data.Children, Matches = data.Matches, Notices = data.Notices, NoticeLists = data.NoticeLists;
|
|
277
|
-
var result = {
|
|
278
|
-
contactMethods: (Matches || []).map(function (cm) { return mapContactMethodSettings(cm); }),
|
|
279
|
-
categories: mapLegacyCategoriesRecursively(Children || []),
|
|
280
|
-
topNotifications: mapNotices(Notices || [], 'noticeRowTop'),
|
|
281
|
-
middleNotifications: mapNotices(Notices || [], 'noticeRowMiddle'),
|
|
282
|
-
bottomNotifications: mapNotices(Notices || [], 'footerNotice'),
|
|
283
|
-
notificationLists: mapNotificationLists(NoticeLists || []),
|
|
284
|
-
};
|
|
285
|
-
return result;
|
|
286
|
-
}
|
|
287
|
-
case data_client_1.ServiceClientQueryType.ContactMethod: {
|
|
288
|
-
var ContactMethod = data.ContactMethod;
|
|
289
|
-
return mapContactMethodSettings(ContactMethod || {});
|
|
290
|
-
}
|
|
291
|
-
case data_client_1.ServiceClientQueryType.Tags:
|
|
292
|
-
case data_client_1.ServiceClientQueryType.TagsOnGuides: {
|
|
293
|
-
return mapTags(data || []);
|
|
294
|
-
}
|
|
295
|
-
case data_client_1.ServiceClientQueryType.Notifications: {
|
|
296
|
-
var Notices = data.Notices, NoticeLists = data.NoticeLists;
|
|
297
|
-
return {
|
|
298
|
-
topNotifications: mapNotices(Notices || [], 'noticeRowTop'),
|
|
299
|
-
middleNotifications: mapNotices(Notices || [], 'noticeRowMiddle'),
|
|
300
|
-
bottomNotifications: mapNotices(Notices || [], 'footerNotice'),
|
|
301
|
-
notificationLists: mapNotificationLists(NoticeLists || []),
|
|
302
|
-
};
|
|
303
|
-
}
|
|
304
|
-
default:
|
|
305
|
-
return {};
|
|
306
|
-
}
|
|
307
|
-
};
|
|
308
|
-
exports.formatLegacyData = formatLegacyData;
|
package/lib/index.d.ts
DELETED
package/lib/index.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.GridWidget = exports.NotFound = exports.genericComponentStyling = exports.DetachedComponent = exports.Component = void 0;
|
|
18
|
-
var widget_types_grid_1 = require("@telia-ace/widget-types-grid");
|
|
19
|
-
Object.defineProperty(exports, "Component", { enumerable: true, get: function () { return widget_types_grid_1.Component; } });
|
|
20
|
-
Object.defineProperty(exports, "DetachedComponent", { enumerable: true, get: function () { return widget_types_grid_1.DetachedComponent; } });
|
|
21
|
-
Object.defineProperty(exports, "genericComponentStyling", { enumerable: true, get: function () { return widget_types_grid_1.genericComponentStyling; } });
|
|
22
|
-
Object.defineProperty(exports, "NotFound", { enumerable: true, get: function () { return widget_types_grid_1.NotFound; } });
|
|
23
|
-
__exportStar(require("./data"), exports);
|
|
24
|
-
var widget_1 = require("./widget");
|
|
25
|
-
Object.defineProperty(exports, "GridWidget", { enumerable: true, get: function () { return widget_1.GridWidget; } });
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
var widget_types_grid_1 = require("@telia-ace/widget-types-grid");
|
|
19
|
-
var services_1 = require("./services");
|
|
20
|
-
var ExtendedWidget = /** @class */ (function (_super) {
|
|
21
|
-
__extends(ExtendedWidget, _super);
|
|
22
|
-
function ExtendedWidget(container) {
|
|
23
|
-
var _this = _super.call(this, container) || this;
|
|
24
|
-
_this.container.registerAsync('contactMethods', function () {
|
|
25
|
-
return (0, services_1.createContactMethodPlatform)(_this.container);
|
|
26
|
-
});
|
|
27
|
-
_this.container.registerAsync('dataClient', function () { return (0, services_1.createDataClient)(_this.container); });
|
|
28
|
-
return _this;
|
|
29
|
-
}
|
|
30
|
-
return ExtendedWidget;
|
|
31
|
-
}(widget_types_grid_1.Widget));
|
|
32
|
-
exports.default = ExtendedWidget;
|
package/lib/widget/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as GridWidget } from './extended-widget';
|
package/lib/widget/index.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.GridWidget = void 0;
|
|
7
|
-
var extended_widget_1 = require("./extended-widget");
|
|
8
|
-
Object.defineProperty(exports, "GridWidget", { enumerable: true, get: function () { return __importDefault(extended_widget_1).default; } });
|
package/lib/widget/services.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { Container } from '@webprovisions/platform';
|
|
2
|
-
export declare const createContactMethodPlatform: (container: Container) => Promise<import("@telia-ace/knowledge-widget-adapters/lib/contact-methods/platform").default>;
|
|
3
|
-
export declare const createDataClient: (container: Container) => Promise<import("../data").DataClient>;
|
package/lib/widget/services.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.createDataClient = exports.createContactMethodPlatform = void 0;
|
|
27
|
-
var createContactMethodPlatform = function (container) {
|
|
28
|
-
return Promise.resolve().then(function () { return __importStar(require('@telia-ace/knowledge-widget-adapters')); }).then(function (_a) {
|
|
29
|
-
var ContactMethodPlatform = _a.ContactMethodPlatform;
|
|
30
|
-
return ContactMethodPlatform.create(container);
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
exports.createContactMethodPlatform = createContactMethodPlatform;
|
|
34
|
-
var createDataClient = function (container) {
|
|
35
|
-
return Promise.resolve().then(function () { return __importStar(require('../data')); }).then(function (_a) {
|
|
36
|
-
var DataClient = _a.DataClient;
|
|
37
|
-
return DataClient.create(container);
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
exports.createDataClient = createDataClient;
|