igniteui-webcomponents 7.3.0 → 7.3.2

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 (322) hide show
  1. package/CHANGELOG.md +64 -1
  2. package/README.md +30 -0
  3. package/components/avatar/avatar.d.ts +1 -2
  4. package/components/avatar/avatar.js +4 -8
  5. package/components/avatar/avatar.js.map +1 -1
  6. package/components/avatar/themes/avatar.base.css.js +1 -1
  7. package/components/avatar/themes/avatar.base.css.js.map +1 -1
  8. package/components/badge/badge.d.ts +6 -1
  9. package/components/badge/badge.js +8 -5
  10. package/components/badge/badge.js.map +1 -1
  11. package/components/badge/themes/badge.base.css.js +1 -1
  12. package/components/badge/themes/badge.base.css.js.map +1 -1
  13. package/components/banner/themes/banner.base.css.js +1 -1
  14. package/components/banner/themes/banner.base.css.js.map +1 -1
  15. package/components/banner/themes/shared/banner.indigo.css.js +1 -1
  16. package/components/banner/themes/shared/banner.indigo.css.js.map +1 -1
  17. package/components/calendar/base.d.ts +7 -2
  18. package/components/calendar/base.js +8 -3
  19. package/components/calendar/base.js.map +1 -1
  20. package/components/calendar/calendar.d.ts +4 -0
  21. package/components/calendar/calendar.js +41 -14
  22. package/components/calendar/calendar.js.map +1 -1
  23. package/components/calendar/days-view/days-view.d.ts +3 -6
  24. package/components/calendar/days-view/days-view.js +7 -16
  25. package/components/calendar/days-view/days-view.js.map +1 -1
  26. package/components/calendar/helpers.d.ts +13 -0
  27. package/components/calendar/helpers.js +15 -0
  28. package/components/calendar/helpers.js.map +1 -1
  29. package/components/calendar/themes/calendar.base.css.js +1 -1
  30. package/components/calendar/themes/calendar.base.css.js.map +1 -1
  31. package/components/calendar/themes/days-view.base.css.js +1 -1
  32. package/components/calendar/themes/days-view.base.css.js.map +1 -1
  33. package/components/calendar/themes/shared/bootstrap/calendar.bootstrap.css.js +1 -1
  34. package/components/calendar/themes/shared/bootstrap/calendar.bootstrap.css.js.map +1 -1
  35. package/components/calendar/themes/shared/bootstrap/days-view.bootstrap.css.js +1 -1
  36. package/components/calendar/themes/shared/bootstrap/days-view.bootstrap.css.js.map +1 -1
  37. package/components/calendar/themes/shared/fluent/days-view.fluent.css.js +1 -1
  38. package/components/calendar/themes/shared/fluent/days-view.fluent.css.js.map +1 -1
  39. package/components/calendar/themes/shared/indigo/calendar.indigo.css.js +1 -1
  40. package/components/calendar/themes/shared/indigo/calendar.indigo.css.js.map +1 -1
  41. package/components/calendar/themes/shared/indigo/days-view.indigo.css.js +1 -1
  42. package/components/calendar/themes/shared/indigo/days-view.indigo.css.js.map +1 -1
  43. package/components/calendar/themes/shared/material/days-view.material.css.js +1 -1
  44. package/components/calendar/themes/shared/material/days-view.material.css.js.map +1 -1
  45. package/components/calendar/themes/year-month-view.base.css.js +1 -1
  46. package/components/calendar/themes/year-month-view.base.css.js.map +1 -1
  47. package/components/card/themes/container.base.css.js +1 -1
  48. package/components/card/themes/container.base.css.js.map +1 -1
  49. package/components/carousel/themes/carousel.base.css.js +1 -1
  50. package/components/carousel/themes/carousel.base.css.js.map +1 -1
  51. package/components/carousel/themes/shared/carousel.indigo.css.js +1 -1
  52. package/components/carousel/themes/shared/carousel.indigo.css.js.map +1 -1
  53. package/components/chat/themes/chat.base.css.js +1 -1
  54. package/components/chat/themes/chat.base.css.js.map +1 -1
  55. package/components/chat/themes/message.base.css.js +1 -1
  56. package/components/chat/themes/message.base.css.js.map +1 -1
  57. package/components/checkbox/themes/checkbox.base.css.js +1 -1
  58. package/components/checkbox/themes/checkbox.base.css.js.map +1 -1
  59. package/components/checkbox/themes/shared/checkbox/checkbox.bootstrap.css.js +1 -1
  60. package/components/checkbox/themes/shared/checkbox/checkbox.bootstrap.css.js.map +1 -1
  61. package/components/checkbox/themes/shared/checkbox/checkbox.fluent.css.js +1 -1
  62. package/components/checkbox/themes/shared/checkbox/checkbox.fluent.css.js.map +1 -1
  63. package/components/checkbox/themes/shared/switch/switch.bootstrap.css.js +1 -1
  64. package/components/checkbox/themes/shared/switch/switch.bootstrap.css.js.map +1 -1
  65. package/components/checkbox/themes/shared/switch/switch.fluent.css.js +1 -1
  66. package/components/checkbox/themes/shared/switch/switch.fluent.css.js.map +1 -1
  67. package/components/checkbox/themes/shared/switch/switch.indigo.css.js +1 -1
  68. package/components/checkbox/themes/shared/switch/switch.indigo.css.js.map +1 -1
  69. package/components/checkbox/themes/shared/switch/switch.material.css.js +1 -1
  70. package/components/checkbox/themes/shared/switch/switch.material.css.js.map +1 -1
  71. package/components/checkbox/themes/switch.base.css.js +1 -1
  72. package/components/checkbox/themes/switch.base.css.js.map +1 -1
  73. package/components/chip/chip.d.ts +30 -14
  74. package/components/chip/chip.js +54 -48
  75. package/components/chip/chip.js.map +1 -1
  76. package/components/chip/themes/chip.base.css.js +1 -1
  77. package/components/chip/themes/chip.base.css.js.map +1 -1
  78. package/components/chip/themes/dark/chip.bootstrap.css.js +1 -1
  79. package/components/chip/themes/dark/chip.bootstrap.css.js.map +1 -1
  80. package/components/chip/themes/dark/chip.fluent.css.js +1 -1
  81. package/components/chip/themes/dark/chip.fluent.css.js.map +1 -1
  82. package/components/chip/themes/dark/chip.indigo.css.js +1 -1
  83. package/components/chip/themes/dark/chip.indigo.css.js.map +1 -1
  84. package/components/chip/themes/dark/chip.material.css.js +1 -1
  85. package/components/chip/themes/dark/chip.material.css.js.map +1 -1
  86. package/components/chip/themes/light/chip.bootstrap.css.js +1 -1
  87. package/components/chip/themes/light/chip.bootstrap.css.js.map +1 -1
  88. package/components/chip/themes/light/chip.fluent.css.js +1 -1
  89. package/components/chip/themes/light/chip.fluent.css.js.map +1 -1
  90. package/components/chip/themes/light/chip.indigo.css.js +1 -1
  91. package/components/chip/themes/light/chip.indigo.css.js.map +1 -1
  92. package/components/chip/themes/light/chip.material.css.js +1 -1
  93. package/components/chip/themes/light/chip.material.css.js.map +1 -1
  94. package/components/chip/themes/shared/chip.bootstrap.css.js +1 -1
  95. package/components/chip/themes/shared/chip.bootstrap.css.js.map +1 -1
  96. package/components/chip/themes/shared/chip.common.css.js +1 -1
  97. package/components/chip/themes/shared/chip.common.css.js.map +1 -1
  98. package/components/chip/themes/shared/chip.fluent.css.js +1 -1
  99. package/components/chip/themes/shared/chip.fluent.css.js.map +1 -1
  100. package/components/chip/themes/shared/chip.indigo.css.js +1 -1
  101. package/components/chip/themes/shared/chip.indigo.css.js.map +1 -1
  102. package/components/color-picker/color-picker.d.ts +2 -2
  103. package/components/color-picker/color-picker.js.map +1 -1
  104. package/components/color-picker/picker-canvas.js +2 -1
  105. package/components/color-picker/picker-canvas.js.map +1 -1
  106. package/components/color-picker/themes/color-picker.base.css.js +1 -1
  107. package/components/color-picker/themes/color-picker.base.css.js.map +1 -1
  108. package/components/combo/themes/combo-item.base.css.js +1 -1
  109. package/components/combo/themes/combo-item.base.css.js.map +1 -1
  110. package/components/combo/themes/combo.base.css.js +1 -1
  111. package/components/combo/themes/combo.base.css.js.map +1 -1
  112. package/components/combo/themes/shared/combo.bootstrap.css.js +1 -1
  113. package/components/combo/themes/shared/combo.bootstrap.css.js.map +1 -1
  114. package/components/date-picker/date-picker.base.d.ts +11 -2
  115. package/components/date-picker/date-picker.base.js +8 -3
  116. package/components/date-picker/date-picker.base.js.map +1 -1
  117. package/components/date-picker/themes/date-picker.base.css.js +1 -1
  118. package/components/date-picker/themes/date-picker.base.css.js.map +1 -1
  119. package/components/date-range-picker/date-range-picker.base.css.js +1 -1
  120. package/components/date-range-picker/date-range-picker.base.css.js.map +1 -1
  121. package/components/date-range-picker/predefined-ranges-area.base.css.js +1 -1
  122. package/components/date-range-picker/predefined-ranges-area.base.css.js.map +1 -1
  123. package/components/divider/themes/divider.base.css.js +1 -1
  124. package/components/divider/themes/divider.base.css.js.map +1 -1
  125. package/components/dropdown/themes/dropdown-item.base.css.js +1 -1
  126. package/components/dropdown/themes/dropdown-item.base.css.js.map +1 -1
  127. package/components/dropdown/themes/dropdown.base.css.js +1 -1
  128. package/components/dropdown/themes/dropdown.base.css.js.map +1 -1
  129. package/components/file-input/themes/file-input.base.css.js +1 -1
  130. package/components/file-input/themes/file-input.base.css.js.map +1 -1
  131. package/components/file-input/themes/shared/file-input.bootstrap.css.js +1 -1
  132. package/components/file-input/themes/shared/file-input.bootstrap.css.js.map +1 -1
  133. package/components/input/themes/shared/input.indigo.css.js +1 -1
  134. package/components/input/themes/shared/input.indigo.css.js.map +1 -1
  135. package/components/input/themes/shared/input.material.css.js +1 -1
  136. package/components/input/themes/shared/input.material.css.js.map +1 -1
  137. package/components/list/themes/item.base.css.js +1 -1
  138. package/components/list/themes/item.base.css.js.map +1 -1
  139. package/components/nav-drawer/themes/item.base.css.js +1 -1
  140. package/components/nav-drawer/themes/item.base.css.js.map +1 -1
  141. package/components/progress/themes/linear/linear.progress.base.css.js +1 -1
  142. package/components/progress/themes/linear/linear.progress.base.css.js.map +1 -1
  143. package/components/progress/themes/linear/shared/linear.progress.bootstrap.css.js +3 -0
  144. package/components/progress/themes/linear/shared/linear.progress.bootstrap.css.js.map +1 -0
  145. package/components/progress/themes/linear/themes.js +3 -2
  146. package/components/progress/themes/linear/themes.js.map +1 -1
  147. package/components/qr-code/qr-code.d.ts +28 -1
  148. package/components/qr-code/qr-code.js +56 -13
  149. package/components/qr-code/qr-code.js.map +1 -1
  150. package/components/qr-code/renderer/export.d.ts +28 -0
  151. package/components/qr-code/renderer/export.js +120 -0
  152. package/components/qr-code/renderer/export.js.map +1 -0
  153. package/components/qr-code/types.d.ts +26 -0
  154. package/components/qr-code/types.js.map +1 -1
  155. package/components/radio/themes/radio.base.css.js +1 -1
  156. package/components/radio/themes/radio.base.css.js.map +1 -1
  157. package/components/radio/themes/shared/radio.bootstrap.css.js +1 -1
  158. package/components/radio/themes/shared/radio.bootstrap.css.js.map +1 -1
  159. package/components/radio/themes/shared/radio.indigo.css.js +1 -1
  160. package/components/radio/themes/shared/radio.indigo.css.js.map +1 -1
  161. package/components/resize-container/themes/resize-container.base.css.js +1 -1
  162. package/components/resize-container/themes/resize-container.base.css.js.map +1 -1
  163. package/components/select/themes/select.base.css.js +1 -1
  164. package/components/select/themes/select.base.css.js.map +1 -1
  165. package/components/select/themes/shared/select.bootstrap.css.js +1 -1
  166. package/components/select/themes/shared/select.bootstrap.css.js.map +1 -1
  167. package/components/slider/themes/shared/slider.material.css.js +1 -1
  168. package/components/slider/themes/shared/slider.material.css.js.map +1 -1
  169. package/components/slider/themes/slider.base.css.js +1 -1
  170. package/components/slider/themes/slider.base.css.js.map +1 -1
  171. package/components/snackbar/themes/snackbar.base.css.js +1 -1
  172. package/components/snackbar/themes/snackbar.base.css.js.map +1 -1
  173. package/components/splitter/themes/splitter.base.css.js +1 -1
  174. package/components/splitter/themes/splitter.base.css.js.map +1 -1
  175. package/components/stepper/themes/step/step.base.css.js +1 -1
  176. package/components/stepper/themes/step/step.base.css.js.map +1 -1
  177. package/components/tabs/themes/shared/tab/tab.bootstrap.css.js +1 -1
  178. package/components/tabs/themes/shared/tab/tab.bootstrap.css.js.map +1 -1
  179. package/components/tabs/themes/shared/tab/tab.fluent.css.js +1 -1
  180. package/components/tabs/themes/shared/tab/tab.fluent.css.js.map +1 -1
  181. package/components/tabs/themes/shared/tab/tab.indigo.css.js +1 -1
  182. package/components/tabs/themes/shared/tab/tab.indigo.css.js.map +1 -1
  183. package/components/tabs/themes/shared/tab/tab.material.css.js +1 -1
  184. package/components/tabs/themes/shared/tab/tab.material.css.js.map +1 -1
  185. package/components/tabs/themes/shared/tabs/tabs.fluent.css.js +1 -1
  186. package/components/tabs/themes/shared/tabs/tabs.fluent.css.js.map +1 -1
  187. package/components/tabs/themes/shared/tabs/tabs.indigo.css.js +1 -1
  188. package/components/tabs/themes/shared/tabs/tabs.indigo.css.js.map +1 -1
  189. package/components/tabs/themes/shared/tabs/tabs.material.css.js +1 -1
  190. package/components/tabs/themes/shared/tabs/tabs.material.css.js.map +1 -1
  191. package/components/tabs/themes/tab.base.css.js +1 -1
  192. package/components/tabs/themes/tab.base.css.js.map +1 -1
  193. package/components/textarea/textarea.d.ts +2 -15
  194. package/components/textarea/textarea.js +48 -93
  195. package/components/textarea/textarea.js.map +1 -1
  196. package/components/textarea/themes/shared/textarea.bootstrap.css.js +1 -1
  197. package/components/textarea/themes/shared/textarea.bootstrap.css.js.map +1 -1
  198. package/components/textarea/themes/shared/textarea.common.css.js +1 -1
  199. package/components/textarea/themes/shared/textarea.common.css.js.map +1 -1
  200. package/components/textarea/themes/shared/textarea.fluent.css.js +1 -1
  201. package/components/textarea/themes/shared/textarea.fluent.css.js.map +1 -1
  202. package/components/textarea/themes/shared/textarea.indigo.css.js +1 -1
  203. package/components/textarea/themes/shared/textarea.indigo.css.js.map +1 -1
  204. package/components/textarea/themes/shared/textarea.material.css.js +1 -1
  205. package/components/textarea/themes/shared/textarea.material.css.js.map +1 -1
  206. package/components/tile-manager/position.d.ts +2 -9
  207. package/components/tile-manager/position.js +27 -42
  208. package/components/tile-manager/position.js.map +1 -1
  209. package/components/tile-manager/resize-state.d.ts +11 -22
  210. package/components/tile-manager/resize-state.js +60 -119
  211. package/components/tile-manager/resize-state.js.map +1 -1
  212. package/components/tile-manager/resize-util.d.ts +3 -7
  213. package/components/tile-manager/resize-util.js +65 -72
  214. package/components/tile-manager/resize-util.js.map +1 -1
  215. package/components/tile-manager/serializer.d.ts +1 -1
  216. package/components/tile-manager/serializer.js +9 -10
  217. package/components/tile-manager/serializer.js.map +1 -1
  218. package/components/tile-manager/themes/shared/tile/tile.common.css.js +1 -1
  219. package/components/tile-manager/themes/shared/tile/tile.common.css.js.map +1 -1
  220. package/components/tile-manager/themes/tile.base.css.js +1 -1
  221. package/components/tile-manager/themes/tile.base.css.js.map +1 -1
  222. package/components/tile-manager/tile-ghost-util.js +16 -20
  223. package/components/tile-manager/tile-ghost-util.js.map +1 -1
  224. package/components/tile-manager/tile-manager.d.ts +5 -2
  225. package/components/tile-manager/tile-manager.js +27 -23
  226. package/components/tile-manager/tile-manager.js.map +1 -1
  227. package/components/tile-manager/tile.d.ts +32 -18
  228. package/components/tile-manager/tile.js +181 -161
  229. package/components/tile-manager/tile.js.map +1 -1
  230. package/components/tile-manager/types.d.ts +1 -5
  231. package/components/tile-manager/types.js.map +1 -1
  232. package/components/toast/themes/toast.base.css.js +1 -1
  233. package/components/toast/themes/toast.base.css.js.map +1 -1
  234. package/components/tooltip/themes/tooltip.base.css.js +1 -1
  235. package/components/tooltip/themes/tooltip.base.css.js.map +1 -1
  236. package/components/tree/themes/item.base.css.js +1 -1
  237. package/components/tree/themes/item.base.css.js.map +1 -1
  238. package/components/validation-container/themes/validator.base.css.js +1 -1
  239. package/components/validation-container/themes/validator.base.css.js.map +1 -1
  240. package/components/validation-container/validation-container.d.ts +10 -12
  241. package/components/validation-container/validation-container.js +14 -17
  242. package/components/validation-container/validation-container.js.map +1 -1
  243. package/custom-elements.json +1061 -946
  244. package/igniteui-webcomponents.css-data.json +1 -1
  245. package/igniteui-webcomponents.html-data.json +1 -1
  246. package/index.d.ts +2 -1
  247. package/index.js.map +1 -1
  248. package/internals/definitions/defineAllComponents.js +4 -0
  249. package/internals/definitions/defineAllComponents.js.map +1 -1
  250. package/internals/directives/drag.d.ts +144 -0
  251. package/internals/directives/drag.js +278 -0
  252. package/internals/directives/drag.js.map +1 -0
  253. package/internals/directives/resize.d.ts +109 -0
  254. package/internals/directives/resize.js +214 -0
  255. package/internals/directives/resize.js.map +1 -0
  256. package/internals/templates/input-shell.d.ts +12 -1
  257. package/internals/templates/input-shell.js +17 -10
  258. package/internals/templates/input-shell.js.map +1 -1
  259. package/internals/utils/dom.d.ts +2 -0
  260. package/internals/utils/dom.js +3 -0
  261. package/internals/utils/dom.js.map +1 -1
  262. package/internals/utils/events.d.ts +2 -0
  263. package/internals/utils/events.js +3 -0
  264. package/internals/utils/events.js.map +1 -1
  265. package/package.json +1 -1
  266. package/skills/README.md +1 -0
  267. package/skills/igniteui-wc-generate-from-image-design/references/gotchas.md +21 -0
  268. package/skills/igniteui-wc-integrate-with-framework/SKILL.md +4 -3
  269. package/skills/igniteui-wc-integrate-with-framework/references/vanilla-js.md +14 -0
  270. package/skills/igniteui-wc-migrate-grid-lite-to-premium/SKILL.md +12 -2
  271. package/web-types.json +2 -2
  272. package/components/resize-container/default-ghost.d.ts +0 -5
  273. package/components/resize-container/default-ghost.js +0 -20
  274. package/components/resize-container/default-ghost.js.map +0 -1
  275. package/components/resize-container/resize-container.d.ts +0 -60
  276. package/components/resize-container/resize-container.js +0 -156
  277. package/components/resize-container/resize-container.js.map +0 -1
  278. package/components/resize-container/resize-controller.d.ts +0 -46
  279. package/components/resize-container/resize-controller.js +0 -195
  280. package/components/resize-container/resize-controller.js.map +0 -1
  281. package/components/resize-container/themes/dark/resize-indicator.bootstrap.css.js +0 -3
  282. package/components/resize-container/themes/dark/resize-indicator.bootstrap.css.js.map +0 -1
  283. package/components/resize-container/themes/dark/resize-indicator.fluent.css.d.ts +0 -1
  284. package/components/resize-container/themes/dark/resize-indicator.fluent.css.js +0 -3
  285. package/components/resize-container/themes/dark/resize-indicator.fluent.css.js.map +0 -1
  286. package/components/resize-container/themes/dark/resize-indicator.indigo.css.d.ts +0 -1
  287. package/components/resize-container/themes/dark/resize-indicator.indigo.css.js +0 -3
  288. package/components/resize-container/themes/dark/resize-indicator.indigo.css.js.map +0 -1
  289. package/components/resize-container/themes/dark/resize-indicator.material.css.d.ts +0 -1
  290. package/components/resize-container/themes/dark/resize-indicator.material.css.js +0 -3
  291. package/components/resize-container/themes/dark/resize-indicator.material.css.js.map +0 -1
  292. package/components/resize-container/themes/dark/resize-indicator.shared.css.d.ts +0 -1
  293. package/components/resize-container/themes/dark/resize-indicator.shared.css.js +0 -3
  294. package/components/resize-container/themes/dark/resize-indicator.shared.css.js.map +0 -1
  295. package/components/resize-container/themes/light/resize-indicator.bootstrap.css.d.ts +0 -1
  296. package/components/resize-container/themes/light/resize-indicator.bootstrap.css.js +0 -3
  297. package/components/resize-container/themes/light/resize-indicator.bootstrap.css.js.map +0 -1
  298. package/components/resize-container/themes/light/resize-indicator.fluent.css.d.ts +0 -1
  299. package/components/resize-container/themes/light/resize-indicator.fluent.css.js +0 -3
  300. package/components/resize-container/themes/light/resize-indicator.fluent.css.js.map +0 -1
  301. package/components/resize-container/themes/light/resize-indicator.indigo.css.d.ts +0 -1
  302. package/components/resize-container/themes/light/resize-indicator.indigo.css.js +0 -3
  303. package/components/resize-container/themes/light/resize-indicator.indigo.css.js.map +0 -1
  304. package/components/resize-container/themes/light/resize-indicator.material.css.d.ts +0 -1
  305. package/components/resize-container/themes/light/resize-indicator.material.css.js +0 -3
  306. package/components/resize-container/themes/light/resize-indicator.material.css.js.map +0 -1
  307. package/components/resize-container/themes/light/resize-indicator.shared.css.d.ts +0 -1
  308. package/components/resize-container/themes/light/resize-indicator.shared.css.js +0 -3
  309. package/components/resize-container/themes/light/resize-indicator.shared.css.js.map +0 -1
  310. package/components/resize-container/themes/shared/resize-container.common.css.d.ts +0 -1
  311. package/components/resize-container/themes/shared/resize-container.common.css.js +0 -3
  312. package/components/resize-container/themes/shared/resize-container.common.css.js.map +0 -1
  313. package/components/resize-container/themes/themes.d.ts +0 -2
  314. package/components/resize-container/themes/themes.js +0 -47
  315. package/components/resize-container/themes/themes.js.map +0 -1
  316. package/components/resize-container/types.d.ts +0 -40
  317. package/components/resize-container/types.js +0 -2
  318. package/components/resize-container/types.js.map +0 -1
  319. package/internals/controllers/drag.d.ts +0 -166
  320. package/internals/controllers/drag.js +0 -283
  321. package/internals/controllers/drag.js.map +0 -1
  322. /package/components/{resize-container/themes/dark/resize-indicator.bootstrap.css.d.ts → progress/themes/linear/shared/linear.progress.bootstrap.css.d.ts} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"resize-indicator.indigo.css.js","sourceRoot":"","sources":["../../../../../src/components/resize-container/themes/light/resize-indicator.indigo.css.ts"],"names":[],"mappings":"AACE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,qDAAqD,CAAC","sourcesContent":["\n import { css } from 'lit';\n export const styles = css`:host{--ig-theme: indigo;--ig-theme-variant: light}`;\n "]}
