solid-ui 2.4.24 → 2.4.25

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 (248) hide show
  1. package/LICENSE.md +0 -0
  2. package/README.md +0 -0
  3. package/dist/index.html +0 -0
  4. package/dist/main.js +50483 -50370
  5. package/dist/main.js.map +1 -1
  6. package/lib/acl/access-controller.d.ts +0 -0
  7. package/lib/acl/access-controller.d.ts.map +0 -0
  8. package/lib/acl/access-controller.js +90 -98
  9. package/lib/acl/access-controller.js.map +1 -1
  10. package/lib/acl/access-groups.d.ts +0 -0
  11. package/lib/acl/access-groups.d.ts.map +0 -0
  12. package/lib/acl/access-groups.js +82 -90
  13. package/lib/acl/access-groups.js.map +1 -1
  14. package/lib/acl/acl-control.d.ts +0 -0
  15. package/lib/acl/acl-control.d.ts.map +0 -0
  16. package/lib/acl/acl-control.js +50 -54
  17. package/lib/acl/acl-control.js.map +1 -1
  18. package/lib/acl/acl.d.ts +3 -3
  19. package/lib/acl/acl.d.ts.map +1 -1
  20. package/lib/acl/acl.js +13 -15
  21. package/lib/acl/acl.js.map +1 -1
  22. package/lib/acl/add-agent-buttons.d.ts +0 -0
  23. package/lib/acl/add-agent-buttons.d.ts.map +0 -0
  24. package/lib/acl/add-agent-buttons.js +142 -154
  25. package/lib/acl/add-agent-buttons.js.map +1 -1
  26. package/lib/acl/index.d.ts +0 -0
  27. package/lib/acl/index.d.ts.map +0 -0
  28. package/lib/acl/index.js +0 -0
  29. package/lib/acl/index.js.map +0 -0
  30. package/lib/acl/styles.d.ts +0 -0
  31. package/lib/acl/styles.d.ts.map +0 -0
  32. package/lib/acl/styles.js +0 -0
  33. package/lib/acl/styles.js.map +0 -0
  34. package/lib/acl/types.d.ts +6 -6
  35. package/lib/acl/types.d.ts.map +1 -1
  36. package/lib/acl/types.js +0 -0
  37. package/lib/acl/types.js.map +0 -0
  38. package/lib/chat/bookmarks.js +181 -191
  39. package/lib/chat/bookmarks.js.map +1 -1
  40. package/lib/chat/chatLogic.js +96 -104
  41. package/lib/chat/chatLogic.js.map +1 -1
  42. package/lib/chat/dateFolder.js +232 -224
  43. package/lib/chat/dateFolder.js.map +1 -1
  44. package/lib/chat/infinite.js +634 -658
  45. package/lib/chat/infinite.js.map +1 -1
  46. package/lib/chat/message.js +119 -131
  47. package/lib/chat/message.js.map +1 -1
  48. package/lib/chat/messageTools.js +106 -114
  49. package/lib/chat/messageTools.js.map +1 -1
  50. package/lib/chat/thread.js +16 -18
  51. package/lib/chat/thread.js.map +1 -1
  52. package/lib/create/create.d.ts +0 -0
  53. package/lib/create/create.d.ts.map +0 -0
  54. package/lib/create/create.js +0 -0
  55. package/lib/create/create.js.map +0 -0
  56. package/lib/create/index.d.ts +0 -0
  57. package/lib/create/index.d.ts.map +0 -0
  58. package/lib/create/index.js +0 -0
  59. package/lib/create/index.js.map +0 -0
  60. package/lib/create/types.d.ts +1 -1
  61. package/lib/create/types.d.ts.map +1 -1
  62. package/lib/create/types.js +0 -0
  63. package/lib/create/types.js.map +0 -0
  64. package/lib/debug.d.ts +0 -0
  65. package/lib/debug.d.ts.map +0 -0
  66. package/lib/debug.js +0 -0
  67. package/lib/debug.js.map +0 -0
  68. package/lib/folders.js +0 -0
  69. package/lib/folders.js.map +0 -0
  70. package/lib/footer/index.d.ts +1 -1
  71. package/lib/footer/index.d.ts.map +1 -1
  72. package/lib/footer/index.js +33 -37
  73. package/lib/footer/index.js.map +1 -1
  74. package/lib/footer/styleMap.d.ts +0 -0
  75. package/lib/footer/styleMap.d.ts.map +0 -0
  76. package/lib/footer/styleMap.js +0 -0
  77. package/lib/footer/styleMap.js.map +0 -0
  78. package/lib/header/empty-profile.d.ts +0 -0
  79. package/lib/header/empty-profile.d.ts.map +0 -0
  80. package/lib/header/empty-profile.js +0 -0
  81. package/lib/header/empty-profile.js.map +0 -0
  82. package/lib/header/index.d.ts +4 -4
  83. package/lib/header/index.d.ts.map +1 -1
  84. package/lib/header/index.js +126 -134
  85. package/lib/header/index.js.map +1 -1
  86. package/lib/header/styleMap.d.ts +0 -0
  87. package/lib/header/styleMap.d.ts.map +0 -0
  88. package/lib/header/styleMap.js +0 -0
  89. package/lib/header/styleMap.js.map +0 -0
  90. package/lib/iconBase.d.ts +0 -0
  91. package/lib/iconBase.d.ts.map +0 -0
  92. package/lib/iconBase.js +0 -0
  93. package/lib/iconBase.js.map +0 -0
  94. package/lib/icons/solid_logo.d.ts +0 -0
  95. package/lib/icons/solid_logo.d.ts.map +0 -0
  96. package/lib/icons/solid_logo.js +0 -0
  97. package/lib/icons/solid_logo.js.map +0 -0
  98. package/lib/index.d.ts +0 -0
  99. package/lib/index.d.ts.map +0 -0
  100. package/lib/index.js +0 -0
  101. package/lib/index.js.map +0 -0
  102. package/lib/jss/index.d.ts +0 -0
  103. package/lib/jss/index.d.ts.map +0 -0
  104. package/lib/jss/index.js +0 -0
  105. package/lib/jss/index.js.map +0 -0
  106. package/lib/log.d.ts +0 -0
  107. package/lib/log.d.ts.map +0 -0
  108. package/lib/log.js +0 -0
  109. package/lib/log.js.map +0 -0
  110. package/lib/login/login.d.ts +0 -0
  111. package/lib/login/login.d.ts.map +0 -0
  112. package/lib/login/login.js +470 -470
  113. package/lib/login/login.js.map +1 -1
  114. package/lib/matrix/index.d.ts +0 -0
  115. package/lib/matrix/index.d.ts.map +0 -0
  116. package/lib/matrix/index.js +0 -0
  117. package/lib/matrix/index.js.map +0 -0
  118. package/lib/matrix/matrix.d.ts +0 -0
  119. package/lib/matrix/matrix.d.ts.map +0 -0
  120. package/lib/matrix/matrix.js +0 -0
  121. package/lib/matrix/matrix.js.map +0 -0
  122. package/lib/matrix/types.d.ts +1 -1
  123. package/lib/matrix/types.d.ts.map +1 -1
  124. package/lib/matrix/types.js +0 -0
  125. package/lib/matrix/types.js.map +0 -0
  126. package/lib/media/index.d.ts +0 -0
  127. package/lib/media/index.d.ts.map +0 -0
  128. package/lib/media/index.js +0 -0
  129. package/lib/media/index.js.map +0 -0
  130. package/lib/media/media-capture.d.ts +0 -0
  131. package/lib/media/media-capture.d.ts.map +0 -0
  132. package/lib/media/media-capture.js +8 -10
  133. package/lib/media/media-capture.js.map +1 -1
  134. package/lib/messageArea.js +0 -0
  135. package/lib/messageArea.js.map +0 -0
  136. package/lib/noun_Camera_1618446_000000.js +0 -0
  137. package/lib/noun_Camera_1618446_000000.js.map +0 -0
  138. package/lib/ns.js +0 -0
  139. package/lib/ns.js.map +0 -0
  140. package/lib/pad.d.ts +1 -1
  141. package/lib/pad.d.ts.map +1 -1
  142. package/lib/pad.js +0 -0
  143. package/lib/pad.js.map +0 -0
  144. package/lib/participation.d.ts +1 -1
  145. package/lib/participation.d.ts.map +1 -1
  146. package/lib/participation.js +1 -1
  147. package/lib/participation.js.map +0 -0
  148. package/lib/preferences.js +0 -0
  149. package/lib/preferences.js.map +0 -0
  150. package/lib/signup/config-default.js +0 -0
  151. package/lib/signup/config-default.js.map +0 -0
  152. package/lib/signup/signup.js +0 -0
  153. package/lib/signup/signup.js.map +0 -0
  154. package/lib/stories/decorators.js +0 -0
  155. package/lib/stories/decorators.js.map +0 -0
  156. package/lib/style.js +0 -0
  157. package/lib/style.js.map +0 -0
  158. package/lib/style_multiSelect.js +0 -0
  159. package/lib/style_multiSelect.js.map +0 -0
  160. package/lib/table.js +0 -0
  161. package/lib/table.js.map +0 -0
  162. package/lib/tabs.d.ts +1 -1
  163. package/lib/tabs.d.ts.map +1 -1
  164. package/lib/tabs.js +0 -0
  165. package/lib/tabs.js.map +0 -0
  166. package/lib/typings.d.js +0 -0
  167. package/lib/typings.d.js.map +0 -0
  168. package/lib/utils/headerFooterHelpers.d.ts +1 -1
  169. package/lib/utils/headerFooterHelpers.d.ts.map +1 -1
  170. package/lib/utils/headerFooterHelpers.js +78 -80
  171. package/lib/utils/headerFooterHelpers.js.map +1 -1
  172. package/lib/utils/index.js +2 -6
  173. package/lib/utils/index.js.map +1 -1
  174. package/lib/utils/label.d.ts +0 -0
  175. package/lib/utils/label.d.ts.map +0 -0
  176. package/lib/utils/label.js +0 -0
  177. package/lib/utils/label.js.map +0 -0
  178. package/lib/versionInfo.d.ts +0 -0
  179. package/lib/versionInfo.d.ts.map +0 -0
  180. package/lib/versionInfo.js +13 -13
  181. package/lib/versionInfo.js.map +1 -1
  182. package/lib/widgets/buttons/iconLinks.d.ts +0 -0
  183. package/lib/widgets/buttons/iconLinks.d.ts.map +0 -0
  184. package/lib/widgets/buttons/iconLinks.js +0 -0
  185. package/lib/widgets/buttons/iconLinks.js.map +0 -0
  186. package/lib/widgets/buttons.d.ts +5 -5
  187. package/lib/widgets/buttons.d.ts.map +1 -1
  188. package/lib/widgets/buttons.js +0 -0
  189. package/lib/widgets/buttons.js.map +0 -0
  190. package/lib/widgets/dragAndDrop.js +0 -0
  191. package/lib/widgets/dragAndDrop.js.map +0 -0
  192. package/lib/widgets/error.d.ts +0 -0
  193. package/lib/widgets/error.d.ts.map +0 -0
  194. package/lib/widgets/error.js +0 -0
  195. package/lib/widgets/error.js.map +0 -0
  196. package/lib/widgets/forms/autocomplete/autocompleteBar.d.ts +0 -0
  197. package/lib/widgets/forms/autocomplete/autocompleteBar.d.ts.map +0 -0
  198. package/lib/widgets/forms/autocomplete/autocompleteBar.js +217 -229
  199. package/lib/widgets/forms/autocomplete/autocompleteBar.js.map +1 -1
  200. package/lib/widgets/forms/autocomplete/autocompleteField.d.ts +0 -0
  201. package/lib/widgets/forms/autocomplete/autocompleteField.d.ts.map +0 -0
  202. package/lib/widgets/forms/autocomplete/autocompleteField.js +70 -74
  203. package/lib/widgets/forms/autocomplete/autocompleteField.js.map +1 -1
  204. package/lib/widgets/forms/autocomplete/autocompletePicker.d.ts +2 -2
  205. package/lib/widgets/forms/autocomplete/autocompletePicker.d.ts.map +1 -1
  206. package/lib/widgets/forms/autocomplete/autocompletePicker.js +363 -379
  207. package/lib/widgets/forms/autocomplete/autocompletePicker.js.map +1 -1
  208. package/lib/widgets/forms/autocomplete/language.d.ts +0 -0
  209. package/lib/widgets/forms/autocomplete/language.d.ts.map +0 -0
  210. package/lib/widgets/forms/autocomplete/language.js +79 -83
  211. package/lib/widgets/forms/autocomplete/language.js.map +1 -1
  212. package/lib/widgets/forms/autocomplete/publicData.d.ts +2 -2
  213. package/lib/widgets/forms/autocomplete/publicData.d.ts.map +1 -1
  214. package/lib/widgets/forms/autocomplete/publicData.js +263 -281
  215. package/lib/widgets/forms/autocomplete/publicData.js.map +1 -1
  216. package/lib/widgets/forms/basic.d.ts +0 -0
  217. package/lib/widgets/forms/basic.d.ts.map +0 -0
  218. package/lib/widgets/forms/basic.js +0 -0
  219. package/lib/widgets/forms/basic.js.map +0 -0
  220. package/lib/widgets/forms/comment.d.ts +0 -0
  221. package/lib/widgets/forms/comment.d.ts.map +0 -0
  222. package/lib/widgets/forms/comment.js +0 -0
  223. package/lib/widgets/forms/comment.js.map +0 -0
  224. package/lib/widgets/forms/fieldFunction.d.ts +1 -1
  225. package/lib/widgets/forms/fieldFunction.d.ts.map +1 -1
  226. package/lib/widgets/forms/fieldFunction.js +1 -3
  227. package/lib/widgets/forms/fieldFunction.js.map +1 -1
  228. package/lib/widgets/forms/fieldParams.d.ts +1 -1
  229. package/lib/widgets/forms/fieldParams.d.ts.map +1 -1
  230. package/lib/widgets/forms/fieldParams.js +0 -0
  231. package/lib/widgets/forms/fieldParams.js.map +0 -0
  232. package/lib/widgets/forms/formStyle.d.ts +0 -0
  233. package/lib/widgets/forms/formStyle.d.ts.map +0 -0
  234. package/lib/widgets/forms/formStyle.js +0 -0
  235. package/lib/widgets/forms/formStyle.js.map +0 -0
  236. package/lib/widgets/forms.js +197 -225
  237. package/lib/widgets/forms.js.map +1 -1
  238. package/lib/widgets/index.js +0 -0
  239. package/lib/widgets/index.js.map +0 -0
  240. package/lib/widgets/multiSelect.js +4 -4
  241. package/lib/widgets/multiSelect.js.map +1 -1
  242. package/lib/widgets/peoplePicker.js +0 -0
  243. package/lib/widgets/peoplePicker.js.map +0 -0
  244. package/lib/widgets/widgetHelpers.d.ts +0 -0
  245. package/lib/widgets/widgetHelpers.d.ts.map +0 -0
  246. package/lib/widgets/widgetHelpers.js +0 -0
  247. package/lib/widgets/widgetHelpers.js.map +0 -0
  248. package/package.json +34 -31
