@wlydfe/pro-ui 0.2.3 → 0.2.5

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 (547) hide show
  1. package/es/component.mjs +22 -22
  2. package/es/components/breadcrumb/src/index.vue.d.ts +1 -1
  3. package/es/{packages/components → components}/breadcrumb/src/index.vue.mjs +1 -1
  4. package/es/components/check-card/src/index.vue.d.ts +1 -1
  5. package/es/{packages/components → components}/check-card/src/index.vue.mjs +1 -1
  6. package/es/components/check-card-group/src/index.vue.d.ts +1 -1
  7. package/es/{packages/components → components}/check-card-group/src/index.vue.mjs +1 -1
  8. package/es/components/check-card-group/style/css.d.ts +1 -1
  9. package/es/components/check-card-group/style/index.d.ts +1 -1
  10. package/es/components/date-picker/index.d.ts +25 -25
  11. package/es/components/date-picker/src/index.vue.d.ts +26 -26
  12. package/es/{packages/components → components}/date-picker/src/index.vue.mjs +1 -1
  13. package/es/components/descriptions/index.d.ts +118 -118
  14. package/es/components/descriptions/src/index.vue.d.ts +131 -131
  15. package/es/{packages/components → components}/descriptions/src/index.vue.mjs +1 -1
  16. package/es/components/descriptions/style/css.d.ts +1 -1
  17. package/es/components/descriptions/style/index.d.ts +1 -1
  18. package/es/components/dialog/index.d.ts +2 -2
  19. package/es/components/dialog/src/index.vue.d.ts +3 -3
  20. package/es/{packages/components → components}/dialog/src/index.vue.mjs +1 -1
  21. package/es/components/dialog-form/index.d.ts +102 -102
  22. package/es/components/dialog-form/src/index.vue.d.ts +116 -116
  23. package/es/{packages/components → components}/dialog-form/src/index.vue.mjs +1 -1
  24. package/es/components/dialog-form/style/css.d.ts +2 -2
  25. package/es/components/dialog-form/style/index.d.ts +2 -2
  26. package/es/components/display-item/index.d.ts +111 -111
  27. package/es/components/display-item/src/index.vue.d.ts +120 -120
  28. package/es/{packages/components → components}/display-item/src/index.vue.mjs +1 -1
  29. package/es/components/display-item/style/css.d.ts +1 -1
  30. package/es/components/display-item/style/index.d.ts +1 -1
  31. package/es/components/drawer-form/index.d.ts +110 -110
  32. package/es/components/drawer-form/src/index.vue.d.ts +122 -122
  33. package/es/{packages/components → components}/drawer-form/src/index.vue.mjs +1 -1
  34. package/es/components/drawer-form/style/css.d.ts +1 -1
  35. package/es/components/drawer-form/style/index.d.ts +1 -1
  36. package/es/components/form/index.d.ts +98 -98
  37. package/es/components/form/src/form-content.vue.d.ts +76 -76
  38. package/es/{packages/components → components}/form/src/form-content.vue.mjs +1 -1
  39. package/es/components/form/src/index.vue.d.ts +108 -108
  40. package/es/{packages/components → components}/form/src/index.vue.mjs +1 -1
  41. package/es/components/form/style/css.d.ts +1 -1
  42. package/es/components/form/style/index.d.ts +1 -1
  43. package/es/components/form-item/index.d.ts +65 -65
  44. package/es/components/form-item/src/index.vue.d.ts +72 -72
  45. package/es/{packages/components → components}/form-item/src/index.vue.mjs +1 -1
  46. package/es/components/form-item/style/css.d.ts +3 -3
  47. package/es/components/form-item/style/index.d.ts +3 -3
  48. package/es/components/header/index.d.ts +1 -1
  49. package/es/components/header/src/index.vue.d.ts +2 -2
  50. package/es/{packages/components → components}/header/src/index.vue.mjs +1 -1
  51. package/es/components/input-tag/index.d.ts +10 -10
  52. package/es/components/input-tag/src/index.vue.d.ts +12 -12
  53. package/es/{packages/components → components}/input-tag/src/index.vue.mjs +1 -1
  54. package/es/components/layout/index.d.ts +56 -56
  55. package/es/components/layout/src/index.vue.d.ts +72 -72
  56. package/es/{packages/components → components}/layout/src/index.vue.mjs +1 -1
  57. package/es/components/layout/style/css.d.ts +3 -3
  58. package/es/components/layout/style/index.d.ts +3 -3
  59. package/es/components/page/src/index.vue.d.ts +3 -3
  60. package/es/{packages/components → components}/page/src/index.vue.mjs +1 -1
  61. package/es/components/page/style/css.d.ts +2 -2
  62. package/es/components/page/style/index.d.ts +2 -2
  63. package/es/components/pagination/index.d.ts +1 -1
  64. package/es/components/pagination/src/index.vue.d.ts +2 -2
  65. package/es/{packages/components → components}/pagination/src/index.vue.mjs +1 -1
  66. package/es/components/popover/src/index.vue.d.ts +1 -1
  67. package/es/{packages/components → components}/popover/src/index.vue.mjs +1 -1
  68. package/es/components/radio/index.d.ts +8 -8
  69. package/es/components/radio/src/index.vue.d.ts +9 -9
  70. package/es/{packages/components → components}/radio/src/index.vue.mjs +1 -1
  71. package/es/components/render/src/index.vue.d.ts +1 -1
  72. package/es/{packages/components → components}/render/src/index.vue.mjs +1 -1
  73. package/es/components/search/index.d.ts +107 -107
  74. package/es/components/search/src/index.vue.d.ts +118 -118
  75. package/es/{packages/components → components}/search/src/index.vue.mjs +1 -1
  76. package/es/components/search/style/css.d.ts +1 -1
  77. package/es/components/search/style/index.d.ts +1 -1
  78. package/es/components/sidebar/index.d.ts +14 -14
  79. package/es/components/sidebar/src/index.vue.d.ts +15 -15
  80. package/es/{packages/components → components}/sidebar/src/index.vue.mjs +1 -1
  81. package/es/components/sidebar/src/sidebar-item.vue.d.ts +1 -1
  82. package/es/{packages/components → components}/sidebar/src/sidebar-item.vue.mjs +1 -1
  83. package/es/components/steps-form/index.d.ts +104 -104
  84. package/es/components/steps-form/src/index.vue.d.ts +116 -116
  85. package/es/{packages/components → components}/steps-form/src/index.vue.mjs +1 -1
  86. package/es/components/steps-form/style/css.d.ts +1 -1
  87. package/es/components/steps-form/style/index.d.ts +1 -1
  88. package/es/{packages/components → components}/table/src/index.vue.mjs +1 -1
  89. package/es/{packages/components → components}/table/src/table-action-bar.vue.mjs +1 -1
  90. package/es/{packages/components → components}/table/src/table-column-drag-sort.vue.mjs +1 -1
  91. package/es/{packages/components → components}/table/src/table-column-index.vue.mjs +1 -1
  92. package/es/{packages/components → components}/table/src/table-column.vue.mjs +1 -1
  93. package/es/components/table/src/table-title-bar.vue.d.ts +3 -3
  94. package/es/{packages/components → components}/table/src/table-title-bar.vue.mjs +1 -1
  95. package/es/components/table/src/type.d.ts +1 -1
  96. package/es/components/table/style/css.d.ts +3 -3
  97. package/es/components/table/style/index.d.ts +3 -3
  98. package/es/components/utils/index.d.ts +1 -1
  99. package/es/constants/page.d.ts +1 -1
  100. package/es/defaults.mjs +2 -1
  101. package/es/directive.d.ts +3 -0
  102. package/es/directive.mjs +8 -0
  103. package/es/directives/index.d.ts +1 -3
  104. package/es/directives/index.mjs +1 -0
  105. package/es/hooks/useGetOptions.d.ts +1 -1
  106. package/es/hooks/useTable.d.ts +2 -2
  107. package/es/index.css +11 -12
  108. package/es/index.d.ts +5 -5
  109. package/es/index.mjs +33 -35
  110. package/es/pro-ui/directive.d.ts +3 -0
  111. package/es/pro-ui/index.d.ts +5 -5
  112. package/es/types/form.d.ts +4 -4
  113. package/index.css +1 -1
  114. package/index.js +14 -4535
  115. package/index.min.js +3 -7
  116. package/index.min.mjs +3 -7
  117. package/index.mjs +15 -4531
  118. package/lib/component.js +22 -22
  119. package/lib/components/breadcrumb/src/index.vue.d.ts +1 -1
  120. package/lib/{packages/components → components}/breadcrumb/src/index.vue.js +1 -1
  121. package/lib/components/check-card/src/index.vue.d.ts +1 -1
  122. package/lib/{packages/components → components}/check-card/src/index.vue.js +1 -1
  123. package/lib/components/check-card-group/src/index.vue.d.ts +1 -1
  124. package/lib/{packages/components → components}/check-card-group/src/index.vue.js +1 -1
  125. package/lib/components/check-card-group/style/css.d.ts +1 -1
  126. package/lib/components/check-card-group/style/index.d.ts +1 -1
  127. package/lib/components/date-picker/index.d.ts +25 -25
  128. package/lib/components/date-picker/src/index.vue.d.ts +26 -26
  129. package/lib/{packages/components → components}/date-picker/src/index.vue.js +1 -1
  130. package/lib/components/descriptions/index.d.ts +118 -118
  131. package/lib/components/descriptions/src/index.vue.d.ts +131 -131
  132. package/lib/{packages/components → components}/descriptions/src/index.vue.js +1 -1
  133. package/lib/components/descriptions/style/css.d.ts +1 -1
  134. package/lib/components/descriptions/style/index.d.ts +1 -1
  135. package/lib/components/dialog/index.d.ts +2 -2
  136. package/lib/components/dialog/src/index.vue.d.ts +3 -3
  137. package/lib/{packages/components → components}/dialog/src/index.vue.js +1 -1
  138. package/lib/components/dialog-form/index.d.ts +102 -102
  139. package/lib/components/dialog-form/src/index.vue.d.ts +116 -116
  140. package/lib/{packages/components → components}/dialog-form/src/index.vue.js +1 -1
  141. package/lib/components/dialog-form/style/css.d.ts +2 -2
  142. package/lib/components/dialog-form/style/index.d.ts +2 -2
  143. package/lib/components/display-item/index.d.ts +111 -111
  144. package/lib/components/display-item/src/index.vue.d.ts +120 -120
  145. package/lib/{packages/components → components}/display-item/src/index.vue.js +1 -1
  146. package/lib/components/display-item/style/css.d.ts +1 -1
  147. package/lib/components/display-item/style/index.d.ts +1 -1
  148. package/lib/components/drawer-form/index.d.ts +110 -110
  149. package/lib/components/drawer-form/src/index.vue.d.ts +122 -122
  150. package/lib/{packages/components → components}/drawer-form/src/index.vue.js +1 -1
  151. package/lib/components/drawer-form/style/css.d.ts +1 -1
  152. package/lib/components/drawer-form/style/index.d.ts +1 -1
  153. package/lib/components/form/index.d.ts +98 -98
  154. package/lib/components/form/src/form-content.vue.d.ts +76 -76
  155. package/lib/{packages/components → components}/form/src/form-content.vue.js +1 -1
  156. package/lib/components/form/src/index.vue.d.ts +108 -108
  157. package/lib/{packages/components → components}/form/src/index.vue.js +1 -1
  158. package/lib/components/form/style/css.d.ts +1 -1
  159. package/lib/components/form/style/index.d.ts +1 -1
  160. package/lib/components/form-item/index.d.ts +65 -65
  161. package/lib/components/form-item/src/index.vue.d.ts +72 -72
  162. package/lib/{packages/components → components}/form-item/src/index.vue.js +1 -1
  163. package/lib/components/form-item/style/css.d.ts +3 -3
  164. package/lib/components/form-item/style/index.d.ts +3 -3
  165. package/lib/components/header/index.d.ts +1 -1
  166. package/lib/components/header/src/index.vue.d.ts +2 -2
  167. package/lib/{packages/components → components}/header/src/index.vue.js +1 -1
  168. package/lib/components/input-tag/index.d.ts +10 -10
  169. package/lib/components/input-tag/src/index.vue.d.ts +12 -12
  170. package/lib/{packages/components → components}/input-tag/src/index.vue.js +1 -1
  171. package/lib/components/layout/index.d.ts +56 -56
  172. package/lib/components/layout/src/index.vue.d.ts +72 -72
  173. package/lib/{packages/components → components}/layout/src/index.vue.js +1 -1
  174. package/lib/components/layout/style/css.d.ts +3 -3
  175. package/lib/components/layout/style/index.d.ts +3 -3
  176. package/lib/components/page/src/index.vue.d.ts +3 -3
  177. package/lib/{packages/components → components}/page/src/index.vue.js +1 -1
  178. package/lib/components/page/style/css.d.ts +2 -2
  179. package/lib/components/page/style/index.d.ts +2 -2
  180. package/lib/components/pagination/index.d.ts +1 -1
  181. package/lib/components/pagination/src/index.vue.d.ts +2 -2
  182. package/lib/{packages/components → components}/pagination/src/index.vue.js +1 -1
  183. package/lib/components/popover/src/index.vue.d.ts +1 -1
  184. package/lib/{packages/components → components}/popover/src/index.vue.js +1 -1
  185. package/lib/components/radio/index.d.ts +8 -8
  186. package/lib/components/radio/src/index.vue.d.ts +9 -9
  187. package/lib/{packages/components → components}/radio/src/index.vue.js +1 -1
  188. package/lib/components/render/src/index.vue.d.ts +1 -1
  189. package/lib/{packages/components → components}/render/src/index.vue.js +1 -1
  190. package/lib/components/search/index.d.ts +107 -107
  191. package/lib/components/search/src/index.vue.d.ts +118 -118
  192. package/lib/{packages/components → components}/search/src/index.vue.js +1 -1
  193. package/lib/components/search/style/css.d.ts +1 -1
  194. package/lib/components/search/style/index.d.ts +1 -1
  195. package/lib/components/sidebar/index.d.ts +14 -14
  196. package/lib/components/sidebar/src/index.vue.d.ts +15 -15
  197. package/lib/{packages/components → components}/sidebar/src/index.vue.js +1 -1
  198. package/lib/components/sidebar/src/sidebar-item.vue.d.ts +1 -1
  199. package/lib/{packages/components → components}/sidebar/src/sidebar-item.vue.js +1 -1
  200. package/lib/components/steps-form/index.d.ts +104 -104
  201. package/lib/components/steps-form/src/index.vue.d.ts +116 -116
  202. package/lib/{packages/components → components}/steps-form/src/index.vue.js +1 -1
  203. package/lib/components/steps-form/style/css.d.ts +1 -1
  204. package/lib/components/steps-form/style/index.d.ts +1 -1
  205. package/lib/{packages/components → components}/table/src/index.vue.js +1 -1
  206. package/lib/{packages/components → components}/table/src/table-action-bar.vue.js +1 -1
  207. package/lib/{packages/components → components}/table/src/table-column-drag-sort.vue.js +1 -1
  208. package/lib/{packages/components → components}/table/src/table-column-index.vue.js +1 -1
  209. package/lib/{packages/components → components}/table/src/table-column.vue.js +1 -1
  210. package/lib/components/table/src/table-title-bar.vue.d.ts +3 -3
  211. package/lib/{packages/components → components}/table/src/table-title-bar.vue.js +1 -1
  212. package/lib/components/table/src/type.d.ts +1 -1
  213. package/lib/components/table/style/css.d.ts +3 -3
  214. package/lib/components/table/style/index.d.ts +3 -3
  215. package/lib/components/utils/index.d.ts +1 -1
  216. package/lib/constants/page.d.ts +1 -1
  217. package/lib/defaults.js +2 -1
  218. package/lib/directive.d.ts +3 -0
  219. package/lib/directive.js +12 -0
  220. package/lib/directives/index.d.ts +1 -3
  221. package/lib/directives/index.js +7 -0
  222. package/lib/hooks/useGetOptions.d.ts +1 -1
  223. package/lib/hooks/useTable.d.ts +2 -2
  224. package/lib/index.d.ts +5 -5
  225. package/lib/index.js +33 -40
  226. package/lib/{index.css → page.css} +13 -14
  227. package/lib/pro-ui/directive.d.ts +3 -0
  228. package/lib/pro-ui/index.d.ts +5 -5
  229. package/lib/types/form.d.ts +4 -4
  230. package/locale/en.js +1 -1
  231. package/locale/en.min.js +1 -1
  232. package/locale/en.min.mjs +1 -1
  233. package/locale/en.mjs +1 -1
  234. package/locale/zh-cn.js +1 -1
  235. package/locale/zh-cn.min.js +1 -1
  236. package/locale/zh-cn.min.mjs +1 -1
  237. package/locale/zh-cn.mjs +1 -1
  238. package/package.json +1 -6
  239. package/es/directives/modules/tippy/index.d.ts +0 -10
  240. package/es/directives.d.ts +0 -1
  241. package/es/directives.mjs +0 -4
  242. package/es/node_modules/.pnpm/tippy.js@6.3.7/node_modules/tippy.js/dist/tippy.css.mjs +0 -3
  243. package/es/node_modules/.pnpm/vue-tippy@6.7.1_vue@3.5.17_typescript@5.8.3_/node_modules/vue-tippy/dist/vue-tippy.mjs +0 -4567
  244. package/es/packages/directives/index.mjs +0 -3
  245. package/es/packages/directives/modules/tippy/index.mjs +0 -11
  246. package/es/pro-ui/directives.d.ts +0 -1
  247. package/index.min.css +0 -1
  248. package/lib/directives/modules/tippy/index.d.ts +0 -10
  249. package/lib/directives.d.ts +0 -1
  250. package/lib/directives.js +0 -15
  251. package/lib/node_modules/.pnpm/tippy.js@6.3.7/node_modules/tippy.js/dist/tippy.css.js +0 -7
  252. package/lib/node_modules/.pnpm/vue-tippy@6.7.1_vue@3.5.17_typescript@5.8.3_/node_modules/vue-tippy/dist/vue-tippy.js +0 -4582
  253. package/lib/packages/directives/index.js +0 -14
  254. package/lib/packages/directives/modules/tippy/index.js +0 -19
  255. package/lib/pro-ui/directives.d.ts +0 -1
  256. /package/es/{packages/components → components}/breadcrumb/index.mjs +0 -0
  257. /package/es/{packages/components → components}/breadcrumb/src/index.vue2.mjs +0 -0
  258. /package/es/{packages/components → components}/breadcrumb/style/css.mjs +0 -0
  259. /package/es/{packages/components → components}/breadcrumb/style/index.mjs +0 -0
  260. /package/es/{packages/components → components}/check-card/index.mjs +0 -0
  261. /package/es/{packages/components → components}/check-card/src/index.vue2.mjs +0 -0
  262. /package/es/{packages/components → components}/check-card/style/css.mjs +0 -0
  263. /package/es/{packages/components → components}/check-card/style/index.mjs +0 -0
  264. /package/es/{packages/components → components}/check-card-group/index.mjs +0 -0
  265. /package/es/{packages/components → components}/check-card-group/src/index.vue2.mjs +0 -0
  266. /package/es/{packages/components → components}/check-card-group/style/css.mjs +0 -0
  267. /package/es/{packages/components → components}/check-card-group/style/index.mjs +0 -0
  268. /package/es/{packages/components → components}/date-picker/index.mjs +0 -0
  269. /package/es/{packages/components → components}/date-picker/src/index.vue2.mjs +0 -0
  270. /package/es/{packages/components → components}/date-picker/style/css.mjs +0 -0
  271. /package/es/{packages/components → components}/date-picker/style/index.mjs +0 -0
  272. /package/es/{packages/components → components}/descriptions/index.mjs +0 -0
  273. /package/es/{packages/components → components}/descriptions/src/index.vue2.mjs +0 -0
  274. /package/es/{packages/components → components}/descriptions/style/css.mjs +0 -0
  275. /package/es/{packages/components → components}/descriptions/style/index.mjs +0 -0
  276. /package/es/{packages/components → components}/dialog/index.mjs +0 -0
  277. /package/es/{packages/components → components}/dialog/src/index.vue2.mjs +0 -0
  278. /package/es/{packages/components → components}/dialog/style/css.mjs +0 -0
  279. /package/es/{packages/components → components}/dialog/style/index.mjs +0 -0
  280. /package/es/{packages/components → components}/dialog-form/index.mjs +0 -0
  281. /package/es/{packages/components → components}/dialog-form/src/index.vue2.mjs +0 -0
  282. /package/es/{packages/components → components}/dialog-form/style/css.mjs +0 -0
  283. /package/es/{packages/components → components}/dialog-form/style/index.mjs +0 -0
  284. /package/es/{packages/components → components}/display-item/index.mjs +0 -0
  285. /package/es/{packages/components → components}/display-item/src/index.vue2.mjs +0 -0
  286. /package/es/{packages/components → components}/display-item/style/css.mjs +0 -0
  287. /package/es/{packages/components → components}/display-item/style/index.mjs +0 -0
  288. /package/es/{packages/components → components}/drawer-form/index.mjs +0 -0
  289. /package/es/{packages/components → components}/drawer-form/src/index.vue2.mjs +0 -0
  290. /package/es/{packages/components → components}/drawer-form/style/css.mjs +0 -0
  291. /package/es/{packages/components → components}/drawer-form/style/index.mjs +0 -0
  292. /package/es/{packages/components → components}/form/index.mjs +0 -0
  293. /package/es/{packages/components → components}/form/src/form-content.vue2.mjs +0 -0
  294. /package/es/{packages/components → components}/form/src/index.vue2.mjs +0 -0
  295. /package/es/{packages/components → components}/form/style/css.mjs +0 -0
  296. /package/es/{packages/components → components}/form/style/index.mjs +0 -0
  297. /package/es/{packages/components → components}/form-item/index.mjs +0 -0
  298. /package/es/{packages/components → components}/form-item/src/index.vue2.mjs +0 -0
  299. /package/es/{packages/components → components}/form-item/style/css.mjs +0 -0
  300. /package/es/{packages/components → components}/form-item/style/index.mjs +0 -0
  301. /package/es/{packages/components → components}/header/index.mjs +0 -0
  302. /package/es/{packages/components → components}/header/src/index.vue2.mjs +0 -0
  303. /package/es/{packages/components → components}/header/style/css.mjs +0 -0
  304. /package/es/{packages/components → components}/header/style/index.mjs +0 -0
  305. /package/es/{packages/components → components}/index.mjs +0 -0
  306. /package/es/{packages/components → components}/input-tag/index.mjs +0 -0
  307. /package/es/{packages/components → components}/input-tag/src/index.vue2.mjs +0 -0
  308. /package/es/{packages/components → components}/input-tag/style/css.mjs +0 -0
  309. /package/es/{packages/components → components}/input-tag/style/index.mjs +0 -0
  310. /package/es/{packages/components → components}/layout/index.mjs +0 -0
  311. /package/es/{packages/components → components}/layout/src/index.vue2.mjs +0 -0
  312. /package/es/{packages/components → components}/layout/style/css.mjs +0 -0
  313. /package/es/{packages/components → components}/layout/style/index.mjs +0 -0
  314. /package/es/{packages/components → components}/page/index.mjs +0 -0
  315. /package/es/{packages/components → components}/page/src/index.vue2.mjs +0 -0
  316. /package/es/{packages/components → components}/page/style/css.mjs +0 -0
  317. /package/es/{packages/components → components}/page/style/index.mjs +0 -0
  318. /package/es/{packages/components → components}/pagination/index.mjs +0 -0
  319. /package/es/{packages/components → components}/pagination/src/index.vue2.mjs +0 -0
  320. /package/es/{packages/components → components}/pagination/style/css.mjs +0 -0
  321. /package/es/{packages/components → components}/pagination/style/index.mjs +0 -0
  322. /package/es/{packages/components → components}/popover/index.mjs +0 -0
  323. /package/es/{packages/components → components}/popover/src/index.vue2.mjs +0 -0
  324. /package/es/{packages/components → components}/popover/style/css.mjs +0 -0
  325. /package/es/{packages/components → components}/popover/style/index.mjs +0 -0
  326. /package/es/{packages/components → components}/radio/index.mjs +0 -0
  327. /package/es/{packages/components → components}/radio/src/index.vue2.mjs +0 -0
  328. /package/es/{packages/components → components}/radio/style/css.mjs +0 -0
  329. /package/es/{packages/components → components}/radio/style/index.mjs +0 -0
  330. /package/es/{packages/components → components}/render/index.mjs +0 -0
  331. /package/es/{packages/components → components}/render/src/index.vue2.mjs +0 -0
  332. /package/es/{packages/components → components}/search/index.mjs +0 -0
  333. /package/es/{packages/components → components}/search/src/index.vue2.mjs +0 -0
  334. /package/es/{packages/components → components}/search/style/css.mjs +0 -0
  335. /package/es/{packages/components → components}/search/style/index.mjs +0 -0
  336. /package/es/{packages/components → components}/sidebar/index.mjs +0 -0
  337. /package/es/{packages/components → components}/sidebar/src/index.vue2.mjs +0 -0
  338. /package/es/{packages/components → components}/sidebar/src/sidebar-item.vue2.mjs +0 -0
  339. /package/es/{packages/components → components}/sidebar/style/css.mjs +0 -0
  340. /package/es/{packages/components → components}/sidebar/style/index.mjs +0 -0
  341. /package/es/{packages/components → components}/steps-form/index.mjs +0 -0
  342. /package/es/{packages/components → components}/steps-form/src/index.vue2.mjs +0 -0
  343. /package/es/{packages/components → components}/steps-form/style/css.mjs +0 -0
  344. /package/es/{packages/components → components}/steps-form/style/index.mjs +0 -0
  345. /package/es/{packages/components → components}/table/index.mjs +0 -0
  346. /package/es/{packages/components → components}/table/src/index.vue2.mjs +0 -0
  347. /package/es/{packages/components → components}/table/src/table-action-bar.vue2.mjs +0 -0
  348. /package/es/{packages/components → components}/table/src/table-column-drag-sort.vue2.mjs +0 -0
  349. /package/es/{packages/components → components}/table/src/table-column-index.vue2.mjs +0 -0
  350. /package/es/{packages/components → components}/table/src/table-column.vue2.mjs +0 -0
  351. /package/es/{packages/components → components}/table/src/table-title-bar.vue2.mjs +0 -0
  352. /package/es/{packages/components → components}/table/src/type.mjs +0 -0
  353. /package/es/{packages/components → components}/table/style/css.mjs +0 -0
  354. /package/es/{packages/components → components}/table/style/index.mjs +0 -0
  355. /package/es/{packages/components → components}/utils/format.mjs +0 -0
  356. /package/es/{packages/components → components}/utils/index.mjs +0 -0
  357. /package/es/{packages/components → components}/utils/is.mjs +0 -0
  358. /package/es/{packages/constants → constants}/form.mjs +0 -0
  359. /package/es/{packages/constants → constants}/index.mjs +0 -0
  360. /package/es/{packages/constants → constants}/page.mjs +0 -0
  361. /package/es/directives/{modules/click → click}/hook/useClickControl.d.ts +0 -0
  362. /package/es/{packages/directives/modules → directives}/click/hook/useClickControl.mjs +0 -0
  363. /package/es/directives/{modules/click → click}/index.d.ts +0 -0
  364. /package/es/{packages/directives/modules → directives}/click/index.mjs +0 -0
  365. /package/es/directives/{modules/click → click}/type/index.d.ts +0 -0
  366. /package/es/{packages/directives/modules → directives}/click/type/index.mjs +0 -0
  367. /package/es/{packages/hooks → hooks}/index.mjs +0 -0
  368. /package/es/{packages/hooks → hooks}/useGetOptions.mjs +0 -0
  369. /package/es/{packages/hooks → hooks}/useLocale.mjs +0 -0
  370. /package/es/{packages/hooks → hooks}/useTable.mjs +0 -0
  371. /package/es/{packages/locale → locale}/index.mjs +0 -0
  372. /package/es/{packages/locale → locale}/lang/en.mjs +0 -0
  373. /package/es/{packages/locale → locale}/lang/zh-cn.mjs +0 -0
  374. /package/es/{packages/theme-chalk → theme-chalk}/src/breadcrumb.scss.mjs +0 -0
  375. /package/es/{packages/theme-chalk → theme-chalk}/src/check-card-group.scss.mjs +0 -0
  376. /package/es/{packages/theme-chalk → theme-chalk}/src/check-card.scss.mjs +0 -0
  377. /package/es/{packages/theme-chalk → theme-chalk}/src/date-picker.scss.mjs +0 -0
  378. /package/es/{packages/theme-chalk → theme-chalk}/src/descriptions.scss.mjs +0 -0
  379. /package/es/{packages/theme-chalk → theme-chalk}/src/dialog-form.scss.mjs +0 -0
  380. /package/es/{packages/theme-chalk → theme-chalk}/src/dialog.scss.mjs +0 -0
  381. /package/es/{packages/theme-chalk → theme-chalk}/src/display-item.scss.mjs +0 -0
  382. /package/es/{packages/theme-chalk → theme-chalk}/src/drawer-form.scss.mjs +0 -0
  383. /package/es/{packages/theme-chalk → theme-chalk}/src/form-item.scss.mjs +0 -0
  384. /package/es/{packages/theme-chalk → theme-chalk}/src/form.scss.mjs +0 -0
  385. /package/es/{packages/theme-chalk → theme-chalk}/src/header.scss.mjs +0 -0
  386. /package/es/{packages/theme-chalk → theme-chalk}/src/input-tag.scss.mjs +0 -0
  387. /package/es/{packages/theme-chalk → theme-chalk}/src/layout.scss.mjs +0 -0
  388. /package/es/{packages/theme-chalk → theme-chalk}/src/page.scss.mjs +0 -0
  389. /package/es/{packages/theme-chalk → theme-chalk}/src/pagination.scss.mjs +0 -0
  390. /package/es/{packages/theme-chalk → theme-chalk}/src/popover.scss.mjs +0 -0
  391. /package/es/{packages/theme-chalk → theme-chalk}/src/radio.scss.mjs +0 -0
  392. /package/es/{packages/theme-chalk → theme-chalk}/src/search.scss.mjs +0 -0
  393. /package/es/{packages/theme-chalk → theme-chalk}/src/sidebar.scss.mjs +0 -0
  394. /package/es/{packages/theme-chalk → theme-chalk}/src/steps-form.scss.mjs +0 -0
  395. /package/es/{packages/theme-chalk → theme-chalk}/src/table.scss.mjs +0 -0
  396. /package/es/{packages/types → types}/form.mjs +0 -0
  397. /package/es/{packages/types → types}/global.mjs +0 -0
  398. /package/es/{packages/types → types}/index.mjs +0 -0
  399. /package/es/{packages/types → types}/layout.mjs +0 -0
  400. /package/es/{packages/types → types}/plus.mjs +0 -0
  401. /package/es/{packages/types → types}/table.mjs +0 -0
  402. /package/lib/{packages/components → components}/breadcrumb/index.js +0 -0
  403. /package/lib/{packages/components → components}/breadcrumb/src/index.vue2.js +0 -0
  404. /package/lib/{packages/components → components}/breadcrumb/style/css.js +0 -0
  405. /package/lib/{packages/components → components}/breadcrumb/style/index.js +0 -0
  406. /package/lib/{packages/components → components}/check-card/index.js +0 -0
  407. /package/lib/{packages/components → components}/check-card/src/index.vue2.js +0 -0
  408. /package/lib/{packages/components → components}/check-card/style/css.js +0 -0
  409. /package/lib/{packages/components → components}/check-card/style/index.js +0 -0
  410. /package/lib/{packages/components → components}/check-card-group/index.js +0 -0
  411. /package/lib/{packages/components → components}/check-card-group/src/index.vue2.js +0 -0
  412. /package/lib/{packages/components → components}/check-card-group/style/css.js +0 -0
  413. /package/lib/{packages/components → components}/check-card-group/style/index.js +0 -0
  414. /package/lib/{packages/components → components}/date-picker/index.js +0 -0
  415. /package/lib/{packages/components → components}/date-picker/src/index.vue2.js +0 -0
  416. /package/lib/{packages/components → components}/date-picker/style/css.js +0 -0
  417. /package/lib/{packages/components → components}/date-picker/style/index.js +0 -0
  418. /package/lib/{packages/components → components}/descriptions/index.js +0 -0
  419. /package/lib/{packages/components → components}/descriptions/src/index.vue2.js +0 -0
  420. /package/lib/{packages/components → components}/descriptions/style/css.js +0 -0
  421. /package/lib/{packages/components → components}/descriptions/style/index.js +0 -0
  422. /package/lib/{packages/components → components}/dialog/index.js +0 -0
  423. /package/lib/{packages/components → components}/dialog/src/index.vue2.js +0 -0
  424. /package/lib/{packages/components → components}/dialog/style/css.js +0 -0
  425. /package/lib/{packages/components → components}/dialog/style/index.js +0 -0
  426. /package/lib/{packages/components → components}/dialog-form/index.js +0 -0
  427. /package/lib/{packages/components → components}/dialog-form/src/index.vue2.js +0 -0
  428. /package/lib/{packages/components → components}/dialog-form/style/css.js +0 -0
  429. /package/lib/{packages/components → components}/dialog-form/style/index.js +0 -0
  430. /package/lib/{packages/components → components}/display-item/index.js +0 -0
  431. /package/lib/{packages/components → components}/display-item/src/index.vue2.js +0 -0
  432. /package/lib/{packages/components → components}/display-item/style/css.js +0 -0
  433. /package/lib/{packages/components → components}/display-item/style/index.js +0 -0
  434. /package/lib/{packages/components → components}/drawer-form/index.js +0 -0
  435. /package/lib/{packages/components → components}/drawer-form/src/index.vue2.js +0 -0
  436. /package/lib/{packages/components → components}/drawer-form/style/css.js +0 -0
  437. /package/lib/{packages/components → components}/drawer-form/style/index.js +0 -0
  438. /package/lib/{packages/components → components}/form/index.js +0 -0
  439. /package/lib/{packages/components → components}/form/src/form-content.vue2.js +0 -0
  440. /package/lib/{packages/components → components}/form/src/index.vue2.js +0 -0
  441. /package/lib/{packages/components → components}/form/style/css.js +0 -0
  442. /package/lib/{packages/components → components}/form/style/index.js +0 -0
  443. /package/lib/{packages/components → components}/form-item/index.js +0 -0
  444. /package/lib/{packages/components → components}/form-item/src/index.vue2.js +0 -0
  445. /package/lib/{packages/components → components}/form-item/style/css.js +0 -0
  446. /package/lib/{packages/components → components}/form-item/style/index.js +0 -0
  447. /package/lib/{packages/components → components}/header/index.js +0 -0
  448. /package/lib/{packages/components → components}/header/src/index.vue2.js +0 -0
  449. /package/lib/{packages/components → components}/header/style/css.js +0 -0
  450. /package/lib/{packages/components → components}/header/style/index.js +0 -0
  451. /package/lib/{packages/components → components}/index.js +0 -0
  452. /package/lib/{packages/components → components}/input-tag/index.js +0 -0
  453. /package/lib/{packages/components → components}/input-tag/src/index.vue2.js +0 -0
  454. /package/lib/{packages/components → components}/input-tag/style/css.js +0 -0
  455. /package/lib/{packages/components → components}/input-tag/style/index.js +0 -0
  456. /package/lib/{packages/components → components}/layout/index.js +0 -0
  457. /package/lib/{packages/components → components}/layout/src/index.vue2.js +0 -0
  458. /package/lib/{packages/components → components}/layout/style/css.js +0 -0
  459. /package/lib/{packages/components → components}/layout/style/index.js +0 -0
  460. /package/lib/{packages/components → components}/page/index.js +0 -0
  461. /package/lib/{packages/components → components}/page/src/index.vue2.js +0 -0
  462. /package/lib/{packages/components → components}/page/style/css.js +0 -0
  463. /package/lib/{packages/components → components}/page/style/index.js +0 -0
  464. /package/lib/{packages/components → components}/pagination/index.js +0 -0
  465. /package/lib/{packages/components → components}/pagination/src/index.vue2.js +0 -0
  466. /package/lib/{packages/components → components}/pagination/style/css.js +0 -0
  467. /package/lib/{packages/components → components}/pagination/style/index.js +0 -0
  468. /package/lib/{packages/components → components}/popover/index.js +0 -0
  469. /package/lib/{packages/components → components}/popover/src/index.vue2.js +0 -0
  470. /package/lib/{packages/components → components}/popover/style/css.js +0 -0
  471. /package/lib/{packages/components → components}/popover/style/index.js +0 -0
  472. /package/lib/{packages/components → components}/radio/index.js +0 -0
  473. /package/lib/{packages/components → components}/radio/src/index.vue2.js +0 -0
  474. /package/lib/{packages/components → components}/radio/style/css.js +0 -0
  475. /package/lib/{packages/components → components}/radio/style/index.js +0 -0
  476. /package/lib/{packages/components → components}/render/index.js +0 -0
  477. /package/lib/{packages/components → components}/render/src/index.vue2.js +0 -0
  478. /package/lib/{packages/components → components}/search/index.js +0 -0
  479. /package/lib/{packages/components → components}/search/src/index.vue2.js +0 -0
  480. /package/lib/{packages/components → components}/search/style/css.js +0 -0
  481. /package/lib/{packages/components → components}/search/style/index.js +0 -0
  482. /package/lib/{packages/components → components}/sidebar/index.js +0 -0
  483. /package/lib/{packages/components → components}/sidebar/src/index.vue2.js +0 -0
  484. /package/lib/{packages/components → components}/sidebar/src/sidebar-item.vue2.js +0 -0
  485. /package/lib/{packages/components → components}/sidebar/style/css.js +0 -0
  486. /package/lib/{packages/components → components}/sidebar/style/index.js +0 -0
  487. /package/lib/{packages/components → components}/steps-form/index.js +0 -0
  488. /package/lib/{packages/components → components}/steps-form/src/index.vue2.js +0 -0
  489. /package/lib/{packages/components → components}/steps-form/style/css.js +0 -0
  490. /package/lib/{packages/components → components}/steps-form/style/index.js +0 -0
  491. /package/lib/{packages/components → components}/table/index.js +0 -0
  492. /package/lib/{packages/components → components}/table/src/index.vue2.js +0 -0
  493. /package/lib/{packages/components → components}/table/src/table-action-bar.vue2.js +0 -0
  494. /package/lib/{packages/components → components}/table/src/table-column-drag-sort.vue2.js +0 -0
  495. /package/lib/{packages/components → components}/table/src/table-column-index.vue2.js +0 -0
  496. /package/lib/{packages/components → components}/table/src/table-column.vue2.js +0 -0
  497. /package/lib/{packages/components → components}/table/src/table-title-bar.vue2.js +0 -0
  498. /package/lib/{packages/components → components}/table/src/type.js +0 -0
  499. /package/lib/{packages/components → components}/table/style/css.js +0 -0
  500. /package/lib/{packages/components → components}/table/style/index.js +0 -0
  501. /package/lib/{packages/components → components}/utils/format.js +0 -0
  502. /package/lib/{packages/components → components}/utils/index.js +0 -0
  503. /package/lib/{packages/components → components}/utils/is.js +0 -0
  504. /package/lib/{packages/constants → constants}/form.js +0 -0
  505. /package/lib/{packages/constants → constants}/index.js +0 -0
  506. /package/lib/{packages/constants → constants}/page.js +0 -0
  507. /package/lib/directives/{modules/click → click}/hook/useClickControl.d.ts +0 -0
  508. /package/lib/{packages/directives/modules → directives}/click/hook/useClickControl.js +0 -0
  509. /package/lib/directives/{modules/click → click}/index.d.ts +0 -0
  510. /package/lib/{packages/directives/modules → directives}/click/index.js +0 -0
  511. /package/lib/directives/{modules/click → click}/type/index.d.ts +0 -0
  512. /package/lib/{packages/directives/modules → directives}/click/type/index.js +0 -0
  513. /package/lib/{packages/hooks → hooks}/index.js +0 -0
  514. /package/lib/{packages/hooks → hooks}/useGetOptions.js +0 -0
  515. /package/lib/{packages/hooks → hooks}/useLocale.js +0 -0
  516. /package/lib/{packages/hooks → hooks}/useTable.js +0 -0
  517. /package/lib/{packages/locale → locale}/index.js +0 -0
  518. /package/lib/{packages/locale → locale}/lang/en.js +0 -0
  519. /package/lib/{packages/locale → locale}/lang/zh-cn.js +0 -0
  520. /package/lib/{packages/theme-chalk → theme-chalk}/src/breadcrumb.scss.js +0 -0
  521. /package/lib/{packages/theme-chalk → theme-chalk}/src/check-card-group.scss.js +0 -0
  522. /package/lib/{packages/theme-chalk → theme-chalk}/src/check-card.scss.js +0 -0
  523. /package/lib/{packages/theme-chalk → theme-chalk}/src/date-picker.scss.js +0 -0
  524. /package/lib/{packages/theme-chalk → theme-chalk}/src/descriptions.scss.js +0 -0
  525. /package/lib/{packages/theme-chalk → theme-chalk}/src/dialog-form.scss.js +0 -0
  526. /package/lib/{packages/theme-chalk → theme-chalk}/src/dialog.scss.js +0 -0
  527. /package/lib/{packages/theme-chalk → theme-chalk}/src/display-item.scss.js +0 -0
  528. /package/lib/{packages/theme-chalk → theme-chalk}/src/drawer-form.scss.js +0 -0
  529. /package/lib/{packages/theme-chalk → theme-chalk}/src/form-item.scss.js +0 -0
  530. /package/lib/{packages/theme-chalk → theme-chalk}/src/form.scss.js +0 -0
  531. /package/lib/{packages/theme-chalk → theme-chalk}/src/header.scss.js +0 -0
  532. /package/lib/{packages/theme-chalk → theme-chalk}/src/input-tag.scss.js +0 -0
  533. /package/lib/{packages/theme-chalk → theme-chalk}/src/layout.scss.js +0 -0
  534. /package/lib/{packages/theme-chalk → theme-chalk}/src/page.scss.js +0 -0
  535. /package/lib/{packages/theme-chalk → theme-chalk}/src/pagination.scss.js +0 -0
  536. /package/lib/{packages/theme-chalk → theme-chalk}/src/popover.scss.js +0 -0
  537. /package/lib/{packages/theme-chalk → theme-chalk}/src/radio.scss.js +0 -0
  538. /package/lib/{packages/theme-chalk → theme-chalk}/src/search.scss.js +0 -0
  539. /package/lib/{packages/theme-chalk → theme-chalk}/src/sidebar.scss.js +0 -0
  540. /package/lib/{packages/theme-chalk → theme-chalk}/src/steps-form.scss.js +0 -0
  541. /package/lib/{packages/theme-chalk → theme-chalk}/src/table.scss.js +0 -0
  542. /package/lib/{packages/types → types}/form.js +0 -0
  543. /package/lib/{packages/types → types}/global.js +0 -0
  544. /package/lib/{packages/types → types}/index.js +0 -0
  545. /package/lib/{packages/types → types}/layout.js +0 -0
  546. /package/lib/{packages/types → types}/plus.js +0 -0
  547. /package/lib/{packages/types → types}/table.js +0 -0
