@pine-ds/core 0.0.2-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (665) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/index-13500e25.js +2468 -0
  3. package/dist/cjs/index-13500e25.js.map +1 -0
  4. package/dist/cjs/index.cjs.js +4 -0
  5. package/dist/cjs/index.cjs.js.map +1 -0
  6. package/dist/cjs/loader.cjs.js +15 -0
  7. package/dist/cjs/loader.cjs.js.map +1 -0
  8. package/dist/cjs/pds-avatar.cjs.entry.js +70 -0
  9. package/dist/cjs/pds-avatar.cjs.entry.js.map +1 -0
  10. package/dist/cjs/pds-button.cjs.entry.js +57 -0
  11. package/dist/cjs/pds-button.cjs.entry.js.map +1 -0
  12. package/dist/cjs/pds-checkbox.cjs.entry.js +57 -0
  13. package/dist/cjs/pds-checkbox.cjs.entry.js.map +1 -0
  14. package/dist/cjs/pds-chip.cjs.entry.js +49 -0
  15. package/dist/cjs/pds-chip.cjs.entry.js.map +1 -0
  16. package/dist/cjs/pds-copytext.cjs.entry.js +68 -0
  17. package/dist/cjs/pds-copytext.cjs.entry.js.map +1 -0
  18. package/dist/cjs/pds-divider.cjs.entry.js +35 -0
  19. package/dist/cjs/pds-divider.cjs.entry.js.map +1 -0
  20. package/dist/cjs/pds-icon.cjs.entry.js +277 -0
  21. package/dist/cjs/pds-icon.cjs.entry.js.map +1 -0
  22. package/dist/cjs/pds-image.cjs.entry.js +31 -0
  23. package/dist/cjs/pds-image.cjs.entry.js.map +1 -0
  24. package/dist/cjs/pds-input.cjs.entry.js +44 -0
  25. package/dist/cjs/pds-input.cjs.entry.js.map +1 -0
  26. package/dist/cjs/pds-label-71ea2cad.js +44 -0
  27. package/dist/cjs/pds-label-71ea2cad.js.map +1 -0
  28. package/dist/cjs/pds-link.cjs.entry.js +37 -0
  29. package/dist/cjs/pds-link.cjs.entry.js.map +1 -0
  30. package/dist/cjs/pds-progress.cjs.entry.js +27 -0
  31. package/dist/cjs/pds-progress.cjs.entry.js.map +1 -0
  32. package/dist/cjs/pds-radio.cjs.entry.js +53 -0
  33. package/dist/cjs/pds-radio.cjs.entry.js.map +1 -0
  34. package/dist/cjs/pds-sortable-item.cjs.entry.js +24 -0
  35. package/dist/cjs/pds-sortable-item.cjs.entry.js.map +1 -0
  36. package/dist/cjs/pds-sortable.cjs.entry.js +2706 -0
  37. package/dist/cjs/pds-sortable.cjs.entry.js.map +1 -0
  38. package/dist/cjs/pds-switch.cjs.entry.js +55 -0
  39. package/dist/cjs/pds-switch.cjs.entry.js.map +1 -0
  40. package/dist/cjs/pds-tab.cjs.entry.js +33 -0
  41. package/dist/cjs/pds-tab.cjs.entry.js.map +1 -0
  42. package/dist/cjs/pds-tabpanel.cjs.entry.js +26 -0
  43. package/dist/cjs/pds-tabpanel.cjs.entry.js.map +1 -0
  44. package/dist/cjs/pds-tabs.cjs.entry.js +98 -0
  45. package/dist/cjs/pds-tabs.cjs.entry.js.map +1 -0
  46. package/dist/cjs/pds-textarea.cjs.entry.js +54 -0
  47. package/dist/cjs/pds-textarea.cjs.entry.js.map +1 -0
  48. package/dist/cjs/pds-tooltip.cjs.entry.js +151 -0
  49. package/dist/cjs/pds-tooltip.cjs.entry.js.map +1 -0
  50. package/dist/cjs/pine-core.cjs.js +25 -0
  51. package/dist/cjs/pine-core.cjs.js.map +1 -0
  52. package/dist/collection/collection-manifest.json +37 -0
  53. package/dist/collection/components/_internal/pds-label/pds-label.js +7 -0
  54. package/dist/collection/components/_internal/pds-label/pds-label.js.map +1 -0
  55. package/dist/collection/components/pds-avatar/pds-avatar.css +59 -0
  56. package/dist/collection/components/pds-avatar/pds-avatar.js +217 -0
  57. package/dist/collection/components/pds-avatar/pds-avatar.js.map +1 -0
  58. package/dist/collection/components/pds-avatar/stories/pds-avatar.stories.js +65 -0
  59. package/dist/collection/components/pds-button/pds-button.css +122 -0
  60. package/dist/collection/components/pds-button/pds-button.js +187 -0
  61. package/dist/collection/components/pds-button/pds-button.js.map +1 -0
  62. package/dist/collection/components/pds-button/stories/pds-button.stories.js +65 -0
  63. package/dist/collection/components/pds-checkbox/pds-checkbox.css +106 -0
  64. package/dist/collection/components/pds-checkbox/pds-checkbox.js +266 -0
  65. package/dist/collection/components/pds-checkbox/pds-checkbox.js.map +1 -0
  66. package/dist/collection/components/pds-checkbox/stories/pds-checkbox.stories.js +80 -0
  67. package/dist/collection/components/pds-chip/pds-chip.css +245 -0
  68. package/dist/collection/components/pds-chip/pds-chip.js +188 -0
  69. package/dist/collection/components/pds-chip/pds-chip.js.map +1 -0
  70. package/dist/collection/components/pds-chip/stories/pds-chip.stories.js +79 -0
  71. package/dist/collection/components/pds-copytext/pds-copytext.css +85 -0
  72. package/dist/collection/components/pds-copytext/pds-copytext.js +186 -0
  73. package/dist/collection/components/pds-copytext/pds-copytext.js.map +1 -0
  74. package/dist/collection/components/pds-copytext/stories/pds-copytext.stories.js +57 -0
  75. package/dist/collection/components/pds-divider/pds-divider.css +92 -0
  76. package/dist/collection/components/pds-divider/pds-divider.js +94 -0
  77. package/dist/collection/components/pds-divider/pds-divider.js.map +1 -0
  78. package/dist/collection/components/pds-divider/stories/pds-divider.stories.js +25 -0
  79. package/dist/collection/components/pds-icon/stories/pds-icon.stories.js +16 -0
  80. package/dist/collection/components/pds-image/pds-image.css +13 -0
  81. package/dist/collection/components/pds-image/pds-image.js +173 -0
  82. package/dist/collection/components/pds-image/pds-image.js.map +1 -0
  83. package/dist/collection/components/pds-image/stories/pds-image.stories.js +35 -0
  84. package/dist/collection/components/pds-input/pds-input.css +88 -0
  85. package/dist/collection/components/pds-input/pds-input.js +279 -0
  86. package/dist/collection/components/pds-input/pds-input.js.map +1 -0
  87. package/dist/collection/components/pds-input/stories/pds-input.stories.js +110 -0
  88. package/dist/collection/components/pds-link/pds-link.css +67 -0
  89. package/dist/collection/components/pds-link/pds-link.js +138 -0
  90. package/dist/collection/components/pds-link/pds-link.js.map +1 -0
  91. package/dist/collection/components/pds-link/stories/pds-link.stories.js +49 -0
  92. package/dist/collection/components/pds-progress/pds-progress.css +77 -0
  93. package/dist/collection/components/pds-progress/pds-progress.js +148 -0
  94. package/dist/collection/components/pds-progress/pds-progress.js.map +1 -0
  95. package/dist/collection/components/pds-progress/stories/pds-progress.stories.js +65 -0
  96. package/dist/collection/components/pds-radio/pds-radio.css +101 -0
  97. package/dist/collection/components/pds-radio/pds-radio.js +261 -0
  98. package/dist/collection/components/pds-radio/pds-radio.js.map +1 -0
  99. package/dist/collection/components/pds-radio/stories/pds-radio.stories.js +71 -0
  100. package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.css +63 -0
  101. package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.js +90 -0
  102. package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.js.map +1 -0
  103. package/dist/collection/components/pds-sortable/pds-sortable-item/stories/pds-sortable-item.stories.js +24 -0
  104. package/dist/collection/components/pds-sortable/pds-sortable.css +10 -0
  105. package/dist/collection/components/pds-sortable/pds-sortable.js +150 -0
  106. package/dist/collection/components/pds-sortable/pds-sortable.js.map +1 -0
  107. package/dist/collection/components/pds-sortable/stories/pds-sortable.stories.js +130 -0
  108. package/dist/collection/components/pds-switch/pds-switch.css +134 -0
  109. package/dist/collection/components/pds-switch/pds-switch.js +277 -0
  110. package/dist/collection/components/pds-switch/pds-switch.js.map +1 -0
  111. package/dist/collection/components/pds-switch/stories/pds-switch.stories.js +102 -0
  112. package/dist/collection/components/pds-tabs/pds-tab/pds-tab.css +158 -0
  113. package/dist/collection/components/pds-tabs/pds-tab/pds-tab.js +154 -0
  114. package/dist/collection/components/pds-tabs/pds-tab/pds-tab.js.map +1 -0
  115. package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.css +12 -0
  116. package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.js +107 -0
  117. package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.js.map +1 -0
  118. package/dist/collection/components/pds-tabs/pds-tabs.css +33 -0
  119. package/dist/collection/components/pds-tabs/pds-tabs.js +209 -0
  120. package/dist/collection/components/pds-tabs/pds-tabs.js.map +1 -0
  121. package/dist/collection/components/pds-tabs/stories/pds-tabs.stories.js +63 -0
  122. package/dist/collection/components/pds-textarea/pds-textarea.css +84 -0
  123. package/dist/collection/components/pds-textarea/pds-textarea.js +303 -0
  124. package/dist/collection/components/pds-textarea/pds-textarea.js.map +1 -0
  125. package/dist/collection/components/pds-textarea/stories/pds-textarea.stories.js +111 -0
  126. package/dist/collection/components/pds-textarea/textarea-interface.js +2 -0
  127. package/dist/collection/components/pds-textarea/textarea-interface.js.map +1 -0
  128. package/dist/collection/components/pds-tooltip/pds-tooltip.css +143 -0
  129. package/dist/collection/components/pds-tooltip/pds-tooltip.js +287 -0
  130. package/dist/collection/components/pds-tooltip/pds-tooltip.js.map +1 -0
  131. package/dist/collection/components/pds-tooltip/stories/pds-tooltip.stories.js +114 -0
  132. package/dist/collection/global/pine-ui-global.js +2 -0
  133. package/dist/collection/global/pine-ui-global.js.map +1 -0
  134. package/dist/collection/index.js +2 -0
  135. package/dist/collection/index.js.map +1 -0
  136. package/dist/collection/stories/_helpers/index.js +15 -0
  137. package/dist/collection/stories/_helpers/index.js.map +1 -0
  138. package/dist/collection/utils/form.js +28 -0
  139. package/dist/collection/utils/form.js.map +1 -0
  140. package/dist/collection/utils/overlay.js +68 -0
  141. package/dist/collection/utils/overlay.js.map +1 -0
  142. package/dist/collection/utils/types.js +2 -0
  143. package/dist/collection/utils/types.js.map +1 -0
  144. package/dist/collection/utils/utils.js +7 -0
  145. package/dist/collection/utils/utils.js.map +1 -0
  146. package/dist/docs.d.ts +421 -0
  147. package/dist/docs.json +3718 -0
  148. package/dist/esm/index-a58668b3.js +2438 -0
  149. package/dist/esm/index-a58668b3.js.map +1 -0
  150. package/dist/esm/index.js +3 -0
  151. package/dist/esm/index.js.map +1 -0
  152. package/dist/esm/loader.js +11 -0
  153. package/dist/esm/loader.js.map +1 -0
  154. package/dist/esm/pds-avatar.entry.js +66 -0
  155. package/dist/esm/pds-avatar.entry.js.map +1 -0
  156. package/dist/esm/pds-button.entry.js +53 -0
  157. package/dist/esm/pds-button.entry.js.map +1 -0
  158. package/dist/esm/pds-checkbox.entry.js +53 -0
  159. package/dist/esm/pds-checkbox.entry.js.map +1 -0
  160. package/dist/esm/pds-chip.entry.js +45 -0
  161. package/dist/esm/pds-chip.entry.js.map +1 -0
  162. package/dist/esm/pds-copytext.entry.js +64 -0
  163. package/dist/esm/pds-copytext.entry.js.map +1 -0
  164. package/dist/esm/pds-divider.entry.js +31 -0
  165. package/dist/esm/pds-divider.entry.js.map +1 -0
  166. package/dist/esm/pds-icon.entry.js +273 -0
  167. package/dist/esm/pds-icon.entry.js.map +1 -0
  168. package/dist/esm/pds-image.entry.js +27 -0
  169. package/dist/esm/pds-image.entry.js.map +1 -0
  170. package/dist/esm/pds-input.entry.js +40 -0
  171. package/dist/esm/pds-input.entry.js.map +1 -0
  172. package/dist/esm/pds-label-a26dd876.js +39 -0
  173. package/dist/esm/pds-label-a26dd876.js.map +1 -0
  174. package/dist/esm/pds-link.entry.js +33 -0
  175. package/dist/esm/pds-link.entry.js.map +1 -0
  176. package/dist/esm/pds-progress.entry.js +23 -0
  177. package/dist/esm/pds-progress.entry.js.map +1 -0
  178. package/dist/esm/pds-radio.entry.js +49 -0
  179. package/dist/esm/pds-radio.entry.js.map +1 -0
  180. package/dist/esm/pds-sortable-item.entry.js +20 -0
  181. package/dist/esm/pds-sortable-item.entry.js.map +1 -0
  182. package/dist/esm/pds-sortable.entry.js +2702 -0
  183. package/dist/esm/pds-sortable.entry.js.map +1 -0
  184. package/dist/esm/pds-switch.entry.js +51 -0
  185. package/dist/esm/pds-switch.entry.js.map +1 -0
  186. package/dist/esm/pds-tab.entry.js +29 -0
  187. package/dist/esm/pds-tab.entry.js.map +1 -0
  188. package/dist/esm/pds-tabpanel.entry.js +22 -0
  189. package/dist/esm/pds-tabpanel.entry.js.map +1 -0
  190. package/dist/esm/pds-tabs.entry.js +94 -0
  191. package/dist/esm/pds-tabs.entry.js.map +1 -0
  192. package/dist/esm/pds-textarea.entry.js +50 -0
  193. package/dist/esm/pds-textarea.entry.js.map +1 -0
  194. package/dist/esm/pds-tooltip.entry.js +147 -0
  195. package/dist/esm/pds-tooltip.entry.js.map +1 -0
  196. package/dist/esm/pine-core.js +20 -0
  197. package/dist/esm/pine-core.js.map +1 -0
  198. package/dist/esm/polyfills/core-js.js +11 -0
  199. package/dist/esm/polyfills/dom.js +79 -0
  200. package/dist/esm/polyfills/es5-html-element.js +1 -0
  201. package/dist/esm/polyfills/index.js +34 -0
  202. package/dist/esm/polyfills/system.js +6 -0
  203. package/dist/esm-es5/index-a58668b3.js +3 -0
  204. package/dist/esm-es5/index-a58668b3.js.map +1 -0
  205. package/dist/esm-es5/index.js +2 -0
  206. package/dist/esm-es5/index.js.map +1 -0
  207. package/dist/esm-es5/loader.js +2 -0
  208. package/dist/esm-es5/loader.js.map +1 -0
  209. package/dist/esm-es5/pds-avatar.entry.js +2 -0
  210. package/dist/esm-es5/pds-avatar.entry.js.map +1 -0
  211. package/dist/esm-es5/pds-button.entry.js +2 -0
  212. package/dist/esm-es5/pds-button.entry.js.map +1 -0
  213. package/dist/esm-es5/pds-checkbox.entry.js +2 -0
  214. package/dist/esm-es5/pds-checkbox.entry.js.map +1 -0
  215. package/dist/esm-es5/pds-chip.entry.js +2 -0
  216. package/dist/esm-es5/pds-chip.entry.js.map +1 -0
  217. package/dist/esm-es5/pds-copytext.entry.js +2 -0
  218. package/dist/esm-es5/pds-copytext.entry.js.map +1 -0
  219. package/dist/esm-es5/pds-divider.entry.js +2 -0
  220. package/dist/esm-es5/pds-divider.entry.js.map +1 -0
  221. package/dist/esm-es5/pds-icon.entry.js +2 -0
  222. package/dist/esm-es5/pds-icon.entry.js.map +1 -0
  223. package/dist/esm-es5/pds-image.entry.js +2 -0
  224. package/dist/esm-es5/pds-image.entry.js.map +1 -0
  225. package/dist/esm-es5/pds-input.entry.js +2 -0
  226. package/dist/esm-es5/pds-input.entry.js.map +1 -0
  227. package/dist/esm-es5/pds-label-a26dd876.js +2 -0
  228. package/dist/esm-es5/pds-label-a26dd876.js.map +1 -0
  229. package/dist/esm-es5/pds-link.entry.js +2 -0
  230. package/dist/esm-es5/pds-link.entry.js.map +1 -0
  231. package/dist/esm-es5/pds-progress.entry.js +2 -0
  232. package/dist/esm-es5/pds-progress.entry.js.map +1 -0
  233. package/dist/esm-es5/pds-radio.entry.js +2 -0
  234. package/dist/esm-es5/pds-radio.entry.js.map +1 -0
  235. package/dist/esm-es5/pds-sortable-item.entry.js +2 -0
  236. package/dist/esm-es5/pds-sortable-item.entry.js.map +1 -0
  237. package/dist/esm-es5/pds-sortable.entry.js +8 -0
  238. package/dist/esm-es5/pds-sortable.entry.js.map +1 -0
  239. package/dist/esm-es5/pds-switch.entry.js +2 -0
  240. package/dist/esm-es5/pds-switch.entry.js.map +1 -0
  241. package/dist/esm-es5/pds-tab.entry.js +2 -0
  242. package/dist/esm-es5/pds-tab.entry.js.map +1 -0
  243. package/dist/esm-es5/pds-tabpanel.entry.js +2 -0
  244. package/dist/esm-es5/pds-tabpanel.entry.js.map +1 -0
  245. package/dist/esm-es5/pds-tabs.entry.js +2 -0
  246. package/dist/esm-es5/pds-tabs.entry.js.map +1 -0
  247. package/dist/esm-es5/pds-textarea.entry.js +2 -0
  248. package/dist/esm-es5/pds-textarea.entry.js.map +1 -0
  249. package/dist/esm-es5/pds-tooltip.entry.js +2 -0
  250. package/dist/esm-es5/pds-tooltip.entry.js.map +1 -0
  251. package/dist/esm-es5/pine-core.js +2 -0
  252. package/dist/esm-es5/pine-core.js.map +1 -0
  253. package/dist/index.cjs.js +1 -0
  254. package/dist/index.js +1 -0
  255. package/dist/pine-core/index.esm.js +2 -0
  256. package/dist/pine-core/index.esm.js.map +1 -0
  257. package/dist/pine-core/p-0a776a7b.entry.js +2 -0
  258. package/dist/pine-core/p-0a776a7b.entry.js.map +1 -0
  259. package/dist/pine-core/p-0adb4b48.entry.js +2 -0
  260. package/dist/pine-core/p-0adb4b48.entry.js.map +1 -0
  261. package/dist/pine-core/p-0c26a00d.entry.js +2 -0
  262. package/dist/pine-core/p-0c26a00d.entry.js.map +1 -0
  263. package/dist/pine-core/p-1c0ffcab.entry.js +2 -0
  264. package/dist/pine-core/p-1c0ffcab.entry.js.map +1 -0
  265. package/dist/pine-core/p-22bd3102.system.entry.js +9 -0
  266. package/dist/pine-core/p-22bd3102.system.entry.js.map +1 -0
  267. package/dist/pine-core/p-22dd8116.entry.js +2 -0
  268. package/dist/pine-core/p-22dd8116.entry.js.map +1 -0
  269. package/dist/pine-core/p-23fb6af2.system.entry.js +2 -0
  270. package/dist/pine-core/p-23fb6af2.system.entry.js.map +1 -0
  271. package/dist/pine-core/p-24077dcd.entry.js +2 -0
  272. package/dist/pine-core/p-24077dcd.entry.js.map +1 -0
  273. package/dist/pine-core/p-27fd7f08.system.entry.js +2 -0
  274. package/dist/pine-core/p-27fd7f08.system.entry.js.map +1 -0
  275. package/dist/pine-core/p-331cbf1d.entry.js +2 -0
  276. package/dist/pine-core/p-331cbf1d.entry.js.map +1 -0
  277. package/dist/pine-core/p-3386bfe1.system.entry.js +2 -0
  278. package/dist/pine-core/p-3386bfe1.system.entry.js.map +1 -0
  279. package/dist/pine-core/p-401cd4bc.entry.js +2 -0
  280. package/dist/pine-core/p-401cd4bc.entry.js.map +1 -0
  281. package/dist/pine-core/p-4a804680.entry.js +2 -0
  282. package/dist/pine-core/p-4a804680.entry.js.map +1 -0
  283. package/dist/pine-core/p-4fc42ff3.system.entry.js +2 -0
  284. package/dist/pine-core/p-4fc42ff3.system.entry.js.map +1 -0
  285. package/dist/pine-core/p-50ea2036.system.js +2 -0
  286. package/dist/pine-core/p-50ea2036.system.js.map +1 -0
  287. package/dist/pine-core/p-5b37a4a2.system.entry.js +2 -0
  288. package/dist/pine-core/p-5b37a4a2.system.entry.js.map +1 -0
  289. package/dist/pine-core/p-643f5378.entry.js +2 -0
  290. package/dist/pine-core/p-643f5378.entry.js.map +1 -0
  291. package/dist/pine-core/p-669d948a.system.entry.js +2 -0
  292. package/dist/pine-core/p-669d948a.system.entry.js.map +1 -0
  293. package/dist/pine-core/p-73262287.system.entry.js +2 -0
  294. package/dist/pine-core/p-73262287.system.entry.js.map +1 -0
  295. package/dist/pine-core/p-79d7e0b1.system.entry.js +2 -0
  296. package/dist/pine-core/p-79d7e0b1.system.entry.js.map +1 -0
  297. package/dist/pine-core/p-7bc01826.entry.js +2 -0
  298. package/dist/pine-core/p-7bc01826.entry.js.map +1 -0
  299. package/dist/pine-core/p-7fcd5f0b.entry.js +8 -0
  300. package/dist/pine-core/p-7fcd5f0b.entry.js.map +1 -0
  301. package/dist/pine-core/p-85f6a94e.system.entry.js +2 -0
  302. package/dist/pine-core/p-85f6a94e.system.entry.js.map +1 -0
  303. package/dist/pine-core/p-8f62c812.entry.js +2 -0
  304. package/dist/pine-core/p-8f62c812.entry.js.map +1 -0
  305. package/dist/pine-core/p-930ab8a3.system.entry.js +2 -0
  306. package/dist/pine-core/p-930ab8a3.system.entry.js.map +1 -0
  307. package/dist/pine-core/p-938886d8.system.entry.js +2 -0
  308. package/dist/pine-core/p-938886d8.system.entry.js.map +1 -0
  309. package/dist/pine-core/p-97cb4285.entry.js +2 -0
  310. package/dist/pine-core/p-97cb4285.entry.js.map +1 -0
  311. package/dist/pine-core/p-abdca153.js +3 -0
  312. package/dist/pine-core/p-abdca153.js.map +1 -0
  313. package/dist/pine-core/p-ac31a7c8.system.entry.js +2 -0
  314. package/dist/pine-core/p-ac31a7c8.system.entry.js.map +1 -0
  315. package/dist/pine-core/p-af75cc15.entry.js +2 -0
  316. package/dist/pine-core/p-af75cc15.entry.js.map +1 -0
  317. package/dist/pine-core/p-b17b818b.entry.js +2 -0
  318. package/dist/pine-core/p-b17b818b.entry.js.map +1 -0
  319. package/dist/pine-core/p-b79a8b07.entry.js +2 -0
  320. package/dist/pine-core/p-b79a8b07.entry.js.map +1 -0
  321. package/dist/pine-core/p-bce2d5b5.system.entry.js +2 -0
  322. package/dist/pine-core/p-bce2d5b5.system.entry.js.map +1 -0
  323. package/dist/pine-core/p-bff583bd.system.js +2 -0
  324. package/dist/pine-core/p-bff583bd.system.js.map +1 -0
  325. package/dist/pine-core/p-c0f9dbe1.system.entry.js +2 -0
  326. package/dist/pine-core/p-c0f9dbe1.system.entry.js.map +1 -0
  327. package/dist/pine-core/p-c4dbae0e.system.js +2 -0
  328. package/dist/pine-core/p-c4dbae0e.system.js.map +1 -0
  329. package/dist/pine-core/p-c6d878f8.entry.js +2 -0
  330. package/dist/pine-core/p-c6d878f8.entry.js.map +1 -0
  331. package/dist/pine-core/p-c8a41b43.system.entry.js +2 -0
  332. package/dist/pine-core/p-c8a41b43.system.entry.js.map +1 -0
  333. package/dist/pine-core/p-d3e173ea.system.entry.js +2 -0
  334. package/dist/pine-core/p-d3e173ea.system.entry.js.map +1 -0
  335. package/dist/pine-core/p-f09892d3.system.entry.js +2 -0
  336. package/dist/pine-core/p-f09892d3.system.entry.js.map +1 -0
  337. package/dist/pine-core/p-f168654a.entry.js +2 -0
  338. package/dist/pine-core/p-f168654a.entry.js.map +1 -0
  339. package/dist/pine-core/p-f1d7f16f.js +2 -0
  340. package/dist/pine-core/p-f1d7f16f.js.map +1 -0
  341. package/dist/pine-core/p-f2c3035d.system.entry.js +2 -0
  342. package/dist/pine-core/p-f2c3035d.system.entry.js.map +1 -0
  343. package/dist/pine-core/p-f3af6d74.system.entry.js +2 -0
  344. package/dist/pine-core/p-f3af6d74.system.entry.js.map +1 -0
  345. package/dist/pine-core/p-fa5d4e73.system.js +3 -0
  346. package/dist/pine-core/p-fa5d4e73.system.js.map +1 -0
  347. package/dist/pine-core/p-fba29e90.entry.js +2 -0
  348. package/dist/pine-core/p-fba29e90.entry.js.map +1 -0
  349. package/dist/pine-core/pine-core.css +1 -0
  350. package/dist/pine-core/pine-core.esm.js +2 -0
  351. package/dist/pine-core/pine-core.esm.js.map +1 -0
  352. package/dist/pine-core/pine-core.js +127 -0
  353. package/dist/pine-core/svg/access-key.svg +1 -0
  354. package/dist/pine-core/svg/add-circle.svg +1 -0
  355. package/dist/pine-core/svg/add-image.svg +1 -0
  356. package/dist/pine-core/svg/add-small.svg +1 -0
  357. package/dist/pine-core/svg/add.svg +1 -0
  358. package/dist/pine-core/svg/ai-sparkle.svg +1 -0
  359. package/dist/pine-core/svg/ai-writer-filled.svg +1 -0
  360. package/dist/pine-core/svg/ai-writer.svg +1 -0
  361. package/dist/pine-core/svg/align-center.svg +1 -0
  362. package/dist/pine-core/svg/align-justify.svg +1 -0
  363. package/dist/pine-core/svg/align-left.svg +1 -0
  364. package/dist/pine-core/svg/align-right.svg +1 -0
  365. package/dist/pine-core/svg/analytics-filled.svg +1 -0
  366. package/dist/pine-core/svg/analytics-outline.svg +1 -0
  367. package/dist/pine-core/svg/app-store.svg +1 -0
  368. package/dist/pine-core/svg/archive.svg +1 -0
  369. package/dist/pine-core/svg/arrow-corner.svg +1 -0
  370. package/dist/pine-core/svg/arrow-down.svg +1 -0
  371. package/dist/pine-core/svg/arrow-left.svg +1 -0
  372. package/dist/pine-core/svg/arrow-right.svg +1 -0
  373. package/dist/pine-core/svg/arrow-up.svg +1 -0
  374. package/dist/pine-core/svg/assessment.svg +1 -0
  375. package/dist/pine-core/svg/at-sign.svg +1 -0
  376. package/dist/pine-core/svg/attach.svg +1 -0
  377. package/dist/pine-core/svg/automations.svg +1 -0
  378. package/dist/pine-core/svg/ban.svg +1 -0
  379. package/dist/pine-core/svg/bank.svg +1 -0
  380. package/dist/pine-core/svg/bell.svg +1 -0
  381. package/dist/pine-core/svg/blog-filled.svg +1 -0
  382. package/dist/pine-core/svg/blog.svg +1 -0
  383. package/dist/pine-core/svg/bold.svg +1 -0
  384. package/dist/pine-core/svg/broadcast.svg +1 -0
  385. package/dist/pine-core/svg/calendar-date.svg +1 -0
  386. package/dist/pine-core/svg/calendar-schedule.svg +1 -0
  387. package/dist/pine-core/svg/calendar-simple.svg +1 -0
  388. package/dist/pine-core/svg/card-bw-amex.svg +1 -0
  389. package/dist/pine-core/svg/card-bw-apple-card.svg +1 -0
  390. package/dist/pine-core/svg/card-bw-diners-club.svg +1 -0
  391. package/dist/pine-core/svg/card-bw-discover.svg +1 -0
  392. package/dist/pine-core/svg/card-bw-gpay-card.svg +1 -0
  393. package/dist/pine-core/svg/card-bw-mastercard.svg +1 -0
  394. package/dist/pine-core/svg/card-bw-paypal.svg +1 -0
  395. package/dist/pine-core/svg/card-bw-stripe.svg +1 -0
  396. package/dist/pine-core/svg/card-bw-visa.svg +1 -0
  397. package/dist/pine-core/svg/card-update.svg +1 -0
  398. package/dist/pine-core/svg/caret-down.svg +1 -0
  399. package/dist/pine-core/svg/caret-left.svg +1 -0
  400. package/dist/pine-core/svg/caret-right.svg +1 -0
  401. package/dist/pine-core/svg/caret-up.svg +1 -0
  402. package/dist/pine-core/svg/cart-add.svg +1 -0
  403. package/dist/pine-core/svg/cart.svg +1 -0
  404. package/dist/pine-core/svg/certificate.svg +1 -0
  405. package/dist/pine-core/svg/check-circle-filled.svg +1 -0
  406. package/dist/pine-core/svg/check-circle.svg +1 -0
  407. package/dist/pine-core/svg/check.svg +1 -0
  408. package/dist/pine-core/svg/circle-1.svg +1 -0
  409. package/dist/pine-core/svg/circle-2.svg +1 -0
  410. package/dist/pine-core/svg/circle-3.svg +1 -0
  411. package/dist/pine-core/svg/circle-4.svg +1 -0
  412. package/dist/pine-core/svg/circle-5.svg +1 -0
  413. package/dist/pine-core/svg/circle-6.svg +1 -0
  414. package/dist/pine-core/svg/circle-7.svg +1 -0
  415. package/dist/pine-core/svg/circle-8.svg +1 -0
  416. package/dist/pine-core/svg/circle-9.svg +1 -0
  417. package/dist/pine-core/svg/clock.svg +1 -0
  418. package/dist/pine-core/svg/closed-captions.svg +1 -0
  419. package/dist/pine-core/svg/cloud-upload.svg +1 -0
  420. package/dist/pine-core/svg/code.svg +1 -0
  421. package/dist/pine-core/svg/color.svg +1 -0
  422. package/dist/pine-core/svg/columns.svg +1 -0
  423. package/dist/pine-core/svg/comment.svg +1 -0
  424. package/dist/pine-core/svg/connect.svg +1 -0
  425. package/dist/pine-core/svg/contact.svg +1 -0
  426. package/dist/pine-core/svg/contacts-filled.svg +1 -0
  427. package/dist/pine-core/svg/contacts-outline.svg +1 -0
  428. package/dist/pine-core/svg/conversation.svg +1 -0
  429. package/dist/pine-core/svg/copy.svg +1 -0
  430. package/dist/pine-core/svg/coupon.svg +1 -0
  431. package/dist/pine-core/svg/course.svg +1 -0
  432. package/dist/pine-core/svg/creator-studio-filled.svg +1 -0
  433. package/dist/pine-core/svg/creator-studio.svg +1 -0
  434. package/dist/pine-core/svg/credit-card.svg +1 -0
  435. package/dist/pine-core/svg/custom-field.svg +1 -0
  436. package/dist/pine-core/svg/customize.svg +1 -0
  437. package/dist/pine-core/svg/danger-filled.svg +1 -0
  438. package/dist/pine-core/svg/danger.svg +1 -0
  439. package/dist/pine-core/svg/dashboard-filled.svg +1 -0
  440. package/dist/pine-core/svg/dashboard-outline.svg +1 -0
  441. package/dist/pine-core/svg/delete-circle.svg +1 -0
  442. package/dist/pine-core/svg/delete-key.svg +1 -0
  443. package/dist/pine-core/svg/delete-x.svg +1 -0
  444. package/dist/pine-core/svg/dollar-sign.svg +1 -0
  445. package/dist/pine-core/svg/dot-menu-horizontal.svg +1 -0
  446. package/dist/pine-core/svg/down-small.svg +1 -0
  447. package/dist/pine-core/svg/download.svg +1 -0
  448. package/dist/pine-core/svg/downsell.svg +1 -0
  449. package/dist/pine-core/svg/draft.svg +1 -0
  450. package/dist/pine-core/svg/drop.svg +1 -0
  451. package/dist/pine-core/svg/duplicate.svg +1 -0
  452. package/dist/pine-core/svg/email-activity.svg +1 -0
  453. package/dist/pine-core/svg/emoji.svg +1 -0
  454. package/dist/pine-core/svg/enlarge-vertical.svg +1 -0
  455. package/dist/pine-core/svg/enlarge.svg +1 -0
  456. package/dist/pine-core/svg/expand.svg +1 -0
  457. package/dist/pine-core/svg/facebook-2.svg +1 -0
  458. package/dist/pine-core/svg/facebook.svg +1 -0
  459. package/dist/pine-core/svg/favorite.svg +1 -0
  460. package/dist/pine-core/svg/feedback.svg +1 -0
  461. package/dist/pine-core/svg/file-money.svg +1 -0
  462. package/dist/pine-core/svg/file.svg +1 -0
  463. package/dist/pine-core/svg/filter.svg +1 -0
  464. package/dist/pine-core/svg/flag.svg +1 -0
  465. package/dist/pine-core/svg/flash-filled.svg +1 -0
  466. package/dist/pine-core/svg/flash.svg +1 -0
  467. package/dist/pine-core/svg/folder-group.svg +1 -0
  468. package/dist/pine-core/svg/folder.svg +1 -0
  469. package/dist/pine-core/svg/form-field.svg +1 -0
  470. package/dist/pine-core/svg/form-filled.svg +1 -0
  471. package/dist/pine-core/svg/form.svg +1 -0
  472. package/dist/pine-core/svg/fullscreen.svg +1 -0
  473. package/dist/pine-core/svg/funnel.svg +1 -0
  474. package/dist/pine-core/svg/grant-offer.svg +1 -0
  475. package/dist/pine-core/svg/handle-2-vertical.svg +1 -0
  476. package/dist/pine-core/svg/handle-2.svg +1 -0
  477. package/dist/pine-core/svg/handle.svg +1 -0
  478. package/dist/pine-core/svg/hashtag.svg +1 -0
  479. package/dist/pine-core/svg/hd-video.svg +1 -0
  480. package/dist/pine-core/svg/heading-large.svg +1 -0
  481. package/dist/pine-core/svg/heading-small.svg +1 -0
  482. package/dist/pine-core/svg/headset.svg +1 -0
  483. package/dist/pine-core/svg/help-filled.svg +1 -0
  484. package/dist/pine-core/svg/help-outline.svg +1 -0
  485. package/dist/pine-core/svg/home-alt.svg +1 -0
  486. package/dist/pine-core/svg/horizontal-line.svg +1 -0
  487. package/dist/pine-core/svg/image.svg +1 -0
  488. package/dist/pine-core/svg/info-circle-filled.svg +1 -0
  489. package/dist/pine-core/svg/info-circle.svg +1 -0
  490. package/dist/pine-core/svg/instagram.svg +1 -0
  491. package/dist/pine-core/svg/ios-battery.svg +1 -0
  492. package/dist/pine-core/svg/ios-data.svg +1 -0
  493. package/dist/pine-core/svg/ios-wifi.svg +1 -0
  494. package/dist/pine-core/svg/italic.svg +1 -0
  495. package/dist/pine-core/svg/kajabi-filled.svg +1 -0
  496. package/dist/pine-core/svg/kajabi-outlined.svg +1 -0
  497. package/dist/pine-core/svg/lab.svg +1 -0
  498. package/dist/pine-core/svg/launch.svg +1 -0
  499. package/dist/pine-core/svg/layout-grid.svg +1 -0
  500. package/dist/pine-core/svg/layout-list.svg +1 -0
  501. package/dist/pine-core/svg/left-small.svg +1 -0
  502. package/dist/pine-core/svg/linkedin.svg +1 -0
  503. package/dist/pine-core/svg/list-bullet.svg +1 -0
  504. package/dist/pine-core/svg/list-numbers.svg +1 -0
  505. package/dist/pine-core/svg/location.svg +1 -0
  506. package/dist/pine-core/svg/lock-alt.svg +1 -0
  507. package/dist/pine-core/svg/lock.svg +1 -0
  508. package/dist/pine-core/svg/logo-afterpay.svg +1 -0
  509. package/dist/pine-core/svg/loop.svg +1 -0
  510. package/dist/pine-core/svg/mail-filled.svg +1 -0
  511. package/dist/pine-core/svg/mail.svg +1 -0
  512. package/dist/pine-core/svg/map.svg +1 -0
  513. package/dist/pine-core/svg/mapped.svg +1 -0
  514. package/dist/pine-core/svg/margin-left.svg +1 -0
  515. package/dist/pine-core/svg/margin-right.svg +1 -0
  516. package/dist/pine-core/svg/marker-filled.svg +1 -0
  517. package/dist/pine-core/svg/marker.svg +1 -0
  518. package/dist/pine-core/svg/marketing-filled.svg +1 -0
  519. package/dist/pine-core/svg/marketing-outline.svg +1 -0
  520. package/dist/pine-core/svg/menu-2.svg +1 -0
  521. package/dist/pine-core/svg/menu-alt.svg +1 -0
  522. package/dist/pine-core/svg/menu.svg +1 -0
  523. package/dist/pine-core/svg/merge.svg +1 -0
  524. package/dist/pine-core/svg/microphone-off.svg +1 -0
  525. package/dist/pine-core/svg/microphone.svg +1 -0
  526. package/dist/pine-core/svg/move-left.svg +1 -0
  527. package/dist/pine-core/svg/move-right.svg +1 -0
  528. package/dist/pine-core/svg/multi-pay.svg +1 -0
  529. package/dist/pine-core/svg/newsletter.svg +1 -0
  530. package/dist/pine-core/svg/one-off-session.svg +1 -0
  531. package/dist/pine-core/svg/one-time.svg +1 -0
  532. package/dist/pine-core/svg/partners-filled.svg +1 -0
  533. package/dist/pine-core/svg/partners-outline.svg +1 -0
  534. package/dist/pine-core/svg/pause-circle.svg +1 -0
  535. package/dist/pine-core/svg/pause.svg +1 -0
  536. package/dist/pine-core/svg/payout.svg +1 -0
  537. package/dist/pine-core/svg/pen.svg +1 -0
  538. package/dist/pine-core/svg/phone-portrait.svg +1 -0
  539. package/dist/pine-core/svg/phone-toolbar.svg +1 -0
  540. package/dist/pine-core/svg/play-circle.svg +1 -0
  541. package/dist/pine-core/svg/play-outline.svg +1 -0
  542. package/dist/pine-core/svg/play-store.svg +1 -0
  543. package/dist/pine-core/svg/play.svg +1 -0
  544. package/dist/pine-core/svg/plug.svg +1 -0
  545. package/dist/pine-core/svg/premium.svg +1 -0
  546. package/dist/pine-core/svg/present.svg +1 -0
  547. package/dist/pine-core/svg/preview-off.svg +1 -0
  548. package/dist/pine-core/svg/preview-on.svg +1 -0
  549. package/dist/pine-core/svg/products-filled.svg +1 -0
  550. package/dist/pine-core/svg/products-outline.svg +1 -0
  551. package/dist/pine-core/svg/question-circle.svg +1 -0
  552. package/dist/pine-core/svg/quote.svg +1 -0
  553. package/dist/pine-core/svg/redo.svg +1 -0
  554. package/dist/pine-core/svg/refresh.svg +1 -0
  555. package/dist/pine-core/svg/remove-circle.svg +1 -0
  556. package/dist/pine-core/svg/remove.svg +1 -0
  557. package/dist/pine-core/svg/rename.svg +1 -0
  558. package/dist/pine-core/svg/reset-password.svg +1 -0
  559. package/dist/pine-core/svg/restore.svg +1 -0
  560. package/dist/pine-core/svg/right-small.svg +1 -0
  561. package/dist/pine-core/svg/round-dollar.svg +1 -0
  562. package/dist/pine-core/svg/rows.svg +1 -0
  563. package/dist/pine-core/svg/sales-filled.svg +1 -0
  564. package/dist/pine-core/svg/sales-outline.svg +1 -0
  565. package/dist/pine-core/svg/scissor.svg +1 -0
  566. package/dist/pine-core/svg/screen-share-off.svg +1 -0
  567. package/dist/pine-core/svg/screen-share-on.svg +1 -0
  568. package/dist/pine-core/svg/search-small.svg +1 -0
  569. package/dist/pine-core/svg/search.svg +1 -0
  570. package/dist/pine-core/svg/send-message.svg +1 -0
  571. package/dist/pine-core/svg/sequences.svg +1 -0
  572. package/dist/pine-core/svg/series.svg +1 -0
  573. package/dist/pine-core/svg/settings-filled.svg +1 -0
  574. package/dist/pine-core/svg/settings-outline.svg +1 -0
  575. package/dist/pine-core/svg/share.svg +1 -0
  576. package/dist/pine-core/svg/skipped.svg +1 -0
  577. package/dist/pine-core/svg/slash-divider.svg +1 -0
  578. package/dist/pine-core/svg/sparkle-filled.svg +1 -0
  579. package/dist/pine-core/svg/sparkle.svg +1 -0
  580. package/dist/pine-core/svg/speaker.svg +1 -0
  581. package/dist/pine-core/svg/stack.svg +1 -0
  582. package/dist/pine-core/svg/star.svg +1 -0
  583. package/dist/pine-core/svg/stop.svg +1 -0
  584. package/dist/pine-core/svg/stopwatch.svg +1 -0
  585. package/dist/pine-core/svg/strikethrough.svg +1 -0
  586. package/dist/pine-core/svg/subscript.svg +1 -0
  587. package/dist/pine-core/svg/subscriptions.svg +1 -0
  588. package/dist/pine-core/svg/super-admin.svg +1 -0
  589. package/dist/pine-core/svg/superscript.svg +1 -0
  590. package/dist/pine-core/svg/sync.svg +1 -0
  591. package/dist/pine-core/svg/tablet-landscape.svg +1 -0
  592. package/dist/pine-core/svg/tablet-portrait.svg +1 -0
  593. package/dist/pine-core/svg/text-styles.svg +1 -0
  594. package/dist/pine-core/svg/theme-store-filled.svg +1 -0
  595. package/dist/pine-core/svg/theme-store.svg +1 -0
  596. package/dist/pine-core/svg/thumbs-down-filled.svg +1 -0
  597. package/dist/pine-core/svg/thumbs-down.svg +1 -0
  598. package/dist/pine-core/svg/thumbs-up-filled.svg +1 -0
  599. package/dist/pine-core/svg/thumbs-up.svg +1 -0
  600. package/dist/pine-core/svg/tiktok.svg +1 -0
  601. package/dist/pine-core/svg/trash.svg +1 -0
  602. package/dist/pine-core/svg/twitter.svg +1 -0
  603. package/dist/pine-core/svg/underline.svg +1 -0
  604. package/dist/pine-core/svg/undo.svg +1 -0
  605. package/dist/pine-core/svg/unlock.svg +1 -0
  606. package/dist/pine-core/svg/unmapped.svg +1 -0
  607. package/dist/pine-core/svg/up-small.svg +1 -0
  608. package/dist/pine-core/svg/upload.svg +1 -0
  609. package/dist/pine-core/svg/url.svg +1 -0
  610. package/dist/pine-core/svg/user-filled.svg +1 -0
  611. package/dist/pine-core/svg/user.svg +1 -0
  612. package/dist/pine-core/svg/users-wm.svg +1 -0
  613. package/dist/pine-core/svg/users.svg +1 -0
  614. package/dist/pine-core/svg/video-off.svg +1 -0
  615. package/dist/pine-core/svg/video-on.svg +1 -0
  616. package/dist/pine-core/svg/warning-filled.svg +1 -0
  617. package/dist/pine-core/svg/warning.svg +1 -0
  618. package/dist/pine-core/svg/website-filled.svg +1 -0
  619. package/dist/pine-core/svg/website-outline.svg +1 -0
  620. package/dist/pine-core/svg/window-paragraph.svg +1 -0
  621. package/dist/pine-core/svg/world.svg +1 -0
  622. package/dist/pine-core/svg/wrench.svg +1 -0
  623. package/dist/pine-core/svg/youtube.svg +1 -0
  624. package/dist/scripts/build-tokens.js +160 -0
  625. package/dist/scripts/build-tokens.js.map +1 -0
  626. package/dist/types/components/_internal/pds-label/pds-label.d.ts +22 -0
  627. package/dist/types/components/pds-avatar/pds-avatar.d.ts +42 -0
  628. package/dist/types/components/pds-button/pds-button.d.ts +36 -0
  629. package/dist/types/components/pds-checkbox/pds-checkbox.d.ts +55 -0
  630. package/dist/types/components/pds-chip/pds-chip.d.ts +39 -0
  631. package/dist/types/components/pds-copytext/pds-copytext.d.ts +34 -0
  632. package/dist/types/components/pds-divider/pds-divider.d.ts +17 -0
  633. package/dist/types/components/pds-image/pds-image.d.ts +42 -0
  634. package/dist/types/components/pds-input/pds-input.d.ts +59 -0
  635. package/dist/types/components/pds-link/pds-link.d.ts +34 -0
  636. package/dist/types/components/pds-progress/pds-progress.d.ts +31 -0
  637. package/dist/types/components/pds-radio/pds-radio.d.ts +54 -0
  638. package/dist/types/components/pds-sortable/pds-sortable-item/pds-sortable-item.d.ts +20 -0
  639. package/dist/types/components/pds-sortable/pds-sortable.d.ts +28 -0
  640. package/dist/types/components/pds-switch/pds-switch.d.ts +59 -0
  641. package/dist/types/components/pds-tabs/pds-tab/pds-tab.d.ts +35 -0
  642. package/dist/types/components/pds-tabs/pds-tabpanel/pds-tabpanel.d.ts +23 -0
  643. package/dist/types/components/pds-tabs/pds-tabs.d.ts +40 -0
  644. package/dist/types/components/pds-textarea/pds-textarea.d.ts +64 -0
  645. package/dist/types/components/pds-textarea/textarea-interface.d.ts +8 -0
  646. package/dist/types/components/pds-tooltip/pds-tooltip.d.ts +68 -0
  647. package/dist/types/components.d.ts +1566 -0
  648. package/dist/types/global/pine-ui-global.d.ts +1 -0
  649. package/dist/types/home/runner/work/pine/pine/libs/core/.stencil/scripts/build-tokens.d.ts +1 -0
  650. package/dist/types/index.d.ts +1 -0
  651. package/dist/types/interface.d.ts +17 -0
  652. package/dist/types/stencil-public-runtime.d.ts +1681 -0
  653. package/dist/types/stories/_helpers/index.d.ts +12 -0
  654. package/dist/types/utils/form.d.ts +12 -0
  655. package/dist/types/utils/overlay.d.ts +8 -0
  656. package/dist/types/utils/types.d.ts +1 -0
  657. package/dist/types/utils/utils.d.ts +2 -0
  658. package/loader/cdn.js +3 -0
  659. package/loader/index.cjs.js +3 -0
  660. package/loader/index.d.ts +21 -0
  661. package/loader/index.es2017.js +3 -0
  662. package/loader/index.js +4 -0
  663. package/loader/package.json +11 -0
  664. package/package.json +115 -0
  665. package/readme.md +75 -0
