@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,202 @@
1
+ import { __decorate } from "tslib";
2
+ /* eslint-disable @typescript-eslint/no-unused-vars */
3
+ import { html } from 'lit';
4
+ import { customElement, property } from 'lit/decorators.js';
5
+ import { TitaniumSingleSelectBase } from '../../titanium/single-select-base/single-select-base';
6
+ import { Debouncer } from '../../titanium/helpers/helpers';
7
+ import { TitaniumSnackbarSingleton } from '../../titanium/snackbar/snackbar';
8
+ import { Loader } from '@googlemaps/js-api-loader';
9
+ import '@material/web/icon/icon';
10
+ import { placeResultToAddress } from './utils/place-result-to-address';
11
+ import { addressToString } from './utils/address-to-string';
12
+ import { validateStreet } from './utils/validate-street';
13
+ /**
14
+ * Single select input that searches Places using the Google Places API
15
+ *
16
+ * @element google-address-input
17
+ *
18
+ */
19
+ let GoogleAddressInput = class GoogleAddressInput extends TitaniumSingleSelectBase {
20
+ #googleMapsApiKey_accessor_storage;
21
+ /**
22
+ * **REQUIRED** GoogleAPI key for Places API
23
+ */
24
+ get googleMapsApiKey() { return this.#googleMapsApiKey_accessor_storage; }
25
+ set googleMapsApiKey(value) { this.#googleMapsApiKey_accessor_storage = value; }
26
+ #label_accessor_storage = 'Address';
27
+ get label() { return this.#label_accessor_storage; }
28
+ set label(value) { this.#label_accessor_storage = value; }
29
+ #placeholder_accessor_storage = 'Search for an address';
30
+ get placeholder() { return this.#placeholder_accessor_storage; }
31
+ set placeholder(value) { this.#placeholder_accessor_storage = value; }
32
+ #pathToSelectedText_accessor_storage = 'primaryDisplayText';
33
+ get pathToSelectedText() { return this.#pathToSelectedText_accessor_storage; }
34
+ set pathToSelectedText(value) { this.#pathToSelectedText_accessor_storage = value; }
35
+ #doSearchDebouncer = new Debouncer((searchTerm) => this.#doSearch(searchTerm));
36
+ #abortController = new AbortController();
37
+ #placesService;
38
+ #autoCompleteService;
39
+ async firstUpdated() {
40
+ const loader = new Loader({
41
+ apiKey: this.googleMapsApiKey,
42
+ version: 'weekly',
43
+ libraries: ['places'],
44
+ });
45
+ await loader.importLibrary('places');
46
+ this.#placesService = new google.maps.places.PlacesService(document.createElement('div'));
47
+ this.#autoCompleteService = new google.maps.places.AutocompleteService();
48
+ }
49
+ updated(changedProps) {
50
+ if (changedProps.has('selected')) {
51
+ //Re-write the primaryDisplayText
52
+ if (this.selected) {
53
+ const addressFormatted = addressToString(this.selected);
54
+ if (addressFormatted !== this.selected.primaryDisplayText) {
55
+ this.selected.primaryDisplayText = addressToString(this.selected);
56
+ this.requestUpdate('selected');
57
+ }
58
+ }
59
+ }
60
+ }
61
+ async #getSuggestions(searchTerm) {
62
+ return new Promise((res) => {
63
+ this.#autoCompleteService.getPlacePredictions({
64
+ input: searchTerm,
65
+ types: ['address'],
66
+ componentRestrictions: { country: 'us' },
67
+ }, (predictions, status) => {
68
+ if (status != google.maps.places.PlacesServiceStatus.OK || !predictions) {
69
+ console.warn(status);
70
+ return res([]);
71
+ }
72
+ return res(predictions.map((o) => ({
73
+ Id: o.place_id,
74
+ primaryDisplayText: o?.structured_formatting?.main_text || o.description,
75
+ secondaryText: o.structured_formatting?.secondary_text,
76
+ })));
77
+ });
78
+ });
79
+ }
80
+ async #getPlaceDetail(placeId) {
81
+ return new Promise((res, rej) => {
82
+ const request = {
83
+ placeId: placeId,
84
+ fields: ['address_components', 'formatted_address', 'geometry'],
85
+ };
86
+ this.#placesService.getDetails(request, (place, status) => {
87
+ if (status != google.maps.places.PlacesServiceStatus.OK || !place) {
88
+ return rej(status);
89
+ }
90
+ return res(place);
91
+ });
92
+ });
93
+ }
94
+ async #doSearch(searchTerm) {
95
+ if (!searchTerm) {
96
+ return;
97
+ }
98
+ this.#abortController.abort();
99
+ this.#abortController = new AbortController();
100
+ try {
101
+ const result = await this.#getSuggestions(searchTerm);
102
+ this.suggestions = result ?? [];
103
+ this.count = this.suggestions.length;
104
+ return;
105
+ }
106
+ catch (error) {
107
+ if (!error?.message?.includes('Abort error')) {
108
+ TitaniumSnackbarSingleton.open(error);
109
+ }
110
+ }
111
+ this.suggestions = [];
112
+ this.count = 0;
113
+ }
114
+ customCheckValidity() {
115
+ if (!this.selected && this.textfield?.value) {
116
+ this.errorText = 'Please enter a valid address in this field';
117
+ return false;
118
+ }
119
+ if (!this.required && !this.selected) {
120
+ return true;
121
+ }
122
+ if (!this.selected) {
123
+ this.errorText = 'Please enter a valid address in this field';
124
+ return false;
125
+ }
126
+ if (!validateStreet(this.selected?.street ?? '')) {
127
+ this.errorText = 'Please correct the invalid street';
128
+ return false;
129
+ }
130
+ if (!this.selected?.city) {
131
+ this.errorText = 'Please correct the missing city';
132
+ return false;
133
+ }
134
+ if (!this.selected?.state) {
135
+ this.errorText = 'Please correct the missing state';
136
+ return false;
137
+ }
138
+ if (!this.selected?.zip) {
139
+ this.errorText = 'Please correct the missing zip code';
140
+ return false;
141
+ }
142
+ return true;
143
+ }
144
+ customReportValidity() {
145
+ if (!this.customCheckValidity()) {
146
+ this.error = true;
147
+ }
148
+ else {
149
+ this.errorText = '';
150
+ this.error = false;
151
+ }
152
+ }
153
+ // Overloaded base
154
+ onInputChanged(searchTerm) {
155
+ this.#doSearchDebouncer.debounce(searchTerm);
156
+ }
157
+ async setSelected(entity) {
158
+ if (entity) {
159
+ try {
160
+ const place = await this.#getPlaceDetail(entity.Id);
161
+ const address = placeResultToAddress(place);
162
+ if (address) {
163
+ entity = { ...entity, ...address };
164
+ }
165
+ }
166
+ catch (error) {
167
+ TitaniumSnackbarSingleton.open(error);
168
+ }
169
+ }
170
+ super.setSelected(entity);
171
+ }
172
+ renderLeadingInputSlot() {
173
+ return html `<slot name="leading-icon" slot="leading-icon"><md-icon>place</md-icon></slot>`;
174
+ }
175
+ renderSelectedLeadingInputSlot(_item) {
176
+ return html ` <md-icon slot="leading-icon">place</md-icon> `;
177
+ }
178
+ renderSuggestion(item) {
179
+ return html `<md-menu-item .item=${item} ?selected=${this.selected?.Id === item.Id}>
180
+ <md-icon slot="start">place</md-icon>
181
+ <span slot="headline">${item.primaryDisplayText}</span>
182
+ <span slot="supporting-text">${item.secondaryText}</span>
183
+ </md-menu-item>`;
184
+ }
185
+ };
186
+ __decorate([
187
+ property({ type: String })
188
+ ], GoogleAddressInput.prototype, "googleMapsApiKey", null);
189
+ __decorate([
190
+ property({ type: String })
191
+ ], GoogleAddressInput.prototype, "label", null);
192
+ __decorate([
193
+ property({ type: String })
194
+ ], GoogleAddressInput.prototype, "placeholder", null);
195
+ __decorate([
196
+ property({ type: String })
197
+ ], GoogleAddressInput.prototype, "pathToSelectedText", null);
198
+ GoogleAddressInput = __decorate([
199
+ customElement('google-address-input')
200
+ ], GoogleAddressInput);
201
+ export { GoogleAddressInput };
202
+ //# sourceMappingURL=google-address-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"google-address-input.js","sourceRoot":"","sources":["google-address-input.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,OAAO,EAAkB,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,sDAAsD,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAE7E,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAEnD,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AwD;AAE9C;IAApC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4DAA4D;AAV5E,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CA+L9B"}
@@ -0,0 +1,30 @@
1
+ import { LitElement } from 'lit';
2
+ import { AddressInputAddress } from './types/address-input-address';
3
+ import '@material/web/icon/icon';
4
+ import '@material/web/select/outlined-select';
5
+ import '@material/web/select/select-option';
6
+ import '@material/web/dialog/dialog';
7
+ import '@material/web/textfield/outlined-text-field';
8
+ import { MdDialog } from '@material/web/dialog/dialog';
9
+ import { MdOutlinedTextField } from '@material/web/textfield/outlined-text-field';
10
+ import { MdOutlinedSelect } from '@material/web/select/outlined-select';
11
+ export declare class ManualAddressDialog extends LitElement {
12
+ protected dialog: MdDialog;
13
+ label: string;
14
+ showCounty: boolean;
15
+ showStreet2: boolean;
16
+ protected street: string;
17
+ protected street2: string;
18
+ protected city: string;
19
+ protected county: string;
20
+ protected state: string;
21
+ protected zip: string;
22
+ protected allInputs: NodeListOf<MdOutlinedTextField | MdOutlinedSelect>;
23
+ resolve: (value: Partial<AddressInputAddress> | null) => void;
24
+ open(address: AddressInputAddress | null | undefined): Promise<Partial<AddressInputAddress> | null>;
25
+ validate(): boolean;
26
+ reset(): Promise<void>;
27
+ static styles: import("lit").CSSResult[];
28
+ render(): import("lit-html").TemplateResult<1>;
29
+ }
30
+ //# sourceMappingURL=manual-address-dialog.d.ts.map
@@ -0,0 +1,250 @@
1
+ import { __decorate } from "tslib";
2
+ import { css, html, LitElement, nothing } from 'lit';
3
+ import { property, customElement, query, queryAll, state } from 'lit/decorators.js';
4
+ import '@material/web/icon/icon';
5
+ import '@material/web/select/outlined-select';
6
+ import '@material/web/select/select-option';
7
+ import '@material/web/dialog/dialog';
8
+ import '@material/web/textfield/outlined-text-field';
9
+ import { formStyles } from '../../../leavittbook/src/styles/form-styles';
10
+ import { allowDialogOverflow, preventDialogOverflow } from '../hacks/dialog-overflow-hacks';
11
+ let ManualAddressDialog = class ManualAddressDialog extends LitElement {
12
+ constructor() {
13
+ super(...arguments);
14
+ this.label = '';
15
+ this.street = '';
16
+ this.street2 = '';
17
+ this.city = '';
18
+ this.county = '';
19
+ this.state = '';
20
+ this.zip = '';
21
+ }
22
+ async open(address) {
23
+ this.reset();
24
+ await this.updateComplete;
25
+ this.street = address?.street ?? '';
26
+ this.street2 = address?.street2 ?? '';
27
+ this.city = address?.city ?? '';
28
+ this.state = address?.state ?? '';
29
+ this.zip = address?.zip ?? '';
30
+ this.county = address?.county ?? '';
31
+ this.dialog.show();
32
+ return new Promise((res) => {
33
+ this.resolve = res;
34
+ });
35
+ }
36
+ validate() {
37
+ let valid = true;
38
+ this.allInputs.forEach((input) => {
39
+ if (!input.reportValidity()) {
40
+ valid = false;
41
+ }
42
+ });
43
+ return valid;
44
+ }
45
+ async reset() {
46
+ this.street = '';
47
+ this.street2 = '';
48
+ this.city = '';
49
+ this.state = '';
50
+ this.zip = '';
51
+ this.county = '';
52
+ this.allInputs.forEach((input) => input.reset());
53
+ }
54
+ static { this.styles = [
55
+ formStyles,
56
+ css `
57
+ md-dialog {
58
+ width: -webkit-fill-available;
59
+ max-width: min(0% + 550px, 100% - 48px);
60
+ }
61
+ `,
62
+ ]; }
63
+ render() {
64
+ return html `
65
+ <md-dialog
66
+ @closing=${(e) => {
67
+ if (e.target.returnValue !== 'apply') {
68
+ this.resolve(null);
69
+ }
70
+ }}
71
+ >
72
+ <div slot="headline">${this.label}</div>
73
+ <form slot="content">
74
+ <md-outlined-text-field
75
+ label="Street"
76
+ required
77
+ .value=${this.street || ''}
78
+ @change=${(e) => (this.street = e.target.value)}
79
+ >
80
+ <md-icon slot="leading-icon">markunread_mailbox</md-icon>
81
+ </md-outlined-text-field>
82
+ ${this.showStreet2
83
+ ? html ` <md-outlined-text-field
84
+ label="Street 2"
85
+ .value=${this.street2 || ''}
86
+ @change=${(e) => (this.street2 = e.target.value)}
87
+ >
88
+ <md-icon slot="leading-icon">meeting_room</md-icon></md-outlined-text-field
89
+ >`
90
+ : nothing}
91
+ <md-outlined-text-field label="City" required .value=${this.city || ''} @change=${(e) => (this.city = e.target.value)}
92
+ ><md-icon slot="leading-icon">location_city</md-icon></md-outlined-text-field
93
+ >
94
+ ${!this.showCounty
95
+ ? nothing
96
+ : html `<md-outlined-text-field
97
+ label="County"
98
+ required
99
+ .value=${this.county || ''}
100
+ @change=${(e) => (this.county = e.target.value)}
101
+ ><md-icon slot="leading-icon">explore</md-icon></md-outlined-text-field
102
+ >`}
103
+
104
+ <md-outlined-select
105
+ @opening=${() => preventDialogOverflow(this.dialog)}
106
+ @closing=${() => allowDialogOverflow(this.dialog)}
107
+ label="State"
108
+ required
109
+ .value=${this.state || ''}
110
+ @request-selection=${(e) => {
111
+ e.stopPropagation();
112
+ this.state = e.target.value;
113
+ }}
114
+ >
115
+ <md-icon slot="location_on">location_on</md-icon>
116
+ <md-select-option value="AL">
117
+ <div slot="headline">Alabama</div>
118
+ </md-select-option>
119
+
120
+ <md-select-option value="AK"> <div slot="headline">Alaska</div></md-select-option>
121
+ <md-select-option value="AS"> <div slot="headline">American Samoa</div></md-select-option>
122
+ <md-select-option value="AZ"> <div slot="headline">Arizona</div></md-select-option>
123
+ <md-select-option value="AR"> <div slot="headline">Arkansas</div></md-select-option>
124
+ <md-select-option value="CA"> <div slot="headline">California</div></md-select-option>
125
+ <md-select-option value="CO"> <div slot="headline">Colorado</div></md-select-option>
126
+ <md-select-option value="CT"> <div slot="headline">Connecticut</div></md-select-option>
127
+ <md-select-option value="DE"> <div slot="headline">Delaware</div></md-select-option>
128
+ <md-select-option value="DC"> <div slot="headline">District of Columbia</div></md-select-option>
129
+ <md-select-option value="FM"> <div slot="headline">Federated States of Micronesia</div></md-select-option>
130
+ <md-select-option value="FL"> <div slot="headline">Florida</div></md-select-option>
131
+ <md-select-option value="GA"> <div slot="headline">Georgia</div></md-select-option>
132
+ <md-select-option value="GU"> <div slot="headline">Guam</div></md-select-option>
133
+ <md-select-option value="HI"> <div slot="headline">Hawaii</div></md-select-option>
134
+ <md-select-option value="ID"> <div slot="headline">Idaho</div></md-select-option>
135
+ <md-select-option value="IL"> <div slot="headline">Illinois</div></md-select-option>
136
+ <md-select-option value="IN"> <div slot="headline">Indiana</div></md-select-option>
137
+ <md-select-option value="IA"> <div slot="headline">Iowa</div></md-select-option>
138
+ <md-select-option value="KS"> <div slot="headline">Kansas</div></md-select-option>
139
+ <md-select-option value="KY"> <div slot="headline">Kentucky</div></md-select-option>
140
+ <md-select-option value="LA"> <div slot="headline">Louisiana</div></md-select-option>
141
+ <md-select-option value="ME"> <div slot="headline">Maine</div></md-select-option>
142
+ <md-select-option value="MH"> <div slot="headline">Marshall Islands</div></md-select-option>
143
+ <md-select-option value="MD"> <div slot="headline">Maryland</div></md-select-option>
144
+ <md-select-option value="MA"> <div slot="headline">Massachusetts</div></md-select-option>
145
+ <md-select-option value="MI"> <div slot="headline">Michigan</div></md-select-option>
146
+ <md-select-option value="MN"> <div slot="headline">Minnesota</div></md-select-option>
147
+ <md-select-option value="MS"> <div slot="headline">Mississippi</div></md-select-option>
148
+ <md-select-option value="MO"> <div slot="headline">Missouri</div></md-select-option>
149
+ <md-select-option value="MT"> <div slot="headline">Montana</div></md-select-option>
150
+ <md-select-option value="NE"> <div slot="headline">Nebraska</div></md-select-option>
151
+ <md-select-option value="NV"> <div slot="headline">Nevada</div></md-select-option>
152
+ <md-select-option value="NH"> <div slot="headline">New Hampshire</div></md-select-option>
153
+ <md-select-option value="NJ"> <div slot="headline">New Jersey</div></md-select-option>
154
+ <md-select-option value="NM"> <div slot="headline">New Mexico</div></md-select-option>
155
+ <md-select-option value="NY"> <div slot="headline">New York</div></md-select-option>
156
+ <md-select-option value="NC"> <div slot="headline">North Carolina</div></md-select-option>
157
+ <md-select-option value="ND"> <div slot="headline">North Dakota</div></md-select-option>
158
+ <md-select-option value="MP"> <div slot="headline">Northern Mariana Islands</div></md-select-option>
159
+ <md-select-option value="OH"> <div slot="headline">Ohio</div></md-select-option>
160
+ <md-select-option value="OK"> <div slot="headline">Oklahoma</div></md-select-option>
161
+ <md-select-option value="OR"> <div slot="headline">Oregon</div></md-select-option>
162
+ <md-select-option value="PW"> <div slot="headline">Palau</div></md-select-option>
163
+ <md-select-option value="PA"> <div slot="headline">Pennsylvania</div></md-select-option>
164
+ <md-select-option value="PR"> <div slot="headline">Puerto Rico</div></md-select-option>
165
+ <md-select-option value="RI"> <div slot="headline">Rhode Island</div></md-select-option>
166
+ <md-select-option value="SC"> <div slot="headline">South Carolina</div></md-select-option>
167
+ <md-select-option value="SD"> <div slot="headline">South Dakota</div></md-select-option>
168
+ <md-select-option value="TN"> <div slot="headline">Tennessee</div></md-select-option>
169
+ <md-select-option value="TX"> <div slot="headline">Texas</div></md-select-option>
170
+ <md-select-option value="UT"> <div slot="headline">Utah</div></md-select-option>
171
+ <md-select-option value="VT"> <div slot="headline">Vermont</div></md-select-option>
172
+ <md-select-option value="VI"> <div slot="headline">Virgin Islands</div></md-select-option>
173
+ <md-select-option value="VA"> <div slot="headline">Virginia</div></md-select-option>
174
+ <md-select-option value="WA"> <div slot="headline">Washington</div></md-select-option>
175
+ <md-select-option value="WV"> <div slot="headline">West Virginia</div></md-select-option>
176
+ <md-select-option value="WI"> <div slot="headline">Wisconsin</div></md-select-option>
177
+ <md-select-option value="WY"> <div slot="headline">Wyoming</div></md-select-option>
178
+ </md-outlined-select>
179
+ <md-outlined-text-field
180
+ label="Zip"
181
+ pattern="^\\d{5}$|^\\d{5}-\\d{4}$"
182
+ required
183
+ .value=${this.zip || ''}
184
+ @change=${(e) => (this.zip = e.target.value)}
185
+ ><md-icon slot="leading-icon">map</md-icon></md-outlined-text-field
186
+ >
187
+ </form>
188
+
189
+ <div slot="actions">
190
+ <md-text-button @click=${() => this.dialog.close('cancel')}> Cancel </md-text-button>
191
+ <md-text-button
192
+ @click=${() => {
193
+ if (this.validate()) {
194
+ this.dialog.close('apply');
195
+ const address = {
196
+ street: this.street,
197
+ street2: this.street2,
198
+ city: this.city,
199
+ state: this.state,
200
+ zip: this.zip,
201
+ county: this.county,
202
+ };
203
+ this.resolve(address);
204
+ }
205
+ }}
206
+ >Update</md-text-button
207
+ >
208
+ </div>
209
+ </md-dialog>
210
+ `;
211
+ }
212
+ };
213
+ __decorate([
214
+ query('md-dialog')
215
+ ], ManualAddressDialog.prototype, "dialog", void 0);
216
+ __decorate([
217
+ property({ type: String })
218
+ ], ManualAddressDialog.prototype, "label", void 0);
219
+ __decorate([
220
+ property({ type: Boolean, attribute: 'show-county' })
221
+ ], ManualAddressDialog.prototype, "showCounty", void 0);
222
+ __decorate([
223
+ property({ type: Boolean, attribute: 'show-street2' })
224
+ ], ManualAddressDialog.prototype, "showStreet2", void 0);
225
+ __decorate([
226
+ state()
227
+ ], ManualAddressDialog.prototype, "street", void 0);
228
+ __decorate([
229
+ state()
230
+ ], ManualAddressDialog.prototype, "street2", void 0);
231
+ __decorate([
232
+ state()
233
+ ], ManualAddressDialog.prototype, "city", void 0);
234
+ __decorate([
235
+ state()
236
+ ], ManualAddressDialog.prototype, "county", void 0);
237
+ __decorate([
238
+ state()
239
+ ], ManualAddressDialog.prototype, "state", void 0);
240
+ __decorate([
241
+ state()
242
+ ], ManualAddressDialog.prototype, "zip", void 0);
243
+ __decorate([
244
+ queryAll('md-outlined-text-field, md-outlined-select')
245
+ ], ManualAddressDialog.prototype, "allInputs", void 0);
246
+ ManualAddressDialog = __decorate([
247
+ customElement('manual-address-dialog')
248
+ ], ManualAddressDialog);
249
+ export { ManualAddressDialog };
250
+ //# sourceMappingURL=manual-address-dialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manual-address-dialog.js","sourceRoot":"","sources":["manual-address-dialog.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,KA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EAAE;gBACnB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBAC3B,MAAM,OAAO,GAAiC;oBAC5C,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,OAAO,EAAE,IAAI,CAAC,OAAO;oBACrB,IAAI,EAAE,IAAI,CAAC,IAAI;oBACf,KAAK,EAAE,IAAI,CAAC,KAAK;oBACjB,GAAG,EAAE,IAAI,CAAC,GAAG;oBACb,MAAM,EAAE,IAAI,CAAC,MAAM;iBACpB,CAAC;gBACF,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;aACvB;QACH,CAAC;;;;;KAKR,CAAC;IACJ,CAAC;;AArN6B;IAA7B,KAAK,CAAC,WAAW,CAAC;mDAA4B;AAEnB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAAoB;AACQ;IAAtD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;uDAAqB;AACnB;IAAvD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;wDAAsB;AAE1D;IAAlB,KAAK,EAAE;mDAA+B;AACpB;IAAlB,KAAK,EAAE;oDAAgC;AACrB;IAAlB,KAAK,EAAE;iDAA6B;AAClB;IAAlB,KAAK,EAAE;mDAA+B;AACpB;IAAlB,KAAK,EAAE;kDAA8B;AACnB;IAAlB,KAAK,EAAE;gDAA4B;AAE8B;IAAjE,QAAQ,CAAC,4CAA4C,CAAC;sDAAyE;AAdrH,mBAAmB;IAD/B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,mBAAmB,CAuN/B"}
@@ -0,0 +1,17 @@
1
+ export interface AddressInputAddress {
2
+ Id: string;
3
+ primaryDisplayText?: string;
4
+ secondaryText?: string;
5
+ street?: string;
6
+ street2?: string;
7
+ fullStreet?: string;
8
+ city?: string;
9
+ state?: string;
10
+ country?: string;
11
+ county?: string;
12
+ fullState?: string;
13
+ zip?: string;
14
+ latitude?: number;
15
+ longitude?: number;
16
+ }
17
+ //# sourceMappingURL=address-input-address.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=address-input-address.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address-input-address.js","sourceRoot":"","sources":["address-input-address.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address.js","sourceRoot":"","sources":["address.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autocomplete-prediction-suggestion.js","sourceRoot":"","sources":["autocomplete-prediction-suggestion.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import { AddressInputAddress } from '../types/address-input-address';
2
+ export declare function addressToString(location: AddressInputAddress | null | undefined): string;
3
+ //# sourceMappingURL=address-to-string.d.ts.map
@@ -0,0 +1,13 @@
1
+ export function addressToString(location) {
2
+ if (!location) {
3
+ return '';
4
+ }
5
+ if (!location.street) {
6
+ return `${location.city}, ${location.state}`;
7
+ }
8
+ if (!location.country) {
9
+ return `${location.street}${location.street2 ? ` ${location.street2}` : ''}, ${location.city}, ${location.state}`;
10
+ }
11
+ return `${location.street}${location.street2 ? ` ${location.street2}` : ''}, ${location.city}, ${location.state}, ${location.country === 'US' ? 'USA' : location.country}`;
12
+ }
13
+ //# sourceMappingURL=address-to-string.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address-to-string.js","sourceRoot":"","sources":["address-to-string.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,eAAe,CAAC,QAAgD;IAC9E,IAAI,CAAC,QAAQ,EAAE;QACb,OAAO,EAAE,CAAC;KACX;IAED,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;QACpB,OAAO,GAAG,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC,KAAK,EAAE,CAAC;KAC9C;IAED,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE;QACrB,OAAO,GAAG,QAAQ,CAAC,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC,KAAK,EAAE,CAAC;KACnH;IAED,OAAO,GAAG,QAAQ,CAAC,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC,KAAK,KAC7G,QAAQ,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,OAC/C,EAAE,CAAC;AACL,CAAC"}
@@ -0,0 +1,4 @@
1
+ /// <reference types="google.maps" />
2
+ import { AddressInputAddress } from '../types/address-input-address';
3
+ export declare function placeResultToAddress(place: google.maps.places.PlaceResult): Partial<AddressInputAddress> | null;
4
+ //# sourceMappingURL=place-result-to-address.d.ts.map
@@ -0,0 +1,33 @@
1
+ export function placeResultToAddress(place) {
2
+ if (!place || !place.address_components || !place.formatted_address) {
3
+ return null;
4
+ }
5
+ const neighborhood = place.address_components.find((o) => o.types.some((p) => p === 'neighborhood'));
6
+ const stateComponent = place.address_components.find((o) => o.types.some((p) => p === 'administrative_area_level_1'));
7
+ const streetNumberComponent = place.address_components.find((o) => o.types.some((p) => p === 'street_number'));
8
+ const streetAddressComponent = place.address_components.find((o) => o.types.some((p) => p === 'route'));
9
+ // GOOGLE flip-flops neighborhood and locality, neither can be used for a accurate city. formatted_address however seems to
10
+ // always show the accurate city.
11
+ const locality = place.address_components.find((o) => o.types.some((p) => p === 'locality'));
12
+ const sublocality = place.address_components.find((o) => o.types.some((p) => p === 'sublocality'));
13
+ const cityComponent = neighborhood?.short_name && place.formatted_address.includes(neighborhood.short_name + ',') ? neighborhood : locality ? locality : sublocality;
14
+ const zipCodeComponent = place.address_components.find((o) => o.types.some((p) => p === 'postal_code'));
15
+ const countyComponent = place.address_components.find((o) => o.types.some((p) => p === 'administrative_area_level_2'));
16
+ const countryComponent = place.address_components.find((o) => o.types.some((p) => p === 'country'));
17
+ const location = {
18
+ street: streetNumberComponent?.short_name
19
+ ? `${streetNumberComponent?.short_name} ${streetAddressComponent?.short_name}`
20
+ : streetAddressComponent?.short_name,
21
+ fullStreet: `${streetNumberComponent?.long_name} ${streetAddressComponent?.long_name}`,
22
+ city: cityComponent?.short_name,
23
+ county: countyComponent?.short_name,
24
+ country: countryComponent?.short_name,
25
+ state: stateComponent?.short_name,
26
+ fullState: stateComponent?.long_name,
27
+ zip: zipCodeComponent?.short_name,
28
+ latitude: place.geometry?.location?.lat(),
29
+ longitude: place.geometry?.location?.lng(),
30
+ };
31
+ return location;
32
+ }
33
+ //# sourceMappingURL=place-result-to-address.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"place-result-to-address.js","sourceRoot":"","sources":["place-result-to-address.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,oBAAoB,CAAC,KAAqC;IACxE,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,kBAAkB,IAAI,CAAC,KAAK,CAAC,iBAAiB,EAAE;QACnE,OAAO,IAAI,CAAC;KACb;IAED,MAAM,YAAY,GAAG,KAAK,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,cAAc,CAAC,CAAC,CAAC;IACrG,MAAM,cAAc,GAAG,KAAK,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,6BAA6B,CAAC,CAAC,CAAC;IACtH,MAAM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C;IACxG,MAAM,eAAe,GAAG,KAAK,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,6BAA6B,CAAC,CAAC,CAAC;IACvH,MAAM,gBAAgB,GAAG,KAAK,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC;IACpG,MAAM,QAAQ,GAAiC;QAC7C,MAAM,EAAE,qBAAqB,EAAE,UAAU;YACvC,CAAC,CAAC,GAAG,qBAAqB,EAAE,UAAU,IAAI,sBAAsB,EAAE,UAAU,EAAE;YAC9E,CAAC,CAAC,sBAAsB,EAAE,UAAU;QACtC,UAAU,EAAE,GAAG,qBAAqB,EAAE,SAAS,IAAI,sBAAsB,EAAE,SAAS,EAAE;QACtF,IAAI,EAAE,aAAa,EAAE,UAAU;QAC/B,MAAM,EAAE,eAAe,EAAE,UAAU;QACnC,OAAO,EAAE,gBAAgB,EAAE,UAAU;QACrC,KAAK,EAAE,cAAc,EAAE,UAAU;QACjC,SAAS,EAAE,cAAc,EAAE,SAAS;QACpC,GAAG,EAAE,gBAAgB,EAAE,UAAU;QACjC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE;QACzC,SAAS,EAAE,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE;KAC3C,CAAC;IAEF,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function validateStreet(street: string): boolean;
2
+ //# sourceMappingURL=validate-street.d.ts.map
@@ -0,0 +1,8 @@
1
+ export function validateStreet(street) {
2
+ const streetRegex = new RegExp(/^(?=.{1,64}$)[a-zA-Z \-\.\d #'\.,]{1,64}[\s][a-zA-Z \-\.\d #'\.,]{1,64}$/);
3
+ const uppercaseRegex = new RegExp('[A-Z]');
4
+ const lowercaseRegex = new RegExp('[a-z]');
5
+ const numberRegex = new RegExp('[0-9]');
6
+ return streetRegex.test(street) ? (uppercaseRegex.test(street) || lowercaseRegex.test(street)) && numberRegex.test(street) : !1;
7
+ }
8
+ //# sourceMappingURL=validate-street.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-street.js","sourceRoot":"","sources":["validate-street.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,MAAM,WAAW,GAAG,IAAI,MAAM,CAAC,0EAA0E,CAAC,CAAC;IAC3G,MAAM,cAAc,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;IAC3C,MAAM,cAAc,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;IAC3C,MAAM,WAAW,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;IAExC,OAAO,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClI,CAAC"}