@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,605 @@
1
+ import { __decorate } from "tslib";
2
+ import './page-control';
3
+ import '@material/web/checkbox/checkbox';
4
+ import '@material/web/progress/linear-progress';
5
+ import '@material/web/icon/icon';
6
+ import { css, html, LitElement } from 'lit';
7
+ import { property, customElement, query, queryAsync } from 'lit/decorators.js';
8
+ import { DataTableItemDropEvent } from './data-table-item';
9
+ import { h1, ellipsis } from '../../titanium/styles/styles';
10
+ /**
11
+ * Material design inspired data table with paging, sorting, multi/single select, table actions, selected actions and more!
12
+ *
13
+ * @element titanium-data-table
14
+ *
15
+ * @fires selected-changed - Fired when a row or rows in the data table is selected. detail: array<unknown>
16
+ * @fires titanium-data-table-items-reorder - Fired when table items are resorted by user.
17
+ * @fires paging-changed - Fired when take or page is changed by click or keyboard action.
18
+ *
19
+ * @slot table-actions - item nonspecific table buttons such as add new item
20
+ * @slot filter-button - filter button slot
21
+ * @slot filters - filter chips slot
22
+ * @slot search-button - search button slot
23
+ * @slot selected-actions - item specific table buttons such as edit, delete shown when one or more items are selected
24
+ * @slot table-headers - slot for table headers (ex. titanium-data-table-header)
25
+ * @slot items - slot for table rows (ex. titanium-data-table-item)
26
+ * @slot footer - slot for additional footer items. Slotting here overwrites footer-buttons.
27
+ * @slot footer-buttons - slot for footer action buttons
28
+ *
29
+ * @cssprop {Color} [var(--md-sys-color-outline-variant)] - Table border color
30
+ * @cssprop {Color} [--titanium-data-table-font-family=Roboto, Noto, sans-serif] - Set the font family used on the data table and paging control
31
+ */
32
+ let TitaniumDataTable = class TitaniumDataTable extends LitElement {
33
+ constructor() {
34
+ super(...arguments);
35
+ /**
36
+ * Available page sizes
37
+ */
38
+ this.pageSizes = [10, 15, 20, 50];
39
+ /**
40
+ * The default page size before the user changes it
41
+ */
42
+ this.defaultPageSize = 10;
43
+ /**
44
+ * Current items displayed on the table.
45
+ */
46
+ this.items = [];
47
+ /**
48
+ * Disables all item selection on the data-table.
49
+ */
50
+ this.disableSelect = false;
51
+ /**
52
+ * Disables paging.
53
+ */
54
+ this.disablePaging = false;
55
+ /**
56
+ * Array of currently selected data table objects
57
+ */
58
+ this.selected = [];
59
+ /**
60
+ * Sets if view port is small
61
+ */
62
+ this.narrow = false;
63
+ this.#openCount = 0;
64
+ }
65
+ #openCount;
66
+ /**
67
+ * returns internal pageControl's current take
68
+ */
69
+ async getTake() {
70
+ return (await this.pageControl)?.take ?? 0;
71
+ }
72
+ /**
73
+ * returns internal pageControl's current page
74
+ */
75
+ async getPage() {
76
+ return (await this.pageControl)?.page ?? 0;
77
+ }
78
+ /**
79
+ * sets internal pageControl's current take
80
+ */
81
+ async setTake(take) {
82
+ const control = await this.pageControl;
83
+ if (control) {
84
+ control.take = take;
85
+ }
86
+ }
87
+ /**
88
+ * sets internal pageControl's current page
89
+ */
90
+ async setPage(page) {
91
+ const control = await this.pageControl;
92
+ if (control) {
93
+ control.page = page;
94
+ }
95
+ }
96
+ /**
97
+ * resets internal pageControl's current page to 0
98
+ */
99
+ async resetPage() {
100
+ await this.setPage(0);
101
+ }
102
+ async firstUpdated() {
103
+ if (typeof ResizeObserver === 'function') {
104
+ const ro = new ResizeObserver(entries => {
105
+ for (const entry of entries) {
106
+ const cr = entry.contentRect;
107
+ this.narrow = cr.width < 560;
108
+ this.updateChildrenIsNarrow();
109
+ }
110
+ });
111
+ ro.observe(this);
112
+ }
113
+ else {
114
+ const mql = window.matchMedia('(max-width: 768px)');
115
+ mql.addEventListener('change', e => {
116
+ this.narrow = e.matches;
117
+ this.updateChildrenIsNarrow();
118
+ });
119
+ this.narrow = mql.matches;
120
+ this.updateChildrenIsNarrow();
121
+ }
122
+ this.addEventListener(DataTableItemDropEvent.eventType, (e) => {
123
+ e.stopPropagation();
124
+ //HoverIndex cannot be dropped beyond the length of the array
125
+ const hoverIndex = Math.min(e.hoverIndex, this.items.length - 1);
126
+ //Ignore if item goes back to where it started
127
+ if (hoverIndex !== e.originIndex) {
128
+ const temp = this.items[e.originIndex];
129
+ this.items.splice(e.originIndex, 1);
130
+ this.items.splice(hoverIndex, 0, temp);
131
+ /**
132
+ * @ignore
133
+ */
134
+ this.dispatchEvent(new DataTableItemsReorderedEvent());
135
+ }
136
+ });
137
+ //When slotted in items change, sync the narrow prop
138
+ this.tableHeaders.addEventListener('slotchange', () => this.updateChildrenIsNarrow());
139
+ this.itemsSlot.addEventListener('slotchange', () => this.updateChildrenIsNarrow());
140
+ await (await this.pageControl)?.updateComplete;
141
+ }
142
+ /**
143
+ * @ignore
144
+ */
145
+ updateChildrenIsNarrow() {
146
+ this.itemsSlot.assignedElements().forEach(o => (o.narrow = this.narrow));
147
+ this.tableHeaders.assignedElements().forEach(o => (o.narrow = this.narrow));
148
+ }
149
+ /**
150
+ * de-select all table items and clear this.selected
151
+ */
152
+ clearSelection() {
153
+ this.#deselectAll();
154
+ // Ensure the collection is empty, deselect can cause a race condition
155
+ // between deselecting and UI drawing new items.
156
+ if (this.selected.length > 0) {
157
+ this.selected = [];
158
+ this.#notifySelectedChanged();
159
+ }
160
+ }
161
+ updated(changedProps) {
162
+ if (changedProps.has('items') && changedProps.get('items') !== this.items) {
163
+ // Clear selection when items array changes.
164
+ this.clearSelection();
165
+ }
166
+ }
167
+ #notifySelectedChanged() {
168
+ this.dispatchEvent(new CustomEvent('selected-changed', { composed: true, detail: this.selected }));
169
+ }
170
+ /**
171
+ * display linear progress bar while promise is active
172
+ */
173
+ async loadWhile(promise) {
174
+ this.isLoading = true;
175
+ this.#openCount++;
176
+ try {
177
+ await promise;
178
+ }
179
+ finally {
180
+ this.#openCount--;
181
+ if (this.#openCount === 0) {
182
+ this.isLoading = false;
183
+ }
184
+ }
185
+ }
186
+ #deselectAll() {
187
+ this.#getTableItems().forEach(o => o.deselect());
188
+ }
189
+ /**
190
+ * select all table items
191
+ */
192
+ selectAll() {
193
+ if (!this.singleSelect) {
194
+ this.#getTableItems().forEach(o => o.select());
195
+ }
196
+ }
197
+ #getTableItems() {
198
+ return this.itemsSlot.assignedElements().filter(o => typeof o.select === 'function' && typeof o.deselect === 'function');
199
+ }
200
+ static { this.styles = [
201
+ h1,
202
+ ellipsis,
203
+ css `
204
+ :host {
205
+ display: flex;
206
+ flex-direction: column;
207
+
208
+ border: 1px solid var(--md-sys-color-outline-variant);
209
+ border-radius: 8px;
210
+ font-family: var(--titanium-data-table-font-family, Roboto, Noto, sans-serif);
211
+ --titanium-page-control-font-family: var(--titanium-data-table-font-family, Roboto, Noto, sans-serif);
212
+ -webkit-font-smoothing: antialiased;
213
+ }
214
+
215
+ header {
216
+ display: flex;
217
+ flex-direction: column;
218
+ padding-bottom: 12px;
219
+ gap: 12px;
220
+ border-bottom: 1px solid var(--md-sys-color-outline-variant);
221
+ position: relative;
222
+ }
223
+
224
+ /* HEADER ROW ONE */
225
+
226
+ section[row-one] {
227
+ display: grid;
228
+ grid: 'head menu' / 1fr auto;
229
+ gap: 8px;
230
+ padding: 12px 12px 0 12px;
231
+ }
232
+
233
+ section[row-one] div[head] {
234
+ grid-area: head;
235
+ }
236
+
237
+ section[row-one] div[menu] {
238
+ grid-area: menu;
239
+ }
240
+
241
+ div[search] {
242
+ grid-area: search;
243
+ }
244
+
245
+ /* HEADER ROW TWO */
246
+
247
+ section[row-two] {
248
+ display: grid;
249
+ grid: 'search-filter add' / 1fr auto;
250
+ gap: 8px;
251
+ padding: 0 12px 0 20px;
252
+ }
253
+
254
+ :host([narrow]) section[row-two] {
255
+ grid:
256
+ 'search-filter '
257
+ 'add' / auto;
258
+ }
259
+
260
+ section[row-two] div[search-filter] {
261
+ grid-area: search-filter;
262
+ display: flex;
263
+ flex-wrap: wrap;
264
+ align-items: center;
265
+ gap: 8px;
266
+ }
267
+
268
+ section[row-two] div[add-button] {
269
+ grid-area: add;
270
+ justify-self: end;
271
+ align-self: end;
272
+ }
273
+
274
+ h1 {
275
+ padding: 12px 12px 0 12px;
276
+ }
277
+
278
+ selected-actions {
279
+ display: grid;
280
+ gap: 6px 24px;
281
+ grid: 'selected-text buttons';
282
+ background-color: var(--md-sys-color-secondary-container);
283
+ position: absolute;
284
+ top: 0px;
285
+ left: 0px;
286
+ right: 0px;
287
+ bottom: 0px;
288
+ margin: 0 !important;
289
+ padding: 0 12px 12px 24px;
290
+ align-content: end;
291
+ }
292
+
293
+ selected-actions h2 {
294
+ color: var(--md-sys-color-on-secondary-container);
295
+ font-size: 18px;
296
+ font-weight: 400;
297
+ align-self: end;
298
+ }
299
+
300
+ selected-actions div[buttons] {
301
+ display: flex;
302
+ flex-wrap: wrap;
303
+ align-items: center;
304
+ gap: 0 8px;
305
+ justify-content: flex-end;
306
+ }
307
+
308
+ table-header {
309
+ display: flex;
310
+ flex-direction: row;
311
+ min-height: 48px;
312
+ border-bottom: 1px solid var(--md-sys-color-outline-variant);
313
+ }
314
+
315
+ table-header ::slotted(titanium-data-table-header:last-of-type) {
316
+ padding-right: 24px;
317
+ }
318
+
319
+ md-linear-progress {
320
+ width: 100%;
321
+ margin-top: -4px;
322
+ }
323
+
324
+ main {
325
+ position: relative;
326
+ min-height: 48px;
327
+ }
328
+
329
+ content-veil {
330
+ display: none;
331
+ position: absolute;
332
+ top: 0;
333
+ left: 0;
334
+ width: 100%;
335
+ height: 100%;
336
+ background-color: var(--md-sys-color-scrim);
337
+ opacity: 0;
338
+ -webkit-transition: opacity 75ms linear;
339
+ -o-transition: opacity 75ms linear;
340
+ transition: opacity 75ms linear;
341
+ z-index: 6;
342
+ }
343
+
344
+ content-veil[opened] {
345
+ opacity: 0.12;
346
+ display: block;
347
+ }
348
+
349
+ table-message {
350
+ display: flex;
351
+ place-items: center;
352
+ justify-content: center;
353
+ gap: 8px;
354
+ padding: 64px;
355
+
356
+ font-size: 14px;
357
+ z-index: 10;
358
+ line-height: 20px;
359
+ border-bottom: 1px solid var(--md-sys-color-outline-variant);
360
+ }
361
+
362
+ table-message md-icon {
363
+ align-self: center;
364
+ flex-shrink: 0;
365
+ }
366
+
367
+ footer {
368
+ display: grid;
369
+ grid: 'controls footer-slot' / minmax(400px, 1fr) auto;
370
+ gap: 24px;
371
+ padding: 12px;
372
+ align-items: center;
373
+ margin-top: -1px;
374
+ border-top: 1px solid var(--md-sys-color-outline-variant);
375
+ }
376
+
377
+ titanium-page-control {
378
+ grid-area: controls;
379
+ margin-left: 12px;
380
+ justify-self: start;
381
+ }
382
+
383
+ div[footer] {
384
+ justify-self: end;
385
+ }
386
+
387
+ :host([narrow]) footer {
388
+ grid:
389
+ 'controls'
390
+ 'footer-slot' / auto;
391
+ }
392
+
393
+ :host([disable-paging]) footer {
394
+ grid: 'footer-slot' / auto;
395
+ }
396
+
397
+ footer-buttons {
398
+ display: flex;
399
+ gap: 12px;
400
+ flex-wrap: wrap;
401
+ align-items: flex-end;
402
+ }
403
+
404
+ div[add-button] {
405
+ display: flex;
406
+ align-items: center;
407
+ }
408
+
409
+ div[items-slot] {
410
+ position: relative;
411
+ }
412
+
413
+ md-checkbox {
414
+ flex-shrink: 0;
415
+ align-self: center;
416
+ margin: 0 14px 0 20px;
417
+ }
418
+
419
+ :host([disable-select]) table-header ::slotted(titanium-data-table-header:first-of-type) {
420
+ padding-left: 24px;
421
+ }
422
+
423
+ :host(:not([disable-select])[single-select]) table-header {
424
+ padding-left: 57px;
425
+ }
426
+
427
+ [hidden] {
428
+ display: none !important;
429
+ }
430
+ `,
431
+ ]; }
432
+ render() {
433
+ return html `
434
+ <header part="header">
435
+ <section row-one>
436
+ <div head ellipsis part="table-header-text-container">
437
+ <slot name="table-header-text"> <h1 ellipsis>${this.header}</h1></slot>
438
+ </div>
439
+ <div menu part="table-actions-container">
440
+ <slot name="table-actions"></slot>
441
+ </div>
442
+ </section>
443
+ <section row-two>
444
+ <div search-filter part="filters-container">
445
+ <slot name="search-button"></slot>
446
+ <slot name="filter-button"></slot>
447
+ <slot name="filters"></slot>
448
+ </div>
449
+ <div add-button part="add-button-container">
450
+ <slot name="add-button"></slot>
451
+ </div>
452
+ </section>
453
+
454
+ <selected-actions ?hidden="${this.selected.length === 0}">
455
+ <h2 ellipsis>${this.selected.length} item${this.selected.length > 1 ? 's' : ''} selected</h2>
456
+ <div buttons part="selected-actions-container">
457
+ <slot name="selected-actions"></slot>
458
+ </div>
459
+ </selected-actions>
460
+ </header>
461
+
462
+ <table-container
463
+ @titanium-data-table-item-selected-changed=${e => {
464
+ e.stopPropagation();
465
+ const dataTableItem = e.target;
466
+ if (dataTableItem.selected) {
467
+ if (this.singleSelect) {
468
+ this.#getTableItems()
469
+ .filter(o => o.item !== dataTableItem.item)
470
+ .forEach(o => o.deselect());
471
+ }
472
+ this.selected.push(dataTableItem.item);
473
+ this.requestUpdate();
474
+ this.#notifySelectedChanged();
475
+ }
476
+ else {
477
+ this.selected.splice(this.selected.indexOf(dataTableItem.item), 1);
478
+ this.requestUpdate();
479
+ this.#notifySelectedChanged();
480
+ }
481
+ }}
482
+ >
483
+ <table-header part="table-header-container">
484
+ ${this.disableSelect || this.singleSelect
485
+ ? ''
486
+ : html `
487
+ <md-checkbox
488
+ title="${this.selected.length > 0 ? 'Deselect' : 'Select'} all checkboxes"
489
+ aria-label="${this.selected.length > 0 ? 'Deselect' : 'Select'} all checkboxes"
490
+ ?checked=${this.selected.length > 0}
491
+ ?indeterminate=${this.selected.length !== 0 && this.selected.length !== this.items.length}
492
+ @click=${() => {
493
+ this.selected.length > 0 ? this.#deselectAll() : this.selectAll();
494
+ this.checkbox.focus();
495
+ }}
496
+ ></md-checkbox>
497
+ `}
498
+ <slot name="table-headers"></slot>
499
+ </table-header>
500
+ <md-linear-progress ?hidden=${!this.isLoading} ?closed=${!this.isLoading} indeterminate></md-linear-progress>
501
+
502
+ <main>
503
+ <div items-slot part="items-container">
504
+ <slot name="items"></slot>
505
+ </div>
506
+ <table-message ?hidden=${this.isLoading || this.items.length > 0}>
507
+ <md-icon>info</md-icon>
508
+ ${this.searchTerm === '' || typeof this.searchTerm === 'undefined' || this.searchTerm === null
509
+ ? 'No results'
510
+ : `Your search of '${this.searchTerm}' did not match any results`}</table-message
511
+ >
512
+ <table-message ?hidden=${!this.isLoading || this.items.length !== 0}> Loading data... </table-message>
513
+ <content-veil ?opened=${this.isLoading}></content-veil>
514
+ </main>
515
+ </table-container>
516
+ <footer part="footer-container">
517
+ <slot name="footer">
518
+ ${this.disablePaging
519
+ ? ''
520
+ : html `
521
+ <titanium-page-control
522
+ label="Rows per page"
523
+ ?disabled=${this.isLoading}
524
+ .count=${this.count}
525
+ .pageSizes=${this.pageSizes}
526
+ .defaultPageSize=${this.defaultPageSize}
527
+ .localStorageKey="${this.header}-take"
528
+ @action=${() => {
529
+ this.dispatchEvent(new CustomEvent('paging-changed', { composed: true }));
530
+ }}
531
+ ></titanium-page-control>
532
+ `}
533
+ <div footer>
534
+ <footer-buttons><slot name="footer-buttons"></slot></footer-buttons>
535
+ </div>
536
+ </slot>
537
+ </footer>
538
+ `;
539
+ }
540
+ };
541
+ __decorate([
542
+ property({ type: String })
543
+ ], TitaniumDataTable.prototype, "header", void 0);
544
+ __decorate([
545
+ property({ type: String })
546
+ ], TitaniumDataTable.prototype, "localStorageKey", void 0);
547
+ __decorate([
548
+ property({ type: Array })
549
+ ], TitaniumDataTable.prototype, "pageSizes", void 0);
550
+ __decorate([
551
+ property({ type: Number, attribute: 'default-page-size' })
552
+ ], TitaniumDataTable.prototype, "defaultPageSize", void 0);
553
+ __decorate([
554
+ property({ type: Number })
555
+ ], TitaniumDataTable.prototype, "count", void 0);
556
+ __decorate([
557
+ property({ type: Array })
558
+ ], TitaniumDataTable.prototype, "items", void 0);
559
+ __decorate([
560
+ property({ type: String })
561
+ ], TitaniumDataTable.prototype, "searchTerm", void 0);
562
+ __decorate([
563
+ property({ type: Boolean, attribute: 'single-select', reflect: true })
564
+ ], TitaniumDataTable.prototype, "singleSelect", void 0);
565
+ __decorate([
566
+ property({ type: Boolean, attribute: 'disable-select' })
567
+ ], TitaniumDataTable.prototype, "disableSelect", void 0);
568
+ __decorate([
569
+ property({ type: Boolean, attribute: 'disable-paging', reflect: true })
570
+ ], TitaniumDataTable.prototype, "disablePaging", void 0);
571
+ __decorate([
572
+ property({ type: Array })
573
+ ], TitaniumDataTable.prototype, "selected", void 0);
574
+ __decorate([
575
+ property({ type: Boolean })
576
+ ], TitaniumDataTable.prototype, "isLoading", void 0);
577
+ __decorate([
578
+ query('slot[name="items"]')
579
+ ], TitaniumDataTable.prototype, "itemsSlot", void 0);
580
+ __decorate([
581
+ query('slot[name="table-headers"]')
582
+ ], TitaniumDataTable.prototype, "tableHeaders", void 0);
583
+ __decorate([
584
+ query('div[items-slot]')
585
+ ], TitaniumDataTable.prototype, "itemsContainer", void 0);
586
+ __decorate([
587
+ property({ type: Boolean, reflect: true, attribute: 'narrow' })
588
+ ], TitaniumDataTable.prototype, "narrow", void 0);
589
+ __decorate([
590
+ query('md-checkbox')
591
+ ], TitaniumDataTable.prototype, "checkbox", void 0);
592
+ __decorate([
593
+ queryAsync('titanium-page-control')
594
+ ], TitaniumDataTable.prototype, "pageControl", void 0);
595
+ TitaniumDataTable = __decorate([
596
+ customElement('titanium-data-table')
597
+ ], TitaniumDataTable);
598
+ export { TitaniumDataTable };
599
+ export class DataTableItemsReorderedEvent extends Event {
600
+ static { this.eventType = 'titanium-data-table-items-reorder'; }
601
+ constructor() {
602
+ super(DataTableItemsReorderedEvent.eventType);
603
+ }
604
+ }
605
+ //# sourceMappingURL=data-table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-table.js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,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { Filter } from './filter';
2
+ export declare class FilterController<TKey extends string> {
3
+ #private;
4
+ subscribeToFilterChange(callback: () => void): void;
5
+ unsubscribeFromFilterChange(callback: () => void): void;
6
+ /**
7
+ *
8
+ */
9
+ constructor(path: string);
10
+ /**
11
+ * Set values of filters based on query string data
12
+ *
13
+ * @returns True if values of filter change from query string data
14
+ */
15
+ loadFromQueryString(): boolean;
16
+ get filters(): Filter[];
17
+ getActiveFilterOdata(): string[];
18
+ setValue(key: TKey, value: string | null): void;
19
+ getValue(key: TKey): string | null | undefined;
20
+ setFilter(key: TKey, oDataFilter: (value: string) => string, initialValue?: string | null): void;
21
+ getFilter(key: TKey): Filter | undefined;
22
+ }
23
+ //# sourceMappingURL=filter-controller.d.ts.map