@opentiny/vue-renderless 3.11.7 → 3.12.0

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 (340) hide show
  1. package/anchor/index.js +13 -6
  2. package/anchor/vue.js +1 -1
  3. package/breadcrumb/index.js +6 -1
  4. package/breadcrumb-item/index.js +8 -1
  5. package/calendar-bar/index.js +295 -68
  6. package/calendar-bar/vue.js +82 -8
  7. package/calendar-view/index.js +2 -2
  8. package/card/index.js +4 -4
  9. package/card/vue.js +2 -3
  10. package/card-group/vue.js +3 -7
  11. package/carousel/index.js +26 -27
  12. package/carousel/vue.js +41 -46
  13. package/carousel-item/index.js +9 -6
  14. package/carousel-item/vue.js +4 -4
  15. package/cascader-mobile/index.js +5 -1
  16. package/cascader-mobile/vue.js +2 -1
  17. package/cascader-panel/index.js +6 -2
  18. package/cascader-view/index.js +363 -0
  19. package/cascader-view/vue.js +130 -0
  20. package/chart-core/deps/constants.js +27 -0
  21. package/chart-core/deps/numerify.js +27 -28
  22. package/chart-core/index.js +122 -31
  23. package/chart-core/vue.js +12 -8
  24. package/chart-radar/index.js +2 -2
  25. package/checkbox-button/vue.js +8 -1
  26. package/checkbox-group/vue.js +4 -5
  27. package/col/index.js +5 -9
  28. package/col/vue.js +4 -3
  29. package/collapse-item/index.js +14 -2
  30. package/color-picker/index.js +24 -34
  31. package/color-picker/utils/color.js +7 -1
  32. package/color-picker/vue.js +39 -26
  33. package/color-select-panel/alpha-select/vue.js +5 -8
  34. package/color-select-panel/hue-select/index.js +4 -2
  35. package/color-select-panel/hue-select/vue.js +11 -10
  36. package/color-select-panel/index.js +29 -17
  37. package/color-select-panel/utils/color.js +5 -0
  38. package/color-select-panel/vue.js +16 -7
  39. package/column-list-item/index.js +19 -5
  40. package/column-list-item/vue.js +16 -14
  41. package/common/bigInt.js +1 -1
  42. package/common/deps/dom.js +37 -5
  43. package/common/deps/repeat-click.js +3 -2
  44. package/common/deps/touch-emulator.js +95 -0
  45. package/common/deps/touch.js +12 -11
  46. package/common/deps/useEventListener.js +47 -0
  47. package/common/deps/useTouch.js +68 -0
  48. package/common/deps/vue-popper.js +3 -4
  49. package/common/index.js +1 -1
  50. package/common/runtime.js +1 -1
  51. package/common/string.js +20 -9
  52. package/date-picker/index.js +24 -4
  53. package/date-picker-mobile/index.js +5 -1
  54. package/file-upload/index.js +148 -50
  55. package/file-upload/vue.js +24 -6
  56. package/filter/index.js +2 -1
  57. package/filter/vue.js +1 -1
  58. package/form-item/index.js +24 -21
  59. package/form-item/vue.js +14 -12
  60. package/grid/plugins/export.js +0 -8
  61. package/grid/utils/common.js +13 -16
  62. package/image-viewer/index.js +1 -1
  63. package/ip-address/index.js +6 -3
  64. package/menu/index.js +127 -0
  65. package/menu/vue.js +90 -0
  66. package/menu-node/index.js +12 -0
  67. package/menu-node/vue.js +42 -0
  68. package/modal/index.js +6 -0
  69. package/modal/vue.js +3 -1
  70. package/numeric/index.js +18 -2
  71. package/numeric/vue.js +11 -7
  72. package/package.json +1 -1
  73. package/popconfirm/index.js +15 -6
  74. package/popconfirm/vue.js +5 -4
  75. package/pull-refresh-mobile-first/index.js +243 -0
  76. package/pull-refresh-mobile-first/vue.js +116 -0
  77. package/qr-code/index.js +54 -0
  78. package/qr-code/vue.js +31 -0
  79. package/radio/index.js +9 -7
  80. package/radio/vue.js +4 -4
  81. package/radio-button/index.js +2 -2
  82. package/radio-button/vue.js +2 -2
  83. package/radio-group/vue.js +1 -0
  84. package/rich-text-edtior/index.js +18 -38
  85. package/rich-text-edtior/vue.js +52 -63
  86. package/select/index.js +6 -6
  87. package/select/vue.js +1 -1
  88. package/slide-bar/index.js +6 -6
  89. package/slide-bar/vue.js +5 -5
  90. package/slider/index.js +47 -14
  91. package/slider/vue.js +25 -6
  92. package/slider-button/index.js +5 -1
  93. package/slider-button/vue.js +1 -0
  94. package/slider-button-group/index.js +15 -0
  95. package/slider-button-group/vue.js +8 -11
  96. package/standard-list-item/index.js +9 -3
  97. package/standard-list-item/vue.js +3 -2
  98. package/switch/index.js +11 -9
  99. package/switch/vue.js +1 -1
  100. package/tab-bar/index.js +1 -1
  101. package/tab-bar/vue.js +2 -1
  102. package/tab-nav/index.js +31 -31
  103. package/tab-nav/vue.js +13 -12
  104. package/tabs/vue.js +3 -1
  105. package/tabs-mf/index.js +14 -9
  106. package/tabs-mf/vue-bar.js +3 -2
  107. package/tabs-mf/vue-nav-item.js +2 -1
  108. package/tabs-mf/vue-nav.js +18 -2
  109. package/tabs-mf/vue.js +3 -1
  110. package/tag/index.js +1 -1
  111. package/toast/index.js +7 -0
  112. package/toast/vue.js +19 -0
  113. package/transfer/index.js +2 -2
  114. package/transfer/vue.js +1 -1
  115. package/tree-node/index.js +1 -1
  116. package/types/{action-menu.type.d.mts → action-menu.type.d.ts} +3 -3
  117. package/types/{alert.type.d.mts → alert.type.d.ts} +2 -1
  118. package/types/{anchor.type.d.mts → anchor.type.d.ts} +3 -3
  119. package/types/{badge.type.d.mts → badge.type.d.ts} +1 -1
  120. package/types/{breadcrumb-item.type.d.mts → breadcrumb-item.type.d.ts} +1 -1
  121. package/types/{breadcrumb.type.d.mts → breadcrumb.type.d.ts} +1 -1
  122. package/types/{button-group.type.d.mts → button-group.type.d.ts} +1 -1
  123. package/types/{button.type.d.mts → button.type.d.ts} +1 -1
  124. package/types/{cascader-menu.type.d.mts → cascader-menu.type.d.ts} +4 -4
  125. package/types/{cascader-node.type.d.mts → cascader-node.type.d.ts} +4 -4
  126. package/types/{cascader-panel.type.d.mts → cascader-panel.type.d.ts} +6 -6
  127. package/types/{checkbox.type.d.mts → checkbox.type.d.ts} +2 -1
  128. package/types/{collapse-item.type.d.mts → collapse-item.type.d.ts} +1 -1
  129. package/types/{collapse.type.d.mts → collapse.type.d.ts} +1 -1
  130. package/types/{color-picker.type.d.mts → color-picker.type.d.ts} +2 -2
  131. package/types/{color-select-panel.type.d.mts → color-select-panel.type.d.ts} +2 -2
  132. package/types/{date-picker.type.d.mts → date-picker.type.d.ts} +5 -1
  133. package/types/{dialog-box.type.d.mts → dialog-box.type.d.ts} +9 -9
  134. package/types/{dropdown-item.type-77f0c8c5.d.ts → dropdown-item.type-bf83e929.d.ts} +4 -4
  135. package/types/{dropdown-item.type.d.mts → dropdown-item.type.d.ts} +3 -3
  136. package/types/{dropdown-menu.type.d.mts → dropdown-menu.type.d.ts} +3 -3
  137. package/types/{dropdown.type.d.mts → dropdown.type.d.ts} +1 -1
  138. package/types/{file-upload.type.d.mts → file-upload.type.d.ts} +2 -2
  139. package/types/{floatbar.type.d.mts → floatbar.type.d.ts} +7 -7
  140. package/types/{form-item.type.d.mts → form-item.type.d.ts} +2 -2
  141. package/types/{form.type-1e2e9272.d.ts → form.type-d0fd42f3.d.ts} +20 -7
  142. package/types/{form.type.d.mts → form.type.d.ts} +2 -2
  143. package/types/{image.type.d.mts → image.type.d.ts} +1 -1
  144. package/types/{input.type.d.mts → input.type.d.ts} +10 -2
  145. package/types/{link.type.d.mts → link.type.d.ts} +1 -1
  146. package/types/{loading.type.d.mts → loading.type.d.ts} +1 -1
  147. package/types/{milestone.type.d.mts → milestone.type.d.ts} +1 -1
  148. package/types/{modal.type.d.mts → modal.type.d.ts} +18 -19
  149. package/types/{nav-menu.type.d.mts → nav-menu.type.d.ts} +1 -1
  150. package/types/{numeric.type.d.mts → numeric.type.d.ts} +9 -3
  151. package/types/{picker.type.d.mts → picker.type.d.ts} +5 -1
  152. package/types/{popeditor.type.d.mts → popeditor.type.d.ts} +1 -1
  153. package/types/{popover.type.d.mts → popover.type.d.ts} +1 -1
  154. package/types/{progress.type.d.mts → progress.type.d.ts} +1 -1
  155. package/types/{radio-button.type.d.mts → radio-button.type.d.ts} +3 -3
  156. package/types/{radio-group.type.d.mts → radio-group.type.d.ts} +5 -1
  157. package/types/{radio.type.d.mts → radio.type.d.ts} +2 -2
  158. package/types/{search.type.d.mts → search.type.d.ts} +1 -1
  159. package/types/{shared.type.d.mts → shared.type.d.ts} +7 -7
  160. package/types/{slider.type.d.mts → slider.type.d.ts} +1 -1
  161. package/types/{steps.type.d.mts → steps.type.d.ts} +6 -1
  162. package/types/{switch.type.d.mts → switch.type.d.ts} +5 -1
  163. package/types/{tab-bar.type.d.mts → tab-bar.type.d.ts} +3 -2
  164. package/types/{tab-item.type.d.mts → tab-item.type.d.ts} +2 -2
  165. package/types/{tab-nav.type.d.mts → tab-nav.type.d.ts} +13 -12
  166. package/types/{tabs.type.d.mts → tabs.type.d.ts} +6 -4
  167. package/types/{tag.type.d.mts → tag.type.d.ts} +1 -1
  168. package/types/{time-line.type-5f76ecc2.d.ts → time-line.type-d7daa669.d.ts} +1 -1
  169. package/types/{time-line.type.d.mts → time-line.type.d.ts} +2 -2
  170. package/types/{timeline-item.type.d.mts → timeline-item.type.d.ts} +2 -2
  171. package/types/toast.type.d.ts +63 -0
  172. package/types/{tooltip.type.d.mts → tooltip.type.d.ts} +2 -9
  173. package/types/{upload-dragger.type.d.mts → upload-dragger.type.d.ts} +2 -2
  174. package/types/{upload-list.type-b934f279.d.ts → upload-list.type-343e8c11.d.ts} +45 -7
  175. package/types/{upload-list.type.d.mts → upload-list.type.d.ts} +2 -2
  176. package/types/{upload.type.d.mts → upload.type.d.ts} +2 -2
  177. package/types/watermark.type.d.ts +33 -0
  178. package/types/{wizard.type.d.mts → wizard.type.d.ts} +1 -1
  179. package/upload/index.js +1 -1
  180. package/upload-list/index.js +3 -2
  181. package/upload-list/vue.js +12 -2
  182. package/watermark/index.js +202 -0
  183. package/watermark/vue.js +27 -0
  184. package/wizard/index.js +5 -5
  185. package/card-group/index.js +0 -16
  186. package/color-picker/alpha-select/index.js +0 -20
  187. package/color-picker/alpha-select/vue.js +0 -60
  188. package/color-picker/color-select/index.js +0 -69
  189. package/color-picker/color-select/vue.js +0 -57
  190. package/color-picker/utils/use-drag.js +0 -38
  191. /package/types/{action-sheet.type.d.mts → action-sheet.type.d.ts} +0 -0
  192. /package/types/{amount.type.d.mts → amount.type.d.ts} +0 -0
  193. /package/types/{area.type.d.mts → area.type.d.ts} +0 -0
  194. /package/types/{autocomplete.type.d.mts → autocomplete.type.d.ts} +0 -0
  195. /package/types/{autonavi-map.type.d.mts → autonavi-map.type.d.ts} +0 -0
  196. /package/types/{avatar.type.d.mts → avatar.type.d.ts} +0 -0
  197. /package/types/{baidu-map.type.d.mts → baidu-map.type.d.ts} +0 -0
  198. /package/types/{bulletin-board.type.d.mts → bulletin-board.type.d.ts} +0 -0
  199. /package/types/{calendar-bar.type.d.mts → calendar-bar.type.d.ts} +0 -0
  200. /package/types/{calendar.type.d.mts → calendar.type.d.ts} +0 -0
  201. /package/types/{card-group.type.d.mts → card-group.type.d.ts} +0 -0
  202. /package/types/{card-template.type.d.mts → card-template.type.d.ts} +0 -0
  203. /package/types/{card.type.d.mts → card.type.d.ts} +0 -0
  204. /package/types/{carousel-item.type.d.mts → carousel-item.type.d.ts} +0 -0
  205. /package/types/{carousel.type.d.mts → carousel.type.d.ts} +0 -0
  206. /package/types/{cascader-mobile.type.d.mts → cascader-mobile.type.d.ts} +0 -0
  207. /package/types/{cascader-select.type.d.mts → cascader-select.type.d.ts} +0 -0
  208. /package/types/{cascader.type.d.mts → cascader.type.d.ts} +0 -0
  209. /package/types/{cell.type.d.mts → cell.type.d.ts} +0 -0
  210. /package/types/{chart-bar.type.d.mts → chart-bar.type.d.ts} +0 -0
  211. /package/types/{chart-boxplot.type.d.mts → chart-boxplot.type.d.ts} +0 -0
  212. /package/types/{chart-candle.type.d.mts → chart-candle.type.d.ts} +0 -0
  213. /package/types/{chart-core.type.d.mts → chart-core.type.d.ts} +0 -0
  214. /package/types/{chart-funnel.type.d.mts → chart-funnel.type.d.ts} +0 -0
  215. /package/types/{chart-gauge.type.d.mts → chart-gauge.type.d.ts} +0 -0
  216. /package/types/{chart-graph.type.d.mts → chart-graph.type.d.ts} +0 -0
  217. /package/types/{chart-heatmap.type.d.mts → chart-heatmap.type.d.ts} +0 -0
  218. /package/types/{chart-line.type.d.mts → chart-line.type.d.ts} +0 -0
  219. /package/types/{chart-liquidfill.type.d.mts → chart-liquidfill.type.d.ts} +0 -0
  220. /package/types/{chart-map.type.d.mts → chart-map.type.d.ts} +0 -0
  221. /package/types/{chart-pie.type.d.mts → chart-pie.type.d.ts} +0 -0
  222. /package/types/{chart-radar.type.d.mts → chart-radar.type.d.ts} +0 -0
  223. /package/types/{chart-sankey.type.d.mts → chart-sankey.type.d.ts} +0 -0
  224. /package/types/{chart-scatter.type.d.mts → chart-scatter.type.d.ts} +0 -0
  225. /package/types/{chart-sunburst.type.d.mts → chart-sunburst.type.d.ts} +0 -0
  226. /package/types/{chart-tree.type.d.mts → chart-tree.type.d.ts} +0 -0
  227. /package/types/{chart-waterfall.type.d.mts → chart-waterfall.type.d.ts} +0 -0
  228. /package/types/{chart-wordcloud.type.d.mts → chart-wordcloud.type.d.ts} +0 -0
  229. /package/types/{checkbox-button.type.d.mts → checkbox-button.type.d.ts} +0 -0
  230. /package/types/{checkbox-group.type.d.mts → checkbox-group.type.d.ts} +0 -0
  231. /package/types/{col.type.d.mts → col.type.d.ts} +0 -0
  232. /package/types/{column-list-group.type.d.mts → column-list-group.type.d.ts} +0 -0
  233. /package/types/{column-list-item.type.d.mts → column-list-item.type.d.ts} +0 -0
  234. /package/types/{common.type.d.mts → common.type.d.ts} +0 -0
  235. /package/types/{company.type.d.mts → company.type.d.ts} +0 -0
  236. /package/types/{container.type.d.mts → container.type.d.ts} +0 -0
  237. /package/types/{country.type.d.mts → country.type.d.ts} +0 -0
  238. /package/types/{credit-card-form.type.d.mts → credit-card-form.type.d.ts} +0 -0
  239. /package/types/{credit-card.type.d.mts → credit-card.type.d.ts} +0 -0
  240. /package/types/{crop.type.d.mts → crop.type.d.ts} +0 -0
  241. /package/types/{currency.type.d.mts → currency.type.d.ts} +0 -0
  242. /package/types/{date-panel.type.d.mts → date-panel.type.d.ts} +0 -0
  243. /package/types/{date-picker-mobile.type.d.mts → date-picker-mobile.type.d.ts} +0 -0
  244. /package/types/{date-range.type.d.mts → date-range.type.d.ts} +0 -0
  245. /package/types/{date-table.type.d.mts → date-table.type.d.ts} +0 -0
  246. /package/types/{dept.type.d.mts → dept.type.d.ts} +0 -0
  247. /package/types/{detail-page.type.d.mts → detail-page.type.d.ts} +0 -0
  248. /package/types/{dialog-select.type.d.mts → dialog-select.type.d.ts} +0 -0
  249. /package/types/{drawer.type.d.mts → drawer.type.d.ts} +0 -0
  250. /package/types/{drop-roles.type.d.mts → drop-roles.type.d.ts} +0 -0
  251. /package/types/{drop-times.type.d.mts → drop-times.type.d.ts} +0 -0
  252. /package/types/{dynamic-scroller-item.type.d.mts → dynamic-scroller-item.type.d.ts} +0 -0
  253. /package/types/{dynamic-scroller.type.d.mts → dynamic-scroller.type.d.ts} +0 -0
  254. /package/types/{espace.type.d.mts → espace.type.d.ts} +0 -0
  255. /package/types/{exception.type.d.mts → exception.type.d.ts} +0 -0
  256. /package/types/{fall-menu.type.d.mts → fall-menu.type.d.ts} +0 -0
  257. /package/types/{filter-bar.type.d.mts → filter-bar.type.d.ts} +0 -0
  258. /package/types/{filter-box.type.d.mts → filter-box.type.d.ts} +0 -0
  259. /package/types/{filter-panel.type.d.mts → filter-panel.type.d.ts} +0 -0
  260. /package/types/{filter.type.d.mts → filter.type.d.ts} +0 -0
  261. /package/types/{floating-button.type.d.mts → floating-button.type.d.ts} +0 -0
  262. /package/types/{flowchart.type.d.mts → flowchart.type.d.ts} +0 -0
  263. /package/types/{fullscreen.type.d.mts → fullscreen.type.d.ts} +0 -0
  264. /package/types/{grid.type.d.mts → grid.type.d.ts} +0 -0
  265. /package/types/{guide.type.d.mts → guide.type.d.ts} +0 -0
  266. /package/types/{hrapprover.type.d.mts → hrapprover.type.d.ts} +0 -0
  267. /package/types/{image-viewer.type.d.mts → image-viewer.type.d.ts} +0 -0
  268. /package/types/{index-bar-anchor.type.d.mts → index-bar-anchor.type.d.ts} +0 -0
  269. /package/types/{index-bar.type.d.mts → index-bar.type.d.ts} +0 -0
  270. /package/types/{ip-address.type.d.mts → ip-address.type.d.ts} +0 -0
  271. /package/types/{layout.type.d.mts → layout.type.d.ts} +0 -0
  272. /package/types/{link-menu.type.d.mts → link-menu.type.d.ts} +0 -0
  273. /package/types/{list.type.d.mts → list.type.d.ts} +0 -0
  274. /package/types/{locales.type.d.mts → locales.type.d.ts} +0 -0
  275. /package/types/{logon-user.type.d.mts → logon-user.type.d.ts} +0 -0
  276. /package/types/{logout.type.d.mts → logout.type.d.ts} +0 -0
  277. /package/types/{mini-picker.type.d.mts → mini-picker.type.d.ts} +0 -0
  278. /package/types/{month-range.type.d.mts → month-range.type.d.ts} +0 -0
  279. /package/types/{month-table.type.d.mts → month-table.type.d.ts} +0 -0
  280. /package/types/{multi-select.type.d.mts → multi-select.type.d.ts} +0 -0
  281. /package/types/{notify.type.d.mts → notify.type.d.ts} +0 -0
  282. /package/types/{option-group.type.d.mts → option-group.type.d.ts} +0 -0
  283. /package/types/{option.type.d.mts → option.type.d.ts} +0 -0
  284. /package/types/{pager-item.type.d.mts → pager-item.type.d.ts} +0 -0
  285. /package/types/{pager.type.d.mts → pager.type.d.ts} +0 -0
  286. /package/types/{panel.type.d.mts → panel.type.d.ts} +0 -0
  287. /package/types/{picker-column.type.d.mts → picker-column.type.d.ts} +0 -0
  288. /package/types/{pop-upload.type.d.mts → pop-upload.type.d.ts} +0 -0
  289. /package/types/{popconfirm.type.d.mts → popconfirm.type.d.ts} +0 -0
  290. /package/types/{popup.type.d.mts → popup.type.d.ts} +0 -0
  291. /package/types/{pull-refresh.type.d.mts → pull-refresh.type.d.ts} +0 -0
  292. /package/types/{query-builder.type.d.mts → query-builder.type.d.ts} +0 -0
  293. /package/types/{rate.type.d.mts → rate.type.d.ts} +0 -0
  294. /package/types/{record.type.d.mts → record.type.d.ts} +0 -0
  295. /package/types/{recycle-scroller.type.d.mts → recycle-scroller.type.d.ts} +0 -0
  296. /package/types/{river.type.d.mts → river.type.d.ts} +0 -0
  297. /package/types/{roles.type.d.mts → roles.type.d.ts} +0 -0
  298. /package/types/{row.type.d.mts → row.type.d.ts} +0 -0
  299. /package/types/{scroll-text.type.d.mts → scroll-text.type.d.ts} +0 -0
  300. /package/types/{scrollbar.type.d.mts → scrollbar.type.d.ts} +0 -0
  301. /package/types/{select-dropdown.type.d.mts → select-dropdown.type.d.ts} +0 -0
  302. /package/types/{select-mobile.type.d.mts → select-mobile.type.d.ts} +0 -0
  303. /package/types/{select-view.type.d.mts → select-view.type.d.ts} +0 -0
  304. /package/types/{select.type.d.mts → select.type.d.ts} +0 -0
  305. /package/types/{selected-box.type.d.mts → selected-box.type.d.ts} +0 -0
  306. /package/types/{slide-bar.type.d.mts → slide-bar.type.d.ts} +0 -0
  307. /package/types/{slider-button-group.type.d.mts → slider-button-group.type.d.ts} +0 -0
  308. /package/types/{slider-button.type.d.mts → slider-button.type.d.ts} +0 -0
  309. /package/types/{split.type.d.mts → split.type.d.ts} +0 -0
  310. /package/types/{standard-list-item.type.d.mts → standard-list-item.type.d.ts} +0 -0
  311. /package/types/{tab-dropdown.type.d.mts → tab-dropdown.type.d.ts} +0 -0
  312. /package/types/{tab-item-mf.type.d.mts → tab-item-mf.type.d.ts} +0 -0
  313. /package/types/{tabbar-item.type.d.mts → tabbar-item.type.d.ts} +0 -0
  314. /package/types/{tabbar.type.d.mts → tabbar.type.d.ts} +0 -0
  315. /package/types/{table.type.d.mts → table.type.d.ts} +0 -0
  316. /package/types/{tabs-mf.type.d.mts → tabs-mf.type.d.ts} +0 -0
  317. /package/types/{tag-group.type.d.mts → tag-group.type.d.ts} +0 -0
  318. /package/types/{tall-storage.type.d.mts → tall-storage.type.d.ts} +0 -0
  319. /package/types/{text-popup.type.d.mts → text-popup.type.d.ts} +0 -0
  320. /package/types/{time-panel.type.d.mts → time-panel.type.d.ts} +0 -0
  321. /package/types/{time-picker-mobile.type.d.mts → time-picker-mobile.type.d.ts} +0 -0
  322. /package/types/{time-range.type.d.mts → time-range.type.d.ts} +0 -0
  323. /package/types/{time-spinner.type.d.mts → time-spinner.type.d.ts} +0 -0
  324. /package/types/{time.type.d.mts → time.type.d.ts} +0 -0
  325. /package/types/{toggle-menu.type.d.mts → toggle-menu.type.d.ts} +0 -0
  326. /package/types/{top-box.type.d.mts → top-box.type.d.ts} +0 -0
  327. /package/types/{transfer-panel.type.d.mts → transfer-panel.type.d.ts} +0 -0
  328. /package/types/{transfer.type.d.mts → transfer.type.d.ts} +0 -0
  329. /package/types/{tree-menu.type.d.mts → tree-menu.type.d.ts} +0 -0
  330. /package/types/{tree-node.type.d.mts → tree-node.type.d.ts} +0 -0
  331. /package/types/{tree.type.d.mts → tree.type.d.ts} +0 -0
  332. /package/types/{user-account.type.d.mts → user-account.type.d.ts} +0 -0
  333. /package/types/{user-contact.type.d.mts → user-contact.type.d.ts} +0 -0
  334. /package/types/{user-head-group.type.d.mts → user-head-group.type.d.ts} +0 -0
  335. /package/types/{user-head.type.d.mts → user-head.type.d.ts} +0 -0
  336. /package/types/{user-link.type.d.mts → user-link.type.d.ts} +0 -0
  337. /package/types/{user.type.d.mts → user.type.d.ts} +0 -0
  338. /package/types/{wheel.type.d.mts → wheel.type.d.ts} +0 -0
  339. /package/types/{year-range.type.d.mts → year-range.type.d.ts} +0 -0
  340. /package/types/{year-table.type.d.mts → year-table.type.d.ts} +0 -0