@@ -19,7 +19,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
19
19
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
20
20
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
21
21
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
22
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
22
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
23
23
  var AUTOCOMPLETE_THRESHOLD = 4; // don't check until this many characters typed
24
24
  var AUTOCOMPLETE_ROWS = 20; // 20?
25
25
  var AUTOCOMPLETE_ROWS_STRETCH = 40;
@@ -50,398 +50,382 @@ function _renderAutoComplete() {
50
50
  _renderAutoComplete = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(dom, acOptions, decoration, callback) {
51
51
  var complain, finish, gotIt, _gotIt, acceptButtonHandler, _acceptButtonHandler, cancelButtonHandler, _cancelButtonHandler, nameMatch, clearList, inputEventHHandler, _inputEventHHandler, loadBindingsAndFilterByLanguage, _loadBindingsAndFilterByLanguage, filterByName, refreshList, _refreshList, initialize, targetClass, lastBindings, loadedEnough, inputEventHandlerLock, allDisplayed, lastFilter, numberOfRows, div, foundName, foundObject, table, head, cell, searchInput, size, searchInputStyle;
52
52
  return _regenerator["default"].wrap(function _callee8$(_context8) {
53
- while (1) {
54
- switch (_context8.prev = _context8.next) {
55
- case 0:
56
- initialize = function _initialize() {
57
- if (acOptions.currentObject) {
58
- // If have existing value then jump into the endgame of the autocomplete
59
- searchInput.value = acOptions.currentName ? acOptions.currentName.value : '??? wot no name for ' + acOptions.currentObject;
60
- foundName = acOptions.currentName;
61
- lastFilter = acOptions.currentName ? acOptions.currentName.value : undefined;
62
- foundObject = acOptions.currentObject;
63
- } else {
64
- searchInput.value = '';
65
- lastFilter = undefined;
66
- foundObject = undefined;
67
- }
68
- if (decoration.deleteButton) {
69
- setVisible(decoration.deleteButton, !!acOptions.currentObject);
70
- }
71
- if (decoration.acceptButton) {
72
- setVisible(decoration.acceptButton, false); // hide until input complete
73
- }
53
+ while (1) switch (_context8.prev = _context8.next) {
54
+ case 0:
55
+ initialize = function _initialize() {
56
+ if (acOptions.currentObject) {
57
+ // If have existing value then jump into the endgame of the autocomplete
58
+ searchInput.value = acOptions.currentName ? acOptions.currentName.value : '??? wot no name for ' + acOptions.currentObject;
59
+ foundName = acOptions.currentName;
60
+ lastFilter = acOptions.currentName ? acOptions.currentName.value : undefined;
61
+ foundObject = acOptions.currentObject;
62
+ } else {
63
+ searchInput.value = '';
64
+ lastFilter = undefined;
65
+ foundObject = undefined;
66
+ }
67
+ if (decoration.deleteButton) {
68
+ setVisible(decoration.deleteButton, !!acOptions.currentObject);
69
+ }
70
+ if (decoration.acceptButton) {
71
+ setVisible(decoration.acceptButton, false); // hide until input complete
72
+ }
74
73
 
75
- if (decoration.editButton) {
76
- setVisible(decoration.editButton, true);
77
- }
78
- if (decoration.cancelButton) {
79
- setVisible(decoration.cancelButton, false); // only allow cancel when there is something to cancel
80
- }
74
+ if (decoration.editButton) {
75
+ setVisible(decoration.editButton, true);
76
+ }
77
+ if (decoration.cancelButton) {
78
+ setVisible(decoration.cancelButton, false); // only allow cancel when there is something to cancel
79
+ }
81
80
 
82
- inputEventHandlerLock = false;
83
- clearList();
84
- };
85
- _refreshList = function _refreshList3() {
86
- _refreshList = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
87
- var rowForBinding, compareBindingsByName, languagePrefs, filter, slimmed, displayable, _iterator, _step, binding;
88
- return _regenerator["default"].wrap(function _callee7$(_context7) {
89
- while (1) {
90
- switch (_context7.prev = _context7.next) {
91
- case 0:
92
- compareBindingsByName = function _compareBindingsByNam(self, other) {
93
- return other.name.value > self.name.value ? 1 : other.name.name < self.name.value ? -1 : 0;
94
- };
95
- rowForBinding = function _rowForBinding(binding) {
96
- var row = dom.createElement('tr');
97
- style.setStyle(row, 'autocompleteRowStyle');
98
- row.setAttribute('style', 'padding: 0.3em;');
99
- row.style.color = allDisplayed ? '#080' : '#088'; // green means 'you should find it here'
100
- row.textContent = binding.name.value;
101
- var object = (0, _publicData.bindingToTerm)(binding.subject);
102
- var nameTerm = (0, _publicData.bindingToTerm)(binding.name);
103
- row.addEventListener('click', /*#__PURE__*/function () {
104
- var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(_event) {
105
- return _regenerator["default"].wrap(function _callee6$(_context6) {
106
- while (1) {
107
- switch (_context6.prev = _context6.next) {
108
- case 0:
109
- debug.log(' click row textContent: ' + row.textContent);
110
- debug.log(' click name: ' + nameTerm.value);
111
- if (object && nameTerm) {
112
- gotIt(object, nameTerm);
113
- }
114
- case 3:
115
- case "end":
116
- return _context6.stop();
117
- }
81
+ inputEventHandlerLock = false;
82
+ clearList();
83
+ };
84
+ _refreshList = function _refreshList3() {
85
+ _refreshList = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
86
+ var rowForBinding, compareBindingsByName, languagePrefs, filter, slimmed, displayable, _iterator, _step, binding;
87
+ return _regenerator["default"].wrap(function _callee7$(_context7) {
88
+ while (1) switch (_context7.prev = _context7.next) {
89
+ case 0:
90
+ compareBindingsByName = function _compareBindingsByNam(self, other) {
91
+ return other.name.value > self.name.value ? 1 : other.name.name < self.name.value ? -1 : 0;
92
+ };
93
+ rowForBinding = function _rowForBinding(binding) {
94
+ var row = dom.createElement('tr');
95
+ style.setStyle(row, 'autocompleteRowStyle');
96
+ row.setAttribute('style', 'padding: 0.3em;');
97
+ row.style.color = allDisplayed ? '#080' : '#088'; // green means 'you should find it here'
98
+ row.textContent = binding.name.value;
99
+ var object = (0, _publicData.bindingToTerm)(binding.subject);
100
+ var nameTerm = (0, _publicData.bindingToTerm)(binding.name);
101
+ row.addEventListener('click', /*#__PURE__*/function () {
102
+ var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(_event) {
103
+ return _regenerator["default"].wrap(function _callee6$(_context6) {
104
+ while (1) switch (_context6.prev = _context6.next) {
105
+ case 0:
106
+ debug.log(' click row textContent: ' + row.textContent);
107
+ debug.log(' click name: ' + nameTerm.value);
108
+ if (object && nameTerm) {
109
+ gotIt(object, nameTerm);
118
110
  }
119
- }, _callee6);
120
- }));
121
- return function (_x12) {
122
- return _ref.apply(this, arguments);
123
- };
124
- }());
125
- return row;
111
+ case 3:
112
+ case "end":
113
+ return _context6.stop();
114
+ }
115
+ }, _callee6);
116
+ }));
117
+ return function (_x12) {
118
+ return _ref.apply(this, arguments);
126
119
  };
127
- if (!inputEventHandlerLock) {
128
- _context7.next = 5;
129
- break;
130
- }
131
- debug.log("Ignoring \"".concat(searchInput.value, "\" because of lock "));
132
- return _context7.abrupt("return");
133
- case 5:
134
- debug.log("Setting lock at \"".concat(searchInput.value, "\""));
135
- inputEventHandlerLock = true;
136
- _context7.next = 9;
137
- return (0, _language.getPreferredLanguages)();
138
- case 9:
139
- languagePrefs = _context7.sent;
140
- filter = searchInput.value.trim().toLowerCase();
141
- if (!(filter.length < AUTOCOMPLETE_THRESHOLD)) {
142
- _context7.next = 16;
143
- break;
144
- }
145
- // too small
146
- clearList();
147
- // candidatesLoaded = false
148
- numberOfRows = AUTOCOMPLETE_ROWS;
149
- _context7.next = 31;
150
- break;
151
- case 16:
152
- if (!(!allDisplayed || !lastFilter || !filter.startsWith(lastFilter))) {
153
- _context7.next = 21;
154
- break;
155
- }
156
- debug.log(" Querying database at \"".concat(filter, "\" cf last \"").concat(lastFilter, "\"."));
157
- _context7.next = 20;
158
- return loadBindingsAndFilterByLanguage(filter, languagePrefs);
159
- case 20:
160
- lastBindings = _context7.sent;
161
- case 21:
162
- // Trim table as search gets tighter:
163
- slimmed = filterByName(filter, lastBindings);
164
- if (loadedEnough && slimmed.length <= AUTOCOMPLETE_ROWS_STRETCH) {
165
- numberOfRows = slimmed.length; // stretch if it means we get all items
166
- }
167
-
168
- allDisplayed = loadedEnough && slimmed.length <= numberOfRows;
169
- debug.log(" Filter:\"".concat(filter, "\" lastBindings: ").concat(lastBindings.length, ", slimmed to ").concat(slimmed.length, "; rows: ").concat(numberOfRows, ", Enough? ").concat(loadedEnough, ", All displayed? ").concat(allDisplayed));
170
- displayable = slimmed.slice(0, numberOfRows);
171
- displayable.sort(compareBindingsByName);
172
- clearList();
173
- _iterator = _createForOfIteratorHelper(displayable);
174
- try {
175
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
176
- binding = _step.value;
177
- table.appendChild(rowForBinding(binding));
178
- }
179
- } catch (err) {
180
- _iterator.e(err);
181
- } finally {
182
- _iterator.f();
183
- }
184
- if (slimmed.length === 1) {
185
- gotIt((0, _publicData.bindingToTerm)(slimmed[0].subject), (0, _publicData.bindingToTerm)(slimmed[0].name));
186
- }
187
- case 31:
188
- // else
189
- inputEventHandlerLock = false;
190
- case 32:
191
- case "end":
192
- return _context7.stop();
120
+ }());
121
+ return row;
122
+ };
123
+ if (!inputEventHandlerLock) {
124
+ _context7.next = 5;
125
+ break;
193
126
  }
194
- }
195
- }, _callee7);
196
- }));
197
- return _refreshList.apply(this, arguments);
198
- };
199
- refreshList = function _refreshList2() {
200
- return _refreshList.apply(this, arguments);
201
- };
202
- filterByName = function _filterByName(filter, bindings) {
203
- return bindings.filter(function (binding) {
204
- return nameMatch(filter, binding.name.value);
205
- });
206
- };
207
- _loadBindingsAndFilterByLanguage = function _loadBindingsAndFilte2() {
208
- _loadBindingsAndFilterByLanguage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(filter, languagePrefs) {
209
- var bindings, slimmed;
210
- return _regenerator["default"].wrap(function _callee5$(_context5) {
211
- while (1) {
212
- switch (_context5.prev = _context5.next) {
213
- case 0:
214
- _context5.prev = 0;
215
- _context5.next = 3;
216
- return (0, _publicData.queryPublicDataByName)(filter, targetClass, languagePrefs || _language.defaultPreferredLanguages, acOptions.queryParams);
217
- case 3:
218
- bindings = _context5.sent;
219
- _context5.next = 11;
220
- break;
221
- case 6:
222
- _context5.prev = 6;
223
- _context5.t0 = _context5["catch"](0);
224
- complain('Error querying db of organizations: ' + _context5.t0);
225
- inputEventHandlerLock = false;
226
- return _context5.abrupt("return");
227
- case 11:
228
- loadedEnough = bindings.length < _publicData.AUTOCOMPLETE_LIMIT;
229
- if (loadedEnough) {
230
- lastFilter = filter;
231
- } else {
232
- lastFilter = undefined;
233
- }
234
- clearList();
235
- slimmed = (0, _language.filterByLanguage)(bindings, languagePrefs);
236
- return _context5.abrupt("return", slimmed);
237
- case 16:
238
- case "end":
239
- return _context5.stop();
127
+ debug.log("Ignoring \"".concat(searchInput.value, "\" because of lock "));
128
+ return _context7.abrupt("return");
129
+ case 5:
130
+ debug.log("Setting lock at \"".concat(searchInput.value, "\""));
131
+ inputEventHandlerLock = true;
132
+ _context7.next = 9;
133
+ return (0, _language.getPreferredLanguages)();
134
+ case 9:
135
+ languagePrefs = _context7.sent;
136
+ filter = searchInput.value.trim().toLowerCase();
137
+ if (!(filter.length < AUTOCOMPLETE_THRESHOLD)) {
138
+ _context7.next = 16;
139
+ break;
240
140
  }
241
- }
242
- }, _callee5, null, [[0, 6]]);
243
- }));
244
- return _loadBindingsAndFilterByLanguage.apply(this, arguments);
245
- };
246
- loadBindingsAndFilterByLanguage = function _loadBindingsAndFilte(_x10, _x11) {
247
- return _loadBindingsAndFilterByLanguage.apply(this, arguments);
248
- };
249
- _inputEventHHandler = function _inputEventHHandler3() {
250
- _inputEventHHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(_event) {
251
- return _regenerator["default"].wrap(function _callee4$(_context4) {
252
- while (1) {
253
- switch (_context4.prev = _context4.next) {
254
- case 0:
255
- // console.log('@@ AC inputEventHHandler called')
256
- setVisible(decoration.cancelButton, true); // only allow cancel when there is something to cancel
257
- refreshList(); /// @@ debounqce does not work with jest
258
- /*
259
- if (runningTimeout) {
260
- clearTimeout(runningTimeout)
261
- }
262
- runningTimeout = setTimeout(refreshList, AUTOCOMPLETE_DEBOUNCE_MS)
263
- */
264
- case 2:
265
- case "end":
266
- return _context4.stop();
141
+ // too small
142
+ clearList();
143
+ // candidatesLoaded = false
144
+ numberOfRows = AUTOCOMPLETE_ROWS;
145
+ _context7.next = 31;
146
+ break;
147
+ case 16:
148
+ if (!(!allDisplayed || !lastFilter || !filter.startsWith(lastFilter))) {
149
+ _context7.next = 21;
150
+ break;
267
151
  }
268
- }
269
- }, _callee4);
270
- }));
271
- return _inputEventHHandler.apply(this, arguments);
272
- };
273
- inputEventHHandler = function _inputEventHHandler2(_x9) {
274
- return _inputEventHHandler.apply(this, arguments);
275
- };
276
- clearList = function _clearList() {
277
- while (table.children.length > 1) {
278
- table.removeChild(table.lastChild);
279
- }
280
- };
281
- nameMatch = function _nameMatch(filter, candidate) {
282
- var parts = filter.split(' '); // Each name part must be somewhere
283
- for (var j = 0; j < parts.length; j++) {
284
- var word = parts[j];
285
- if (candidate.toLowerCase().indexOf(word) < 0) return false;
286
- }
287
- return true;
288
- };
289
- _cancelButtonHandler = function _cancelButtonHandler3() {
290
- _cancelButtonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(_event) {
291
- return _regenerator["default"].wrap(function _callee3$(_context3) {
292
- while (1) {
293
- switch (_context3.prev = _context3.next) {
294
- case 0:
295
- debug.log('Auto complete: Canceled by user! ');
296
- if (acOptions.permanent) {
297
- initialize();
298
- } else {
299
- if (div.parentNode) {
300
- div.parentNode.removeChild(div);
301
- }
302
- }
303
- case 2:
304
- case "end":
305
- return _context3.stop();
152
+ debug.log(" Querying database at \"".concat(filter, "\" cf last \"").concat(lastFilter, "\"."));
153
+ _context7.next = 20;
154
+ return loadBindingsAndFilterByLanguage(filter, languagePrefs);
155
+ case 20:
156
+ lastBindings = _context7.sent;
157
+ case 21:
158
+ // Trim table as search gets tighter:
159
+ slimmed = filterByName(filter, lastBindings);
160
+ if (loadedEnough && slimmed.length <= AUTOCOMPLETE_ROWS_STRETCH) {
161
+ numberOfRows = slimmed.length; // stretch if it means we get all items
306
162
  }
307
- }
308
- }, _callee3);
309
- }));
310
- return _cancelButtonHandler.apply(this, arguments);
311
- };
312
- cancelButtonHandler = function _cancelButtonHandler2(_x8) {
313
- return _cancelButtonHandler.apply(this, arguments);
314
- };
315
- _acceptButtonHandler = function _acceptButtonHandler3() {
316
- _acceptButtonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(_event) {
317
- return _regenerator["default"].wrap(function _callee2$(_context2) {
318
- while (1) {
319
- switch (_context2.prev = _context2.next) {
320
- case 0:
321
- if (foundName && searchInput.value === foundName.value) {
322
- // still
323
- finish(foundObject, foundName);
324
- }
325
- case 1:
326
- case "end":
327
- return _context2.stop();
163
+
164
+ allDisplayed = loadedEnough && slimmed.length <= numberOfRows;
165
+ debug.log(" Filter:\"".concat(filter, "\" lastBindings: ").concat(lastBindings.length, ", slimmed to ").concat(slimmed.length, "; rows: ").concat(numberOfRows, ", Enough? ").concat(loadedEnough, ", All displayed? ").concat(allDisplayed));
166
+ displayable = slimmed.slice(0, numberOfRows);
167
+ displayable.sort(compareBindingsByName);
168
+ clearList();
169
+ _iterator = _createForOfIteratorHelper(displayable);
170
+ try {
171
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
172
+ binding = _step.value;
173
+ table.appendChild(rowForBinding(binding));
174
+ }
175
+ } catch (err) {
176
+ _iterator.e(err);
177
+ } finally {
178
+ _iterator.f();
179
+ }
180
+ if (slimmed.length === 1) {
181
+ gotIt((0, _publicData.bindingToTerm)(slimmed[0].subject), (0, _publicData.bindingToTerm)(slimmed[0].name));
182
+ }
183
+ case 31:
184
+ // else
185
+ inputEventHandlerLock = false;
186
+ case 32:
187
+ case "end":
188
+ return _context7.stop();
189
+ }
190
+ }, _callee7);
191
+ }));
192
+ return _refreshList.apply(this, arguments);
193
+ };
194
+ refreshList = function _refreshList2() {
195
+ return _refreshList.apply(this, arguments);
196
+ };
197
+ filterByName = function _filterByName(filter, bindings) {
198
+ return bindings.filter(function (binding) {
199
+ return nameMatch(filter, binding.name.value);
200
+ });
201
+ };
202
+ _loadBindingsAndFilterByLanguage = function _loadBindingsAndFilte2() {
203
+ _loadBindingsAndFilterByLanguage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(filter, languagePrefs) {
204
+ var bindings, slimmed;
205
+ return _regenerator["default"].wrap(function _callee5$(_context5) {
206
+ while (1) switch (_context5.prev = _context5.next) {
207
+ case 0:
208
+ _context5.prev = 0;
209
+ _context5.next = 3;
210
+ return (0, _publicData.queryPublicDataByName)(filter, targetClass, languagePrefs || _language.defaultPreferredLanguages, acOptions.queryParams);
211
+ case 3:
212
+ bindings = _context5.sent;
213
+ _context5.next = 11;
214
+ break;
215
+ case 6:
216
+ _context5.prev = 6;
217
+ _context5.t0 = _context5["catch"](0);
218
+ complain('Error querying db of organizations: ' + _context5.t0);
219
+ inputEventHandlerLock = false;
220
+ return _context5.abrupt("return");
221
+ case 11:
222
+ loadedEnough = bindings.length < _publicData.AUTOCOMPLETE_LIMIT;
223
+ if (loadedEnough) {
224
+ lastFilter = filter;
225
+ } else {
226
+ lastFilter = undefined;
328
227
  }
329
- }
330
- }, _callee2);
331
- }));
332
- return _acceptButtonHandler.apply(this, arguments);
333
- };
334
- acceptButtonHandler = function _acceptButtonHandler2(_x7) {
335
- return _acceptButtonHandler.apply(this, arguments);
336
- };
337
- _gotIt = function _gotIt3() {
338
- _gotIt = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(object, name) {
339
- return _regenerator["default"].wrap(function _callee$(_context) {
340
- while (1) {
341
- switch (_context.prev = _context.next) {
342
- case 0:
343
- if (!decoration.acceptButton) {
344
- _context.next = 10;
345
- break;
346
- }
347
- decoration.acceptButton.disbaled = false;
348
- setVisible(decoration.acceptButton, true); // now wait for confirmation
349
- searchInput.value = name.value; // complete it
350
- foundName = name;
351
- foundObject = object;
352
- debug.log('Auto complete: name: ' + name);
353
- debug.log('Auto complete: waiting for accept ' + object);
354
- clearList(); // This may be an option - nice and clean but does not allow change of mind
355
- return _context.abrupt("return");
356
- case 10:
357
- setVisible(decoration.cancelButton, true);
358
- finish(object, name);
359
- case 12:
360
- case "end":
361
- return _context.stop();
228
+ clearList();
229
+ slimmed = (0, _language.filterByLanguage)(bindings, languagePrefs);
230
+ return _context5.abrupt("return", slimmed);
231
+ case 16:
232
+ case "end":
233
+ return _context5.stop();
234
+ }
235
+ }, _callee5, null, [[0, 6]]);
236
+ }));
237
+ return _loadBindingsAndFilterByLanguage.apply(this, arguments);
238
+ };
239
+ loadBindingsAndFilterByLanguage = function _loadBindingsAndFilte(_x10, _x11) {
240
+ return _loadBindingsAndFilterByLanguage.apply(this, arguments);
241
+ };
242
+ _inputEventHHandler = function _inputEventHHandler3() {
243
+ _inputEventHHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(_event) {
244
+ return _regenerator["default"].wrap(function _callee4$(_context4) {
245
+ while (1) switch (_context4.prev = _context4.next) {
246
+ case 0:
247
+ // console.log('@@ AC inputEventHHandler called')
248
+ setVisible(decoration.cancelButton, true); // only allow cancel when there is something to cancel
249
+ refreshList(); /// @@ debounqce does not work with jest
250
+ /*
251
+ if (runningTimeout) {
252
+ clearTimeout(runningTimeout)
362
253
  }
363
- }
364
- }, _callee);
365
- }));
366
- return _gotIt.apply(this, arguments);
367
- };
368
- gotIt = function _gotIt2(_x5, _x6) {
369
- return _gotIt.apply(this, arguments);
370
- };
371
- finish = function _finish(object, name) {
372
- debug.log('Auto complete: finish! ' + object);
373
- if (object.termType === 'Literal' && acOptions.queryParams.objectURIBase) {
374
- object = _solidLogic.store.sym(acOptions.queryParams.objectURIBase.value + object.value);
375
- }
376
- // remove(decoration.cancelButton)
377
- // remove(decoration.acceptButton)
378
- // remove(div)
379
- clearList();
380
- callback(object, name);
381
- };
382
- complain = function _complain(message) {
383
- var errorRow = table.appendChild(dom.createElement('tr'));
384
- debug.log(message);
385
- var err = new Error(message);
386
- errorRow.appendChild(widgets.errorMessageBlock(dom, err, 'pink'));
387
- // errorMessageBlock will log the stack to the console
388
- style.setStyle(errorRow, 'autocompleteRowStyle');
389
- errorRow.style.padding = '1em';
390
- };
391
- // initialiize
392
- // const queryParams: QueryParameters = acOptions.queryParams
393
- targetClass = acOptions.targetClass;
394
- if (targetClass) {
395
- _context8.next = 21;
396
- break;
254
+ runningTimeout = setTimeout(refreshList, AUTOCOMPLETE_DEBOUNCE_MS)
255
+ */
256
+ case 2:
257
+ case "end":
258
+ return _context4.stop();
259
+ }
260
+ }, _callee4);
261
+ }));
262
+ return _inputEventHHandler.apply(this, arguments);
263
+ };
264
+ inputEventHHandler = function _inputEventHHandler2(_x9) {
265
+ return _inputEventHHandler.apply(this, arguments);
266
+ };
267
+ clearList = function _clearList() {
268
+ while (table.children.length > 1) {
269
+ table.removeChild(table.lastChild);
397
270
  }
398
- throw new Error('renderAutoComplete: missing targetClass');
399
- case 21:
400
- // console.log(`renderAutoComplete: targetClass=${targetClass}` )
401
- if (decoration.acceptButton) {
402
- decoration.acceptButton.addEventListener('click', acceptButtonHandler, false);
271
+ };
272
+ nameMatch = function _nameMatch(filter, candidate) {
273
+ var parts = filter.split(' '); // Each name part must be somewhere
274
+ for (var j = 0; j < parts.length; j++) {
275
+ var word = parts[j];
276
+ if (candidate.toLowerCase().indexOf(word) < 0) return false;
403
277
  }
404
- if (decoration.cancelButton) {
405
- decoration.cancelButton.addEventListener('click', cancelButtonHandler, false);
278
+ return true;
279
+ };
280
+ _cancelButtonHandler = function _cancelButtonHandler3() {
281
+ _cancelButtonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(_event) {
282
+ return _regenerator["default"].wrap(function _callee3$(_context3) {
283
+ while (1) switch (_context3.prev = _context3.next) {
284
+ case 0:
285
+ debug.log('Auto complete: Canceled by user! ');
286
+ if (acOptions.permanent) {
287
+ initialize();
288
+ } else {
289
+ if (div.parentNode) {
290
+ div.parentNode.removeChild(div);
291
+ }
292
+ }
293
+ case 2:
294
+ case "end":
295
+ return _context3.stop();
296
+ }
297
+ }, _callee3);
298
+ }));
299
+ return _cancelButtonHandler.apply(this, arguments);
300
+ };
301
+ cancelButtonHandler = function _cancelButtonHandler2(_x8) {
302
+ return _cancelButtonHandler.apply(this, arguments);
303
+ };
304
+ _acceptButtonHandler = function _acceptButtonHandler3() {
305
+ _acceptButtonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(_event) {
306
+ return _regenerator["default"].wrap(function _callee2$(_context2) {
307
+ while (1) switch (_context2.prev = _context2.next) {
308
+ case 0:
309
+ if (foundName && searchInput.value === foundName.value) {
310
+ // still
311
+ finish(foundObject, foundName);
312
+ }
313
+ case 1:
314
+ case "end":
315
+ return _context2.stop();
316
+ }
317
+ }, _callee2);
318
+ }));
319
+ return _acceptButtonHandler.apply(this, arguments);
320
+ };
321
+ acceptButtonHandler = function _acceptButtonHandler2(_x7) {
322
+ return _acceptButtonHandler.apply(this, arguments);
323
+ };
324
+ _gotIt = function _gotIt3() {
325
+ _gotIt = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(object, name) {
326
+ return _regenerator["default"].wrap(function _callee$(_context) {
327
+ while (1) switch (_context.prev = _context.next) {
328
+ case 0:
329
+ if (!decoration.acceptButton) {
330
+ _context.next = 10;
331
+ break;
332
+ }
333
+ decoration.acceptButton.disbaled = false;
334
+ setVisible(decoration.acceptButton, true); // now wait for confirmation
335
+ searchInput.value = name.value; // complete it
336
+ foundName = name;
337
+ foundObject = object;
338
+ debug.log('Auto complete: name: ' + name);
339
+ debug.log('Auto complete: waiting for accept ' + object);
340
+ clearList(); // This may be an option - nice and clean but does not allow change of mind
341
+ return _context.abrupt("return");
342
+ case 10:
343
+ setVisible(decoration.cancelButton, true);
344
+ finish(object, name);
345
+ case 12:
346
+ case "end":
347
+ return _context.stop();
348
+ }
349
+ }, _callee);
350
+ }));
351
+ return _gotIt.apply(this, arguments);
352
+ };
353
+ gotIt = function _gotIt2(_x5, _x6) {
354
+ return _gotIt.apply(this, arguments);
355
+ };
356
+ finish = function _finish(object, name) {
357
+ debug.log('Auto complete: finish! ' + object);
358
+ if (object.termType === 'Literal' && acOptions.queryParams.objectURIBase) {
359
+ object = _solidLogic.store.sym(acOptions.queryParams.objectURIBase.value + object.value);
406
360
  }
361
+ // remove(decoration.cancelButton)
362
+ // remove(decoration.acceptButton)
363
+ // remove(div)
364
+ clearList();
365
+ callback(object, name);
366
+ };
367
+ complain = function _complain(message) {
368
+ var errorRow = table.appendChild(dom.createElement('tr'));
369
+ debug.log(message);
370
+ var err = new Error(message);
371
+ errorRow.appendChild(widgets.errorMessageBlock(dom, err, 'pink'));
372
+ // errorMessageBlock will log the stack to the console
373
+ style.setStyle(errorRow, 'autocompleteRowStyle');
374
+ errorRow.style.padding = '1em';
375
+ };
376
+ // initialiize
377
+ // const queryParams: QueryParameters = acOptions.queryParams
378
+ targetClass = acOptions.targetClass;
379
+ if (targetClass) {
380
+ _context8.next = 21;
381
+ break;
382
+ }
383
+ throw new Error('renderAutoComplete: missing targetClass');
384
+ case 21:
385
+ // console.log(`renderAutoComplete: targetClass=${targetClass}` )
386
+ if (decoration.acceptButton) {
387
+ decoration.acceptButton.addEventListener('click', acceptButtonHandler, false);
388
+ }
389
+ if (decoration.cancelButton) {
390
+ decoration.cancelButton.addEventListener('click', cancelButtonHandler, false);
391
+ }
407
392
 
