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