@@ -1,11 +1,9 @@
1
1
  import "../../chunk-G2ADBYYC.js";
2
- import Color from "../utils/color";
3
2
  import { draggable } from "../utils/use-drag";
4
3
  import { onDrag, updateThumb } from ".";
5
4
  const api = ["state", "color", "slider", "alphaWrapper", "alphaThumb"];
6
5
  const renderless = (props, context, { emit }) => {
7
- const hex = props.color;
8
- const color = new Color(hex, props.alpha);
6
+ const color = props.color;
9
7
  const [rr, gg, bb] = color.getRGB();
10
8
  const r = context.ref(rr);
11
9
  const g = context.ref(gg);
@@ -16,14 +14,14 @@ const renderless = (props, context, { emit }) => {
16
14
  const alpha = context.ref(color.get("a"));
17
15
  context.watch(
18
16
  () => props.color,
19
- (hex2) => {
20
- color.reset(hex2);
17
+ () => {
21
18
  const [rr2, gg2, bb2] = color.getRGB();
22
19
  r.value = rr2;
23
20
  g.value = gg2;
24
21
  b.value = bb2;
25
22
  alpha.value = color.get("a");
26
- }
23
+ },
24
+ { deep: true }
27
25
  );
28
26
  context.watch(alpha, (newAlpha) => {
29
27
  updateThumb(newAlpha, alphaThumb.value, alphaWrapper.value);
@@ -33,8 +31,7 @@ const renderless = (props, context, { emit }) => {
33
31
  return `linear-gradient(to right, rgba(${r.value}, ${g.value}, ${b.value}, 0) 0%, rgba(${r.value}, ${g.value}, ${b.value}, 1) 100%)`;
34
32
  });
35
33
  const state = context.reactive({
36
- background,
37
- hex
34
+ background
38
35
  });
39
36
  const api2 = {
40
37
  state,
@@ -35,11 +35,13 @@ const updateCursor = (wrapper, cursor, emit) => {
35
35
  const { x, y } = updatePosition(event, rect, cursor);
36
36
  color.set({
37
37
  s: calcSaturation(x, rect.width) * 100,
38
- v: calcBrightness(y, rect.height)
38
+ v: calcBrightness(y, rect.height),
39
+ h: color.get("h")
39
40
  });
40
41
  emit("sv-update", {
41
42
  s: color.get("s"),
42
- v: color.get("v")
43
+ v: color.get("v"),
44
+ h: color.get("h")
43
45
  });
44
46
  };
45
47
  };
@@ -1,29 +1,30 @@
1
1
  import "../../chunk-G2ADBYYC.js";
2
2
  import { draggable } from "../utils/use-drag";
3
- import Color from "../utils/color";
4
3
  import { getThumbTop, resetCursor, updateThumb, updateCursor } from "./index";
5
4
  const api = ["state", "cursor", "wrapper", "bar", "thumb"];
6
- const renderless = (props, context, { emit }) => {
5
+ const renderless = (props, context, { emit, expose }) => {
7
6
  const cursor = context.ref();
8
7
  const wrapper = context.ref();
9
8
  const thumb = context.ref();
10
9
  const bar = context.ref();
11
- const color = new Color(props.color);
10
+ const color = props.color;
12
11
  const h = context.ref(color.get("h"));
13
- const background = context.computed(() => {
14
- return `hsl(${h.value}deg, 100%, 50%)`;
15
- });
12
+ const background = `hsl(${h.value}deg, 100%, 50%)`;
16
13
  const state = context.reactive({
17
14
  background
18
15
  });
19
16
  const api2 = { state, cursor, wrapper, bar, thumb };
20
17
  context.watch(
21
- () => props.color,
22
- (newColor) => {
23
- color.reset(newColor);
18
+ () => props,
19
+ () => {
20
+ h.value = color.get("h");
24
21
  resetCursor(color.get("s"), color.get("v"), wrapper, cursor, thumb, color, h);
25
- }
22
+ },
23
+ { deep: true }
26
24
  );
25
+ context.watch(h, (newHue) => {
26
+ state.background = `hsl(${newHue}deg, 100%, 50%)`;
27
+ });
27
28
  context.onMounted(() => {
28
29
  const update = {
29
30
  thumb: updateThumb(bar, thumb, h, emit),
@@ -1,8 +1,12 @@
1
- import "../chunk-G2ADBYYC.js";
2
- const onConfirm = (hex, triggerBg, res, emit, stack, enableHistory) => {
1
+ import {
2
+ __spreadProps,
3
+ __spreadValues
4
+ } from "../chunk-G2ADBYYC.js";
5
+ import Color from "./utils/color";
6
+ const onConfirm = (hex, pre, res, emit, stack, enableHistory, color) => {
3
7
  return () => {
8
+ pre.value = hex.value;
4
9
  hex.value = res.value;
5
- triggerBg.value = res.value;
6
10
  if (enableHistory) {
7
11
  const itemIdx = Math.max(
8
12
  stack.value.indexOf(res.value),
@@ -14,32 +18,36 @@ const onConfirm = (hex, triggerBg, res, emit, stack, enableHistory) => {
14
18
  }
15
19
  stack.value.unshift(res.value);
16
20
  }
21
+ color.value.setPrevH(color.value.get("h"));
17
22
  emit("confirm", res.value);
18
23
  };
19
24
  };
20
- const onCancel = (res, triggerBg, emit, isShow, hex, color) => {
25
+ const onCancel = (res, pre, emit, isShow, hex, color) => {
21
26
  return () => {
22
27
  if (isShow.value) {
23
- res.value = triggerBg.value;
24
- hex.value = triggerBg.value;
25
- color.reset(hex.value);
26
- emit("cancel");
28
+ res.value = pre.value;
29
+ hex.value = pre.value;
30
+ const tmpColor = new Color(pre.value);
31
+ color.value.set(__spreadProps(__spreadValues({}, tmpColor.getHSV()), {
32
+ h: color.value.get("preH")
33
+ }));
34
+ emit("cancel", color);
27
35
  }
28
36
  };
29
37
  };
30
38
  const onColorUpdate = (color, res) => {
31
- res.value = color.getHex();
39
+ res.value = color.value.getHex();
32
40
  };
33
41
  const onHSVUpdate = (color, res, hex, emit) => {
34
42
  return {
35
43
  onHueUpdate: (hue) => {
36
- color.set({ h: hue });
44
+ color.value.set({ h: hue });
37
45
  onColorUpdate(color, res);
38
- hex.value = color.getHex();
46
+ hex.value = color.value.getHex();
39
47
  emit("hue-update", hue);
40
48
  },
41
49
  onSVUpdate: ({ s, v }) => {
42
- color.set({ s, v });
50
+ hex.value = color.value.getHex();
43
51
  onColorUpdate(color, res);
44
52
  emit("sv-update", { s, v });
45
53
  }
@@ -48,23 +56,27 @@ const onHSVUpdate = (color, res, hex, emit) => {
48
56
  const onAlphaUpdate = (color, res) => {
49
57
  return {
50
58
  update: (alpha) => {
51
- color.set({ a: alpha });
59
+ color.value.set({ a: alpha });
52
60
  onColorUpdate(color, res);
53
61
  }
54
62
  };
55
63
  };
56
- const handleHistoryClick = (hex, res, color) => {
64
+ const handleHistoryClick = (hex, res, color, emit) => {
57
65
  return (history) => {
58
66
  hex.value = history;
59
67
  res.value = history;
60
- color.reset(history);
68
+ const tmpColor = new Color(history);
69
+ color.value.set(__spreadValues({}, tmpColor.getHSV()));
70
+ emit("color-update", color);
61
71
  };
62
72
  };
63
- const handlePredefineClick = (hex, res, color) => {
73
+ const handlePredefineClick = (hex, res, color, emit) => {
64
74
  return (selectedColor) => {
65
75
  hex.value = selectedColor;
66
76
  res.value = selectedColor;
67
- color.reset(selectedColor);
77
+ const tmpColor = new Color(selectedColor);
78
+ color.value.set(__spreadValues({}, tmpColor.getHSV()));
79
+ emit("color-update", color);
68
80
  };
69
81
  };
70
82
  export {
@@ -33,6 +33,7 @@ class Color {
33
33
  this.s = 0;
34
34
  this.v = 0;
35
35
  this.a = 100;
36
+ this.preH = 0;
36
37
  this.enableAlpha = false;
37
38
  this.reset(value);
38
39
  this.enableAlpha = alpha;
@@ -48,6 +49,7 @@ class Color {
48
49
  this.hex = normalizeHexColor(hex);
49
50
  const { r, g, b, a } = hexToRgb(this.hex);
50
51
  const { h, s, v } = rgb([r, g, b, a]).hsv().object();
52
+ this.preH = h;
51
53
  this.h = h;
52
54
  this.s = s;
53
55
  this.v = v;
@@ -59,6 +61,9 @@ class Color {
59
61
  this.v = v != null ? v : this.v;
60
62
  this.a = a != null ? a : this.a;
61
63
  }
64
+ setPrevH(val) {
65
+ this.preH = val;
66
+ }
62
67
  /**
63
68
  *
64
69
  * @returns [R,G,B]
@@ -19,6 +19,7 @@ const renderless = (props, context, { emit }) => {
19
19
  const { modelValue, visible, history, predefine } = context.toRefs(props);
20
20
  const hex = context.ref((_a = modelValue == null ? void 0 : modelValue.value) != null ? _a : "transparent");
21
21
  const res = context.ref((_b = modelValue == null ? void 0 : modelValue.value) != null ? _b : "transparent");
22
+ const pre = context.ref(res.value);
22
23
  const triggerBg = context.ref((_c = modelValue == null ? void 0 : modelValue.value) != null ? _c : "transparent");
23
24
  const isShow = context.ref((_d = visible == null ? void 0 : visible.value) != null ? _d : false);
24
25
  const cursor = context.ref();
@@ -29,7 +30,7 @@ const renderless = (props, context, { emit }) => {
29
30
  const changeVisible = (state2) => {
30
31
  isShow.value = state2;
31
32
  };
32
- const color = new Color(hex.value, props.alpha);
33
+ const color = context.ref(new Color(hex.value, props.alpha));
33
34
  const state = context.reactive({
34
35
  isShow,
35
36
  hex,
@@ -56,11 +57,19 @@ const renderless = (props, context, { emit }) => {
56
57
  },
57
58
  { deep: true }
58
59
  );
60
+ context.watch(
61
+ state,
62
+ () => {
63
+ state.color = state.color;
64
+ },
65
+ { deep: true }
66
+ );
59
67
  context.watch(modelValue, (newValue) => {
68
+ pre.value = res.value;
60
69
  hex.value = newValue;
61
70
  res.value = newValue;
62
- triggerBg.value = newValue;
63
- color.reset(hex.value);
71
+ color.value.reset(newValue);
72
+ state.color.reset(newValue);
64
73
  });
65
74
  context.watch(visible, (visible2) => {
66
75
  isShow.value = visible2;
@@ -72,11 +81,11 @@ const renderless = (props, context, { emit }) => {
72
81
  changeVisible,
73
82
  onHueUpdate,
74
83
  onSVUpdate,
75
- onConfirm: onConfirm(hex, triggerBg, res, emit, stack, enableHistory),
76
- onCancel: onCancel(res, triggerBg, emit, isShow, hex, color),
84
+ onConfirm: onConfirm(hex, pre, res, emit, stack, enableHistory, color),
85
+ onCancel: onCancel(res, pre, emit, isShow, hex, color),
77
86
  onAlphaUpdate: update,
78
- onHistoryClick: handleHistoryClick(hex, res, color),
79
- onPredefineColorClick: handlePredefineClick(hex, res, color),
87
+ onHistoryClick: handleHistoryClick(hex, res, color, emit),
88
+ onPredefineColorClick: handlePredefineClick(hex, res, color, emit),
80
89
  cursor
81
90
  };
82
91
  return api2;
@@ -1,9 +1,9 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
2
  import { isNull } from "../common/type";
3
- const handelIconClick = ({ emit }) => (item, index) => {
3
+ const handelIconClick = ({ emit }) => (item, index, event) => {
4
4
  if (item.disabled)
5
5
  return;
6
- emit("icon-click", item, index);
6
+ emit("icon-click", item, index, event);
7
7
  };
8
8
  const handleChange = ({ constants, dispatch, emit, state, nextTick }) => () => {
9
9
  nextTick(() => {
@@ -24,23 +24,37 @@ const getIsGroup = ({ constants, parent: $parent, state }) => () => {
24
24
  return false;
25
25
  };
26
26
  const getSize = ({ props, state }) => () => state.isGroup ? state.columnGroup.size || props.size : props.size;
27
- const isDisabled = ({ props, state }) => () => props.checkboxDisabled || state.columnGroup.disabled;
27
+ const isDisabled = ({ props, state }) => () => props.disabled || state.columnGroup.disabled;
28
28
  const getModel = ({ props, state }) => () => {
29
29
  const model = state.isGroup ? state.store : props.modelValue !== void 0 ? props.modelValue : state.selfModel;
30
- return isNull(model) ? [] : model;
30
+ if (state.showCheckbox) {
31
+ return isNull(model) ? [] : model;
32
+ } else {
33
+ return state.store;
34
+ }
31
35
  };
32
36
  const setModel = ({ constants, dispatch, emit, state }) => (val) => {
33
37
  if (state.isGroup) {
34
38
  dispatch(constants.COLUMN_GROUP, "update:modelValue", [val]);
35
39
  } else {
36
40
  emit("update:modelValue", val);
37
- state.selfModel = val;
41
+ state.showCheckbox && (state.selfModel = val);
38
42
  }
39
43
  };
40
44
  const computedStore = ({ state, props }) => () => state.isGroup ? state.columnGroup.modelValue : props.modelValue;
45
+ const getItemChecked = ({ props, state }) => () => {
46
+ if (!state.showCheckbox || !state.showRadio)
47
+ return;
48
+ if (state.showCheckbox) {
49
+ return state.isGroup || Array.isArray(state.model) ? ~state.model.indexOf(props.label) : state.model;
50
+ } else {
51
+ return state.model === props.label;
52
+ }
53
+ };
41
54
  export {
42
55
  computedStore,
43
56
  getIsGroup,
57
+ getItemChecked,
44
58
  getModel,
45
59
  getSize,
46
60
  handelIconClick,
@@ -1,28 +1,30 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
2
  import {
3
+ getModel,
4
+ setModel,
3
5
  handelIconClick,
6
+ computedStore,
7
+ getItemChecked,
4
8
  handleChange,
5
9
  getIsGroup,
6
10
  getSize,
7
- isDisabled,
8
- getModel,
9
- setModel,
10
- computedStore
11
+ isDisabled
11
12
  } from "./index";
12
- const api = ["state", "handelIconClick"];
13
- const renderless = (props, { reactive, watch, computed }, { vm, parent, emit, constants, nextTick, dispatch }) => {
13
+ const api = ["state", "handelIconClick", "handleChange"];
14
+ const renderless = (props, { reactive, computed }, { vm, parent, emit, nextTick, dispatch, constants }) => {
14
15
  const api2 = {};
15
16
  const state = reactive({
16
17
  columnGroup: {},
17
- itemChecked: props.modelValue,
18
+ size: computed(() => api2.getSize()),
19
+ disabled: computed(() => api2.isDisabled()),
20
+ itemChecked: computed(() => api2.getItemChecked()),
18
21
  sliceNum: computed(() => props.size === "small" ? 1 : 2),
19
22
  iconNum: computed(() => props.size === "small" ? 2 : 3),
20
23
  effectOptions: computed(() => props.options.filter((item) => !item.hidden)),
21
24
  showCheckbox: computed(() => props.showCheckbox || state.columnGroup.showCheckbox),
25
+ showRadio: computed(() => props.showRadio || state.columnGroup.showRadio),
22
26
  store: computed(() => api2.computedStore()),
23
- getIsGroup: computed(() => api2.getIsGroup()),
24
- size: computed(() => api2.getSize()),
25
- disabled: computed(() => api2.isDisabled()),
27
+ isGroup: computed(() => api2.getIsGroup()),
26
28
  model: computed({
27
29
  get: () => api2.getModel(),
28
30
  set: (val) => api2.setModel(val)
@@ -30,16 +32,16 @@ const renderless = (props, { reactive, watch, computed }, { vm, parent, emit, co
30
32
  });
31
33
  Object.assign(api2, {
32
34
  state,
33
- getSize: getSize({ props, state }),
34
- getModel: getModel({ props, state }),
35
35
  getIsGroup: getIsGroup({ constants, parent, state }),
36
36
  isDisabled: isDisabled({ props, state }),
37
37
  setModel: setModel({ constants, dispatch, emit, props, vm, state }),
38
+ getSize: getSize({ props, state }),
39
+ getModel: getModel({ props, state }),
38
40
  handleChange: handleChange({ constants, dispatch, emit, state, nextTick }),
39
41
  computedStore: computedStore({ state, props }),
40
- handelIconClick: handelIconClick({ emit })
42
+ handelIconClick: handelIconClick({ emit }),
43
+ getItemChecked: getItemChecked({ state, props })
41
44
  });
42
- watch(() => state.model, api2.handleChange, { deep: true });
43
45
  return api2;
44
46
  };
45
47
  export {
package/common/bigInt.js CHANGED
@@ -125,7 +125,7 @@ class BigIntDecimal {
125
125
  const trimRet = trimNumber(mergedValue);
126
126
  this.negative = trimRet.negative;
127
127
  const numbers = trimRet.trimStr.split(".");
128
- this.integer = numbers[0].indexOf("e") === -1 ? BigInt(numbers[0]) : numbers[0];
128
+ this.integer = !numbers[0].includes("e") ? BigInt(numbers[0]) : numbers[0];
129
129
  const decimalStr = numbers[1] || "0";
130
130
  this.decimal = convertBigInt(decimalStr);
131
131
  this.decimalLen = decimalStr.length;
@@ -5,15 +5,15 @@ const isServer = typeof window === "undefined";
5
5
  const SPECIAL_CHARS_REGEXP = /([:\-_]+(.))/g;
6
6
  const MOZ_HACK_REGEXP = /^moz([A-Z])/;
7
7
  const camelCase = (name) => name.replace(SPECIAL_CHARS_REGEXP, (_, separator, letter, offset) => offset ? letter.toUpperCase() : letter).replace(MOZ_HACK_REGEXP, "Moz$1");
8
- const on = (el, event, handler) => {
8
+ const on = (el, event, handler, options = false) => {
9
9
  if (el && event && handler) {
10
- el.addEventListener(event, handler, false);
10
+ el.addEventListener(event, handler, options);
11
11
  }
12
12
  };
13
- const off = (el, event, handler) => {
13
+ const off = (el, event, handler, options = false) => {
14
14
  window.document;
15
15
  if (el && event) {
16
- el.removeEventListener(event, handler, false);
16
+ el.removeEventListener(event, handler, options);
17
17
  }
18
18
  };
19
19
  const once = (el, event, fn) => {
@@ -145,18 +145,50 @@ const getDomNode = () => {
145
145
  visibleWidth: documentElement.clientWidth || bodyElem.clientWidth
146
146
  };
147
147
  };
148
+ const getScrollTop = (el) => {
149
+ const top = "scrollTop" in el ? el.scrollTop : el.pageYOffset;
150
+ return Math.max(top, 0);
151
+ };
152
+ const stopPropagation = (event) => event.stopPropagation();
153
+ const preventDefault = (event, isStopPropagation) => {
154
+ if (typeof event.cancelable !== "boolean" || event.cancelable) {
155
+ event.preventDefault();
156
+ }
157
+ if (isStopPropagation) {
158
+ stopPropagation(event);
159
+ }
160
+ };
161
+ const overflowScrollReg = /scroll|auto|overlay/i;
162
+ const defaultRoot = isServer ? void 0 : window;
163
+ const isElement = (node) => node.tagName !== "HTML" && node.tagName !== "BODY" && node.nodeType === 1;
164
+ const getScrollParent = (el, root = defaultRoot) => {
165
+ let node = el;
166
+ while (node && node !== root && isElement(node)) {
167
+ const { overflowY } = window.getComputedStyle(node);
168
+ if (overflowScrollReg.test(overflowY)) {
169
+ return node;
170
+ }
171
+ node = node.parentNode;
172
+ }
173
+ return root;
174
+ };
148
175
  export {
149
176
  addClass,
150
177
  getDomNode,
151
178
  getScrollContainer,
179
+ getScrollParent,
180
+ getScrollTop,
152
181
  getStyle,
153
182
  hasClass,
154
183
  isInContainer,
155
184
  isScroll,
185
+ isServer,
156
186
  isVNode,
157
187
  off,
158
188
  on,
159
189
  once,
190
+ preventDefault,
160
191
  removeClass,
161
- setStyle
192
+ setStyle,
193
+ stopPropagation
162
194
  };
@@ -1,13 +1,14 @@
1
1
  import "../../chunk-G2ADBYYC.js";
2
2
  import { on, once } from "./dom";
3
3
  var repeat_click_default = (el, binding) => {
4
+ const LONG_PRESS_INTERVAL = 200;
4
5
  let interval = null;
5
6
  let startTime;
6
7
  const handler = () => {
7
8
  typeof binding.value === "function" && binding.value.apply();
8
9
  };
9
10
  const clear = () => {
10
- if (Date.now() - startTime < 100) {
11
+ if (Date.now() - startTime < LONG_PRESS_INTERVAL) {
11
12
  handler();
12
13
  }
13
14
  clearInterval(interval);
@@ -20,7 +21,7 @@ var repeat_click_default = (el, binding) => {
20
21
  startTime = Date.now();
21
22
  once(document, "mouseup", clear);
22
23
  clearInterval(interval);
23
- interval = setInterval(handler, 100);
24
+ interval = setInterval(handler, LONG_PRESS_INTERVAL);
24
25
  });
25
26
  };
26
27
  export {
@@ -0,0 +1,95 @@
1
+ import "../../chunk-G2ADBYYC.js";
2
+ let emulated = false;
3
+ let initiated = false;
4
+ let eventTarget = null;
5
+ let mouseTarget = null;
6
+ const matches = Element.prototype.matches || Element.prototype.webkitMatchesSelector;
7
+ const closest = (el, s) => {
8
+ do {
9
+ if (matches.call(el, s))
10
+ return el;
11
+ el = el.parentElement || el.parentNode;
12
+ } while (el !== null && el.nodeType === 1);
13
+ return null;
14
+ };
15
+ class Touch {
16
+ constructor(target, identifier, pos, deltaX, deltaY) {
17
+ this.target = target;
18
+ this.identifier = identifier;
19
+ deltaX = deltaX || 0;
20
+ deltaY = deltaY || 0;
21
+ this.pageX = pos.pageX + deltaX;
22
+ this.pageY = pos.pageY + deltaY;
23
+ this.screenX = pos.screenX + deltaX;
24
+ this.screenY = pos.screenY + deltaY;
25
+ this.clientX = pos.clientX + deltaX;
26
+ this.clientY = pos.clientY + deltaY;
27
+ }
28
+ }
29
+ const TouchList = () => {
30
+ const touchList = [];
31
+ touchList.item = (index) => touchList[index] || null;
32
+ touchList.identifiedTouch = (id) => touchList[id + 1] || null;
33
+ return touchList;
34
+ };
35
+ const createTouchList = (mouseEv) => {
36
+ const touchList = TouchList();
37
+ touchList.push(new Touch(eventTarget, 1, mouseEv, 0, 0));
38
+ return touchList;
39
+ };
40
+ const getActiveTouches = (mouseEv) => {
41
+ if (mouseEv.type === "mouseup") {
42
+ return TouchList();
43
+ }
44
+ return createTouchList(mouseEv);
45
+ };
46
+ const triggerTouch = (eventName, mouseEv) => {
47
+ const touchEvent = document.createEvent("Event");
48
+ touchEvent.initEvent(eventName, true, true);
49
+ touchEvent.altKey = mouseEv.altKey;
50
+ touchEvent.metaKey = mouseEv.metaKey;
51
+ touchEvent.ctrlKey = mouseEv.ctrlKey;
52
+ touchEvent.shiftKey = mouseEv.shiftKey;
53
+ touchEvent.changedTouches = createTouchList(mouseEv);
54
+ touchEvent.targetTouches = getActiveTouches(mouseEv);
55
+ touchEvent.touches = getActiveTouches(mouseEv);
56
+ touchEvent.isTinySimulate = true;
57
+ eventTarget.dispatchEvent(touchEvent);
58
+ };
59
+ const onMouse = (touchType) => (ev) => {
60
+ if (ev.type === "mousedown") {
61
+ initiated = true;
62
+ }
63
+ if (ev.type === "mouseup") {
64
+ initiated = false;
65
+ }
66
+ if (ev.type === "mousemove" && !initiated) {
67
+ return;
68
+ }
69
+ if (ev.type === "mousedown" || !mouseTarget) {
70
+ mouseTarget = ev.target;
71
+ }
72
+ if ((eventTarget = closest(mouseTarget, "[data-tiny-touch-simulate-container]")) && eventTarget.dispatchEvent) {
73
+ triggerTouch(touchType, ev);
74
+ }
75
+ if (ev.type === "mouseup") {
76
+ eventTarget = null;
77
+ mouseTarget = null;
78
+ }
79
+ };
80
+ const touchEmulator = () => {
81
+ window.addEventListener("mousedown", onMouse("touchstart"), true);
82
+ window.addEventListener("mousemove", onMouse("touchmove"), true);
83
+ window.addEventListener("mouseup", onMouse("touchend"), true);
84
+ };
85
+ const emulate = () => {
86
+ const supportTouch = "ontouchstart" in window;
87
+ if (!emulated && !supportTouch) {
88
+ emulated = true;
89
+ touchEmulator();
90
+ }
91
+ };
92
+ var touch_emulator_default = emulate;
93
+ export {
94
+ touch_emulator_default as default
95
+ };
@@ -1,19 +1,13 @@
1
1
  import "../../chunk-G2ADBYYC.js";
2
2
  const MIN_DISTANCE = 10;
3
- function getDirection(w, h) {
4
- if (h > w && h > MIN_DISTANCE) {
5
- return "vertical";
6
- } else if (w > h && w > MIN_DISTANCE) {
3
+ const getDirection = (x, y) => {
4
+ if (x > y && x > MIN_DISTANCE) {
7
5
  return "horizontal";
8
6
  }
7
+ if (y > x && y > MIN_DISTANCE) {
8
+ return "vertical";
9
+ }
9
10
  return "";
10
- }
11
- const resetTouchStatus = (state) => {
12
- state.direction = "";
13
- state.deltaX = 0;
14
- state.deltaY = 0;
15
- state.offsetX = 0;
16
- state.offsetY = 0;
17
11
  };
18
12
  const touchStart = (state) => (event) => {
19
13
  resetTouchStatus(state);
@@ -28,6 +22,13 @@ const touchMove = (state) => (event) => {
28
22
  state.offsetY = Math.abs(state.deltaY);
29
23
  state.direction = state.direction || getDirection(state.offsetX, state.offsetY);
30
24
  };
25
+ const resetTouchStatus = (state) => {
26
+ state.direction = "";
27
+ state.deltaX = 0;
28
+ state.deltaY = 0;
29
+ state.offsetX = 0;
30
+ state.offsetY = 0;
31
+ };
31
32
  export {
32
33
  getDirection,
33
34
  resetTouchStatus,
@@ -0,0 +1,47 @@
1
+ import "../../chunk-G2ADBYYC.js";
2
+ import { on, off, isServer } from "./dom";
3
+ const onMountedOrActivated = ({ onMounted, onActivated, nextTick }) => (hook) => {
4
+ let mounted;
5
+ onMounted(() => (hook(), nextTick(() => mounted = true)));
6
+ onActivated(() => mounted && hook());
7
+ };
8
+ const useEventListener = ({ unref, isRef, watch, nextTick, onMounted, onUnmounted, onActivated, onDeactivated }) => (type, listener, options = {}) => {
9
+ if (isServer)
10
+ return;
11
+ const { target = window, passive = false, capture = false } = options;
12
+ let cleaned = false;
13
+ let attached;
14
+ const add = (target2) => {
15
+ if (cleaned)
16
+ return;
17
+ const element = unref(target2);
18
+ if (element && !attached) {
19
+ on(element, type, listener, { capture, passive });
20
+ attached = true;
21
+ }
22
+ };
23
+ const remove = (target2) => {
24
+ if (cleaned)
25
+ return;
26
+ const element = unref(target2);
27
+ if (element && attached) {
28
+ off(element, type, listener, { capture, passive });
29
+ attached = false;
30
+ }
31
+ };
32
+ onUnmounted(() => remove(target));
33
+ onDeactivated(() => remove(target));
34
+ onMountedOrActivated({ onMounted, onActivated, nextTick })(() => add(target));
35
+ let stopWatch;
36
+ if (isRef(target)) {
37
+ stopWatch = watch(target, (val, oldVal) => (remove(oldVal), add(val)));
38
+ }
39
+ return () => {
40
+ stopWatch && stopWatch();
41
+ remove(target);
42
+ cleaned = true;
43
+ };
44
+ };
45
+ export {
46
+ useEventListener
47
+ };