@@ -1,4567 +0,0 @@
1
- import { getCurrentInstance, ref, shallowRef, isRef, isVNode, createApp, h, isReactive, onMounted, onUnmounted, watch, unref, defineComponent, nextTick, reactive } from 'vue';
2
-
3
- /*!
4
- * vue-tippy v6.7.1
5
- * (c) 2025
6
- * @license MIT
7
- */
8
-
9
- var top = 'top';
10
- var bottom = 'bottom';
11
- var right = 'right';
12
- var left = 'left';
13
- var auto = 'auto';
14
- var basePlacements = [top, bottom, right, left];
15
- var start = 'start';
16
- var end = 'end';
17
- var clippingParents = 'clippingParents';
18
- var viewport = 'viewport';
19
- var popper = 'popper';
20
- var reference = 'reference';
21
- var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {
22
- return acc.concat([placement + "-" + start, placement + "-" + end]);
23
- }, []);
24
- var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {
25
- return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
26
- }, []); // modifiers that need to read the DOM
27
-
28
- var beforeRead = 'beforeRead';
29
- var read = 'read';
30
- var afterRead = 'afterRead'; // pure-logic modifiers
31
-
32
- var beforeMain = 'beforeMain';
33
- var main = 'main';
34
- var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)
35
-
36
- var beforeWrite = 'beforeWrite';
37
- var write = 'write';
38
- var afterWrite = 'afterWrite';
39
- var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
40
-
41
- function getNodeName(element) {
42
- return element ? (element.nodeName || '').toLowerCase() : null;
43
- }
44
-
45
- function getWindow(node) {
46
- if (node == null) {
47
- return window;
48
- }
49
-
50
- if (node.toString() !== '[object Window]') {
51
- var ownerDocument = node.ownerDocument;
52
- return ownerDocument ? ownerDocument.defaultView || window : window;
53
- }
54
-
55
- return node;
56
- }
57
-
58
- function isElement(node) {
59
- var OwnElement = getWindow(node).Element;
60
- return node instanceof OwnElement || node instanceof Element;
61
- }
62
-
63
- function isHTMLElement(node) {
64
- var OwnElement = getWindow(node).HTMLElement;
65
- return node instanceof OwnElement || node instanceof HTMLElement;
66
- }
67
-
68
- function isShadowRoot(node) {
69
- // IE 11 has no ShadowRoot
70
- if (typeof ShadowRoot === 'undefined') {
71
- return false;
72
- }
73
-
74
- var OwnElement = getWindow(node).ShadowRoot;
75
- return node instanceof OwnElement || node instanceof ShadowRoot;
76
- }
77
-
78
- // and applies them to the HTMLElements such as popper and arrow
79
-
80
- function applyStyles(_ref) {
81
- var state = _ref.state;
82
- Object.keys(state.elements).forEach(function (name) {
83
- var style = state.styles[name] || {};
84
- var attributes = state.attributes[name] || {};
85
- var element = state.elements[name]; // arrow is optional + virtual elements
86
-
87
- if (!isHTMLElement(element) || !getNodeName(element)) {
88
- return;
89
- } // Flow doesn't support to extend this property, but it's the most
90
- // effective way to apply styles to an HTMLElement
91
- // $FlowFixMe[cannot-write]
92
-
93
-
94
- Object.assign(element.style, style);
95
- Object.keys(attributes).forEach(function (name) {
96
- var value = attributes[name];
97
-
98
- if (value === false) {
99
- element.removeAttribute(name);
100
- } else {
101
- element.setAttribute(name, value === true ? '' : value);
102
- }
103
- });
104
- });
105
- }
106
-
107
- function effect(_ref2) {
108
- var state = _ref2.state;
109
- var initialStyles = {
110
- popper: {
111
- position: state.options.strategy,
112
- left: '0',
113
- top: '0',
114
- margin: '0'
115
- },
116
- arrow: {
117
- position: 'absolute'
118
- },
119
- reference: {}
120
- };
121
- Object.assign(state.elements.popper.style, initialStyles.popper);
122
- state.styles = initialStyles;
123
-
124
- if (state.elements.arrow) {
125
- Object.assign(state.elements.arrow.style, initialStyles.arrow);
126
- }
127
-
128
- return function () {
129
- Object.keys(state.elements).forEach(function (name) {
130
- var element = state.elements[name];
131
- var attributes = state.attributes[name] || {};
132
- var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them
133
-
134
- var style = styleProperties.reduce(function (style, property) {
135
- style[property] = '';
136
- return style;
137
- }, {}); // arrow is optional + virtual elements
138
-
139
- if (!isHTMLElement(element) || !getNodeName(element)) {
140
- return;
141
- }
142
-
143
- Object.assign(element.style, style);
144
- Object.keys(attributes).forEach(function (attribute) {
145
- element.removeAttribute(attribute);
146
- });
147
- });
148
- };
149
- } // eslint-disable-next-line import/no-unused-modules
150
-
151
-
152
- var applyStyles$1 = {
153
- name: 'applyStyles',
154
- enabled: true,
155
- phase: 'write',
156
- fn: applyStyles,
157
- effect: effect,
158
- requires: ['computeStyles']
159
- };
160
-
161
- function getBasePlacement(placement) {
162
- return placement.split('-')[0];
163
- }
164
-
165
- var max = Math.max;
166
- var min = Math.min;
167
- var round = Math.round;
168
-
169
- function getBoundingClientRect(element, includeScale) {
170
- if (includeScale === void 0) {
171
- includeScale = false;
172
- }
173
-
174
- var rect = element.getBoundingClientRect();
175
- var scaleX = 1;
176
- var scaleY = 1;
177
-
178
- if (isHTMLElement(element) && includeScale) {
179
- var offsetHeight = element.offsetHeight;
180
- var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale
181
- // Fallback to 1 in case both values are `0`
182
-
183
- if (offsetWidth > 0) {
184
- scaleX = round(rect.width) / offsetWidth || 1;
185
- }
186
-
187
- if (offsetHeight > 0) {
188
- scaleY = round(rect.height) / offsetHeight || 1;
189
- }
190
- }
191
-
192
- return {
193
- width: rect.width / scaleX,
194
- height: rect.height / scaleY,
195
- top: rect.top / scaleY,
196
- right: rect.right / scaleX,
197
- bottom: rect.bottom / scaleY,
198
- left: rect.left / scaleX,
199
- x: rect.left / scaleX,
200
- y: rect.top / scaleY
201
- };
202
- }
203
-
204
- // means it doesn't take into account transforms.
205
-
206
- function getLayoutRect(element) {
207
- var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.
208
- // Fixes https://github.com/popperjs/popper-core/issues/1223
209
-
210
- var width = element.offsetWidth;
211
- var height = element.offsetHeight;
212
-
213
- if (Math.abs(clientRect.width - width) <= 1) {
214
- width = clientRect.width;
215
- }
216
-
217
- if (Math.abs(clientRect.height - height) <= 1) {
218
- height = clientRect.height;
219
- }
220
-
221
- return {
222
- x: element.offsetLeft,
223
- y: element.offsetTop,
224
- width: width,
225
- height: height
226
- };
227
- }
228
-
229
- function contains(parent, child) {
230
- var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method
231
-
232
- if (parent.contains(child)) {
233
- return true;
234
- } // then fallback to custom implementation with Shadow DOM support
235
- else if (rootNode && isShadowRoot(rootNode)) {
236
- var next = child;
237
-
238
- do {
239
- if (next && parent.isSameNode(next)) {
240
- return true;
241
- } // $FlowFixMe[prop-missing]: need a better way to handle this...
242
-
243
-
244
- next = next.parentNode || next.host;
245
- } while (next);
246
- } // Give up, the result is false
247
-
248
-
249
- return false;
250
- }
251
-
252
- function getComputedStyle(element) {
253
- return getWindow(element).getComputedStyle(element);
254
- }
255
-
256
- function isTableElement(element) {
257
- return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;
258
- }
259
-
260
- function getDocumentElement(element) {
261
- // $FlowFixMe[incompatible-return]: assume body is always available
262
- return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
263
- element.document) || window.document).documentElement;
264
- }
265
-
266
- function getParentNode(element) {
267
- if (getNodeName(element) === 'html') {
268
- return element;
269
- }
270
-
271
- return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
272
- // $FlowFixMe[incompatible-return]
273
- // $FlowFixMe[prop-missing]
274
- element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
275
- element.parentNode || ( // DOM Element detected
276
- isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
277
- // $FlowFixMe[incompatible-call]: HTMLElement is a Node
278
- getDocumentElement(element) // fallback
279
-
280
- );
281
- }
282
-
283
- function getTrueOffsetParent(element) {
284
- if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
285
- getComputedStyle(element).position === 'fixed') {
286
- return null;
287
- }
288
-
289
- return element.offsetParent;
290
- } // `.offsetParent` reports `null` for fixed elements, while absolute elements
291
- // return the containing block
292
-
293
-
294
- function getContainingBlock(element) {
295
- var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1;
296
- var isIE = navigator.userAgent.indexOf('Trident') !== -1;
297
-
298
- if (isIE && isHTMLElement(element)) {
299
- // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport
300
- var elementCss = getComputedStyle(element);
301
-
302
- if (elementCss.position === 'fixed') {
303
- return null;
304
- }
305
- }
306
-
307
- var currentNode = getParentNode(element);
308
-
309
- while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
310
- var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that
311
- // create a containing block.
312
- // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
313
-
314
- if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {
315
- return currentNode;
316
- } else {
317
- currentNode = currentNode.parentNode;
318
- }
319
- }
320
-
321
- return null;
322
- } // Gets the closest ancestor positioned element. Handles some edge cases,
323
- // such as table ancestors and cross browser bugs.
324
-
325
-
326
- function getOffsetParent(element) {
327
- var window = getWindow(element);
328
- var offsetParent = getTrueOffsetParent(element);
329
-
330
- while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
331
- offsetParent = getTrueOffsetParent(offsetParent);
332
- }
333
-
334
- if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {
335
- return window;
336
- }
337
-
338
- return offsetParent || getContainingBlock(element) || window;
339
- }
340
-
341
- function getMainAxisFromPlacement(placement) {
342
- return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
343
- }
344
-
345
- function within(min$1, value, max$1) {
346
- return max(min$1, min(value, max$1));
347
- }
348
- function withinMaxClamp(min, value, max) {
349
- var v = within(min, value, max);
350
- return v > max ? max : v;
351
- }
352
-
353
- function getFreshSideObject() {
354
- return {
355
- top: 0,
356
- right: 0,
357
- bottom: 0,
358
- left: 0
359
- };
360
- }
361
-
362
- function mergePaddingObject(paddingObject) {
363
- return Object.assign({}, getFreshSideObject(), paddingObject);
364
- }
365
-
366
- function expandToHashMap(value, keys) {
367
- return keys.reduce(function (hashMap, key) {
368
- hashMap[key] = value;
369
- return hashMap;
370
- }, {});
371
- }
372
-
373
- var toPaddingObject = function toPaddingObject(padding, state) {
374
- padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {
375
- placement: state.placement
376
- })) : padding;
377
- return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
378
- };
379
-
380
- function arrow(_ref) {
381
- var _state$modifiersData$;
382
-
383
- var state = _ref.state,
384
- name = _ref.name,
385
- options = _ref.options;
386
- var arrowElement = state.elements.arrow;
387
- var popperOffsets = state.modifiersData.popperOffsets;
388
- var basePlacement = getBasePlacement(state.placement);
389
- var axis = getMainAxisFromPlacement(basePlacement);
390
- var isVertical = [left, right].indexOf(basePlacement) >= 0;
391
- var len = isVertical ? 'height' : 'width';
392
-
393
- if (!arrowElement || !popperOffsets) {
394
- return;
395
- }
396
-
397
- var paddingObject = toPaddingObject(options.padding, state);
398
- var arrowRect = getLayoutRect(arrowElement);
399
- var minProp = axis === 'y' ? top : left;
400
- var maxProp = axis === 'y' ? bottom : right;
401
- var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
402
- var startDiff = popperOffsets[axis] - state.rects.reference[axis];
403
- var arrowOffsetParent = getOffsetParent(arrowElement);
404
- var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
405
- var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is
406
- // outside of the popper bounds
407
-
408
- var min = paddingObject[minProp];
409
- var max = clientSize - arrowRect[len] - paddingObject[maxProp];
410
- var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
411
- var offset = within(min, center, max); // Prevents breaking syntax highlighting...
412
-
413
- var axisProp = axis;
414
- state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);
415
- }
416
-
417
- function effect$1(_ref2) {
418
- var state = _ref2.state,
419
- options = _ref2.options;
420
- var _options$element = options.element,
421
- arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;
422
-
423
- if (arrowElement == null) {
424
- return;
425
- } // CSS selector
426
-
427
-
428
- if (typeof arrowElement === 'string') {
429
- arrowElement = state.elements.popper.querySelector(arrowElement);
430
-
431
- if (!arrowElement) {
432
- return;
433
- }
434
- }
435
-
436
- if (!contains(state.elements.popper, arrowElement)) {
437
-
438
- return;
439
- }
440
-
441
- state.elements.arrow = arrowElement;
442
- } // eslint-disable-next-line import/no-unused-modules
443
-
444
-
445
- var arrow$1 = {
446
- name: 'arrow',
447
- enabled: true,
448
- phase: 'main',
449
- fn: arrow,
450
- effect: effect$1,
451
- requires: ['popperOffsets'],
452
- requiresIfExists: ['preventOverflow']
453
- };
454
-
455
- function getVariation(placement) {
456
- return placement.split('-')[1];
457
- }
458
-
459
- var unsetSides = {
460
- top: 'auto',
461
- right: 'auto',
462
- bottom: 'auto',
463
- left: 'auto'
464
- }; // Round the offsets to the nearest suitable subpixel based on the DPR.
465
- // Zooming can change the DPR, but it seems to report a value that will
466
- // cleanly divide the values into the appropriate subpixels.
467
-
468
- function roundOffsetsByDPR(_ref) {
469
- var x = _ref.x,
470
- y = _ref.y;
471
- var win = window;
472
- var dpr = win.devicePixelRatio || 1;
473
- return {
474
- x: round(x * dpr) / dpr || 0,
475
- y: round(y * dpr) / dpr || 0
476
- };
477
- }
478
-
479
- function mapToStyles(_ref2) {
480
- var _Object$assign2;
481
-
482
- var popper = _ref2.popper,
483
- popperRect = _ref2.popperRect,
484
- placement = _ref2.placement,
485
- variation = _ref2.variation,
486
- offsets = _ref2.offsets,
487
- position = _ref2.position,
488
- gpuAcceleration = _ref2.gpuAcceleration,
489
- adaptive = _ref2.adaptive,
490
- roundOffsets = _ref2.roundOffsets,
491
- isFixed = _ref2.isFixed;
492
-
493
- var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets,
494
- _ref3$x = _ref3.x,
495
- x = _ref3$x === void 0 ? 0 : _ref3$x,
496
- _ref3$y = _ref3.y,
497
- y = _ref3$y === void 0 ? 0 : _ref3$y;
498
-
499
- var hasX = offsets.hasOwnProperty('x');
500
- var hasY = offsets.hasOwnProperty('y');
501
- var sideX = left;
502
- var sideY = top;
503
- var win = window;
504
-
505
- if (adaptive) {
506
- var offsetParent = getOffsetParent(popper);
507
- var heightProp = 'clientHeight';
508
- var widthProp = 'clientWidth';
509
-
510
- if (offsetParent === getWindow(popper)) {
511
- offsetParent = getDocumentElement(popper);
512
-
513
- if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {
514
- heightProp = 'scrollHeight';
515
- widthProp = 'scrollWidth';
516
- }
517
- } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
518
-
519
-
520
- offsetParent = offsetParent;
521
-
522
- if (placement === top || (placement === left || placement === right) && variation === end) {
523
- sideY = bottom;
524
- var offsetY = isFixed && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
525
- offsetParent[heightProp];
526
- y -= offsetY - popperRect.height;
527
- y *= gpuAcceleration ? 1 : -1;
528
- }
529
-
530
- if (placement === left || (placement === top || placement === bottom) && variation === end) {
531
- sideX = right;
532
- var offsetX = isFixed && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
533
- offsetParent[widthProp];
534
- x -= offsetX - popperRect.width;
535
- x *= gpuAcceleration ? 1 : -1;
536
- }
537
- }
538
-
539
- var commonStyles = Object.assign({
540
- position: position
541
- }, adaptive && unsetSides);
542
-
543
- if (gpuAcceleration) {
544
- var _Object$assign;
545
-
546
- return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
547
- }
548
-
549
- return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
550
- }
551
-
552
- function computeStyles(_ref4) {
553
- var state = _ref4.state,
554
- options = _ref4.options;
555
- var _options$gpuAccelerat = options.gpuAcceleration,
556
- gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
557
- _options$adaptive = options.adaptive,
558
- adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
559
- _options$roundOffsets = options.roundOffsets,
560
- roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
561
-
562
- var commonStyles = {
563
- placement: getBasePlacement(state.placement),
564
- variation: getVariation(state.placement),
565
- popper: state.elements.popper,
566
- popperRect: state.rects.popper,
567
- gpuAcceleration: gpuAcceleration,
568
- isFixed: state.options.strategy === 'fixed'
569
- };
570
-
571
- if (state.modifiersData.popperOffsets != null) {
572
- state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
573
- offsets: state.modifiersData.popperOffsets,
574
- position: state.options.strategy,
575
- adaptive: adaptive,
576
- roundOffsets: roundOffsets
577
- })));
578
- }
579
-
580
- if (state.modifiersData.arrow != null) {
581
- state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
582
- offsets: state.modifiersData.arrow,
583
- position: 'absolute',
584
- adaptive: false,
585
- roundOffsets: roundOffsets
586
- })));
587
- }
588
-
589
- state.attributes.popper = Object.assign({}, state.attributes.popper, {
590
- 'data-popper-placement': state.placement
591
- });
592
- } // eslint-disable-next-line import/no-unused-modules
593
-
594
-
595
- var computeStyles$1 = {
596
- name: 'computeStyles',
597
- enabled: true,
598
- phase: 'beforeWrite',
599
- fn: computeStyles,
600
- data: {}
601
- };
602
-
603
- var passive = {
604
- passive: true
605
- };
606
-
607
- function effect$2(_ref) {
608
- var state = _ref.state,
609
- instance = _ref.instance,
610
- options = _ref.options;
611
- var _options$scroll = options.scroll,
612
- scroll = _options$scroll === void 0 ? true : _options$scroll,
613
- _options$resize = options.resize,
614
- resize = _options$resize === void 0 ? true : _options$resize;
615
- var window = getWindow(state.elements.popper);
616
- var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
617
-
618
- if (scroll) {
619
- scrollParents.forEach(function (scrollParent) {
620
- scrollParent.addEventListener('scroll', instance.update, passive);
621
- });
622
- }
623
-
624
- if (resize) {
625
- window.addEventListener('resize', instance.update, passive);
626
- }
627
-
628
- return function () {
629
- if (scroll) {
630
- scrollParents.forEach(function (scrollParent) {
631
- scrollParent.removeEventListener('scroll', instance.update, passive);
632
- });
633
- }
634
-
635
- if (resize) {
636
- window.removeEventListener('resize', instance.update, passive);
637
- }
638
- };
639
- } // eslint-disable-next-line import/no-unused-modules
640
-
641
-
642
- var eventListeners = {
643
- name: 'eventListeners',
644
- enabled: true,
645
- phase: 'write',
646
- fn: function fn() {},
647
- effect: effect$2,
648
- data: {}
649
- };
650
-
651
- var hash = {
652
- left: 'right',
653
- right: 'left',
654
- bottom: 'top',
655
- top: 'bottom'
656
- };
657
- function getOppositePlacement(placement) {
658
- return placement.replace(/left|right|bottom|top/g, function (matched) {
659
- return hash[matched];
660
- });
661
- }
662
-
663
- var hash$1 = {
664
- start: 'end',
665
- end: 'start'
666
- };
667
- function getOppositeVariationPlacement(placement) {
668
- return placement.replace(/start|end/g, function (matched) {
669
- return hash$1[matched];
670
- });
671
- }
672
-
673
- function getWindowScroll(node) {
674
- var win = getWindow(node);
675
- var scrollLeft = win.pageXOffset;
676
- var scrollTop = win.pageYOffset;
677
- return {
678
- scrollLeft: scrollLeft,
679
- scrollTop: scrollTop
680
- };
681
- }
682
-
683
- function getWindowScrollBarX(element) {
684
- // If <html> has a CSS width greater than the viewport, then this will be
685
- // incorrect for RTL.
686
- // Popper 1 is broken in this case and never had a bug report so let's assume
687
- // it's not an issue. I don't think anyone ever specifies width on <html>
688
- // anyway.
689
- // Browsers where the left scrollbar doesn't cause an issue report `0` for
690
- // this (e.g. Edge 2019, IE11, Safari)
691
- return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
692
- }
693
-
694
- function getViewportRect(element) {
695
- var win = getWindow(element);
696
- var html = getDocumentElement(element);
697
- var visualViewport = win.visualViewport;
698
- var width = html.clientWidth;
699
- var height = html.clientHeight;
700
- var x = 0;
701
- var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper
702
- // can be obscured underneath it.
703
- // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even
704
- // if it isn't open, so if this isn't available, the popper will be detected
705
- // to overflow the bottom of the screen too early.
706
-
707
- if (visualViewport) {
708
- width = visualViewport.width;
709
- height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently)
710
- // In Chrome, it returns a value very close to 0 (+/-) but contains rounding
711
- // errors due to floating point numbers, so we need to check precision.
712
- // Safari returns a number <= 0, usually < -1 when pinch-zoomed
713
- // Feature detection fails in mobile emulation mode in Chrome.
714
- // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) <
715
- // 0.001
716
- // Fallback here: "Not Safari" userAgent
717
-
718
- if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
719
- x = visualViewport.offsetLeft;
720
- y = visualViewport.offsetTop;
721
- }
722
- }
723
-
724
- return {
725
- width: width,
726
- height: height,
727
- x: x + getWindowScrollBarX(element),
728
- y: y
729
- };
730
- }
731
-
732
- // of the `<html>` and `<body>` rect bounds if horizontally scrollable
733
-
734
- function getDocumentRect(element) {
735
- var _element$ownerDocumen;
736
-
737
- var html = getDocumentElement(element);
738
- var winScroll = getWindowScroll(element);
739
- var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
740
- var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
741
- var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
742
- var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
743
- var y = -winScroll.scrollTop;
744
-
745
- if (getComputedStyle(body || html).direction === 'rtl') {
746
- x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
747
- }
748
-
749
- return {
750
- width: width,
751
- height: height,
752
- x: x,
753
- y: y
754
- };
755
- }
756
-
757
- function isScrollParent(element) {
758
- // Firefox wants us to check `-x` and `-y` variations as well
759
- var _getComputedStyle = getComputedStyle(element),
760
- overflow = _getComputedStyle.overflow,
761
- overflowX = _getComputedStyle.overflowX,
762
- overflowY = _getComputedStyle.overflowY;
763
-
764
- return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
765
- }
766
-
767
- function getScrollParent(node) {
768
- if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
769
- // $FlowFixMe[incompatible-return]: assume body is always available
770
- return node.ownerDocument.body;
771
- }
772
-
773
- if (isHTMLElement(node) && isScrollParent(node)) {
774
- return node;
775
- }
776
-
777
- return getScrollParent(getParentNode(node));
778
- }
779
-
780
- /*
781
- given a DOM element, return the list of all scroll parents, up the list of ancesors
782
- until we get to the top window object. This list is what we attach scroll listeners
783
- to, because if any of these parent elements scroll, we'll need to re-calculate the
784
- reference element's position.
785
- */
786
-
787
- function listScrollParents(element, list) {
788
- var _element$ownerDocumen;
789
-
790
- if (list === void 0) {
791
- list = [];
792
- }
793
-
794
- var scrollParent = getScrollParent(element);
795
- var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
796
- var win = getWindow(scrollParent);
797
- var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
798
- var updatedList = list.concat(target);
799
- return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
800
- updatedList.concat(listScrollParents(getParentNode(target)));
801
- }
802
-
803
- function rectToClientRect(rect) {
804
- return Object.assign({}, rect, {
805
- left: rect.x,
806
- top: rect.y,
807
- right: rect.x + rect.width,
808
- bottom: rect.y + rect.height
809
- });
810
- }
811
-
812
- function getInnerBoundingClientRect(element) {
813
- var rect = getBoundingClientRect(element);
814
- rect.top = rect.top + element.clientTop;
815
- rect.left = rect.left + element.clientLeft;
816
- rect.bottom = rect.top + element.clientHeight;
817
- rect.right = rect.left + element.clientWidth;
818
- rect.width = element.clientWidth;
819
- rect.height = element.clientHeight;
820
- rect.x = rect.left;
821
- rect.y = rect.top;
822
- return rect;
823
- }
824
-
825
- function getClientRectFromMixedType(element, clippingParent) {
826
- return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
827
- } // A "clipping parent" is an overflowable container with the characteristic of
828
- // clipping (or hiding) overflowing elements with a position different from
829
- // `initial`
830
-
831
-
832
- function getClippingParents(element) {
833
- var clippingParents = listScrollParents(getParentNode(element));
834
- var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;
835
- var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
836
-
837
- if (!isElement(clipperElement)) {
838
- return [];
839
- } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414
840
-
841
-
842
- return clippingParents.filter(function (clippingParent) {
843
- return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body' && (canEscapeClipping ? getComputedStyle(clippingParent).position !== 'static' : true);
844
- });
845
- } // Gets the maximum area that the element is visible in due to any number of
846
- // clipping parents
847
-
848
-
849
- function getClippingRect(element, boundary, rootBoundary) {
850
- var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
851
- var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
852
- var firstClippingParent = clippingParents[0];
853
- var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
854
- var rect = getClientRectFromMixedType(element, clippingParent);
855
- accRect.top = max(rect.top, accRect.top);
856
- accRect.right = min(rect.right, accRect.right);
857
- accRect.bottom = min(rect.bottom, accRect.bottom);
858
- accRect.left = max(rect.left, accRect.left);
859
- return accRect;
860
- }, getClientRectFromMixedType(element, firstClippingParent));
861
- clippingRect.width = clippingRect.right - clippingRect.left;
862
- clippingRect.height = clippingRect.bottom - clippingRect.top;
863
- clippingRect.x = clippingRect.left;
864
- clippingRect.y = clippingRect.top;
865
- return clippingRect;
866
- }
867
-
868
- function computeOffsets(_ref) {
869
- var reference = _ref.reference,
870
- element = _ref.element,
871
- placement = _ref.placement;
872
- var basePlacement = placement ? getBasePlacement(placement) : null;
873
- var variation = placement ? getVariation(placement) : null;
874
- var commonX = reference.x + reference.width / 2 - element.width / 2;
875
- var commonY = reference.y + reference.height / 2 - element.height / 2;
876
- var offsets;
877
-
878
- switch (basePlacement) {
879
- case top:
880
- offsets = {
881
- x: commonX,
882
- y: reference.y - element.height
883
- };
884
- break;
885
-
886
- case bottom:
887
- offsets = {
888
- x: commonX,
889
- y: reference.y + reference.height
890
- };
891
- break;
892
-
893
- case right:
894
- offsets = {
895
- x: reference.x + reference.width,
896
- y: commonY
897
- };
898
- break;
899
-
900
- case left:
901
- offsets = {
902
- x: reference.x - element.width,
903
- y: commonY
904
- };
905
- break;
906
-
907
- default:
908
- offsets = {
909
- x: reference.x,
910
- y: reference.y
911
- };
912
- }
913
-
914
- var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
915
-
916
- if (mainAxis != null) {
917
- var len = mainAxis === 'y' ? 'height' : 'width';
918
-
919
- switch (variation) {
920
- case start:
921
- offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
922
- break;
923
-
924
- case end:
925
- offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
926
- break;
927
- }
928
- }
929
-
930
- return offsets;
931
- }
932
-
933
- function detectOverflow(state, options) {
934
- if (options === void 0) {
935
- options = {};
936
- }
937
-
938
- var _options = options,
939
- _options$placement = _options.placement,
940
- placement = _options$placement === void 0 ? state.placement : _options$placement,
941
- _options$boundary = _options.boundary,
942
- boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,
943
- _options$rootBoundary = _options.rootBoundary,
944
- rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,
945
- _options$elementConte = _options.elementContext,
946
- elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,
947
- _options$altBoundary = _options.altBoundary,
948
- altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,
949
- _options$padding = _options.padding,
950
- padding = _options$padding === void 0 ? 0 : _options$padding;
951
- var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
952
- var altContext = elementContext === popper ? reference : popper;
953
- var popperRect = state.rects.popper;
954
- var element = state.elements[altBoundary ? altContext : elementContext];
955
- var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);
956
- var referenceClientRect = getBoundingClientRect(state.elements.reference);
957
- var popperOffsets = computeOffsets({
958
- reference: referenceClientRect,
959
- element: popperRect,
960
- strategy: 'absolute',
961
- placement: placement
962
- });
963
- var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));
964
- var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
965
- // 0 or negative = within the clipping rect
966
-
967
- var overflowOffsets = {
968
- top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
969
- bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
970
- left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
971
- right: elementClientRect.right - clippingClientRect.right + paddingObject.right
972
- };
973
- var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element
974
-
975
- if (elementContext === popper && offsetData) {
976
- var offset = offsetData[placement];
977
- Object.keys(overflowOffsets).forEach(function (key) {
978
- var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
979
- var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';
980
- overflowOffsets[key] += offset[axis] * multiply;
981
- });
982
- }
983
-
984
- return overflowOffsets;
985
- }
986
-
987
- function computeAutoPlacement(state, options) {
988
- if (options === void 0) {
989
- options = {};
990
- }
991
-
992
- var _options = options,
993
- placement = _options.placement,
994
- boundary = _options.boundary,
995
- rootBoundary = _options.rootBoundary,
996
- padding = _options.padding,
997
- flipVariations = _options.flipVariations,
998
- _options$allowedAutoP = _options.allowedAutoPlacements,
999
- allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
1000
- var variation = getVariation(placement);
1001
- var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {
1002
- return getVariation(placement) === variation;
1003
- }) : basePlacements;
1004
- var allowedPlacements = placements$1.filter(function (placement) {
1005
- return allowedAutoPlacements.indexOf(placement) >= 0;
1006
- });
1007
-
1008
- if (allowedPlacements.length === 0) {
1009
- allowedPlacements = placements$1;
1010
- } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
1011
-
1012
-
1013
- var overflows = allowedPlacements.reduce(function (acc, placement) {
1014
- acc[placement] = detectOverflow(state, {
1015
- placement: placement,
1016
- boundary: boundary,
1017
- rootBoundary: rootBoundary,
1018
- padding: padding
1019
- })[getBasePlacement(placement)];
1020
- return acc;
1021
- }, {});
1022
- return Object.keys(overflows).sort(function (a, b) {
1023
- return overflows[a] - overflows[b];
1024
- });
1025
- }
1026
-
1027
- function getExpandedFallbackPlacements(placement) {
1028
- if (getBasePlacement(placement) === auto) {
1029
- return [];
1030
- }
1031
-
1032
- var oppositePlacement = getOppositePlacement(placement);
1033
- return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
1034
- }
1035
-
1036
- function flip(_ref) {
1037
- var state = _ref.state,
1038
- options = _ref.options,
1039
- name = _ref.name;
1040
-
1041
- if (state.modifiersData[name]._skip) {
1042
- return;
1043
- }
1044
-
1045
- var _options$mainAxis = options.mainAxis,
1046
- checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
1047
- _options$altAxis = options.altAxis,
1048
- checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,
1049
- specifiedFallbackPlacements = options.fallbackPlacements,
1050
- padding = options.padding,
1051
- boundary = options.boundary,
1052
- rootBoundary = options.rootBoundary,
1053
- altBoundary = options.altBoundary,
1054
- _options$flipVariatio = options.flipVariations,
1055
- flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,
1056
- allowedAutoPlacements = options.allowedAutoPlacements;
1057
- var preferredPlacement = state.options.placement;
1058
- var basePlacement = getBasePlacement(preferredPlacement);
1059
- var isBasePlacement = basePlacement === preferredPlacement;
1060
- var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
1061
- var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {
1062
- return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {
1063
- placement: placement,
1064
- boundary: boundary,
1065
- rootBoundary: rootBoundary,
1066
- padding: padding,
1067
- flipVariations: flipVariations,
1068
- allowedAutoPlacements: allowedAutoPlacements
1069
- }) : placement);
1070
- }, []);
1071
- var referenceRect = state.rects.reference;
1072
- var popperRect = state.rects.popper;
1073
- var checksMap = new Map();
1074
- var makeFallbackChecks = true;
1075
- var firstFittingPlacement = placements[0];
1076
-
1077
- for (var i = 0; i < placements.length; i++) {
1078
- var placement = placements[i];
1079
-
1080
- var _basePlacement = getBasePlacement(placement);
1081
-
1082
- var isStartVariation = getVariation(placement) === start;
1083
- var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
1084
- var len = isVertical ? 'width' : 'height';
1085
- var overflow = detectOverflow(state, {
1086
- placement: placement,
1087
- boundary: boundary,
1088
- rootBoundary: rootBoundary,
1089
- altBoundary: altBoundary,
1090
- padding: padding
1091
- });
1092
- var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
1093
-
1094
- if (referenceRect[len] > popperRect[len]) {
1095
- mainVariationSide = getOppositePlacement(mainVariationSide);
1096
- }
1097
-
1098
- var altVariationSide = getOppositePlacement(mainVariationSide);
1099
- var checks = [];
1100
-
1101
- if (checkMainAxis) {
1102
- checks.push(overflow[_basePlacement] <= 0);
1103
- }
1104
-
1105
- if (checkAltAxis) {
1106
- checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
1107
- }
1108
-
1109
- if (checks.every(function (check) {
1110
- return check;
1111
- })) {
1112
- firstFittingPlacement = placement;
1113
- makeFallbackChecks = false;
1114
- break;
1115
- }
1116
-
1117
- checksMap.set(placement, checks);
1118
- }
1119
-
1120
- if (makeFallbackChecks) {
1121
- // `2` may be desired in some cases – research later
1122
- var numberOfChecks = flipVariations ? 3 : 1;
1123
-
1124
- var _loop = function _loop(_i) {
1125
- var fittingPlacement = placements.find(function (placement) {
1126
- var checks = checksMap.get(placement);
1127
-
1128
- if (checks) {
1129
- return checks.slice(0, _i).every(function (check) {
1130
- return check;
1131
- });
1132
- }
1133
- });
1134
-
1135
- if (fittingPlacement) {
1136
- firstFittingPlacement = fittingPlacement;
1137
- return "break";
1138
- }
1139
- };
1140
-
1141
- for (var _i = numberOfChecks; _i > 0; _i--) {
1142
- var _ret = _loop(_i);
1143
-
1144
- if (_ret === "break") break;
1145
- }
1146
- }
1147
-
1148
- if (state.placement !== firstFittingPlacement) {
1149
- state.modifiersData[name]._skip = true;
1150
- state.placement = firstFittingPlacement;
1151
- state.reset = true;
1152
- }
1153
- } // eslint-disable-next-line import/no-unused-modules
1154
-
1155
-
1156
- var flip$1 = {
1157
- name: 'flip',
1158
- enabled: true,
1159
- phase: 'main',
1160
- fn: flip,
1161
- requiresIfExists: ['offset'],
1162
- data: {
1163
- _skip: false
1164
- }
1165
- };
1166
-
1167
- function getSideOffsets(overflow, rect, preventedOffsets) {
1168
- if (preventedOffsets === void 0) {
1169
- preventedOffsets = {
1170
- x: 0,
1171
- y: 0
1172
- };
1173
- }
1174
-
1175
- return {
1176
- top: overflow.top - rect.height - preventedOffsets.y,
1177
- right: overflow.right - rect.width + preventedOffsets.x,
1178
- bottom: overflow.bottom - rect.height + preventedOffsets.y,
1179
- left: overflow.left - rect.width - preventedOffsets.x
1180
- };
1181
- }
1182
-
1183
- function isAnySideFullyClipped(overflow) {
1184
- return [top, right, bottom, left].some(function (side) {
1185
- return overflow[side] >= 0;
1186
- });
1187
- }
1188
-
1189
- function hide(_ref) {
1190
- var state = _ref.state,
1191
- name = _ref.name;
1192
- var referenceRect = state.rects.reference;
1193
- var popperRect = state.rects.popper;
1194
- var preventedOffsets = state.modifiersData.preventOverflow;
1195
- var referenceOverflow = detectOverflow(state, {
1196
- elementContext: 'reference'
1197
- });
1198
- var popperAltOverflow = detectOverflow(state, {
1199
- altBoundary: true
1200
- });
1201
- var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
1202
- var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
1203
- var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
1204
- var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
1205
- state.modifiersData[name] = {
1206
- referenceClippingOffsets: referenceClippingOffsets,
1207
- popperEscapeOffsets: popperEscapeOffsets,
1208
- isReferenceHidden: isReferenceHidden,
1209
- hasPopperEscaped: hasPopperEscaped
1210
- };
1211
- state.attributes.popper = Object.assign({}, state.attributes.popper, {
1212
- 'data-popper-reference-hidden': isReferenceHidden,
1213
- 'data-popper-escaped': hasPopperEscaped
1214
- });
1215
- } // eslint-disable-next-line import/no-unused-modules
1216
-
1217
-
1218
- var hide$1 = {
1219
- name: 'hide',
1220
- enabled: true,
1221
- phase: 'main',
1222
- requiresIfExists: ['preventOverflow'],
1223
- fn: hide
1224
- };
1225
-
1226
- function distanceAndSkiddingToXY(placement, rects, offset) {
1227
- var basePlacement = getBasePlacement(placement);
1228
- var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
1229
-
1230
- var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {
1231
- placement: placement
1232
- })) : offset,
1233
- skidding = _ref[0],
1234
- distance = _ref[1];
1235
-
1236
- skidding = skidding || 0;
1237
- distance = (distance || 0) * invertDistance;
1238
- return [left, right].indexOf(basePlacement) >= 0 ? {
1239
- x: distance,
1240
- y: skidding
1241
- } : {
1242
- x: skidding,
1243
- y: distance
1244
- };
1245
- }
1246
-
1247
- function offset(_ref2) {
1248
- var state = _ref2.state,
1249
- options = _ref2.options,
1250
- name = _ref2.name;
1251
- var _options$offset = options.offset,
1252
- offset = _options$offset === void 0 ? [0, 0] : _options$offset;
1253
- var data = placements.reduce(function (acc, placement) {
1254
- acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);
1255
- return acc;
1256
- }, {});
1257
- var _data$state$placement = data[state.placement],
1258
- x = _data$state$placement.x,
1259
- y = _data$state$placement.y;
1260
-
1261
- if (state.modifiersData.popperOffsets != null) {
1262
- state.modifiersData.popperOffsets.x += x;
1263
- state.modifiersData.popperOffsets.y += y;
1264
- }
1265
-
1266
- state.modifiersData[name] = data;
1267
- } // eslint-disable-next-line import/no-unused-modules
1268
-
1269
-
1270
- var offset$1 = {
1271
- name: 'offset',
1272
- enabled: true,
1273
- phase: 'main',
1274
- requires: ['popperOffsets'],
1275
- fn: offset
1276
- };
1277
-
1278
- function popperOffsets(_ref) {
1279
- var state = _ref.state,
1280
- name = _ref.name;
1281
- // Offsets are the actual position the popper needs to have to be
1282
- // properly positioned near its reference element
1283
- // This is the most basic placement, and will be adjusted by
1284
- // the modifiers in the next step
1285
- state.modifiersData[name] = computeOffsets({
1286
- reference: state.rects.reference,
1287
- element: state.rects.popper,
1288
- strategy: 'absolute',
1289
- placement: state.placement
1290
- });
1291
- } // eslint-disable-next-line import/no-unused-modules
1292
-
1293
-
1294
- var popperOffsets$1 = {
1295
- name: 'popperOffsets',
1296
- enabled: true,
1297
- phase: 'read',
1298
- fn: popperOffsets,
1299
- data: {}
1300
- };
1301
-
1302
- function getAltAxis(axis) {
1303
- return axis === 'x' ? 'y' : 'x';
1304
- }
1305
-
1306
- function preventOverflow(_ref) {
1307
- var state = _ref.state,
1308
- options = _ref.options,
1309
- name = _ref.name;
1310
- var _options$mainAxis = options.mainAxis,
1311
- checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
1312
- _options$altAxis = options.altAxis,
1313
- checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,
1314
- boundary = options.boundary,
1315
- rootBoundary = options.rootBoundary,
1316
- altBoundary = options.altBoundary,
1317
- padding = options.padding,
1318
- _options$tether = options.tether,
1319
- tether = _options$tether === void 0 ? true : _options$tether,
1320
- _options$tetherOffset = options.tetherOffset,
1321
- tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
1322
- var overflow = detectOverflow(state, {
1323
- boundary: boundary,
1324
- rootBoundary: rootBoundary,
1325
- padding: padding,
1326
- altBoundary: altBoundary
1327
- });
1328
- var basePlacement = getBasePlacement(state.placement);
1329
- var variation = getVariation(state.placement);
1330
- var isBasePlacement = !variation;
1331
- var mainAxis = getMainAxisFromPlacement(basePlacement);
1332
- var altAxis = getAltAxis(mainAxis);
1333
- var popperOffsets = state.modifiersData.popperOffsets;
1334
- var referenceRect = state.rects.reference;
1335
- var popperRect = state.rects.popper;
1336
- var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
1337
- placement: state.placement
1338
- })) : tetherOffset;
1339
- var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {
1340
- mainAxis: tetherOffsetValue,
1341
- altAxis: tetherOffsetValue
1342
- } : Object.assign({
1343
- mainAxis: 0,
1344
- altAxis: 0
1345
- }, tetherOffsetValue);
1346
- var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
1347
- var data = {
1348
- x: 0,
1349
- y: 0
1350
- };
1351
-
1352
- if (!popperOffsets) {
1353
- return;
1354
- }
1355
-
1356
- if (checkMainAxis) {
1357
- var _offsetModifierState$;
1358
-
1359
- var mainSide = mainAxis === 'y' ? top : left;
1360
- var altSide = mainAxis === 'y' ? bottom : right;
1361
- var len = mainAxis === 'y' ? 'height' : 'width';
1362
- var offset = popperOffsets[mainAxis];
1363
- var min$1 = offset + overflow[mainSide];
1364
- var max$1 = offset - overflow[altSide];
1365
- var additive = tether ? -popperRect[len] / 2 : 0;
1366
- var minLen = variation === start ? referenceRect[len] : popperRect[len];
1367
- var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
1368
- // outside the reference bounds
1369
-
1370
- var arrowElement = state.elements.arrow;
1371
- var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
1372
- width: 0,
1373
- height: 0
1374
- };
1375
- var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();
1376
- var arrowPaddingMin = arrowPaddingObject[mainSide];
1377
- var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want
1378
- // to include its full size in the calculation. If the reference is small
1379
- // and near the edge of a boundary, the popper can overflow even if the
1380
- // reference is not overflowing as well (e.g. virtual elements with no
1381
- // width or height)
1382
-
1383
- var arrowLen = within(0, referenceRect[len], arrowRect[len]);
1384
- var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
1385
- var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
1386
- var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
1387
- var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
1388
- var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
1389
- var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
1390
- var tetherMax = offset + maxOffset - offsetModifierValue;
1391
- var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
1392
- popperOffsets[mainAxis] = preventedOffset;
1393
- data[mainAxis] = preventedOffset - offset;
1394
- }
1395
-
1396
- if (checkAltAxis) {
1397
- var _offsetModifierState$2;
1398
-
1399
- var _mainSide = mainAxis === 'x' ? top : left;
1400
-
1401
- var _altSide = mainAxis === 'x' ? bottom : right;
1402
-
1403
- var _offset = popperOffsets[altAxis];
1404
-
1405
- var _len = altAxis === 'y' ? 'height' : 'width';
1406
-
1407
- var _min = _offset + overflow[_mainSide];
1408
-
1409
- var _max = _offset - overflow[_altSide];
1410
-
1411
- var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
1412
-
1413
- var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
1414
-
1415
- var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
1416
-
1417
- var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
1418
-
1419
- var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
1420
-
1421
- popperOffsets[altAxis] = _preventedOffset;
1422
- data[altAxis] = _preventedOffset - _offset;
1423
- }
1424
-
1425
- state.modifiersData[name] = data;
1426
- } // eslint-disable-next-line import/no-unused-modules
1427
-
1428
-
1429
- var preventOverflow$1 = {
1430
- name: 'preventOverflow',
1431
- enabled: true,
1432
- phase: 'main',
1433
- fn: preventOverflow,
1434
- requiresIfExists: ['offset']
1435
- };
1436
-
1437
- function getHTMLElementScroll(element) {
1438
- return {
1439
- scrollLeft: element.scrollLeft,
1440
- scrollTop: element.scrollTop
1441
- };
1442
- }
1443
-
1444
- function getNodeScroll(node) {
1445
- if (node === getWindow(node) || !isHTMLElement(node)) {
1446
- return getWindowScroll(node);
1447
- } else {
1448
- return getHTMLElementScroll(node);
1449
- }
1450
- }
1451
-
1452
- function isElementScaled(element) {
1453
- var rect = element.getBoundingClientRect();
1454
- var scaleX = round(rect.width) / element.offsetWidth || 1;
1455
- var scaleY = round(rect.height) / element.offsetHeight || 1;
1456
- return scaleX !== 1 || scaleY !== 1;
1457
- } // Returns the composite rect of an element relative to its offsetParent.
1458
- // Composite means it takes into account transforms as well as layout.
1459
-
1460
-
1461
- function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
1462
- if (isFixed === void 0) {
1463
- isFixed = false;
1464
- }
1465
-
1466
- var isOffsetParentAnElement = isHTMLElement(offsetParent);
1467
- var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
1468
- var documentElement = getDocumentElement(offsetParent);
1469
- var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);
1470
- var scroll = {
1471
- scrollLeft: 0,
1472
- scrollTop: 0
1473
- };
1474
- var offsets = {
1475
- x: 0,
1476
- y: 0
1477
- };
1478
-
1479
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1480
- if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078
1481
- isScrollParent(documentElement)) {
1482
- scroll = getNodeScroll(offsetParent);
1483
- }
1484
-
1485
- if (isHTMLElement(offsetParent)) {
1486
- offsets = getBoundingClientRect(offsetParent, true);
1487
- offsets.x += offsetParent.clientLeft;
1488
- offsets.y += offsetParent.clientTop;
1489
- } else if (documentElement) {
1490
- offsets.x = getWindowScrollBarX(documentElement);
1491
- }
1492
- }
1493
-
1494
- return {
1495
- x: rect.left + scroll.scrollLeft - offsets.x,
1496
- y: rect.top + scroll.scrollTop - offsets.y,
1497
- width: rect.width,
1498
- height: rect.height
1499
- };
1500
- }
1501
-
1502
- function order(modifiers) {
1503
- var map = new Map();
1504
- var visited = new Set();
1505
- var result = [];
1506
- modifiers.forEach(function (modifier) {
1507
- map.set(modifier.name, modifier);
1508
- }); // On visiting object, check for its dependencies and visit them recursively
1509
-
1510
- function sort(modifier) {
1511
- visited.add(modifier.name);
1512
- var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
1513
- requires.forEach(function (dep) {
1514
- if (!visited.has(dep)) {
1515
- var depModifier = map.get(dep);
1516
-
1517
- if (depModifier) {
1518
- sort(depModifier);
1519
- }
1520
- }
1521
- });
1522
- result.push(modifier);
1523
- }
1524
-
1525
- modifiers.forEach(function (modifier) {
1526
- if (!visited.has(modifier.name)) {
1527
- // check for visited object
1528
- sort(modifier);
1529
- }
1530
- });
1531
- return result;
1532
- }
1533
-
1534
- function orderModifiers(modifiers) {
1535
- // order based on dependencies
1536
- var orderedModifiers = order(modifiers); // order based on phase
1537
-
1538
- return modifierPhases.reduce(function (acc, phase) {
1539
- return acc.concat(orderedModifiers.filter(function (modifier) {
1540
- return modifier.phase === phase;
1541
- }));
1542
- }, []);
1543
- }
1544
-
1545
- function debounce(fn) {
1546
- var pending;
1547
- return function () {
1548
- if (!pending) {
1549
- pending = new Promise(function (resolve) {
1550
- Promise.resolve().then(function () {
1551
- pending = undefined;
1552
- resolve(fn());
1553
- });
1554
- });
1555
- }
1556
-
1557
- return pending;
1558
- };
1559
- }
1560
-
1561
- function mergeByName(modifiers) {
1562
- var merged = modifiers.reduce(function (merged, current) {
1563
- var existing = merged[current.name];
1564
- merged[current.name] = existing ? Object.assign({}, existing, current, {
1565
- options: Object.assign({}, existing.options, current.options),
1566
- data: Object.assign({}, existing.data, current.data)
1567
- }) : current;
1568
- return merged;
1569
- }, {}); // IE11 does not support Object.values
1570
-
1571
- return Object.keys(merged).map(function (key) {
1572
- return merged[key];
1573
- });
1574
- }
1575
-
1576
- var DEFAULT_OPTIONS = {
1577
- placement: 'bottom',
1578
- modifiers: [],
1579
- strategy: 'absolute'
1580
- };
1581
-
1582
- function areValidElements() {
1583
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1584
- args[_key] = arguments[_key];
1585
- }
1586
-
1587
- return !args.some(function (element) {
1588
- return !(element && typeof element.getBoundingClientRect === 'function');
1589
- });
1590
- }
1591
-
1592
- function popperGenerator(generatorOptions) {
1593
- if (generatorOptions === void 0) {
1594
- generatorOptions = {};
1595
- }
1596
-
1597
- var _generatorOptions = generatorOptions,
1598
- _generatorOptions$def = _generatorOptions.defaultModifiers,
1599
- defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,
1600
- _generatorOptions$def2 = _generatorOptions.defaultOptions,
1601
- defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
1602
- return function createPopper(reference, popper, options) {
1603
- if (options === void 0) {
1604
- options = defaultOptions;
1605
- }
1606
-
1607
- var state = {
1608
- placement: 'bottom',
1609
- orderedModifiers: [],
1610
- options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
1611
- modifiersData: {},
1612
- elements: {
1613
- reference: reference,
1614
- popper: popper
1615
- },
1616
- attributes: {},
1617
- styles: {}
1618
- };
1619
- var effectCleanupFns = [];
1620
- var isDestroyed = false;
1621
- var instance = {
1622
- state: state,
1623
- setOptions: function setOptions(setOptionsAction) {
1624
- var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;
1625
- cleanupModifierEffects();
1626
- state.options = Object.assign({}, defaultOptions, state.options, options);
1627
- state.scrollParents = {
1628
- reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
1629
- popper: listScrollParents(popper)
1630
- }; // Orders the modifiers based on their dependencies and `phase`
1631
- // properties
1632
-
1633
- var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers
1634
-
1635
- state.orderedModifiers = orderedModifiers.filter(function (m) {
1636
- return m.enabled;
1637
- }); // Validate the provided modifiers so that the consumer will get warned
1638
-
1639
- runModifierEffects();
1640
- return instance.update();
1641
- },
1642
- // Sync update – it will always be executed, even if not necessary. This
1643
- // is useful for low frequency updates where sync behavior simplifies the
1644
- // logic.
1645
- // For high frequency updates (e.g. `resize` and `scroll` events), always
1646
- // prefer the async Popper#update method
1647
- forceUpdate: function forceUpdate() {
1648
- if (isDestroyed) {
1649
- return;
1650
- }
1651
-
1652
- var _state$elements = state.elements,
1653
- reference = _state$elements.reference,
1654
- popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements
1655
- // anymore
1656
-
1657
- if (!areValidElements(reference, popper)) {
1658
-
1659
- return;
1660
- } // Store the reference and popper rects to be read by modifiers
1661
-
1662
-
1663
- state.rects = {
1664
- reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),
1665
- popper: getLayoutRect(popper)
1666
- }; // Modifiers have the ability to reset the current update cycle. The
1667
- // most common use case for this is the `flip` modifier changing the
1668
- // placement, which then needs to re-run all the modifiers, because the
1669
- // logic was previously ran for the previous placement and is therefore
1670
- // stale/incorrect
1671
-
1672
- state.reset = false;
1673
- state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier
1674
- // is filled with the initial data specified by the modifier. This means
1675
- // it doesn't persist and is fresh on each update.
1676
- // To ensure persistent data, use `${name}#persistent`
1677
-
1678
- state.orderedModifiers.forEach(function (modifier) {
1679
- return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
1680
- });
1681
-
1682
- for (var index = 0; index < state.orderedModifiers.length; index++) {
1683
-
1684
- if (state.reset === true) {
1685
- state.reset = false;
1686
- index = -1;
1687
- continue;
1688
- }
1689
-
1690
- var _state$orderedModifie = state.orderedModifiers[index],
1691
- fn = _state$orderedModifie.fn,
1692
- _state$orderedModifie2 = _state$orderedModifie.options,
1693
- _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
1694
- name = _state$orderedModifie.name;
1695
-
1696
- if (typeof fn === 'function') {
1697
- state = fn({
1698
- state: state,
1699
- options: _options,
1700
- name: name,
1701
- instance: instance
1702
- }) || state;
1703
- }
1704
- }
1705
- },
1706
- // Async and optimistically optimized update – it will not be executed if
1707
- // not necessary (debounced to run at most once-per-tick)
1708
- update: debounce(function () {
1709
- return new Promise(function (resolve) {
1710
- instance.forceUpdate();
1711
- resolve(state);
1712
- });
1713
- }),
1714
- destroy: function destroy() {
1715
- cleanupModifierEffects();
1716
- isDestroyed = true;
1717
- }
1718
- };
1719
-
1720
- if (!areValidElements(reference, popper)) {
1721
-
1722
- return instance;
1723
- }
1724
-
1725
- instance.setOptions(options).then(function (state) {
1726
- if (!isDestroyed && options.onFirstUpdate) {
1727
- options.onFirstUpdate(state);
1728
- }
1729
- }); // Modifiers have the ability to execute arbitrary code before the first
1730
- // update cycle runs. They will be executed in the same order as the update
1731
- // cycle. This is useful when a modifier adds some persistent data that
1732
- // other modifiers need to use, but the modifier is run after the dependent
1733
- // one.
1734
-
1735
- function runModifierEffects() {
1736
- state.orderedModifiers.forEach(function (_ref3) {
1737
- var name = _ref3.name,
1738
- _ref3$options = _ref3.options,
1739
- options = _ref3$options === void 0 ? {} : _ref3$options,
1740
- effect = _ref3.effect;
1741
-
1742
- if (typeof effect === 'function') {
1743
- var cleanupFn = effect({
1744
- state: state,
1745
- name: name,
1746
- instance: instance,
1747
- options: options
1748
- });
1749
-
1750
- var noopFn = function noopFn() {};
1751
-
1752
- effectCleanupFns.push(cleanupFn || noopFn);
1753
- }
1754
- });
1755
- }
1756
-
1757
- function cleanupModifierEffects() {
1758
- effectCleanupFns.forEach(function (fn) {
1759
- return fn();
1760
- });
1761
- effectCleanupFns = [];
1762
- }
1763
-
1764
- return instance;
1765
- };
1766
- }
1767
-
1768
- var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1];
1769
- var createPopper = /*#__PURE__*/popperGenerator({
1770
- defaultModifiers: defaultModifiers
1771
- }); // eslint-disable-next-line import/no-unused-modules
1772
-
1773
- /**!
1774
- * tippy.js v6.3.7
1775
- * (c) 2017-2021 atomiks
1776
- * MIT License
1777
- */
1778
-
1779
- var ROUND_ARROW = '<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>';
1780
- var BOX_CLASS = "tippy-box";
1781
- var CONTENT_CLASS = "tippy-content";
1782
- var BACKDROP_CLASS = "tippy-backdrop";
1783
- var ARROW_CLASS = "tippy-arrow";
1784
- var SVG_ARROW_CLASS = "tippy-svg-arrow";
1785
- var TOUCH_OPTIONS = {
1786
- passive: true,
1787
- capture: true
1788
- };
1789
- var TIPPY_DEFAULT_APPEND_TO = function TIPPY_DEFAULT_APPEND_TO() {
1790
- return document.body;
1791
- };
1792
- function getValueAtIndexOrReturn(value, index, defaultValue) {
1793
- if (Array.isArray(value)) {
1794
- var v = value[index];
1795
- return v == null ? Array.isArray(defaultValue) ? defaultValue[index] : defaultValue : v;
1796
- }
1797
-
1798
- return value;
1799
- }
1800
- function isType(value, type) {
1801
- var str = {}.toString.call(value);
1802
- return str.indexOf('[object') === 0 && str.indexOf(type + "]") > -1;
1803
- }
1804
- function invokeWithArgsOrReturn(value, args) {
1805
- return typeof value === 'function' ? value.apply(void 0, args) : value;
1806
- }
1807
- function debounce$1(fn, ms) {
1808
- // Avoid wrapping in `setTimeout` if ms is 0 anyway
1809
- if (ms === 0) {
1810
- return fn;
1811
- }
1812
-
1813
- var timeout;
1814
- return function (arg) {
1815
- clearTimeout(timeout);
1816
- timeout = setTimeout(function () {
1817
- fn(arg);
1818
- }, ms);
1819
- };
1820
- }
1821
- function removeProperties(obj, keys) {
1822
- var clone = Object.assign({}, obj);
1823
- keys.forEach(function (key) {
1824
- delete clone[key];
1825
- });
1826
- return clone;
1827
- }
1828
- function splitBySpaces(value) {
1829
- return value.split(/\s+/).filter(Boolean);
1830
- }
1831
- function normalizeToArray(value) {
1832
- return [].concat(value);
1833
- }
1834
- function pushIfUnique(arr, value) {
1835
- if (arr.indexOf(value) === -1) {
1836
- arr.push(value);
1837
- }
1838
- }
1839
- function unique(arr) {
1840
- return arr.filter(function (item, index) {
1841
- return arr.indexOf(item) === index;
1842
- });
1843
- }
1844
- function getBasePlacement$1(placement) {
1845
- return placement.split('-')[0];
1846
- }
1847
- function arrayFrom(value) {
1848
- return [].slice.call(value);
1849
- }
1850
- function removeUndefinedProps(obj) {
1851
- return Object.keys(obj).reduce(function (acc, key) {
1852
- if (obj[key] !== undefined) {
1853
- acc[key] = obj[key];
1854
- }
1855
-
1856
- return acc;
1857
- }, {});
1858
- }
1859
-
1860
- function div() {
1861
- return document.createElement('div');
1862
- }
1863
- function isElement$1(value) {
1864
- return ['Element', 'Fragment'].some(function (type) {
1865
- return isType(value, type);
1866
- });
1867
- }
1868
- function isNodeList(value) {
1869
- return isType(value, 'NodeList');
1870
- }
1871
- function isMouseEvent(value) {
1872
- return isType(value, 'MouseEvent');
1873
- }
1874
- function isReferenceElement(value) {
1875
- return !!(value && value._tippy && value._tippy.reference === value);
1876
- }
1877
- function getArrayOfElements(value) {
1878
- if (isElement$1(value)) {
1879
- return [value];
1880
- }
1881
-
1882
- if (isNodeList(value)) {
1883
- return arrayFrom(value);
1884
- }
1885
-
1886
- if (Array.isArray(value)) {
1887
- return value;
1888
- }
1889
-
1890
- return arrayFrom(document.querySelectorAll(value));
1891
- }
1892
- function setTransitionDuration(els, value) {
1893
- els.forEach(function (el) {
1894
- if (el) {
1895
- el.style.transitionDuration = value + "ms";
1896
- }
1897
- });
1898
- }
1899
- function setVisibilityState(els, state) {
1900
- els.forEach(function (el) {
1901
- if (el) {
1902
- el.setAttribute('data-state', state);
1903
- }
1904
- });
1905
- }
1906
- function getOwnerDocument(elementOrElements) {
1907
- var _element$ownerDocumen;
1908
-
1909
- var _normalizeToArray = normalizeToArray(elementOrElements),
1910
- element = _normalizeToArray[0]; // Elements created via a <template> have an ownerDocument with no reference to the body
1911
-
1912
-
1913
- return element != null && (_element$ownerDocumen = element.ownerDocument) != null && _element$ownerDocumen.body ? element.ownerDocument : document;
1914
- }
1915
- function isCursorOutsideInteractiveBorder(popperTreeData, event) {
1916
- var clientX = event.clientX,
1917
- clientY = event.clientY;
1918
- return popperTreeData.every(function (_ref) {
1919
- var popperRect = _ref.popperRect,
1920
- popperState = _ref.popperState,
1921
- props = _ref.props;
1922
- var interactiveBorder = props.interactiveBorder;
1923
- var basePlacement = getBasePlacement$1(popperState.placement);
1924
- var offsetData = popperState.modifiersData.offset;
1925
-
1926
- if (!offsetData) {
1927
- return true;
1928
- }
1929
-
1930
- var topDistance = basePlacement === 'bottom' ? offsetData.top.y : 0;
1931
- var bottomDistance = basePlacement === 'top' ? offsetData.bottom.y : 0;
1932
- var leftDistance = basePlacement === 'right' ? offsetData.left.x : 0;
1933
- var rightDistance = basePlacement === 'left' ? offsetData.right.x : 0;
1934
- var exceedsTop = popperRect.top - clientY + topDistance > interactiveBorder;
1935
- var exceedsBottom = clientY - popperRect.bottom - bottomDistance > interactiveBorder;
1936
- var exceedsLeft = popperRect.left - clientX + leftDistance > interactiveBorder;
1937
- var exceedsRight = clientX - popperRect.right - rightDistance > interactiveBorder;
1938
- return exceedsTop || exceedsBottom || exceedsLeft || exceedsRight;
1939
- });
1940
- }
1941
- function updateTransitionEndListener(box, action, listener) {
1942
- var method = action + "EventListener"; // some browsers apparently support `transition` (unprefixed) but only fire
1943
- // `webkitTransitionEnd`...
1944
-
1945
- ['transitionend', 'webkitTransitionEnd'].forEach(function (event) {
1946
- box[method](event, listener);
1947
- });
1948
- }
1949
- /**
1950
- * Compared to xxx.contains, this function works for dom structures with shadow
1951
- * dom
1952
- */
1953
-
1954
- function actualContains(parent, child) {
1955
- var target = child;
1956
-
1957
- while (target) {
1958
- var _target$getRootNode;
1959
-
1960
- if (parent.contains(target)) {
1961
- return true;
1962
- }
1963
-
1964
- target = target.getRootNode == null ? void 0 : (_target$getRootNode = target.getRootNode()) == null ? void 0 : _target$getRootNode.host;
1965
- }
1966
-
1967
- return false;
1968
- }
1969
-
1970
- var currentInput = {
1971
- isTouch: false
1972
- };
1973
- var lastMouseMoveTime = 0;
1974
- /**
1975
- * When a `touchstart` event is fired, it's assumed the user is using touch
1976
- * input. We'll bind a `mousemove` event listener to listen for mouse input in
1977
- * the future. This way, the `isTouch` property is fully dynamic and will handle
1978
- * hybrid devices that use a mix of touch + mouse input.
1979
- */
1980
-
1981
- function onDocumentTouchStart() {
1982
- if (currentInput.isTouch) {
1983
- return;
1984
- }
1985
-
1986
- currentInput.isTouch = true;
1987
-
1988
- if (window.performance) {
1989
- document.addEventListener('mousemove', onDocumentMouseMove);
1990
- }
1991
- }
1992
- /**
1993
- * When two `mousemove` event are fired consecutively within 20ms, it's assumed
1994
- * the user is using mouse input again. `mousemove` can fire on touch devices as
1995
- * well, but very rarely that quickly.
1996
- */
1997
-
1998
- function onDocumentMouseMove() {
1999
- var now = performance.now();
2000
-
2001
- if (now - lastMouseMoveTime < 20) {
2002
- currentInput.isTouch = false;
2003
- document.removeEventListener('mousemove', onDocumentMouseMove);
2004
- }
2005
-
2006
- lastMouseMoveTime = now;
2007
- }
2008
- /**
2009
- * When an element is in focus and has a tippy, leaving the tab/window and
2010
- * returning causes it to show again. For mouse users this is unexpected, but
2011
- * for keyboard use it makes sense.
2012
- * TODO: find a better technique to solve this problem
2013
- */
2014
-
2015
- function onWindowBlur() {
2016
- var activeElement = document.activeElement;
2017
-
2018
- if (isReferenceElement(activeElement)) {
2019
- var instance = activeElement._tippy;
2020
-
2021
- if (activeElement.blur && !instance.state.isVisible) {
2022
- activeElement.blur();
2023
- }
2024
- }
2025
- }
2026
- function bindGlobalEventListeners() {
2027
- document.addEventListener('touchstart', onDocumentTouchStart, TOUCH_OPTIONS);
2028
- window.addEventListener('blur', onWindowBlur);
2029
- }
2030
-
2031
- var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
2032
- var isIE11 = isBrowser ? // @ts-ignore
2033
- !!window.msCrypto : false;
2034
-
2035
- var pluginProps = {
2036
- animateFill: false,
2037
- followCursor: false,
2038
- inlinePositioning: false,
2039
- sticky: false
2040
- };
2041
- var renderProps = {
2042
- allowHTML: false,
2043
- animation: 'fade',
2044
- arrow: true,
2045
- content: '',
2046
- inertia: false,
2047
- maxWidth: 350,
2048
- role: 'tooltip',
2049
- theme: '',
2050
- zIndex: 9999
2051
- };
2052
- var defaultProps = Object.assign({
2053
- appendTo: TIPPY_DEFAULT_APPEND_TO,
2054
- aria: {
2055
- content: 'auto',
2056
- expanded: 'auto'
2057
- },
2058
- delay: 0,
2059
- duration: [300, 250],
2060
- getReferenceClientRect: null,
2061
- hideOnClick: true,
2062
- ignoreAttributes: false,
2063
- interactive: false,
2064
- interactiveBorder: 2,
2065
- interactiveDebounce: 0,
2066
- moveTransition: '',
2067
- offset: [0, 10],
2068
- onAfterUpdate: function onAfterUpdate() {},
2069
- onBeforeUpdate: function onBeforeUpdate() {},
2070
- onCreate: function onCreate() {},
2071
- onDestroy: function onDestroy() {},
2072
- onHidden: function onHidden() {},
2073
- onHide: function onHide() {},
2074
- onMount: function onMount() {},
2075
- onShow: function onShow() {},
2076
- onShown: function onShown() {},
2077
- onTrigger: function onTrigger() {},
2078
- onUntrigger: function onUntrigger() {},
2079
- onClickOutside: function onClickOutside() {},
2080
- placement: 'top',
2081
- plugins: [],
2082
- popperOptions: {},
2083
- render: null,
2084
- showOnCreate: false,
2085
- touch: true,
2086
- trigger: 'mouseenter focus',
2087
- triggerTarget: null
2088
- }, pluginProps, renderProps);
2089
- var defaultKeys = Object.keys(defaultProps);
2090
- var setDefaultProps = function setDefaultProps(partialProps) {
2091
-
2092
- var keys = Object.keys(partialProps);
2093
- keys.forEach(function (key) {
2094
- defaultProps[key] = partialProps[key];
2095
- });
2096
- };
2097
- function getExtendedPassedProps(passedProps) {
2098
- var plugins = passedProps.plugins || [];
2099
- var pluginProps = plugins.reduce(function (acc, plugin) {
2100
- var name = plugin.name,
2101
- defaultValue = plugin.defaultValue;
2102
-
2103
- if (name) {
2104
- var _name;
2105
-
2106
- acc[name] = passedProps[name] !== undefined ? passedProps[name] : (_name = defaultProps[name]) != null ? _name : defaultValue;
2107
- }
2108
-
2109
- return acc;
2110
- }, {});
2111
- return Object.assign({}, passedProps, pluginProps);
2112
- }
2113
- function getDataAttributeProps(reference, plugins) {
2114
- var propKeys = plugins ? Object.keys(getExtendedPassedProps(Object.assign({}, defaultProps, {
2115
- plugins: plugins
2116
- }))) : defaultKeys;
2117
- var props = propKeys.reduce(function (acc, key) {
2118
- var valueAsString = (reference.getAttribute("data-tippy-" + key) || '').trim();
2119
-
2120
- if (!valueAsString) {
2121
- return acc;
2122
- }
2123
-
2124
- if (key === 'content') {
2125
- acc[key] = valueAsString;
2126
- } else {
2127
- try {
2128
- acc[key] = JSON.parse(valueAsString);
2129
- } catch (e) {
2130
- acc[key] = valueAsString;
2131
- }
2132
- }
2133
-
2134
- return acc;
2135
- }, {});
2136
- return props;
2137
- }
2138
- function evaluateProps(reference, props) {
2139
- var out = Object.assign({}, props, {
2140
- content: invokeWithArgsOrReturn(props.content, [reference])
2141
- }, props.ignoreAttributes ? {} : getDataAttributeProps(reference, props.plugins));
2142
- out.aria = Object.assign({}, defaultProps.aria, out.aria);
2143
- out.aria = {
2144
- expanded: out.aria.expanded === 'auto' ? props.interactive : out.aria.expanded,
2145
- content: out.aria.content === 'auto' ? props.interactive ? null : 'describedby' : out.aria.content
2146
- };
2147
- return out;
2148
- }
2149
-
2150
- var innerHTML = function innerHTML() {
2151
- return 'innerHTML';
2152
- };
2153
-
2154
- function dangerouslySetInnerHTML(element, html) {
2155
- element[innerHTML()] = html;
2156
- }
2157
-
2158
- function createArrowElement(value) {
2159
- var arrow = div();
2160
-
2161
- if (value === true) {
2162
- arrow.className = ARROW_CLASS;
2163
- } else {
2164
- arrow.className = SVG_ARROW_CLASS;
2165
-
2166
- if (isElement$1(value)) {
2167
- arrow.appendChild(value);
2168
- } else {
2169
- dangerouslySetInnerHTML(arrow, value);
2170
- }
2171
- }
2172
-
2173
- return arrow;
2174
- }
2175
-
2176
- function setContent(content, props) {
2177
- if (isElement$1(props.content)) {
2178
- dangerouslySetInnerHTML(content, '');
2179
- content.appendChild(props.content);
2180
- } else if (typeof props.content !== 'function') {
2181
- if (props.allowHTML) {
2182
- dangerouslySetInnerHTML(content, props.content);
2183
- } else {
2184
- content.textContent = props.content;
2185
- }
2186
- }
2187
- }
2188
- function getChildren(popper) {
2189
- var box = popper.firstElementChild;
2190
- var boxChildren = arrayFrom(box.children);
2191
- return {
2192
- box: box,
2193
- content: boxChildren.find(function (node) {
2194
- return node.classList.contains(CONTENT_CLASS);
2195
- }),
2196
- arrow: boxChildren.find(function (node) {
2197
- return node.classList.contains(ARROW_CLASS) || node.classList.contains(SVG_ARROW_CLASS);
2198
- }),
2199
- backdrop: boxChildren.find(function (node) {
2200
- return node.classList.contains(BACKDROP_CLASS);
2201
- })
2202
- };
2203
- }
2204
- function render(instance) {
2205
- var popper = div();
2206
- var box = div();
2207
- box.className = BOX_CLASS;
2208
- box.setAttribute('data-state', 'hidden');
2209
- box.setAttribute('tabindex', '-1');
2210
- var content = div();
2211
- content.className = CONTENT_CLASS;
2212
- content.setAttribute('data-state', 'hidden');
2213
- setContent(content, instance.props);
2214
- popper.appendChild(box);
2215
- box.appendChild(content);
2216
- onUpdate(instance.props, instance.props);
2217
-
2218
- function onUpdate(prevProps, nextProps) {
2219
- var _getChildren = getChildren(popper),
2220
- box = _getChildren.box,
2221
- content = _getChildren.content,
2222
- arrow = _getChildren.arrow;
2223
-
2224
- if (nextProps.theme) {
2225
- box.setAttribute('data-theme', nextProps.theme);
2226
- } else {
2227
- box.removeAttribute('data-theme');
2228
- }
2229
-
2230
- if (typeof nextProps.animation === 'string') {
2231
- box.setAttribute('data-animation', nextProps.animation);
2232
- } else {
2233
- box.removeAttribute('data-animation');
2234
- }
2235
-
2236
- if (nextProps.inertia) {
2237
- box.setAttribute('data-inertia', '');
2238
- } else {
2239
- box.removeAttribute('data-inertia');
2240
- }
2241
-
2242
- box.style.maxWidth = typeof nextProps.maxWidth === 'number' ? nextProps.maxWidth + "px" : nextProps.maxWidth;
2243
-
2244
- if (nextProps.role) {
2245
- box.setAttribute('role', nextProps.role);
2246
- } else {
2247
- box.removeAttribute('role');
2248
- }
2249
-
2250
- if (prevProps.content !== nextProps.content || prevProps.allowHTML !== nextProps.allowHTML) {
2251
- setContent(content, instance.props);
2252
- }
2253
-
2254
- if (nextProps.arrow) {
2255
- if (!arrow) {
2256
- box.appendChild(createArrowElement(nextProps.arrow));
2257
- } else if (prevProps.arrow !== nextProps.arrow) {
2258
- box.removeChild(arrow);
2259
- box.appendChild(createArrowElement(nextProps.arrow));
2260
- }
2261
- } else if (arrow) {
2262
- box.removeChild(arrow);
2263
- }
2264
- }
2265
-
2266
- return {
2267
- popper: popper,
2268
- onUpdate: onUpdate
2269
- };
2270
- } // Runtime check to identify if the render function is the default one; this
2271
- // way we can apply default CSS transitions logic and it can be tree-shaken away
2272
-
2273
- render.$$tippy = true;
2274
-
2275
- var idCounter = 1;
2276
- var mouseMoveListeners = []; // Used by `hideAll()`
2277
-
2278
- var mountedInstances = [];
2279
- function createTippy(reference, passedProps) {
2280
- var props = evaluateProps(reference, Object.assign({}, defaultProps, getExtendedPassedProps(removeUndefinedProps(passedProps)))); // ===========================================================================
2281
- // 🔒 Private members
2282
- // ===========================================================================
2283
-
2284
- var showTimeout;
2285
- var hideTimeout;
2286
- var scheduleHideAnimationFrame;
2287
- var isVisibleFromClick = false;
2288
- var didHideDueToDocumentMouseDown = false;
2289
- var didTouchMove = false;
2290
- var ignoreOnFirstUpdate = false;
2291
- var lastTriggerEvent;
2292
- var currentTransitionEndListener;
2293
- var onFirstUpdate;
2294
- var listeners = [];
2295
- var debouncedOnMouseMove = debounce$1(onMouseMove, props.interactiveDebounce);
2296
- var currentTarget; // ===========================================================================
2297
- // 🔑 Public members
2298
- // ===========================================================================
2299
-
2300
- var id = idCounter++;
2301
- var popperInstance = null;
2302
- var plugins = unique(props.plugins);
2303
- var state = {
2304
- // Is the instance currently enabled?
2305
- isEnabled: true,
2306
- // Is the tippy currently showing and not transitioning out?
2307
- isVisible: false,
2308
- // Has the instance been destroyed?
2309
- isDestroyed: false,
2310
- // Is the tippy currently mounted to the DOM?
2311
- isMounted: false,
2312
- // Has the tippy finished transitioning in?
2313
- isShown: false
2314
- };
2315
- var instance = {
2316
- // properties
2317
- id: id,
2318
- reference: reference,
2319
- popper: div(),
2320
- popperInstance: popperInstance,
2321
- props: props,
2322
- state: state,
2323
- plugins: plugins,
2324
- // methods
2325
- clearDelayTimeouts: clearDelayTimeouts,
2326
- setProps: setProps,
2327
- setContent: setContent,
2328
- show: show,
2329
- hide: hide,
2330
- hideWithInteractivity: hideWithInteractivity,
2331
- enable: enable,
2332
- disable: disable,
2333
- unmount: unmount,
2334
- destroy: destroy
2335
- }; // TODO: Investigate why this early return causes a TDZ error in the tests —
2336
- // it doesn't seem to happen in the browser
2337
-
2338
- /* istanbul ignore if */
2339
-
2340
- if (!props.render) {
2341
-
2342
- return instance;
2343
- } // ===========================================================================
2344
- // Initial mutations
2345
- // ===========================================================================
2346
-
2347
-
2348
- var _props$render = props.render(instance),
2349
- popper = _props$render.popper,
2350
- onUpdate = _props$render.onUpdate;
2351
-
2352
- popper.setAttribute('data-tippy-root', '');
2353
- popper.id = "tippy-" + instance.id;
2354
- instance.popper = popper;
2355
- reference._tippy = instance;
2356
- popper._tippy = instance;
2357
- var pluginsHooks = plugins.map(function (plugin) {
2358
- return plugin.fn(instance);
2359
- });
2360
- var hasAriaExpanded = reference.hasAttribute('aria-expanded');
2361
- addListeners();
2362
- handleAriaExpandedAttribute();
2363
- handleStyles();
2364
- invokeHook('onCreate', [instance]);
2365
-
2366
- if (props.showOnCreate) {
2367
- scheduleShow();
2368
- } // Prevent a tippy with a delay from hiding if the cursor left then returned
2369
- // before it started hiding
2370
-
2371
-
2372
- popper.addEventListener('mouseenter', function () {
2373
- if (instance.props.interactive && instance.state.isVisible) {
2374
- instance.clearDelayTimeouts();
2375
- }
2376
- });
2377
- popper.addEventListener('mouseleave', function () {
2378
- if (instance.props.interactive && instance.props.trigger.indexOf('mouseenter') >= 0) {
2379
- getDocument().addEventListener('mousemove', debouncedOnMouseMove);
2380
- }
2381
- });
2382
- return instance; // ===========================================================================
2383
- // 🔒 Private methods
2384
- // ===========================================================================
2385
-
2386
- function getNormalizedTouchSettings() {
2387
- var touch = instance.props.touch;
2388
- return Array.isArray(touch) ? touch : [touch, 0];
2389
- }
2390
-
2391
- function getIsCustomTouchBehavior() {
2392
- return getNormalizedTouchSettings()[0] === 'hold';
2393
- }
2394
-
2395
- function getIsDefaultRenderFn() {
2396
- var _instance$props$rende;
2397
-
2398
- // @ts-ignore
2399
- return !!((_instance$props$rende = instance.props.render) != null && _instance$props$rende.$$tippy);
2400
- }
2401
-
2402
- function getCurrentTarget() {
2403
- return currentTarget || reference;
2404
- }
2405
-
2406
- function getDocument() {
2407
- var parent = getCurrentTarget().parentNode;
2408
- return parent ? getOwnerDocument(parent) : document;
2409
- }
2410
-
2411
- function getDefaultTemplateChildren() {
2412
- return getChildren(popper);
2413
- }
2414
-
2415
- function getDelay(isShow) {
2416
- // For touch or keyboard input, force `0` delay for UX reasons
2417
- // Also if the instance is mounted but not visible (transitioning out),
2418
- // ignore delay
2419
- if (instance.state.isMounted && !instance.state.isVisible || currentInput.isTouch || lastTriggerEvent && lastTriggerEvent.type === 'focus') {
2420
- return 0;
2421
- }
2422
-
2423
- return getValueAtIndexOrReturn(instance.props.delay, isShow ? 0 : 1, defaultProps.delay);
2424
- }
2425
-
2426
- function handleStyles(fromHide) {
2427
- if (fromHide === void 0) {
2428
- fromHide = false;
2429
- }
2430
-
2431
- popper.style.pointerEvents = instance.props.interactive && !fromHide ? '' : 'none';
2432
- popper.style.zIndex = "" + instance.props.zIndex;
2433
- }
2434
-
2435
- function invokeHook(hook, args, shouldInvokePropsHook) {
2436
- if (shouldInvokePropsHook === void 0) {
2437
- shouldInvokePropsHook = true;
2438
- }
2439
-
2440
- pluginsHooks.forEach(function (pluginHooks) {
2441
- if (pluginHooks[hook]) {
2442
- pluginHooks[hook].apply(pluginHooks, args);
2443
- }
2444
- });
2445
-
2446
- if (shouldInvokePropsHook) {
2447
- var _instance$props;
2448
-
2449
- (_instance$props = instance.props)[hook].apply(_instance$props, args);
2450
- }
2451
- }
2452
-
2453
- function handleAriaContentAttribute() {
2454
- var aria = instance.props.aria;
2455
-
2456
- if (!aria.content) {
2457
- return;
2458
- }
2459
-
2460
- var attr = "aria-" + aria.content;
2461
- var id = popper.id;
2462
- var nodes = normalizeToArray(instance.props.triggerTarget || reference);
2463
- nodes.forEach(function (node) {
2464
- var currentValue = node.getAttribute(attr);
2465
-
2466
- if (instance.state.isVisible) {
2467
- node.setAttribute(attr, currentValue ? currentValue + " " + id : id);
2468
- } else {
2469
- var nextValue = currentValue && currentValue.replace(id, '').trim();
2470
-
2471
- if (nextValue) {
2472
- node.setAttribute(attr, nextValue);
2473
- } else {
2474
- node.removeAttribute(attr);
2475
- }
2476
- }
2477
- });
2478
- }
2479
-
2480
- function handleAriaExpandedAttribute() {
2481
- if (hasAriaExpanded || !instance.props.aria.expanded) {
2482
- return;
2483
- }
2484
-
2485
- var nodes = normalizeToArray(instance.props.triggerTarget || reference);
2486
- nodes.forEach(function (node) {
2487
- if (instance.props.interactive) {
2488
- node.setAttribute('aria-expanded', instance.state.isVisible && node === getCurrentTarget() ? 'true' : 'false');
2489
- } else {
2490
- node.removeAttribute('aria-expanded');
2491
- }
2492
- });
2493
- }
2494
-
2495
- function cleanupInteractiveMouseListeners() {
2496
- getDocument().removeEventListener('mousemove', debouncedOnMouseMove);
2497
- mouseMoveListeners = mouseMoveListeners.filter(function (listener) {
2498
- return listener !== debouncedOnMouseMove;
2499
- });
2500
- }
2501
-
2502
- function onDocumentPress(event) {
2503
- // Moved finger to scroll instead of an intentional tap outside
2504
- if (currentInput.isTouch) {
2505
- if (didTouchMove || event.type === 'mousedown') {
2506
- return;
2507
- }
2508
- }
2509
-
2510
- var actualTarget = event.composedPath && event.composedPath()[0] || event.target; // Clicked on interactive popper
2511
-
2512
- if (instance.props.interactive && actualContains(popper, actualTarget)) {
2513
- return;
2514
- } // Clicked on the event listeners target
2515
-
2516
-
2517
- if (normalizeToArray(instance.props.triggerTarget || reference).some(function (el) {
2518
- return actualContains(el, actualTarget);
2519
- })) {
2520
- if (currentInput.isTouch) {
2521
- return;
2522
- }
2523
-
2524
- if (instance.state.isVisible && instance.props.trigger.indexOf('click') >= 0) {
2525
- return;
2526
- }
2527
- } else {
2528
- invokeHook('onClickOutside', [instance, event]);
2529
- }
2530
-
2531
- if (instance.props.hideOnClick === true) {
2532
- instance.clearDelayTimeouts();
2533
- instance.hide(); // `mousedown` event is fired right before `focus` if pressing the
2534
- // currentTarget. This lets a tippy with `focus` trigger know that it
2535
- // should not show
2536
-
2537
- didHideDueToDocumentMouseDown = true;
2538
- setTimeout(function () {
2539
- didHideDueToDocumentMouseDown = false;
2540
- }); // The listener gets added in `scheduleShow()`, but this may be hiding it
2541
- // before it shows, and hide()'s early bail-out behavior can prevent it
2542
- // from being cleaned up
2543
-
2544
- if (!instance.state.isMounted) {
2545
- removeDocumentPress();
2546
- }
2547
- }
2548
- }
2549
-
2550
- function onTouchMove() {
2551
- didTouchMove = true;
2552
- }
2553
-
2554
- function onTouchStart() {
2555
- didTouchMove = false;
2556
- }
2557
-
2558
- function addDocumentPress() {
2559
- var doc = getDocument();
2560
- doc.addEventListener('mousedown', onDocumentPress, true);
2561
- doc.addEventListener('touchend', onDocumentPress, TOUCH_OPTIONS);
2562
- doc.addEventListener('touchstart', onTouchStart, TOUCH_OPTIONS);
2563
- doc.addEventListener('touchmove', onTouchMove, TOUCH_OPTIONS);
2564
- }
2565
-
2566
- function removeDocumentPress() {
2567
- var doc = getDocument();
2568
- doc.removeEventListener('mousedown', onDocumentPress, true);
2569
- doc.removeEventListener('touchend', onDocumentPress, TOUCH_OPTIONS);
2570
- doc.removeEventListener('touchstart', onTouchStart, TOUCH_OPTIONS);
2571
- doc.removeEventListener('touchmove', onTouchMove, TOUCH_OPTIONS);
2572
- }
2573
-
2574
- function onTransitionedOut(duration, callback) {
2575
- onTransitionEnd(duration, function () {
2576
- if (!instance.state.isVisible && popper.parentNode && popper.parentNode.contains(popper)) {
2577
- callback();
2578
- }
2579
- });
2580
- }
2581
-
2582
- function onTransitionedIn(duration, callback) {
2583
- onTransitionEnd(duration, callback);
2584
- }
2585
-
2586
- function onTransitionEnd(duration, callback) {
2587
- var box = getDefaultTemplateChildren().box;
2588
-
2589
- function listener(event) {
2590
- if (event.target === box) {
2591
- updateTransitionEndListener(box, 'remove', listener);
2592
- callback();
2593
- }
2594
- } // Make callback synchronous if duration is 0
2595
- // `transitionend` won't fire otherwise
2596
-
2597
-
2598
- if (duration === 0) {
2599
- return callback();
2600
- }
2601
-
2602
- updateTransitionEndListener(box, 'remove', currentTransitionEndListener);
2603
- updateTransitionEndListener(box, 'add', listener);
2604
- currentTransitionEndListener = listener;
2605
- }
2606
-
2607
- function on(eventType, handler, options) {
2608
- if (options === void 0) {
2609
- options = false;
2610
- }
2611
-
2612
- var nodes = normalizeToArray(instance.props.triggerTarget || reference);
2613
- nodes.forEach(function (node) {
2614
- node.addEventListener(eventType, handler, options);
2615
- listeners.push({
2616
- node: node,
2617
- eventType: eventType,
2618
- handler: handler,
2619
- options: options
2620
- });
2621
- });
2622
- }
2623
-
2624
- function addListeners() {
2625
- if (getIsCustomTouchBehavior()) {
2626
- on('touchstart', onTrigger, {
2627
- passive: true
2628
- });
2629
- on('touchend', onMouseLeave, {
2630
- passive: true
2631
- });
2632
- }
2633
-
2634
- splitBySpaces(instance.props.trigger).forEach(function (eventType) {
2635
- if (eventType === 'manual') {
2636
- return;
2637
- }
2638
-
2639
- on(eventType, onTrigger);
2640
-
2641
- switch (eventType) {
2642
- case 'mouseenter':
2643
- on('mouseleave', onMouseLeave);
2644
- break;
2645
-
2646
- case 'focus':
2647
- on(isIE11 ? 'focusout' : 'blur', onBlurOrFocusOut);
2648
- break;
2649
-
2650
- case 'focusin':
2651
- on('focusout', onBlurOrFocusOut);
2652
- break;
2653
- }
2654
- });
2655
- }
2656
-
2657
- function removeListeners() {
2658
- listeners.forEach(function (_ref) {
2659
- var node = _ref.node,
2660
- eventType = _ref.eventType,
2661
- handler = _ref.handler,
2662
- options = _ref.options;
2663
- node.removeEventListener(eventType, handler, options);
2664
- });
2665
- listeners = [];
2666
- }
2667
-
2668
- function onTrigger(event) {
2669
- var _lastTriggerEvent;
2670
-
2671
- var shouldScheduleClickHide = false;
2672
-
2673
- if (!instance.state.isEnabled || isEventListenerStopped(event) || didHideDueToDocumentMouseDown) {
2674
- return;
2675
- }
2676
-
2677
- var wasFocused = ((_lastTriggerEvent = lastTriggerEvent) == null ? void 0 : _lastTriggerEvent.type) === 'focus';
2678
- lastTriggerEvent = event;
2679
- currentTarget = event.currentTarget;
2680
- handleAriaExpandedAttribute();
2681
-
2682
- if (!instance.state.isVisible && isMouseEvent(event)) {
2683
- // If scrolling, `mouseenter` events can be fired if the cursor lands
2684
- // over a new target, but `mousemove` events don't get fired. This
2685
- // causes interactive tooltips to get stuck open until the cursor is
2686
- // moved
2687
- mouseMoveListeners.forEach(function (listener) {
2688
- return listener(event);
2689
- });
2690
- } // Toggle show/hide when clicking click-triggered tooltips
2691
-
2692
-
2693
- if (event.type === 'click' && (instance.props.trigger.indexOf('mouseenter') < 0 || isVisibleFromClick) && instance.props.hideOnClick !== false && instance.state.isVisible) {
2694
- shouldScheduleClickHide = true;
2695
- } else {
2696
- scheduleShow(event);
2697
- }
2698
-
2699
- if (event.type === 'click') {
2700
- isVisibleFromClick = !shouldScheduleClickHide;
2701
- }
2702
-
2703
- if (shouldScheduleClickHide && !wasFocused) {
2704
- scheduleHide(event);
2705
- }
2706
- }
2707
-
2708
- function onMouseMove(event) {
2709
- var target = event.target;
2710
- var isCursorOverReferenceOrPopper = getCurrentTarget().contains(target) || popper.contains(target);
2711
-
2712
- if (event.type === 'mousemove' && isCursorOverReferenceOrPopper) {
2713
- return;
2714
- }
2715
-
2716
- var popperTreeData = getNestedPopperTree().concat(popper).map(function (popper) {
2717
- var _instance$popperInsta;
2718
-
2719
- var instance = popper._tippy;
2720
- var state = (_instance$popperInsta = instance.popperInstance) == null ? void 0 : _instance$popperInsta.state;
2721
-
2722
- if (state) {
2723
- return {
2724
- popperRect: popper.getBoundingClientRect(),
2725
- popperState: state,
2726
- props: props
2727
- };
2728
- }
2729
-
2730
- return null;
2731
- }).filter(Boolean);
2732
-
2733
- if (isCursorOutsideInteractiveBorder(popperTreeData, event)) {
2734
- cleanupInteractiveMouseListeners();
2735
- scheduleHide(event);
2736
- }
2737
- }
2738
-
2739
- function onMouseLeave(event) {
2740
- var shouldBail = isEventListenerStopped(event) || instance.props.trigger.indexOf('click') >= 0 && isVisibleFromClick;
2741
-
2742
- if (shouldBail) {
2743
- return;
2744
- }
2745
-
2746
- if (instance.props.interactive) {
2747
- instance.hideWithInteractivity(event);
2748
- return;
2749
- }
2750
-
2751
- scheduleHide(event);
2752
- }
2753
-
2754
- function onBlurOrFocusOut(event) {
2755
- if (instance.props.trigger.indexOf('focusin') < 0 && event.target !== getCurrentTarget()) {
2756
- return;
2757
- } // If focus was moved to within the popper
2758
-
2759
-
2760
- if (instance.props.interactive && event.relatedTarget && popper.contains(event.relatedTarget)) {
2761
- return;
2762
- }
2763
-
2764
- scheduleHide(event);
2765
- }
2766
-
2767
- function isEventListenerStopped(event) {
2768
- return currentInput.isTouch ? getIsCustomTouchBehavior() !== event.type.indexOf('touch') >= 0 : false;
2769
- }
2770
-
2771
- function createPopperInstance() {
2772
- destroyPopperInstance();
2773
- var _instance$props2 = instance.props,
2774
- popperOptions = _instance$props2.popperOptions,
2775
- placement = _instance$props2.placement,
2776
- offset = _instance$props2.offset,
2777
- getReferenceClientRect = _instance$props2.getReferenceClientRect,
2778
- moveTransition = _instance$props2.moveTransition;
2779
- var arrow = getIsDefaultRenderFn() ? getChildren(popper).arrow : null;
2780
- var computedReference = getReferenceClientRect ? {
2781
- getBoundingClientRect: getReferenceClientRect,
2782
- contextElement: getReferenceClientRect.contextElement || getCurrentTarget()
2783
- } : reference;
2784
- var tippyModifier = {
2785
- name: '$$tippy',
2786
- enabled: true,
2787
- phase: 'beforeWrite',
2788
- requires: ['computeStyles'],
2789
- fn: function fn(_ref2) {
2790
- var state = _ref2.state;
2791
-
2792
- if (getIsDefaultRenderFn()) {
2793
- var _getDefaultTemplateCh = getDefaultTemplateChildren(),
2794
- box = _getDefaultTemplateCh.box;
2795
-
2796
- ['placement', 'reference-hidden', 'escaped'].forEach(function (attr) {
2797
- if (attr === 'placement') {
2798
- box.setAttribute('data-placement', state.placement);
2799
- } else {
2800
- if (state.attributes.popper["data-popper-" + attr]) {
2801
- box.setAttribute("data-" + attr, '');
2802
- } else {
2803
- box.removeAttribute("data-" + attr);
2804
- }
2805
- }
2806
- });
2807
- state.attributes.popper = {};
2808
- }
2809
- }
2810
- };
2811
- var modifiers = [{
2812
- name: 'offset',
2813
- options: {
2814
- offset: offset
2815
- }
2816
- }, {
2817
- name: 'preventOverflow',
2818
- options: {
2819
- padding: {
2820
- top: 2,
2821
- bottom: 2,
2822
- left: 5,
2823
- right: 5
2824
- }
2825
- }
2826
- }, {
2827
- name: 'flip',
2828
- options: {
2829
- padding: 5
2830
- }
2831
- }, {
2832
- name: 'computeStyles',
2833
- options: {
2834
- adaptive: !moveTransition
2835
- }
2836
- }, tippyModifier];
2837
-
2838
- if (getIsDefaultRenderFn() && arrow) {
2839
- modifiers.push({
2840
- name: 'arrow',
2841
- options: {
2842
- element: arrow,
2843
- padding: 3
2844
- }
2845
- });
2846
- }
2847
-
2848
- modifiers.push.apply(modifiers, (popperOptions == null ? void 0 : popperOptions.modifiers) || []);
2849
- instance.popperInstance = createPopper(computedReference, popper, Object.assign({}, popperOptions, {
2850
- placement: placement,
2851
- onFirstUpdate: onFirstUpdate,
2852
- modifiers: modifiers
2853
- }));
2854
- }
2855
-
2856
- function destroyPopperInstance() {
2857
- if (instance.popperInstance) {
2858
- instance.popperInstance.destroy();
2859
- instance.popperInstance = null;
2860
- }
2861
- }
2862
-
2863
- function mount() {
2864
- var appendTo = instance.props.appendTo;
2865
- var parentNode; // By default, we'll append the popper to the triggerTargets's parentNode so
2866
- // it's directly after the reference element so the elements inside the
2867
- // tippy can be tabbed to
2868
- // If there are clipping issues, the user can specify a different appendTo
2869
- // and ensure focus management is handled correctly manually
2870
-
2871
- var node = getCurrentTarget();
2872
-
2873
- if (instance.props.interactive && appendTo === TIPPY_DEFAULT_APPEND_TO || appendTo === 'parent') {
2874
- parentNode = node.parentNode;
2875
- } else {
2876
- parentNode = invokeWithArgsOrReturn(appendTo, [node]);
2877
- } // The popper element needs to exist on the DOM before its position can be
2878
- // updated as Popper needs to read its dimensions
2879
-
2880
-
2881
- if (!parentNode.contains(popper)) {
2882
- parentNode.appendChild(popper);
2883
- }
2884
-
2885
- instance.state.isMounted = true;
2886
- createPopperInstance();
2887
- }
2888
-
2889
- function getNestedPopperTree() {
2890
- return arrayFrom(popper.querySelectorAll('[data-tippy-root]'));
2891
- }
2892
-
2893
- function scheduleShow(event) {
2894
- instance.clearDelayTimeouts();
2895
-
2896
- if (event) {
2897
- invokeHook('onTrigger', [instance, event]);
2898
- }
2899
-
2900
- addDocumentPress();
2901
- var delay = getDelay(true);
2902
-
2903
- var _getNormalizedTouchSe = getNormalizedTouchSettings(),
2904
- touchValue = _getNormalizedTouchSe[0],
2905
- touchDelay = _getNormalizedTouchSe[1];
2906
-
2907
- if (currentInput.isTouch && touchValue === 'hold' && touchDelay) {
2908
- delay = touchDelay;
2909
- }
2910
-
2911
- if (delay) {
2912
- showTimeout = setTimeout(function () {
2913
- instance.show();
2914
- }, delay);
2915
- } else {
2916
- instance.show();
2917
- }
2918
- }
2919
-
2920
- function scheduleHide(event) {
2921
- instance.clearDelayTimeouts();
2922
- invokeHook('onUntrigger', [instance, event]);
2923
-
2924
- if (!instance.state.isVisible) {
2925
- removeDocumentPress();
2926
- return;
2927
- } // For interactive tippies, scheduleHide is added to a document.body handler
2928
- // from onMouseLeave so must intercept scheduled hides from mousemove/leave
2929
- // events when trigger contains mouseenter and click, and the tip is
2930
- // currently shown as a result of a click.
2931
-
2932
-
2933
- if (instance.props.trigger.indexOf('mouseenter') >= 0 && instance.props.trigger.indexOf('click') >= 0 && ['mouseleave', 'mousemove'].indexOf(event.type) >= 0 && isVisibleFromClick) {
2934
- return;
2935
- }
2936
-
2937
- var delay = getDelay(false);
2938
-
2939
- if (delay) {
2940
- hideTimeout = setTimeout(function () {
2941
- if (instance.state.isVisible) {
2942
- instance.hide();
2943
- }
2944
- }, delay);
2945
- } else {
2946
- // Fixes a `transitionend` problem when it fires 1 frame too
2947
- // late sometimes, we don't want hide() to be called.
2948
- scheduleHideAnimationFrame = requestAnimationFrame(function () {
2949
- instance.hide();
2950
- });
2951
- }
2952
- } // ===========================================================================
2953
- // 🔑 Public methods
2954
- // ===========================================================================
2955
-
2956
-
2957
- function enable() {
2958
- instance.state.isEnabled = true;
2959
- }
2960
-
2961
- function disable() {
2962
- // Disabling the instance should also hide it
2963
- // https://github.com/atomiks/tippy.js-react/issues/106
2964
- instance.hide();
2965
- instance.state.isEnabled = false;
2966
- }
2967
-
2968
- function clearDelayTimeouts() {
2969
- clearTimeout(showTimeout);
2970
- clearTimeout(hideTimeout);
2971
- cancelAnimationFrame(scheduleHideAnimationFrame);
2972
- }
2973
-
2974
- function setProps(partialProps) {
2975
-
2976
- if (instance.state.isDestroyed) {
2977
- return;
2978
- }
2979
-
2980
- invokeHook('onBeforeUpdate', [instance, partialProps]);
2981
- removeListeners();
2982
- var prevProps = instance.props;
2983
- var nextProps = evaluateProps(reference, Object.assign({}, prevProps, removeUndefinedProps(partialProps), {
2984
- ignoreAttributes: true
2985
- }));
2986
- instance.props = nextProps;
2987
- addListeners();
2988
-
2989
- if (prevProps.interactiveDebounce !== nextProps.interactiveDebounce) {
2990
- cleanupInteractiveMouseListeners();
2991
- debouncedOnMouseMove = debounce$1(onMouseMove, nextProps.interactiveDebounce);
2992
- } // Ensure stale aria-expanded attributes are removed
2993
-
2994
-
2995
- if (prevProps.triggerTarget && !nextProps.triggerTarget) {
2996
- normalizeToArray(prevProps.triggerTarget).forEach(function (node) {
2997
- node.removeAttribute('aria-expanded');
2998
- });
2999
- } else if (nextProps.triggerTarget) {
3000
- reference.removeAttribute('aria-expanded');
3001
- }
3002
-
3003
- handleAriaExpandedAttribute();
3004
- handleStyles();
3005
-
3006
- if (onUpdate) {
3007
- onUpdate(prevProps, nextProps);
3008
- }
3009
-
3010
- if (instance.popperInstance) {
3011
- createPopperInstance(); // Fixes an issue with nested tippies if they are all getting re-rendered,
3012
- // and the nested ones get re-rendered first.
3013
- // https://github.com/atomiks/tippyjs-react/issues/177
3014
- // TODO: find a cleaner / more efficient solution(!)
3015
-
3016
- getNestedPopperTree().forEach(function (nestedPopper) {
3017
- // React (and other UI libs likely) requires a rAF wrapper as it flushes
3018
- // its work in one
3019
- requestAnimationFrame(nestedPopper._tippy.popperInstance.forceUpdate);
3020
- });
3021
- }
3022
-
3023
- invokeHook('onAfterUpdate', [instance, partialProps]);
3024
- }
3025
-
3026
- function setContent(content) {
3027
- instance.setProps({
3028
- content: content
3029
- });
3030
- }
3031
-
3032
- function show() {
3033
-
3034
-
3035
- var isAlreadyVisible = instance.state.isVisible;
3036
- var isDestroyed = instance.state.isDestroyed;
3037
- var isDisabled = !instance.state.isEnabled;
3038
- var isTouchAndTouchDisabled = currentInput.isTouch && !instance.props.touch;
3039
- var duration = getValueAtIndexOrReturn(instance.props.duration, 0, defaultProps.duration);
3040
-
3041
- if (isAlreadyVisible || isDestroyed || isDisabled || isTouchAndTouchDisabled) {
3042
- return;
3043
- } // Normalize `disabled` behavior across browsers.
3044
- // Firefox allows events on disabled elements, but Chrome doesn't.
3045
- // Using a wrapper element (i.e. <span>) is recommended.
3046
-
3047
-
3048
- if (getCurrentTarget().hasAttribute('disabled')) {
3049
- return;
3050
- }
3051
-
3052
- invokeHook('onShow', [instance], false);
3053
-
3054
- if (instance.props.onShow(instance) === false) {
3055
- return;
3056
- }
3057
-
3058
- instance.state.isVisible = true;
3059
-
3060
- if (getIsDefaultRenderFn()) {
3061
- popper.style.visibility = 'visible';
3062
- }
3063
-
3064
- handleStyles();
3065
- addDocumentPress();
3066
-
3067
- if (!instance.state.isMounted) {
3068
- popper.style.transition = 'none';
3069
- } // If flipping to the opposite side after hiding at least once, the
3070
- // animation will use the wrong placement without resetting the duration
3071
-
3072
-
3073
- if (getIsDefaultRenderFn()) {
3074
- var _getDefaultTemplateCh2 = getDefaultTemplateChildren(),
3075
- box = _getDefaultTemplateCh2.box,
3076
- content = _getDefaultTemplateCh2.content;
3077
-
3078
- setTransitionDuration([box, content], 0);
3079
- }
3080
-
3081
- onFirstUpdate = function onFirstUpdate() {
3082
- var _instance$popperInsta2;
3083
-
3084
- if (!instance.state.isVisible || ignoreOnFirstUpdate) {
3085
- return;
3086
- }
3087
-
3088
- ignoreOnFirstUpdate = true; // reflow
3089
-
3090
- void popper.offsetHeight;
3091
- popper.style.transition = instance.props.moveTransition;
3092
-
3093
- if (getIsDefaultRenderFn() && instance.props.animation) {
3094
- var _getDefaultTemplateCh3 = getDefaultTemplateChildren(),
3095
- _box = _getDefaultTemplateCh3.box,
3096
- _content = _getDefaultTemplateCh3.content;
3097
-
3098
- setTransitionDuration([_box, _content], duration);
3099
- setVisibilityState([_box, _content], 'visible');
3100
- }
3101
-
3102
- handleAriaContentAttribute();
3103
- handleAriaExpandedAttribute();
3104
- pushIfUnique(mountedInstances, instance); // certain modifiers (e.g. `maxSize`) require a second update after the
3105
- // popper has been positioned for the first time
3106
-
3107
- (_instance$popperInsta2 = instance.popperInstance) == null ? void 0 : _instance$popperInsta2.forceUpdate();
3108
- invokeHook('onMount', [instance]);
3109
-
3110
- if (instance.props.animation && getIsDefaultRenderFn()) {
3111
- onTransitionedIn(duration, function () {
3112
- instance.state.isShown = true;
3113
- invokeHook('onShown', [instance]);
3114
- });
3115
- }
3116
- };
3117
-
3118
- mount();
3119
- }
3120
-
3121
- function hide() {
3122
-
3123
-
3124
- var isAlreadyHidden = !instance.state.isVisible;
3125
- var isDestroyed = instance.state.isDestroyed;
3126
- var isDisabled = !instance.state.isEnabled;
3127
- var duration = getValueAtIndexOrReturn(instance.props.duration, 1, defaultProps.duration);
3128
-
3129
- if (isAlreadyHidden || isDestroyed || isDisabled) {
3130
- return;
3131
- }
3132
-
3133
- invokeHook('onHide', [instance], false);
3134
-
3135
- if (instance.props.onHide(instance) === false) {
3136
- return;
3137
- }
3138
-
3139
- instance.state.isVisible = false;
3140
- instance.state.isShown = false;
3141
- ignoreOnFirstUpdate = false;
3142
- isVisibleFromClick = false;
3143
-
3144
- if (getIsDefaultRenderFn()) {
3145
- popper.style.visibility = 'hidden';
3146
- }
3147
-
3148
- cleanupInteractiveMouseListeners();
3149
- removeDocumentPress();
3150
- handleStyles(true);
3151
-
3152
- if (getIsDefaultRenderFn()) {
3153
- var _getDefaultTemplateCh4 = getDefaultTemplateChildren(),
3154
- box = _getDefaultTemplateCh4.box,
3155
- content = _getDefaultTemplateCh4.content;
3156
-
3157
- if (instance.props.animation) {
3158
- setTransitionDuration([box, content], duration);
3159
- setVisibilityState([box, content], 'hidden');
3160
- }
3161
- }
3162
-
3163
- handleAriaContentAttribute();
3164
- handleAriaExpandedAttribute();
3165
-
3166
- if (instance.props.animation) {
3167
- if (getIsDefaultRenderFn()) {
3168
- onTransitionedOut(duration, instance.unmount);
3169
- }
3170
- } else {
3171
- instance.unmount();
3172
- }
3173
- }
3174
-
3175
- function hideWithInteractivity(event) {
3176
-
3177
- getDocument().addEventListener('mousemove', debouncedOnMouseMove);
3178
- pushIfUnique(mouseMoveListeners, debouncedOnMouseMove);
3179
- debouncedOnMouseMove(event);
3180
- }
3181
-
3182
- function unmount() {
3183
-
3184
- if (instance.state.isVisible) {
3185
- instance.hide();
3186
- }
3187
-
3188
- if (!instance.state.isMounted) {
3189
- return;
3190
- }
3191
-
3192
- destroyPopperInstance(); // If a popper is not interactive, it will be appended outside the popper
3193
- // tree by default. This seems mainly for interactive tippies, but we should
3194
- // find a workaround if possible
3195
-
3196
- getNestedPopperTree().forEach(function (nestedPopper) {
3197
- nestedPopper._tippy.unmount();
3198
- });
3199
-
3200
- if (popper.parentNode) {
3201
- popper.parentNode.removeChild(popper);
3202
- }
3203
-
3204
- mountedInstances = mountedInstances.filter(function (i) {
3205
- return i !== instance;
3206
- });
3207
- instance.state.isMounted = false;
3208
- invokeHook('onHidden', [instance]);
3209
- }
3210
-
3211
- function destroy() {
3212
-
3213
- if (instance.state.isDestroyed) {
3214
- return;
3215
- }
3216
-
3217
- instance.clearDelayTimeouts();
3218
- instance.unmount();
3219
- removeListeners();
3220
- delete reference._tippy;
3221
- instance.state.isDestroyed = true;
3222
- invokeHook('onDestroy', [instance]);
3223
- }
3224
- }
3225
-
3226
- function tippy(targets, optionalProps) {
3227
- if (optionalProps === void 0) {
3228
- optionalProps = {};
3229
- }
3230
-
3231
- var plugins = defaultProps.plugins.concat(optionalProps.plugins || []);
3232
-
3233
- bindGlobalEventListeners();
3234
- var passedProps = Object.assign({}, optionalProps, {
3235
- plugins: plugins
3236
- });
3237
- var elements = getArrayOfElements(targets);
3238
-
3239
- var instances = elements.reduce(function (acc, reference) {
3240
- var instance = reference && createTippy(reference, passedProps);
3241
-
3242
- if (instance) {
3243
- acc.push(instance);
3244
- }
3245
-
3246
- return acc;
3247
- }, []);
3248
- return isElement$1(targets) ? instances[0] : instances;
3249
- }
3250
-
3251
- tippy.defaultProps = defaultProps;
3252
- tippy.setDefaultProps = setDefaultProps;
3253
- tippy.currentInput = currentInput;
3254
- var hideAll = function hideAll(_temp) {
3255
- var _ref = _temp === void 0 ? {} : _temp,
3256
- excludedReferenceOrInstance = _ref.exclude,
3257
- duration = _ref.duration;
3258
-
3259
- mountedInstances.forEach(function (instance) {
3260
- var isExcluded = false;
3261
-
3262
- if (excludedReferenceOrInstance) {
3263
- isExcluded = isReferenceElement(excludedReferenceOrInstance) ? instance.reference === excludedReferenceOrInstance : instance.popper === excludedReferenceOrInstance.popper;
3264
- }
3265
-
3266
- if (!isExcluded) {
3267
- var originalDuration = instance.props.duration;
3268
- instance.setProps({
3269
- duration: duration
3270
- });
3271
- instance.hide();
3272
-
3273
- if (!instance.state.isDestroyed) {
3274
- instance.setProps({
3275
- duration: originalDuration
3276
- });
3277
- }
3278
- }
3279
- });
3280
- };
3281
-
3282
- // every time the popper is destroyed (i.e. a new target), removing the styles
3283
- // and causing transitions to break for singletons when the console is open, but
3284
- // most notably for non-transform styles being used, `gpuAcceleration: false`.
3285
-
3286
- var applyStylesModifier = Object.assign({}, applyStyles$1, {
3287
- effect: function effect(_ref) {
3288
- var state = _ref.state;
3289
- var initialStyles = {
3290
- popper: {
3291
- position: state.options.strategy,
3292
- left: '0',
3293
- top: '0',
3294
- margin: '0'
3295
- },
3296
- arrow: {
3297
- position: 'absolute'
3298
- },
3299
- reference: {}
3300
- };
3301
- Object.assign(state.elements.popper.style, initialStyles.popper);
3302
- state.styles = initialStyles;
3303
-
3304
- if (state.elements.arrow) {
3305
- Object.assign(state.elements.arrow.style, initialStyles.arrow);
3306
- } // intentionally return no cleanup function
3307
- // return () => { ... }
3308
-
3309
- }
3310
- });
3311
-
3312
- var createSingleton = function createSingleton(tippyInstances, optionalProps) {
3313
- var _optionalProps$popper;
3314
-
3315
- if (optionalProps === void 0) {
3316
- optionalProps = {};
3317
- }
3318
-
3319
- var individualInstances = tippyInstances;
3320
- var references = [];
3321
- var triggerTargets = [];
3322
- var currentTarget;
3323
- var overrides = optionalProps.overrides;
3324
- var interceptSetPropsCleanups = [];
3325
- var shownOnCreate = false;
3326
-
3327
- function setTriggerTargets() {
3328
- triggerTargets = individualInstances.map(function (instance) {
3329
- return normalizeToArray(instance.props.triggerTarget || instance.reference);
3330
- }).reduce(function (acc, item) {
3331
- return acc.concat(item);
3332
- }, []);
3333
- }
3334
-
3335
- function setReferences() {
3336
- references = individualInstances.map(function (instance) {
3337
- return instance.reference;
3338
- });
3339
- }
3340
-
3341
- function enableInstances(isEnabled) {
3342
- individualInstances.forEach(function (instance) {
3343
- if (isEnabled) {
3344
- instance.enable();
3345
- } else {
3346
- instance.disable();
3347
- }
3348
- });
3349
- }
3350
-
3351
- function interceptSetProps(singleton) {
3352
- return individualInstances.map(function (instance) {
3353
- var originalSetProps = instance.setProps;
3354
-
3355
- instance.setProps = function (props) {
3356
- originalSetProps(props);
3357
-
3358
- if (instance.reference === currentTarget) {
3359
- singleton.setProps(props);
3360
- }
3361
- };
3362
-
3363
- return function () {
3364
- instance.setProps = originalSetProps;
3365
- };
3366
- });
3367
- } // have to pass singleton, as it maybe undefined on first call
3368
-
3369
-
3370
- function prepareInstance(singleton, target) {
3371
- var index = triggerTargets.indexOf(target); // bail-out
3372
-
3373
- if (target === currentTarget) {
3374
- return;
3375
- }
3376
-
3377
- currentTarget = target;
3378
- var overrideProps = (overrides || []).concat('content').reduce(function (acc, prop) {
3379
- acc[prop] = individualInstances[index].props[prop];
3380
- return acc;
3381
- }, {});
3382
- singleton.setProps(Object.assign({}, overrideProps, {
3383
- getReferenceClientRect: typeof overrideProps.getReferenceClientRect === 'function' ? overrideProps.getReferenceClientRect : function () {
3384
- var _references$index;
3385
-
3386
- return (_references$index = references[index]) == null ? void 0 : _references$index.getBoundingClientRect();
3387
- }
3388
- }));
3389
- }
3390
-
3391
- enableInstances(false);
3392
- setReferences();
3393
- setTriggerTargets();
3394
- var plugin = {
3395
- fn: function fn() {
3396
- return {
3397
- onDestroy: function onDestroy() {
3398
- enableInstances(true);
3399
- },
3400
- onHidden: function onHidden() {
3401
- currentTarget = null;
3402
- },
3403
- onClickOutside: function onClickOutside(instance) {
3404
- if (instance.props.showOnCreate && !shownOnCreate) {
3405
- shownOnCreate = true;
3406
- currentTarget = null;
3407
- }
3408
- },
3409
- onShow: function onShow(instance) {
3410
- if (instance.props.showOnCreate && !shownOnCreate) {
3411
- shownOnCreate = true;
3412
- prepareInstance(instance, references[0]);
3413
- }
3414
- },
3415
- onTrigger: function onTrigger(instance, event) {
3416
- prepareInstance(instance, event.currentTarget);
3417
- }
3418
- };
3419
- }
3420
- };
3421
- var singleton = tippy(div(), Object.assign({}, removeProperties(optionalProps, ['overrides']), {
3422
- plugins: [plugin].concat(optionalProps.plugins || []),
3423
- triggerTarget: triggerTargets,
3424
- popperOptions: Object.assign({}, optionalProps.popperOptions, {
3425
- modifiers: [].concat(((_optionalProps$popper = optionalProps.popperOptions) == null ? void 0 : _optionalProps$popper.modifiers) || [], [applyStylesModifier])
3426
- })
3427
- }));
3428
- var originalShow = singleton.show;
3429
-
3430
- singleton.show = function (target) {
3431
- originalShow(); // first time, showOnCreate or programmatic call with no params
3432
- // default to showing first instance
3433
-
3434
- if (!currentTarget && target == null) {
3435
- return prepareInstance(singleton, references[0]);
3436
- } // triggered from event (do nothing as prepareInstance already called by onTrigger)
3437
- // programmatic call with no params when already visible (do nothing again)
3438
-
3439
-
3440
- if (currentTarget && target == null) {
3441
- return;
3442
- } // target is index of instance
3443
-
3444
-
3445
- if (typeof target === 'number') {
3446
- return references[target] && prepareInstance(singleton, references[target]);
3447
- } // target is a child tippy instance
3448
-
3449
-
3450
- if (individualInstances.indexOf(target) >= 0) {
3451
- var ref = target.reference;
3452
- return prepareInstance(singleton, ref);
3453
- } // target is a ReferenceElement
3454
-
3455
-
3456
- if (references.indexOf(target) >= 0) {
3457
- return prepareInstance(singleton, target);
3458
- }
3459
- };
3460
-
3461
- singleton.showNext = function () {
3462
- var first = references[0];
3463
-
3464
- if (!currentTarget) {
3465
- return singleton.show(0);
3466
- }
3467
-
3468
- var index = references.indexOf(currentTarget);
3469
- singleton.show(references[index + 1] || first);
3470
- };
3471
-
3472
- singleton.showPrevious = function () {
3473
- var last = references[references.length - 1];
3474
-
3475
- if (!currentTarget) {
3476
- return singleton.show(last);
3477
- }
3478
-
3479
- var index = references.indexOf(currentTarget);
3480
- var target = references[index - 1] || last;
3481
- singleton.show(target);
3482
- };
3483
-
3484
- var originalSetProps = singleton.setProps;
3485
-
3486
- singleton.setProps = function (props) {
3487
- overrides = props.overrides || overrides;
3488
- originalSetProps(props);
3489
- };
3490
-
3491
- singleton.setInstances = function (nextInstances) {
3492
- enableInstances(true);
3493
- interceptSetPropsCleanups.forEach(function (fn) {
3494
- return fn();
3495
- });
3496
- individualInstances = nextInstances;
3497
- enableInstances(false);
3498
- setReferences();
3499
- setTriggerTargets();
3500
- interceptSetPropsCleanups = interceptSetProps(singleton);
3501
- singleton.setProps({
3502
- triggerTarget: triggerTargets
3503
- });
3504
- };
3505
-
3506
- interceptSetPropsCleanups = interceptSetProps(singleton);
3507
- return singleton;
3508
- };
3509
-
3510
- var animateFill = {
3511
- name: 'animateFill',
3512
- defaultValue: false,
3513
- fn: function fn(instance) {
3514
- var _instance$props$rende;
3515
-
3516
- // @ts-ignore
3517
- if (!((_instance$props$rende = instance.props.render) != null && _instance$props$rende.$$tippy)) {
3518
-
3519
- return {};
3520
- }
3521
-
3522
- var _getChildren = getChildren(instance.popper),
3523
- box = _getChildren.box,
3524
- content = _getChildren.content;
3525
-
3526
- var backdrop = instance.props.animateFill ? createBackdropElement() : null;
3527
- return {
3528
- onCreate: function onCreate() {
3529
- if (backdrop) {
3530
- box.insertBefore(backdrop, box.firstElementChild);
3531
- box.setAttribute('data-animatefill', '');
3532
- box.style.overflow = 'hidden';
3533
- instance.setProps({
3534
- arrow: false,
3535
- animation: 'shift-away'
3536
- });
3537
- }
3538
- },
3539
- onMount: function onMount() {
3540
- if (backdrop) {
3541
- var transitionDuration = box.style.transitionDuration;
3542
- var duration = Number(transitionDuration.replace('ms', '')); // The content should fade in after the backdrop has mostly filled the
3543
- // tooltip element. `clip-path` is the other alternative but is not
3544
- // well-supported and is buggy on some devices.
3545
-
3546
- content.style.transitionDelay = Math.round(duration / 10) + "ms";
3547
- backdrop.style.transitionDuration = transitionDuration;
3548
- setVisibilityState([backdrop], 'visible');
3549
- }
3550
- },
3551
- onShow: function onShow() {
3552
- if (backdrop) {
3553
- backdrop.style.transitionDuration = '0ms';
3554
- }
3555
- },
3556
- onHide: function onHide() {
3557
- if (backdrop) {
3558
- setVisibilityState([backdrop], 'hidden');
3559
- }
3560
- }
3561
- };
3562
- }
3563
- };
3564
-
3565
- function createBackdropElement() {
3566
- var backdrop = div();
3567
- backdrop.className = BACKDROP_CLASS;
3568
- setVisibilityState([backdrop], 'hidden');
3569
- return backdrop;
3570
- }
3571
-
3572
- var mouseCoords = {
3573
- clientX: 0,
3574
- clientY: 0
3575
- };
3576
- var activeInstances = [];
3577
-
3578
- function storeMouseCoords(_ref) {
3579
- var clientX = _ref.clientX,
3580
- clientY = _ref.clientY;
3581
- mouseCoords = {
3582
- clientX: clientX,
3583
- clientY: clientY
3584
- };
3585
- }
3586
-
3587
- function addMouseCoordsListener(doc) {
3588
- doc.addEventListener('mousemove', storeMouseCoords);
3589
- }
3590
-
3591
- function removeMouseCoordsListener(doc) {
3592
- doc.removeEventListener('mousemove', storeMouseCoords);
3593
- }
3594
-
3595
- var followCursor = {
3596
- name: 'followCursor',
3597
- defaultValue: false,
3598
- fn: function fn(instance) {
3599
- var reference = instance.reference;
3600
- var doc = getOwnerDocument(instance.props.triggerTarget || reference);
3601
- var isInternalUpdate = false;
3602
- var wasFocusEvent = false;
3603
- var isUnmounted = true;
3604
- var prevProps = instance.props;
3605
-
3606
- function getIsInitialBehavior() {
3607
- return instance.props.followCursor === 'initial' && instance.state.isVisible;
3608
- }
3609
-
3610
- function addListener() {
3611
- doc.addEventListener('mousemove', onMouseMove);
3612
- }
3613
-
3614
- function removeListener() {
3615
- doc.removeEventListener('mousemove', onMouseMove);
3616
- }
3617
-
3618
- function unsetGetReferenceClientRect() {
3619
- isInternalUpdate = true;
3620
- instance.setProps({
3621
- getReferenceClientRect: null
3622
- });
3623
- isInternalUpdate = false;
3624
- }
3625
-
3626
- function onMouseMove(event) {
3627
- // If the instance is interactive, avoid updating the position unless it's
3628
- // over the reference element
3629
- var isCursorOverReference = event.target ? reference.contains(event.target) : true;
3630
- var followCursor = instance.props.followCursor;
3631
- var clientX = event.clientX,
3632
- clientY = event.clientY;
3633
- var rect = reference.getBoundingClientRect();
3634
- var relativeX = clientX - rect.left;
3635
- var relativeY = clientY - rect.top;
3636
-
3637
- if (isCursorOverReference || !instance.props.interactive) {
3638
- instance.setProps({
3639
- // @ts-ignore - unneeded DOMRect properties
3640
- getReferenceClientRect: function getReferenceClientRect() {
3641
- var rect = reference.getBoundingClientRect();
3642
- var x = clientX;
3643
- var y = clientY;
3644
-
3645
- if (followCursor === 'initial') {
3646
- x = rect.left + relativeX;
3647
- y = rect.top + relativeY;
3648
- }
3649
-
3650
- var top = followCursor === 'horizontal' ? rect.top : y;
3651
- var right = followCursor === 'vertical' ? rect.right : x;
3652
- var bottom = followCursor === 'horizontal' ? rect.bottom : y;
3653
- var left = followCursor === 'vertical' ? rect.left : x;
3654
- return {
3655
- width: right - left,
3656
- height: bottom - top,
3657
- top: top,
3658
- right: right,
3659
- bottom: bottom,
3660
- left: left
3661
- };
3662
- }
3663
- });
3664
- }
3665
- }
3666
-
3667
- function create() {
3668
- if (instance.props.followCursor) {
3669
- activeInstances.push({
3670
- instance: instance,
3671
- doc: doc
3672
- });
3673
- addMouseCoordsListener(doc);
3674
- }
3675
- }
3676
-
3677
- function destroy() {
3678
- activeInstances = activeInstances.filter(function (data) {
3679
- return data.instance !== instance;
3680
- });
3681
-
3682
- if (activeInstances.filter(function (data) {
3683
- return data.doc === doc;
3684
- }).length === 0) {
3685
- removeMouseCoordsListener(doc);
3686
- }
3687
- }
3688
-
3689
- return {
3690
- onCreate: create,
3691
- onDestroy: destroy,
3692
- onBeforeUpdate: function onBeforeUpdate() {
3693
- prevProps = instance.props;
3694
- },
3695
- onAfterUpdate: function onAfterUpdate(_, _ref2) {
3696
- var followCursor = _ref2.followCursor;
3697
-
3698
- if (isInternalUpdate) {
3699
- return;
3700
- }
3701
-
3702
- if (followCursor !== undefined && prevProps.followCursor !== followCursor) {
3703
- destroy();
3704
-
3705
- if (followCursor) {
3706
- create();
3707
-
3708
- if (instance.state.isMounted && !wasFocusEvent && !getIsInitialBehavior()) {
3709
- addListener();
3710
- }
3711
- } else {
3712
- removeListener();
3713
- unsetGetReferenceClientRect();
3714
- }
3715
- }
3716
- },
3717
- onMount: function onMount() {
3718
- if (instance.props.followCursor && !wasFocusEvent) {
3719
- if (isUnmounted) {
3720
- onMouseMove(mouseCoords);
3721
- isUnmounted = false;
3722
- }
3723
-
3724
- if (!getIsInitialBehavior()) {
3725
- addListener();
3726
- }
3727
- }
3728
- },
3729
- onTrigger: function onTrigger(_, event) {
3730
- if (isMouseEvent(event)) {
3731
- mouseCoords = {
3732
- clientX: event.clientX,
3733
- clientY: event.clientY
3734
- };
3735
- }
3736
-
3737
- wasFocusEvent = event.type === 'focus';
3738
- },
3739
- onHidden: function onHidden() {
3740
- if (instance.props.followCursor) {
3741
- unsetGetReferenceClientRect();
3742
- removeListener();
3743
- isUnmounted = true;
3744
- }
3745
- }
3746
- };
3747
- }
3748
- };
3749
-
3750
- function getProps(props, modifier) {
3751
- var _props$popperOptions;
3752
-
3753
- return {
3754
- popperOptions: Object.assign({}, props.popperOptions, {
3755
- modifiers: [].concat((((_props$popperOptions = props.popperOptions) == null ? void 0 : _props$popperOptions.modifiers) || []).filter(function (_ref) {
3756
- var name = _ref.name;
3757
- return name !== modifier.name;
3758
- }), [modifier])
3759
- })
3760
- };
3761
- }
3762
-
3763
- var inlinePositioning = {
3764
- name: 'inlinePositioning',
3765
- defaultValue: false,
3766
- fn: function fn(instance) {
3767
- var reference = instance.reference;
3768
-
3769
- function isEnabled() {
3770
- return !!instance.props.inlinePositioning;
3771
- }
3772
-
3773
- var placement;
3774
- var cursorRectIndex = -1;
3775
- var isInternalUpdate = false;
3776
- var triedPlacements = [];
3777
- var modifier = {
3778
- name: 'tippyInlinePositioning',
3779
- enabled: true,
3780
- phase: 'afterWrite',
3781
- fn: function fn(_ref2) {
3782
- var state = _ref2.state;
3783
-
3784
- if (isEnabled()) {
3785
- if (triedPlacements.indexOf(state.placement) !== -1) {
3786
- triedPlacements = [];
3787
- }
3788
-
3789
- if (placement !== state.placement && triedPlacements.indexOf(state.placement) === -1) {
3790
- triedPlacements.push(state.placement);
3791
- instance.setProps({
3792
- // @ts-ignore - unneeded DOMRect properties
3793
- getReferenceClientRect: function getReferenceClientRect() {
3794
- return _getReferenceClientRect(state.placement);
3795
- }
3796
- });
3797
- }
3798
-
3799
- placement = state.placement;
3800
- }
3801
- }
3802
- };
3803
-
3804
- function _getReferenceClientRect(placement) {
3805
- return getInlineBoundingClientRect(getBasePlacement$1(placement), reference.getBoundingClientRect(), arrayFrom(reference.getClientRects()), cursorRectIndex);
3806
- }
3807
-
3808
- function setInternalProps(partialProps) {
3809
- isInternalUpdate = true;
3810
- instance.setProps(partialProps);
3811
- isInternalUpdate = false;
3812
- }
3813
-
3814
- function addModifier() {
3815
- if (!isInternalUpdate) {
3816
- setInternalProps(getProps(instance.props, modifier));
3817
- }
3818
- }
3819
-
3820
- return {
3821
- onCreate: addModifier,
3822
- onAfterUpdate: addModifier,
3823
- onTrigger: function onTrigger(_, event) {
3824
- if (isMouseEvent(event)) {
3825
- var rects = arrayFrom(instance.reference.getClientRects());
3826
- var cursorRect = rects.find(function (rect) {
3827
- return rect.left - 2 <= event.clientX && rect.right + 2 >= event.clientX && rect.top - 2 <= event.clientY && rect.bottom + 2 >= event.clientY;
3828
- });
3829
- var index = rects.indexOf(cursorRect);
3830
- cursorRectIndex = index > -1 ? index : cursorRectIndex;
3831
- }
3832
- },
3833
- onHidden: function onHidden() {
3834
- cursorRectIndex = -1;
3835
- }
3836
- };
3837
- }
3838
- };
3839
- function getInlineBoundingClientRect(currentBasePlacement, boundingRect, clientRects, cursorRectIndex) {
3840
- // Not an inline element, or placement is not yet known
3841
- if (clientRects.length < 2 || currentBasePlacement === null) {
3842
- return boundingRect;
3843
- } // There are two rects and they are disjoined
3844
-
3845
-
3846
- if (clientRects.length === 2 && cursorRectIndex >= 0 && clientRects[0].left > clientRects[1].right) {
3847
- return clientRects[cursorRectIndex] || boundingRect;
3848
- }
3849
-
3850
- switch (currentBasePlacement) {
3851
- case 'top':
3852
- case 'bottom':
3853
- {
3854
- var firstRect = clientRects[0];
3855
- var lastRect = clientRects[clientRects.length - 1];
3856
- var isTop = currentBasePlacement === 'top';
3857
- var top = firstRect.top;
3858
- var bottom = lastRect.bottom;
3859
- var left = isTop ? firstRect.left : lastRect.left;
3860
- var right = isTop ? firstRect.right : lastRect.right;
3861
- var width = right - left;
3862
- var height = bottom - top;
3863
- return {
3864
- top: top,
3865
- bottom: bottom,
3866
- left: left,
3867
- right: right,
3868
- width: width,
3869
- height: height
3870
- };
3871
- }
3872
-
3873
- case 'left':
3874
- case 'right':
3875
- {
3876
- var minLeft = Math.min.apply(Math, clientRects.map(function (rects) {
3877
- return rects.left;
3878
- }));
3879
- var maxRight = Math.max.apply(Math, clientRects.map(function (rects) {
3880
- return rects.right;
3881
- }));
3882
- var measureRects = clientRects.filter(function (rect) {
3883
- return currentBasePlacement === 'left' ? rect.left === minLeft : rect.right === maxRight;
3884
- });
3885
- var _top = measureRects[0].top;
3886
- var _bottom = measureRects[measureRects.length - 1].bottom;
3887
- var _left = minLeft;
3888
- var _right = maxRight;
3889
-
3890
- var _width = _right - _left;
3891
-
3892
- var _height = _bottom - _top;
3893
-
3894
- return {
3895
- top: _top,
3896
- bottom: _bottom,
3897
- left: _left,
3898
- right: _right,
3899
- width: _width,
3900
- height: _height
3901
- };
3902
- }
3903
-
3904
- default:
3905
- {
3906
- return boundingRect;
3907
- }
3908
- }
3909
- }
3910
-
3911
- var sticky = {
3912
- name: 'sticky',
3913
- defaultValue: false,
3914
- fn: function fn(instance) {
3915
- var reference = instance.reference,
3916
- popper = instance.popper;
3917
-
3918
- function getReference() {
3919
- return instance.popperInstance ? instance.popperInstance.state.elements.reference : reference;
3920
- }
3921
-
3922
- function shouldCheck(value) {
3923
- return instance.props.sticky === true || instance.props.sticky === value;
3924
- }
3925
-
3926
- var prevRefRect = null;
3927
- var prevPopRect = null;
3928
-
3929
- function updatePosition() {
3930
- var currentRefRect = shouldCheck('reference') ? getReference().getBoundingClientRect() : null;
3931
- var currentPopRect = shouldCheck('popper') ? popper.getBoundingClientRect() : null;
3932
-
3933
- if (currentRefRect && areRectsDifferent(prevRefRect, currentRefRect) || currentPopRect && areRectsDifferent(prevPopRect, currentPopRect)) {
3934
- if (instance.popperInstance) {
3935
- instance.popperInstance.update();
3936
- }
3937
- }
3938
-
3939
- prevRefRect = currentRefRect;
3940
- prevPopRect = currentPopRect;
3941
-
3942
- if (instance.state.isMounted) {
3943
- requestAnimationFrame(updatePosition);
3944
- }
3945
- }
3946
-
3947
- return {
3948
- onMount: function onMount() {
3949
- if (instance.props.sticky) {
3950
- updatePosition();
3951
- }
3952
- }
3953
- };
3954
- }
3955
- };
3956
-
3957
- function areRectsDifferent(rectA, rectB) {
3958
- if (rectA && rectB) {
3959
- return rectA.top !== rectB.top || rectA.right !== rectB.right || rectA.bottom !== rectB.bottom || rectA.left !== rectB.left;
3960
- }
3961
-
3962
- return true;
3963
- }
3964
-
3965
- tippy.setDefaultProps({
3966
- render: render
3967
- });
3968
-
3969
- tippy.setDefaultProps({
3970
- //@ts-ignore
3971
- onShow: instance => {
3972
- if (!instance.props.content)
3973
- return false;
3974
- },
3975
- });
3976
- const isComponentInstance = (value) => {
3977
- return value instanceof Object && '$' in value && '$el' in value;
3978
- };
3979
- function useTippy(el, opts = {}, settings = { mount: true, appName: 'Tippy' }) {
3980
- settings = Object.assign({ mount: true, appName: 'Tippy' }, settings);
3981
- const vm = getCurrentInstance();
3982
- const instance = ref();
3983
- const state = ref({
3984
- isEnabled: false,
3985
- isVisible: false,
3986
- isDestroyed: false,
3987
- isMounted: false,
3988
- isShown: false,
3989
- });
3990
- const headlessApp = shallowRef();
3991
- let container = null;
3992
- const getContainer = () => {
3993
- if (container)
3994
- return container;
3995
- container = document.createDocumentFragment();
3996
- return container;
3997
- };
3998
- const getContent = (content) => {
3999
- let newContent;
4000
- let unwrappedContent = isRef(content)
4001
- ? content.value
4002
- : content;
4003
- if (isVNode(unwrappedContent)) {
4004
- if (!headlessApp.value) {
4005
- headlessApp.value = createApp({
4006
- name: settings.appName,
4007
- setup: () => {
4008
- return () => isRef(content) ? content.value : content;
4009
- },
4010
- });
4011
- if (vm) {
4012
- Object.assign(headlessApp.value._context, vm.appContext);
4013
- }
4014
- headlessApp.value.mount(getContainer());
4015
- }
4016
- newContent = () => getContainer();
4017
- }
4018
- else if (typeof unwrappedContent === 'object') {
4019
- if (!headlessApp.value) {
4020
- headlessApp.value = createApp({
4021
- name: settings.appName,
4022
- setup: () => {
4023
- return () => h(isRef(content) ? content.value : content);
4024
- },
4025
- });
4026
- if (vm) {
4027
- Object.assign(headlessApp.value._context, vm.appContext);
4028
- }
4029
- headlessApp.value.mount(getContainer());
4030
- }
4031
- newContent = () => getContainer();
4032
- }
4033
- else {
4034
- newContent = unwrappedContent;
4035
- }
4036
- return newContent;
4037
- };
4038
- const getProps = (opts) => {
4039
- let options = {};
4040
- if (isRef(opts)) {
4041
- options = opts.value || {};
4042
- }
4043
- else if (isReactive(opts)) {
4044
- options = { ...opts };
4045
- }
4046
- else {
4047
- options = { ...opts };
4048
- }
4049
- if (options.content) {
4050
- options.content = getContent(options.content);
4051
- }
4052
- if (options.triggerTarget) {
4053
- options.triggerTarget = isRef(options.triggerTarget)
4054
- ? options.triggerTarget.value
4055
- : options.triggerTarget;
4056
- }
4057
- if (!options.plugins || !Array.isArray(options.plugins)) {
4058
- options.plugins = [];
4059
- }
4060
- options.plugins = options.plugins.filter((plugin) => plugin.name !== 'vueTippyReactiveState');
4061
- options.plugins.push({
4062
- name: 'vueTippyReactiveState',
4063
- fn: () => {
4064
- return {
4065
- onCreate() {
4066
- state.value.isEnabled = true;
4067
- },
4068
- onMount() {
4069
- state.value.isMounted = true;
4070
- },
4071
- onShow() {
4072
- state.value.isMounted = true;
4073
- state.value.isVisible = true;
4074
- },
4075
- onShown() {
4076
- state.value.isShown = true;
4077
- },
4078
- onHide() {
4079
- state.value.isMounted = false;
4080
- state.value.isVisible = false;
4081
- },
4082
- onHidden() {
4083
- state.value.isShown = false;
4084
- },
4085
- onUnmounted() {
4086
- state.value.isMounted = false;
4087
- },
4088
- onDestroy() {
4089
- state.value.isDestroyed = true;
4090
- },
4091
- };
4092
- }
4093
- });
4094
- return options;
4095
- };
4096
- const refresh = () => {
4097
- if (!instance.value)
4098
- return;
4099
- instance.value.setProps(getProps(opts));
4100
- };
4101
- const refreshContent = () => {
4102
- if (!instance.value || !opts.content)
4103
- return;
4104
- instance.value.setContent(getContent(opts.content));
4105
- };
4106
- const setContent = (value) => {
4107
- var _a;
4108
- (_a = instance.value) === null || _a === void 0 ? void 0 : _a.setContent(getContent(value));
4109
- };
4110
- const setProps = (value) => {
4111
- var _a;
4112
- (_a = instance.value) === null || _a === void 0 ? void 0 : _a.setProps(getProps(value));
4113
- };
4114
- const destroy = () => {
4115
- var _a;
4116
- if (instance.value) {
4117
- instance.value.destroy();
4118
- instance.value = undefined;
4119
- }
4120
- container = null;
4121
- (_a = headlessApp.value) === null || _a === void 0 ? void 0 : _a.unmount();
4122
- headlessApp.value = undefined;
4123
- };
4124
- const show = () => {
4125
- var _a;
4126
- (_a = instance.value) === null || _a === void 0 ? void 0 : _a.show();
4127
- };
4128
- const hide = () => {
4129
- var _a;
4130
- (_a = instance.value) === null || _a === void 0 ? void 0 : _a.hide();
4131
- };
4132
- const disable = () => {
4133
- var _a;
4134
- (_a = instance.value) === null || _a === void 0 ? void 0 : _a.disable();
4135
- state.value.isEnabled = false;
4136
- };
4137
- const enable = () => {
4138
- var _a;
4139
- (_a = instance.value) === null || _a === void 0 ? void 0 : _a.enable();
4140
- state.value.isEnabled = true;
4141
- };
4142
- const unmount = () => {
4143
- var _a;
4144
- (_a = instance.value) === null || _a === void 0 ? void 0 : _a.unmount();
4145
- };
4146
- const mount = () => {
4147
- if (!el)
4148
- return;
4149
- let target = isRef(el) ? el.value : el;
4150
- if (typeof target === 'function')
4151
- target = target();
4152
- if (isComponentInstance(target)) {
4153
- target = target.$el;
4154
- }
4155
- if (target) {
4156
- //@ts-ignore
4157
- instance.value = tippy(target, getProps(opts));
4158
- //@ts-ignore
4159
- target.$tippy = response;
4160
- }
4161
- };
4162
- const response = {
4163
- tippy: instance,
4164
- refresh,
4165
- refreshContent,
4166
- setContent,
4167
- setProps,
4168
- destroy,
4169
- hide,
4170
- show,
4171
- disable,
4172
- enable,
4173
- unmount,
4174
- mount,
4175
- state,
4176
- };
4177
- if (settings.mount) {
4178
- if (vm) {
4179
- if (vm.isMounted) {
4180
- mount();
4181
- }
4182
- else {
4183
- onMounted(mount);
4184
- }
4185
- }
4186
- else {
4187
- mount();
4188
- }
4189
- }
4190
- if (vm) {
4191
- onUnmounted(() => {
4192
- destroy();
4193
- });
4194
- }
4195
- if (isRef(opts) || isReactive(opts)) {
4196
- watch(opts, refresh, { immediate: false });
4197
- }
4198
- else if (isRef(opts.content)) {
4199
- watch(opts.content, refreshContent, { immediate: false });
4200
- }
4201
- return response;
4202
- }
4203
-
4204
- function useTippyComponent(opts = {}, children) {
4205
- const instance = ref();
4206
- return {
4207
- instance,
4208
- TippyComponent: h(TippyComponent, {
4209
- ...opts,
4210
- onVnodeMounted: (vnode) => {
4211
- //@ts-ignore
4212
- instance.value = vnode.component.ctx;
4213
- },
4214
- }, children),
4215
- };
4216
- }
4217
-
4218
- function useSingleton(instances, optionalProps) {
4219
- const singleton = ref();
4220
- onMounted(() => {
4221
- const pendingTippyInstances = Array.isArray(instances)
4222
- ? instances.map(i => i.value)
4223
- : typeof instances === 'function'
4224
- ? instances()
4225
- : instances.value;
4226
- const tippyInstances = pendingTippyInstances
4227
- .map((instance) => {
4228
- if (instance instanceof Element) {
4229
- //@ts-ignore
4230
- return instance._tippy;
4231
- }
4232
- return instance;
4233
- })
4234
- .filter(Boolean);
4235
- singleton.value = createSingleton(tippyInstances, optionalProps
4236
- ? { allowHTML: true, ...optionalProps }
4237
- : { allowHTML: true });
4238
- });
4239
- return {
4240
- singleton,
4241
- };
4242
- }
4243
-
4244
- function toValue(r) {
4245
- return typeof r === 'function'
4246
- ? r()
4247
- : unref(r);
4248
- }
4249
- function unrefElement(elRef) {
4250
- var _a, _b;
4251
- const plain = toValue(elRef);
4252
- return (_b = (_a = plain) === null || _a === void 0 ? void 0 : _a.$el) !== null && _b !== void 0 ? _b : plain;
4253
- }
4254
- const TippyComponent = defineComponent({
4255
- props: {
4256
- to: {
4257
- type: [String, Function],
4258
- },
4259
- tag: {
4260
- type: [String, Object],
4261
- default: 'span'
4262
- },
4263
- contentTag: {
4264
- type: [String, Object],
4265
- default: 'span'
4266
- },
4267
- contentClass: {
4268
- type: String,
4269
- default: null
4270
- },
4271
- appendTo: { default: () => tippy.defaultProps['appendTo'] },
4272
- aria: { default: () => tippy.defaultProps['aria'] },
4273
- delay: { default: () => tippy.defaultProps['delay'] },
4274
- duration: { default: () => tippy.defaultProps['duration'] },
4275
- getReferenceClientRect: { default: () => tippy.defaultProps['getReferenceClientRect'] },
4276
- hideOnClick: { type: [Boolean, String], default: () => tippy.defaultProps['hideOnClick'] },
4277
- ignoreAttributes: { type: Boolean, default: () => tippy.defaultProps['ignoreAttributes'] },
4278
- interactive: { type: Boolean, default: () => tippy.defaultProps['interactive'] },
4279
- interactiveBorder: { default: () => tippy.defaultProps['interactiveBorder'] },
4280
- interactiveDebounce: { default: () => tippy.defaultProps['interactiveDebounce'] },
4281
- moveTransition: { default: () => tippy.defaultProps['moveTransition'] },
4282
- offset: { default: () => tippy.defaultProps['offset'] },
4283
- onAfterUpdate: { default: () => tippy.defaultProps['onAfterUpdate'] },
4284
- onBeforeUpdate: { default: () => tippy.defaultProps['onBeforeUpdate'] },
4285
- onCreate: { default: () => tippy.defaultProps['onCreate'] },
4286
- onDestroy: { default: () => tippy.defaultProps['onDestroy'] },
4287
- onHidden: { default: () => tippy.defaultProps['onHidden'] },
4288
- onHide: { default: () => tippy.defaultProps['onHide'] },
4289
- onMount: { default: () => tippy.defaultProps['onMount'] },
4290
- onShow: { default: () => tippy.defaultProps['onShow'] },
4291
- onShown: { default: () => tippy.defaultProps['onShown'] },
4292
- onTrigger: { default: () => tippy.defaultProps['onTrigger'] },
4293
- onUntrigger: { default: () => tippy.defaultProps['onUntrigger'] },
4294
- onClickOutside: { default: () => tippy.defaultProps['onClickOutside'] },
4295
- placement: { default: () => tippy.defaultProps['placement'] },
4296
- plugins: { default: () => tippy.defaultProps['plugins'] },
4297
- popperOptions: { default: () => tippy.defaultProps['popperOptions'] },
4298
- render: { default: () => tippy.defaultProps['render'] },
4299
- showOnCreate: { type: Boolean, default: () => tippy.defaultProps['showOnCreate'] },
4300
- touch: { type: [Boolean, String, Array], default: () => tippy.defaultProps['touch'] },
4301
- trigger: { default: () => tippy.defaultProps['trigger'] },
4302
- triggerTarget: { default: () => tippy.defaultProps['triggerTarget'] },
4303
- animateFill: { type: Boolean, default: () => tippy.defaultProps['animateFill'] },
4304
- followCursor: { type: [Boolean, String], default: () => tippy.defaultProps['followCursor'] },
4305
- inlinePositioning: { type: Boolean, default: () => tippy.defaultProps['inlinePositioning'] },
4306
- sticky: { type: [Boolean, String], default: () => tippy.defaultProps['sticky'] },
4307
- allowHTML: { type: Boolean, default: () => tippy.defaultProps['allowHTML'] },
4308
- animation: { default: () => tippy.defaultProps['animation'] },
4309
- arrow: { default: () => tippy.defaultProps['arrow'] },
4310
- content: { default: () => tippy.defaultProps['content'] },
4311
- inertia: { default: () => tippy.defaultProps['inertia'] },
4312
- maxWidth: { default: () => tippy.defaultProps['maxWidth'] },
4313
- role: { default: () => tippy.defaultProps['role'] },
4314
- theme: { default: () => tippy.defaultProps['theme'] },
4315
- zIndex: { default: () => tippy.defaultProps['zIndex'] }
4316
- },
4317
- emits: ['state'],
4318
- setup(props, { slots, emit, expose }) {
4319
- const elem = ref();
4320
- const findParentHelper = ref();
4321
- const contentElem = ref();
4322
- const mounted = ref(false);
4323
- const getOptions = () => {
4324
- let options = { ...props };
4325
- for (const prop of ['to', 'tag', 'contentTag', 'contentClass']) {
4326
- if (options.hasOwnProperty(prop)) {
4327
- // @ts-ignore
4328
- delete options[prop];
4329
- }
4330
- }
4331
- return options;
4332
- };
4333
- let target = () => unrefElement(elem);
4334
- if (props.to) {
4335
- if (typeof Element !== 'undefined' && props.to instanceof Element) {
4336
- target = () => props.to;
4337
- }
4338
- else if (props.to === 'parent') {
4339
- target = () => {
4340
- let el = elem.value;
4341
- if (!el) {
4342
- el = elem.value = findParentHelper.value.parentElement;
4343
- }
4344
- return el;
4345
- };
4346
- }
4347
- else if (typeof props.to === 'string' || props.to instanceof String) {
4348
- target = () => document.querySelector(props.to);
4349
- }
4350
- }
4351
- const tippy = useTippy(target, getOptions());
4352
- let contentSlot = slots.content;
4353
- if (!contentSlot && props.to === 'parent') {
4354
- contentSlot = slots.default;
4355
- }
4356
- onMounted(() => {
4357
- mounted.value = true;
4358
- nextTick(() => {
4359
- if (contentSlot)
4360
- tippy.setContent(() => contentElem.value);
4361
- });
4362
- });
4363
- watch(tippy.state, () => {
4364
- emit('state', unref(tippy.state));
4365
- }, { immediate: true, deep: true });
4366
- watch(() => props, () => {
4367
- tippy.setProps(getOptions());
4368
- if (contentSlot)
4369
- tippy.setContent(() => contentElem.value);
4370
- }, { deep: true });
4371
- let exposed = reactive({
4372
- elem,
4373
- contentElem,
4374
- mounted,
4375
- ...tippy
4376
- });
4377
- expose(exposed);
4378
- return () => {
4379
- const contentTag = typeof props.contentTag === 'string' ? props.contentTag : props.contentTag;
4380
- const content = contentSlot
4381
- ? h(contentTag, {
4382
- ref: contentElem,
4383
- style: { display: mounted.value ? 'inherit' : 'none' },
4384
- class: props.contentClass,
4385
- }, contentSlot(exposed))
4386
- : null;
4387
- if (props.to === 'parent') {
4388
- const result = [];
4389
- if (!elem.value) {
4390
- const findParentHelperNode = h('span', {
4391
- ref: findParentHelper,
4392
- 'data-v-tippy': '',
4393
- style: { display: 'none' },
4394
- });
4395
- result.push(findParentHelperNode);
4396
- }
4397
- if (content) {
4398
- result.push(content);
4399
- }
4400
- return result;
4401
- }
4402
- const slot = slots.default ? slots.default(exposed) : [];
4403
- if (!props.tag) {
4404
- const trigger = h(slot[0], {
4405
- ref: elem, 'data-v-tippy': ''
4406
- });
4407
- return content ? [trigger, content] : trigger;
4408
- }
4409
- const tag = typeof props.tag === 'string' ? props.tag : props.tag;
4410
- return h(tag, { ref: elem, 'data-v-tippy': '' }, content ? [slot, content] : slot);
4411
- };
4412
- },
4413
- });
4414
-
4415
- const booleanProps = [
4416
- 'a11y',
4417
- 'allowHTML',
4418
- 'arrow',
4419
- 'flip',
4420
- 'flipOnUpdate',
4421
- 'hideOnClick',
4422
- 'ignoreAttributes',
4423
- 'inertia',
4424
- 'interactive',
4425
- 'lazy',
4426
- 'multiple',
4427
- 'showOnInit',
4428
- 'touch',
4429
- 'touchHold',
4430
- ];
4431
- let props = {};
4432
- Object.keys(tippy.defaultProps).forEach((prop) => {
4433
- if (booleanProps.includes(prop)) {
4434
- props[prop] = {
4435
- type: Boolean,
4436
- default: function () {
4437
- return tippy.defaultProps[prop];
4438
- },
4439
- };
4440
- }
4441
- else {
4442
- props[prop] = {
4443
- default: function () {
4444
- return tippy.defaultProps[prop];
4445
- },
4446
- };
4447
- }
4448
- });
4449
- const TippySingleton = defineComponent({
4450
- props,
4451
- setup(props) {
4452
- const instances = ref([]);
4453
- const { singleton } = useSingleton(instances, props);
4454
- return { instances, singleton };
4455
- },
4456
- mounted() {
4457
- var _a;
4458
- const parent = this.$el.parentElement;
4459
- const elements = parent.querySelectorAll('[data-v-tippy]');
4460
- this.instances = Array.from(elements)
4461
- .map((el) => el._tippy)
4462
- .filter(Boolean);
4463
- (_a = this.singleton) === null || _a === void 0 ? void 0 : _a.setInstances(this.instances);
4464
- },
4465
- render() {
4466
- let slot = this.$slots.default ? this.$slots.default() : [];
4467
- return h(() => slot);
4468
- },
4469
- });
4470
-
4471
- const directive = {
4472
- mounted(el, binding, vnode) {
4473
- const opts = typeof binding.value === "string" ? { content: binding.value } : binding.value || {};
4474
- const modifiers = Object.keys(binding.modifiers || {});
4475
- const placement = modifiers.find(modifier => modifier !== 'arrow');
4476
- const withArrow = modifiers.findIndex(modifier => modifier === 'arrow') !== -1;
4477
- if (placement) {
4478
- opts.placement = opts.placement || placement;
4479
- }
4480
- if (withArrow) {
4481
- opts.arrow = opts.arrow !== undefined ? opts.arrow : true;
4482
- }
4483
- if (vnode.props && vnode.props.onTippyShow) {
4484
- opts.onShow = function (...args) {
4485
- var _a;
4486
- return (_a = vnode.props) === null || _a === void 0 ? void 0 : _a.onTippyShow(...args);
4487
- };
4488
- }
4489
- if (vnode.props && vnode.props.onTippyShown) {
4490
- opts.onShown = function (...args) {
4491
- var _a;
4492
- return (_a = vnode.props) === null || _a === void 0 ? void 0 : _a.onTippyShown(...args);
4493
- };
4494
- }
4495
- if (vnode.props && vnode.props.onTippyHidden) {
4496
- opts.onHidden = function (...args) {
4497
- var _a;
4498
- return (_a = vnode.props) === null || _a === void 0 ? void 0 : _a.onTippyHidden(...args);
4499
- };
4500
- }
4501
- if (vnode.props && vnode.props.onTippyHide) {
4502
- opts.onHide = function (...args) {
4503
- var _a;
4504
- return (_a = vnode.props) === null || _a === void 0 ? void 0 : _a.onTippyHide(...args);
4505
- };
4506
- }
4507
- if (vnode.props && vnode.props.onTippyMount) {
4508
- opts.onMount = function (...args) {
4509
- var _a;
4510
- return (_a = vnode.props) === null || _a === void 0 ? void 0 : _a.onTippyMount(...args);
4511
- };
4512
- }
4513
- if (el.getAttribute('title') && !opts.content) {
4514
- opts.content = el.getAttribute('title');
4515
- el.removeAttribute('title');
4516
- }
4517
- if (el.getAttribute('content') && !opts.content) {
4518
- opts.content = el.getAttribute('content');
4519
- }
4520
- useTippy(el, opts);
4521
- },
4522
- unmounted(el) {
4523
- if (el.$tippy) {
4524
- el.$tippy.destroy();
4525
- }
4526
- else if (el._tippy) {
4527
- el._tippy.destroy();
4528
- }
4529
- },
4530
- updated(el, binding) {
4531
- const opts = typeof binding.value === "string" ? { content: binding.value } : binding.value || {};
4532
- // any kind of falsy content value, even undefined, should be treated as null - 'no tooltip to show'
4533
- if (!opts.content) {
4534
- opts.content = null;
4535
- }
4536
- if (el.getAttribute('title') && !opts.content) {
4537
- opts.content = el.getAttribute('title');
4538
- el.removeAttribute('title');
4539
- }
4540
- if (el.getAttribute('content') && !opts.content) {
4541
- opts.content = el.getAttribute('content');
4542
- }
4543
- if (el.$tippy) {
4544
- el.$tippy.setProps(opts || {});
4545
- }
4546
- else if (el._tippy) {
4547
- el._tippy.setProps(opts || {});
4548
- }
4549
- },
4550
- };
4551
-
4552
- const plugin = {
4553
- install(app, options = {}) {
4554
- tippy.setDefaultProps(options.defaultProps || {});
4555
- app.directive(options.directive || 'tippy', directive);
4556
- app.component(options.component || 'tippy', TippyComponent);
4557
- app.component(options.componentSingleton || 'tippy-singleton', TippySingleton);
4558
- },
4559
- };
4560
-
4561
- const setDefaultProps$1 = tippy.setDefaultProps;
4562
- setDefaultProps$1({
4563
- ignoreAttributes: true,
4564
- plugins: [sticky, inlinePositioning, followCursor, animateFill],
4565
- });
4566
-
4567
- export { TippyComponent as Tippy, TippySingleton, plugin as default, directive, hideAll, plugin, ROUND_ARROW as roundArrow, setDefaultProps$1 as setDefaultProps, tippy, useSingleton, useTippy, useTippyComponent };