@aurelia-mdc-web/all 9.3.1-au2 → 9.3.3-au2

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 (621) hide show
  1. package/dist/alert/alert-configuration.js +15 -0
  2. package/dist/alert/alert-configuration.js.map +1 -0
  3. package/dist/alert/alert-modal/alert-modal.html +27 -0
  4. package/dist/alert/alert-modal/alert-modal.js +30 -0
  5. package/dist/alert/alert-modal/alert-modal.js.map +1 -0
  6. package/dist/alert/alert-modal/i-alert-modal-payload.js +14 -0
  7. package/dist/alert/alert-modal/i-alert-modal-payload.js.map +1 -0
  8. package/dist/alert/alert-service.js +106 -0
  9. package/dist/alert/alert-service.js.map +1 -0
  10. package/dist/alert/decorators/confirm-action.js +17 -0
  11. package/dist/alert/decorators/confirm-action.js.map +1 -0
  12. package/dist/alert/decorators/using-progress.js +27 -0
  13. package/dist/alert/decorators/using-progress.js.map +1 -0
  14. package/dist/alert/exceptions-tracker.js +8 -0
  15. package/dist/alert/exceptions-tracker.js.map +1 -0
  16. package/dist/alert/global-progress/global-progress.html +9 -0
  17. package/dist/alert/global-progress/global-progress.js +64 -0
  18. package/dist/alert/global-progress/global-progress.js.map +1 -0
  19. package/dist/alert/prompt-dialog/prompt-dialog.html +15 -0
  20. package/dist/alert/prompt-dialog/prompt-dialog.js +44 -0
  21. package/dist/alert/prompt-dialog/prompt-dialog.js.map +1 -0
  22. package/dist/banner/mdc-banner.html +21 -21
  23. package/dist/banner/mdc-banner.js +45 -42
  24. package/dist/banner/mdc-banner.js.map +1 -1
  25. package/dist/base/attributes/mdc-focus-trap.js +25 -22
  26. package/dist/base/attributes/mdc-focus-trap.js.map +1 -1
  27. package/dist/base/elements/i-validated-element.js +2 -1
  28. package/dist/base/elements/i-validated-element.js.map +1 -1
  29. package/dist/base/elements/mdc-promisify-reference.js +16 -13
  30. package/dist/base/elements/mdc-promisify-reference.js.map +1 -1
  31. package/dist/base/index.js +21 -9
  32. package/dist/base/index.js.map +1 -1
  33. package/dist/base/interceptors.js +12 -5
  34. package/dist/base/interceptors.js.map +1 -1
  35. package/dist/base/material-palette.js +4 -1
  36. package/dist/base/material-palette.js.map +1 -1
  37. package/dist/base/mdc-component.js +5 -1
  38. package/dist/base/mdc-component.js.map +1 -1
  39. package/dist/base/next-element.js +4 -1
  40. package/dist/base/next-element.js.map +1 -1
  41. package/dist/button/enhance-mdc-button.js +9 -6
  42. package/dist/button/enhance-mdc-button.js.map +1 -1
  43. package/dist/button/mdc-button-label.js +9 -6
  44. package/dist/button/mdc-button-label.js.map +1 -1
  45. package/dist/button/mdc-button.html +12 -12
  46. package/dist/button/mdc-button.js +30 -27
  47. package/dist/button/mdc-button.js.map +1 -1
  48. package/dist/card/mdc-card-action-buttons.js +9 -6
  49. package/dist/card/mdc-card-action-buttons.js.map +1 -1
  50. package/dist/card/mdc-card-action-icons.js +9 -6
  51. package/dist/card/mdc-card-action-icons.js.map +1 -1
  52. package/dist/card/mdc-card-actions/mdc-card-actions.html +3 -3
  53. package/dist/card/mdc-card-actions/mdc-card-actions.js +15 -12
  54. package/dist/card/mdc-card-actions/mdc-card-actions.js.map +1 -1
  55. package/dist/card/mdc-card-media/mdc-card-media.html +5 -5
  56. package/dist/card/mdc-card-media/mdc-card-media.js +18 -15
  57. package/dist/card/mdc-card-media/mdc-card-media.js.map +1 -1
  58. package/dist/card/mdc-card-primary-action.html +5 -5
  59. package/dist/card/mdc-card-primary-action.js +15 -12
  60. package/dist/card/mdc-card-primary-action.js.map +1 -1
  61. package/dist/card/mdc-card.html +3 -3
  62. package/dist/card/mdc-card.js +15 -12
  63. package/dist/card/mdc-card.js.map +1 -1
  64. package/dist/checkbox/mdc-checkbox.html +12 -12
  65. package/dist/checkbox/mdc-checkbox.js +38 -35
  66. package/dist/checkbox/mdc-checkbox.js.map +1 -1
  67. package/dist/chips/mdc-chip/mdc-chip.html +24 -24
  68. package/dist/chips/mdc-chip/mdc-chip.js +37 -34
  69. package/dist/chips/mdc-chip/mdc-chip.js.map +1 -1
  70. package/dist/chips/mdc-chip-action/enhance-mdc-chip-action.js +9 -6
  71. package/dist/chips/mdc-chip-action/enhance-mdc-chip-action.js.map +1 -1
  72. package/dist/chips/mdc-chip-action/mdc-chip-action.html +25 -25
  73. package/dist/chips/mdc-chip-action/mdc-chip-action.js +40 -37
  74. package/dist/chips/mdc-chip-action/mdc-chip-action.js.map +1 -1
  75. package/dist/chips/mdc-chip-set/mdc-chip-set.html +10 -10
  76. package/dist/chips/mdc-chip-set/mdc-chip-set.js +27 -24
  77. package/dist/chips/mdc-chip-set/mdc-chip-set.js.map +1 -1
  78. package/dist/circular-progress/mdc-circular-progress.html +38 -38
  79. package/dist/circular-progress/mdc-circular-progress.js +25 -22
  80. package/dist/circular-progress/mdc-circular-progress.js.map +1 -1
  81. package/dist/data-table/mdc-data-table-row.js +13 -10
  82. package/dist/data-table/mdc-data-table-row.js.map +1 -1
  83. package/dist/data-table/mdc-data-table.html +50 -49
  84. package/dist/data-table/mdc-data-table.js +183 -91
  85. package/dist/data-table/mdc-data-table.js.map +1 -1
  86. package/dist/dialog/mdc-dialog-actions.js +13 -10
  87. package/dist/dialog/mdc-dialog-actions.js.map +1 -1
  88. package/dist/dialog/mdc-dialog-content.js +9 -6
  89. package/dist/dialog/mdc-dialog-content.js.map +1 -1
  90. package/dist/dialog/mdc-dialog-service.js +20 -13
  91. package/dist/dialog/mdc-dialog-service.js.map +1 -1
  92. package/dist/dialog/mdc-dialog-title.js +9 -6
  93. package/dist/dialog/mdc-dialog-title.js.map +1 -1
  94. package/dist/dialog/mdc-dialog.html +14 -14
  95. package/dist/dialog/mdc-dialog.js +49 -46
  96. package/dist/dialog/mdc-dialog.js.map +1 -1
  97. package/dist/drawer/mdc-drawer-app-content.js +9 -6
  98. package/dist/drawer/mdc-drawer-app-content.js.map +1 -1
  99. package/dist/drawer/mdc-drawer-content.js +9 -6
  100. package/dist/drawer/mdc-drawer-content.js.map +1 -1
  101. package/dist/drawer/mdc-drawer-header/mdc-drawer-header.html +5 -5
  102. package/dist/drawer/mdc-drawer-header/mdc-drawer-header.js +17 -14
  103. package/dist/drawer/mdc-drawer-header/mdc-drawer-header.js.map +1 -1
  104. package/dist/drawer/mdc-drawer.html +6 -6
  105. package/dist/drawer/mdc-drawer.js +24 -21
  106. package/dist/drawer/mdc-drawer.js.map +1 -1
  107. package/dist/elevation/mdc-elevation.js +9 -6
  108. package/dist/elevation/mdc-elevation.js.map +1 -1
  109. package/dist/expandable/mdc-expandable.html +28 -28
  110. package/dist/expandable/mdc-expandable.js +20 -17
  111. package/dist/expandable/mdc-expandable.js.map +1 -1
  112. package/dist/fab/enhance-mdc-fab.js +9 -6
  113. package/dist/fab/enhance-mdc-fab.js.map +1 -1
  114. package/dist/fab/mdc-fab-icon.js +9 -6
  115. package/dist/fab/mdc-fab-icon.js.map +1 -1
  116. package/dist/fab/mdc-fab.html +13 -13
  117. package/dist/fab/mdc-fab.js +33 -30
  118. package/dist/fab/mdc-fab.js.map +1 -1
  119. package/dist/floating-label/mdc-floating-label.html +1 -1
  120. package/dist/floating-label/mdc-floating-label.js +16 -13
  121. package/dist/floating-label/mdc-floating-label.js.map +1 -1
  122. package/dist/form-field/mdc-form-field.html +6 -6
  123. package/dist/form-field/mdc-form-field.js +27 -24
  124. package/dist/form-field/mdc-form-field.js.map +1 -1
  125. package/dist/icon/mdc-icon.html +3 -3
  126. package/dist/icon/mdc-icon.js +10 -7
  127. package/dist/icon/mdc-icon.js.map +1 -1
  128. package/dist/icon-button/enhance-mdc-icon-button.js +9 -6
  129. package/dist/icon-button/enhance-mdc-icon-button.js.map +1 -1
  130. package/dist/icon-button/mdc-icon-button-icon/mdc-icon-button-icon.html +4 -4
  131. package/dist/icon-button/mdc-icon-button-icon/mdc-icon-button-icon.js +18 -15
  132. package/dist/icon-button/mdc-icon-button-icon/mdc-icon-button-icon.js.map +1 -1
  133. package/dist/icon-button/mdc-icon-button.html +11 -11
  134. package/dist/icon-button/mdc-icon-button.js +28 -25
  135. package/dist/icon-button/mdc-icon-button.js.map +1 -1
  136. package/dist/image-list/mdc-image-list-item/mdc-image-list-item.html +9 -9
  137. package/dist/image-list/mdc-image-list-item/mdc-image-list-item.js +22 -19
  138. package/dist/image-list/mdc-image-list-item/mdc-image-list-item.js.map +1 -1
  139. package/dist/image-list/mdc-image-list.html +7 -7
  140. package/dist/image-list/mdc-image-list.js +35 -32
  141. package/dist/image-list/mdc-image-list.js.map +1 -1
  142. package/dist/index.js +297 -139
  143. package/dist/index.js.map +1 -1
  144. package/dist/layout-grid/mdc-layout-grid-cell/mdc-layout-grid-cell.html +12 -12
  145. package/dist/layout-grid/mdc-layout-grid-cell/mdc-layout-grid-cell.js +36 -33
  146. package/dist/layout-grid/mdc-layout-grid-cell/mdc-layout-grid-cell.js.map +1 -1
  147. package/dist/layout-grid/mdc-layout-grid-inner.js +9 -6
  148. package/dist/layout-grid/mdc-layout-grid-inner.js.map +1 -1
  149. package/dist/layout-grid/mdc-layout-grid.html +8 -8
  150. package/dist/layout-grid/mdc-layout-grid.js +33 -30
  151. package/dist/layout-grid/mdc-layout-grid.js.map +1 -1
  152. package/dist/line-ripple/mdc-line-ripple.js +13 -10
  153. package/dist/line-ripple/mdc-line-ripple.js.map +1 -1
  154. package/dist/linear-progress/mdc-linear-progress.html +12 -12
  155. package/dist/linear-progress/mdc-linear-progress.js +26 -23
  156. package/dist/linear-progress/mdc-linear-progress.js.map +1 -1
  157. package/dist/list/mdc-deprecated-list/mdc-deprecated-list-divider/mdc-deprecated-list-divider.html +4 -4
  158. package/dist/list/mdc-deprecated-list/mdc-deprecated-list-divider/mdc-deprecated-list-divider.js +18 -15
  159. package/dist/list/mdc-deprecated-list/mdc-deprecated-list-divider/mdc-deprecated-list-divider.js.map +1 -1
  160. package/dist/list/mdc-deprecated-list/mdc-deprecated-list-group.js +17 -14
  161. package/dist/list/mdc-deprecated-list/mdc-deprecated-list-group.js.map +1 -1
  162. package/dist/list/mdc-deprecated-list/mdc-deprecated-list-item/enhance-mdc-deprecated-list-item.js +9 -6
  163. package/dist/list/mdc-deprecated-list/mdc-deprecated-list-item/enhance-mdc-deprecated-list-item.js.map +1 -1
  164. package/dist/list/mdc-deprecated-list/mdc-deprecated-list-item/mdc-deprecated-list-item-graphic.js +9 -6
  165. package/dist/list/mdc-deprecated-list/mdc-deprecated-list-item/mdc-deprecated-list-item-graphic.js.map +1 -1
  166. package/dist/list/mdc-deprecated-list/mdc-deprecated-list-item/mdc-deprecated-list-item-meta.js +9 -6
  167. package/dist/list/mdc-deprecated-list/mdc-deprecated-list-item/mdc-deprecated-list-item-meta.js.map +1 -1
  168. package/dist/list/mdc-deprecated-list/mdc-deprecated-list-item/mdc-deprecated-list-item.html +8 -8
  169. package/dist/list/mdc-deprecated-list/mdc-deprecated-list-item/mdc-deprecated-list-item.js +28 -25
  170. package/dist/list/mdc-deprecated-list/mdc-deprecated-list-item/mdc-deprecated-list-item.js.map +1 -1
  171. package/dist/list/mdc-deprecated-list/mdc-deprecated-list-item-primary-text.js +9 -6
  172. package/dist/list/mdc-deprecated-list/mdc-deprecated-list-item-primary-text.js.map +1 -1
  173. package/dist/list/mdc-deprecated-list/mdc-deprecated-list-item-secondary-text.js +9 -6
  174. package/dist/list/mdc-deprecated-list/mdc-deprecated-list-item-secondary-text.js.map +1 -1
  175. package/dist/list/mdc-deprecated-list/mdc-deprecated-list.html +15 -15
  176. package/dist/list/mdc-deprecated-list/mdc-deprecated-list.js +78 -75
  177. package/dist/list/mdc-deprecated-list/mdc-deprecated-list.js.map +1 -1
  178. package/dist/list/mdc-list-divider/mdc-list-divider.html +7 -7
  179. package/dist/list/mdc-list-divider/mdc-list-divider.js +21 -18
  180. package/dist/list/mdc-list-divider/mdc-list-divider.js.map +1 -1
  181. package/dist/list/mdc-list-group.js +17 -14
  182. package/dist/list/mdc-list-group.js.map +1 -1
  183. package/dist/list/mdc-list-item/enhance-mdc-list-item.js +9 -6
  184. package/dist/list/mdc-list-item/enhance-mdc-list-item.js.map +1 -1
  185. package/dist/list/mdc-list-item/mdc-list-item-leading.js +9 -6
  186. package/dist/list/mdc-list-item/mdc-list-item-leading.js.map +1 -1
  187. package/dist/list/mdc-list-item/mdc-list-item-trailing.js +9 -6
  188. package/dist/list/mdc-list-item/mdc-list-item-trailing.js.map +1 -1
  189. package/dist/list/mdc-list-item/mdc-list-item.html +13 -13
  190. package/dist/list/mdc-list-item/mdc-list-item.js +40 -37
  191. package/dist/list/mdc-list-item/mdc-list-item.js.map +1 -1
  192. package/dist/list/mdc-list-item-overline-text.js +9 -6
  193. package/dist/list/mdc-list-item-overline-text.js.map +1 -1
  194. package/dist/list/mdc-list-item-primary-text.js +9 -6
  195. package/dist/list/mdc-list-item-primary-text.js.map +1 -1
  196. package/dist/list/mdc-list-item-secondary-text.js +9 -6
  197. package/dist/list/mdc-list-item-secondary-text.js.map +1 -1
  198. package/dist/list/mdc-list.html +5 -5
  199. package/dist/list/mdc-list.js +58 -55
  200. package/dist/list/mdc-list.js.map +1 -1
  201. package/dist/lookup/discardable-promise.js +5 -1
  202. package/dist/lookup/discardable-promise.js.map +1 -1
  203. package/dist/lookup/mdc-lookup-configuration.js +5 -1
  204. package/dist/lookup/mdc-lookup-configuration.js.map +1 -1
  205. package/dist/lookup/mdc-lookup.html +27 -27
  206. package/dist/lookup/mdc-lookup.js +74 -71
  207. package/dist/lookup/mdc-lookup.js.map +1 -1
  208. package/dist/mdc-configuration.js +15 -9
  209. package/dist/mdc-configuration.js.map +1 -1
  210. package/dist/menu/mdc-menu-selection-group-icon.js +9 -6
  211. package/dist/menu/mdc-menu-selection-group-icon.js.map +1 -1
  212. package/dist/menu/mdc-menu-selection-group.js +9 -6
  213. package/dist/menu/mdc-menu-selection-group.js.map +1 -1
  214. package/dist/menu/mdc-menu.html +6 -6
  215. package/dist/menu/mdc-menu.js +71 -68
  216. package/dist/menu/mdc-menu.js.map +1 -1
  217. package/dist/menu-surface/mdc-menu-surface-anchor.js +11 -8
  218. package/dist/menu-surface/mdc-menu-surface-anchor.js.map +1 -1
  219. package/dist/menu-surface/mdc-menu-surface.js +61 -58
  220. package/dist/menu-surface/mdc-menu-surface.js.map +1 -1
  221. package/dist/notched-outline/mdc-notched-outline.html +7 -7
  222. package/dist/notched-outline/mdc-notched-outline.js +20 -17
  223. package/dist/notched-outline/mdc-notched-outline.js.map +1 -1
  224. package/dist/radio/mdc-radio.html +9 -9
  225. package/dist/radio/mdc-radio.js +27 -24
  226. package/dist/radio/mdc-radio.js.map +1 -1
  227. package/dist/ripple/mdc-ripple.js +51 -48
  228. package/dist/ripple/mdc-ripple.js.map +1 -1
  229. package/dist/segmented-button/mdc-segmented-button-segment/enhance-mdc-segmented-button-segment.js +9 -6
  230. package/dist/segmented-button/mdc-segmented-button-segment/enhance-mdc-segmented-button-segment.js.map +1 -1
  231. package/dist/segmented-button/mdc-segmented-button-segment/mdc-segmented-button-segment.html +11 -11
  232. package/dist/segmented-button/mdc-segmented-button-segment/mdc-segmented-button-segment.js +27 -24
  233. package/dist/segmented-button/mdc-segmented-button-segment/mdc-segmented-button-segment.js.map +1 -1
  234. package/dist/segmented-button/mdc-segmented-button.html +3 -3
  235. package/dist/segmented-button/mdc-segmented-button.js +24 -21
  236. package/dist/segmented-button/mdc-segmented-button.js.map +1 -1
  237. package/dist/select/mdc-default-select-configuration.js +5 -1
  238. package/dist/select/mdc-default-select-configuration.js.map +1 -1
  239. package/dist/select/mdc-select-adapter-aurelia.js +2 -1
  240. package/dist/select/mdc-select-adapter-aurelia.js.map +1 -1
  241. package/dist/select/mdc-select-foundation-aurelia.js +47 -43
  242. package/dist/select/mdc-select-foundation-aurelia.js.map +1 -1
  243. package/dist/select/mdc-select-helper-text/mdc-select-helper-text.html +7 -7
  244. package/dist/select/mdc-select-helper-text/mdc-select-helper-text.js +27 -24
  245. package/dist/select/mdc-select-helper-text/mdc-select-helper-text.js.map +1 -1
  246. package/dist/select/mdc-select-icon.js +16 -13
  247. package/dist/select/mdc-select-icon.js.map +1 -1
  248. package/dist/select/mdc-select-value-observer.js +16 -12
  249. package/dist/select/mdc-select-value-observer.js.map +1 -1
  250. package/dist/select/mdc-select.html +38 -38
  251. package/dist/select/mdc-select.js +71 -68
  252. package/dist/select/mdc-select.js.map +1 -1
  253. package/dist/slider/mdc-slider-foundation-aurelia.js +6 -2
  254. package/dist/slider/mdc-slider-foundation-aurelia.js.map +1 -1
  255. package/dist/slider/mdc-slider.html +36 -36
  256. package/dist/slider/mdc-slider.js +79 -76
  257. package/dist/slider/mdc-slider.js.map +1 -1
  258. package/dist/snackbar/mdc-snackbar-service.js +8 -4
  259. package/dist/snackbar/mdc-snackbar-service.js.map +1 -1
  260. package/dist/snackbar/mdc-snackbar.html +14 -14
  261. package/dist/snackbar/mdc-snackbar.js +55 -52
  262. package/dist/snackbar/mdc-snackbar.js.map +1 -1
  263. package/dist/switch/enhance-mdc-switch.js +9 -6
  264. package/dist/switch/enhance-mdc-switch.js.map +1 -1
  265. package/dist/switch/mdc-switch.html +21 -21
  266. package/dist/switch/mdc-switch.js +16 -13
  267. package/dist/switch/mdc-switch.js.map +1 -1
  268. package/dist/tab-bar/indicator/mdc-tab-indicator.html +9 -9
  269. package/dist/tab-bar/indicator/mdc-tab-indicator.js +26 -23
  270. package/dist/tab-bar/indicator/mdc-tab-indicator.js.map +1 -1
  271. package/dist/tab-bar/mdc-tab-bar.html +6 -6
  272. package/dist/tab-bar/mdc-tab-bar.js +29 -26
  273. package/dist/tab-bar/mdc-tab-bar.js.map +1 -1
  274. package/dist/tab-bar/scroller/mdc-tab-scroller.html +11 -11
  275. package/dist/tab-bar/scroller/mdc-tab-scroller.js +25 -22
  276. package/dist/tab-bar/scroller/mdc-tab-scroller.js.map +1 -1
  277. package/dist/tab-bar/tab/mdc-tab.html +20 -20
  278. package/dist/tab-bar/tab/mdc-tab.js +44 -41
  279. package/dist/tab-bar/tab/mdc-tab.js.map +1 -1
  280. package/dist/text-field/enhance-mdc-text-field.js +9 -6
  281. package/dist/text-field/enhance-mdc-text-field.js.map +1 -1
  282. package/dist/text-field/mdc-default-text-field-configuration.js +5 -1
  283. package/dist/text-field/mdc-default-text-field-configuration.js.map +1 -1
  284. package/dist/text-field/mdc-inputmask.js +76 -0
  285. package/dist/text-field/mdc-inputmask.js.map +1 -0
  286. package/dist/text-field/mdc-text-field-character-counter.js +13 -10
  287. package/dist/text-field/mdc-text-field-character-counter.js.map +1 -1
  288. package/dist/text-field/mdc-text-field-helper-line/mdc-text-field-helper-line.html +7 -7
  289. package/dist/text-field/mdc-text-field-helper-line/mdc-text-field-helper-line.js +14 -11
  290. package/dist/text-field/mdc-text-field-helper-line/mdc-text-field-helper-line.js.map +1 -1
  291. package/dist/text-field/mdc-text-field-helper-text/mdc-text-field-helper-text.html +6 -6
  292. package/dist/text-field/mdc-text-field-helper-text/mdc-text-field-helper-text.js +22 -19
  293. package/dist/text-field/mdc-text-field-helper-text/mdc-text-field-helper-text.js.map +1 -1
  294. package/dist/text-field/mdc-text-field-icon.js +22 -19
  295. package/dist/text-field/mdc-text-field-icon.js.map +1 -1
  296. package/dist/text-field/mdc-text-field.html +29 -29
  297. package/dist/text-field/mdc-text-field.js +116 -113
  298. package/dist/text-field/mdc-text-field.js.map +1 -1
  299. package/dist/tooltip/mdc-default-tooltip-configuration.js +5 -1
  300. package/dist/tooltip/mdc-default-tooltip-configuration.js.map +1 -1
  301. package/dist/tooltip/mdc-tooltip-attribute.js +39 -36
  302. package/dist/tooltip/mdc-tooltip-attribute.js.map +1 -1
  303. package/dist/tooltip/mdc-tooltip.html +7 -7
  304. package/dist/tooltip/mdc-tooltip.js +66 -63
  305. package/dist/tooltip/mdc-tooltip.js.map +1 -1
  306. package/dist/top-app-bar/enhance-top-app-bar-actions.js +9 -6
  307. package/dist/top-app-bar/enhance-top-app-bar-actions.js.map +1 -1
  308. package/dist/top-app-bar/mdc-top-app-bar-action-item.js +9 -6
  309. package/dist/top-app-bar/mdc-top-app-bar-action-item.js.map +1 -1
  310. package/dist/top-app-bar/mdc-top-app-bar-fixed-adjust.js +9 -6
  311. package/dist/top-app-bar/mdc-top-app-bar-fixed-adjust.js.map +1 -1
  312. package/dist/top-app-bar/mdc-top-app-bar-nav-icon.js +9 -6
  313. package/dist/top-app-bar/mdc-top-app-bar-nav-icon.js.map +1 -1
  314. package/dist/top-app-bar/mdc-top-app-bar-row.js +9 -6
  315. package/dist/top-app-bar/mdc-top-app-bar-row.js.map +1 -1
  316. package/dist/top-app-bar/mdc-top-app-bar-section/mdc-top-app-bar-section.html +3 -3
  317. package/dist/top-app-bar/mdc-top-app-bar-section/mdc-top-app-bar-section.js +15 -12
  318. package/dist/top-app-bar/mdc-top-app-bar-section/mdc-top-app-bar-section.js.map +1 -1
  319. package/dist/top-app-bar/mdc-top-app-bar-title.js +9 -6
  320. package/dist/top-app-bar/mdc-top-app-bar-title.js.map +1 -1
  321. package/dist/top-app-bar/mdc-top-app-bar.html +9 -9
  322. package/dist/top-app-bar/mdc-top-app-bar.js +43 -40
  323. package/dist/top-app-bar/mdc-top-app-bar.js.map +1 -1
  324. package/dist/tree-view/i-tree-node.js +2 -1
  325. package/dist/tree-view/i-tree-node.js.map +1 -1
  326. package/dist/tree-view/mdc-tree-node-meta.js +9 -6
  327. package/dist/tree-view/mdc-tree-node-meta.js.map +1 -1
  328. package/dist/tree-view/mdc-tree-node.js +9 -6
  329. package/dist/tree-view/mdc-tree-node.js.map +1 -1
  330. package/dist/tree-view/mdc-tree-view.js +29 -25
  331. package/dist/tree-view/mdc-tree-view.js.map +1 -1
  332. package/dist/tree-view/node-filter.js +9 -6
  333. package/dist/tree-view/node-filter.js.map +1 -1
  334. package/dist/types/alert/alert-configuration.d.ts +8 -0
  335. package/dist/types/alert/alert-modal/alert-modal.d.ts +6 -0
  336. package/dist/types/alert/alert-modal/i-alert-modal-payload.d.ts +9 -0
  337. package/dist/types/alert/alert-service.d.ts +27 -0
  338. package/dist/types/alert/decorators/confirm-action.d.ts +3 -0
  339. package/dist/types/alert/decorators/using-progress.d.ts +6 -0
  340. package/dist/types/alert/exceptions-tracker.d.ts +3 -0
  341. package/dist/types/alert/global-progress/global-progress.d.ts +11 -0
  342. package/dist/types/alert/prompt-dialog/prompt-dialog.d.ts +21 -0
  343. package/dist/types/data-table/mdc-data-table.d.ts +16 -4
  344. package/dist/types/index.d.ts +11 -1
  345. package/dist/types/lookup/mdc-lookup.d.ts +3 -3
  346. package/dist/types/mdc-configuration.d.ts +2 -0
  347. package/dist/types/select/mdc-select.d.ts +3 -3
  348. package/dist/types/text-field/mdc-inputmask.d.ts +11 -0
  349. package/dist/types/text-field/mdc-text-field.d.ts +3 -3
  350. package/dist/types/tooltip/mdc-tooltip.d.ts +3 -3
  351. package/dist/types/validation/validate.d.ts +10 -0
  352. package/dist/typography/mdc-typography.js +60 -57
  353. package/dist/typography/mdc-typography.js.map +1 -1
  354. package/dist/validation/mdc-validation-controller-factory.js +10 -6
  355. package/dist/validation/mdc-validation-controller-factory.js.map +1 -1
  356. package/dist/validation/mdc-validation-result-presenter.js +5 -1
  357. package/dist/validation/mdc-validation-result-presenter.js.map +1 -1
  358. package/dist/validation/validate.js +27 -0
  359. package/dist/validation/validate.js.map +1 -0
  360. package/package.json +4 -2
  361. package/src/alert/alert-configuration.ts +11 -0
  362. package/src/alert/alert-modal/alert-modal.html +27 -0
  363. package/src/alert/alert-modal/alert-modal.scss +10 -0
  364. package/src/alert/alert-modal/alert-modal.ts +13 -0
  365. package/src/alert/alert-modal/i-alert-modal-payload.ts +9 -0
  366. package/src/alert/alert-service.ts +113 -0
  367. package/src/alert/decorators/confirm-action.ts +18 -0
  368. package/src/alert/decorators/using-progress.ts +30 -0
  369. package/src/alert/exceptions-tracker.ts +3 -0
  370. package/src/alert/global-progress/global-progress.html +9 -0
  371. package/src/alert/global-progress/global-progress.scss +38 -0
  372. package/src/alert/global-progress/global-progress.ts +27 -0
  373. package/src/alert/prompt-dialog/prompt-dialog.html +15 -0
  374. package/src/alert/prompt-dialog/prompt-dialog.ts +35 -0
  375. package/src/banner/mdc-banner.html +21 -21
  376. package/src/banner/mdc-banner.ts +116 -116
  377. package/src/base/attributes/mdc-focus-trap.ts +42 -42
  378. package/src/base/elements/i-validated-element.ts +12 -12
  379. package/src/base/elements/mdc-promisify-reference.ts +21 -21
  380. package/src/base/interceptors.ts +25 -25
  381. package/src/base/material-palette.md +7 -7
  382. package/src/base/material-palette.ts +22 -22
  383. package/src/base/mdc-component.ts +69 -69
  384. package/src/base/next-element.ts +39 -39
  385. package/src/button/enhance-mdc-button.ts +8 -8
  386. package/src/button/mdc-button-label.ts +15 -15
  387. package/src/button/mdc-button.html +12 -12
  388. package/src/button/mdc-button.ts +62 -62
  389. package/src/card/mdc-card-action-buttons.ts +19 -19
  390. package/src/card/mdc-card-action-icons.ts +19 -19
  391. package/src/card/mdc-card-actions/mdc-card-actions.html +3 -3
  392. package/src/card/mdc-card-actions/mdc-card-actions.ts +15 -15
  393. package/src/card/mdc-card-media/mdc-card-media.html +5 -5
  394. package/src/card/mdc-card-media/mdc-card-media.ts +21 -21
  395. package/src/card/mdc-card-primary-action.html +5 -5
  396. package/src/card/mdc-card-primary-action.ts +16 -16
  397. package/src/card/mdc-card.html +3 -3
  398. package/src/card/mdc-card.ts +16 -16
  399. package/src/checkbox/mdc-checkbox.html +12 -12
  400. package/src/checkbox/mdc-checkbox.ts +217 -217
  401. package/src/chips/mdc-chip/mdc-chip.html +24 -24
  402. package/src/chips/mdc-chip-action/enhance-mdc-chip-action.ts +8 -8
  403. package/src/chips/mdc-chip-action/mdc-chip-action.html +25 -25
  404. package/src/chips/mdc-chip-action/mdc-chip-action.ts +143 -143
  405. package/src/chips/mdc-chip-set/mdc-chip-set.html +10 -10
  406. package/src/chips/mdc-chip-set/mdc-chip-set.ts +117 -117
  407. package/src/circular-progress/mdc-circular-progress.html +38 -38
  408. package/src/circular-progress/mdc-circular-progress.ts +91 -91
  409. package/src/circular-progress/styles/_index.scss +1 -1
  410. package/src/circular-progress/styles/mdc-circular-progress.import.scss +1 -1
  411. package/src/circular-progress/styles/mdc-circular-progress.scss +14 -14
  412. package/src/data-table/mdc-data-table-row.ts +24 -24
  413. package/src/data-table/mdc-data-table.html +50 -49
  414. package/src/data-table/mdc-data-table.ts +111 -13
  415. package/src/data-table/styles/_index.scss +1 -0
  416. package/src/data-table/styles/mdc-data-table.import.scss +1 -0
  417. package/src/data-table/styles/mdc-data-table.scss +64 -0
  418. package/src/dialog/mdc-dialog-actions.ts +23 -23
  419. package/src/dialog/mdc-dialog-content.ts +11 -11
  420. package/src/dialog/mdc-dialog-service.ts +83 -80
  421. package/src/dialog/mdc-dialog-title.ts +8 -8
  422. package/src/dialog/mdc-dialog.html +14 -14
  423. package/src/dialog/mdc-dialog.ts +224 -224
  424. package/src/drawer/mdc-drawer-app-content.ts +11 -11
  425. package/src/drawer/mdc-drawer-content.ts +11 -11
  426. package/src/drawer/mdc-drawer-header/mdc-drawer-header.html +5 -5
  427. package/src/drawer/mdc-drawer-header/mdc-drawer-header.ts +18 -18
  428. package/src/drawer/mdc-drawer.html +6 -6
  429. package/src/drawer/mdc-drawer.ts +125 -125
  430. package/src/elevation/mdc-elevation.ts +23 -23
  431. package/src/expandable/mdc-expandable.html +28 -28
  432. package/src/expandable/styles/_icon-variables.scss +3 -3
  433. package/src/expandable/styles/_index.scss +1 -1
  434. package/src/expandable/styles/_mixins.scss +287 -287
  435. package/src/expandable/styles/_variables.scss +17 -17
  436. package/src/expandable/styles/mdc-expandable.import.scss +1 -1
  437. package/src/expandable/styles/mdc-expandable.scss +3 -3
  438. package/src/fab/enhance-mdc-fab.ts +8 -8
  439. package/src/fab/mdc-fab-icon.ts +15 -15
  440. package/src/fab/mdc-fab.html +13 -13
  441. package/src/fab/mdc-fab.ts +50 -50
  442. package/src/floating-label/mdc-floating-label.html +1 -1
  443. package/src/floating-label/mdc-floating-label.ts +44 -44
  444. package/src/form-field/mdc-form-field.html +6 -6
  445. package/src/icon/mdc-icon.html +3 -3
  446. package/src/icon/mdc-icon.ts +11 -11
  447. package/src/icon-button/enhance-mdc-icon-button.ts +8 -8
  448. package/src/icon-button/mdc-icon-button-icon/mdc-icon-button-icon.html +4 -4
  449. package/src/icon-button/mdc-icon-button-icon/mdc-icon-button-icon.ts +29 -29
  450. package/src/icon-button/mdc-icon-button.html +11 -11
  451. package/src/icon-button/mdc-icon-button.ts +69 -69
  452. package/src/image-list/mdc-image-list-item/mdc-image-list-item.html +9 -9
  453. package/src/image-list/mdc-image-list-item/mdc-image-list-item.ts +31 -31
  454. package/src/image-list/mdc-image-list.html +7 -7
  455. package/src/image-list/mdc-image-list.ts +73 -73
  456. package/src/image-list/styles/_index.scss +1 -1
  457. package/src/image-list/styles/mdc-image-list.import.scss +1 -1
  458. package/src/image-list/styles/mdc-image-list.scss +7 -7
  459. package/src/index.ts +17 -3
  460. package/src/layout-grid/mdc-layout-grid-cell/mdc-layout-grid-cell.html +12 -12
  461. package/src/layout-grid/mdc-layout-grid-cell/mdc-layout-grid-cell.ts +49 -49
  462. package/src/layout-grid/mdc-layout-grid-inner.ts +8 -8
  463. package/src/layout-grid/mdc-layout-grid.html +8 -8
  464. package/src/layout-grid/mdc-layout-grid.ts +67 -67
  465. package/src/layout-grid/styles/_index.scss +1 -1
  466. package/src/layout-grid/styles/mdc-layout-grid.import.scss +1 -1
  467. package/src/layout-grid/styles/mdc-layout-grid.scss +11 -11
  468. package/src/line-ripple/mdc-line-ripple.ts +41 -41
  469. package/src/linear-progress/mdc-linear-progress.html +12 -12
  470. package/src/linear-progress/mdc-linear-progress.ts +103 -103
  471. package/src/list/mdc-deprecated-list/mdc-deprecated-list-divider/mdc-deprecated-list-divider.html +4 -4
  472. package/src/list/mdc-deprecated-list/mdc-deprecated-list-divider/mdc-deprecated-list-divider.ts +18 -18
  473. package/src/list/mdc-deprecated-list/mdc-deprecated-list-group.ts +27 -27
  474. package/src/list/mdc-deprecated-list/mdc-deprecated-list-item/enhance-mdc-deprecated-list-item.ts +8 -8
  475. package/src/list/mdc-deprecated-list/mdc-deprecated-list-item/mdc-deprecated-list-item-graphic.ts +15 -15
  476. package/src/list/mdc-deprecated-list/mdc-deprecated-list-item/mdc-deprecated-list-item-meta.ts +15 -15
  477. package/src/list/mdc-deprecated-list/mdc-deprecated-list-item/mdc-deprecated-list-item.html +8 -8
  478. package/src/list/mdc-deprecated-list/mdc-deprecated-list-item-primary-text.ts +11 -11
  479. package/src/list/mdc-deprecated-list/mdc-deprecated-list-item-secondary-text.ts +11 -11
  480. package/src/list/mdc-deprecated-list/mdc-deprecated-list.html +15 -15
  481. package/src/list/mdc-deprecated-list/mdc-deprecated-list.ts +331 -331
  482. package/src/list/mdc-list-divider/mdc-list-divider.html +7 -7
  483. package/src/list/mdc-list-divider/mdc-list-divider.ts +24 -24
  484. package/src/list/mdc-list-group.ts +27 -27
  485. package/src/list/mdc-list-item/enhance-mdc-list-item.ts +8 -8
  486. package/src/list/mdc-list-item/mdc-list-item-leading.ts +34 -34
  487. package/src/list/mdc-list-item/mdc-list-item-trailing.ts +36 -36
  488. package/src/list/mdc-list-item/mdc-list-item.html +13 -13
  489. package/src/list/mdc-list-item-overline-text.ts +8 -8
  490. package/src/list/mdc-list-item-primary-text.ts +11 -11
  491. package/src/list/mdc-list-item-secondary-text.ts +11 -11
  492. package/src/list/mdc-list.html +5 -5
  493. package/src/list/mdc-list.ts +300 -300
  494. package/src/lookup/discardable-promise.ts +24 -24
  495. package/src/lookup/mdc-lookup-configuration.ts +11 -11
  496. package/src/lookup/mdc-lookup.html +27 -27
  497. package/src/lookup/mdc-lookup.ts +5 -5
  498. package/src/mdc-configuration.ts +2 -0
  499. package/src/menu/mdc-menu-selection-group-icon.ts +11 -11
  500. package/src/menu/mdc-menu-selection-group.ts +4 -4
  501. package/src/menu/mdc-menu.html +6 -6
  502. package/src/menu-surface/mdc-menu-surface-anchor.ts +12 -12
  503. package/src/menu-surface/mdc-menu-surface.ts +275 -275
  504. package/src/notched-outline/mdc-notched-outline.html +7 -7
  505. package/src/notched-outline/mdc-notched-outline.ts +60 -60
  506. package/src/radio/mdc-radio.html +9 -9
  507. package/src/radio/mdc-radio.ts +162 -162
  508. package/src/resource.d.ts +22 -22
  509. package/src/ripple/mdc-ripple.ts +114 -114
  510. package/src/segmented-button/mdc-segmented-button-segment/enhance-mdc-segmented-button-segment.ts +8 -8
  511. package/src/segmented-button/mdc-segmented-button-segment/mdc-segmented-button-segment.html +11 -11
  512. package/src/segmented-button/mdc-segmented-button.html +3 -3
  513. package/src/segmented-button/mdc-segmented-button.ts +89 -89
  514. package/src/select/mdc-default-select-configuration.ts +3 -3
  515. package/src/select/mdc-select-adapter-aurelia.ts +213 -213
  516. package/src/select/mdc-select-foundation-aurelia.ts +484 -484
  517. package/src/select/mdc-select-helper-text/mdc-select-helper-text.html +7 -7
  518. package/src/select/mdc-select-helper-text/mdc-select-helper-text.ts +55 -55
  519. package/src/select/mdc-select-icon.ts +41 -41
  520. package/src/select/mdc-select-value-observer.ts +347 -346
  521. package/src/select/mdc-select.html +38 -38
  522. package/src/select/mdc-select.ts +480 -480
  523. package/src/slider/mdc-slider-foundation-aurelia.ts +13 -13
  524. package/src/slider/mdc-slider.html +36 -36
  525. package/src/slider/mdc-slider.ts +409 -409
  526. package/src/slider/styles/_index.scss +1 -1
  527. package/src/slider/styles/mdc-slider.import.scss +1 -1
  528. package/src/slider/styles/mdc-slider.scss +8 -8
  529. package/src/snackbar/mdc-snackbar-service.ts +48 -48
  530. package/src/snackbar/mdc-snackbar.html +14 -14
  531. package/src/snackbar/mdc-snackbar.ts +109 -109
  532. package/src/switch/enhance-mdc-switch.ts +8 -8
  533. package/src/switch/mdc-switch.html +21 -21
  534. package/src/switch/mdc-switch.ts +86 -86
  535. package/src/tab-bar/indicator/mdc-tab-indicator.html +9 -9
  536. package/src/tab-bar/indicator/mdc-tab-indicator.ts +51 -51
  537. package/src/tab-bar/mdc-tab-bar.html +6 -6
  538. package/src/tab-bar/mdc-tab-bar.ts +119 -119
  539. package/src/tab-bar/scroller/mdc-tab-scroller.html +11 -11
  540. package/src/tab-bar/scroller/mdc-tab-scroller.ts +85 -85
  541. package/src/tab-bar/tab/mdc-tab.html +20 -20
  542. package/src/tab-bar/tab/mdc-tab.ts +118 -118
  543. package/src/text-field/enhance-mdc-text-field.ts +12 -12
  544. package/src/text-field/mdc-default-text-field-configuration.ts +3 -3
  545. package/src/text-field/mdc-inputmask.ts +45 -0
  546. package/src/text-field/mdc-text-field-character-counter.ts +32 -32
  547. package/src/text-field/mdc-text-field-helper-line/mdc-text-field-helper-line.html +7 -7
  548. package/src/text-field/mdc-text-field-helper-line/mdc-text-field-helper-line.ts +37 -37
  549. package/src/text-field/mdc-text-field-helper-text/mdc-text-field-helper-text.html +6 -6
  550. package/src/text-field/mdc-text-field-helper-text/mdc-text-field-helper-text.ts +47 -47
  551. package/src/text-field/mdc-text-field-icon.ts +59 -59
  552. package/src/text-field/mdc-text-field.html +29 -29
  553. package/src/text-field/mdc-text-field.ts +535 -535
  554. package/src/tooltip/mdc-default-tooltip-configuration.ts +5 -5
  555. package/src/tooltip/mdc-tooltip-attribute.ts +118 -118
  556. package/src/tooltip/mdc-tooltip.html +7 -7
  557. package/src/tooltip/mdc-tooltip.ts +6 -6
  558. package/src/top-app-bar/enhance-top-app-bar-actions.ts +9 -9
  559. package/src/top-app-bar/mdc-top-app-bar-action-item.ts +12 -12
  560. package/src/top-app-bar/mdc-top-app-bar-fixed-adjust.ts +13 -13
  561. package/src/top-app-bar/mdc-top-app-bar-nav-icon.ts +12 -12
  562. package/src/top-app-bar/mdc-top-app-bar-row.ts +7 -7
  563. package/src/top-app-bar/mdc-top-app-bar-section/mdc-top-app-bar-section.html +3 -3
  564. package/src/top-app-bar/mdc-top-app-bar-section/mdc-top-app-bar-section.ts +9 -9
  565. package/src/top-app-bar/mdc-top-app-bar-title.ts +7 -7
  566. package/src/top-app-bar/mdc-top-app-bar.html +9 -9
  567. package/src/top-app-bar/mdc-top-app-bar.ts +93 -93
  568. package/src/tree-view/i-tree-node.ts +8 -8
  569. package/src/tree-view/mdc-tree-node-meta.ts +11 -11
  570. package/src/tree-view/mdc-tree-node.ts +4 -4
  571. package/src/tree-view/node-filter.ts +12 -12
  572. package/src/tree-view/styles/_index.scss +1 -1
  573. package/src/tree-view/styles/_mixins.scss +145 -145
  574. package/src/tree-view/styles/_variables.scss +8 -8
  575. package/src/tree-view/styles/mdc-tree-view.import.scss +1 -1
  576. package/src/tree-view/styles/mdc-tree-view.scss +3 -3
  577. package/src/typography/mdc-typography.ts +130 -130
  578. package/src/validation/mdc-validation-controller-factory.ts +20 -20
  579. package/src/validation/mdc-validation-result-presenter.ts +36 -36
  580. package/src/validation/validate.ts +32 -0
  581. package/styles/mdc-all.scss +53 -52
  582. package/src/banner/doc/api.json +0 -1106
  583. package/src/base/doc/api.json +0 -1408
  584. package/src/button/doc/api.json +0 -621
  585. package/src/card/doc/api.json +0 -214
  586. package/src/checkbox/doc/api.json +0 -1320
  587. package/src/chips/doc/api.json +0 -2533
  588. package/src/circular-progress/doc/api.json +0 -1085
  589. package/src/data-table/doc/api.json +0 -2064
  590. package/src/dialog/doc/api.json +0 -1667
  591. package/src/drawer/doc/api.json +0 -1416
  592. package/src/elevation/doc/api.json +0 -317
  593. package/src/expandable/doc/api.json +0 -677
  594. package/src/fab/doc/api.json +0 -396
  595. package/src/floating-label/doc/api.json +0 -914
  596. package/src/form-field/doc/api.json +0 -948
  597. package/src/icon/doc/api.json +0 -224
  598. package/src/icon-button/doc/api.json +0 -1109
  599. package/src/image-list/doc/api.json +0 -438
  600. package/src/layout-grid/doc/api.json +0 -600
  601. package/src/line-ripple/doc/api.json +0 -857
  602. package/src/linear-progress/doc/api.json +0 -949
  603. package/src/list/doc/api.json +0 -5725
  604. package/src/lookup/doc/api.json +0 -2370
  605. package/src/menu/doc/api.json +0 -2246
  606. package/src/menu-surface/doc/api.json +0 -1800
  607. package/src/notched-outline/doc/api.json +0 -943
  608. package/src/radio/doc/api.json +0 -1159
  609. package/src/ripple/doc/api.json +0 -1212
  610. package/src/segmented-button/doc/api.json +0 -1937
  611. package/src/select/doc/api.json +0 -4247
  612. package/src/slider/doc/api.json +0 -1954
  613. package/src/snackbar/doc/api.json +0 -1699
  614. package/src/switch/doc/api.json +0 -899
  615. package/src/tab-bar/doc/api.json +0 -4253
  616. package/src/text-field/doc/api.json +0 -3179
  617. package/src/tooltip/doc/api.json +0 -2531
  618. package/src/top-app-bar/doc/api.json +0 -1752
  619. package/src/tree-view/doc/api.json +0 -1710
  620. package/src/typography/doc/api.json +0 -3058
  621. package/src/validation/doc/api.json +0 -371
