@nyaruka/temba-components 0.86.0 → 0.87.0

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 (285) hide show
  1. package/.eslintrc.js +3 -3
  2. package/.prettierrc +6 -0
  3. package/.storybook/main.js +3 -3
  4. package/.storybook/preview.js +2 -2
  5. package/CHANGELOG.md +14 -0
  6. package/CreateIncludesPlugin.js +2 -2
  7. package/demo/index.html +1 -0
  8. package/dist/locales/es.js +1 -1
  9. package/dist/locales/es.js.map +1 -1
  10. package/dist/locales/fr.js +1 -1
  11. package/dist/locales/fr.js.map +1 -1
  12. package/dist/locales/pt.js +1 -1
  13. package/dist/locales/pt.js.map +1 -1
  14. package/dist/temba-components.js +296 -277
  15. package/dist/temba-components.js.map +1 -1
  16. package/out-tsc/src/RapidElement.js +3 -3
  17. package/out-tsc/src/RapidElement.js.map +1 -1
  18. package/out-tsc/src/ResizeElement.js +2 -2
  19. package/out-tsc/src/ResizeElement.js.map +1 -1
  20. package/out-tsc/src/aliaseditor/AliasEditor.js +1 -1
  21. package/out-tsc/src/aliaseditor/AliasEditor.js.map +1 -1
  22. package/out-tsc/src/button/Button.js +1 -1
  23. package/out-tsc/src/button/Button.js.map +1 -1
  24. package/out-tsc/src/charcount/helpers.js +1 -1
  25. package/out-tsc/src/charcount/helpers.js.map +1 -1
  26. package/out-tsc/src/colorpicker/ColorPicker.js +4 -4
  27. package/out-tsc/src/colorpicker/ColorPicker.js.map +1 -1
  28. package/out-tsc/src/completion/Completion.js +2 -2
  29. package/out-tsc/src/completion/Completion.js.map +1 -1
  30. package/out-tsc/src/completion/ExcellentParser.js +1 -1
  31. package/out-tsc/src/completion/ExcellentParser.js.map +1 -1
  32. package/out-tsc/src/completion/helpers.js +8 -8
  33. package/out-tsc/src/completion/helpers.js.map +1 -1
  34. package/out-tsc/src/compose/Compose.js +14 -14
  35. package/out-tsc/src/compose/Compose.js.map +1 -1
  36. package/out-tsc/src/contacts/ContactBadges.js +2 -2
  37. package/out-tsc/src/contacts/ContactBadges.js.map +1 -1
  38. package/out-tsc/src/contacts/ContactChat.js +4 -4
  39. package/out-tsc/src/contacts/ContactChat.js.map +1 -1
  40. package/out-tsc/src/contacts/ContactDetails.js +4 -4
  41. package/out-tsc/src/contacts/ContactDetails.js.map +1 -1
  42. package/out-tsc/src/contacts/ContactFieldEditor.js +3 -3
  43. package/out-tsc/src/contacts/ContactFieldEditor.js.map +1 -1
  44. package/out-tsc/src/contacts/ContactFields.js +2 -2
  45. package/out-tsc/src/contacts/ContactFields.js.map +1 -1
  46. package/out-tsc/src/contacts/ContactHistory.js +21 -19
  47. package/out-tsc/src/contacts/ContactHistory.js.map +1 -1
  48. package/out-tsc/src/contacts/ContactPending.js +4 -4
  49. package/out-tsc/src/contacts/ContactPending.js.map +1 -1
  50. package/out-tsc/src/contacts/ContactTickets.js +8 -8
  51. package/out-tsc/src/contacts/ContactTickets.js.map +1 -1
  52. package/out-tsc/src/contacts/events.js +2 -2
  53. package/out-tsc/src/contacts/events.js.map +1 -1
  54. package/out-tsc/src/contacts/helpers.js +2 -2
  55. package/out-tsc/src/contacts/helpers.js.map +1 -1
  56. package/out-tsc/src/contactsearch/ContactSearch.js +7 -7
  57. package/out-tsc/src/contactsearch/ContactSearch.js.map +1 -1
  58. package/out-tsc/src/date/TembaDate.js +1 -1
  59. package/out-tsc/src/date/TembaDate.js.map +1 -1
  60. package/out-tsc/src/datepicker/DatePicker.js +1 -1
  61. package/out-tsc/src/datepicker/DatePicker.js.map +1 -1
  62. package/out-tsc/src/dialog/Dialog.js +5 -5
  63. package/out-tsc/src/dialog/Dialog.js.map +1 -1
  64. package/out-tsc/src/dialog/Modax.js +8 -8
  65. package/out-tsc/src/dialog/Modax.js.map +1 -1
  66. package/out-tsc/src/dropdown/Dropdown.js +1 -1
  67. package/out-tsc/src/dropdown/Dropdown.js.map +1 -1
  68. package/out-tsc/src/fields/FieldManager.js +6 -6
  69. package/out-tsc/src/fields/FieldManager.js.map +1 -1
  70. package/out-tsc/src/imagepicker/ImagePicker.js +4 -4
  71. package/out-tsc/src/imagepicker/ImagePicker.js.map +1 -1
  72. package/out-tsc/src/interfaces.js.map +1 -1
  73. package/out-tsc/src/label/Label.js +1 -1
  74. package/out-tsc/src/label/Label.js.map +1 -1
  75. package/out-tsc/src/leafletmap/LeafletMap.js +6 -6
  76. package/out-tsc/src/leafletmap/LeafletMap.js.map +1 -1
  77. package/out-tsc/src/leafletmap/helpers.js +2 -2
  78. package/out-tsc/src/leafletmap/helpers.js.map +1 -1
  79. package/out-tsc/src/lightbox/Lightbox.js +2 -2
  80. package/out-tsc/src/lightbox/Lightbox.js.map +1 -1
  81. package/out-tsc/src/list/ContentMenu.js +8 -8
  82. package/out-tsc/src/list/ContentMenu.js.map +1 -1
  83. package/out-tsc/src/list/NotificationList.js +7 -3
  84. package/out-tsc/src/list/NotificationList.js.map +1 -1
  85. package/out-tsc/src/list/RunList.js +1 -1
  86. package/out-tsc/src/list/RunList.js.map +1 -1
  87. package/out-tsc/src/list/SortableList.js +6 -6
  88. package/out-tsc/src/list/SortableList.js.map +1 -1
  89. package/out-tsc/src/list/TembaList.js +5 -5
  90. package/out-tsc/src/list/TembaList.js.map +1 -1
  91. package/out-tsc/src/list/TembaMenu.js +22 -22
  92. package/out-tsc/src/list/TembaMenu.js.map +1 -1
  93. package/out-tsc/src/loading/Loading.js +1 -1
  94. package/out-tsc/src/loading/Loading.js.map +1 -1
  95. package/out-tsc/src/locales/es.js +1 -1
  96. package/out-tsc/src/locales/es.js.map +1 -1
  97. package/out-tsc/src/locales/fr.js +1 -1
  98. package/out-tsc/src/locales/fr.js.map +1 -1
  99. package/out-tsc/src/locales/pt.js +1 -1
  100. package/out-tsc/src/locales/pt.js.map +1 -1
  101. package/out-tsc/src/omnibox/Omnibox.js +1 -1
  102. package/out-tsc/src/omnibox/Omnibox.js.map +1 -1
  103. package/out-tsc/src/options/Options.js +9 -9
  104. package/out-tsc/src/options/Options.js.map +1 -1
  105. package/out-tsc/src/remote/Remote.js +1 -1
  106. package/out-tsc/src/remote/Remote.js.map +1 -1
  107. package/out-tsc/src/select/Select.js +18 -18
  108. package/out-tsc/src/select/Select.js.map +1 -1
  109. package/out-tsc/src/sms/gsmsplitter.js +8 -8
  110. package/out-tsc/src/sms/gsmsplitter.js.map +1 -1
  111. package/out-tsc/src/sms/gsmvalidator.js +1 -1
  112. package/out-tsc/src/sms/gsmvalidator.js.map +1 -1
  113. package/out-tsc/src/sms/index.js +2 -2
  114. package/out-tsc/src/sms/index.js.map +1 -1
  115. package/out-tsc/src/sms/unicodesplitter.js +8 -8
  116. package/out-tsc/src/sms/unicodesplitter.js.map +1 -1
  117. package/out-tsc/src/store/Store.js +10 -10
  118. package/out-tsc/src/store/Store.js.map +1 -1
  119. package/out-tsc/src/store/StoreElement.js +2 -2
  120. package/out-tsc/src/store/StoreElement.js.map +1 -1
  121. package/out-tsc/src/tabpane/TabPane.js +4 -4
  122. package/out-tsc/src/tabpane/TabPane.js.map +1 -1
  123. package/out-tsc/src/templates/TemplateEditor.js +9 -9
  124. package/out-tsc/src/templates/TemplateEditor.js.map +1 -1
  125. package/out-tsc/src/textinput/TextInput.js +1 -1
  126. package/out-tsc/src/textinput/TextInput.js.map +1 -1
  127. package/out-tsc/src/thumbnail/Thumbnail.js +5 -5
  128. package/out-tsc/src/thumbnail/Thumbnail.js.map +1 -1
  129. package/out-tsc/src/tip/Tip.js +3 -3
  130. package/out-tsc/src/tip/Tip.js.map +1 -1
  131. package/out-tsc/src/utils/index.js +21 -21
  132. package/out-tsc/src/utils/index.js.map +1 -1
  133. package/out-tsc/src/vectoricon/VectorIcon.js +2 -2
  134. package/out-tsc/src/vectoricon/VectorIcon.js.map +1 -1
  135. package/out-tsc/src/vectoricon/index.js +2 -0
  136. package/out-tsc/src/vectoricon/index.js.map +1 -1
  137. package/out-tsc/src/webchat/WebChat.js +234 -81
  138. package/out-tsc/src/webchat/WebChat.js.map +1 -1
  139. package/out-tsc/src/webchat/assets.js +2 -0
  140. package/out-tsc/src/webchat/assets.js.map +1 -0
  141. package/out-tsc/src/webchat/index.js.map +1 -1
  142. package/out-tsc/test/temba-alert.test.js +1 -1
  143. package/out-tsc/test/temba-alert.test.js.map +1 -1
  144. package/out-tsc/test/temba-checkbox.test.js.map +1 -1
  145. package/out-tsc/test/temba-color-picker.test.js +4 -4
  146. package/out-tsc/test/temba-color-picker.test.js.map +1 -1
  147. package/out-tsc/test/temba-compose.test.js +50 -54
  148. package/out-tsc/test/temba-compose.test.js.map +1 -1
  149. package/out-tsc/test/temba-contact-badges.test.js +2 -2
  150. package/out-tsc/test/temba-contact-badges.test.js.map +1 -1
  151. package/out-tsc/test/temba-contact-chat.test.js +25 -38
  152. package/out-tsc/test/temba-contact-chat.test.js.map +1 -1
  153. package/out-tsc/test/temba-contact-details.test.js +2 -2
  154. package/out-tsc/test/temba-contact-details.test.js.map +1 -1
  155. package/out-tsc/test/temba-contact-fields.test.js +4 -4
  156. package/out-tsc/test/temba-contact-fields.test.js.map +1 -1
  157. package/out-tsc/test/temba-contact-history.test.js +3 -3
  158. package/out-tsc/test/temba-contact-history.test.js.map +1 -1
  159. package/out-tsc/test/temba-contact-search.test.js +7 -7
  160. package/out-tsc/test/temba-contact-search.test.js.map +1 -1
  161. package/out-tsc/test/temba-contact-tickets.test.js +3 -3
  162. package/out-tsc/test/temba-contact-tickets.test.js.map +1 -1
  163. package/out-tsc/test/temba-content-menu.test.js +7 -7
  164. package/out-tsc/test/temba-content-menu.test.js.map +1 -1
  165. package/out-tsc/test/temba-date.test.js +3 -3
  166. package/out-tsc/test/temba-date.test.js.map +1 -1
  167. package/out-tsc/test/temba-datepicker.test.js +1 -1
  168. package/out-tsc/test/temba-datepicker.test.js.map +1 -1
  169. package/out-tsc/test/temba-field-manager.test.js +1 -3
  170. package/out-tsc/test/temba-field-manager.test.js.map +1 -1
  171. package/out-tsc/test/temba-label.test.js +6 -6
  172. package/out-tsc/test/temba-label.test.js.map +1 -1
  173. package/out-tsc/test/temba-lightbox.test.js +2 -2
  174. package/out-tsc/test/temba-lightbox.test.js.map +1 -1
  175. package/out-tsc/test/temba-list.test.js +6 -6
  176. package/out-tsc/test/temba-list.test.js.map +1 -1
  177. package/out-tsc/test/temba-menu.test.js +4 -5
  178. package/out-tsc/test/temba-menu.test.js.map +1 -1
  179. package/out-tsc/test/temba-modax.test.js +3 -3
  180. package/out-tsc/test/temba-modax.test.js.map +1 -1
  181. package/out-tsc/test/temba-options.test.js +1 -1
  182. package/out-tsc/test/temba-options.test.js.map +1 -1
  183. package/out-tsc/test/temba-select.test.js +17 -17
  184. package/out-tsc/test/temba-select.test.js.map +1 -1
  185. package/out-tsc/test/temba-sortable-list.test.js +1 -1
  186. package/out-tsc/test/temba-sortable-list.test.js.map +1 -1
  187. package/out-tsc/test/temba-textinput.test.js +2 -2
  188. package/out-tsc/test/temba-textinput.test.js.map +1 -1
  189. package/out-tsc/test/temba-tip.test.js +4 -4
  190. package/out-tsc/test/temba-tip.test.js.map +1 -1
  191. package/out-tsc/test/utils.test.js +8 -8
  192. package/out-tsc/test/utils.test.js.map +1 -1
  193. package/package.json +6 -15
  194. package/src/RapidElement.ts +3 -3
  195. package/src/ResizeElement.ts +2 -2
  196. package/src/aliaseditor/AliasEditor.ts +1 -2
  197. package/src/button/Button.ts +1 -1
  198. package/src/charcount/helpers.ts +1 -1
  199. package/src/colorpicker/ColorPicker.ts +4 -4
  200. package/src/completion/Completion.ts +2 -2
  201. package/src/completion/ExcellentParser.ts +1 -1
  202. package/src/completion/helpers.ts +9 -9
  203. package/src/compose/Compose.ts +18 -16
  204. package/src/contacts/ContactBadges.ts +2 -2
  205. package/src/contacts/ContactChat.ts +4 -4
  206. package/src/contacts/ContactDetails.ts +4 -4
  207. package/src/contacts/ContactFieldEditor.ts +4 -4
  208. package/src/contacts/ContactFields.ts +2 -2
  209. package/src/contacts/ContactHistory.ts +25 -22
  210. package/src/contacts/ContactPending.ts +4 -4
  211. package/src/contacts/ContactTickets.ts +9 -9
  212. package/src/contacts/events.ts +3 -3
  213. package/src/contacts/helpers.ts +2 -2
  214. package/src/contactsearch/ContactSearch.ts +9 -9
  215. package/src/date/TembaDate.ts +1 -1
  216. package/src/datepicker/DatePicker.ts +1 -1
  217. package/src/dialog/Dialog.ts +6 -6
  218. package/src/dialog/Modax.ts +8 -8
  219. package/src/dropdown/Dropdown.ts +1 -2
  220. package/src/emojis.json +1882 -1
  221. package/src/fields/FieldManager.ts +6 -7
  222. package/src/imagepicker/ImagePicker.ts +4 -4
  223. package/src/interfaces.ts +4 -4
  224. package/src/label/Label.ts +1 -1
  225. package/src/leafletmap/LeafletMap.ts +6 -6
  226. package/src/leafletmap/helpers.ts +2 -2
  227. package/src/lightbox/Lightbox.ts +2 -2
  228. package/src/list/ContentMenu.ts +9 -9
  229. package/src/list/NotificationList.ts +7 -3
  230. package/src/list/RunList.ts +1 -1
  231. package/src/list/SortableList.ts +6 -6
  232. package/src/list/TembaList.ts +5 -5
  233. package/src/list/TembaMenu.ts +23 -23
  234. package/src/loading/Loading.ts +1 -1
  235. package/src/locales/es.ts +1 -1
  236. package/src/locales/fr.ts +1 -1
  237. package/src/locales/pt.ts +1 -1
  238. package/src/omnibox/Omnibox.ts +2 -2
  239. package/src/options/Options.ts +9 -9
  240. package/src/remote/Remote.ts +1 -1
  241. package/src/select/Select.ts +19 -19
  242. package/src/sms/gsmsplitter.ts +8 -8
  243. package/src/sms/gsmvalidator.ts +1 -1
  244. package/src/sms/index.ts +2 -2
  245. package/src/sms/unicodesplitter.ts +8 -8
  246. package/src/store/Store.ts +10 -10
  247. package/src/store/StoreElement.ts +2 -2
  248. package/src/tabpane/TabPane.ts +4 -4
  249. package/src/templates/TemplateEditor.ts +9 -9
  250. package/src/textinput/TextInput.ts +2 -2
  251. package/src/thumbnail/Thumbnail.ts +5 -5
  252. package/src/tip/Tip.ts +3 -3
  253. package/src/utils/index.ts +24 -24
  254. package/src/vectoricon/VectorIcon.ts +2 -2
  255. package/src/vectoricon/index.ts +3 -1
  256. package/src/webchat/WebChat.ts +272 -87
  257. package/src/webchat/assets.ts +2 -0
  258. package/src/webchat/index.ts +1 -1
  259. package/svg.js +28 -29
  260. package/test/temba-alert.test.ts +1 -1
  261. package/test/temba-checkbox.test.ts +1 -1
  262. package/test/temba-color-picker.test.ts +4 -4
  263. package/test/temba-compose.test.ts +50 -55
  264. package/test/temba-contact-badges.test.ts +2 -2
  265. package/test/temba-contact-chat.test.ts +26 -46
  266. package/test/temba-contact-details.test.ts +2 -8
  267. package/test/temba-contact-fields.test.ts +4 -11
  268. package/test/temba-contact-history.test.ts +3 -3
  269. package/test/temba-contact-search.test.ts +7 -13
  270. package/test/temba-contact-tickets.test.ts +3 -3
  271. package/test/temba-content-menu.test.ts +7 -7
  272. package/test/temba-date.test.ts +3 -3
  273. package/test/temba-datepicker.test.ts +1 -1
  274. package/test/temba-field-manager.test.ts +1 -4
  275. package/test/temba-label.test.ts +6 -6
  276. package/test/temba-lightbox.test.ts +2 -2
  277. package/test/temba-list.test.ts +6 -6
  278. package/test/temba-menu.test.ts +4 -5
  279. package/test/temba-modax.test.ts +3 -3
  280. package/test/temba-options.test.ts +1 -1
  281. package/test/temba-select.test.ts +17 -17
  282. package/test/temba-sortable-list.test.ts +1 -1
  283. package/test/temba-textinput.test.ts +2 -2
  284. package/test/temba-tip.test.ts +5 -5
  285. package/test/utils.test.ts +8 -9
