@momentum-ui/web-components 2.14.12 → 2.14.13

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 (1351) hide show
  1. package/.eslintignore +6 -0
  2. package/.eslintrc.js +22 -0
  3. package/.github/CODEOWNERS +5 -0
  4. package/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
  5. package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  6. package/.github/pull_request_template.md +191 -0
  7. package/.prettierignore +6 -0
  8. package/.prettierrc +6 -0
  9. package/.storybook/main.ts +66 -0
  10. package/.storybook/manager.ts +16 -0
  11. package/.storybook/preview-body.html +43 -0
  12. package/.storybook/preview-head.html +3 -0
  13. package/.storybook/preview.ts +38 -0
  14. package/.stylelintignore +6 -0
  15. package/.stylelintrc.js +18 -0
  16. package/.vscode/extensions.json +13 -0
  17. package/.vscode/launch.json +13 -0
  18. package/.vscode/settings.json +33 -0
  19. package/ANGULAR_USAGE.md +102 -0
  20. package/APPLYING_STYLES.md +44 -0
  21. package/CHANGELOG.md +23 -0
  22. package/CONTRIBUTING.md +56 -0
  23. package/REACT_USAGE.md +145 -0
  24. package/VERSIONING.md +28 -0
  25. package/WEB_COMPONENTS_CRASH_COURSE.md +255 -0
  26. package/babel.config.js +4 -0
  27. package/codecov.yml +10 -0
  28. package/jest/cssTransform.js +9 -0
  29. package/jest/imgTransform.js +9 -0
  30. package/jest/svgTransform.js +9 -0
  31. package/jest.config.js +37 -0
  32. package/package.json +130 -6
  33. package/publish-conf.js +64 -0
  34. package/sonar-project.properties +22 -0
  35. package/sonar.config.js +22 -0
  36. package/src/[sandbox]/examples/AdvanceList/components/ErrorLoader/ErrorLoader.scss +22 -0
  37. package/src/[sandbox]/examples/AdvanceList/components/ErrorLoader/ErrorLoader.ts +77 -0
  38. package/src/[sandbox]/examples/AdvanceList/components/ParentComponentError.ts +116 -0
  39. package/src/[sandbox]/examples/AdvanceList/components/ParentComponentGeneric.ts +95 -0
  40. package/src/[sandbox]/examples/AdvanceList/components/ParentComponentPreSelect.ts +90 -0
  41. package/src/[sandbox]/examples/accordion.ts +67 -0
  42. package/src/[sandbox]/examples/advance-list.ts +14 -0
  43. package/src/[sandbox]/examples/alert-banner.ts +100 -0
  44. package/src/[sandbox]/examples/alert.ts +130 -0
  45. package/src/[sandbox]/examples/audio-player.ts +9 -0
  46. package/src/[sandbox]/examples/avatar.ts +119 -0
  47. package/src/[sandbox]/examples/badge.ts +170 -0
  48. package/src/[sandbox]/examples/breadcrumb.ts +5 -0
  49. package/src/[sandbox]/examples/button-group.ts +66 -0
  50. package/src/[sandbox]/examples/button.ts +407 -0
  51. package/src/[sandbox]/examples/card-ai.ts +105 -0
  52. package/src/[sandbox]/examples/card.ts +76 -0
  53. package/src/[sandbox]/examples/chat-message.ts +33 -0
  54. package/src/[sandbox]/examples/checkbox.ts +64 -0
  55. package/src/[sandbox]/examples/chip.ts +121 -0
  56. package/src/[sandbox]/examples/coachmark.ts +90 -0
  57. package/src/[sandbox]/examples/code-editor.ts +13 -0
  58. package/src/[sandbox]/examples/colorTable.ts +12 -0
  59. package/src/[sandbox]/examples/combobox.ts +402 -0
  60. package/src/[sandbox]/examples/date-range-picker.ts +26 -0
  61. package/src/[sandbox]/examples/date-time-picker.ts +25 -0
  62. package/src/[sandbox]/examples/datepicker.ts +41 -0
  63. package/src/[sandbox]/examples/draggable.ts +70 -0
  64. package/src/[sandbox]/examples/dropdown.ts +263 -0
  65. package/src/[sandbox]/examples/editable-field.ts +115 -0
  66. package/src/[sandbox]/examples/favorite.ts +49 -0
  67. package/src/[sandbox]/examples/floating-modal.ts +101 -0
  68. package/src/[sandbox]/examples/form.ts +101 -0
  69. package/src/[sandbox]/examples/grabber.ts +165 -0
  70. package/src/[sandbox]/examples/icon.ts +66 -0
  71. package/src/[sandbox]/examples/index.ts +54 -0
  72. package/src/[sandbox]/examples/input-file.ts +7 -0
  73. package/src/[sandbox]/examples/input.ts +440 -0
  74. package/src/[sandbox]/examples/label.ts +13 -0
  75. package/src/[sandbox]/examples/link.ts +46 -0
  76. package/src/[sandbox]/examples/list.ts +55 -0
  77. package/src/[sandbox]/examples/loading.ts +8 -0
  78. package/src/[sandbox]/examples/meeting-alert.ts +108 -0
  79. package/src/[sandbox]/examples/menu-item.ts +33 -0
  80. package/src/[sandbox]/examples/menu-overlay.ts +580 -0
  81. package/src/[sandbox]/examples/modal.ts +451 -0
  82. package/src/[sandbox]/examples/pagination.ts +13 -0
  83. package/src/[sandbox]/examples/phone-input.ts +90 -0
  84. package/src/[sandbox]/examples/progress-bar.ts +6 -0
  85. package/src/[sandbox]/examples/radio-group.ts +52 -0
  86. package/src/[sandbox]/examples/slider.ts +17 -0
  87. package/src/[sandbox]/examples/spinner.ts +4 -0
  88. package/src/[sandbox]/examples/table-advanced.ts +120 -0
  89. package/src/[sandbox]/examples/table.ts +106 -0
  90. package/src/[sandbox]/examples/tabs.ts +843 -0
  91. package/src/[sandbox]/examples/task-item.ts +99 -0
  92. package/src/[sandbox]/examples/timepicker.ts +26 -0
  93. package/src/[sandbox]/examples/toggle-switch.ts +20 -0
  94. package/src/[sandbox]/examples/tooltip.ts +138 -0
  95. package/src/[sandbox]/favicon.ico +0 -0
  96. package/src/[sandbox]/index.html +15 -0
  97. package/src/[sandbox]/sandbox.mock.ts +636 -0
  98. package/src/[sandbox]/sandbox.scss +66 -0
  99. package/src/[sandbox]/sandbox.ts +737 -0
  100. package/src/assets/images/profile.svg +47 -0
  101. package/src/assets/images/whatsapp.svg +1104 -0
  102. package/src/assets/images/wxm.svg +8 -0
  103. package/src/components/accordion/Accordion.mdx +74 -0
  104. package/src/components/accordion/Accordion.stories.ts +50 -0
  105. package/src/components/accordion/Accordion.test.ts +151 -0
  106. package/src/components/accordion/Accordion.ts +188 -0
  107. package/src/components/accordion/AccordionItem.test.ts +124 -0
  108. package/src/components/accordion/AccordionItem.ts +180 -0
  109. package/src/components/accordion/scss/accordion-item.scss +87 -0
  110. package/src/components/accordion/scss/accordion.scss +30 -0
  111. package/src/components/accordion/scss/mixins.scss +16 -0
  112. package/src/components/accordion/scss/module.scss +17 -0
  113. package/src/components/accordion/scss/settings.scss +10 -0
  114. package/src/components/accordion/tokens/lm-accordion-tokens.js +26 -0
  115. package/src/components/accordion/tokens/md-accordion-tokens.js +26 -0
  116. package/src/components/accordion/tokens/mdv2-accordion-tokens.js +21 -0
  117. package/src/components/activity-button/ActivityButton.test.ts +52 -0
  118. package/src/components/activity-button/ActivityButton.ts +92 -0
  119. package/src/components/activity-button/scss/activity-button.scss +160 -0
  120. package/src/components/activity-button/scss/module.scss +63 -0
  121. package/src/components/advance-list/AdvanceList.test.ts +367 -0
  122. package/src/components/advance-list/AdvanceList.ts +267 -0
  123. package/src/components/advance-list/scss/AdvanceList.scss +69 -0
  124. package/src/components/advance-list/scss/module.scss +11 -0
  125. package/src/components/advance-list/tokens/lm-advance-list-tokens.js +46 -0
  126. package/src/components/advance-list/tokens/md-advance-list-tokens.js +46 -0
  127. package/src/components/advance-list/tokens/mdv2-adavance-list-tokens.js +49 -0
  128. package/src/components/alert/Alert.mdx +72 -0
  129. package/src/components/alert/Alert.stories.ts +123 -0
  130. package/src/components/alert/Alert.test.ts +276 -0
  131. package/src/components/alert/Alert.ts +265 -0
  132. package/src/components/alert/scss/alert.scss +215 -0
  133. package/src/components/alert/scss/mixins.scss +27 -0
  134. package/src/components/alert/scss/module.scss +21 -0
  135. package/src/components/alert/scss/settings.scss +41 -0
  136. package/src/components/alert/tokens/lm-alert-tokens.js +52 -0
  137. package/src/components/alert/tokens/md-alert-tokens.js +52 -0
  138. package/src/components/alert/tokens/mdv2-alert-tokens.js +48 -0
  139. package/src/components/alert-banner/AlertBanner.mdx +38 -0
  140. package/src/components/alert-banner/AlertBanner.stories.ts +63 -0
  141. package/src/components/alert-banner/AlertBanner.test.ts +79 -0
  142. package/src/components/alert-banner/AlertBanner.ts +89 -0
  143. package/src/components/alert-banner/scss/alert-banner.scss +68 -0
  144. package/src/components/alert-banner/scss/mixins.scss +8 -0
  145. package/src/components/alert-banner/scss/module.scss +10 -0
  146. package/src/components/alert-banner/scss/settings.scss +15 -0
  147. package/src/components/alert-banner/tokens/lm-alertbanner-tokens.js +50 -0
  148. package/src/components/alert-banner/tokens/md-alertbanner-tokens.js +50 -0
  149. package/src/components/alert-banner/tokens/mdv2-alertbanner-tokens.js +44 -0
  150. package/src/components/audio-player/AudioPlayer.stories.ts +42 -0
  151. package/src/components/audio-player/AudioPlayer.test.ts +208 -0
  152. package/src/components/audio-player/AudioPlayer.ts +539 -0
  153. package/src/components/audio-player/scss/audio-player.scss +236 -0
  154. package/src/components/audio-player/scss/mixins.scss +0 -0
  155. package/src/components/audio-player/scss/module.scss +16 -0
  156. package/src/components/audio-player/scss/settings.scss +15 -0
  157. package/src/components/audio-player/tokens/lm-audio-player-token.js +46 -0
  158. package/src/components/audio-player/tokens/md-audio-player-token.js +46 -0
  159. package/src/components/audio-player/tokens/mdv2-audio-player-token.js +37 -0
  160. package/src/components/avatar/Avatar.constants.ts +31 -0
  161. package/src/components/avatar/Avatar.mdx +153 -0
  162. package/src/components/avatar/Avatar.stories.ts +97 -0
  163. package/src/components/avatar/Avatar.test.ts +202 -0
  164. package/src/components/avatar/Avatar.ts +294 -0
  165. package/src/components/avatar/CompositeAvatar.ts +47 -0
  166. package/src/components/avatar/Presence.test.ts +239 -0
  167. package/src/components/avatar/Presence.ts +52 -0
  168. package/src/components/avatar/Presence.utils.ts +132 -0
  169. package/src/components/avatar/scss/avatar.scss +331 -0
  170. package/src/components/avatar/scss/composite-avatar.scss +89 -0
  171. package/src/components/avatar/scss/mixins.scss +33 -0
  172. package/src/components/avatar/scss/module.scss +20 -0
  173. package/src/components/avatar/scss/presence.scss +47 -0
  174. package/src/components/avatar/scss/settings.scss +249 -0
  175. package/src/components/avatar/tokens/lm-avatar-tokens.js +193 -0
  176. package/src/components/avatar/tokens/md-avatar-tokens.js +183 -0
  177. package/src/components/avatar/tokens/mdv2-avatar-tokens.js +179 -0
  178. package/src/components/badge/Badge.stories.ts +62 -0
  179. package/src/components/badge/Badge.test.ts +100 -0
  180. package/src/components/badge/Badge.ts +114 -0
  181. package/src/components/badge/scss/badge.scss +244 -0
  182. package/src/components/badge/scss/mixins.scss +82 -0
  183. package/src/components/badge/scss/module.scss +12 -0
  184. package/src/components/badge/scss/settings.scss +69 -0
  185. package/src/components/badge/tokens/lm-badge-tokens.js +369 -0
  186. package/src/components/badge/tokens/md-badge-tokens.js +359 -0
  187. package/src/components/badge/tokens/mdv2-badge-tokens.js +392 -0
  188. package/src/components/breadcrumb/Breadcrumb.stories.ts +61 -0
  189. package/src/components/breadcrumb/Breadcrumb.test.ts +38 -0
  190. package/src/components/breadcrumb/Breadcrumb.ts +79 -0
  191. package/src/components/breadcrumb/scss/breadcrumb.scss +39 -0
  192. package/src/components/breadcrumb/scss/mixins.scss +5 -0
  193. package/src/components/breadcrumb/scss/module.scss +15 -0
  194. package/src/components/breadcrumb/scss/settings.scss +6 -0
  195. package/src/components/breadcrumb/tokens/lm-breadcrumb-token.js +23 -0
  196. package/src/components/breadcrumb/tokens/md-breadcrumb-token.js +23 -0
  197. package/src/components/breadcrumb/tokens/mdv2-breadcrumb-token.js +18 -0
  198. package/src/components/button/Button.mdx +77 -0
  199. package/src/components/button/Button.stories.ts +97 -0
  200. package/src/components/button/Button.test.ts +278 -0
  201. package/src/components/button/Button.ts +377 -0
  202. package/src/components/button/README.md +72 -0
  203. package/src/components/button/scss/button.scss +1002 -0
  204. package/src/components/button/scss/mixins.scss +281 -0
  205. package/src/components/button/scss/module.scss +18 -0
  206. package/src/components/button/scss/settings.scss +242 -0
  207. package/src/components/button/tokens/lm-button-tokens.js +352 -0
  208. package/src/components/button/tokens/mdv2-button-tokens.js +465 -0
  209. package/src/components/button-group/ButtonGroup.stories.ts +53 -0
  210. package/src/components/button-group/ButtonGroup.test.ts +146 -0
  211. package/src/components/button-group/ButtonGroup.ts +219 -0
  212. package/src/components/button-group/scss/button-group.scss +95 -0
  213. package/src/components/button-group/scss/module.scss +16 -0
  214. package/src/components/button-group/scss/settings.scss +5 -0
  215. package/src/components/button-group/tokens/lm-button-group-tokens.js +38 -0
  216. package/src/components/button-group/tokens/md-button-group-tokens.js +38 -0
  217. package/src/components/button-group/tokens/mdv2-button-group-tokens.js +40 -0
  218. package/src/components/card/Card.stories.ts +89 -0
  219. package/src/components/card/Card.test.ts +83 -0
  220. package/src/components/card/Card.ts +179 -0
  221. package/src/components/card/scss/card.scss +131 -0
  222. package/src/components/card/scss/module.scss +13 -0
  223. package/src/components/card/scss/settings.scss +11 -0
  224. package/src/components/card-ai/CardAi.stories.ts +62 -0
  225. package/src/components/card-ai/CardAi.test.ts +203 -0
  226. package/src/components/card-ai/CardAi.ts +232 -0
  227. package/src/components/card-ai/scss/card-ai.scss +107 -0
  228. package/src/components/card-ai/scss/module.scss +13 -0
  229. package/src/components/card-ai/scss/settings.scss +17 -0
  230. package/src/components/card-ai/tokens/lm-card-ai-tokens.js +16 -0
  231. package/src/components/card-ai/tokens/md-card-ai-tokens.js +16 -0
  232. package/src/components/card-ai/tokens/mdv2-card-ai-tokens.js +16 -0
  233. package/src/components/chat-message/ChatMessage.stories.ts +39 -0
  234. package/src/components/chat-message/ChatMessage.test.ts +53 -0
  235. package/src/components/chat-message/ChatMessage.ts +52 -0
  236. package/src/components/chat-message/scss/chat-message.scss +49 -0
  237. package/src/components/chat-message/scss/mixins.scss +6 -0
  238. package/src/components/chat-message/scss/module.scss +16 -0
  239. package/src/components/chat-message/scss/settings.scss +7 -0
  240. package/src/components/chat-message/tokens/lm-chat-message-tokens.js +18 -0
  241. package/src/components/chat-message/tokens/md-chat-message-tokens.js +18 -0
  242. package/src/components/chat-message/tokens/mdv2-chat-message-tokens.js +15 -0
  243. package/src/components/checkbox/Checkbox.stories.ts +68 -0
  244. package/src/components/checkbox/Checkbox.test.ts +124 -0
  245. package/src/components/checkbox/Checkbox.ts +172 -0
  246. package/src/components/checkbox/CheckboxGroup.test.ts +43 -0
  247. package/src/components/checkbox/CheckboxGroup.ts +91 -0
  248. package/src/components/checkbox/scss/checkbox.scss +152 -0
  249. package/src/components/checkbox/scss/checkboxgroup.scss +17 -0
  250. package/src/components/checkbox/scss/mixins.scss +0 -0
  251. package/src/components/checkbox/scss/module.scss +13 -0
  252. package/src/components/checkbox/scss/settings.scss +15 -0
  253. package/src/components/checkbox/tokens/lm-checkbox-tokens.js +82 -0
  254. package/src/components/checkbox/tokens/md-checkbox-tokens.js +83 -0
  255. package/src/components/checkbox/tokens/mdv2-checkbox-tokens.js +65 -0
  256. package/src/components/chip/Chip.stories.ts +89 -0
  257. package/src/components/chip/Chip.test.ts +137 -0
  258. package/src/components/chip/Chip.ts +299 -0
  259. package/src/components/chip/scss/chip.scss +469 -0
  260. package/src/components/chip/scss/mixins.scss +54 -0
  261. package/src/components/chip/scss/module.scss +17 -0
  262. package/src/components/chip/scss/settings.scss +5 -0
  263. package/src/components/coachmark/Coachmark.stories.ts +46 -0
  264. package/src/components/coachmark/Coachmark.test.ts +143 -0
  265. package/src/components/coachmark/Coachmark.ts +155 -0
  266. package/src/components/coachmark/scss/coachmarks.scss +569 -0
  267. package/src/components/coachmark/scss/module.scss +14 -0
  268. package/src/components/coachmark/scss/settings.scss +4 -0
  269. package/src/components/coachmark/tokens/lm-coachmark-tokens.js +140 -0
  270. package/src/components/coachmark/tokens/md-coachmark-tokens.js +130 -0
  271. package/src/components/coachmark/tokens/mdv2-coachmark-tokens.js +117 -0
  272. package/src/components/code-editor/CodeEditor.stories.ts +31 -0
  273. package/src/components/code-editor/CodeEditor.test.ts +46 -0
  274. package/src/components/code-editor/CodeEditor.ts +183 -0
  275. package/src/components/code-editor/scss/code-editor.scss +157 -0
  276. package/src/components/code-editor/scss/module.scss +12 -0
  277. package/src/components/code-editor/scss/settings.scss +10 -0
  278. package/src/components/combobox/ComboBox.stories.ts +185 -0
  279. package/src/components/combobox/ComboBox.test.ts +1517 -0
  280. package/src/components/combobox/ComboBox.ts +1824 -0
  281. package/src/components/combobox/scss/combobox.scss +572 -0
  282. package/src/components/combobox/scss/mixins.scss +9 -0
  283. package/src/components/combobox/scss/module.scss +17 -0
  284. package/src/components/combobox/scss/settings.scss +35 -0
  285. package/src/components/combobox/tokens/lm-combobox-tokens.js +152 -0
  286. package/src/components/combobox/tokens/md-combobox-tokens.js +156 -0
  287. package/src/components/combobox/tokens/mdv2-combobox-tokens.js +132 -0
  288. package/src/components/date-range-picker/DateRangePicker.stories.ts +49 -0
  289. package/src/components/date-range-picker/DateRangePicker.test.ts +173 -0
  290. package/src/components/date-range-picker/DateRangePicker.ts +92 -0
  291. package/src/components/date-range-picker/scss/daterangepicker.scss +0 -0
  292. package/src/components/date-range-picker/tokens/lm-date-range-picker-tokens.js +26 -0
  293. package/src/components/date-range-picker/tokens/md-date-range-picker-tokens.js +26 -0
  294. package/src/components/date-range-picker/tokens/mdv2-date-range-picker-tokens.js +26 -0
  295. package/src/components/date-time-picker/DateTimePicker.stories.ts +50 -0
  296. package/src/components/date-time-picker/DateTimePicker.test.ts +37 -0
  297. package/src/components/date-time-picker/DateTimePicker.ts +187 -0
  298. package/src/components/date-time-picker/scss/date-time-picker.scss +7 -0
  299. package/src/components/date-time-picker/scss/module.scss +9 -0
  300. package/src/components/date-time-picker/scss/settings.scss +1 -0
  301. package/src/components/datepicker/DatePicker.stories.ts +42 -0
  302. package/src/components/datepicker/DatePicker.test.ts +97 -0
  303. package/src/components/datepicker/DatePicker.ts +290 -0
  304. package/src/components/datepicker/datepicker-calendar/DatePickerCalendar.test.ts +70 -0
  305. package/src/components/datepicker/datepicker-calendar/DatePickerCalendar.ts +179 -0
  306. package/src/components/datepicker/datepicker-day/DatePickerDay.test.ts +48 -0
  307. package/src/components/datepicker/datepicker-day/DatePickerDay.ts +173 -0
  308. package/src/components/datepicker/datepicker-month/DatePickerMonth.test.ts +13 -0
  309. package/src/components/datepicker/datepicker-month/DatePickerMonth.ts +60 -0
  310. package/src/components/datepicker/datepicker-week/DatePickerWeek.test.ts +13 -0
  311. package/src/components/datepicker/datepicker-week/DatePickerWeek.ts +56 -0
  312. package/src/components/datepicker/scss/datepicker.scss +240 -0
  313. package/src/components/datepicker/scss/module.scss +9 -0
  314. package/src/components/datepicker/scss/settings.scss +9 -0
  315. package/src/components/datepicker/tokens/lm-datepicker-tokens.js +72 -0
  316. package/src/components/datepicker/tokens/md-datepicker-tokens.js +72 -0
  317. package/src/components/datepicker/tokens/mdv2-datepicker-tokens.js +80 -0
  318. package/src/components/draggable/Draggable.mdx +258 -0
  319. package/src/components/draggable/Draggable.stories.ts +171 -0
  320. package/src/components/draggable/Draggable.test.ts +116 -0
  321. package/src/components/draggable/Draggable.ts +203 -0
  322. package/src/components/draggable/DraggableItem.test.ts +45 -0
  323. package/src/components/draggable/DraggableItem.ts +58 -0
  324. package/src/components/draggable/scss/draggable-item.scss +70 -0
  325. package/src/components/draggable/scss/module.scss +12 -0
  326. package/src/components/draggable/scss/settings.scss +6 -0
  327. package/src/components/dropdown/Dropdown.stories.ts +121 -0
  328. package/src/components/dropdown/Dropdown.test.ts +461 -0
  329. package/src/components/dropdown/Dropdown.ts +901 -0
  330. package/src/components/dropdown/scss/dropdown.scss +488 -0
  331. package/src/components/dropdown/scss/mixins.scss +23 -0
  332. package/src/components/dropdown/scss/module.scss +25 -0
  333. package/src/components/dropdown/scss/settings.scss +24 -0
  334. package/src/components/dropdown/tokens/lm-dropdown-tokens.js +58 -0
  335. package/src/components/dropdown/tokens/md-dropdown-tokens.js +58 -0
  336. package/src/components/dropdown/tokens/mdv2-dropdown-tokens.js +67 -0
  337. package/src/components/editable-textfield/EditableTextfield.stories.ts +106 -0
  338. package/src/components/editable-textfield/EditableTextfield.test.ts +219 -0
  339. package/src/components/editable-textfield/EditableTextfield.ts +262 -0
  340. package/src/components/editable-textfield/scss/editable-textfield.scss +128 -0
  341. package/src/components/editable-textfield/scss/module.scss +14 -0
  342. package/src/components/editable-textfield/scss/settings.scss +6 -0
  343. package/src/components/editable-textfield/tokens/lm-editabletextfield-tokens.js +130 -0
  344. package/src/components/editable-textfield/tokens/md-editabletextfield-tokens.js +118 -0
  345. package/src/components/editable-textfield/tokens/mdv2-editabletextfield-tokens.js +129 -0
  346. package/src/components/favorite/Favorite.mdx +27 -0
  347. package/src/components/favorite/Favorite.stories.ts +48 -0
  348. package/src/components/favorite/Favorite.test.ts +116 -0
  349. package/src/components/favorite/Favorite.ts +119 -0
  350. package/src/components/favorite/scss/favorite.scss +116 -0
  351. package/src/components/favorite/scss/module.scss +18 -0
  352. package/src/components/favorite/scss/settings.scss +3 -0
  353. package/src/components/floating-modal/Floating.mdx +42 -0
  354. package/src/components/floating-modal/FloatingMinimizedModal.test.ts +92 -0
  355. package/src/components/floating-modal/FloatingMinimizedModal.ts +278 -0
  356. package/src/components/floating-modal/FloatingModal.stories.ts +72 -0
  357. package/src/components/floating-modal/FloatingModal.test.ts +114 -0
  358. package/src/components/floating-modal/FloatingModal.ts +372 -0
  359. package/src/components/floating-modal/README.md +36 -0
  360. package/src/components/floating-modal/scss/floating.scss +85 -0
  361. package/src/components/floating-modal/scss/module.scss +19 -0
  362. package/src/components/floating-modal/scss/settings.scss +5 -0
  363. package/src/components/floating-modal/tokens/lm-floating-modal-tokens.js +46 -0
  364. package/src/components/floating-modal/tokens/md-floating-modal-tokens.js +46 -0
  365. package/src/components/floating-modal/tokens/mdv2-floating-modal-tokens.js +38 -0
  366. package/src/components/form/Form.stories.ts +59 -0
  367. package/src/components/form/Form.test.ts +57 -0
  368. package/src/components/form/Form.ts +239 -0
  369. package/src/components/grabber/Grabber.stories.ts +61 -0
  370. package/src/components/grabber/Grabber.test.ts +171 -0
  371. package/src/components/grabber/Grabber.ts +183 -0
  372. package/src/components/grabber/scss/grabber.scss +123 -0
  373. package/src/components/grabber/scss/module.scss +5 -0
  374. package/src/components/grabber/tokens/lm-grabber-tokens.js +39 -0
  375. package/src/components/grabber/tokens/md-grabber-tokens.js +39 -0
  376. package/src/components/grabber/tokens/mdv2-grabber-tokens.js +38 -0
  377. package/src/components/help-text/HelpText.test.ts +38 -0
  378. package/src/components/help-text/HelpText.ts +69 -0
  379. package/src/components/help-text/scss/help-text.scss +50 -0
  380. package/src/components/help-text/scss/mixins.scss +14 -0
  381. package/src/components/help-text/scss/module.scss +13 -0
  382. package/src/components/help-text/scss/settings.scss +5 -0
  383. package/src/components/help-text/tokens/lm-help-text-tokens.js +16 -0
  384. package/src/components/help-text/tokens/md-help-text-tokens.js +16 -0
  385. package/src/components/help-text/tokens/mdv2-help-text-tokens.js +14 -0
  386. package/src/components/icon/Icon.stories.ts +79 -0
  387. package/src/components/icon/Icon.test.ts +181 -0
  388. package/src/components/icon/Icon.ts +474 -0
  389. package/src/components/icon/momentum-ui-to-design-icons.json +3087 -0
  390. package/src/components/icon/scss/icon.scss +36 -0
  391. package/src/components/icon/scss/module.scss +17 -0
  392. package/src/components/icon/scss/settings.scss +10 -0
  393. package/src/components/input/Input.stories.ts +133 -0
  394. package/src/components/input/Input.test.ts +347 -0
  395. package/src/components/input/Input.ts +556 -0
  396. package/src/components/input/scss/input.scss +529 -0
  397. package/src/components/input/scss/module.scss +26 -0
  398. package/src/components/input/tokens/lm-input-tokens.js +142 -0
  399. package/src/components/input/tokens/md-input-tokens.js +132 -0
  400. package/src/components/input/tokens/mdv2-input-tokens.js +168 -0
  401. package/src/components/input-file/InputFile.stories.ts +27 -0
  402. package/src/components/input-file/InputFile.test.ts +39 -0
  403. package/src/components/input-file/InputFile.ts +115 -0
  404. package/src/components/input-file/scss/input-file.scss +8 -0
  405. package/src/components/input-file/scss/module.scss +6 -0
  406. package/src/components/label/Label.stories.ts +59 -0
  407. package/src/components/label/Label.test.ts +26 -0
  408. package/src/components/label/Label.ts +81 -0
  409. package/src/components/label/scss/label.scss +44 -0
  410. package/src/components/label/scss/mixins.scss +25 -0
  411. package/src/components/label/scss/module.scss +17 -0
  412. package/src/components/label/scss/settings.scss +8 -0
  413. package/src/components/label/tokens/lm-label-tokens.js +18 -0
  414. package/src/components/label/tokens/md-label-tokens.js +18 -0
  415. package/src/components/label/tokens/mdv2-label-tokens.js +15 -0
  416. package/src/components/link/Link.stories.ts +66 -0
  417. package/src/components/link/Link.test.ts +98 -0
  418. package/src/components/link/Link.ts +123 -0
  419. package/src/components/link/scss/link.scss +43 -0
  420. package/src/components/link/scss/mixins.scss +124 -0
  421. package/src/components/link/scss/module.scss +14 -0
  422. package/src/components/link/scss/settings.scss +5 -0
  423. package/src/components/link/tokens/lm-link-tokens.js +61 -0
  424. package/src/components/link/tokens/md-link-tokens.js +127 -0
  425. package/src/components/link/tokens/mdv2-link-tokens.js +47 -0
  426. package/src/components/list/List.stories.ts +60 -0
  427. package/src/components/list/List.test.ts +214 -0
  428. package/src/components/list/List.ts +198 -0
  429. package/src/components/list/ListItem.test.ts +59 -0
  430. package/src/components/list/ListItem.ts +69 -0
  431. package/src/components/list/scss/list.scss +26 -0
  432. package/src/components/list/scss/listitem.scss +88 -0
  433. package/src/components/list/scss/mixins.scss +8 -0
  434. package/src/components/list/scss/module.scss +15 -0
  435. package/src/components/list/scss/settings.scss +7 -0
  436. package/src/components/list/tokens/lm-list-tokens.js +46 -0
  437. package/src/components/list/tokens/md-list-tokens.js +46 -0
  438. package/src/components/list/tokens/mdv2-list-tokens.js +49 -0
  439. package/src/components/loading/Loading.stories.ts +46 -0
  440. package/src/components/loading/Loading.test.ts +29 -0
  441. package/src/components/loading/Loading.ts +48 -0
  442. package/src/components/loading/scss/loading.scss +74 -0
  443. package/src/components/loading/scss/module.scss +8 -0
  444. package/src/components/meeting-alert/CompositeAvatar.ts +37 -0
  445. package/src/components/meeting-alert/MeetingAlert.mdx +187 -0
  446. package/src/components/meeting-alert/MeetingAlert.stories.ts +197 -0
  447. package/src/components/meeting-alert/MeetingAlert.test.ts +227 -0
  448. package/src/components/meeting-alert/MeetingAlert.ts +203 -0
  449. package/src/components/meeting-alert/scss/alert.scss +244 -0
  450. package/src/components/meeting-alert/scss/mixins.scss +13 -0
  451. package/src/components/meeting-alert/scss/module.scss +20 -0
  452. package/src/components/meeting-alert/scss/settings.scss +27 -0
  453. package/src/components/meeting-alert/tokens/lm-meeting-alert-tokens.js +15 -0
  454. package/src/components/meeting-alert/tokens/md-meeting-alert-tokens.js +15 -0
  455. package/src/components/meeting-alert/tokens/mdv2-meeting-alert-tokens.js +43 -0
  456. package/src/components/menu/Menu.stories.ts +61 -0
  457. package/src/components/menu/Menu.test.ts +109 -0
  458. package/src/components/menu/Menu.ts +218 -0
  459. package/src/components/menu/MenuItem.test.ts +49 -0
  460. package/src/components/menu/MenuItem.ts +159 -0
  461. package/src/components/menu/scss/menu-item.scss +61 -0
  462. package/src/components/menu/scss/menu.scss +31 -0
  463. package/src/components/menu/scss/module.scss +15 -0
  464. package/src/components/menu/scss/settings.scss +18 -0
  465. package/src/components/menu/tokens/lm-menu-tokens.js +27 -0
  466. package/src/components/menu/tokens/md-menu-tokens.js +27 -0
  467. package/src/components/menu/tokens/mdv2-menu-tokens.js +42 -0
  468. package/src/components/menu-overlay/MenuOverlay.stories.ts +92 -0
  469. package/src/components/menu-overlay/MenuOverlay.test.ts +634 -0
  470. package/src/components/menu-overlay/MenuOverlay.ts +487 -0
  471. package/src/components/menu-overlay/scss/menu-overlay.scss +75 -0
  472. package/src/components/menu-overlay/scss/module.scss +12 -0
  473. package/src/components/menu-overlay/scss/settings.scss +6 -0
  474. package/src/components/modal/Modal.stories.ts +78 -0
  475. package/src/components/modal/Modal.test.ts +217 -0
  476. package/src/components/modal/Modal.ts +292 -0
  477. package/src/components/modal/scss/mixins.scss +109 -0
  478. package/src/components/modal/scss/modal.scss +357 -0
  479. package/src/components/modal/scss/module.scss +18 -0
  480. package/src/components/modal/scss/settings.scss +59 -0
  481. package/src/components/modal/tokens/lm-modal-tokens.js +44 -0
  482. package/src/components/modal/tokens/md-modal-tokens.js +44 -0
  483. package/src/components/modal/tokens/mdv2-modal-tokens.js +36 -0
  484. package/src/components/pagination/Pagination.stories.ts +37 -0
  485. package/src/components/pagination/Pagination.test.ts +74 -0
  486. package/src/components/pagination/Pagination.ts +219 -0
  487. package/src/components/pagination/scss/mixins.scss +11 -0
  488. package/src/components/pagination/scss/module.scss +18 -0
  489. package/src/components/pagination/scss/pagination.scss +120 -0
  490. package/src/components/pagination/scss/settings.scss +11 -0
  491. package/src/components/pagination/tokens/lm-pagination-tokens.js +49 -0
  492. package/src/components/pagination/tokens/md-pagination-tokens.js +49 -0
  493. package/src/components/pagination/tokens/mdv2-pagination-tokens.js +39 -0
  494. package/src/components/phone-input/PhoneInput.stories.ts +45 -0
  495. package/src/components/phone-input/PhoneInput.test.ts +198 -0
  496. package/src/components/phone-input/PhoneInput.ts +275 -0
  497. package/src/components/phone-input/scss/module.scss +7 -0
  498. package/src/components/phone-input/scss/phoneInput.scss +95 -0
  499. package/src/components/phone-input/scss/settings.scss +3 -0
  500. package/src/components/phone-input/tokens/lm-phone-input-tokens.js +26 -0
  501. package/src/components/phone-input/tokens/md-phone-input-tokens.js +26 -0
  502. package/src/components/phone-input/tokens/mdv2-phone-input-tokens.js +22 -0
  503. package/src/components/progress-bar/ProgressBar.stories.ts +48 -0
  504. package/src/components/progress-bar/ProgressBar.test.ts +120 -0
  505. package/src/components/progress-bar/ProgressBar.ts +112 -0
  506. package/src/components/progress-bar/scss/mixins.scss +49 -0
  507. package/src/components/progress-bar/scss/module.scss +10 -0
  508. package/src/components/progress-bar/scss/progress.scss +77 -0
  509. package/src/components/progress-bar/scss/settings.scss +28 -0
  510. package/src/components/progress-bar/tokens/lm-progress-bar-tokens.js +28 -0
  511. package/src/components/progress-bar/tokens/md-progress-bar-tokens.js +28 -0
  512. package/src/components/progress-bar/tokens/mdv2-progress-bar-tokens.js +36 -0
  513. package/src/components/radio/Radio.test.ts +66 -0
  514. package/src/components/radio/Radio.ts +94 -0
  515. package/src/components/radio/RadioGroup.stories.ts +47 -0
  516. package/src/components/radio/RadioGroup.test.ts +209 -0
  517. package/src/components/radio/RadioGroup.ts +195 -0
  518. package/src/components/radio/scss/mixins.scss +7 -0
  519. package/src/components/radio/scss/module.scss +17 -0
  520. package/src/components/radio/scss/radio.scss +149 -0
  521. package/src/components/radio/scss/radiogroup.scss +29 -0
  522. package/src/components/radio/scss/settings.scss +18 -0
  523. package/src/components/radio/tokens/lm-radio-tokens.js +84 -0
  524. package/src/components/radio/tokens/md-radio-tokens.js +84 -0
  525. package/src/components/radio/tokens/mdv2-radio-tokens.js +67 -0
  526. package/src/components/sass-stats/README.md +25 -0
  527. package/src/components/sass-stats/SassStats.test.ts +13 -0
  528. package/src/components/sass-stats/SassStats.ts +110 -0
  529. package/src/components/slider/Slider.stories.ts +54 -0
  530. package/src/components/slider/Slider.test.ts +128 -0
  531. package/src/components/slider/Slider.ts +283 -0
  532. package/src/components/slider/scss/mixins.scss +5 -0
  533. package/src/components/slider/scss/module.scss +17 -0
  534. package/src/components/slider/scss/settings.scss +10 -0
  535. package/src/components/slider/scss/slider.scss +188 -0
  536. package/src/components/slider/tokens/lm-slider-token.js +57 -0
  537. package/src/components/slider/tokens/md-slider-tokens.js +61 -0
  538. package/src/components/slider/tokens/mdv2-slider-token.js +50 -0
  539. package/src/components/spinner/Spinner.stories.ts +36 -0
  540. package/src/components/spinner/Spinner.test.ts +18 -0
  541. package/src/components/spinner/Spinner.ts +40 -0
  542. package/src/components/spinner/scss/mixins.scss +34 -0
  543. package/src/components/spinner/scss/module.scss +10 -0
  544. package/src/components/spinner/scss/settings.scss +3 -0
  545. package/src/components/spinner/scss/spinner.scss +50 -0
  546. package/src/components/spinner/tokens/lm-spinner-tokens.js +16 -0
  547. package/src/components/spinner/tokens/md-spinner-tokens.js +18 -0
  548. package/src/components/spinner/tokens/mdv2-spinner-tokens.js +15 -0
  549. package/src/components/table/Table.stories.ts +76 -0
  550. package/src/components/table/Table.test.ts +51 -0
  551. package/src/components/table/Table.ts +234 -0
  552. package/src/components/table/scss/mixins.scss +6 -0
  553. package/src/components/table/scss/module.scss +27 -0
  554. package/src/components/table/scss/settings.scss +11 -0
  555. package/src/components/table/scss/table.scss +148 -0
  556. package/src/components/table/tokens/lm-table-tokens.js +42 -0
  557. package/src/components/table/tokens/md-table-tokens.js +42 -0
  558. package/src/components/table/tokens/mdv2-table-tokens.js +35 -0
  559. package/src/components/table-advanced/TableAdvanced.md +233 -0
  560. package/src/components/table-advanced/TableAdvanced.mdx +240 -0
  561. package/src/components/table-advanced/TableAdvanced.stories.ts +166 -0
  562. package/src/components/table-advanced/TableAdvanced.test.ts +374 -0
  563. package/src/components/table-advanced/TableAdvanced.ts +1081 -0
  564. package/src/components/table-advanced/scss/module.scss +27 -0
  565. package/src/components/table-advanced/scss/settings.scss +16 -0
  566. package/src/components/table-advanced/scss/table-advanced.scss +399 -0
  567. package/src/components/table-advanced/src/decorators.ts +150 -0
  568. package/src/components/table-advanced/src/filter.ts +86 -0
  569. package/src/components/table-advanced/tokens/lm-table-advanced-tokens.js +64 -0
  570. package/src/components/table-advanced/tokens/md-table-advanced-tokens.js +64 -0
  571. package/src/components/table-advanced/tokens/mdv2-table-advanced-tokens.js +64 -0
  572. package/src/components/tabs/Tab.test.ts +103 -0
  573. package/src/components/tabs/Tab.ts +215 -0
  574. package/src/components/tabs/TabPanel.test.ts +31 -0
  575. package/src/components/tabs/TabPanel.ts +44 -0
  576. package/src/components/tabs/Tabs.stories.ts +172 -0
  577. package/src/components/tabs/Tabs.test.ts +676 -0
  578. package/src/components/tabs/Tabs.ts +1222 -0
  579. package/src/components/tabs/scss/mixins.scss +6 -0
  580. package/src/components/tabs/scss/module.scss +16 -0
  581. package/src/components/tabs/scss/settings.scss +22 -0
  582. package/src/components/tabs/scss/tab.scss +304 -0
  583. package/src/components/tabs/scss/tabs.scss +241 -0
  584. package/src/components/tabs/tokens/lm-tabs-tokens.js +74 -0
  585. package/src/components/tabs/tokens/md-tabs-tokens.js +68 -0
  586. package/src/components/tabs/tokens/mdv2-tabs-tokens.js +52 -0
  587. package/src/components/taskitem/TaskItem.stories.ts +63 -0
  588. package/src/components/taskitem/TaskItem.test.ts +417 -0
  589. package/src/components/taskitem/TaskItem.ts +258 -0
  590. package/src/components/taskitem/scss/mixins.scss +42 -0
  591. package/src/components/taskitem/scss/module.scss +15 -0
  592. package/src/components/taskitem/scss/settings.scss +43 -0
  593. package/src/components/taskitem/scss/task-item.scss +229 -0
  594. package/src/components/taskitem/tokens/lm-taskitem-tokens.js +72 -0
  595. package/src/components/taskitem/tokens/md-taskitem-tokens.js +72 -0
  596. package/src/components/taskitem/tokens/mdv2-taskitem-tokens.js +58 -0
  597. package/src/components/theme/README.md +13 -0
  598. package/src/components/theme/Theme.test.ts +88 -0
  599. package/src/components/theme/Theme.ts +377 -0
  600. package/src/components/theme/index.ts +8 -0
  601. package/src/components/timepicker/TimePicker.stories.ts +44 -0
  602. package/src/components/timepicker/TimePicker.test.ts +145 -0
  603. package/src/components/timepicker/TimePicker.ts +424 -0
  604. package/src/components/timepicker/scss/module.scss +9 -0
  605. package/src/components/timepicker/scss/settings.scss +8 -0
  606. package/src/components/timepicker/scss/timepicker.scss +71 -0
  607. package/src/components/toggle-switch/ToggleSwitch.stories.ts +46 -0
  608. package/src/components/toggle-switch/ToggleSwitch.test.ts +92 -0
  609. package/src/components/toggle-switch/ToggleSwitch.ts +102 -0
  610. package/src/components/toggle-switch/scss/mixins.scss +98 -0
  611. package/src/components/toggle-switch/scss/module.scss +12 -0
  612. package/src/components/toggle-switch/scss/settings.scss +14 -0
  613. package/src/components/toggle-switch/scss/toggle-switch.scss +197 -0
  614. package/src/components/toggle-switch/tokens/lm-toggle-tokens.js +52 -0
  615. package/src/components/toggle-switch/tokens/md-toggle-tokens.js +52 -0
  616. package/src/components/toggle-switch/tokens/mdv2-toggle-tokens.js +48 -0
  617. package/src/components/tooltip/Tooltip.stories.ts +59 -0
  618. package/src/components/tooltip/Tooltip.test.ts +108 -0
  619. package/src/components/tooltip/Tooltip.ts +242 -0
  620. package/src/components/tooltip/scss/module.scss +12 -0
  621. package/src/components/tooltip/scss/settings.scss +11 -0
  622. package/src/components/tooltip/scss/tooltip.scss +141 -0
  623. package/src/components/tooltip/tokens/lm-tooltip-tokens.js +18 -0
  624. package/src/components/tooltip/tokens/md-tooltip-tokens.js +18 -0
  625. package/src/components/tooltip/tokens/mdv2-tooltip-tokens.js +42 -0
  626. package/src/constants.ts +42 -0
  627. package/src/index.ts +79 -0
  628. package/src/internal-components/color-table/ColorTable.stories.ts +39 -0
  629. package/src/internal-components/color-table/ColorTable.ts +83 -0
  630. package/src/internal-components/color-table/data.ts +203 -0
  631. package/src/internal-components/color-table/scss/color-table.scss +739 -0
  632. package/src/internal-components/color-table/scss/module.scss +11 -0
  633. package/src/internal-components/color-table/utils.ts +552 -0
  634. package/src/mixins/CustomElementCheck.ts +25 -0
  635. package/src/mixins/DedupeMixin.test.ts +81 -0
  636. package/src/mixins/DedupeMixin.ts +54 -0
  637. package/src/mixins/FocusMixin.test.ts +116 -0
  638. package/src/mixins/FocusMixin.ts +136 -0
  639. package/src/mixins/FocusTrapMixin.test.ts +560 -0
  640. package/src/mixins/FocusTrapMixin.ts +480 -0
  641. package/src/mixins/ResizeMixin.test.ts +84 -0
  642. package/src/mixins/ResizeMixin.ts +142 -0
  643. package/src/mixins/RovingTabIndexMixin.test.ts +60 -0
  644. package/src/mixins/RovingTabIndexMixin.ts +110 -0
  645. package/src/mixins/SlottedMixin.test.ts +68 -0
  646. package/src/mixins/SlottedMixin.ts +116 -0
  647. package/src/mixins/index.ts +17 -0
  648. package/src/templates/color-table-data-string.hbs +22 -0
  649. package/src/templates/colors-settings.hbs +21 -0
  650. package/src/templates/colors.hbs +35 -0
  651. package/src/templates/component-colors.hbs +40 -0
  652. package/src/templates/css-color-variables.hbs +22 -0
  653. package/src/templates/dark-colors.hbs +33 -0
  654. package/src/templates/light-colors.hbs +33 -0
  655. package/src/templates/semantic-color-dark.hbs +28 -0
  656. package/src/templates/semantic-color-light.hbs +28 -0
  657. package/src/templates/semantic-color-settings.hbs +38 -0
  658. package/src/tokens/Tokens.test.ts +12 -0
  659. package/src/tokens/tokenImports.js +7 -0
  660. package/src/tsconfig.json +25 -0
  661. package/src/types/declare.d.ts +31 -0
  662. package/src/types/globals.d.ts +5 -0
  663. package/src/utils/clearVars.js +47 -0
  664. package/src/utils/createTokenFilesModule.js +88 -0
  665. package/src/utils/dateUtils.test.ts +174 -0
  666. package/src/utils/dateUtils.ts +102 -0
  667. package/src/utils/enums.ts +721 -0
  668. package/src/utils/generateColorTableData.js +41 -0
  669. package/src/utils/generateScssFromTokens.js +245 -0
  670. package/src/utils/helpers.ts +150 -0
  671. package/src/utils/keyboard.ts +5 -0
  672. package/src/utils/validations.ts +29 -0
  673. package/src/wc_scss/colors/settings-base.scss +208 -0
  674. package/src/wc_scss/colors/settings-transparencies.scss +52 -0
  675. package/src/wc_scss/colors/settings.scss +1 -0
  676. package/src/wc_scss/generic/global.scss +117 -0
  677. package/src/wc_scss/generic/normalize.scss +422 -0
  678. package/src/wc_scss/icon/settings.scss +12 -0
  679. package/src/wc_scss/path.scss +4 -0
  680. package/src/wc_scss/reset.scss +27 -0
  681. package/src/wc_scss/settings/avatar.scss +205 -0
  682. package/src/wc_scss/settings/button-settings.scss +193 -0
  683. package/src/wc_scss/settings/core.scss +130 -0
  684. package/src/wc_scss/settings/focus.scss +7 -0
  685. package/src/wc_scss/settings/form-controls.scss +23 -0
  686. package/src/wc_scss/settings/forms.scss +26 -0
  687. package/src/wc_scss/settings/input.scss +59 -0
  688. package/src/wc_scss/settings/list-item.scss +86 -0
  689. package/src/wc_scss/settings/list.scss +10 -0
  690. package/src/wc_scss/settings/media.scss +116 -0
  691. package/src/wc_scss/settings/overlay.scss +6 -0
  692. package/src/wc_scss/settings/rem.scss +1 -0
  693. package/src/wc_scss/settings/z-index.scss +9 -0
  694. package/src/wc_scss/themes/global--dark.scss +114 -0
  695. package/src/wc_scss/themes/global--light.scss +114 -0
  696. package/src/wc_scss/themes/global--lm.scss +5 -0
  697. package/src/wc_scss/themes/global--md.scss +5 -0
  698. package/src/wc_scss/themes/global--mdv2.scss +176 -0
  699. package/src/wc_scss/tools/functions/core.scss +183 -0
  700. package/src/wc_scss/tools/mixins/avatar.scss +32 -0
  701. package/src/wc_scss/tools/mixins/baseline.scss +71 -0
  702. package/src/wc_scss/tools/mixins/border-radius.scss +26 -0
  703. package/src/wc_scss/tools/mixins/button.scss +256 -0
  704. package/src/wc_scss/tools/mixins/core.scss +204 -0
  705. package/src/wc_scss/tools/mixins/easing.scss +63 -0
  706. package/src/wc_scss/tools/mixins/flex.scss +14 -0
  707. package/src/wc_scss/tools/mixins/focus.scss +35 -0
  708. package/src/wc_scss/tools/mixins/input.scss +155 -0
  709. package/src/wc_scss/tools/mixins/nav-divider.scss +10 -0
  710. package/src/wc_scss/tools/mixins/scrollbar.scss +40 -0
  711. package/src/wc_scss/tools/mixins/spacing.scss +208 -0
  712. package/src/wc_scss/tools/mixins/spinner.scss +38 -0
  713. package/src/wc_scss/typography/mixins.scss +208 -0
  714. package/src/wc_scss/typography/settings.scss +297 -0
  715. package/src/wc_scss/typography/typography.scss +321 -0
  716. package/stats/cssStats.js +17 -0
  717. package/stats/stats-loader.js +23 -0
  718. package/stats/utils.js +5 -0
  719. package/stats/writeFileSyncRecursive.js +20 -0
  720. package/tsconfig.json +13 -0
  721. package/webpack.config.dev.server.ts +27 -0
  722. package/webpack.config.ts +309 -0
  723. package/webpack.plugin.LoadChunks.ts +67 -0
  724. package/dist/assets/fonts/CiscoSansTT-Medium.woff +0 -0
  725. package/dist/assets/fonts/CiscoSansTT-Medium.woff2 +0 -0
  726. package/dist/assets/fonts/CiscoSansTT-MediumOblique.woff +0 -0
  727. package/dist/assets/fonts/CiscoSansTT-MediumOblique.woff2 +0 -0
  728. package/dist/assets/fonts/CiscoSansTTBold.woff +0 -0
  729. package/dist/assets/fonts/CiscoSansTTBold.woff2 +0 -0
  730. package/dist/assets/fonts/CiscoSansTTBoldOblique.woff +0 -0
  731. package/dist/assets/fonts/CiscoSansTTBoldOblique.woff2 +0 -0
  732. package/dist/assets/fonts/CiscoSansTTCondBold.woff +0 -0
  733. package/dist/assets/fonts/CiscoSansTTCondBold.woff2 +0 -0
  734. package/dist/assets/fonts/CiscoSansTTCondRegular.woff +0 -0
  735. package/dist/assets/fonts/CiscoSansTTCondRegular.woff2 +0 -0
  736. package/dist/assets/fonts/CiscoSansTTExtraLight.woff +0 -0
  737. package/dist/assets/fonts/CiscoSansTTExtraLight.woff2 +0 -0
  738. package/dist/assets/fonts/CiscoSansTTExtraLightOblique.woff +0 -0
  739. package/dist/assets/fonts/CiscoSansTTExtraLightOblique.woff2 +0 -0
  740. package/dist/assets/fonts/CiscoSansTTHeavy.woff +0 -0
  741. package/dist/assets/fonts/CiscoSansTTHeavy.woff2 +0 -0
  742. package/dist/assets/fonts/CiscoSansTTHeavyOblique.woff +0 -0
  743. package/dist/assets/fonts/CiscoSansTTHeavyOblique.woff2 +0 -0
  744. package/dist/assets/fonts/CiscoSansTTLight.woff +0 -0
  745. package/dist/assets/fonts/CiscoSansTTLight.woff2 +0 -0
  746. package/dist/assets/fonts/CiscoSansTTLightOblique.woff +0 -0
  747. package/dist/assets/fonts/CiscoSansTTLightOblique.woff2 +0 -0
  748. package/dist/assets/fonts/CiscoSansTTRegular.woff +0 -0
  749. package/dist/assets/fonts/CiscoSansTTRegular.woff2 +0 -0
  750. package/dist/assets/fonts/CiscoSansTTRegularOblique.woff +0 -0
  751. package/dist/assets/fonts/CiscoSansTTRegularOblique.woff2 +0 -0
  752. package/dist/assets/fonts/CiscoSansTTThin.woff +0 -0
  753. package/dist/assets/fonts/CiscoSansTTThin.woff2 +0 -0
  754. package/dist/assets/fonts/CiscoSansTTThinOblique.woff +0 -0
  755. package/dist/assets/fonts/CiscoSansTTThinOblique.woff2 +0 -0
  756. package/dist/assets/fonts/Inter.var.woff2 +0 -0
  757. package/dist/assets/fonts/index.html +0 -18578
  758. package/dist/assets/fonts/momentum-ui-icons.svg +0 -9270
  759. package/dist/assets/fonts/momentum-ui-icons.ttf +0 -0
  760. package/dist/assets/fonts/momentum-ui-icons.woff +0 -0
  761. package/dist/assets/fonts/momentum-ui-icons.woff2 +0 -0
  762. package/dist/assets/icons/fonts/index.html +0 -18578
  763. package/dist/assets/icons/fonts/momentum-ui-icons.svg +0 -9270
  764. package/dist/assets/icons/fonts/momentum-ui-icons.ttf +0 -0
  765. package/dist/assets/icons/fonts/momentum-ui-icons.woff +0 -0
  766. package/dist/assets/icons/fonts/momentum-ui-icons.woff2 +0 -0
  767. package/dist/assets/images/avatar-images/barbara.png +0 -0
  768. package/dist/assets/images/avatar-images/brandon.png +0 -0
  769. package/dist/assets/images/avatar-images/brenda.png +0 -0
  770. package/dist/assets/images/avatar-images/giacomo.png +0 -0
  771. package/dist/assets/images/avatar-images/maria.png +0 -0
  772. package/dist/assets/images/avatar-images/simon.png +0 -0
  773. package/dist/assets/images/cisco/cisco-logo-black.png +0 -0
  774. package/dist/assets/images/cisco/cisco-logo-black.svg +0 -21
  775. package/dist/assets/images/cisco/cisco-logo-blue.png +0 -0
  776. package/dist/assets/images/cisco/cisco-logo-blue.svg +0 -21
  777. package/dist/assets/images/cisco/cisco-logo-white.png +0 -0
  778. package/dist/assets/images/cisco/cisco-logo-white.svg +0 -21
  779. package/dist/assets/images/cisco-webex/lockup/cisco-webex-lockup-black.png +0 -0
  780. package/dist/assets/images/cisco-webex/lockup/cisco-webex-lockup-black.svg +0 -30
  781. package/dist/assets/images/cisco-webex/lockup/cisco-webex-lockup-blue.png +0 -0
  782. package/dist/assets/images/cisco-webex/lockup/cisco-webex-lockup-blue.svg +0 -30
  783. package/dist/assets/images/cisco-webex/lockup/cisco-webex-lockup-white.png +0 -0
  784. package/dist/assets/images/cisco-webex/lockup/cisco-webex-lockup-white.svg +0 -30
  785. package/dist/assets/images/cisco-webex/wordmark/cisco-webex-wordmark-black.png +0 -0
  786. package/dist/assets/images/cisco-webex/wordmark/cisco-webex-wordmark-black.svg +0 -13
  787. package/dist/assets/images/cisco-webex/wordmark/cisco-webex-wordmark-blue.png +0 -0
  788. package/dist/assets/images/cisco-webex/wordmark/cisco-webex-wordmark-blue.svg +0 -13
  789. package/dist/assets/images/cisco-webex/wordmark/cisco-webex-wordmark-white.png +0 -0
  790. package/dist/assets/images/cisco-webex/wordmark/cisco-webex-wordmark-white.svg +0 -13
  791. package/dist/assets/images/flags.png +0 -0
  792. package/dist/assets/images/flags@2x.png +0 -0
  793. package/dist/assets/images/momentum/momentum-color-icon.png +0 -0
  794. package/dist/assets/images/momentum/momentum-color-icon.svg +0 -1
  795. package/dist/assets/images/momentum/momentum-horiz-color-white.png +0 -0
  796. package/dist/assets/images/momentum/momentum-horiz-color.png +0 -0
  797. package/dist/assets/images/momentum/momentum-horiz-color.svg +0 -1
  798. package/dist/assets/images/momentum/momentum-horiz-outline.png +0 -0
  799. package/dist/assets/images/momentum/momentum-horiz-outline.svg +0 -1
  800. package/dist/assets/images/momentum/momentum-outline-icon.png +0 -0
  801. package/dist/assets/images/momentum/momentum-outline-icon.svg +0 -1
  802. package/dist/assets/images/momentum/momentum-vert-color.png +0 -0
  803. package/dist/assets/images/momentum/momentum-vert-color.svg +0 -1
  804. package/dist/assets/images/momentum/momentum-vert-outline.png +0 -0
  805. package/dist/assets/images/momentum/momentum-vert-outline.svg +0 -1
  806. package/dist/assets/images/momentum/momentum.jpg +0 -0
  807. package/dist/assets/images/opacity-bkgd.jpg +0 -0
  808. package/dist/assets/images/webex-calling/calling-icon-color.png +0 -0
  809. package/dist/assets/images/webex-calling/calling-icon-color.svg +0 -14
  810. package/dist/assets/images/webex-calling/calling-icon-white.png +0 -0
  811. package/dist/assets/images/webex-calling/calling-icon-white.svg +0 -13
  812. package/dist/assets/images/webex-calling/calling-with-container-and-label-color.png +0 -0
  813. package/dist/assets/images/webex-calling/calling-with-container-and-label-color.svg +0 -46
  814. package/dist/assets/images/webex-calling/calling-with-container-color.png +0 -0
  815. package/dist/assets/images/webex-calling/calling-with-container-color.svg +0 -19
  816. package/dist/assets/images/webex-calling/calling-with-label-color.png +0 -0
  817. package/dist/assets/images/webex-calling/calling-with-label-color.svg +0 -39
  818. package/dist/assets/images/webex-meetings/meetings-icon-color.png +0 -0
  819. package/dist/assets/images/webex-meetings/meetings-icon-color.svg +0 -15
  820. package/dist/assets/images/webex-meetings/meetings-icon-white.png +0 -0
  821. package/dist/assets/images/webex-meetings/meetings-icon-white.svg +0 -12
  822. package/dist/assets/images/webex-meetings/meetings-with-container-and-label-color.png +0 -0
  823. package/dist/assets/images/webex-meetings/meetings-with-container-and-label-color.svg +0 -29
  824. package/dist/assets/images/webex-meetings/meetings-with-container-color.png +0 -0
  825. package/dist/assets/images/webex-meetings/meetings-with-container-color.svg +0 -16
  826. package/dist/assets/images/webex-meetings/meetings-with-label-color.png +0 -0
  827. package/dist/assets/images/webex-meetings/meetings-with-label-color.svg +0 -28
  828. package/dist/assets/images/webex-teams/teams-icon-color.png +0 -0
  829. package/dist/assets/images/webex-teams/teams-icon-color.svg +0 -18
  830. package/dist/assets/images/webex-teams/teams-icon-white.png +0 -0
  831. package/dist/assets/images/webex-teams/teams-icon-white.svg +0 -12
  832. package/dist/assets/images/webex-teams/teams-with-container-and-label-color.png +0 -0
  833. package/dist/assets/images/webex-teams/teams-with-container-and-label-color.svg +0 -29
  834. package/dist/assets/images/webex-teams/teams-with-container-color.png +0 -0
  835. package/dist/assets/images/webex-teams/teams-with-container-color.svg +0 -19
  836. package/dist/assets/images/webex-teams/teams-with-label-color.png +0 -0
  837. package/dist/assets/images/webex-teams/teams-with-label-color.svg +0 -30
  838. package/dist/assets/styles/momentum-ui-icons.min.css +0 -1
  839. package/dist/assets/styles/momentum-ui.min.css +0 -7
  840. package/dist/assets/styles/momentum-ui.min.css.map +0 -1
  841. package/dist/chunks/md-0.js +0 -1
  842. package/dist/chunks/md-1.js +0 -1
  843. package/dist/chunks/md-10.js +0 -26
  844. package/dist/chunks/md-100.js +0 -1
  845. package/dist/chunks/md-101.js +0 -1
  846. package/dist/chunks/md-102.js +0 -1
  847. package/dist/chunks/md-103.js +0 -1
  848. package/dist/chunks/md-104.js +0 -1
  849. package/dist/chunks/md-105.js +0 -1
  850. package/dist/chunks/md-106.js +0 -1
  851. package/dist/chunks/md-107.js +0 -1
  852. package/dist/chunks/md-108.js +0 -1
  853. package/dist/chunks/md-109.js +0 -1
  854. package/dist/chunks/md-11.js +0 -1
  855. package/dist/chunks/md-110.js +0 -1
  856. package/dist/chunks/md-111.js +0 -1
  857. package/dist/chunks/md-112.js +0 -1
  858. package/dist/chunks/md-113.js +0 -1
  859. package/dist/chunks/md-114.js +0 -1
  860. package/dist/chunks/md-115.js +0 -1
  861. package/dist/chunks/md-116.js +0 -1
  862. package/dist/chunks/md-117.js +0 -1
  863. package/dist/chunks/md-118.js +0 -1
  864. package/dist/chunks/md-119.js +0 -1
  865. package/dist/chunks/md-12.js +0 -1
  866. package/dist/chunks/md-120.js +0 -1
  867. package/dist/chunks/md-121.js +0 -1
  868. package/dist/chunks/md-122.js +0 -1
  869. package/dist/chunks/md-123.js +0 -1
  870. package/dist/chunks/md-124.js +0 -1
  871. package/dist/chunks/md-125.js +0 -1
  872. package/dist/chunks/md-126.js +0 -1
  873. package/dist/chunks/md-127.js +0 -1
  874. package/dist/chunks/md-128.js +0 -1
  875. package/dist/chunks/md-129.js +0 -1
  876. package/dist/chunks/md-13.js +0 -11
  877. package/dist/chunks/md-130.js +0 -1
  878. package/dist/chunks/md-131.js +0 -1
  879. package/dist/chunks/md-132.js +0 -1
  880. package/dist/chunks/md-133.js +0 -1
  881. package/dist/chunks/md-134.js +0 -1
  882. package/dist/chunks/md-135.js +0 -1
  883. package/dist/chunks/md-136.js +0 -1
  884. package/dist/chunks/md-137.js +0 -1
  885. package/dist/chunks/md-138.js +0 -1
  886. package/dist/chunks/md-139.js +0 -1
  887. package/dist/chunks/md-14.js +0 -9
  888. package/dist/chunks/md-140.js +0 -1
  889. package/dist/chunks/md-141.js +0 -1
  890. package/dist/chunks/md-142.js +0 -1
  891. package/dist/chunks/md-143.js +0 -1
  892. package/dist/chunks/md-144.js +0 -1
  893. package/dist/chunks/md-145.js +0 -1
  894. package/dist/chunks/md-146.js +0 -1
  895. package/dist/chunks/md-147.js +0 -1
  896. package/dist/chunks/md-148.js +0 -1
  897. package/dist/chunks/md-149.js +0 -1
  898. package/dist/chunks/md-15.js +0 -1
  899. package/dist/chunks/md-150.js +0 -1
  900. package/dist/chunks/md-151.js +0 -1
  901. package/dist/chunks/md-152.js +0 -1
  902. package/dist/chunks/md-153.js +0 -1
  903. package/dist/chunks/md-154.js +0 -1
  904. package/dist/chunks/md-155.js +0 -1
  905. package/dist/chunks/md-156.js +0 -1
  906. package/dist/chunks/md-157.js +0 -1
  907. package/dist/chunks/md-158.js +0 -1
  908. package/dist/chunks/md-159.js +0 -1
  909. package/dist/chunks/md-16.js +0 -26
  910. package/dist/chunks/md-160.js +0 -1
  911. package/dist/chunks/md-161.js +0 -1
  912. package/dist/chunks/md-162.js +0 -1
  913. package/dist/chunks/md-163.js +0 -1
  914. package/dist/chunks/md-164.js +0 -1
  915. package/dist/chunks/md-165.js +0 -1
  916. package/dist/chunks/md-166.js +0 -1
  917. package/dist/chunks/md-167.js +0 -1
  918. package/dist/chunks/md-168.js +0 -1
  919. package/dist/chunks/md-169.js +0 -1
  920. package/dist/chunks/md-17.js +0 -122
  921. package/dist/chunks/md-170.js +0 -1
  922. package/dist/chunks/md-171.js +0 -1
  923. package/dist/chunks/md-172.js +0 -1
  924. package/dist/chunks/md-173.js +0 -1
  925. package/dist/chunks/md-174.js +0 -1
  926. package/dist/chunks/md-175.js +0 -1
  927. package/dist/chunks/md-176.js +0 -1
  928. package/dist/chunks/md-177.js +0 -1
  929. package/dist/chunks/md-178.js +0 -1
  930. package/dist/chunks/md-179.js +0 -1
  931. package/dist/chunks/md-18.js +0 -17
  932. package/dist/chunks/md-180.js +0 -1
  933. package/dist/chunks/md-181.js +0 -1
  934. package/dist/chunks/md-182.js +0 -1
  935. package/dist/chunks/md-183.js +0 -1
  936. package/dist/chunks/md-184.js +0 -1
  937. package/dist/chunks/md-185.js +0 -1
  938. package/dist/chunks/md-186.js +0 -1
  939. package/dist/chunks/md-187.js +0 -1
  940. package/dist/chunks/md-188.js +0 -1
  941. package/dist/chunks/md-189.js +0 -1
  942. package/dist/chunks/md-19.js +0 -1
  943. package/dist/chunks/md-190.js +0 -1
  944. package/dist/chunks/md-191.js +0 -1
  945. package/dist/chunks/md-192.js +0 -1
  946. package/dist/chunks/md-193.js +0 -1
  947. package/dist/chunks/md-194.js +0 -1
  948. package/dist/chunks/md-195.js +0 -1
  949. package/dist/chunks/md-196.js +0 -1
  950. package/dist/chunks/md-197.js +0 -1
  951. package/dist/chunks/md-198.js +0 -1
  952. package/dist/chunks/md-199.js +0 -1
  953. package/dist/chunks/md-2.js +0 -1
  954. package/dist/chunks/md-20.js +0 -8
  955. package/dist/chunks/md-200.js +0 -1
  956. package/dist/chunks/md-201.js +0 -1
  957. package/dist/chunks/md-202.js +0 -1
  958. package/dist/chunks/md-203.js +0 -1
  959. package/dist/chunks/md-204.js +0 -1
  960. package/dist/chunks/md-205.js +0 -1
  961. package/dist/chunks/md-206.js +0 -1
  962. package/dist/chunks/md-207.js +0 -1
  963. package/dist/chunks/md-208.js +0 -1
  964. package/dist/chunks/md-209.js +0 -1
  965. package/dist/chunks/md-21.js +0 -23
  966. package/dist/chunks/md-210.js +0 -1
  967. package/dist/chunks/md-211.js +0 -1
  968. package/dist/chunks/md-212.js +0 -1
  969. package/dist/chunks/md-213.js +0 -1
  970. package/dist/chunks/md-214.js +0 -1
  971. package/dist/chunks/md-215.js +0 -1
  972. package/dist/chunks/md-216.js +0 -1
  973. package/dist/chunks/md-217.js +0 -1
  974. package/dist/chunks/md-218.js +0 -1
  975. package/dist/chunks/md-219.js +0 -1
  976. package/dist/chunks/md-22.js +0 -1
  977. package/dist/chunks/md-220.js +0 -1
  978. package/dist/chunks/md-221.js +0 -1
  979. package/dist/chunks/md-222.js +0 -1
  980. package/dist/chunks/md-223.js +0 -1
  981. package/dist/chunks/md-224.js +0 -1
  982. package/dist/chunks/md-225.js +0 -1
  983. package/dist/chunks/md-226.js +0 -1
  984. package/dist/chunks/md-227.js +0 -1
  985. package/dist/chunks/md-228.js +0 -1
  986. package/dist/chunks/md-229.js +0 -1
  987. package/dist/chunks/md-23.js +0 -7
  988. package/dist/chunks/md-230.js +0 -1
  989. package/dist/chunks/md-231.js +0 -1
  990. package/dist/chunks/md-232.js +0 -1
  991. package/dist/chunks/md-233.js +0 -1
  992. package/dist/chunks/md-234.js +0 -1
  993. package/dist/chunks/md-235.js +0 -1
  994. package/dist/chunks/md-236.js +0 -1
  995. package/dist/chunks/md-237.js +0 -1
  996. package/dist/chunks/md-238.js +0 -1
  997. package/dist/chunks/md-239.js +0 -1
  998. package/dist/chunks/md-24.js +0 -8
  999. package/dist/chunks/md-240.js +0 -1
  1000. package/dist/chunks/md-241.js +0 -1
  1001. package/dist/chunks/md-242.js +0 -1
  1002. package/dist/chunks/md-243.js +0 -1
  1003. package/dist/chunks/md-244.js +0 -1
  1004. package/dist/chunks/md-245.js +0 -1
  1005. package/dist/chunks/md-246.js +0 -1
  1006. package/dist/chunks/md-247.js +0 -1
  1007. package/dist/chunks/md-248.js +0 -1
  1008. package/dist/chunks/md-249.js +0 -1
  1009. package/dist/chunks/md-25.js +0 -1
  1010. package/dist/chunks/md-250.js +0 -1
  1011. package/dist/chunks/md-251.js +0 -1
  1012. package/dist/chunks/md-252.js +0 -1
  1013. package/dist/chunks/md-253.js +0 -1
  1014. package/dist/chunks/md-254.js +0 -1
  1015. package/dist/chunks/md-255.js +0 -1
  1016. package/dist/chunks/md-256.js +0 -1
  1017. package/dist/chunks/md-257.js +0 -1
  1018. package/dist/chunks/md-258.js +0 -1
  1019. package/dist/chunks/md-259.js +0 -1
  1020. package/dist/chunks/md-26.js +0 -1
  1021. package/dist/chunks/md-260.js +0 -1
  1022. package/dist/chunks/md-261.js +0 -1
  1023. package/dist/chunks/md-262.js +0 -1
  1024. package/dist/chunks/md-263.js +0 -1
  1025. package/dist/chunks/md-264.js +0 -1
  1026. package/dist/chunks/md-265.js +0 -1
  1027. package/dist/chunks/md-266.js +0 -1
  1028. package/dist/chunks/md-267.js +0 -1
  1029. package/dist/chunks/md-268.js +0 -1
  1030. package/dist/chunks/md-269.js +0 -1
  1031. package/dist/chunks/md-27.js +0 -61
  1032. package/dist/chunks/md-270.js +0 -1
  1033. package/dist/chunks/md-271.js +0 -1
  1034. package/dist/chunks/md-272.js +0 -1
  1035. package/dist/chunks/md-273.js +0 -1
  1036. package/dist/chunks/md-274.js +0 -1
  1037. package/dist/chunks/md-275.js +0 -1
  1038. package/dist/chunks/md-276.js +0 -1
  1039. package/dist/chunks/md-277.js +0 -1
  1040. package/dist/chunks/md-278.js +0 -1
  1041. package/dist/chunks/md-28.js +0 -1
  1042. package/dist/chunks/md-29.js +0 -221
  1043. package/dist/chunks/md-3.js +0 -1
  1044. package/dist/chunks/md-30.js +0 -49
  1045. package/dist/chunks/md-31.js +0 -1
  1046. package/dist/chunks/md-32.js +0 -1
  1047. package/dist/chunks/md-33.js +0 -36
  1048. package/dist/chunks/md-34.js +0 -33
  1049. package/dist/chunks/md-35.js +0 -23
  1050. package/dist/chunks/md-36.js +0 -5
  1051. package/dist/chunks/md-37.js +0 -5
  1052. package/dist/chunks/md-38.js +0 -1
  1053. package/dist/chunks/md-39.js +0 -21
  1054. package/dist/chunks/md-4.js +0 -1
  1055. package/dist/chunks/md-40.js +0 -42
  1056. package/dist/chunks/md-41.js +0 -1
  1057. package/dist/chunks/md-42.js +0 -30
  1058. package/dist/chunks/md-43.js +0 -16
  1059. package/dist/chunks/md-44.js +0 -1
  1060. package/dist/chunks/md-45.js +0 -27
  1061. package/dist/chunks/md-46.js +0 -5
  1062. package/dist/chunks/md-47.js +0 -38
  1063. package/dist/chunks/md-48.js +0 -13
  1064. package/dist/chunks/md-49.js +0 -20
  1065. package/dist/chunks/md-5.js +0 -1
  1066. package/dist/chunks/md-50.js +0 -121
  1067. package/dist/chunks/md-51.js +0 -98
  1068. package/dist/chunks/md-52.js +0 -11
  1069. package/dist/chunks/md-53.js +0 -5
  1070. package/dist/chunks/md-54.js +0 -77
  1071. package/dist/chunks/md-55.js +0 -68
  1072. package/dist/chunks/md-56.js +0 -22
  1073. package/dist/chunks/md-57.js +0 -14
  1074. package/dist/chunks/md-58.js +0 -5
  1075. package/dist/chunks/md-59.js +0 -51
  1076. package/dist/chunks/md-6.js +0 -77
  1077. package/dist/chunks/md-60.js +0 -22
  1078. package/dist/chunks/md-61.js +0 -5
  1079. package/dist/chunks/md-62.js +0 -1
  1080. package/dist/chunks/md-63.js +0 -23
  1081. package/dist/chunks/md-64.js +0 -5
  1082. package/dist/chunks/md-65.js +0 -11
  1083. package/dist/chunks/md-66.js +0 -142
  1084. package/dist/chunks/md-67.js +0 -30
  1085. package/dist/chunks/md-68.js +0 -70
  1086. package/dist/chunks/md-69.js +0 -19
  1087. package/dist/chunks/md-7.js +0 -1
  1088. package/dist/chunks/md-70.js +0 -21
  1089. package/dist/chunks/md-71.js +0 -17
  1090. package/dist/chunks/md-72.js +0 -76
  1091. package/dist/chunks/md-73.js +0 -7
  1092. package/dist/chunks/md-74.js +0 -72
  1093. package/dist/chunks/md-75.js +0 -78
  1094. package/dist/chunks/md-76.js +0 -66
  1095. package/dist/chunks/md-77.js +0 -17
  1096. package/dist/chunks/md-78.js +0 -5
  1097. package/dist/chunks/md-79.js +0 -19
  1098. package/dist/chunks/md-8.js +0 -1
  1099. package/dist/chunks/md-80.js +0 -1
  1100. package/dist/chunks/md-81.js +0 -168
  1101. package/dist/chunks/md-82.js +0 -43
  1102. package/dist/chunks/md-83.js +0 -100
  1103. package/dist/chunks/md-84.js +0 -82
  1104. package/dist/chunks/md-85.js +0 -12
  1105. package/dist/chunks/md-86.js +0 -42
  1106. package/dist/chunks/md-87.js +0 -34
  1107. package/dist/chunks/md-88.js +0 -1
  1108. package/dist/chunks/md-89.js +0 -1
  1109. package/dist/chunks/md-9.js +0 -1
  1110. package/dist/chunks/md-90.js +0 -1
  1111. package/dist/chunks/md-91.js +0 -1
  1112. package/dist/chunks/md-92.js +0 -1
  1113. package/dist/chunks/md-93.js +0 -1
  1114. package/dist/chunks/md-94.js +0 -1
  1115. package/dist/chunks/md-95.js +0 -1
  1116. package/dist/chunks/md-96.js +0 -1
  1117. package/dist/chunks/md-97.js +0 -1
  1118. package/dist/chunks/md-98.js +0 -1
  1119. package/dist/chunks/md-99.js +0 -1
  1120. package/dist/comp/md-accordion-entry.js +0 -1
  1121. package/dist/comp/md-accordion-item-entry.js +0 -1
  1122. package/dist/comp/md-accordion-item.js +0 -15
  1123. package/dist/comp/md-accordion.js +0 -11
  1124. package/dist/comp/md-activity-button-entry.js +0 -1
  1125. package/dist/comp/md-activity-button.js +0 -9
  1126. package/dist/comp/md-alert-banner-entry.js +0 -1
  1127. package/dist/comp/md-alert-banner.js +0 -9
  1128. package/dist/comp/md-alert-entry.js +0 -1
  1129. package/dist/comp/md-alert.js +0 -10
  1130. package/dist/comp/md-audio-player-entry.js +0 -1
  1131. package/dist/comp/md-audio-player.js +0 -16
  1132. package/dist/comp/md-avatar-entry.js +0 -1
  1133. package/dist/comp/md-avatar.js +0 -11
  1134. package/dist/comp/md-badge-entry.js +0 -1
  1135. package/dist/comp/md-badge.js +0 -4
  1136. package/dist/comp/md-breadcrumb-entry.js +0 -1
  1137. package/dist/comp/md-breadcrumb.js +0 -4
  1138. package/dist/comp/md-button-entry.js +0 -1
  1139. package/dist/comp/md-button-group-entry.js +0 -1
  1140. package/dist/comp/md-button-group.js +0 -10
  1141. package/dist/comp/md-button.js +0 -6
  1142. package/dist/comp/md-card-ai-entry.js +0 -1
  1143. package/dist/comp/md-card-ai.js +0 -9
  1144. package/dist/comp/md-card-entry.js +0 -1
  1145. package/dist/comp/md-card.js +0 -22
  1146. package/dist/comp/md-chat-message-entry.js +0 -1
  1147. package/dist/comp/md-chat-message.js +0 -12
  1148. package/dist/comp/md-checkbox-entry.js +0 -1
  1149. package/dist/comp/md-checkbox.js +0 -11
  1150. package/dist/comp/md-checkboxgroup-entry.js +0 -1
  1151. package/dist/comp/md-checkboxgroup.js +0 -11
  1152. package/dist/comp/md-chip-entry.js +0 -1
  1153. package/dist/comp/md-chip.js +0 -17
  1154. package/dist/comp/md-coachmark-entry.js +0 -1
  1155. package/dist/comp/md-coachmark.js +0 -13
  1156. package/dist/comp/md-combobox-entry.js +0 -1
  1157. package/dist/comp/md-combobox.js +0 -17
  1158. package/dist/comp/md-composite-avatar-entry.js +0 -1
  1159. package/dist/comp/md-composite-avatar.js +0 -5
  1160. package/dist/comp/md-date-range-picker-entry.js +0 -1
  1161. package/dist/comp/md-date-range-picker.js +0 -24
  1162. package/dist/comp/md-date-time-picker-entry.js +0 -1
  1163. package/dist/comp/md-date-time-picker.js +0 -18
  1164. package/dist/comp/md-datepicker-calendar-entry.js +0 -1
  1165. package/dist/comp/md-datepicker-calendar.js +0 -14
  1166. package/dist/comp/md-datepicker-day-entry.js +0 -1
  1167. package/dist/comp/md-datepicker-day.js +0 -9
  1168. package/dist/comp/md-datepicker-entry.js +0 -1
  1169. package/dist/comp/md-datepicker-month-entry.js +0 -1
  1170. package/dist/comp/md-datepicker-month.js +0 -11
  1171. package/dist/comp/md-datepicker-week-entry.js +0 -1
  1172. package/dist/comp/md-datepicker-week.js +0 -10
  1173. package/dist/comp/md-datepicker.js +0 -23
  1174. package/dist/comp/md-draggable-entry.js +0 -1
  1175. package/dist/comp/md-draggable-item-entry.js +0 -1
  1176. package/dist/comp/md-draggable-item.js +0 -11
  1177. package/dist/comp/md-draggable.js +0 -12
  1178. package/dist/comp/md-dropdown-entry.js +0 -1
  1179. package/dist/comp/md-dropdown.js +0 -15
  1180. package/dist/comp/md-editable-field-entry.js +0 -1
  1181. package/dist/comp/md-editable-field.js +0 -15
  1182. package/dist/comp/md-favorite-entry.js +0 -1
  1183. package/dist/comp/md-favorite.js +0 -14
  1184. package/dist/comp/md-floating-minimize-entry.js +0 -1
  1185. package/dist/comp/md-floating-minimize.js +0 -15
  1186. package/dist/comp/md-floating-modal-entry.js +0 -1
  1187. package/dist/comp/md-floating-modal.js +0 -16
  1188. package/dist/comp/md-form-entry.js +0 -1
  1189. package/dist/comp/md-form.js +0 -9
  1190. package/dist/comp/md-grabber-entry.js +0 -1
  1191. package/dist/comp/md-grabber.js +0 -14
  1192. package/dist/comp/md-help-text-entry.js +0 -1
  1193. package/dist/comp/md-help-text.js +0 -4
  1194. package/dist/comp/md-icon-entry.js +0 -1
  1195. package/dist/comp/md-icon.js +0 -8
  1196. package/dist/comp/md-inpu.js +0 -12
  1197. package/dist/comp/md-input-entry.js +0 -1
  1198. package/dist/comp/md-input-file.js +0 -1
  1199. package/dist/comp/md-input.js +0 -13
  1200. package/dist/comp/md-label-entry.js +0 -1
  1201. package/dist/comp/md-label.js +0 -4
  1202. package/dist/comp/md-link-entry.js +0 -1
  1203. package/dist/comp/md-link.js +0 -4
  1204. package/dist/comp/md-list-entry.js +0 -1
  1205. package/dist/comp/md-list-item-entry.js +0 -1
  1206. package/dist/comp/md-list-item.js +0 -11
  1207. package/dist/comp/md-list.js +0 -11
  1208. package/dist/comp/md-loading-entry.js +0 -1
  1209. package/dist/comp/md-loading.js +0 -4
  1210. package/dist/comp/md-meeting-alert-entry.js +0 -1
  1211. package/dist/comp/md-meeting-alert.js +0 -12
  1212. package/dist/comp/md-menu-entry.js +0 -1
  1213. package/dist/comp/md-menu-item-entry.js +0 -1
  1214. package/dist/comp/md-menu-item.js +0 -4
  1215. package/dist/comp/md-menu-overlay-entry.js +0 -1
  1216. package/dist/comp/md-menu-overlay.js +0 -8
  1217. package/dist/comp/md-menu.js +0 -8
  1218. package/dist/comp/md-modal-entry.js +0 -1
  1219. package/dist/comp/md-modal.js +0 -14
  1220. package/dist/comp/md-pagination-entry.js +0 -1
  1221. package/dist/comp/md-pagination.js +0 -9
  1222. package/dist/comp/md-phone-input-entry.js +0 -1
  1223. package/dist/comp/md-phone-input.js +0 -20
  1224. package/dist/comp/md-progress-bar-entry.js +0 -1
  1225. package/dist/comp/md-progress-bar.js +0 -4
  1226. package/dist/comp/md-radio-entry.js +0 -1
  1227. package/dist/comp/md-radio.js +0 -11
  1228. package/dist/comp/md-radiogroup-entry.js +0 -1
  1229. package/dist/comp/md-radiogroup.js +0 -11
  1230. package/dist/comp/md-slider-entry.js +0 -1
  1231. package/dist/comp/md-slider.js +0 -10
  1232. package/dist/comp/md-spinner-entry.js +0 -1
  1233. package/dist/comp/md-spinner.js +0 -4
  1234. package/dist/comp/md-tab-entry.js +0 -1
  1235. package/dist/comp/md-tab-panel-entry.js +0 -1
  1236. package/dist/comp/md-tab-panel.js +0 -11
  1237. package/dist/comp/md-tab.js +0 -11
  1238. package/dist/comp/md-table-advanced-entry.js +0 -1
  1239. package/dist/comp/md-table-advanced.js +0 -14
  1240. package/dist/comp/md-table-entry.js +0 -1
  1241. package/dist/comp/md-table.js +0 -9
  1242. package/dist/comp/md-tabs-entry.js +0 -1
  1243. package/dist/comp/md-tabs.js +0 -19
  1244. package/dist/comp/md-task-item-entry.js +0 -1
  1245. package/dist/comp/md-task-item.js +0 -10
  1246. package/dist/comp/md-theme-entry.js +0 -1
  1247. package/dist/comp/md-theme.js +0 -4
  1248. package/dist/comp/md-timepicker-entry.js +0 -1
  1249. package/dist/comp/md-timepicker.js +0 -22
  1250. package/dist/comp/md-toggle-switch-entry.js +0 -1
  1251. package/dist/comp/md-toggle-switch.js +0 -11
  1252. package/dist/comp/md-tooltip-entry.js +0 -1
  1253. package/dist/comp/md-tooltip.js +0 -11
  1254. package/dist/index-entry.js +0 -34
  1255. package/dist/index.js +0 -89
  1256. package/dist/types/components/accordion/Accordion.d.ts +0 -32
  1257. package/dist/types/components/accordion/AccordionItem.d.ts +0 -41
  1258. package/dist/types/components/activity-button/ActivityButton.d.ts +0 -41
  1259. package/dist/types/components/alert/Alert.d.ts +0 -57
  1260. package/dist/types/components/alert-banner/AlertBanner.d.ts +0 -29
  1261. package/dist/types/components/audio-player/AudioPlayer.d.ts +0 -112
  1262. package/dist/types/components/avatar/Avatar.constants.d.ts +0 -4
  1263. package/dist/types/components/avatar/Avatar.d.ts +0 -69
  1264. package/dist/types/components/avatar/CompositeAvatar.d.ts +0 -25
  1265. package/dist/types/components/avatar/Presence.d.ts +0 -20
  1266. package/dist/types/components/avatar/Presence.utils.d.ts +0 -8
  1267. package/dist/types/components/badge/Badge.d.ts +0 -38
  1268. package/dist/types/components/breadcrumb/Breadcrumb.d.ts +0 -24
  1269. package/dist/types/components/button/Button.d.ts +0 -111
  1270. package/dist/types/components/button-group/ButtonGroup.d.ts +0 -45
  1271. package/dist/types/components/card/Card.d.ts +0 -37
  1272. package/dist/types/components/card-ai/CardAi.d.ts +0 -45
  1273. package/dist/types/components/chat-message/ChatMessage.d.ts +0 -18
  1274. package/dist/types/components/checkbox/Checkbox.d.ts +0 -44
  1275. package/dist/types/components/checkbox/CheckboxGroup.d.ts +0 -29
  1276. package/dist/types/components/chip/Chip.d.ts +0 -67
  1277. package/dist/types/components/coachmark/Coachmark.d.ts +0 -46
  1278. package/dist/types/components/code-editor/CodeEditor.d.ts +0 -40
  1279. package/dist/types/components/combobox/ComboBox.d.ts +0 -208
  1280. package/dist/types/components/date-range-picker/DateRangePicker.d.ts +0 -27
  1281. package/dist/types/components/date-time-picker/DateTimePicker.d.ts +0 -45
  1282. package/dist/types/components/datepicker/DatePicker.d.ts +0 -58
  1283. package/dist/types/components/datepicker/datepicker-calendar/DatePickerCalendar.d.ts +0 -39
  1284. package/dist/types/components/datepicker/datepicker-day/DatePickerDay.d.ts +0 -56
  1285. package/dist/types/components/datepicker/datepicker-month/DatePickerMonth.d.ts +0 -26
  1286. package/dist/types/components/datepicker/datepicker-week/DatePickerWeek.d.ts +0 -27
  1287. package/dist/types/components/draggable/Draggable.d.ts +0 -62
  1288. package/dist/types/components/draggable/DraggableItem.d.ts +0 -29
  1289. package/dist/types/components/dropdown/Dropdown.d.ts +0 -152
  1290. package/dist/types/components/editable-textfield/EditableTextfield.d.ts +0 -53
  1291. package/dist/types/components/favorite/Favorite.d.ts +0 -36
  1292. package/dist/types/components/floating-modal/FloatingMinimizedModal.d.ts +0 -53
  1293. package/dist/types/components/floating-modal/FloatingModal.d.ts +0 -70
  1294. package/dist/types/components/form/Form.d.ts +0 -49
  1295. package/dist/types/components/grabber/Grabber.d.ts +0 -74
  1296. package/dist/types/components/help-text/HelpText.d.ts +0 -28
  1297. package/dist/types/components/icon/Icon.d.ts +0 -196
  1298. package/dist/types/components/input/Input.d.ts +0 -138
  1299. package/dist/types/components/input-file/InputFile.d.ts +0 -25
  1300. package/dist/types/components/label/Label.d.ts +0 -43
  1301. package/dist/types/components/link/Link.d.ts +0 -36
  1302. package/dist/types/components/list/List.d.ts +0 -47
  1303. package/dist/types/components/list/ListItem.d.ts +0 -26
  1304. package/dist/types/components/loading/Loading.d.ts +0 -24
  1305. package/dist/types/components/meeting-alert/CompositeAvatar.d.ts +0 -1
  1306. package/dist/types/components/meeting-alert/MeetingAlert.d.ts +0 -46
  1307. package/dist/types/components/menu/Menu.d.ts +0 -46
  1308. package/dist/types/components/menu/MenuItem.d.ts +0 -46
  1309. package/dist/types/components/menu-overlay/MenuOverlay.d.ts +0 -81
  1310. package/dist/types/components/modal/Modal.d.ts +0 -74
  1311. package/dist/types/components/pagination/Pagination.d.ts +0 -33
  1312. package/dist/types/components/phone-input/PhoneInput.d.ts +0 -68
  1313. package/dist/types/components/progress-bar/ProgressBar.d.ts +0 -35
  1314. package/dist/types/components/radio/Radio.d.ts +0 -33
  1315. package/dist/types/components/radio/RadioGroup.d.ts +0 -43
  1316. package/dist/types/components/sass-stats/SassStats.d.ts +0 -29
  1317. package/dist/types/components/slider/Slider.d.ts +0 -47
  1318. package/dist/types/components/spinner/Spinner.d.ts +0 -24
  1319. package/dist/types/components/table/Table.d.ts +0 -57
  1320. package/dist/types/components/table-advanced/TableAdvanced.d.ts +0 -169
  1321. package/dist/types/components/table-advanced/src/decorators.d.ts +0 -32
  1322. package/dist/types/components/table-advanced/src/filter.d.ts +0 -25
  1323. package/dist/types/components/tabs/Tab.d.ts +0 -64
  1324. package/dist/types/components/tabs/TabPanel.d.ts +0 -25
  1325. package/dist/types/components/tabs/Tabs.d.ts +0 -125
  1326. package/dist/types/components/taskitem/TaskItem.d.ts +0 -40
  1327. package/dist/types/components/theme/Theme.d.ts +0 -89
  1328. package/dist/types/components/theme/index.d.ts +0 -7
  1329. package/dist/types/components/timepicker/TimePicker.d.ts +0 -50
  1330. package/dist/types/components/toggle-switch/ToggleSwitch.d.ts +0 -39
  1331. package/dist/types/components/tooltip/Tooltip.d.ts +0 -54
  1332. package/dist/types/constants.d.ts +0 -39
  1333. package/dist/types/index.d.ts +0 -75
  1334. package/dist/types/internal-components/color-table/ColorTable.d.ts +0 -9
  1335. package/dist/types/internal-components/color-table/data.d.ts +0 -551
  1336. package/dist/types/internal-components/color-table/utils.d.ts +0 -1
  1337. package/dist/types/mixins/CustomElementCheck.d.ts +0 -1
  1338. package/dist/types/mixins/DedupeMixin.d.ts +0 -28
  1339. package/dist/types/mixins/FocusMixin.d.ts +0 -44
  1340. package/dist/types/mixins/FocusTrapMixin.d.ts +0 -19
  1341. package/dist/types/mixins/ResizeMixin.d.ts +0 -52
  1342. package/dist/types/mixins/RovingTabIndexMixin.d.ts +0 -31
  1343. package/dist/types/mixins/SlottedMixin.d.ts +0 -43
  1344. package/dist/types/mixins/index.d.ts +0 -14
  1345. package/dist/types/utils/dateUtils.d.ts +0 -31
  1346. package/dist/types/utils/enums.d.ts +0 -18
  1347. package/dist/types/utils/helpers.d.ts +0 -17
  1348. package/dist/types/utils/keyboard.d.ts +0 -1
  1349. package/dist/types/utils/validations.d.ts +0 -25
  1350. package/dist/types/wc_scss/colors/vars/color-table-data-string.d.ts +0 -1
  1351. /package/{dist → src}/assets/styles/fonts.css +0 -0
