@saasquatch/vanilla-components 1.2.4-0 → 1.2.4-1

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.
Files changed (88) hide show
  1. package/LICENSE +21 -21
  2. package/dist/cjs/{WidgetHost-d7b870ce.js → WidgetHost-71b013eb.js} +615 -615
  3. package/dist/cjs/sqh-close-button.cjs.entry.js +25 -25
  4. package/dist/cjs/sqh-copy-button_12.cjs.entry.js +1050 -1151
  5. package/dist/cjs/sqh-referral-code.cjs.entry.js +22 -22
  6. package/dist/cjs/sqh-rewards-actions.cjs.entry.js +26 -26
  7. package/dist/collection/components/close-button/close-button.js +67 -67
  8. package/dist/collection/components/copy-button/copy-button.js +386 -386
  9. package/dist/collection/components/copy-link-button/copy-link-button.js +230 -230
  10. package/dist/collection/components/global-container/global-container.js +169 -169
  11. package/dist/collection/components/image-component/image-component.js +174 -174
  12. package/dist/collection/components/partner-stat-component/partner-stat-component.js +185 -185
  13. package/dist/collection/components/referral-code/referral-code.js +33 -33
  14. package/dist/collection/components/referral-component/referral-component.js +254 -254
  15. package/dist/collection/components/referral-list/referral-list.js +929 -932
  16. package/dist/collection/components/rewards-actions/rewards-actions.js +104 -104
  17. package/dist/collection/components/share-button/share-button.js +309 -309
  18. package/dist/collection/components/share-button-container/share-button-container.js +2467 -2467
  19. package/dist/collection/components/stat-component/stat-component.js +185 -185
  20. package/dist/collection/components/stats-container/stats-container.js +204 -204
  21. package/dist/collection/components/text-component/text-component.js +276 -276
  22. package/dist/collection/entrypoint.js +32 -32
  23. package/dist/collection/global/global.js +4 -4
  24. package/dist/collection/services/FormatJs.js +15 -15
  25. package/dist/collection/services/WidgetHost.js +621 -621
  26. package/dist/collection/utilities.js +81 -81
  27. package/dist/esm/{WidgetHost-a27e693d.js → WidgetHost-9c337319.js} +615 -615
  28. package/dist/esm/polyfills/core-js.js +0 -0
  29. package/dist/esm/polyfills/dom.js +0 -0
  30. package/dist/esm/polyfills/es5-html-element.js +0 -0
  31. package/dist/esm/polyfills/index.js +0 -0
  32. package/dist/esm/polyfills/system.js +0 -0
  33. package/dist/esm/sqh-close-button.entry.js +25 -25
  34. package/dist/esm/sqh-copy-button_12.entry.js +1050 -1151
  35. package/dist/esm/sqh-referral-code.entry.js +22 -22
  36. package/dist/esm/sqh-rewards-actions.entry.js +26 -26
  37. package/dist/esm-es5/{WidgetHost-a27e693d.js → WidgetHost-9c337319.js} +9432 -9432
  38. package/dist/esm-es5/_commonjsHelpers-1d681858.js +17 -17
  39. package/dist/esm-es5/css-shim-a659079f.js +122 -122
  40. package/dist/esm-es5/dom-4061ceba.js +468 -468
  41. package/dist/esm-es5/en-be593af0.js +1471 -1471
  42. package/dist/esm-es5/index-8ea8b6d8.js +1758 -1758
  43. package/dist/esm-es5/loader.mjs +11 -11
  44. package/dist/esm-es5/sqh-close-button.entry.js +35 -35
  45. package/dist/esm-es5/sqh-copy-button_12.entry.js +9571 -9660
  46. package/dist/esm-es5/sqh-referral-code.entry.js +29 -29
  47. package/dist/esm-es5/sqh-rewards-actions.entry.js +31 -31
  48. package/dist/esm-es5/widget-components.mjs +6 -6
  49. package/dist/types/components/close-button/close-button.d.ts +15 -15
  50. package/dist/types/components/copy-button/copy-button.d.ts +104 -104
  51. package/dist/types/components/copy-link-button/copy-link-button.d.ts +59 -59
  52. package/dist/types/components/global-container/global-container.d.ts +46 -46
  53. package/dist/types/components/image-component/image-component.d.ts +50 -50
  54. package/dist/types/components/partner-stat-component/partner-stat-component.d.ts +48 -48
  55. package/dist/types/components/referral-code/referral-code.d.ts +9 -9
  56. package/dist/types/components/referral-component/referral-component.d.ts +45 -45
  57. package/dist/types/components/referral-list/referral-list.d.ts +248 -249
  58. package/dist/types/components/rewards-actions/rewards-actions.d.ts +24 -24
  59. package/dist/types/components/share-button/share-button.d.ts +81 -81
  60. package/dist/types/components/share-button-container/share-button-container.d.ts +681 -681
  61. package/dist/types/components/stat-component/stat-component.d.ts +47 -47
  62. package/dist/types/components/stats-container/stats-container.d.ts +44 -44
  63. package/dist/types/components/text-component/text-component.d.ts +77 -77
  64. package/dist/types/components.d.ts +0 -2
  65. package/dist/types/global/global.d.ts +4 -4
  66. package/dist/types/saasquatch.d.ts +103 -103
  67. package/dist/types/services/FormatJs.d.ts +7 -7
  68. package/dist/types/services/WidgetHost.d.ts +45 -45
  69. package/dist/types/utilities.d.ts +7 -7
  70. package/dist/widget-components/entrypoint.js +32 -32
  71. package/dist/widget-components/p-24fc4ba9.js +1 -1
  72. package/dist/widget-components/{p-d4b27c72.entry.js → p-366f1663.entry.js} +1 -1
  73. package/dist/widget-components/p-46109683.js +3 -3
  74. package/dist/widget-components/{p-650d012d.entry.js → p-54ea7a00.entry.js} +1 -1
  75. package/dist/widget-components/p-58be1132.system.js +1 -1
  76. package/dist/widget-components/{p-9adc7c50.system.js → p-8e232564.system.js} +0 -0
  77. package/dist/widget-components/{p-c0cdba77.system.entry.js → p-b17efca4.system.entry.js} +1 -1
  78. package/dist/widget-components/p-c8bc8c77.system.entry.js +1 -0
  79. package/dist/widget-components/{p-d7059393.entry.js → p-d416634a.entry.js} +16 -16
  80. package/dist/widget-components/p-d97c955d.system.entry.js +8 -0
  81. package/dist/widget-components/{p-9525bf4a.js → p-edd43dbc.js} +0 -0
  82. package/dist/widget-components/widget-components.esm.js +1 -1
  83. package/dist/widget-components/widget-components.js +1 -1
  84. package/docs/raisins.json +1 -1
  85. package/package.json +96 -96
  86. package/readme.md +52 -52
  87. package/dist/widget-components/p-908068c2.system.entry.js +0 -1
  88. package/dist/widget-components/p-fba5ea7f.system.entry.js +0 -8
