@cds/core 6.2.2 → 6.2.4

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 (671) hide show
  1. package/accordion/accordion-content.element.js.map +1 -1
  2. package/accordion/accordion-header.element.js.map +1 -1
  3. package/accordion/accordion-panel.element.js.map +1 -1
  4. package/accordion/accordion.element.js.map +1 -1
  5. package/accordion/register.js.map +1 -1
  6. package/alert/alert-actions.element.js.map +1 -1
  7. package/alert/alert-group.element.js.map +1 -1
  8. package/alert/alert.element.js.map +1 -1
  9. package/alert/register.js.map +1 -1
  10. package/badge/badge.element.js.map +1 -1
  11. package/badge/register.js.map +1 -1
  12. package/breadcrumb/breadcrumb.element.js.map +1 -1
  13. package/breadcrumb/register.js.map +1 -1
  14. package/button/button.element.js.map +1 -1
  15. package/button/icon-button.element.js.map +1 -1
  16. package/button/register.js.map +1 -1
  17. package/button-action/button-action.element.js.map +1 -1
  18. package/button-action/register.js.map +1 -1
  19. package/button-expand/button-expand.element.js.map +1 -1
  20. package/button-expand/register.js.map +1 -1
  21. package/button-handle/button-handle.element.js.map +1 -1
  22. package/button-handle/register.js.map +1 -1
  23. package/button-inline/button-inline.element.js.map +1 -1
  24. package/button-inline/register.js.map +1 -1
  25. package/button-sort/button-sort.element.js.map +1 -1
  26. package/button-sort/register.js.map +1 -1
  27. package/button-sort/utils.js.map +1 -1
  28. package/card/card.element.js.map +1 -1
  29. package/card/register.js.map +1 -1
  30. package/checkbox/checkbox-group.element.js.map +1 -1
  31. package/checkbox/checkbox.element.js.map +1 -1
  32. package/checkbox/register.js.map +1 -1
  33. package/datalist/datalist.element.js.map +1 -1
  34. package/datalist/register.js.map +1 -1
  35. package/date/date.element.js.map +1 -1
  36. package/date/register.js.map +1 -1
  37. package/demo/data/demo.service.js.map +1 -1
  38. package/demo/data/food.data.js.map +1 -1
  39. package/demo/data/infrastructure.data.js.map +1 -1
  40. package/demo/data/system.data.js.map +1 -1
  41. package/demo/index.js.map +1 -1
  42. package/demo/utils.js.map +1 -1
  43. package/divider/divider.element.js.map +1 -1
  44. package/divider/register.js.map +1 -1
  45. package/dropdown/dropdown.element.js.map +1 -1
  46. package/dropdown/register.js.map +1 -1
  47. package/file/file.element.js.map +1 -1
  48. package/file/register.js.map +1 -1
  49. package/forms/control/control.element.js.map +1 -1
  50. package/forms/control-action/control-action.element.js.map +1 -1
  51. package/forms/control-group/control-group.element.js.map +1 -1
  52. package/forms/control-inline/control-inline.element.js +1 -1
  53. package/forms/control-inline/control-inline.element.js.map +1 -1
  54. package/forms/control-label/control-label.element.js.map +1 -1
  55. package/forms/control-message/control-message.element.js.map +1 -1
  56. package/forms/form-group/form-group.element.js.map +1 -1
  57. package/forms/register.js.map +1 -1
  58. package/forms/utils/utils.js.map +1 -1
  59. package/forms/utils/validate.js.map +1 -1
  60. package/global.css +18 -18
  61. package/grid/cell/grid-cell.element.js.map +1 -1
  62. package/grid/column/grid-column-position.controller.js.map +1 -1
  63. package/grid/column/grid-column-size.controller.js.map +1 -1
  64. package/grid/column/grid-column.element.js.map +1 -1
  65. package/grid/detail/grid-detail.element.js.map +1 -1
  66. package/grid/footer/grid-footer.element.js.map +1 -1
  67. package/grid/grid/grid-layout.controller.js.map +1 -1
  68. package/grid/grid/grid.element.js.map +1 -1
  69. package/grid/pagination/grid-pagination.element.js.map +1 -1
  70. package/grid/placeholder/grid-placeholder.element.js.map +1 -1
  71. package/grid/register.js.map +1 -1
  72. package/grid/row/grid-row-position.controller.js.map +1 -1
  73. package/grid/row/grid-row.element.js.map +1 -1
  74. package/icon/collections/chart.js.map +1 -1
  75. package/icon/collections/commerce.js.map +1 -1
  76. package/icon/collections/core.js.map +1 -1
  77. package/icon/collections/essential.js.map +1 -1
  78. package/icon/collections/media.js.map +1 -1
  79. package/icon/collections/mini.js.map +1 -1
  80. package/icon/collections/social.js.map +1 -1
  81. package/icon/collections/technology.js.map +1 -1
  82. package/icon/collections/text-edit.js.map +1 -1
  83. package/icon/collections/travel.js.map +1 -1
  84. package/icon/icon.element.js.map +1 -1
  85. package/icon/icon.renderer.js.map +1 -1
  86. package/icon/icon.service.js.map +1 -1
  87. package/icon/register.js.map +1 -1
  88. package/icon/shapes/accessibility-1.js.map +1 -1
  89. package/icon/shapes/accessibility-2.js.map +1 -1
  90. package/icon/shapes/add-text.js.map +1 -1
  91. package/icon/shapes/administrator.js.map +1 -1
  92. package/icon/shapes/airplane.js.map +1 -1
  93. package/icon/shapes/alarm-clock.js.map +1 -1
  94. package/icon/shapes/alarm-off.js.map +1 -1
  95. package/icon/shapes/align-bottom.js.map +1 -1
  96. package/icon/shapes/align-center.js.map +1 -1
  97. package/icon/shapes/align-left-text.js.map +1 -1
  98. package/icon/shapes/align-left.js.map +1 -1
  99. package/icon/shapes/align-middle.js.map +1 -1
  100. package/icon/shapes/align-right-text.js.map +1 -1
  101. package/icon/shapes/align-right.js.map +1 -1
  102. package/icon/shapes/align-top.js.map +1 -1
  103. package/icon/shapes/angle-double.js.map +1 -1
  104. package/icon/shapes/angle.js.map +1 -1
  105. package/icon/shapes/animation.js.map +1 -1
  106. package/icon/shapes/announcement.js.map +1 -1
  107. package/icon/shapes/application.js.map +1 -1
  108. package/icon/shapes/applications.js.map +1 -1
  109. package/icon/shapes/archive.js.map +1 -1
  110. package/icon/shapes/arrow-mini.js.map +1 -1
  111. package/icon/shapes/arrow.js.map +1 -1
  112. package/icon/shapes/assign-user.js.map +1 -1
  113. package/icon/shapes/asterisk.js.map +1 -1
  114. package/icon/shapes/atom.js.map +1 -1
  115. package/icon/shapes/axis-chart.js.map +1 -1
  116. package/icon/shapes/backup-restore.js.map +1 -1
  117. package/icon/shapes/backup.js.map +1 -1
  118. package/icon/shapes/ban.js.map +1 -1
  119. package/icon/shapes/bank.js.map +1 -1
  120. package/icon/shapes/bar-chart.js.map +1 -1
  121. package/icon/shapes/bar-code.js.map +1 -1
  122. package/icon/shapes/bars.js.map +1 -1
  123. package/icon/shapes/battery.js.map +1 -1
  124. package/icon/shapes/bell-curve.js.map +1 -1
  125. package/icon/shapes/bell.js.map +1 -1
  126. package/icon/shapes/beta.js.map +1 -1
  127. package/icon/shapes/bicycle.js.map +1 -1
  128. package/icon/shapes/birthday-cake.js.map +1 -1
  129. package/icon/shapes/bitcoin.js.map +1 -1
  130. package/icon/shapes/block-quote.js.map +1 -1
  131. package/icon/shapes/block.js.map +1 -1
  132. package/icon/shapes/blocks-group.js.map +1 -1
  133. package/icon/shapes/bluetooth-off.js.map +1 -1
  134. package/icon/shapes/bluetooth.js.map +1 -1
  135. package/icon/shapes/boat.js.map +1 -1
  136. package/icon/shapes/bold.js.map +1 -1
  137. package/icon/shapes/bolt.js.map +1 -1
  138. package/icon/shapes/book.js.map +1 -1
  139. package/icon/shapes/bookmark.js.map +1 -1
  140. package/icon/shapes/box-plot.js.map +1 -1
  141. package/icon/shapes/briefcase.js.map +1 -1
  142. package/icon/shapes/bubble-chart.js.map +1 -1
  143. package/icon/shapes/bubble-exclamation.js.map +1 -1
  144. package/icon/shapes/bug.js.map +1 -1
  145. package/icon/shapes/building.js.map +1 -1
  146. package/icon/shapes/bullet-list.js.map +1 -1
  147. package/icon/shapes/bullseye.js.map +1 -1
  148. package/icon/shapes/bundle.js.map +1 -1
  149. package/icon/shapes/calculator.js.map +1 -1
  150. package/icon/shapes/calendar-mini.js.map +1 -1
  151. package/icon/shapes/calendar.js.map +1 -1
  152. package/icon/shapes/camera.js.map +1 -1
  153. package/icon/shapes/campervan.js.map +1 -1
  154. package/icon/shapes/capacitor.js.map +1 -1
  155. package/icon/shapes/car.js.map +1 -1
  156. package/icon/shapes/caravan.js.map +1 -1
  157. package/icon/shapes/cd-dvd.js.map +1 -1
  158. package/icon/shapes/center-text.js.map +1 -1
  159. package/icon/shapes/certificate.js.map +1 -1
  160. package/icon/shapes/chat-bubble.js.map +1 -1
  161. package/icon/shapes/check-circle-mini.js.map +1 -1
  162. package/icon/shapes/check-circle.js.map +1 -1
  163. package/icon/shapes/check-mini.js.map +1 -1
  164. package/icon/shapes/check.js.map +1 -1
  165. package/icon/shapes/checkbox-list.js.map +1 -1
  166. package/icon/shapes/child-arrow.js.map +1 -1
  167. package/icon/shapes/ci-cd.js.map +1 -1
  168. package/icon/shapes/circle-arrow.js.map +1 -1
  169. package/icon/shapes/circle.js.map +1 -1
  170. package/icon/shapes/clipboard.js.map +1 -1
  171. package/icon/shapes/clock.js.map +1 -1
  172. package/icon/shapes/clone.js.map +1 -1
  173. package/icon/shapes/cloud-chart.js.map +1 -1
  174. package/icon/shapes/cloud-network.js.map +1 -1
  175. package/icon/shapes/cloud-scale.js.map +1 -1
  176. package/icon/shapes/cloud-traffic.js.map +1 -1
  177. package/icon/shapes/cloud.js.map +1 -1
  178. package/icon/shapes/cluster.js.map +1 -1
  179. package/icon/shapes/code.js.map +1 -1
  180. package/icon/shapes/cog.js.map +1 -1
  181. package/icon/shapes/coin-bag.js.map +1 -1
  182. package/icon/shapes/collapse-card.js.map +1 -1
  183. package/icon/shapes/color-palette.js.map +1 -1
  184. package/icon/shapes/color-picker.js.map +1 -1
  185. package/icon/shapes/compass.js.map +1 -1
  186. package/icon/shapes/computer.js.map +1 -1
  187. package/icon/shapes/connect.js.map +1 -1
  188. package/icon/shapes/container-volume.js.map +1 -1
  189. package/icon/shapes/container.js.map +1 -1
  190. package/icon/shapes/contract.js.map +1 -1
  191. package/icon/shapes/control-lun.js.map +1 -1
  192. package/icon/shapes/copy-to-clipboard.js.map +1 -1
  193. package/icon/shapes/copy.js.map +1 -1
  194. package/icon/shapes/cpu.js.map +1 -1
  195. package/icon/shapes/credit-card.js.map +1 -1
  196. package/icon/shapes/crosshairs.js.map +1 -1
  197. package/icon/shapes/crown.js.map +1 -1
  198. package/icon/shapes/cursor-arrow.js.map +1 -1
  199. package/icon/shapes/cursor-hand-click.js.map +1 -1
  200. package/icon/shapes/cursor-hand-grab.js.map +1 -1
  201. package/icon/shapes/cursor-hand-open.js.map +1 -1
  202. package/icon/shapes/cursor-hand.js.map +1 -1
  203. package/icon/shapes/cursor-move.js.map +1 -1
  204. package/icon/shapes/curve-chart.js.map +1 -1
  205. package/icon/shapes/dashboard.js.map +1 -1
  206. package/icon/shapes/data-cluster.js.map +1 -1
  207. package/icon/shapes/deploy.js.map +1 -1
  208. package/icon/shapes/detail-collapse.js.map +1 -1
  209. package/icon/shapes/detail-expand.js.map +1 -1
  210. package/icon/shapes/details.js.map +1 -1
  211. package/icon/shapes/devices.js.map +1 -1
  212. package/icon/shapes/digital-signature.js.map +1 -1
  213. package/icon/shapes/disconnect.js.map +1 -1
  214. package/icon/shapes/display.js.map +1 -1
  215. package/icon/shapes/dollar-bill.js.map +1 -1
  216. package/icon/shapes/dollar.js.map +1 -1
  217. package/icon/shapes/dot-circle.js.map +1 -1
  218. package/icon/shapes/download-cloud.js.map +1 -1
  219. package/icon/shapes/download.js.map +1 -1
  220. package/icon/shapes/drag-handle-corner.js.map +1 -1
  221. package/icon/shapes/drag-handle.js.map +1 -1
  222. package/icon/shapes/e-check.js.map +1 -1
  223. package/icon/shapes/ellipsis-horizontal.js.map +1 -1
  224. package/icon/shapes/ellipsis-vertical.js.map +1 -1
  225. package/icon/shapes/employee-group.js.map +1 -1
  226. package/icon/shapes/employee.js.map +1 -1
  227. package/icon/shapes/envelope.js.map +1 -1
  228. package/icon/shapes/eraser.js.map +1 -1
  229. package/icon/shapes/error-mini.js.map +1 -1
  230. package/icon/shapes/error-standard.js.map +1 -1
  231. package/icon/shapes/euro.js.map +1 -1
  232. package/icon/shapes/event-mini.js.map +1 -1
  233. package/icon/shapes/event.js.map +1 -1
  234. package/icon/shapes/exclamation-circle.js.map +1 -1
  235. package/icon/shapes/exclamation-triangle.js.map +1 -1
  236. package/icon/shapes/expand-card.js.map +1 -1
  237. package/icon/shapes/export.js.map +1 -1
  238. package/icon/shapes/eye-hide.js.map +1 -1
  239. package/icon/shapes/eye.js.map +1 -1
  240. package/icon/shapes/factory.js.map +1 -1
  241. package/icon/shapes/fast-forward.js.map +1 -1
  242. package/icon/shapes/ferry.js.map +1 -1
  243. package/icon/shapes/file-group.js.map +1 -1
  244. package/icon/shapes/file-settings.js.map +1 -1
  245. package/icon/shapes/file-share-2.js.map +1 -1
  246. package/icon/shapes/file-share.js.map +1 -1
  247. package/icon/shapes/file-zip.js.map +1 -1
  248. package/icon/shapes/file.js.map +1 -1
  249. package/icon/shapes/film-strip.js.map +1 -1
  250. package/icon/shapes/filter-2.js.map +1 -1
  251. package/icon/shapes/filter-grid-circle-mini.js.map +1 -1
  252. package/icon/shapes/filter-grid-circle.js.map +1 -1
  253. package/icon/shapes/filter-grid-mini.js.map +1 -1
  254. package/icon/shapes/filter-grid.js.map +1 -1
  255. package/icon/shapes/filter-off.js.map +1 -1
  256. package/icon/shapes/filter.js.map +1 -1
  257. package/icon/shapes/firewall.js.map +1 -1
  258. package/icon/shapes/first-aid.js.map +1 -1
  259. package/icon/shapes/fish.js.map +1 -1
  260. package/icon/shapes/flag.js.map +1 -1
  261. package/icon/shapes/flame.js.map +1 -1
  262. package/icon/shapes/flask.js.map +1 -1
  263. package/icon/shapes/floppy.js.map +1 -1
  264. package/icon/shapes/folder-open.js.map +1 -1
  265. package/icon/shapes/folder.js.map +1 -1
  266. package/icon/shapes/font-size.js.map +1 -1
  267. package/icon/shapes/forking.js.map +1 -1
  268. package/icon/shapes/form.js.map +1 -1
  269. package/icon/shapes/fuel.js.map +1 -1
  270. package/icon/shapes/gavel.js.map +1 -1
  271. package/icon/shapes/grid-chart.js.map +1 -1
  272. package/icon/shapes/grid-view.js.map +1 -1
  273. package/icon/shapes/half-star.js.map +1 -1
  274. package/icon/shapes/happy-face.js.map +1 -1
  275. package/icon/shapes/hard-disk.js.map +1 -1
  276. package/icon/shapes/hard-drive-disks.js.map +1 -1
  277. package/icon/shapes/hard-drive.js.map +1 -1
  278. package/icon/shapes/hashtag.js.map +1 -1
  279. package/icon/shapes/headphones.js.map +1 -1
  280. package/icon/shapes/heart-broken.js.map +1 -1
  281. package/icon/shapes/heart.js.map +1 -1
  282. package/icon/shapes/heat-map.js.map +1 -1
  283. package/icon/shapes/helix.js.map +1 -1
  284. package/icon/shapes/help-info.js.map +1 -1
  285. package/icon/shapes/help.js.map +1 -1
  286. package/icon/shapes/highlighter.js.map +1 -1
  287. package/icon/shapes/history.js.map +1 -1
  288. package/icon/shapes/home.js.map +1 -1
  289. package/icon/shapes/host-group.js.map +1 -1
  290. package/icon/shapes/host.js.map +1 -1
  291. package/icon/shapes/hourglass.js.map +1 -1
  292. package/icon/shapes/id-badge.js.map +1 -1
  293. package/icon/shapes/image-gallery.js.map +1 -1
  294. package/icon/shapes/image.js.map +1 -1
  295. package/icon/shapes/import.js.map +1 -1
  296. package/icon/shapes/inbox.js.map +1 -1
  297. package/icon/shapes/indent.js.map +1 -1
  298. package/icon/shapes/inductor.js.map +1 -1
  299. package/icon/shapes/info-circle-mini.js.map +1 -1
  300. package/icon/shapes/info-circle.js.map +1 -1
  301. package/icon/shapes/info-standard.js.map +1 -1
  302. package/icon/shapes/install.js.map +1 -1
  303. package/icon/shapes/internet-of-things.js.map +1 -1
  304. package/icon/shapes/italic.js.map +1 -1
  305. package/icon/shapes/justify-text.js.map +1 -1
  306. package/icon/shapes/key.js.map +1 -1
  307. package/icon/shapes/keyboard.js.map +1 -1
  308. package/icon/shapes/landscape.js.map +1 -1
  309. package/icon/shapes/language.js.map +1 -1
  310. package/icon/shapes/launchpad.js.map +1 -1
  311. package/icon/shapes/layers.js.map +1 -1
  312. package/icon/shapes/library.js.map +1 -1
  313. package/icon/shapes/lightbulb.js.map +1 -1
  314. package/icon/shapes/line-chart.js.map +1 -1
  315. package/icon/shapes/link.js.map +1 -1
  316. package/icon/shapes/list.js.map +1 -1
  317. package/icon/shapes/lock.js.map +1 -1
  318. package/icon/shapes/login.js.map +1 -1
  319. package/icon/shapes/logout.js.map +1 -1
  320. package/icon/shapes/map-marker.js.map +1 -1
  321. package/icon/shapes/map.js.map +1 -1
  322. package/icon/shapes/media-changer.js.map +1 -1
  323. package/icon/shapes/memory.js.map +1 -1
  324. package/icon/shapes/microphone-mute.js.map +1 -1
  325. package/icon/shapes/microphone.js.map +1 -1
  326. package/icon/shapes/minus-circle.js.map +1 -1
  327. package/icon/shapes/minus.js.map +1 -1
  328. package/icon/shapes/mobile.js.map +1 -1
  329. package/icon/shapes/moon.js.map +1 -1
  330. package/icon/shapes/mouse.js.map +1 -1
  331. package/icon/shapes/music-note.js.map +1 -1
  332. package/icon/shapes/namespace.js.map +1 -1
  333. package/icon/shapes/network-globe.js.map +1 -1
  334. package/icon/shapes/network-settings.js.map +1 -1
  335. package/icon/shapes/network-switch.js.map +1 -1
  336. package/icon/shapes/neutral-face.js.map +1 -1
  337. package/icon/shapes/new.js.map +1 -1
  338. package/icon/shapes/no-access.js.map +1 -1
  339. package/icon/shapes/no-wifi.js.map +1 -1
  340. package/icon/shapes/node-group.js.map +1 -1
  341. package/icon/shapes/node.js.map +1 -1
  342. package/icon/shapes/nodes.js.map +1 -1
  343. package/icon/shapes/note.js.map +1 -1
  344. package/icon/shapes/number-list.js.map +1 -1
  345. package/icon/shapes/nvme.js.map +1 -1
  346. package/icon/shapes/objects.js.map +1 -1
  347. package/icon/shapes/on-holiday.js.map +1 -1
  348. package/icon/shapes/organization.js.map +1 -1
  349. package/icon/shapes/outdent.js.map +1 -1
  350. package/icon/shapes/paint-roller.js.map +1 -1
  351. package/icon/shapes/paperclip.js.map +1 -1
  352. package/icon/shapes/paste.js.map +1 -1
  353. package/icon/shapes/pause.js.map +1 -1
  354. package/icon/shapes/pdf-file.js.map +1 -1
  355. package/icon/shapes/pencil.js.map +1 -1
  356. package/icon/shapes/peso.js.map +1 -1
  357. package/icon/shapes/phone-handset.js.map +1 -1
  358. package/icon/shapes/picture.js.map +1 -1
  359. package/icon/shapes/pie-chart.js.map +1 -1
  360. package/icon/shapes/piggy-bank.js.map +1 -1
  361. package/icon/shapes/pin.js.map +1 -1
  362. package/icon/shapes/pinboard.js.map +1 -1
  363. package/icon/shapes/play.js.map +1 -1
  364. package/icon/shapes/plugin.js.map +1 -1
  365. package/icon/shapes/plus-circle.js.map +1 -1
  366. package/icon/shapes/plus.js.map +1 -1
  367. package/icon/shapes/pod.js.map +1 -1
  368. package/icon/shapes/pop-out.js.map +1 -1
  369. package/icon/shapes/portrait.js.map +1 -1
  370. package/icon/shapes/pound.js.map +1 -1
  371. package/icon/shapes/power.js.map +1 -1
  372. package/icon/shapes/printer.js.map +1 -1
  373. package/icon/shapes/process-on-vm.js.map +1 -1
  374. package/icon/shapes/qr-code.js.map +1 -1
  375. package/icon/shapes/rack-server.js.map +1 -1
  376. package/icon/shapes/radar.js.map +1 -1
  377. package/icon/shapes/recycle.js.map +1 -1
  378. package/icon/shapes/redo.js.map +1 -1
  379. package/icon/shapes/refresh.js.map +1 -1
  380. package/icon/shapes/repeat.js.map +1 -1
  381. package/icon/shapes/replay-all.js.map +1 -1
  382. package/icon/shapes/replay-one.js.map +1 -1
  383. package/icon/shapes/resistor.js.map +1 -1
  384. package/icon/shapes/resize.js.map +1 -1
  385. package/icon/shapes/resource-pool.js.map +1 -1
  386. package/icon/shapes/rewind.js.map +1 -1
  387. package/icon/shapes/router.js.map +1 -1
  388. package/icon/shapes/ruble.js.map +1 -1
  389. package/icon/shapes/ruler-pencil.js.map +1 -1
  390. package/icon/shapes/rupee.js.map +1 -1
  391. package/icon/shapes/sad-face.js.map +1 -1
  392. package/icon/shapes/scatter-plot.js.map +1 -1
  393. package/icon/shapes/scissors.js.map +1 -1
  394. package/icon/shapes/script-execute.js.map +1 -1
  395. package/icon/shapes/script-schedule.js.map +1 -1
  396. package/icon/shapes/scroll.js.map +1 -1
  397. package/icon/shapes/search.js.map +1 -1
  398. package/icon/shapes/share.js.map +1 -1
  399. package/icon/shapes/shield-check.js.map +1 -1
  400. package/icon/shapes/shield-x.js.map +1 -1
  401. package/icon/shapes/shield.js.map +1 -1
  402. package/icon/shapes/shopping-bag.js.map +1 -1
  403. package/icon/shapes/shopping-cart.js.map +1 -1
  404. package/icon/shapes/shrink.js.map +1 -1
  405. package/icon/shapes/shuffle.js.map +1 -1
  406. package/icon/shapes/slider.js.map +1 -1
  407. package/icon/shapes/snowflake.js.map +1 -1
  408. package/icon/shapes/sort-by.js.map +1 -1
  409. package/icon/shapes/squid.js.map +1 -1
  410. package/icon/shapes/ssd.js.map +1 -1
  411. package/icon/shapes/star.js.map +1 -1
  412. package/icon/shapes/step-forward-2.js.map +1 -1
  413. package/icon/shapes/step-forward.js.map +1 -1
  414. package/icon/shapes/stop.js.map +1 -1
  415. package/icon/shapes/storage-adapter.js.map +1 -1
  416. package/icon/shapes/storage.js.map +1 -1
  417. package/icon/shapes/store.js.map +1 -1
  418. package/icon/shapes/strikethrough.js.map +1 -1
  419. package/icon/shapes/subscript.js.map +1 -1
  420. package/icon/shapes/success-standard.js.map +1 -1
  421. package/icon/shapes/sun.js.map +1 -1
  422. package/icon/shapes/superscript.js.map +1 -1
  423. package/icon/shapes/switch.js.map +1 -1
  424. package/icon/shapes/sync.js.map +1 -1
  425. package/icon/shapes/table.js.map +1 -1
  426. package/icon/shapes/tablet.js.map +1 -1
  427. package/icon/shapes/tag.js.map +1 -1
  428. package/icon/shapes/tags.js.map +1 -1
  429. package/icon/shapes/talk-bubbles.js.map +1 -1
  430. package/icon/shapes/tape-drive.js.map +1 -1
  431. package/icon/shapes/target.js.map +1 -1
  432. package/icon/shapes/tasks.js.map +1 -1
  433. package/icon/shapes/terminal.js.map +1 -1
  434. package/icon/shapes/text-color.js.map +1 -1
  435. package/icon/shapes/text.js.map +1 -1
  436. package/icon/shapes/thermometer.js.map +1 -1
  437. package/icon/shapes/thin-client.js.map +1 -1
  438. package/icon/shapes/thumbs-down.js.map +1 -1
  439. package/icon/shapes/thumbs-up.js.map +1 -1
  440. package/icon/shapes/tick-chart.js.map +1 -1
  441. package/icon/shapes/timeline.js.map +1 -1
  442. package/icon/shapes/times-circle.js.map +1 -1
  443. package/icon/shapes/times-mini.js.map +1 -1
  444. package/icon/shapes/times.js.map +1 -1
  445. package/icon/shapes/tools.js.map +1 -1
  446. package/icon/shapes/trailer.js.map +1 -1
  447. package/icon/shapes/trash.js.map +1 -1
  448. package/icon/shapes/tree-view.js.map +1 -1
  449. package/icon/shapes/tree.js.map +1 -1
  450. package/icon/shapes/truck.js.map +1 -1
  451. package/icon/shapes/two-way-arrows.js.map +1 -1
  452. package/icon/shapes/unarchive.js.map +1 -1
  453. package/icon/shapes/underline.js.map +1 -1
  454. package/icon/shapes/undo.js.map +1 -1
  455. package/icon/shapes/uninstall.js.map +1 -1
  456. package/icon/shapes/unknown-status.js.map +1 -1
  457. package/icon/shapes/unknown.js.map +1 -1
  458. package/icon/shapes/unlink.js.map +1 -1
  459. package/icon/shapes/unlock.js.map +1 -1
  460. package/icon/shapes/unpin.js.map +1 -1
  461. package/icon/shapes/update.js.map +1 -1
  462. package/icon/shapes/upload-cloud.js.map +1 -1
  463. package/icon/shapes/upload.js.map +1 -1
  464. package/icon/shapes/usb.js.map +1 -1
  465. package/icon/shapes/user.js.map +1 -1
  466. package/icon/shapes/users.js.map +1 -1
  467. package/icon/shapes/video-camera.js.map +1 -1
  468. package/icon/shapes/video-gallery.js.map +1 -1
  469. package/icon/shapes/view-cards.js.map +1 -1
  470. package/icon/shapes/view-columns.js.map +1 -1
  471. package/icon/shapes/view-list.js.map +1 -1
  472. package/icon/shapes/vm-bug-inverse.js.map +1 -1
  473. package/icon/shapes/vm-bug.js.map +1 -1
  474. package/icon/shapes/vm.js.map +1 -1
  475. package/icon/shapes/vmw-app.js.map +1 -1
  476. package/icon/shapes/volume-down.js.map +1 -1
  477. package/icon/shapes/volume-mute.js.map +1 -1
  478. package/icon/shapes/volume-up.js.map +1 -1
  479. package/icon/shapes/volume.js.map +1 -1
  480. package/icon/shapes/wallet.js.map +1 -1
  481. package/icon/shapes/wand.js.map +1 -1
  482. package/icon/shapes/warning-mini.js.map +1 -1
  483. package/icon/shapes/warning-standard.js.map +1 -1
  484. package/icon/shapes/wifi.js.map +1 -1
  485. package/icon/shapes/window-close.js.map +1 -1
  486. package/icon/shapes/window-max.js.map +1 -1
  487. package/icon/shapes/window-min.js.map +1 -1
  488. package/icon/shapes/window-restore.js.map +1 -1
  489. package/icon/shapes/won.js.map +1 -1
  490. package/icon/shapes/world.js.map +1 -1
  491. package/icon/shapes/wrench.js.map +1 -1
  492. package/icon/shapes/xls-file.js.map +1 -1
  493. package/icon/shapes/yen.js.map +1 -1
  494. package/icon/shapes/zoom-in.js.map +1 -1
  495. package/icon/shapes/zoom-out.js.map +1 -1
  496. package/icon/utils/icon.classnames.js.map +1 -1
  497. package/icon/utils/icon.svg-helpers.js.map +1 -1
  498. package/input/index.js.map +1 -1
  499. package/input/input-group.element.js.map +1 -1
  500. package/input/input.element.js.map +1 -1
  501. package/input/register.js.map +1 -1
  502. package/internal/base/button.base.js.map +1 -1
  503. package/internal/base/focus-trap.base.js.map +1 -1
  504. package/internal/controllers/active.controller.js.map +1 -1
  505. package/internal/controllers/aria-button.controller.js.map +1 -1
  506. package/internal/controllers/aria-disabled.controller.js.map +1 -1
  507. package/internal/controllers/aria-expanded.controller.js.map +1 -1
  508. package/internal/controllers/aria-grid.controller.js.map +1 -1
  509. package/internal/controllers/aria-modal.controller.js.map +1 -1
  510. package/internal/controllers/aria-multiselectable.controller.js.map +1 -1
  511. package/internal/controllers/aria-popup-trigger.controller.js.map +1 -1
  512. package/internal/controllers/aria-popup.controller.js.map +1 -1
  513. package/internal/controllers/aria-pressed.controller.js.map +1 -1
  514. package/internal/controllers/aria-selected.controller.js.map +1 -1
  515. package/internal/controllers/button-anchor.controller.js.map +1 -1
  516. package/internal/controllers/button-submit.controller.js.map +1 -1
  517. package/internal/controllers/closable.controller.js.map +1 -1
  518. package/internal/controllers/draggable-list.controller.js.map +1 -1
  519. package/internal/controllers/first-focus.controller.js.map +1 -1
  520. package/internal/controllers/grid-range-selection.controller.js.map +1 -1
  521. package/internal/controllers/inline-focus-trap.controller.js.map +1 -1
  522. package/internal/controllers/key-navigation-grid.controller.js.map +1 -1
  523. package/internal/controllers/key-navigation-list.controller.js.map +1 -1
  524. package/internal/controllers/key-navigation.utils.js.map +1 -1
  525. package/internal/controllers/layer.controller.js.map +1 -1
  526. package/internal/controllers/responsive.controller.js.map +1 -1
  527. package/internal/controllers/scrollable-list-visibility.controller.js.map +1 -1
  528. package/internal/controllers/touch.controller.js.map +1 -1
  529. package/internal/controllers/trigger.controller.js.map +1 -1
  530. package/internal/decorators/animate.js.map +1 -1
  531. package/internal/decorators/element.js.map +1 -1
  532. package/internal/decorators/event.js.map +1 -1
  533. package/internal/decorators/global-style.js.map +1 -1
  534. package/internal/decorators/i18n.js.map +1 -1
  535. package/internal/decorators/id.js.map +1 -1
  536. package/internal/decorators/property.js.map +1 -1
  537. package/internal/decorators/query-slot.js.map +1 -1
  538. package/internal/decorators/utils.js.map +1 -1
  539. package/internal/directives/spread-props.js.map +1 -1
  540. package/internal/i18n/utils.js.map +1 -1
  541. package/internal/index.js.map +1 -1
  542. package/internal/motion/animations/cds-accordion-panel-open.js.map +1 -1
  543. package/internal/motion/animations/cds-component-shake.js.map +1 -1
  544. package/internal/motion/animations/cds-dropdown-open.js.map +1 -1
  545. package/internal/motion/animations/cds-modal-enter.js.map +1 -1
  546. package/internal/motion/animations/cds-navigation-group-open.js.map +1 -1
  547. package/internal/motion/animations/cds-navigation-open.js.map +1 -1
  548. package/internal/motion/animations/cds-overlay-hinge-example.js.map +1 -1
  549. package/internal/motion/animations/cds-tree-item-expand.js.map +1 -1
  550. package/internal/motion/animations/keyframes/fade-in-and-slide-down.js.map +1 -1
  551. package/internal/motion/animations/keyframes/fade-in.js.map +1 -1
  552. package/internal/motion/animations/keyframes/hinge.js.map +1 -1
  553. package/internal/motion/animations/keyframes/shake.js.map +1 -1
  554. package/internal/motion/interfaces.js.map +1 -1
  555. package/internal/motion/motion.service.js.map +1 -1
  556. package/internal/motion/utils.js.map +1 -1
  557. package/internal/positioning/interfaces.js.map +1 -1
  558. package/internal/positioning/utils.js.map +1 -1
  559. package/internal/services/focus-trap-tracker.service.js.map +1 -1
  560. package/internal/services/global.service.js.map +1 -1
  561. package/internal/services/i18n.service.js.map +1 -1
  562. package/internal/services/keycodes.service.js.map +1 -1
  563. package/internal/services/log.service.js.map +1 -1
  564. package/internal/utils/__.js.map +1 -1
  565. package/internal/utils/a11y.js.map +1 -1
  566. package/internal/utils/array.js.map +1 -1
  567. package/internal/utils/async.js.map +1 -1
  568. package/internal/utils/browser.js.map +1 -1
  569. package/internal/utils/color.js.map +1 -1
  570. package/internal/utils/conditional.js.map +1 -1
  571. package/internal/utils/css.js.map +1 -1
  572. package/internal/utils/dom.js.map +1 -1
  573. package/internal/utils/enum.js.map +1 -1
  574. package/internal/utils/environment.js.map +1 -1
  575. package/internal/utils/event-subject.js.map +1 -1
  576. package/internal/utils/events.js.map +1 -1
  577. package/internal/utils/exists.js.map +1 -1
  578. package/internal/utils/focus.js.map +1 -1
  579. package/internal/utils/framework.js.map +1 -1
  580. package/internal/utils/global.js +1 -1
  581. package/internal/utils/global.js.map +1 -1
  582. package/internal/utils/identity.js.map +1 -1
  583. package/internal/utils/keycodes.js.map +1 -1
  584. package/internal/utils/lit.js.map +1 -1
  585. package/internal/utils/math.js.map +1 -1
  586. package/internal/utils/metadata.js.map +1 -1
  587. package/internal/utils/registration.js.map +1 -1
  588. package/internal/utils/responsive.js.map +1 -1
  589. package/internal/utils/size.js.map +1 -1
  590. package/internal/utils/string.js.map +1 -1
  591. package/internal/utils/supports.js.map +1 -1
  592. package/internal/utils/traversal.js.map +1 -1
  593. package/internal-components/close-button/close-button.element.js.map +1 -1
  594. package/internal-components/close-button/register.js.map +1 -1
  595. package/internal-components/overlay/overlay.element.js.map +1 -1
  596. package/internal-components/overlay/register.js.map +1 -1
  597. package/internal-components/panel/panel.element.js.map +1 -1
  598. package/internal-components/panel/register.js.map +1 -1
  599. package/internal-components/popup/pointer.element.js.map +1 -1
  600. package/internal-components/popup/popup.element.js.map +1 -1
  601. package/internal-components/popup/register.js.map +1 -1
  602. package/internal-components/popup/utils/pointer.utils.js.map +1 -1
  603. package/internal-components/split-handle/register.js.map +1 -1
  604. package/internal-components/split-handle/split-handle.element.js.map +1 -1
  605. package/internal-components/visual-checkbox/register.js.map +1 -1
  606. package/internal-components/visual-checkbox/visual-checkbox.element.js.map +1 -1
  607. package/list/list.css +2 -2
  608. package/modal/modal-actions.element.js.map +1 -1
  609. package/modal/modal-content.element.js.map +1 -1
  610. package/modal/modal-header-actions.element.js.map +1 -1
  611. package/modal/modal-header.element.js.map +1 -1
  612. package/modal/modal.element.js.map +1 -1
  613. package/modal/register.js.map +1 -1
  614. package/navigation/navigation-group.element.js.map +1 -1
  615. package/navigation/navigation-item.element.js.map +1 -1
  616. package/navigation/navigation-start.element.js.map +1 -1
  617. package/navigation/navigation.element.js.map +1 -1
  618. package/navigation/register.js.map +1 -1
  619. package/navigation/utils/utils.js.map +1 -1
  620. package/package.json +1 -1
  621. package/pagination/pagination-button.element.js.map +1 -1
  622. package/pagination/pagination.element.js.map +1 -1
  623. package/pagination/register.js.map +1 -1
  624. package/pagination/utils.js.map +1 -1
  625. package/password/password.element.js.map +1 -1
  626. package/password/register.js.map +1 -1
  627. package/polyfills/aria-reflect.js.map +1 -1
  628. package/polyfills/at.js.map +1 -1
  629. package/progress-circle/progress-circle.element.js.map +1 -1
  630. package/progress-circle/progress-circle.utils.js.map +1 -1
  631. package/progress-circle/register.js.map +1 -1
  632. package/radio/radio-group.element.js.map +1 -1
  633. package/radio/radio.element.js.map +1 -1
  634. package/radio/register.js.map +1 -1
  635. package/range/range.element.js.map +1 -1
  636. package/range/register.js.map +1 -1
  637. package/search/register.js.map +1 -1
  638. package/search/search.element.js.map +1 -1
  639. package/select/register.js.map +1 -1
  640. package/select/select.element.js.map +1 -1
  641. package/selection-panels/checkbox/checkbox-panel.element.js.map +1 -1
  642. package/selection-panels/checkbox/register.js.map +1 -1
  643. package/selection-panels/radio/radio-panel.element.js.map +1 -1
  644. package/selection-panels/radio/register.js.map +1 -1
  645. package/signpost/register.js.map +1 -1
  646. package/signpost/signpost.element.js.map +1 -1
  647. package/styles/module.layout.css +11 -11
  648. package/styles/module.reset.css +1 -1
  649. package/styles/module.typography.css +5 -5
  650. package/styles/shim.clr-ui.css +17 -2
  651. package/styles/shim.clr-ui.min.css +6 -2
  652. package/styles/theme.dark.css +1 -1
  653. package/styles/theme.high-contrast.css +2 -2
  654. package/styles/theme.low-motion.css +2 -2
  655. package/table/table.css +2 -2
  656. package/tag/register.js.map +1 -1
  657. package/tag/tag.element.js.map +1 -1
  658. package/test/utils.js.map +1 -1
  659. package/test/web-test-server.js.map +1 -1
  660. package/test-dropdown/register.js.map +1 -1
  661. package/test-dropdown/test-dropdown.element.js.map +1 -1
  662. package/textarea/register.js.map +1 -1
  663. package/textarea/textarea.element.js.map +1 -1
  664. package/time/register.js.map +1 -1
  665. package/time/time.element.js.map +1 -1
  666. package/toggle/register.js.map +1 -1
  667. package/toggle/toggle-group.element.js.map +1 -1
  668. package/toggle/toggle.element.js.map +1 -1
  669. package/tree-view/register.js.map +1 -1
  670. package/tree-view/tree-item.element.js.map +1 -1
  671. package/tree-view/tree.element.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"log.service.js","sources":["../../../../src/internal/services/log.service.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport { existsInWindow } from '../utils/exists.js';\nexport class LogService {\n static log(...args) {\n if (notProductionEnvironment() && notTestingEnvironment()) {\n console.log(...args);\n }\n }\n static warn(...args) {\n if (notProductionEnvironment() && notTestingEnvironment()) {\n console.warn(...args);\n }\n }\n static error(...args) {\n if (notProductionEnvironment() && notTestingEnvironment()) {\n console.error(...args);\n }\n }\n}\nfunction notTestingEnvironment() {\n return !existsInWindow(['jasmine']);\n}\nexport function notProductionEnvironment() {\n return !window.CDS.environment.production;\n}\n"],"names":["LogService","static","args","notProductionEnvironment","notTestingEnvironment","console","log","warn","error","existsInWindow","window","CDS","environment","production"],"mappings":"oDAMO,MAAMA,EACTC,cAAcC,GACNC,KAA8BC,KAC9BC,QAAQC,OAAOJ,GAGvBD,eAAeC,GACPC,KAA8BC,KAC9BC,QAAQE,QAAQL,GAGxBD,gBAAgBC,GACRC,KAA8BC,KAC9BC,QAAQG,SAASN,IAI7B,SAASE,IACL,OAAQK,EAAe,CAAC,YAErB,SAASN,IACZ,OAAQO,OAAOC,IAAIC,YAAYC"}
