@studiometa/js-toolkit 2.12.1 → 3.0.0-alpha.10

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 (383) hide show
  1. package/Base/Base.d.ts +8 -8
  2. package/Base/Base.js +75 -78
  3. package/Base/Base.js.map +2 -2
  4. package/Base/features.d.ts +15 -2
  5. package/Base/features.js +31 -1
  6. package/Base/features.js.map +2 -2
  7. package/Base/index.d.ts +1 -0
  8. package/Base/index.js +4 -0
  9. package/Base/index.js.map +2 -2
  10. package/Base/managers/AbstractManager.d.ts +1 -1
  11. package/Base/managers/ChildrenManager.d.ts +6 -6
  12. package/Base/managers/ChildrenManager.js +34 -20
  13. package/Base/managers/ChildrenManager.js.map +2 -2
  14. package/Base/managers/EventsManager.d.ts +6 -28
  15. package/Base/managers/EventsManager.js +54 -64
  16. package/Base/managers/EventsManager.js.map +2 -2
  17. package/Base/managers/OptionsManager.d.ts +6 -6
  18. package/Base/managers/OptionsManager.js +29 -23
  19. package/Base/managers/OptionsManager.js.map +3 -3
  20. package/Base/managers/RefsManager.d.ts +1 -1
  21. package/Base/managers/RefsManager.js +23 -34
  22. package/Base/managers/RefsManager.js.map +3 -3
  23. package/Base/managers/ResponsiveOptionsManager.js +7 -4
  24. package/Base/managers/ResponsiveOptionsManager.js.map +2 -2
  25. package/Base/managers/ServicesManager.d.ts +2 -4
  26. package/Base/managers/ServicesManager.js +2 -3
  27. package/Base/managers/ServicesManager.js.map +2 -2
  28. package/Base/utils.d.ts +10 -5
  29. package/Base/utils.js +37 -23
  30. package/Base/utils.js.map +2 -2
  31. package/README.md +107 -6
  32. package/decorators/index.d.ts +1 -1
  33. package/decorators/index.js +1 -1
  34. package/decorators/index.js.map +1 -1
  35. package/decorators/withBreakpointManager.js +6 -4
  36. package/decorators/withBreakpointManager.js.map +2 -2
  37. package/decorators/withBreakpointObserver.d.ts +0 -1
  38. package/decorators/withBreakpointObserver.js +5 -3
  39. package/decorators/withBreakpointObserver.js.map +2 -2
  40. package/decorators/withIntersectionObserver.js +3 -5
  41. package/decorators/withIntersectionObserver.js.map +2 -2
  42. package/decorators/withMountOnMediaQuery.js +3 -3
  43. package/decorators/withMountOnMediaQuery.js.map +2 -2
  44. package/decorators/withMountWhenInView.js +3 -3
  45. package/decorators/withMountWhenInView.js.map +2 -2
  46. package/decorators/withName.d.ts +6 -0
  47. package/decorators/withName.js +12 -0
  48. package/decorators/withName.js.map +7 -0
  49. package/decorators/withScrolledInView/utils.d.ts +12 -1
  50. package/decorators/withScrolledInView/utils.js.map +2 -2
  51. package/decorators/withScrolledInView/withScrolledInView.js +7 -62
  52. package/decorators/withScrolledInView/withScrolledInView.js.map +2 -2
  53. package/helpers/createApp.d.ts +3 -4
  54. package/helpers/createApp.js +21 -11
  55. package/helpers/createApp.js.map +2 -2
  56. package/helpers/getDirectChildren.js +10 -5
  57. package/helpers/getDirectChildren.js.map +2 -2
  58. package/helpers/importWhenVisible.js +1 -2
  59. package/helpers/importWhenVisible.js.map +1 -1
  60. package/index.d.ts +2 -3
  61. package/index.js +2 -4
  62. package/index.js.map +2 -2
  63. package/package.json +2 -10
  64. package/services/index.d.ts +1 -1
  65. package/services/index.js.map +2 -2
  66. package/services/pointer.d.ts +1 -1
  67. package/services/pointer.js +3 -3
  68. package/services/pointer.js.map +2 -2
  69. package/services/raf.js +2 -4
  70. package/services/raf.js.map +2 -2
  71. package/services/resize.d.ts +7 -6
  72. package/services/resize.js +18 -26
  73. package/services/resize.js.map +2 -2
  74. package/services/scroll.d.ts +14 -0
  75. package/services/scroll.js +39 -21
  76. package/services/scroll.js.map +2 -2
  77. package/utils/SmartQueue.d.ts +1 -1
  78. package/utils/SmartQueue.js +1 -1
  79. package/utils/SmartQueue.js.map +2 -2
  80. package/utils/css/animate.d.ts +33 -15
  81. package/utils/css/animate.js +67 -26
  82. package/utils/css/animate.js.map +2 -2
  83. package/utils/css/getOffsetSizes.js +2 -2
  84. package/utils/css/getOffsetSizes.js.map +1 -1
  85. package/utils/css/index.d.ts +2 -1
  86. package/utils/css/index.js +4 -4
  87. package/utils/css/index.js.map +2 -2
  88. package/utils/css/matrix.d.ts +1 -1
  89. package/utils/css/matrix.js.map +2 -2
  90. package/utils/css/transform.d.ts +1 -1
  91. package/utils/css/transform.js +1 -1
  92. package/utils/css/transform.js.map +2 -2
  93. package/utils/css/utils.d.ts +1 -1
  94. package/utils/css/utils.js +1 -1
  95. package/utils/css/utils.js.map +2 -2
  96. package/utils/index.d.ts +6 -4
  97. package/utils/index.js +17 -16
  98. package/utils/index.js.map +2 -2
  99. package/utils/is.d.ts +12 -0
  100. package/utils/is.js +17 -0
  101. package/utils/is.js.map +2 -2
  102. package/utils/math/createRange.d.ts +4 -0
  103. package/utils/math/createRange.js +13 -0
  104. package/utils/math/createRange.js.map +7 -0
  105. package/utils/math/ease.d.ts +1 -0
  106. package/utils/math/ease.js +2 -0
  107. package/utils/math/ease.js.map +2 -2
  108. package/utils/math/index.d.ts +5 -3
  109. package/utils/math/index.js +7 -3
  110. package/utils/math/index.js.map +2 -2
  111. package/utils/math/mean.d.ts +1 -0
  112. package/utils/math/mean.js +17 -0
  113. package/utils/math/mean.js.map +7 -0
  114. package/utils/memo.d.ts +5 -0
  115. package/utils/memo.js +14 -0
  116. package/utils/memo.js.map +7 -0
  117. package/utils/nextFrame.d.ts +4 -22
  118. package/utils/nextFrame.js +3 -10
  119. package/utils/nextFrame.js.map +2 -2
  120. package/utils/nextMicrotask.d.ts +4 -1
  121. package/utils/nextMicrotask.js +3 -3
  122. package/utils/nextMicrotask.js.map +2 -2
  123. package/utils/nextTick.d.ts +4 -1
  124. package/utils/nextTick.js +3 -3
  125. package/utils/nextTick.js.map +2 -2
  126. package/utils/random.d.ts +15 -0
  127. package/utils/random.js +15 -0
  128. package/utils/random.js.map +7 -0
  129. package/utils/scrollTo.d.ts +30 -6
  130. package/utils/scrollTo.js +97 -43
  131. package/utils/scrollTo.js.map +2 -2
  132. package/utils/string/changeCase.d.ts +24 -0
  133. package/utils/string/changeCase.js +47 -0
  134. package/utils/string/changeCase.js.map +7 -0
  135. package/utils/string/index.d.ts +1 -0
  136. package/utils/string/index.js +1 -0
  137. package/utils/string/index.js.map +2 -2
  138. package/utils/{focusTrap.d.ts → trapFocus.d.ts} +2 -10
  139. package/utils/{focusTrap.js → trapFocus.js} +5 -9
  140. package/utils/trapFocus.js.map +7 -0
  141. package/utils/tween.d.ts +59 -10
  142. package/utils/tween.js +24 -18
  143. package/utils/tween.js.map +2 -2
  144. package/Base/Base.cjs +0 -420
  145. package/Base/Base.cjs.map +0 -7
  146. package/Base/features.cjs +0 -27
  147. package/Base/features.cjs.map +0 -7
  148. package/Base/index.cjs +0 -21
  149. package/Base/index.cjs.map +0 -7
  150. package/Base/managers/AbstractManager.cjs +0 -78
  151. package/Base/managers/AbstractManager.cjs.map +0 -7
  152. package/Base/managers/ChildrenManager.cjs +0 -156
  153. package/Base/managers/ChildrenManager.cjs.map +0 -7
  154. package/Base/managers/EventsManager.cjs +0 -305
  155. package/Base/managers/EventsManager.cjs.map +0 -7
  156. package/Base/managers/OptionsManager.cjs +0 -198
  157. package/Base/managers/OptionsManager.cjs.map +0 -7
  158. package/Base/managers/RefsManager.cjs +0 -118
  159. package/Base/managers/RefsManager.cjs.map +0 -7
  160. package/Base/managers/ResponsiveOptionsManager.cjs +0 -79
  161. package/Base/managers/ResponsiveOptionsManager.cjs.map +0 -7
  162. package/Base/managers/ServicesManager.cjs +0 -161
  163. package/Base/managers/ServicesManager.cjs.map +0 -7
  164. package/Base/managers/index.cjs +0 -39
  165. package/Base/managers/index.cjs.map +0 -7
  166. package/Base/types.cjs +0 -19
  167. package/Base/types.cjs.map +0 -7
  168. package/Base/utils.cjs +0 -95
  169. package/Base/utils.cjs.map +0 -7
  170. package/decorators/index.cjs +0 -33
  171. package/decorators/index.cjs.map +0 -7
  172. package/decorators/withBreakpointManager.cjs +0 -102
  173. package/decorators/withBreakpointManager.cjs.map +0 -7
  174. package/decorators/withBreakpointObserver.cjs +0 -128
  175. package/decorators/withBreakpointObserver.cjs.map +0 -7
  176. package/decorators/withDrag.cjs +0 -56
  177. package/decorators/withDrag.cjs.map +0 -7
  178. package/decorators/withExtraConfig.cjs +0 -50
  179. package/decorators/withExtraConfig.cjs.map +0 -7
  180. package/decorators/withFreezedOptions.cjs +0 -50
  181. package/decorators/withFreezedOptions.cjs.map +0 -7
  182. package/decorators/withIntersectionObserver.cjs +0 -71
  183. package/decorators/withIntersectionObserver.cjs.map +0 -7
  184. package/decorators/withMountOnMediaQuery.cjs +0 -86
  185. package/decorators/withMountOnMediaQuery.cjs.map +0 -7
  186. package/decorators/withMountWhenInView.cjs +0 -92
  187. package/decorators/withMountWhenInView.cjs.map +0 -7
  188. package/decorators/withMountWhenPrefersMotion.cjs +0 -30
  189. package/decorators/withMountWhenPrefersMotion.cjs.map +0 -7
  190. package/decorators/withRelativePointer.cjs +0 -56
  191. package/decorators/withRelativePointer.cjs.map +0 -7
  192. package/decorators/withResponsiveOptions.cjs +0 -41
  193. package/decorators/withResponsiveOptions.cjs.map +0 -7
  194. package/decorators/withScrolledInView/index.cjs +0 -22
  195. package/decorators/withScrolledInView/index.cjs.map +0 -7
  196. package/decorators/withScrolledInView/types.cjs +0 -19
  197. package/decorators/withScrolledInView/types.cjs.map +0 -7
  198. package/decorators/withScrolledInView/utils.cjs +0 -99
  199. package/decorators/withScrolledInView/utils.cjs.map +0 -7
  200. package/decorators/withScrolledInView/withScrolledInView.cjs +0 -249
  201. package/decorators/withScrolledInView/withScrolledInView.cjs.map +0 -7
  202. package/decorators/withVue2.cjs +0 -68
  203. package/decorators/withVue2.cjs.map +0 -7
  204. package/decorators/withVue2.d.ts +0 -16
  205. package/decorators/withVue2.js +0 -46
  206. package/decorators/withVue2.js.map +0 -7
  207. package/helpers/createApp.cjs +0 -58
  208. package/helpers/createApp.cjs.map +0 -7
  209. package/helpers/getClosestParent.cjs +0 -45
  210. package/helpers/getClosestParent.cjs.map +0 -7
  211. package/helpers/getDirectChildren.cjs +0 -47
  212. package/helpers/getDirectChildren.cjs.map +0 -7
  213. package/helpers/getInstanceFromElement.cjs +0 -32
  214. package/helpers/getInstanceFromElement.cjs.map +0 -7
  215. package/helpers/importOnInteraction.cjs +0 -48
  216. package/helpers/importOnInteraction.cjs.map +0 -7
  217. package/helpers/importOnMediaQuery.cjs +0 -44
  218. package/helpers/importOnMediaQuery.cjs.map +0 -7
  219. package/helpers/importWhenIdle.cjs +0 -46
  220. package/helpers/importWhenIdle.cjs.map +0 -7
  221. package/helpers/importWhenPrefersMotion.cjs +0 -40
  222. package/helpers/importWhenPrefersMotion.cjs.map +0 -7
  223. package/helpers/importWhenVisible.cjs +0 -44
  224. package/helpers/importWhenVisible.cjs.map +0 -7
  225. package/helpers/index.cjs +0 -53
  226. package/helpers/index.cjs.map +0 -7
  227. package/helpers/utils.cjs +0 -37
  228. package/helpers/utils.cjs.map +0 -7
  229. package/index.cjs +0 -31
  230. package/index.cjs.map +0 -7
  231. package/services/drag.cjs +0 -231
  232. package/services/drag.cjs.map +0 -7
  233. package/services/index.cjs +0 -51
  234. package/services/index.cjs.map +0 -7
  235. package/services/key.cjs +0 -97
  236. package/services/key.cjs.map +0 -7
  237. package/services/load.cjs +0 -60
  238. package/services/load.cjs.map +0 -7
  239. package/services/pointer.cjs +0 -145
  240. package/services/pointer.cjs.map +0 -7
  241. package/services/raf.cjs +0 -80
  242. package/services/raf.cjs.map +0 -7
  243. package/services/resize.cjs +0 -107
  244. package/services/resize.cjs.map +0 -7
  245. package/services/scroll.cjs +0 -119
  246. package/services/scroll.cjs.map +0 -7
  247. package/services/service.cjs +0 -69
  248. package/services/service.cjs.map +0 -7
  249. package/utils/Queue.cjs +0 -93
  250. package/utils/Queue.cjs.map +0 -7
  251. package/utils/SmartQueue.cjs +0 -73
  252. package/utils/SmartQueue.cjs.map +0 -7
  253. package/utils/collide/boundingRectToCircle.cjs +0 -36
  254. package/utils/collide/boundingRectToCircle.cjs.map +0 -7
  255. package/utils/collide/collideCircleCircle.cjs +0 -35
  256. package/utils/collide/collideCircleCircle.cjs.map +0 -7
  257. package/utils/collide/collideCircleRect.cjs +0 -47
  258. package/utils/collide/collideCircleRect.cjs.map +0 -7
  259. package/utils/collide/collidePointCircle.cjs +0 -32
  260. package/utils/collide/collidePointCircle.cjs.map +0 -7
  261. package/utils/collide/collidePointRect.cjs +0 -32
  262. package/utils/collide/collidePointRect.cjs.map +0 -7
  263. package/utils/collide/collideRectRect.cjs +0 -32
  264. package/utils/collide/collideRectRect.cjs.map +0 -7
  265. package/utils/collide/index.cjs +0 -47
  266. package/utils/collide/index.cjs.map +0 -7
  267. package/utils/css/animate.cjs +0 -202
  268. package/utils/css/animate.cjs.map +0 -7
  269. package/utils/css/classes.cjs +0 -51
  270. package/utils/css/classes.cjs.map +0 -7
  271. package/utils/css/getOffsetSizes.cjs +0 -48
  272. package/utils/css/getOffsetSizes.cjs.map +0 -7
  273. package/utils/css/index.cjs +0 -52
  274. package/utils/css/index.cjs.map +0 -7
  275. package/utils/css/matrix.cjs +0 -30
  276. package/utils/css/matrix.cjs.map +0 -7
  277. package/utils/css/styles.cjs +0 -45
  278. package/utils/css/styles.cjs.map +0 -7
  279. package/utils/css/transform.cjs +0 -91
  280. package/utils/css/transform.cjs.map +0 -7
  281. package/utils/css/transition.cjs +0 -145
  282. package/utils/css/transition.cjs.map +0 -7
  283. package/utils/css/utils.cjs +0 -32
  284. package/utils/css/utils.cjs.map +0 -7
  285. package/utils/debounce.cjs +0 -35
  286. package/utils/debounce.cjs.map +0 -7
  287. package/utils/dom/ancestors.cjs +0 -37
  288. package/utils/dom/ancestors.cjs.map +0 -7
  289. package/utils/dom/index.cjs +0 -21
  290. package/utils/dom/index.cjs.map +0 -7
  291. package/utils/focusTrap.cjs +0 -93
  292. package/utils/focusTrap.cjs.map +0 -7
  293. package/utils/focusTrap.js.map +0 -7
  294. package/utils/getComponentResolver.cjs +0 -38
  295. package/utils/getComponentResolver.cjs.map +0 -7
  296. package/utils/has.cjs +0 -29
  297. package/utils/has.cjs.map +0 -7
  298. package/utils/history.cjs +0 -92
  299. package/utils/history.cjs.map +0 -7
  300. package/utils/index.cjs +0 -76
  301. package/utils/index.cjs.map +0 -7
  302. package/utils/is.cjs +0 -41
  303. package/utils/is.cjs.map +0 -7
  304. package/utils/keyCodes.cjs +0 -36
  305. package/utils/keyCodes.cjs.map +0 -7
  306. package/utils/math/clamp.cjs +0 -29
  307. package/utils/math/clamp.cjs.map +0 -7
  308. package/utils/math/clamp01.cjs +0 -40
  309. package/utils/math/clamp01.cjs.map +0 -7
  310. package/utils/math/createEases.cjs +0 -33
  311. package/utils/math/createEases.cjs.map +0 -7
  312. package/utils/math/damp.cjs +0 -29
  313. package/utils/math/damp.cjs.map +0 -7
  314. package/utils/math/ease.cjs +0 -82
  315. package/utils/math/ease.cjs.map +0 -7
  316. package/utils/math/index.cjs +0 -54
  317. package/utils/math/index.cjs.map +0 -7
  318. package/utils/math/inertiaFinalValue.cjs +0 -47
  319. package/utils/math/inertiaFinalValue.cjs.map +0 -7
  320. package/utils/math/lerp.cjs +0 -29
  321. package/utils/math/lerp.cjs.map +0 -7
  322. package/utils/math/map.cjs +0 -29
  323. package/utils/math/map.cjs.map +0 -7
  324. package/utils/math/round.cjs +0 -29
  325. package/utils/math/round.cjs.map +0 -7
  326. package/utils/memoize.cjs +0 -48
  327. package/utils/memoize.cjs.map +0 -7
  328. package/utils/nextFrame.cjs +0 -41
  329. package/utils/nextFrame.cjs.map +0 -7
  330. package/utils/nextMicrotask.cjs +0 -30
  331. package/utils/nextMicrotask.cjs.map +0 -7
  332. package/utils/nextTick.cjs +0 -31
  333. package/utils/nextTick.cjs.map +0 -7
  334. package/utils/noop.cjs +0 -32
  335. package/utils/noop.cjs.map +0 -7
  336. package/utils/object/autoBind.cjs +0 -60
  337. package/utils/object/autoBind.cjs.map +0 -7
  338. package/utils/object/autoBind.d.ts +0 -14
  339. package/utils/object/autoBind.js +0 -28
  340. package/utils/object/autoBind.js.map +0 -7
  341. package/utils/object/getAllProperties.cjs +0 -39
  342. package/utils/object/getAllProperties.cjs.map +0 -7
  343. package/utils/object/index.cjs +0 -39
  344. package/utils/object/index.cjs.map +0 -7
  345. package/utils/object/index.d.ts +0 -2
  346. package/utils/object/index.js +0 -7
  347. package/utils/object/index.js.map +0 -7
  348. package/utils/scheduler.cjs +0 -75
  349. package/utils/scheduler.cjs.map +0 -7
  350. package/utils/scrollTo.cjs +0 -88
  351. package/utils/scrollTo.cjs.map +0 -7
  352. package/utils/string/endsWith.cjs +0 -35
  353. package/utils/string/endsWith.cjs.map +0 -7
  354. package/utils/string/index.cjs +0 -58
  355. package/utils/string/index.cjs.map +0 -7
  356. package/utils/string/startsWith.cjs +0 -35
  357. package/utils/string/startsWith.cjs.map +0 -7
  358. package/utils/string/withLeadingCharacters.cjs +0 -40
  359. package/utils/string/withLeadingCharacters.cjs.map +0 -7
  360. package/utils/string/withLeadingSlash.cjs +0 -40
  361. package/utils/string/withLeadingSlash.cjs.map +0 -7
  362. package/utils/string/withTrailingCharacters.cjs +0 -40
  363. package/utils/string/withTrailingCharacters.cjs.map +0 -7
  364. package/utils/string/withTrailingSlash.cjs +0 -40
  365. package/utils/string/withTrailingSlash.cjs.map +0 -7
  366. package/utils/string/withoutLeadingCharacters.cjs +0 -29
  367. package/utils/string/withoutLeadingCharacters.cjs.map +0 -7
  368. package/utils/string/withoutLeadingCharactersRecursive.cjs +0 -45
  369. package/utils/string/withoutLeadingCharactersRecursive.cjs.map +0 -7
  370. package/utils/string/withoutLeadingSlash.cjs +0 -40
  371. package/utils/string/withoutLeadingSlash.cjs.map +0 -7
  372. package/utils/string/withoutTrailingCharacters.cjs +0 -29
  373. package/utils/string/withoutTrailingCharacters.cjs.map +0 -7
  374. package/utils/string/withoutTrailingCharactersRecursive.cjs +0 -45
  375. package/utils/string/withoutTrailingCharactersRecursive.cjs.map +0 -7
  376. package/utils/string/withoutTrailingSlash.cjs +0 -40
  377. package/utils/string/withoutTrailingSlash.cjs.map +0 -7
  378. package/utils/throttle.cjs +0 -37
  379. package/utils/throttle.cjs.map +0 -7
  380. package/utils/tween.cjs +0 -122
  381. package/utils/tween.cjs.map +0 -7
  382. package/utils/wait.cjs +0 -31
  383. package/utils/wait.cjs.map +0 -7