@@ -1 +0,0 @@
1
- export declare const styles: import("lit").CSSResult;
@@ -1,3 +0,0 @@
1
- import { css } from 'lit';
2
- export const styles = css `:host{--ig-theme: material;--ig-theme-variant: light}`;
3
- //# sourceMappingURL=resize-indicator.material.css.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resize-indicator.material.css.js","sourceRoot":"","sources":["../../../../../src/components/resize-container/themes/light/resize-indicator.material.css.ts"],"names":[],"mappings":"AACE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,uDAAuD,CAAC","sourcesContent":["\n import { css } from 'lit';\n export const styles = css`:host{--ig-theme: material;--ig-theme-variant: light}`;\n "]}
@@ -1 +0,0 @@
1
- export declare const styles: import("lit").CSSResult;
@@ -1,3 +0,0 @@
1
- import { css } from 'lit';
2
- export const styles = css `:host{--resize-indicator: var(--ig-resize-indicator-resize-indicator, var(--ig-primary-500));--ig-theme-variant: light}`;
3
- //# sourceMappingURL=resize-indicator.shared.css.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resize-indicator.shared.css.js","sourceRoot":"","sources":["../../../../../src/components/resize-container/themes/light/resize-indicator.shared.css.ts"],"names":[],"mappings":"AACE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,yHAAyH,CAAC","sourcesContent":["\n import { css } from 'lit';\n export const styles = css`:host{--resize-indicator: var(--ig-resize-indicator-resize-indicator, var(--ig-primary-500));--ig-theme-variant: light}`;\n "]}
@@ -1 +0,0 @@
1
- export declare const styles: import("lit").CSSResult;
@@ -1,3 +0,0 @@
1
- import { css } from 'lit';
2
- export const styles = css `[part~=active]::after{content:"";position:absolute;pointer-events:none;inset:0;width:100%;height:100%;border-radius:var(--_border-radius);border:.0625rem solid var(--resize-indicator)}[part=trigger-side],[part=trigger],[part=trigger-bottom]{width:var(--_size);aspect-ratio:1;border-radius:50%;z-index:11111;background-color:var(--resize-indicator)}`;
3
- //# sourceMappingURL=resize-container.common.css.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resize-container.common.css.js","sourceRoot":"","sources":["../../../../../src/components/resize-container/themes/shared/resize-container.common.css.ts"],"names":[],"mappings":"AACE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,8VAA8V,CAAC","sourcesContent":["\n import { css } from 'lit';\n export const styles = css`[part~=active]::after{content:\"\";position:absolute;pointer-events:none;inset:0;width:100%;height:100%;border-radius:var(--_border-radius);border:.0625rem solid var(--resize-indicator)}[part=trigger-side],[part=trigger],[part=trigger-bottom]{width:var(--_size);aspect-ratio:1;border-radius:50%;z-index:11111;background-color:var(--resize-indicator)}`;\n "]}
@@ -1,2 +0,0 @@
1
- import type { Themes } from '#theming/types.js';
2
- export declare const all: Themes;
@@ -1,47 +0,0 @@
1
- import { css } from 'lit';
2
- import { styles as bootstrapDark } from './dark/resize-indicator.bootstrap.css.js';
3
- import { styles as fluentDark } from './dark/resize-indicator.fluent.css.js';
4
- import { styles as indigoDark } from './dark/resize-indicator.indigo.css.js';
5
- import { styles as materialDark } from './dark/resize-indicator.material.css.js';
6
- import { styles as sharedDark } from './dark/resize-indicator.shared.css.js';
7
- import { styles as bootstrapLight } from './light/resize-indicator.bootstrap.css.js';
8
- import { styles as fluentLight } from './light/resize-indicator.fluent.css.js';
9
- import { styles as indigoLight } from './light/resize-indicator.indigo.css.js';
10
- import { styles as materialLight } from './light/resize-indicator.material.css.js';
11
- import { styles as sharedLight } from './light/resize-indicator.shared.css.js';
12
- const light = {
13
- shared: css `
14
- ${sharedLight}
15
- `,
16
- bootstrap: css `
17
- ${bootstrapLight}
18
- `,
19
- material: css `
20
- ${materialLight}
21
- `,
22
- fluent: css `
23
- ${fluentLight}
24
- `,
25
- indigo: css `
26
- ${indigoLight}
27
- `,
28
- };
29
- const dark = {
30
- shared: css `
31
- ${sharedDark}
32
- `,
33
- bootstrap: css `
34
- ${bootstrapDark}
35
- `,
36
- material: css `
37
- ${materialDark}
38
- `,
39
- fluent: css `
40
- ${fluentDark}
41
- `,
42
- indigo: css `
43
- ${indigoDark}
44
- `,
45
- };
46
- export const all = { light, dark };
47
- //# sourceMappingURL=themes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"themes.js","sourceRoot":"","sources":["../../../../src/components/resize-container/themes/themes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAI1B,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAE7E,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAE/E,MAAM,KAAK,GAAG;IACZ,MAAM,EAAE,GAAG,CAAA;MACP,WAAW;GACd;IACD,SAAS,EAAE,GAAG,CAAA;MACV,cAAc;GACjB;IACD,QAAQ,EAAE,GAAG,CAAA;MACT,aAAa;GAChB;IACD,MAAM,EAAE,GAAG,CAAA;MACP,WAAW;GACd;IACD,MAAM,EAAE,GAAG,CAAA;MACP,WAAW;GACd;CACF,CAAC;AAEF,MAAM,IAAI,GAAG;IACX,MAAM,EAAE,GAAG,CAAA;MACP,UAAU;GACb;IACD,SAAS,EAAE,GAAG,CAAA;MACV,aAAa;GAChB;IACD,QAAQ,EAAE,GAAG,CAAA;MACT,YAAY;GACf;IACD,MAAM,EAAE,GAAG,CAAA;MACP,UAAU;GACb;IACD,MAAM,EAAE,GAAG,CAAA;MACP,UAAU;GACb;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,GAAG,GAAW,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC","sourcesContent":["import { css } from 'lit';\n\nimport type { Themes } from '#theming/types.js';\n// Dark Overrides\nimport { styles as bootstrapDark } from './dark/resize-indicator.bootstrap.css.js';\nimport { styles as fluentDark } from './dark/resize-indicator.fluent.css.js';\nimport { styles as indigoDark } from './dark/resize-indicator.indigo.css.js';\nimport { styles as materialDark } from './dark/resize-indicator.material.css.js';\nimport { styles as sharedDark } from './dark/resize-indicator.shared.css.js';\n// Light Overrides\nimport { styles as bootstrapLight } from './light/resize-indicator.bootstrap.css.js';\nimport { styles as fluentLight } from './light/resize-indicator.fluent.css.js';\nimport { styles as indigoLight } from './light/resize-indicator.indigo.css.js';\nimport { styles as materialLight } from './light/resize-indicator.material.css.js';\nimport { styles as sharedLight } from './light/resize-indicator.shared.css.js';\n\nconst light = {\n shared: css`\n ${sharedLight}\n `,\n bootstrap: css`\n ${bootstrapLight}\n `,\n material: css`\n ${materialLight}\n `,\n fluent: css`\n ${fluentLight}\n `,\n indigo: css`\n ${indigoLight}\n `,\n};\n\nconst dark = {\n shared: css`\n ${sharedDark}\n `,\n bootstrap: css`\n ${bootstrapDark}\n `,\n material: css`\n ${materialDark}\n `,\n fluent: css`\n ${fluentDark}\n `,\n indigo: css`\n ${indigoDark}\n `,\n};\n\nexport const all: Themes = { light, dark };\n"]}
@@ -1,40 +0,0 @@
1
- import type { Ref } from 'lit/directives/ref.js';
2
- export type ResizeMode = 'immediate' | 'deferred';
3
- export type ResizeCallback = (params: ResizeCallbackParams) => unknown;
4
- export type ResizeCancelCallback = (state: ResizeState) => unknown;
5
- export type ResizeGhostFactory = () => HTMLElement;
6
- export type ResizeState = {
7
- initial: DOMRect;
8
- current: DOMRect;
9
- deltaX: number;
10
- deltaY: number;
11
- ghost: HTMLElement | null;
12
- trigger: HTMLElement | null;
13
- commit?: () => unknown;
14
- };
15
- export type ResizeCallbackParams = {
16
- event: PointerEvent;
17
- state: ResizeState;
18
- };
19
- export type ResizeControllerConfiguration = {
20
- enabled?: boolean;
21
- ref?: Ref<HTMLElement>[];
22
- mode?: ResizeMode;
23
- deferredFactory?: ResizeGhostFactory;
24
- layer?: () => HTMLElement;
25
- /** Callback invoked at the start of a resize operation. */
26
- start?: ResizeCallback;
27
- /** Callback invoked on each pointer move during a resize operation. */
28
- resize?: ResizeCallback;
29
- /** Callback invoked when a resize operation completes. */
30
- end?: ResizeCallback;
31
- /** Callback invoked when a resize operation is cancelled. */
32
- cancel?: ResizeCancelCallback;
33
- /**
34
- * Optional callback that returns the DOM element which will be resized/resizing depending on the
35
- * configured mode of the controller.
36
- *
37
- * Defaults to the controller host.
38
- */
39
- resizeTarget?: () => HTMLElement;
40
- };
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/resize-container/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Ref } from 'lit/directives/ref.js';\n\nexport type ResizeMode = 'immediate' | 'deferred';\nexport type ResizeCallback = (params: ResizeCallbackParams) => unknown;\nexport type ResizeCancelCallback = (state: ResizeState) => unknown;\nexport type ResizeGhostFactory = () => HTMLElement;\n\nexport type ResizeState = {\n initial: DOMRect;\n current: DOMRect;\n deltaX: number;\n deltaY: number;\n ghost: HTMLElement | null;\n trigger: HTMLElement | null;\n commit?: () => unknown;\n};\n\nexport type ResizeCallbackParams = {\n event: PointerEvent;\n state: ResizeState;\n};\n\nexport type ResizeControllerConfiguration = {\n enabled?: boolean;\n ref?: Ref<HTMLElement>[];\n mode?: ResizeMode;\n deferredFactory?: ResizeGhostFactory;\n layer?: () => HTMLElement;\n /** Callback invoked at the start of a resize operation. */\n start?: ResizeCallback;\n /** Callback invoked on each pointer move during a resize operation. */\n resize?: ResizeCallback;\n /** Callback invoked when a resize operation completes. */\n end?: ResizeCallback;\n /** Callback invoked when a resize operation is cancelled. */\n cancel?: ResizeCancelCallback;\n /**\n * Optional callback that returns the DOM element which will be resized/resizing depending on the\n * configured mode of the controller.\n *\n * Defaults to the controller host.\n */\n resizeTarget?: () => HTMLElement;\n};\n"]}
@@ -1,166 +0,0 @@
1
- import type { LitElement, ReactiveController, ReactiveControllerHost } from 'lit';
2
- import type { Ref } from 'lit/directives/ref.js';
3
- type DragCallback = (parameters: DragCallbackParameters) => unknown;
4
- type DragCancelCallback = (state: DragState) => unknown;
5
- export type DragCallbackParameters = {
6
- event: PointerEvent;
7
- state: DragState;
8
- };
9
- type State = {
10
- initial: DOMRect;
11
- current: DOMRect;
12
- position: {
13
- x: number;
14
- y: number;
15
- };
16
- offset: {
17
- x: number;
18
- y: number;
19
- };
20
- pointerState: {
21
- previous: {
22
- x: number;
23
- y: number;
24
- };
25
- current: {
26
- x: number;
27
- y: number;
28
- };
29
- direction: Direction;
30
- };
31
- };
32
- type DragState = State & {
33
- ghost: HTMLElement | null;
34
- element: Element | null;
35
- };
36
- type Direction = 'start' | 'end' | 'bottom' | 'top';
37
- type DragControllerConfiguration = {
38
- /** Whether the drag feature is enabled for the current host. */
39
- enabled?: boolean;
40
- /**
41
- * The mode of the drag operation.
42
- *
43
- * Deferred will create a ghost element and keep the original element
44
- * at its place until the operation completes successfully.
45
- */
46
- mode?: 'immediate' | 'deferred';
47
- /**
48
- * Whether starting a drag operation should snap the dragged item's top left corner
49
- * to the cursor position.
50
- */
51
- snapToCursor?: boolean;
52
- /**
53
- * Guard function invoked during the `start` callback.
54
- * Returning a truthy value will stop the current drag operation.
55
- */
56
- skip?: (event: PointerEvent) => boolean;
57
- matchTarget?: (target: Element) => boolean;
58
- /**
59
- *
60
- */
61
- trigger?: () => HTMLElement;
62
- /**
63
- * Contain drag operations to the scope of the passed DOM element.
64
- */
65
- container?: Ref<HTMLElement>;
66
- /**
67
- * The DOM element that will "host" the ghost drag element when the controller
68
- * is set to **deferred**.
69
- *
70
- * @remarks
71
- * In **immediate** mode, this property is ignored.
72
- */
73
- layer?: () => HTMLElement;
74
- ghost?: () => HTMLElement;
75
- /** Callback invoked at the beginning of a drag operation. */
76
- start?: DragCallback;
77
- /** Callback invoked while dragging the target element. */
78
- move?: DragCallback;
79
- enter?: DragCallback;
80
- leave?: DragCallback;
81
- over?: DragCallback;
82
- /** Callback invoked during a drop operation. */
83
- end?: DragCallback;
84
- /** Callback invoked when a drag is cancelled */
85
- cancel?: DragCancelCallback;
86
- };
87
- declare class DragController implements ReactiveController {
88
- private readonly _host;
89
- private readonly _options;
90
- private readonly _abortHandle;
91
- private _state;
92
- private _matchedElement;
93
- private _id;
94
- private _hasPointerCapture;
95
- private _ghost;
96
- /** Whether `snapToCursor` is enabled for the controller. */
97
- private get _hasSnapping();
98
- /** Whether the current drag mode is deferred. */
99
- private get _isDeferred();
100
- /**
101
- * The source element which will capture pointer events and initiate drag mode.
102
- *
103
- * @remarks
104
- * By default that will be the host element itself, unless `trigger` is passed in.
105
- */
106
- private get _element();
107
- /**
108
- * The element being dragged.
109
- *
110
- * @remarks
111
- * When in **deferred** mode this returns a reference to the drag ghost element,
112
- * otherwise it is the host element.
113
- */
114
- private get _dragItem();
115
- /**
116
- * The DOM element that will "host" the ghost drag element when the controller
117
- * is set to **deferred**.
118
- *
119
- * @remarks
120
- * In **immediate** mode, this property is ignored.
121
- */
122
- private get _layer();
123
- private get _stateParameters();
124
- constructor(host: ReactiveControllerHost & LitElement, options?: DragControllerConfiguration);
125
- /** Whether the drag controller is enabled. */
126
- get enabled(): boolean;
127
- /** Updates the drag controller configuration. */
128
- set(options?: DragControllerConfiguration): void;
129
- /** Stops any drag operation and cleans up state, additional event listeners and elements. */
130
- dispose(): void;
131
- /** @internal */
132
- hostConnected(): void;
133
- /** @internal */
134
- hostDisconnected(): void;
135
- /** @internal */
136
- handleEvent(event: PointerEvent & KeyboardEvent): void;
137
- private _handlePointerDown;
138
- private _handlePointerMove;
139
- private _handlePointerEnd;
140
- private _handleCancel;
141
- private _setDragCancelListener;
142
- private _setInitialState;
143
- private _setDragState;
144
- /**
145
- * Toggles text selection for the duration of a drag operation.
146
- *
147
- * @remarks
148
- * Disabling `user-select` only on the dragged element is not enough, since browsers
149
- * (notably Safari) will still create a text selection in whatever elements sit under
150
- * the pointer while dragging. Applying it to the owner document's body prevents that
151
- * across the page for the active drag and is reverted once the operation completes.
152
- */
153
- private _toggleTextSelection;
154
- private _updateMatcher;
155
- private _updatePosition;
156
- private _updatePointerState;
157
- private _assignPosition;
158
- private _createDragGhost;
159
- private _removeGhost;
160
- private _shouldSkip;
161
- }
162
- /**
163
- * Adds a drag and drop controller to the given host
164
- */
165
- export declare function addDragController(host: ReactiveControllerHost & LitElement, options?: DragControllerConfiguration): DragController;
166
- export {};
@@ -1,283 +0,0 @@
1
- import { getDefaultLayer } from '../../components/resize-container/default-ghost.js';
2
- import { createAbortHandle } from '../abort-handler.js';
3
- import { getRoot, isLTR, roundByDPR, setStyles } from '../utils/dom.js';
4
- import { getElementFromPath } from '../utils/events.js';
5
- import { escapeKey, isKey } from './key-bindings.js';
6
- const additionalEvents = [
7
- 'pointermove',
8
- 'lostpointercapture',
9
- 'contextmenu',
10
- ];
11
- class DragController {
12
- get _hasSnapping() {
13
- return Boolean(this._options.snapToCursor);
14
- }
15
- get _isDeferred() {
16
- return this._options.mode === 'deferred';
17
- }
18
- get _element() {
19
- return this._options.trigger?.() ?? this._host;
20
- }
21
- get _dragItem() {
22
- return this._isDeferred ? this._ghost : this._host;
23
- }
24
- get _layer() {
25
- if (!this._isDeferred) {
26
- return this._host;
27
- }
28
- return this._options.layer?.() ?? this._host;
29
- }
30
- get _stateParameters() {
31
- return {
32
- ...this._state,
33
- ghost: this._ghost,
34
- element: this._matchedElement,
35
- };
36
- }
37
- constructor(host, options) {
38
- this._options = {
39
- enabled: true,
40
- mode: 'deferred',
41
- snapToCursor: false,
42
- layer: getDefaultLayer,
43
- };
44
- this._abortHandle = createAbortHandle();
45
- this._id = -1;
46
- this._hasPointerCapture = false;
47
- this._ghost = null;
48
- this._host = host;
49
- this._host.addController(this);
50
- this.set(options);
51
- }
52
- get enabled() {
53
- return Boolean(this._options.enabled);
54
- }
55
- set(options) {
56
- Object.assign(this._options, options);
57
- }
58
- dispose() {
59
- this._matchedElement = null;
60
- this._removeGhost();
61
- this._setDragState(false);
62
- }
63
- hostConnected() {
64
- const { signal } = this._abortHandle;
65
- this._host.addEventListener('dragstart', this, { signal });
66
- this._host.addEventListener('touchstart', this, { passive: false, signal });
67
- this._host.addEventListener('pointerdown', this, { signal });
68
- }
69
- hostDisconnected() {
70
- this._abortHandle.abort();
71
- this._setDragCancelListener(false);
72
- this._removeGhost();
73
- }
74
- handleEvent(event) {
75
- if (!this.enabled) {
76
- return;
77
- }
78
- switch (event.type) {
79
- case 'touchstart':
80
- case 'dragstart':
81
- case 'contextmenu':
82
- event.preventDefault();
83
- break;
84
- case 'keydown':
85
- this._handleCancel(event);
86
- break;
87
- case 'pointerdown':
88
- this._handlePointerDown(event);
89
- break;
90
- case 'pointermove':
91
- this._handlePointerMove(event);
92
- break;
93
- case 'lostpointercapture':
94
- this._handlePointerEnd(event);
95
- break;
96
- }
97
- }
98
- _handlePointerDown(event) {
99
- if (this._shouldSkip(event)) {
100
- return;
101
- }
102
- this._setInitialState(event);
103
- this._createDragGhost();
104
- this._updatePosition(event);
105
- const parameters = {
106
- event,
107
- state: this._stateParameters,
108
- };
109
- if (this._options.start?.call(this._host, parameters) === false) {
110
- this.dispose();
111
- return;
112
- }
113
- this._assignPosition(this._dragItem);
114
- this._setDragState();
115
- }
116
- _handlePointerMove(event) {
117
- if (!this._hasPointerCapture) {
118
- return;
119
- }
120
- this._updatePosition(event);
121
- this._updatePointerState(event);
122
- this._updateMatcher(event);
123
- const parameters = {
124
- event,
125
- state: this._stateParameters,
126
- };
127
- this._options.move?.call(this._host, parameters);
128
- this._assignPosition(this._dragItem);
129
- }
130
- _handlePointerEnd(event) {
131
- this._options.end?.call(this._host, {
132
- event,
133
- state: this._stateParameters,
134
- });
135
- this.dispose();
136
- }
137
- _handleCancel(event) {
138
- if (this._hasPointerCapture && isKey(event, escapeKey)) {
139
- this._options.cancel?.call(this._host, this._stateParameters);
140
- }
141
- }
142
- _setDragCancelListener(enabled = true) {
143
- enabled
144
- ? globalThis.addEventListener('keydown', this)
145
- : globalThis.removeEventListener('keydown', this);
146
- }
147
- _setInitialState({ pointerId, clientX, clientY, }) {
148
- const rect = this._host.getBoundingClientRect();
149
- const position = { x: rect.x, y: rect.y };
150
- const offset = { x: rect.x - clientX, y: rect.y - clientY };
151
- this._id = pointerId;
152
- this._state = {
153
- initial: rect,
154
- current: structuredClone(rect),
155
- position,
156
- offset,
157
- pointerState: {
158
- previous: { x: clientX, y: clientY },
159
- current: { x: clientX, y: clientY },
160
- direction: 'end',
161
- },
162
- };
163
- }
164
- _setDragState(enabled = true) {
165
- this._hasPointerCapture = enabled;
166
- const cssValue = enabled ? 'none' : '';
167
- setStyles(this._element, {
168
- touchAction: cssValue,
169
- userSelect: cssValue,
170
- webkitUserSelect: cssValue,
171
- });
172
- this._toggleTextSelection(enabled);
173
- enabled
174
- ? this._element.setPointerCapture(this._id)
175
- : this._element.releasePointerCapture(this._id);
176
- this._setDragCancelListener(enabled);
177
- for (const type of additionalEvents) {
178
- enabled
179
- ? this._host.addEventListener(type, this)
180
- : this._host.removeEventListener(type, this);
181
- }
182
- }
183
- _toggleTextSelection(disabled) {
184
- const value = disabled ? 'none' : '';
185
- const { style } = this._host.ownerDocument.body;
186
- style.userSelect = value;
187
- style.webkitUserSelect = value;
188
- if (disabled) {
189
- this._host.ownerDocument.getSelection()?.removeAllRanges();
190
- }
191
- }
192
- _updateMatcher(event) {
193
- if (!this._options.matchTarget) {
194
- return;
195
- }
196
- const match = getRoot(this._host)
197
- .elementsFromPoint(event.clientX, event.clientY)
198
- .find((element) => this._options.matchTarget.call(this._host, element));
199
- if (match && !this._matchedElement) {
200
- this._matchedElement = match;
201
- this._options.enter?.call(this._host, {
202
- event,
203
- state: this._stateParameters,
204
- });
205
- return;
206
- }
207
- if (!match && this._matchedElement) {
208
- this._options.leave?.call(this._host, {
209
- event,
210
- state: this._stateParameters,
211
- });
212
- this._matchedElement = null;
213
- return;
214
- }
215
- if (match && match === this._matchedElement) {
216
- this._options.over?.call(this._host, {
217
- event,
218
- state: this._stateParameters,
219
- });
220
- }
221
- }
222
- _updatePosition({ clientX, clientY }) {
223
- const { x, y } = this._state.offset;
224
- const { x: layerX, y: layerY } = this._isDeferred
225
- ? this._layer.getBoundingClientRect()
226
- : this._state.initial;
227
- const posX = this._hasSnapping ? clientX - layerX : clientX - layerX + x;
228
- const posY = this._hasSnapping ? clientY - layerY : clientY - layerY + y;
229
- this._state.position = { x: posX, y: posY };
230
- }
231
- _updatePointerState({ clientX, clientY }) {
232
- const state = this._state.pointerState;
233
- state.previous = { ...state.current };
234
- state.current = { x: clientX, y: clientY };
235
- const dx = state.current.x - state.previous.x;
236
- const dy = state.current.y - state.previous.y;
237
- if (Math.abs(dx) >= Math.abs(dy)) {
238
- const swapHorizontal = isLTR(this._host) ? dx >= 0 : dx <= 0;
239
- state.direction = swapHorizontal ? 'end' : 'start';
240
- }
241
- else {
242
- state.direction = dy >= 0 ? 'bottom' : 'top';
243
- }
244
- }
245
- _assignPosition(element) {
246
- element.style.transform = `translate3d(${roundByDPR(this._state.position.x)}px,${roundByDPR(this._state.position.y)}px,0)`;
247
- }
248
- _createDragGhost() {
249
- if (!this._isDeferred) {
250
- return;
251
- }
252
- this._ghost =
253
- this._options.ghost?.call(this._host) ??
254
- createDefaultDragGhost(this._host.getBoundingClientRect());
255
- this._layer.append(this._ghost);
256
- }
257
- _removeGhost() {
258
- this._ghost?.remove();
259
- this._ghost = null;
260
- }
261
- _shouldSkip(event) {
262
- return (Boolean(event.button) ||
263
- this._options.skip?.call(this._host, event) ||
264
- !getElementFromPath((e) => e === this._element, event));
265
- }
266
- }
267
- function createDefaultDragGhost({ x, y, width, height }) {
268
- const element = document.createElement('div');
269
- setStyles(element, {
270
- position: 'absolute',
271
- left: `${x}px`,
272
- top: `${y}px`,
273
- width: `${width}px`,
274
- height: `${height}px`,
275
- zIndex: '1000',
276
- background: 'gold',
277
- });
278
- return element;
279
- }
280
- export function addDragController(host, options) {
281
- return new DragController(host, options);
282
- }
283
- //# sourceMappingURL=drag.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"drag.js","sourceRoot":"","sources":["../../../src/internals/controllers/drag.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,eAAe,EAAE,MAAM,oDAAoD,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAuFrD,MAAM,gBAAgB,GAAG;IACvB,aAAa;IACb,oBAAoB;IACpB,aAAa;CACL,CAAC;AAEX,MAAM,cAAc;IAqBlB,IAAY,YAAY;QACtB,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IAC7C,CAAC;IAGD,IAAY,WAAW;QACrB,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,UAAU,CAAC;IAC3C,CAAC;IA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AAM,CAAC,CAAC;IAClC,CAAC;IAEO,YAAY;QAClB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;QACtB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACrB,CAAC;IAEO,WAAW,CAAC,KAAmB;QACrC,OAAO,CACL,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC;YACrB,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC;YAC3C,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,CACvD,CAAC;IACJ,CAAC;CACF;AAED,SAAS,sBAAsB,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAW;IAC9D,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAE9C,SAAS,CAAC,OAAO,EAAE;QACjB,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,GAAG,EAAE,GAAG,CAAC,IAAI;QACb,KAAK,EAAE,GAAG,KAAK,IAAI;QACnB,MAAM,EAAE,GAAG,MAAM,IAAI;QACrB,MAAM,EAAE,MAAM;QACd,UAAU,EAAE,MAAM;KACnB,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC;AAKD,MAAM,UAAU,iBAAiB,CAC/B,IAAyC,EACzC,OAAqC;IAErC,OAAO,IAAI,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC3C,CAAC","sourcesContent":["import type {\n LitElement,\n ReactiveController,\n ReactiveControllerHost,\n} from 'lit';\nimport type { Ref } from 'lit/directives/ref.js';\n\nimport { getDefaultLayer } from '../../components/resize-container/default-ghost.js';\nimport { createAbortHandle } from '../abort-handler.js';\nimport { getRoot, isLTR, roundByDPR, setStyles } from '../utils/dom.js';\nimport { getElementFromPath } from '../utils/events.js';\nimport { escapeKey, isKey } from './key-bindings.js';\n\ntype DragCallback = (parameters: DragCallbackParameters) => unknown;\ntype DragCancelCallback = (state: DragState) => unknown;\n\nexport type DragCallbackParameters = {\n event: PointerEvent;\n state: DragState;\n};\n\ntype State = {\n initial: DOMRect;\n current: DOMRect;\n position: { x: number; y: number };\n offset: { x: number; y: number };\n pointerState: {\n previous: { x: number; y: number };\n current: { x: number; y: number };\n direction: Direction;\n };\n};\n\ntype DragState = State & {\n ghost: HTMLElement | null;\n element: Element | null;\n};\n\ntype Direction = 'start' | 'end' | 'bottom' | 'top';\n\ntype DragControllerConfiguration = {\n /** Whether the drag feature is enabled for the current host. */\n enabled?: boolean;\n /**\n * The mode of the drag operation.\n *\n * Deferred will create a ghost element and keep the original element\n * at its place until the operation completes successfully.\n */\n mode?: 'immediate' | 'deferred';\n /**\n * Whether starting a drag operation should snap the dragged item's top left corner\n * to the cursor position.\n */\n snapToCursor?: boolean;\n /**\n * Guard function invoked during the `start` callback.\n * Returning a truthy value will stop the current drag operation.\n */\n skip?: (event: PointerEvent) => boolean;\n\n matchTarget?: (target: Element) => boolean;\n /**\n *\n */\n trigger?: () => HTMLElement;\n /**\n * Contain drag operations to the scope of the passed DOM element.\n */\n container?: Ref<HTMLElement>;\n /**\n * The DOM element that will \"host\" the ghost drag element when the controller\n * is set to **deferred**.\n *\n * @remarks\n * In **immediate** mode, this property is ignored.\n */\n layer?: () => HTMLElement;\n\n ghost?: () => HTMLElement;\n\n /** Callback invoked at the beginning of a drag operation. */\n start?: DragCallback;\n /** Callback invoked while dragging the target element. */\n move?: DragCallback;\n\n enter?: DragCallback;\n\n leave?: DragCallback;\n\n over?: DragCallback;\n\n /** Callback invoked during a drop operation. */\n end?: DragCallback;\n /** Callback invoked when a drag is cancelled */\n cancel?: DragCancelCallback;\n};\n\nconst additionalEvents = [\n 'pointermove',\n 'lostpointercapture',\n 'contextmenu',\n] as const;\n\nclass DragController implements ReactiveController {\n private readonly _host: ReactiveControllerHost & LitElement;\n private readonly _options: DragControllerConfiguration = {\n enabled: true,\n mode: 'deferred',\n snapToCursor: false,\n layer: getDefaultLayer,\n };\n\n private readonly _abortHandle = createAbortHandle();\n\n private _state!: State;\n\n private _matchedElement!: Element | null;\n\n private _id = -1;\n private _hasPointerCapture = false;\n\n private _ghost: HTMLElement | null = null;\n\n /** Whether `snapToCursor` is enabled for the controller. */\n private get _hasSnapping(): boolean {\n return Boolean(this._options.snapToCursor);\n }\n\n /** Whether the current drag mode is deferred. */\n private get _isDeferred(): boolean {\n return this._options.mode === 'deferred';\n }\n\n /**\n * The source element which will capture pointer events and initiate drag mode.\n *\n * @remarks\n * By default that will be the host element itself, unless `trigger` is passed in.\n */\n private get _element(): HTMLElement {\n return this._options.trigger?.() ?? this._host;\n }\n\n /**\n * The element being dragged.\n *\n * @remarks\n * When in **deferred** mode this returns a reference to the drag ghost element,\n * otherwise it is the host element.\n */\n private get _dragItem(): HTMLElement {\n return this._isDeferred ? this._ghost! : this._host;\n }\n\n /**\n * The DOM element that will \"host\" the ghost drag element when the controller\n * is set to **deferred**.\n *\n * @remarks\n * In **immediate** mode, this property is ignored.\n */\n private get _layer(): HTMLElement {\n if (!this._isDeferred) {\n return this._host;\n }\n\n return this._options.layer?.() ?? this._host;\n }\n\n private get _stateParameters(): DragState {\n return {\n ...this._state,\n ghost: this._ghost,\n element: this._matchedElement,\n };\n }\n\n constructor(\n host: ReactiveControllerHost & LitElement,\n options?: DragControllerConfiguration\n ) {\n this._host = host;\n this._host.addController(this);\n this.set(options);\n }\n\n // #region Public API\n\n /** Whether the drag controller is enabled. */\n public get enabled(): boolean {\n return Boolean(this._options.enabled);\n }\n\n /** Updates the drag controller configuration. */\n public set(options?: DragControllerConfiguration): void {\n Object.assign(this._options, options);\n }\n\n /** Stops any drag operation and cleans up state, additional event listeners and elements. */\n public dispose(): void {\n this._matchedElement = null;\n this._removeGhost();\n this._setDragState(false);\n }\n\n /** @internal */\n public hostConnected(): void {\n const { signal } = this._abortHandle;\n\n this._host.addEventListener('dragstart', this, { signal });\n this._host.addEventListener('touchstart', this, { passive: false, signal });\n this._host.addEventListener('pointerdown', this, { signal });\n }\n\n /** @internal */\n public hostDisconnected(): void {\n this._abortHandle.abort();\n this._setDragCancelListener(false);\n this._removeGhost();\n }\n\n /** @internal */\n public handleEvent(event: PointerEvent & KeyboardEvent): void {\n if (!this.enabled) {\n return;\n }\n\n switch (event.type) {\n case 'touchstart':\n case 'dragstart':\n // Prevent contextmenu default behavior during drag\n case 'contextmenu':\n event.preventDefault();\n break;\n case 'keydown':\n this._handleCancel(event);\n break;\n case 'pointerdown':\n this._handlePointerDown(event);\n break;\n case 'pointermove':\n this._handlePointerMove(event);\n break;\n case 'lostpointercapture':\n this._handlePointerEnd(event);\n break;\n }\n }\n\n // #endregion\n\n // #region Event handlers\n\n private _handlePointerDown(event: PointerEvent): void {\n if (this._shouldSkip(event)) {\n return;\n }\n\n this._setInitialState(event);\n this._createDragGhost();\n this._updatePosition(event);\n\n const parameters = {\n event,\n state: this._stateParameters,\n };\n\n if (this._options.start?.call(this._host, parameters) === false) {\n this.dispose();\n return;\n }\n\n this._assignPosition(this._dragItem);\n this._setDragState();\n }\n\n private _handlePointerMove(event: PointerEvent): void {\n if (!this._hasPointerCapture) {\n return;\n }\n\n this._updatePosition(event);\n this._updatePointerState(event);\n this._updateMatcher(event);\n\n const parameters = {\n event,\n state: this._stateParameters,\n };\n\n this._options.move?.call(this._host, parameters);\n\n this._assignPosition(this._dragItem);\n }\n\n private _handlePointerEnd(event: PointerEvent): void {\n this._options.end?.call(this._host, {\n event,\n state: this._stateParameters,\n });\n this.dispose();\n }\n\n private _handleCancel(event: KeyboardEvent): void {\n if (this._hasPointerCapture && isKey(event, escapeKey)) {\n // Reset state\n this._options.cancel?.call(this._host, this._stateParameters);\n }\n }\n\n // #endregion\n\n private _setDragCancelListener(enabled = true): void {\n enabled\n ? globalThis.addEventListener('keydown', this)\n : globalThis.removeEventListener('keydown', this);\n }\n\n private _setInitialState({\n pointerId,\n clientX,\n clientY,\n }: PointerEvent): void {\n const rect = this._host.getBoundingClientRect();\n const position = { x: rect.x, y: rect.y };\n const offset = { x: rect.x - clientX, y: rect.y - clientY };\n\n this._id = pointerId;\n this._state = {\n initial: rect,\n current: structuredClone(rect),\n position,\n offset,\n pointerState: {\n previous: { x: clientX, y: clientY },\n current: { x: clientX, y: clientY },\n direction: 'end',\n },\n };\n }\n\n private _setDragState(enabled = true): void {\n this._hasPointerCapture = enabled;\n const cssValue = enabled ? 'none' : '';\n\n setStyles(this._element, {\n touchAction: cssValue,\n userSelect: cssValue,\n webkitUserSelect: cssValue,\n });\n\n this._toggleTextSelection(enabled);\n\n enabled\n ? this._element.setPointerCapture(this._id)\n : this._element.releasePointerCapture(this._id);\n\n this._setDragCancelListener(enabled);\n\n // Toggle additional events\n for (const type of additionalEvents) {\n enabled\n ? this._host.addEventListener(type, this)\n : this._host.removeEventListener(type, this);\n }\n }\n\n /**\n * Toggles text selection for the duration of a drag operation.\n *\n * @remarks\n * Disabling `user-select` only on the dragged element is not enough, since browsers\n * (notably Safari) will still create a text selection in whatever elements sit under\n * the pointer while dragging. Applying it to the owner document's body prevents that\n * across the page for the active drag and is reverted once the operation completes.\n */\n private _toggleTextSelection(disabled: boolean): void {\n const value = disabled ? 'none' : '';\n const { style } = this._host.ownerDocument.body;\n\n style.userSelect = value;\n style.webkitUserSelect = value;\n\n if (disabled) {\n this._host.ownerDocument.getSelection()?.removeAllRanges();\n }\n }\n\n private _updateMatcher(event: PointerEvent) {\n if (!this._options.matchTarget) {\n return;\n }\n\n const match = getRoot(this._host)\n .elementsFromPoint(event.clientX, event.clientY)\n .find((element) => this._options.matchTarget!.call(this._host, element));\n\n if (match && !this._matchedElement) {\n this._matchedElement = match;\n this._options.enter?.call(this._host, {\n event,\n state: this._stateParameters,\n });\n return;\n }\n\n if (!match && this._matchedElement) {\n this._options.leave?.call(this._host, {\n event,\n state: this._stateParameters,\n });\n this._matchedElement = null;\n return;\n }\n\n if (match && match === this._matchedElement) {\n this._options.over?.call(this._host, {\n event,\n state: this._stateParameters,\n });\n }\n }\n\n private _updatePosition({ clientX, clientY }: PointerEvent): void {\n const { x, y } = this._state.offset;\n const { x: layerX, y: layerY } = this._isDeferred\n ? this._layer.getBoundingClientRect()\n : this._state.initial;\n\n const posX = this._hasSnapping ? clientX - layerX : clientX - layerX + x;\n const posY = this._hasSnapping ? clientY - layerY : clientY - layerY + y;\n\n this._state.position = { x: posX, y: posY };\n }\n\n private _updatePointerState({ clientX, clientY }: PointerEvent): void {\n const state = this._state.pointerState;\n\n state.previous = { ...state.current };\n state.current = { x: clientX, y: clientY };\n\n const dx = state.current.x - state.previous.x;\n const dy = state.current.y - state.previous.y;\n\n if (Math.abs(dx) >= Math.abs(dy)) {\n const swapHorizontal = isLTR(this._host) ? dx >= 0 : dx <= 0;\n state.direction = swapHorizontal ? 'end' : 'start';\n } else {\n state.direction = dy >= 0 ? 'bottom' : 'top';\n }\n }\n\n private _assignPosition(element: HTMLElement): void {\n element.style.transform = `translate3d(${roundByDPR(this._state.position.x)}px,${roundByDPR(this._state.position.y)}px,0)`;\n }\n\n private _createDragGhost(): void {\n if (!this._isDeferred) {\n return;\n }\n\n this._ghost =\n this._options.ghost?.call(this._host) ??\n createDefaultDragGhost(this._host.getBoundingClientRect());\n\n this._layer.append(this._ghost);\n }\n\n private _removeGhost(): void {\n this._ghost?.remove();\n this._ghost = null;\n }\n\n private _shouldSkip(event: PointerEvent): boolean {\n return (\n Boolean(event.button) ||\n this._options.skip?.call(this._host, event) ||\n !getElementFromPath((e) => e === this._element, event)\n );\n }\n}\n\nfunction createDefaultDragGhost({ x, y, width, height }: DOMRect): HTMLElement {\n const element = document.createElement('div');\n\n setStyles(element, {\n position: 'absolute',\n left: `${x}px`,\n top: `${y}px`,\n width: `${width}px`,\n height: `${height}px`,\n zIndex: '1000',\n background: 'gold',\n });\n\n return element;\n}\n\n/**\n * Adds a drag and drop controller to the given host\n */\nexport function addDragController(\n host: ReactiveControllerHost & LitElement,\n options?: DragControllerConfiguration\n): DragController {\n return new DragController(host, options);\n}\n"]}