@@ -1,932 +1,929 @@
1
- import { h, Component, Prop, State } from "@stencil/core";
2
- import { css } from "emotion";
3
- import { uuid } from "../../utilities";
4
- import { API } from "../../services/WidgetHost";
5
- /**
6
- * @uiName Referral List
7
- */
8
- export class ReferralList {
9
- constructor() {
10
- this.offset = 0;
11
- this.loading = true;
12
- }
13
- componentWillLoad() {
14
- if (!this.ishidden) {
15
- return this.getReferrals(this.showreferrer)
16
- .then((res) => {
17
- this.referrals = res.referrals.data;
18
- this.referredBy = res.referredByReferral;
19
- this.referralsCount = res.referrals.totalCount;
20
- this.loading = false;
21
- this.locale = res.locale;
22
- })
23
- .catch((e) => {
24
- this.onError(e);
25
- });
26
- }
27
- }
28
- getReferrals(showReferrer, offset = 0) {
29
- return API.graphql.getReferrals(showReferrer, offset);
30
- }
31
- paginate(offset, event) {
32
- if (this.loading)
33
- return null;
34
- let { referralsCount } = this;
35
- if (this.showreferrer && this.referredBy)
36
- referralsCount++;
37
- if (offset >= referralsCount || offset < 0)
38
- return null;
39
- this.loading = true;
40
- const { target } = event;
41
- target.innerText = "...";
42
- this.getReferrals(this.showreferrer, offset).then((res) => {
43
- target.innerText =
44
- offset > this.offset ? this.paginatemore : this.paginateless;
45
- this.referrals = res.referrals.data;
46
- this.offset = offset;
47
- this.loading = false;
48
- });
49
- }
50
- onError(e) {
51
- console.error(e);
52
- this.loading = false;
53
- }
54
- render() {
55
- let referredByRow;
56
- let referralsRow;
57
- const referralvariables = {
58
- usefirstreward: this.usefirstreward,
59
- referrercontent: this.referrercontent,
60
- convertedcontent: this.convertedcontent,
61
- pendingcontent: this.pendingcontent,
62
- pendingvalue: this.pendingvalue,
63
- referrervalue: this.referrervalue,
64
- valuecontent: this.valuecontent,
65
- expiredcontent: this.expiredcontent,
66
- expiredvalue: this.expiredvalue,
67
- expiresvalue: this.expiresvalue,
68
- redeemedvalue: this.redeemedvalue,
69
- showexpiry: this.showexpiry,
70
- shownotes: this.shownotes,
71
- cancelledvalue: this.cancelledvalue,
72
- cancelledcontent: this.cancelledcontent,
73
- };
74
- if (this.referrals) {
75
- referralsRow = this.referrals.map((ref) => {
76
- const referraltype = ref.rewards.length > 0 || ref.dateConverted ? "converted" : "pending";
77
- return (h("sqh-referral-component", { id: uuid(), referral: ref, referralvariables: referralvariables, referraltype: referraltype, unknownuser: this.unknownuser, locale: this.internationalization ? this.locale : "en-US" }));
78
- });
79
- }
80
- if (this.referrals.length < 3 && this.referredBy && this.showreferrer) {
81
- referredByRow = (h("sqh-referral-component", { id: uuid(), referral: this.referredBy, referralvariables: referralvariables, referraltype: "referrer", unknownuser: this.unknownuser, locale: this.internationalization ? this.locale : "en-US" }));
82
- }
83
- const clz = css `
84
- .squatch-referrals-icon.icon-ok-circled {
85
- color: ${this.rewardcolor};
86
- }
87
- .squatch-referrals-icon.icon-attention {
88
- color: ${this.pendingcolor};
89
- }
90
- .squatch-referrals-value {
91
- color: ${this.rewardcolor};
92
- }
93
- .squatch-referrals-value.pending {
94
- color: ${this.pendingcolor};
95
- }
96
- .squatch-referrals-value.referrer {
97
- color: ${this.rewardcolor};
98
- }
99
- .squatch-referrals-value.expired {
100
- color: ${this.expiredcolor};
101
- }
102
- .squatch-value-contents.expired {
103
- color: ${this.expiredcolor};
104
- }
105
- .squatch-referrals-icon.icon-attention.expired {
106
- color: ${this.expiredcolor};
107
- }
108
- .squatch-referrals-value.cancelled {
109
- color: ${this.cancelledcolor};
110
- }
111
- .squatch-value-contents.cancelled {
112
- color: ${this.cancelledcolor};
113
- }
114
- .squatch-referrals-icon.icon-attention.cancelled {
115
- color: ${this.cancelledcolor};
116
- }
117
- .squatch-referrals-heading {
118
- color: ${this.referralnamecolor};
119
- }
120
- .squatch-referrals-description,
121
- .squatch-referrals-value-content {
122
- color: ${this.referraltextcolor};
123
- }
124
- .squatch-customer-note {
125
- color: ${this.customernotecolor || "darkslategray"};
126
- }
127
- .squatch-referrals-scroll-action {
128
- font-family: ${"inherit"};
129
- }
130
- `;
131
- const totalReferralsCount = this.showreferrer && this.referredBy
132
- ? this.referralsCount + 1
133
- : this.referralsCount;
134
- return !this.ishidden && totalReferralsCount > 0 ? (
135
- // Referral List when not hidden and 1 or more referrals
136
- h("div", { class: `squatch-referrals ${clz}` },
137
- h("div", { class: "squatch-referrals-scroll-container" },
138
- referralsRow,
139
- referredByRow),
140
- h("div", { class: "squatch-referrals-scroll-action-container" },
141
- h("button", { class: `
142
- squatch-referrals-scroll-action previous ${this.loading
143
- ? "disabled"
144
- : this.offset === 0
145
- ? "disabled"
146
- : ""}
147
- `, onClick: (event) => this.paginate(this.offset - 3, event) }, this.paginateless),
148
- h("button", { class: `
149
- squatch-referrals-scroll-action view-more ${this.loading
150
- ? "disabled"
151
- : this.showreferrer && this.referredBy
152
- ? this.offset >= this.referralsCount - 2
153
- ? "disabled"
154
- : ""
155
- : this.offset >= this.referralsCount - 3
156
- ? "disabled"
157
- : ""}
158
- `, "view-more": true, onClick: (event) => this.paginate(this.offset + 3, event) }, this.paginatemore)))) : (
159
- // 'No Referrals Yet' button if this.referralCount < 1
160
- h("div", { class: "squatch-referrals-scroll-action-container" },
161
- h("button", { disabled: true, class: "squatch-no-referrals-yet" }, this.noreferralsyet)));
162
- }
163
- static get is() { return "sqh-referral-list"; }
164
- static get originalStyleUrls() { return {
165
- "$": ["referral-list.scss"]
166
- }; }
167
- static get styleUrls() { return {
168
- "$": ["referral-list.css"]
169
- }; }
170
- static get properties() { return {
171
- "ishidden": {
172
- "type": "boolean",
173
- "mutable": false,
174
- "complexType": {
175
- "original": "boolean",
176
- "resolved": "boolean",
177
- "references": {}
178
- },
179
- "required": false,
180
- "optional": false,
181
- "docs": {
182
- "tags": [{
183
- "text": "Hide Referral List",
184
- "name": "uiName"
185
- }],
186
- "text": "Hide or show the component"
187
- },
188
- "attribute": "ishidden",
189
- "reflect": false
190
- },
191
- "paginatemore": {
192
- "type": "string",
193
- "mutable": false,
194
- "complexType": {
195
- "original": "string",
196
- "resolved": "string",
197
- "references": {}
198
- },
199
- "required": false,
200
- "optional": false,
201
- "docs": {
202
- "tags": [{
203
- "text": "Paginate More Text",
204
- "name": "uiName"
205
- }, {
206
- "text": "\"View More\"",
207
- "name": "default"
208
- }],
209
- "text": "Shown inside the paginate more button"
210
- },
211
- "attribute": "paginatemore",
212
- "reflect": false
213
- },
214
- "paginateless": {
215
- "type": "string",
216
- "mutable": false,
217
- "complexType": {
218
- "original": "string",
219
- "resolved": "string",
220
- "references": {}
221
- },
222
- "required": false,
223
- "optional": false,
224
- "docs": {
225
- "tags": [{
226
- "text": "Paginate Less Text",
227
- "name": "uiName"
228
- }, {
229
- "text": "\"Previous\"",
230
- "name": "default"
231
- }],
232
- "text": "Shown inside the paginate less button"
233
- },
234
- "attribute": "paginateless",
235
- "reflect": false
236
- },
237
- "noreferralsyet": {
238
- "type": "string",
239
- "mutable": false,
240
- "complexType": {
241
- "original": "string",
242
- "resolved": "string",
243
- "references": {}
244
- },
245
- "required": false,
246
- "optional": false,
247
- "docs": {
248
- "tags": [{
249
- "text": "Empty Referrals Text",
250
- "name": "uiName"
251
- }, {
252
- "text": "\"No Referrals Yet...\"",
253
- "name": "default"
254
- }],
255
- "text": "Shown when referral list is empty"
256
- },
257
- "attribute": "noreferralsyet",
258
- "reflect": false
259
- },
260
- "referralnamecolor": {
261
- "type": "string",
262
- "mutable": false,
263
- "complexType": {
264
- "original": "string",
265
- "resolved": "string",
266
- "references": {}
267
- },
268
- "required": false,
269
- "optional": false,
270
- "docs": {
271
- "tags": [{
272
- "text": "Referral Name Color",
273
- "name": "uiName"
274
- }, {
275
- "text": "color",
276
- "name": "uiWidget"
277
- }, {
278
- "text": "color",
279
- "name": "format"
280
- }, {
281
- "text": "\"darkslategray\"",
282
- "name": "default"
283
- }],
284
- "text": "Text color of the referred users name"
285
- },
286
- "attribute": "referralnamecolor",
287
- "reflect": false
288
- },
289
- "referraltextcolor": {
290
- "type": "string",
291
- "mutable": false,
292
- "complexType": {
293
- "original": "string",
294
- "resolved": "string",
295
- "references": {}
296
- },
297
- "required": false,
298
- "optional": false,
299
- "docs": {
300
- "tags": [{
301
- "text": "Referral Text Color",
302
- "name": "uiName"
303
- }, {
304
- "text": "color",
305
- "name": "uiWidget"
306
- }, {
307
- "text": "color",
308
- "name": "format"
309
- }, {
310
- "text": "\"lightgray\"",
311
- "name": "default"
312
- }],
313
- "text": "Text color of the referral status"
314
- },
315
- "attribute": "referraltextcolor",
316
- "reflect": false
317
- },
318
- "unknownuser": {
319
- "type": "string",
320
- "mutable": false,
321
- "complexType": {
322
- "original": "string",
323
- "resolved": "string",
324
- "references": {}
325
- },
326
- "required": false,
327
- "optional": false,
328
- "docs": {
329
- "tags": [{
330
- "text": "Unknown User Text",
331
- "name": "uiName"
332
- }, {
333
- "text": "\"Your Friend\"",
334
- "name": "default"
335
- }],
336
- "text": "Text shown when the referred users name is unknown"
337
- },
338
- "attribute": "unknownuser",
339
- "reflect": false
340
- },
341
- "showexpiry": {
342
- "type": "boolean",
343
- "mutable": false,
344
- "complexType": {
345
- "original": "boolean",
346
- "resolved": "boolean",
347
- "references": {}
348
- },
349
- "required": false,
350
- "optional": false,
351
- "docs": {
352
- "tags": [{
353
- "text": "Show Expiry",
354
- "name": "uiName"
355
- }],
356
- "text": "Show or hide expired rewards"
357
- },
358
- "attribute": "showexpiry",
359
- "reflect": false
360
- },
361
- "shownotes": {
362
- "type": "boolean",
363
- "mutable": false,
364
- "complexType": {
365
- "original": "boolean",
366
- "resolved": "boolean",
367
- "references": {}
368
- },
369
- "required": false,
370
- "optional": false,
371
- "docs": {
372
- "tags": [{
373
- "text": "Show Customer Note",
374
- "name": "uiName"
375
- }],
376
- "text": "Show the customer note for a referral"
377
- },
378
- "attribute": "shownotes",
379
- "reflect": false
380
- },
381
- "redeemedvalue": {
382
- "type": "string",
383
- "mutable": false,
384
- "complexType": {
385
- "original": "string",
386
- "resolved": "string",
387
- "references": {}
388
- },
389
- "required": false,
390
- "optional": false,
391
- "docs": {
392
- "tags": [{
393
- "text": "Redeemed Value",
394
- "name": "uiName"
395
- }, {
396
- "text": "Converted Referrals",
397
- "name": "uiGroup"
398
- }, {
399
- "text": "\"Redeemed\"",
400
- "name": "default"
401
- }],
402
- "text": "Shown when reward is redeemed"
403
- },
404
- "attribute": "redeemedvalue",
405
- "reflect": false
406
- },
407
- "showreferrer": {
408
- "type": "boolean",
409
- "mutable": false,
410
- "complexType": {
411
- "original": "boolean",
412
- "resolved": "boolean",
413
- "references": {}
414
- },
415
- "required": false,
416
- "optional": false,
417
- "docs": {
418
- "tags": [{
419
- "text": "Show Referrer",
420
- "name": "uiName"
421
- }, {
422
- "text": "Referrer",
423
- "name": "uiGroup"
424
- }, {
425
- "text": "\"\"",
426
- "name": "default"
427
- }],
428
- "text": "Show or hide the referrer"
429
- },
430
- "attribute": "showreferrer",
431
- "reflect": false
432
- },
433
- "referrercontent": {
434
- "type": "string",
435
- "mutable": false,
436
- "complexType": {
437
- "original": "string",
438
- "resolved": "string",
439
- "references": {}
440
- },
441
- "required": false,
442
- "optional": false,
443
- "docs": {
444
- "tags": [{
445
- "text": "Referrer Content",
446
- "name": "uiName"
447
- }, {
448
- "text": "Referrer",
449
- "name": "uiGroup"
450
- }, {
451
- "text": "\"Referred you {date}\"",
452
- "name": "default"
453
- }],
454
- "text": "Text explaining who referred you to the program"
455
- },
456
- "attribute": "referrercontent",
457
- "reflect": false
458
- },
459
- "referrervalue": {
460
- "type": "string",
461
- "mutable": false,
462
- "complexType": {
463
- "original": "string",
464
- "resolved": "string",
465
- "references": {}
466
- },
467
- "required": false,
468
- "optional": false,
469
- "docs": {
470
- "tags": [{
471
- "text": "Referrer Value",
472
- "name": "uiName"
473
- }, {
474
- "text": "Referrer",
475
- "name": "uiGroup"
476
- }, {
477
- "text": "\"Referred\"",
478
- "name": "default"
479
- }],
480
- "text": "Referred Text shown in reward column"
481
- },
482
- "attribute": "referrervalue",
483
- "reflect": false
484
- },
485
- "rewardcolor": {
486
- "type": "string",
487
- "mutable": false,
488
- "complexType": {
489
- "original": "string",
490
- "resolved": "string",
491
- "references": {}
492
- },
493
- "required": false,
494
- "optional": false,
495
- "docs": {
496
- "tags": [{
497
- "text": "Reward Color",
498
- "name": "uiName"
499
- }, {
500
- "text": "Converted Referrals",
501
- "name": "uiGroup"
502
- }, {
503
- "text": "color",
504
- "name": "uiWidget"
505
- }, {
506
- "text": "color",
507
- "name": "format"
508
- }, {
509
- "text": "\"#4BB543\"",
510
- "name": "default"
511
- }],
512
- "text": "Color of the successful reward icon and the text value"
513
- },
514
- "attribute": "rewardcolor",
515
- "reflect": false
516
- },
517
- "customernotecolor": {
518
- "type": "string",
519
- "mutable": false,
520
- "complexType": {
521
- "original": "string",
522
- "resolved": "string",
523
- "references": {}
524
- },
525
- "required": false,
526
- "optional": false,
527
- "docs": {
528
- "tags": [{
529
- "text": "Reward Color",
530
- "name": "uiName"
531
- }, {
532
- "text": "Converted Referrals",
533
- "name": "uiGroup"
534
- }, {
535
- "text": "color",
536
- "name": "uiWidget"
537
- }, {
538
- "text": "color",
539
- "name": "format"
540
- }],
541
- "text": "Color of the customer note"
542
- },
543
- "attribute": "customernotecolor",
544
- "reflect": false
545
- },
546
- "usefirstreward": {
547
- "type": "boolean",
548
- "mutable": false,
549
- "complexType": {
550
- "original": "boolean",
551
- "resolved": "boolean",
552
- "references": {}
553
- },
554
- "required": false,
555
- "optional": false,
556
- "docs": {
557
- "tags": [{
558
- "text": "Use First Reward",
559
- "name": "uiName"
560
- }, {
561
- "text": "Converted Referrals",
562
- "name": "uiGroup"
563
- }],
564
- "text": "Show value of the first earned reward inside the rewards column"
565
- },
566
- "attribute": "usefirstreward",
567
- "reflect": false
568
- },
569
- "convertedcontent": {
570
- "type": "string",
571
- "mutable": false,
572
- "complexType": {
573
- "original": "string",
574
- "resolved": "string",
575
- "references": {}
576
- },
577
- "required": false,
578
- "optional": false,
579
- "docs": {
580
- "tags": [{
581
- "text": "Converted Content",
582
- "name": "uiName"
583
- }, {
584
- "text": "Converted Referrals",
585
- "name": "uiGroup"
586
- }, {
587
- "text": "\"Signed up, referred {date}\"",
588
- "name": "default"
589
- }],
590
- "text": "Content shown when a referral is converted"
591
- },
592
- "attribute": "convertedcontent",
593
- "reflect": false
594
- },
595
- "valuecontent": {
596
- "type": "string",
597
- "mutable": false,
598
- "complexType": {
599
- "original": "string",
600
- "resolved": "string",
601
- "references": {}
602
- },
603
- "required": false,
604
- "optional": false,
605
- "docs": {
606
- "tags": [{
607
- "text": "Value Content",
608
- "name": "uiName"
609
- }, {
610
- "text": "Converted Referrals",
611
- "name": "uiGroup"
612
- }, {
613
- "text": "textArea",
614
- "name": "uiWidget"
615
- }, {
616
- "text": "\"and {extrarewards} more {extrarewards, plural, one {reward} other {rewards}}\"",
617
- "name": "default"
618
- }],
619
- "text": "Value shown in the rewards column"
620
- },
621
- "attribute": "valuecontent",
622
- "reflect": false
623
- },
624
- "pendingcolor": {
625
- "type": "string",
626
- "mutable": false,
627
- "complexType": {
628
- "original": "string",
629
- "resolved": "string",
630
- "references": {}
631
- },
632
- "required": false,
633
- "optional": false,
634
- "docs": {
635
- "tags": [{
636
- "text": "Pending Color",
637
- "name": "uiName"
638
- }, {
639
- "text": "Pending Referrals",
640
- "name": "uiGroup"
641
- }, {
642
- "text": "color",
643
- "name": "uiWidget"
644
- }, {
645
- "text": "color",
646
- "name": "format"
647
- }, {
648
- "text": "\"lightgray\"",
649
- "name": "default"
650
- }],
651
- "text": "Color of the pending icon and text"
652
- },
653
- "attribute": "pendingcolor",
654
- "reflect": false
655
- },
656
- "pendingcontent": {
657
- "type": "string",
658
- "mutable": false,
659
- "complexType": {
660
- "original": "string",
661
- "resolved": "string",
662
- "references": {}
663
- },
664
- "required": false,
665
- "optional": false,
666
- "docs": {
667
- "tags": [{
668
- "text": "Pending Content",
669
- "name": "uiName"
670
- }, {
671
- "text": "Pending Referrals",
672
- "name": "uiGroup"
673
- }, {
674
- "text": "\"Trial user, referred {date}\"",
675
- "name": "default"
676
- }],
677
- "text": "Pending content shown in the user column"
678
- },
679
- "attribute": "pendingcontent",
680
- "reflect": false
681
- },
682
- "pendingvalue": {
683
- "type": "string",
684
- "mutable": false,
685
- "complexType": {
686
- "original": "string",
687
- "resolved": "string",
688
- "references": {}
689
- },
690
- "required": false,
691
- "optional": false,
692
- "docs": {
693
- "tags": [{
694
- "text": "Pending Value",
695
- "name": "uiName"
696
- }, {
697
- "text": "Pending Referrals",
698
- "name": "uiGroup"
699
- }, {
700
- "text": "\"Referral pending\"",
701
- "name": "default"
702
- }],
703
- "text": "Pending content shown alongside the icon in the referral column"
704
- },
705
- "attribute": "pendingvalue",
706
- "reflect": false
707
- },
708
- "expiredcolor": {
709
- "type": "string",
710
- "mutable": false,
711
- "complexType": {
712
- "original": "string",
713
- "resolved": "string",
714
- "references": {}
715
- },
716
- "required": false,
717
- "optional": false,
718
- "docs": {
719
- "tags": [{
720
- "text": "Expired Color",
721
- "name": "uiName"
722
- }, {
723
- "text": "Expired Rewards",
724
- "name": "uiGroup"
725
- }, {
726
- "text": "color",
727
- "name": "uiWidget"
728
- }, {
729
- "text": "color",
730
- "name": "format"
731
- }, {
732
- "text": "\"lightgray\"",
733
- "name": "default"
734
- }],
735
- "text": "Color of the expired icon and text"
736
- },
737
- "attribute": "expiredcolor",
738
- "reflect": false
739
- },
740
- "expiredcontent": {
741
- "type": "string",
742
- "mutable": false,
743
- "complexType": {
744
- "original": "string",
745
- "resolved": "string",
746
- "references": {}
747
- },
748
- "required": false,
749
- "optional": false,
750
- "docs": {
751
- "tags": [{
752
- "text": "Expired Content",
753
- "name": "uiName"
754
- }, {
755
- "text": "Expired Rewards",
756
- "name": "uiGroup"
757
- }, {
758
- "text": "\"Signed up, referred {date}\"",
759
- "name": "default"
760
- }],
761
- "text": "Expired content shown in the user column"
762
- },
763
- "attribute": "expiredcontent",
764
- "reflect": false
765
- },
766
- "expiredvalue": {
767
- "type": "string",
768
- "mutable": false,
769
- "complexType": {
770
- "original": "string",
771
- "resolved": "string",
772
- "references": {}
773
- },
774
- "required": false,
775
- "optional": false,
776
- "docs": {
777
- "tags": [{
778
- "text": "Expired Value",
779
- "name": "uiName"
780
- }, {
781
- "text": "Expired Rewards",
782
- "name": "uiGroup"
783
- }, {
784
- "text": "\"Expired Reward\"",
785
- "name": "default"
786
- }],
787
- "text": "Expired content shown alongside the icon in the referral column"
788
- },
789
- "attribute": "expiredvalue",
790
- "reflect": false
791
- },
792
- "expiresvalue": {
793
- "type": "string",
794
- "mutable": false,
795
- "complexType": {
796
- "original": "string",
797
- "resolved": "string",
798
- "references": {}
799
- },
800
- "required": false,
801
- "optional": false,
802
- "docs": {
803
- "tags": [{
804
- "text": "Expires Value",
805
- "name": "uiName"
806
- }, {
807
- "text": "Expired Rewards",
808
- "name": "uiGroup"
809
- }],
810
- "text": "Reward expiry ICU message"
811
- },
812
- "attribute": "expiresvalue",
813
- "reflect": false
814
- },
815
- "cancelledcolor": {
816
- "type": "string",
817
- "mutable": false,
818
- "complexType": {
819
- "original": "string",
820
- "resolved": "string",
821
- "references": {}
822
- },
823
- "required": false,
824
- "optional": false,
825
- "docs": {
826
- "tags": [{
827
- "text": "Cancelled Color",
828
- "name": "uiName"
829
- }, {
830
- "text": "Cancelled Rewards",
831
- "name": "uiGroup"
832
- }, {
833
- "text": "color",
834
- "name": "uiWidget"
835
- }, {
836
- "text": "color",
837
- "name": "format"
838
- }, {
839
- "text": "\"#C81D05\"",
840
- "name": "default"
841
- }],
842
- "text": "Color of the cancelled icon and text"
843
- },
844
- "attribute": "cancelledcolor",
845
- "reflect": false
846
- },
847
- "cancelledcontent": {
848
- "type": "string",
849
- "mutable": false,
850
- "complexType": {
851
- "original": "string",
852
- "resolved": "string",
853
- "references": {}
854
- },
855
- "required": false,
856
- "optional": false,
857
- "docs": {
858
- "tags": [{
859
- "text": "Cancelled Content",
860
- "name": "uiName"
861
- }, {
862
- "text": "Cancelled Rewards",
863
- "name": "uiGroup"
864
- }, {
865
- "text": "\"Signed up, referred {date}\"",
866
- "name": "default"
867
- }],
868
- "text": "Cancelled text content shown in the user column"
869
- },
870
- "attribute": "cancelledcontent",
871
- "reflect": false
872
- },
873
- "cancelledvalue": {
874
- "type": "string",
875
- "mutable": false,
876
- "complexType": {
877
- "original": "string",
878
- "resolved": "string",
879
- "references": {}
880
- },
881
- "required": false,
882
- "optional": false,
883
- "docs": {
884
- "tags": [{
885
- "text": "Cancelled Value",
886
- "name": "uiName"
887
- }, {
888
- "text": "Cancelled Rewards",
889
- "name": "uiGroup"
890
- }, {
891
- "text": "\"Cancelled Reward\"",
892
- "name": "default"
893
- }],
894
- "text": "Cancelled text content shown alongside the icon in the referral column"
895
- },
896
- "attribute": "cancelledvalue",
897
- "reflect": false
898
- },
899
- "internationalization": {
900
- "type": "boolean",
901
- "mutable": false,
902
- "complexType": {
903
- "original": "boolean",
904
- "resolved": "boolean",
905
- "references": {}
906
- },
907
- "required": false,
908
- "optional": false,
909
- "docs": {
910
- "tags": [{
911
- "text": "Internationalization",
912
- "name": "uiName"
913
- }, {
914
- "text": "internationalizationProps",
915
- "name": "uiGroup"
916
- }],
917
- "text": "When true, the local gets set by using the value passed to the referral component"
918
- },
919
- "attribute": "internationalization",
920
- "reflect": false
921
- }
922
- }; }
923
- static get states() { return {
924
- "referrals": {},
925
- "referralsCount": {},
926
- "referredBy": {},
927
- "rewards": {},
928
- "loading": {},
929
- "offset": {},
930
- "locale": {}
931
- }; }
932
- }
1
+ import { h, Component, Prop, State } from "@stencil/core";
2
+ import { css } from "emotion";
3
+ import { uuid } from "../../utilities";
4
+ import { API } from "../../services/WidgetHost";
5
+ /**
6
+ * @uiName Referral List
7
+ */
8
+ export class ReferralList {
9
+ constructor() {
10
+ this.offset = 0;
11
+ this.loading = true;
12
+ }
13
+ componentWillLoad() {
14
+ if (!this.ishidden) {
15
+ return this.getReferrals(this.showreferrer)
16
+ .then((res) => {
17
+ this.referrals = res.referrals.data;
18
+ this.referredBy = res.referredByReferral;
19
+ this.referralsCount = res.referrals.totalCount;
20
+ this.loading = false;
21
+ this.locale = res.locale;
22
+ })
23
+ .catch((e) => {
24
+ this.onError(e);
25
+ });
26
+ }
27
+ }
28
+ getReferrals(showReferrer, offset = 0) {
29
+ return API.graphql.getReferrals(showReferrer, offset);
30
+ }
31
+ paginate(offset, event) {
32
+ if (this.loading)
33
+ return null;
34
+ let { referralsCount } = this;
35
+ if (this.showreferrer && this.referredBy)
36
+ referralsCount++;
37
+ if (offset >= referralsCount || offset < 0)
38
+ return null;
39
+ this.loading = true;
40
+ const { target } = event;
41
+ target.innerText = "...";
42
+ this.getReferrals(this.showreferrer, offset).then((res) => {
43
+ target.innerText =
44
+ offset > this.offset ? this.paginatemore : this.paginateless;
45
+ this.referrals = res.referrals.data;
46
+ this.offset = offset;
47
+ this.loading = false;
48
+ });
49
+ }
50
+ onError(e) {
51
+ console.error(e);
52
+ this.loading = false;
53
+ }
54
+ render() {
55
+ let referredByRow;
56
+ let referralsRow;
57
+ const referralvariables = {
58
+ usefirstreward: this.usefirstreward,
59
+ referrercontent: this.referrercontent,
60
+ convertedcontent: this.convertedcontent,
61
+ pendingcontent: this.pendingcontent,
62
+ pendingvalue: this.pendingvalue,
63
+ referrervalue: this.referrervalue,
64
+ valuecontent: this.valuecontent,
65
+ expiredcontent: this.expiredcontent,
66
+ expiredvalue: this.expiredvalue,
67
+ expiresvalue: this.expiresvalue,
68
+ redeemedvalue: this.redeemedvalue,
69
+ showexpiry: this.showexpiry,
70
+ shownotes: this.shownotes,
71
+ cancelledvalue: this.cancelledvalue,
72
+ cancelledcontent: this.cancelledcontent,
73
+ };
74
+ if (this.referrals) {
75
+ referralsRow = this.referrals.map((ref) => {
76
+ const referraltype = ref.rewards.length > 0 || ref.dateConverted ? "converted" : "pending";
77
+ return (h("sqh-referral-component", { id: uuid(), referral: ref, referralvariables: referralvariables, referraltype: referraltype, unknownuser: this.unknownuser, locale: this.internationalization ? this.locale : "en-US" }));
78
+ });
79
+ }
80
+ if (this.referrals.length < 3 && this.referredBy && this.showreferrer) {
81
+ referredByRow = (h("sqh-referral-component", { id: uuid(), referral: this.referredBy, referralvariables: referralvariables, referraltype: "referrer", unknownuser: this.unknownuser, locale: this.internationalization ? this.locale : "en-US" }));
82
+ }
83
+ const clz = css `
84
+ .squatch-referrals-icon.icon-ok-circled {
85
+ color: ${this.rewardcolor};
86
+ }
87
+ .squatch-referrals-icon.icon-attention {
88
+ color: ${this.pendingcolor};
89
+ }
90
+ .squatch-referrals-value {
91
+ color: ${this.rewardcolor};
92
+ }
93
+ .squatch-referrals-value.pending {
94
+ color: ${this.pendingcolor};
95
+ }
96
+ .squatch-referrals-value.referrer {
97
+ color: ${this.rewardcolor};
98
+ }
99
+ .squatch-referrals-value.expired {
100
+ color: ${this.expiredcolor};
101
+ }
102
+ .squatch-value-contents.expired {
103
+ color: ${this.expiredcolor};
104
+ }
105
+ .squatch-referrals-icon.icon-attention.expired {
106
+ color: ${this.expiredcolor};
107
+ }
108
+ .squatch-referrals-value.cancelled {
109
+ color: ${this.cancelledcolor};
110
+ }
111
+ .squatch-value-contents.cancelled {
112
+ color: ${this.cancelledcolor};
113
+ }
114
+ .squatch-referrals-icon.icon-attention.cancelled {
115
+ color: ${this.cancelledcolor};
116
+ }
117
+ .squatch-referrals-heading {
118
+ color: ${this.referralnamecolor};
119
+ }
120
+ .squatch-referrals-description,
121
+ .squatch-referrals-value-content {
122
+ color: ${this.referraltextcolor};
123
+ }
124
+ .squatch-customer-note {
125
+ color: ${this.customernotecolor || "darkslategray"};
126
+ }
127
+ .squatch-referrals-scroll-action {
128
+ font-family: ${"inherit"};
129
+ }
130
+ `;
131
+ const totalReferralsCount = this.showreferrer && this.referredBy
132
+ ? this.referralsCount + 1
133
+ : this.referralsCount;
134
+ return !this.ishidden && totalReferralsCount > 0 ? (
135
+ // Referral List when not hidden and 1 or more referrals
136
+ h("div", { class: `squatch-referrals ${clz}` },
137
+ h("div", { class: "squatch-referrals-scroll-container" },
138
+ referralsRow,
139
+ referredByRow),
140
+ h("div", { class: "squatch-referrals-scroll-action-container" },
141
+ h("button", { class: `
142
+ squatch-referrals-scroll-action previous ${this.loading
143
+ ? "disabled"
144
+ : this.offset === 0
145
+ ? "disabled"
146
+ : ""}
147
+ `, onClick: (event) => this.paginate(this.offset - 3, event) }, this.paginateless),
148
+ h("button", { class: `
149
+ squatch-referrals-scroll-action view-more ${this.loading
150
+ ? "disabled"
151
+ : this.showreferrer && this.referredBy
152
+ ? this.offset >= this.referralsCount - 2
153
+ ? "disabled"
154
+ : ""
155
+ : this.offset >= this.referralsCount - 3
156
+ ? "disabled"
157
+ : ""}
158
+ `, "view-more": true, onClick: (event) => this.paginate(this.offset + 3, event) }, this.paginatemore)))) : (
159
+ // 'No Referrals Yet' button if this.referralCount < 1
160
+ h("div", { class: "squatch-referrals-scroll-action-container" },
161
+ h("button", { disabled: true, class: "squatch-no-referrals-yet" }, this.noreferralsyet)));
162
+ }
163
+ static get is() { return "sqh-referral-list"; }
164
+ static get originalStyleUrls() { return {
165
+ "$": ["referral-list.scss"]
166
+ }; }
167
+ static get styleUrls() { return {
168
+ "$": ["referral-list.css"]
169
+ }; }
170
+ static get properties() { return {
171
+ "ishidden": {
172
+ "type": "boolean",
173
+ "mutable": false,
174
+ "complexType": {
175
+ "original": "boolean",
176
+ "resolved": "boolean",
177
+ "references": {}
178
+ },
179
+ "required": false,
180
+ "optional": false,
181
+ "docs": {
182
+ "tags": [{
183
+ "text": "Hide Referral List",
184
+ "name": "uiName"
185
+ }],
186
+ "text": "Hide or show the component"
187
+ },
188
+ "attribute": "ishidden",
189
+ "reflect": false
190
+ },
191
+ "paginatemore": {
192
+ "type": "string",
193
+ "mutable": false,
194
+ "complexType": {
195
+ "original": "string",
196
+ "resolved": "string",
197
+ "references": {}
198
+ },
199
+ "required": false,
200
+ "optional": false,
201
+ "docs": {
202
+ "tags": [{
203
+ "text": "Paginate More Text",
204
+ "name": "uiName"
205
+ }, {
206
+ "text": "\"View More\"",
207
+ "name": "default"
208
+ }],
209
+ "text": "Shown inside the paginate more button"
210
+ },
211
+ "attribute": "paginatemore",
212
+ "reflect": false
213
+ },
214
+ "paginateless": {
215
+ "type": "string",
216
+ "mutable": false,
217
+ "complexType": {
218
+ "original": "string",
219
+ "resolved": "string",
220
+ "references": {}
221
+ },
222
+ "required": false,
223
+ "optional": false,
224
+ "docs": {
225
+ "tags": [{
226
+ "text": "Paginate Less Text",
227
+ "name": "uiName"
228
+ }, {
229
+ "text": "\"Previous\"",
230
+ "name": "default"
231
+ }],
232
+ "text": "Shown inside the paginate less button"
233
+ },
234
+ "attribute": "paginateless",
235
+ "reflect": false
236
+ },
237
+ "noreferralsyet": {
238
+ "type": "string",
239
+ "mutable": false,
240
+ "complexType": {
241
+ "original": "string",
242
+ "resolved": "string",
243
+ "references": {}
244
+ },
245
+ "required": false,
246
+ "optional": false,
247
+ "docs": {
248
+ "tags": [{
249
+ "text": "Empty Referrals Text",
250
+ "name": "uiName"
251
+ }, {
252
+ "text": "\"No Referrals Yet...\"",
253
+ "name": "default"
254
+ }],
255
+ "text": "Shown when referral list is empty"
256
+ },
257
+ "attribute": "noreferralsyet",
258
+ "reflect": false
259
+ },
260
+ "referralnamecolor": {
261
+ "type": "string",
262
+ "mutable": false,
263
+ "complexType": {
264
+ "original": "string",
265
+ "resolved": "string",
266
+ "references": {}
267
+ },
268
+ "required": false,
269
+ "optional": false,
270
+ "docs": {
271
+ "tags": [{
272
+ "text": "Referral Name Color",
273
+ "name": "uiName"
274
+ }, {
275
+ "text": "color",
276
+ "name": "uiWidget"
277
+ }, {
278
+ "text": "color",
279
+ "name": "format"
280
+ }, {
281
+ "text": "\"darkslategray\"",
282
+ "name": "default"
283
+ }],
284
+ "text": "Text color of the referred users name"
285
+ },
286
+ "attribute": "referralnamecolor",
287
+ "reflect": false
288
+ },
289
+ "referraltextcolor": {
290
+ "type": "string",
291
+ "mutable": false,
292
+ "complexType": {
293
+ "original": "string",
294
+ "resolved": "string",
295
+ "references": {}
296
+ },
297
+ "required": false,
298
+ "optional": false,
299
+ "docs": {
300
+ "tags": [{
301
+ "text": "Referral Text Color",
302
+ "name": "uiName"
303
+ }, {
304
+ "text": "color",
305
+ "name": "uiWidget"
306
+ }, {
307
+ "text": "color",
308
+ "name": "format"
309
+ }, {
310
+ "text": "\"lightgray\"",
311
+ "name": "default"
312
+ }],
313
+ "text": "Text color of the referral status"
314
+ },
315
+ "attribute": "referraltextcolor",
316
+ "reflect": false
317
+ },
318
+ "unknownuser": {
319
+ "type": "string",
320
+ "mutable": false,
321
+ "complexType": {
322
+ "original": "string",
323
+ "resolved": "string",
324
+ "references": {}
325
+ },
326
+ "required": false,
327
+ "optional": false,
328
+ "docs": {
329
+ "tags": [{
330
+ "text": "Unknown User Text",
331
+ "name": "uiName"
332
+ }, {
333
+ "text": "\"Your Friend\"",
334
+ "name": "default"
335
+ }],
336
+ "text": "Text shown when the referred users name is unknown"
337
+ },
338
+ "attribute": "unknownuser",
339
+ "reflect": false
340
+ },
341
+ "showexpiry": {
342
+ "type": "boolean",
343
+ "mutable": false,
344
+ "complexType": {
345
+ "original": "boolean",
346
+ "resolved": "boolean",
347
+ "references": {}
348
+ },
349
+ "required": false,
350
+ "optional": false,
351
+ "docs": {
352
+ "tags": [{
353
+ "text": "Show Expiry",
354
+ "name": "uiName"
355
+ }],
356
+ "text": "Show or hide expired rewards"
357
+ },
358
+ "attribute": "showexpiry",
359
+ "reflect": false
360
+ },
361
+ "shownotes": {
362
+ "type": "boolean",
363
+ "mutable": false,
364
+ "complexType": {
365
+ "original": "boolean",
366
+ "resolved": "boolean",
367
+ "references": {}
368
+ },
369
+ "required": false,
370
+ "optional": false,
371
+ "docs": {
372
+ "tags": [{
373
+ "text": "Show Customer Note",
374
+ "name": "uiName"
375
+ }],
376
+ "text": "Show the customer note for a referral"
377
+ },
378
+ "attribute": "shownotes",
379
+ "reflect": false
380
+ },
381
+ "redeemedvalue": {
382
+ "type": "string",
383
+ "mutable": false,
384
+ "complexType": {
385
+ "original": "string",
386
+ "resolved": "string",
387
+ "references": {}
388
+ },
389
+ "required": false,
390
+ "optional": false,
391
+ "docs": {
392
+ "tags": [{
393
+ "text": "Redeemed Value",
394
+ "name": "uiName"
395
+ }, {
396
+ "text": "Converted Referrals",
397
+ "name": "uiGroup"
398
+ }, {
399
+ "text": "\"Redeemed\"",
400
+ "name": "default"
401
+ }],
402
+ "text": "Shown when reward is redeemed"
403
+ },
404
+ "attribute": "redeemedvalue",
405
+ "reflect": false
406
+ },
407
+ "showreferrer": {
408
+ "type": "boolean",
409
+ "mutable": false,
410
+ "complexType": {
411
+ "original": "boolean",
412
+ "resolved": "boolean",
413
+ "references": {}
414
+ },
415
+ "required": false,
416
+ "optional": false,
417
+ "docs": {
418
+ "tags": [{
419
+ "text": "Show Referrer",
420
+ "name": "uiName"
421
+ }, {
422
+ "text": "Referrer",
423
+ "name": "uiGroup"
424
+ }, {
425
+ "text": "\"\"",
426
+ "name": "default"
427
+ }],
428
+ "text": "Show or hide the referrer"
429
+ },
430
+ "attribute": "showreferrer",
431
+ "reflect": false
432
+ },
433
+ "referrercontent": {
434
+ "type": "string",
435
+ "mutable": false,
436
+ "complexType": {
437
+ "original": "string",
438
+ "resolved": "string",
439
+ "references": {}
440
+ },
441
+ "required": false,
442
+ "optional": false,
443
+ "docs": {
444
+ "tags": [{
445
+ "text": "Referrer Content",
446
+ "name": "uiName"
447
+ }, {
448
+ "text": "Referrer",
449
+ "name": "uiGroup"
450
+ }, {
451
+ "text": "\"Referred you {date}\"",
452
+ "name": "default"
453
+ }],
454
+ "text": "Text explaining who referred you to the program"
455
+ },
456
+ "attribute": "referrercontent",
457
+ "reflect": false
458
+ },
459
+ "referrervalue": {
460
+ "type": "string",
461
+ "mutable": false,
462
+ "complexType": {
463
+ "original": "string",
464
+ "resolved": "string",
465
+ "references": {}
466
+ },
467
+ "required": false,
468
+ "optional": false,
469
+ "docs": {
470
+ "tags": [{
471
+ "text": "Referrer Value",
472
+ "name": "uiName"
473
+ }, {
474
+ "text": "Referrer",
475
+ "name": "uiGroup"
476
+ }, {
477
+ "text": "\"Referred\"",
478
+ "name": "default"
479
+ }],
480
+ "text": "Referred Text shown in reward column"
481
+ },
482
+ "attribute": "referrervalue",
483
+ "reflect": false
484
+ },
485
+ "rewardcolor": {
486
+ "type": "string",
487
+ "mutable": false,
488
+ "complexType": {
489
+ "original": "string",
490
+ "resolved": "string",
491
+ "references": {}
492
+ },
493
+ "required": false,
494
+ "optional": false,
495
+ "docs": {
496
+ "tags": [{
497
+ "text": "Reward Color",
498
+ "name": "uiName"
499
+ }, {
500
+ "text": "Converted Referrals",
501
+ "name": "uiGroup"
502
+ }, {
503
+ "text": "color",
504
+ "name": "uiWidget"
505
+ }, {
506
+ "text": "color",
507
+ "name": "format"
508
+ }, {
509
+ "text": "\"#4BB543\"",
510
+ "name": "default"
511
+ }],
512
+ "text": "Color of the successful reward icon and the text value"
513
+ },
514
+ "attribute": "rewardcolor",
515
+ "reflect": false
516
+ },
517
+ "customernotecolor": {
518
+ "type": "string",
519
+ "mutable": false,
520
+ "complexType": {
521
+ "original": "string",
522
+ "resolved": "string",
523
+ "references": {}
524
+ },
525
+ "required": false,
526
+ "optional": false,
527
+ "docs": {
528
+ "tags": [{
529
+ "text": "Reward Color",
530
+ "name": "uiName"
531
+ }, {
532
+ "text": "Converted Referrals",
533
+ "name": "uiGroup"
534
+ }, {
535
+ "text": "color",
536
+ "name": "uiWidget"
537
+ }, {
538
+ "text": "color",
539
+ "name": "format"
540
+ }],
541
+ "text": "Color of the customer note"
542
+ },
543
+ "attribute": "customernotecolor",
544
+ "reflect": false
545
+ },
546
+ "usefirstreward": {
547
+ "type": "boolean",
548
+ "mutable": false,
549
+ "complexType": {
550
+ "original": "boolean",
551
+ "resolved": "boolean",
552
+ "references": {}
553
+ },
554
+ "required": false,
555
+ "optional": false,
556
+ "docs": {
557
+ "tags": [{
558
+ "text": "Use First Reward",
559
+ "name": "uiName"
560
+ }, {
561
+ "text": "Converted Referrals",
562
+ "name": "uiGroup"
563
+ }],
564
+ "text": "Show value of the first earned reward inside the rewards column"
565
+ },
566
+ "attribute": "usefirstreward",
567
+ "reflect": false
568
+ },
569
+ "convertedcontent": {
570
+ "type": "string",
571
+ "mutable": false,
572
+ "complexType": {
573
+ "original": "string",
574
+ "resolved": "string",
575
+ "references": {}
576
+ },
577
+ "required": false,
578
+ "optional": false,
579
+ "docs": {
580
+ "tags": [{
581
+ "text": "Converted Content",
582
+ "name": "uiName"
583
+ }, {
584
+ "text": "Converted Referrals",
585
+ "name": "uiGroup"
586
+ }, {
587
+ "text": "\"Signed up, referred {date}\"",
588
+ "name": "default"
589
+ }],
590
+ "text": "Content shown when a referral is converted"
591
+ },
592
+ "attribute": "convertedcontent",
593
+ "reflect": false
594
+ },
595
+ "valuecontent": {
596
+ "type": "string",
597
+ "mutable": false,
598
+ "complexType": {
599
+ "original": "string",
600
+ "resolved": "string",
601
+ "references": {}
602
+ },
603
+ "required": false,
604
+ "optional": false,
605
+ "docs": {
606
+ "tags": [{
607
+ "text": "Value Content",
608
+ "name": "uiName"
609
+ }, {
610
+ "text": "Converted Referrals",
611
+ "name": "uiGroup"
612
+ }, {
613
+ "text": "textArea",
614
+ "name": "uiWidget"
615
+ }, {
616
+ "text": "\"and {extrarewards} more {extrarewards, plural, one {reward} other {rewards}}\"",
617
+ "name": "default"
618
+ }],
619
+ "text": "Value shown in the rewards column"
620
+ },
621
+ "attribute": "valuecontent",
622
+ "reflect": false
623
+ },
624
+ "pendingcolor": {
625
+ "type": "string",
626
+ "mutable": false,
627
+ "complexType": {
628
+ "original": "string",
629
+ "resolved": "string",
630
+ "references": {}
631
+ },
632
+ "required": false,
633
+ "optional": false,
634
+ "docs": {
635
+ "tags": [{
636
+ "text": "Pending Color",
637
+ "name": "uiName"
638
+ }, {
639
+ "text": "Pending Referrals",
640
+ "name": "uiGroup"
641
+ }, {
642
+ "text": "color",
643
+ "name": "uiWidget"
644
+ }, {
645
+ "text": "color",
646
+ "name": "format"
647
+ }, {
648
+ "text": "\"lightgray\"",
649
+ "name": "default"
650
+ }],
651
+ "text": "Color of the pending icon and text"
652
+ },
653
+ "attribute": "pendingcolor",
654
+ "reflect": false
655
+ },
656
+ "pendingcontent": {
657
+ "type": "string",
658
+ "mutable": false,
659
+ "complexType": {
660
+ "original": "string",
661
+ "resolved": "string",
662
+ "references": {}
663
+ },
664
+ "required": false,
665
+ "optional": false,
666
+ "docs": {
667
+ "tags": [{
668
+ "text": "Pending Content",
669
+ "name": "uiName"
670
+ }, {
671
+ "text": "Pending Referrals",
672
+ "name": "uiGroup"
673
+ }, {
674
+ "text": "\"Trial user, referred {date}\"",
675
+ "name": "default"
676
+ }],
677
+ "text": "Pending content shown in the user column"
678
+ },
679
+ "attribute": "pendingcontent",
680
+ "reflect": false
681
+ },
682
+ "pendingvalue": {
683
+ "type": "string",
684
+ "mutable": false,
685
+ "complexType": {
686
+ "original": "string",
687
+ "resolved": "string",
688
+ "references": {}
689
+ },
690
+ "required": false,
691
+ "optional": false,
692
+ "docs": {
693
+ "tags": [{
694
+ "text": "Pending Value",
695
+ "name": "uiName"
696
+ }, {
697
+ "text": "Pending Referrals",
698
+ "name": "uiGroup"
699
+ }, {
700
+ "text": "\"Referral pending\"",
701
+ "name": "default"
702
+ }],
703
+ "text": "Pending content shown alongside the icon in the referral column"
704
+ },
705
+ "attribute": "pendingvalue",
706
+ "reflect": false
707
+ },
708
+ "expiredcolor": {
709
+ "type": "string",
710
+ "mutable": false,
711
+ "complexType": {
712
+ "original": "string",
713
+ "resolved": "string",
714
+ "references": {}
715
+ },
716
+ "required": false,
717
+ "optional": false,
718
+ "docs": {
719
+ "tags": [{
720
+ "text": "Expired Color",
721
+ "name": "uiName"
722
+ }, {
723
+ "text": "Expired Rewards",
724
+ "name": "uiGroup"
725
+ }, {
726
+ "text": "color",
727
+ "name": "uiWidget"
728
+ }, {
729
+ "text": "color",
730
+ "name": "format"
731
+ }, {
732
+ "text": "\"lightgray\"",
733
+ "name": "default"
734
+ }],
735
+ "text": "Color of the expired icon and text"
736
+ },
737
+ "attribute": "expiredcolor",
738
+ "reflect": false
739
+ },
740
+ "expiredcontent": {
741
+ "type": "string",
742
+ "mutable": false,
743
+ "complexType": {
744
+ "original": "string",
745
+ "resolved": "string",
746
+ "references": {}
747
+ },
748
+ "required": false,
749
+ "optional": false,
750
+ "docs": {
751
+ "tags": [{
752
+ "text": "Expired Content",
753
+ "name": "uiName"
754
+ }, {
755
+ "text": "Expired Rewards",
756
+ "name": "uiGroup"
757
+ }, {
758
+ "text": "\"Signed up, referred {date}\"",
759
+ "name": "default"
760
+ }],
761
+ "text": "Expired content shown in the user column"
762
+ },
763
+ "attribute": "expiredcontent",
764
+ "reflect": false
765
+ },
766
+ "expiredvalue": {
767
+ "type": "string",
768
+ "mutable": false,
769
+ "complexType": {
770
+ "original": "string",
771
+ "resolved": "string",
772
+ "references": {}
773
+ },
774
+ "required": false,
775
+ "optional": false,
776
+ "docs": {
777
+ "tags": [{
778
+ "text": "Expired Value",
779
+ "name": "uiName"
780
+ }, {
781
+ "text": "Expired Rewards",
782
+ "name": "uiGroup"
783
+ }, {
784
+ "text": "\"Expired Reward\"",
785
+ "name": "default"
786
+ }],
787
+ "text": "Expired content shown alongside the icon in the referral column"
788
+ },
789
+ "attribute": "expiredvalue",
790
+ "reflect": false
791
+ },
792
+ "expiresvalue": {
793
+ "type": "string",
794
+ "mutable": false,
795
+ "complexType": {
796
+ "original": "string",
797
+ "resolved": "string",
798
+ "references": {}
799
+ },
800
+ "required": false,
801
+ "optional": false,
802
+ "docs": {
803
+ "tags": [{
804
+ "text": "Expires Value",
805
+ "name": "uiName"
806
+ }, {
807
+ "text": "Expired Rewards",
808
+ "name": "uiGroup"
809
+ }],
810
+ "text": "Reward expiry ICU message"
811
+ },
812
+ "attribute": "expiresvalue",
813
+ "reflect": false
814
+ },
815
+ "cancelledcolor": {
816
+ "type": "string",
817
+ "mutable": false,
818
+ "complexType": {
819
+ "original": "string",
820
+ "resolved": "string",
821
+ "references": {}
822
+ },
823
+ "required": false,
824
+ "optional": false,
825
+ "docs": {
826
+ "tags": [{
827
+ "text": "Cancelled Color",
828
+ "name": "uiName"
829
+ }, {
830
+ "text": "Cancelled Rewards",
831
+ "name": "uiGroup"
832
+ }, {
833
+ "text": "color",
834
+ "name": "uiWidget"
835
+ }, {
836
+ "text": "color",
837
+ "name": "format"
838
+ }, {
839
+ "text": "\"#C81D05\"",
840
+ "name": "default"
841
+ }],
842
+ "text": "Color of the cancelled icon and text"
843
+ },
844
+ "attribute": "cancelledcolor",
845
+ "reflect": false
846
+ },
847
+ "cancelledcontent": {
848
+ "type": "string",
849
+ "mutable": false,
850
+ "complexType": {
851
+ "original": "string",
852
+ "resolved": "string",
853
+ "references": {}
854
+ },
855
+ "required": false,
856
+ "optional": false,
857
+ "docs": {
858
+ "tags": [{
859
+ "text": "Cancelled Content",
860
+ "name": "uiName"
861
+ }, {
862
+ "text": "Cancelled Rewards",
863
+ "name": "uiGroup"
864
+ }, {
865
+ "text": "\"Signed up, referred {date}\"",
866
+ "name": "default"
867
+ }],
868
+ "text": "Cancelled text content shown in the user column"
869
+ },
870
+ "attribute": "cancelledcontent",
871
+ "reflect": false
872
+ },
873
+ "cancelledvalue": {
874
+ "type": "string",
875
+ "mutable": false,
876
+ "complexType": {
877
+ "original": "string",
878
+ "resolved": "string",
879
+ "references": {}
880
+ },
881
+ "required": false,
882
+ "optional": false,
883
+ "docs": {
884
+ "tags": [{
885
+ "text": "Cancelled Value",
886
+ "name": "uiName"
887
+ }, {
888
+ "text": "Cancelled Rewards",
889
+ "name": "uiGroup"
890
+ }, {
891
+ "text": "\"Cancelled Reward\"",
892
+ "name": "default"
893
+ }],
894
+ "text": "Cancelled text content shown alongside the icon in the referral column"
895
+ },
896
+ "attribute": "cancelledvalue",
897
+ "reflect": false
898
+ },
899
+ "internationalization": {
900
+ "type": "boolean",
901
+ "mutable": false,
902
+ "complexType": {
903
+ "original": "boolean",
904
+ "resolved": "boolean",
905
+ "references": {}
906
+ },
907
+ "required": false,
908
+ "optional": false,
909
+ "docs": {
910
+ "tags": [{
911
+ "text": "Internationalization",
912
+ "name": "uiName"
913
+ }],
914
+ "text": "When true, the local gets set by using the value passed to the referral component"
915
+ },
916
+ "attribute": "internationalization",
917
+ "reflect": false
918
+ }
919
+ }; }
920
+ static get states() { return {
921
+ "referrals": {},
922
+ "referralsCount": {},
923
+ "referredBy": {},
924
+ "rewards": {},
925
+ "loading": {},
926
+ "offset": {},
927
+ "locale": {}
928
+ }; }
929
+ }