@@ -7,7 +7,7 @@ import {
7
7
  getClasses,
8
8
  getScrollParent,
9
9
  isElementVisible,
10
- throttle,
10
+ throttle
11
11
  } from '../utils';
12
12
 
13
13
  export class Options extends RapidElement {
@@ -330,7 +330,7 @@ export class Options extends RapidElement {
330
330
  }
331
331
 
332
332
  this.fireCustomEvent(CustomEventType.CursorChanged, {
333
- index: this.cursorIndex,
333
+ index: this.cursorIndex
334
334
  });
335
335
  }
336
336
 
@@ -437,7 +437,7 @@ export class Options extends RapidElement {
437
437
  this.fireCustomEvent(CustomEventType.Selection, {
438
438
  selected,
439
439
  tabbed,
440
- index,
440
+ index
441
441
  });
442
442
  }
443
443
 
@@ -566,13 +566,13 @@ export class Options extends RapidElement {
566
566
  {
567
567
  event: 'keydown',
568
568
  method: this.handleKeyDown,
569
- isDocument: true,
569
+ isDocument: true
570
570
  },
571
571
  {
572
572
  event: 'scroll',
573
573
  method: this.calculatePosition,
574
- isDocument: true,
575
- },
574
+ isDocument: true
575
+ }
576
576
  ];
