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,5 +0,0 @@
1
- /**
2
- * Default ghost element factory for the igc-resize implementation.
3
- */
4
- export declare function createDefaultGhostElement({ x, y, width, height, }: DOMRect): HTMLElement;
5
- export declare function getDefaultLayer(): HTMLElement;
@@ -1,20 +0,0 @@
1
- import { setStyles } from '#internals/utils/dom.js';
2
- export function createDefaultGhostElement({ x, y, width, height, }) {
3
- const element = document.createElement('div');
4
- const { scrollX, scrollY } = window;
5
- setStyles(element, {
6
- position: 'absolute',
7
- top: `${y + scrollY}px`,
8
- left: `${x + scrollX}px`,
9
- zIndex: '1000',
10
- background: 'pink',
11
- opacity: '0.85',
12
- width: `${width}px`,
13
- height: `${height}px`,
14
- });
15
- return element;
16
- }
17
- export function getDefaultLayer() {
18
- return document.body;
19
- }
20
- //# sourceMappingURL=default-ghost.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"default-ghost.js","sourceRoot":"","sources":["../../../src/components/resize-container/default-ghost.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAKpD,MAAM,UAAU,yBAAyB,CAAC,EACxC,CAAC,EACD,CAAC,EACD,KAAK,EACL,MAAM,GACE;IACR,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;IAEpC,SAAS,CAAC,OAAO,EAAE;QACjB,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,GAAG,CAAC,GAAG,OAAO,IAAI;QACvB,IAAI,EAAE,GAAG,CAAC,GAAG,OAAO,IAAI;QACxB,MAAM,EAAE,MAAM;QACd,UAAU,EAAE,MAAM;QAClB,OAAO,EAAE,MAAM;QACf,KAAK,EAAE,GAAG,KAAK,IAAI;QACnB,MAAM,EAAE,GAAG,MAAM,IAAI;KACtB,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,eAAe;IAC7B,OAAO,QAAQ,CAAC,IAAI,CAAC;AACvB,CAAC","sourcesContent":["import { setStyles } from '#internals/utils/dom.js';\n\n/**\n * Default ghost element factory for the igc-resize implementation.\n */\nexport function createDefaultGhostElement({\n x,\n y,\n width,\n height,\n}: DOMRect): HTMLElement {\n const element = document.createElement('div');\n const { scrollX, scrollY } = window;\n\n setStyles(element, {\n position: 'absolute',\n top: `${y + scrollY}px`,\n left: `${x + scrollX}px`,\n zIndex: '1000',\n background: 'pink',\n opacity: '0.85',\n width: `${width}px`,\n height: `${height}px`,\n });\n\n return element;\n}\n\nexport function getDefaultLayer(): HTMLElement {\n return document.body;\n}\n"]}
@@ -1,60 +0,0 @@
1
- import { LitElement, nothing } from 'lit';
2
- import type { Constructor } from '#internals/mixins/constructor.js';
3
- import type { ResizeCallbackParams, ResizeGhostFactory, ResizeMode } from './types.js';
4
- /** @hidden */
5
- export interface IgcResizeContainerComponentEventMap {
6
- igcResizeStart: CustomEvent<ResizeCallbackParams>;
7
- igcResize: CustomEvent<ResizeCallbackParams>;
8
- igcResizeEnd: CustomEvent<ResizeCallbackParams>;
9
- igcResizeCancel: CustomEvent<unknown>;
10
- }
11
- declare const IgcResizeContainerComponent_base: Constructor<import("#internals/mixins/event-emitter.js").EventEmitterInterface<IgcResizeContainerComponentEventMap>> & Constructor<LitElement>;
12
- /**
13
- * @element igc-resize
14
- *
15
- * @slot - renders the element(s) that should be resized
16
- * @slot side-adorner - renders the side resize handle.
17
- * @slot corner-adorner - renders the corner resize handle.
18
- * @slot bottom-adorner - renders the bottom resize handle.
19
- *
20
- */
21
- export default class IgcResizeContainerComponent extends IgcResizeContainerComponent_base {
22
- static readonly tagName = "igc-resize";
23
- static styles: import("lit").CSSResult[];
24
- static register(): void;
25
- private _controller;
26
- private _mode;
27
- private _ghostFactory?;
28
- /** The DOM container doing the actual resizing */
29
- private _container;
30
- /** Resize component adorners */
31
- private _adorners;
32
- private _isActive;
33
- /**
34
- * Whether to always show the resize element adorners.
35
- */
36
- active: boolean;
37
- set ghostFactory(value: ResizeGhostFactory);
38
- get ghostFactory(): ResizeGhostFactory | undefined;
39
- /** Get/Set the mode of the resizing operation. */
40
- set mode(value: ResizeMode);
41
- get mode(): ResizeMode;
42
- constructor();
43
- protected createRenderRoot(): HTMLElement | DocumentFragment;
44
- private _updateResizingState;
45
- private _handlePointerEnter;
46
- private _handlePointerLeave;
47
- private _handleResizeStart;
48
- private _handleResize;
49
- private _handleResizeEnd;
50
- private _handleResizeCancel;
51
- protected _renderAdorner(name: 'side' | 'corner' | 'bottom', part: string): import("lit-html").TemplateResult<1>;
52
- protected _renderAdorners(): typeof nothing | import("lit-html").TemplateResult<1>;
53
- protected render(): import("lit-html").TemplateResult<1>;
54
- }
55
- declare global {
56
- interface HTMLElementTagNameMap {
57
- 'igc-resize': IgcResizeContainerComponent;
58
- }
59
- }
60
- export {};
@@ -1,156 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { html, LitElement, nothing } from 'lit';
8
- import { property, state } from 'lit/decorators.js';
9
- import { createRef, ref } from 'lit/directives/ref.js';
10
- import { registerComponent } from '#internals/definitions/register.js';
11
- import { EventEmitterMixin } from '#internals/mixins/event-emitter.js';
12
- import { partMap } from '#internals/part-map.js';
13
- import { setStyles } from '#internals/utils/dom.js';
14
- import { bindIf } from '#internals/utils/lit.js';
15
- import { addThemingController } from '#theming/theming-controller.js';
16
- import IgcIconComponent from '../icon/icon.js';
17
- import { addResizeController } from './resize-controller.js';
18
- import { styles } from './themes/resize-container.base.css.js';
19
- import { styles as shared } from './themes/shared/resize-container.common.css.js';
20
- import { all } from './themes/themes.js';
21
- export default class IgcResizeContainerComponent extends EventEmitterMixin(LitElement) {
22
- static { this.tagName = 'igc-resize'; }
23
- static { this.styles = [styles, shared]; }
24
- static register() {
25
- registerComponent(IgcResizeContainerComponent, IgcIconComponent);
26
- }
27
- set ghostFactory(value) {
28
- this._ghostFactory = value;
29
- this._controller.set({ deferredFactory: this._ghostFactory });
30
- }
31
- get ghostFactory() {
32
- return this._ghostFactory;
33
- }
34
- set mode(value) {
35
- this._mode = value;
36
- this._controller.set({ mode: this._mode });
37
- }
38
- get mode() {
39
- return this._mode;
40
- }
41
- constructor() {
42
- super();
43
- this._mode = 'immediate';
44
- this._container = createRef();
45
- this._adorners = {
46
- side: createRef(),
47
- corner: createRef(),
48
- bottom: createRef(),
49
- };
50
- this._isActive = false;
51
- this.active = false;
52
- addThemingController(this, all);
53
- this._controller = addResizeController(this, {
54
- ref: [this._adorners.side, this._adorners.corner, this._adorners.bottom],
55
- mode: this._mode,
56
- deferredFactory: this._ghostFactory,
57
- start: this._handleResizeStart,
58
- resize: this._handleResize,
59
- end: this._handleResizeEnd,
60
- cancel: this._handleResizeCancel,
61
- resizeTarget: () => this._container.value,
62
- });
63
- }
64
- createRenderRoot() {
65
- const root = super.createRenderRoot();
66
- root.addEventListener('slotchange', () => this.requestUpdate());
67
- return root;
68
- }
69
- _updateResizingState(params) {
70
- const { initial, current, trigger } = params.state;
71
- const { side, bottom } = this._adorners;
72
- if (trigger === side.value) {
73
- current.height = initial.height;
74
- }
75
- else if (trigger === bottom.value) {
76
- current.width = initial.width;
77
- }
78
- }
79
- _handlePointerEnter() {
80
- this._isActive = true;
81
- }
82
- _handlePointerLeave() {
83
- this._isActive = false;
84
- }
85
- _handleResizeStart(params) {
86
- params.event.preventDefault();
87
- return this.emitEvent('igcResizeStart', {
88
- bubbles: false,
89
- cancelable: true,
90
- detail: params,
91
- });
92
- }
93
- _handleResize(params) {
94
- this._updateResizingState(params);
95
- this.emitEvent('igcResize', { bubbles: false, detail: params });
96
- }
97
- _handleResizeEnd(params) {
98
- this.emitEvent('igcResizeEnd', { bubbles: false, detail: params });
99
- }
100
- _handleResizeCancel({ initial }) {
101
- this._controller.dispose();
102
- if (this.mode !== 'deferred') {
103
- setStyles(this._container.value, {
104
- width: `${initial.width}px`,
105
- height: `${initial.height}px`,
106
- });
107
- }
108
- this.emitEvent('igcResizeCancel', { bubbles: false, cancelable: false });
109
- }
110
- _renderAdorner(name, part) {
111
- return html `
112
- <slot ${ref(this._adorners[name])} part=${part} name="${name}-adorner">
113
- </slot>
114
- `;
115
- }
116
- _renderAdorners() {
117
- if (!this._isActive && !this.active) {
118
- return nothing;
119
- }
120
- return html `
121
- ${this._renderAdorner('side', 'trigger-side')}
122
- ${this._renderAdorner('corner', 'trigger')}
123
- ${this._renderAdorner('bottom', 'trigger-bottom')}
124
- `;
125
- }
126
- render() {
127
- const parts = {
128
- 'resize-base': true,
129
- active: this._isActive || this.active,
130
- };
131
- return html `
132
- <div
133
- ${ref(this._container)}
134
- part=${partMap(parts)}
135
- @pointerenter=${bindIf(!this.active, this._handlePointerEnter)}
136
- @pointerleave=${bindIf(!this.active, this._handlePointerLeave)}
137
- >
138
- <slot></slot>
139
- ${this._renderAdorners()}
140
- </div>
141
- `;
142
- }
143
- }
144
- __decorate([
145
- state()
146
- ], IgcResizeContainerComponent.prototype, "_isActive", void 0);
147
- __decorate([
148
- property({ type: Boolean, reflect: true })
149
- ], IgcResizeContainerComponent.prototype, "active", void 0);
150
- __decorate([
151
- property({ attribute: false })
152
- ], IgcResizeContainerComponent.prototype, "ghostFactory", null);
153
- __decorate([
154
- property()
155
- ], IgcResizeContainerComponent.prototype, "mode", null);
156
- //# sourceMappingURL=resize-container.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resize-container.js","sourceRoot":"","sources":["../../../src/components/resize-container/resize-container.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAY,GAAG,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AA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,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2DACrB;AAGtB;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;+DAI9B;AAQD;IADC,QAAQ,EAAE;uDAIV","sourcesContent":["import { html, LitElement, nothing } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { createRef, type Ref, ref } from 'lit/directives/ref.js';\nimport { registerComponent } from '#internals/definitions/register.js';\nimport type { Constructor } from '#internals/mixins/constructor.js';\nimport { EventEmitterMixin } from '#internals/mixins/event-emitter.js';\nimport { partMap } from '#internals/part-map.js';\nimport { setStyles } from '#internals/utils/dom.js';\nimport { bindIf } from '#internals/utils/lit.js';\nimport { addThemingController } from '#theming/theming-controller.js';\nimport IgcIconComponent from '../icon/icon.js';\nimport { addResizeController } from './resize-controller.js';\nimport { styles } from './themes/resize-container.base.css.js';\nimport { styles as shared } from './themes/shared/resize-container.common.css.js';\nimport { all } from './themes/themes.js';\nimport type {\n ResizeCallbackParams,\n ResizeGhostFactory,\n ResizeMode,\n ResizeState,\n} from './types.js';\n\n/** @hidden */\nexport interface IgcResizeContainerComponentEventMap {\n igcResizeStart: CustomEvent<ResizeCallbackParams>;\n igcResize: CustomEvent<ResizeCallbackParams>;\n igcResizeEnd: CustomEvent<ResizeCallbackParams>;\n igcResizeCancel: CustomEvent<unknown>;\n}\n\n/* blazorSuppress */\n/**\n * @element igc-resize\n *\n * @slot - renders the element(s) that should be resized\n * @slot side-adorner - renders the side resize handle.\n * @slot corner-adorner - renders the corner resize handle.\n * @slot bottom-adorner - renders the bottom resize handle.\n *\n */\nexport default class IgcResizeContainerComponent extends EventEmitterMixin<\n IgcResizeContainerComponentEventMap,\n Constructor<LitElement>\n>(LitElement) {\n public static readonly tagName = 'igc-resize';\n public static styles = [styles, shared];\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(IgcResizeContainerComponent, IgcIconComponent);\n }\n\n private _controller: ReturnType<typeof addResizeController>;\n\n private _mode: ResizeMode = 'immediate';\n private _ghostFactory?: ResizeGhostFactory;\n\n /** The DOM container doing the actual resizing */\n private _container: Ref<HTMLElement> = createRef();\n\n /** Resize component adorners */\n private _adorners: Record<'side' | 'corner' | 'bottom', Ref<HTMLElement>> = {\n side: createRef(),\n corner: createRef(),\n bottom: createRef(),\n };\n\n @state()\n private _isActive = false;\n\n /**\n * Whether to always show the resize element adorners.\n */\n @property({ type: Boolean, reflect: true })\n public active = false;\n\n @property({ attribute: false })\n public set ghostFactory(value: ResizeGhostFactory) {\n this._ghostFactory = value;\n this._controller.set({ deferredFactory: this._ghostFactory });\n }\n\n public get ghostFactory(): ResizeGhostFactory | undefined {\n return this._ghostFactory;\n }\n\n /** Get/Set the mode of the resizing operation. */\n @property()\n public set mode(value: ResizeMode) {\n this._mode = value;\n this._controller.set({ mode: this._mode });\n }\n\n public get mode(): ResizeMode {\n return this._mode;\n }\n\n constructor() {\n super();\n\n addThemingController(this, all);\n\n this._controller = addResizeController(this, {\n ref: [this._adorners.side, this._adorners.corner, this._adorners.bottom],\n mode: this._mode,\n deferredFactory: this._ghostFactory,\n start: this._handleResizeStart,\n resize: this._handleResize,\n end: this._handleResizeEnd,\n cancel: this._handleResizeCancel,\n resizeTarget: () => this._container.value!,\n });\n }\n\n protected override createRenderRoot(): HTMLElement | DocumentFragment {\n const root = super.createRenderRoot();\n root.addEventListener('slotchange', () => this.requestUpdate());\n return root;\n }\n\n private _updateResizingState(params: ResizeCallbackParams): void {\n const { initial, current, trigger } = params.state;\n const { side, bottom } = this._adorners;\n\n if (trigger === side.value) {\n current.height = initial.height;\n } else if (trigger === bottom.value) {\n current.width = initial.width;\n }\n }\n\n private _handlePointerEnter(): void {\n this._isActive = true;\n }\n\n private _handlePointerLeave(): void {\n this._isActive = false;\n }\n\n private _handleResizeStart(params: ResizeCallbackParams) {\n params.event.preventDefault();\n\n return this.emitEvent('igcResizeStart', {\n bubbles: false,\n cancelable: true,\n detail: params,\n });\n }\n\n private _handleResize(params: ResizeCallbackParams): void {\n this._updateResizingState(params);\n this.emitEvent('igcResize', { bubbles: false, detail: params });\n }\n\n private _handleResizeEnd(params: ResizeCallbackParams): void {\n this.emitEvent('igcResizeEnd', { bubbles: false, detail: params });\n }\n\n private _handleResizeCancel({ initial }: ResizeState): void {\n this._controller.dispose();\n\n if (this.mode !== 'deferred') {\n setStyles(this._container.value!, {\n width: `${initial.width}px`,\n height: `${initial.height}px`,\n });\n }\n\n this.emitEvent('igcResizeCancel', { bubbles: false, cancelable: false });\n }\n\n protected _renderAdorner(name: 'side' | 'corner' | 'bottom', part: string) {\n return html`\n <slot ${ref(this._adorners[name])} part=${part} name=\"${name}-adorner\">\n </slot>\n `;\n }\n\n protected _renderAdorners() {\n if (!this._isActive && !this.active) {\n return nothing;\n }\n\n return html`\n ${this._renderAdorner('side', 'trigger-side')}\n ${this._renderAdorner('corner', 'trigger')}\n ${this._renderAdorner('bottom', 'trigger-bottom')}\n `;\n }\n\n protected override render() {\n const parts = {\n 'resize-base': true,\n active: this._isActive || this.active,\n };\n\n return html`\n <div\n ${ref(this._container)}\n part=${partMap(parts)}\n @pointerenter=${bindIf(!this.active, this._handlePointerEnter)}\n @pointerleave=${bindIf(!this.active, this._handlePointerLeave)}\n >\n <slot></slot>\n ${this._renderAdorners()}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-resize': IgcResizeContainerComponent;\n }\n}\n"]}
@@ -1,46 +0,0 @@
1
- import type { ReactiveController, ReactiveControllerHost } from 'lit';
2
- import type { ResizeControllerConfiguration } from './types.js';
3
- declare class ResizeController implements ReactiveController {
4
- private readonly _host;
5
- private readonly _abortHandle;
6
- private readonly _options;
7
- private _id;
8
- private _hasPointerCapture;
9
- private _state;
10
- private _activeRef;
11
- private _ghost;
12
- private get _element();
13
- private get _resizeTarget();
14
- private get _layer();
15
- /** Whether the controller is in deferred mode. */
16
- private get _isDeferred();
17
- private get _stateParameters();
18
- constructor(host: ReactiveControllerHost & HTMLElement, options?: ResizeControllerConfiguration);
19
- /** Whether the controller is enabled and will listen for events. */
20
- get enabled(): boolean;
21
- /** Updates the configuration of the resize controller. */
22
- set(options?: ResizeControllerConfiguration): void;
23
- /** Stops any resizing operation, cleaning up any additional elements and event listeners. */
24
- dispose(): void;
25
- /** @internal */
26
- hostConnected(): void;
27
- /** @internal */
28
- hostDisconnected(): void;
29
- /** @internal */
30
- handleEvent(event: PointerEvent & KeyboardEvent): void;
31
- private _handlePointerDown;
32
- private _handlePointerMove;
33
- private _handlePointerEnd;
34
- private _handleCancel;
35
- private _shouldSkip;
36
- private _setActiveRef;
37
- private _setResizeState;
38
- private _setResizeCancelListener;
39
- private _setInitialState;
40
- private _updateState;
41
- private _updatePosition;
42
- private _createGhostElement;
43
- private _removeGhostElement;
44
- }
45
- export declare function addResizeController(host: ReactiveControllerHost & HTMLElement, options?: ResizeControllerConfiguration): ResizeController;
46
- export {};
@@ -1,195 +0,0 @@
1
- import { createAbortHandle } from '#internals/abort-handler.js';
2
- import { escapeKey, isKey } from '#internals/controllers/key-bindings.js';
3
- import { setStyles } from '#internals/utils/dom.js';
4
- import { getElementFromPath } from '#internals/utils/events.js';
5
- import { createDefaultGhostElement, getDefaultLayer } from './default-ghost.js';
6
- const additionalEvents = [
7
- 'pointermove',
8
- 'lostpointercapture',
9
- 'contextmenu',
10
- ];
11
- class ResizeController {
12
- get _element() {
13
- return this._activeRef ?? this._host;
14
- }
15
- get _resizeTarget() {
16
- return this._options.resizeTarget?.call(this._host) ?? this._host;
17
- }
18
- get _layer() {
19
- if (!this._isDeferred) {
20
- return this._host;
21
- }
22
- return this._options.layer?.() ?? this._host;
23
- }
24
- get _isDeferred() {
25
- return this._options.mode === 'deferred';
26
- }
27
- get _stateParameters() {
28
- const { initial, current } = this._state;
29
- return {
30
- initial,
31
- current,
32
- deltaX: current.width - initial.width,
33
- deltaY: current.height - initial.height,
34
- ghost: this._ghost,
35
- trigger: this._activeRef,
36
- };
37
- }
38
- constructor(host, options) {
39
- this._abortHandle = createAbortHandle();
40
- this._options = {
41
- enabled: true,
42
- layer: getDefaultLayer,
43
- };
44
- this._id = -1;
45
- this._hasPointerCapture = false;
46
- this._activeRef = null;
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._setResizeState(false);
60
- this._removeGhostElement();
61
- this._activeRef = null;
62
- }
63
- hostConnected() {
64
- const { signal } = this._abortHandle;
65
- this._host.addEventListener('pointerdown', this, { signal });
66
- this._host.addEventListener('touchstart', this, { passive: false, signal });
67
- }
68
- hostDisconnected() {
69
- this._abortHandle.abort();
70
- this._setResizeCancelListener(false);
71
- this._removeGhostElement();
72
- }
73
- handleEvent(event) {
74
- if (!this.enabled) {
75
- return;
76
- }
77
- switch (event.type) {
78
- case 'touchstart':
79
- case 'contextmenu':
80
- event.preventDefault();
81
- break;
82
- case 'keydown':
83
- this._handleCancel(event);
84
- break;
85
- case 'pointerdown':
86
- this._handlePointerDown(event);
87
- break;
88
- case 'pointermove':
89
- this._handlePointerMove(event);
90
- break;
91
- case 'lostpointercapture':
92
- this._handlePointerEnd(event);
93
- break;
94
- }
95
- }
96
- _handlePointerDown(event) {
97
- if (event.button || this._shouldSkip(event)) {
98
- return;
99
- }
100
- this._setInitialState(event);
101
- this._createGhostElement();
102
- const parameters = { event, state: this._stateParameters };
103
- if (this._options.start?.call(this._host, parameters) === false) {
104
- this.dispose();
105
- return;
106
- }
107
- this._setResizeState();
108
- }
109
- _handlePointerMove(event) {
110
- if (!this._hasPointerCapture) {
111
- return;
112
- }
113
- this._updateState(event);
114
- const parameters = { event, state: this._stateParameters };
115
- this._options.resize?.call(this._host, parameters);
116
- this._state.current = parameters.state.current;
117
- this._updatePosition(this._isDeferred ? this._ghost : this._resizeTarget);
118
- }
119
- _handlePointerEnd(event) {
120
- const parameters = { event, state: this._stateParameters };
121
- this._options.end?.call(this._host, parameters);
122
- this._state.current = parameters.state.current;
123
- parameters.state.commit?.() ?? this._updatePosition(this._resizeTarget);
124
- this.dispose();
125
- }
126
- _handleCancel(event) {
127
- if (this._hasPointerCapture && isKey(event, escapeKey)) {
128
- this._options.cancel?.call(this._host, this._stateParameters);
129
- }
130
- }
131
- _shouldSkip(event) {
132
- this._setActiveRef(event);
133
- return !this._activeRef;
134
- }
135
- _setActiveRef(event) {
136
- const refs = this._options.ref?.map(({ value }) => value) ?? [this._host];
137
- this._activeRef =
138
- getElementFromPath((e) => refs.includes(e), event) ?? null;
139
- }
140
- _setResizeState(enabled = true) {
141
- this._hasPointerCapture = enabled;
142
- enabled
143
- ? this._element.setPointerCapture(this._id)
144
- : this._element.releasePointerCapture(this._id);
145
- this._setResizeCancelListener(enabled);
146
- for (const type of additionalEvents) {
147
- enabled
148
- ? this._host.addEventListener(type, this)
149
- : this._host.removeEventListener(type, this);
150
- }
151
- }
152
- _setResizeCancelListener(enabled = true) {
153
- enabled
154
- ? globalThis.addEventListener('keydown', this)
155
- : globalThis.removeEventListener('keydown', this);
156
- }
157
- _setInitialState({ pointerId }) {
158
- const dimensions = this._resizeTarget.getBoundingClientRect();
159
- this._id = pointerId;
160
- this._state = {
161
- initial: dimensions,
162
- current: structuredClone(dimensions),
163
- };
164
- }
165
- _updateState({ clientX, clientY }) {
166
- this._state.current.width = clientX - this._state.initial.x;
167
- this._state.current.height = clientY - this._state.initial.y;
168
- }
169
- _updatePosition(element) {
170
- if (element) {
171
- setStyles(element, {
172
- width: `${this._state.current.width}px`,
173
- height: `${this._state.current.height}px`,
174
- });
175
- }
176
- }
177
- _createGhostElement() {
178
- if (!this._isDeferred) {
179
- return;
180
- }
181
- this._ghost =
182
- this._options.deferredFactory?.call(this._host) ??
183
- createDefaultGhostElement(this._resizeTarget.getBoundingClientRect());
184
- this._ghost.setAttribute('data-resize-ghost', '');
185
- this._layer.append(this._ghost);
186
- }
187
- _removeGhostElement() {
188
- this._ghost?.remove();
189
- this._ghost = null;
190
- }
191
- }
192
- export function addResizeController(host, options) {
193
- return new ResizeController(host, options);
194
- }
195
- //# sourceMappingURL=resize-controller.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resize-controller.js","sourceRoot":"","sources":["../../../src/components/resize-container/resize-controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGhF,MAAM,gBAAgB,GAAG;IACvB,aAAa;IACb,oBAAoB;IACpB,aAAa;CACL,CAAC;AAOX,MAAM,gBAAgB;IAgBpB,IAAY,QAAQ;QAClB,OAAO,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,KAAK,CAAC;IACvC,CAAC;IAED,IAAY,aAAa;QACvB,OAAO,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC;IACpE,CAAC;IAED,IAAY,MAAM;QAChB,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACtB,OAAO,IAAI,CAAC,KAAK,CAAC;QACpB,CAAC;QAED,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC;IAC/C,CAAC;IAGD,IAAY,WAAW;QACrB,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,UAAU,CAAC;IAC3C,CAAC;IAED,IAAY,gBAAgB;QAC1B,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GA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T,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;gBAC/C,yBAAyB,CAAC,IAAI,CAAC,aAAa,CAAC,qBAAqB,EAAE,CAAC,CAAC;QAExE,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;QAClD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;IAEO,mBAAmB;QACzB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;QACtB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACrB,CAAC;CAGF;AAED,MAAM,UAAU,mBAAmB,CACjC,IAA0C,EAC1C,OAAuC;IAEvC,OAAO,IAAI,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC7C,CAAC","sourcesContent":["import type { ReactiveController, ReactiveControllerHost } from 'lit';\nimport { createAbortHandle } from '#internals/abort-handler.js';\nimport { escapeKey, isKey } from '#internals/controllers/key-bindings.js';\nimport { setStyles } from '#internals/utils/dom.js';\nimport { getElementFromPath } from '#internals/utils/events.js';\nimport { createDefaultGhostElement, getDefaultLayer } from './default-ghost.js';\nimport type { ResizeControllerConfiguration, ResizeState } from './types.js';\n\nconst additionalEvents = [\n 'pointermove',\n 'lostpointercapture',\n 'contextmenu',\n] as const;\n\ntype State = {\n initial: DOMRect;\n current: DOMRect;\n};\n\nclass ResizeController implements ReactiveController {\n private readonly _host: ReactiveControllerHost & HTMLElement;\n private readonly _abortHandle = createAbortHandle();\n\n private readonly _options: ResizeControllerConfiguration = {\n enabled: true,\n layer: getDefaultLayer,\n };\n\n private _id = -1;\n private _hasPointerCapture = false;\n private _state!: State;\n\n private _activeRef: HTMLElement | null = null;\n private _ghost: HTMLElement | null = null;\n\n private get _element(): HTMLElement {\n return this._activeRef ?? this._host;\n }\n\n private get _resizeTarget(): HTMLElement {\n return this._options.resizeTarget?.call(this._host) ?? this._host;\n }\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 /** Whether the controller is in deferred mode. */\n private get _isDeferred(): boolean {\n return this._options.mode === 'deferred';\n }\n\n private get _stateParameters(): ResizeState {\n const { initial, current } = this._state;\n\n return {\n initial,\n current,\n deltaX: current.width - initial.width,\n deltaY: current.height - initial.height,\n ghost: this._ghost,\n trigger: this._activeRef,\n };\n }\n\n constructor(\n host: ReactiveControllerHost & HTMLElement,\n options?: ResizeControllerConfiguration\n ) {\n this._host = host;\n this._host.addController(this);\n\n this.set(options);\n }\n\n // #region Public API\n\n /** Whether the controller is enabled and will listen for events. */\n public get enabled(): boolean {\n return Boolean(this._options.enabled);\n }\n\n /** Updates the configuration of the resize controller. */\n public set(options?: ResizeControllerConfiguration): void {\n Object.assign(this._options, options);\n }\n\n /** Stops any resizing operation, cleaning up any additional elements and event listeners. */\n public dispose(): void {\n this._setResizeState(false);\n this._removeGhostElement();\n this._activeRef = null;\n }\n\n /** @internal */\n public hostConnected(): void {\n const { signal } = this._abortHandle;\n this._host.addEventListener('pointerdown', this, { signal });\n this._host.addEventListener('touchstart', this, { passive: false, signal });\n }\n\n /** @internal */\n public hostDisconnected(): void {\n this._abortHandle.abort();\n this._setResizeCancelListener(false);\n this._removeGhostElement();\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 // Prevent contextmenu default behavior during resize\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 // #endregion\n\n // #region Event handlers\n\n private _handlePointerDown(event: PointerEvent): void {\n // Non-primary buttons are ignored\n if (event.button || this._shouldSkip(event)) {\n return;\n }\n\n this._setInitialState(event);\n this._createGhostElement();\n const parameters = { event, state: this._stateParameters };\n\n if (this._options.start?.call(this._host, parameters) === false) {\n this.dispose();\n return;\n }\n\n this._setResizeState();\n }\n\n private _handlePointerMove(event: PointerEvent): void {\n if (!this._hasPointerCapture) {\n return;\n }\n\n this._updateState(event);\n\n const parameters = { event, state: this._stateParameters };\n this._options.resize?.call(this._host, parameters);\n this._state.current = parameters.state.current;\n this._updatePosition(this._isDeferred ? this._ghost : this._resizeTarget);\n }\n\n private _handlePointerEnd(event: PointerEvent): void {\n const parameters = { event, state: this._stateParameters };\n\n this._options.end?.call(this._host, parameters);\n this._state.current = parameters.state.current;\n\n parameters.state.commit?.() ?? this._updatePosition(this._resizeTarget);\n this.dispose();\n }\n\n private _handleCancel(event: KeyboardEvent): void {\n if (this._hasPointerCapture && isKey(event, escapeKey)) {\n this._options.cancel?.call(this._host, this._stateParameters);\n }\n }\n\n // #endregion\n\n // #region Internal API\n\n private _shouldSkip(event: PointerEvent): boolean {\n this._setActiveRef(event);\n return !this._activeRef;\n }\n\n private _setActiveRef(event: Event): void {\n const refs = this._options.ref?.map(({ value }) => value) ?? [this._host];\n\n this._activeRef =\n getElementFromPath((e) => refs.includes(e as HTMLElement), event) ?? null;\n }\n\n private _setResizeState(enabled = true): void {\n this._hasPointerCapture = enabled;\n\n enabled\n ? this._element.setPointerCapture(this._id)\n : this._element.releasePointerCapture(this._id);\n\n this._setResizeCancelListener(enabled);\n\n // Toggle additional event listeners\n for (const type of additionalEvents) {\n enabled\n ? this._host.addEventListener(type, this)\n : this._host.removeEventListener(type, this);\n }\n }\n\n private _setResizeCancelListener(enabled = true): void {\n enabled\n ? globalThis.addEventListener('keydown', this)\n : globalThis.removeEventListener('keydown', this);\n }\n\n private _setInitialState({ pointerId }: PointerEvent): void {\n const dimensions = this._resizeTarget.getBoundingClientRect();\n\n this._id = pointerId;\n this._state = {\n initial: dimensions,\n current: structuredClone(dimensions),\n };\n }\n\n private _updateState({ clientX, clientY }: PointerEvent): void {\n this._state.current.width = clientX - this._state.initial.x;\n this._state.current.height = clientY - this._state.initial.y;\n }\n\n private _updatePosition(element: HTMLElement | null): void {\n if (element) {\n setStyles(element, {\n width: `${this._state.current.width}px`,\n height: `${this._state.current.height}px`,\n });\n }\n }\n\n private _createGhostElement(): void {\n if (!this._isDeferred) {\n return;\n }\n\n this._ghost =\n this._options.deferredFactory?.call(this._host) ??\n createDefaultGhostElement(this._resizeTarget.getBoundingClientRect());\n\n this._ghost.setAttribute('data-resize-ghost', '');\n this._layer.append(this._ghost);\n }\n\n private _removeGhostElement(): void {\n this._ghost?.remove();\n this._ghost = null;\n }\n\n // #endregion\n}\n\nexport function addResizeController(\n host: ReactiveControllerHost & HTMLElement,\n options?: ResizeControllerConfiguration\n): ResizeController {\n return new ResizeController(host, options);\n}\n"]}
@@ -1,3 +0,0 @@
1
- import { css } from 'lit';
2
- export const styles = css `:host{--ig-theme: bootstrap;--ig-theme-variant: dark}`;
3
- //# sourceMappingURL=resize-indicator.bootstrap.css.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resize-indicator.bootstrap.css.js","sourceRoot":"","sources":["../../../../../src/components/resize-container/themes/dark/resize-indicator.bootstrap.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: bootstrap;--ig-theme-variant: dark}`;\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: fluent;--ig-theme-variant: dark}`;
3
- //# sourceMappingURL=resize-indicator.fluent.css.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resize-indicator.fluent.css.js","sourceRoot":"","sources":["../../../../../src/components/resize-container/themes/dark/resize-indicator.fluent.css.ts"],"names":[],"mappings":"AACE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,oDAAoD,CAAC","sourcesContent":["\n import { css } from 'lit';\n export const styles = css`:host{--ig-theme: fluent;--ig-theme-variant: dark}`;\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-300));--ig-theme: indigo;--ig-theme-variant: dark}`;
3
- //# sourceMappingURL=resize-indicator.indigo.css.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resize-indicator.indigo.css.js","sourceRoot":"","sources":["../../../../../src/components/resize-container/themes/dark/resize-indicator.indigo.css.ts"],"names":[],"mappings":"AACE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,2IAA2I,CAAC","sourcesContent":["\n import { css } from 'lit';\n export const styles = css`:host{--resize-indicator: var(--ig-resize-indicator-resize-indicator, var(--ig-primary-300));--ig-theme: indigo;--ig-theme-variant: dark}`;\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: dark}`;
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/dark/resize-indicator.material.css.ts"],"names":[],"mappings":"AACE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,sDAAsD,CAAC","sourcesContent":["\n import { css } from 'lit';\n export const styles = css`:host{--ig-theme: material;--ig-theme-variant: dark}`;\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: dark}`;
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/dark/resize-indicator.shared.css.ts"],"names":[],"mappings":"AACE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,wHAAwH,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: dark}`;\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: bootstrap;--ig-theme-variant: light}`;
3
- //# sourceMappingURL=resize-indicator.bootstrap.css.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resize-indicator.bootstrap.css.js","sourceRoot":"","sources":["../../../../../src/components/resize-container/themes/light/resize-indicator.bootstrap.css.ts"],"names":[],"mappings":"AACE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,wDAAwD,CAAC","sourcesContent":["\n import { css } from 'lit';\n export const styles = css`:host{--ig-theme: bootstrap;--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: fluent;--ig-theme-variant: light}`;
3
- //# sourceMappingURL=resize-indicator.fluent.css.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resize-indicator.fluent.css.js","sourceRoot":"","sources":["../../../../../src/components/resize-container/themes/light/resize-indicator.fluent.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: fluent;--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: indigo;--ig-theme-variant: light}`;
3
- //# sourceMappingURL=resize-indicator.indigo.css.js.map