@@ -0,0 +1,1824 @@
1
+ /**
2
+ * Copyright (c) Cisco Systems, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+
9
+ import "@/components/help-text/HelpText";
10
+ import "@/components/icon/Icon";
11
+ import { ATTRIBUTES, Key } from "@/constants";
12
+ import { FocusMixin } from "@/mixins";
13
+ import { customElementWithCheck } from "@/mixins/CustomElementCheck";
14
+ import { debounce, findHighlight } from "@/utils/helpers";
15
+ import reset from "@/wc_scss/reset.scss";
16
+ import { LitElement, PropertyValues, html, internalProperty, property, query, queryAll } from "lit-element";
17
+ import { nothing } from "lit-html";
18
+ import { classMap } from "lit-html/directives/class-map";
19
+ import { ifDefined } from "lit-html/directives/if-defined";
20
+ import { repeat } from "lit-html/directives/repeat";
21
+ import { styleMap } from "lit-html/directives/style-map";
22
+ import { scroll } from "lit-virtualizer";
23
+ import { setTimeout } from "timers";
24
+ import styles from "./scss/module.scss";
25
+
26
+ export namespace ComboBox {
27
+ type OptionMember = { [key: string]: string };
28
+ type SelectedEvent = {
29
+ value?: string | OptionMember;
30
+ selected: (string | OptionMember)[];
31
+ };
32
+ export type MessageType = "error" | "success" | "warning";
33
+ export type Message = {
34
+ type: MessageType;
35
+ message: string;
36
+ id?: string;
37
+ ariaLive?: "off" | "assertive" | "polite";
38
+ };
39
+
40
+ export class MessageController {
41
+ determineMessageType(array: ComboBox.Message[]) {
42
+ return array.reduce<ComboBox.MessageType>(
43
+ (accumulator, errorMessage) =>
44
+ (errorMessage as unknown as string) === "error" ? accumulator : errorMessage.type,
45
+ "" as ComboBox.MessageType
46
+ );
47
+ }
48
+ filterMessagesByType(array: ComboBox.Message[], value: string) {
49
+ return array.reduce(
50
+ (accumulator, errorMessage) =>
51
+ errorMessage.type === value ? accumulator.concat(errorMessage.message) : accumulator,
52
+ [] as string[]
53
+ );
54
+ }
55
+ }
56
+
57
+ @customElementWithCheck("md-combobox")
58
+ export class ELEMENT extends FocusMixin(LitElement) {
59
+ private _focusedIndex = -1;
60
+ private _focusedGroupIndex = -1;
61
+
62
+ @property({ type: String }) label = "Options";
63
+ @property({ type: Array }) options: (string | OptionMember)[] = [];
64
+ @property({ type: Array, attribute: "custom-options" }) customOptions = [];
65
+ @property({ type: String }) placeholder = "";
66
+ @property({ type: Boolean, attribute: "is-multi" }) isMulti = false;
67
+ @property({ type: Boolean, attribute: "use-virtual-scroll" }) useVirtualScroll = false;
68
+ @property({ type: Boolean, reflect: true }) disabled = false;
69
+ @property({ type: Boolean, reflect: true }) ordered = false;
70
+ @property({ type: Boolean, reflect: true }) expanded = false;
71
+ @property({ type: Array, reflect: true }) groupExpandedList: any = [];
72
+ @property({ type: Boolean, reflect: true }) searchItem = false;
73
+ @property({ type: Boolean, reflect: true }) compact = false;
74
+ @property({ type: Boolean, attribute: "no-clear-icon" }) noClearIcon = false;
75
+ @property({ type: Boolean, attribute: "select-when-in-focus" }) selectWhenInFocus = false;
76
+ @property({ type: Array }) selectedOptions: (string | OptionMember)[] = [];
77
+ @property({ type: Number, attribute: "visible-option", reflect: true }) visibleOptions = 8;
78
+ @property({ type: String, attribute: "option-id", reflect: true }) optionId = "";
79
+ @property({ type: String, attribute: "option-value", reflect: true }) optionValue = "";
80
+ @property({ type: Boolean, attribute: "with-custom-content" }) isCustomContent = false;
81
+ @property({ type: Boolean, reflect: true }) searchable = false;
82
+ @property({ type: String }) shape = "none";
83
+ @property({ type: Array }) value: (string | OptionMember)[] = [];
84
+ @property({ type: String, attribute: "input-value", reflect: true }) inputValue = "";
85
+ @property({ type: Boolean, attribute: "allow-custom-value", reflect: true }) allowCustomValue = false;
86
+ @property({ type: Boolean, reflect: true }) autofocus = false;
87
+ @property({ type: String, attribute: "no-results-i18n" }) resultsTextLocalization = "No Results";
88
+ @property({ type: String, attribute: "no-options-i18n" }) optionsTextLocalization = "No Options";
89
+ @property({ type: Boolean, reflect: true, attribute: "search-trim-space" }) trimSpace = false;
90
+ @property({ type: Boolean, reflect: true }) invalid = false;
91
+ @property({ type: String, reflect: true, attribute: "invalid-text-i18n" }) invalidText = "";
92
+
93
+ @property({ type: String, reflect: true }) ariaLabel = ""; // This aria-label is used by default when there is no search or list-items are displayed.
94
+ @property({ type: String, attribute: "search-result-aria-label" }) searchResultAriaLabel = ""; // This aria-label is dynamic and used when there is search and list-items are displayed.
95
+ @internalProperty() ariaLabelForComboBox = ""; // This internal property is used to conditionally set aria-label.
96
+
97
+ @property({ type: String, attribute: "clear-aria-label" }) clearAriaLabel = "Clear";
98
+ @property({ type: String, attribute: "arrow-aria-label" }) arrowAriaLabel = "Expand";
99
+ @property({ type: String, attribute: "clear-icon-height" }) clearIconHeight = "auto";
100
+
101
+ @property({ type: String, attribute: "all-i18n" }) allTextLocalization = "All";
102
+ @property({ type: String, attribute: "select-all-i18n" }) selectAllTextLocalization = "Select All";
103
+ @property({ type: String, attribute: "selected-all-i18n" }) selectedTextLocalization = "Selected";
104
+
105
+ @property({ type: Boolean, attribute: "allow-select-all", reflect: true }) allowSelectAll = false;
106
+ @property({ type: Boolean, attribute: "show-custom-error", reflect: true }) showCustomError = false;
107
+ @property({ type: Boolean, attribute: "show-loader", reflect: true }) showLoader = false;
108
+ @property({ type: Boolean, attribute: "show-selected-count", reflect: true }) showSelectedCount = false;
109
+ @property({ type: String, attribute: "popup-chevron-aria-hidden" }) popupChevronAriaHidden = "true";
110
+ @property({ type: Boolean, reflect: true }) newMomentum = false;
111
+
112
+ @property({ type: String }) comboboxId = "";
113
+ @property({ type: String }) helpText = "";
114
+ @property({ type: Array }) messageArr: ComboBox.Message[] = [];
115
+ @property({ type: String }) htmlId = "";
116
+ @property({ type: Boolean, reflect: true }) readOnly = false;
117
+
118
+ private readonly messageController = new MessageController();
119
+
120
+ @property({ type: Number, attribute: false })
121
+ @internalProperty()
122
+ private isOptGroup = false;
123
+ @internalProperty()
124
+ private isSelectAllChecked = false;
125
+ get focusedIndex() {
126
+ return this._focusedIndex;
127
+ }
128
+ set focusedIndex(index: number) {
129
+ this.updateFocusedIndex(index);
130
+ }
131
+
132
+ updateFocusedIndex(index: number) {
133
+ const oldIndex = this._focusedIndex;
134
+ if (this.checkForVirtualScroll()) {
135
+ // Virtual Scroll is Enabled.
136
+ let newId: any;
137
+ if (this.allowSelectAll) {
138
+ // "Select All" checkbox option is enabled.
139
+ newId = index === 0 ? "selectAll" : this.getOptionId(this.filteredOptions[index - 1]);
140
+ } else {
141
+ newId = this.getOptionId(this.filteredOptions[index]);
142
+ }
143
+ const newList = this.lists ? [...this.lists]?.find((list) => list.offsetHeight !== 0 && list.id === newId) : "";
144
+ if (this.lists) {
145
+ [...this.lists].forEach((list) => {
146
+ list.toggleAttribute("focused", false);
147
+ });
148
+ }
149
+ if (newList) {
150
+ newList?.toggleAttribute("focused", true);
151
+ }
152
+ } else {
153
+ if (this.lists) {
154
+ const oldFocusedOption = this.lists[oldIndex];
155
+ if (oldFocusedOption) {
156
+ oldFocusedOption.toggleAttribute("focused", false);
157
+ }
158
+ const newFocusedOption = this.lists[index];
159
+ if (newFocusedOption) {
160
+ newFocusedOption.toggleAttribute("focused", true);
161
+ }
162
+ }
163
+ }
164
+ this._focusedIndex = index;
165
+ this.requestUpdate("focusedIndex", oldIndex);
166
+ }
167
+
168
+ get focusedGroupIndex() {
169
+ return this._focusedGroupIndex;
170
+ }
171
+
172
+ set focusedGroupIndex(index: number) {
173
+ const oldIndex = this._focusedGroupIndex;
174
+ if (this.labels && this.labels.length !== 0) {
175
+ const oldFocusedOption = this.labels[oldIndex];
176
+ if (oldFocusedOption) {
177
+ oldFocusedOption.toggleAttribute("focused", false);
178
+ }
179
+ const newFocusedOption = this.labels[index];
180
+ if (newFocusedOption) {
181
+ newFocusedOption.toggleAttribute("focused", true);
182
+ newFocusedOption.focus();
183
+ }
184
+ }
185
+ this._focusedGroupIndex = index;
186
+ this.requestUpdate("focusedGroupIndex", oldIndex);
187
+ }
188
+
189
+ get messageType(): ComboBox.MessageType | null {
190
+ if (this.messageArr.length > 0) {
191
+ return this.messageController.determineMessageType(this.messageArr);
192
+ }
193
+ return null;
194
+ }
195
+
196
+ get messages() {
197
+ if (this.messageType) {
198
+ return this.messageController.filterMessagesByType(this.messageArr, this.messageType);
199
+ }
200
+ return null;
201
+ }
202
+
203
+ private multiSelectedIndex = -1;
204
+ private multiSelected: number[] = [];
205
+ private customContent: Element[] = [];
206
+
207
+ private notifySearchResultCount() {
208
+ // this function is to update ariaLabelForComboBox for search result count.
209
+
210
+ // If searchResultAriaLabel is passed, the {{}} is replaced with the search result count.
211
+ if (this.searchResultAriaLabel) {
212
+ const regex = /{{.*?}}/g;
213
+ this.ariaLabelForComboBox = this.searchResultAriaLabel.replace(regex, this.filteredOptions.length.toString());
214
+ }
215
+ // If searchResultAriaLabel is not passed and ariaLabel is passed, the ariaLabel is appended with the search result count.
216
+ else if (this.ariaLabel) {
217
+ this.ariaLabelForComboBox = `${this.ariaLabel}, ${this.filteredOptions.length} results found.`;
218
+ }
219
+ // If both searchResultAriaLabel and ariaLabel are not passed, the default text is appended with the search result count.
220
+ else {
221
+ this.ariaLabelForComboBox = `ComboBox Element, ${this.filteredOptions.length} results found.`;
222
+ }
223
+ }
224
+
225
+ @query(".group") group?: HTMLDivElement;
226
+ @query(".md-combobox-listbox") input?: HTMLInputElement;
227
+ @query(".md-combobox-button") button?: HTMLButtonElement;
228
+ @query("div#md-combobox-listbox") listBox?: HTMLDivElement;
229
+ @query(".virtual-scroll") virtualizer?: any;
230
+
231
+ @queryAll("div.md-combobox-option") lists?: HTMLDivElement[];
232
+ @queryAll(".group-label") labels?: HTMLDivElement[];
233
+ @queryAll(".md-combobox-selected-item") selected?: HTMLDivElement[];
234
+
235
+ protected firstUpdated(changedProperties: PropertyValues) {
236
+ // Initially the ariaLabelForComboBox is set for ariaLabel value if found or a static text is set.
237
+ this.ariaLabelForComboBox = this.ariaLabel ? this.ariaLabel : "ComboBox Element";
238
+ super.firstUpdated(changedProperties);
239
+ if (this.isCustomContent) {
240
+ this.optionId = "id";
241
+ this.optionValue = "value";
242
+ this.setOptionCustomContent();
243
+ }
244
+ this.setInitialValue();
245
+ }
246
+
247
+ protected updated(changedProperties: PropertyValues) {
248
+ super.updated(changedProperties);
249
+ if (changedProperties.has("expanded")) {
250
+ if (this.expanded) {
251
+ this.resizeListbox();
252
+ this.checkSelectedOptions();
253
+ } else {
254
+ this.unCheckAllOptions();
255
+ }
256
+ }
257
+ if (changedProperties.has("focusedIndex")) {
258
+ if (this.focusedIndex >= 0) {
259
+ if (!this.checkForVirtualScroll()) {
260
+ this.scrollToOption();
261
+ }
262
+ }
263
+ }
264
+ if (changedProperties.has("value")) {
265
+ if (this.selectedOptions.length === 0) {
266
+ this.setInitialValue();
267
+ }
268
+ }
269
+ if (changedProperties.has("customOptions")) {
270
+ if (this.isCustomContent) {
271
+ this.setOptionCustomContent();
272
+ this.resizeListbox();
273
+ }
274
+ }
275
+ if (changedProperties.has("showCustomError")) {
276
+ this.resizeListbox();
277
+ }
278
+ if (changedProperties.has("showLoader")) {
279
+ this.resizeListbox();
280
+ }
281
+ if (changedProperties.has("searchItem")) {
282
+ this.resizeListbox();
283
+ }
284
+ }
285
+
286
+ protected handleFocusIn(event: Event) {
287
+ if (!this.disabled || this.readOnly) {
288
+ if (this.noClearIcon) {
289
+ requestAnimationFrame(() => {
290
+ this.input!.focus();
291
+ this.focusedGroupIndex = -1;
292
+ });
293
+
294
+ if (this.selectWhenInFocus) {
295
+ this.input!.select();
296
+ }
297
+ }
298
+ super.handleFocusIn && super.handleFocusIn(event);
299
+ }
300
+ this.dispatchEvent(
301
+ new CustomEvent("combobox-focus-in", {
302
+ composed: true,
303
+ bubbles: true
304
+ })
305
+ );
306
+ }
307
+
308
+ protected handleFocusOut(event: Event) {
309
+ super.handleFocusOut && super.handleFocusOut(event);
310
+ this.dispatchEvent(
311
+ new CustomEvent("combobox-focus-out", {
312
+ composed: true,
313
+ bubbles: true
314
+ })
315
+ );
316
+ }
317
+
318
+ private findFilteredOption(option: string | OptionMember) {
319
+ if (this.isOptionObject(option)) {
320
+ return (this.filteredOptions as OptionMember[]).findIndex(
321
+ (filteredOption) =>
322
+ this.getOptionId(filteredOption) === this.getOptionId(option) &&
323
+ this.getOptionValue(filteredOption) === this.getOptionValue(option)
324
+ );
325
+ }
326
+ return this.filteredOptions.indexOf(option);
327
+ }
328
+
329
+ private setInitialValue() {
330
+ if (this.value.length) {
331
+ if (this.isMulti) {
332
+ this.value.forEach((v) => {
333
+ const selectedIndex = this.findFilteredOption(v);
334
+ if (selectedIndex !== -1) {
335
+ this.setSelectedOption(v);
336
+ }
337
+ });
338
+ } else {
339
+ const option = this.value[0];
340
+ const selectedIndex = this.findFilteredOption(option);
341
+ if (selectedIndex !== -1) {
342
+ this.setSelectedOption(option);
343
+ this.setInputValue(this.getOptionValue(option));
344
+ this.input?.setAttribute(ATTRIBUTES.AriaActivedescendant, this.getOptionId(option));
345
+ this.focusedIndex = selectedIndex;
346
+ this.focusedGroupIndex = -1;
347
+ }
348
+ }
349
+ }
350
+ }
351
+
352
+ private isOptionObject(option: string | OptionMember) {
353
+ return typeof option === "object" && option !== null;
354
+ }
355
+
356
+ private setOptionCustomContent() {
357
+ if (this.isOptGroup) {
358
+ const customOptionGroups = [...this.querySelectorAll(`optgroup`)];
359
+ const final = [];
360
+ for (const optgroup of customOptionGroups) {
361
+ const label = optgroup.getAttribute("label");
362
+ const childOptions = [...optgroup.querySelectorAll(`[slot]`)];
363
+
364
+ final.push({ isLabel: "true", [this.optionValue]: label, groupName: label });
365
+ for (const option of childOptions) {
366
+ const customValue = option.getAttribute("aria-label");
367
+ const displayCustomValue = option.getAttribute("display-value");
368
+ const slotValue = option.getAttribute("slot");
369
+ if (customValue && displayCustomValue) {
370
+ final.push({
371
+ [this.optionId]: customValue,
372
+ [this.optionValue]: displayCustomValue,
373
+ isLabel: "false",
374
+ groupName: label,
375
+ slot: slotValue
376
+ });
377
+ }
378
+ }
379
+ }
380
+ this.options = final as OptionMember[];
381
+ } else {
382
+ this.customContent = [...this.querySelectorAll(`[slot]`)];
383
+ if (this.customContent && this.customContent.length) {
384
+ this.options = this.customContent.map((content) => {
385
+ const customValue = content.getAttribute("aria-label");
386
+ const displayCustomValue = content.getAttribute("display-value");
387
+ if (customValue && displayCustomValue) {
388
+ return { [this.optionId]: customValue, [this.optionValue]: displayCustomValue };
389
+ }
390
+ }) as OptionMember[];
391
+ } else {
392
+ this.options = [];
393
+ }
394
+ }
395
+ }
396
+
397
+ private getOptionValue(option: string | OptionMember) {
398
+ return this.isOptionObject(option) ? (option as OptionMember)[this.optionValue] : (option as string);
399
+ }
400
+
401
+ private getOptionGroupName(option: any) {
402
+ return option?.groupName;
403
+ }
404
+
405
+ private getOptionId(option: string | OptionMember) {
406
+ return this.isOptionObject(option) ? (option as OptionMember)[this.optionId] : (option as string);
407
+ }
408
+
409
+ private getFocusedItem(focusedIndex: number) {
410
+ if (focusedIndex >= 0) {
411
+ return this.filteredOptions[focusedIndex];
412
+ }
413
+ }
414
+
415
+ private setupEvents() {
416
+ document.addEventListener("click", this.handleOutsideClick);
417
+ this.addEventListener("remove-all-selected", this.removeAllSelected);
418
+ this.addEventListener("selected-changed", this.selectedChange as EventListener);
419
+ }
420
+
421
+ private teardownEvents() {
422
+ document.removeEventListener("click", this.handleOutsideClick);
423
+ this.removeEventListener("remove-all-selected", this.removeAllSelected);
424
+ this.removeEventListener("selected-changed", this.selectedChange as EventListener);
425
+ }
426
+
427
+ private setVisualListbox(value: boolean) {
428
+ this.expanded = value;
429
+ }
430
+
431
+ private setGroupList(value: any) {
432
+ if (this.groupExpandedList.includes(value)) {
433
+ this.groupExpandedList.splice(this.groupExpandedList.indexOf(value), 1);
434
+ this.groupExpandedList = [...this.groupExpandedList];
435
+ } else {
436
+ if (this.searchItem) this.groupExpandedList.push(value);
437
+ else this.groupExpandedList = [value];
438
+ }
439
+ }
440
+
441
+ private findSelectedOption(option: string | OptionMember) {
442
+ if (this.optionId && option) {
443
+ return this.selectedOptions.findIndex(
444
+ (selectedOption) =>
445
+ selectedOption &&
446
+ (selectedOption as OptionMember)[this.optionId] === (option as OptionMember)[this.optionId]
447
+ );
448
+ } else {
449
+ return this.selectedOptions.indexOf(option);
450
+ }
451
+ }
452
+
453
+ private findOptionIndex(event: MouseEvent) {
454
+ const eventPath = event.composedPath();
455
+ if (this.checkForVirtualScroll()) {
456
+ let id = "";
457
+ [...this.lists!].forEach((listOption) => {
458
+ if (eventPath.includes(listOption)) {
459
+ id = listOption.id;
460
+ }
461
+ });
462
+ return this.filteredOptions.findIndex((option: any) => this.getOptionId(option) === id);
463
+ } else {
464
+ return [...this.lists!].findIndex((listOption) => eventPath.includes(listOption));
465
+ }
466
+ }
467
+ private checkSelectedOptions() {
468
+ if (this.checkForVirtualScroll()) {
469
+ const selectedOptionIds = this.selectedOptions.map((option) => this.getOptionId(option));
470
+ const updatedLists = [...this.lists!].filter((list) => list.id !== "selectAll");
471
+ updatedLists?.forEach((list: HTMLDivElement) => {
472
+ if (selectedOptionIds.includes(list.id)) {
473
+ if (this.isMulti) {
474
+ list?.setAttribute("aria-checked", "true");
475
+ }
476
+ list?.setAttribute("aria-selected", "true");
477
+ } else if (this.isMulti) {
478
+ list?.setAttribute("aria-checked", "false");
479
+ }
480
+ });
481
+ }
482
+ }
483
+ private unCheckAllOptions() {
484
+ if (this.checkForVirtualScroll() && this.isMulti) {
485
+ [...this.lists!]?.forEach((list: HTMLDivElement) => {
486
+ if (list?.id !== "selectAll") {
487
+ list?.setAttribute("aria-checked", "false");
488
+ }
489
+ });
490
+ }
491
+ }
492
+
493
+ private setSelectedOption(option: string | OptionMember) {
494
+ if (!this.isMulti) {
495
+ this.selectedOptions = [];
496
+ }
497
+ const selectedIndex = this.findSelectedOption(option);
498
+ if (selectedIndex !== -1) {
499
+ const removedOption = this.selectedOptions[selectedIndex];
500
+ this.selectedOptions.splice(selectedIndex, 1);
501
+ this.notifySelectedChange({
502
+ value: removedOption,
503
+ selected: this.selectedOptions
504
+ });
505
+ } else {
506
+ this.selectedOptions.push(option);
507
+ this.notifySelectedChange({
508
+ value: option,
509
+ selected: this.selectedOptions
510
+ });
511
+ }
512
+ this.checkSelectedOptions();
513
+ if (this.isMulti && this.allowSelectAll) {
514
+ this.isSelectAllChecked = this.isSelectAllSelected();
515
+ }
516
+ this.requestUpdate();
517
+ }
518
+
519
+ private notifySelectedChange = debounce((detail: SelectedEvent) => {
520
+ this.dispatchEvent(
521
+ new CustomEvent<SelectedEvent>("change-selected", {
522
+ composed: true,
523
+ bubbles: true,
524
+ detail
525
+ })
526
+ );
527
+ }, 0);
528
+
529
+ private handleGroupFilter = (finalFilteredOption: (string | OptionMember)[]) => {
530
+ const tempGroupExpandedList = finalFilteredOption.filter((item) => {
531
+ if (typeof item !== "string" && item.isLabel === "true") {
532
+ return item.groupName;
533
+ }
534
+ });
535
+ this.searchItem = true;
536
+ this.groupExpandedList = tempGroupExpandedList.map((a) => {
537
+ if (typeof a !== "string") {
538
+ return a.groupName;
539
+ }
540
+ });
541
+
542
+ return finalFilteredOption.filter((option: string | OptionMember) => {
543
+ if (typeof option !== "string" && option.isLabel === "true") {
544
+ const isGroupOption = finalFilteredOption.find((option2) => {
545
+ if (typeof option !== "string" && typeof option2 !== "string") {
546
+ return option.groupName === option2.groupName && option2.isLabel === "false";
547
+ }
548
+ });
549
+ return isGroupOption ? true : false;
550
+ } else {
551
+ return true;
552
+ }
553
+ });
554
+ };
555
+
556
+ private filterOptions(value: string): (string | OptionMember)[] {
557
+ if (value && value.length) {
558
+ const finalFilteredOption = this.options.filter((option: string | OptionMember) => {
559
+ if (this.isOptGroup && typeof option !== "string" && option.isLabel === "true") {
560
+ return option;
561
+ } else {
562
+ return (this.isCustomContent ? this.getOptionId(option) : this.getOptionValue(option))
563
+ .toLowerCase()
564
+ .includes(value.toLowerCase());
565
+ }
566
+ });
567
+
568
+ if (this.isOptGroup) {
569
+ return this.handleGroupFilter(finalFilteredOption);
570
+ } else {
571
+ return finalFilteredOption;
572
+ }
573
+ } else {
574
+ this.searchItem = false;
575
+ return this.options;
576
+ }
577
+ }
578
+
579
+ private getListBoxVerticalPadding() {
580
+ if (this.listBox) {
581
+ const computedStyle = window.getComputedStyle(this.listBox, null);
582
+ const paddingTop = parseInt(computedStyle.getPropertyValue("padding-top"));
583
+ const paddingBottom = parseInt(computedStyle.getPropertyValue("padding-bottom"));
584
+ const padding = paddingTop + paddingBottom;
585
+
586
+ if (!isNaN(padding)) {
587
+ return padding + 2;
588
+ }
589
+ }
590
+
591
+ return 10;
592
+ }
593
+
594
+ private resizeListbox() {
595
+ this.updateOnNextFrame(() => {
596
+ let height = 0;
597
+ let labelHeight = 0;
598
+ let virtualizerHeight = 0;
599
+ const verticalPadding: number = this.getListBoxVerticalPadding();
600
+ if (this.lists) {
601
+ const updatedList = this.checkForVirtualScroll()
602
+ ? [...this.lists].filter((list) => list.offsetHeight !== 0)
603
+ : [...this.lists];
604
+
605
+ height = updatedList
606
+ .slice(0, this.visibleOptions)
607
+ .reduce((accumulator, option) => accumulator + option.offsetHeight, 0);
608
+ virtualizerHeight =
609
+ this.checkForVirtualScroll() && this.allowSelectAll
610
+ ? updatedList
611
+ .slice(1, this.visibleOptions)
612
+ .reduce((accumulator, option) => accumulator + option.offsetHeight, 0)
613
+ : updatedList
614
+ .slice(0, this.visibleOptions)
615
+ .reduce((accumulator, option) => accumulator + option.offsetHeight, 0);
616
+ }
617
+ if (this.labels) {
618
+ labelHeight = [...this.labels]
619
+ .slice(0, this.visibleOptions)
620
+ .reduce((accumulator, option) => accumulator + option.offsetHeight, 0);
621
+ }
622
+ if (this.listBox) {
623
+ this.listBox.style.maxHeight = `${height + labelHeight + verticalPadding}px`;
624
+ }
625
+
626
+ if (this.virtualizer) {
627
+ this.virtualizer.style.height = `${virtualizerHeight + verticalPadding}px`;
628
+ }
629
+ if (this.showCustomError || this.showLoader) {
630
+ const customContent = this.listBox?.querySelector("[slot]");
631
+ if (this.listBox && customContent) {
632
+ this.listBox.style.height = `${customContent.clientHeight + verticalPadding}px`;
633
+ this.listBox.style.maxHeight = `${customContent.clientHeight + verticalPadding}px`;
634
+ }
635
+ }
636
+ });
637
+ }
638
+
639
+ private setInputValue(value = "") {
640
+ this.input!.value = value;
641
+ }
642
+
643
+ private updateOnNextFrame(cb: FrameRequestCallback) {
644
+ requestAnimationFrame(cb);
645
+ }
646
+
647
+ private unCheckedAllOptions() {
648
+ if (this.isMulti) {
649
+ this.lists!.forEach((list, index) => this.unCheckedOption(index));
650
+ this.isSelectAllChecked = false;
651
+ }
652
+ }
653
+
654
+ private unCheckedOption(index: number) {
655
+ if (this.isMulti) {
656
+ this.lists![index].setAttribute("aria-checked", "false");
657
+ this.notifySelectedChange({
658
+ value: this.filteredOptions[index],
659
+ selected: this.selectedOptions
660
+ });
661
+ }
662
+ }
663
+
664
+ private checkAllOptions() {
665
+ if (this.isMulti) {
666
+ this.lists!.forEach((list, index) => this.checkOption(index));
667
+ }
668
+ }
669
+
670
+ private checkOption(index: number) {
671
+ if (this.isMulti) {
672
+ this.lists![index].setAttribute("aria-checked", "true");
673
+ this.notifySelectedChange({
674
+ value: this.filteredOptions[index],
675
+ selected: this.selectedOptions
676
+ });
677
+ }
678
+ }
679
+
680
+ private isSelectAllSelected() {
681
+ return this.selectedOptions.length === this.options.length;
682
+ }
683
+
684
+ private setFocusOnHost(force: boolean) {
685
+ if (this.setFocus) {
686
+ this.setFocus(force);
687
+ }
688
+ }
689
+
690
+ private isOptionFocused(optionIndex: number) {
691
+ return this.focusedIndex === optionIndex;
692
+ }
693
+
694
+ private getAriaState(optionIndex: number) {
695
+ return this.isOptionFocused(optionIndex);
696
+ }
697
+
698
+ private scrollToOption() {
699
+ let distance = 0;
700
+ const { top, bottom } = this.listBox!.getBoundingClientRect();
701
+ const option = this.lists![this.focusedIndex];
702
+ const nextOption = (this.lists![this.focusedIndex + 1] || option)?.getBoundingClientRect();
703
+ const prevOption = (this.lists![this.focusedIndex - 1] || option)?.getBoundingClientRect();
704
+
705
+ if (nextOption?.bottom > bottom) {
706
+ distance = nextOption.bottom - bottom + 2;
707
+ } else if (prevOption?.top < top) {
708
+ distance = prevOption.top - top - 2;
709
+ }
710
+ this.updateOnNextFrame(() => {
711
+ this.listBox!.scrollTop += distance;
712
+ });
713
+ }
714
+
715
+ private getCustomContentName(option: string | OptionMember) {
716
+ const index = this.options.indexOf(option);
717
+ if (this.isOptGroup) {
718
+ const selectedOption = this.options[index];
719
+ if (selectedOption && typeof selectedOption !== "string") {
720
+ return selectedOption.slot;
721
+ }
722
+ } else {
723
+ if (index !== -1) {
724
+ return this.customContent[index].slot;
725
+ }
726
+ }
727
+ }
728
+
729
+ private setInputSelectionRange(start: number, end: number) {
730
+ this.input!.setSelectionRange(start, end);
731
+ }
732
+
733
+ private isOptionChecked(option: string | OptionMember) {
734
+ if (this.findSelectedOption(option) !== -1) {
735
+ return "true";
736
+ }
737
+ return "false";
738
+ }
739
+
740
+ private getInputSelection() {
741
+ return this.input!.selectionStart;
742
+ }
743
+
744
+ private canMultiSelect() {
745
+ const inputSelection = this.getInputSelection();
746
+ return inputSelection === 0 && this.selectedOptions.length !== 0 && this.isMulti;
747
+ }
748
+
749
+ private removeMultiTag() {
750
+ if (this.selected) {
751
+ this.multiSelected.forEach((index) => {
752
+ const selected = this.selected![index];
753
+ if (selected && selected.hasAttribute("selected")) {
754
+ this.removeSelected(this.selectedOptions[index]);
755
+ }
756
+ });
757
+ }
758
+ }
759
+
760
+ private unselectedAllMultiTag() {
761
+ if (this.selected) {
762
+ this.selected.forEach((selected) => selected.removeAttribute("selected"));
763
+ }
764
+ this.multiSelectedIndex = -1;
765
+ }
766
+
767
+ private findLastMultiSelected() {
768
+ return this.selected![this.multiSelectedIndex];
769
+ }
770
+
771
+ private toggleMultiSelectedTag(selected: HTMLElement | undefined, force: boolean) {
772
+ if (selected) {
773
+ selected.toggleAttribute("selected", force);
774
+ }
775
+ }
776
+
777
+ private selectMultiTag(isShiftKey: boolean) {
778
+ if (this.canMultiSelect()) {
779
+ if (!isShiftKey) {
780
+ this.multiSelected = [];
781
+ const oldSelected = this.findLastMultiSelected();
782
+ this.toggleMultiSelectedTag(oldSelected, false);
783
+ }
784
+ if (this.multiSelectedIndex <= 0) {
785
+ this.multiSelectedIndex = this.selectedOptions.length - 1;
786
+ } else {
787
+ this.multiSelectedIndex--;
788
+ }
789
+ this.multiSelected.push(this.multiSelectedIndex);
790
+ const newSelected = this.findLastMultiSelected();
791
+ this.toggleMultiSelectedTag(newSelected, true);
792
+ }
793
+ }
794
+
795
+ async handleListClick(event: MouseEvent) {
796
+ this.dispatchEvent(
797
+ new CustomEvent("selected-changed", {
798
+ detail: {
799
+ event
800
+ }
801
+ })
802
+ );
803
+ await this.updateComplete;
804
+
805
+ if (this.isMulti) {
806
+ this.setVisualListbox(true);
807
+ } else {
808
+ this.setVisualListbox(false);
809
+ }
810
+
811
+ this.updateOnNextFrame(() => {
812
+ this.input!.focus();
813
+ this.focusedGroupIndex = -1;
814
+ });
815
+ }
816
+
817
+ async handleSelectAll() {
818
+ this.isSelectAllChecked = !this.isSelectAllChecked;
819
+ if (this.isSelectAllChecked) {
820
+ this.selectedOptions = [...this.options];
821
+ this.checkAllOptions();
822
+ } else {
823
+ this.selectedOptions = [];
824
+ this.unCheckedAllOptions();
825
+ }
826
+
827
+ await this.updateComplete;
828
+ this.setVisualListbox(true);
829
+ this.notifySelectedChange({
830
+ selected: this.selectedOptions
831
+ });
832
+ }
833
+
834
+ handleInputKeyUp(event: KeyboardEvent) {
835
+ switch (event.code) {
836
+ case Key.Escape: {
837
+ break;
838
+ }
839
+ case Key.Backspace:
840
+ {
841
+ this.setFocusOnHost(true);
842
+ this.setVisualListbox(true);
843
+ this.resizeListbox();
844
+ this.removeMultiTag();
845
+ }
846
+ break;
847
+ case Key.ArrowLeft:
848
+ {
849
+ if (this.isMulti) {
850
+ if (event.shiftKey) {
851
+ this.selectMultiTag(true);
852
+ } else {
853
+ this.selectMultiTag(false);
854
+ }
855
+ }
856
+ }
857
+ break;
858
+ default: {
859
+ if (this.isMulti) {
860
+ this.unselectedAllMultiTag();
861
+ }
862
+ break;
863
+ }
864
+ }
865
+ }
866
+
867
+ private notifyInputValueChanged = debounce((value: string) => {
868
+ this.dispatchEvent(
869
+ new CustomEvent("combobox-input", {
870
+ composed: true,
871
+ bubbles: true,
872
+ detail: {
873
+ value
874
+ }
875
+ })
876
+ );
877
+
878
+ this.notifySearchResultCount();
879
+ this.focusedGroupIndex = 0;
880
+ requestAnimationFrame(() => {
881
+ this.input!.focus();
882
+ this.focusedGroupIndex = -1;
883
+ });
884
+ }, 250);
885
+
886
+ handleInput(event: Event) {
887
+ const inputValue = (event.target as HTMLInputElement).value;
888
+ this.inputValue = inputValue.trim();
889
+ this.notifyInputValueChanged(inputValue.trim());
890
+ }
891
+
892
+ private removeAllSelected() {
893
+ this.focusedIndex = -1;
894
+ this.focusedGroupIndex = -1;
895
+ this.selectedOptions = [];
896
+ this.inputValue = "";
897
+ this.setInputValue();
898
+ this.input?.setAttribute(ATTRIBUTES.AriaActivedescendant, "");
899
+ this.setVisualListbox(false);
900
+ this.unCheckedAllOptions();
901
+ this.setSelectedAttribute(undefined);
902
+ this.updateOnNextFrame(() => {
903
+ this.input!.focus();
904
+ });
905
+ this.notifySelectedChange({
906
+ selected: this.selectedOptions
907
+ });
908
+ }
909
+
910
+ private removeSelected(option: string | OptionMember) {
911
+ const index = this.findSelectedOption(option);
912
+ const checkedOptionIndex = this.filteredOptions.indexOf(option);
913
+
914
+ if (checkedOptionIndex !== -1) {
915
+ this.unCheckedOption(checkedOptionIndex);
916
+ }
917
+ if (index !== -1) {
918
+ this.selectedOptions.splice(index, 1);
919
+ this.requestUpdate();
920
+ }
921
+ this.updateOnNextFrame(() => {
922
+ this.input!.focus();
923
+ this.focusedGroupIndex = -1;
924
+ });
925
+ }
926
+
927
+ private selectedChange(event: CustomEvent<{ event: MouseEvent }>) {
928
+ const { event: clickEvent } = event.detail;
929
+ let optionIndex = this.findOptionIndex(clickEvent);
930
+ if (optionIndex !== -1) {
931
+ this.focusedIndex = this.allowSelectAll && this.checkForVirtualScroll() ? optionIndex + 1 : optionIndex;
932
+ if (this.isMulti && this.allowSelectAll && !this.checkForVirtualScroll()) {
933
+ optionIndex = optionIndex - 1;
934
+ }
935
+ const option = this.getFocusedItem(optionIndex);
936
+ this.setSelectedAttribute(option);
937
+ if (option) {
938
+ this.setSelectedOption(option);
939
+ if (!this.isMulti) {
940
+ this.setInputValue(this.getOptionValue(option));
941
+ this.input?.setAttribute(ATTRIBUTES.AriaActivedescendant, this.getOptionId(option));
942
+ } else if (this.isMulti && this.allowSelectAll) {
943
+ this.isSelectAllChecked = this.isSelectAllSelected();
944
+ }
945
+ }
946
+ }
947
+ }
948
+
949
+ private setSelectedAttribute(option: string | OptionMember | undefined) {
950
+ let optionId = "";
951
+ if (option) {
952
+ optionId = this.getOptionId(option);
953
+ }
954
+ this.lists?.forEach((list, _index) => {
955
+ if (list?.id === optionId) {
956
+ list?.setAttribute("selected", "true");
957
+ } else {
958
+ list?.setAttribute("selected", "false");
959
+ }
960
+ });
961
+ }
962
+
963
+ private shouldChangeButton() {
964
+ const shouldChange =
965
+ (this.input && this.input.value.length > 0 && !this.noClearIcon) ||
966
+ (this.isMulti && this.selectedOptions.length && !this.noClearIcon);
967
+ if (shouldChange) {
968
+ document.dispatchEvent(new CustomEvent("on-widget-update"));
969
+ }
970
+ return shouldChange;
971
+ }
972
+
973
+ private setCustomValue() {
974
+ if (!this.optionId && !this.optionValue) {
975
+ this.options = [...this.options, this.inputValue];
976
+
977
+ this.setSelectedOption(this.inputValue);
978
+
979
+ if (!this.isMulti) {
980
+ this.updateOnNextFrame(() => {
981
+ this.focusedIndex = this.filteredOptions.length - 1;
982
+ const option = this.getFocusedItem(this.focusedIndex);
983
+ if (option) {
984
+ this.setInputValue(this.getOptionValue(option));
985
+ this.input?.setAttribute(ATTRIBUTES.AriaActivedescendant, this.getOptionId(option));
986
+ }
987
+ });
988
+ }
989
+
990
+ this.dispatchEvent(
991
+ new CustomEvent("custom-value-add", {
992
+ composed: true,
993
+ bubbles: true,
994
+ detail: {
995
+ value: this.inputValue
996
+ }
997
+ })
998
+ );
999
+ }
1000
+ this.inputValue = "";
1001
+ }
1002
+
1003
+ handleGroupFocus() {
1004
+ this.setFocusOnHost(false);
1005
+ if (!this.expanded) {
1006
+ this.setVisualListbox(true);
1007
+ }
1008
+ if (this.filteredGroupOptions.length > 0 && this.focusedGroupIndex === -1) {
1009
+ this.focusedGroupIndex = this.filteredGroupOptions.findIndex((item) => {
1010
+ return typeof item !== "string" && item.groupName === this.groupExpandedList[0];
1011
+ });
1012
+ }
1013
+ this.updateOnNextFrame(() => {
1014
+ if (
1015
+ this.focusedGroupIndex === -1 ||
1016
+ (!this.allowSelectAll && this.focusedGroupIndex >= this.filteredGroupOptions.length - 1) ||
1017
+ (this.allowSelectAll && this.focusedGroupIndex >= this.filteredGroupOptions.length)
1018
+ ) {
1019
+ this.focusedGroupIndex = 0;
1020
+ } else {
1021
+ this.focusedGroupIndex++;
1022
+ }
1023
+ });
1024
+ this.focusedIndex = -1;
1025
+ }
1026
+
1027
+ handleInputKeyDown(event: KeyboardEvent) {
1028
+ switch (event.code) {
1029
+ case Key.Backspace:
1030
+ {
1031
+ this.focusedIndex = -1;
1032
+ }
1033
+ break;
1034
+ case Key.Tab:
1035
+ case Key.Enter:
1036
+ {
1037
+ this.setFocusOnHost(true);
1038
+ if (this.expanded) {
1039
+ this.updateOnNextFrame(() => {
1040
+ const option = this.getFocusedItem(!this.allowSelectAll ? this.focusedIndex : this.focusedIndex - 1);
1041
+ if (this.allowCustomValue && this.input && this.input.value.length) {
1042
+ const isOptionAlreadyExist = this.findFilteredOption(this.inputValue) === -1;
1043
+ if (isOptionAlreadyExist) {
1044
+ this.setCustomValue();
1045
+ return;
1046
+ }
1047
+ }
1048
+ if (option) {
1049
+ this.setSelectedAttribute(option);
1050
+ this.setSelectedOption(option);
1051
+ if (!this.showSelectedCount) {
1052
+ this.setInputValue(this.getOptionValue(option));
1053
+ this.input?.setAttribute(ATTRIBUTES.AriaActivedescendant, this.getOptionId(option));
1054
+ }
1055
+ }
1056
+ if (this.isMulti && this.allowSelectAll && this.focusedIndex === 0) {
1057
+ this.handleSelectAll();
1058
+ }
1059
+ });
1060
+ }
1061
+ this.setVisualListbox(false);
1062
+ if (event.code === Key.Tab && this.isMulti) {
1063
+ return;
1064
+ }
1065
+ }
1066
+ break;
1067
+ case Key.ArrowDown:
1068
+ {
1069
+ if (this.isOptGroup && this.filteredOptions.length === 0) {
1070
+ this.handleGroupFocus();
1071
+ return;
1072
+ }
1073
+ this.setFocusOnHost(false);
1074
+ if (!this.expanded) {
1075
+ this.setVisualListbox(true);
1076
+ }
1077
+ this.updateOnNextFrame(() => {
1078
+ if (
1079
+ this.focusedIndex === -1 ||
1080
+ (!this.allowSelectAll && this.focusedIndex >= this.filteredOptions.length - 1) ||
1081
+ (this.allowSelectAll && this.focusedIndex >= this.filteredOptions.length)
1082
+ ) {
1083
+ this.focusedIndex = 0;
1084
+ } else {
1085
+ this.focusedIndex++;
1086
+ }
1087
+ const option = this.getFocusedItem(this.focusedIndex);
1088
+ this.groupExpandedList = [this.getOptionGroupName(option)];
1089
+ if (!this.showSelectedCount && option) {
1090
+ this.setInputValue(this.getOptionValue(option));
1091
+ this.input?.setAttribute(ATTRIBUTES.AriaActivedescendant, this.getOptionId(option));
1092
+ }
1093
+ this.focusedGroupIndex = -1;
1094
+ });
1095
+ }
1096
+ break;
1097
+ case Key.ArrowUp:
1098
+ {
1099
+ if (this.isOptGroup && this.filteredOptions.length === 0) {
1100
+ this.handleGroupFocus();
1101
+ return;
1102
+ }
1103
+ this.setFocusOnHost(false);
1104
+ if (!this.expanded) {
1105
+ this.setVisualListbox(true);
1106
+ }
1107
+ this.updateOnNextFrame(() => {
1108
+ if (this.focusedIndex <= 0) {
1109
+ this.focusedIndex = !this.allowSelectAll
1110
+ ? this.filteredOptions.length - 1
1111
+ : this.filteredOptions.length;
1112
+ } else {
1113
+ this.focusedIndex--;
1114
+ }
1115
+ const option = this.getFocusedItem(this.focusedIndex);
1116
+ this.groupExpandedList = [this.getOptionGroupName(option)];
1117
+ if (option && !this.showSelectedCount) {
1118
+ this.setInputValue(this.getOptionValue(option));
1119
+ this.input?.setAttribute(ATTRIBUTES.AriaActivedescendant, this.getOptionId(option));
1120
+ this.focusedGroupIndex = -1;
1121
+ }
1122
+ });
1123
+ }
1124
+ break;
1125
+ case Key.ArrowLeft:
1126
+ case Key.ArrowRight:
1127
+ {
1128
+ event.stopPropagation();
1129
+ }
1130
+ break;
1131
+ case Key.Escape:
1132
+ {
1133
+ this.setFocusOnHost(true);
1134
+ if (this.expanded) {
1135
+ event.stopPropagation();
1136
+ this.setVisualListbox(false);
1137
+ } else {
1138
+ this.setInputValue();
1139
+ this.input?.setAttribute(ATTRIBUTES.AriaActivedescendant, "");
1140
+ this.focusedIndex = -1;
1141
+ this.focusedGroupIndex = -1;
1142
+ this.removeAllSelected();
1143
+ this.setSelectedAttribute(undefined);
1144
+ }
1145
+ }
1146
+ break;
1147
+ case Key.Home:
1148
+ {
1149
+ this.setInputSelectionRange(0, 0);
1150
+ }
1151
+ break;
1152
+ case Key.End:
1153
+ {
1154
+ const { length } = this.inputValue;
1155
+ this.setInputSelectionRange(length, length);
1156
+ }
1157
+ break;
1158
+ case Key.Space: {
1159
+ if (this.isMulti && this.expanded) {
1160
+ event.preventDefault();
1161
+ const option = this.getFocusedItem(!this.allowSelectAll ? this.focusedIndex : this.focusedIndex - 1);
1162
+ if (option) {
1163
+ this.setSelectedOption(option);
1164
+ this.setSelectedAttribute(option);
1165
+ if (!this.showSelectedCount) {
1166
+ this.setInputValue();
1167
+ this.input?.setAttribute(ATTRIBUTES.AriaActivedescendant, "");
1168
+ }
1169
+ }
1170
+ if (this.focusedIndex === 0 && this.allowSelectAll) {
1171
+ this.handleSelectAll();
1172
+ }
1173
+ }
1174
+ this.expanded = true;
1175
+ break;
1176
+ }
1177
+ default: {
1178
+ break;
1179
+ }
1180
+ }
1181
+ }
1182
+
1183
+ handleGroupLabelKeyDown(event: KeyboardEvent, option: OptionMember) {
1184
+ switch (event.code) {
1185
+ case Key.Tab:
1186
+ {
1187
+ this.handleGroupFocus();
1188
+ }
1189
+ break;
1190
+ case Key.Enter:
1191
+ case Key.Space:
1192
+ {
1193
+ if (this.focusedGroupIndex !== -1) {
1194
+ this.toggleGroupListBox(event, option.value);
1195
+ } else {
1196
+ this.setFocusOnHost(true);
1197
+ this.setVisualListbox(false);
1198
+ this.updateOnNextFrame(() => {
1199
+ const option = this.getFocusedItem(!this.allowSelectAll ? this.focusedIndex : this.focusedIndex - 1);
1200
+ if (option) {
1201
+ this.setSelectedOption(option);
1202
+ if (!this.showSelectedCount) {
1203
+ this.setInputValue(this.getOptionValue(option));
1204
+ this.input?.setAttribute(ATTRIBUTES.AriaActivedescendant, this.getOptionId(option));
1205
+ this.updateOnNextFrame(() => {
1206
+ this.input!.focus();
1207
+ this.focusedGroupIndex = -1;
1208
+ });
1209
+ }
1210
+ }
1211
+ if (this.isMulti && this.allowSelectAll && this.focusedIndex === 0) {
1212
+ this.handleSelectAll();
1213
+ }
1214
+ });
1215
+ }
1216
+ }
1217
+ break;
1218
+ case Key.ArrowDown:
1219
+ {
1220
+ if (this.filteredOptions.length === 0) {
1221
+ return;
1222
+ }
1223
+ this.setFocusOnHost(false);
1224
+ this.updateOnNextFrame(() => {
1225
+ if (
1226
+ this.focusedIndex === -1 ||
1227
+ (!this.allowSelectAll && this.focusedIndex >= this.filteredOptions.length - 1) ||
1228
+ (this.allowSelectAll && this.focusedIndex >= this.filteredOptions.length)
1229
+ ) {
1230
+ this.focusedIndex = 0;
1231
+ } else {
1232
+ this.focusedIndex++;
1233
+ }
1234
+ const option = this.getFocusedItem(this.focusedIndex);
1235
+ this.groupExpandedList = [this.getOptionGroupName(option)];
1236
+ if (!this.showSelectedCount && option) {
1237
+ this.setInputValue(this.getOptionValue(option));
1238
+ this.input?.setAttribute(ATTRIBUTES.AriaActivedescendant, this.getOptionId(option));
1239
+ }
1240
+ this.focusedGroupIndex = -1;
1241
+ });
1242
+ }
1243
+ break;
1244
+ case Key.ArrowUp:
1245
+ {
1246
+ if (this.isOptGroup && this.filteredOptions.length === 0) {
1247
+ return;
1248
+ }
1249
+ this.setFocusOnHost(false);
1250
+ this.updateOnNextFrame(() => {
1251
+ if (this.focusedIndex <= 0) {
1252
+ this.focusedIndex = !this.allowSelectAll
1253
+ ? this.filteredOptions.length - 1
1254
+ : this.filteredOptions.length;
1255
+ } else {
1256
+ this.focusedIndex--;
1257
+ }
1258
+ const item = this.getFocusedItem(this.focusedIndex);
1259
+ this.groupExpandedList = [this.getOptionGroupName(item)];
1260
+ if (item && !this.showSelectedCount) {
1261
+ this.setInputValue(this.getOptionValue(item));
1262
+ this.input?.setAttribute(ATTRIBUTES.AriaActivedescendant, this.getOptionId(item));
1263
+ }
1264
+ });
1265
+ }
1266
+ break;
1267
+ case Key.Escape:
1268
+ {
1269
+ this.focusedGroupIndex = -1;
1270
+ this.setVisualListbox(false);
1271
+ this.setFocusOnHost(true);
1272
+ this.input!.focus();
1273
+ }
1274
+ break;
1275
+ default: {
1276
+ this.setVisualListbox(true);
1277
+ break;
1278
+ }
1279
+ }
1280
+ }
1281
+
1282
+ toggleVisualListBox(e: any) {
1283
+ if (this.readOnly) {
1284
+ return;
1285
+ }
1286
+ if (e.target.classList.contains("md-combobox-listbox")) {
1287
+ e.target.focus();
1288
+ } else if (e.target.localName === "md-icon") {
1289
+ const parentElement = e.target.parentElement?.parentElement?.parentElement;
1290
+ if (parentElement) {
1291
+ const input = parentElement.querySelector(".md-combobox-listbox");
1292
+ setTimeout(() => {
1293
+ input.focus();
1294
+ }, 10);
1295
+ }
1296
+ }
1297
+ if (this.expanded) {
1298
+ this.setVisualListbox(false);
1299
+ } else {
1300
+ // While open combo-box
1301
+ this.dispatchEvent(
1302
+ new CustomEvent("combobox-on-expand", {
1303
+ composed: true,
1304
+ bubbles: true
1305
+ })
1306
+ );
1307
+ this.notifySearchResultCount();
1308
+ this.setVisualListbox(true);
1309
+ }
1310
+ this.input!.focus();
1311
+ this.setGroupList("");
1312
+ this.focusedGroupIndex = -1;
1313
+ }
1314
+
1315
+ toggleGroupListBox(e: Event, data: string) {
1316
+ e.stopPropagation();
1317
+ this.focusedGroupIndex = this.filteredGroupOptions.findIndex((item) => {
1318
+ return typeof item !== "string" && item.groupName === data;
1319
+ });
1320
+ this.setGroupList(data);
1321
+ this.resizeListbox();
1322
+ }
1323
+
1324
+ handleRemoveAll(event: MouseEvent) {
1325
+ event.stopPropagation();
1326
+ this.dispatchEvent(new CustomEvent("remove-all-selected"));
1327
+ }
1328
+
1329
+ handleOutsideClick = (event: MouseEvent) => {
1330
+ let insideInputClick = false;
1331
+ const path = event.composedPath();
1332
+ if (path.length) {
1333
+ insideInputClick = !!path.find((element) => element === this);
1334
+ if (!insideInputClick) {
1335
+ this.setVisualListbox(false);
1336
+ this.unselectedAllMultiTag();
1337
+ }
1338
+ }
1339
+ };
1340
+
1341
+ connectedCallback() {
1342
+ super.connectedCallback();
1343
+ this.setupEvents();
1344
+ const isOptGroup = this.querySelector("optgroup");
1345
+ if (isOptGroup) this.isOptGroup = true;
1346
+ }
1347
+
1348
+ disconnectedCallback() {
1349
+ super.disconnectedCallback();
1350
+ this.teardownEvents();
1351
+ }
1352
+
1353
+ static get styles() {
1354
+ return [reset, styles];
1355
+ }
1356
+
1357
+ get listItemOptionMap() {
1358
+ return {
1359
+ "md-combobox-multiselect": this.isMulti
1360
+ };
1361
+ }
1362
+
1363
+ get filteredOptions() {
1364
+ return this.filterOptions(this.trimSpace ? this.inputValue.replace(/\s+/g, "") : this.inputValue).filter(
1365
+ (options: string | OptionMember) => {
1366
+ if (this.isOptGroup) {
1367
+ if (typeof options !== "string" && this.groupExpandedList.includes(this.getOptionGroupName(options))) {
1368
+ return options.isLabel === "false";
1369
+ }
1370
+ } else {
1371
+ return true;
1372
+ }
1373
+ }
1374
+ );
1375
+ }
1376
+
1377
+ get filteredGroupOptions() {
1378
+ return this.filterOptions(this.trimSpace ? this.inputValue.replace(/\s+/g, "") : this.inputValue).filter(
1379
+ (options: string | OptionMember) => {
1380
+ if (this.isOptGroup) {
1381
+ if (typeof options !== "string") {
1382
+ return options.isLabel === "true";
1383
+ }
1384
+ } else {
1385
+ return true;
1386
+ }
1387
+ }
1388
+ );
1389
+ }
1390
+
1391
+ get comboBoxTemplateClassMap() {
1392
+ return {
1393
+ [`md-combobox--${this.shape}`]: !!this.shape,
1394
+ "md-combobox-searchable": this.searchable,
1395
+ "md-new-combobox": this.newMomentum,
1396
+ [`md-${this.messageType}`]: !!this.messageType,
1397
+ "md-combobox-readonly": this.readOnly
1398
+ };
1399
+ }
1400
+
1401
+ searchIconTemplate() {
1402
+ return html`
1403
+ <md-icon
1404
+ name="search-bold"
1405
+ class="search-icon"
1406
+ size="16"
1407
+ iconSet="momentumDesign"
1408
+ @click=${this.toggleVisualListBox}
1409
+ ></md-icon>
1410
+ `;
1411
+ }
1412
+
1413
+ selectedOptionTemplate(selectedOption: string | OptionMember) {
1414
+ return html`
1415
+ <div class="md-combobox-selected-item">
1416
+ <span>${this.getOptionValue(selectedOption)}</span>
1417
+ <md-icon
1418
+ class="remove-item"
1419
+ name="cancel-bold"
1420
+ size=${this.newMomentum ? "16" : "8"}
1421
+ iconSet="momentumDesign"
1422
+ @click=${() => this.removeSelected(selectedOption)}
1423
+ ></md-icon>
1424
+ </div>
1425
+ `;
1426
+ }
1427
+
1428
+ clearButtonTemplate() {
1429
+ return html`
1430
+ <button
1431
+ type="button"
1432
+ class="md-combobox-button clear"
1433
+ aria-label=${this.clearAriaLabel}
1434
+ aria-controls="md-combobox-listbox"
1435
+ tabindex="0"
1436
+ ?disabled=${this.disabled}
1437
+ ?readonly=${this.readOnly}
1438
+ @click=${this.handleRemoveAll}
1439
+ >
1440
+ <span>
1441
+ <md-icon
1442
+ class="md-input__icon-clear"
1443
+ name="cancel-bold"
1444
+ size="14"
1445
+ iconSet="momentumDesign"
1446
+ style="height: ${this.clearIconHeight};"
1447
+ ></md-icon
1448
+ ></span>
1449
+ </button>
1450
+ `;
1451
+ }
1452
+
1453
+ arrowButtonTemplate() {
1454
+ return html`
1455
+ <button
1456
+ type="button"
1457
+ class="md-combobox-button arrow-down"
1458
+ aria-expanded=${this.expanded}
1459
+ aria-label=${ifDefined(this.popupChevronAriaHidden === "true" ? undefined : this.arrowAriaLabel)}
1460
+ aria-controls="md-combobox-listbox"
1461
+ tabindex="-1"
1462
+ aria-hidden=${this.popupChevronAriaHidden}
1463
+ ?disabled=${this.disabled}
1464
+ ?readonly=${this.readOnly}
1465
+ @click=${this.toggleVisualListBox}
1466
+ >
1467
+ <span>
1468
+ <md-icon name="arrow-down-bold" size="16" iconSet="momentumDesign"></md-icon>
1469
+ </span>
1470
+ </button>
1471
+ `;
1472
+ }
1473
+
1474
+ groupArrowButtonTemplate(data: string) {
1475
+ const iconName = this.groupExpandedList.includes(data) ? "arrow-up-bold" : "arrow-down-bold";
1476
+ return html`
1477
+ <button
1478
+ type="button"
1479
+ class="md-combobox-button"
1480
+ aria-label=${ifDefined(this.popupChevronAriaHidden === "true" ? undefined : this.arrowAriaLabel)}
1481
+ aria-controls="md-combobox-listbox"
1482
+ tabindex="-1"
1483
+ aria-hidden=${this.popupChevronAriaHidden === "true" ? "true" : "false"}
1484
+ ?disabled=${this.disabled}
1485
+ ?readonly=${this.readOnly}
1486
+ @click=${(e: MouseEvent) => this.toggleGroupListBox(e, data)}
1487
+ >
1488
+ <span>
1489
+ <md-icon name=${iconName} size="12" iconSet="momentumDesign"></md-icon>
1490
+ </span>
1491
+ </button>
1492
+ `;
1493
+ }
1494
+
1495
+ getSelectAllOption() {
1496
+ const ariaLabelForCount = this.checkForVirtualScroll() ? `, 1 of ${this.options.length + 1}` : "";
1497
+ return html`
1498
+ <div
1499
+ id="selectAll"
1500
+ part="combobox-option"
1501
+ class="md-combobox-option ${classMap(this.listItemOptionMap)}"
1502
+ @click=${this.handleSelectAll}
1503
+ aria-label="${this.selectAllTextLocalization}${ariaLabelForCount}"
1504
+ aria-checked=${ifDefined(this.isSelectAllChecked ? "true" : undefined)}
1505
+ role="checkbox"
1506
+ >
1507
+ <span class="select-option" aria-hidden="true">
1508
+ <md-icon name="check-bold" size="14" iconSet="momentumDesign"></md-icon>
1509
+ </span>
1510
+
1511
+ <span part="label" class="select-label" aria-hidden="true">${this.selectAllTextLocalization}</span>
1512
+ </div>
1513
+ `;
1514
+ }
1515
+
1516
+ getSelctedCount() {
1517
+ if (this.selectedOptions.length === 0) {
1518
+ return nothing;
1519
+ } else if (this.isSelectAllSelected()) {
1520
+ return html` <span class="selected-count">${this.allTextLocalization}</span> `;
1521
+ }
1522
+ return html`
1523
+ <span class="selected-count">${this.selectedOptions.length} ${this.selectedTextLocalization}</span>
1524
+ `;
1525
+ }
1526
+ checkForVirtualScroll() {
1527
+ return this.useVirtualScroll && !this.isOptGroup;
1528
+ }
1529
+
1530
+ rangeChanged() {
1531
+ this.updateFocusedIndex(this.focusedIndex);
1532
+ this.checkSelectedOptions();
1533
+ this.resizeListbox();
1534
+ }
1535
+
1536
+ getCustomErrorContent() {
1537
+ const element = this.querySelector("[slot]") || this.shadowRoot!.querySelector("[slot]");
1538
+ return document.createRange().createContextualFragment(`${element?.outerHTML}`);
1539
+ }
1540
+
1541
+ getCustomContent(option: string | OptionMember) {
1542
+ const slotName = this.getCustomContentName(option);
1543
+ if (this.isOptGroup) {
1544
+ const slot = [...this.querySelectorAll(`[slot]`)].find((element) => element.slot === slotName);
1545
+ if (slot) {
1546
+ return document.createRange().createContextualFragment(`${slot.outerHTML}`);
1547
+ } else {
1548
+ return html``;
1549
+ }
1550
+ } else {
1551
+ return html` <slot name=${ifDefined(slotName)}></slot> `;
1552
+ }
1553
+ }
1554
+
1555
+ renderGroupLabelHeader(option: OptionMember, optionIndex: number) {
1556
+ return html`
1557
+ <div
1558
+ part="group-label"
1559
+ class="group-label"
1560
+ role="listbox"
1561
+ aria-controls="md-combobox-listbox"
1562
+ aria-label=${option.value}
1563
+ @click=${(e: MouseEvent) => this.toggleGroupListBox(e, option.value)}
1564
+ @keydown=${(e: KeyboardEvent) => {
1565
+ this.handleGroupLabelKeyDown(e, option);
1566
+ }}
1567
+ tabindex="1"
1568
+ aria-selected=${this.getAriaState(optionIndex)}
1569
+ >
1570
+ <span part="group-label">${option.value}</span>
1571
+ ${this.groupArrowButtonTemplate(option.value)}
1572
+ </div>
1573
+ `;
1574
+ }
1575
+
1576
+ renderWithoutVirtualScroll() {
1577
+ return repeat(
1578
+ this.filterOptions(this.trimSpace ? this.inputValue.replace(/\s+/g, "") : this.inputValue),
1579
+ (option: string | OptionMember) => this.getOptionId(option),
1580
+ (option: string | OptionMember, optionIndex) => {
1581
+ if (typeof option !== "string" && this.isOptGroup && option.isLabel === "true") {
1582
+ return this.renderGroupLabelHeader(option, optionIndex);
1583
+ } else if (!(this.isOptGroup && !this.groupExpandedList.includes(this.getOptionGroupName(option)))) {
1584
+ return this.renderItem(option, optionIndex);
1585
+ }
1586
+ }
1587
+ );
1588
+ }
1589
+
1590
+ highlightingSearchedText(option: OptionMember | string) {
1591
+ return findHighlight(
1592
+ this.getOptionValue(option),
1593
+ this.trimSpace ? this.inputValue.replace(/\s+/g, "") : this.inputValue
1594
+ ).map(({ text, matching }) =>
1595
+ matching
1596
+ ? html` <span class="highlight-text" part="select-label">${text}</span> `
1597
+ : html` <span class="selected-label-text" part="select-label">${text}</span> `
1598
+ );
1599
+ }
1600
+
1601
+ addStyle() {
1602
+ const isInvisible = this.expanded
1603
+ ? this.options.length && this.filteredOptions.length === 0 && this.inputValue && this.allowCustomValue
1604
+ : true;
1605
+ if (!this.checkForVirtualScroll()) {
1606
+ return styleMap({
1607
+ display: isInvisible ? "none" : "block",
1608
+ "z-index": "99",
1609
+ overflow: "auto"
1610
+ });
1611
+ } else {
1612
+ return styleMap({
1613
+ visibility: isInvisible ? "hidden" : "visible",
1614
+ "z-index": isInvisible ? "-1" : "99",
1615
+ overflow: "hidden"
1616
+ });
1617
+ }
1618
+ }
1619
+
1620
+ renderItem(option: OptionMember | string, index: number) {
1621
+ const count = this.allowSelectAll ? index + 2 : index + 1;
1622
+ const total = this.allowSelectAll ? this.options.length + 1 : this.options.length;
1623
+ const ariaLabelForCount = this.checkForVirtualScroll() ? `, ${count} of ${total}` : "";
1624
+ return html`
1625
+ <div
1626
+ id=${this.getOptionId(option)}
1627
+ title="${this.getOptionValue(option)}"
1628
+ part="combobox-option"
1629
+ class="md-combobox-option"
1630
+ aria-posinset=${count}
1631
+ aria-setsize=${total}
1632
+ role=${this.isMulti ? "checkbox" : "listitem"}
1633
+ aria-label="${this.isCustomContent
1634
+ ? this.getOptionId(option)
1635
+ : this.getOptionValue(option)}${ariaLabelForCount}"
1636
+ tabindex="-1"
1637
+ @click=${this.handleListClick}
1638
+ aria-checked=${ifDefined(this.isMulti ? this.isOptionChecked.call(this, option) : undefined)}
1639
+ >
1640
+ ${this.isMulti
1641
+ ? html`
1642
+ <span class="select-option" aria-hidden="true">
1643
+ <md-icon name="check-bold" size="14" iconSet="momentumDesign"></md-icon>
1644
+ </span>
1645
+ `
1646
+ : nothing}
1647
+ <span part="label" class="select-label" aria-hidden="true">
1648
+ ${this.isCustomContent ? this.getCustomContent(option) : this.highlightingSearchedText(option)}
1649
+ </span>
1650
+ </div>
1651
+ `;
1652
+ }
1653
+
1654
+ inputTitle() {
1655
+ if (this.isMulti) {
1656
+ // For multi select, The title should be the selected items count
1657
+ return this.selectedOptions.length > 0
1658
+ ? `${this.selectedOptions.length} ${this.selectedTextLocalization}`
1659
+ : this.placeholder;
1660
+ }
1661
+ return this.selectedOptions.length > 0 ? this.getOptionValue(this.selectedOptions[0]) : this.placeholder;
1662
+ }
1663
+
1664
+ helpTextTemplate() {
1665
+ return this.helpText
1666
+ ? html`
1667
+ <md-help-text
1668
+ class="help-text ${classMap({ disabled: this.disabled, newMomentum: this.newMomentum })}"
1669
+ .message=${this.helpText}
1670
+ style=${styleMap({ width: "100%" })}
1671
+ ></md-help-text>
1672
+ `
1673
+ : nothing;
1674
+ }
1675
+
1676
+ messagesTemplate() {
1677
+ return this.messages && !!this.messages.length
1678
+ ? html`
1679
+ <div id="${this.htmlId}-message" part="message" class="md-combobox__messages">
1680
+ ${repeat(this.messages, (message, id) => {
1681
+ return html`
1682
+ <md-help-text
1683
+ .message=${message}
1684
+ .id=${this.messageArr[id].id || ""}
1685
+ .ariaLive=${this.messageArr[id].ariaLive || "polite"}
1686
+ .messageType=${this.messageType as ComboBox.MessageType}
1687
+ ></md-help-text>
1688
+ `;
1689
+ })}
1690
+ </div>
1691
+ `
1692
+ : nothing;
1693
+ }
1694
+
1695
+ render() {
1696
+ return html`
1697
+ <div part="combobox" class="md-combobox md-combobox-list ${classMap(this.comboBoxTemplateClassMap)}">
1698
+ <div part="group" class="group ${classMap(this.listItemOptionMap)}">
1699
+ ${this.searchable ? this.searchIconTemplate() : nothing}
1700
+ <div class="md-combobox__multiwrap" part="multiwrap">
1701
+ ${this.isMulti
1702
+ ? this.isMulti && !this.showSelectedCount
1703
+ ? repeat(this.selectedOptions, (selectedOption) => this.selectedOptionTemplate(selectedOption))
1704
+ : this.getSelctedCount()
1705
+ : nothing}
1706
+ <input
1707
+ id=${ifDefined(this.comboboxId || undefined)}
1708
+ class="md-combobox-listbox"
1709
+ type="text"
1710
+ role="combobox"
1711
+ aria-autocomplete="both"
1712
+ aria-label=${this.ariaLabelForComboBox}
1713
+ part="multiwrap-input"
1714
+ aria-expanded=${this.expanded}
1715
+ placeholder=${this.isMulti && this.showSelectedCount && this.selectedOptions.length !== 0
1716
+ ? ""
1717
+ : this.placeholder}
1718
+ aria-controls="md-combobox-listbox"
1719
+ ?readonly=${this.allowSelectAll || this.readOnly}
1720
+ ?disabled=${this.disabled}
1721
+ ?autofocus=${this.autofocus}
1722
+ title=${ifDefined(this.inputTitle())}
1723
+ .value=${this.inputValue}
1724
+ @click=${this.toggleVisualListBox}
1725
+ @input=${this.handleInput}
1726
+ @keyup=${this.handleInputKeyUp}
1727
+ @keydown=${this.handleInputKeyDown}
1728
+ />
1729
+ </div>
1730
+ ${this.compact
1731
+ ? nothing
1732
+ : this.shouldChangeButton()
1733
+ ? this.clearButtonTemplate()
1734
+ : !this.newMomentum
1735
+ ? this.arrowButtonTemplate()
1736
+ : nothing}
1737
+ ${this.newMomentum
1738
+ ? html` <div class="md-combobox-right-arrow">${this.arrowButtonTemplate()}</div> `
1739
+ : nothing}
1740
+ </div>
1741
+
1742
+ ${this.showLoader || this.showCustomError
1743
+ ? html`
1744
+ <div
1745
+ id="md-combobox-listbox"
1746
+ part="combobox-options"
1747
+ aria-label=${this.ariaLabel}
1748
+ style=${styleMap({
1749
+ display: this.expanded ? "block" : "none",
1750
+ "z-index": "99"
1751
+ })}
1752
+ >
1753
+ ${this.getCustomErrorContent()}
1754
+ </div>
1755
+ `
1756
+ : html`
1757
+ <div
1758
+ id="md-combobox-listbox"
1759
+ part="combobox-options"
1760
+ aria-label=${this.ariaLabel || this.label}
1761
+ style=${this.addStyle()}
1762
+ role=${ifDefined(this.checkForVirtualScroll() ? undefined : "list")}
1763
+ >
1764
+ ${this.isMulti && this.allowSelectAll && this.expanded ? this.getSelectAllOption() : nothing}
1765
+ ${!this.checkForVirtualScroll()
1766
+ ? this.renderWithoutVirtualScroll()
1767
+ : this.options.length !== 0 &&
1768
+ this.filterOptions(this.trimSpace ? this.inputValue.replace(/\s+/g, "") : this.inputValue)
1769
+ .length > 0
1770
+ ? html`
1771
+ <div class="virtual-scroll" @rangechange=${this.rangeChanged}>
1772
+ ${scroll({
1773
+ items: this.filterOptions(
1774
+ this.trimSpace ? this.inputValue.replace(/\s+/g, "") : this.inputValue
1775
+ ),
1776
+ renderItem: (item: string | OptionMember, index?: number) =>
1777
+ this.renderItem(item, index || 0),
1778
+ useShadowDOM: false,
1779
+ scrollToIndex: {
1780
+ index: this.focusedIndex,
1781
+ position: this.focusedIndex === -1 ? "start" : "center"
1782
+ }
1783
+ })}
1784
+ </div>
1785
+ `
1786
+ : nothing}
1787
+ ${this.options.length &&
1788
+ this.filteredOptions.length === 0 &&
1789
+ this.inputValue &&
1790
+ !this.allowCustomValue
1791
+ ? html`
1792
+ <div class="no-result md-combobox-option" role="option" aria-selected="false" tabindex="-1">
1793
+ ${this.resultsTextLocalization.trim()}
1794
+ </div>
1795
+ `
1796
+ : nothing}
1797
+ ${this.options.length === 0
1798
+ ? html`
1799
+ <div class="no-result md-combobox-option" role="option" aria-selected="false" tabindex="-1">
1800
+ ${this.optionsTextLocalization.trim()}
1801
+ </div>
1802
+ `
1803
+ : nothing}
1804
+ </div>
1805
+ `}
1806
+ </div>
1807
+ ${this.invalid
1808
+ ? html`
1809
+ <div part="message" class="md-combobox-error ${classMap({ "md-new-combobox-error": this.newMomentum })}">
1810
+ <md-help-text .message=${this.invalidText} messageType="error"></md-help-text>
1811
+ </div>
1812
+ `
1813
+ : nothing}
1814
+ ${this.messagesTemplate()} ${this.helpTextTemplate()}
1815
+ `;
1816
+ }
1817
+ }
1818
+ }
1819
+
1820
+ declare global {
1821
+ interface HTMLElementTagNameMap {
1822
+ "md-combobox": ComboBox.ELEMENT;
1823
+ }
1824
+ }