@leavittsoftware/web 1.0.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 (294) hide show
  1. package/leavitt/api-service/HttpError.d.ts +10 -0
  2. package/leavitt/api-service/HttpError.js +2 -0
  3. package/leavitt/api-service/HttpError.js.map +1 -0
  4. package/leavitt/api-service/api-service.d.ts +27 -0
  5. package/leavitt/api-service/api-service.js +332 -0
  6. package/leavitt/api-service/api-service.js.map +1 -0
  7. package/leavitt/api-service/api2-service.d.ts +338 -0
  8. package/leavitt/api-service/api2-service.js +17 -0
  9. package/leavitt/api-service/api2-service.js.map +1 -0
  10. package/leavitt/api-service/authenticated-token-provider.d.ts +5 -0
  11. package/leavitt/api-service/authenticated-token-provider.js +7 -0
  12. package/leavitt/api-service/authenticated-token-provider.js.map +1 -0
  13. package/leavitt/api-service/bearer-token-provider.d.ts +4 -0
  14. package/leavitt/api-service/bearer-token-provider.js +2 -0
  15. package/leavitt/api-service/bearer-token-provider.js.map +1 -0
  16. package/leavitt/api-service/mapi-service.d.ts +338 -0
  17. package/leavitt/api-service/mapi-service.js +17 -0
  18. package/leavitt/api-service/mapi-service.js.map +1 -0
  19. package/leavitt/api-service/no-authentication-token-provider.d.ts +5 -0
  20. package/leavitt/api-service/no-authentication-token-provider.js +6 -0
  21. package/leavitt/api-service/no-authentication-token-provider.js.map +1 -0
  22. package/leavitt/api-service/odata-dto.d.ts +6 -0
  23. package/leavitt/api-service/odata-dto.js +7 -0
  24. package/leavitt/api-service/odata-dto.js.map +1 -0
  25. package/leavitt/api-service/odata-model-info.d.ts +5 -0
  26. package/leavitt/api-service/odata-model-info.js +7 -0
  27. package/leavitt/api-service/odata-model-info.js.map +1 -0
  28. package/leavitt/api-service/odata-response.d.ts +15 -0
  29. package/leavitt/api-service/odata-response.js +50 -0
  30. package/leavitt/api-service/odata-response.js.map +1 -0
  31. package/leavitt/api-service/status-codes.d.ts +2 -0
  32. package/leavitt/api-service/status-codes.js +44 -0
  33. package/leavitt/api-service/status-codes.js.map +1 -0
  34. package/leavitt/company-select/company-select.d.ts +50 -0
  35. package/leavitt/company-select/company-select.js +157 -0
  36. package/leavitt/company-select/company-select.js.map +1 -0
  37. package/leavitt/person-company-select/person-company-select.d.ts +41 -0
  38. package/leavitt/person-company-select/person-company-select.js +180 -0
  39. package/leavitt/person-company-select/person-company-select.js.map +1 -0
  40. package/leavitt/person-group-select/people-group-icons.d.ts +5 -0
  41. package/leavitt/person-group-select/people-group-icons.js +66 -0
  42. package/leavitt/person-group-select/people-group-icons.js.map +1 -0
  43. package/leavitt/person-group-select/person-group-select.d.ts +41 -0
  44. package/leavitt/person-group-select/person-group-select.js +186 -0
  45. package/leavitt/person-group-select/person-group-select.js.map +1 -0
  46. package/leavitt/person-select/person-select.d.ts +33 -0
  47. package/leavitt/person-select/person-select.js +128 -0
  48. package/leavitt/person-select/person-select.js.map +1 -0
  49. package/leavitt/profile-picture/profile-picture-menu.d.ts +44 -0
  50. package/leavitt/profile-picture/profile-picture-menu.js +197 -0
  51. package/leavitt/profile-picture/profile-picture-menu.js.map +1 -0
  52. package/leavitt/profile-picture/profile-picture.d.ts +39 -0
  53. package/leavitt/profile-picture/profile-picture.js +151 -0
  54. package/leavitt/profile-picture/profile-picture.js.map +1 -0
  55. package/leavitt/user-feedback/user-feedback.d.ts +357 -0
  56. package/leavitt/user-feedback/user-feedback.js +207 -0
  57. package/leavitt/user-feedback/user-feedback.js.map +1 -0
  58. package/leavitt/user-manager/LssJwtToken.d.ts +21 -0
  59. package/leavitt/user-manager/LssJwtToken.js +2 -0
  60. package/leavitt/user-manager/LssJwtToken.js.map +1 -0
  61. package/leavitt/user-manager/user-manager-events.d.ts +5 -0
  62. package/leavitt/user-manager/user-manager-events.js +7 -0
  63. package/leavitt/user-manager/user-manager-events.js.map +1 -0
  64. package/leavitt/user-manager/user-manager.d.ts +37 -0
  65. package/leavitt/user-manager/user-manager.js +364 -0
  66. package/leavitt/user-manager/user-manager.js.map +1 -0
  67. package/package.json +36 -0
  68. package/titanium/access-denied-page/access-denied-page.d.ts +16 -0
  69. package/titanium/access-denied-page/access-denied-page.js +360 -0
  70. package/titanium/access-denied-page/access-denied-page.js.map +1 -0
  71. package/titanium/address-input/Address.js.map +1 -0
  72. package/titanium/address-input/address-input.d.ts +29 -0
  73. package/titanium/address-input/address-input.js +77 -0
  74. package/titanium/address-input/address-input.js.map +1 -0
  75. package/titanium/address-input/google-address-input.d.ts +30 -0
  76. package/titanium/address-input/google-address-input.js +202 -0
  77. package/titanium/address-input/google-address-input.js.map +1 -0
  78. package/titanium/address-input/manual-address-dialog.d.ts +30 -0
  79. package/titanium/address-input/manual-address-dialog.js +250 -0
  80. package/titanium/address-input/manual-address-dialog.js.map +1 -0
  81. package/titanium/address-input/types/address-input-address.d.ts +17 -0
  82. package/titanium/address-input/types/address-input-address.js +2 -0
  83. package/titanium/address-input/types/address-input-address.js.map +1 -0
  84. package/titanium/address-input/types/address.js.map +1 -0
  85. package/titanium/address-input/types/autocomplete-prediction-suggestion.js.map +1 -0
  86. package/titanium/address-input/utils/address-to-string.d.ts +3 -0
  87. package/titanium/address-input/utils/address-to-string.js +13 -0
  88. package/titanium/address-input/utils/address-to-string.js.map +1 -0
  89. package/titanium/address-input/utils/place-result-to-address.d.ts +4 -0
  90. package/titanium/address-input/utils/place-result-to-address.js +33 -0
  91. package/titanium/address-input/utils/place-result-to-address.js.map +1 -0
  92. package/titanium/address-input/utils/validate-street.d.ts +2 -0
  93. package/titanium/address-input/utils/validate-street.js +8 -0
  94. package/titanium/address-input/utils/validate-street.js.map +1 -0
  95. package/titanium/card/card.d.ts +23 -0
  96. package/titanium/card/card.js +160 -0
  97. package/titanium/card/card.js.map +1 -0
  98. package/titanium/chip-multi-select/chip-multi-select.d.ts +55 -0
  99. package/titanium/chip-multi-select/chip-multi-select.js +119 -0
  100. package/titanium/chip-multi-select/chip-multi-select.js.map +1 -0
  101. package/titanium/data-table/data-table-header.d.ts +67 -0
  102. package/titanium/data-table/data-table-header.js +207 -0
  103. package/titanium/data-table/data-table-header.js.map +1 -0
  104. package/titanium/data-table/data-table-item.d.ts +100 -0
  105. package/titanium/data-table/data-table-item.js +511 -0
  106. package/titanium/data-table/data-table-item.js.map +1 -0
  107. package/titanium/data-table/data-table.d.ts +146 -0
  108. package/titanium/data-table/data-table.js +605 -0
  109. package/titanium/data-table/data-table.js.map +1 -0
  110. package/titanium/data-table/filter-controller.d.ts +23 -0
  111. package/titanium/data-table/filter-controller.js +119 -0
  112. package/titanium/data-table/filter-controller.js.map +1 -0
  113. package/titanium/data-table/filter.d.ts +8 -0
  114. package/titanium/data-table/filter.js +11 -0
  115. package/titanium/data-table/filter.js.map +1 -0
  116. package/titanium/data-table/page-control.d.ts +54 -0
  117. package/titanium/data-table/page-control.js +196 -0
  118. package/titanium/data-table/page-control.js.map +1 -0
  119. package/titanium/date-range-selector/date-range-change-event.d.ts +8 -0
  120. package/titanium/date-range-selector/date-range-change-event.js +10 -0
  121. package/titanium/date-range-selector/date-range-change-event.js.map +1 -0
  122. package/titanium/date-range-selector/date-range-selector.d.ts +65 -0
  123. package/titanium/date-range-selector/date-range-selector.js +423 -0
  124. package/titanium/date-range-selector/date-range-selector.js.map +1 -0
  125. package/titanium/date-range-selector/range-label.d.ts +4 -0
  126. package/titanium/date-range-selector/range-label.js +25 -0
  127. package/titanium/date-range-selector/range-label.js.map +1 -0
  128. package/titanium/drawer/drawer.d.ts +39 -0
  129. package/titanium/drawer/drawer.js +233 -0
  130. package/titanium/drawer/drawer.js.map +1 -0
  131. package/titanium/duration-input/duration-input.d.ts +26 -0
  132. package/titanium/duration-input/duration-input.js +86 -0
  133. package/titanium/duration-input/duration-input.js.map +1 -0
  134. package/titanium/duration-input/human-interval.d.ts +19 -0
  135. package/titanium/duration-input/human-interval.js +74 -0
  136. package/titanium/duration-input/human-interval.js.map +1 -0
  137. package/titanium/error-page/error-page.d.ts +16 -0
  138. package/titanium/error-page/error-page.js +96 -0
  139. package/titanium/error-page/error-page.js.map +1 -0
  140. package/titanium/event-bus/event-bus.d.ts +10 -0
  141. package/titanium/event-bus/event-bus.js +52 -0
  142. package/titanium/event-bus/event-bus.js.map +1 -0
  143. package/titanium/extendable-outlined-text-field/extendable-outlined-text-field.d.ts +160 -0
  144. package/titanium/extendable-outlined-text-field/extendable-outlined-text-field.js +295 -0
  145. package/titanium/extendable-outlined-text-field/extendable-outlined-text-field.js.map +1 -0
  146. package/titanium/extendable-outlined-text-field/extensible-outlined-text-field.d.ts +45 -0
  147. package/titanium/extendable-outlined-text-field/extensible-outlined-text-field.js.map +1 -0
  148. package/titanium/full-page-loading-indicator/full-page-loading-indicator.d.ts +19 -0
  149. package/titanium/full-page-loading-indicator/full-page-loading-indicator.js +170 -0
  150. package/titanium/full-page-loading-indicator/full-page-loading-indicator.js.map +1 -0
  151. package/titanium/hacks/dialog-overflow-hacks.d.ts +4 -0
  152. package/titanium/hacks/dialog-overflow-hacks.js +21 -0
  153. package/titanium/hacks/dialog-overflow-hacks.js.map +1 -0
  154. package/titanium/header/header.d.ts +39 -0
  155. package/titanium/header/header.js +148 -0
  156. package/titanium/header/header.js.map +1 -0
  157. package/titanium/helpers/csv-download.d.ts +3 -0
  158. package/titanium/helpers/csv-download.js +78 -0
  159. package/titanium/helpers/csv-download.js.map +1 -0
  160. package/titanium/helpers/debouncer.d.ts +13 -0
  161. package/titanium/helpers/debouncer.js +33 -0
  162. package/titanium/helpers/debouncer.js.map +1 -0
  163. package/titanium/helpers/delay.d.ts +2 -0
  164. package/titanium/helpers/delay.js +6 -0
  165. package/titanium/helpers/delay.js.map +1 -0
  166. package/titanium/helpers/dev-detection.d.ts +3 -0
  167. package/titanium/helpers/dev-detection.js +12 -0
  168. package/titanium/helpers/dev-detection.js.map +1 -0
  169. package/titanium/helpers/helpers.d.ts +14 -0
  170. package/titanium/helpers/helpers.js +14 -0
  171. package/titanium/helpers/helpers.js.map +1 -0
  172. package/titanium/helpers/join.d.ts +2 -0
  173. package/titanium/helpers/join.js +5 -0
  174. package/titanium/helpers/join.js.map +1 -0
  175. package/titanium/helpers/leavitt-cdn.d.ts +5 -0
  176. package/titanium/helpers/leavitt-cdn.js +38 -0
  177. package/titanium/helpers/leavitt-cdn.js.map +1 -0
  178. package/titanium/helpers/load-while.d.ts +343 -0
  179. package/titanium/helpers/load-while.js +27 -0
  180. package/titanium/helpers/load-while.js.map +1 -0
  181. package/titanium/helpers/media-query.d.ts +2 -0
  182. package/titanium/helpers/media-query.js +6 -0
  183. package/titanium/helpers/media-query.js.map +1 -0
  184. package/titanium/helpers/middle-ellipsis.d.ts +2 -0
  185. package/titanium/helpers/middle-ellipsis.js +7 -0
  186. package/titanium/helpers/middle-ellipsis.js.map +1 -0
  187. package/titanium/helpers/not-null-or-undefined.d.ts +2 -0
  188. package/titanium/helpers/not-null-or-undefined.js +4 -0
  189. package/titanium/helpers/not-null-or-undefined.js.map +1 -0
  190. package/titanium/helpers/not-null.d.ts +2 -0
  191. package/titanium/helpers/not-null.js +4 -0
  192. package/titanium/helpers/not-null.js.map +1 -0
  193. package/titanium/helpers/not-undefined.d.ts +2 -0
  194. package/titanium/helpers/not-undefined.js +4 -0
  195. package/titanium/helpers/not-undefined.js.map +1 -0
  196. package/titanium/helpers/odata-helpers.d.ts +2 -0
  197. package/titanium/helpers/odata-helpers.js +2 -0
  198. package/titanium/helpers/odata-helpers.js.map +1 -0
  199. package/titanium/helpers/search-token.d.ts +2 -0
  200. package/titanium/helpers/search-token.js +17 -0
  201. package/titanium/helpers/search-token.js.map +1 -0
  202. package/titanium/icon-picker/icon-picker.d.ts +23 -0
  203. package/titanium/icon-picker/icon-picker.js +75 -0
  204. package/titanium/icon-picker/icon-picker.js.map +1 -0
  205. package/titanium/icon-picker/material-symbols.d.ts +3 -0
  206. package/titanium/icon-picker/material-symbols.js +3297 -0
  207. package/titanium/icon-picker/material-symbols.js.map +1 -0
  208. package/titanium/input-validator/input-validator.d.ts +20 -0
  209. package/titanium/input-validator/input-validator.js +45 -0
  210. package/titanium/input-validator/input-validator.js.map +1 -0
  211. package/titanium/search-input/search-input.d.ts +47 -0
  212. package/titanium/search-input/search-input.js +237 -0
  213. package/titanium/search-input/search-input.js.map +1 -0
  214. package/titanium/service-worker-notifier/service-worker-notifier.d.ts +9 -0
  215. package/titanium/service-worker-notifier/service-worker-notifier.js +57 -0
  216. package/titanium/service-worker-notifier/service-worker-notifier.js.map +1 -0
  217. package/titanium/show-hide/show-hide.d.ts +36 -0
  218. package/titanium/show-hide/show-hide.js +144 -0
  219. package/titanium/show-hide/show-hide.js.map +1 -0
  220. package/titanium/single-select-base/single-select-base.d.ts +449 -0
  221. package/titanium/single-select-base/single-select-base.js +411 -0
  222. package/titanium/single-select-base/single-select-base.js.map +1 -0
  223. package/titanium/smart-attachment-input/crop-and-save-image-dialog.d.ts +370 -0
  224. package/titanium/smart-attachment-input/crop-and-save-image-dialog.js +270 -0
  225. package/titanium/smart-attachment-input/crop-and-save-image-dialog.js.map +1 -0
  226. package/titanium/smart-attachment-input/cropper-styles.d.ts +3 -0
  227. package/titanium/smart-attachment-input/cropper-styles.js +311 -0
  228. package/titanium/smart-attachment-input/cropper-styles.js.map +1 -0
  229. package/titanium/smart-attachment-input/image-formats.d.ts +5 -0
  230. package/titanium/smart-attachment-input/image-formats.js +37 -0
  231. package/titanium/smart-attachment-input/image-formats.js.map +1 -0
  232. package/titanium/smart-attachment-input/image-preview-dialog.d.ts +21 -0
  233. package/titanium/smart-attachment-input/image-preview-dialog.js +83 -0
  234. package/titanium/smart-attachment-input/image-preview-dialog.js.map +1 -0
  235. package/titanium/smart-attachment-input/smart-attachment-input.d.ts +126 -0
  236. package/titanium/smart-attachment-input/smart-attachment-input.js +422 -0
  237. package/titanium/smart-attachment-input/smart-attachment-input.js.map +1 -0
  238. package/titanium/smart-attachment-input/type/smart-attachment.d.ts +7 -0
  239. package/titanium/smart-attachment-input/type/smart-attachment.js +2 -0
  240. package/titanium/smart-attachment-input/type/smart-attachment.js.map +1 -0
  241. package/titanium/snackbar/snackbar.d.ts +79 -0
  242. package/titanium/snackbar/snackbar.js +302 -0
  243. package/titanium/snackbar/snackbar.js.map +1 -0
  244. package/titanium/styles/a.d.ts +2 -0
  245. package/titanium/styles/a.js +18 -0
  246. package/titanium/styles/a.js.map +1 -0
  247. package/titanium/styles/data-row.d.ts +2 -0
  248. package/titanium/styles/data-row.js +52 -0
  249. package/titanium/styles/data-row.js.map +1 -0
  250. package/titanium/styles/ellipsis.d.ts +2 -0
  251. package/titanium/styles/ellipsis.js +9 -0
  252. package/titanium/styles/ellipsis.js.map +1 -0
  253. package/titanium/styles/h1.d.ts +2 -0
  254. package/titanium/styles/h1.js +17 -0
  255. package/titanium/styles/h1.js.map +1 -0
  256. package/titanium/styles/h2.d.ts +2 -0
  257. package/titanium/styles/h2.js +17 -0
  258. package/titanium/styles/h2.js.map +1 -0
  259. package/titanium/styles/h3.d.ts +2 -0
  260. package/titanium/styles/h3.js +17 -0
  261. package/titanium/styles/h3.js.map +1 -0
  262. package/titanium/styles/h4.d.ts +2 -0
  263. package/titanium/styles/h4.js +17 -0
  264. package/titanium/styles/h4.js.map +1 -0
  265. package/titanium/styles/h5.d.ts +2 -0
  266. package/titanium/styles/h5.js +19 -0
  267. package/titanium/styles/h5.js.map +1 -0
  268. package/titanium/styles/p.d.ts +2 -0
  269. package/titanium/styles/p.js +17 -0
  270. package/titanium/styles/p.js.map +1 -0
  271. package/titanium/styles/styles.d.ts +17 -0
  272. package/titanium/styles/styles.js +17 -0
  273. package/titanium/styles/styles.js.map +1 -0
  274. package/titanium/toolbar/toolbar.d.ts +34 -0
  275. package/titanium/toolbar/toolbar.js +104 -0
  276. package/titanium/toolbar/toolbar.js.map +1 -0
  277. package/titanium/types/any-function.d.ts +5 -0
  278. package/titanium/types/any-function.js +2 -0
  279. package/titanium/types/any-function.js.map +1 -0
  280. package/titanium/types/dom-event.d.ts +4 -0
  281. package/titanium/types/dom-event.js +2 -0
  282. package/titanium/types/dom-event.js.map +1 -0
  283. package/titanium/types/identifier-interface.d.ts +4 -0
  284. package/titanium/types/identifier-interface.js +2 -0
  285. package/titanium/types/identifier-interface.js.map +1 -0
  286. package/titanium/types/pending-state-event.d.ts +7 -0
  287. package/titanium/types/pending-state-event.js +7 -0
  288. package/titanium/types/pending-state-event.js.map +1 -0
  289. package/titanium/types/string-map.d.ts +7 -0
  290. package/titanium/types/string-map.js +5 -0
  291. package/titanium/types/string-map.js.map +1 -0
  292. package/titanium/youtube-input/youtube-input.d.ts +17 -0
  293. package/titanium/youtube-input/youtube-input.js +52 -0
  294. package/titanium/youtube-input/youtube-input.js.map +1 -0
