@sankhyalabs/sankhyablocks 8.16.0-ms.11 → 8.16.0-ms.12

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