@@ -0,0 +1,2706 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index$1 = require('./index-13500e25.js');
6
+
7
+ /**!
8
+ * Sortable 1.15.1
9
+ * @author RubaXa <trash@rubaxa.org>
10
+ * @author owenm <owen23355@gmail.com>
11
+ * @license MIT
12
+ */
13
+ function ownKeys(object, enumerableOnly) {
14
+ var keys = Object.keys(object);
15
+ if (Object.getOwnPropertySymbols) {
16
+ var symbols = Object.getOwnPropertySymbols(object);
17
+ if (enumerableOnly) {
18
+ symbols = symbols.filter(function (sym) {
19
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
20
+ });
21
+ }
22
+ keys.push.apply(keys, symbols);
23
+ }
24
+ return keys;
25
+ }
26
+ function _objectSpread2(target) {
27
+ for (var i = 1; i < arguments.length; i++) {
28
+ var source = arguments[i] != null ? arguments[i] : {};
29
+ if (i % 2) {
30
+ ownKeys(Object(source), true).forEach(function (key) {
31
+ _defineProperty(target, key, source[key]);
32
+ });
33
+ } else if (Object.getOwnPropertyDescriptors) {
34
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
35
+ } else {
36
+ ownKeys(Object(source)).forEach(function (key) {
37
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
38
+ });
39
+ }
40
+ }
41
+ return target;
42
+ }
43
+ function _typeof(obj) {
44
+ "@babel/helpers - typeof";
45
+
46
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
47
+ _typeof = function (obj) {
48
+ return typeof obj;
49
+ };
50
+ } else {
51
+ _typeof = function (obj) {
52
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
53
+ };
54
+ }
55
+ return _typeof(obj);
56
+ }
57
+ function _defineProperty(obj, key, value) {
58
+ if (key in obj) {
59
+ Object.defineProperty(obj, key, {
60
+ value: value,
61
+ enumerable: true,
62
+ configurable: true,
63
+ writable: true
64
+ });
65
+ } else {
66
+ obj[key] = value;
67
+ }
68
+ return obj;
69
+ }
70
+ function _extends() {
71
+ _extends = Object.assign || function (target) {
72
+ for (var i = 1; i < arguments.length; i++) {
73
+ var source = arguments[i];
74
+ for (var key in source) {
75
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
76
+ target[key] = source[key];
77
+ }
78
+ }
79
+ }
80
+ return target;
81
+ };
82
+ return _extends.apply(this, arguments);
83
+ }
84
+ function _objectWithoutPropertiesLoose(source, excluded) {
85
+ if (source == null) return {};
86
+ var target = {};
87
+ var sourceKeys = Object.keys(source);
88
+ var key, i;
89
+ for (i = 0; i < sourceKeys.length; i++) {
90
+ key = sourceKeys[i];
91
+ if (excluded.indexOf(key) >= 0) continue;
92
+ target[key] = source[key];
93
+ }
94
+ return target;
95
+ }
96
+ function _objectWithoutProperties(source, excluded) {
97
+ if (source == null) return {};
98
+ var target = _objectWithoutPropertiesLoose(source, excluded);
99
+ var key, i;
100
+ if (Object.getOwnPropertySymbols) {
101
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
102
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
103
+ key = sourceSymbolKeys[i];
104
+ if (excluded.indexOf(key) >= 0) continue;
105
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
106
+ target[key] = source[key];
107
+ }
108
+ }
109
+ return target;
110
+ }
111
+
112
+ var version = "1.15.1";
113
+
114
+ function userAgent(pattern) {
115
+ if (typeof window !== 'undefined' && window.navigator) {
116
+ return !! /*@__PURE__*/navigator.userAgent.match(pattern);
117
+ }
118
+ }
119
+ var IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i);
120
+ var Edge = userAgent(/Edge/i);
121
+ var FireFox = userAgent(/firefox/i);
122
+ var Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);
123
+ var IOS = userAgent(/iP(ad|od|hone)/i);
124
+ var ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);
125
+
126
+ var captureMode = {
127
+ capture: false,
128
+ passive: false
129
+ };
130
+ function on(el, event, fn) {
131
+ el.addEventListener(event, fn, !IE11OrLess && captureMode);
132
+ }
133
+ function off(el, event, fn) {
134
+ el.removeEventListener(event, fn, !IE11OrLess && captureMode);
135
+ }
136
+ function matches( /**HTMLElement*/el, /**String*/selector) {
137
+ if (!selector) return;
138
+ selector[0] === '>' && (selector = selector.substring(1));
139
+ if (el) {
140
+ try {
141
+ if (el.matches) {
142
+ return el.matches(selector);
143
+ } else if (el.msMatchesSelector) {
144
+ return el.msMatchesSelector(selector);
145
+ } else if (el.webkitMatchesSelector) {
146
+ return el.webkitMatchesSelector(selector);
147
+ }
148
+ } catch (_) {
149
+ return false;
150
+ }
151
+ }
152
+ return false;
153
+ }
154
+ function getParentOrHost(el) {
155
+ return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;
156
+ }
157
+ function closest( /**HTMLElement*/el, /**String*/selector, /**HTMLElement*/ctx, includeCTX) {
158
+ if (el) {
159
+ ctx = ctx || document;
160
+ do {
161
+ if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {
162
+ return el;
163
+ }
164
+ if (el === ctx) break;
165
+ /* jshint boss:true */
166
+ } while (el = getParentOrHost(el));
167
+ }
168
+ return null;
169
+ }
170
+ var R_SPACE = /\s+/g;
171
+ function toggleClass(el, name, state) {
172
+ if (el && name) {
173
+ if (el.classList) {
174
+ el.classList[state ? 'add' : 'remove'](name);
175
+ } else {
176
+ var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');
177
+ el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');
178
+ }
179
+ }
180
+ }
181
+ function css(el, prop, val) {
182
+ var style = el && el.style;
183
+ if (style) {
184
+ if (val === void 0) {
185
+ if (document.defaultView && document.defaultView.getComputedStyle) {
186
+ val = document.defaultView.getComputedStyle(el, '');
187
+ } else if (el.currentStyle) {
188
+ val = el.currentStyle;
189
+ }
190
+ return prop === void 0 ? val : val[prop];
191
+ } else {
192
+ if (!(prop in style) && prop.indexOf('webkit') === -1) {
193
+ prop = '-webkit-' + prop;
194
+ }
195
+ style[prop] = val + (typeof val === 'string' ? '' : 'px');
196
+ }
197
+ }
198
+ }
199
+ function matrix(el, selfOnly) {
200
+ var appliedTransforms = '';
201
+ if (typeof el === 'string') {
202
+ appliedTransforms = el;
203
+ } else {
204
+ do {
205
+ var transform = css(el, 'transform');
206
+ if (transform && transform !== 'none') {
207
+ appliedTransforms = transform + ' ' + appliedTransforms;
208
+ }
209
+ /* jshint boss:true */
210
+ } while (!selfOnly && (el = el.parentNode));
211
+ }
212
+ var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
213
+ /*jshint -W056 */
214
+ return matrixFn && new matrixFn(appliedTransforms);
215
+ }
216
+ function find(ctx, tagName, iterator) {
217
+ if (ctx) {
218
+ var list = ctx.getElementsByTagName(tagName),
219
+ i = 0,
220
+ n = list.length;
221
+ if (iterator) {
222
+ for (; i < n; i++) {
223
+ iterator(list[i], i);
224
+ }
225
+ }
226
+ return list;
227
+ }
228
+ return [];
229
+ }
230
+ function getWindowScrollingElement() {
231
+ var scrollingElement = document.scrollingElement;
232
+ if (scrollingElement) {
233
+ return scrollingElement;
234
+ } else {
235
+ return document.documentElement;
236
+ }
237
+ }
238
+
239
+ /**
240
+ * Returns the "bounding client rect" of given element
241
+ * @param {HTMLElement} el The element whose boundingClientRect is wanted
242
+ * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container
243
+ * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr
244
+ * @param {[Boolean]} undoScale Whether the container's scale() should be undone
245
+ * @param {[HTMLElement]} container The parent the element will be placed in
246
+ * @return {Object} The boundingClientRect of el, with specified adjustments
247
+ */
248
+ function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {
249
+ if (!el.getBoundingClientRect && el !== window) return;
250
+ var elRect, top, left, bottom, right, height, width;
251
+ if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {
252
+ elRect = el.getBoundingClientRect();
253
+ top = elRect.top;
254
+ left = elRect.left;
255
+ bottom = elRect.bottom;
256
+ right = elRect.right;
257
+ height = elRect.height;
258
+ width = elRect.width;
259
+ } else {
260
+ top = 0;
261
+ left = 0;
262
+ bottom = window.innerHeight;
263
+ right = window.innerWidth;
264
+ height = window.innerHeight;
265
+ width = window.innerWidth;
266
+ }
267
+ if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {
268
+ // Adjust for translate()
269
+ container = container || el.parentNode;
270
+
271
+ // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)
272
+ // Not needed on <= IE11
273
+ if (!IE11OrLess) {
274
+ do {
275
+ if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {
276
+ var containerRect = container.getBoundingClientRect();
277
+
278
+ // Set relative to edges of padding box of container
279
+ top -= containerRect.top + parseInt(css(container, 'border-top-width'));
280
+ left -= containerRect.left + parseInt(css(container, 'border-left-width'));
281
+ bottom = top + elRect.height;
282
+ right = left + elRect.width;
283
+ break;
284
+ }
285
+ /* jshint boss:true */
286
+ } while (container = container.parentNode);
287
+ }
288
+ }
289
+ if (undoScale && el !== window) {
290
+ // Adjust for scale()
291
+ var elMatrix = matrix(container || el),
292
+ scaleX = elMatrix && elMatrix.a,
293
+ scaleY = elMatrix && elMatrix.d;
294
+ if (elMatrix) {
295
+ top /= scaleY;
296
+ left /= scaleX;
297
+ width /= scaleX;
298
+ height /= scaleY;
299
+ bottom = top + height;
300
+ right = left + width;
301
+ }
302
+ }
303
+ return {
304
+ top: top,
305
+ left: left,
306
+ bottom: bottom,
307
+ right: right,
308
+ width: width,
309
+ height: height
310
+ };
311
+ }
312
+
313
+ /**
314
+ * Returns the content rect of the element (bounding rect minus border and padding)
315
+ * @param {HTMLElement} el
316
+ */
317
+ function getContentRect(el) {
318
+ var rect = getRect(el);
319
+ var paddingLeft = parseInt(css(el, 'padding-left')),
320
+ paddingTop = parseInt(css(el, 'padding-top')),
321
+ paddingRight = parseInt(css(el, 'padding-right')),
322
+ paddingBottom = parseInt(css(el, 'padding-bottom'));
323
+ rect.top += paddingTop + parseInt(css(el, 'border-top-width'));
324
+ rect.left += paddingLeft + parseInt(css(el, 'border-left-width'));
325
+ // Client Width/Height includes padding only
326
+ rect.width = el.clientWidth - paddingLeft - paddingRight;
327
+ rect.height = el.clientHeight - paddingTop - paddingBottom;
328
+ rect.bottom = rect.top + rect.height;
329
+ rect.right = rect.left + rect.width;
330
+ return rect;
331
+ }
332
+
333
+ /**
334
+ * Checks if a side of an element is scrolled past a side of its parents
335
+ * @param {HTMLElement} el The element who's side being scrolled out of view is in question
336
+ * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')
337
+ * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')
338
+ * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element
339
+ */
340
+ function isScrolledPast(el, elSide, parentSide) {
341
+ var parent = getParentAutoScrollElement(el, true),
342
+ elSideVal = getRect(el)[elSide];
343
+
344
+ /* jshint boss:true */
345
+ while (parent) {
346
+ var parentSideVal = getRect(parent)[parentSide],
347
+ visible = void 0;
348
+ if (parentSide === 'top' || parentSide === 'left') {
349
+ visible = elSideVal >= parentSideVal;
350
+ } else {
351
+ visible = elSideVal <= parentSideVal;
352
+ }
353
+ if (!visible) return parent;
354
+ if (parent === getWindowScrollingElement()) break;
355
+ parent = getParentAutoScrollElement(parent, false);
356
+ }
357
+ return false;
358
+ }
359
+
360
+ /**
361
+ * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)
362
+ * and non-draggable elements
363
+ * @param {HTMLElement} el The parent element
364
+ * @param {Number} childNum The index of the child
365
+ * @param {Object} options Parent Sortable's options
366
+ * @return {HTMLElement} The child at index childNum, or null if not found
367
+ */
368
+ function getChild(el, childNum, options, includeDragEl) {
369
+ var currentChild = 0,
370
+ i = 0,
371
+ children = el.children;
372
+ while (i < children.length) {
373
+ if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {
374
+ if (currentChild === childNum) {
375
+ return children[i];
376
+ }
377
+ currentChild++;
378
+ }
379
+ i++;
380
+ }
381
+ return null;
382
+ }
383
+
384
+ /**
385
+ * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)
386
+ * @param {HTMLElement} el Parent element
387
+ * @param {selector} selector Any other elements that should be ignored
388
+ * @return {HTMLElement} The last child, ignoring ghostEl
389
+ */
390
+ function lastChild(el, selector) {
391
+ var last = el.lastElementChild;
392
+ while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {
393
+ last = last.previousElementSibling;
394
+ }
395
+ return last || null;
396
+ }
397
+
398
+ /**
399
+ * Returns the index of an element within its parent for a selected set of
400
+ * elements
401
+ * @param {HTMLElement} el
402
+ * @param {selector} selector
403
+ * @return {number}
404
+ */
405
+ function index(el, selector) {
406
+ var index = 0;
407
+ if (!el || !el.parentNode) {
408
+ return -1;
409
+ }
410
+
411
+ /* jshint boss:true */
412
+ while (el = el.previousElementSibling) {
413
+ if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {
414
+ index++;
415
+ }
416
+ }
417
+ return index;
418
+ }
419
+
420
+ /**
421
+ * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.
422
+ * The value is returned in real pixels.
423
+ * @param {HTMLElement} el
424
+ * @return {Array} Offsets in the format of [left, top]
425
+ */
426
+ function getRelativeScrollOffset(el) {
427
+ var offsetLeft = 0,
428
+ offsetTop = 0,
429
+ winScroller = getWindowScrollingElement();
430
+ if (el) {
431
+ do {
432
+ var elMatrix = matrix(el),
433
+ scaleX = elMatrix.a,
434
+ scaleY = elMatrix.d;
435
+ offsetLeft += el.scrollLeft * scaleX;
436
+ offsetTop += el.scrollTop * scaleY;
437
+ } while (el !== winScroller && (el = el.parentNode));
438
+ }
439
+ return [offsetLeft, offsetTop];
440
+ }
441
+
442
+ /**
443
+ * Returns the index of the object within the given array
444
+ * @param {Array} arr Array that may or may not hold the object
445
+ * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find
446
+ * @return {Number} The index of the object in the array, or -1
447
+ */
448
+ function indexOfObject(arr, obj) {
449
+ for (var i in arr) {
450
+ if (!arr.hasOwnProperty(i)) continue;
451
+ for (var key in obj) {
452
+ if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);
453
+ }
454
+ }
455
+ return -1;
456
+ }
457
+ function getParentAutoScrollElement(el, includeSelf) {
458
+ // skip to window
459
+ if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();
460
+ var elem = el;
461
+ var gotSelf = false;
462
+ do {
463
+ // we don't need to get elem css if it isn't even overflowing in the first place (performance)
464
+ if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {
465
+ var elemCSS = css(elem);
466
+ if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {
467
+ if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();
468
+ if (gotSelf || includeSelf) return elem;
469
+ gotSelf = true;
470
+ }
471
+ }
472
+ /* jshint boss:true */
473
+ } while (elem = elem.parentNode);
474
+ return getWindowScrollingElement();
475
+ }
476
+ function extend(dst, src) {
477
+ if (dst && src) {
478
+ for (var key in src) {
479
+ if (src.hasOwnProperty(key)) {
480
+ dst[key] = src[key];
481
+ }
482
+ }
483
+ }
484
+ return dst;
485
+ }
486
+ function isRectEqual(rect1, rect2) {
487
+ return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);
488
+ }
489
+ var _throttleTimeout;
490
+ function throttle(callback, ms) {
491
+ return function () {
492
+ if (!_throttleTimeout) {
493
+ var args = arguments,
494
+ _this = this;
495
+ if (args.length === 1) {
496
+ callback.call(_this, args[0]);
497
+ } else {
498
+ callback.apply(_this, args);
499
+ }
500
+ _throttleTimeout = setTimeout(function () {
501
+ _throttleTimeout = void 0;
502
+ }, ms);
503
+ }
504
+ };
505
+ }
506
+ function cancelThrottle() {
507
+ clearTimeout(_throttleTimeout);
508
+ _throttleTimeout = void 0;
509
+ }
510
+ function scrollBy(el, x, y) {
511
+ el.scrollLeft += x;
512
+ el.scrollTop += y;
513
+ }
514
+ function clone(el) {
515
+ var Polymer = window.Polymer;
516
+ var $ = window.jQuery || window.Zepto;
517
+ if (Polymer && Polymer.dom) {
518
+ return Polymer.dom(el).cloneNode(true);
519
+ } else if ($) {
520
+ return $(el).clone(true)[0];
521
+ } else {
522
+ return el.cloneNode(true);
523
+ }
524
+ }
525
+ var expando = 'Sortable' + new Date().getTime();
526
+
527
+ function AnimationStateManager() {
528
+ var animationStates = [],
529
+ animationCallbackId;
530
+ return {
531
+ captureAnimationState: function captureAnimationState() {
532
+ animationStates = [];
533
+ if (!this.options.animation) return;
534
+ var children = [].slice.call(this.el.children);
535
+ children.forEach(function (child) {
536
+ if (css(child, 'display') === 'none' || child === Sortable.ghost) return;
537
+ animationStates.push({
538
+ target: child,
539
+ rect: getRect(child)
540
+ });
541
+ var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect);
542
+
543
+ // If animating: compensate for current animation
544
+ if (child.thisAnimationDuration) {
545
+ var childMatrix = matrix(child, true);
546
+ if (childMatrix) {
547
+ fromRect.top -= childMatrix.f;
548
+ fromRect.left -= childMatrix.e;
549
+ }
550
+ }
551
+ child.fromRect = fromRect;
552
+ });
553
+ },
554
+ addAnimationState: function addAnimationState(state) {
555
+ animationStates.push(state);
556
+ },
557
+ removeAnimationState: function removeAnimationState(target) {
558
+ animationStates.splice(indexOfObject(animationStates, {
559
+ target: target
560
+ }), 1);
561
+ },
562
+ animateAll: function animateAll(callback) {
563
+ var _this = this;
564
+ if (!this.options.animation) {
565
+ clearTimeout(animationCallbackId);
566
+ if (typeof callback === 'function') callback();
567
+ return;
568
+ }
569
+ var animating = false,
570
+ animationTime = 0;
571
+ animationStates.forEach(function (state) {
572
+ var time = 0,
573
+ target = state.target,
574
+ fromRect = target.fromRect,
575
+ toRect = getRect(target),
576
+ prevFromRect = target.prevFromRect,
577
+ prevToRect = target.prevToRect,
578
+ animatingRect = state.rect,
579
+ targetMatrix = matrix(target, true);
580
+ if (targetMatrix) {
581
+ // Compensate for current animation
582
+ toRect.top -= targetMatrix.f;
583
+ toRect.left -= targetMatrix.e;
584
+ }
585
+ target.toRect = toRect;
586
+ if (target.thisAnimationDuration) {
587
+ // Could also check if animatingRect is between fromRect and toRect
588
+ if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) &&
589
+ // Make sure animatingRect is on line between toRect & fromRect
590
+ (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {
591
+ // If returning to same place as started from animation and on same axis
592
+ time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);
593
+ }
594
+ }
595
+
596
+ // if fromRect != toRect: animate
597
+ if (!isRectEqual(toRect, fromRect)) {
598
+ target.prevFromRect = fromRect;
599
+ target.prevToRect = toRect;
600
+ if (!time) {
601
+ time = _this.options.animation;
602
+ }
603
+ _this.animate(target, animatingRect, toRect, time);
604
+ }
605
+ if (time) {
606
+ animating = true;
607
+ animationTime = Math.max(animationTime, time);
608
+ clearTimeout(target.animationResetTimer);
609
+ target.animationResetTimer = setTimeout(function () {
610
+ target.animationTime = 0;
611
+ target.prevFromRect = null;
612
+ target.fromRect = null;
613
+ target.prevToRect = null;
614
+ target.thisAnimationDuration = null;
615
+ }, time);
616
+ target.thisAnimationDuration = time;
617
+ }
618
+ });
619
+ clearTimeout(animationCallbackId);
620
+ if (!animating) {
621
+ if (typeof callback === 'function') callback();
622
+ } else {
623
+ animationCallbackId = setTimeout(function () {
624
+ if (typeof callback === 'function') callback();
625
+ }, animationTime);
626
+ }
627
+ animationStates = [];
628
+ },
629
+ animate: function animate(target, currentRect, toRect, duration) {
630
+ if (duration) {
631
+ css(target, 'transition', '');
632
+ css(target, 'transform', '');
633
+ var elMatrix = matrix(this.el),
634
+ scaleX = elMatrix && elMatrix.a,
635
+ scaleY = elMatrix && elMatrix.d,
636
+ translateX = (currentRect.left - toRect.left) / (scaleX || 1),
637
+ translateY = (currentRect.top - toRect.top) / (scaleY || 1);
638
+ target.animatingX = !!translateX;
639
+ target.animatingY = !!translateY;
640
+ css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');
641
+ this.forRepaintDummy = repaint(target); // repaint
642
+
643
+ css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));
644
+ css(target, 'transform', 'translate3d(0,0,0)');
645
+ typeof target.animated === 'number' && clearTimeout(target.animated);
646
+ target.animated = setTimeout(function () {
647
+ css(target, 'transition', '');
648
+ css(target, 'transform', '');
649
+ target.animated = false;
650
+ target.animatingX = false;
651
+ target.animatingY = false;
652
+ }, duration);
653
+ }
654
+ }
655
+ };
656
+ }
657
+ function repaint(target) {
658
+ return target.offsetWidth;
659
+ }
660
+ function calculateRealTime(animatingRect, fromRect, toRect, options) {
661
+ return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;
662
+ }
663
+
664
+ var plugins = [];
665
+ var defaults = {
666
+ initializeByDefault: true
667
+ };
668
+ var PluginManager = {
669
+ mount: function mount(plugin) {
670
+ // Set default static properties
671
+ for (var option in defaults) {
672
+ if (defaults.hasOwnProperty(option) && !(option in plugin)) {
673
+ plugin[option] = defaults[option];
674
+ }
675
+ }
676
+ plugins.forEach(function (p) {
677
+ if (p.pluginName === plugin.pluginName) {
678
+ throw "Sortable: Cannot mount plugin ".concat(plugin.pluginName, " more than once");
679
+ }
680
+ });
681
+ plugins.push(plugin);
682
+ },
683
+ pluginEvent: function pluginEvent(eventName, sortable, evt) {
684
+ var _this = this;
685
+ this.eventCanceled = false;
686
+ evt.cancel = function () {
687
+ _this.eventCanceled = true;
688
+ };
689
+ var eventNameGlobal = eventName + 'Global';
690
+ plugins.forEach(function (plugin) {
691
+ if (!sortable[plugin.pluginName]) return;
692
+ // Fire global events if it exists in this sortable
693
+ if (sortable[plugin.pluginName][eventNameGlobal]) {
694
+ sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({
695
+ sortable: sortable
696
+ }, evt));
697
+ }
698
+
699
+ // Only fire plugin event if plugin is enabled in this sortable,
700
+ // and plugin has event defined
701
+ if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {
702
+ sortable[plugin.pluginName][eventName](_objectSpread2({
703
+ sortable: sortable
704
+ }, evt));
705
+ }
706
+ });
707
+ },
708
+ initializePlugins: function initializePlugins(sortable, el, defaults, options) {
709
+ plugins.forEach(function (plugin) {
710
+ var pluginName = plugin.pluginName;
711
+ if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;
712
+ var initialized = new plugin(sortable, el, sortable.options);
713
+ initialized.sortable = sortable;
714
+ initialized.options = sortable.options;
715
+ sortable[pluginName] = initialized;
716
+
717
+ // Add default options from plugin
718
+ _extends(defaults, initialized.defaults);
719
+ });
720
+ for (var option in sortable.options) {
721
+ if (!sortable.options.hasOwnProperty(option)) continue;
722
+ var modified = this.modifyOption(sortable, option, sortable.options[option]);
723
+ if (typeof modified !== 'undefined') {
724
+ sortable.options[option] = modified;
725
+ }
726
+ }
727
+ },
728
+ getEventProperties: function getEventProperties(name, sortable) {
729
+ var eventProperties = {};
730
+ plugins.forEach(function (plugin) {
731
+ if (typeof plugin.eventProperties !== 'function') return;
732
+ _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));
733
+ });
734
+ return eventProperties;
735
+ },
736
+ modifyOption: function modifyOption(sortable, name, value) {
737
+ var modifiedValue;
738
+ plugins.forEach(function (plugin) {
739
+ // Plugin must exist on the Sortable
740
+ if (!sortable[plugin.pluginName]) return;
741
+
742
+ // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin
743
+ if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {
744
+ modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);
745
+ }
746
+ });
747
+ return modifiedValue;
748
+ }
749
+ };
750
+
751
+ function dispatchEvent(_ref) {
752
+ var sortable = _ref.sortable,
753
+ rootEl = _ref.rootEl,
754
+ name = _ref.name,
755
+ targetEl = _ref.targetEl,
756
+ cloneEl = _ref.cloneEl,
757
+ toEl = _ref.toEl,
758
+ fromEl = _ref.fromEl,
759
+ oldIndex = _ref.oldIndex,
760
+ newIndex = _ref.newIndex,
761
+ oldDraggableIndex = _ref.oldDraggableIndex,
762
+ newDraggableIndex = _ref.newDraggableIndex,
763
+ originalEvent = _ref.originalEvent,
764
+ putSortable = _ref.putSortable,
765
+ extraEventProperties = _ref.extraEventProperties;
766
+ sortable = sortable || rootEl && rootEl[expando];
767
+ if (!sortable) return;
768
+ var evt,
769
+ options = sortable.options,
770
+ onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1);
771
+ // Support for new CustomEvent feature
772
+ if (window.CustomEvent && !IE11OrLess && !Edge) {
773
+ evt = new CustomEvent(name, {
774
+ bubbles: true,
775
+ cancelable: true
776
+ });
777
+ } else {
778
+ evt = document.createEvent('Event');
779
+ evt.initEvent(name, true, true);
780
+ }
781
+ evt.to = toEl || rootEl;
782
+ evt.from = fromEl || rootEl;
783
+ evt.item = targetEl || rootEl;
784
+ evt.clone = cloneEl;
785
+ evt.oldIndex = oldIndex;
786
+ evt.newIndex = newIndex;
787
+ evt.oldDraggableIndex = oldDraggableIndex;
788
+ evt.newDraggableIndex = newDraggableIndex;
789
+ evt.originalEvent = originalEvent;
790
+ evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;
791
+ var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));
792
+ for (var option in allEventProperties) {
793
+ evt[option] = allEventProperties[option];
794
+ }
795
+ if (rootEl) {
796
+ rootEl.dispatchEvent(evt);
797
+ }
798
+ if (options[onName]) {
799
+ options[onName].call(sortable, evt);
800
+ }
801
+ }
802
+
803
+ var _excluded = ["evt"];
804
+ var pluginEvent = function pluginEvent(eventName, sortable) {
805
+ var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
806
+ originalEvent = _ref.evt,
807
+ data = _objectWithoutProperties(_ref, _excluded);
808
+ PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({
809
+ dragEl: dragEl,
810
+ parentEl: parentEl,
811
+ ghostEl: ghostEl,
812
+ rootEl: rootEl,
813
+ nextEl: nextEl,
814
+ lastDownEl: lastDownEl,
815
+ cloneEl: cloneEl,
816
+ cloneHidden: cloneHidden,
817
+ dragStarted: moved,
818
+ putSortable: putSortable,
819
+ activeSortable: Sortable.active,
820
+ originalEvent: originalEvent,
821
+ oldIndex: oldIndex,
822
+ oldDraggableIndex: oldDraggableIndex,
823
+ newIndex: newIndex,
824
+ newDraggableIndex: newDraggableIndex,
825
+ hideGhostForTarget: _hideGhostForTarget,
826
+ unhideGhostForTarget: _unhideGhostForTarget,
827
+ cloneNowHidden: function cloneNowHidden() {
828
+ cloneHidden = true;
829
+ },
830
+ cloneNowShown: function cloneNowShown() {
831
+ cloneHidden = false;
832
+ },
833
+ dispatchSortableEvent: function dispatchSortableEvent(name) {
834
+ _dispatchEvent({
835
+ sortable: sortable,
836
+ name: name,
837
+ originalEvent: originalEvent
838
+ });
839
+ }
840
+ }, data));
841
+ };
842
+ function _dispatchEvent(info) {
843
+ dispatchEvent(_objectSpread2({
844
+ putSortable: putSortable,
845
+ cloneEl: cloneEl,
846
+ targetEl: dragEl,
847
+ rootEl: rootEl,
848
+ oldIndex: oldIndex,
849
+ oldDraggableIndex: oldDraggableIndex,
850
+ newIndex: newIndex,
851
+ newDraggableIndex: newDraggableIndex
852
+ }, info));
853
+ }
854
+ var dragEl,
855
+ parentEl,
856
+ ghostEl,
857
+ rootEl,
858
+ nextEl,
859
+ lastDownEl,
860
+ cloneEl,
861
+ cloneHidden,
862
+ oldIndex,
863
+ newIndex,
864
+ oldDraggableIndex,
865
+ newDraggableIndex,
866
+ activeGroup,
867
+ putSortable,
868
+ awaitingDragStarted = false,
869
+ ignoreNextClick = false,
870
+ sortables = [],
871
+ tapEvt,
872
+ touchEvt,
873
+ lastDx,
874
+ lastDy,
875
+ tapDistanceLeft,
876
+ tapDistanceTop,
877
+ moved,
878
+ lastTarget,
879
+ lastDirection,
880
+ pastFirstInvertThresh = false,
881
+ isCircumstantialInvert = false,
882
+ targetMoveDistance,
883
+ // For positioning ghost absolutely
884
+ ghostRelativeParent,
885
+ ghostRelativeParentInitialScroll = [],
886
+ // (left, top)
887
+
888
+ _silent = false,
889
+ savedInputChecked = [];
890
+
891
+ /** @const */
892
+ var documentExists = typeof document !== 'undefined',
893
+ PositionGhostAbsolutely = IOS,
894
+ CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',
895
+ // This will not pass for IE9, because IE9 DnD only works on anchors
896
+ supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),
897
+ supportCssPointerEvents = function () {
898
+ if (!documentExists) return;
899
+ // false when <= IE11
900
+ if (IE11OrLess) {
901
+ return false;
902
+ }
903
+ var el = document.createElement('x');
904
+ el.style.cssText = 'pointer-events:auto';
905
+ return el.style.pointerEvents === 'auto';
906
+ }(),
907
+ _detectDirection = function _detectDirection(el, options) {
908
+ var elCSS = css(el),
909
+ elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),
910
+ child1 = getChild(el, 0, options),
911
+ child2 = getChild(el, 1, options),
912
+ firstChildCSS = child1 && css(child1),
913
+ secondChildCSS = child2 && css(child2),
914
+ firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,
915
+ secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;
916
+ if (elCSS.display === 'flex') {
917
+ return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';
918
+ }
919
+ if (elCSS.display === 'grid') {
920
+ return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';
921
+ }
922
+ if (child1 && firstChildCSS["float"] && firstChildCSS["float"] !== 'none') {
923
+ var touchingSideChild2 = firstChildCSS["float"] === 'left' ? 'left' : 'right';
924
+ return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';
925
+ }
926
+ return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';
927
+ },
928
+ _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {
929
+ var dragElS1Opp = vertical ? dragRect.left : dragRect.top,
930
+ dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,
931
+ dragElOppLength = vertical ? dragRect.width : dragRect.height,
932
+ targetS1Opp = vertical ? targetRect.left : targetRect.top,
933
+ targetS2Opp = vertical ? targetRect.right : targetRect.bottom,
934
+ targetOppLength = vertical ? targetRect.width : targetRect.height;
935
+ return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;
936
+ },
937
+ /**
938
+ * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.
939
+ * @param {Number} x X position
940
+ * @param {Number} y Y position
941
+ * @return {HTMLElement} Element of the first found nearest Sortable
942
+ */
943
+ _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {
944
+ var ret;
945
+ sortables.some(function (sortable) {
946
+ var threshold = sortable[expando].options.emptyInsertThreshold;
947
+ if (!threshold || lastChild(sortable)) return;
948
+ var rect = getRect(sortable),
949
+ insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,
950
+ insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;
951
+ if (insideHorizontally && insideVertically) {
952
+ return ret = sortable;
953
+ }
954
+ });
955
+ return ret;
956
+ },
957
+ _prepareGroup = function _prepareGroup(options) {
958
+ function toFn(value, pull) {
959
+ return function (to, from, dragEl, evt) {
960
+ var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;
961
+ if (value == null && (pull || sameGroup)) {
962
+ // Default pull value
963
+ // Default pull and put value if same group
964
+ return true;
965
+ } else if (value == null || value === false) {
966
+ return false;
967
+ } else if (pull && value === 'clone') {
968
+ return value;
969
+ } else if (typeof value === 'function') {
970
+ return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);
971
+ } else {
972
+ var otherGroup = (pull ? to : from).options.group.name;
973
+ return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;
974
+ }
975
+ };
976
+ }
977
+ var group = {};
978
+ var originalGroup = options.group;
979
+ if (!originalGroup || _typeof(originalGroup) != 'object') {
980
+ originalGroup = {
981
+ name: originalGroup
982
+ };
983
+ }
984
+ group.name = originalGroup.name;
985
+ group.checkPull = toFn(originalGroup.pull, true);
986
+ group.checkPut = toFn(originalGroup.put);
987
+ group.revertClone = originalGroup.revertClone;
988
+ options.group = group;
989
+ },
990
+ _hideGhostForTarget = function _hideGhostForTarget() {
991
+ if (!supportCssPointerEvents && ghostEl) {
992
+ css(ghostEl, 'display', 'none');
993
+ }
994
+ },
995
+ _unhideGhostForTarget = function _unhideGhostForTarget() {
996
+ if (!supportCssPointerEvents && ghostEl) {
997
+ css(ghostEl, 'display', '');
998
+ }
999
+ };
1000
+
1001
+ // #1184 fix - Prevent click event on fallback if dragged but item not changed position
1002
+ if (documentExists && !ChromeForAndroid) {
1003
+ document.addEventListener('click', function (evt) {
1004
+ if (ignoreNextClick) {
1005
+ evt.preventDefault();
1006
+ evt.stopPropagation && evt.stopPropagation();
1007
+ evt.stopImmediatePropagation && evt.stopImmediatePropagation();
1008
+ ignoreNextClick = false;
1009
+ return false;
1010
+ }
1011
+ }, true);
1012
+ }
1013
+ var nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {
1014
+ if (dragEl) {
1015
+ evt = evt.touches ? evt.touches[0] : evt;
1016
+ var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);
1017
+ if (nearest) {
1018
+ // Create imitation event
1019
+ var event = {};
1020
+ for (var i in evt) {
1021
+ if (evt.hasOwnProperty(i)) {
1022
+ event[i] = evt[i];
1023
+ }
1024
+ }
1025
+ event.target = event.rootEl = nearest;
1026
+ event.preventDefault = void 0;
1027
+ event.stopPropagation = void 0;
1028
+ nearest[expando]._onDragOver(event);
1029
+ }
1030
+ }
1031
+ };
1032
+ var _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {
1033
+ if (dragEl) {
1034
+ dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
1035
+ }
1036
+ };
1037
+
1038
+ /**
1039
+ * @class Sortable
1040
+ * @param {HTMLElement} el
1041
+ * @param {Object} [options]
1042
+ */
1043
+ function Sortable(el, options) {
1044
+ if (!(el && el.nodeType && el.nodeType === 1)) {
1045
+ throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(el));
1046
+ }
1047
+ this.el = el; // root element
1048
+ this.options = options = _extends({}, options);
1049
+
1050
+ // Export instance
1051
+ el[expando] = this;
1052
+ var defaults = {
1053
+ group: null,
1054
+ sort: true,
1055
+ disabled: false,
1056
+ store: null,
1057
+ handle: null,
1058
+ draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',
1059
+ swapThreshold: 1,
1060
+ // percentage; 0 <= x <= 1
1061
+ invertSwap: false,
1062
+ // invert always
1063
+ invertedSwapThreshold: null,
1064
+ // will be set to same as swapThreshold if default
1065
+ removeCloneOnHide: true,
1066
+ direction: function direction() {
1067
+ return _detectDirection(el, this.options);
1068
+ },
1069
+ ghostClass: 'sortable-ghost',
1070
+ chosenClass: 'sortable-chosen',
1071
+ dragClass: 'sortable-drag',
1072
+ ignore: 'a, img',
1073
+ filter: null,
1074
+ preventOnFilter: true,
1075
+ animation: 0,
1076
+ easing: null,
1077
+ setData: function setData(dataTransfer, dragEl) {
1078
+ dataTransfer.setData('Text', dragEl.textContent);
1079
+ },
1080
+ dropBubble: false,
1081
+ dragoverBubble: false,
1082
+ dataIdAttr: 'data-id',
1083
+ delay: 0,
1084
+ delayOnTouchOnly: false,
1085
+ touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
1086
+ forceFallback: false,
1087
+ fallbackClass: 'sortable-fallback',
1088
+ fallbackOnBody: false,
1089
+ fallbackTolerance: 0,
1090
+ fallbackOffset: {
1091
+ x: 0,
1092
+ y: 0
1093
+ },
1094
+ supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari,
1095
+ emptyInsertThreshold: 5
1096
+ };
1097
+ PluginManager.initializePlugins(this, el, defaults);
1098
+
1099
+ // Set default options
1100
+ for (var name in defaults) {
1101
+ !(name in options) && (options[name] = defaults[name]);
1102
+ }
1103
+ _prepareGroup(options);
1104
+
1105
+ // Bind all private methods
1106
+ for (var fn in this) {
1107
+ if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
1108
+ this[fn] = this[fn].bind(this);
1109
+ }
1110
+ }
1111
+
1112
+ // Setup drag mode
1113
+ this.nativeDraggable = options.forceFallback ? false : supportDraggable;
1114
+ if (this.nativeDraggable) {
1115
+ // Touch start threshold cannot be greater than the native dragstart threshold
1116
+ this.options.touchStartThreshold = 1;
1117
+ }
1118
+
1119
+ // Bind events
1120
+ if (options.supportPointer) {
1121
+ on(el, 'pointerdown', this._onTapStart);
1122
+ } else {
1123
+ on(el, 'mousedown', this._onTapStart);
1124
+ on(el, 'touchstart', this._onTapStart);
1125
+ }
1126
+ if (this.nativeDraggable) {
1127
+ on(el, 'dragover', this);
1128
+ on(el, 'dragenter', this);
1129
+ }
1130
+ sortables.push(this.el);
1131
+
1132
+ // Restore sorting
1133
+ options.store && options.store.get && this.sort(options.store.get(this) || []);
1134
+
1135
+ // Add animation state manager
1136
+ _extends(this, AnimationStateManager());
1137
+ }
1138
+ Sortable.prototype = /** @lends Sortable.prototype */{
1139
+ constructor: Sortable,
1140
+ _isOutsideThisEl: function _isOutsideThisEl(target) {
1141
+ if (!this.el.contains(target) && target !== this.el) {
1142
+ lastTarget = null;
1143
+ }
1144
+ },
1145
+ _getDirection: function _getDirection(evt, target) {
1146
+ return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;
1147
+ },
1148
+ _onTapStart: function _onTapStart( /** Event|TouchEvent */evt) {
1149
+ if (!evt.cancelable) return;
1150
+ var _this = this,
1151
+ el = this.el,
1152
+ options = this.options,
1153
+ preventOnFilter = options.preventOnFilter,
1154
+ type = evt.type,
1155
+ touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,
1156
+ target = (touch || evt).target,
1157
+ originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,
1158
+ filter = options.filter;
1159
+ _saveInputCheckedState(el);
1160
+
1161
+ // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.
1162
+ if (dragEl) {
1163
+ return;
1164
+ }
1165
+ if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {
1166
+ return; // only left button and enabled
1167
+ }
1168
+
1169
+ // cancel dnd if original target is content editable
1170
+ if (originalTarget.isContentEditable) {
1171
+ return;
1172
+ }
1173
+
1174
+ // Safari ignores further event handling after mousedown
1175
+ if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {
1176
+ return;
1177
+ }
1178
+ target = closest(target, options.draggable, el, false);
1179
+ if (target && target.animated) {
1180
+ return;
1181
+ }
1182
+ if (lastDownEl === target) {
1183
+ // Ignoring duplicate `down`
1184
+ return;
1185
+ }
1186
+
1187
+ // Get the index of the dragged element within its parent
1188
+ oldIndex = index(target);
1189
+ oldDraggableIndex = index(target, options.draggable);
1190
+
1191
+ // Check filter
1192
+ if (typeof filter === 'function') {
1193
+ if (filter.call(this, evt, target, this)) {
1194
+ _dispatchEvent({
1195
+ sortable: _this,
1196
+ rootEl: originalTarget,
1197
+ name: 'filter',
1198
+ targetEl: target,
1199
+ toEl: el,
1200
+ fromEl: el
1201
+ });
1202
+ pluginEvent('filter', _this, {
1203
+ evt: evt
1204
+ });
1205
+ preventOnFilter && evt.cancelable && evt.preventDefault();
1206
+ return; // cancel dnd
1207
+ }
1208
+ } else if (filter) {
1209
+ filter = filter.split(',').some(function (criteria) {
1210
+ criteria = closest(originalTarget, criteria.trim(), el, false);
1211
+ if (criteria) {
1212
+ _dispatchEvent({
1213
+ sortable: _this,
1214
+ rootEl: criteria,
1215
+ name: 'filter',
1216
+ targetEl: target,
1217
+ fromEl: el,
1218
+ toEl: el
1219
+ });
1220
+ pluginEvent('filter', _this, {
1221
+ evt: evt
1222
+ });
1223
+ return true;
1224
+ }
1225
+ });
1226
+ if (filter) {
1227
+ preventOnFilter && evt.cancelable && evt.preventDefault();
1228
+ return; // cancel dnd
1229
+ }
1230
+ }
1231
+ if (options.handle && !closest(originalTarget, options.handle, el, false)) {
1232
+ return;
1233
+ }
1234
+
1235
+ // Prepare `dragstart`
1236
+ this._prepareDragStart(evt, touch, target);
1237
+ },
1238
+ _prepareDragStart: function _prepareDragStart( /** Event */evt, /** Touch */touch, /** HTMLElement */target) {
1239
+ var _this = this,
1240
+ el = _this.el,
1241
+ options = _this.options,
1242
+ ownerDocument = el.ownerDocument,
1243
+ dragStartFn;
1244
+ if (target && !dragEl && target.parentNode === el) {
1245
+ var dragRect = getRect(target);
1246
+ rootEl = el;
1247
+ dragEl = target;
1248
+ parentEl = dragEl.parentNode;
1249
+ nextEl = dragEl.nextSibling;
1250
+ lastDownEl = target;
1251
+ activeGroup = options.group;
1252
+ Sortable.dragged = dragEl;
1253
+ tapEvt = {
1254
+ target: dragEl,
1255
+ clientX: (touch || evt).clientX,
1256
+ clientY: (touch || evt).clientY
1257
+ };
1258
+ tapDistanceLeft = tapEvt.clientX - dragRect.left;
1259
+ tapDistanceTop = tapEvt.clientY - dragRect.top;
1260
+ this._lastX = (touch || evt).clientX;
1261
+ this._lastY = (touch || evt).clientY;
1262
+ dragEl.style['will-change'] = 'all';
1263
+ dragStartFn = function dragStartFn() {
1264
+ pluginEvent('delayEnded', _this, {
1265
+ evt: evt
1266
+ });
1267
+ if (Sortable.eventCanceled) {
1268
+ _this._onDrop();
1269
+ return;
1270
+ }
1271
+ // Delayed drag has been triggered
1272
+ // we can re-enable the events: touchmove/mousemove
1273
+ _this._disableDelayedDragEvents();
1274
+ if (!FireFox && _this.nativeDraggable) {
1275
+ dragEl.draggable = true;
1276
+ }
1277
+
1278
+ // Bind the events: dragstart/dragend
1279
+ _this._triggerDragStart(evt, touch);
1280
+
1281
+ // Drag start event
1282
+ _dispatchEvent({
1283
+ sortable: _this,
1284
+ name: 'choose',
1285
+ originalEvent: evt
1286
+ });
1287
+
1288
+ // Chosen item
1289
+ toggleClass(dragEl, options.chosenClass, true);
1290
+ };
1291
+
1292
+ // Disable "draggable"
1293
+ options.ignore.split(',').forEach(function (criteria) {
1294
+ find(dragEl, criteria.trim(), _disableDraggable);
1295
+ });
1296
+ on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);
1297
+ on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);
1298
+ on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);
1299
+ on(ownerDocument, 'mouseup', _this._onDrop);
1300
+ on(ownerDocument, 'touchend', _this._onDrop);
1301
+ on(ownerDocument, 'touchcancel', _this._onDrop);
1302
+
1303
+ // Make dragEl draggable (must be before delay for FireFox)
1304
+ if (FireFox && this.nativeDraggable) {
1305
+ this.options.touchStartThreshold = 4;
1306
+ dragEl.draggable = true;
1307
+ }
1308
+ pluginEvent('delayStart', this, {
1309
+ evt: evt
1310
+ });
1311
+
1312
+ // Delay is impossible for native DnD in Edge or IE
1313
+ if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {
1314
+ if (Sortable.eventCanceled) {
1315
+ this._onDrop();
1316
+ return;
1317
+ }
1318
+ // If the user moves the pointer or let go the click or touch
1319
+ // before the delay has been reached:
1320
+ // disable the delayed drag
1321
+ on(ownerDocument, 'mouseup', _this._disableDelayedDrag);
1322
+ on(ownerDocument, 'touchend', _this._disableDelayedDrag);
1323
+ on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);
1324
+ on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);
1325
+ on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);
1326
+ options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);
1327
+ _this._dragStartTimer = setTimeout(dragStartFn, options.delay);
1328
+ } else {
1329
+ dragStartFn();
1330
+ }
1331
+ }
1332
+ },
1333
+ _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler( /** TouchEvent|PointerEvent **/e) {
1334
+ var touch = e.touches ? e.touches[0] : e;
1335
+ if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {
1336
+ this._disableDelayedDrag();
1337
+ }
1338
+ },
1339
+ _disableDelayedDrag: function _disableDelayedDrag() {
1340
+ dragEl && _disableDraggable(dragEl);
1341
+ clearTimeout(this._dragStartTimer);
1342
+ this._disableDelayedDragEvents();
1343
+ },
1344
+ _disableDelayedDragEvents: function _disableDelayedDragEvents() {
1345
+ var ownerDocument = this.el.ownerDocument;
1346
+ off(ownerDocument, 'mouseup', this._disableDelayedDrag);
1347
+ off(ownerDocument, 'touchend', this._disableDelayedDrag);
1348
+ off(ownerDocument, 'touchcancel', this._disableDelayedDrag);
1349
+ off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);
1350
+ off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);
1351
+ off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);
1352
+ },
1353
+ _triggerDragStart: function _triggerDragStart( /** Event */evt, /** Touch */touch) {
1354
+ touch = touch || evt.pointerType == 'touch' && evt;
1355
+ if (!this.nativeDraggable || touch) {
1356
+ if (this.options.supportPointer) {
1357
+ on(document, 'pointermove', this._onTouchMove);
1358
+ } else if (touch) {
1359
+ on(document, 'touchmove', this._onTouchMove);
1360
+ } else {
1361
+ on(document, 'mousemove', this._onTouchMove);
1362
+ }
1363
+ } else {
1364
+ on(dragEl, 'dragend', this);
1365
+ on(rootEl, 'dragstart', this._onDragStart);
1366
+ }
1367
+ try {
1368
+ if (document.selection) {
1369
+ // Timeout neccessary for IE9
1370
+ _nextTick(function () {
1371
+ document.selection.empty();
1372
+ });
1373
+ } else {
1374
+ window.getSelection().removeAllRanges();
1375
+ }
1376
+ } catch (err) {}
1377
+ },
1378
+ _dragStarted: function _dragStarted(fallback, evt) {
1379
+ awaitingDragStarted = false;
1380
+ if (rootEl && dragEl) {
1381
+ pluginEvent('dragStarted', this, {
1382
+ evt: evt
1383
+ });
1384
+ if (this.nativeDraggable) {
1385
+ on(document, 'dragover', _checkOutsideTargetEl);
1386
+ }
1387
+ var options = this.options;
1388
+
1389
+ // Apply effect
1390
+ !fallback && toggleClass(dragEl, options.dragClass, false);
1391
+ toggleClass(dragEl, options.ghostClass, true);
1392
+ Sortable.active = this;
1393
+ fallback && this._appendGhost();
1394
+
1395
+ // Drag start event
1396
+ _dispatchEvent({
1397
+ sortable: this,
1398
+ name: 'start',
1399
+ originalEvent: evt
1400
+ });
1401
+ } else {
1402
+ this._nulling();
1403
+ }
1404
+ },
1405
+ _emulateDragOver: function _emulateDragOver() {
1406
+ if (touchEvt) {
1407
+ this._lastX = touchEvt.clientX;
1408
+ this._lastY = touchEvt.clientY;
1409
+ _hideGhostForTarget();
1410
+ var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
1411
+ var parent = target;
1412
+ while (target && target.shadowRoot) {
1413
+ target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
1414
+ if (target === parent) break;
1415
+ parent = target;
1416
+ }
1417
+ dragEl.parentNode[expando]._isOutsideThisEl(target);
1418
+ if (parent) {
1419
+ do {
1420
+ if (parent[expando]) {
1421
+ var inserted = void 0;
1422
+ inserted = parent[expando]._onDragOver({
1423
+ clientX: touchEvt.clientX,
1424
+ clientY: touchEvt.clientY,
1425
+ target: target,
1426
+ rootEl: parent
1427
+ });
1428
+ if (inserted && !this.options.dragoverBubble) {
1429
+ break;
1430
+ }
1431
+ }
1432
+ target = parent; // store last element
1433
+ }
1434
+ /* jshint boss:true */ while (parent = parent.parentNode);
1435
+ }
1436
+ _unhideGhostForTarget();
1437
+ }
1438
+ },
1439
+ _onTouchMove: function _onTouchMove( /**TouchEvent*/evt) {
1440
+ if (tapEvt) {
1441
+ var options = this.options,
1442
+ fallbackTolerance = options.fallbackTolerance,
1443
+ fallbackOffset = options.fallbackOffset,
1444
+ touch = evt.touches ? evt.touches[0] : evt,
1445
+ ghostMatrix = ghostEl && matrix(ghostEl, true),
1446
+ scaleX = ghostEl && ghostMatrix && ghostMatrix.a,
1447
+ scaleY = ghostEl && ghostMatrix && ghostMatrix.d,
1448
+ relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),
1449
+ dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),
1450
+ dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1);
1451
+
1452
+ // only set the status to dragging, when we are actually dragging
1453
+ if (!Sortable.active && !awaitingDragStarted) {
1454
+ if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {
1455
+ return;
1456
+ }
1457
+ this._onDragStart(evt, true);
1458
+ }
1459
+ if (ghostEl) {
1460
+ if (ghostMatrix) {
1461
+ ghostMatrix.e += dx - (lastDx || 0);
1462
+ ghostMatrix.f += dy - (lastDy || 0);
1463
+ } else {
1464
+ ghostMatrix = {
1465
+ a: 1,
1466
+ b: 0,
1467
+ c: 0,
1468
+ d: 1,
1469
+ e: dx,
1470
+ f: dy
1471
+ };
1472
+ }
1473
+ var cssMatrix = "matrix(".concat(ghostMatrix.a, ",").concat(ghostMatrix.b, ",").concat(ghostMatrix.c, ",").concat(ghostMatrix.d, ",").concat(ghostMatrix.e, ",").concat(ghostMatrix.f, ")");
1474
+ css(ghostEl, 'webkitTransform', cssMatrix);
1475
+ css(ghostEl, 'mozTransform', cssMatrix);
1476
+ css(ghostEl, 'msTransform', cssMatrix);
1477
+ css(ghostEl, 'transform', cssMatrix);
1478
+ lastDx = dx;
1479
+ lastDy = dy;
1480
+ touchEvt = touch;
1481
+ }
1482
+ evt.cancelable && evt.preventDefault();
1483
+ }
1484
+ },
1485
+ _appendGhost: function _appendGhost() {
1486
+ // Bug if using scale(): https://stackoverflow.com/questions/2637058
1487
+ // Not being adjusted for
1488
+ if (!ghostEl) {
1489
+ var container = this.options.fallbackOnBody ? document.body : rootEl,
1490
+ rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),
1491
+ options = this.options;
1492
+
1493
+ // Position absolutely
1494
+ if (PositionGhostAbsolutely) {
1495
+ // Get relatively positioned parent
1496
+ ghostRelativeParent = container;
1497
+ while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {
1498
+ ghostRelativeParent = ghostRelativeParent.parentNode;
1499
+ }
1500
+ if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {
1501
+ if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();
1502
+ rect.top += ghostRelativeParent.scrollTop;
1503
+ rect.left += ghostRelativeParent.scrollLeft;
1504
+ } else {
1505
+ ghostRelativeParent = getWindowScrollingElement();
1506
+ }
1507
+ ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);
1508
+ }
1509
+ ghostEl = dragEl.cloneNode(true);
1510
+ toggleClass(ghostEl, options.ghostClass, false);
1511
+ toggleClass(ghostEl, options.fallbackClass, true);
1512
+ toggleClass(ghostEl, options.dragClass, true);
1513
+ css(ghostEl, 'transition', '');
1514
+ css(ghostEl, 'transform', '');
1515
+ css(ghostEl, 'box-sizing', 'border-box');
1516
+ css(ghostEl, 'margin', 0);
1517
+ css(ghostEl, 'top', rect.top);
1518
+ css(ghostEl, 'left', rect.left);
1519
+ css(ghostEl, 'width', rect.width);
1520
+ css(ghostEl, 'height', rect.height);
1521
+ css(ghostEl, 'opacity', '0.8');
1522
+ css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');
1523
+ css(ghostEl, 'zIndex', '100000');
1524
+ css(ghostEl, 'pointerEvents', 'none');
1525
+ Sortable.ghost = ghostEl;
1526
+ container.appendChild(ghostEl);
1527
+
1528
+ // Set transform-origin
1529
+ css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');
1530
+ }
1531
+ },
1532
+ _onDragStart: function _onDragStart( /**Event*/evt, /**boolean*/fallback) {
1533
+ var _this = this;
1534
+ var dataTransfer = evt.dataTransfer;
1535
+ var options = _this.options;
1536
+ pluginEvent('dragStart', this, {
1537
+ evt: evt
1538
+ });
1539
+ if (Sortable.eventCanceled) {
1540
+ this._onDrop();
1541
+ return;
1542
+ }
1543
+ pluginEvent('setupClone', this);
1544
+ if (!Sortable.eventCanceled) {
1545
+ cloneEl = clone(dragEl);
1546
+ cloneEl.removeAttribute("id");
1547
+ cloneEl.draggable = false;
1548
+ cloneEl.style['will-change'] = '';
1549
+ this._hideClone();
1550
+ toggleClass(cloneEl, this.options.chosenClass, false);
1551
+ Sortable.clone = cloneEl;
1552
+ }
1553
+
1554
+ // #1143: IFrame support workaround
1555
+ _this.cloneId = _nextTick(function () {
1556
+ pluginEvent('clone', _this);
1557
+ if (Sortable.eventCanceled) return;
1558
+ if (!_this.options.removeCloneOnHide) {
1559
+ rootEl.insertBefore(cloneEl, dragEl);
1560
+ }
1561
+ _this._hideClone();
1562
+ _dispatchEvent({
1563
+ sortable: _this,
1564
+ name: 'clone'
1565
+ });
1566
+ });
1567
+ !fallback && toggleClass(dragEl, options.dragClass, true);
1568
+
1569
+ // Set proper drop events
1570
+ if (fallback) {
1571
+ ignoreNextClick = true;
1572
+ _this._loopId = setInterval(_this._emulateDragOver, 50);
1573
+ } else {
1574
+ // Undo what was set in _prepareDragStart before drag started
1575
+ off(document, 'mouseup', _this._onDrop);
1576
+ off(document, 'touchend', _this._onDrop);
1577
+ off(document, 'touchcancel', _this._onDrop);
1578
+ if (dataTransfer) {
1579
+ dataTransfer.effectAllowed = 'move';
1580
+ options.setData && options.setData.call(_this, dataTransfer, dragEl);
1581
+ }
1582
+ on(document, 'drop', _this);
1583
+
1584
+ // #1276 fix:
1585
+ css(dragEl, 'transform', 'translateZ(0)');
1586
+ }
1587
+ awaitingDragStarted = true;
1588
+ _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));
1589
+ on(document, 'selectstart', _this);
1590
+ moved = true;
1591
+ if (Safari) {
1592
+ css(document.body, 'user-select', 'none');
1593
+ }
1594
+ },
1595
+ // Returns true - if no further action is needed (either inserted or another condition)
1596
+ _onDragOver: function _onDragOver( /**Event*/evt) {
1597
+ var el = this.el,
1598
+ target = evt.target,
1599
+ dragRect,
1600
+ targetRect,
1601
+ revert,
1602
+ options = this.options,
1603
+ group = options.group,
1604
+ activeSortable = Sortable.active,
1605
+ isOwner = activeGroup === group,
1606
+ canSort = options.sort,
1607
+ fromSortable = putSortable || activeSortable,
1608
+ vertical,
1609
+ _this = this,
1610
+ completedFired = false;
1611
+ if (_silent) return;
1612
+ function dragOverEvent(name, extra) {
1613
+ pluginEvent(name, _this, _objectSpread2({
1614
+ evt: evt,
1615
+ isOwner: isOwner,
1616
+ axis: vertical ? 'vertical' : 'horizontal',
1617
+ revert: revert,
1618
+ dragRect: dragRect,
1619
+ targetRect: targetRect,
1620
+ canSort: canSort,
1621
+ fromSortable: fromSortable,
1622
+ target: target,
1623
+ completed: completed,
1624
+ onMove: function onMove(target, after) {
1625
+ return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);
1626
+ },
1627
+ changed: changed
1628
+ }, extra));
1629
+ }
1630
+
1631
+ // Capture animation state
1632
+ function capture() {
1633
+ dragOverEvent('dragOverAnimationCapture');
1634
+ _this.captureAnimationState();
1635
+ if (_this !== fromSortable) {
1636
+ fromSortable.captureAnimationState();
1637
+ }
1638
+ }
1639
+
1640
+ // Return invocation when dragEl is inserted (or completed)
1641
+ function completed(insertion) {
1642
+ dragOverEvent('dragOverCompleted', {
1643
+ insertion: insertion
1644
+ });
1645
+ if (insertion) {
1646
+ // Clones must be hidden before folding animation to capture dragRectAbsolute properly
1647
+ if (isOwner) {
1648
+ activeSortable._hideClone();
1649
+ } else {
1650
+ activeSortable._showClone(_this);
1651
+ }
1652
+ if (_this !== fromSortable) {
1653
+ // Set ghost class to new sortable's ghost class
1654
+ toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);
1655
+ toggleClass(dragEl, options.ghostClass, true);
1656
+ }
1657
+ if (putSortable !== _this && _this !== Sortable.active) {
1658
+ putSortable = _this;
1659
+ } else if (_this === Sortable.active && putSortable) {
1660
+ putSortable = null;
1661
+ }
1662
+
1663
+ // Animation
1664
+ if (fromSortable === _this) {
1665
+ _this._ignoreWhileAnimating = target;
1666
+ }
1667
+ _this.animateAll(function () {
1668
+ dragOverEvent('dragOverAnimationComplete');
1669
+ _this._ignoreWhileAnimating = null;
1670
+ });
1671
+ if (_this !== fromSortable) {
1672
+ fromSortable.animateAll();
1673
+ fromSortable._ignoreWhileAnimating = null;
1674
+ }
1675
+ }
1676
+
1677
+ // Null lastTarget if it is not inside a previously swapped element
1678
+ if (target === dragEl && !dragEl.animated || target === el && !target.animated) {
1679
+ lastTarget = null;
1680
+ }
1681
+
1682
+ // no bubbling and not fallback
1683
+ if (!options.dragoverBubble && !evt.rootEl && target !== document) {
1684
+ dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
1685
+
1686
+ // Do not detect for empty insert if already inserted
1687
+ !insertion && nearestEmptyInsertDetectEvent(evt);
1688
+ }
1689
+ !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();
1690
+ return completedFired = true;
1691
+ }
1692
+
1693
+ // Call when dragEl has been inserted
1694
+ function changed() {
1695
+ newIndex = index(dragEl);
1696
+ newDraggableIndex = index(dragEl, options.draggable);
1697
+ _dispatchEvent({
1698
+ sortable: _this,
1699
+ name: 'change',
1700
+ toEl: el,
1701
+ newIndex: newIndex,
1702
+ newDraggableIndex: newDraggableIndex,
1703
+ originalEvent: evt
1704
+ });
1705
+ }
1706
+ if (evt.preventDefault !== void 0) {
1707
+ evt.cancelable && evt.preventDefault();
1708
+ }
1709
+ target = closest(target, options.draggable, el, true);
1710
+ dragOverEvent('dragOver');
1711
+ if (Sortable.eventCanceled) return completedFired;
1712
+ if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {
1713
+ return completed(false);
1714
+ }
1715
+ ignoreNextClick = false;
1716
+ if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list
1717
+ : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {
1718
+ vertical = this._getDirection(evt, target) === 'vertical';
1719
+ dragRect = getRect(dragEl);
1720
+ dragOverEvent('dragOverValid');
1721
+ if (Sortable.eventCanceled) return completedFired;
1722
+ if (revert) {
1723
+ parentEl = rootEl; // actualization
1724
+ capture();
1725
+ this._hideClone();
1726
+ dragOverEvent('revert');
1727
+ if (!Sortable.eventCanceled) {
1728
+ if (nextEl) {
1729
+ rootEl.insertBefore(dragEl, nextEl);
1730
+ } else {
1731
+ rootEl.appendChild(dragEl);
1732
+ }
1733
+ }
1734
+ return completed(true);
1735
+ }
1736
+ var elLastChild = lastChild(el, options.draggable);
1737
+ if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {
1738
+ // Insert to end of list
1739
+
1740
+ // If already at end of list: Do not insert
1741
+ if (elLastChild === dragEl) {
1742
+ return completed(false);
1743
+ }
1744
+
1745
+ // if there is a last element, it is the target
1746
+ if (elLastChild && el === evt.target) {
1747
+ target = elLastChild;
1748
+ }
1749
+ if (target) {
1750
+ targetRect = getRect(target);
1751
+ }
1752
+ if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {
1753
+ capture();
1754
+ if (elLastChild && elLastChild.nextSibling) {
1755
+ // the last draggable element is not the last node
1756
+ el.insertBefore(dragEl, elLastChild.nextSibling);
1757
+ } else {
1758
+ el.appendChild(dragEl);
1759
+ }
1760
+ parentEl = el; // actualization
1761
+
1762
+ changed();
1763
+ return completed(true);
1764
+ }
1765
+ } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {
1766
+ // Insert to start of list
1767
+ var firstChild = getChild(el, 0, options, true);
1768
+ if (firstChild === dragEl) {
1769
+ return completed(false);
1770
+ }
1771
+ target = firstChild;
1772
+ targetRect = getRect(target);
1773
+ if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {
1774
+ capture();
1775
+ el.insertBefore(dragEl, firstChild);
1776
+ parentEl = el; // actualization
1777
+
1778
+ changed();
1779
+ return completed(true);
1780
+ }
1781
+ } else if (target.parentNode === el) {
1782
+ targetRect = getRect(target);
1783
+ var direction = 0,
1784
+ targetBeforeFirstSwap,
1785
+ differentLevel = dragEl.parentNode !== el,
1786
+ differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),
1787
+ side1 = vertical ? 'top' : 'left',
1788
+ scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),
1789
+ scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;
1790
+ if (lastTarget !== target) {
1791
+ targetBeforeFirstSwap = targetRect[side1];
1792
+ pastFirstInvertThresh = false;
1793
+ isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;
1794
+ }
1795
+ direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);
1796
+ var sibling;
1797
+ if (direction !== 0) {
1798
+ // Check if target is beside dragEl in respective direction (ignoring hidden elements)
1799
+ var dragIndex = index(dragEl);
1800
+ do {
1801
+ dragIndex -= direction;
1802
+ sibling = parentEl.children[dragIndex];
1803
+ } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));
1804
+ }
1805
+ // If dragEl is already beside target: Do not insert
1806
+ if (direction === 0 || sibling === target) {
1807
+ return completed(false);
1808
+ }
1809
+ lastTarget = target;
1810
+ lastDirection = direction;
1811
+ var nextSibling = target.nextElementSibling,
1812
+ after = false;
1813
+ after = direction === 1;
1814
+ var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);
1815
+ if (moveVector !== false) {
1816
+ if (moveVector === 1 || moveVector === -1) {
1817
+ after = moveVector === 1;
1818
+ }
1819
+ _silent = true;
1820
+ setTimeout(_unsilent, 30);
1821
+ capture();
1822
+ if (after && !nextSibling) {
1823
+ el.appendChild(dragEl);
1824
+ } else {
1825
+ target.parentNode.insertBefore(dragEl, after ? nextSibling : target);
1826
+ }
1827
+
1828
+ // Undo chrome's scroll adjustment (has no effect on other browsers)
1829
+ if (scrolledPastTop) {
1830
+ scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);
1831
+ }
1832
+ parentEl = dragEl.parentNode; // actualization
1833
+
1834
+ // must be done before animation
1835
+ if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {
1836
+ targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);
1837
+ }
1838
+ changed();
1839
+ return completed(true);
1840
+ }
1841
+ }
1842
+ if (el.contains(dragEl)) {
1843
+ return completed(false);
1844
+ }
1845
+ }
1846
+ return false;
1847
+ },
1848
+ _ignoreWhileAnimating: null,
1849
+ _offMoveEvents: function _offMoveEvents() {
1850
+ off(document, 'mousemove', this._onTouchMove);
1851
+ off(document, 'touchmove', this._onTouchMove);
1852
+ off(document, 'pointermove', this._onTouchMove);
1853
+ off(document, 'dragover', nearestEmptyInsertDetectEvent);
1854
+ off(document, 'mousemove', nearestEmptyInsertDetectEvent);
1855
+ off(document, 'touchmove', nearestEmptyInsertDetectEvent);
1856
+ },
1857
+ _offUpEvents: function _offUpEvents() {
1858
+ var ownerDocument = this.el.ownerDocument;
1859
+ off(ownerDocument, 'mouseup', this._onDrop);
1860
+ off(ownerDocument, 'touchend', this._onDrop);
1861
+ off(ownerDocument, 'pointerup', this._onDrop);
1862
+ off(ownerDocument, 'touchcancel', this._onDrop);
1863
+ off(document, 'selectstart', this);
1864
+ },
1865
+ _onDrop: function _onDrop( /**Event*/evt) {
1866
+ var el = this.el,
1867
+ options = this.options;
1868
+
1869
+ // Get the index of the dragged element within its parent
1870
+ newIndex = index(dragEl);
1871
+ newDraggableIndex = index(dragEl, options.draggable);
1872
+ pluginEvent('drop', this, {
1873
+ evt: evt
1874
+ });
1875
+ parentEl = dragEl && dragEl.parentNode;
1876
+
1877
+ // Get again after plugin event
1878
+ newIndex = index(dragEl);
1879
+ newDraggableIndex = index(dragEl, options.draggable);
1880
+ if (Sortable.eventCanceled) {
1881
+ this._nulling();
1882
+ return;
1883
+ }
1884
+ awaitingDragStarted = false;
1885
+ isCircumstantialInvert = false;
1886
+ pastFirstInvertThresh = false;
1887
+ clearInterval(this._loopId);
1888
+ clearTimeout(this._dragStartTimer);
1889
+ _cancelNextTick(this.cloneId);
1890
+ _cancelNextTick(this._dragStartId);
1891
+
1892
+ // Unbind events
1893
+ if (this.nativeDraggable) {
1894
+ off(document, 'drop', this);
1895
+ off(el, 'dragstart', this._onDragStart);
1896
+ }
1897
+ this._offMoveEvents();
1898
+ this._offUpEvents();
1899
+ if (Safari) {
1900
+ css(document.body, 'user-select', '');
1901
+ }
1902
+ css(dragEl, 'transform', '');
1903
+ if (evt) {
1904
+ if (moved) {
1905
+ evt.cancelable && evt.preventDefault();
1906
+ !options.dropBubble && evt.stopPropagation();
1907
+ }
1908
+ ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);
1909
+ if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {
1910
+ // Remove clone(s)
1911
+ cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);
1912
+ }
1913
+ if (dragEl) {
1914
+ if (this.nativeDraggable) {
1915
+ off(dragEl, 'dragend', this);
1916
+ }
1917
+ _disableDraggable(dragEl);
1918
+ dragEl.style['will-change'] = '';
1919
+
1920
+ // Remove classes
1921
+ // ghostClass is added in dragStarted
1922
+ if (moved && !awaitingDragStarted) {
1923
+ toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);
1924
+ }
1925
+ toggleClass(dragEl, this.options.chosenClass, false);
1926
+
1927
+ // Drag stop event
1928
+ _dispatchEvent({
1929
+ sortable: this,
1930
+ name: 'unchoose',
1931
+ toEl: parentEl,
1932
+ newIndex: null,
1933
+ newDraggableIndex: null,
1934
+ originalEvent: evt
1935
+ });
1936
+ if (rootEl !== parentEl) {
1937
+ if (newIndex >= 0) {
1938
+ // Add event
1939
+ _dispatchEvent({
1940
+ rootEl: parentEl,
1941
+ name: 'add',
1942
+ toEl: parentEl,
1943
+ fromEl: rootEl,
1944
+ originalEvent: evt
1945
+ });
1946
+
1947
+ // Remove event
1948
+ _dispatchEvent({
1949
+ sortable: this,
1950
+ name: 'remove',
1951
+ toEl: parentEl,
1952
+ originalEvent: evt
1953
+ });
1954
+
1955
+ // drag from one list and drop into another
1956
+ _dispatchEvent({
1957
+ rootEl: parentEl,
1958
+ name: 'sort',
1959
+ toEl: parentEl,
1960
+ fromEl: rootEl,
1961
+ originalEvent: evt
1962
+ });
1963
+ _dispatchEvent({
1964
+ sortable: this,
1965
+ name: 'sort',
1966
+ toEl: parentEl,
1967
+ originalEvent: evt
1968
+ });
1969
+ }
1970
+ putSortable && putSortable.save();
1971
+ } else {
1972
+ if (newIndex !== oldIndex) {
1973
+ if (newIndex >= 0) {
1974
+ // drag & drop within the same list
1975
+ _dispatchEvent({
1976
+ sortable: this,
1977
+ name: 'update',
1978
+ toEl: parentEl,
1979
+ originalEvent: evt
1980
+ });
1981
+ _dispatchEvent({
1982
+ sortable: this,
1983
+ name: 'sort',
1984
+ toEl: parentEl,
1985
+ originalEvent: evt
1986
+ });
1987
+ }
1988
+ }
1989
+ }
1990
+ if (Sortable.active) {
1991
+ /* jshint eqnull:true */
1992
+ if (newIndex == null || newIndex === -1) {
1993
+ newIndex = oldIndex;
1994
+ newDraggableIndex = oldDraggableIndex;
1995
+ }
1996
+ _dispatchEvent({
1997
+ sortable: this,
1998
+ name: 'end',
1999
+ toEl: parentEl,
2000
+ originalEvent: evt
2001
+ });
2002
+
2003
+ // Save sorting
2004
+ this.save();
2005
+ }
2006
+ }
2007
+ }
2008
+ this._nulling();
2009
+ },
2010
+ _nulling: function _nulling() {
2011
+ pluginEvent('nulling', this);
2012
+ rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;
2013
+ savedInputChecked.forEach(function (el) {
2014
+ el.checked = true;
2015
+ });
2016
+ savedInputChecked.length = lastDx = lastDy = 0;
2017
+ },
2018
+ handleEvent: function handleEvent( /**Event*/evt) {
2019
+ switch (evt.type) {
2020
+ case 'drop':
2021
+ case 'dragend':
2022
+ this._onDrop(evt);
2023
+ break;
2024
+ case 'dragenter':
2025
+ case 'dragover':
2026
+ if (dragEl) {
2027
+ this._onDragOver(evt);
2028
+ _globalDragOver(evt);
2029
+ }
2030
+ break;
2031
+ case 'selectstart':
2032
+ evt.preventDefault();
2033
+ break;
2034
+ }
2035
+ },
2036
+ /**
2037
+ * Serializes the item into an array of string.
2038
+ * @returns {String[]}
2039
+ */
2040
+ toArray: function toArray() {
2041
+ var order = [],
2042
+ el,
2043
+ children = this.el.children,
2044
+ i = 0,
2045
+ n = children.length,
2046
+ options = this.options;
2047
+ for (; i < n; i++) {
2048
+ el = children[i];
2049
+ if (closest(el, options.draggable, this.el, false)) {
2050
+ order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));
2051
+ }
2052
+ }
2053
+ return order;
2054
+ },
2055
+ /**
2056
+ * Sorts the elements according to the array.
2057
+ * @param {String[]} order order of the items
2058
+ */
2059
+ sort: function sort(order, useAnimation) {
2060
+ var items = {},
2061
+ rootEl = this.el;
2062
+ this.toArray().forEach(function (id, i) {
2063
+ var el = rootEl.children[i];
2064
+ if (closest(el, this.options.draggable, rootEl, false)) {
2065
+ items[id] = el;
2066
+ }
2067
+ }, this);
2068
+ useAnimation && this.captureAnimationState();
2069
+ order.forEach(function (id) {
2070
+ if (items[id]) {
2071
+ rootEl.removeChild(items[id]);
2072
+ rootEl.appendChild(items[id]);
2073
+ }
2074
+ });
2075
+ useAnimation && this.animateAll();
2076
+ },
2077
+ /**
2078
+ * Save the current sorting
2079
+ */
2080
+ save: function save() {
2081
+ var store = this.options.store;
2082
+ store && store.set && store.set(this);
2083
+ },
2084
+ /**
2085
+ * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
2086
+ * @param {HTMLElement} el
2087
+ * @param {String} [selector] default: `options.draggable`
2088
+ * @returns {HTMLElement|null}
2089
+ */
2090
+ closest: function closest$1(el, selector) {
2091
+ return closest(el, selector || this.options.draggable, this.el, false);
2092
+ },
2093
+ /**
2094
+ * Set/get option
2095
+ * @param {string} name
2096
+ * @param {*} [value]
2097
+ * @returns {*}
2098
+ */
2099
+ option: function option(name, value) {
2100
+ var options = this.options;
2101
+ if (value === void 0) {
2102
+ return options[name];
2103
+ } else {
2104
+ var modifiedValue = PluginManager.modifyOption(this, name, value);
2105
+ if (typeof modifiedValue !== 'undefined') {
2106
+ options[name] = modifiedValue;
2107
+ } else {
2108
+ options[name] = value;
2109
+ }
2110
+ if (name === 'group') {
2111
+ _prepareGroup(options);
2112
+ }
2113
+ }
2114
+ },
2115
+ /**
2116
+ * Destroy
2117
+ */
2118
+ destroy: function destroy() {
2119
+ pluginEvent('destroy', this);
2120
+ var el = this.el;
2121
+ el[expando] = null;
2122
+ off(el, 'mousedown', this._onTapStart);
2123
+ off(el, 'touchstart', this._onTapStart);
2124
+ off(el, 'pointerdown', this._onTapStart);
2125
+ if (this.nativeDraggable) {
2126
+ off(el, 'dragover', this);
2127
+ off(el, 'dragenter', this);
2128
+ }
2129
+ // Remove draggable attributes
2130
+ Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {
2131
+ el.removeAttribute('draggable');
2132
+ });
2133
+ this._onDrop();
2134
+ this._disableDelayedDragEvents();
2135
+ sortables.splice(sortables.indexOf(this.el), 1);
2136
+ this.el = el = null;
2137
+ },
2138
+ _hideClone: function _hideClone() {
2139
+ if (!cloneHidden) {
2140
+ pluginEvent('hideClone', this);
2141
+ if (Sortable.eventCanceled) return;
2142
+ css(cloneEl, 'display', 'none');
2143
+ if (this.options.removeCloneOnHide && cloneEl.parentNode) {
2144
+ cloneEl.parentNode.removeChild(cloneEl);
2145
+ }
2146
+ cloneHidden = true;
2147
+ }
2148
+ },
2149
+ _showClone: function _showClone(putSortable) {
2150
+ if (putSortable.lastPutMode !== 'clone') {
2151
+ this._hideClone();
2152
+ return;
2153
+ }
2154
+ if (cloneHidden) {
2155
+ pluginEvent('showClone', this);
2156
+ if (Sortable.eventCanceled) return;
2157
+
2158
+ // show clone at dragEl or original position
2159
+ if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {
2160
+ rootEl.insertBefore(cloneEl, dragEl);
2161
+ } else if (nextEl) {
2162
+ rootEl.insertBefore(cloneEl, nextEl);
2163
+ } else {
2164
+ rootEl.appendChild(cloneEl);
2165
+ }
2166
+ if (this.options.group.revertClone) {
2167
+ this.animate(dragEl, cloneEl);
2168
+ }
2169
+ css(cloneEl, 'display', '');
2170
+ cloneHidden = false;
2171
+ }
2172
+ }
2173
+ };
2174
+ function _globalDragOver( /**Event*/evt) {
2175
+ if (evt.dataTransfer) {
2176
+ evt.dataTransfer.dropEffect = 'move';
2177
+ }
2178
+ evt.cancelable && evt.preventDefault();
2179
+ }
2180
+ function _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {
2181
+ var evt,
2182
+ sortable = fromEl[expando],
2183
+ onMoveFn = sortable.options.onMove,
2184
+ retVal;
2185
+ // Support for new CustomEvent feature
2186
+ if (window.CustomEvent && !IE11OrLess && !Edge) {
2187
+ evt = new CustomEvent('move', {
2188
+ bubbles: true,
2189
+ cancelable: true
2190
+ });
2191
+ } else {
2192
+ evt = document.createEvent('Event');
2193
+ evt.initEvent('move', true, true);
2194
+ }
2195
+ evt.to = toEl;
2196
+ evt.from = fromEl;
2197
+ evt.dragged = dragEl;
2198
+ evt.draggedRect = dragRect;
2199
+ evt.related = targetEl || toEl;
2200
+ evt.relatedRect = targetRect || getRect(toEl);
2201
+ evt.willInsertAfter = willInsertAfter;
2202
+ evt.originalEvent = originalEvent;
2203
+ fromEl.dispatchEvent(evt);
2204
+ if (onMoveFn) {
2205
+ retVal = onMoveFn.call(sortable, evt, originalEvent);
2206
+ }
2207
+ return retVal;
2208
+ }
2209
+ function _disableDraggable(el) {
2210
+ el.draggable = false;
2211
+ }
2212
+ function _unsilent() {
2213
+ _silent = false;
2214
+ }
2215
+ function _ghostIsFirst(evt, vertical, sortable) {
2216
+ var firstElRect = getRect(getChild(sortable.el, 0, sortable.options, true));
2217
+ var sortableContentRect = getContentRect(sortable.el);
2218
+ var spacer = 10;
2219
+ return vertical ? evt.clientX < sortableContentRect.left - spacer || evt.clientY < firstElRect.top && evt.clientX < firstElRect.right : evt.clientY < sortableContentRect.top - spacer || evt.clientY < firstElRect.bottom && evt.clientX < firstElRect.left;
2220
+ }
2221
+ function _ghostIsLast(evt, vertical, sortable) {
2222
+ var lastElRect = getRect(lastChild(sortable.el, sortable.options.draggable));
2223
+ var sortableContentRect = getContentRect(sortable.el);
2224
+ var spacer = 10;
2225
+ return vertical ? evt.clientX > sortableContentRect.right + spacer || evt.clientY > lastElRect.bottom && evt.clientX > lastElRect.left : evt.clientY > sortableContentRect.bottom + spacer || evt.clientX > lastElRect.right && evt.clientY > lastElRect.top;
2226
+ }
2227
+ function _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {
2228
+ var mouseOnAxis = vertical ? evt.clientY : evt.clientX,
2229
+ targetLength = vertical ? targetRect.height : targetRect.width,
2230
+ targetS1 = vertical ? targetRect.top : targetRect.left,
2231
+ targetS2 = vertical ? targetRect.bottom : targetRect.right,
2232
+ invert = false;
2233
+ if (!invertSwap) {
2234
+ // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold
2235
+ if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {
2236
+ // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2
2237
+ // check if past first invert threshold on side opposite of lastDirection
2238
+ if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {
2239
+ // past first invert threshold, do not restrict inverted threshold to dragEl shadow
2240
+ pastFirstInvertThresh = true;
2241
+ }
2242
+ if (!pastFirstInvertThresh) {
2243
+ // dragEl shadow (target move distance shadow)
2244
+ if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow
2245
+ : mouseOnAxis > targetS2 - targetMoveDistance) {
2246
+ return -lastDirection;
2247
+ }
2248
+ } else {
2249
+ invert = true;
2250
+ }
2251
+ } else {
2252
+ // Regular
2253
+ if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {
2254
+ return _getInsertDirection(target);
2255
+ }
2256
+ }
2257
+ }
2258
+ invert = invert || invertSwap;
2259
+ if (invert) {
2260
+ // Invert of regular
2261
+ if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {
2262
+ return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;
2263
+ }
2264
+ }
2265
+ return 0;
2266
+ }
2267
+
2268
+ /**
2269
+ * Gets the direction dragEl must be swapped relative to target in order to make it
2270
+ * seem that dragEl has been "inserted" into that element's position
2271
+ * @param {HTMLElement} target The target whose position dragEl is being inserted at
2272
+ * @return {Number} Direction dragEl must be swapped
2273
+ */
2274
+ function _getInsertDirection(target) {
2275
+ if (index(dragEl) < index(target)) {
2276
+ return 1;
2277
+ } else {
2278
+ return -1;
2279
+ }
2280
+ }
2281
+
2282
+ /**
2283
+ * Generate id
2284
+ * @param {HTMLElement} el
2285
+ * @returns {String}
2286
+ * @private
2287
+ */
2288
+ function _generateId(el) {
2289
+ var str = el.tagName + el.className + el.src + el.href + el.textContent,
2290
+ i = str.length,
2291
+ sum = 0;
2292
+ while (i--) {
2293
+ sum += str.charCodeAt(i);
2294
+ }
2295
+ return sum.toString(36);
2296
+ }
2297
+ function _saveInputCheckedState(root) {
2298
+ savedInputChecked.length = 0;
2299
+ var inputs = root.getElementsByTagName('input');
2300
+ var idx = inputs.length;
2301
+ while (idx--) {
2302
+ var el = inputs[idx];
2303
+ el.checked && savedInputChecked.push(el);
2304
+ }
2305
+ }
2306
+ function _nextTick(fn) {
2307
+ return setTimeout(fn, 0);
2308
+ }
2309
+ function _cancelNextTick(id) {
2310
+ return clearTimeout(id);
2311
+ }
2312
+
2313
+ // Fixed #973:
2314
+ if (documentExists) {
2315
+ on(document, 'touchmove', function (evt) {
2316
+ if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {
2317
+ evt.preventDefault();
2318
+ }
2319
+ });
2320
+ }
2321
+
2322
+ // Export utils
2323
+ Sortable.utils = {
2324
+ on: on,
2325
+ off: off,
2326
+ css: css,
2327
+ find: find,
2328
+ is: function is(el, selector) {
2329
+ return !!closest(el, selector, el, false);
2330
+ },
2331
+ extend: extend,
2332
+ throttle: throttle,
2333
+ closest: closest,
2334
+ toggleClass: toggleClass,
2335
+ clone: clone,
2336
+ index: index,
2337
+ nextTick: _nextTick,
2338
+ cancelNextTick: _cancelNextTick,
2339
+ detectDirection: _detectDirection,
2340
+ getChild: getChild
2341
+ };
2342
+
2343
+ /**
2344
+ * Get the Sortable instance of an element
2345
+ * @param {HTMLElement} element The element
2346
+ * @return {Sortable|undefined} The instance of Sortable
2347
+ */
2348
+ Sortable.get = function (element) {
2349
+ return element[expando];
2350
+ };
2351
+
2352
+ /**
2353
+ * Mount a plugin to Sortable
2354
+ * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted
2355
+ */
2356
+ Sortable.mount = function () {
2357
+ for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {
2358
+ plugins[_key] = arguments[_key];
2359
+ }
2360
+ if (plugins[0].constructor === Array) plugins = plugins[0];
2361
+ plugins.forEach(function (plugin) {
2362
+ if (!plugin.prototype || !plugin.prototype.constructor) {
2363
+ throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(plugin));
2364
+ }
2365
+ if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);
2366
+ PluginManager.mount(plugin);
2367
+ });
2368
+ };
2369
+
2370
+ /**
2371
+ * Create sortable instance
2372
+ * @param {HTMLElement} el
2373
+ * @param {Object} [options]
2374
+ */
2375
+ Sortable.create = function (el, options) {
2376
+ return new Sortable(el, options);
2377
+ };
2378
+
2379
+ // Export
2380
+ Sortable.version = version;
2381
+
2382
+ var autoScrolls = [],
2383
+ scrollEl,
2384
+ scrollRootEl,
2385
+ scrolling = false,
2386
+ lastAutoScrollX,
2387
+ lastAutoScrollY,
2388
+ touchEvt$1,
2389
+ pointerElemChangedInterval;
2390
+ function AutoScrollPlugin() {
2391
+ function AutoScroll() {
2392
+ this.defaults = {
2393
+ scroll: true,
2394
+ forceAutoScrollFallback: false,
2395
+ scrollSensitivity: 30,
2396
+ scrollSpeed: 10,
2397
+ bubbleScroll: true
2398
+ };
2399
+
2400
+ // Bind all private methods
2401
+ for (var fn in this) {
2402
+ if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
2403
+ this[fn] = this[fn].bind(this);
2404
+ }
2405
+ }
2406
+ }
2407
+ AutoScroll.prototype = {
2408
+ dragStarted: function dragStarted(_ref) {
2409
+ var originalEvent = _ref.originalEvent;
2410
+ if (this.sortable.nativeDraggable) {
2411
+ on(document, 'dragover', this._handleAutoScroll);
2412
+ } else {
2413
+ if (this.options.supportPointer) {
2414
+ on(document, 'pointermove', this._handleFallbackAutoScroll);
2415
+ } else if (originalEvent.touches) {
2416
+ on(document, 'touchmove', this._handleFallbackAutoScroll);
2417
+ } else {
2418
+ on(document, 'mousemove', this._handleFallbackAutoScroll);
2419
+ }
2420
+ }
2421
+ },
2422
+ dragOverCompleted: function dragOverCompleted(_ref2) {
2423
+ var originalEvent = _ref2.originalEvent;
2424
+ // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)
2425
+ if (!this.options.dragOverBubble && !originalEvent.rootEl) {
2426
+ this._handleAutoScroll(originalEvent);
2427
+ }
2428
+ },
2429
+ drop: function drop() {
2430
+ if (this.sortable.nativeDraggable) {
2431
+ off(document, 'dragover', this._handleAutoScroll);
2432
+ } else {
2433
+ off(document, 'pointermove', this._handleFallbackAutoScroll);
2434
+ off(document, 'touchmove', this._handleFallbackAutoScroll);
2435
+ off(document, 'mousemove', this._handleFallbackAutoScroll);
2436
+ }
2437
+ clearPointerElemChangedInterval();
2438
+ clearAutoScrolls();
2439
+ cancelThrottle();
2440
+ },
2441
+ nulling: function nulling() {
2442
+ touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;
2443
+ autoScrolls.length = 0;
2444
+ },
2445
+ _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {
2446
+ this._handleAutoScroll(evt, true);
2447
+ },
2448
+ _handleAutoScroll: function _handleAutoScroll(evt, fallback) {
2449
+ var _this = this;
2450
+ var x = (evt.touches ? evt.touches[0] : evt).clientX,
2451
+ y = (evt.touches ? evt.touches[0] : evt).clientY,
2452
+ elem = document.elementFromPoint(x, y);
2453
+ touchEvt$1 = evt;
2454
+
2455
+ // IE does not seem to have native autoscroll,
2456
+ // Edge's autoscroll seems too conditional,
2457
+ // MACOS Safari does not have autoscroll,
2458
+ // Firefox and Chrome are good
2459
+ if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {
2460
+ autoScroll(evt, this.options, elem, fallback);
2461
+
2462
+ // Listener for pointer element change
2463
+ var ogElemScroller = getParentAutoScrollElement(elem, true);
2464
+ if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {
2465
+ pointerElemChangedInterval && clearPointerElemChangedInterval();
2466
+ // Detect for pointer elem change, emulating native DnD behaviour
2467
+ pointerElemChangedInterval = setInterval(function () {
2468
+ var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);
2469
+ if (newElem !== ogElemScroller) {
2470
+ ogElemScroller = newElem;
2471
+ clearAutoScrolls();
2472
+ }
2473
+ autoScroll(evt, _this.options, newElem, fallback);
2474
+ }, 10);
2475
+ lastAutoScrollX = x;
2476
+ lastAutoScrollY = y;
2477
+ }
2478
+ } else {
2479
+ // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll
2480
+ if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {
2481
+ clearAutoScrolls();
2482
+ return;
2483
+ }
2484
+ autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);
2485
+ }
2486
+ }
2487
+ };
2488
+ return _extends(AutoScroll, {
2489
+ pluginName: 'scroll',
2490
+ initializeByDefault: true
2491
+ });
2492
+ }
2493
+ function clearAutoScrolls() {
2494
+ autoScrolls.forEach(function (autoScroll) {
2495
+ clearInterval(autoScroll.pid);
2496
+ });
2497
+ autoScrolls = [];
2498
+ }
2499
+ function clearPointerElemChangedInterval() {
2500
+ clearInterval(pointerElemChangedInterval);
2501
+ }
2502
+ var autoScroll = throttle(function (evt, options, rootEl, isFallback) {
2503
+ // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521
2504
+ if (!options.scroll) return;
2505
+ var x = (evt.touches ? evt.touches[0] : evt).clientX,
2506
+ y = (evt.touches ? evt.touches[0] : evt).clientY,
2507
+ sens = options.scrollSensitivity,
2508
+ speed = options.scrollSpeed,
2509
+ winScroller = getWindowScrollingElement();
2510
+ var scrollThisInstance = false,
2511
+ scrollCustomFn;
2512
+
2513
+ // New scroll root, set scrollEl
2514
+ if (scrollRootEl !== rootEl) {
2515
+ scrollRootEl = rootEl;
2516
+ clearAutoScrolls();
2517
+ scrollEl = options.scroll;
2518
+ scrollCustomFn = options.scrollFn;
2519
+ if (scrollEl === true) {
2520
+ scrollEl = getParentAutoScrollElement(rootEl, true);
2521
+ }
2522
+ }
2523
+ var layersOut = 0;
2524
+ var currentParent = scrollEl;
2525
+ do {
2526
+ var el = currentParent,
2527
+ rect = getRect(el),
2528
+ top = rect.top,
2529
+ bottom = rect.bottom,
2530
+ left = rect.left,
2531
+ right = rect.right,
2532
+ width = rect.width,
2533
+ height = rect.height,
2534
+ canScrollX = void 0,
2535
+ canScrollY = void 0,
2536
+ scrollWidth = el.scrollWidth,
2537
+ scrollHeight = el.scrollHeight,
2538
+ elCSS = css(el),
2539
+ scrollPosX = el.scrollLeft,
2540
+ scrollPosY = el.scrollTop;
2541
+ if (el === winScroller) {
2542
+ canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');
2543
+ canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');
2544
+ } else {
2545
+ canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');
2546
+ canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');
2547
+ }
2548
+ var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);
2549
+ var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);
2550
+ if (!autoScrolls[layersOut]) {
2551
+ for (var i = 0; i <= layersOut; i++) {
2552
+ if (!autoScrolls[i]) {
2553
+ autoScrolls[i] = {};
2554
+ }
2555
+ }
2556
+ }
2557
+ if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {
2558
+ autoScrolls[layersOut].el = el;
2559
+ autoScrolls[layersOut].vx = vx;
2560
+ autoScrolls[layersOut].vy = vy;
2561
+ clearInterval(autoScrolls[layersOut].pid);
2562
+ if (vx != 0 || vy != 0) {
2563
+ scrollThisInstance = true;
2564
+ /* jshint loopfunc:true */
2565
+ autoScrolls[layersOut].pid = setInterval(function () {
2566
+ // emulate drag over during autoscroll (fallback), emulating native DnD behaviour
2567
+ if (isFallback && this.layer === 0) {
2568
+ Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely
2569
+ }
2570
+ var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;
2571
+ var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;
2572
+ if (typeof scrollCustomFn === 'function') {
2573
+ if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {
2574
+ return;
2575
+ }
2576
+ }
2577
+ scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);
2578
+ }.bind({
2579
+ layer: layersOut
2580
+ }), 24);
2581
+ }
2582
+ }
2583
+ layersOut++;
2584
+ } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));
2585
+ scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not
2586
+ }, 30);
2587
+
2588
+ var drop = function drop(_ref) {
2589
+ var originalEvent = _ref.originalEvent,
2590
+ putSortable = _ref.putSortable,
2591
+ dragEl = _ref.dragEl,
2592
+ activeSortable = _ref.activeSortable,
2593
+ dispatchSortableEvent = _ref.dispatchSortableEvent,
2594
+ hideGhostForTarget = _ref.hideGhostForTarget,
2595
+ unhideGhostForTarget = _ref.unhideGhostForTarget;
2596
+ if (!originalEvent) return;
2597
+ var toSortable = putSortable || activeSortable;
2598
+ hideGhostForTarget();
2599
+ var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;
2600
+ var target = document.elementFromPoint(touch.clientX, touch.clientY);
2601
+ unhideGhostForTarget();
2602
+ if (toSortable && !toSortable.el.contains(target)) {
2603
+ dispatchSortableEvent('spill');
2604
+ this.onSpill({
2605
+ dragEl: dragEl,
2606
+ putSortable: putSortable
2607
+ });
2608
+ }
2609
+ };
2610
+ function Revert() {}
2611
+ Revert.prototype = {
2612
+ startIndex: null,
2613
+ dragStart: function dragStart(_ref2) {
2614
+ var oldDraggableIndex = _ref2.oldDraggableIndex;
2615
+ this.startIndex = oldDraggableIndex;
2616
+ },
2617
+ onSpill: function onSpill(_ref3) {
2618
+ var dragEl = _ref3.dragEl,
2619
+ putSortable = _ref3.putSortable;
2620
+ this.sortable.captureAnimationState();
2621
+ if (putSortable) {
2622
+ putSortable.captureAnimationState();
2623
+ }
2624
+ var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);
2625
+ if (nextSibling) {
2626
+ this.sortable.el.insertBefore(dragEl, nextSibling);
2627
+ } else {
2628
+ this.sortable.el.appendChild(dragEl);
2629
+ }
2630
+ this.sortable.animateAll();
2631
+ if (putSortable) {
2632
+ putSortable.animateAll();
2633
+ }
2634
+ },
2635
+ drop: drop
2636
+ };
2637
+ _extends(Revert, {
2638
+ pluginName: 'revertOnSpill'
2639
+ });
2640
+ function Remove() {}
2641
+ Remove.prototype = {
2642
+ onSpill: function onSpill(_ref4) {
2643
+ var dragEl = _ref4.dragEl,
2644
+ putSortable = _ref4.putSortable;
2645
+ var parentSortable = putSortable || this.sortable;
2646
+ parentSortable.captureAnimationState();
2647
+ dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);
2648
+ parentSortable.animateAll();
2649
+ },
2650
+ drop: drop
2651
+ };
2652
+ _extends(Remove, {
2653
+ pluginName: 'removeOnSpill'
2654
+ });
2655
+
2656
+ Sortable.mount(new AutoScrollPlugin());
2657
+ Sortable.mount(Remove, Revert);
2658
+
2659
+ const pdsSortableCss = ".pds-sortable.sc-pds-sortable-h{--border-radius:var(--pine-border-radius-md);--border:var(--pine-border-default);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.pds-sortable.pds-sortable--bordered.sc-pds-sortable-h{border:var(--border);border-radius:var(--border-radius)}";
2660
+
2661
+ const PdsSortable = class {
2662
+ constructor(hostRef) {
2663
+ index$1.registerInstance(this, hostRef);
2664
+ this.pdsSortableItemMoved = index$1.createEvent(this, "pdsSortableItemMoved", 7);
2665
+ this.border = false;
2666
+ this.componentId = undefined;
2667
+ this.dividers = false;
2668
+ this.handleType = 'row';
2669
+ }
2670
+ classNames() {
2671
+ const classNames = ['pds-sortable'];
2672
+ if (this.border) {
2673
+ classNames.push('pds-sortable--bordered');
2674
+ }
2675
+ if (this.dividers) {
2676
+ classNames.push('pds-sortable--divided');
2677
+ }
2678
+ if (this.handleType) {
2679
+ classNames.push(`pds-sortable--handle-type-${this.handleType}`);
2680
+ }
2681
+ return classNames.join(' ');
2682
+ }
2683
+ componentDidLoad() {
2684
+ let sortableOptions = {
2685
+ animation: 150,
2686
+ ghostClass: 'pds-sortable-item--ghost',
2687
+ dragClass: 'pds-sortable-item--drag',
2688
+ onEnd: (evt) => {
2689
+ this.pdsSortableItemMoved.emit(evt);
2690
+ },
2691
+ };
2692
+ if (this.handleType === 'handle') {
2693
+ sortableOptions = Object.assign(Object.assign({}, sortableOptions), { handle: '.pds-sortable-item__handle' });
2694
+ }
2695
+ Sortable.create(this.el, sortableOptions);
2696
+ }
2697
+ render() {
2698
+ return (index$1.h(index$1.Host, { class: this.classNames(), id: this.componentId }, index$1.h("slot", null)));
2699
+ }
2700
+ get el() { return index$1.getElement(this); }
2701
+ };
2702
+ PdsSortable.style = pdsSortableCss;
2703
+
2704
+ exports.pds_sortable = PdsSortable;
2705
+
2706
+ //# sourceMappingURL=pds-sortable.cjs.entry.js.map