@@ -1,346 +1,347 @@
1
- import {
2
- subscriberCollection,
3
- AccessorType,
4
- } from '@aurelia/runtime';
5
-
6
- import type {
7
- ICollectionObserver,
8
- IndexMap,
9
- IObserver,
10
- IObserverLocator,
11
- ISubscriber,
12
- ISubscriberCollection,
13
- } from '@aurelia/runtime';
14
-
15
- import { INode, CustomElement } from '@aurelia/runtime-html';
16
- import { IMdcSelectElement, MdcSelect } from './mdc-select';
17
-
18
- // const hasOwn = Object.prototype.hasOwnProperty;
19
- const childObserverOptions = {
20
- childList: true,
21
- subtree: true,
22
- characterData: true
23
- };
24
-
25
- // function defaultMatcher(a: unknown, b: unknown): boolean {
26
- // return a === b;
27
- // }
28
-
29
- export interface IOptionElement extends HTMLOptionElement {
30
- model?: unknown;
31
- }
32
-
33
- export interface MdcSelectValueObserver extends
34
- ISubscriberCollection { }
35
-
36
- export interface INodeObserverConfigBase {
37
- /**
38
- * Indicates the list of events can be used to observe a particular property
39
- */
40
- readonly events: string[];
41
- /**
42
- * Indicates whether this property is readonly, so observer wont attempt to assign value
43
- * example: input.files
44
- */
45
- readonly readonly?: boolean;
46
- /**
47
- * A default value to assign to the corresponding property if the incoming value is null/undefined
48
- */
49
- readonly default?: unknown;
50
- }
51
-
52
-
53
- export interface INodeObserver extends IObserver {
54
- /**
55
- * Instruct this node observer event observation behavior
56
- */
57
- useConfig(config: INodeObserverConfigBase): void;
58
- }
59
-
60
- @subscriberCollection()
61
- export class MdcSelectValueObserver implements INodeObserver {
62
- public currentValue: unknown = void 0;
63
- public oldValue: unknown = void 0;
64
-
65
- public readonly obj: IMdcSelectElement;
66
- public config: INodeObserverConfigBase;
67
-
68
- public hasChanges: boolean = false;
69
- // ObserverType.Layout is not always true
70
- // but for simplicity, always treat as such
71
- public type: AccessorType = (AccessorType.Node | AccessorType.Observer | AccessorType.Layout) as AccessorType;
72
-
73
- public arrayObserver?: ICollectionObserver<'array'> = void 0;
74
- public nodeObserver?: MutationObserver = void 0;
75
-
76
- private observing: boolean = false;
77
- private listened: boolean = false;
78
-
79
- public constructor(
80
- obj: INode,
81
- // deepscan-disable-next-line
82
- _key: PropertyKey,
83
- config: INodeObserverConfigBase,
84
- _: IObserverLocator
85
- ) {
86
- this.obj = obj as unknown as IMdcSelectElement;
87
- this.config = config;
88
- }
89
-
90
- optionsWereSet: boolean;
91
-
92
- setElementValue(skipNotify: boolean) {
93
- // do not pass the value to the element if options has never been set
94
- // the value will be passed on when options do arrive
95
- if (this.optionsWereSet) {
96
- CustomElement.for<MdcSelect>(this.obj).viewModel.setValue(this.currentValue, skipNotify);
97
- }
98
- }
99
-
100
- public getValue(): unknown {
101
- // is it safe to assume the observer has the latest value?
102
- // todo: ability to turn on/off cache based on type
103
- return this.observing
104
- ? this.currentValue
105
- // : this.obj.multiple
106
- // ? Array.from(this.obj.options).map(o => o.value)
107
- : this.obj.value;
108
- }
109
-
110
- public setValue(newValue: unknown): void {
111
- this.currentValue = newValue;
112
- this.hasChanges = newValue !== this.oldValue;
113
- // this.observeArray(newValue instanceof Array ? newValue : null);
114
- if (this.optionsWereSet) {
115
- this.flushChanges();
116
- }
117
- }
118
-
119
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
120
- public flushChanges(): void {
121
- if (this.hasChanges) {
122
- this.hasChanges = false;
123
- this.synchronizeOptions();
124
- }
125
- }
126
-
127
- public handleCollectionChange(): void {
128
- // always sync "selected" property of <options/>
129
- // immediately whenever the array notifies its mutation
130
- this.synchronizeOptions();
131
- }
132
-
133
- public notify(): void {
134
- const oldValue = this.oldValue;
135
- const newValue = this.currentValue;
136
- if (newValue === oldValue) {
137
- return;
138
- }
139
- this.subs.notify(newValue, oldValue);
140
- }
141
-
142
- public handleEvent(): void {
143
- const shouldNotify = this.synchronizeValue();
144
- if (shouldNotify) {
145
- this.subs.notify(this.currentValue, this.oldValue);
146
- }
147
- }
148
-
149
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
150
- public synchronizeOptions(_indexMap?: IndexMap): void {
151
- this.setElementValue(true);
152
- // const { currentValue, obj } = this;
153
- // // const isArray = Array.isArray(currentValue);
154
- // // const matcher = obj.matcher !== void 0 ? obj.matcher : defaultMatcher;
155
- // // const matcher = defaultMatcher;
156
- // const options = CustomElement.for<MdcSelect>(obj).viewModel.items;
157
- // let i = options.length;
158
-
159
- // while (i-- > 0) {
160
- // // const option = options[i];
161
- // // const optionValue = hasOwn.call(option, 'model') ? option.model : option.value;
162
- // // const optionValue = option.value;
163
- // // if (isArray) {
164
- // // option.selected = (currentValue as unknown[]).findIndex(item => !!matcher(optionValue, item)) !== -1;
165
- // // continue;
166
- // // }
167
- // if (!this.optionsWereSet) {
168
- // this.optionsWereSet = true;
169
- // this.setElementValue(true);
170
- // }
171
- // // option.selected = !!matcher(optionValue, currentValue);
172
- // }
173
- }
174
-
175
- public synchronizeValue(): boolean {
176
- // Spec for synchronizing value from `<select/>` to `SelectObserver`
177
- // When synchronizing value to observed <select/> element, do the following steps:
178
- // A. If `<select/>` is multiple
179
- // 1. Check if current value, called `currentValue` is an array
180
- // a. If not an array, return true to signal value has changed
181
- // b. If is an array:
182
- // i. gather all current selected <option/>, in to array called `values`
183
- // ii. loop through the `currentValue` array and remove items that are nolonger selected based on matcher
184
- // iii. loop through the `values` array and add items that are selected based on matcher
185
- // iv. Return false to signal value hasn't changed
186
- // B. If the select is single
187
- // 1. Let `value` equal the first selected option, if no option selected, then `value` is `null`
188
- // 2. assign `this.currentValue` to `this.oldValue`
189
- // 3. assign `value` to `this.currentValue`
190
- // 4. return `true` to signal value has changed
191
- const obj = this.obj;
192
- const options = CustomElement.for<MdcSelect>(obj).viewModel.items ?? [];
193
- const len = options.length;
194
- // const currentValue = this.currentValue;
195
- let i = 0;
196
-
197
- /*
198
- if (obj.multiple) {
199
- // A.
200
- if (!(currentValue instanceof Array)) {
201
- // A.1.a
202
- return true;
203
- }
204
- // A.1.b
205
- // multi select
206
- let option: IOptionElement;
207
- const matcher = obj.matcher ?? defaultMatcher;
208
- // A.1.b.i
209
- const values: unknown[] = [];
210
- while (i < len) {
211
- option = options[i];
212
- if (option.selected) {
213
- values.push(hasOwn.call(option, 'model')
214
- ? option.model
215
- : option.value
216
- );
217
- }
218
- ++i;
219
- }
220
- // A.1.b.ii
221
- i = 0;
222
- while (i < currentValue.length) {
223
- const a = currentValue[i];
224
- // Todo: remove arrow fn
225
- if (values.findIndex(b => !!matcher(a, b)) === -1) {
226
- currentValue.splice(i, 1);
227
- } else {
228
- ++i;
229
- }
230
- }
231
- // A.1.b.iii
232
- i = 0;
233
- while (i < values.length) {
234
- const a = values[i];
235
- // Todo: remove arrow fn
236
- if (currentValue.findIndex(b => !!matcher(a, b)) === -1) {
237
- currentValue.push(a);
238
- }
239
- ++i;
240
- }
241
- // A.1.b.iv
242
- return false;
243
- }
244
- */
245
- // B. single select
246
- // B.1
247
- let value: unknown = null;
248
- while (i < len) {
249
- const option = options[i];
250
- if (option.value === this.obj.value) {
251
- // value = hasOwn.call(option, 'model') ? option.model : option.value;
252
- value = option.value;
253
- break;
254
- }
255
- ++i;
256
- }
257
- // B.2
258
- this.oldValue = this.currentValue;
259
- // B.3
260
- this.currentValue = value;
261
- // B.4
262
- return true;
263
- }
264
-
265
- private start(): void {
266
- const vm = CustomElement.for<MdcSelect>(this.obj).viewModel;
267
- vm.initialised.then(() => {
268
- (this.nodeObserver = new this.obj.ownerDocument.defaultView!.MutationObserver(records => this.handleNodeChange(records)))
269
- .observe(vm.menu.root, childObserverOptions);
270
- // this.observeArray(this.currentValue instanceof Array ? this.currentValue : null);
271
- this.observing = true;
272
- if (vm.items?.length) {
273
- this.optionsWereSet = true;
274
- this.synchronizeOptions();
275
- }
276
- });
277
- }
278
-
279
- private stop(): void {
280
- this.optionsWereSet = false;
281
- this.nodeObserver?.disconnect();
282
- this.arrayObserver?.unsubscribe(this);
283
- this.nodeObserver
284
- = this.arrayObserver
285
- = void 0;
286
- this.observing = false;
287
- }
288
-
289
- // todo: observe all kind of collection
290
- // private observeArray(array: unknown[] | null): void {
291
- // this.arrayObserver?.unsubscribe(this);
292
- // this.arrayObserver = void 0;
293
- // if (array !== null) {
294
- // if (!this.obj.multiple) {
295
- // throw new Error('Only null or Array instances can be bound to a multi-select.');
296
- // }
297
- // (this.arrayObserver = this.observerLocator.getArrayObserver(array)).subscribe(this);
298
- // }
299
- // }
300
-
301
- public handleNodeChange(records: MutationRecord[]): void {
302
- if (records.find(x => x.type === 'childList'
303
- && (Array.from(x.addedNodes).find(y => (y as HTMLElement).tagName === 'MDC-LIST-ITEM')
304
- || Array.from(x.removedNodes).find(y => (y as HTMLElement).tagName === 'MDC-LIST-ITEM'))
305
- )) {
306
- this.optionsWereSet = true;
307
- this.synchronizeOptions();
308
- const shouldNotify = this.synchronizeValue();
309
- if (shouldNotify) {
310
- this.notify();
311
- }
312
- }
313
- }
314
-
315
- public subscribe(subscriber: ISubscriber): void {
316
- if (this.subs.add(subscriber) && this.subs.count === 1) {
317
- for (const e of this.config.events) {
318
- this.obj.addEventListener(e, this);
319
- }
320
- this.listened = true;
321
- this.start();
322
- }
323
- }
324
-
325
- public unsubscribe(subscriber: ISubscriber): void {
326
- if (this.subs.remove(subscriber) && this.subs.count === 0) {
327
- for (const e of this.config.events) {
328
- this.obj.removeEventListener(e, this);
329
- }
330
- this.listened = false;
331
- this.stop();
332
- }
333
- }
334
-
335
- useConfig(config: INodeObserverConfigBase): void {
336
- this.config = config;
337
- if (this.listened) {
338
- for (const e of this.config.events) {
339
- this.obj.removeEventListener(e, this);
340
- }
341
- for (const e of this.config.events) {
342
- this.obj.addEventListener(e, this);
343
- }
344
- }
345
- }
346
- }
1
+ import {
2
+ subscriberCollection,
3
+ AccessorType,
4
+ } from '@aurelia/runtime';
5
+
6
+ import type {
7
+ ICollectionObserver,
8
+ IndexMap,
9
+ IObserver,
10
+ IObserverLocator,
11
+ ISubscriber,
12
+ ISubscriberCollection,
13
+ } from '@aurelia/runtime';
14
+
15
+ import { INode, CustomElement } from '@aurelia/runtime-html';
16
+ import { IMdcSelectElement, MdcSelect } from './mdc-select';
17
+
18
+ // const hasOwn = Object.prototype.hasOwnProperty;
19
+ const childObserverOptions = {
20
+ childList: true,
21
+ subtree: true,
22
+ characterData: true
23
+ };
24
+
25
+ // function defaultMatcher(a: unknown, b: unknown): boolean {
26
+ // return a === b;
27
+ // }
28
+
29
+ export interface IOptionElement extends HTMLOptionElement {
30
+ model?: unknown;
31
+ }
32
+
33
+ export interface MdcSelectValueObserver extends
34
+ ISubscriberCollection { }
35
+
36
+ export interface INodeObserverConfigBase {
37
+ /**
38
+ * Indicates the list of events can be used to observe a particular property
39
+ */
40
+ readonly events: string[];
41
+ /**
42
+ * Indicates whether this property is readonly, so observer wont attempt to assign value
43
+ * example: input.files
44
+ */
45
+ readonly readonly?: boolean;
46
+ /**
47
+ * A default value to assign to the corresponding property if the incoming value is null/undefined
48
+ */
49
+ readonly default?: unknown;
50
+ }
51
+
52
+
53
+ export interface INodeObserver extends IObserver {
54
+ /**
55
+ * Instruct this node observer event observation behavior
56
+ */
57
+ useConfig(config: INodeObserverConfigBase): void;
58
+ }
59
+
60
+ @subscriberCollection()
61
+ export class MdcSelectValueObserver implements INodeObserver {
62
+ public currentValue: unknown = void 0;
63
+ public oldValue: unknown = void 0;
64
+
65
+ public readonly obj: IMdcSelectElement;
66
+ public config: INodeObserverConfigBase;
67
+
68
+ public hasChanges: boolean = false;
69
+ // ObserverType.Layout is not always true
70
+ // but for simplicity, always treat as such
71
+ public type: AccessorType = (AccessorType.Node | AccessorType.Observer | AccessorType.Layout) as AccessorType;
72
+
73
+ public arrayObserver?: ICollectionObserver<'array'> = void 0;
74
+ public nodeObserver?: MutationObserver = void 0;
75
+
76
+ private observing: boolean = false;
77
+ private listened: boolean = false;
78
+
79
+ public constructor(
80
+ obj: INode,
81
+ // deepscan-disable-next-line
82
+ _key: PropertyKey,
83
+ config: INodeObserverConfigBase,
84
+ _: IObserverLocator
85
+ ) {
86
+ this.obj = obj as unknown as IMdcSelectElement;
87
+ this.config = config;
88
+ }
89
+
90
+ optionsWereSet: boolean;
91
+
92
+ setElementValue(skipNotify: boolean) {
93
+ // do not pass the value to the element if options has never been set
94
+ // the value will be passed on when options do arrive
95
+ if (this.optionsWereSet) {
96
+ CustomElement.for<MdcSelect>(this.obj).viewModel.setValue(this.currentValue, skipNotify);
97
+ }
98
+ }
99
+
100
+ public getValue(): unknown {
101
+ // is it safe to assume the observer has the latest value?
102
+ // todo: ability to turn on/off cache based on type
103
+ return this.observing
104
+ ? this.currentValue
105
+ // : this.obj.multiple
106
+ // ? Array.from(this.obj.options).map(o => o.value)
107
+ : this.obj.value;
108
+ }
109
+
110
+ public setValue(newValue: unknown): void {
111
+ this.oldValue = this.currentValue;
112
+ this.currentValue = newValue;
113
+ this.hasChanges = newValue !== this.oldValue;
114
+ // this.observeArray(newValue instanceof Array ? newValue : null);
115
+ if (this.optionsWereSet) {
116
+ this.flushChanges();
117
+ }
118
+ }
119
+
120
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
121
+ public flushChanges(): void {
122
+ if (this.hasChanges) {
123
+ this.hasChanges = false;
124
+ this.synchronizeOptions();
125
+ }
126
+ }
127
+
128
+ public handleCollectionChange(): void {
129
+ // always sync "selected" property of <options/>
130
+ // immediately whenever the array notifies its mutation
131
+ this.synchronizeOptions();
132
+ }
133
+
134
+ public notify(): void {
135
+ const oldValue = this.oldValue;
136
+ const newValue = this.currentValue;
137
+ if (newValue === oldValue) {
138
+ return;
139
+ }
140
+ this.subs.notify(newValue, oldValue);
141
+ }
142
+
143
+ public handleEvent(): void {
144
+ const shouldNotify = this.synchronizeValue();
145
+ if (shouldNotify) {
146
+ this.subs.notify(this.currentValue, this.oldValue);
147
+ }
148
+ }
149
+
150
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
151
+ public synchronizeOptions(_indexMap?: IndexMap): void {
152
+ this.setElementValue(true);
153
+ // const { currentValue, obj } = this;
154
+ // // const isArray = Array.isArray(currentValue);
155
+ // // const matcher = obj.matcher !== void 0 ? obj.matcher : defaultMatcher;
156
+ // // const matcher = defaultMatcher;
157
+ // const options = CustomElement.for<MdcSelect>(obj).viewModel.items;
158
+ // let i = options.length;
159
+
160
+ // while (i-- > 0) {
161
+ // // const option = options[i];
162
+ // // const optionValue = hasOwn.call(option, 'model') ? option.model : option.value;
163
+ // // const optionValue = option.value;
164
+ // // if (isArray) {
165
+ // // option.selected = (currentValue as unknown[]).findIndex(item => !!matcher(optionValue, item)) !== -1;
166
+ // // continue;
167
+ // // }
168
+ // if (!this.optionsWereSet) {
169
+ // this.optionsWereSet = true;
170
+ // this.setElementValue(true);
171
+ // }
172
+ // // option.selected = !!matcher(optionValue, currentValue);
173
+ // }
174
+ }
175
+
176
+ public synchronizeValue(): boolean {
177
+ // Spec for synchronizing value from `<select/>` to `SelectObserver`
178
+ // When synchronizing value to observed <select/> element, do the following steps:
179
+ // A. If `<select/>` is multiple
180
+ // 1. Check if current value, called `currentValue` is an array
181
+ // a. If not an array, return true to signal value has changed
182
+ // b. If is an array:
183
+ // i. gather all current selected <option/>, in to array called `values`
184
+ // ii. loop through the `currentValue` array and remove items that are nolonger selected based on matcher
185
+ // iii. loop through the `values` array and add items that are selected based on matcher
186
+ // iv. Return false to signal value hasn't changed
187
+ // B. If the select is single
188
+ // 1. Let `value` equal the first selected option, if no option selected, then `value` is `null`
189
+ // 2. assign `this.currentValue` to `this.oldValue`
190
+ // 3. assign `value` to `this.currentValue`
191
+ // 4. return `true` to signal value has changed
192
+ const obj = this.obj;
193
+ const options = CustomElement.for<MdcSelect>(obj).viewModel.items ?? [];
194
+ const len = options.length;
195
+ // const currentValue = this.currentValue;
196
+ let i = 0;
197
+
198
+ /*
199
+ if (obj.multiple) {
200
+ // A.
201
+ if (!(currentValue instanceof Array)) {
202
+ // A.1.a
203
+ return true;
204
+ }
205
+ // A.1.b
206
+ // multi select
207
+ let option: IOptionElement;
208
+ const matcher = obj.matcher ?? defaultMatcher;
209
+ // A.1.b.i
210
+ const values: unknown[] = [];
211
+ while (i < len) {
212
+ option = options[i];
213
+ if (option.selected) {
214
+ values.push(hasOwn.call(option, 'model')
215
+ ? option.model
216
+ : option.value
217
+ );
218
+ }
219
+ ++i;
220
+ }
221
+ // A.1.b.ii
222
+ i = 0;
223
+ while (i < currentValue.length) {
224
+ const a = currentValue[i];
225
+ // Todo: remove arrow fn
226
+ if (values.findIndex(b => !!matcher(a, b)) === -1) {
227
+ currentValue.splice(i, 1);
228
+ } else {
229
+ ++i;
230
+ }
231
+ }
232
+ // A.1.b.iii
233
+ i = 0;
234
+ while (i < values.length) {
235
+ const a = values[i];
236
+ // Todo: remove arrow fn
237
+ if (currentValue.findIndex(b => !!matcher(a, b)) === -1) {
238
+ currentValue.push(a);
239
+ }
240
+ ++i;
241
+ }
242
+ // A.1.b.iv
243
+ return false;
244
+ }
245
+ */
246
+ // B. single select
247
+ // B.1
248
+ let value: unknown = undefined;
249
+ while (i < len) {
250
+ const option = options[i];
251
+ if (option.value === this.obj.value) {
252
+ // value = hasOwn.call(option, 'model') ? option.model : option.value;
253
+ value = option.value;
254
+ break;
255
+ }
256
+ ++i;
257
+ }
258
+ // B.2
259
+ this.oldValue = this.currentValue;
260
+ // B.3
261
+ this.currentValue = value;
262
+ // B.4
263
+ return true;
264
+ }
265
+
266
+ private start(): void {
267
+ const vm = CustomElement.for<MdcSelect>(this.obj).viewModel;
268
+ vm.initialised.then(() => {
269
+ (this.nodeObserver = new this.obj.ownerDocument.defaultView!.MutationObserver(records => this.handleNodeChange(records)))
270
+ .observe(vm.menu.root, childObserverOptions);
271
+ // this.observeArray(this.currentValue instanceof Array ? this.currentValue : null);
272
+ this.observing = true;
273
+ if (vm.items?.length) {
274
+ this.optionsWereSet = true;
275
+ this.synchronizeOptions();
276
+ }
277
+ });
278
+ }
279
+
280
+ private stop(): void {
281
+ this.optionsWereSet = false;
282
+ this.nodeObserver?.disconnect();
283
+ this.arrayObserver?.unsubscribe(this);
284
+ this.nodeObserver
285
+ = this.arrayObserver
286
+ = void 0;
287
+ this.observing = false;
288
+ }
289
+
290
+ // todo: observe all kind of collection
291
+ // private observeArray(array: unknown[] | null): void {
292
+ // this.arrayObserver?.unsubscribe(this);
293
+ // this.arrayObserver = void 0;
294
+ // if (array !== null) {
295
+ // if (!this.obj.multiple) {
296
+ // throw new Error('Only null or Array instances can be bound to a multi-select.');
297
+ // }
298
+ // (this.arrayObserver = this.observerLocator.getArrayObserver(array)).subscribe(this);
299
+ // }
300
+ // }
301
+
302
+ public handleNodeChange(records: MutationRecord[]): void {
303
+ if (records.find(x => x.type === 'childList'
304
+ && (Array.from(x.addedNodes).find(y => (y as HTMLElement).tagName === 'MDC-LIST-ITEM')
305
+ || Array.from(x.removedNodes).find(y => (y as HTMLElement).tagName === 'MDC-LIST-ITEM'))
306
+ )) {
307
+ this.optionsWereSet = true;
308
+ this.synchronizeOptions();
309
+ const shouldNotify = this.synchronizeValue();
310
+ if (shouldNotify) {
311
+ this.notify();
312
+ }
313
+ }
314
+ }
315
+
316
+ public subscribe(subscriber: ISubscriber): void {
317
+ if (this.subs.add(subscriber) && this.subs.count === 1) {
318
+ for (const e of this.config.events) {
319
+ this.obj.addEventListener(e, this);
320
+ }
321
+ this.listened = true;
322
+ this.start();
323
+ }
324
+ }
325
+
326
+ public unsubscribe(subscriber: ISubscriber): void {
327
+ if (this.subs.remove(subscriber) && this.subs.count === 0) {
328
+ for (const e of this.config.events) {
329
+ this.obj.removeEventListener(e, this);
330
+ }
331
+ this.listened = false;
332
+ this.stop();
333
+ }
334
+ }
335
+
336
+ useConfig(config: INodeObserverConfigBase): void {
337
+ this.config = config;
338
+ if (this.listened) {
339
+ for (const e of this.config.events) {
340
+ this.obj.removeEventListener(e, this);
341
+ }
342
+ for (const e of this.config.events) {
343
+ this.obj.addEventListener(e, this);
344
+ }
345
+ }
346
+ }
347
+ }