@@ -1,50 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // packages/js-toolkit/decorators/withFreezedOptions.ts
20
- var withFreezedOptions_exports = {};
21
- __export(withFreezedOptions_exports, {
22
- withFreezedOptions: () => withFreezedOptions
23
- });
24
- module.exports = __toCommonJS(withFreezedOptions_exports);
25
- function withFreezedOptions(BaseClass) {
26
- class WithFreezedOptions extends BaseClass {
27
- /**
28
- * Hold freezed options
29
- *
30
- * @private
31
- */
32
- __freezedOptions;
33
- /**
34
- * Lazyly freeze the `$options` property.
35
- */
36
- get $options() {
37
- if (!this.__freezedOptions) {
38
- Object.defineProperty(this, "__freezedOptions", {
39
- value: Object.freeze({ ...super.$options }),
40
- enumerable: false,
41
- configurable: true
42
- });
43
- }
44
- return this.__freezedOptions;
45
- }
46
- }
47
- return WithFreezedOptions;
48
- }
49
- if (module.exports.default) module.exports = module.exports.default;
50
- //# sourceMappingURL=withFreezedOptions.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../packages/js-toolkit/decorators/withFreezedOptions.ts"],
4
- "sourcesContent": ["import type { BaseDecorator, BaseInterface } from '../Base/types.js';\nimport type { Base, BaseProps, BaseOptions } from '../Base/index.js';\n\nexport interface WithFreezedOptionsInterface extends BaseInterface {\n readonly $options: Readonly<BaseOptions>;\n}\n\n/**\n * Freeze the `$options` property to improve performance.\n */\nexport function withFreezedOptions<S extends Base>(\n BaseClass: typeof Base,\n): BaseDecorator<WithFreezedOptionsInterface, S> {\n /**\n * Class.\n */\n class WithFreezedOptions<T extends BaseProps = BaseProps> extends BaseClass<T> {\n /**\n * Hold freezed options\n *\n * @private\n */\n __freezedOptions;\n\n /**\n * Lazyly freeze the `$options` property.\n */\n get $options() {\n if (!this.__freezedOptions) {\n Object.defineProperty(this, '__freezedOptions', {\n value: Object.freeze({ ...super.$options }),\n enumerable: false,\n configurable: true,\n });\n }\n\n return this.__freezedOptions;\n }\n }\n\n // @ts-ignore\n return WithFreezedOptions;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAUO,SAAS,mBACd,WAC+C;AAAA,EAI/C,MAAM,2BAA4D,UAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAM7E;AAAA;AAAA;AAAA;AAAA,IAKA,IAAI,WAAW;AACb,UAAI,CAAC,KAAK,kBAAkB;AAC1B,eAAO,eAAe,MAAM,oBAAoB;AAAA,UAC9C,OAAO,OAAO,OAAO,EAAE,GAAG,MAAM,SAAS,CAAC;AAAA,UAC1C,YAAY;AAAA,UACZ,cAAc;AAAA,QAChB,CAAC;AAAA,MACH;AAEA,aAAO,KAAK;AAAA,IACd;AAAA,EACF;AAGA,SAAO;AACT;",
6
- "names": []
7
- }
@@ -1,71 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // packages/js-toolkit/decorators/withIntersectionObserver.ts
20
- var withIntersectionObserver_exports = {};
21
- __export(withIntersectionObserver_exports, {
22
- withIntersectionObserver: () => withIntersectionObserver
23
- });
24
- module.exports = __toCommonJS(withIntersectionObserver_exports);
25
- function createArrayOfNumber(length) {
26
- return new Array(length + 1).fill(length).map((val, index) => index / length);
27
- }
28
- function withIntersectionObserver(BaseClass, defaultOptions = { threshold: createArrayOfNumber(100) }) {
29
- class WithIntersectionObserver extends BaseClass {
30
- /**
31
- * Config
32
- */
33
- static config = {
34
- ...BaseClass.config,
35
- name: `${BaseClass.config.name}WithIntersectionObserver`,
36
- options: {
37
- ...BaseClass.config?.options || {},
38
- intersectionObserver: Object
39
- },
40
- emits: ["intersected"]
41
- };
42
- /**
43
- * Intersection observer instance.
44
- */
45
- $observer;
46
- /**
47
- * Create an observer when the class in instantiated.
48
- */
49
- constructor(element) {
50
- super(element);
51
- this.$observer = new IntersectionObserver(
52
- (entries) => {
53
- this.__callMethod("intersected", entries);
54
- },
55
- {
56
- ...defaultOptions,
57
- ...this.$options.intersectionObserver
58
- }
59
- );
60
- this.$on("mounted", () => {
61
- this.$observer.observe(this.$el);
62
- });
63
- this.$on("destroyed", () => {
64
- this.$observer.unobserve(this.$el);
65
- });
66
- }
67
- }
68
- return WithIntersectionObserver;
69
- }
70
- if (module.exports.default) module.exports = module.exports.default;
71
- //# sourceMappingURL=withIntersectionObserver.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../packages/js-toolkit/decorators/withIntersectionObserver.ts"],
4
- "sourcesContent": ["import type { BaseDecorator, BaseInterface } from '../Base/types.js';\nimport type { Base, BaseProps, BaseConfig } from '../Base/index.js';\n\nexport interface WithIntersectionObserverProps extends BaseProps {\n $options: {\n intersectionObserver: IntersectionObserverInit;\n };\n $observer: IntersectionObserver;\n intersected(entries: IntersectionObserverEntry[]): void;\n}\n\nexport interface WithIntersectionObserverInterface extends BaseInterface {\n $observer: IntersectionObserver;\n}\n\n/**\n * Create an array of number between 0 and 1 from the given length.\n */\nfunction createArrayOfNumber(length: number): number[] {\n return new Array(length + 1).fill(length).map((val, index) => index / length);\n}\n\n/**\n * IntersectionObserver decoration.\n */\nexport function withIntersectionObserver<S extends Base>(\n BaseClass: typeof Base,\n // eslint-disable-next-line unicorn/no-object-as-default-parameter\n defaultOptions: IntersectionObserverInit = { threshold: createArrayOfNumber(100) },\n): BaseDecorator<WithIntersectionObserverInterface, S, WithIntersectionObserverProps> {\n /**\n * Class.\n */\n class WithIntersectionObserver<T extends BaseProps = BaseProps> extends BaseClass<\n T & WithIntersectionObserverProps\n > {\n /**\n * Config\n */\n static config: BaseConfig = {\n ...BaseClass.config,\n name: `${BaseClass.config.name}WithIntersectionObserver`,\n options: {\n ...(BaseClass.config?.options || {}),\n intersectionObserver: Object,\n },\n emits: ['intersected'],\n };\n\n /**\n * Intersection observer instance.\n */\n $observer: IntersectionObserver;\n\n /**\n * Create an observer when the class in instantiated.\n */\n constructor(element: HTMLElement) {\n super(element);\n\n this.$observer = new IntersectionObserver(\n (entries) => {\n this.__callMethod('intersected', entries);\n },\n {\n ...defaultOptions,\n ...(this.$options.intersectionObserver as IntersectionObserverInit),\n },\n );\n\n this.$on('mounted', () => {\n this.$observer.observe(this.$el);\n });\n\n this.$on('destroyed', () => {\n this.$observer.unobserve(this.$el);\n });\n }\n }\n\n // @ts-ignore\n return WithIntersectionObserver;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBA,SAAS,oBAAoB,QAA0B;AACrD,SAAO,IAAI,MAAM,SAAS,CAAC,EAAE,KAAK,MAAM,EAAE,IAAI,CAAC,KAAK,UAAU,QAAQ,MAAM;AAC9E;AAKO,SAAS,yBACd,WAEA,iBAA2C,EAAE,WAAW,oBAAoB,GAAG,EAAE,GACG;AAAA,EAIpF,MAAM,iCAAkE,UAEtE;AAAA;AAAA;AAAA;AAAA,IAIA,OAAO,SAAqB;AAAA,MAC1B,GAAG,UAAU;AAAA,MACb,MAAM,GAAG,UAAU,OAAO,IAAI;AAAA,MAC9B,SAAS;AAAA,QACP,GAAI,UAAU,QAAQ,WAAW,CAAC;AAAA,QAClC,sBAAsB;AAAA,MACxB;AAAA,MACA,OAAO,CAAC,aAAa;AAAA,IACvB;AAAA;AAAA;AAAA;AAAA,IAKA;AAAA;AAAA;AAAA;AAAA,IAKA,YAAY,SAAsB;AAChC,YAAM,OAAO;AAEb,WAAK,YAAY,IAAI;AAAA,QACnB,CAAC,YAAY;AACX,eAAK,aAAa,eAAe,OAAO;AAAA,QAC1C;AAAA,QACA;AAAA,UACE,GAAG;AAAA,UACH,GAAI,KAAK,SAAS;AAAA,QACpB;AAAA,MACF;AAEA,WAAK,IAAI,WAAW,MAAM;AACxB,aAAK,UAAU,QAAQ,KAAK,GAAG;AAAA,MACjC,CAAC;AAED,WAAK,IAAI,aAAa,MAAM;AAC1B,aAAK,UAAU,UAAU,KAAK,GAAG;AAAA,MACnC,CAAC;AAAA,IACH;AAAA,EACF;AAGA,SAAO;AACT;",
6
- "names": []
7
- }
@@ -1,86 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // packages/js-toolkit/decorators/withMountOnMediaQuery.ts
20
- var withMountOnMediaQuery_exports = {};
21
- __export(withMountOnMediaQuery_exports, {
22
- withMountOnMediaQuery: () => withMountOnMediaQuery
23
- });
24
- module.exports = __toCommonJS(withMountOnMediaQuery_exports);
25
- var import_is = require("../utils/is.cjs");
26
- function withMountOnMediaQuery(BaseClass, media) {
27
- class WithMountOnMediaQuery extends BaseClass {
28
- /**
29
- * Config.
30
- */
31
- static config = {
32
- ...BaseClass.config,
33
- name: `${BaseClass.config.name}withMountOnMediaQuery`,
34
- options: {
35
- ...BaseClass.config?.options || {},
36
- media: String
37
- }
38
- };
39
- /**
40
- * Is the media query matches?
41
- *
42
- * @private
43
- */
44
- __matches = false;
45
- /**
46
- * Listen for media query changes when the class in instantiated.
47
- *
48
- * @param {HTMLElement} element The component's root element.
49
- */
50
- constructor(element) {
51
- super(element);
52
- if (import_is.isDev && !this.$options.media && !media) {
53
- this.$warn(
54
- 'Missing either "$options.media" or "media" argument in withMountOnMediaQuery decorator.'
55
- );
56
- return;
57
- }
58
- const mediaQueryList = window.matchMedia(this.$options.media || media);
59
- this.__matches = mediaQueryList.matches;
60
- const changeHandler = (event) => {
61
- this.__matches = event.matches;
62
- if (event.matches && !this.$isMounted) {
63
- this.$mount();
64
- } else if (this.$isMounted) {
65
- setTimeout(() => this.$destroy());
66
- }
67
- };
68
- mediaQueryList.addEventListener("change", changeHandler);
69
- this.$on("terminated", () => {
70
- mediaQueryList.removeEventListener("change", changeHandler);
71
- });
72
- }
73
- /**
74
- * Override the mounting of the component.
75
- */
76
- $mount() {
77
- if (this.__matches) {
78
- super.$mount();
79
- }
80
- return this;
81
- }
82
- }
83
- return WithMountOnMediaQuery;
84
- }
85
- if (module.exports.default) module.exports = module.exports.default;
86
- //# sourceMappingURL=withMountOnMediaQuery.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../packages/js-toolkit/decorators/withMountOnMediaQuery.ts"],
4
- "sourcesContent": ["import { BaseInterface, BaseDecorator } from '../Base/types.js';\nimport type { Base, BaseProps, BaseConfig } from '../Base/index.js';\nimport { isDev } from '../utils/is.js';\n\nexport interface withMountOnMediaQueryProps extends BaseProps {\n $options: {\n media: string;\n };\n}\n\nexport interface withMountOnMediaQueryInterface extends BaseInterface {\n /**\n * @private\n */\n __matches: boolean;\n $mount(): this;\n}\n\n/**\n * IntersectionObserver decoration.\n */\nexport function withMountOnMediaQuery<S extends Base = Base>(\n BaseClass: typeof Base,\n media,\n): BaseDecorator<withMountOnMediaQueryInterface, S, withMountOnMediaQueryProps> {\n /**\n * Class.\n */\n class WithMountOnMediaQuery<T extends BaseProps = BaseProps> extends BaseClass<\n T & withMountOnMediaQueryProps\n > {\n /**\n * Config.\n */\n static config: BaseConfig = {\n ...BaseClass.config,\n name: `${BaseClass.config.name}withMountOnMediaQuery`,\n options: {\n ...(BaseClass.config?.options || {}),\n media: String,\n },\n };\n\n /**\n * Is the media query matches?\n *\n * @private\n */\n __matches = false;\n\n /**\n * Listen for media query changes when the class in instantiated.\n *\n * @param {HTMLElement} element The component's root element.\n */\n constructor(element: HTMLElement) {\n super(element);\n\n if (isDev && !this.$options.media && !media) {\n this.$warn(\n 'Missing either \"$options.media\" or \"media\" argument in withMountOnMediaQuery decorator.',\n );\n return;\n }\n\n const mediaQueryList = window.matchMedia(this.$options.media || media);\n\n // Set initial value\n this.__matches = mediaQueryList.matches;\n\n const changeHandler = (event: MediaQueryListEvent) => {\n this.__matches = event.matches;\n\n if (event.matches && !this.$isMounted) {\n this.$mount();\n } else if (this.$isMounted) {\n setTimeout(() => this.$destroy());\n }\n };\n\n // Start listening for changes\n mediaQueryList.addEventListener('change', changeHandler);\n\n this.$on('terminated', () => {\n mediaQueryList.removeEventListener('change', changeHandler);\n });\n }\n\n /**\n * Override the mounting of the component.\n */\n $mount() {\n if (this.__matches) {\n super.$mount();\n }\n\n return this;\n }\n }\n\n // @ts-ignore\n return WithMountOnMediaQuery;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,gBAAsB;AAmBf,SAAS,sBACd,WACA,OAC8E;AAAA,EAI9E,MAAM,8BAA+D,UAEnE;AAAA;AAAA;AAAA;AAAA,IAIA,OAAO,SAAqB;AAAA,MAC1B,GAAG,UAAU;AAAA,MACb,MAAM,GAAG,UAAU,OAAO,IAAI;AAAA,MAC9B,SAAS;AAAA,QACP,GAAI,UAAU,QAAQ,WAAW,CAAC;AAAA,QAClC,OAAO;AAAA,MACT;AAAA,IACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOZ,YAAY,SAAsB;AAChC,YAAM,OAAO;AAEb,UAAI,mBAAS,CAAC,KAAK,SAAS,SAAS,CAAC,OAAO;AAC3C,aAAK;AAAA,UACH;AAAA,QACF;AACA;AAAA,MACF;AAEA,YAAM,iBAAiB,OAAO,WAAW,KAAK,SAAS,SAAS,KAAK;AAGrE,WAAK,YAAY,eAAe;AAEhC,YAAM,gBAAgB,CAAC,UAA+B;AACpD,aAAK,YAAY,MAAM;AAEvB,YAAI,MAAM,WAAW,CAAC,KAAK,YAAY;AACrC,eAAK,OAAO;AAAA,QACd,WAAW,KAAK,YAAY;AAC1B,qBAAW,MAAM,KAAK,SAAS,CAAC;AAAA,QAClC;AAAA,MACF;AAGA,qBAAe,iBAAiB,UAAU,aAAa;AAEvD,WAAK,IAAI,cAAc,MAAM;AAC3B,uBAAe,oBAAoB,UAAU,aAAa;AAAA,MAC5D,CAAC;AAAA,IACH;AAAA;AAAA;AAAA;AAAA,IAKA,SAAS;AACP,UAAI,KAAK,WAAW;AAClB,cAAM,OAAO;AAAA,MACf;AAEA,aAAO;AAAA,IACT;AAAA,EACF;AAGA,SAAO;AACT;",
6
- "names": []
7
- }
@@ -1,92 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // packages/js-toolkit/decorators/withMountWhenInView.ts
20
- var withMountWhenInView_exports = {};
21
- __export(withMountWhenInView_exports, {
22
- withMountWhenInView: () => withMountWhenInView
23
- });
24
- module.exports = __toCommonJS(withMountWhenInView_exports);
25
- function withMountWhenInView(BaseClass, defaultOptions = { threshold: [0, 1] }) {
26
- class WithMountWhenInView extends BaseClass {
27
- /**
28
- * Config.
29
- */
30
- static config = {
31
- ...BaseClass.config,
32
- name: `${BaseClass.config.name}WithMountWhenInView`,
33
- options: {
34
- ...BaseClass.config?.options || {},
35
- intersectionObserver: Object
36
- }
37
- };
38
- /**
39
- * Is the component visible?
40
- *
41
- * @private
42
- */
43
- __isVisible = false;
44
- /**
45
- * The component's observer.
46
- *
47
- * @private
48
- */
49
- __observer;
50
- /**
51
- * Create an observer when the class in instantiated.
52
- *
53
- * @param {HTMLElement} element The component's root element.
54
- */
55
- constructor(element) {
56
- super(element);
57
- this.__observer = new IntersectionObserver(
58
- (entries) => {
59
- const isVisible = entries.reduce((acc, entry) => acc || entry.isIntersecting, false);
60
- if (this.__isVisible !== isVisible) {
61
- this.__isVisible = isVisible;
62
- if (isVisible) {
63
- this.$mount();
64
- } else {
65
- setTimeout(() => this.$destroy());
66
- }
67
- }
68
- },
69
- {
70
- ...defaultOptions,
71
- ...this.$options.intersectionObserver
72
- }
73
- );
74
- this.__observer.observe(this.$el);
75
- this.$on("terminated", () => {
76
- this.__observer.disconnect();
77
- });
78
- }
79
- /**
80
- * Override the mounting of the component.
81
- */
82
- $mount() {
83
- if (this.__isVisible) {
84
- super.$mount();
85
- }
86
- return this;
87
- }
88
- }
89
- return WithMountWhenInView;
90
- }
91
- if (module.exports.default) module.exports = module.exports.default;
92
- //# sourceMappingURL=withMountWhenInView.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../packages/js-toolkit/decorators/withMountWhenInView.ts"],
4
- "sourcesContent": ["import { BaseInterface, BaseDecorator } from '../Base/types.js';\nimport type { Base, BaseProps, BaseConfig } from '../Base/index.js';\n\nexport interface WithMountWhenInViewProps extends BaseProps {\n $options: {\n intersectionObserver: IntersectionObserverInit;\n };\n}\n\nexport interface WithMountWhenInViewInterface extends BaseInterface {\n /**\n * @private\n */\n __isVisible: boolean;\n /**\n * @private\n */\n __observer: IntersectionObserver;\n $mount(): this;\n}\n\n/**\n * IntersectionObserver decoration.\n */\nexport function withMountWhenInView<S extends Base = Base>(\n BaseClass: typeof Base,\n // eslint-disable-next-line unicorn/no-object-as-default-parameter\n defaultOptions: IntersectionObserverInit = { threshold: [0, 1] },\n): BaseDecorator<WithMountWhenInViewInterface, S, WithMountWhenInViewProps> {\n /**\n * Class.\n */\n class WithMountWhenInView<T extends BaseProps = BaseProps> extends BaseClass<\n T & WithMountWhenInViewProps\n > {\n /**\n * Config.\n */\n static config: BaseConfig = {\n ...BaseClass.config,\n name: `${BaseClass.config.name}WithMountWhenInView`,\n options: {\n ...(BaseClass.config?.options || {}),\n intersectionObserver: Object,\n },\n };\n\n /**\n * Is the component visible?\n *\n * @private\n */\n __isVisible = false;\n\n /**\n * The component's observer.\n *\n * @private\n */\n __observer: IntersectionObserver;\n\n /**\n * Create an observer when the class in instantiated.\n *\n * @param {HTMLElement} element The component's root element.\n */\n constructor(element: HTMLElement) {\n super(element);\n\n this.__observer = new IntersectionObserver(\n (entries) => {\n const isVisible = entries.reduce((acc, entry) => acc || entry.isIntersecting, false);\n if (this.__isVisible !== isVisible) {\n this.__isVisible = isVisible;\n\n if (isVisible) {\n this.$mount();\n } else {\n setTimeout(() => this.$destroy());\n }\n }\n },\n {\n ...defaultOptions,\n ...(this.$options as typeof this.$options & WithMountWhenInViewProps['$options'])\n .intersectionObserver,\n },\n );\n\n this.__observer.observe(this.$el);\n\n this.$on('terminated', () => {\n this.__observer.disconnect();\n });\n }\n\n /**\n * Override the mounting of the component.\n */\n $mount() {\n if (this.__isVisible) {\n super.$mount();\n }\n\n return this;\n }\n }\n\n // @ts-ignore\n return WithMountWhenInView;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAwBO,SAAS,oBACd,WAEA,iBAA2C,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,GACW;AAAA,EAI1E,MAAM,4BAA6D,UAEjE;AAAA;AAAA;AAAA;AAAA,IAIA,OAAO,SAAqB;AAAA,MAC1B,GAAG,UAAU;AAAA,MACb,MAAM,GAAG,UAAU,OAAO,IAAI;AAAA,MAC9B,SAAS;AAAA,QACP,GAAI,UAAU,QAAQ,WAAW,CAAC;AAAA,QAClC,sBAAsB;AAAA,MACxB;AAAA,IACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,YAAY,SAAsB;AAChC,YAAM,OAAO;AAEb,WAAK,aAAa,IAAI;AAAA,QACpB,CAAC,YAAY;AACX,gBAAM,YAAY,QAAQ,OAAO,CAAC,KAAK,UAAU,OAAO,MAAM,gBAAgB,KAAK;AACnF,cAAI,KAAK,gBAAgB,WAAW;AAClC,iBAAK,cAAc;AAEnB,gBAAI,WAAW;AACb,mBAAK,OAAO;AAAA,YACd,OAAO;AACL,yBAAW,MAAM,KAAK,SAAS,CAAC;AAAA,YAClC;AAAA,UACF;AAAA,QACF;AAAA,QACA;AAAA,UACE,GAAG;AAAA,UACH,GAAI,KAAK,SACN;AAAA,QACL;AAAA,MACF;AAEA,WAAK,WAAW,QAAQ,KAAK,GAAG;AAEhC,WAAK,IAAI,cAAc,MAAM;AAC3B,aAAK,WAAW,WAAW;AAAA,MAC7B,CAAC;AAAA,IACH;AAAA;AAAA;AAAA;AAAA,IAKA,SAAS;AACP,UAAI,KAAK,aAAa;AACpB,cAAM,OAAO;AAAA,MACf;AAEA,aAAO;AAAA,IACT;AAAA,EACF;AAGA,SAAO;AACT;",
6
- "names": []
7
- }
@@ -1,30 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // packages/js-toolkit/decorators/withMountWhenPrefersMotion.ts
20
- var withMountWhenPrefersMotion_exports = {};
21
- __export(withMountWhenPrefersMotion_exports, {
22
- withMountWhenPrefersMotion: () => withMountWhenPrefersMotion
23
- });
24
- module.exports = __toCommonJS(withMountWhenPrefersMotion_exports);
25
- var import_withMountOnMediaQuery = require("./withMountOnMediaQuery.cjs");
26
- function withMountWhenPrefersMotion(BaseClass) {
27
- return (0, import_withMountOnMediaQuery.withMountOnMediaQuery)(BaseClass, "not (prefers-reduced-motion)");
28
- }
29
- if (module.exports.default) module.exports = module.exports.default;
30
- //# sourceMappingURL=withMountWhenPrefersMotion.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../packages/js-toolkit/decorators/withMountWhenPrefersMotion.ts"],
4
- "sourcesContent": ["import { withMountOnMediaQuery } from './withMountOnMediaQuery.js';\nimport type { Base } from '../Base/index.js';\nimport { BaseDecorator, BaseInterface } from '../Base/types.js';\n\nexport function withMountWhenPrefersMotion<S extends Base = Base>(\n BaseClass: typeof Base,\n): BaseDecorator<BaseInterface, S> {\n return withMountOnMediaQuery(BaseClass, 'not (prefers-reduced-motion)');\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mCAAsC;AAI/B,SAAS,2BACd,WACiC;AACjC,aAAO,oDAAsB,WAAW,8BAA8B;AACxE;",
6
- "names": []
7
- }
@@ -1,56 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // packages/js-toolkit/decorators/withRelativePointer.ts
20
- var withRelativePointer_exports = {};
21
- __export(withRelativePointer_exports, {
22
- withRelativePointer: () => withRelativePointer
23
- });
24
- module.exports = __toCommonJS(withRelativePointer_exports);
25
- var import_services = require("../services/index.cjs");
26
- function withRelativePointer(BaseClass, { target = (instance) => instance.$el } = {}) {
27
- class WithRelativePointer extends BaseClass {
28
- /**
29
- * Config.
30
- */
31
- static config = {
32
- name: `${BaseClass.config.name}WithRelativePointer`,
33
- emits: ["movedrelative"]
34
- };
35
- /**
36
- * Class constructor.
37
- */
38
- constructor(element) {
39
- super(element);
40
- this.$on("mounted", () => {
41
- this.$services.register(
42
- "movedrelative",
43
- import_services.usePointer.bind(void 0, target.call(this, this))
44
- );
45
- this.$services.enable("movedrelative");
46
- });
47
- this.$on("destroyed", () => {
48
- this.$services.disable("movedrelative");
49
- this.$services.unregister("movedrelative");
50
- });
51
- }
52
- }
53
- return WithRelativePointer;
54
- }
55
- if (module.exports.default) module.exports = module.exports.default;
56
- //# sourceMappingURL=withRelativePointer.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../packages/js-toolkit/decorators/withRelativePointer.ts"],
4
- "sourcesContent": ["import type { BaseDecorator, BaseInterface } from '../Base/types.js';\nimport type { Base, BaseProps, BaseConfig } from '../Base/index.js';\nimport type { PointerServiceProps } from '../services/pointer.js';\nimport { usePointer } from '../services/index.js';\n\nexport type RelativePointerDecoratorOptions = {\n target?: (this: Base, instance: Base) => HTMLElement;\n};\n\nexport interface RelativePointerInterface extends BaseInterface {\n movedrelative?(props: PointerServiceProps): void;\n}\n\n/**\n * Add dragging capabilities to a component.\n */\nexport function withRelativePointer<S extends Base>(\n BaseClass: typeof Base,\n { target = (instance) => instance.$el }: RelativePointerDecoratorOptions = {},\n): BaseDecorator<RelativePointerInterface, S> {\n /**\n * Class.\n */\n class WithRelativePointer<T extends BaseProps = BaseProps> extends BaseClass<T> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n name: `${BaseClass.config.name}WithRelativePointer`,\n emits: ['movedrelative'],\n };\n\n /**\n * Class constructor.\n */\n constructor(element: HTMLElement) {\n super(element);\n\n this.$on('mounted', () => {\n this.$services.register(\n 'movedrelative',\n usePointer.bind(undefined, target.call(this, this)),\n );\n this.$services.enable('movedrelative');\n });\n\n this.$on('destroyed', () => {\n this.$services.disable('movedrelative');\n this.$services.unregister('movedrelative');\n });\n }\n }\n\n // @ts-ignore\n return WithRelativePointer;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,sBAA2B;AAapB,SAAS,oBACd,WACA,EAAE,SAAS,CAAC,aAAa,SAAS,IAAI,IAAqC,CAAC,GAChC;AAAA,EAI5C,MAAM,4BAA6D,UAAa;AAAA;AAAA;AAAA;AAAA,IAI9E,OAAO,SAAqB;AAAA,MAC1B,MAAM,GAAG,UAAU,OAAO,IAAI;AAAA,MAC9B,OAAO,CAAC,eAAe;AAAA,IACzB;AAAA;AAAA;AAAA;AAAA,IAKA,YAAY,SAAsB;AAChC,YAAM,OAAO;AAEb,WAAK,IAAI,WAAW,MAAM;AACxB,aAAK,UAAU;AAAA,UACb;AAAA,UACA,2BAAW,KAAK,QAAW,OAAO,KAAK,MAAM,IAAI,CAAC;AAAA,QACpD;AACA,aAAK,UAAU,OAAO,eAAe;AAAA,MACvC,CAAC;AAED,WAAK,IAAI,aAAa,MAAM;AAC1B,aAAK,UAAU,QAAQ,eAAe;AACtC,aAAK,UAAU,WAAW,eAAe;AAAA,MAC3C,CAAC;AAAA,IACH;AAAA,EACF;AAGA,SAAO;AACT;",
6
- "names": []
7
- }
@@ -1,41 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // packages/js-toolkit/decorators/withResponsiveOptions.ts
20
- var withResponsiveOptions_exports = {};
21
- __export(withResponsiveOptions_exports, {
22
- withResponsiveOptions: () => withResponsiveOptions
23
- });
24
- module.exports = __toCommonJS(withResponsiveOptions_exports);
25
- var import_ResponsiveOptionsManager = require("../Base/managers/ResponsiveOptionsManager.cjs");
26
- function withResponsiveOptions(BaseClass) {
27
- class WithResponsiveOptions extends BaseClass {
28
- /**
29
- * Get managers.
30
- */
31
- get __managers() {
32
- return {
33
- ...super.__managers,
34
- OptionsManager: import_ResponsiveOptionsManager.ResponsiveOptionsManager
35
- };
36
- }
37
- }
38
- return WithResponsiveOptions;
39
- }
40
- if (module.exports.default) module.exports = module.exports.default;
41
- //# sourceMappingURL=withResponsiveOptions.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../packages/js-toolkit/decorators/withResponsiveOptions.ts"],
4
- "sourcesContent": ["import type { BaseInterface, BaseDecorator } from '../Base/types.js';\nimport type { Base, BaseProps, Managers } from '../Base/index.js';\nimport { ResponsiveOptionsManager } from '../Base/managers/ResponsiveOptionsManager.js';\n\n/**\n * Extends the configuration of an existing class.\n */\nexport function withResponsiveOptions<S extends Base>(\n BaseClass: typeof Base,\n): BaseDecorator<BaseInterface, S> {\n /**\n * Class.\n */\n class WithResponsiveOptions<T extends BaseProps = BaseProps> extends BaseClass<T> {\n /**\n * Get managers.\n */\n get __managers(): Managers & { OptionsManager: typeof ResponsiveOptionsManager } {\n return {\n ...super.__managers,\n OptionsManager: ResponsiveOptionsManager,\n };\n }\n }\n\n // @ts-ignore\n return WithResponsiveOptions;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,sCAAyC;AAKlC,SAAS,sBACd,WACiC;AAAA,EAIjC,MAAM,8BAA+D,UAAa;AAAA;AAAA;AAAA;AAAA,IAIhF,IAAI,aAA6E;AAC/E,aAAO;AAAA,QACL,GAAG,MAAM;AAAA,QACT,gBAAgB;AAAA,MAClB;AAAA,IACF;AAAA,EACF;AAGA,SAAO;AACT;",
6
- "names": []
7
- }
@@ -1,22 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from))
8
- if (!__hasOwnProp.call(to, key) && key !== except)
9
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
- }
11
- return to;
12
- };
13
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
-
16
- // packages/js-toolkit/decorators/withScrolledInView/index.ts
17
- var withScrolledInView_exports = {};
18
- module.exports = __toCommonJS(withScrolledInView_exports);
19
- __reExport(withScrolledInView_exports, require("./withScrolledInView.cjs"), module.exports);
20
- __reExport(withScrolledInView_exports, require("./types.cjs"), module.exports);
21
- if (module.exports.default) module.exports = module.exports.default;
22
- //# sourceMappingURL=index.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../packages/js-toolkit/decorators/withScrolledInView/index.ts"],
4
- "sourcesContent": ["export * from './withScrolledInView.js';\nexport * from './types.js';\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,uCAAc,qCAAd;AACA,uCAAc,wBADd;",
6
- "names": []
7
- }
@@ -1,19 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from))
8
- if (!__hasOwnProp.call(to, key) && key !== except)
9
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
- }
11
- return to;
12
- };
13
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
-
15
- // packages/js-toolkit/decorators/withScrolledInView/types.ts
16
- var types_exports = {};
17
- module.exports = __toCommonJS(types_exports);
18
- if (module.exports.default) module.exports = module.exports.default;
19
- //# sourceMappingURL=types.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../packages/js-toolkit/decorators/withScrolledInView/types.ts"],
4
- "sourcesContent": ["export type OffsetValue = 'start' | 'center' | 'end' | string | number;\n\nexport type NormalizedOffset = [[OffsetValue, OffsetValue], [OffsetValue, OffsetValue]];\n"],
5
- "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;",
6
- "names": []
7
- }