@@ -0,0 +1,157 @@
1
+ import { __decorate } from "tslib";
2
+ import { css, html } from 'lit';
3
+ import { property, customElement } from 'lit/decorators.js';
4
+ import '@material/web/icon/icon';
5
+ import '@material/web/textfield/outlined-text-field';
6
+ import '@material/web/menu/menu';
7
+ import '@material/web/menu/menu-item';
8
+ import { TitaniumSnackbarSingleton } from '../../titanium/snackbar/snackbar';
9
+ import Fuse from 'fuse.js';
10
+ import { TitaniumSingleSelectBase } from '../../titanium/single-select-base/single-select-base';
11
+ /**
12
+ * Single select input that searches Leavitt Group companies
13
+ *
14
+ * @element leavitt-company-select
15
+ *
16
+ * @fires selected - Fired when selection is made or cleared
17
+ *
18
+ */
19
+ let LeavittCompanySelect = class LeavittCompanySelect extends TitaniumSingleSelectBase {
20
+ #label_accessor_storage = 'Company';
21
+ get label() { return this.#label_accessor_storage; }
22
+ set label(value) { this.#label_accessor_storage = value; }
23
+ #placeholder_accessor_storage = 'Search for a company';
24
+ get placeholder() { return this.#placeholder_accessor_storage; }
25
+ set placeholder(value) { this.#placeholder_accessor_storage = value; }
26
+ #pathToSelectedText_accessor_storage = 'Name';
27
+ get pathToSelectedText() { return this.#pathToSelectedText_accessor_storage; }
28
+ set pathToSelectedText(value) { this.#pathToSelectedText_accessor_storage = value; }
29
+ #companies_accessor_storage = [];
30
+ get companies() { return this.#companies_accessor_storage; }
31
+ set companies(value) { this.#companies_accessor_storage = value; }
32
+ #apiService_accessor_storage;
33
+ /**
34
+ * Required
35
+ */
36
+ get apiService() { return this.#apiService_accessor_storage; }
37
+ set apiService(value) { this.#apiService_accessor_storage = value; }
38
+ #disableAutoLoad_accessor_storage = false;
39
+ /**
40
+ * Disables automatic loading of companies on firstUpdated
41
+ */
42
+ get disableAutoLoad() { return this.#disableAutoLoad_accessor_storage; }
43
+ set disableAutoLoad(value) { this.#disableAutoLoad_accessor_storage = value; }
44
+ #odataParts_accessor_storage = ['orderby=Name', 'select=Name,ShortName,MarkUrl,Id'];
45
+ /**
46
+ * Odata parts for the Company API call
47
+ */
48
+ get odataParts() { return this.#odataParts_accessor_storage; }
49
+ set odataParts(value) { this.#odataParts_accessor_storage = value; }
50
+ #apiControllerName_accessor_storage = 'Companies';
51
+ /**
52
+ * Set the name of the API controller to use
53
+ */
54
+ get apiControllerName() { return this.#apiControllerName_accessor_storage; }
55
+ set apiControllerName(value) { this.#apiControllerName_accessor_storage = value; }
56
+ async firstUpdated() {
57
+ if (!this.disableAutoLoad && !this.companies.length && this.apiService) {
58
+ this.#reloadCompanies();
59
+ }
60
+ }
61
+ async updated(changedProps) {
62
+ if (changedProps.has('companies') && this.companies) {
63
+ this.suggestions = this.companies;
64
+ }
65
+ }
66
+ /**
67
+ * Force the list of companies to reload from remote
68
+ */
69
+ async reloadCompanies() {
70
+ if (!this.disableAutoLoad) {
71
+ console.warn('leavitt-company-select reloadCompanies method has been called manually without setting disableAutoLoad');
72
+ }
73
+ this.#reloadCompanies();
74
+ }
75
+ async #reloadCompanies() {
76
+ this.companies = await this.#getCompanies();
77
+ this.selected = this.companies.find((o) => o.Id === this.selected?.Id) ?? null;
78
+ }
79
+ async #getCompanies() {
80
+ try {
81
+ const get = this.apiService?.getAsync(`${this.apiControllerName}?${this.odataParts.join('&')}`);
82
+ const result = await get;
83
+ return result?.toList() ?? [];
84
+ }
85
+ catch (error) {
86
+ TitaniumSnackbarSingleton.open(error);
87
+ }
88
+ return [];
89
+ }
90
+ static { this.styles = [
91
+ ...TitaniumSingleSelectBase.styles,
92
+ css `
93
+ img[company-mark] {
94
+ width: 40px;
95
+ height: 40px;
96
+ }
97
+ `,
98
+ ]; }
99
+ onInputChanged(searchTerm) {
100
+ const options = {
101
+ includeScore: true,
102
+ keys: ['Name', 'ShortName'],
103
+ shouldSort: true,
104
+ threshold: 0.3,
105
+ };
106
+ if (this.searchTerm) {
107
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
108
+ const fuse = new Fuse(this.companies, options);
109
+ const fuseResults = fuse.search(searchTerm);
110
+ this.suggestions = fuseResults.map((o) => o.item);
111
+ }
112
+ else {
113
+ this.suggestions = this.companies;
114
+ }
115
+ this.count = this.suggestions.length;
116
+ }
117
+ renderSelectedLeadingInputSlot(entity) {
118
+ return html ` <img leading slot="leading-icon" src=${entity.MarkUrl || 'https://cdn.leavitt.com/lg-mark.svg'} />`;
119
+ }
120
+ renderSuggestion(company) {
121
+ return html `<md-menu-item .item=${company} ?selected=${this.selected?.Id === company.Id}>
122
+ <slot name="trailing-icon" slot="trailing-icon"></slot>
123
+ <span slot="headline">${company.Name}</span>
124
+ <span slot="supporting-text">${company.ShortName || '-'}</span>
125
+ <img loading="lazy" company-mark slot="start" src=${company.MarkUrl || 'https://cdn.leavitt.com/lg-mark.svg'} />
126
+ </md-menu-item>`;
127
+ }
128
+ };
129
+ __decorate([
130
+ property({ type: String })
131
+ ], LeavittCompanySelect.prototype, "label", null);
132
+ __decorate([
133
+ property({ type: String })
134
+ ], LeavittCompanySelect.prototype, "placeholder", null);
135
+ __decorate([
136
+ property({ type: String })
137
+ ], LeavittCompanySelect.prototype, "pathToSelectedText", null);
138
+ __decorate([
139
+ property({ type: Array })
140
+ ], LeavittCompanySelect.prototype, "companies", null);
141
+ __decorate([
142
+ property({ attribute: false })
143
+ ], LeavittCompanySelect.prototype, "apiService", null);
144
+ __decorate([
145
+ property({ type: Boolean })
146
+ ], LeavittCompanySelect.prototype, "disableAutoLoad", null);
147
+ __decorate([
148
+ property({ type: Array })
149
+ ], LeavittCompanySelect.prototype, "odataParts", null);
150
+ __decorate([
151
+ property({ type: String })
152
+ ], LeavittCompanySelect.prototype, "apiControllerName", null);
153
+ LeavittCompanySelect = __decorate([
154
+ customElement('leavitt-company-select')
155
+ ], LeavittCompanySelect);
156
+ export { LeavittCompanySelect };
157
+ //# sourceMappingURL=company-select.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"company-select.js","sourceRoot":"","sources":["company-select.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,yBAAyB,CAAC;AACjC,OAAO,6CAA6C,CAAC;AAErD,OAAO,yBAAyB,CAAC;AACjC,OAAO,8BAA8B,CAAC;AAEtC,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAI7E,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,wBAAwB,EAAE,MAAM,sDAAsD,CAAC;AAEhG;;;;;;;GAOG;AAEI,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,wBAA0C;IAC7C,0BAAgB,SAAS,CAAC;IAA1B,IAAA,KAAK,2CAAqB;IAA1B,IAAA,KAAK,iDAAqB;IAE1B,gCAAsB,sBAAsB,CAAC;IAA7C,IAAA,WAAW,iDAAkC;IAA7C,IAAA,WAAW,uDAAkC;IAE7C,uCAA6B,MAAM,CAAC;IAApC,IAAA,kBAAkB,wDAAkB;IAApC,IAAA,kBAAkB,8DAAkB;IAErC,8BAAqC,EAAE,CAAC;IAAxC,IAAA,SAAS,+CAA+B;IAAxC,IAAA,SAAS,qDAA+B;IAKnC,6BAAuB;IAHhE;;OAEG;IACsC,IAAA,UAAU,gDAAa;IAAvB,IAAA,UAAU,sDAAa;IAK1B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AAO,IAAI,CAAA,uBAAuB,OAAO,cAAc,IAAI,CAAC,QAAQ,EAAE,EAAE,KAAK,OAAO,CAAC,EAAE;;8BAE7D,OAAO,CAAC,IAAI;qCACL,OAAO,CAAC,SAAS,IAAI,GAAG;0DACH,OAAO,CAAC,OAAO,IAAI,qCAAqC;oBAC9F,CAAC;IACnB,CAAC;;AA1GoC;IAApC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAAoC;AAE1B;IAApC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uDAAuD;AAE7C;IAApC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8DAA8C;AAErC;IAAnC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;qDAAkD;AAKnC;IAAxC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;sDAAiC;AAK1B;IAArC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;2DAA2C;AAKnC;IAAnC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;sDAA2F;AAKhF;IAApC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6DAAkD;AA3BlE,oBAAoB;IADhC,aAAa,CAAC,wBAAwB,CAAC;GAC3B,oBAAoB,CA4GhC"}
@@ -0,0 +1,41 @@
1
+ import { Company as CoreCompany, Person as CorePerson } from '@leavittsoftware/lg-core-typescript';
2
+ import { TitaniumSingleSelectBase } from '../../titanium/single-select-base/single-select-base';
3
+ import '../profile-picture/profile-picture';
4
+ import ApiService from '../api-service/api-service';
5
+ export type Person = CorePerson & {
6
+ type: 'Person';
7
+ Name: string;
8
+ };
9
+ export type Company = CoreCompany & {
10
+ type: 'Company';
11
+ };
12
+ /**
13
+ * Single select input that searches Leavitt users and companies
14
+ *
15
+ * @element leavitt-person-select
16
+ *
17
+ */
18
+ export declare class LeavittPersonCompanySelect extends TitaniumSingleSelectBase<Partial<Partial<Person | Company>>> {
19
+ #private;
20
+ accessor label: string;
21
+ accessor placeholder: string;
22
+ /**
23
+ * Set the name of the API controller to use
24
+ */
25
+ accessor peopleApiControllerName: string;
26
+ /**
27
+ * Set the name of the API controller to use
28
+ */
29
+ accessor companyApiControllerName: string;
30
+ accessor pathToSelectedText: string;
31
+ /**
32
+ * Required
33
+ */
34
+ apiService: ApiService;
35
+ searchTermToOData(searchTerm: string): string | null;
36
+ static styles: import("lit").CSSResult[];
37
+ protected onInputChanged(searchTerm: string): void;
38
+ protected renderSelectedLeadingInputSlot(entity: Partial<Partial<Person | Company>>): import("lit-html").TemplateResult<1>;
39
+ protected renderSuggestion(entity: Partial<Partial<Person | Company>>): import("lit-html").TemplateResult<1>;
40
+ }
41
+ //# sourceMappingURL=person-company-select.d.ts.map
@@ -0,0 +1,180 @@
1
+ import { __decorate } from "tslib";
2
+ /* eslint-disable @typescript-eslint/no-unused-vars */
3
+ import { css, html } from 'lit';
4
+ import { customElement, property } from 'lit/decorators.js';
5
+ import { TitaniumSingleSelectBase } from '../../titanium/single-select-base/single-select-base';
6
+ import '../profile-picture/profile-picture';
7
+ import { Debouncer, getSearchTokens } from '../../titanium/helpers/helpers';
8
+ import { TitaniumSnackbarSingleton } from '../../titanium/snackbar/snackbar';
9
+ import Fuse from 'fuse.js';
10
+ /**
11
+ * Single select input that searches Leavitt users and companies
12
+ *
13
+ * @element leavitt-person-select
14
+ *
15
+ */
16
+ let LeavittPersonCompanySelect = class LeavittPersonCompanySelect extends TitaniumSingleSelectBase {
17
+ #label_accessor_storage = 'Person or company';
18
+ get label() { return this.#label_accessor_storage; }
19
+ set label(value) { this.#label_accessor_storage = value; }
20
+ #placeholder_accessor_storage = 'Search for a person or company';
21
+ get placeholder() { return this.#placeholder_accessor_storage; }
22
+ set placeholder(value) { this.#placeholder_accessor_storage = value; }
23
+ #peopleApiControllerName_accessor_storage = 'People';
24
+ /**
25
+ * Set the name of the API controller to use
26
+ */
27
+ get peopleApiControllerName() { return this.#peopleApiControllerName_accessor_storage; }
28
+ set peopleApiControllerName(value) { this.#peopleApiControllerName_accessor_storage = value; }
29
+ #companyApiControllerName_accessor_storage = 'Companies';
30
+ /**
31
+ * Set the name of the API controller to use
32
+ */
33
+ get companyApiControllerName() { return this.#companyApiControllerName_accessor_storage; }
34
+ set companyApiControllerName(value) { this.#companyApiControllerName_accessor_storage = value; }
35
+ #pathToSelectedText_accessor_storage = 'Name';
36
+ get pathToSelectedText() { return this.#pathToSelectedText_accessor_storage; }
37
+ set pathToSelectedText(value) { this.#pathToSelectedText_accessor_storage = value; }
38
+ #doSearchDebouncer = new Debouncer((searchTerm) => this.#doSearch(searchTerm));
39
+ #abortController = new AbortController();
40
+ searchTermToOData(searchTerm) {
41
+ const searchTokens = getSearchTokens(searchTerm);
42
+ if (searchTokens.length < 1) {
43
+ return null;
44
+ }
45
+ return searchTokens.map((token) => `contains(tolower(Name), '${token.toLowerCase()}')`).join(' and ');
46
+ }
47
+ async #doSearch(searchTerm) {
48
+ if (!searchTerm) {
49
+ return;
50
+ }
51
+ this.#abortController.abort();
52
+ this.#abortController = new AbortController();
53
+ const all = Promise.all([this.#doPersonSearch(searchTerm), this.#doCompanySearch(searchTerm)]);
54
+ this.loadWhile(all);
55
+ const results = await all;
56
+ const entities = [...(results[0]?.entities ?? []), ...(results[1]?.entities ?? [])];
57
+ const odataCount = (results[0]?.odataCount ?? 0) + (results[1]?.odataCount ?? 0);
58
+ const options = {
59
+ includeScore: true,
60
+ keys: ['Name'],
61
+ };
62
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
63
+ const fuse = new Fuse(entities, options);
64
+ const fuseResults = fuse.search(searchTerm).sort((a, b) => (b?.score ?? 0) - (a?.score ?? 0));
65
+ this.suggestions = fuseResults.map((o) => o.item) ?? [];
66
+ this.count = odataCount ?? 0;
67
+ }
68
+ /**
69
+ * @ignore
70
+ */
71
+ async #doPersonSearch(searchTerm) {
72
+ if (!searchTerm) {
73
+ return null;
74
+ }
75
+ try {
76
+ const odataParts = ['top=100', 'count=true', 'compute=FullName as Name', 'select=Name,Id,CompanyName,ProfilePictureCdnFileName'];
77
+ const searchTokens = getSearchTokens(searchTerm);
78
+ if (searchTokens.length > 0) {
79
+ const searchFilter = searchTokens.map((token) => `contains(tolower(Name), '${token.toLowerCase()}')`).join(' and ');
80
+ odataParts.push(`filter=${searchFilter}`);
81
+ }
82
+ const results = await this.apiService?.getAsync(`${this.peopleApiControllerName}?${odataParts.join('&')}`, {
83
+ abortController: this.#abortController,
84
+ });
85
+ results?.entities.forEach((p) => (p.type = 'Person'));
86
+ return results;
87
+ }
88
+ catch (error) {
89
+ if (!error?.message?.includes('Abort error')) {
90
+ TitaniumSnackbarSingleton.open(error);
91
+ }
92
+ }
93
+ return null;
94
+ }
95
+ /**
96
+ * @ignore
97
+ */
98
+ async #doCompanySearch(searchTerm) {
99
+ if (!searchTerm) {
100
+ return null;
101
+ }
102
+ try {
103
+ const odataParts = ['top=100', 'count=true', 'select=Name,Shortname,MarkUrl,Id'];
104
+ const searchTokens = getSearchTokens(searchTerm);
105
+ if (searchTokens.length > 0) {
106
+ const searchFilter = searchTokens.map((token) => `(contains(Name, '${token}') OR (contains(Shortname, '${token}')))`).join(' and ');
107
+ odataParts.push(`$filter=${searchFilter}`);
108
+ }
109
+ const results = await this.apiService?.getAsync(`Companies?${odataParts.join('&')}`, { abortController: this.#abortController });
110
+ results?.entities.forEach((p) => (p.type = 'Company'));
111
+ return results;
112
+ }
113
+ catch (error) {
114
+ if (!error?.message?.includes('Abort error')) {
115
+ TitaniumSnackbarSingleton.open(error);
116
+ }
117
+ }
118
+ return null;
119
+ }
120
+ static { this.styles = [
121
+ ...TitaniumSingleSelectBase.styles,
122
+ css `
123
+ img[company-mark] {
124
+ width: 40px;
125
+ height: 40px;
126
+ }
127
+ `,
128
+ ]; }
129
+ // Overloaded base
130
+ onInputChanged(searchTerm) {
131
+ this.isLoading = true;
132
+ this.#doSearchDebouncer.debounce(searchTerm);
133
+ }
134
+ renderSelectedLeadingInputSlot(entity) {
135
+ return entity.type === 'Person'
136
+ ? html `<profile-picture slot="leading-icon" .fileName=${entity?.ProfilePictureCdnFileName || null} shape="circle" size="24"></profile-picture>`
137
+ : entity.type === 'Company'
138
+ ? html `<img leading slot="leading-icon" src=${entity.MarkUrl || 'https://cdn.leavitt.com/lg-mark.svg'} />`
139
+ : html ``;
140
+ }
141
+ renderSuggestion(entity) {
142
+ return entity.type === 'Person'
143
+ ? html `<md-menu-item .item=${entity} ?selected=${this.selected?.Id === entity.Id}>
144
+ <profile-picture slot="start" .fileName=${entity?.ProfilePictureCdnFileName ?? null} shape="circle" size="40"></profile-picture>
145
+ <span slot="headline">${entity.Name}</span>
146
+ <span slot="supporting-text">${entity.CompanyName}</span>
147
+ </md-menu-item>`
148
+ : entity.type === 'Company'
149
+ ? html `<md-menu-item .item=${entity} ?selected=${this.selected?.Id === entity.Id}>
150
+ <slot name="trailing-icon" slot="trailing-icon"></slot>
151
+ <span slot="headline">${entity.Name}</span>
152
+ <span slot="supporting-text">${entity.ShortName || '-'}</span>
153
+ <img loading="lazy" company-mark slot="start" src=${entity.MarkUrl || 'https://cdn.leavitt.com/lg-mark.svg'} />
154
+ </md-menu-item>`
155
+ : html ``;
156
+ }
157
+ };
158
+ __decorate([
159
+ property({ type: String })
160
+ ], LeavittPersonCompanySelect.prototype, "label", null);
161
+ __decorate([
162
+ property({ type: String })
163
+ ], LeavittPersonCompanySelect.prototype, "placeholder", null);
164
+ __decorate([
165
+ property({ type: String })
166
+ ], LeavittPersonCompanySelect.prototype, "peopleApiControllerName", null);
167
+ __decorate([
168
+ property({ type: String })
169
+ ], LeavittPersonCompanySelect.prototype, "companyApiControllerName", null);
170
+ __decorate([
171
+ property({ type: String })
172
+ ], LeavittPersonCompanySelect.prototype, "pathToSelectedText", null);
173
+ __decorate([
174
+ property({ attribute: false })
175
+ ], LeavittPersonCompanySelect.prototype, "apiService", void 0);
176
+ LeavittPersonCompanySelect = __decorate([
177
+ customElement('leavitt-person-company-select')
178
+ ], LeavittPersonCompanySelect);
179
+ export { LeavittPersonCompanySelect };
180
+ //# sourceMappingURL=person-company-select.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"person-company-select.js","sourceRoot":"","sources":["person-company-select.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,sDAAsD,CAAC;AAEhG,OAAO,oCAAoC,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAE5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,IAAI,MAAM,SAAS,CAAC;AAK3B;;;;;GAKG;AAEI,IAAM,0BAA0B,GAAhC,MAAM,0BAA2B,SAAQ,wBAA4D;IACrE,0BAAgB,mBAAmB,CAAC;IAApC,IAAA,KAAK,2CAA+B;IAApC,IAAA,KAAK,iDAA+B;IAEpC,gCAAsB,gCAAgC,CAAC;IAAvD,IAAA,WAAW,iDAA4C;IAAvD,IAAA,WAAW,uDAA4C;IAKvD,4CAAkC,QAAQ,CAAC;IAHhF;;OAEG;IACkC,IAAA,uBAAuB,6DAAoB;IAA3C,IAAA,uBAAuB,mEAAoB;IAK3C,6CAAmC,WAAW,CAAC;IAHpF;;OAEG;IACkC,IAAA,wBAAwB,8DAAuB;IAA/C,IAAA,wBAAwB,oEAAuB;IAE/C,uCAA6B,MAAM,CAAC;IAApC,IAAA,kBAAkB,wDAAkB;IAApC,IAAA,kBAAkB,8DAAkB;IAOzE,kBAAkB,GAAG,IAAI,SAAS,CAAC,CAAC,UAAkB,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CA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;kCAEpD,MAAM,CAAC,IAAI;yCACJ,MAAM,CAAC,SAAS,IAAI,GAAG;8DACF,MAAM,CAAC,OAAO,IAAI,qCAAqC;wBAC7F;gBAClB,CAAC,CAAC,IAAI,CAAA,EAAE,CAAC;IACb,CAAC;;AAvJoC;IAApC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uDAA8C;AAEpC;IAApC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6DAAiE;AAKvD;IAApC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yEAAqD;AAK3C;IAApC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0EAAyD;AAE/C;IAApC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oEAA8C;AAKzC;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;8DAAwB;AApB5C,0BAA0B;IADtC,aAAa,CAAC,+BAA+B,CAAC;GAClC,0BAA0B,CAyJtC"}
@@ -0,0 +1,5 @@
1
+ export declare const peopleGroupIcons: Map<string, {
2
+ icon: string;
3
+ displayName: string;
4
+ }>;
5
+ //# sourceMappingURL=people-group-icons.d.ts.map
@@ -0,0 +1,66 @@
1
+ export const peopleGroupIcons = new Map([
2
+ [
3
+ '#lg.net.core.DataModel.Core.StatePeopleGroup',
4
+ {
5
+ icon: 'location_searching',
6
+ displayName: 'State people group',
7
+ },
8
+ ],
9
+ [
10
+ '#lg.net.core.DataModel.Core.CityPeopleGroup',
11
+ {
12
+ icon: 'share_location',
13
+ displayName: 'City people group',
14
+ },
15
+ ],
16
+ [
17
+ '#lg.net.core.DataModel.Core.JobRolePeopleGroup',
18
+ {
19
+ icon: 'light_mode',
20
+ displayName: 'Job role people group',
21
+ },
22
+ ],
23
+ [
24
+ '#lg.net.core.DataModel.Core.LdapPeopleGroup',
25
+ {
26
+ icon: 'account_circle',
27
+ displayName: 'LDAP people group',
28
+ },
29
+ ],
30
+ [
31
+ '#lg.net.core.DataModel.Core.CompanyPeopleGroup',
32
+ {
33
+ icon: 'supervised_user_circle',
34
+ displayName: 'Company people group',
35
+ },
36
+ ],
37
+ [
38
+ '#lg.net.core.DataModel.Core.DepartmentPeopleGroup',
39
+ {
40
+ icon: 'monetization_on',
41
+ displayName: 'Department people group',
42
+ },
43
+ ],
44
+ [
45
+ '#lg.net.core.DataModel.Core.BuildingPeopleGroup',
46
+ {
47
+ icon: 'location_city',
48
+ displayName: 'Building people group',
49
+ },
50
+ ],
51
+ [
52
+ '#lg.net.core.DataModel.Core.FTEJobRolePeopleGroup',
53
+ {
54
+ icon: 'work_outline',
55
+ displayName: 'FTE job role people group',
56
+ },
57
+ ],
58
+ [
59
+ '#lg.net.core.DataModel.Core.CompanyGroupPeopleGroup',
60
+ {
61
+ icon: 'groups',
62
+ displayName: 'Company grouping people group',
63
+ },
64
+ ],
65
+ ]);
66
+ //# sourceMappingURL=people-group-icons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"people-group-icons.js","sourceRoot":"","sources":["people-group-icons.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAgD;IACrF;QACE,8CAA8C;QAC9C;YACE,IAAI,EAAE,oBAAoB;YAC1B,WAAW,EAAE,oBAAoB;SAClC;KACF;IACD;QACE,6CAA6C;QAC7C;YACE,IAAI,EAAE,gBAAgB;YACtB,WAAW,EAAE,mBAAmB;SACjC;KACF;IACD;QACE,gDAAgD;QAChD;YACE,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,uBAAuB;SACrC;KACF;IACD;QACE,6CAA6C;QAC7C;YACE,IAAI,EAAE,gBAAgB;YACtB,WAAW,EAAE,mBAAmB;SACjC;KACF;IACD;QACE,gDAAgD;QAChD;YACE,IAAI,EAAE,wBAAwB;YAC9B,WAAW,EAAE,sBAAsB;SACpC;KACF;IACD;QACE,mDAAmD;QACnD;YACE,IAAI,EAAE,iBAAiB;YACvB,WAAW,EAAE,yBAAyB;SACvC;KACF;IACD;QACE,iDAAiD;QACjD;YACE,IAAI,EAAE,eAAe;YACrB,WAAW,EAAE,uBAAuB;SACrC;KACF;IACD;QACE,mDAAmD;QACnD;YACE,IAAI,EAAE,cAAc;YACpB,WAAW,EAAE,2BAA2B;SACzC;KACF;IACD;QACE,qDAAqD;QACrD;YACE,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,+BAA+B;SAC7C;KACF;CACF,CAAC,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { PeopleGroup as CorePeopleGroup, Person as CorePerson } from '@leavittsoftware/lg-core-typescript';
2
+ import { TitaniumSingleSelectBase } from '../../titanium/single-select-base/single-select-base';
3
+ import '../profile-picture/profile-picture';
4
+ import ApiService from '../api-service/api-service';
5
+ export type Person = CorePerson & {
6
+ type: 'Person';
7
+ Name: string;
8
+ };
9
+ export type PeopleGroup = CorePeopleGroup & {
10
+ type: 'PeopleGroup';
11
+ };
12
+ /**
13
+ * Single select input that searches Leavitt Group users and user groups
14
+ *
15
+ * @element leavitt-person-select
16
+ *
17
+ */
18
+ export declare class LeavittPersonGroupSelect extends TitaniumSingleSelectBase<Partial<Partial<Person | PeopleGroup>>> {
19
+ #private;
20
+ accessor label: string;
21
+ accessor placeholder: string;
22
+ /**
23
+ * Set the name of the API controller to use
24
+ */
25
+ accessor peopleApiControllerName: string;
26
+ /**
27
+ * Set the name of the API controller to use
28
+ */
29
+ accessor groupApiControllerName: string;
30
+ accessor pathToSelectedText: string;
31
+ /**
32
+ * Required
33
+ */
34
+ apiService: ApiService;
35
+ searchTermToOData(searchTerm: string): string | null;
36
+ static styles: import("lit").CSSResult[];
37
+ protected onInputChanged(searchTerm: string): void;
38
+ protected renderSelectedLeadingInputSlot(entity: Partial<Partial<Person | PeopleGroup>>): import("lit-html").TemplateResult<1>;
39
+ protected renderSuggestion(entity: Partial<Partial<Person | PeopleGroup>>): import("lit-html").TemplateResult<1>;
40
+ }
41
+ //# sourceMappingURL=person-group-select.d.ts.map