1
+ {"version":3,"file":"log.service.js","sources":["../../../../src/internal/services/log.service.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport { existsInWindow } from '../utils/exists.js';\nexport class LogService {\n static log(...args) {\n if (notProductionEnvironment() && notTestingEnvironment()) {\n console.log(...args);\n }\n }\n static warn(...args) {\n if (notProductionEnvironment() && notTestingEnvironment()) {\n console.warn(...args);\n }\n }\n static error(...args) {\n if (notProductionEnvironment() && notTestingEnvironment()) {\n console.error(...args);\n }\n }\n}\nfunction notTestingEnvironment() {\n return !existsInWindow(['jasmine']);\n}\nexport function notProductionEnvironment() {\n return !window.CDS.environment.production;\n}\n"],"names":["LogService","static","args","notProductionEnvironment","notTestingEnvironment","console","log","warn","error","existsInWindow","window","CDS","environment","production"],"mappings":"oDAMO,MAAMA,EACTC,cAAcC,GACNC,KAA8BC,KAC9BC,QAAQC,OAAOJ,GAGvBD,eAAeC,GACPC,KAA8BC,KAC9BC,QAAQE,QAAQL,GAGxBD,gBAAgBC,GACRC,KAA8BC,KAC9BC,QAAQG,SAASN,IAI7B,SAASE,IACL,OAAQK,EAAe,CAAC,YAErB,SAASN,IACZ,OAAQO,OAAOC,IAAIC,YAAYC"}
@@ -1 +1 @@
1
- {"version":3,"file":"__.js","sources":["../../../../src/internal/utils/__.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\n// due to import __ from 'ramda/es/__'; being untyped we can't import it properly\n// here is what it exports\nexport default { '@@functional/placeholder': true };\n"],"names":[],"mappings":"AAOA,MAAe,CAAE,4BAA4B"}
1
+ {"version":3,"file":"__.js","sources":["../../../../src/internal/utils/__.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\n// due to import __ from 'ramda/es/__'; being untyped we can't import it properly\n// here is what it exports\nexport default { '@@functional/placeholder': true };\n"],"names":[],"mappings":"AAOA,MAAe,CAAE,4BAA4B"}
@@ -1 +1 @@
1
- {"version":3,"file":"a11y.js","sources":["../../../../src/internal/utils/a11y.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport { createId } from './identity.js';\nimport { setAttributes } from './dom.js';\nexport function describeElementByElements(element, messages) {\n setAttributes(element, [\n 'aria-describedby',\n messages.length ? messages.map(m => (m.id = createId())).join(' ') : false,\n ]);\n}\nexport function hasAriaLabelTypeAttr(element) {\n return element.hasAttribute('aria-label') || element.hasAttribute('aria-labelledby');\n}\n"],"names":["describeElementByElements","element","messages","setAttributes","length","map","m","id","createId","join","hasAriaLabelTypeAttr","hasAttribute"],"mappings":"kFAOO,SAASA,EAA0BC,EAASC,GAC/CC,EAAcF,EAAS,CACnB,qBACAC,EAASE,QAASF,EAASG,KAAIC,GAAMA,EAAEC,GAAKC,MAAaC,KAAK,OAG/D,SAASC,EAAqBT,GACjC,OAAOA,EAAQU,aAAa,eAAiBV,EAAQU,aAAa"}
1
+ {"version":3,"file":"a11y.js","sources":["../../../../src/internal/utils/a11y.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport { createId } from './identity.js';\nimport { setAttributes } from './dom.js';\nexport function describeElementByElements(element, messages) {\n setAttributes(element, [\n 'aria-describedby',\n messages.length ? messages.map(m => (m.id = createId())).join(' ') : false,\n ]);\n}\nexport function hasAriaLabelTypeAttr(element) {\n return element.hasAttribute('aria-label') || element.hasAttribute('aria-labelledby');\n}\n"],"names":["describeElementByElements","element","messages","setAttributes","length","map","m","id","createId","join","hasAriaLabelTypeAttr","hasAttribute"],"mappings":"kFAOO,SAASA,EAA0BC,EAASC,GAC/CC,EAAcF,EAAS,CACnB,qBACAC,EAASE,QAASF,EAASG,KAAIC,GAAMA,EAAEC,GAAKC,MAAaC,KAAK,OAG/D,SAASC,EAAqBT,GACjC,OAAOA,EAAQU,aAAa,eAAiBV,EAAQU,aAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"array.js","sources":["../../../../src/internal/utils/array.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nexport function arrayToObject(arr, key) {\n return arr.reduce((obj, item) => {\n obj[item[key]] = item;\n return obj;\n }, {});\n}\nexport function arrayTail(arr) {\n return arr.length ? arr[arr.length - 1] : void 0;\n}\nexport function arrayHead(arr) {\n return arr.length ? arr[0] : void 0;\n}\nexport function previousInArray(current, arr) {\n const idx = arr.indexOf(current);\n return idx === -1 ? void 0 : arr[Math.max(idx - 1, 0)];\n}\nexport function nextInArray(current, arr) {\n const idx = arr.indexOf(current);\n return idx === -1 ? void 0 : arr[Math.min(idx + 1, arr.length - 1)];\n}\nexport function arrayRemoveFirstInstance(val, arr) {\n const newArr = Array.from(arr);\n const i = arr.indexOf(val);\n if (i > -1) {\n newArr.splice(i, 1);\n }\n return newArr;\n}\nexport function arrayRemoveLastInstance(val, arr) {\n const reversedArr = Array.from(arr).reverse();\n return arrayRemoveFirstInstance(val, reversedArr).reverse();\n}\nexport function arrayRemoveAllInstances(val, arr) {\n const arrayRemovalMachine = [].concat(val);\n return arr.filter(item => !arrayRemovalMachine.includes(item));\n}\nexport function groupArray(arr, size) {\n return [...arr].reduce((acc, val, i) => {\n const idx = Math.floor(i / size);\n const page = acc[idx] || (acc[idx] = []);\n page.push(val);\n return acc;\n }, []);\n}\nexport async function* asyncGroupArray(items, batch = 100) {\n const values = groupArray(items, batch);\n for (let i = 0; i < values.length; i++) {\n yield values[i];\n await new Promise(r => setTimeout(r, 0));\n }\n}\n"],"names":["arrayToObject","arr","key","reduce","obj","item","arrayTail","length","arrayHead","previousInArray","current","idx","indexOf","Math","max","nextInArray","min","arrayRemoveFirstInstance","val","newArr","Array","from","i","splice","arrayRemoveLastInstance","reverse","arrayRemoveAllInstances","arrayRemovalMachine","concat","filter","includes","groupArray","size","acc","floor","push","async","asyncGroupArray","items","batch","values","Promise","r","setTimeout"],"mappings":"AAKO,SAASA,EAAcC,EAAKC,GAC/B,OAAOD,EAAIE,QAAO,CAACC,EAAKC,KACpBD,EAAIC,EAAKH,IAAQG,EACVD,IACR,IAEA,SAASE,EAAUL,GACtB,OAAOA,EAAIM,OAASN,EAAIA,EAAIM,OAAS,QAAK,EAEvC,SAASC,EAAUP,GACtB,OAAOA,EAAIM,OAASN,EAAI,QAAK,EAE1B,SAASQ,EAAgBC,EAAST,GACrC,MAAMU,EAAMV,EAAIW,QAAQF,GACxB,OAAgB,IAATC,OAAa,EAASV,EAAIY,KAAKC,IAAIH,EAAM,EAAG,IAEhD,SAASI,EAAYL,EAAST,GACjC,MAAMU,EAAMV,EAAIW,QAAQF,GACxB,OAAgB,IAATC,OAAa,EAASV,EAAIY,KAAKG,IAAIL,EAAM,EAAGV,EAAIM,OAAS,IAE7D,SAASU,EAAyBC,EAAKjB,GAC1C,MAAMkB,EAASC,MAAMC,KAAKpB,GACpBqB,EAAIrB,EAAIW,QAAQM,GAItB,OAHII,GAAK,GACLH,EAAOI,OAAOD,EAAG,GAEdH,EAEJ,SAASK,EAAwBN,EAAKjB,GAEzC,OAAOgB,EAAyBC,EADZE,MAAMC,KAAKpB,GAAKwB,WACcA,UAE/C,SAASC,EAAwBR,EAAKjB,GACzC,MAAM0B,EAAsB,GAAGC,OAAOV,GACtC,OAAOjB,EAAI4B,QAAOxB,IAASsB,EAAoBG,SAASzB,KAErD,SAAS0B,EAAW9B,EAAK+B,GAC5B,MAAO,IAAI/B,GAAKE,QAAO,CAAC8B,EAAKf,EAAKI,KAC9B,MAAMX,EAAME,KAAKqB,MAAMZ,EAAIU,GAG3B,OAFaC,EAAItB,KAASsB,EAAItB,GAAO,KAChCwB,KAAKjB,GACHe,IACR,IAEAG,eAAgBC,EAAgBC,EAAOC,EAAQ,KAClD,MAAMC,EAAST,EAAWO,EAAOC,GACjC,IAAK,IAAIjB,EAAI,EAAGA,EAAIkB,EAAOjC,OAAQe,UACzBkB,EAAOlB,SACP,IAAImB,SAAQC,GAAKC,WAAWD,EAAG"}
1
+ {"version":3,"file":"array.js","sources":["../../../../src/internal/utils/array.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nexport function arrayToObject(arr, key) {\n return arr.reduce((obj, item) => {\n obj[item[key]] = item;\n return obj;\n }, {});\n}\nexport function arrayTail(arr) {\n return arr.length ? arr[arr.length - 1] : void 0;\n}\nexport function arrayHead(arr) {\n return arr.length ? arr[0] : void 0;\n}\nexport function previousInArray(current, arr) {\n const idx = arr.indexOf(current);\n return idx === -1 ? void 0 : arr[Math.max(idx - 1, 0)];\n}\nexport function nextInArray(current, arr) {\n const idx = arr.indexOf(current);\n return idx === -1 ? void 0 : arr[Math.min(idx + 1, arr.length - 1)];\n}\nexport function arrayRemoveFirstInstance(val, arr) {\n const newArr = Array.from(arr);\n const i = arr.indexOf(val);\n if (i > -1) {\n newArr.splice(i, 1);\n }\n return newArr;\n}\nexport function arrayRemoveLastInstance(val, arr) {\n const reversedArr = Array.from(arr).reverse();\n return arrayRemoveFirstInstance(val, reversedArr).reverse();\n}\nexport function arrayRemoveAllInstances(val, arr) {\n const arrayRemovalMachine = [].concat(val);\n return arr.filter(item => !arrayRemovalMachine.includes(item));\n}\nexport function groupArray(arr, size) {\n return [...arr].reduce((acc, val, i) => {\n const idx = Math.floor(i / size);\n const page = acc[idx] || (acc[idx] = []);\n page.push(val);\n return acc;\n }, []);\n}\nexport async function* asyncGroupArray(items, batch = 100) {\n const values = groupArray(items, batch);\n for (let i = 0; i < values.length; i++) {\n yield values[i];\n await new Promise(r => setTimeout(r, 0));\n }\n}\n"],"names":["arrayToObject","arr","key","reduce","obj","item","arrayTail","length","arrayHead","previousInArray","current","idx","indexOf","Math","max","nextInArray","min","arrayRemoveFirstInstance","val","newArr","Array","from","i","splice","arrayRemoveLastInstance","reverse","arrayRemoveAllInstances","arrayRemovalMachine","concat","filter","includes","groupArray","size","acc","floor","push","async","asyncGroupArray","items","batch","values","Promise","r","setTimeout"],"mappings":"AAKO,SAASA,EAAcC,EAAKC,GAC/B,OAAOD,EAAIE,QAAO,CAACC,EAAKC,KACpBD,EAAIC,EAAKH,IAAQG,EACVD,IACR,IAEA,SAASE,EAAUL,GACtB,OAAOA,EAAIM,OAASN,EAAIA,EAAIM,OAAS,QAAK,EAEvC,SAASC,EAAUP,GACtB,OAAOA,EAAIM,OAASN,EAAI,QAAK,EAE1B,SAASQ,EAAgBC,EAAST,GACrC,MAAMU,EAAMV,EAAIW,QAAQF,GACxB,OAAgB,IAATC,OAAa,EAASV,EAAIY,KAAKC,IAAIH,EAAM,EAAG,IAEhD,SAASI,EAAYL,EAAST,GACjC,MAAMU,EAAMV,EAAIW,QAAQF,GACxB,OAAgB,IAATC,OAAa,EAASV,EAAIY,KAAKG,IAAIL,EAAM,EAAGV,EAAIM,OAAS,IAE7D,SAASU,EAAyBC,EAAKjB,GAC1C,MAAMkB,EAASC,MAAMC,KAAKpB,GACpBqB,EAAIrB,EAAIW,QAAQM,GAItB,OAHII,GAAK,GACLH,EAAOI,OAAOD,EAAG,GAEdH,EAEJ,SAASK,EAAwBN,EAAKjB,GAEzC,OAAOgB,EAAyBC,EADZE,MAAMC,KAAKpB,GAAKwB,WACcA,UAE/C,SAASC,EAAwBR,EAAKjB,GACzC,MAAM0B,EAAsB,GAAGC,OAAOV,GACtC,OAAOjB,EAAI4B,QAAOxB,IAASsB,EAAoBG,SAASzB,KAErD,SAAS0B,EAAW9B,EAAK+B,GAC5B,MAAO,IAAI/B,GAAKE,QAAO,CAAC8B,EAAKf,EAAKI,KAC9B,MAAMX,EAAME,KAAKqB,MAAMZ,EAAIU,GAG3B,OAFaC,EAAItB,KAASsB,EAAItB,GAAO,KAChCwB,KAAKjB,GACHe,IACR,IAEAG,eAAgBC,EAAgBC,EAAOC,EAAQ,KAClD,MAAMC,EAAST,EAAWO,EAAOC,GACjC,IAAK,IAAIjB,EAAI,EAAGA,EAAIkB,EAAOjC,OAAQe,UACzBkB,EAAOlB,SACP,IAAImB,SAAQC,GAAKC,WAAWD,EAAG"}
@@ -1 +1 @@
1
- {"version":3,"file":"async.js","sources":["../../../../src/internal/utils/async.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\n/**\n * sleep() is used in animation code and also in some unit tests where async behavior needs to\n * be tested.\n *\n * Use sleep() inside an async function to delay execution for a short period of time.\n *\n * ```\n * async function ohai() {\n * await sleep(55); // delays execution by at least 55 ms\n * return 'ohai';\n * }\n * ```\n *\n * NOTE: the time sent to sleep is the MINIMUM time duration to execution. It is not and will not\n * be the exact time to execution.\n *\n */\nexport function sleep(millisecondsToWait = 10) {\n return new Promise(resolve => setTimeout(resolve, millisecondsToWait));\n}\n"],"names":["sleep","millisecondsToWait","Promise","resolve","setTimeout"],"mappings":"AAsBO,SAASA,EAAMC,EAAqB,IACvC,OAAO,IAAIC,SAAQC,GAAWC,WAAWD,EAASF"}
1
+ {"version":3,"file":"async.js","sources":["../../../../src/internal/utils/async.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\n/**\n * sleep() is used in animation code and also in some unit tests where async behavior needs to\n * be tested.\n *\n * Use sleep() inside an async function to delay execution for a short period of time.\n *\n * ```\n * async function ohai() {\n * await sleep(55); // delays execution by at least 55 ms\n * return 'ohai';\n * }\n * ```\n *\n * NOTE: the time sent to sleep is the MINIMUM time duration to execution. It is not and will not\n * be the exact time to execution.\n *\n */\nexport function sleep(millisecondsToWait = 10) {\n return new Promise(resolve => setTimeout(resolve, millisecondsToWait));\n}\n"],"names":["sleep","millisecondsToWait","Promise","resolve","setTimeout"],"mappings":"AAsBO,SAASA,EAAMC,EAAqB,IACvC,OAAO,IAAIC,SAAQC,GAAWC,WAAWD,EAASF"}
@@ -1 +1 @@
1
- {"version":3,"file":"browser.js","sources":["../../../../src/internal/utils/browser.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\n/**\n * Hacks/workarounds for specific browsers, only when absolutly needed\n */\n/** Used to detect safari for a11y behavior corrections */\nexport function isSafari() {\n return (navigator.vendor.match(/apple/i) || '').length > 0;\n}\n/** Used to detect Win for NVDA for a11y behavior corrections */\nexport function isWindows() {\n return (navigator.platform.match(/Win/i) || '').length > 0;\n}\n"],"names":["isSafari","navigator","vendor","match","length","isWindows","platform"],"mappings":"AASO,SAASA,IACZ,OAAQC,UAAUC,OAAOC,MAAM,WAAa,IAAIC,OAAS,EAGtD,SAASC,IACZ,OAAQJ,UAAUK,SAASH,MAAM,SAAW,IAAIC,OAAS"}
1
+ {"version":3,"file":"browser.js","sources":["../../../../src/internal/utils/browser.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\n/**\n * Hacks/workarounds for specific browsers, only when absolutly needed\n */\n/** Used to detect safari for a11y behavior corrections */\nexport function isSafari() {\n return (navigator.vendor.match(/apple/i) || '').length > 0;\n}\n/** Used to detect Win for NVDA for a11y behavior corrections */\nexport function isWindows() {\n return (navigator.platform.match(/Win/i) || '').length > 0;\n}\n"],"names":["isSafari","navigator","vendor","match","length","isWindows","platform"],"mappings":"AASO,SAASA,IACZ,OAAQC,UAAUC,OAAOC,MAAM,WAAa,IAAIC,OAAS,EAGtD,SAASC,IACZ,OAAQJ,UAAUK,SAASH,MAAM,SAAW,IAAIC,OAAS"}
@@ -1 +1 @@
1
- {"version":3,"file":"color.js","sources":["../../../../src/internal/utils/color.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nexport function hslToRgb(h, s, l) {\n s = s / 100;\n l = l / 100;\n const a = s * Math.min(l, 1 - l);\n const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n return [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)];\n}\nexport function rgbToHex(red, green, blue) {\n let r = red.toString(16);\n let g = green.toString(16);\n let b = blue.toString(16);\n if (r.length === 1) {\n r = '0' + r;\n }\n if (g.length === 1) {\n g = '0' + g;\n }\n if (b.length === 1) {\n b = '0' + b;\n }\n return `#${r}${g}${b}`;\n}\n"],"names":["hslToRgb","h","s","l","a","Math","min","f","n","k","max","round","rgbToHex","red","green","blue","r","toString","g","b","length"],"mappings":"AAKO,SAASA,EAASC,EAAGC,EAAGC,GAG3B,MAAMC,GAFNF,GAAQ,KAEMG,KAAKC,IADnBH,GAAQ,IACkB,EAAIA,GACxBI,EAAI,CAACC,EAAGC,GAAKD,EAAIP,EAAI,IAAM,KAAOE,EAAIC,EAAIC,KAAKK,IAAIL,KAAKC,IAAIG,EAAI,EAAG,EAAIA,EAAG,IAAK,GACrF,MAAO,CAACJ,KAAKM,MAAa,IAAPJ,EAAE,IAAWF,KAAKM,MAAa,IAAPJ,EAAE,IAAWF,KAAKM,MAAa,IAAPJ,EAAE,KAElE,SAASK,EAASC,EAAKC,EAAOC,GACjC,IAAIC,EAAIH,EAAII,SAAS,IACjBC,EAAIJ,EAAMG,SAAS,IACnBE,EAAIJ,EAAKE,SAAS,IAUtB,OATiB,IAAbD,EAAEI,SACFJ,EAAI,IAAMA,GAEG,IAAbE,EAAEE,SACFF,EAAI,IAAMA,GAEG,IAAbC,EAAEC,SACFD,EAAI,IAAMA,GAEP,IAAIH,IAAIE,IAAIC"}
1
+ {"version":3,"file":"color.js","sources":["../../../../src/internal/utils/color.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nexport function hslToRgb(h, s, l) {\n s = s / 100;\n l = l / 100;\n const a = s * Math.min(l, 1 - l);\n const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n return [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)];\n}\nexport function rgbToHex(red, green, blue) {\n let r = red.toString(16);\n let g = green.toString(16);\n let b = blue.toString(16);\n if (r.length === 1) {\n r = '0' + r;\n }\n if (g.length === 1) {\n g = '0' + g;\n }\n if (b.length === 1) {\n b = '0' + b;\n }\n return `#${r}${g}${b}`;\n}\n"],"names":["hslToRgb","h","s","l","a","Math","min","f","n","k","max","round","rgbToHex","red","green","blue","r","toString","g","b","length"],"mappings":"AAKO,SAASA,EAASC,EAAGC,EAAGC,GAG3B,MAAMC,GAFNF,GAAQ,KAEMG,KAAKC,IADnBH,GAAQ,IACkB,EAAIA,GACxBI,EAAI,CAACC,EAAGC,GAAKD,EAAIP,EAAI,IAAM,KAAOE,EAAIC,EAAIC,KAAKK,IAAIL,KAAKC,IAAIG,EAAI,EAAG,EAAIA,EAAG,IAAK,GACrF,MAAO,CAACJ,KAAKM,MAAa,IAAPJ,EAAE,IAAWF,KAAKM,MAAa,IAAPJ,EAAE,IAAWF,KAAKM,MAAa,IAAPJ,EAAE,KAElE,SAASK,EAASC,EAAKC,EAAOC,GACjC,IAAIC,EAAIH,EAAII,SAAS,IACjBC,EAAIJ,EAAMG,SAAS,IACnBE,EAAIJ,EAAKE,SAAS,IAUtB,OATiB,IAAbD,EAAEI,SACFJ,EAAI,IAAMA,GAEG,IAAbE,EAAEE,SACFF,EAAI,IAAMA,GAEG,IAAbC,EAAEC,SACFD,EAAI,IAAMA,GAEP,IAAIH,IAAIE,IAAIC"}
@@ -1 +1 @@
1
- {"version":3,"file":"conditional.js","sources":["../../../../src/internal/utils/conditional.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nexport function returnOrFallthrough(conditions, fallthrough) {\n const truthyCondition = conditions.find(cond => cond[0]() === true);\n if (truthyCondition) {\n return truthyCondition[1]();\n }\n return fallthrough();\n}\nexport function anyPassOrAnyFail(truths, untruths, fallthrough) {\n const mapOfTruth = truths.map((fn) => fn());\n if (mapOfTruth.indexOf(true) > -1) {\n return true;\n }\n const mapOfUntruth = untruths.map((fn) => fn());\n if (mapOfUntruth.indexOf(true) > -1) {\n return false;\n }\n return fallthrough;\n}\n"],"names":["returnOrFallthrough","conditions","fallthrough","truthyCondition","find","cond","anyPassOrAnyFail","truths","untruths","map","fn","indexOf"],"mappings":"AAKO,SAASA,EAAoBC,EAAYC,GAC5C,MAAMC,EAAkBF,EAAWG,MAAKC,IAAsB,IAAdA,EAAK,OACrD,OAAIF,EACOA,EAAgB,KAEpBD,IAEJ,SAASI,EAAiBC,EAAQC,EAAUN,GAE/C,OADmBK,EAAOE,KAAKC,GAAOA,MACvBC,SAAQ,IAAS,KAGXH,EAASC,KAAKC,GAAOA,MACzBC,SAAQ,IAAS,IAG3BT"}
1
+ {"version":3,"file":"conditional.js","sources":["../../../../src/internal/utils/conditional.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nexport function returnOrFallthrough(conditions, fallthrough) {\n const truthyCondition = conditions.find(cond => cond[0]() === true);\n if (truthyCondition) {\n return truthyCondition[1]();\n }\n return fallthrough();\n}\nexport function anyPassOrAnyFail(truths, untruths, fallthrough) {\n const mapOfTruth = truths.map((fn) => fn());\n if (mapOfTruth.indexOf(true) > -1) {\n return true;\n }\n const mapOfUntruth = untruths.map((fn) => fn());\n if (mapOfUntruth.indexOf(true) > -1) {\n return false;\n }\n return fallthrough;\n}\n"],"names":["returnOrFallthrough","conditions","fallthrough","truthyCondition","find","cond","anyPassOrAnyFail","truths","untruths","map","fn","indexOf"],"mappings":"AAKO,SAASA,EAAoBC,EAAYC,GAC5C,MAAMC,EAAkBF,EAAWG,MAAKC,IAAsB,IAAdA,EAAK,OACrD,OAAIF,EACOA,EAAgB,KAEpBD,IAEJ,SAASI,EAAiBC,EAAQC,EAAUN,GAE/C,OADmBK,EAAOE,KAAKC,GAAOA,MACvBC,SAAQ,IAAS,KAGXH,EAASC,KAAKC,GAAOA,MACzBC,SAAQ,IAAS,IAG3BT"}
@@ -1 +1 @@
1
- {"version":3,"file":"css.js","sources":["../../../../src/internal/utils/css.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport { LogService } from '../services/log.service.js';\nimport { isString } from './identity.js';\nexport function hasClassnames(el, ...classNames) {\n return classNames.filter((cn) => el.classList.contains(cn)).length === classNames.length;\n}\nexport function addClassnames(el, ...classNames) {\n classNames.forEach((cn) => {\n el.classList.add(cn);\n });\n return el;\n}\nexport function removeClassnames(el, ...classNames) {\n classNames.forEach((cn) => {\n el.classList.remove(cn);\n });\n return el;\n}\nexport function removeClassnamesUnless(el, classnamesToRemove, classnamesToKeep) {\n const filteredClassnamesToRemove = classnamesToRemove.filter(cn => classnamesToKeep.indexOf(cn) < 0);\n return removeClassnames(el, ...filteredClassnamesToRemove);\n}\nexport function updateElementStyles(el, ...styleTuples) {\n styleTuples.forEach(([styleKey, value]) => {\n el.style[styleKey] = value;\n });\n return el;\n}\nexport function unsetElementStyles(el, ...styleProperties) {\n styleProperties.forEach(prop => {\n el.style[prop] = '';\n });\n return el;\n}\nexport function pxToRem(pxValue) {\n return `calc((${pxValue} / var(--cds-global-base)) * 1rem)`;\n}\nexport function getCssPropertyValue(propertyName, el = document.body, pseudoSelectorModifier = null) {\n try {\n return getComputedStyle(el, pseudoSelectorModifier).getPropertyValue(propertyName).trim();\n }\n catch (e) {\n LogService.warn('Container element passed to getCustomPropertyValue must be an element.');\n return '';\n }\n}\nexport function setCssPropertyValue(propertyName, value, el = document.body) {\n try {\n if (value === '' || value === null || value === false) {\n el.style.removeProperty(propertyName);\n }\n else {\n el.style.setProperty(propertyName, value);\n }\n }\n catch (e) {\n LogService.warn('Container element passed to getCustomPropertyValue must be an element.');\n }\n}\nexport function isCssPropertyName(str) {\n return !!str && isString(str) && str.slice(0, 2) === '--';\n}\nexport function supportsAdoptingStyleSheets() {\n return (window.ShadowRoot &&\n (window.ShadyCSS === undefined || window.ShadyCSS.nativeShadow) &&\n 'adoptedStyleSheets' in Document.prototype &&\n 'replace' in CSSStyleSheet.prototype);\n}\n"],"names":["hasClassnames","el","classNames","filter","cn","classList","contains","length","addClassnames","forEach","add","removeClassnames","remove","removeClassnamesUnless","classnamesToRemove","classnamesToKeep","indexOf","updateElementStyles","styleTuples","styleKey","value","style","unsetElementStyles","styleProperties","prop","pxToRem","pxValue","getCssPropertyValue","propertyName","document","body","pseudoSelectorModifier","getComputedStyle","getPropertyValue","trim","e","LogService","warn","setCssPropertyValue","removeProperty","setProperty","isCssPropertyName","str","isString","slice","supportsAdoptingStyleSheets","window","ShadowRoot","undefined","ShadyCSS","nativeShadow","Document","prototype","CSSStyleSheet"],"mappings":"iGAOO,SAASA,EAAcC,KAAOC,GACjC,OAAOA,EAAWC,QAAQC,GAAOH,EAAGI,UAAUC,SAASF,KAAKG,SAAWL,EAAWK,OAE/E,SAASC,EAAcP,KAAOC,GAIjC,OAHAA,EAAWO,SAASL,IAChBH,EAAGI,UAAUK,IAAIN,MAEdH,EAEJ,SAASU,EAAiBV,KAAOC,GAIpC,OAHAA,EAAWO,SAASL,IAChBH,EAAGI,UAAUO,OAAOR,MAEjBH,EAEJ,SAASY,EAAuBZ,EAAIa,EAAoBC,GAE3D,OAAOJ,EAAiBV,KADWa,EAAmBX,QAAOC,GAAMW,EAAiBC,QAAQZ,GAAM,KAG/F,SAASa,EAAoBhB,KAAOiB,GAIvC,OAHAA,EAAYT,SAAQ,EAAEU,EAAUC,MAC5BnB,EAAGoB,MAAMF,GAAYC,KAElBnB,EAEJ,SAASqB,EAAmBrB,KAAOsB,GAItC,OAHAA,EAAgBd,SAAQe,IACpBvB,EAAGoB,MAAMG,GAAQ,MAEdvB,EAEJ,SAASwB,EAAQC,GACpB,MAAO,SAASA,sCAEb,SAASC,EAAoBC,EAAc3B,EAAK4B,SAASC,KAAMC,EAAyB,MAC3F,IACI,OAAOC,iBAAiB/B,EAAI8B,GAAwBE,iBAAiBL,GAAcM,OAEvF,MAAOC,GAEH,OADAC,EAAWC,KAAK,0EACT,IAGR,SAASC,EAAoBV,EAAcR,EAAOnB,EAAK4B,SAASC,MACnE,IACkB,KAAVV,GAA0B,OAAVA,IAA4B,IAAVA,EAClCnB,EAAGoB,MAAMkB,eAAeX,GAGxB3B,EAAGoB,MAAMmB,YAAYZ,EAAcR,GAG3C,MAAOe,GACHC,EAAWC,KAAK,2EAGjB,SAASI,EAAkBC,GAC9B,QAASA,GAAOC,EAASD,IAA4B,OAApBA,EAAIE,MAAM,EAAG,GAE3C,SAASC,IACZ,OAAQC,OAAOC,kBACUC,IAApBF,OAAOG,UAA0BH,OAAOG,SAASC,eAClD,uBAAwBC,SAASC,WACjC,YAAaC,cAAcD"}
1
+ {"version":3,"file":"css.js","sources":["../../../../src/internal/utils/css.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport { LogService } from '../services/log.service.js';\nimport { isString } from './identity.js';\nexport function hasClassnames(el, ...classNames) {\n return classNames.filter((cn) => el.classList.contains(cn)).length === classNames.length;\n}\nexport function addClassnames(el, ...classNames) {\n classNames.forEach((cn) => {\n el.classList.add(cn);\n });\n return el;\n}\nexport function removeClassnames(el, ...classNames) {\n classNames.forEach((cn) => {\n el.classList.remove(cn);\n });\n return el;\n}\nexport function removeClassnamesUnless(el, classnamesToRemove, classnamesToKeep) {\n const filteredClassnamesToRemove = classnamesToRemove.filter(cn => classnamesToKeep.indexOf(cn) < 0);\n return removeClassnames(el, ...filteredClassnamesToRemove);\n}\nexport function updateElementStyles(el, ...styleTuples) {\n styleTuples.forEach(([styleKey, value]) => {\n el.style[styleKey] = value;\n });\n return el;\n}\nexport function unsetElementStyles(el, ...styleProperties) {\n styleProperties.forEach(prop => {\n el.style[prop] = '';\n });\n return el;\n}\nexport function pxToRem(pxValue) {\n return `calc((${pxValue} / var(--cds-global-base)) * 1rem)`;\n}\nexport function getCssPropertyValue(propertyName, el = document.body, pseudoSelectorModifier = null) {\n try {\n return getComputedStyle(el, pseudoSelectorModifier).getPropertyValue(propertyName).trim();\n }\n catch (e) {\n LogService.warn('Container element passed to getCustomPropertyValue must be an element.');\n return '';\n }\n}\nexport function setCssPropertyValue(propertyName, value, el = document.body) {\n try {\n if (value === '' || value === null || value === false) {\n el.style.removeProperty(propertyName);\n }\n else {\n el.style.setProperty(propertyName, value);\n }\n }\n catch (e) {\n LogService.warn('Container element passed to getCustomPropertyValue must be an element.');\n }\n}\nexport function isCssPropertyName(str) {\n return !!str && isString(str) && str.slice(0, 2) === '--';\n}\nexport function supportsAdoptingStyleSheets() {\n return (window.ShadowRoot &&\n (window.ShadyCSS === undefined || window.ShadyCSS.nativeShadow) &&\n 'adoptedStyleSheets' in Document.prototype &&\n 'replace' in CSSStyleSheet.prototype);\n}\n"],"names":["hasClassnames","el","classNames","filter","cn","classList","contains","length","addClassnames","forEach","add","removeClassnames","remove","removeClassnamesUnless","classnamesToRemove","classnamesToKeep","indexOf","updateElementStyles","styleTuples","styleKey","value","style","unsetElementStyles","styleProperties","prop","pxToRem","pxValue","getCssPropertyValue","propertyName","document","body","pseudoSelectorModifier","getComputedStyle","getPropertyValue","trim","e","LogService","warn","setCssPropertyValue","removeProperty","setProperty","isCssPropertyName","str","isString","slice","supportsAdoptingStyleSheets","window","ShadowRoot","undefined","ShadyCSS","nativeShadow","Document","prototype","CSSStyleSheet"],"mappings":"iGAOO,SAASA,EAAcC,KAAOC,GACjC,OAAOA,EAAWC,QAAQC,GAAOH,EAAGI,UAAUC,SAASF,KAAKG,SAAWL,EAAWK,OAE/E,SAASC,EAAcP,KAAOC,GAIjC,OAHAA,EAAWO,SAASL,IAChBH,EAAGI,UAAUK,IAAIN,MAEdH,EAEJ,SAASU,EAAiBV,KAAOC,GAIpC,OAHAA,EAAWO,SAASL,IAChBH,EAAGI,UAAUO,OAAOR,MAEjBH,EAEJ,SAASY,EAAuBZ,EAAIa,EAAoBC,GAE3D,OAAOJ,EAAiBV,KADWa,EAAmBX,QAAOC,GAAMW,EAAiBC,QAAQZ,GAAM,KAG/F,SAASa,EAAoBhB,KAAOiB,GAIvC,OAHAA,EAAYT,SAAQ,EAAEU,EAAUC,MAC5BnB,EAAGoB,MAAMF,GAAYC,KAElBnB,EAEJ,SAASqB,EAAmBrB,KAAOsB,GAItC,OAHAA,EAAgBd,SAAQe,IACpBvB,EAAGoB,MAAMG,GAAQ,MAEdvB,EAEJ,SAASwB,EAAQC,GACpB,MAAO,SAASA,sCAEb,SAASC,EAAoBC,EAAc3B,EAAK4B,SAASC,KAAMC,EAAyB,MAC3F,IACI,OAAOC,iBAAiB/B,EAAI8B,GAAwBE,iBAAiBL,GAAcM,OAEvF,MAAOC,GAEH,OADAC,EAAWC,KAAK,0EACT,IAGR,SAASC,EAAoBV,EAAcR,EAAOnB,EAAK4B,SAASC,MACnE,IACkB,KAAVV,GAA0B,OAAVA,IAA4B,IAAVA,EAClCnB,EAAGoB,MAAMkB,eAAeX,GAGxB3B,EAAGoB,MAAMmB,YAAYZ,EAAcR,GAG3C,MAAOe,GACHC,EAAWC,KAAK,2EAGjB,SAASI,EAAkBC,GAC9B,QAASA,GAAOC,EAASD,IAA4B,OAApBA,EAAIE,MAAM,EAAG,GAE3C,SAASC,IACZ,OAAQC,OAAOC,kBACUC,IAApBF,OAAOG,UAA0BH,OAAOG,SAASC,eAClD,uBAAwBC,SAASC,WACjC,YAAaC,cAAcD"}
@@ -1 +1 @@
1
- {"version":3,"file":"dom.js","sources":["../../../../src/internal/utils/dom.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport includes from 'ramda/es/includes.js';\nimport without from 'ramda/es/without.js';\nimport { getCssPropertyValue } from './css.js';\nimport { pluckPixelValue, transformSpacedStringToArray } from './string.js';\nimport { isNumericString, isStringAndNotNilOrEmpty } from './identity.js';\n/**\n * We are not going to be opinionated about the use of the disabled attribute here.\n * Browsers will manage that on their own. The focus of this is to determine whether\n * or not a tabindex should be set on an element to make it programmatically\n * focusable.\n *\n */\nexport function isFocusable(element) {\n /* c8 ignore next 21 */\n switch (element.tagName.toLowerCase()) {\n case 'input':\n return (element.getAttribute('type') !== 'hidden' &&\n !element.hasAttribute('disabled') &&\n !element.hasAttribute('readonly'));\n case 'button':\n case 'select':\n case 'textarea':\n return !element.hasAttribute('disabled');\n case 'iframe':\n case 'embed':\n case 'object':\n return true;\n case 'a':\n case 'area':\n return element.hasAttribute('href');\n case 'audio':\n case 'video':\n return element.hasAttribute('controls');\n default:\n // we are not going to get into invalid values sent to the\n // tabindex attr. users have control of that and should avoid\n // setting tabindex to weird/unsupported values.\n return (element.hasAttribute('tabindex') ||\n element.getAttribute('contenteditable') === 'true' ||\n (element.getAttribute('role') === 'button' && !element.hasAttribute('disabled')));\n }\n}\n/* c8 ignore next */\nexport function isScrollable(element) {\n // early return here in the event element looked up but not in the dom at present\n if (!element) {\n return false;\n }\n // there's no great way to determine if something has scrollbars or not\n // this calculation is... okay at it. it is slightly naive but covers\n // our current need/use-case. if we need something more robust, we can\n // update this function to use one of the more complicated checks.\n const boundingRect = element.getBoundingClientRect();\n return (boundingRect.top < 0 ||\n element.scrollHeight > element.offsetHeight ||\n boundingRect.left < 0 ||\n element.scrollWidth > element.clientWidth);\n}\n/**\n * Works only on light DOM because that is all we have needed it for thus far\n *\n */\n/* c8 ignore next */\nexport function queryAllFocusable(element) {\n return element.querySelectorAll(tabFlowSelectors.join(', '));\n}\nconst nonTabIndexFocusableSelectors = [\n 'a[href]',\n 'area[href]',\n 'audio[controls]',\n 'button:not([disabled])',\n 'input:not([type=\"hidden\"]):not([disabled]):not([readonly])',\n 'iframe',\n 'object',\n 'embed',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'video[controls]',\n '*[contenteditable=true]',\n '[role=button]:not([disabled])',\n];\nexport const focusableSelectors = ['*[tabindex]', ...nonTabIndexFocusableSelectors];\nexport const tabFlowSelectors = ['*[tabindex]:not([tabindex=\"-1\"])', ...nonTabIndexFocusableSelectors];\nexport function getElementWidth(element, unit = 'px') {\n if (element) {\n return element.getBoundingClientRect ? element.getBoundingClientRect().width + unit : '';\n }\n return '';\n}\nexport function getElementWidthUnless(element, unless) {\n if (!unless) {\n return getElementWidth(element);\n }\n return '';\n}\nexport function isHTMLElement(el) {\n return !!el && el instanceof HTMLElement;\n}\nexport function hasAttributeAndIsNotEmpty(element, attribute) {\n return !!element && element.hasAttribute(attribute) && isStringAndNotNilOrEmpty(element.getAttribute(attribute));\n}\nexport function setOrRemoveAttribute(element, attrTuple, test) {\n const [attribute, value] = attrTuple;\n if (test()) {\n setAttributes(element, [attribute, value]);\n }\n else {\n removeAttributes(element, attribute);\n }\n}\nexport function setAttributes(element, ...attributeTuples) {\n if (element) {\n attributeTuples.forEach(([attr, val]) => {\n if (val === false || val === null) {\n element.removeAttribute(attr);\n }\n else {\n element.setAttribute(attr, val + '');\n }\n });\n }\n}\nexport function removeAttributes(element, ...attrs) {\n if (element) {\n attrs.forEach(attr => {\n element.removeAttribute(attr);\n });\n }\n}\nexport function addAttributeValue(element, attr, value) {\n if (element) {\n const currentAttrVal = element.getAttribute(attr);\n if (!currentAttrVal) {\n element.setAttribute(attr, value);\n }\n else if (!includes(value, currentAttrVal.split(' '))) {\n // add it only if it is not already there\n element.setAttribute(attr, currentAttrVal + ' ' + value);\n }\n }\n}\nexport function removeAttributeValue(element, attr, value) {\n if (element) {\n const currentAttrVal = element.getAttribute(attr);\n if (currentAttrVal) {\n // remove the specified value from the list of values currently set\n const attrValues = without([value], transformSpacedStringToArray(currentAttrVal));\n const newAttrValue = attrValues.join(' ');\n if (newAttrValue) {\n element.setAttribute(attr, newAttrValue);\n }\n else {\n element.removeAttribute(attr);\n }\n }\n }\n}\nexport function assignSlotNames(...slotTuples) {\n slotTuples.forEach(slotTuple => {\n const [el, slotName] = slotTuple;\n if (el) {\n setAttributes(el, ['slot', slotName]);\n }\n });\n}\nexport function isVisible(element) {\n return !!element && element?.offsetHeight > 0 && element?.hasAttribute('hidden') === false;\n}\nexport function spanWrapper(nodeList) {\n Array.from(nodeList)\n .filter(node => node.textContent && node.textContent.trim().length > 0 && node.nodeType === 3 && node.parentElement)\n .forEach(node => {\n const spanWrapper = document.createElement('span');\n node.after(spanWrapper);\n spanWrapper.appendChild(node);\n });\n}\nexport function queryChildFromLightOrShadowDom(hostEl, selector) {\n if (!selector) {\n return null;\n }\n return hostEl.querySelector(selector) || hostEl?.shadowRoot?.querySelector(selector) || null;\n}\nexport function createFragment(tagString) {\n return document.createRange().createContextualFragment(tagString);\n}\nexport function getWindowDimensions(win = window) {\n const doc = win?.document;\n const h = win?.innerHeight || doc?.documentElement?.clientHeight || 0;\n const w = win?.innerWidth || doc?.documentElement?.clientWidth || 0;\n return { width: w, height: h };\n}\nexport function windowIsAboveMobileBreakpoint(breakpointAsPixelValue) {\n const breakpointVal = breakpointAsPixelValue || getCssPropertyValue('--cds-global-layout-width-xs').trim();\n return breakpointAsPixelValue?.endsWith('px') ? pluckPixelValue(breakpointVal) >= getWindowDimensions().width : false;\n}\nexport function getShadowRootOrElse(hostEl, fallbackEl) {\n const fallTo = fallbackEl ? fallbackEl : hostEl;\n return (hostEl.shadowRoot ? hostEl.shadowRoot : fallTo);\n}\nexport function getInputValueType(value) {\n if (isNumericString(value)) {\n return 'number';\n }\n else if (value.match(/^\\d{4}-\\d{1,2}-\\d{1,2}$/)) {\n return 'date';\n }\n else {\n return 'text';\n }\n}\n// todo cory: test\nexport function querySelectorRoots(element, selector) {\n const root = element.querySelectorAll(selector);\n const shadowRoot = element.shadowRoot?.querySelectorAll(selector);\n return [...Array.from(root), ...Array.from(shadowRoot)];\n}\n// todo cory: test\n/**\n * Checks for right click with context menus & keyboard mouse control https://apple.stackexchange.com/questions/32715/how-do-i-open-the-context-menu-from-a-mac-keyboard\n */\nexport function contextMenuClick(event) {\n return (event.buttons === 2 && !event.ctrlKey) || (event.buttons === 1 && event.ctrlKey);\n}\n/** Coerces attribute/property value to a boolean */\nexport function coerceBooleanProperty(value) {\n return value !== null && value !== undefined && `${value}` !== 'false';\n}\n"],"names":["isFocusable","element","tagName","toLowerCase","getAttribute","hasAttribute","isScrollable","boundingRect","getBoundingClientRect","top","scrollHeight","offsetHeight","left","scrollWidth","clientWidth","queryAllFocusable","querySelectorAll","tabFlowSelectors","join","nonTabIndexFocusableSelectors","focusableSelectors","getElementWidth","unit","width","getElementWidthUnless","unless","isHTMLElement","el","HTMLElement","hasAttributeAndIsNotEmpty","attribute","isStringAndNotNilOrEmpty","setOrRemoveAttribute","attrTuple","test","value","setAttributes","removeAttributes","attributeTuples","forEach","attr","val","removeAttribute","setAttribute","attrs","addAttributeValue","currentAttrVal","includes","split","removeAttributeValue","newAttrValue","without","transformSpacedStringToArray","assignSlotNames","slotTuples","slotTuple","slotName","isVisible","spanWrapper","nodeList","Array","from","filter","node","textContent","trim","length","nodeType","parentElement","document","createElement","after","appendChild","queryChildFromLightOrShadowDom","hostEl","selector","querySelector","shadowRoot","createFragment","tagString","createRange","createContextualFragment","getWindowDimensions","win","window","doc","h","innerHeight","documentElement","clientHeight","innerWidth","height","windowIsAboveMobileBreakpoint","breakpointAsPixelValue","breakpointVal","getCssPropertyValue","endsWith","pluckPixelValue","getShadowRootOrElse","fallbackEl","fallTo","getInputValueType","isNumericString","match","querySelectorRoots","root","contextMenuClick","event","buttons","ctrlKey","coerceBooleanProperty"],"mappings":"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"}
1
+ {"version":3,"file":"dom.js","sources":["../../../../src/internal/utils/dom.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport includes from 'ramda/es/includes.js';\nimport without from 'ramda/es/without.js';\nimport { getCssPropertyValue } from './css.js';\nimport { pluckPixelValue, transformSpacedStringToArray } from './string.js';\nimport { isNumericString, isStringAndNotNilOrEmpty } from './identity.js';\n/**\n * We are not going to be opinionated about the use of the disabled attribute here.\n * Browsers will manage that on their own. The focus of this is to determine whether\n * or not a tabindex should be set on an element to make it programmatically\n * focusable.\n *\n */\nexport function isFocusable(element) {\n /* c8 ignore next 21 */\n switch (element.tagName.toLowerCase()) {\n case 'input':\n return (element.getAttribute('type') !== 'hidden' &&\n !element.hasAttribute('disabled') &&\n !element.hasAttribute('readonly'));\n case 'button':\n case 'select':\n case 'textarea':\n return !element.hasAttribute('disabled');\n case 'iframe':\n case 'embed':\n case 'object':\n return true;\n case 'a':\n case 'area':\n return element.hasAttribute('href');\n case 'audio':\n case 'video':\n return element.hasAttribute('controls');\n default:\n // we are not going to get into invalid values sent to the\n // tabindex attr. users have control of that and should avoid\n // setting tabindex to weird/unsupported values.\n return (element.hasAttribute('tabindex') ||\n element.getAttribute('contenteditable') === 'true' ||\n (element.getAttribute('role') === 'button' && !element.hasAttribute('disabled')));\n }\n}\n/* c8 ignore next */\nexport function isScrollable(element) {\n // early return here in the event element looked up but not in the dom at present\n if (!element) {\n return false;\n }\n // there's no great way to determine if something has scrollbars or not\n // this calculation is... okay at it. it is slightly naive but covers\n // our current need/use-case. if we need something more robust, we can\n // update this function to use one of the more complicated checks.\n const boundingRect = element.getBoundingClientRect();\n return (boundingRect.top < 0 ||\n element.scrollHeight > element.offsetHeight ||\n boundingRect.left < 0 ||\n element.scrollWidth > element.clientWidth);\n}\n/**\n * Works only on light DOM because that is all we have needed it for thus far\n *\n */\n/* c8 ignore next */\nexport function queryAllFocusable(element) {\n return element.querySelectorAll(tabFlowSelectors.join(', '));\n}\nconst nonTabIndexFocusableSelectors = [\n 'a[href]',\n 'area[href]',\n 'audio[controls]',\n 'button:not([disabled])',\n 'input:not([type=\"hidden\"]):not([disabled]):not([readonly])',\n 'iframe',\n 'object',\n 'embed',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'video[controls]',\n '*[contenteditable=true]',\n '[role=button]:not([disabled])',\n];\nexport const focusableSelectors = ['*[tabindex]', ...nonTabIndexFocusableSelectors];\nexport const tabFlowSelectors = ['*[tabindex]:not([tabindex=\"-1\"])', ...nonTabIndexFocusableSelectors];\nexport function getElementWidth(element, unit = 'px') {\n if (element) {\n return element.getBoundingClientRect ? element.getBoundingClientRect().width + unit : '';\n }\n return '';\n}\nexport function getElementWidthUnless(element, unless) {\n if (!unless) {\n return getElementWidth(element);\n }\n return '';\n}\nexport function isHTMLElement(el) {\n return !!el && el instanceof HTMLElement;\n}\nexport function hasAttributeAndIsNotEmpty(element, attribute) {\n return !!element && element.hasAttribute(attribute) && isStringAndNotNilOrEmpty(element.getAttribute(attribute));\n}\nexport function setOrRemoveAttribute(element, attrTuple, test) {\n const [attribute, value] = attrTuple;\n if (test()) {\n setAttributes(element, [attribute, value]);\n }\n else {\n removeAttributes(element, attribute);\n }\n}\nexport function setAttributes(element, ...attributeTuples) {\n if (element) {\n attributeTuples.forEach(([attr, val]) => {\n if (val === false || val === null) {\n element.removeAttribute(attr);\n }\n else {\n element.setAttribute(attr, val + '');\n }\n });\n }\n}\nexport function removeAttributes(element, ...attrs) {\n if (element) {\n attrs.forEach(attr => {\n element.removeAttribute(attr);\n });\n }\n}\nexport function addAttributeValue(element, attr, value) {\n if (element) {\n const currentAttrVal = element.getAttribute(attr);\n if (!currentAttrVal) {\n element.setAttribute(attr, value);\n }\n else if (!includes(value, currentAttrVal.split(' '))) {\n // add it only if it is not already there\n element.setAttribute(attr, currentAttrVal + ' ' + value);\n }\n }\n}\nexport function removeAttributeValue(element, attr, value) {\n if (element) {\n const currentAttrVal = element.getAttribute(attr);\n if (currentAttrVal) {\n // remove the specified value from the list of values currently set\n const attrValues = without([value], transformSpacedStringToArray(currentAttrVal));\n const newAttrValue = attrValues.join(' ');\n if (newAttrValue) {\n element.setAttribute(attr, newAttrValue);\n }\n else {\n element.removeAttribute(attr);\n }\n }\n }\n}\nexport function assignSlotNames(...slotTuples) {\n slotTuples.forEach(slotTuple => {\n const [el, slotName] = slotTuple;\n if (el) {\n setAttributes(el, ['slot', slotName]);\n }\n });\n}\nexport function isVisible(element) {\n return !!element && element?.offsetHeight > 0 && element?.hasAttribute('hidden') === false;\n}\nexport function spanWrapper(nodeList) {\n Array.from(nodeList)\n .filter(node => node.textContent && node.textContent.trim().length > 0 && node.nodeType === 3 && node.parentElement)\n .forEach(node => {\n const spanWrapper = document.createElement('span');\n node.after(spanWrapper);\n spanWrapper.appendChild(node);\n });\n}\nexport function queryChildFromLightOrShadowDom(hostEl, selector) {\n if (!selector) {\n return null;\n }\n return hostEl.querySelector(selector) || hostEl?.shadowRoot?.querySelector(selector) || null;\n}\nexport function createFragment(tagString) {\n return document.createRange().createContextualFragment(tagString);\n}\nexport function getWindowDimensions(win = window) {\n const doc = win?.document;\n const h = win?.innerHeight || doc?.documentElement?.clientHeight || 0;\n const w = win?.innerWidth || doc?.documentElement?.clientWidth || 0;\n return { width: w, height: h };\n}\nexport function windowIsAboveMobileBreakpoint(breakpointAsPixelValue) {\n const breakpointVal = breakpointAsPixelValue || getCssPropertyValue('--cds-global-layout-width-xs').trim();\n return breakpointAsPixelValue?.endsWith('px') ? pluckPixelValue(breakpointVal) >= getWindowDimensions().width : false;\n}\nexport function getShadowRootOrElse(hostEl, fallbackEl) {\n const fallTo = fallbackEl ? fallbackEl : hostEl;\n return (hostEl.shadowRoot ? hostEl.shadowRoot : fallTo);\n}\nexport function getInputValueType(value) {\n if (isNumericString(value)) {\n return 'number';\n }\n else if (value.match(/^\\d{4}-\\d{1,2}-\\d{1,2}$/)) {\n return 'date';\n }\n else {\n return 'text';\n }\n}\n// todo cory: test\nexport function querySelectorRoots(element, selector) {\n const root = element.querySelectorAll(selector);\n const shadowRoot = element.shadowRoot?.querySelectorAll(selector);\n return [...Array.from(root), ...Array.from(shadowRoot)];\n}\n// todo cory: test\n/**\n * Checks for right click with context menus & keyboard mouse control https://apple.stackexchange.com/questions/32715/how-do-i-open-the-context-menu-from-a-mac-keyboard\n */\nexport function contextMenuClick(event) {\n return (event.buttons === 2 && !event.ctrlKey) || (event.buttons === 1 && event.ctrlKey);\n}\n/** Coerces attribute/property value to a boolean */\nexport function coerceBooleanProperty(value) {\n return value !== null && value !== undefined && `${value}` !== 'false';\n}\n"],"names":["isFocusable","element","tagName","toLowerCase","getAttribute","hasAttribute","isScrollable","boundingRect","getBoundingClientRect","top","scrollHeight","offsetHeight","left","scrollWidth","clientWidth","queryAllFocusable","querySelectorAll","tabFlowSelectors","join","nonTabIndexFocusableSelectors","focusableSelectors","getElementWidth","unit","width","getElementWidthUnless","unless","isHTMLElement","el","HTMLElement","hasAttributeAndIsNotEmpty","attribute","isStringAndNotNilOrEmpty","setOrRemoveAttribute","attrTuple","test","value","setAttributes","removeAttributes","attributeTuples","forEach","attr","val","removeAttribute","setAttribute","attrs","addAttributeValue","currentAttrVal","includes","split","removeAttributeValue","newAttrValue","without","transformSpacedStringToArray","assignSlotNames","slotTuples","slotTuple","slotName","isVisible","spanWrapper","nodeList","Array","from","filter","node","textContent","trim","length","nodeType","parentElement","document","createElement","after","appendChild","queryChildFromLightOrShadowDom","hostEl","selector","querySelector","shadowRoot","createFragment","tagString","createRange","createContextualFragment","getWindowDimensions","win","window","doc","h","innerHeight","documentElement","clientHeight","innerWidth","height","windowIsAboveMobileBreakpoint","breakpointAsPixelValue","breakpointVal","getCssPropertyValue","endsWith","pluckPixelValue","getShadowRootOrElse","fallbackEl","fallTo","getInputValueType","isNumericString","match","querySelectorRoots","root","contextMenuClick","event","buttons","ctrlKey","coerceBooleanProperty"],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"enum.js","sources":["../../../../src/internal/utils/enum.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nexport function getEnumValueFromStringKey(enumToSearch, keyAsString, keyTransform = (k) => k, fallback = '') {\n if (!keyAsString) {\n return fallback;\n }\n const keyToGet = keyTransform(keyAsString);\n const enumValue = enumToSearch[keyToGet];\n return typeof enumValue !== 'undefined' ? enumValue : fallback;\n}\n"],"names":["getEnumValueFromStringKey","enumToSearch","keyAsString","keyTransform","k","fallback","enumValue"],"mappings":"AAKO,SAASA,EAA0BC,EAAcC,EAAaC,EAAe,CAACC,GAAMA,GAAGC,EAAW,IACrG,IAAKH,EACD,OAAOG,EAEX,MACMC,EAAYL,EADDE,EAAaD,IAE9B,YAA4B,IAAdI,EAA4BA,EAAYD"}
1
+ {"version":3,"file":"enum.js","sources":["../../../../src/internal/utils/enum.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nexport function getEnumValueFromStringKey(enumToSearch, keyAsString, keyTransform = (k) => k, fallback = '') {\n if (!keyAsString) {\n return fallback;\n }\n const keyToGet = keyTransform(keyAsString);\n const enumValue = enumToSearch[keyToGet];\n return typeof enumValue !== 'undefined' ? enumValue : fallback;\n}\n"],"names":["getEnumValueFromStringKey","enumToSearch","keyAsString","keyTransform","k","fallback","enumValue"],"mappings":"AAKO,SAASA,EAA0BC,EAAcC,EAAaC,EAAe,CAACC,GAAMA,GAAGC,EAAW,IACrG,IAAKH,EACD,OAAOG,EAEX,MACMC,EAAYL,EADDE,EAAaD,IAE9B,YAA4B,IAAdI,EAA4BA,EAAYD"}
@@ -1 +1 @@
1
- {"version":3,"file":"environment.js","sources":["../../../../src/internal/utils/environment.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport { isNil } from '../utils/identity.js';\nexport function isBrowser(win = window) {\n return !isNil(win);\n}\nexport function isJestTest() {\n return globalThis?.process?.env?.JEST_WORKER_ID !== undefined;\n}\n"],"names":["isBrowser","win","window","isNil","isJestTest","undefined","globalThis","process","env","JEST_WORKER_ID"],"mappings":"sCAMO,SAASA,EAAUC,EAAMC,QAC5B,OAAQC,EAAMF,GAEX,SAASG,IACZ,YAAoDC,IAA7CC,YAAYC,SAASC,KAAKC"}
1
+ {"version":3,"file":"environment.js","sources":["../../../../src/internal/utils/environment.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport { isNil } from '../utils/identity.js';\nexport function isBrowser(win = window) {\n return !isNil(win);\n}\nexport function isJestTest() {\n return globalThis?.process?.env?.JEST_WORKER_ID !== undefined;\n}\n"],"names":["isBrowser","win","window","isNil","isJestTest","undefined","globalThis","process","env","JEST_WORKER_ID"],"mappings":"sCAMO,SAASA,EAAUC,EAAMC,QAC5B,OAAQC,EAAMF,GAEX,SAASG,IACZ,YAAoDC,IAA7CC,YAAYC,SAASC,KAAKC"}
@@ -1 +1 @@
1
- {"version":3,"file":"event-subject.js","sources":["../../../../src/internal/utils/event-subject.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\n/**\n * Subscription returned from EventSubject.\n * Enables subscriber to un-subscribe from source.\n */\nclass InternalEventSubscription {\n constructor(fn, subscriptions) {\n this.fn = fn;\n this.subscriptions = subscriptions;\n }\n /** Use during disconnectedCallback to stop receiving events */\n unsubscribe() {\n const index = this.subscriptions.indexOf(this);\n if (index !== -1) {\n this.subscriptions.splice(index, 1);\n }\n }\n}\n/**\n * Basic Subject implementing Observer style pattern.\n * Use to trigger and communicate outgoing async updates.\n *\n * Used as a lightweight alternative to rxjs style subject.\n * RxJS pulls in too much code for our performance standards\n * and would require additional peer dependencies for the\n * host application to take on.\n *\n * @internal\n */\nexport class EventSubject {\n constructor() {\n this.subscriptions = [];\n }\n /** Subscribe to receive event value updates */\n subscribe(fn) {\n const sub = new InternalEventSubscription(fn, this.subscriptions);\n this.subscriptions.push(sub);\n return sub;\n }\n /** Use to trigger and send an event to all active subscribers */\n emit(value) {\n this.subscriptions.forEach(sub => sub.fn(value));\n }\n /** Cast Subject to Observable subtype to prevent access to `emit` */\n toEventObservable() {\n return this;\n }\n}\n"],"names":["InternalEventSubscription","constructor","fn","subscriptions","this","unsubscribe","index","indexOf","splice","EventSubject","subscribe","sub","push","emit","value","forEach","toEventObservable"],"mappings":"AASA,MAAMA,EACFC,YAAYC,EAAIC,GACZC,KAAKF,GAAKA,EACVE,KAAKD,cAAgBA,EAGzBE,cACI,MAAMC,EAAQF,KAAKD,cAAcI,QAAQH,OAC1B,IAAXE,GACAF,KAAKD,cAAcK,OAAOF,EAAO,IAetC,MAAMG,EACTR,cACIG,KAAKD,cAAgB,GAGzBO,UAAUR,GACN,MAAMS,EAAM,IAAIX,EAA0BE,EAAIE,KAAKD,eAEnD,OADAC,KAAKD,cAAcS,KAAKD,GACjBA,EAGXE,KAAKC,GACDV,KAAKD,cAAcY,SAAQJ,GAAOA,EAAIT,GAAGY,KAG7CE,oBACI,OAAOZ"}
1
+ {"version":3,"file":"event-subject.js","sources":["../../../../src/internal/utils/event-subject.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\n/**\n * Subscription returned from EventSubject.\n * Enables subscriber to un-subscribe from source.\n */\nclass InternalEventSubscription {\n constructor(fn, subscriptions) {\n this.fn = fn;\n this.subscriptions = subscriptions;\n }\n /** Use during disconnectedCallback to stop receiving events */\n unsubscribe() {\n const index = this.subscriptions.indexOf(this);\n if (index !== -1) {\n this.subscriptions.splice(index, 1);\n }\n }\n}\n/**\n * Basic Subject implementing Observer style pattern.\n * Use to trigger and communicate outgoing async updates.\n *\n * Used as a lightweight alternative to rxjs style subject.\n * RxJS pulls in too much code for our performance standards\n * and would require additional peer dependencies for the\n * host application to take on.\n *\n * @internal\n */\nexport class EventSubject {\n constructor() {\n this.subscriptions = [];\n }\n /** Subscribe to receive event value updates */\n subscribe(fn) {\n const sub = new InternalEventSubscription(fn, this.subscriptions);\n this.subscriptions.push(sub);\n return sub;\n }\n /** Use to trigger and send an event to all active subscribers */\n emit(value) {\n this.subscriptions.forEach(sub => sub.fn(value));\n }\n /** Cast Subject to Observable subtype to prevent access to `emit` */\n toEventObservable() {\n return this;\n }\n}\n"],"names":["InternalEventSubscription","constructor","fn","subscriptions","this","unsubscribe","index","indexOf","splice","EventSubject","subscribe","sub","push","emit","value","forEach","toEventObservable"],"mappings":"AASA,MAAMA,EACFC,YAAYC,EAAIC,GACZC,KAAKF,GAAKA,EACVE,KAAKD,cAAgBA,EAGzBE,cACI,MAAMC,EAAQF,KAAKD,cAAcI,QAAQH,OAC1B,IAAXE,GACAF,KAAKD,cAAcK,OAAOF,EAAO,IAetC,MAAMG,EACTR,cACIG,KAAKD,cAAgB,GAGzBO,UAAUR,GACN,MAAMS,EAAM,IAAIX,EAA0BE,EAAIE,KAAKD,eAEnD,OADAC,KAAKD,cAAcS,KAAKD,GACjBA,EAGXE,KAAKC,GACDV,KAAKD,cAAcY,SAAQJ,GAAOA,EAAIT,GAAGY,KAG7CE,oBACI,OAAOZ"}
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","sources":["../../../../src/internal/utils/events.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport { isJestTest } from './environment.js';\nexport function stopEvent(event) {\n event.preventDefault();\n event.stopPropagation();\n}\nexport const getElementUpdates = (element, propertyKey, callback) => {\n if (element.hasAttribute(propertyKey)) {\n callback(element.getAttribute(propertyKey));\n }\n else if (element[propertyKey] !== undefined) {\n callback(element[propertyKey]);\n }\n // React: disable input tracker to setup property observer. React re-creates tracker on input changes\n // https://github.com/facebook/react/blob/9198a5cec0936a21a5ba194a22fcbac03eba5d1d/packages/react-dom/src/client/inputValueTracking.js#L51\n // https://github.com/vmware/clarity/issues/5625\n if (element._valueTracker && (propertyKey === 'checked' || propertyKey === 'value')) {\n element._valueTracker = null;\n }\n const updatedProp = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element), propertyKey);\n // Jest and JSDom breaks defining a new property, so skip\n if (updatedProp && !isJestTest()) {\n Object.defineProperty(element, propertyKey, {\n get: updatedProp.get,\n set: val => {\n callback(val);\n updatedProp.set.call(element, val);\n },\n });\n }\n return listenForAttributeChange(element, propertyKey, val => callback(val));\n};\nexport function onFirstInteraction(element) {\n return new Promise(resolve => {\n const update = () => {\n resolve(null);\n element.__cdsTouched = true;\n };\n if (element.__cdsTouched) {\n resolve(null);\n }\n element.addEventListener('mouseover', update, { once: true, passive: true });\n element.addEventListener('touchstart', update, { once: true, passive: true }); // avoid click related events to prevent SRs like NVDA from anouncing \"clickable\" https://github.com/nvaccess/nvda/issues/5830\n element.addEventListener('keydown', update, { once: true, passive: true });\n element.addEventListener('focus', update, { once: true, passive: true });\n });\n}\nexport function onChildListMutation(element, fn) {\n const observer = new MutationObserver(mutations => {\n for (const mutation of mutations) {\n if (mutation.type === 'childList') {\n fn(mutation);\n }\n }\n });\n observer.observe(element, { childList: true });\n return observer;\n}\nexport function listenForAttributeChange(element, attrName, fn) {\n const observer = new MutationObserver(mutations => {\n if (mutations.find(m => m.attributeName === attrName)) {\n fn(element.getAttribute(attrName));\n }\n });\n observer.observe(element, { attributes: true });\n return observer;\n}\nexport function listenForAttributeListChange(element, attrNames, fn) {\n const observer = new MutationObserver(mutations => {\n const mutation = mutations.find(m => attrNames.find(i => m.attributeName === i));\n if (mutation) {\n fn(element.getAttribute(mutation.attributeName));\n }\n });\n observer.observe(element, { attributes: true, attributeFilter: attrNames, subtree: true });\n return observer;\n}\n"],"names":["stopEvent","event","preventDefault","stopPropagation","getElementUpdates","element","propertyKey","callback","hasAttribute","getAttribute","undefined","_valueTracker","updatedProp","Object","getOwnPropertyDescriptor","getPrototypeOf","isJestTest","defineProperty","get","set","val","call","listenForAttributeChange","onFirstInteraction","Promise","resolve","update","__cdsTouched","addEventListener","once","passive","onChildListMutation","fn","observer","MutationObserver","mutations","mutation","type","observe","childList","attrName","find","m","attributeName","attributes","listenForAttributeListChange","attrNames","i","attributeFilter","subtree"],"mappings":"8CAMO,SAASA,EAAUC,GACtBA,EAAMC,iBACND,EAAME,kBAEE,MAACC,EAAoB,CAACC,EAASC,EAAaC,KAChDF,EAAQG,aAAaF,GACrBC,EAASF,EAAQI,aAAaH,SAEAI,IAAzBL,EAAQC,IACbC,EAASF,EAAQC,KAKjBD,EAAQM,eAAkC,YAAhBL,GAA6C,UAAhBA,IACvDD,EAAQM,cAAgB,MAE5B,MAAMC,EAAcC,OAAOC,yBAAyBD,OAAOE,eAAeV,GAAUC,GAWpF,OATIM,IAAgBI,KAChBH,OAAOI,eAAeZ,EAASC,EAAa,CACxCY,IAAKN,EAAYM,IACjBC,IAAKC,IACDb,EAASa,GACTR,EAAYO,IAAIE,KAAKhB,EAASe,MAInCE,EAAyBjB,EAASC,GAAac,GAAOb,EAASa,MAEnE,SAASG,EAAmBlB,GAC/B,OAAO,IAAImB,SAAQC,IACf,MAAMC,EAAS,KACXD,EAAQ,MACRpB,EAAQsB,cAAe,GAEvBtB,EAAQsB,cACRF,EAAQ,MAEZpB,EAAQuB,iBAAiB,YAAaF,EAAQ,CAAEG,MAAM,EAAMC,SAAS,IACrEzB,EAAQuB,iBAAiB,aAAcF,EAAQ,CAAEG,MAAM,EAAMC,SAAS,IACtEzB,EAAQuB,iBAAiB,UAAWF,EAAQ,CAAEG,MAAM,EAAMC,SAAS,IACnEzB,EAAQuB,iBAAiB,QAASF,EAAQ,CAAEG,MAAM,EAAMC,SAAS,OAGlE,SAASC,EAAoB1B,EAAS2B,GACzC,MAAMC,EAAW,IAAIC,kBAAiBC,IAClC,IAAK,MAAMC,KAAYD,EACG,cAAlBC,EAASC,MACTL,EAAGI,MAKf,OADAH,EAASK,QAAQjC,EAAS,CAAEkC,WAAW,IAChCN,EAEJ,SAASX,EAAyBjB,EAASmC,EAAUR,GACxD,MAAMC,EAAW,IAAIC,kBAAiBC,IAC9BA,EAAUM,MAAKC,GAAKA,EAAEC,gBAAkBH,KACxCR,EAAG3B,EAAQI,aAAa+B,OAIhC,OADAP,EAASK,QAAQjC,EAAS,CAAEuC,YAAY,IACjCX,EAEJ,SAASY,EAA6BxC,EAASyC,EAAWd,GAC7D,MAAMC,EAAW,IAAIC,kBAAiBC,IAClC,MAAMC,EAAWD,EAAUM,MAAKC,GAAKI,EAAUL,MAAKM,GAAKL,EAAEC,gBAAkBI,MACzEX,GACAJ,EAAG3B,EAAQI,aAAa2B,EAASO,mBAIzC,OADAV,EAASK,QAAQjC,EAAS,CAAEuC,YAAY,EAAMI,gBAAiBF,EAAWG,SAAS,IAC5EhB"}
1
+ {"version":3,"file":"events.js","sources":["../../../../src/internal/utils/events.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport { isJestTest } from './environment.js';\nexport function stopEvent(event) {\n event.preventDefault();\n event.stopPropagation();\n}\nexport const getElementUpdates = (element, propertyKey, callback) => {\n if (element.hasAttribute(propertyKey)) {\n callback(element.getAttribute(propertyKey));\n }\n else if (element[propertyKey] !== undefined) {\n callback(element[propertyKey]);\n }\n // React: disable input tracker to setup property observer. React re-creates tracker on input changes\n // https://github.com/facebook/react/blob/9198a5cec0936a21a5ba194a22fcbac03eba5d1d/packages/react-dom/src/client/inputValueTracking.js#L51\n // https://github.com/vmware/clarity/issues/5625\n if (element._valueTracker && (propertyKey === 'checked' || propertyKey === 'value')) {\n element._valueTracker = null;\n }\n const updatedProp = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(element), propertyKey);\n // Jest and JSDom breaks defining a new property, so skip\n if (updatedProp && !isJestTest()) {\n Object.defineProperty(element, propertyKey, {\n get: updatedProp.get,\n set: val => {\n callback(val);\n updatedProp.set.call(element, val);\n },\n });\n }\n return listenForAttributeChange(element, propertyKey, val => callback(val));\n};\nexport function onFirstInteraction(element) {\n return new Promise(resolve => {\n const update = () => {\n resolve(null);\n element.__cdsTouched = true;\n };\n if (element.__cdsTouched) {\n resolve(null);\n }\n element.addEventListener('mouseover', update, { once: true, passive: true });\n element.addEventListener('touchstart', update, { once: true, passive: true }); // avoid click related events to prevent SRs like NVDA from anouncing \"clickable\" https://github.com/nvaccess/nvda/issues/5830\n element.addEventListener('keydown', update, { once: true, passive: true });\n element.addEventListener('focus', update, { once: true, passive: true });\n });\n}\nexport function onChildListMutation(element, fn) {\n const observer = new MutationObserver(mutations => {\n for (const mutation of mutations) {\n if (mutation.type === 'childList') {\n fn(mutation);\n }\n }\n });\n observer.observe(element, { childList: true });\n return observer;\n}\nexport function listenForAttributeChange(element, attrName, fn) {\n const observer = new MutationObserver(mutations => {\n if (mutations.find(m => m.attributeName === attrName)) {\n fn(element.getAttribute(attrName));\n }\n });\n observer.observe(element, { attributes: true });\n return observer;\n}\nexport function listenForAttributeListChange(element, attrNames, fn) {\n const observer = new MutationObserver(mutations => {\n const mutation = mutations.find(m => attrNames.find(i => m.attributeName === i));\n if (mutation) {\n fn(element.getAttribute(mutation.attributeName));\n }\n });\n observer.observe(element, { attributes: true, attributeFilter: attrNames, subtree: true });\n return observer;\n}\n"],"names":["stopEvent","event","preventDefault","stopPropagation","getElementUpdates","element","propertyKey","callback","hasAttribute","getAttribute","undefined","_valueTracker","updatedProp","Object","getOwnPropertyDescriptor","getPrototypeOf","isJestTest","defineProperty","get","set","val","call","listenForAttributeChange","onFirstInteraction","Promise","resolve","update","__cdsTouched","addEventListener","once","passive","onChildListMutation","fn","observer","MutationObserver","mutations","mutation","type","observe","childList","attrName","find","m","attributeName","attributes","listenForAttributeListChange","attrNames","i","attributeFilter","subtree"],"mappings":"8CAMO,SAASA,EAAUC,GACtBA,EAAMC,iBACND,EAAME,kBAEE,MAACC,EAAoB,CAACC,EAASC,EAAaC,KAChDF,EAAQG,aAAaF,GACrBC,EAASF,EAAQI,aAAaH,SAEAI,IAAzBL,EAAQC,IACbC,EAASF,EAAQC,KAKjBD,EAAQM,eAAkC,YAAhBL,GAA6C,UAAhBA,IACvDD,EAAQM,cAAgB,MAE5B,MAAMC,EAAcC,OAAOC,yBAAyBD,OAAOE,eAAeV,GAAUC,GAWpF,OATIM,IAAgBI,KAChBH,OAAOI,eAAeZ,EAASC,EAAa,CACxCY,IAAKN,EAAYM,IACjBC,IAAKC,IACDb,EAASa,GACTR,EAAYO,IAAIE,KAAKhB,EAASe,MAInCE,EAAyBjB,EAASC,GAAac,GAAOb,EAASa,MAEnE,SAASG,EAAmBlB,GAC/B,OAAO,IAAImB,SAAQC,IACf,MAAMC,EAAS,KACXD,EAAQ,MACRpB,EAAQsB,cAAe,GAEvBtB,EAAQsB,cACRF,EAAQ,MAEZpB,EAAQuB,iBAAiB,YAAaF,EAAQ,CAAEG,MAAM,EAAMC,SAAS,IACrEzB,EAAQuB,iBAAiB,aAAcF,EAAQ,CAAEG,MAAM,EAAMC,SAAS,IACtEzB,EAAQuB,iBAAiB,UAAWF,EAAQ,CAAEG,MAAM,EAAMC,SAAS,IACnEzB,EAAQuB,iBAAiB,QAASF,EAAQ,CAAEG,MAAM,EAAMC,SAAS,OAGlE,SAASC,EAAoB1B,EAAS2B,GACzC,MAAMC,EAAW,IAAIC,kBAAiBC,IAClC,IAAK,MAAMC,KAAYD,EACG,cAAlBC,EAASC,MACTL,EAAGI,MAKf,OADAH,EAASK,QAAQjC,EAAS,CAAEkC,WAAW,IAChCN,EAEJ,SAASX,EAAyBjB,EAASmC,EAAUR,GACxD,MAAMC,EAAW,IAAIC,kBAAiBC,IAC9BA,EAAUM,MAAKC,GAAKA,EAAEC,gBAAkBH,KACxCR,EAAG3B,EAAQI,aAAa+B,OAIhC,OADAP,EAASK,QAAQjC,EAAS,CAAEuC,YAAY,IACjCX,EAEJ,SAASY,EAA6BxC,EAASyC,EAAWd,GAC7D,MAAMC,EAAW,IAAIC,kBAAiBC,IAClC,MAAMC,EAAWD,EAAUM,MAAKC,GAAKI,EAAUL,MAAKM,GAAKL,EAAEC,gBAAkBI,MACzEX,GACAJ,EAAG3B,EAAQI,aAAa2B,EAASO,mBAIzC,OADAV,EAASK,QAAQjC,EAAS,CAAEuC,YAAY,EAAMI,gBAAiBF,EAAWG,SAAS,IAC5EhB"}
@@ -1 +1 @@
1
- {"version":3,"file":"exists.js","sources":["../../../../src/internal/utils/exists.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport curryN from 'ramda/es/curryN.js';\nimport path from 'ramda/es/path.js';\nimport __ from './__.js';\nexport const existsIn = curryN(2, (pathToCheck, obj) => {\n const pathExists = path(pathToCheck, obj);\n return typeof pathExists !== 'undefined';\n});\nexport function elementExists(tagName, registry) {\n if (!registry) {\n registry = window && window.customElements;\n }\n if (!registry) {\n return true; // we don't want to execute further actions because window does not exist\n }\n return !!registry.get(tagName);\n}\nexport const existsInWindow = existsIn(__, window);\n"],"names":["existsIn","curryN","pathToCheck","obj","path","elementExists","tagName","registry","window","customElements","get","existsInWindow","__"],"mappings":"yFAQY,MAACA,EAAWC,EAAO,GAAG,CAACC,EAAaC,SAEf,IADVC,EAAKF,EAAaC,KAGlC,SAASE,EAAcC,EAASC,GAInC,OAHKA,IACDA,EAAWC,QAAUA,OAAOC,iBAE3BF,KAGIA,EAASG,IAAIJ,GAEd,MAACK,EAAiBX,EAASY,EAAIJ"}
1
+ {"version":3,"file":"exists.js","sources":["../../../../src/internal/utils/exists.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport curryN from 'ramda/es/curryN.js';\nimport path from 'ramda/es/path.js';\nimport __ from './__.js';\nexport const existsIn = curryN(2, (pathToCheck, obj) => {\n const pathExists = path(pathToCheck, obj);\n return typeof pathExists !== 'undefined';\n});\nexport function elementExists(tagName, registry) {\n if (!registry) {\n registry = window && window.customElements;\n }\n if (!registry) {\n return true; // we don't want to execute further actions because window does not exist\n }\n return !!registry.get(tagName);\n}\nexport const existsInWindow = existsIn(__, window);\n"],"names":["existsIn","curryN","pathToCheck","obj","path","elementExists","tagName","registry","window","customElements","get","existsInWindow","__"],"mappings":"yFAQY,MAACA,EAAWC,EAAO,GAAG,CAACC,EAAaC,SAEf,IADVC,EAAKF,EAAaC,KAGlC,SAASE,EAAcC,EAASC,GAInC,OAHKA,IACDA,EAAWC,QAAUA,OAAOC,iBAE3BF,KAGIA,EAASG,IAAIJ,GAEd,MAACK,EAAiBX,EAASY,EAAIJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"focus.js","sources":["../../../../src/internal/utils/focus.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport { stopEvent } from './events.js';\nexport function focusable(element) {\n return element.matches([\n 'a[href]',\n 'area[href]',\n 'input:not([disabled])',\n 'button:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'iframe',\n 'object',\n 'embed',\n '*[tabindex]',\n '*[contenteditable=true]',\n '[role=button]:not([disabled])',\n ].join(','));\n}\n// todo cory: test\n/**\n * Lists simple focus primitives, any interactive element that does not require advanced keyboard interactions like arrow/navigation\n */\nexport function simpleFocusable(element) {\n return element.matches([\n 'a[href]',\n 'button:not([disabled])',\n 'input[type=checkbox]',\n 'input[type=radio]',\n 'object',\n 'embed',\n '*[tabindex]',\n '[role=button]:not([disabled])',\n ].join(','));\n}\nexport function getActiveElement(root = document) {\n if (root.activeElement && root.activeElement.shadowRoot) {\n return getActiveElement(root.activeElement.shadowRoot) ?? root.activeElement;\n }\n else {\n return root.activeElement;\n }\n}\nexport function focusElement(element) {\n if (element && !focusable(element)) {\n element.setAttribute('tabindex', '-1');\n element.focus();\n element.addEventListener('blur', () => element.removeAttribute('tabindex'), { once: true });\n }\n else {\n element?.focus();\n }\n}\nexport function onFocusOut(element, fn) {\n element.addEventListener('focusout', (event) => {\n if (!element.contains(event.relatedTarget) && document.hasFocus()) {\n fn();\n }\n });\n}\nexport function onEscape(element, fn) {\n element.addEventListener('keyup', (e) => {\n if (e.code === 'Escape') {\n stopEvent(e);\n fn();\n }\n });\n}\nexport function ignoreFocus(hostEl) {\n return (hostEl.cdsIgnoreFocus === true ||\n hostEl.hasAttribute('cds-ignore-focus') ||\n hostEl.hasAttribute('_demo-mode') // deprecated internal\n );\n}\n// todo cory: test\nexport function setActiveKeyListItem(items, item) {\n items.forEach(i => (i.tabIndex = -1));\n item.tabIndex = 0;\n}\n// todo cory: test\nexport function initializeKeyListItems(items) {\n items.forEach(i => (i.tabIndex = -1));\n items[0].tabIndex = 0;\n}\n"],"names":["focusable","element","matches","simpleFocusable","getActiveElement","root","document","activeElement","shadowRoot","focusElement","setAttribute","focus","addEventListener","removeAttribute","once","onFocusOut","fn","event","contains","relatedTarget","hasFocus","onEscape","e","code","stopEvent","ignoreFocus","hostEl","cdsIgnoreFocus","hasAttribute","setActiveKeyListItem","items","item","forEach","i","tabIndex","initializeKeyListItems"],"mappings":"wCAMO,SAASA,EAAUC,GACtB,OAAOA,EAAQC,QAAQ,yMAmBpB,SAASC,EAAgBF,GAC5B,OAAOA,EAAQC,QAAQ,gIAWpB,SAASE,EAAiBC,EAAOC,UACpC,OAAID,EAAKE,eAAiBF,EAAKE,cAAcC,WAClCJ,EAAiBC,EAAKE,cAAcC,aAAeH,EAAKE,cAGxDF,EAAKE,cAGb,SAASE,EAAaR,GACrBA,IAAYD,EAAUC,IACtBA,EAAQS,aAAa,WAAY,MACjCT,EAAQU,QACRV,EAAQW,iBAAiB,QAAQ,IAAMX,EAAQY,gBAAgB,aAAa,CAAEC,MAAM,KAGpFb,GAASU,QAGV,SAASI,EAAWd,EAASe,GAChCf,EAAQW,iBAAiB,YAAaK,KAC7BhB,EAAQiB,SAASD,EAAME,gBAAkBb,SAASc,YACnDJ,OAIL,SAASK,EAASpB,EAASe,GAC9Bf,EAAQW,iBAAiB,SAAUU,IAChB,WAAXA,EAAEC,OACFC,EAAUF,GACVN,QAIL,SAASS,EAAYC,GACxB,OAAkC,IAA1BA,EAAOC,gBACXD,EAAOE,aAAa,qBACpBF,EAAOE,aAAa,cAIrB,SAASC,EAAqBC,EAAOC,GACxCD,EAAME,SAAQC,GAAMA,EAAEC,UAAY,IAClCH,EAAKG,SAAW,EAGb,SAASC,EAAuBL,GACnCA,EAAME,SAAQC,GAAMA,EAAEC,UAAY,IAClCJ,EAAM,GAAGI,SAAW"}
1
+ {"version":3,"file":"focus.js","sources":["../../../../src/internal/utils/focus.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport { stopEvent } from './events.js';\nexport function focusable(element) {\n return element.matches([\n 'a[href]',\n 'area[href]',\n 'input:not([disabled])',\n 'button:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'iframe',\n 'object',\n 'embed',\n '*[tabindex]',\n '*[contenteditable=true]',\n '[role=button]:not([disabled])',\n ].join(','));\n}\n// todo cory: test\n/**\n * Lists simple focus primitives, any interactive element that does not require advanced keyboard interactions like arrow/navigation\n */\nexport function simpleFocusable(element) {\n return element.matches([\n 'a[href]',\n 'button:not([disabled])',\n 'input[type=checkbox]',\n 'input[type=radio]',\n 'object',\n 'embed',\n '*[tabindex]',\n '[role=button]:not([disabled])',\n ].join(','));\n}\nexport function getActiveElement(root = document) {\n if (root.activeElement && root.activeElement.shadowRoot) {\n return getActiveElement(root.activeElement.shadowRoot) ?? root.activeElement;\n }\n else {\n return root.activeElement;\n }\n}\nexport function focusElement(element) {\n if (element && !focusable(element)) {\n element.setAttribute('tabindex', '-1');\n element.focus();\n element.addEventListener('blur', () => element.removeAttribute('tabindex'), { once: true });\n }\n else {\n element?.focus();\n }\n}\nexport function onFocusOut(element, fn) {\n element.addEventListener('focusout', (event) => {\n if (!element.contains(event.relatedTarget) && document.hasFocus()) {\n fn();\n }\n });\n}\nexport function onEscape(element, fn) {\n element.addEventListener('keyup', (e) => {\n if (e.code === 'Escape') {\n stopEvent(e);\n fn();\n }\n });\n}\nexport function ignoreFocus(hostEl) {\n return (hostEl.cdsIgnoreFocus === true ||\n hostEl.hasAttribute('cds-ignore-focus') ||\n hostEl.hasAttribute('_demo-mode') // deprecated internal\n );\n}\n// todo cory: test\nexport function setActiveKeyListItem(items, item) {\n items.forEach(i => (i.tabIndex = -1));\n item.tabIndex = 0;\n}\n// todo cory: test\nexport function initializeKeyListItems(items) {\n items.forEach(i => (i.tabIndex = -1));\n items[0].tabIndex = 0;\n}\n"],"names":["focusable","element","matches","simpleFocusable","getActiveElement","root","document","activeElement","shadowRoot","focusElement","setAttribute","focus","addEventListener","removeAttribute","once","onFocusOut","fn","event","contains","relatedTarget","hasFocus","onEscape","e","code","stopEvent","ignoreFocus","hostEl","cdsIgnoreFocus","hasAttribute","setActiveKeyListItem","items","item","forEach","i","tabIndex","initializeKeyListItems"],"mappings":"wCAMO,SAASA,EAAUC,GACtB,OAAOA,EAAQC,QAAQ,yMAmBpB,SAASC,EAAgBF,GAC5B,OAAOA,EAAQC,QAAQ,gIAWpB,SAASE,EAAiBC,EAAOC,UACpC,OAAID,EAAKE,eAAiBF,EAAKE,cAAcC,WAClCJ,EAAiBC,EAAKE,cAAcC,aAAeH,EAAKE,cAGxDF,EAAKE,cAGb,SAASE,EAAaR,GACrBA,IAAYD,EAAUC,IACtBA,EAAQS,aAAa,WAAY,MACjCT,EAAQU,QACRV,EAAQW,iBAAiB,QAAQ,IAAMX,EAAQY,gBAAgB,aAAa,CAAEC,MAAM,KAGpFb,GAASU,QAGV,SAASI,EAAWd,EAASe,GAChCf,EAAQW,iBAAiB,YAAaK,KAC7BhB,EAAQiB,SAASD,EAAME,gBAAkBb,SAASc,YACnDJ,OAIL,SAASK,EAASpB,EAASe,GAC9Bf,EAAQW,iBAAiB,SAAUU,IAChB,WAAXA,EAAEC,OACFC,EAAUF,GACVN,QAIL,SAASS,EAAYC,GACxB,OAAkC,IAA1BA,EAAOC,gBACXD,EAAOE,aAAa,qBACpBF,EAAOE,aAAa,cAIrB,SAASC,EAAqBC,EAAOC,GACxCD,EAAME,SAAQC,GAAMA,EAAEC,UAAY,IAClCH,EAAKG,SAAW,EAGb,SAASC,EAAuBL,GACnCA,EAAME,SAAQC,GAAMA,EAAEC,UAAY,IAClCJ,EAAM,GAAGI,SAAW"}
@@ -1 +1 @@
1
- {"version":3,"file":"framework.js","sources":["../../../../src/internal/utils/framework.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\n// DO NOT USE for conditionally applying behavior based on the host framework.\n// These utilities are only for detecting host frameworks for debugging and logging.\n// Host framework specific code should exist outside of the @cds/core package.\n// Get values once then cache\nlet angularVersion;\nlet angularJSVersion;\nlet reactVersion;\nlet vueVersion;\nexport function getAngularVersion(useCache = true) {\n if (!useCache || !angularVersion) {\n const appRoot = document && document.querySelector('[ng-version]');\n angularVersion = appRoot ? `${appRoot.getAttribute('ng-version')}` : undefined;\n }\n return angularVersion;\n}\nexport function getAngularJSVersion(useCache = true) {\n if (!useCache || !angularVersion) {\n angularJSVersion = window?.angular?.version?.full;\n }\n return angularJSVersion;\n}\nexport function getReactVersion(useCache = true) {\n if (!useCache || !reactVersion) {\n if (window?.CDS?._react?.version) {\n reactVersion = window.CDS._react.version;\n }\n else if (document.querySelector('[data-reactroot], [data-reactid]')) {\n reactVersion = 'unknown version';\n }\n else {\n reactVersion = undefined;\n }\n }\n return reactVersion;\n}\nexport function getVueVersion(useCache = true) {\n if (!useCache || !vueVersion) {\n const all = document.querySelectorAll('*');\n let el;\n for (let i = 0; i < all.length; i++) {\n if (all[i].__vue__) {\n el = all[i];\n break;\n }\n }\n vueVersion = el ? 'unknown version' : undefined;\n }\n return vueVersion;\n}\nexport function isStorybook() {\n return window?.location?.href?.includes('localhost:6006');\n}\n"],"names":["angularVersion","angularJSVersion","reactVersion","vueVersion","getAngularVersion","useCache","appRoot","document","querySelector","getAttribute","undefined","getAngularJSVersion","window","angular","version","full","getReactVersion","CDS","_react","getVueVersion","all","querySelectorAll","el","i","length","__vue__","isStorybook","location","href","includes"],"mappings":"AASA,IAAIA,EACAC,EACAC,EACAC,EACG,SAASC,EAAkBC,GAAW,GACzC,IAAKA,IAAaL,EAAgB,CAC9B,MAAMM,EAAUC,UAAYA,SAASC,cAAc,gBACnDR,EAAiBM,EAAU,GAAGA,EAAQG,aAAa,mBAAkBC,EAEzE,OAAOV,EAEJ,SAASW,EAAoBN,GAAW,GAI3C,OAHKA,GAAaL,IACdC,EAAmBW,QAAQC,SAASC,SAASC,MAE1Cd,EAEJ,SAASe,EAAgBX,GAAW,GAYvC,OAXKA,GAAaH,IAEVA,EADAU,QAAQK,KAAKC,QAAQJ,QACNF,OAAOK,IAAIC,OAAOJ,QAE5BP,SAASC,cAAc,oCACb,uBAGAE,GAGhBR,EAEJ,SAASiB,EAAcd,GAAW,GACrC,IAAKA,IAAaF,EAAY,CAC1B,MAAMiB,EAAMb,SAASc,iBAAiB,KACtC,IAAIC,EACJ,IAAK,IAAIC,EAAI,EAAGA,EAAIH,EAAII,OAAQD,IAC5B,GAAIH,EAAIG,GAAGE,QAAS,CAChBH,EAAKF,EAAIG,GACT,MAGRpB,EAAamB,EAAK,uBAAoBZ,EAE1C,OAAOP,EAEJ,SAASuB,IACZ,OAAOd,QAAQe,UAAUC,MAAMC,SAAS"}
1
+ {"version":3,"file":"framework.js","sources":["../../../../src/internal/utils/framework.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\n// DO NOT USE for conditionally applying behavior based on the host framework.\n// These utilities are only for detecting host frameworks for debugging and logging.\n// Host framework specific code should exist outside of the @cds/core package.\n// Get values once then cache\nlet angularVersion;\nlet angularJSVersion;\nlet reactVersion;\nlet vueVersion;\nexport function getAngularVersion(useCache = true) {\n if (!useCache || !angularVersion) {\n const appRoot = document && document.querySelector('[ng-version]');\n angularVersion = appRoot ? `${appRoot.getAttribute('ng-version')}` : undefined;\n }\n return angularVersion;\n}\nexport function getAngularJSVersion(useCache = true) {\n if (!useCache || !angularVersion) {\n angularJSVersion = window?.angular?.version?.full;\n }\n return angularJSVersion;\n}\nexport function getReactVersion(useCache = true) {\n if (!useCache || !reactVersion) {\n if (window?.CDS?._react?.version) {\n reactVersion = window.CDS._react.version;\n }\n else if (document.querySelector('[data-reactroot], [data-reactid]')) {\n reactVersion = 'unknown version';\n }\n else {\n reactVersion = undefined;\n }\n }\n return reactVersion;\n}\nexport function getVueVersion(useCache = true) {\n if (!useCache || !vueVersion) {\n const all = document.querySelectorAll('*');\n let el;\n for (let i = 0; i < all.length; i++) {\n if (all[i].__vue__) {\n el = all[i];\n break;\n }\n }\n vueVersion = el ? 'unknown version' : undefined;\n }\n return vueVersion;\n}\nexport function isStorybook() {\n return window?.location?.href?.includes('localhost:6006');\n}\n"],"names":["angularVersion","angularJSVersion","reactVersion","vueVersion","getAngularVersion","useCache","appRoot","document","querySelector","getAttribute","undefined","getAngularJSVersion","window","angular","version","full","getReactVersion","CDS","_react","getVueVersion","all","querySelectorAll","el","i","length","__vue__","isStorybook","location","href","includes"],"mappings":"AASA,IAAIA,EACAC,EACAC,EACAC,EACG,SAASC,EAAkBC,GAAW,GACzC,IAAKA,IAAaL,EAAgB,CAC9B,MAAMM,EAAUC,UAAYA,SAASC,cAAc,gBACnDR,EAAiBM,EAAU,GAAGA,EAAQG,aAAa,mBAAkBC,EAEzE,OAAOV,EAEJ,SAASW,EAAoBN,GAAW,GAI3C,OAHKA,GAAaL,IACdC,EAAmBW,QAAQC,SAASC,SAASC,MAE1Cd,EAEJ,SAASe,EAAgBX,GAAW,GAYvC,OAXKA,GAAaH,IAEVA,EADAU,QAAQK,KAAKC,QAAQJ,QACNF,OAAOK,IAAIC,OAAOJ,QAE5BP,SAASC,cAAc,oCACb,uBAGAE,GAGhBR,EAEJ,SAASiB,EAAcd,GAAW,GACrC,IAAKA,IAAaF,EAAY,CAC1B,MAAMiB,EAAMb,SAASc,iBAAiB,KACtC,IAAIC,EACJ,IAAK,IAAIC,EAAI,EAAGA,EAAIH,EAAII,OAAQD,IAC5B,GAAIH,EAAIG,GAAGE,QAAS,CAChBH,EAAKF,EAAIG,GACT,MAGRpB,EAAamB,EAAK,uBAAoBZ,EAE1C,OAAOP,EAEJ,SAASuB,IACZ,OAAOd,QAAQe,UAAUC,MAAMC,SAAS"}
@@ -1,2 +1,2 @@
1
- import{isBrowser as e}from"./environment.js";import{getAngularVersion as n,getAngularJSVersion as o,getReactVersion as t,getVueVersion as i}from"./framework.js";import{browserFeatures as s}from"./supports.js";import{LogService as r}from"../services/log.service.js";function w(){e()&&(window.CDS=window.CDS||{_version:[],_react:{version:void 0},_supports:s.supports,_isStateProxied:!1,_state:{focusTrapItems:[],layerElements:[],i18nRegistry:{},elementRegistry:{},iconRegistry:{},motionRegistry:{}},environment:{production:!1},getDetails:a,logDetails:d},function(){const e="6.2.2";window.CDS._version.indexOf(e)<0&&(window.CDS._version.push(e),document.querySelector("body")?.setAttribute("cds-version",window.CDS._version.join(" "))),window.CDS._version.length>1&&r.warn("Running more than one version of Clarity can cause unexpected issues. Please ensure only one version is loaded.")}(),window.CDS._isStateProxied||(window.CDS._isStateProxied=!0,window.CDS._state=new Proxy(window.CDS._state,{set:(e,n,o)=>{const t={key:n,prev:window.CDS._state[n],current:o};return e[n]=o,document.dispatchEvent(new CustomEvent("CDS_STATE_UPDATE",{detail:t})),!0}})))}function a(){return{versions:window.CDS._version,environment:window.CDS.environment,userAgent:navigator.userAgent,supports:window.CDS._supports,angularVersion:n(!1),angularJSVersion:o(!1),reactVersion:t(!1),vueVersion:i(!1),state:{...window.CDS._state,iconRegistry:Object.keys(window.CDS._state.iconRegistry),motionRegistry:Object.keys(window.CDS._state.motionRegistry),focusTrapRegistry:Object.keys(window.CDS._state.focusTrapItems.map((e=>e.focusTrapId)))}}}function d(){r.log(JSON.stringify(a(),null,2))}export{w as setupCDSGlobal};
1
+ import{isBrowser as e}from"./environment.js";import{getAngularVersion as n,getAngularJSVersion as o,getReactVersion as t,getVueVersion as i}from"./framework.js";import{browserFeatures as s}from"./supports.js";import{LogService as r}from"../services/log.service.js";function w(){e()&&(window.CDS=window.CDS||{_version:[],_react:{version:void 0},_supports:s.supports,_isStateProxied:!1,_state:{focusTrapItems:[],layerElements:[],i18nRegistry:{},elementRegistry:{},iconRegistry:{},motionRegistry:{}},environment:{production:!1},getDetails:a,logDetails:d},function(){const e="6.2.4";window.CDS._version.indexOf(e)<0&&(window.CDS._version.push(e),document.querySelector("body")?.setAttribute("cds-version",window.CDS._version.join(" "))),window.CDS._version.length>1&&r.warn("Running more than one version of Clarity can cause unexpected issues. Please ensure only one version is loaded.")}(),window.CDS._isStateProxied||(window.CDS._isStateProxied=!0,window.CDS._state=new Proxy(window.CDS._state,{set:(e,n,o)=>{const t={key:n,prev:window.CDS._state[n],current:o};return e[n]=o,document.dispatchEvent(new CustomEvent("CDS_STATE_UPDATE",{detail:t})),!0}})))}function a(){return{versions:window.CDS._version,environment:window.CDS.environment,userAgent:navigator.userAgent,supports:window.CDS._supports,angularVersion:n(!1),angularJSVersion:o(!1),reactVersion:t(!1),vueVersion:i(!1),state:{...window.CDS._state,iconRegistry:Object.keys(window.CDS._state.iconRegistry),motionRegistry:Object.keys(window.CDS._state.motionRegistry),focusTrapRegistry:Object.keys(window.CDS._state.focusTrapItems.map((e=>e.focusTrapId)))}}}function d(){r.log(JSON.stringify(a(),null,2))}export{w as setupCDSGlobal};
2
2
  //# sourceMappingURL=global.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"global.js","sources":["../../../../src/internal/utils/global.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport { isBrowser } from './environment.js';\nimport { getAngularVersion, getReactVersion, getVueVersion, getAngularJSVersion } from './framework.js';\nimport { browserFeatures } from './supports.js';\nimport { LogService } from '../services/log.service.js';\nexport function setupCDSGlobal() {\n if (isBrowser()) {\n initializeCDSGlobal();\n setRunningVersion();\n intializeCDSStateProxy();\n }\n}\nfunction intializeCDSStateProxy() {\n if (!window.CDS._isStateProxied) {\n window.CDS._isStateProxied = true;\n window.CDS._state = new Proxy(window.CDS._state, {\n set: (target, key, value) => {\n const detail = { key, prev: window.CDS._state[key], current: value };\n target[key] = value;\n document.dispatchEvent(new CustomEvent('CDS_STATE_UPDATE', { detail }));\n return true;\n },\n });\n }\n}\nfunction getDetails() {\n return {\n versions: window.CDS._version,\n environment: window.CDS.environment,\n userAgent: navigator.userAgent,\n supports: window.CDS._supports,\n angularVersion: getAngularVersion(false),\n angularJSVersion: getAngularJSVersion(false),\n reactVersion: getReactVersion(false),\n vueVersion: getVueVersion(false),\n state: {\n ...window.CDS._state,\n iconRegistry: Object.keys(window.CDS._state.iconRegistry),\n motionRegistry: Object.keys(window.CDS._state.motionRegistry),\n focusTrapRegistry: Object.keys(window.CDS._state.focusTrapItems.map(i => i.focusTrapId)),\n },\n };\n}\nfunction logDetails() {\n LogService.log(JSON.stringify(getDetails(), null, 2));\n}\nfunction initializeCDSGlobal() {\n window.CDS = window.CDS || {\n _version: [],\n _react: { version: undefined },\n _supports: browserFeatures.supports,\n _isStateProxied: false,\n _state: {\n focusTrapItems: [],\n layerElements: [],\n i18nRegistry: {},\n elementRegistry: {},\n iconRegistry: {},\n motionRegistry: {},\n },\n environment: {\n production: false,\n },\n getDetails,\n logDetails,\n };\n}\nfunction setRunningVersion() {\n const loadedVersion = 'PACKAGE_VERSION';\n if (window.CDS._version.indexOf(loadedVersion) < 0) {\n window.CDS._version.push(loadedVersion);\n document.querySelector('body')?.setAttribute('cds-version', window.CDS._version.join(' '));\n }\n if (window.CDS._version.length > 1) {\n LogService.warn('Running more than one version of Clarity can cause unexpected issues. Please ensure only one version is loaded.');\n }\n}\n"],"names":["setupCDSGlobal","isBrowser","window","CDS","_version","_react","version","undefined","_supports","browserFeatures","supports","_isStateProxied","_state","focusTrapItems","layerElements","i18nRegistry","elementRegistry","iconRegistry","motionRegistry","environment","production","getDetails","logDetails","loadedVersion","indexOf","push","document","querySelector","setAttribute","join","length","LogService","warn","setRunningVersion","Proxy","set","target","key","value","detail","prev","current","dispatchEvent","CustomEvent","versions","userAgent","navigator","angularVersion","getAngularVersion","angularJSVersion","getAngularJSVersion","reactVersion","getReactVersion","vueVersion","getVueVersion","state","Object","keys","focusTrapRegistry","map","i","focusTrapId","log","JSON","stringify"],"mappings":"yQASO,SAASA,IACRC,MAyCJC,OAAOC,IAAMD,OAAOC,KAAO,CACvBC,SAAU,GACVC,OAAQ,CAAEC,aAASC,GACnBC,UAAWC,EAAgBC,SAC3BC,iBAAiB,EACjBC,OAAQ,CACJC,eAAgB,GAChBC,cAAe,GACfC,aAAc,GACdC,gBAAiB,GACjBC,aAAc,GACdC,eAAgB,IAEpBC,YAAa,CACTC,YAAY,GAEhBC,WAAAA,EACAC,WAAAA,GAGR,WACI,MAAMC,EAAgB,kBAClBrB,OAAOC,IAAIC,SAASoB,QAAQD,GAAiB,IAC7CrB,OAAOC,IAAIC,SAASqB,KAAKF,GACzBG,SAASC,cAAc,SAASC,aAAa,cAAe1B,OAAOC,IAAIC,SAASyB,KAAK,OAErF3B,OAAOC,IAAIC,SAAS0B,OAAS,GAC7BC,EAAWC,KAAK,mHAlEhBC,GAKC/B,OAAOC,IAAIQ,kBACZT,OAAOC,IAAIQ,iBAAkB,EAC7BT,OAAOC,IAAIS,OAAS,IAAIsB,MAAMhC,OAAOC,IAAIS,OAAQ,CAC7CuB,IAAK,CAACC,EAAQC,EAAKC,KACf,MAAMC,EAAS,CAAEF,IAAAA,EAAKG,KAAMtC,OAAOC,IAAIS,OAAOyB,GAAMI,QAASH,GAG7D,OAFAF,EAAOC,GAAOC,EACdZ,SAASgB,cAAc,IAAIC,YAAY,mBAAoB,CAAEJ,OAAAA,MACtD,OAKvB,SAASlB,IACL,MAAO,CACHuB,SAAU1C,OAAOC,IAAIC,SACrBe,YAAajB,OAAOC,IAAIgB,YACxB0B,UAAWC,UAAUD,UACrBnC,SAAUR,OAAOC,IAAIK,UACrBuC,eAAgBC,GAAkB,GAClCC,iBAAkBC,GAAoB,GACtCC,aAAcC,GAAgB,GAC9BC,WAAYC,GAAc,GAC1BC,MAAO,IACArD,OAAOC,IAAIS,OACdK,aAAcuC,OAAOC,KAAKvD,OAAOC,IAAIS,OAAOK,cAC5CC,eAAgBsC,OAAOC,KAAKvD,OAAOC,IAAIS,OAAOM,gBAC9CwC,kBAAmBF,OAAOC,KAAKvD,OAAOC,IAAIS,OAAOC,eAAe8C,KAAIC,GAAKA,EAAEC,iBAIvF,SAASvC,IACLS,EAAW+B,IAAIC,KAAKC,UAAU3C,IAAc,KAAM"}
1
+ {"version":3,"file":"global.js","sources":["../../../../src/internal/utils/global.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport { isBrowser } from './environment.js';\nimport { getAngularVersion, getReactVersion, getVueVersion, getAngularJSVersion } from './framework.js';\nimport { browserFeatures } from './supports.js';\nimport { LogService } from '../services/log.service.js';\nexport function setupCDSGlobal() {\n if (isBrowser()) {\n initializeCDSGlobal();\n setRunningVersion();\n intializeCDSStateProxy();\n }\n}\nfunction intializeCDSStateProxy() {\n if (!window.CDS._isStateProxied) {\n window.CDS._isStateProxied = true;\n window.CDS._state = new Proxy(window.CDS._state, {\n set: (target, key, value) => {\n const detail = { key, prev: window.CDS._state[key], current: value };\n target[key] = value;\n document.dispatchEvent(new CustomEvent('CDS_STATE_UPDATE', { detail }));\n return true;\n },\n });\n }\n}\nfunction getDetails() {\n return {\n versions: window.CDS._version,\n environment: window.CDS.environment,\n userAgent: navigator.userAgent,\n supports: window.CDS._supports,\n angularVersion: getAngularVersion(false),\n angularJSVersion: getAngularJSVersion(false),\n reactVersion: getReactVersion(false),\n vueVersion: getVueVersion(false),\n state: {\n ...window.CDS._state,\n iconRegistry: Object.keys(window.CDS._state.iconRegistry),\n motionRegistry: Object.keys(window.CDS._state.motionRegistry),\n focusTrapRegistry: Object.keys(window.CDS._state.focusTrapItems.map(i => i.focusTrapId)),\n },\n };\n}\nfunction logDetails() {\n LogService.log(JSON.stringify(getDetails(), null, 2));\n}\nfunction initializeCDSGlobal() {\n window.CDS = window.CDS || {\n _version: [],\n _react: { version: undefined },\n _supports: browserFeatures.supports,\n _isStateProxied: false,\n _state: {\n focusTrapItems: [],\n layerElements: [],\n i18nRegistry: {},\n elementRegistry: {},\n iconRegistry: {},\n motionRegistry: {},\n },\n environment: {\n production: false,\n },\n getDetails,\n logDetails,\n };\n}\nfunction setRunningVersion() {\n const loadedVersion = 'PACKAGE_VERSION';\n if (window.CDS._version.indexOf(loadedVersion) < 0) {\n window.CDS._version.push(loadedVersion);\n document.querySelector('body')?.setAttribute('cds-version', window.CDS._version.join(' '));\n }\n if (window.CDS._version.length > 1) {\n LogService.warn('Running more than one version of Clarity can cause unexpected issues. Please ensure only one version is loaded.');\n }\n}\n"],"names":["setupCDSGlobal","isBrowser","window","CDS","_version","_react","version","undefined","_supports","browserFeatures","supports","_isStateProxied","_state","focusTrapItems","layerElements","i18nRegistry","elementRegistry","iconRegistry","motionRegistry","environment","production","getDetails","logDetails","loadedVersion","indexOf","push","document","querySelector","setAttribute","join","length","LogService","warn","setRunningVersion","Proxy","set","target","key","value","detail","prev","current","dispatchEvent","CustomEvent","versions","userAgent","navigator","angularVersion","getAngularVersion","angularJSVersion","getAngularJSVersion","reactVersion","getReactVersion","vueVersion","getVueVersion","state","Object","keys","focusTrapRegistry","map","i","focusTrapId","log","JSON","stringify"],"mappings":"yQASO,SAASA,IACRC,MAyCJC,OAAOC,IAAMD,OAAOC,KAAO,CACvBC,SAAU,GACVC,OAAQ,CAAEC,aAASC,GACnBC,UAAWC,EAAgBC,SAC3BC,iBAAiB,EACjBC,OAAQ,CACJC,eAAgB,GAChBC,cAAe,GACfC,aAAc,GACdC,gBAAiB,GACjBC,aAAc,GACdC,eAAgB,IAEpBC,YAAa,CACTC,YAAY,GAEhBC,WAAAA,EACAC,WAAAA,GAGR,WACI,MAAMC,EAAgB,kBAClBrB,OAAOC,IAAIC,SAASoB,QAAQD,GAAiB,IAC7CrB,OAAOC,IAAIC,SAASqB,KAAKF,GACzBG,SAASC,cAAc,SAASC,aAAa,cAAe1B,OAAOC,IAAIC,SAASyB,KAAK,OAErF3B,OAAOC,IAAIC,SAAS0B,OAAS,GAC7BC,EAAWC,KAAK,mHAlEhBC,GAKC/B,OAAOC,IAAIQ,kBACZT,OAAOC,IAAIQ,iBAAkB,EAC7BT,OAAOC,IAAIS,OAAS,IAAIsB,MAAMhC,OAAOC,IAAIS,OAAQ,CAC7CuB,IAAK,CAACC,EAAQC,EAAKC,KACf,MAAMC,EAAS,CAAEF,IAAAA,EAAKG,KAAMtC,OAAOC,IAAIS,OAAOyB,GAAMI,QAASH,GAG7D,OAFAF,EAAOC,GAAOC,EACdZ,SAASgB,cAAc,IAAIC,YAAY,mBAAoB,CAAEJ,OAAAA,MACtD,OAKvB,SAASlB,IACL,MAAO,CACHuB,SAAU1C,OAAOC,IAAIC,SACrBe,YAAajB,OAAOC,IAAIgB,YACxB0B,UAAWC,UAAUD,UACrBnC,SAAUR,OAAOC,IAAIK,UACrBuC,eAAgBC,GAAkB,GAClCC,iBAAkBC,GAAoB,GACtCC,aAAcC,GAAgB,GAC9BC,WAAYC,GAAc,GAC1BC,MAAO,IACArD,OAAOC,IAAIS,OACdK,aAAcuC,OAAOC,KAAKvD,OAAOC,IAAIS,OAAOK,cAC5CC,eAAgBsC,OAAOC,KAAKvD,OAAOC,IAAIS,OAAOM,gBAC9CwC,kBAAmBF,OAAOC,KAAKvD,OAAOC,IAAIS,OAAOC,eAAe8C,KAAIC,GAAKA,EAAEC,iBAIvF,SAASvC,IACLS,EAAW+B,IAAIC,KAAKC,UAAU3C,IAAc,KAAM"}
@@ -1 +1 @@
1
- {"version":3,"file":"identity.js","sources":["../../../../src/internal/utils/identity.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport is from 'ramda/es/is.js';\nimport isEmpty from 'ramda/es/isEmpty.js';\nexport function isNil(val) {\n return val === null || val === undefined;\n}\nexport function isNilOrEmpty(val) {\n return isNil(val) || isEmpty(val);\n}\nexport function isString(val) {\n return is(String, val);\n}\nexport function isNumericString(val) {\n return isString(val) && !isEmpty(val.trim()) && +val === +val;\n}\nexport function isStringOrNil(val) {\n return is(String, val) || isNil(val);\n}\nexport function isStringAndNotNilOrEmpty(val) {\n return isString(val) && !isNil(val) && !isEmpty(val);\n}\nexport function isObject(val) {\n return is(Object, val);\n}\nexport function isMap(val) {\n return is(Map, val);\n}\nexport function isObjectAndNotNilOrEmpty(val) {\n return !isNilOrEmpty(val) && isObject(val);\n}\nexport function hasPropertyChanged(val, oldVal) {\n return val !== oldVal;\n}\n// marks nil values (undefined, null, empty string) as changed\nexport function hasStringPropertyChanged(val, oldVal) {\n return isStringOrNil(val) && hasPropertyChanged(val, oldVal);\n}\n// ignores nil values when checking for changes\nexport function hasStringPropertyChangedAndNotNil(val, oldVal) {\n return !isNilOrEmpty(val) && hasPropertyChanged(val, oldVal);\n}\nexport function getEnumValues(enumeration) {\n return Object.values(enumeration);\n}\nexport function createId(prefix = '_') {\n return `${prefix}${Math.random().toString(36).substr(2, 9)}`;\n}\n// simplistic way to test objects for equality\n// note that it ignores/removes methods from objects\nexport function objectNaiveDeepEquals(obj1, obj2) {\n return JSON.stringify(obj1) === JSON.stringify(obj2);\n}\nexport function getFromObjectPath(path, dataObj, fallback = `$\\{${path}}`) {\n return path.split('.').reduce((res, key) => {\n try {\n const val = res[key];\n switch (true) {\n case val === null:\n case val === false:\n case val === '':\n case val === 0:\n return val;\n default:\n return val || fallback;\n }\n }\n catch {\n return fallback;\n }\n }, dataObj);\n}\n// used by deepClone() tested through integration\nfunction cloneMap(mp) {\n const clonedMap = new Map();\n for (const [key, val] of mp) {\n if (isMap(val)) {\n clonedMap.set(key, cloneMap(val));\n }\n else {\n clonedMap.set(key, val);\n }\n }\n return clonedMap;\n}\nexport function deepClone(obj) {\n // this will clone almost anything (maps, arrays, objects, etc.) to the lowest of the low levels\n // be careful using this carelessly b/c it CAN have performance implications!\n switch (true) {\n case isMap(obj):\n return cloneMap(obj);\n case isObject(obj) && !Array.isArray(obj):\n return mergeObjects({}, obj);\n default:\n return JSON.parse(JSON.stringify(obj));\n }\n}\n/* c8 ignore next 2 */\nexport function convertAttributeStringValuesToValue(stringValue) {\n switch (true) {\n case stringValue === 'true':\n return true;\n case stringValue === 'false':\n return false;\n case stringValue === 'null':\n return null;\n case stringValue === 'undefined':\n return void 0; // undefined\n case isNumericString(stringValue):\n return +stringValue;\n default:\n // else it's a string and that's ok\n return stringValue;\n }\n}\n// this utility is a little restrictive on its inputs. it expects a specific format.\n// going outside of that format (like passing an object or function as the value) can yield unintended results.\n// this does NOT eval anything. that would be bad.\n// 'isValid:true status:success': string =>\n// [['isValid', true], ['status', 'success']]: [string, string | number | boolean][]\nexport function convertStringPropValuePairsToTuple(propValString) {\n // starts as a string like... \"isValid:true status:success\"\n return propValString\n .split(' ')\n .map(str => str.split(':'))\n .map(pv => {\n const [propname, propValAsString] = pv;\n return [propname, convertAttributeStringValuesToValue(propValAsString)];\n });\n // returns as [['isValid', true], ['status', 'success']]\n}\nexport function anyOrAllPropertiesPass(obj, propValuePairs, anyOrAll) {\n if (!propValuePairs) {\n return true;\n }\n const tests = convertStringPropValuePairsToTuple(propValuePairs);\n if (!obj) {\n return false;\n }\n if (tests.length < 1) {\n return true;\n }\n else {\n const testResults = tests.filter(pvArry => {\n const [propname, expectedVal] = pvArry;\n return doesPropertyPass(obj, propname, expectedVal);\n });\n return anyOrAll === 'all' ? testResults.length === tests.length : testResults.length > 0;\n }\n}\nexport function allPropertiesPass(obj, propValuePairs) {\n return anyOrAllPropertiesPass(obj, propValuePairs, 'all');\n}\nexport function anyPropertiesPass(obj, propValuePairs) {\n return anyOrAllPropertiesPass(obj, propValuePairs, 'any');\n}\n// TODO: BREAK THIS UP. TRIED ONCE. TOO CONVOLUTED.\n/**\n * This function takes an object (e.g. { ohai: 'hello', count: 2 }) or an Element\n * (e.g. <p ohai=\"hello\" count=\"2\">i am an html element</p>).\n *\n * It also takes a string that represents a potential property or attribute on the\n * object or element (e.g. \"ohai\" or \"count\").\n *\n * Lastly, it takes a potential value for the potential property or attribute\n * (e.g. \"hello\" or 2).\n *\n * If the object/element has the string as a property or attribute and the value\n * of the property/attribute equals the expected value, it returns true. If not,\n * it returns false.\n *\n * This code is the brains behind our \"key:value\" strings found in Clarity Motion.\n * (e.g. { hidden: true, onlyIf: \"responsive:false\", animation: ...})\n *\n * @export\n * @param {*} objectOrElement\n * @param {string} propertyOrAttributeName\n * @param {(string | number | boolean | null | undefined)} expectedValue\n * @returns {boolean}\n */\nexport function doesPropertyPass(objectOrElement, propertyOrAttributeName, expectedValue) {\n if (propertyOrAttributeName in objectOrElement) {\n // test expected key/value as object property first because it's less complicated\n if (expectedValue === false) {\n return !objectOrElement[propertyOrAttributeName];\n }\n else {\n return objectOrElement[propertyOrAttributeName] === expectedValue;\n }\n }\n else if (objectOrElement.hasAttribute &&\n objectOrElement.hasAttribute(propertyOrAttributeName)) {\n // test expected key/value as if an attribute on an element\n const propAsAttributeValue = objectOrElement.hasAttribute(propertyOrAttributeName) &&\n objectOrElement.getAttribute(propertyOrAttributeName);\n // sometimes attribute values can get set as string representations of\n // falsy states (see: boolean attribute with a string \"false\" value).\n // this catches that and less likely but still problematic misstep of\n // hard-setting with a string of \"undefined\" or \"null\"\n if (['null', 'false', 'undefined'].indexOf(propAsAttributeValue) > -1) {\n switch (expectedValue) {\n case null:\n return propAsAttributeValue === 'null';\n case false:\n return propAsAttributeValue === 'false';\n default:\n return !expectedValue;\n }\n }\n else {\n // after handling the weird edge case above, this is the more straightforward\n // value check.\n switch (expectedValue) {\n case false:\n return !propAsAttributeValue || propAsAttributeValue === 'false';\n case true:\n return propAsAttributeValue === '' || propAsAttributeValue === 'true';\n default:\n return propAsAttributeValue === expectedValue.toString();\n }\n }\n }\n else {\n // this is not an object property or an attribute on an element attribute so we need\n // to verify if it's expected to be undefined or false. If so, the attribute not being\n // present on the element (see: boolean attrs) meets expectations and return true.\n return ((!objectOrElement.hasAttribute && (expectedValue === false || expectedValue === undefined)) || false);\n }\n}\nexport function allAre(testFn, ...itemsToCheck) {\n return itemsToCheck.map(item => testFn(item)).indexOf(false) < 0;\n}\nexport function allAreDefined(...items) {\n const testFn = (val) => {\n return val !== undefined;\n };\n return allAre(testFn, ...items);\n}\nexport function mergeObjects(...objs) {\n const returnObj = {};\n const clones = objs.map(o => {\n // cloning here so we don't get messed up with object references\n return isObject(o) ? { ...o } : {};\n });\n clones.forEach(srcObj => {\n Object.keys(srcObj).forEach(prop => {\n const propVal = srcObj[prop];\n if (Array.isArray(propVal)) {\n returnObj[prop] = Array.from(propVal);\n }\n else if (isObject(propVal)) {\n returnObj[prop] = mergeObjects(returnObj[prop] || {}, propVal);\n }\n else {\n returnObj[prop] = propVal;\n }\n });\n });\n return returnObj;\n}\n"],"names":["isNil","val","isNilOrEmpty","isEmpty","isString","is","String","isNumericString","trim","isStringOrNil","isStringAndNotNilOrEmpty","isObject","Object","isMap","Map","isObjectAndNotNilOrEmpty","hasPropertyChanged","oldVal","hasStringPropertyChanged","hasStringPropertyChangedAndNotNil","getEnumValues","enumeration","values","createId","prefix","Math","random","toString","substr","objectNaiveDeepEquals","obj1","obj2","JSON","stringify","getFromObjectPath","path","dataObj","fallback","split","reduce","res","key","cloneMap","mp","clonedMap","set","deepClone","obj","Array","isArray","mergeObjects","parse","convertAttributeStringValuesToValue","stringValue","convertStringPropValuePairsToTuple","propValString","map","str","pv","propname","propValAsString","anyOrAllPropertiesPass","propValuePairs","anyOrAll","tests","length","testResults","filter","pvArry","expectedVal","doesPropertyPass","allPropertiesPass","anyPropertiesPass","objectOrElement","propertyOrAttributeName","expectedValue","hasAttribute","undefined","propAsAttributeValue","getAttribute","indexOf","allAre","testFn","itemsToCheck","item","allAreDefined","items","objs","returnObj","o","forEach","srcObj","keys","prop","propVal","from"],"mappings":"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"}
1
+ {"version":3,"file":"identity.js","sources":["../../../../src/internal/utils/identity.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport is from 'ramda/es/is.js';\nimport isEmpty from 'ramda/es/isEmpty.js';\nexport function isNil(val) {\n return val === null || val === undefined;\n}\nexport function isNilOrEmpty(val) {\n return isNil(val) || isEmpty(val);\n}\nexport function isString(val) {\n return is(String, val);\n}\nexport function isNumericString(val) {\n return isString(val) && !isEmpty(val.trim()) && +val === +val;\n}\nexport function isStringOrNil(val) {\n return is(String, val) || isNil(val);\n}\nexport function isStringAndNotNilOrEmpty(val) {\n return isString(val) && !isNil(val) && !isEmpty(val);\n}\nexport function isObject(val) {\n return is(Object, val);\n}\nexport function isMap(val) {\n return is(Map, val);\n}\nexport function isObjectAndNotNilOrEmpty(val) {\n return !isNilOrEmpty(val) && isObject(val);\n}\nexport function hasPropertyChanged(val, oldVal) {\n return val !== oldVal;\n}\n// marks nil values (undefined, null, empty string) as changed\nexport function hasStringPropertyChanged(val, oldVal) {\n return isStringOrNil(val) && hasPropertyChanged(val, oldVal);\n}\n// ignores nil values when checking for changes\nexport function hasStringPropertyChangedAndNotNil(val, oldVal) {\n return !isNilOrEmpty(val) && hasPropertyChanged(val, oldVal);\n}\nexport function getEnumValues(enumeration) {\n return Object.values(enumeration);\n}\nexport function createId(prefix = '_') {\n return `${prefix}${Math.random().toString(36).substr(2, 9)}`;\n}\n// simplistic way to test objects for equality\n// note that it ignores/removes methods from objects\nexport function objectNaiveDeepEquals(obj1, obj2) {\n return JSON.stringify(obj1) === JSON.stringify(obj2);\n}\nexport function getFromObjectPath(path, dataObj, fallback = `$\\{${path}}`) {\n return path.split('.').reduce((res, key) => {\n try {\n const val = res[key];\n switch (true) {\n case val === null:\n case val === false:\n case val === '':\n case val === 0:\n return val;\n default:\n return val || fallback;\n }\n }\n catch {\n return fallback;\n }\n }, dataObj);\n}\n// used by deepClone() tested through integration\nfunction cloneMap(mp) {\n const clonedMap = new Map();\n for (const [key, val] of mp) {\n if (isMap(val)) {\n clonedMap.set(key, cloneMap(val));\n }\n else {\n clonedMap.set(key, val);\n }\n }\n return clonedMap;\n}\nexport function deepClone(obj) {\n // this will clone almost anything (maps, arrays, objects, etc.) to the lowest of the low levels\n // be careful using this carelessly b/c it CAN have performance implications!\n switch (true) {\n case isMap(obj):\n return cloneMap(obj);\n case isObject(obj) && !Array.isArray(obj):\n return mergeObjects({}, obj);\n default:\n return JSON.parse(JSON.stringify(obj));\n }\n}\n/* c8 ignore next 2 */\nexport function convertAttributeStringValuesToValue(stringValue) {\n switch (true) {\n case stringValue === 'true':\n return true;\n case stringValue === 'false':\n return false;\n case stringValue === 'null':\n return null;\n case stringValue === 'undefined':\n return void 0; // undefined\n case isNumericString(stringValue):\n return +stringValue;\n default:\n // else it's a string and that's ok\n return stringValue;\n }\n}\n// this utility is a little restrictive on its inputs. it expects a specific format.\n// going outside of that format (like passing an object or function as the value) can yield unintended results.\n// this does NOT eval anything. that would be bad.\n// 'isValid:true status:success': string =>\n// [['isValid', true], ['status', 'success']]: [string, string | number | boolean][]\nexport function convertStringPropValuePairsToTuple(propValString) {\n // starts as a string like... \"isValid:true status:success\"\n return propValString\n .split(' ')\n .map(str => str.split(':'))\n .map(pv => {\n const [propname, propValAsString] = pv;\n return [propname, convertAttributeStringValuesToValue(propValAsString)];\n });\n // returns as [['isValid', true], ['status', 'success']]\n}\nexport function anyOrAllPropertiesPass(obj, propValuePairs, anyOrAll) {\n if (!propValuePairs) {\n return true;\n }\n const tests = convertStringPropValuePairsToTuple(propValuePairs);\n if (!obj) {\n return false;\n }\n if (tests.length < 1) {\n return true;\n }\n else {\n const testResults = tests.filter(pvArry => {\n const [propname, expectedVal] = pvArry;\n return doesPropertyPass(obj, propname, expectedVal);\n });\n return anyOrAll === 'all' ? testResults.length === tests.length : testResults.length > 0;\n }\n}\nexport function allPropertiesPass(obj, propValuePairs) {\n return anyOrAllPropertiesPass(obj, propValuePairs, 'all');\n}\nexport function anyPropertiesPass(obj, propValuePairs) {\n return anyOrAllPropertiesPass(obj, propValuePairs, 'any');\n}\n// TODO: BREAK THIS UP. TRIED ONCE. TOO CONVOLUTED.\n/**\n * This function takes an object (e.g. { ohai: 'hello', count: 2 }) or an Element\n * (e.g. <p ohai=\"hello\" count=\"2\">i am an html element</p>).\n *\n * It also takes a string that represents a potential property or attribute on the\n * object or element (e.g. \"ohai\" or \"count\").\n *\n * Lastly, it takes a potential value for the potential property or attribute\n * (e.g. \"hello\" or 2).\n *\n * If the object/element has the string as a property or attribute and the value\n * of the property/attribute equals the expected value, it returns true. If not,\n * it returns false.\n *\n * This code is the brains behind our \"key:value\" strings found in Clarity Motion.\n * (e.g. { hidden: true, onlyIf: \"responsive:false\", animation: ...})\n *\n * @export\n * @param {*} objectOrElement\n * @param {string} propertyOrAttributeName\n * @param {(string | number | boolean | null | undefined)} expectedValue\n * @returns {boolean}\n */\nexport function doesPropertyPass(objectOrElement, propertyOrAttributeName, expectedValue) {\n if (propertyOrAttributeName in objectOrElement) {\n // test expected key/value as object property first because it's less complicated\n if (expectedValue === false) {\n return !objectOrElement[propertyOrAttributeName];\n }\n else {\n return objectOrElement[propertyOrAttributeName] === expectedValue;\n }\n }\n else if (objectOrElement.hasAttribute &&\n objectOrElement.hasAttribute(propertyOrAttributeName)) {\n // test expected key/value as if an attribute on an element\n const propAsAttributeValue = objectOrElement.hasAttribute(propertyOrAttributeName) &&\n objectOrElement.getAttribute(propertyOrAttributeName);\n // sometimes attribute values can get set as string representations of\n // falsy states (see: boolean attribute with a string \"false\" value).\n // this catches that and less likely but still problematic misstep of\n // hard-setting with a string of \"undefined\" or \"null\"\n if (['null', 'false', 'undefined'].indexOf(propAsAttributeValue) > -1) {\n switch (expectedValue) {\n case null:\n return propAsAttributeValue === 'null';\n case false:\n return propAsAttributeValue === 'false';\n default:\n return !expectedValue;\n }\n }\n else {\n // after handling the weird edge case above, this is the more straightforward\n // value check.\n switch (expectedValue) {\n case false:\n return !propAsAttributeValue || propAsAttributeValue === 'false';\n case true:\n return propAsAttributeValue === '' || propAsAttributeValue === 'true';\n default:\n return propAsAttributeValue === expectedValue.toString();\n }\n }\n }\n else {\n // this is not an object property or an attribute on an element attribute so we need\n // to verify if it's expected to be undefined or false. If so, the attribute not being\n // present on the element (see: boolean attrs) meets expectations and return true.\n return ((!objectOrElement.hasAttribute && (expectedValue === false || expectedValue === undefined)) || false);\n }\n}\nexport function allAre(testFn, ...itemsToCheck) {\n return itemsToCheck.map(item => testFn(item)).indexOf(false) < 0;\n}\nexport function allAreDefined(...items) {\n const testFn = (val) => {\n return val !== undefined;\n };\n return allAre(testFn, ...items);\n}\nexport function mergeObjects(...objs) {\n const returnObj = {};\n const clones = objs.map(o => {\n // cloning here so we don't get messed up with object references\n return isObject(o) ? { ...o } : {};\n });\n clones.forEach(srcObj => {\n Object.keys(srcObj).forEach(prop => {\n const propVal = srcObj[prop];\n if (Array.isArray(propVal)) {\n returnObj[prop] = Array.from(propVal);\n }\n else if (isObject(propVal)) {\n returnObj[prop] = mergeObjects(returnObj[prop] || {}, propVal);\n }\n else {\n returnObj[prop] = propVal;\n }\n });\n });\n return returnObj;\n}\n"],"names":["isNil","val","isNilOrEmpty","isEmpty","isString","is","String","isNumericString","trim","isStringOrNil","isStringAndNotNilOrEmpty","isObject","Object","isMap","Map","isObjectAndNotNilOrEmpty","hasPropertyChanged","oldVal","hasStringPropertyChanged","hasStringPropertyChangedAndNotNil","getEnumValues","enumeration","values","createId","prefix","Math","random","toString","substr","objectNaiveDeepEquals","obj1","obj2","JSON","stringify","getFromObjectPath","path","dataObj","fallback","split","reduce","res","key","cloneMap","mp","clonedMap","set","deepClone","obj","Array","isArray","mergeObjects","parse","convertAttributeStringValuesToValue","stringValue","convertStringPropValuePairsToTuple","propValString","map","str","pv","propname","propValAsString","anyOrAllPropertiesPass","propValuePairs","anyOrAll","tests","length","testResults","filter","pvArry","expectedVal","doesPropertyPass","allPropertiesPass","anyPropertiesPass","objectOrElement","propertyOrAttributeName","expectedValue","hasAttribute","undefined","propAsAttributeValue","getAttribute","indexOf","allAre","testFn","itemsToCheck","item","allAreDefined","items","objs","returnObj","o","forEach","srcObj","keys","prop","propVal","from"],"mappings":"iEAOO,SAASA,EAAMC,GAClB,OAAOA,MAAAA,EAEJ,SAASC,EAAaD,GACzB,OAAOD,EAAMC,IAAQE,EAAQF,GAE1B,SAASG,EAASH,GACrB,OAAOI,EAAGC,OAAQL,GAEf,SAASM,EAAgBN,GAC5B,OAAOG,EAASH,KAASE,EAAQF,EAAIO,UAAYP,IAASA,EAEvD,SAASQ,EAAcR,GAC1B,OAAOI,EAAGC,OAAQL,IAAQD,EAAMC,GAE7B,SAASS,EAAyBT,GACrC,OAAOG,EAASH,KAASD,EAAMC,KAASE,EAAQF,GAE7C,SAASU,EAASV,GACrB,OAAOI,EAAGO,OAAQX,GAEf,SAASY,EAAMZ,GAClB,OAAOI,EAAGS,IAAKb,GAEZ,SAASc,EAAyBd,GACrC,OAAQC,EAAaD,IAAQU,EAASV,GAEnC,SAASe,EAAmBf,EAAKgB,GACpC,OAAOhB,IAAQgB,EAGZ,SAASC,EAAyBjB,EAAKgB,GAC1C,OAAOR,EAAcR,IAAQe,EAAmBf,EAAKgB,GAGlD,SAASE,EAAkClB,EAAKgB,GACnD,OAAQf,EAAaD,IAAQe,EAAmBf,EAAKgB,GAElD,SAASG,EAAcC,GAC1B,OAAOT,OAAOU,OAAOD,GAElB,SAASE,EAASC,EAAS,KAC9B,MAAO,GAAGA,IAASC,KAAKC,SAASC,SAAS,IAAIC,OAAO,EAAG,KAIrD,SAASC,EAAsBC,EAAMC,GACxC,OAAOC,KAAKC,UAAUH,KAAUE,KAAKC,UAAUF,GAE5C,SAASG,EAAkBC,EAAMC,EAASC,EAAW,MAAMF,MAC9D,OAAOA,EAAKG,MAAM,KAAKC,QAAO,CAACC,EAAKC,KAChC,IACI,MAAMxC,EAAMuC,EAAIC,GAChB,QAAQ,GACJ,KAAa,OAARxC,EACL,KAAa,IAARA,EACL,IAAa,KAARA,EACL,KAAa,IAARA,EACD,OAAOA,EACX,QACI,OAAOA,GAAOoC,GAG1B,MACI,OAAOA,KAEZD,GAGP,SAASM,EAASC,GACd,MAAMC,EAAY,IAAI9B,IACtB,IAAK,MAAO2B,EAAKxC,KAAQ0C,EACjB9B,EAAMZ,GACN2C,EAAUC,IAAIJ,EAAKC,EAASzC,IAG5B2C,EAAUC,IAAIJ,EAAKxC,GAG3B,OAAO2C,EAEJ,SAASE,EAAUC,GAGtB,QAAQ,GACJ,KAAKlC,EAAMkC,GACP,OAAOL,EAASK,GACpB,KAAKpC,EAASoC,KAASC,MAAMC,QAAQF,GACjC,OAAOG,EAAa,GAAIH,GAC5B,QACI,OAAOf,KAAKmB,MAAMnB,KAAKC,UAAUc,KAItC,SAASK,EAAoCC,GAChD,QAAQ,GACJ,IAAqB,SAAhBA,EACD,OAAO,EACX,IAAqB,UAAhBA,EACD,OAAO,EACX,IAAqB,SAAhBA,EACD,OAAO,KACX,IAAqB,cAAhBA,EACD,OACJ,KAAK9C,EAAgB8C,GACjB,OAAQA,EACZ,QAEI,OAAOA,GAQZ,SAASC,EAAmCC,GAE/C,OAAOA,EACFjB,MAAM,KACNkB,KAAIC,GAAOA,EAAInB,MAAM,OACrBkB,KAAIE,IACL,MAAOC,EAAUC,GAAmBF,EACpC,MAAO,CAACC,EAAUP,EAAoCQ,OAIvD,SAASC,EAAuBd,EAAKe,EAAgBC,GACxD,IAAKD,EACD,OAAO,EAEX,MAAME,EAAQV,EAAmCQ,GACjD,IAAKf,EACD,OAAO,EAEX,GAAIiB,EAAMC,OAAS,EACf,OAAO,EAEN,CACD,MAAMC,EAAcF,EAAMG,QAAOC,IAC7B,MAAOT,EAAUU,GAAeD,EAChC,OAAOE,EAAiBvB,EAAKY,EAAUU,MAE3C,MAAoB,QAAbN,EAAqBG,EAAYD,SAAWD,EAAMC,OAASC,EAAYD,OAAS,GAGxF,SAASM,EAAkBxB,EAAKe,GACnC,OAAOD,EAAuBd,EAAKe,EAAgB,OAEhD,SAASU,EAAkBzB,EAAKe,GACnC,OAAOD,EAAuBd,EAAKe,EAAgB,OA0BhD,SAASQ,EAAiBG,EAAiBC,EAAyBC,GACvE,GAAID,KAA2BD,EAE3B,OAAsB,IAAlBE,GACQF,EAAgBC,GAGjBD,EAAgBC,KAA6BC,EAGvD,IAAIF,EAAgBG,eACrBH,EAAgBG,aAAaF,GAmC7B,OAAUD,EAAgBG,gBAAmC,IAAlBD,QAA6CE,IAAlBF,KAAiC,EAnChD,CAEvD,MAAMG,EAAuBL,EAAgBG,aAAaF,IACtDD,EAAgBM,aAAaL,GAKjC,GAAI,CAAC,OAAQ,QAAS,aAAaM,QAAQF,IAAyB,EAChE,OAAQH,GACJ,KAAK,KACD,MAAgC,SAAzBG,EACX,KAAK,EACD,MAAgC,UAAzBA,EACX,QACI,OAAQH,OAMhB,OAAQA,GACJ,KAAK,EACD,OAAQG,GAAiD,UAAzBA,EACpC,KAAK,EACD,MAAgC,KAAzBA,GAAwD,SAAzBA,EAC1C,QACI,OAAOA,IAAyBH,EAAchD,aAW3D,SAASsD,EAAOC,KAAWC,GAC9B,OAAOA,EAAa3B,KAAI4B,GAAQF,EAAOE,KAAOJ,SAAQ,GAAS,EAE5D,SAASK,KAAiBC,GAI7B,OAAOL,GAHShF,QACG4E,IAAR5E,MAEcqF,GAEtB,SAASpC,KAAgBqC,GAC5B,MAAMC,EAAY,GAmBlB,OAlBeD,EAAK/B,KAAIiC,GAEb9E,EAAS8E,GAAK,IAAKA,GAAM,KAE7BC,SAAQC,IACX/E,OAAOgF,KAAKD,GAAQD,SAAQG,IACxB,MAAMC,EAAUH,EAAOE,GACnB7C,MAAMC,QAAQ6C,GACdN,EAAUK,GAAQ7C,MAAM+C,KAAKD,GAExBnF,EAASmF,GACdN,EAAUK,GAAQ3C,EAAasC,EAAUK,IAAS,GAAIC,GAGtDN,EAAUK,GAAQC,QAIvBN"}
@@ -1 +1 @@
1
- {"version":3,"file":"keycodes.js","sources":["../../../../src/internal/utils/keycodes.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport { KeyCodeService } from '../services/keycodes.service.js';\n/**\n * keyWasEvented() checks to see if a given key is part of any KeyboardEvent it is passed.\n */\nexport function keyWasEvented(evt, whichKey) {\n // evt.key support goes all the way back to IE9; we don't need evt.keyCode for IE support!\n return KeyCodeService.getCode(whichKey) === evt.key;\n}\n/**\n * checkModifierKey() tests if a special key (Ctrl, Alt, Meta, Shift) part of a KeyboardEvent.\n */\nfunction checkModifierKey(evt, key) {\n switch (key) {\n case 'ctrl':\n return evt.ctrlKey;\n case 'alt':\n return evt.altKey;\n case 'shift':\n return evt.shiftKey;\n case 'cmd':\n case 'win':\n case 'meta':\n return evt.metaKey;\n default:\n return false;\n }\n}\n// handlers -> single keys or any of a collection of keys\n/**\n * onKey() takes a single key and fires a handler if that key is part of\n * the KeyboardEvent it was passed.\n */\nexport function onKey(whichKey, evt, handler) {\n if (keyWasEvented(evt, whichKey)) {\n handler();\n }\n}\n/**\n * onAnyKey() takes an array of keys and fires a handler if any of the keys are part of\n * the KeyboardEvent it was passed.\n */\nexport function onAnyKey(whichKeys, evt, handler) {\n const eventedKeys = whichKeys.filter(k => {\n return keyWasEvented(evt, k);\n });\n if (eventedKeys.length > 0) {\n handler();\n }\n}\n// key combos\n/**\n * onKeyCombo() takes a string representation of a combination of keys and modifier keys such as\n * 'ctrl+shift+a'.\n *\n * onKeyCombo() does not make accommodation for the '+' symbol in a key combo. Consider using 'ctrl+shift+='.\n *\n * onKeyCombo() accounts for 'cmd', 'win', and 'meta' keys inside keycombos. 'cmd+K', 'win+K', and 'meta+K'\n * are all the same thing to onKeyCombo().\n */\nexport function onKeyCombo(whichKeyCombo, evt, handler) {\n if (wereModifierComboKeysPressed(whichKeyCombo, evt) && wereNonModifierComboKeysPressed(whichKeyCombo, evt)) {\n handler();\n }\n}\n// key combo helpers\nconst modifierKeys = ['ctrl', 'alt', 'shift', 'meta', 'cmd', 'win'];\n/**\n * getModifierKeysFromKeyCombo() takes a keycombo string and returns an array with all of the\n * special keys in the keycombo.\n */\nexport function getModifierKeysFromKeyCombo(keyCombo) {\n // note: at some point, we may have to handle a situation of 'ctrl++' or 'ctrl+plus'\n // it's unlikely so i'm not over-coding for it right now\n return keyCombo.split('+').filter(k => {\n return modifierKeys.indexOf(k) > -1;\n });\n}\n/**\n * removeModifierKeysFromKeyCombo() takes a keycombo string and returns an array with all of the\n * non-special keys in the keycombo.\n */\nexport function removeModifierKeysFromKeyCombo(keyCombo) {\n return keyCombo.split('+').filter(k => {\n return modifierKeys.indexOf(k) < 0;\n });\n}\n/**\n * wereModifierComboKeysPressed() tests if ALL special keys (Ctrl, Alt, Meta, Shift) were included\n * as part of a KeyboardEvent keycombo.\n *\n * @private\n *\n */\nfunction wereModifierComboKeysPressed(keyCombo, evt) {\n const modifierKeyArray = getModifierKeysFromKeyCombo(keyCombo);\n if (modifierKeyArray.length === 0) {\n return true;\n }\n return modifierKeyArray.reduce((acc, currentKey) => acc && checkModifierKey(evt, currentKey), true);\n}\n/**\n * wereNonModifierComboKeysPressed() tests if non-special keys (Ctrl, Alt, Meta, Shift) were included\n * as part of a KeyboardEvent.\n *\n * @private\n *\n */\nfunction wereNonModifierComboKeysPressed(keyCombo, evt) {\n const keyArray = removeModifierKeysFromKeyCombo(keyCombo);\n if (keyArray.length === 0) {\n return true;\n }\n return keyArray.reduce((acc, currentKey) => acc && keyWasEvented(evt, currentKey), true);\n}\nexport function validKeyNavigationCode(e) {\n return (e.code === KeyNavigationCode.ArrowUp ||\n e.code === KeyNavigationCode.ArrowDown ||\n e.code === KeyNavigationCode.ArrowLeft ||\n e.code === KeyNavigationCode.ArrowRight ||\n e.code === KeyNavigationCode.End ||\n e.code === KeyNavigationCode.Home ||\n e.code === KeyNavigationCode.PageUp ||\n e.code === KeyNavigationCode.PageDown);\n}\nexport var KeyNavigationCode;\n(function (KeyNavigationCode) {\n KeyNavigationCode[\"ArrowUp\"] = \"ArrowUp\";\n KeyNavigationCode[\"ArrowDown\"] = \"ArrowDown\";\n KeyNavigationCode[\"ArrowLeft\"] = \"ArrowLeft\";\n KeyNavigationCode[\"ArrowRight\"] = \"ArrowRight\";\n KeyNavigationCode[\"End\"] = \"End\";\n KeyNavigationCode[\"Home\"] = \"Home\";\n KeyNavigationCode[\"PageUp\"] = \"PageUp\";\n KeyNavigationCode[\"PageDown\"] = \"PageDown\";\n})(KeyNavigationCode || (KeyNavigationCode = {}));\n"],"names":["keyWasEvented","evt","whichKey","KeyCodeService","getCode","key","onKey","handler","onAnyKey","whichKeys","filter","k","length","onKeyCombo","whichKeyCombo","keyCombo","modifierKeyArray","getModifierKeysFromKeyCombo","reduce","acc","currentKey","ctrlKey","altKey","shiftKey","metaKey","checkModifierKey","wereModifierComboKeysPressed","keyArray","removeModifierKeysFromKeyCombo","wereNonModifierComboKeysPressed","modifierKeys","split","indexOf","validKeyNavigationCode","e","code","KeyNavigationCode","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","End","Home","PageUp","PageDown"],"mappings":"iEASO,SAASA,EAAcC,EAAKC,GAE/B,OAAOC,EAAeC,QAAQF,KAAcD,EAAII,IA0B7C,SAASC,EAAMJ,EAAUD,EAAKM,GAC7BP,EAAcC,EAAKC,IACnBK,IAOD,SAASC,EAASC,EAAWR,EAAKM,GACjBE,EAAUC,QAAOC,GAC1BX,EAAcC,EAAKU,KAEdC,OAAS,GACrBL,IAaD,SAASM,EAAWC,EAAeb,EAAKM,IAkC/C,SAAsCQ,EAAUd,GAC5C,MAAMe,EAAmBC,EAA4BF,GACrD,OAAgC,IAA5BC,EAAiBJ,QAGdI,EAAiBE,QAAO,CAACC,EAAKC,IAAeD,GAvFxD,SAA0BlB,EAAKI,GAC3B,OAAQA,GACJ,IAAK,OACD,OAAOJ,EAAIoB,QACf,IAAK,MACD,OAAOpB,EAAIqB,OACf,IAAK,QACD,OAAOrB,EAAIsB,SACf,IAAK,MACL,IAAK,MACL,IAAK,OACD,OAAOtB,EAAIuB,QACf,QACI,OAAO,GA0E4CC,CAAiBxB,EAAKmB,KAAa,IAtC1FM,CAA6BZ,EAAeb,IA+CpD,SAAyCc,EAAUd,GAC/C,MAAM0B,EAAWC,EAA+Bb,GAChD,OAAwB,IAApBY,EAASf,QAGNe,EAAST,QAAO,CAACC,EAAKC,IAAeD,GAAOnB,EAAcC,EAAKmB,KAAa,GApD3BS,CAAgCf,EAAeb,IACnGM,IAIR,MAAMuB,EAAe,CAAC,OAAQ,MAAO,QAAS,OAAQ,MAAO,OAKtD,SAASb,EAA4BF,GAGxC,OAAOA,EAASgB,MAAM,KAAKrB,QAAOC,GACvBmB,EAAaE,QAAQrB,IAAM,IAOnC,SAASiB,EAA+Bb,GAC3C,OAAOA,EAASgB,MAAM,KAAKrB,QAAOC,GACvBmB,EAAaE,QAAQrB,GAAK,IA+BlC,SAASsB,EAAuBC,GACnC,OAAQA,EAAEC,OAASC,EAAkBC,SACjCH,EAAEC,OAASC,EAAkBE,WAC7BJ,EAAEC,OAASC,EAAkBG,WAC7BL,EAAEC,OAASC,EAAkBI,YAC7BN,EAAEC,OAASC,EAAkBK,KAC7BP,EAAEC,OAASC,EAAkBM,MAC7BR,EAAEC,OAASC,EAAkBO,QAC7BT,EAAEC,OAASC,EAAkBQ,SAE3B,IAACR,GACX,SAAWA,GACPA,EAA2B,QAAI,UAC/BA,EAA6B,UAAI,YACjCA,EAA6B,UAAI,YACjCA,EAA8B,WAAI,aAClCA,EAAuB,IAAI,MAC3BA,EAAwB,KAAI,OAC5BA,EAA0B,OAAI,SAC9BA,EAA4B,SAAI,WARpC,CASGA,IAAsBA,EAAoB"}
1
+ {"version":3,"file":"keycodes.js","sources":["../../../../src/internal/utils/keycodes.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport { KeyCodeService } from '../services/keycodes.service.js';\n/**\n * keyWasEvented() checks to see if a given key is part of any KeyboardEvent it is passed.\n */\nexport function keyWasEvented(evt, whichKey) {\n // evt.key support goes all the way back to IE9; we don't need evt.keyCode for IE support!\n return KeyCodeService.getCode(whichKey) === evt.key;\n}\n/**\n * checkModifierKey() tests if a special key (Ctrl, Alt, Meta, Shift) part of a KeyboardEvent.\n */\nfunction checkModifierKey(evt, key) {\n switch (key) {\n case 'ctrl':\n return evt.ctrlKey;\n case 'alt':\n return evt.altKey;\n case 'shift':\n return evt.shiftKey;\n case 'cmd':\n case 'win':\n case 'meta':\n return evt.metaKey;\n default:\n return false;\n }\n}\n// handlers -> single keys or any of a collection of keys\n/**\n * onKey() takes a single key and fires a handler if that key is part of\n * the KeyboardEvent it was passed.\n */\nexport function onKey(whichKey, evt, handler) {\n if (keyWasEvented(evt, whichKey)) {\n handler();\n }\n}\n/**\n * onAnyKey() takes an array of keys and fires a handler if any of the keys are part of\n * the KeyboardEvent it was passed.\n */\nexport function onAnyKey(whichKeys, evt, handler) {\n const eventedKeys = whichKeys.filter(k => {\n return keyWasEvented(evt, k);\n });\n if (eventedKeys.length > 0) {\n handler();\n }\n}\n// key combos\n/**\n * onKeyCombo() takes a string representation of a combination of keys and modifier keys such as\n * 'ctrl+shift+a'.\n *\n * onKeyCombo() does not make accommodation for the '+' symbol in a key combo. Consider using 'ctrl+shift+='.\n *\n * onKeyCombo() accounts for 'cmd', 'win', and 'meta' keys inside keycombos. 'cmd+K', 'win+K', and 'meta+K'\n * are all the same thing to onKeyCombo().\n */\nexport function onKeyCombo(whichKeyCombo, evt, handler) {\n if (wereModifierComboKeysPressed(whichKeyCombo, evt) && wereNonModifierComboKeysPressed(whichKeyCombo, evt)) {\n handler();\n }\n}\n// key combo helpers\nconst modifierKeys = ['ctrl', 'alt', 'shift', 'meta', 'cmd', 'win'];\n/**\n * getModifierKeysFromKeyCombo() takes a keycombo string and returns an array with all of the\n * special keys in the keycombo.\n */\nexport function getModifierKeysFromKeyCombo(keyCombo) {\n // note: at some point, we may have to handle a situation of 'ctrl++' or 'ctrl+plus'\n // it's unlikely so i'm not over-coding for it right now\n return keyCombo.split('+').filter(k => {\n return modifierKeys.indexOf(k) > -1;\n });\n}\n/**\n * removeModifierKeysFromKeyCombo() takes a keycombo string and returns an array with all of the\n * non-special keys in the keycombo.\n */\nexport function removeModifierKeysFromKeyCombo(keyCombo) {\n return keyCombo.split('+').filter(k => {\n return modifierKeys.indexOf(k) < 0;\n });\n}\n/**\n * wereModifierComboKeysPressed() tests if ALL special keys (Ctrl, Alt, Meta, Shift) were included\n * as part of a KeyboardEvent keycombo.\n *\n * @private\n *\n */\nfunction wereModifierComboKeysPressed(keyCombo, evt) {\n const modifierKeyArray = getModifierKeysFromKeyCombo(keyCombo);\n if (modifierKeyArray.length === 0) {\n return true;\n }\n return modifierKeyArray.reduce((acc, currentKey) => acc && checkModifierKey(evt, currentKey), true);\n}\n/**\n * wereNonModifierComboKeysPressed() tests if non-special keys (Ctrl, Alt, Meta, Shift) were included\n * as part of a KeyboardEvent.\n *\n * @private\n *\n */\nfunction wereNonModifierComboKeysPressed(keyCombo, evt) {\n const keyArray = removeModifierKeysFromKeyCombo(keyCombo);\n if (keyArray.length === 0) {\n return true;\n }\n return keyArray.reduce((acc, currentKey) => acc && keyWasEvented(evt, currentKey), true);\n}\nexport function validKeyNavigationCode(e) {\n return (e.code === KeyNavigationCode.ArrowUp ||\n e.code === KeyNavigationCode.ArrowDown ||\n e.code === KeyNavigationCode.ArrowLeft ||\n e.code === KeyNavigationCode.ArrowRight ||\n e.code === KeyNavigationCode.End ||\n e.code === KeyNavigationCode.Home ||\n e.code === KeyNavigationCode.PageUp ||\n e.code === KeyNavigationCode.PageDown);\n}\nexport var KeyNavigationCode;\n(function (KeyNavigationCode) {\n KeyNavigationCode[\"ArrowUp\"] = \"ArrowUp\";\n KeyNavigationCode[\"ArrowDown\"] = \"ArrowDown\";\n KeyNavigationCode[\"ArrowLeft\"] = \"ArrowLeft\";\n KeyNavigationCode[\"ArrowRight\"] = \"ArrowRight\";\n KeyNavigationCode[\"End\"] = \"End\";\n KeyNavigationCode[\"Home\"] = \"Home\";\n KeyNavigationCode[\"PageUp\"] = \"PageUp\";\n KeyNavigationCode[\"PageDown\"] = \"PageDown\";\n})(KeyNavigationCode || (KeyNavigationCode = {}));\n"],"names":["keyWasEvented","evt","whichKey","KeyCodeService","getCode","key","onKey","handler","onAnyKey","whichKeys","filter","k","length","onKeyCombo","whichKeyCombo","keyCombo","modifierKeyArray","getModifierKeysFromKeyCombo","reduce","acc","currentKey","ctrlKey","altKey","shiftKey","metaKey","checkModifierKey","wereModifierComboKeysPressed","keyArray","removeModifierKeysFromKeyCombo","wereNonModifierComboKeysPressed","modifierKeys","split","indexOf","validKeyNavigationCode","e","code","KeyNavigationCode","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","End","Home","PageUp","PageDown"],"mappings":"iEASO,SAASA,EAAcC,EAAKC,GAE/B,OAAOC,EAAeC,QAAQF,KAAcD,EAAII,IA0B7C,SAASC,EAAMJ,EAAUD,EAAKM,GAC7BP,EAAcC,EAAKC,IACnBK,IAOD,SAASC,EAASC,EAAWR,EAAKM,GACjBE,EAAUC,QAAOC,GAC1BX,EAAcC,EAAKU,KAEdC,OAAS,GACrBL,IAaD,SAASM,EAAWC,EAAeb,EAAKM,IAkC/C,SAAsCQ,EAAUd,GAC5C,MAAMe,EAAmBC,EAA4BF,GACrD,OAAgC,IAA5BC,EAAiBJ,QAGdI,EAAiBE,QAAO,CAACC,EAAKC,IAAeD,GAvFxD,SAA0BlB,EAAKI,GAC3B,OAAQA,GACJ,IAAK,OACD,OAAOJ,EAAIoB,QACf,IAAK,MACD,OAAOpB,EAAIqB,OACf,IAAK,QACD,OAAOrB,EAAIsB,SACf,IAAK,MACL,IAAK,MACL,IAAK,OACD,OAAOtB,EAAIuB,QACf,QACI,OAAO,GA0E4CC,CAAiBxB,EAAKmB,KAAa,IAtC1FM,CAA6BZ,EAAeb,IA+CpD,SAAyCc,EAAUd,GAC/C,MAAM0B,EAAWC,EAA+Bb,GAChD,OAAwB,IAApBY,EAASf,QAGNe,EAAST,QAAO,CAACC,EAAKC,IAAeD,GAAOnB,EAAcC,EAAKmB,KAAa,GApD3BS,CAAgCf,EAAeb,IACnGM,IAIR,MAAMuB,EAAe,CAAC,OAAQ,MAAO,QAAS,OAAQ,MAAO,OAKtD,SAASb,EAA4BF,GAGxC,OAAOA,EAASgB,MAAM,KAAKrB,QAAOC,GACvBmB,EAAaE,QAAQrB,IAAM,IAOnC,SAASiB,EAA+Bb,GAC3C,OAAOA,EAASgB,MAAM,KAAKrB,QAAOC,GACvBmB,EAAaE,QAAQrB,GAAK,IA+BlC,SAASsB,EAAuBC,GACnC,OAAQA,EAAEC,OAASC,EAAkBC,SACjCH,EAAEC,OAASC,EAAkBE,WAC7BJ,EAAEC,OAASC,EAAkBG,WAC7BL,EAAEC,OAASC,EAAkBI,YAC7BN,EAAEC,OAASC,EAAkBK,KAC7BP,EAAEC,OAASC,EAAkBM,MAC7BR,EAAEC,OAASC,EAAkBO,QAC7BT,EAAEC,OAASC,EAAkBQ,SAE3B,IAACR,GACX,SAAWA,GACPA,EAA2B,QAAI,UAC/BA,EAA6B,UAAI,YACjCA,EAA6B,UAAI,YACjCA,EAA8B,WAAI,aAClCA,EAAuB,IAAI,MAC3BA,EAAwB,KAAI,OAC5BA,EAA0B,OAAI,SAC9BA,EAA4B,SAAI,WARpC,CASGA,IAAsBA,EAAoB"}
@@ -1 +1 @@
1
- {"version":3,"file":"lit.js","sources":["../../../../src/internal/utils/lit.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport { render } from 'lit';\n/**\n * Returns a promise when all components have completed rendering one cycle.\n */\nexport function childrenUpdateComplete(elements) {\n return Promise.all(Array.from(elements).map(e => e.updateComplete));\n}\n/**\n * Set all properties that are in common with a parent group and child components.\n * This is helpful when providing convenience group/wrapper components that set the state\n * of child slotted elements (cds-form-group, cds-control-group). Typically call\n * during the `firstUpdated` or `updated` lifecycle.\n */\nexport function syncDefinedProps(props, source, targets) {\n props.forEach((_value, key) => targets.filter(t => t && t[key] !== undefined).forEach(t => (t[key] = source[key])));\n}\n/**\n * Set all common properties between two instances with given conditions. This is\n * helpful for setting child component properties from the parent given certain\n * conditions.\n */\nexport function syncProps(target, source, conditions) {\n Object.keys(conditions)\n .filter(c => conditions[c])\n .forEach(c => (target[c] = source[c]));\n}\nexport function syncPropsForAllItems(targets, source, conditions) {\n targets.forEach(target => syncProps(target, source, conditions));\n}\n/** given an element and prop map, determine if property was updated during the updated lifecycle */\nexport function propUpdated(element, props, prop) {\n return props.has(prop) && element[prop] !== props.get(prop);\n}\nexport function renderBefore(value, container, options) {\n const el = document.createElement('div');\n container.prepend(el);\n render(value, container, { renderBefore: el, ...options });\n const rendered = el.previousSibling;\n el.remove();\n return rendered;\n}\nexport function renderAfter(value, container, options) {\n const el = document.createElement('div');\n container.appendChild(el);\n render(value, container, { renderBefore: el, ...options });\n const rendered = el.previousSibling;\n el.remove();\n return rendered;\n}\n"],"names":["childrenUpdateComplete","elements","Promise","all","Array","from","map","e","updateComplete","syncDefinedProps","props","source","targets","forEach","_value","key","filter","t","undefined","syncProps","target","conditions","Object","keys","c","syncPropsForAllItems","propUpdated","element","prop","has","get","renderBefore","value","container","options","el","document","createElement","prepend","render","rendered","previousSibling","remove","renderAfter","appendChild"],"mappings":"6BASO,SAASA,EAAuBC,GACnC,OAAOC,QAAQC,IAAIC,MAAMC,KAAKJ,GAAUK,KAAIC,GAAKA,EAAEC,kBAQhD,SAASC,EAAiBC,EAAOC,EAAQC,GAC5CF,EAAMG,SAAQ,CAACC,EAAQC,IAAQH,EAAQI,QAAOC,GAAKA,QAAgBC,IAAXD,EAAEF,KAAoBF,SAAQI,GAAMA,EAAEF,GAAOJ,EAAOI,OAOzG,SAASI,EAAUC,EAAQT,EAAQU,GACtCC,OAAOC,KAAKF,GACPL,QAAOQ,GAAKH,EAAWG,KACvBX,SAAQW,GAAMJ,EAAOI,GAAKb,EAAOa,KAEnC,SAASC,EAAqBb,EAASD,EAAQU,GAClDT,EAAQC,SAAQO,GAAUD,EAAUC,EAAQT,EAAQU,KAGjD,SAASK,EAAYC,EAASjB,EAAOkB,GACxC,OAAOlB,EAAMmB,IAAID,IAASD,EAAQC,KAAUlB,EAAMoB,IAAIF,GAEnD,SAASG,EAAaC,EAAOC,EAAWC,GAC3C,MAAMC,EAAKC,SAASC,cAAc,OAClCJ,EAAUK,QAAQH,GAClBI,EAAOP,EAAOC,EAAW,CAAEF,aAAcI,KAAOD,IAChD,MAAMM,EAAWL,EAAGM,gBAEpB,OADAN,EAAGO,SACIF,EAEJ,SAASG,EAAYX,EAAOC,EAAWC,GAC1C,MAAMC,EAAKC,SAASC,cAAc,OAClCJ,EAAUW,YAAYT,GACtBI,EAAOP,EAAOC,EAAW,CAAEF,aAAcI,KAAOD,IAChD,MAAMM,EAAWL,EAAGM,gBAEpB,OADAN,EAAGO,SACIF"}
1
+ {"version":3,"file":"lit.js","sources":["../../../../src/internal/utils/lit.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport { render } from 'lit';\n/**\n * Returns a promise when all components have completed rendering one cycle.\n */\nexport function childrenUpdateComplete(elements) {\n return Promise.all(Array.from(elements).map(e => e.updateComplete));\n}\n/**\n * Set all properties that are in common with a parent group and child components.\n * This is helpful when providing convenience group/wrapper components that set the state\n * of child slotted elements (cds-form-group, cds-control-group). Typically call\n * during the `firstUpdated` or `updated` lifecycle.\n */\nexport function syncDefinedProps(props, source, targets) {\n props.forEach((_value, key) => targets.filter(t => t && t[key] !== undefined).forEach(t => (t[key] = source[key])));\n}\n/**\n * Set all common properties between two instances with given conditions. This is\n * helpful for setting child component properties from the parent given certain\n * conditions.\n */\nexport function syncProps(target, source, conditions) {\n Object.keys(conditions)\n .filter(c => conditions[c])\n .forEach(c => (target[c] = source[c]));\n}\nexport function syncPropsForAllItems(targets, source, conditions) {\n targets.forEach(target => syncProps(target, source, conditions));\n}\n/** given an element and prop map, determine if property was updated during the updated lifecycle */\nexport function propUpdated(element, props, prop) {\n return props.has(prop) && element[prop] !== props.get(prop);\n}\nexport function renderBefore(value, container, options) {\n const el = document.createElement('div');\n container.prepend(el);\n render(value, container, { renderBefore: el, ...options });\n const rendered = el.previousSibling;\n el.remove();\n return rendered;\n}\nexport function renderAfter(value, container, options) {\n const el = document.createElement('div');\n container.appendChild(el);\n render(value, container, { renderBefore: el, ...options });\n const rendered = el.previousSibling;\n el.remove();\n return rendered;\n}\n"],"names":["childrenUpdateComplete","elements","Promise","all","Array","from","map","e","updateComplete","syncDefinedProps","props","source","targets","forEach","_value","key","filter","t","undefined","syncProps","target","conditions","Object","keys","c","syncPropsForAllItems","propUpdated","element","prop","has","get","renderBefore","value","container","options","el","document","createElement","prepend","render","rendered","previousSibling","remove","renderAfter","appendChild"],"mappings":"6BASO,SAASA,EAAuBC,GACnC,OAAOC,QAAQC,IAAIC,MAAMC,KAAKJ,GAAUK,KAAIC,GAAKA,EAAEC,kBAQhD,SAASC,EAAiBC,EAAOC,EAAQC,GAC5CF,EAAMG,SAAQ,CAACC,EAAQC,IAAQH,EAAQI,QAAOC,GAAKA,QAAgBC,IAAXD,EAAEF,KAAoBF,SAAQI,GAAMA,EAAEF,GAAOJ,EAAOI,OAOzG,SAASI,EAAUC,EAAQT,EAAQU,GACtCC,OAAOC,KAAKF,GACPL,QAAOQ,GAAKH,EAAWG,KACvBX,SAAQW,GAAMJ,EAAOI,GAAKb,EAAOa,KAEnC,SAASC,EAAqBb,EAASD,EAAQU,GAClDT,EAAQC,SAAQO,GAAUD,EAAUC,EAAQT,EAAQU,KAGjD,SAASK,EAAYC,EAASjB,EAAOkB,GACxC,OAAOlB,EAAMmB,IAAID,IAASD,EAAQC,KAAUlB,EAAMoB,IAAIF,GAEnD,SAASG,EAAaC,EAAOC,EAAWC,GAC3C,MAAMC,EAAKC,SAASC,cAAc,OAClCJ,EAAUK,QAAQH,GAClBI,EAAOP,EAAOC,EAAW,CAAEF,aAAcI,KAAOD,IAChD,MAAMM,EAAWL,EAAGM,gBAEpB,OADAN,EAAGO,SACIF,EAEJ,SAASG,EAAYX,EAAOC,EAAWC,GAC1C,MAAMC,EAAKC,SAASC,cAAc,OAClCJ,EAAUW,YAAYT,GACtBI,EAAOP,EAAOC,EAAW,CAAEF,aAAcI,KAAOD,IAChD,MAAMM,EAAWL,EAAGM,gBAEpB,OADAN,EAAGO,SACIF"}
@@ -1 +1 @@
1
- {"version":3,"file":"math.js","sources":["../../../../src/internal/utils/math.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport isNil from 'ramda/es/isNil.js';\nimport sum from 'ramda/es/sum.js';\nimport curryN from 'ramda/es/curryN.js';\nexport function getMillisecondsFromSeconds(sec) {\n return isNil(sec) ? 0 : Number(sec) * 1000;\n}\nexport const sumAndSubtract = curryN(3, (startValue, add, subtract) => {\n return (startValue || 0) + sum(add || []) - sum(subtract || []);\n});\nexport const compareSumTo = curryN(4, (startValue, add, subtract, compareFn) => {\n return !compareFn ? false : compareFn(sumAndSubtract(startValue, add, subtract));\n});\nexport function getOffesetDifference(minuend, subtrahend) {\n return Math.sign(subtrahend - minuend) * Math.abs(minuend - subtrahend);\n}\n"],"names":["getMillisecondsFromSeconds","sec","isNil","Number","sumAndSubtract","curryN","startValue","add","subtract","sum","compareSumTo","compareFn","getOffesetDifference","minuend","subtrahend","Math","sign","abs"],"mappings":"kGAQO,SAASA,EAA2BC,GACvC,OAAOC,EAAMD,GAAO,EAAkB,IAAdE,OAAOF,GAEvB,MAACG,EAAiBC,EAAO,GAAG,CAACC,EAAYC,EAAKC,KAC9CF,GAAc,GAAKG,EAAIF,GAAO,IAAME,EAAID,GAAY,MAEnDE,EAAeL,EAAO,GAAG,CAACC,EAAYC,EAAKC,EAAUG,MACtDA,GAAoBA,EAAUP,EAAeE,EAAYC,EAAKC,MAEnE,SAASI,EAAqBC,EAASC,GAC1C,OAAOC,KAAKC,KAAKF,EAAaD,GAAWE,KAAKE,IAAIJ,EAAUC"}
1
+ {"version":3,"file":"math.js","sources":["../../../../src/internal/utils/math.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport isNil from 'ramda/es/isNil.js';\nimport sum from 'ramda/es/sum.js';\nimport curryN from 'ramda/es/curryN.js';\nexport function getMillisecondsFromSeconds(sec) {\n return isNil(sec) ? 0 : Number(sec) * 1000;\n}\nexport const sumAndSubtract = curryN(3, (startValue, add, subtract) => {\n return (startValue || 0) + sum(add || []) - sum(subtract || []);\n});\nexport const compareSumTo = curryN(4, (startValue, add, subtract, compareFn) => {\n return !compareFn ? false : compareFn(sumAndSubtract(startValue, add, subtract));\n});\nexport function getOffesetDifference(minuend, subtrahend) {\n return Math.sign(subtrahend - minuend) * Math.abs(minuend - subtrahend);\n}\n"],"names":["getMillisecondsFromSeconds","sec","isNil","Number","sumAndSubtract","curryN","startValue","add","subtract","sum","compareSumTo","compareFn","getOffesetDifference","minuend","subtrahend","Math","sign","abs"],"mappings":"kGAQO,SAASA,EAA2BC,GACvC,OAAOC,EAAMD,GAAO,EAAkB,IAAdE,OAAOF,GAEvB,MAACG,EAAiBC,EAAO,GAAG,CAACC,EAAYC,EAAKC,KAC9CF,GAAc,GAAKG,EAAIF,GAAO,IAAME,EAAID,GAAY,MAEnDE,EAAeL,EAAO,GAAG,CAACC,EAAYC,EAAKC,EAAUG,MACtDA,GAAoBA,EAAUP,EAAeE,EAAYC,EAAKC,MAEnE,SAASI,EAAqBC,EAASC,GAC1C,OAAOC,KAAKC,KAAKF,EAAaD,GAAWE,KAAKE,IAAIJ,EAAUC"}
@@ -1 +1 @@
1
- {"version":3,"file":"metadata.js","sources":["../../../../src/internal/utils/metadata.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport { arrayToObject } from './array.js';\nimport { setPropStyles } from './string.js';\nexport function getElementStorybookArgTypes(tagName, customElementsMetadata) {\n const meta = arrayToObject(customElementsMetadata.tags, 'name')[tagName];\n return { ...getPropOptionsStorybookArgs(meta), ...getCustomPropsStorybookArgs(meta), ...getSlotStorybookArgs(meta) };\n}\nexport function getElementStorybookArgs(args) {\n return { ...args, style: setPropStyles(args) };\n}\nfunction getCustomPropsStorybookArgs(customElementMetadata) {\n return customElementMetadata.cssProperties?.reduce((obj, prop) => {\n const type = prop?.name?.includes('color') || prop?.name?.endsWith('background') ? 'color' : 'text';\n return { ...obj, [prop.name]: { control: { type } } };\n }, {});\n}\nfunction getPropOptionsStorybookArgs(customElementMetadata) {\n return customElementMetadata.properties\n ?.filter((prop) => prop?.type?.includes(' | '))\n .reduce((obj, prop) => {\n const options = prop.type.split('|').map(p => p.replace(/\"/g, '').replace(/\\s/g, ''));\n return {\n ...obj,\n [prop.name]: {\n control: { type: 'select', options },\n defaultValue: options[0],\n },\n };\n }, {});\n}\nfunction getSlotStorybookArgs(customElementMetadata) {\n return customElementMetadata.slots?.reduce((obj, prop) => {\n return { ...obj, [prop.name]: { control: { type: 'text' }, defaultValue: `${prop.name}` } };\n }, {});\n}\n"],"names":["getElementStorybookArgTypes","tagName","customElementsMetadata","meta","arrayToObject","tags","customElementMetadata","properties","filter","prop","type","includes","reduce","obj","options","split","map","p","replace","name","control","defaultValue","getCustomPropsStorybookArgs","getSlotStorybookArgs","getElementStorybookArgs","args","style","setPropStyles","cssProperties","endsWith","slots"],"mappings":"uFAOO,SAASA,EAA4BC,EAASC,GACjD,MAAMC,EAAOC,EAAcF,EAAuBG,KAAM,QAAQJ,GAChE,MAAO,KAW0BK,EAXOH,EAYjCG,EAAsBC,YACvBC,QAAQC,GAASA,GAAMC,MAAMC,SAAS,SACvCC,QAAO,CAACC,EAAKJ,KACd,MAAMK,EAAUL,EAAKC,KAAKK,MAAM,KAAKC,KAAIC,GAAKA,EAAEC,QAAQ,KAAM,IAAIA,QAAQ,MAAO,MACjF,MAAO,IACAL,EACH,CAACJ,EAAKU,MAAO,CACTC,QAAS,CAAEV,KAAM,SAAUI,QAAAA,GAC3BO,aAAcP,EAAQ,OAG/B,QAvB+CQ,EAA4BnB,MAAUoB,EAAqBpB,IAWjH,IAAqCG,EAT9B,SAASkB,EAAwBC,GACpC,MAAO,IAAKA,EAAMC,MAAOC,EAAcF,IAE3C,SAASH,EAA4BhB,GACjC,OAAOA,EAAsBsB,eAAehB,QAAO,CAACC,EAAKJ,KACrD,MAAMC,EAAOD,GAAMU,MAAMR,SAAS,UAAYF,GAAMU,MAAMU,SAAS,cAAgB,QAAU,OAC7F,MAAO,IAAKhB,EAAK,CAACJ,EAAKU,MAAO,CAAEC,QAAS,CAAEV,KAAAA,OAC5C,IAgBP,SAASa,EAAqBjB,GAC1B,OAAOA,EAAsBwB,OAAOlB,QAAO,CAACC,EAAKJ,KACtC,IAAKI,EAAK,CAACJ,EAAKU,MAAO,CAAEC,QAAS,CAAEV,KAAM,QAAUW,aAAc,GAAGZ,EAAKU,SAClF"}
1
+ {"version":3,"file":"metadata.js","sources":["../../../../src/internal/utils/metadata.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport { arrayToObject } from './array.js';\nimport { setPropStyles } from './string.js';\nexport function getElementStorybookArgTypes(tagName, customElementsMetadata) {\n const meta = arrayToObject(customElementsMetadata.tags, 'name')[tagName];\n return { ...getPropOptionsStorybookArgs(meta), ...getCustomPropsStorybookArgs(meta), ...getSlotStorybookArgs(meta) };\n}\nexport function getElementStorybookArgs(args) {\n return { ...args, style: setPropStyles(args) };\n}\nfunction getCustomPropsStorybookArgs(customElementMetadata) {\n return customElementMetadata.cssProperties?.reduce((obj, prop) => {\n const type = prop?.name?.includes('color') || prop?.name?.endsWith('background') ? 'color' : 'text';\n return { ...obj, [prop.name]: { control: { type } } };\n }, {});\n}\nfunction getPropOptionsStorybookArgs(customElementMetadata) {\n return customElementMetadata.properties\n ?.filter((prop) => prop?.type?.includes(' | '))\n .reduce((obj, prop) => {\n const options = prop.type.split('|').map(p => p.replace(/\"/g, '').replace(/\\s/g, ''));\n return {\n ...obj,\n [prop.name]: {\n control: { type: 'select', options },\n defaultValue: options[0],\n },\n };\n }, {});\n}\nfunction getSlotStorybookArgs(customElementMetadata) {\n return customElementMetadata.slots?.reduce((obj, prop) => {\n return { ...obj, [prop.name]: { control: { type: 'text' }, defaultValue: `${prop.name}` } };\n }, {});\n}\n"],"names":["getElementStorybookArgTypes","tagName","customElementsMetadata","meta","arrayToObject","tags","customElementMetadata","properties","filter","prop","type","includes","reduce","obj","options","split","map","p","replace","name","control","defaultValue","getCustomPropsStorybookArgs","getSlotStorybookArgs","getElementStorybookArgs","args","style","setPropStyles","cssProperties","endsWith","slots"],"mappings":"uFAOO,SAASA,EAA4BC,EAASC,GACjD,MAAMC,EAAOC,EAAcF,EAAuBG,KAAM,QAAQJ,GAChE,MAAO,KAW0BK,EAXOH,EAYjCG,EAAsBC,YACvBC,QAAQC,GAASA,GAAMC,MAAMC,SAAS,SACvCC,QAAO,CAACC,EAAKJ,KACd,MAAMK,EAAUL,EAAKC,KAAKK,MAAM,KAAKC,KAAIC,GAAKA,EAAEC,QAAQ,KAAM,IAAIA,QAAQ,MAAO,MACjF,MAAO,IACAL,EACH,CAACJ,EAAKU,MAAO,CACTC,QAAS,CAAEV,KAAM,SAAUI,QAAAA,GAC3BO,aAAcP,EAAQ,OAG/B,QAvB+CQ,EAA4BnB,MAAUoB,EAAqBpB,IAWjH,IAAqCG,EAT9B,SAASkB,EAAwBC,GACpC,MAAO,IAAKA,EAAMC,MAAOC,EAAcF,IAE3C,SAASH,EAA4BhB,GACjC,OAAOA,EAAsBsB,eAAehB,QAAO,CAACC,EAAKJ,KACrD,MAAMC,EAAOD,GAAMU,MAAMR,SAAS,UAAYF,GAAMU,MAAMU,SAAS,cAAgB,QAAU,OAC7F,MAAO,IAAKhB,EAAK,CAACJ,EAAKU,MAAO,CAAEC,QAAS,CAAEV,KAAAA,OAC5C,IAgBP,SAASa,EAAqBjB,GAC1B,OAAOA,EAAsBwB,OAAOlB,QAAO,CAACC,EAAKJ,KACtC,IAAKI,EAAK,CAACJ,EAAKU,MAAO,CAAEC,QAAS,CAAEV,KAAM,QAAUW,aAAc,GAAGZ,EAAKU,SAClF"}
@@ -1 +1 @@
1
- {"version":3,"file":"registration.js","sources":["../../../../src/internal/utils/registration.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport curryN from 'ramda/es/curryN.js';\nimport { isBrowser } from './environment.js';\nimport { elementExists, existsInWindow } from './exists.js';\nimport { setupCDSGlobal } from './global.js';\nimport { isStorybook } from './framework.js';\nimport { LogService } from '../services/log.service.js';\nconst addElementToRegistry = curryN(3, (tagName, elementClass, registry) => {\n if (elementExists(tagName) && !isStorybook()) {\n LogService.warn(`${tagName} has already been registered`);\n }\n else {\n registry.define(tagName, elementClass);\n setupCDSGlobal();\n if (window && !Object.keys(window.CDS._state.elementRegistry).some(i => i === tagName)) {\n window.CDS._state.elementRegistry = { ...window.CDS._state.elementRegistry, [tagName]: {} };\n }\n }\n});\nexport function registerElementSafely(tagName, elementClass) {\n if (isBrowser() && existsInWindow(['customElements'])) {\n addElementToRegistry(tagName, elementClass, window.customElements);\n }\n}\n"],"names":["addElementToRegistry","curryN","tagName","elementClass","registry","elementExists","isStorybook","LogService","warn","define","setupCDSGlobal","window","Object","keys","CDS","_state","elementRegistry","some","i","registerElementSafely","isBrowser","existsInWindow","customElements"],"mappings":"iSAWA,MAAMA,EAAuBC,EAAO,GAAG,CAACC,EAASC,EAAcC,KACvDC,EAAcH,KAAaI,IAC3BC,EAAWC,KAAQN,EAAH,iCAGhBE,EAASK,OAAOP,EAASC,GACzBO,IACIC,SAAWC,OAAOC,KAAKF,OAAOG,IAAIC,OAAOC,iBAAiBC,MAAKC,GAAKA,IAAMhB,MAC1ES,OAAOG,IAAIC,OAAOC,gBAAkB,IAAKL,OAAOG,IAAIC,OAAOC,gBAAiBd,CAACA,GAAU,SAI5F,SAASiB,EAAsBjB,EAASC,GACvCiB,KAAeC,EAAe,CAAC,oBAC/BrB,EAAqBE,EAASC,EAAcQ,OAAOW"}
1
+ {"version":3,"file":"registration.js","sources":["../../../../src/internal/utils/registration.ts"],"sourcesContent":["/*\n * Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n * This software is released under MIT license.\n * The full license information can be found in LICENSE in the root directory of this project.\n */\nimport curryN from 'ramda/es/curryN.js';\nimport { isBrowser } from './environment.js';\nimport { elementExists, existsInWindow } from './exists.js';\nimport { setupCDSGlobal } from './global.js';\nimport { isStorybook } from './framework.js';\nimport { LogService } from '../services/log.service.js';\nconst addElementToRegistry = curryN(3, (tagName, elementClass, registry) => {\n if (elementExists(tagName) && !isStorybook()) {\n LogService.warn(`${tagName} has already been registered`);\n }\n else {\n registry.define(tagName, elementClass);\n setupCDSGlobal();\n if (window && !Object.keys(window.CDS._state.elementRegistry).some(i => i === tagName)) {\n window.CDS._state.elementRegistry = { ...window.CDS._state.elementRegistry, [tagName]: {} };\n }\n }\n});\nexport function registerElementSafely(tagName, elementClass) {\n if (isBrowser() && existsInWindow(['customElements'])) {\n addElementToRegistry(tagName, elementClass, window.customElements);\n }\n}\n"],"names":["addElementToRegistry","curryN","tagName","elementClass","registry","elementExists","isStorybook","LogService","warn","define","setupCDSGlobal","window","Object","keys","CDS","_state","elementRegistry","some","i","registerElementSafely","isBrowser","existsInWindow","customElements"],"mappings":"iSAWA,MAAMA,EAAuBC,EAAO,GAAG,CAACC,EAASC,EAAcC,KACvDC,EAAcH,KAAaI,IAC3BC,EAAWC,KAAQN,EAAH,iCAGhBE,EAASK,OAAOP,EAASC,GACzBO,IACIC,SAAWC,OAAOC,KAAKF,OAAOG,IAAIC,OAAOC,iBAAiBC,MAAKC,GAAKA,IAAMhB,MAC1ES,OAAOG,IAAIC,OAAOC,gBAAkB,IAAKL,OAAOG,IAAIC,OAAOC,gBAAiBd,CAACA,GAAU,SAI5F,SAASiB,EAAsBjB,EAASC,GACvCiB,KAAeC,EAAe,CAAC,oBAC/BrB,EAAqBE,EAASC,EAAcQ,OAAOW"}