577
577
  }
578
578
 
@@ -616,7 +616,7 @@ export class Options extends RapidElement {
616
616
 
617
617
  const containerStyle = {
618
618
  'margin-left': `${this.marginHorizontal}px`,
619
- 'margin-top': `${vertical}px`,
619
+ 'margin-top': `${vertical}px`
620
620
  };
621
621
 
622
622
  if (this.top) {
@@ -639,11 +639,11 @@ export class Options extends RapidElement {
639
639
  anchored: !this.block,
640
640
  loading: this.loading,
641
641
  shadow: !this.hideShadow,
642
- bordered: this.hideShadow,
642
+ bordered: this.hideShadow
643
643
  });
644
644
 
645
645
  const classesInner = getClasses({
646
- options: true,
646
+ options: true
647
647
  });
648
648
 
649
649
  let options = this.options || [];
@@ -20,7 +20,7 @@ export default class Remote extends RapidElement {
20
20
  super.updated(changes);
21
21
 
22
22
  if (changes.has('endpoint')) {
23
- getUrl(this.endpoint).then(response => {
23
+ getUrl(this.endpoint).then((response) => {
24
24
  this.body = unsafeHTML(response.body);
25
25
  });
26
26
  }
@@ -6,7 +6,7 @@ import {
6
6
  getClasses,
7
7
  fetchResults,
8
8
  WebResponse,
9
- postJSON,
9
+ postJSON
10
10
  } from '../utils';
11
11
  import '../options/Options';
12
12
  import { EventHandler } from '../RapidElement';
@@ -17,7 +17,7 @@ import { CompletionOption, CustomEventType, Position } from '../interfaces';
17
17
  import {
18
18
  renderCompletionOption,
19
19
  updateInputElementWithCompletion,
20
- executeCompletionQuery,
20
+ executeCompletionQuery
21
21
  } from '../completion/helpers';
22
22
  import { Store } from '../store/Store';
23
23
  import { styleMap } from 'lit-html/directives/style-map.js';
@@ -550,7 +550,7 @@ export class Select extends FormElement {
550
550
  if (results && results.length > 0) {
551
551
  if (value) {
552
552
  // if we started with a value, see if we can find it in the results
553
- const existing = results.find(option => {
553
+ const existing = results.find((option) => {
554
554
  return this.getValue(option) === value;
555
555
  });
556
556
 
@@ -660,7 +660,7 @@ export class Select extends FormElement {
660
660
 
661
661
  public setSelectedValue(value: string) {
662
662
  if (this.staticOptions.length > 0) {
663
- const existing = this.staticOptions.find(option => {
663
+ const existing = this.staticOptions.find((option) => {
664
664
  return this.getValue(option) === value;
665
665
  });
666
666
 
@@ -686,7 +686,7 @@ export class Select extends FormElement {
686
686
  this.value = this.serializeValue(this.values[0]);
687
687
  } else {
688
688
  if (this.inputRoot.parentElement) {
689
- this.values.forEach(value => {
689
+ this.values.forEach((value) => {
690
690
  const ele = document.createElement('input');
691
691
  ele.setAttribute('type', 'hidden');
692
692
  ele.setAttribute('name', name);
@@ -731,7 +731,7 @@ export class Select extends FormElement {
731
731
  const selected = event.detail.selected;
732
732
  // check if we should post it
733
733
  if (selected.post && this.endpoint) {
734
- postJSON(this.endpoint, selected).then(response => {
734
+ postJSON(this.endpoint, selected).then((response) => {
735
735
  if (response.status >= 200 && response.status < 300) {
736
736
  this.setSelectedOption(response.json);
737
737
  this.lruCache = lru(20, 60000);
@@ -801,7 +801,7 @@ export class Select extends FormElement {
801
801
 
802
802
  private setVisibleOptions(options: any[]) {
803
803
  // if we have an exclusion filter apply it
804
- options = options.filter(option => {
804
+ options = options.filter((option) => {
805
805
  // exclude unnamed
806
806
  if (!this.getNameInternal(option)) {
807
807
  return false;
@@ -854,16 +854,16 @@ export class Select extends FormElement {
854
854
  if (this.values.length > 0) {
855
855
  if (this.multi) {
856
856
  options = options.filter(
857
- option =>
857
+ (option) =>
858
858
  !this.values.find(
859
- selected => this.getValue(selected) === this.getValue(option)
859
+ (selected) => this.getValue(selected) === this.getValue(option)
860
860
  )
861
861
  );
862
862
  } else {
863
863
  // if no search, single select should set our cursor to the selected item
864
864
  if (!this.input) {
865
865
  this.cursorIndex = options.findIndex(
866
- option => this.getValue(option) === this.getValue(this.values[0])
866
+ (option) => this.getValue(option) === this.getValue(this.values[0])
867
867
  );
868
868
  } else {
869
869
  this.cursorIndex = 0;
@@ -880,7 +880,7 @@ export class Select extends FormElement {
880
880
  this.visibleOptions = options;
881
881
 
882
882
  this.fireCustomEvent(CustomEventType.ContentChanged, {
883
- options: this.visibleOptions,
883
+ options: this.visibleOptions
884
884
  });
885
885
  }
886
886
 
@@ -978,7 +978,7 @@ export class Select extends FormElement {
978
978
  this.lruCache.set(url, {
979
979
  options: results,
980
980
  complete: true,
981
- next: null,
981
+ next: null
982
982
  });
983
983
 
984
984
  this.complete = true;
@@ -1017,7 +1017,7 @@ export class Select extends FormElement {
1017
1017
  this.lruCache.set(url, {
1018
1018
  options: results,
1019
1019
  complete: this.complete,
1020
- next: this.next,
1020
+ next: this.next
1021
1021
  });
1022
1022
  }
1023
1023
 
@@ -1069,12 +1069,12 @@ export class Select extends FormElement {
1069
1069
  const expression = {
1070
1070
  name: ele.value,
1071
1071
  value: ele.value,
1072
- expression: true,
1072
+ expression: true
1073
1073
  };
1074
1074
 
1075
1075
  if (this.multi) {
1076
1076
  if (
1077
- !this.values.find(option => {
1077
+ !this.values.find((option) => {
1078
1078
  return (
1079
1079
  option.expression &&
1080
1080
  option.value &&
@@ -1184,10 +1184,10 @@ export class Select extends FormElement {
1184
1184
  { event: CustomEventType.Canceled, method: this.handleCancel },
1185
1185
  {
1186
1186
  event: CustomEventType.CursorChanged,
1187
- method: this.handleCursorChanged,
1187
+ method: this.handleCursorChanged
1188
1188
  },
1189
1189
  { event: 'blur', method: this.handleBlur },
1190
- { event: 'focus', method: this.handleFocus },
1190
+ { event: 'focus', method: this.handleFocus }
1191
1191
  ];
1192
1192
  }
1193
1193
 
@@ -1296,13 +1296,13 @@ export class Select extends FormElement {
1296
1296
  'search-input': this.input.length > 0,
1297
1297
  'no-search-input': this.input.length === 0,
1298
1298
  [this.flavor]: this.flavor !== null,
1299
- disabled: this.disabled,
1299
+ disabled: this.disabled
1300
1300
  });
1301
1301
 
1302
1302
  const anchorStyles = this.anchorPosition
1303
1303
  ? {
1304
1304
  top: '0px',
1305
- left: `${this.anchorPosition.left - 10}px`,
1305
+ left: `${this.anchorPosition.left - 10}px`
1306
1306
  }
1307
1307
  : {};
1308
1308
 
@@ -13,11 +13,11 @@ export const gsmSplit = function (message, options) {
13
13
  {
14
14
  content: options.summary ? undefined : '',
15
15
  length: 0,
16
- bytes: 0,
17
- },
16
+ bytes: 0
17
+ }
18
18
  ],
19
19
  totalLength: 0,
20
- totalBytes: 0,
20
+ totalBytes: 0
21
21
  };
22
22
  }
23
23
 
@@ -32,7 +32,7 @@ export const gsmSplit = function (message, options) {
32
32
  const msg = {
33
33
  content: options.summary ? undefined : messagePart,
34
34
  length: length,
35
- bytes: bytes,
35
+ bytes: bytes
36
36
  };
37
37
  messages.push(msg);
38
38
 
@@ -74,17 +74,17 @@ export const gsmSplit = function (message, options) {
74
74
  ? undefined
75
75
  : messages[0].content + messages[1].content,
76
76
  length: totalLength,
77
- bytes: totalBytes,
78
- },
77
+ bytes: totalBytes
78
+ }
79
79
  ],
80
80
  totalLength: totalLength,
81
- totalBytes: totalBytes,
81
+ totalBytes: totalBytes
82
82
  };
83
83
  }
84
84
 
85
85
  return {
86
86
  parts: messages,
87
87
  totalLength: totalLength,
88
- totalBytes: totalBytes,
88
+ totalBytes: totalBytes
89
89
  };
90
90
  };
@@ -8,7 +8,7 @@ const GSM_charCodes = [
8
8
  120, 121, 122, 123, 124, 125, 126, 161, 163, 164, 165, 167, 191, 196, 197,
9
9
  198, 199, 201, 209, 214, 216, 220, 223, 224, 228, 229, 230, 232, 233, 236,
10
10
  241, 242, 246, 248, 249, 252, 915, 916, 920, 923, 926, 928, 931, 934, 936,
11
- 937, 8364,
11
+ 937, 8364
12
12
  ];
13
13
 
14
14
  // '\f|^€{}[~]\\'
package/src/sms/index.ts CHANGED
@@ -20,7 +20,7 @@ export const splitSMS = function (message: string, options: any = {}) {
20
20
  const characterset = options && options.characterset;
21
21
 
22
22
  options = {
23
- summary: options && options.summary,
23
+ summary: options && options.summary
24
24
  };
25
25
 
26
26
  const isGsm =
@@ -52,6 +52,6 @@ export const splitSMS = function (message: string, options: any = {}) {
52
52
  parts: splitResult.parts,
53
53
  bytes: splitResult.totalBytes,
54
54
  length: splitResult.totalLength,
55
- remainingInPart: remainingInPart,
55
+ remainingInPart: remainingInPart
56
56
  };
57
57
  };
@@ -11,11 +11,11 @@ export const unicodeSplit = function (message, options) {
11
11
  {
12
12
  content: options.summary ? undefined : '',
13
13
  length: 0,
14
- bytes: 0,
15
- },
14
+ bytes: 0
15
+ }
16
16
  ],
17
17
  totalLength: 0,
18
- totalBytes: 0,
18
+ totalBytes: 0
19
19
  };
20
20
  }
21
21
 
@@ -34,7 +34,7 @@ export const unicodeSplit = function (message, options) {
34
34
  ? message.substring(partStart, partEnd + 1)
35
35
  : message.substring(partStart),
36
36
  length: length,
37
- bytes: bytes,
37
+ bytes: bytes
38
38
  };
39
39
  messages.push(msg);
40
40
 
@@ -70,17 +70,17 @@ export const unicodeSplit = function (message, options) {
70
70
  {
71
71
  content: options.summary ? undefined : message,
72
72
  length: totalLength,
73
- bytes: totalBytes,
74
- },
73
+ bytes: totalBytes
74
+ }
75
75
  ],
76
76
  totalLength: totalLength,
77
- totalBytes: totalBytes,
77
+ totalBytes: totalBytes
78
78
  };
79
79
  }
80
80
 
81
81
  return {
82
82
  parts: messages,
83
83
  totalLength: totalLength,
84
- totalBytes: totalBytes,
84
+ totalBytes: totalBytes
85
85
  };
86
86
  };
@@ -8,7 +8,7 @@ import {
8
8
  postUrl,
9
9
  postJSON,
10
10
  postForm,
11
- getCookie,
11
+ getCookie
12
12
  } from '../utils';
13
13
  import {
14
14
  ContactField,
@@ -18,7 +18,7 @@ import {
18
18
  KeyedAssets,
19
19
  CustomEventType,
20
20
  Workspace,
21
- User,
21
+ User
22
22
  } from '../interfaces';
23
23
  import { RapidElement } from '../RapidElement';
24
24
  import { lru } from 'tiny-lru';
@@ -30,7 +30,7 @@ import { sourceLocale, targetLocales } from '../locales/locale-codes';
30
30
  const { setLocale } = configureLocalization({
31
31
  sourceLocale,
32
32
  targetLocales,
33
- loadLocale: locale => import(`./locales/${locale}.js`),
33
+ loadLocale: (locale) => import(`./locales/${locale}.js`)
34
34
  });
35
35
 
36
36
  export class Store extends RapidElement {
@@ -137,7 +137,7 @@ export class Store extends RapidElement {
137
137
  const fetches = [];
138
138
  if (this.completionEndpoint) {
139
139
  fetches.push(
140
- getUrl(this.completionEndpoint).then(response => {
140
+ getUrl(this.completionEndpoint).then((response) => {
141
141
  this.schema = response.json['context'] as CompletionSchema;
142
142
  this.fnOptions = response.json['functions'] as CompletionOption[];
143
143
  })
@@ -257,7 +257,7 @@ export class Store extends RapidElement {
257
257
 
258
258
  this.fireCustomEvent(CustomEventType.StoreUpdated, {
259
259
  url: this.fieldsEndpoint,
260
- data: this.keyedAssets['fields'],
260
+ data: this.keyedAssets['fields']
261
261
  });
262
262
  });
263
263
  }
@@ -285,7 +285,7 @@ export class Store extends RapidElement {
285
285
  if (changedProperties.has('ready') && this.ready) {
286
286
  const locale = this.getLanguageCode();
287
287
  const target = targetLocales.find(
288
- targetLocale => targetLocale === locale
288
+ (targetLocale) => targetLocale === locale
289
289
  );
290
290
 
291
291
  if (target) {
@@ -373,7 +373,7 @@ export class Store extends RapidElement {
373
373
  ): Promise<WebResponse> {
374
374
  options = options || {};
375
375
  if (!options.force && this.cache.has(url)) {
376
- return new Promise<WebResponse>(resolve => {
376
+ return new Promise<WebResponse>((resolve) => {
377
377
  resolve(this.cache.get(url));
378
378
  });
379
379
  }
@@ -407,12 +407,12 @@ export class Store extends RapidElement {
407
407
  const results = this.cache.get(key);
408
408
 
409
409
  if (!options.force && results) {
410
- return new Promise<any[]>(resolve => {
410
+ return new Promise<any[]>((resolve) => {
411
411
  resolve(results);
412
412
  });
413
413
  }
414
414
 
415
- return new Promise<any[]>(resolve => {
415
+ return new Promise<any[]>((resolve) => {
416
416
  const pending = this.pendingResolves[url] || [];
417
417
  pending.push(resolve);
418
418
  this.pendingResolves[url] = pending;
@@ -453,7 +453,7 @@ export class Store extends RapidElement {
453
453
  if (cached && !options.force) {
454
454
  this.fireCustomEvent(CustomEventType.StoreUpdated, { url, data: cached });
455
455
  } else {
456
- fetchResults(url).then(data => {
456
+ fetchResults(url).then((data) => {
457
457
  if (!data) {
458
458
  delete this.fetching[url];
459
459
  return;
@@ -28,7 +28,7 @@ export class StoreElement extends StoreMonitorElement {
28
28
  public refresh() {
29
29
  this.store.makeRequest(this.url, {
30
30
  prepareData: this.prepareData,
31
- force: true,
31
+ force: true
32
32
  });
33
33
  }
34
34
 
@@ -38,7 +38,7 @@ export class StoreElement extends StoreMonitorElement {
38
38
  this.data = event.detail.data;
39
39
  this.fireCustomEvent(CustomEventType.Refreshed, {
40
40
  data: event.detail.data,
41
- previous,
41
+ previous
42
42
  });
43
43
  }
44
44
  }
@@ -319,7 +319,7 @@ export class TabPane extends RapidElement {
319
319
  class="pane ${getClasses({
320
320
  first: this.index == 0,
321
321
  embedded: this.embedded,
322
- bottom: this.bottom,
322
+ bottom: this.bottom
323
323
  })}"
324
324
  >
325
325
  <slot></slot>
@@ -332,7 +332,7 @@ export class TabPane extends RapidElement {
332
332
  bottom: this.bottom,
333
333
  collapses: this.collapses,
334
334
  embedded: this.embedded,
335
- focusedname: this.focusedName,
335
+ focusedname: this.focusedName
336
336
  })}"
337
337
  >
338
338
  ${this.tabs.map(
@@ -345,7 +345,7 @@ export class TabPane extends RapidElement {
345
345
  first: index == 0,
346
346
  selected: index == this.index,
347
347
  hidden: tab.hidden,
348
- notify: tab.notify,
348
+ notify: tab.notify
349
349
  })}"
350
350
  style="${tab.selectionColor && index == this.index
351
351
  ? `color:${tab.selectionColor};--icon-color:${tab.selectionColor};`
@@ -383,7 +383,7 @@ export class TabPane extends RapidElement {
383
383
  class="pane ${getClasses({
384
384
  first: this.index == 0,
385
385
  embedded: this.embedded,
386
- bottom: this.bottom,
386
+ bottom: this.bottom
387
387
  })}"
388
388
  >
389
389
  <slot></slot>
@@ -29,7 +29,7 @@ interface Template {
29
29
  export class TemplateEditor extends FormElement {
30
30
  static shadowRootOptions = {
31
31
  ...LitElement.shadowRootOptions,
32
- delegatesFocus: true,
32
+ delegatesFocus: true
33
33
  };
34
34
 
35
35
  static get styles() {
@@ -166,7 +166,7 @@ export class TemplateEditor extends FormElement {
166
166
  this.selectedTemplate = (event.target as any).values[0] as Template;
167
167
  const [lang, loc] = this.lang.split('-');
168
168
  if (this.selectedTemplate) {
169
- this.selectedTemplate.translations.forEach(translation => {
169
+ this.selectedTemplate.translations.forEach((translation) => {
170
170
  if (
171
171
  translation.locale === this.lang ||
172
172
  (!loc && translation.locale.split('-')[0] === lang)
@@ -195,7 +195,7 @@ export class TemplateEditor extends FormElement {
195
195
  this.fireCustomEvent(CustomEventType.ContextChanged, {
196
196
  template: this.selectedTemplate,
197
197
  translation: this.translation,
198
- variables: this.variables,
198
+ variables: this.variables
199
199
  });
200
200
  }
201
201
 
@@ -206,7 +206,7 @@ export class TemplateEditor extends FormElement {
206
206
  this.fireCustomEvent(CustomEventType.ContentChanged, {
207
207
  template: this.selectedTemplate,
208
208
  translation: this.translation,
209
- variables: this.variables,
209
+ variables: this.variables
210
210
  });
211
211
  }
212
212
 
@@ -241,14 +241,14 @@ export class TemplateEditor extends FormElement {
241
241
 
242
242
  public renderComponents(components: Component[]): TemplateResult {
243
243
  const nonButtons = components
244
- .filter(comp => !comp.type.startsWith('button/'))
244
+ .filter((comp) => !comp.type.startsWith('button/'))
245
245
  .map(
246
- component =>
246
+ (component) =>
247
247
  html`<div class="${component['name']}">
248
248
  ${this.renderVariables(component)}
249
249
  </div>`
250
250
  );
251
- const buttonComponents = components.filter(comp =>
251
+ const buttonComponents = components.filter((comp) =>
252
252
  comp.type.startsWith('button/')
253
253
  );
254
254
  const buttons =
@@ -261,7 +261,7 @@ export class TemplateEditor extends FormElement {
261
261
  }
262
262
 
263
263
  public renderButtons(components): TemplateResult {
264
- const buttons = components.map(component => {
264
+ const buttons = components.map((component) => {
265
265
  if (component.display) {
266
266
  return html`
267
267
  <div class="button">
@@ -301,7 +301,7 @@ export class TemplateEditor extends FormElement {
301
301
  class="picker"
302
302
  value="${this.template}"
303
303
  endpoint="${this.url}?comps_as_list=true"
304
- shouldExclude=${template => template.status !== 'approved'}
304
+ shouldExclude=${(template) => template.status !== 'approved'}
305
305
  placeholder="Select a template"
306
306
  @temba-content-changed=${this.swallowEvent}
307
307
  @change=${this.handleTemplateChanged}
@@ -10,7 +10,7 @@ import { CharCount } from '../charcount/CharCount';
10
10
  export enum InputType {
11
11
  Text = 'text',
12
12
  Password = 'password',
13
- Number = 'number',
13
+ Number = 'number'
14
14
  }
15
15
 
16
16
  export class TextInput extends FormElement {
@@ -349,7 +349,7 @@ export class TextInput extends FormElement {
349
349
  // TODO make this a formelement and have contactsearch set the root
350
350
  public render(): TemplateResult {
351
351
  const containerStyle = {
352
- height: `${this.textarea ? '100%' : 'auto'}`,
352
+ height: `${this.textarea ? '100%' : 'auto'}`
353
353
  };
354
354
 
355
355
  const clear =
@@ -45,7 +45,7 @@ export class Thumbnail extends RapidElement {
45
45
  @property({ type: Boolean })
46
46
  zooming = false;
47
47
 
48
- public handleClick(evt: MouseEvent) {
48
+ public handleClick() {
49
49
  window.setTimeout(() => {
50
50
  const lightbox = document.querySelector('temba-lightbox') as Lightbox;
51
51
  lightbox.showElement(this);
@@ -60,7 +60,7 @@ export class Thumbnail extends RapidElement {
60
60
  style=${styleMap({
61
61
  background: 'red',
62
62
  borderRadius: '0',
63
- boxShadow: 'var(--widget-box-shadow)',
63
+ boxShadow: 'var(--widget-box-shadow)'
64
64
  })}
65
65
  >
66
66
  <div
@@ -79,7 +79,7 @@ export class Thumbnail extends RapidElement {
79
79
  alignItems: 'center',
80
80
  justifyContent: 'center',
81
81
  fontWeight: '400',
82
- color: '#bbb',
82
+ color: '#bbb'
83
83
  })}
84
84
  >
85
85
  ${this.label}
@@ -92,7 +92,7 @@ export class Thumbnail extends RapidElement {
92
92
  padding: 'var(--thumb-padding, 0.4em)',
93
93
  background: '#fff',
94
94
  borderRadius: 'var(--curvature)',
95
- boxShadow: 'var(--widget-box-shadow)',
95
+ boxShadow: 'var(--widget-box-shadow)'
96
96
  })}">
97
97
 
98
98
  <div class="thumb" style=${styleMap({
@@ -108,7 +108,7 @@ export class Thumbnail extends RapidElement {
108
108
  alignItems: 'center',
109
109
  justifyContent: 'center',
110
110
  fontWeight: '400',
111
- color: '#bbb',
111
+ color: '#bbb'
112
112
  })}>
113
113
  ${this.label}
114
114
  </div>
package/src/tip/Tip.ts CHANGED
@@ -169,12 +169,12 @@ export class Tip extends RapidElement {
169
169
  public render(): TemplateResult {
170
170
  const tipStyle: any = {
171
171
  top: this.top ? `${this.top}px` : '0px',
172
- left: this.left ? `${this.left}px` : '0px',
172
+ left: this.left ? `${this.left}px` : '0px'
173
173
  };
174
174
 
175
175
  const arrowStyle: any = {
176
176
  top: this.arrowTop ? `${this.arrowTop}px` : '0px',
177
- left: this.arrowLeft ? `${this.arrowLeft}px` : '0px',
177
+ left: this.arrowLeft ? `${this.arrowLeft}px` : '0px'
178
178
  };
179
179
 
180
180
  if (this.width) {
@@ -185,7 +185,7 @@ export class Tip extends RapidElement {
185
185
  tip: true,
186
186
  show: this.visible,
187
187
  top: this.poppedTop,
188
- 'hide-on-change': this.hideOnChange,
188
+ 'hide-on-change': this.hideOnChange
189
189
  });
190
190
 
191
191
  return html`