408
- // var candidatesLoaded = false
409
- loadedEnough = false;
410
- inputEventHandlerLock = false;
411
- allDisplayed = false;
412
- lastFilter = undefined;
413
- numberOfRows = AUTOCOMPLETE_ROWS; // this gets slimmed down
414
- div = dom.createElement('div');
415
- foundName = undefined; // once found accepted string must match this
416
- foundObject = undefined;
417
- table = div.appendChild(dom.createElement('table'));
418
- table.setAttribute('data-testid', 'autocomplete-table');
419
- table.setAttribute('style', 'max-width: 30em; margin: 0.5em;');
420
- head = table.appendChild(dom.createElement('tr'));
421
- style.setStyle(head, 'autocompleteRowStyle'); // textInputStyle or
422
- cell = head.appendChild(dom.createElement('td'));
423
- searchInput = cell.appendChild(dom.createElement('input'));
424
- searchInput.setAttribute('type', 'text');
425
- initialize();
426
- size = acOptions.size || style.textInputSize || 20;
427
- searchInput.setAttribute('size', size);
428
- searchInput.setAttribute('data-testid', 'autocomplete-input');
429
- searchInputStyle = style.textInputStyle ||
430
- // searchInputStyle ?
431
- 'border: 0.1em solid #444; border-radius: 0.5em; width: 100%; font-size: 100%; padding: 0.1em 0.6em'; // @
432
- searchInput.setAttribute('style', searchInputStyle);
433
- searchInput.addEventListener('keyup', function (event) {
434
- if (event.keyCode === 13) {
435
- acceptButtonHandler(event);
436
- }
437
- }, false);
438
- searchInput.addEventListener('input', inputEventHHandler);
439
- // console.log('@@ renderAutoComplete returns ' + div.innerHTML)
440
- return _context8.abrupt("return", div);
441
- case 48:
442
- case "end":
443
- return _context8.stop();
444
- }
393
+ // var candidatesLoaded = false
394
+ loadedEnough = false;
395
+ inputEventHandlerLock = false;
396
+ allDisplayed = false;
397
+ lastFilter = undefined;
398
+ numberOfRows = AUTOCOMPLETE_ROWS; // this gets slimmed down
399
+ div = dom.createElement('div');
400
+ foundName = undefined; // once found accepted string must match this
401
+ foundObject = undefined;
402
+ table = div.appendChild(dom.createElement('table'));
403
+ table.setAttribute('data-testid', 'autocomplete-table');
404
+ table.setAttribute('style', 'max-width: 30em; margin: 0.5em;');
405
+ head = table.appendChild(dom.createElement('tr'));
406
+ style.setStyle(head, 'autocompleteRowStyle'); // textInputStyle or
407
+ cell = head.appendChild(dom.createElement('td'));
408
+ searchInput = cell.appendChild(dom.createElement('input'));
409
+ searchInput.setAttribute('type', 'text');
410
+ initialize();
411
+ size = acOptions.size || style.textInputSize || 20;
412
+ searchInput.setAttribute('size', size);
413
+ searchInput.setAttribute('data-testid', 'autocomplete-input');
414
+ searchInputStyle = style.textInputStyle ||
415
+ // searchInputStyle ?
416
+ 'border: 0.1em solid #444; border-radius: 0.5em; width: 100%; font-size: 100%; padding: 0.1em 0.6em'; // @
417
+ searchInput.setAttribute('style', searchInputStyle);
418
+ searchInput.addEventListener('keyup', function (event) {
419
+ if (event.keyCode === 13) {
420
+ acceptButtonHandler(event);
421
+ }
422
+ }, false);
423
+ searchInput.addEventListener('input', inputEventHHandler);
424
+ // console.log('@@ renderAutoComplete returns ' + div.innerHTML)
425
+ return _context8.abrupt("return", div);
426
+ case 48:
427
+ case "end":
428
+ return _context8.stop();
445
429
  }
446
430
  }, _callee8);
447
431
  }));