@getflip/swirl-components 0.12.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (961) hide show
  1. package/components.json +648 -106
  2. package/dist/cjs/balancetext-7a0bdee3.js +763 -0
  3. package/dist/cjs/file-manager.cjs.entry.js +3 -1
  4. package/dist/cjs/{floating-ui.dom.esm-75453e4e.js → floating-ui.dom.esm-35943202.js} +0 -0
  5. package/dist/cjs/{index-72831c5f.js → index-83363034.js} +584 -274
  6. package/dist/cjs/loader.cjs.js +4 -3
  7. package/dist/cjs/swirl-action-list-item.cjs.entry.js +9 -4
  8. package/dist/cjs/swirl-action-list-section.cjs.entry.js +2 -1
  9. package/dist/cjs/swirl-action-list.cjs.entry.js +2 -2
  10. package/dist/cjs/swirl-app-layout_5.cjs.entry.js +41 -9
  11. package/dist/cjs/swirl-autocomplete.cjs.entry.js +22 -11
  12. package/dist/cjs/swirl-avatar-group.cjs.entry.js +2 -1
  13. package/dist/cjs/swirl-avatar.cjs.entry.js +13 -7
  14. package/dist/cjs/swirl-badge.cjs.entry.js +3 -1
  15. package/dist/cjs/swirl-banner.cjs.entry.js +9 -7
  16. package/dist/cjs/swirl-button-group.cjs.entry.js +4 -1
  17. package/dist/cjs/swirl-button.cjs.entry.js +20 -6
  18. package/dist/cjs/swirl-card.cjs.entry.js +5 -1
  19. package/dist/cjs/swirl-checkbox.cjs.entry.js +11 -3
  20. package/dist/cjs/swirl-chip.cjs.entry.js +7 -4
  21. package/dist/cjs/swirl-components.cjs.js +10 -3
  22. package/dist/cjs/swirl-console-layout.cjs.entry.js +14 -8
  23. package/dist/cjs/swirl-date-input.cjs.entry.js +23 -8
  24. package/dist/cjs/swirl-date-picker_2.cjs.entry.js +19 -82
  25. package/dist/cjs/swirl-description-list-item.cjs.entry.js +2 -1
  26. package/dist/cjs/swirl-description-list.cjs.entry.js +1 -1
  27. package/dist/cjs/swirl-dialog.cjs.entry.js +7 -3
  28. package/dist/cjs/swirl-file-uploader.cjs.entry.js +12 -5
  29. package/dist/cjs/swirl-file-viewer_7.cjs.entry.js +40 -16
  30. package/dist/cjs/swirl-form-control.cjs.entry.js +24 -2
  31. package/dist/cjs/swirl-form-group.cjs.entry.js +1 -1
  32. package/dist/cjs/swirl-heading.cjs.entry.js +19 -2
  33. package/dist/cjs/swirl-icon-add-photo.cjs.entry.js +1 -1
  34. package/dist/cjs/swirl-icon-add_4.cjs.entry.js +1 -1
  35. package/dist/cjs/swirl-icon-admin-panel-settings.cjs.entry.js +1 -1
  36. package/dist/cjs/swirl-icon-arrow-back.cjs.entry.js +1 -1
  37. package/dist/cjs/swirl-icon-arrow-downward_2.cjs.entry.js +1 -1
  38. package/dist/cjs/swirl-icon-arrow-forward.cjs.entry.js +1 -1
  39. package/dist/cjs/swirl-icon-arrow-left_3.cjs.entry.js +1 -1
  40. package/dist/cjs/swirl-icon-arrow-right-small.cjs.entry.js +1 -1
  41. package/dist/cjs/swirl-icon-attachment.cjs.entry.js +1 -1
  42. package/dist/cjs/swirl-icon-block.cjs.entry.js +1 -1
  43. package/dist/cjs/swirl-icon-cancel_4.cjs.entry.js +1 -1
  44. package/dist/cjs/swirl-icon-chat-bubble.cjs.entry.js +1 -1
  45. package/dist/cjs/swirl-icon-chats-filled.cjs.entry.js +1 -1
  46. package/dist/cjs/swirl-icon-chats-outlined.cjs.entry.js +1 -1
  47. package/dist/cjs/swirl-icon-check-circle.cjs.entry.js +1 -1
  48. package/dist/cjs/swirl-icon-check-small_4.cjs.entry.js +3452 -0
  49. package/dist/cjs/swirl-icon-check-strong.cjs.entry.js +1 -1
  50. package/dist/cjs/swirl-icon-check.cjs.entry.js +1 -1
  51. package/dist/cjs/swirl-icon-chevron-left.cjs.entry.js +1 -1
  52. package/dist/cjs/swirl-icon-chevron-right.cjs.entry.js +1 -1
  53. package/dist/cjs/swirl-icon-close-small.cjs.entry.js +1 -1
  54. package/dist/cjs/swirl-icon-close.cjs.entry.js +1 -1
  55. package/dist/cjs/swirl-icon-cloud-upload.cjs.entry.js +1 -1
  56. package/dist/cjs/swirl-icon-column.cjs.entry.js +1 -1
  57. package/dist/cjs/swirl-icon-comment.cjs.entry.js +1 -1
  58. package/dist/cjs/swirl-icon-copy.cjs.entry.js +1 -1
  59. package/dist/cjs/swirl-icon-date-range.cjs.entry.js +1 -1
  60. package/dist/cjs/swirl-icon-delete.cjs.entry.js +1 -1
  61. package/dist/cjs/swirl-icon-description.cjs.entry.js +1 -1
  62. package/dist/cjs/swirl-icon-edit.cjs.entry.js +1 -1
  63. package/dist/cjs/swirl-icon-emoji-mood.cjs.entry.js +1 -1
  64. package/dist/cjs/swirl-icon-emoji-satisfied.cjs.entry.js +1 -1
  65. package/dist/cjs/swirl-icon-error_3.cjs.entry.js +5 -3
  66. package/dist/cjs/swirl-icon-expand-more.cjs.entry.js +1 -1
  67. package/dist/cjs/swirl-icon-file.cjs.entry.js +1 -1
  68. package/dist/cjs/swirl-icon-filter.cjs.entry.js +1 -1
  69. package/dist/cjs/swirl-icon-folder-shared.cjs.entry.js +1 -1
  70. package/dist/cjs/swirl-icon-group-assign.cjs.entry.js +1 -1
  71. package/dist/cjs/swirl-icon-groups-custom.cjs.entry.js +1 -1
  72. package/dist/cjs/swirl-icon-groups-filled.cjs.entry.js +1 -1
  73. package/dist/cjs/swirl-icon-groups-outlined.cjs.entry.js +1 -1
  74. package/dist/cjs/swirl-icon-groups.cjs.entry.js +1 -1
  75. package/dist/cjs/swirl-icon-help.cjs.entry.js +1 -1
  76. package/dist/cjs/swirl-icon-image.cjs.entry.js +1 -1
  77. package/dist/cjs/swirl-icon-info.cjs.entry.js +1 -1
  78. package/dist/cjs/swirl-icon-inventory.cjs.entry.js +1 -1
  79. package/dist/cjs/swirl-icon-like.cjs.entry.js +1 -1
  80. package/dist/cjs/swirl-icon-link.cjs.entry.js +1 -1
  81. package/dist/cjs/swirl-icon-lock.cjs.entry.js +1 -1
  82. package/dist/cjs/swirl-icon-logout.cjs.entry.js +1 -1
  83. package/dist/cjs/swirl-icon-mail.cjs.entry.js +1 -1
  84. package/dist/cjs/swirl-icon-manage-accounts.cjs.entry.js +1 -1
  85. package/dist/cjs/swirl-icon-mention.cjs.entry.js +1 -1
  86. package/dist/cjs/swirl-icon-menu-filled.cjs.entry.js +1 -1
  87. package/dist/cjs/swirl-icon-menu-outlined.cjs.entry.js +1 -1
  88. package/dist/cjs/swirl-icon-menu.cjs.entry.js +1 -1
  89. package/dist/cjs/swirl-icon-message.cjs.entry.js +1 -1
  90. package/dist/cjs/swirl-icon-more-horizontal.cjs.entry.js +1 -1
  91. package/dist/cjs/swirl-icon-more-vertikal.cjs.entry.js +1 -1
  92. package/dist/cjs/swirl-icon-news-filled.cjs.entry.js +1 -1
  93. package/dist/cjs/swirl-icon-news-outlined.cjs.entry.js +1 -1
  94. package/dist/cjs/swirl-icon-notifications-active.cjs.entry.js +1 -1
  95. package/dist/cjs/swirl-icon-notifications-off.cjs.entry.js +1 -1
  96. package/dist/cjs/swirl-icon-notifications.cjs.entry.js +1 -1
  97. package/dist/cjs/swirl-icon-open-in-new.cjs.entry.js +1 -1
  98. package/dist/cjs/swirl-icon-people-alt.cjs.entry.js +1 -1
  99. package/dist/cjs/swirl-icon-person-off.cjs.entry.js +1 -1
  100. package/dist/cjs/swirl-icon-person.cjs.entry.js +1 -1
  101. package/dist/cjs/swirl-icon-phone.cjs.entry.js +1 -1
  102. package/dist/cjs/swirl-icon-poll.cjs.entry.js +1 -1
  103. package/dist/cjs/swirl-icon-print.cjs.entry.js +1 -1
  104. package/dist/cjs/swirl-icon-recieved.cjs.entry.js +1 -1
  105. package/dist/cjs/swirl-icon-search-strong.cjs.entry.js +1 -1
  106. package/dist/cjs/swirl-icon-search.cjs.entry.js +1 -1
  107. package/dist/cjs/swirl-icon-send.cjs.entry.js +1 -1
  108. package/dist/cjs/swirl-icon-settings.cjs.entry.js +1 -1
  109. package/dist/cjs/swirl-icon-sync.cjs.entry.js +1 -1
  110. package/dist/cjs/swirl-icon-tasks-filled.cjs.entry.js +1 -1
  111. package/dist/cjs/swirl-icon-tasks-outlined.cjs.entry.js +1 -1
  112. package/dist/cjs/swirl-icon-time-filled.cjs.entry.js +1 -1
  113. package/dist/cjs/swirl-icon-time-outlined.cjs.entry.js +1 -1
  114. package/dist/cjs/swirl-icon-user-assign.cjs.entry.js +1 -1
  115. package/dist/cjs/swirl-icon-video-camera.cjs.entry.js +1 -1
  116. package/dist/cjs/swirl-icon-warning.cjs.entry.js +1 -1
  117. package/dist/cjs/swirl-lightbox.cjs.entry.js +10 -8
  118. package/dist/cjs/swirl-link.cjs.entry.js +4 -1
  119. package/dist/cjs/swirl-list.cjs.entry.js +1 -1
  120. package/dist/cjs/swirl-modal.cjs.entry.js +9 -6
  121. package/dist/cjs/swirl-option-list-section.cjs.entry.js +2 -1
  122. package/dist/cjs/swirl-pagination.cjs.entry.js +11 -8
  123. package/dist/cjs/swirl-pdf-reader.cjs.entry.js +16 -12
  124. package/dist/cjs/swirl-popover.cjs.entry.js +14 -9
  125. package/dist/cjs/swirl-progress-indicator.cjs.entry.js +2 -1
  126. package/dist/cjs/swirl-radio-group.cjs.entry.js +3 -1
  127. package/dist/cjs/swirl-radio.cjs.entry.js +9 -3
  128. package/dist/cjs/swirl-resource-list-file-item.cjs.entry.js +9 -4
  129. package/dist/cjs/swirl-search.cjs.entry.js +10 -4
  130. package/dist/cjs/swirl-select.cjs.entry.js +14 -4
  131. package/dist/cjs/swirl-separator.cjs.entry.js +1 -1
  132. package/dist/cjs/swirl-skeleton-box.cjs.entry.js +34 -0
  133. package/dist/cjs/swirl-skeleton-text.cjs.entry.js +26 -0
  134. package/dist/cjs/swirl-stack.cjs.entry.js +1 -1
  135. package/dist/cjs/swirl-switch.cjs.entry.js +8 -4
  136. package/dist/cjs/swirl-tab.cjs.entry.js +4 -1
  137. package/dist/cjs/swirl-table-cell.cjs.entry.js +1 -1
  138. package/dist/cjs/swirl-table-column.cjs.entry.js +6 -1
  139. package/dist/cjs/swirl-table-row-group.cjs.entry.js +2 -1
  140. package/dist/cjs/swirl-table-row.cjs.entry.js +3 -1
  141. package/dist/cjs/swirl-table.cjs.entry.js +9 -3
  142. package/dist/cjs/swirl-tabs.cjs.entry.js +4 -1
  143. package/dist/cjs/swirl-tag.cjs.entry.js +5 -3
  144. package/dist/cjs/swirl-text-input.cjs.entry.js +34 -10
  145. package/dist/cjs/swirl-text.cjs.entry.js +19 -3
  146. package/dist/cjs/swirl-theme-provider.cjs.entry.js +2 -1
  147. package/dist/cjs/swirl-thumbnail.cjs.entry.js +3 -1
  148. package/dist/cjs/swirl-toast-provider.cjs.entry.js +3 -2
  149. package/dist/cjs/swirl-toast.cjs.entry.js +9 -4
  150. package/dist/cjs/swirl-tooltip.cjs.entry.js +7 -5
  151. package/dist/cjs/swirl-tree-navigation-item.cjs.entry.js +4 -1
  152. package/dist/cjs/swirl-video-thumbnail.cjs.entry.js +4 -1
  153. package/dist/cjs/swirl-visually-hidden.cjs.entry.js +1 -1
  154. package/dist/cjs/{utils-9c9476b4.js → utils-a07ee0db.js} +18 -0
  155. package/dist/cjs/wc-datepicker.cjs.entry.js +471 -0
  156. package/dist/collection/collection-manifest.json +13 -3
  157. package/dist/collection/components/swirl-action-list/swirl-action-list.js +12 -10
  158. package/dist/collection/components/swirl-action-list-item/swirl-action-list-item.js +146 -139
  159. package/dist/collection/components/swirl-action-list-section/swirl-action-list-section.js +36 -31
  160. package/dist/collection/components/swirl-app-layout/swirl-app-layout.js +425 -427
  161. package/dist/collection/components/swirl-autocomplete/swirl-autocomplete.js +310 -275
  162. package/dist/collection/components/swirl-avatar/swirl-avatar.js +238 -228
  163. package/dist/collection/components/swirl-avatar-group/swirl-avatar-group.js +36 -30
  164. package/dist/collection/components/swirl-badge/swirl-badge.js +114 -106
  165. package/dist/collection/components/swirl-banner/swirl-banner.js +192 -187
  166. package/dist/collection/components/swirl-box/swirl-box.js +144 -134
  167. package/dist/collection/components/swirl-button/swirl-button.js +382 -360
  168. package/dist/collection/components/swirl-button-group/swirl-button-group.js +93 -85
  169. package/dist/collection/components/swirl-card/swirl-card.js +104 -96
  170. package/dist/collection/components/swirl-checkbox/swirl-checkbox.js +210 -204
  171. package/dist/collection/components/swirl-chip/swirl-chip.js +108 -102
  172. package/dist/collection/components/swirl-console-layout/swirl-console-layout.js +312 -322
  173. package/dist/collection/components/swirl-date-input/swirl-date-input.css +11 -0
  174. package/dist/collection/components/swirl-date-input/swirl-date-input.js +294 -223
  175. package/dist/collection/components/swirl-date-picker/swirl-date-picker.css +168 -121
  176. package/dist/collection/components/swirl-date-picker/swirl-date-picker.js +134 -199
  177. package/dist/collection/components/swirl-date-picker/swirl-date-picker.stories.js +0 -5
  178. package/dist/collection/components/swirl-description-list/swirl-description-list.js +12 -10
  179. package/dist/collection/components/swirl-description-list-item/swirl-description-list-item.js +36 -31
  180. package/dist/collection/components/swirl-dialog/swirl-dialog.js +182 -174
  181. package/dist/collection/components/swirl-empty-state/swirl-empty-state.js +53 -50
  182. package/dist/collection/components/swirl-file-uploader/swirl-file-uploader.js +249 -241
  183. package/dist/collection/components/swirl-file-viewer/swirl-file-viewer.js +214 -208
  184. package/dist/collection/components/swirl-file-viewer/viewers/swirl-file-viewer-audio/swirl-file-viewer-audio.js +90 -79
  185. package/dist/collection/components/swirl-file-viewer/viewers/swirl-file-viewer-csv/swirl-file-viewer-csv.js +87 -77
  186. package/dist/collection/components/swirl-file-viewer/viewers/swirl-file-viewer-image/swirl-file-viewer-image.js +160 -148
  187. package/dist/collection/components/swirl-file-viewer/viewers/swirl-file-viewer-pdf/swirl-file-viewer-pdf.js +224 -214
  188. package/dist/collection/components/swirl-file-viewer/viewers/swirl-file-viewer-text/swirl-file-viewer-text.js +87 -75
  189. package/dist/collection/components/swirl-file-viewer/viewers/swirl-file-viewer-video/swirl-file-viewer-video.js +90 -79
  190. package/dist/collection/components/swirl-form-control/swirl-form-control.css +22 -0
  191. package/dist/collection/components/swirl-form-control/swirl-form-control.js +167 -122
  192. package/dist/collection/components/swirl-form-group/swirl-form-group.js +38 -33
  193. package/dist/collection/components/swirl-heading/swirl-heading.js +154 -102
  194. package/dist/collection/components/swirl-heading/swirl-heading.stories.js +6 -1
  195. package/dist/collection/components/swirl-icon/icons/swirl-icon-add-photo.js +38 -38
  196. package/dist/collection/components/swirl-icon/icons/swirl-icon-add.js +38 -38
  197. package/dist/collection/components/swirl-icon/icons/swirl-icon-admin-panel-settings.js +38 -41
  198. package/dist/collection/components/swirl-icon/icons/swirl-icon-arrow-back.js +38 -38
  199. package/dist/collection/components/swirl-icon/icons/swirl-icon-arrow-downward.js +38 -38
  200. package/dist/collection/components/swirl-icon/icons/swirl-icon-arrow-forward.js +38 -38
  201. package/dist/collection/components/swirl-icon/icons/swirl-icon-arrow-left.js +38 -38
  202. package/dist/collection/components/swirl-icon/icons/swirl-icon-arrow-right-small.js +38 -38
  203. package/dist/collection/components/swirl-icon/icons/swirl-icon-arrow-right.js +38 -38
  204. package/dist/collection/components/swirl-icon/icons/swirl-icon-arrow-upward.js +38 -38
  205. package/dist/collection/components/swirl-icon/icons/swirl-icon-attachment.js +38 -38
  206. package/dist/collection/components/swirl-icon/icons/swirl-icon-block.js +38 -38
  207. package/dist/collection/components/swirl-icon/icons/swirl-icon-cancel.js +38 -38
  208. package/dist/collection/components/swirl-icon/icons/swirl-icon-chat-bubble.js +38 -38
  209. package/dist/collection/components/swirl-icon/icons/swirl-icon-chats-filled.js +38 -38
  210. package/dist/collection/components/swirl-icon/icons/swirl-icon-chats-outlined.js +38 -44
  211. package/dist/collection/components/swirl-icon/icons/swirl-icon-check-circle.js +38 -38
  212. package/dist/collection/components/swirl-icon/icons/swirl-icon-check-small.js +38 -38
  213. package/dist/collection/components/swirl-icon/icons/swirl-icon-check-strong.js +38 -38
  214. package/dist/collection/components/swirl-icon/icons/swirl-icon-check.js +38 -38
  215. package/dist/collection/components/swirl-icon/icons/swirl-icon-chevron-left.js +38 -38
  216. package/dist/collection/components/swirl-icon/icons/swirl-icon-chevron-right.js +38 -38
  217. package/dist/collection/components/swirl-icon/icons/swirl-icon-close-small.js +38 -38
  218. package/dist/collection/components/swirl-icon/icons/swirl-icon-close.js +38 -38
  219. package/dist/collection/components/swirl-icon/icons/swirl-icon-cloud-upload.js +38 -38
  220. package/dist/collection/components/swirl-icon/icons/swirl-icon-column.js +38 -38
  221. package/dist/collection/components/swirl-icon/icons/swirl-icon-comment.js +38 -41
  222. package/dist/collection/components/swirl-icon/icons/swirl-icon-copy.js +38 -38
  223. package/dist/collection/components/swirl-icon/icons/swirl-icon-date-range.js +38 -38
  224. package/dist/collection/components/swirl-icon/icons/swirl-icon-delete.js +38 -41
  225. package/dist/collection/components/swirl-icon/icons/swirl-icon-description.js +38 -38
  226. package/dist/collection/components/swirl-icon/icons/swirl-icon-download.js +38 -38
  227. package/dist/collection/components/swirl-icon/icons/swirl-icon-drag-handle.js +52 -0
  228. package/dist/collection/components/swirl-icon/icons/swirl-icon-edit.js +38 -38
  229. package/dist/collection/components/swirl-icon/icons/swirl-icon-emoji-mood.js +38 -38
  230. package/dist/collection/components/swirl-icon/icons/swirl-icon-emoji-satisfied.js +38 -38
  231. package/dist/collection/components/swirl-icon/icons/swirl-icon-error.js +38 -38
  232. package/dist/collection/components/swirl-icon/icons/swirl-icon-expand-less.js +38 -38
  233. package/dist/collection/components/swirl-icon/icons/swirl-icon-expand-more.js +38 -38
  234. package/dist/collection/components/swirl-icon/icons/swirl-icon-file.js +38 -38
  235. package/dist/collection/components/swirl-icon/icons/swirl-icon-filter.js +38 -38
  236. package/dist/collection/components/swirl-icon/icons/swirl-icon-folder-shared.js +38 -38
  237. package/dist/collection/components/swirl-icon/icons/swirl-icon-fullscreen-exit.js +38 -38
  238. package/dist/collection/components/swirl-icon/icons/swirl-icon-fullscreen.js +38 -38
  239. package/dist/collection/components/swirl-icon/icons/swirl-icon-group-assign.js +38 -38
  240. package/dist/collection/components/swirl-icon/icons/swirl-icon-groups-custom.js +38 -53
  241. package/dist/collection/components/swirl-icon/icons/swirl-icon-groups-filled.js +38 -53
  242. package/dist/collection/components/swirl-icon/icons/swirl-icon-groups-outlined.js +38 -53
  243. package/dist/collection/components/swirl-icon/icons/swirl-icon-groups.js +38 -38
  244. package/dist/collection/components/swirl-icon/icons/swirl-icon-help.js +38 -38
  245. package/dist/collection/components/swirl-icon/icons/swirl-icon-image.js +38 -38
  246. package/dist/collection/components/swirl-icon/icons/swirl-icon-info.js +38 -38
  247. package/dist/collection/components/swirl-icon/icons/swirl-icon-inventory.js +38 -38
  248. package/dist/collection/components/swirl-icon/icons/swirl-icon-like.js +38 -41
  249. package/dist/collection/components/swirl-icon/icons/swirl-icon-link.js +38 -38
  250. package/dist/collection/components/swirl-icon/icons/swirl-icon-lock.js +38 -38
  251. package/dist/collection/components/swirl-icon/icons/swirl-icon-logout.js +38 -38
  252. package/dist/collection/components/swirl-icon/icons/swirl-icon-mail.js +38 -38
  253. package/dist/collection/components/swirl-icon/icons/swirl-icon-manage-accounts.js +38 -44
  254. package/dist/collection/components/swirl-icon/icons/swirl-icon-mention.js +38 -38
  255. package/dist/collection/components/swirl-icon/icons/swirl-icon-menu-filled.js +38 -47
  256. package/dist/collection/components/swirl-icon/icons/swirl-icon-menu-outlined.js +38 -47
  257. package/dist/collection/components/swirl-icon/icons/swirl-icon-menu.js +38 -38
  258. package/dist/collection/components/swirl-icon/icons/swirl-icon-message.js +38 -38
  259. package/dist/collection/components/swirl-icon/icons/swirl-icon-more-horizontal.js +38 -38
  260. package/dist/collection/components/swirl-icon/icons/swirl-icon-more-vertikal.js +38 -38
  261. package/dist/collection/components/swirl-icon/icons/swirl-icon-news-filled.js +38 -38
  262. package/dist/collection/components/swirl-icon/icons/swirl-icon-news-outlined.js +38 -44
  263. package/dist/collection/components/swirl-icon/icons/swirl-icon-notifications-active.js +38 -38
  264. package/dist/collection/components/swirl-icon/icons/swirl-icon-notifications-off.js +38 -38
  265. package/dist/collection/components/swirl-icon/icons/swirl-icon-notifications.js +38 -38
  266. package/dist/collection/components/swirl-icon/icons/swirl-icon-open-in-new.js +38 -38
  267. package/dist/collection/components/swirl-icon/icons/swirl-icon-people-alt.js +38 -47
  268. package/dist/collection/components/swirl-icon/icons/swirl-icon-person-off.js +38 -38
  269. package/dist/collection/components/swirl-icon/icons/swirl-icon-person.js +38 -38
  270. package/dist/collection/components/swirl-icon/icons/swirl-icon-phone.js +38 -38
  271. package/dist/collection/components/swirl-icon/icons/swirl-icon-poll.js +38 -38
  272. package/dist/collection/components/swirl-icon/icons/swirl-icon-print.js +38 -38
  273. package/dist/collection/components/swirl-icon/icons/swirl-icon-recieved.js +38 -41
  274. package/dist/collection/components/swirl-icon/icons/swirl-icon-remove.js +38 -38
  275. package/dist/collection/components/swirl-icon/icons/swirl-icon-search-strong.js +38 -38
  276. package/dist/collection/components/swirl-icon/icons/swirl-icon-search.js +38 -38
  277. package/dist/collection/components/swirl-icon/icons/swirl-icon-send.js +38 -38
  278. package/dist/collection/components/swirl-icon/icons/swirl-icon-settings.js +38 -38
  279. package/dist/collection/components/swirl-icon/icons/swirl-icon-sync.js +38 -38
  280. package/dist/collection/components/swirl-icon/icons/swirl-icon-tasks-filled.js +38 -38
  281. package/dist/collection/components/swirl-icon/icons/swirl-icon-tasks-outlined.js +38 -41
  282. package/dist/collection/components/swirl-icon/icons/swirl-icon-time-filled.js +38 -38
  283. package/dist/collection/components/swirl-icon/icons/swirl-icon-time-outlined.js +38 -38
  284. package/dist/collection/components/swirl-icon/icons/swirl-icon-today.js +38 -38
  285. package/dist/collection/components/swirl-icon/icons/swirl-icon-user-assign.js +38 -38
  286. package/dist/collection/components/swirl-icon/icons/swirl-icon-video-camera.js +38 -38
  287. package/dist/collection/components/swirl-icon/icons/swirl-icon-visibility-off.js +38 -38
  288. package/dist/collection/components/swirl-icon/icons/swirl-icon-visibility.js +38 -38
  289. package/dist/collection/components/swirl-icon/icons/swirl-icon-warning.js +38 -38
  290. package/dist/collection/components/swirl-inline-error/swirl-inline-error.js +56 -52
  291. package/dist/collection/components/swirl-lightbox/swirl-lightbox.js +170 -178
  292. package/dist/collection/components/swirl-link/swirl-link.js +74 -63
  293. package/dist/collection/components/swirl-list/swirl-list.js +12 -10
  294. package/dist/collection/components/swirl-modal/swirl-modal.js +205 -200
  295. package/dist/collection/components/swirl-option-list/swirl-option-list.js +364 -126
  296. package/dist/collection/components/swirl-option-list/swirl-option-list.stories.js +6 -8
  297. package/dist/collection/components/swirl-option-list-item/swirl-option-list-item.css +64 -1
  298. package/dist/collection/components/swirl-option-list-item/swirl-option-list-item.js +234 -123
  299. package/dist/collection/components/swirl-option-list-item/swirl-option-list-item.stories.js +8 -0
  300. package/dist/collection/components/swirl-option-list-section/swirl-option-list-section.js +36 -31
  301. package/dist/collection/components/swirl-pagination/swirl-pagination.js +218 -223
  302. package/dist/collection/components/swirl-pdf-reader/swirl-pdf-reader.js +233 -245
  303. package/dist/collection/components/swirl-popover/swirl-popover.js +263 -249
  304. package/dist/collection/components/swirl-progress-indicator/swirl-progress-indicator.js +93 -89
  305. package/dist/collection/components/swirl-radio/swirl-radio.js +183 -176
  306. package/dist/collection/components/swirl-radio-group/swirl-radio-group.js +70 -60
  307. package/dist/collection/components/swirl-resource-list/swirl-resource-list.js +34 -29
  308. package/dist/collection/components/swirl-resource-list-file-item/swirl-resource-list-file-item.js +158 -156
  309. package/dist/collection/components/swirl-resource-list-item/swirl-resource-list-item.js +240 -232
  310. package/dist/collection/components/swirl-search/swirl-search.js +216 -205
  311. package/dist/collection/components/swirl-select/swirl-select.css +4 -0
  312. package/dist/collection/components/swirl-select/swirl-select.js +186 -153
  313. package/dist/collection/components/swirl-separator/swirl-separator.js +12 -9
  314. package/dist/collection/components/swirl-skeleton-box/swirl-skeleton-box.css +54 -0
  315. package/dist/collection/components/swirl-skeleton-box/swirl-skeleton-box.js +130 -0
  316. package/dist/collection/components/swirl-skeleton-box/swirl-skeleton-box.stories.js +20 -0
  317. package/dist/collection/components/swirl-skeleton-text/swirl-skeleton-text.css +173 -0
  318. package/dist/collection/components/swirl-skeleton-text/swirl-skeleton-text.js +89 -0
  319. package/dist/collection/components/swirl-skeleton-text/swirl-skeleton-text.stories.js +19 -0
  320. package/dist/collection/components/swirl-spinner/swirl-spinner.js +55 -53
  321. package/dist/collection/components/swirl-stack/swirl-stack.js +135 -127
  322. package/dist/collection/components/swirl-switch/swirl-switch.js +169 -160
  323. package/dist/collection/components/swirl-tab/swirl-tab.js +70 -61
  324. package/dist/collection/components/swirl-table/swirl-table.js +90 -88
  325. package/dist/collection/components/swirl-table-cell/swirl-table-cell.js +12 -9
  326. package/dist/collection/components/swirl-table-column/swirl-table-column.js +123 -117
  327. package/dist/collection/components/swirl-table-row/swirl-table-row.js +53 -44
  328. package/dist/collection/components/swirl-table-row-group/swirl-table-row-group.js +36 -30
  329. package/dist/collection/components/swirl-tabs/swirl-tabs.js +112 -101
  330. package/dist/collection/components/swirl-tag/swirl-tag.js +111 -104
  331. package/dist/collection/components/swirl-text/swirl-text.js +197 -146
  332. package/dist/collection/components/swirl-text/swirl-text.stories.js +5 -0
  333. package/dist/collection/components/swirl-text-input/swirl-text-input.css +21 -0
  334. package/dist/collection/components/swirl-text-input/swirl-text-input.js +594 -557
  335. package/dist/collection/components/swirl-theme-provider/swirl-theme-provider.js +141 -122
  336. package/dist/collection/components/swirl-thumbnail/swirl-thumbnail.js +93 -85
  337. package/dist/collection/components/swirl-toast/swirl-toast.js +165 -155
  338. package/dist/collection/components/swirl-toast-provider/swirl-toast-provider.js +112 -104
  339. package/dist/collection/components/swirl-tooltip/swirl-tooltip.js +122 -113
  340. package/dist/collection/components/swirl-tree-navigation-item/swirl-tree-navigation-item.js +68 -61
  341. package/dist/collection/components/swirl-video-thumbnail/swirl-video-thumbnail.js +85 -83
  342. package/dist/collection/components/swirl-visually-hidden/swirl-visually-hidden.js +12 -9
  343. package/dist/collection/prototypes/file-manager/file-manager.js +12 -22
  344. package/dist/collection/utils.js +17 -0
  345. package/dist/components/balancetext.js +761 -0
  346. package/dist/components/file-manager.js +36 -29
  347. package/dist/components/index.d.ts +9 -172
  348. package/dist/components/index.js +1 -170
  349. package/dist/components/index2.js +35 -2
  350. package/dist/components/swirl-action-list-item.js +7 -3
  351. package/dist/components/swirl-action-list-section.js +1 -1
  352. package/dist/components/swirl-action-list.js +0 -1
  353. package/dist/components/swirl-app-layout2.js +20 -6
  354. package/dist/components/swirl-autocomplete.js +33 -16
  355. package/dist/components/swirl-avatar-group.js +1 -1
  356. package/dist/components/swirl-avatar.js +12 -7
  357. package/dist/components/swirl-badge.js +2 -1
  358. package/dist/components/swirl-banner.js +7 -6
  359. package/dist/components/swirl-box2.js +4 -1
  360. package/dist/components/swirl-button-group2.js +3 -1
  361. package/dist/components/swirl-button2.js +18 -5
  362. package/dist/components/swirl-card.js +4 -1
  363. package/dist/components/swirl-checkbox.js +10 -3
  364. package/dist/components/swirl-chip.js +5 -3
  365. package/dist/components/swirl-console-layout.js +12 -7
  366. package/dist/components/swirl-date-input.js +38 -16
  367. package/dist/components/swirl-date-picker2.js +26 -86
  368. package/dist/components/swirl-description-list-item.js +1 -1
  369. package/dist/components/swirl-description-list.js +0 -1
  370. package/dist/components/swirl-dialog.js +6 -3
  371. package/dist/components/swirl-empty-state2.js +2 -1
  372. package/dist/components/swirl-file-uploader.js +11 -5
  373. package/dist/components/swirl-file-viewer-audio2.js +3 -1
  374. package/dist/components/swirl-file-viewer-csv2.js +5 -2
  375. package/dist/components/swirl-file-viewer-image2.js +6 -5
  376. package/dist/components/swirl-file-viewer-pdf2.js +12 -9
  377. package/dist/components/swirl-file-viewer-text2.js +4 -1
  378. package/dist/components/swirl-file-viewer-video2.js +3 -1
  379. package/dist/components/swirl-file-viewer2.js +8 -5
  380. package/dist/components/swirl-form-control.js +24 -2
  381. package/dist/components/swirl-form-group.js +0 -1
  382. package/dist/components/swirl-heading2.js +20 -3
  383. package/dist/components/swirl-icon-add-photo.js +0 -1
  384. package/dist/components/swirl-icon-add2.js +0 -1
  385. package/dist/components/swirl-icon-admin-panel-settings.js +0 -1
  386. package/dist/components/swirl-icon-arrow-back.js +0 -1
  387. package/dist/components/swirl-icon-arrow-downward2.js +0 -1
  388. package/dist/components/swirl-icon-arrow-forward.js +0 -1
  389. package/dist/components/swirl-icon-arrow-left2.js +0 -1
  390. package/dist/components/swirl-icon-arrow-right-small.js +0 -1
  391. package/dist/components/swirl-icon-arrow-right2.js +0 -1
  392. package/dist/components/swirl-icon-arrow-upward2.js +0 -1
  393. package/dist/components/swirl-icon-attachment.js +0 -1
  394. package/dist/components/swirl-icon-block.js +0 -1
  395. package/dist/components/swirl-icon-cancel2.js +0 -1
  396. package/dist/components/swirl-icon-chat-bubble.js +0 -1
  397. package/dist/components/swirl-icon-chats-filled.js +0 -1
  398. package/dist/components/swirl-icon-chats-outlined.js +0 -1
  399. package/dist/components/swirl-icon-check-circle.js +0 -1
  400. package/dist/components/swirl-icon-check-small2.js +0 -1
  401. package/dist/components/swirl-icon-check-strong2.js +0 -1
  402. package/dist/components/swirl-icon-check.js +0 -1
  403. package/dist/components/swirl-icon-chevron-left.js +0 -1
  404. package/dist/components/swirl-icon-chevron-right.js +0 -1
  405. package/dist/components/swirl-icon-close-small.js +0 -1
  406. package/dist/components/swirl-icon-close2.js +0 -1
  407. package/dist/components/swirl-icon-cloud-upload2.js +0 -1
  408. package/dist/components/swirl-icon-column.js +0 -1
  409. package/dist/components/swirl-icon-comment.js +0 -1
  410. package/dist/components/swirl-icon-copy.js +0 -1
  411. package/dist/components/swirl-icon-date-range.js +0 -1
  412. package/dist/components/swirl-icon-delete.js +0 -1
  413. package/dist/components/swirl-icon-description.js +0 -1
  414. package/dist/components/swirl-icon-download2.js +0 -1
  415. package/dist/components/swirl-icon-drag-handle.d.ts +11 -0
  416. package/dist/components/swirl-icon-drag-handle.js +6 -0
  417. package/dist/components/swirl-icon-drag-handle2.js +36 -0
  418. package/dist/components/swirl-icon-edit.js +0 -1
  419. package/dist/components/swirl-icon-emoji-mood.js +0 -1
  420. package/dist/components/swirl-icon-emoji-satisfied.js +0 -1
  421. package/dist/components/swirl-icon-error2.js +0 -1
  422. package/dist/components/swirl-icon-expand-less2.js +0 -1
  423. package/dist/components/swirl-icon-expand-more2.js +0 -1
  424. package/dist/components/swirl-icon-file.js +0 -1
  425. package/dist/components/swirl-icon-filter.js +0 -1
  426. package/dist/components/swirl-icon-folder-shared.js +0 -1
  427. package/dist/components/swirl-icon-fullscreen-exit2.js +0 -1
  428. package/dist/components/swirl-icon-fullscreen2.js +0 -1
  429. package/dist/components/swirl-icon-group-assign.js +0 -1
  430. package/dist/components/swirl-icon-groups-custom.js +0 -1
  431. package/dist/components/swirl-icon-groups-filled.js +0 -1
  432. package/dist/components/swirl-icon-groups-outlined.js +0 -1
  433. package/dist/components/swirl-icon-groups.js +0 -1
  434. package/dist/components/swirl-icon-help.js +0 -1
  435. package/dist/components/swirl-icon-image.js +0 -1
  436. package/dist/components/swirl-icon-info.js +0 -1
  437. package/dist/components/swirl-icon-inventory.js +0 -1
  438. package/dist/components/swirl-icon-like.js +0 -1
  439. package/dist/components/swirl-icon-link.js +0 -1
  440. package/dist/components/swirl-icon-lock.js +0 -1
  441. package/dist/components/swirl-icon-logout.js +0 -1
  442. package/dist/components/swirl-icon-mail.js +0 -1
  443. package/dist/components/swirl-icon-manage-accounts.js +0 -1
  444. package/dist/components/swirl-icon-mention.js +0 -1
  445. package/dist/components/swirl-icon-menu-filled.js +0 -1
  446. package/dist/components/swirl-icon-menu-outlined.js +0 -1
  447. package/dist/components/swirl-icon-menu.js +0 -1
  448. package/dist/components/swirl-icon-message.js +0 -1
  449. package/dist/components/swirl-icon-more-horizontal.js +0 -1
  450. package/dist/components/swirl-icon-more-vertikal.js +0 -1
  451. package/dist/components/swirl-icon-news-filled.js +0 -1
  452. package/dist/components/swirl-icon-news-outlined.js +0 -1
  453. package/dist/components/swirl-icon-notifications-active.js +0 -1
  454. package/dist/components/swirl-icon-notifications-off.js +0 -1
  455. package/dist/components/swirl-icon-notifications.js +0 -1
  456. package/dist/components/swirl-icon-open-in-new.js +0 -1
  457. package/dist/components/swirl-icon-people-alt.js +0 -1
  458. package/dist/components/swirl-icon-person-off.js +0 -1
  459. package/dist/components/swirl-icon-person2.js +0 -1
  460. package/dist/components/swirl-icon-phone.js +0 -1
  461. package/dist/components/swirl-icon-poll.js +0 -1
  462. package/dist/components/swirl-icon-print.js +0 -1
  463. package/dist/components/swirl-icon-recieved.js +0 -1
  464. package/dist/components/swirl-icon-remove2.js +0 -1
  465. package/dist/components/swirl-icon-search-strong.js +0 -1
  466. package/dist/components/swirl-icon-search2.js +0 -1
  467. package/dist/components/swirl-icon-send.js +0 -1
  468. package/dist/components/swirl-icon-settings.js +0 -1
  469. package/dist/components/swirl-icon-sync.js +0 -1
  470. package/dist/components/swirl-icon-tasks-filled.js +0 -1
  471. package/dist/components/swirl-icon-tasks-outlined.js +0 -1
  472. package/dist/components/swirl-icon-time-filled.js +0 -1
  473. package/dist/components/swirl-icon-time-outlined.js +0 -1
  474. package/dist/components/swirl-icon-today2.js +0 -1
  475. package/dist/components/swirl-icon-user-assign.js +0 -1
  476. package/dist/components/swirl-icon-video-camera.js +0 -1
  477. package/dist/components/swirl-icon-visibility-off2.js +0 -1
  478. package/dist/components/swirl-icon-visibility2.js +0 -1
  479. package/dist/components/swirl-icon-warning.js +0 -1
  480. package/dist/components/swirl-inline-error2.js +2 -2
  481. package/dist/components/swirl-lightbox.js +8 -7
  482. package/dist/components/swirl-link.js +3 -1
  483. package/dist/components/swirl-list.js +0 -1
  484. package/dist/components/swirl-modal.js +8 -6
  485. package/dist/components/swirl-option-list-item2.js +39 -13
  486. package/dist/components/swirl-option-list-section.js +1 -1
  487. package/dist/components/swirl-option-list2.js +3184 -17
  488. package/dist/components/swirl-pagination.js +10 -8
  489. package/dist/components/swirl-pdf-reader.js +14 -11
  490. package/dist/components/swirl-popover2.js +11 -7
  491. package/dist/components/swirl-progress-indicator.js +1 -1
  492. package/dist/components/swirl-radio-group.js +2 -1
  493. package/dist/components/swirl-radio.js +8 -3
  494. package/dist/components/swirl-resource-list-file-item.js +7 -3
  495. package/dist/components/swirl-resource-list-item2.js +12 -3
  496. package/dist/components/swirl-resource-list2.js +1 -1
  497. package/dist/components/swirl-search.js +8 -3
  498. package/dist/components/swirl-select.js +28 -12
  499. package/dist/components/swirl-separator.js +0 -1
  500. package/dist/components/swirl-skeleton-box.d.ts +11 -0
  501. package/dist/components/swirl-skeleton-box.js +53 -0
  502. package/dist/components/swirl-skeleton-text.d.ts +11 -0
  503. package/dist/components/swirl-skeleton-text.js +43 -0
  504. package/dist/components/swirl-spinner2.js +1 -1
  505. package/dist/components/swirl-stack2.js +0 -1
  506. package/dist/components/swirl-switch.js +7 -4
  507. package/dist/components/swirl-tab.js +3 -1
  508. package/dist/components/swirl-table-cell.js +0 -1
  509. package/dist/components/swirl-table-column.js +5 -1
  510. package/dist/components/swirl-table-row-group.js +1 -1
  511. package/dist/components/swirl-table-row.js +2 -1
  512. package/dist/components/swirl-table.js +7 -2
  513. package/dist/components/swirl-tabs.js +3 -1
  514. package/dist/components/swirl-tag.js +4 -3
  515. package/dist/components/swirl-text-input2.js +33 -9
  516. package/dist/components/swirl-text2.js +21 -6
  517. package/dist/components/swirl-theme-provider.js +1 -1
  518. package/dist/components/swirl-thumbnail.js +2 -1
  519. package/dist/components/swirl-toast-provider.js +2 -2
  520. package/dist/components/swirl-toast2.js +7 -3
  521. package/dist/components/swirl-tooltip.js +5 -4
  522. package/dist/components/swirl-tree-navigation-item.js +3 -1
  523. package/dist/components/swirl-video-thumbnail.js +3 -1
  524. package/dist/components/swirl-visually-hidden2.js +0 -1
  525. package/dist/components/utils.js +18 -1
  526. package/dist/components/wc-datepicker.js +6 -0
  527. package/dist/components/wc-datepicker2.js +504 -0
  528. package/dist/{components/_commonjsHelpers.js → esm/_commonjsHelpers-10467d11.js} +1 -1
  529. package/dist/esm/balancetext-31f1ec68.js +761 -0
  530. package/dist/esm/file-manager.entry.js +3 -1
  531. package/dist/esm/{floating-ui.dom.esm-1a4e8b8a.js → floating-ui.dom.esm-b9f28f6d.js} +0 -0
  532. package/dist/esm/{index-5a3b2828.js → index-0ff2c8e0.js} +584 -275
  533. package/dist/esm/{index-c3028f7d.js → index-47862d62.js} +1 -1
  534. package/dist/esm/loader.js +4 -3
  535. package/dist/esm/polyfills/css-shim.js +1 -1
  536. package/dist/esm/swirl-action-list-item.entry.js +11 -6
  537. package/dist/esm/swirl-action-list-section.entry.js +2 -1
  538. package/dist/esm/swirl-action-list.entry.js +2 -2
  539. package/dist/esm/swirl-app-layout_5.entry.js +43 -11
  540. package/dist/esm/swirl-autocomplete.entry.js +24 -13
  541. package/dist/esm/swirl-avatar-group.entry.js +4 -3
  542. package/dist/esm/swirl-avatar.entry.js +15 -9
  543. package/dist/esm/swirl-badge.entry.js +5 -3
  544. package/dist/esm/swirl-banner.entry.js +11 -9
  545. package/dist/esm/swirl-button-group.entry.js +6 -3
  546. package/dist/esm/swirl-button.entry.js +22 -8
  547. package/dist/esm/swirl-card.entry.js +7 -3
  548. package/dist/esm/swirl-checkbox.entry.js +13 -5
  549. package/dist/esm/swirl-chip.entry.js +9 -6
  550. package/dist/esm/swirl-components.js +7 -3
  551. package/dist/esm/swirl-console-layout.entry.js +16 -10
  552. package/dist/esm/swirl-date-input.entry.js +24 -9
  553. package/dist/esm/swirl-date-picker_2.entry.js +20 -83
  554. package/dist/esm/swirl-description-list-item.entry.js +2 -1
  555. package/dist/esm/swirl-description-list.entry.js +1 -1
  556. package/dist/esm/swirl-dialog.entry.js +9 -5
  557. package/dist/esm/swirl-file-uploader.entry.js +14 -7
  558. package/dist/esm/swirl-file-viewer_7.entry.js +41 -17
  559. package/dist/esm/swirl-form-control.entry.js +26 -4
  560. package/dist/esm/swirl-form-group.entry.js +3 -3
  561. package/dist/esm/swirl-heading.entry.js +21 -4
  562. package/dist/esm/swirl-icon-add-photo.entry.js +3 -3
  563. package/dist/esm/swirl-icon-add_4.entry.js +3 -3
  564. package/dist/esm/swirl-icon-admin-panel-settings.entry.js +3 -3
  565. package/dist/esm/swirl-icon-arrow-back.entry.js +3 -3
  566. package/dist/esm/swirl-icon-arrow-downward_2.entry.js +3 -3
  567. package/dist/esm/swirl-icon-arrow-forward.entry.js +3 -3
  568. package/dist/esm/swirl-icon-arrow-left_3.entry.js +3 -3
  569. package/dist/esm/swirl-icon-arrow-right-small.entry.js +3 -3
  570. package/dist/esm/swirl-icon-attachment.entry.js +3 -3
  571. package/dist/esm/swirl-icon-block.entry.js +3 -3
  572. package/dist/esm/swirl-icon-cancel_4.entry.js +3 -3
  573. package/dist/esm/swirl-icon-chat-bubble.entry.js +3 -3
  574. package/dist/esm/swirl-icon-chats-filled.entry.js +3 -3
  575. package/dist/esm/swirl-icon-chats-outlined.entry.js +3 -3
  576. package/dist/esm/swirl-icon-check-circle.entry.js +3 -3
  577. package/dist/esm/swirl-icon-check-small_4.entry.js +3445 -0
  578. package/dist/esm/swirl-icon-check-strong.entry.js +3 -3
  579. package/dist/esm/swirl-icon-check.entry.js +3 -3
  580. package/dist/esm/swirl-icon-chevron-left.entry.js +3 -3
  581. package/dist/esm/swirl-icon-chevron-right.entry.js +3 -3
  582. package/dist/esm/swirl-icon-close-small.entry.js +3 -3
  583. package/dist/esm/swirl-icon-close.entry.js +3 -3
  584. package/dist/esm/swirl-icon-cloud-upload.entry.js +3 -3
  585. package/dist/esm/swirl-icon-column.entry.js +3 -3
  586. package/dist/esm/swirl-icon-comment.entry.js +3 -3
  587. package/dist/esm/swirl-icon-copy.entry.js +3 -3
  588. package/dist/esm/swirl-icon-date-range.entry.js +3 -3
  589. package/dist/esm/swirl-icon-delete.entry.js +3 -3
  590. package/dist/esm/swirl-icon-description.entry.js +3 -3
  591. package/dist/esm/swirl-icon-edit.entry.js +3 -3
  592. package/dist/esm/swirl-icon-emoji-mood.entry.js +3 -3
  593. package/dist/esm/swirl-icon-emoji-satisfied.entry.js +3 -3
  594. package/dist/esm/swirl-icon-error_3.entry.js +7 -5
  595. package/dist/esm/swirl-icon-expand-more.entry.js +3 -3
  596. package/dist/esm/swirl-icon-file.entry.js +3 -3
  597. package/dist/esm/swirl-icon-filter.entry.js +3 -3
  598. package/dist/esm/swirl-icon-folder-shared.entry.js +3 -3
  599. package/dist/esm/swirl-icon-group-assign.entry.js +3 -3
  600. package/dist/esm/swirl-icon-groups-custom.entry.js +3 -3
  601. package/dist/esm/swirl-icon-groups-filled.entry.js +3 -3
  602. package/dist/esm/swirl-icon-groups-outlined.entry.js +3 -3
  603. package/dist/esm/swirl-icon-groups.entry.js +3 -3
  604. package/dist/esm/swirl-icon-help.entry.js +3 -3
  605. package/dist/esm/swirl-icon-image.entry.js +3 -3
  606. package/dist/esm/swirl-icon-info.entry.js +3 -3
  607. package/dist/esm/swirl-icon-inventory.entry.js +3 -3
  608. package/dist/esm/swirl-icon-like.entry.js +3 -3
  609. package/dist/esm/swirl-icon-link.entry.js +3 -3
  610. package/dist/esm/swirl-icon-lock.entry.js +3 -3
  611. package/dist/esm/swirl-icon-logout.entry.js +3 -3
  612. package/dist/esm/swirl-icon-mail.entry.js +3 -3
  613. package/dist/esm/swirl-icon-manage-accounts.entry.js +3 -3
  614. package/dist/esm/swirl-icon-mention.entry.js +3 -3
  615. package/dist/esm/swirl-icon-menu-filled.entry.js +3 -3
  616. package/dist/esm/swirl-icon-menu-outlined.entry.js +3 -3
  617. package/dist/esm/swirl-icon-menu.entry.js +3 -3
  618. package/dist/esm/swirl-icon-message.entry.js +3 -3
  619. package/dist/esm/swirl-icon-more-horizontal.entry.js +3 -3
  620. package/dist/esm/swirl-icon-more-vertikal.entry.js +3 -3
  621. package/dist/esm/swirl-icon-news-filled.entry.js +3 -3
  622. package/dist/esm/swirl-icon-news-outlined.entry.js +3 -3
  623. package/dist/esm/swirl-icon-notifications-active.entry.js +3 -3
  624. package/dist/esm/swirl-icon-notifications-off.entry.js +3 -3
  625. package/dist/esm/swirl-icon-notifications.entry.js +3 -3
  626. package/dist/esm/swirl-icon-open-in-new.entry.js +3 -3
  627. package/dist/esm/swirl-icon-people-alt.entry.js +3 -3
  628. package/dist/esm/swirl-icon-person-off.entry.js +3 -3
  629. package/dist/esm/swirl-icon-person.entry.js +3 -3
  630. package/dist/esm/swirl-icon-phone.entry.js +3 -3
  631. package/dist/esm/swirl-icon-poll.entry.js +3 -3
  632. package/dist/esm/swirl-icon-print.entry.js +3 -3
  633. package/dist/esm/swirl-icon-recieved.entry.js +3 -3
  634. package/dist/esm/swirl-icon-search-strong.entry.js +3 -3
  635. package/dist/esm/swirl-icon-search.entry.js +3 -3
  636. package/dist/esm/swirl-icon-send.entry.js +3 -3
  637. package/dist/esm/swirl-icon-settings.entry.js +3 -3
  638. package/dist/esm/swirl-icon-sync.entry.js +3 -3
  639. package/dist/esm/swirl-icon-tasks-filled.entry.js +3 -3
  640. package/dist/esm/swirl-icon-tasks-outlined.entry.js +3 -3
  641. package/dist/esm/swirl-icon-time-filled.entry.js +3 -3
  642. package/dist/esm/swirl-icon-time-outlined.entry.js +3 -3
  643. package/dist/esm/swirl-icon-user-assign.entry.js +3 -3
  644. package/dist/esm/swirl-icon-video-camera.entry.js +3 -3
  645. package/dist/esm/swirl-icon-warning.entry.js +3 -3
  646. package/dist/esm/swirl-lightbox.entry.js +12 -10
  647. package/dist/esm/swirl-link.entry.js +4 -1
  648. package/dist/esm/swirl-list.entry.js +1 -1
  649. package/dist/esm/swirl-modal.entry.js +11 -8
  650. package/dist/esm/swirl-option-list-section.entry.js +2 -1
  651. package/dist/esm/swirl-pagination.entry.js +13 -10
  652. package/dist/esm/swirl-pdf-reader.entry.js +18 -14
  653. package/dist/esm/swirl-popover.entry.js +16 -11
  654. package/dist/esm/swirl-progress-indicator.entry.js +4 -3
  655. package/dist/esm/swirl-radio-group.entry.js +3 -1
  656. package/dist/esm/swirl-radio.entry.js +11 -5
  657. package/dist/esm/swirl-resource-list-file-item.entry.js +11 -6
  658. package/dist/esm/swirl-search.entry.js +12 -6
  659. package/dist/esm/swirl-select.entry.js +16 -6
  660. package/dist/esm/swirl-separator.entry.js +1 -1
  661. package/dist/esm/swirl-skeleton-box.entry.js +30 -0
  662. package/dist/esm/swirl-skeleton-text.entry.js +22 -0
  663. package/dist/esm/swirl-stack.entry.js +3 -3
  664. package/dist/esm/swirl-switch.entry.js +10 -6
  665. package/dist/esm/swirl-tab.entry.js +6 -3
  666. package/dist/esm/swirl-table-cell.entry.js +1 -1
  667. package/dist/esm/swirl-table-column.entry.js +6 -1
  668. package/dist/esm/swirl-table-row-group.entry.js +2 -1
  669. package/dist/esm/swirl-table-row.entry.js +5 -3
  670. package/dist/esm/swirl-table.entry.js +9 -3
  671. package/dist/esm/swirl-tabs.entry.js +6 -3
  672. package/dist/esm/swirl-tag.entry.js +7 -5
  673. package/dist/esm/swirl-text-input.entry.js +36 -12
  674. package/dist/esm/swirl-text.entry.js +21 -5
  675. package/dist/esm/swirl-theme-provider.entry.js +2 -1
  676. package/dist/esm/swirl-thumbnail.entry.js +5 -3
  677. package/dist/esm/swirl-toast-provider.entry.js +3 -2
  678. package/dist/esm/swirl-toast.entry.js +11 -6
  679. package/dist/esm/swirl-tooltip.entry.js +7 -5
  680. package/dist/esm/swirl-tree-navigation-item.entry.js +6 -3
  681. package/dist/esm/swirl-video-thumbnail.entry.js +4 -1
  682. package/dist/esm/swirl-visually-hidden.entry.js +1 -1
  683. package/dist/esm/{utils-7efaa1c6.js → utils-33d31b58.js} +18 -1
  684. package/dist/esm/wc-datepicker.entry.js +467 -0
  685. package/dist/swirl-components/{p-435c746a.entry.js → p-00978344.entry.js} +1 -1
  686. package/dist/swirl-components/{p-96ac53d5.entry.js → p-00ce0096.entry.js} +1 -1
  687. package/dist/swirl-components/{p-ffe7373d.entry.js → p-026a6c8f.entry.js} +1 -1
  688. package/dist/swirl-components/{p-6e4135eb.entry.js → p-027680e2.entry.js} +1 -1
  689. package/dist/swirl-components/{p-98827f45.entry.js → p-0319e9d6.entry.js} +1 -1
  690. package/dist/swirl-components/p-05c15d47.js +2 -0
  691. package/dist/swirl-components/{p-90559cbf.entry.js → p-090aa1c5.entry.js} +1 -1
  692. package/dist/swirl-components/p-0dcc2cbc.entry.js +1 -0
  693. package/dist/swirl-components/{p-cd8446b2.entry.js → p-0e59a667.entry.js} +1 -1
  694. package/dist/swirl-components/{p-4935dc49.entry.js → p-0f3b28e9.entry.js} +1 -1
  695. package/dist/swirl-components/p-107e3594.entry.js +1 -0
  696. package/dist/swirl-components/{p-0924336d.entry.js → p-121b8ab9.entry.js} +1 -1
  697. package/dist/swirl-components/{p-0dd24ec2.entry.js → p-12633c5e.entry.js} +1 -1
  698. package/dist/swirl-components/p-13376409.entry.js +1 -0
  699. package/dist/swirl-components/{p-e419a9cb.entry.js → p-142ceff7.entry.js} +1 -1
  700. package/dist/swirl-components/p-148b7b70.entry.js +1 -0
  701. package/dist/swirl-components/p-1614639e.entry.js +1 -0
  702. package/dist/swirl-components/{p-86bd3473.js → p-16e63a98.js} +1 -1
  703. package/dist/swirl-components/p-19caf328.entry.js +1 -0
  704. package/dist/swirl-components/p-1a6ca33d.entry.js +7 -0
  705. package/dist/swirl-components/p-1aa44f84.entry.js +1 -0
  706. package/dist/swirl-components/p-1b7876da.entry.js +1 -0
  707. package/dist/swirl-components/{p-c215db6a.entry.js → p-1c12a405.entry.js} +1 -1
  708. package/dist/swirl-components/p-1e7a0c4a.entry.js +1 -0
  709. package/dist/swirl-components/{p-692e4e5c.entry.js → p-2056c612.entry.js} +1 -1
  710. package/dist/swirl-components/p-2057f4dc.entry.js +1 -0
  711. package/dist/swirl-components/{p-a2a3e866.entry.js → p-217b2507.entry.js} +1 -1
  712. package/dist/swirl-components/p-21ff58e8.entry.js +1 -0
  713. package/dist/swirl-components/{p-b27dfc38.entry.js → p-27566da1.entry.js} +1 -1
  714. package/dist/swirl-components/{p-8cabe3e0.entry.js → p-2aede2ed.entry.js} +1 -1
  715. package/dist/swirl-components/{p-027eabd9.entry.js → p-2c78c2d5.entry.js} +1 -1
  716. package/dist/swirl-components/p-2c941975.entry.js +1 -0
  717. package/dist/swirl-components/p-2e733839.entry.js +1 -0
  718. package/dist/swirl-components/{p-5028921b.entry.js → p-2ea576e0.entry.js} +1 -1
  719. package/dist/swirl-components/{p-15b398b3.entry.js → p-2edc08f0.entry.js} +1 -1
  720. package/dist/swirl-components/p-33e4b66d.entry.js +8 -0
  721. package/dist/swirl-components/p-34e4e242.entry.js +1 -0
  722. package/dist/swirl-components/{p-f8b0f92a.entry.js → p-354e974d.entry.js} +1 -1
  723. package/dist/swirl-components/{p-ab7a08a6.entry.js → p-3a8af86e.entry.js} +1 -1
  724. package/dist/swirl-components/{p-9f45803b.entry.js → p-3e0f6d31.entry.js} +1 -1
  725. package/dist/swirl-components/{p-f09a3f4e.entry.js → p-429005ee.entry.js} +1 -1
  726. package/dist/swirl-components/p-4464e2c4.entry.js +1 -0
  727. package/dist/swirl-components/{p-e3293a79.entry.js → p-447ef6eb.entry.js} +1 -1
  728. package/dist/swirl-components/{p-409900a9.entry.js → p-44a74d62.entry.js} +1 -1
  729. package/dist/swirl-components/p-4a847ce0.entry.js +1 -0
  730. package/dist/swirl-components/p-4ef99de5.js +1 -0
  731. package/dist/swirl-components/p-50430bab.entry.js +1 -0
  732. package/dist/swirl-components/{p-70805149.entry.js → p-50ae0963.entry.js} +1 -1
  733. package/dist/swirl-components/{p-5d0acbf4.entry.js → p-5166e355.entry.js} +1 -1
  734. package/dist/swirl-components/{p-968adc69.entry.js → p-537b28c8.entry.js} +1 -1
  735. package/dist/swirl-components/{p-e8618da9.entry.js → p-541c943f.entry.js} +1 -1
  736. package/dist/swirl-components/{p-8f3d1f73.entry.js → p-5540b8cf.entry.js} +1 -1
  737. package/dist/swirl-components/p-56499a10.entry.js +1 -0
  738. package/dist/swirl-components/{p-4307ddfe.entry.js → p-58f83fcc.entry.js} +1 -1
  739. package/dist/swirl-components/p-619061ef.entry.js +1 -0
  740. package/dist/swirl-components/{p-294983c3.entry.js → p-61ad8c1a.entry.js} +1 -1
  741. package/dist/swirl-components/p-61b7f41b.entry.js +1 -0
  742. package/dist/swirl-components/{p-17e7ea80.entry.js → p-62f0b76b.entry.js} +1 -1
  743. package/dist/swirl-components/{p-5f461f84.entry.js → p-64cdef0c.entry.js} +1 -1
  744. package/dist/swirl-components/p-6526bf3e.js +1 -0
  745. package/dist/swirl-components/{p-6c620f94.entry.js → p-668539d3.entry.js} +1 -1
  746. package/dist/swirl-components/p-67e86a11.entry.js +1 -0
  747. package/dist/swirl-components/{p-e7c325b7.entry.js → p-730760c1.entry.js} +1 -1
  748. package/dist/swirl-components/{p-1bff5707.entry.js → p-79486690.entry.js} +1 -1
  749. package/dist/swirl-components/{p-474f4c76.entry.js → p-7a6f1bf2.entry.js} +1 -1
  750. package/dist/swirl-components/p-7b0adf16.js +7 -0
  751. package/dist/swirl-components/{p-582364ee.entry.js → p-7c32e01c.entry.js} +1 -1
  752. package/dist/swirl-components/{p-d69a0a99.entry.js → p-7cad01ab.entry.js} +1 -1
  753. package/dist/swirl-components/{p-8d998974.entry.js → p-7de7d7c4.entry.js} +1 -1
  754. package/dist/swirl-components/p-7f5648ca.entry.js +1 -0
  755. package/dist/swirl-components/{p-eac6d46d.entry.js → p-80c7ab11.entry.js} +1 -1
  756. package/dist/swirl-components/{p-2bcb979a.entry.js → p-81b80dd4.entry.js} +1 -1
  757. package/dist/swirl-components/p-8317b681.entry.js +1 -0
  758. package/dist/swirl-components/{p-c6b1fe02.entry.js → p-8342ee34.entry.js} +1 -1
  759. package/dist/swirl-components/{p-1391e221.entry.js → p-8667eb55.entry.js} +1 -1
  760. package/dist/swirl-components/p-87ce453b.entry.js +49 -0
  761. package/dist/swirl-components/{p-0a5d1a8f.entry.js → p-87d2ee0e.entry.js} +1 -1
  762. package/dist/swirl-components/p-8ea0a318.entry.js +1 -0
  763. package/dist/swirl-components/{p-3335383c.entry.js → p-8effa03e.entry.js} +1 -1
  764. package/dist/swirl-components/{p-d9760e10.entry.js → p-8f07da3d.entry.js} +1 -1
  765. package/dist/swirl-components/{p-2fa4c633.entry.js → p-8f52577a.entry.js} +1 -1
  766. package/dist/swirl-components/{p-170a2b48.entry.js → p-8fd083ba.entry.js} +1 -1
  767. package/dist/swirl-components/p-905e3f32.entry.js +1 -0
  768. package/dist/swirl-components/p-9142e03b.js +1 -0
  769. package/dist/swirl-components/p-92b0a462.entry.js +1 -0
  770. package/dist/swirl-components/p-94cefacc.entry.js +1 -0
  771. package/dist/swirl-components/{p-c9307120.entry.js → p-99ba3b0c.entry.js} +1 -1
  772. package/dist/swirl-components/{p-c63c0897.entry.js → p-9d8e7ff0.entry.js} +1 -1
  773. package/dist/swirl-components/{p-d2311589.entry.js → p-9d94f15b.entry.js} +1 -1
  774. package/dist/swirl-components/p-9dce0e50.entry.js +1 -0
  775. package/dist/swirl-components/p-9f24f03d.entry.js +1 -0
  776. package/dist/swirl-components/{p-67626481.entry.js → p-a0c73040.entry.js} +1 -1
  777. package/dist/swirl-components/p-a0e0322a.entry.js +1 -0
  778. package/dist/swirl-components/p-a6c15dd2.entry.js +1 -0
  779. package/dist/swirl-components/{p-99244721.entry.js → p-a8fde9b6.entry.js} +1 -1
  780. package/dist/swirl-components/{p-d730ab29.entry.js → p-aba143bd.entry.js} +1 -1
  781. package/dist/swirl-components/p-ada769a2.entry.js +1 -0
  782. package/dist/swirl-components/{p-3991c596.entry.js → p-aebd2770.entry.js} +1 -1
  783. package/dist/swirl-components/{p-8ee094ca.entry.js → p-b40d02ab.entry.js} +1 -1
  784. package/dist/swirl-components/{p-91039432.entry.js → p-b5886f1e.entry.js} +1 -1
  785. package/dist/swirl-components/{p-49abf88c.entry.js → p-b5bff846.entry.js} +1 -1
  786. package/dist/swirl-components/{p-4e08d391.entry.js → p-b73f46e9.entry.js} +1 -1
  787. package/dist/swirl-components/{p-898341d1.entry.js → p-bb664758.entry.js} +1 -1
  788. package/dist/swirl-components/{p-32c2d812.entry.js → p-bbc4dfae.entry.js} +1 -1
  789. package/dist/swirl-components/p-bc1985c0.entry.js +1 -0
  790. package/dist/swirl-components/p-c0036f1f.entry.js +1 -0
  791. package/dist/swirl-components/p-c00ec508.entry.js +1 -0
  792. package/dist/swirl-components/{p-297800ad.entry.js → p-c089a86f.entry.js} +1 -1
  793. package/dist/swirl-components/p-c1119f03.entry.js +1 -0
  794. package/dist/swirl-components/{p-38d22e69.entry.js → p-c1407ccd.entry.js} +1 -1
  795. package/dist/swirl-components/{p-d16f5f72.entry.js → p-c1afbdd8.entry.js} +1 -1
  796. package/dist/swirl-components/p-c1d740a2.entry.js +1 -0
  797. package/dist/swirl-components/p-c3a1b027.entry.js +1 -0
  798. package/dist/swirl-components/p-c3badef7.entry.js +1 -0
  799. package/dist/swirl-components/{p-d78eb6d8.entry.js → p-c4f0b6bd.entry.js} +1 -1
  800. package/dist/swirl-components/p-c6902302.entry.js +1 -0
  801. package/dist/swirl-components/p-c7326b88.entry.js +1 -0
  802. package/dist/swirl-components/p-c783221d.entry.js +1 -0
  803. package/dist/swirl-components/{p-5af19090.entry.js → p-c81bd519.entry.js} +1 -1
  804. package/dist/swirl-components/{p-33e363ed.entry.js → p-cb7bca01.entry.js} +1 -1
  805. package/dist/swirl-components/p-cddec2c8.entry.js +1 -0
  806. package/dist/swirl-components/p-cef24ae4.entry.js +1 -0
  807. package/dist/swirl-components/{p-7a1181b5.entry.js → p-d02acd75.entry.js} +1 -1
  808. package/dist/swirl-components/p-d20dbf47.entry.js +1 -0
  809. package/dist/swirl-components/{p-20ac0472.entry.js → p-d3243268.entry.js} +1 -1
  810. package/dist/swirl-components/p-d51a5f4f.entry.js +1 -0
  811. package/dist/swirl-components/{p-941e7960.entry.js → p-d5b02a31.entry.js} +1 -1
  812. package/dist/swirl-components/{p-3310a6e2.entry.js → p-d82fce3d.entry.js} +1 -1
  813. package/dist/swirl-components/{p-634e09ad.entry.js → p-d8c4dfb3.entry.js} +1 -1
  814. package/dist/swirl-components/{p-2aaeb1e6.entry.js → p-ddb3b371.entry.js} +1 -1
  815. package/dist/swirl-components/p-ddd49304.entry.js +1 -0
  816. package/dist/swirl-components/{p-043d093e.entry.js → p-e0193bd5.entry.js} +1 -1
  817. package/dist/swirl-components/p-e1abf6d5.entry.js +1 -0
  818. package/dist/swirl-components/{p-5e45f6dc.entry.js → p-e407f7c4.entry.js} +1 -1
  819. package/dist/swirl-components/{p-acd8fa1d.entry.js → p-e4177f2f.entry.js} +1 -1
  820. package/dist/swirl-components/p-e60c8c01.entry.js +1 -0
  821. package/dist/swirl-components/p-e89d3b8c.entry.js +1 -0
  822. package/dist/swirl-components/p-e8bebe03.entry.js +1 -0
  823. package/dist/swirl-components/p-e8f693b7.entry.js +1 -0
  824. package/dist/swirl-components/{p-ed56aa85.entry.js → p-ec21cd3f.entry.js} +1 -1
  825. package/dist/swirl-components/{p-1339648a.entry.js → p-ec750d72.entry.js} +1 -1
  826. package/dist/swirl-components/{p-4268041a.entry.js → p-ed5bdc5c.entry.js} +1 -1
  827. package/dist/swirl-components/{p-4d7dcfee.entry.js → p-eed748e6.entry.js} +1 -1
  828. package/dist/swirl-components/{p-0d66f638.entry.js → p-ef58fc1e.entry.js} +1 -1
  829. package/dist/swirl-components/{p-d15994cb.entry.js → p-f4b96d3b.entry.js} +1 -1
  830. package/dist/swirl-components/{p-92709d5b.entry.js → p-f573b3f3.entry.js} +1 -1
  831. package/dist/swirl-components/p-f5c1afb6.entry.js +1 -0
  832. package/dist/swirl-components/{p-38d67d0e.entry.js → p-f828f836.entry.js} +1 -1
  833. package/dist/swirl-components/{p-88abc2db.entry.js → p-fa67dbce.entry.js} +1 -1
  834. package/dist/swirl-components/p-fbd4380b.entry.js +1 -0
  835. package/dist/swirl-components/{p-dbd1b662.entry.js → p-fc65574b.entry.js} +1 -1
  836. package/dist/swirl-components/{p-6043df71.entry.js → p-fe82f579.entry.js} +1 -1
  837. package/dist/swirl-components/{p-ebc078da.entry.js → p-feda757e.entry.js} +1 -1
  838. package/dist/swirl-components/p-ff161795.entry.js +1 -0
  839. package/dist/swirl-components/swirl-components.css +11 -1
  840. package/dist/swirl-components/swirl-components.esm.js +1 -1
  841. package/dist/types/components/swirl-action-list-item/swirl-action-list-item.d.ts +2 -2
  842. package/dist/types/components/swirl-app-layout/swirl-app-layout.d.ts +2 -2
  843. package/dist/types/components/swirl-autocomplete/swirl-autocomplete.d.ts +3 -2
  844. package/dist/types/components/swirl-avatar/swirl-avatar.d.ts +4 -4
  845. package/dist/types/components/swirl-badge/swirl-badge.d.ts +3 -3
  846. package/dist/types/components/swirl-banner/swirl-banner.d.ts +2 -2
  847. package/dist/types/components/swirl-box/swirl-box.d.ts +2 -2
  848. package/dist/types/components/swirl-button/swirl-button.d.ts +5 -5
  849. package/dist/types/components/swirl-button-group/swirl-button-group.d.ts +1 -1
  850. package/dist/types/components/swirl-checkbox/swirl-checkbox.d.ts +1 -1
  851. package/dist/types/components/swirl-chip/swirl-chip.d.ts +1 -1
  852. package/dist/types/components/swirl-date-input/swirl-date-input.d.ts +6 -3
  853. package/dist/types/components/swirl-date-picker/swirl-date-picker.d.ts +6 -10
  854. package/dist/types/components/swirl-date-picker/swirl-date-picker.stories.d.ts +0 -7
  855. package/dist/types/components/swirl-dialog/swirl-dialog.d.ts +1 -1
  856. package/dist/types/components/swirl-file-viewer/viewers/swirl-file-viewer-pdf/swirl-file-viewer-pdf.d.ts +1 -1
  857. package/dist/types/components/swirl-form-control/swirl-form-control.d.ts +2 -0
  858. package/dist/types/components/swirl-form-group/swirl-form-group.d.ts +1 -1
  859. package/dist/types/components/swirl-heading/swirl-heading.d.ts +8 -3
  860. package/dist/types/components/swirl-heading/swirl-heading.stories.d.ts +5 -0
  861. package/dist/types/components/swirl-icon/icons/swirl-icon-drag-handle.d.ts +5 -0
  862. package/dist/types/components/swirl-icon/swirl-icon.types.d.ts +1 -1
  863. package/dist/types/components/swirl-inline-error/swirl-inline-error.d.ts +1 -1
  864. package/dist/types/components/swirl-link/swirl-link.d.ts +1 -1
  865. package/dist/types/components/swirl-option-list/swirl-option-list.d.ts +21 -0
  866. package/dist/types/components/swirl-option-list-item/swirl-option-list-item.d.ts +9 -1
  867. package/dist/types/components/swirl-option-list-item/swirl-option-list-item.stories.d.ts +8 -0
  868. package/dist/types/components/swirl-pagination/swirl-pagination.d.ts +1 -1
  869. package/dist/types/components/swirl-popover/swirl-popover.d.ts +1 -1
  870. package/dist/types/components/swirl-progress-indicator/swirl-progress-indicator.d.ts +2 -2
  871. package/dist/types/components/swirl-radio/swirl-radio.d.ts +1 -1
  872. package/dist/types/components/swirl-select/swirl-select.d.ts +2 -1
  873. package/dist/types/components/swirl-skeleton-box/swirl-skeleton-box.d.ts +9 -0
  874. package/dist/types/components/swirl-skeleton-box/swirl-skeleton-box.stories.d.ts +13 -0
  875. package/dist/types/components/swirl-skeleton-text/swirl-skeleton-text.d.ts +7 -0
  876. package/dist/types/components/swirl-skeleton-text/swirl-skeleton-text.stories.d.ts +13 -0
  877. package/dist/types/components/swirl-spinner/swirl-spinner.d.ts +1 -1
  878. package/dist/types/components/swirl-stack/swirl-stack.d.ts +4 -4
  879. package/dist/types/components/swirl-switch/swirl-switch.d.ts +1 -1
  880. package/dist/types/components/swirl-table-column/swirl-table-column.d.ts +1 -1
  881. package/dist/types/components/swirl-tag/swirl-tag.d.ts +1 -1
  882. package/dist/types/components/swirl-text/swirl-text.d.ts +11 -5
  883. package/dist/types/components/swirl-text/swirl-text.stories.d.ts +5 -0
  884. package/dist/types/components/swirl-text-input/swirl-text-input.d.ts +3 -2
  885. package/dist/types/components/swirl-theme-provider/swirl-theme-provider.d.ts +5 -5
  886. package/dist/types/components/swirl-thumbnail/swirl-thumbnail.d.ts +2 -2
  887. package/dist/types/components/swirl-toast/swirl-toast.d.ts +1 -1
  888. package/dist/types/components/swirl-toast-provider/swirl-toast-provider.d.ts +2 -2
  889. package/dist/types/components/swirl-tooltip/swirl-tooltip.d.ts +1 -1
  890. package/dist/types/components.d.ts +151 -13
  891. package/dist/types/index.d.ts +2 -0
  892. package/dist/types/prototypes/file-manager/file-manager.d.ts +2 -2
  893. package/dist/types/stencil-public-runtime.d.ts +91 -19
  894. package/dist/types/utils.d.ts +1 -0
  895. package/dist/typings.d.ts +1 -0
  896. package/loader/index.d.ts +9 -0
  897. package/loader/package.json +1 -0
  898. package/package.json +27 -15
  899. package/vscode-data.json +166 -0
  900. package/dist/cjs/swirl-icon-check-small_3.cjs.entry.js +0 -261
  901. package/dist/esm/_commonjsHelpers-44457d8d.js +0 -36
  902. package/dist/esm/swirl-icon-check-small_3.entry.js +0 -255
  903. package/dist/swirl-components/p-0206d806.entry.js +0 -1
  904. package/dist/swirl-components/p-06e76536.entry.js +0 -1
  905. package/dist/swirl-components/p-0cb291d0.entry.js +0 -1
  906. package/dist/swirl-components/p-0dcba8b2.entry.js +0 -1
  907. package/dist/swirl-components/p-0ed40682.entry.js +0 -1
  908. package/dist/swirl-components/p-1133d7f4.entry.js +0 -1
  909. package/dist/swirl-components/p-1253d22b.entry.js +0 -1
  910. package/dist/swirl-components/p-13295f24.entry.js +0 -1
  911. package/dist/swirl-components/p-21267175.entry.js +0 -1
  912. package/dist/swirl-components/p-29e918f4.entry.js +0 -36
  913. package/dist/swirl-components/p-2a9cacb2.entry.js +0 -1
  914. package/dist/swirl-components/p-30740007.entry.js +0 -1
  915. package/dist/swirl-components/p-31943bc0.entry.js +0 -1
  916. package/dist/swirl-components/p-31f9bc42.entry.js +0 -1
  917. package/dist/swirl-components/p-36573727.entry.js +0 -1
  918. package/dist/swirl-components/p-4181aa7a.entry.js +0 -1
  919. package/dist/swirl-components/p-4a16e7e1.entry.js +0 -1
  920. package/dist/swirl-components/p-4af06a9d.entry.js +0 -1
  921. package/dist/swirl-components/p-4f04a176.entry.js +0 -1
  922. package/dist/swirl-components/p-51097641.entry.js +0 -1
  923. package/dist/swirl-components/p-5612f03c.entry.js +0 -1
  924. package/dist/swirl-components/p-59bfb6f7.entry.js +0 -1
  925. package/dist/swirl-components/p-6272f11a.entry.js +0 -1
  926. package/dist/swirl-components/p-659b4fcb.entry.js +0 -1
  927. package/dist/swirl-components/p-6baff764.entry.js +0 -1
  928. package/dist/swirl-components/p-6f039422.entry.js +0 -1
  929. package/dist/swirl-components/p-708ea5cf.entry.js +0 -1
  930. package/dist/swirl-components/p-733abfbd.entry.js +0 -1
  931. package/dist/swirl-components/p-745ae10f.entry.js +0 -1
  932. package/dist/swirl-components/p-7602ab40.entry.js +0 -1
  933. package/dist/swirl-components/p-76e4350f.entry.js +0 -1
  934. package/dist/swirl-components/p-7a00efe8.entry.js +0 -1
  935. package/dist/swirl-components/p-7c514ca1.entry.js +0 -1
  936. package/dist/swirl-components/p-7f642be8.entry.js +0 -1
  937. package/dist/swirl-components/p-8157c96f.entry.js +0 -1
  938. package/dist/swirl-components/p-96ee66e7.entry.js +0 -1
  939. package/dist/swirl-components/p-9a74850d.entry.js +0 -1
  940. package/dist/swirl-components/p-9fe00e8a.js +0 -2
  941. package/dist/swirl-components/p-a0a3e5d3.entry.js +0 -1
  942. package/dist/swirl-components/p-a333b07d.entry.js +0 -1
  943. package/dist/swirl-components/p-a5497705.entry.js +0 -1
  944. package/dist/swirl-components/p-a61783f1.entry.js +0 -1
  945. package/dist/swirl-components/p-a76e4ffc.entry.js +0 -1
  946. package/dist/swirl-components/p-bd4b3edf.entry.js +0 -1
  947. package/dist/swirl-components/p-c0402092.entry.js +0 -1
  948. package/dist/swirl-components/p-c45a50a2.entry.js +0 -1
  949. package/dist/swirl-components/p-cbd8f173.entry.js +0 -1
  950. package/dist/swirl-components/p-d09dc70d.entry.js +0 -7
  951. package/dist/swirl-components/p-d3d722dc.js +0 -7
  952. package/dist/swirl-components/p-d46f437e.entry.js +0 -1
  953. package/dist/swirl-components/p-d97d183f.js +0 -1
  954. package/dist/swirl-components/p-e0aca739.entry.js +0 -1
  955. package/dist/swirl-components/p-e8bb09e8.js +0 -1
  956. package/dist/swirl-components/p-ea5e12d7.entry.js +0 -1
  957. package/dist/swirl-components/p-f06a85d3.entry.js +0 -1
  958. package/dist/swirl-components/p-f17a9780.entry.js +0 -1
  959. package/dist/swirl-components/p-f2763bd6.entry.js +0 -1
  960. package/dist/swirl-components/p-fa9e7b73.entry.js +0 -1
  961. package/dist/swirl-components/p-fb50f7b6.entry.js +0 -1
@@ -0,0 +1,3445 @@
1
+ import { r as registerInstance, h, F as Fragment, c as createEvent, H as Host, g as getElement } from './index-0ff2c8e0.js';
2
+ import { c as classnames } from './index-47862d62.js';
3
+ import { c as closestPassShadow, q as querySelectorAllDeep, g as getDesktopMediaQuery } from './utils-33d31b58.js';
4
+ import './_commonjsHelpers-10467d11.js';
5
+
6
+ const swirlIconCss$1 = ":host{display:inline-flex}";
7
+
8
+ const SwirlIconCheckSmall = class {
9
+ constructor(hostRef) {
10
+ registerInstance(this, hostRef);
11
+ this.size = 24;
12
+ }
13
+ render() {
14
+ const viewBoxSize = this.size === 20 ? 24 : this.size;
15
+ const className = classnames("swirl-icon", `swirl-icon--size-${this.size}`);
16
+ return (h("svg", { class: className, fill: "none", height: this.size, part: "icon", viewBox: `0 0 ${viewBoxSize} ${viewBoxSize}`, width: this.size, xmlns: "http://www.w3.org/2000/svg" }, this.size === 16 && (h(Fragment, null, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M12.4142 4.91924C12.8047 5.30976 12.8047 5.94293 12.4142 6.33345L7.08086 11.6667C6.69033 12.0572 6.05717 12.0572 5.66664 11.6667L3.70711 9.70707C3.31658 9.31655 3.31658 8.68338 3.70711 8.29286C4.09763 7.90233 4.7308 7.90233 5.12132 8.29286L6.37375 9.54539L11 4.91924C11.3905 4.52871 12.0237 4.52871 12.4142 4.91924Z", fill: "currentColor" }))), (this.size === 20 || this.size === 24) && (h(Fragment, null, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M18.6213 7.37879C19.2071 7.96458 19.2071 8.91433 18.6213 9.50011L10.6213 17.5C10.0355 18.0858 9.08577 18.0858 8.49998 17.5L5.56068 14.5605C4.97489 13.9748 4.97489 13.025 5.56068 12.4392C6.14646 11.8534 7.09621 11.8534 7.682 12.4392L9.56064 14.318L16.5 7.37879C17.0858 6.79301 18.0355 6.79301 18.6213 7.37879Z", fill: "currentColor" }))), this.size === 28 && (h(Fragment, null, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M21.7248 8.60863C22.4083 9.29205 22.4083 10.4001 21.7248 11.0835L12.3915 20.4167C11.7081 21.1001 10.6001 21.1001 9.91663 20.4167L6.48744 16.9873C5.80403 16.3039 5.80403 15.1959 6.48744 14.5125C7.17086 13.8291 8.2789 13.8291 8.96232 14.5125L11.1541 16.7044L19.25 8.60863C19.9334 7.92521 21.0414 7.92521 21.7248 8.60863Z", fill: "currentColor" })))));
17
+ }
18
+ };
19
+ SwirlIconCheckSmall.style = swirlIconCss$1;
20
+
21
+ const swirlIconCss = ":host{display:inline-flex}";
22
+
23
+ const SwirlIconDragHandle = class {
24
+ constructor(hostRef) {
25
+ registerInstance(this, hostRef);
26
+ this.size = 24;
27
+ }
28
+ render() {
29
+ const viewBoxSize = this.size === 20 ? 24 : this.size;
30
+ const className = classnames("swirl-icon", `swirl-icon--size-${this.size}`);
31
+ return (h("svg", { class: className, fill: "none", height: this.size, part: "icon", viewBox: `0 0 ${viewBoxSize} ${viewBoxSize}`, width: this.size, xmlns: "http://www.w3.org/2000/svg" }, this.size === 16 && (h(Fragment, null, h("rect", { x: "9", y: "3", width: "2", height: "2", rx: "1", fill: "currentColor" }), h("rect", { x: "9", y: "7", width: "2", height: "2", rx: "1", fill: "currentColor" }), h("rect", { x: "9", y: "11", width: "2", height: "2", rx: "1", fill: "currentColor" }), h("rect", { x: "5", y: "3", width: "2", height: "2", rx: "1", fill: "currentColor" }), h("rect", { x: "5", y: "7", width: "2", height: "2", rx: "1", fill: "currentColor" }), h("rect", { x: "5", y: "11", width: "2", height: "2", rx: "1", fill: "currentColor" }))), (this.size === 20 || this.size === 24) && (h(Fragment, null, h("rect", { x: "13.5", y: "4.5", width: "3", height: "3", rx: "1.5", fill: "currentColor" }), h("rect", { x: "13.5", y: "10.5", width: "3", height: "3", rx: "1.5", fill: "currentColor" }), h("rect", { x: "13.5", y: "16.5", width: "3", height: "3", rx: "1.5", fill: "currentColor" }), h("rect", { x: "7.5", y: "4.5", width: "3", height: "3", rx: "1.5", fill: "currentColor" }), h("rect", { x: "7.5", y: "10.5", width: "3", height: "3", rx: "1.5", fill: "currentColor" }), h("rect", { x: "7.5", y: "16.5", width: "3", height: "3", rx: "1.5", fill: "currentColor" }))), this.size === 28 && (h(Fragment, null, h("rect", { x: "15.75", y: "5.25", width: "3.5", height: "3.5", rx: "1.75", fill: "currentColor" }), h("rect", { x: "15.75", y: "12.25", width: "3.5", height: "3.5", rx: "1.75", fill: "currentColor" }), h("rect", { x: "15.75", y: "19.25", width: "3.5", height: "3.5", rx: "1.75", fill: "currentColor" }), h("rect", { x: "8.75", y: "5.25", width: "3.5", height: "3.5", rx: "1.75", fill: "currentColor" }), h("rect", { x: "8.75", y: "12.25", width: "3.5", height: "3.5", rx: "1.75", fill: "currentColor" }), h("rect", { x: "8.75", y: "19.25", width: "3.5", height: "3.5", rx: "1.75", fill: "currentColor" })))));
32
+ }
33
+ };
34
+ SwirlIconDragHandle.style = swirlIconCss;
35
+
36
+ /**!
37
+ * Sortable 1.15.0
38
+ * @author RubaXa <trash@rubaxa.org>
39
+ * @author owenm <owen23355@gmail.com>
40
+ * @license MIT
41
+ */
42
+ function ownKeys(object, enumerableOnly) {
43
+ var keys = Object.keys(object);
44
+
45
+ if (Object.getOwnPropertySymbols) {
46
+ var symbols = Object.getOwnPropertySymbols(object);
47
+
48
+ if (enumerableOnly) {
49
+ symbols = symbols.filter(function (sym) {
50
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
51
+ });
52
+ }
53
+
54
+ keys.push.apply(keys, symbols);
55
+ }
56
+
57
+ return keys;
58
+ }
59
+
60
+ function _objectSpread2(target) {
61
+ for (var i = 1; i < arguments.length; i++) {
62
+ var source = arguments[i] != null ? arguments[i] : {};
63
+
64
+ if (i % 2) {
65
+ ownKeys(Object(source), true).forEach(function (key) {
66
+ _defineProperty(target, key, source[key]);
67
+ });
68
+ } else if (Object.getOwnPropertyDescriptors) {
69
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
70
+ } else {
71
+ ownKeys(Object(source)).forEach(function (key) {
72
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
73
+ });
74
+ }
75
+ }
76
+
77
+ return target;
78
+ }
79
+
80
+ function _typeof(obj) {
81
+ "@babel/helpers - typeof";
82
+
83
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
84
+ _typeof = function (obj) {
85
+ return typeof obj;
86
+ };
87
+ } else {
88
+ _typeof = function (obj) {
89
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
90
+ };
91
+ }
92
+
93
+ return _typeof(obj);
94
+ }
95
+
96
+ function _defineProperty(obj, key, value) {
97
+ if (key in obj) {
98
+ Object.defineProperty(obj, key, {
99
+ value: value,
100
+ enumerable: true,
101
+ configurable: true,
102
+ writable: true
103
+ });
104
+ } else {
105
+ obj[key] = value;
106
+ }
107
+
108
+ return obj;
109
+ }
110
+
111
+ function _extends() {
112
+ _extends = Object.assign || function (target) {
113
+ for (var i = 1; i < arguments.length; i++) {
114
+ var source = arguments[i];
115
+
116
+ for (var key in source) {
117
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
118
+ target[key] = source[key];
119
+ }
120
+ }
121
+ }
122
+
123
+ return target;
124
+ };
125
+
126
+ return _extends.apply(this, arguments);
127
+ }
128
+
129
+ function _objectWithoutPropertiesLoose(source, excluded) {
130
+ if (source == null) return {};
131
+ var target = {};
132
+ var sourceKeys = Object.keys(source);
133
+ var key, i;
134
+
135
+ for (i = 0; i < sourceKeys.length; i++) {
136
+ key = sourceKeys[i];
137
+ if (excluded.indexOf(key) >= 0) continue;
138
+ target[key] = source[key];
139
+ }
140
+
141
+ return target;
142
+ }
143
+
144
+ function _objectWithoutProperties(source, excluded) {
145
+ if (source == null) return {};
146
+
147
+ var target = _objectWithoutPropertiesLoose(source, excluded);
148
+
149
+ var key, i;
150
+
151
+ if (Object.getOwnPropertySymbols) {
152
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
153
+
154
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
155
+ key = sourceSymbolKeys[i];
156
+ if (excluded.indexOf(key) >= 0) continue;
157
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
158
+ target[key] = source[key];
159
+ }
160
+ }
161
+
162
+ return target;
163
+ }
164
+
165
+ var version = "1.15.0";
166
+
167
+ function userAgent(pattern) {
168
+ if (typeof window !== 'undefined' && window.navigator) {
169
+ return !! /*@__PURE__*/navigator.userAgent.match(pattern);
170
+ }
171
+ }
172
+
173
+ var IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i);
174
+ var Edge = userAgent(/Edge/i);
175
+ var FireFox = userAgent(/firefox/i);
176
+ var Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);
177
+ var IOS = userAgent(/iP(ad|od|hone)/i);
178
+ var ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);
179
+
180
+ var captureMode = {
181
+ capture: false,
182
+ passive: false
183
+ };
184
+
185
+ function on(el, event, fn) {
186
+ el.addEventListener(event, fn, !IE11OrLess && captureMode);
187
+ }
188
+
189
+ function off(el, event, fn) {
190
+ el.removeEventListener(event, fn, !IE11OrLess && captureMode);
191
+ }
192
+
193
+ function matches(
194
+ /**HTMLElement*/
195
+ el,
196
+ /**String*/
197
+ selector) {
198
+ if (!selector) return;
199
+ selector[0] === '>' && (selector = selector.substring(1));
200
+
201
+ if (el) {
202
+ try {
203
+ if (el.matches) {
204
+ return el.matches(selector);
205
+ } else if (el.msMatchesSelector) {
206
+ return el.msMatchesSelector(selector);
207
+ } else if (el.webkitMatchesSelector) {
208
+ return el.webkitMatchesSelector(selector);
209
+ }
210
+ } catch (_) {
211
+ return false;
212
+ }
213
+ }
214
+
215
+ return false;
216
+ }
217
+
218
+ function getParentOrHost(el) {
219
+ return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;
220
+ }
221
+
222
+ function closest(
223
+ /**HTMLElement*/
224
+ el,
225
+ /**String*/
226
+ selector,
227
+ /**HTMLElement*/
228
+ ctx, includeCTX) {
229
+ if (el) {
230
+ ctx = ctx || document;
231
+
232
+ do {
233
+ if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {
234
+ return el;
235
+ }
236
+
237
+ if (el === ctx) break;
238
+ /* jshint boss:true */
239
+ } while (el = getParentOrHost(el));
240
+ }
241
+
242
+ return null;
243
+ }
244
+
245
+ var R_SPACE = /\s+/g;
246
+
247
+ function toggleClass(el, name, state) {
248
+ if (el && name) {
249
+ if (el.classList) {
250
+ el.classList[state ? 'add' : 'remove'](name);
251
+ } else {
252
+ var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');
253
+ el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');
254
+ }
255
+ }
256
+ }
257
+
258
+ function css(el, prop, val) {
259
+ var style = el && el.style;
260
+
261
+ if (style) {
262
+ if (val === void 0) {
263
+ if (document.defaultView && document.defaultView.getComputedStyle) {
264
+ val = document.defaultView.getComputedStyle(el, '');
265
+ } else if (el.currentStyle) {
266
+ val = el.currentStyle;
267
+ }
268
+
269
+ return prop === void 0 ? val : val[prop];
270
+ } else {
271
+ if (!(prop in style) && prop.indexOf('webkit') === -1) {
272
+ prop = '-webkit-' + prop;
273
+ }
274
+
275
+ style[prop] = val + (typeof val === 'string' ? '' : 'px');
276
+ }
277
+ }
278
+ }
279
+
280
+ function matrix(el, selfOnly) {
281
+ var appliedTransforms = '';
282
+
283
+ if (typeof el === 'string') {
284
+ appliedTransforms = el;
285
+ } else {
286
+ do {
287
+ var transform = css(el, 'transform');
288
+
289
+ if (transform && transform !== 'none') {
290
+ appliedTransforms = transform + ' ' + appliedTransforms;
291
+ }
292
+ /* jshint boss:true */
293
+
294
+ } while (!selfOnly && (el = el.parentNode));
295
+ }
296
+
297
+ var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
298
+ /*jshint -W056 */
299
+
300
+ return matrixFn && new matrixFn(appliedTransforms);
301
+ }
302
+
303
+ function find(ctx, tagName, iterator) {
304
+ if (ctx) {
305
+ var list = ctx.getElementsByTagName(tagName),
306
+ i = 0,
307
+ n = list.length;
308
+
309
+ if (iterator) {
310
+ for (; i < n; i++) {
311
+ iterator(list[i], i);
312
+ }
313
+ }
314
+
315
+ return list;
316
+ }
317
+
318
+ return [];
319
+ }
320
+
321
+ function getWindowScrollingElement() {
322
+ var scrollingElement = document.scrollingElement;
323
+
324
+ if (scrollingElement) {
325
+ return scrollingElement;
326
+ } else {
327
+ return document.documentElement;
328
+ }
329
+ }
330
+ /**
331
+ * Returns the "bounding client rect" of given element
332
+ * @param {HTMLElement} el The element whose boundingClientRect is wanted
333
+ * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container
334
+ * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr
335
+ * @param {[Boolean]} undoScale Whether the container's scale() should be undone
336
+ * @param {[HTMLElement]} container The parent the element will be placed in
337
+ * @return {Object} The boundingClientRect of el, with specified adjustments
338
+ */
339
+
340
+
341
+ function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {
342
+ if (!el.getBoundingClientRect && el !== window) return;
343
+ var elRect, top, left, bottom, right, height, width;
344
+
345
+ if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {
346
+ elRect = el.getBoundingClientRect();
347
+ top = elRect.top;
348
+ left = elRect.left;
349
+ bottom = elRect.bottom;
350
+ right = elRect.right;
351
+ height = elRect.height;
352
+ width = elRect.width;
353
+ } else {
354
+ top = 0;
355
+ left = 0;
356
+ bottom = window.innerHeight;
357
+ right = window.innerWidth;
358
+ height = window.innerHeight;
359
+ width = window.innerWidth;
360
+ }
361
+
362
+ if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {
363
+ // Adjust for translate()
364
+ container = container || el.parentNode; // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)
365
+ // Not needed on <= IE11
366
+
367
+ if (!IE11OrLess) {
368
+ do {
369
+ if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {
370
+ var containerRect = container.getBoundingClientRect(); // Set relative to edges of padding box of container
371
+
372
+ top -= containerRect.top + parseInt(css(container, 'border-top-width'));
373
+ left -= containerRect.left + parseInt(css(container, 'border-left-width'));
374
+ bottom = top + elRect.height;
375
+ right = left + elRect.width;
376
+ break;
377
+ }
378
+ /* jshint boss:true */
379
+
380
+ } while (container = container.parentNode);
381
+ }
382
+ }
383
+
384
+ if (undoScale && el !== window) {
385
+ // Adjust for scale()
386
+ var elMatrix = matrix(container || el),
387
+ scaleX = elMatrix && elMatrix.a,
388
+ scaleY = elMatrix && elMatrix.d;
389
+
390
+ if (elMatrix) {
391
+ top /= scaleY;
392
+ left /= scaleX;
393
+ width /= scaleX;
394
+ height /= scaleY;
395
+ bottom = top + height;
396
+ right = left + width;
397
+ }
398
+ }
399
+
400
+ return {
401
+ top: top,
402
+ left: left,
403
+ bottom: bottom,
404
+ right: right,
405
+ width: width,
406
+ height: height
407
+ };
408
+ }
409
+ /**
410
+ * Checks if a side of an element is scrolled past a side of its parents
411
+ * @param {HTMLElement} el The element who's side being scrolled out of view is in question
412
+ * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')
413
+ * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')
414
+ * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element
415
+ */
416
+
417
+
418
+ function isScrolledPast(el, elSide, parentSide) {
419
+ var parent = getParentAutoScrollElement(el, true),
420
+ elSideVal = getRect(el)[elSide];
421
+ /* jshint boss:true */
422
+
423
+ while (parent) {
424
+ var parentSideVal = getRect(parent)[parentSide],
425
+ visible = void 0;
426
+
427
+ if (parentSide === 'top' || parentSide === 'left') {
428
+ visible = elSideVal >= parentSideVal;
429
+ } else {
430
+ visible = elSideVal <= parentSideVal;
431
+ }
432
+
433
+ if (!visible) return parent;
434
+ if (parent === getWindowScrollingElement()) break;
435
+ parent = getParentAutoScrollElement(parent, false);
436
+ }
437
+
438
+ return false;
439
+ }
440
+ /**
441
+ * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)
442
+ * and non-draggable elements
443
+ * @param {HTMLElement} el The parent element
444
+ * @param {Number} childNum The index of the child
445
+ * @param {Object} options Parent Sortable's options
446
+ * @return {HTMLElement} The child at index childNum, or null if not found
447
+ */
448
+
449
+
450
+ function getChild(el, childNum, options, includeDragEl) {
451
+ var currentChild = 0,
452
+ i = 0,
453
+ children = el.children;
454
+
455
+ while (i < children.length) {
456
+ if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {
457
+ if (currentChild === childNum) {
458
+ return children[i];
459
+ }
460
+
461
+ currentChild++;
462
+ }
463
+
464
+ i++;
465
+ }
466
+
467
+ return null;
468
+ }
469
+ /**
470
+ * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)
471
+ * @param {HTMLElement} el Parent element
472
+ * @param {selector} selector Any other elements that should be ignored
473
+ * @return {HTMLElement} The last child, ignoring ghostEl
474
+ */
475
+
476
+
477
+ function lastChild(el, selector) {
478
+ var last = el.lastElementChild;
479
+
480
+ while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {
481
+ last = last.previousElementSibling;
482
+ }
483
+
484
+ return last || null;
485
+ }
486
+ /**
487
+ * Returns the index of an element within its parent for a selected set of
488
+ * elements
489
+ * @param {HTMLElement} el
490
+ * @param {selector} selector
491
+ * @return {number}
492
+ */
493
+
494
+
495
+ function index(el, selector) {
496
+ var index = 0;
497
+
498
+ if (!el || !el.parentNode) {
499
+ return -1;
500
+ }
501
+ /* jshint boss:true */
502
+
503
+
504
+ while (el = el.previousElementSibling) {
505
+ if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {
506
+ index++;
507
+ }
508
+ }
509
+
510
+ return index;
511
+ }
512
+ /**
513
+ * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.
514
+ * The value is returned in real pixels.
515
+ * @param {HTMLElement} el
516
+ * @return {Array} Offsets in the format of [left, top]
517
+ */
518
+
519
+
520
+ function getRelativeScrollOffset(el) {
521
+ var offsetLeft = 0,
522
+ offsetTop = 0,
523
+ winScroller = getWindowScrollingElement();
524
+
525
+ if (el) {
526
+ do {
527
+ var elMatrix = matrix(el),
528
+ scaleX = elMatrix.a,
529
+ scaleY = elMatrix.d;
530
+ offsetLeft += el.scrollLeft * scaleX;
531
+ offsetTop += el.scrollTop * scaleY;
532
+ } while (el !== winScroller && (el = el.parentNode));
533
+ }
534
+
535
+ return [offsetLeft, offsetTop];
536
+ }
537
+ /**
538
+ * Returns the index of the object within the given array
539
+ * @param {Array} arr Array that may or may not hold the object
540
+ * @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
541
+ * @return {Number} The index of the object in the array, or -1
542
+ */
543
+
544
+
545
+ function indexOfObject(arr, obj) {
546
+ for (var i in arr) {
547
+ if (!arr.hasOwnProperty(i)) continue;
548
+
549
+ for (var key in obj) {
550
+ if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);
551
+ }
552
+ }
553
+
554
+ return -1;
555
+ }
556
+
557
+ function getParentAutoScrollElement(el, includeSelf) {
558
+ // skip to window
559
+ if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();
560
+ var elem = el;
561
+ var gotSelf = false;
562
+
563
+ do {
564
+ // we don't need to get elem css if it isn't even overflowing in the first place (performance)
565
+ if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {
566
+ var elemCSS = css(elem);
567
+
568
+ if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {
569
+ if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();
570
+ if (gotSelf || includeSelf) return elem;
571
+ gotSelf = true;
572
+ }
573
+ }
574
+ /* jshint boss:true */
575
+
576
+ } while (elem = elem.parentNode);
577
+
578
+ return getWindowScrollingElement();
579
+ }
580
+
581
+ function extend(dst, src) {
582
+ if (dst && src) {
583
+ for (var key in src) {
584
+ if (src.hasOwnProperty(key)) {
585
+ dst[key] = src[key];
586
+ }
587
+ }
588
+ }
589
+
590
+ return dst;
591
+ }
592
+
593
+ function isRectEqual(rect1, rect2) {
594
+ 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);
595
+ }
596
+
597
+ var _throttleTimeout;
598
+
599
+ function throttle(callback, ms) {
600
+ return function () {
601
+ if (!_throttleTimeout) {
602
+ var args = arguments,
603
+ _this = this;
604
+
605
+ if (args.length === 1) {
606
+ callback.call(_this, args[0]);
607
+ } else {
608
+ callback.apply(_this, args);
609
+ }
610
+
611
+ _throttleTimeout = setTimeout(function () {
612
+ _throttleTimeout = void 0;
613
+ }, ms);
614
+ }
615
+ };
616
+ }
617
+
618
+ function cancelThrottle() {
619
+ clearTimeout(_throttleTimeout);
620
+ _throttleTimeout = void 0;
621
+ }
622
+
623
+ function scrollBy(el, x, y) {
624
+ el.scrollLeft += x;
625
+ el.scrollTop += y;
626
+ }
627
+
628
+ function clone(el) {
629
+ var Polymer = window.Polymer;
630
+ var $ = window.jQuery || window.Zepto;
631
+
632
+ if (Polymer && Polymer.dom) {
633
+ return Polymer.dom(el).cloneNode(true);
634
+ } else if ($) {
635
+ return $(el).clone(true)[0];
636
+ } else {
637
+ return el.cloneNode(true);
638
+ }
639
+ }
640
+
641
+ var expando = 'Sortable' + new Date().getTime();
642
+
643
+ function AnimationStateManager() {
644
+ var animationStates = [],
645
+ animationCallbackId;
646
+ return {
647
+ captureAnimationState: function captureAnimationState() {
648
+ animationStates = [];
649
+ if (!this.options.animation) return;
650
+ var children = [].slice.call(this.el.children);
651
+ children.forEach(function (child) {
652
+ if (css(child, 'display') === 'none' || child === Sortable.ghost) return;
653
+ animationStates.push({
654
+ target: child,
655
+ rect: getRect(child)
656
+ });
657
+
658
+ var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect); // If animating: compensate for current animation
659
+
660
+
661
+ if (child.thisAnimationDuration) {
662
+ var childMatrix = matrix(child, true);
663
+
664
+ if (childMatrix) {
665
+ fromRect.top -= childMatrix.f;
666
+ fromRect.left -= childMatrix.e;
667
+ }
668
+ }
669
+
670
+ child.fromRect = fromRect;
671
+ });
672
+ },
673
+ addAnimationState: function addAnimationState(state) {
674
+ animationStates.push(state);
675
+ },
676
+ removeAnimationState: function removeAnimationState(target) {
677
+ animationStates.splice(indexOfObject(animationStates, {
678
+ target: target
679
+ }), 1);
680
+ },
681
+ animateAll: function animateAll(callback) {
682
+ var _this = this;
683
+
684
+ if (!this.options.animation) {
685
+ clearTimeout(animationCallbackId);
686
+ if (typeof callback === 'function') callback();
687
+ return;
688
+ }
689
+
690
+ var animating = false,
691
+ animationTime = 0;
692
+ animationStates.forEach(function (state) {
693
+ var time = 0,
694
+ target = state.target,
695
+ fromRect = target.fromRect,
696
+ toRect = getRect(target),
697
+ prevFromRect = target.prevFromRect,
698
+ prevToRect = target.prevToRect,
699
+ animatingRect = state.rect,
700
+ targetMatrix = matrix(target, true);
701
+
702
+ if (targetMatrix) {
703
+ // Compensate for current animation
704
+ toRect.top -= targetMatrix.f;
705
+ toRect.left -= targetMatrix.e;
706
+ }
707
+
708
+ target.toRect = toRect;
709
+
710
+ if (target.thisAnimationDuration) {
711
+ // Could also check if animatingRect is between fromRect and toRect
712
+ if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) && // Make sure animatingRect is on line between toRect & fromRect
713
+ (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {
714
+ // If returning to same place as started from animation and on same axis
715
+ time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);
716
+ }
717
+ } // if fromRect != toRect: animate
718
+
719
+
720
+ if (!isRectEqual(toRect, fromRect)) {
721
+ target.prevFromRect = fromRect;
722
+ target.prevToRect = toRect;
723
+
724
+ if (!time) {
725
+ time = _this.options.animation;
726
+ }
727
+
728
+ _this.animate(target, animatingRect, toRect, time);
729
+ }
730
+
731
+ if (time) {
732
+ animating = true;
733
+ animationTime = Math.max(animationTime, time);
734
+ clearTimeout(target.animationResetTimer);
735
+ target.animationResetTimer = setTimeout(function () {
736
+ target.animationTime = 0;
737
+ target.prevFromRect = null;
738
+ target.fromRect = null;
739
+ target.prevToRect = null;
740
+ target.thisAnimationDuration = null;
741
+ }, time);
742
+ target.thisAnimationDuration = time;
743
+ }
744
+ });
745
+ clearTimeout(animationCallbackId);
746
+
747
+ if (!animating) {
748
+ if (typeof callback === 'function') callback();
749
+ } else {
750
+ animationCallbackId = setTimeout(function () {
751
+ if (typeof callback === 'function') callback();
752
+ }, animationTime);
753
+ }
754
+
755
+ animationStates = [];
756
+ },
757
+ animate: function animate(target, currentRect, toRect, duration) {
758
+ if (duration) {
759
+ css(target, 'transition', '');
760
+ css(target, 'transform', '');
761
+ var elMatrix = matrix(this.el),
762
+ scaleX = elMatrix && elMatrix.a,
763
+ scaleY = elMatrix && elMatrix.d,
764
+ translateX = (currentRect.left - toRect.left) / (scaleX || 1),
765
+ translateY = (currentRect.top - toRect.top) / (scaleY || 1);
766
+ target.animatingX = !!translateX;
767
+ target.animatingY = !!translateY;
768
+ css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');
769
+ this.forRepaintDummy = repaint(target); // repaint
770
+
771
+ css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));
772
+ css(target, 'transform', 'translate3d(0,0,0)');
773
+ typeof target.animated === 'number' && clearTimeout(target.animated);
774
+ target.animated = setTimeout(function () {
775
+ css(target, 'transition', '');
776
+ css(target, 'transform', '');
777
+ target.animated = false;
778
+ target.animatingX = false;
779
+ target.animatingY = false;
780
+ }, duration);
781
+ }
782
+ }
783
+ };
784
+ }
785
+
786
+ function repaint(target) {
787
+ return target.offsetWidth;
788
+ }
789
+
790
+ function calculateRealTime(animatingRect, fromRect, toRect, options) {
791
+ 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;
792
+ }
793
+
794
+ var plugins = [];
795
+ var defaults = {
796
+ initializeByDefault: true
797
+ };
798
+ var PluginManager = {
799
+ mount: function mount(plugin) {
800
+ // Set default static properties
801
+ for (var option in defaults) {
802
+ if (defaults.hasOwnProperty(option) && !(option in plugin)) {
803
+ plugin[option] = defaults[option];
804
+ }
805
+ }
806
+
807
+ plugins.forEach(function (p) {
808
+ if (p.pluginName === plugin.pluginName) {
809
+ throw "Sortable: Cannot mount plugin ".concat(plugin.pluginName, " more than once");
810
+ }
811
+ });
812
+ plugins.push(plugin);
813
+ },
814
+ pluginEvent: function pluginEvent(eventName, sortable, evt) {
815
+ var _this = this;
816
+
817
+ this.eventCanceled = false;
818
+
819
+ evt.cancel = function () {
820
+ _this.eventCanceled = true;
821
+ };
822
+
823
+ var eventNameGlobal = eventName + 'Global';
824
+ plugins.forEach(function (plugin) {
825
+ if (!sortable[plugin.pluginName]) return; // Fire global events if it exists in this sortable
826
+
827
+ if (sortable[plugin.pluginName][eventNameGlobal]) {
828
+ sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({
829
+ sortable: sortable
830
+ }, evt));
831
+ } // Only fire plugin event if plugin is enabled in this sortable,
832
+ // and plugin has event defined
833
+
834
+
835
+ if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {
836
+ sortable[plugin.pluginName][eventName](_objectSpread2({
837
+ sortable: sortable
838
+ }, evt));
839
+ }
840
+ });
841
+ },
842
+ initializePlugins: function initializePlugins(sortable, el, defaults, options) {
843
+ plugins.forEach(function (plugin) {
844
+ var pluginName = plugin.pluginName;
845
+ if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;
846
+ var initialized = new plugin(sortable, el, sortable.options);
847
+ initialized.sortable = sortable;
848
+ initialized.options = sortable.options;
849
+ sortable[pluginName] = initialized; // Add default options from plugin
850
+
851
+ _extends(defaults, initialized.defaults);
852
+ });
853
+
854
+ for (var option in sortable.options) {
855
+ if (!sortable.options.hasOwnProperty(option)) continue;
856
+ var modified = this.modifyOption(sortable, option, sortable.options[option]);
857
+
858
+ if (typeof modified !== 'undefined') {
859
+ sortable.options[option] = modified;
860
+ }
861
+ }
862
+ },
863
+ getEventProperties: function getEventProperties(name, sortable) {
864
+ var eventProperties = {};
865
+ plugins.forEach(function (plugin) {
866
+ if (typeof plugin.eventProperties !== 'function') return;
867
+
868
+ _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));
869
+ });
870
+ return eventProperties;
871
+ },
872
+ modifyOption: function modifyOption(sortable, name, value) {
873
+ var modifiedValue;
874
+ plugins.forEach(function (plugin) {
875
+ // Plugin must exist on the Sortable
876
+ if (!sortable[plugin.pluginName]) return; // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin
877
+
878
+ if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {
879
+ modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);
880
+ }
881
+ });
882
+ return modifiedValue;
883
+ }
884
+ };
885
+
886
+ function dispatchEvent(_ref) {
887
+ var sortable = _ref.sortable,
888
+ rootEl = _ref.rootEl,
889
+ name = _ref.name,
890
+ targetEl = _ref.targetEl,
891
+ cloneEl = _ref.cloneEl,
892
+ toEl = _ref.toEl,
893
+ fromEl = _ref.fromEl,
894
+ oldIndex = _ref.oldIndex,
895
+ newIndex = _ref.newIndex,
896
+ oldDraggableIndex = _ref.oldDraggableIndex,
897
+ newDraggableIndex = _ref.newDraggableIndex,
898
+ originalEvent = _ref.originalEvent,
899
+ putSortable = _ref.putSortable,
900
+ extraEventProperties = _ref.extraEventProperties;
901
+ sortable = sortable || rootEl && rootEl[expando];
902
+ if (!sortable) return;
903
+ var evt,
904
+ options = sortable.options,
905
+ onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1); // Support for new CustomEvent feature
906
+
907
+ if (window.CustomEvent && !IE11OrLess && !Edge) {
908
+ evt = new CustomEvent(name, {
909
+ bubbles: true,
910
+ cancelable: true
911
+ });
912
+ } else {
913
+ evt = document.createEvent('Event');
914
+ evt.initEvent(name, true, true);
915
+ }
916
+
917
+ evt.to = toEl || rootEl;
918
+ evt.from = fromEl || rootEl;
919
+ evt.item = targetEl || rootEl;
920
+ evt.clone = cloneEl;
921
+ evt.oldIndex = oldIndex;
922
+ evt.newIndex = newIndex;
923
+ evt.oldDraggableIndex = oldDraggableIndex;
924
+ evt.newDraggableIndex = newDraggableIndex;
925
+ evt.originalEvent = originalEvent;
926
+ evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;
927
+
928
+ var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));
929
+
930
+ for (var option in allEventProperties) {
931
+ evt[option] = allEventProperties[option];
932
+ }
933
+
934
+ if (rootEl) {
935
+ rootEl.dispatchEvent(evt);
936
+ }
937
+
938
+ if (options[onName]) {
939
+ options[onName].call(sortable, evt);
940
+ }
941
+ }
942
+
943
+ var _excluded = ["evt"];
944
+
945
+ var pluginEvent = function pluginEvent(eventName, sortable) {
946
+ var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
947
+ originalEvent = _ref.evt,
948
+ data = _objectWithoutProperties(_ref, _excluded);
949
+
950
+ PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({
951
+ dragEl: dragEl,
952
+ parentEl: parentEl,
953
+ ghostEl: ghostEl,
954
+ rootEl: rootEl,
955
+ nextEl: nextEl,
956
+ lastDownEl: lastDownEl,
957
+ cloneEl: cloneEl,
958
+ cloneHidden: cloneHidden,
959
+ dragStarted: moved,
960
+ putSortable: putSortable,
961
+ activeSortable: Sortable.active,
962
+ originalEvent: originalEvent,
963
+ oldIndex: oldIndex,
964
+ oldDraggableIndex: oldDraggableIndex,
965
+ newIndex: newIndex,
966
+ newDraggableIndex: newDraggableIndex,
967
+ hideGhostForTarget: _hideGhostForTarget,
968
+ unhideGhostForTarget: _unhideGhostForTarget,
969
+ cloneNowHidden: function cloneNowHidden() {
970
+ cloneHidden = true;
971
+ },
972
+ cloneNowShown: function cloneNowShown() {
973
+ cloneHidden = false;
974
+ },
975
+ dispatchSortableEvent: function dispatchSortableEvent(name) {
976
+ _dispatchEvent({
977
+ sortable: sortable,
978
+ name: name,
979
+ originalEvent: originalEvent
980
+ });
981
+ }
982
+ }, data));
983
+ };
984
+
985
+ function _dispatchEvent(info) {
986
+ dispatchEvent(_objectSpread2({
987
+ putSortable: putSortable,
988
+ cloneEl: cloneEl,
989
+ targetEl: dragEl,
990
+ rootEl: rootEl,
991
+ oldIndex: oldIndex,
992
+ oldDraggableIndex: oldDraggableIndex,
993
+ newIndex: newIndex,
994
+ newDraggableIndex: newDraggableIndex
995
+ }, info));
996
+ }
997
+
998
+ var dragEl,
999
+ parentEl,
1000
+ ghostEl,
1001
+ rootEl,
1002
+ nextEl,
1003
+ lastDownEl,
1004
+ cloneEl,
1005
+ cloneHidden,
1006
+ oldIndex,
1007
+ newIndex,
1008
+ oldDraggableIndex,
1009
+ newDraggableIndex,
1010
+ activeGroup,
1011
+ putSortable,
1012
+ awaitingDragStarted = false,
1013
+ ignoreNextClick = false,
1014
+ sortables = [],
1015
+ tapEvt,
1016
+ touchEvt,
1017
+ lastDx,
1018
+ lastDy,
1019
+ tapDistanceLeft,
1020
+ tapDistanceTop,
1021
+ moved,
1022
+ lastTarget,
1023
+ lastDirection,
1024
+ pastFirstInvertThresh = false,
1025
+ isCircumstantialInvert = false,
1026
+ targetMoveDistance,
1027
+ // For positioning ghost absolutely
1028
+ ghostRelativeParent,
1029
+ ghostRelativeParentInitialScroll = [],
1030
+ // (left, top)
1031
+ _silent = false,
1032
+ savedInputChecked = [];
1033
+ /** @const */
1034
+
1035
+ var documentExists = typeof document !== 'undefined',
1036
+ PositionGhostAbsolutely = IOS,
1037
+ CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',
1038
+ // This will not pass for IE9, because IE9 DnD only works on anchors
1039
+ supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),
1040
+ supportCssPointerEvents = function () {
1041
+ if (!documentExists) return; // false when <= IE11
1042
+
1043
+ if (IE11OrLess) {
1044
+ return false;
1045
+ }
1046
+
1047
+ var el = document.createElement('x');
1048
+ el.style.cssText = 'pointer-events:auto';
1049
+ return el.style.pointerEvents === 'auto';
1050
+ }(),
1051
+ _detectDirection = function _detectDirection(el, options) {
1052
+ var elCSS = css(el),
1053
+ elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),
1054
+ child1 = getChild(el, 0, options),
1055
+ child2 = getChild(el, 1, options),
1056
+ firstChildCSS = child1 && css(child1),
1057
+ secondChildCSS = child2 && css(child2),
1058
+ firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,
1059
+ secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;
1060
+
1061
+ if (elCSS.display === 'flex') {
1062
+ return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';
1063
+ }
1064
+
1065
+ if (elCSS.display === 'grid') {
1066
+ return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';
1067
+ }
1068
+
1069
+ if (child1 && firstChildCSS["float"] && firstChildCSS["float"] !== 'none') {
1070
+ var touchingSideChild2 = firstChildCSS["float"] === 'left' ? 'left' : 'right';
1071
+ return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';
1072
+ }
1073
+
1074
+ 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';
1075
+ },
1076
+ _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {
1077
+ var dragElS1Opp = vertical ? dragRect.left : dragRect.top,
1078
+ dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,
1079
+ dragElOppLength = vertical ? dragRect.width : dragRect.height,
1080
+ targetS1Opp = vertical ? targetRect.left : targetRect.top,
1081
+ targetS2Opp = vertical ? targetRect.right : targetRect.bottom,
1082
+ targetOppLength = vertical ? targetRect.width : targetRect.height;
1083
+ return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;
1084
+ },
1085
+
1086
+ /**
1087
+ * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.
1088
+ * @param {Number} x X position
1089
+ * @param {Number} y Y position
1090
+ * @return {HTMLElement} Element of the first found nearest Sortable
1091
+ */
1092
+ _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {
1093
+ var ret;
1094
+ sortables.some(function (sortable) {
1095
+ var threshold = sortable[expando].options.emptyInsertThreshold;
1096
+ if (!threshold || lastChild(sortable)) return;
1097
+ var rect = getRect(sortable),
1098
+ insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,
1099
+ insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;
1100
+
1101
+ if (insideHorizontally && insideVertically) {
1102
+ return ret = sortable;
1103
+ }
1104
+ });
1105
+ return ret;
1106
+ },
1107
+ _prepareGroup = function _prepareGroup(options) {
1108
+ function toFn(value, pull) {
1109
+ return function (to, from, dragEl, evt) {
1110
+ var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;
1111
+
1112
+ if (value == null && (pull || sameGroup)) {
1113
+ // Default pull value
1114
+ // Default pull and put value if same group
1115
+ return true;
1116
+ } else if (value == null || value === false) {
1117
+ return false;
1118
+ } else if (pull && value === 'clone') {
1119
+ return value;
1120
+ } else if (typeof value === 'function') {
1121
+ return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);
1122
+ } else {
1123
+ var otherGroup = (pull ? to : from).options.group.name;
1124
+ return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;
1125
+ }
1126
+ };
1127
+ }
1128
+
1129
+ var group = {};
1130
+ var originalGroup = options.group;
1131
+
1132
+ if (!originalGroup || _typeof(originalGroup) != 'object') {
1133
+ originalGroup = {
1134
+ name: originalGroup
1135
+ };
1136
+ }
1137
+
1138
+ group.name = originalGroup.name;
1139
+ group.checkPull = toFn(originalGroup.pull, true);
1140
+ group.checkPut = toFn(originalGroup.put);
1141
+ group.revertClone = originalGroup.revertClone;
1142
+ options.group = group;
1143
+ },
1144
+ _hideGhostForTarget = function _hideGhostForTarget() {
1145
+ if (!supportCssPointerEvents && ghostEl) {
1146
+ css(ghostEl, 'display', 'none');
1147
+ }
1148
+ },
1149
+ _unhideGhostForTarget = function _unhideGhostForTarget() {
1150
+ if (!supportCssPointerEvents && ghostEl) {
1151
+ css(ghostEl, 'display', '');
1152
+ }
1153
+ }; // #1184 fix - Prevent click event on fallback if dragged but item not changed position
1154
+
1155
+
1156
+ if (documentExists && !ChromeForAndroid) {
1157
+ document.addEventListener('click', function (evt) {
1158
+ if (ignoreNextClick) {
1159
+ evt.preventDefault();
1160
+ evt.stopPropagation && evt.stopPropagation();
1161
+ evt.stopImmediatePropagation && evt.stopImmediatePropagation();
1162
+ ignoreNextClick = false;
1163
+ return false;
1164
+ }
1165
+ }, true);
1166
+ }
1167
+
1168
+ var nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {
1169
+ if (dragEl) {
1170
+ evt = evt.touches ? evt.touches[0] : evt;
1171
+
1172
+ var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);
1173
+
1174
+ if (nearest) {
1175
+ // Create imitation event
1176
+ var event = {};
1177
+
1178
+ for (var i in evt) {
1179
+ if (evt.hasOwnProperty(i)) {
1180
+ event[i] = evt[i];
1181
+ }
1182
+ }
1183
+
1184
+ event.target = event.rootEl = nearest;
1185
+ event.preventDefault = void 0;
1186
+ event.stopPropagation = void 0;
1187
+
1188
+ nearest[expando]._onDragOver(event);
1189
+ }
1190
+ }
1191
+ };
1192
+
1193
+ var _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {
1194
+ if (dragEl) {
1195
+ dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
1196
+ }
1197
+ };
1198
+ /**
1199
+ * @class Sortable
1200
+ * @param {HTMLElement} el
1201
+ * @param {Object} [options]
1202
+ */
1203
+
1204
+
1205
+ function Sortable(el, options) {
1206
+ if (!(el && el.nodeType && el.nodeType === 1)) {
1207
+ throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(el));
1208
+ }
1209
+
1210
+ this.el = el; // root element
1211
+
1212
+ this.options = options = _extends({}, options); // Export instance
1213
+
1214
+ el[expando] = this;
1215
+ var defaults = {
1216
+ group: null,
1217
+ sort: true,
1218
+ disabled: false,
1219
+ store: null,
1220
+ handle: null,
1221
+ draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',
1222
+ swapThreshold: 1,
1223
+ // percentage; 0 <= x <= 1
1224
+ invertSwap: false,
1225
+ // invert always
1226
+ invertedSwapThreshold: null,
1227
+ // will be set to same as swapThreshold if default
1228
+ removeCloneOnHide: true,
1229
+ direction: function direction() {
1230
+ return _detectDirection(el, this.options);
1231
+ },
1232
+ ghostClass: 'sortable-ghost',
1233
+ chosenClass: 'sortable-chosen',
1234
+ dragClass: 'sortable-drag',
1235
+ ignore: 'a, img',
1236
+ filter: null,
1237
+ preventOnFilter: true,
1238
+ animation: 0,
1239
+ easing: null,
1240
+ setData: function setData(dataTransfer, dragEl) {
1241
+ dataTransfer.setData('Text', dragEl.textContent);
1242
+ },
1243
+ dropBubble: false,
1244
+ dragoverBubble: false,
1245
+ dataIdAttr: 'data-id',
1246
+ delay: 0,
1247
+ delayOnTouchOnly: false,
1248
+ touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
1249
+ forceFallback: false,
1250
+ fallbackClass: 'sortable-fallback',
1251
+ fallbackOnBody: false,
1252
+ fallbackTolerance: 0,
1253
+ fallbackOffset: {
1254
+ x: 0,
1255
+ y: 0
1256
+ },
1257
+ supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari,
1258
+ emptyInsertThreshold: 5
1259
+ };
1260
+ PluginManager.initializePlugins(this, el, defaults); // Set default options
1261
+
1262
+ for (var name in defaults) {
1263
+ !(name in options) && (options[name] = defaults[name]);
1264
+ }
1265
+
1266
+ _prepareGroup(options); // Bind all private methods
1267
+
1268
+
1269
+ for (var fn in this) {
1270
+ if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
1271
+ this[fn] = this[fn].bind(this);
1272
+ }
1273
+ } // Setup drag mode
1274
+
1275
+
1276
+ this.nativeDraggable = options.forceFallback ? false : supportDraggable;
1277
+
1278
+ if (this.nativeDraggable) {
1279
+ // Touch start threshold cannot be greater than the native dragstart threshold
1280
+ this.options.touchStartThreshold = 1;
1281
+ } // Bind events
1282
+
1283
+
1284
+ if (options.supportPointer) {
1285
+ on(el, 'pointerdown', this._onTapStart);
1286
+ } else {
1287
+ on(el, 'mousedown', this._onTapStart);
1288
+ on(el, 'touchstart', this._onTapStart);
1289
+ }
1290
+
1291
+ if (this.nativeDraggable) {
1292
+ on(el, 'dragover', this);
1293
+ on(el, 'dragenter', this);
1294
+ }
1295
+
1296
+ sortables.push(this.el); // Restore sorting
1297
+
1298
+ options.store && options.store.get && this.sort(options.store.get(this) || []); // Add animation state manager
1299
+
1300
+ _extends(this, AnimationStateManager());
1301
+ }
1302
+
1303
+ Sortable.prototype =
1304
+ /** @lends Sortable.prototype */
1305
+ {
1306
+ constructor: Sortable,
1307
+ _isOutsideThisEl: function _isOutsideThisEl(target) {
1308
+ if (!this.el.contains(target) && target !== this.el) {
1309
+ lastTarget = null;
1310
+ }
1311
+ },
1312
+ _getDirection: function _getDirection(evt, target) {
1313
+ return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;
1314
+ },
1315
+ _onTapStart: function _onTapStart(
1316
+ /** Event|TouchEvent */
1317
+ evt) {
1318
+ if (!evt.cancelable) return;
1319
+
1320
+ var _this = this,
1321
+ el = this.el,
1322
+ options = this.options,
1323
+ preventOnFilter = options.preventOnFilter,
1324
+ type = evt.type,
1325
+ touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,
1326
+ target = (touch || evt).target,
1327
+ originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,
1328
+ filter = options.filter;
1329
+
1330
+ _saveInputCheckedState(el); // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.
1331
+
1332
+
1333
+ if (dragEl) {
1334
+ return;
1335
+ }
1336
+
1337
+ if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {
1338
+ return; // only left button and enabled
1339
+ } // cancel dnd if original target is content editable
1340
+
1341
+
1342
+ if (originalTarget.isContentEditable) {
1343
+ return;
1344
+ } // Safari ignores further event handling after mousedown
1345
+
1346
+
1347
+ if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {
1348
+ return;
1349
+ }
1350
+
1351
+ target = closest(target, options.draggable, el, false);
1352
+
1353
+ if (target && target.animated) {
1354
+ return;
1355
+ }
1356
+
1357
+ if (lastDownEl === target) {
1358
+ // Ignoring duplicate `down`
1359
+ return;
1360
+ } // Get the index of the dragged element within its parent
1361
+
1362
+
1363
+ oldIndex = index(target);
1364
+ oldDraggableIndex = index(target, options.draggable); // Check filter
1365
+
1366
+ if (typeof filter === 'function') {
1367
+ if (filter.call(this, evt, target, this)) {
1368
+ _dispatchEvent({
1369
+ sortable: _this,
1370
+ rootEl: originalTarget,
1371
+ name: 'filter',
1372
+ targetEl: target,
1373
+ toEl: el,
1374
+ fromEl: el
1375
+ });
1376
+
1377
+ pluginEvent('filter', _this, {
1378
+ evt: evt
1379
+ });
1380
+ preventOnFilter && evt.cancelable && evt.preventDefault();
1381
+ return; // cancel dnd
1382
+ }
1383
+ } else if (filter) {
1384
+ filter = filter.split(',').some(function (criteria) {
1385
+ criteria = closest(originalTarget, criteria.trim(), el, false);
1386
+
1387
+ if (criteria) {
1388
+ _dispatchEvent({
1389
+ sortable: _this,
1390
+ rootEl: criteria,
1391
+ name: 'filter',
1392
+ targetEl: target,
1393
+ fromEl: el,
1394
+ toEl: el
1395
+ });
1396
+
1397
+ pluginEvent('filter', _this, {
1398
+ evt: evt
1399
+ });
1400
+ return true;
1401
+ }
1402
+ });
1403
+
1404
+ if (filter) {
1405
+ preventOnFilter && evt.cancelable && evt.preventDefault();
1406
+ return; // cancel dnd
1407
+ }
1408
+ }
1409
+
1410
+ if (options.handle && !closest(originalTarget, options.handle, el, false)) {
1411
+ return;
1412
+ } // Prepare `dragstart`
1413
+
1414
+
1415
+ this._prepareDragStart(evt, touch, target);
1416
+ },
1417
+ _prepareDragStart: function _prepareDragStart(
1418
+ /** Event */
1419
+ evt,
1420
+ /** Touch */
1421
+ touch,
1422
+ /** HTMLElement */
1423
+ target) {
1424
+ var _this = this,
1425
+ el = _this.el,
1426
+ options = _this.options,
1427
+ ownerDocument = el.ownerDocument,
1428
+ dragStartFn;
1429
+
1430
+ if (target && !dragEl && target.parentNode === el) {
1431
+ var dragRect = getRect(target);
1432
+ rootEl = el;
1433
+ dragEl = target;
1434
+ parentEl = dragEl.parentNode;
1435
+ nextEl = dragEl.nextSibling;
1436
+ lastDownEl = target;
1437
+ activeGroup = options.group;
1438
+ Sortable.dragged = dragEl;
1439
+ tapEvt = {
1440
+ target: dragEl,
1441
+ clientX: (touch || evt).clientX,
1442
+ clientY: (touch || evt).clientY
1443
+ };
1444
+ tapDistanceLeft = tapEvt.clientX - dragRect.left;
1445
+ tapDistanceTop = tapEvt.clientY - dragRect.top;
1446
+ this._lastX = (touch || evt).clientX;
1447
+ this._lastY = (touch || evt).clientY;
1448
+ dragEl.style['will-change'] = 'all';
1449
+
1450
+ dragStartFn = function dragStartFn() {
1451
+ pluginEvent('delayEnded', _this, {
1452
+ evt: evt
1453
+ });
1454
+
1455
+ if (Sortable.eventCanceled) {
1456
+ _this._onDrop();
1457
+
1458
+ return;
1459
+ } // Delayed drag has been triggered
1460
+ // we can re-enable the events: touchmove/mousemove
1461
+
1462
+
1463
+ _this._disableDelayedDragEvents();
1464
+
1465
+ if (!FireFox && _this.nativeDraggable) {
1466
+ dragEl.draggable = true;
1467
+ } // Bind the events: dragstart/dragend
1468
+
1469
+
1470
+ _this._triggerDragStart(evt, touch); // Drag start event
1471
+
1472
+
1473
+ _dispatchEvent({
1474
+ sortable: _this,
1475
+ name: 'choose',
1476
+ originalEvent: evt
1477
+ }); // Chosen item
1478
+
1479
+
1480
+ toggleClass(dragEl, options.chosenClass, true);
1481
+ }; // Disable "draggable"
1482
+
1483
+
1484
+ options.ignore.split(',').forEach(function (criteria) {
1485
+ find(dragEl, criteria.trim(), _disableDraggable);
1486
+ });
1487
+ on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);
1488
+ on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);
1489
+ on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);
1490
+ on(ownerDocument, 'mouseup', _this._onDrop);
1491
+ on(ownerDocument, 'touchend', _this._onDrop);
1492
+ on(ownerDocument, 'touchcancel', _this._onDrop); // Make dragEl draggable (must be before delay for FireFox)
1493
+
1494
+ if (FireFox && this.nativeDraggable) {
1495
+ this.options.touchStartThreshold = 4;
1496
+ dragEl.draggable = true;
1497
+ }
1498
+
1499
+ pluginEvent('delayStart', this, {
1500
+ evt: evt
1501
+ }); // Delay is impossible for native DnD in Edge or IE
1502
+
1503
+ if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {
1504
+ if (Sortable.eventCanceled) {
1505
+ this._onDrop();
1506
+
1507
+ return;
1508
+ } // If the user moves the pointer or let go the click or touch
1509
+ // before the delay has been reached:
1510
+ // disable the delayed drag
1511
+
1512
+
1513
+ on(ownerDocument, 'mouseup', _this._disableDelayedDrag);
1514
+ on(ownerDocument, 'touchend', _this._disableDelayedDrag);
1515
+ on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);
1516
+ on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);
1517
+ on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);
1518
+ options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);
1519
+ _this._dragStartTimer = setTimeout(dragStartFn, options.delay);
1520
+ } else {
1521
+ dragStartFn();
1522
+ }
1523
+ }
1524
+ },
1525
+ _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler(
1526
+ /** TouchEvent|PointerEvent **/
1527
+ e) {
1528
+ var touch = e.touches ? e.touches[0] : e;
1529
+
1530
+ 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))) {
1531
+ this._disableDelayedDrag();
1532
+ }
1533
+ },
1534
+ _disableDelayedDrag: function _disableDelayedDrag() {
1535
+ dragEl && _disableDraggable(dragEl);
1536
+ clearTimeout(this._dragStartTimer);
1537
+
1538
+ this._disableDelayedDragEvents();
1539
+ },
1540
+ _disableDelayedDragEvents: function _disableDelayedDragEvents() {
1541
+ var ownerDocument = this.el.ownerDocument;
1542
+ off(ownerDocument, 'mouseup', this._disableDelayedDrag);
1543
+ off(ownerDocument, 'touchend', this._disableDelayedDrag);
1544
+ off(ownerDocument, 'touchcancel', this._disableDelayedDrag);
1545
+ off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);
1546
+ off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);
1547
+ off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);
1548
+ },
1549
+ _triggerDragStart: function _triggerDragStart(
1550
+ /** Event */
1551
+ evt,
1552
+ /** Touch */
1553
+ touch) {
1554
+ touch = touch || evt.pointerType == 'touch' && evt;
1555
+
1556
+ if (!this.nativeDraggable || touch) {
1557
+ if (this.options.supportPointer) {
1558
+ on(document, 'pointermove', this._onTouchMove);
1559
+ } else if (touch) {
1560
+ on(document, 'touchmove', this._onTouchMove);
1561
+ } else {
1562
+ on(document, 'mousemove', this._onTouchMove);
1563
+ }
1564
+ } else {
1565
+ on(dragEl, 'dragend', this);
1566
+ on(rootEl, 'dragstart', this._onDragStart);
1567
+ }
1568
+
1569
+ try {
1570
+ if (document.selection) {
1571
+ // Timeout neccessary for IE9
1572
+ _nextTick(function () {
1573
+ document.selection.empty();
1574
+ });
1575
+ } else {
1576
+ window.getSelection().removeAllRanges();
1577
+ }
1578
+ } catch (err) {}
1579
+ },
1580
+ _dragStarted: function _dragStarted(fallback, evt) {
1581
+
1582
+ awaitingDragStarted = false;
1583
+
1584
+ if (rootEl && dragEl) {
1585
+ pluginEvent('dragStarted', this, {
1586
+ evt: evt
1587
+ });
1588
+
1589
+ if (this.nativeDraggable) {
1590
+ on(document, 'dragover', _checkOutsideTargetEl);
1591
+ }
1592
+
1593
+ var options = this.options; // Apply effect
1594
+
1595
+ !fallback && toggleClass(dragEl, options.dragClass, false);
1596
+ toggleClass(dragEl, options.ghostClass, true);
1597
+ Sortable.active = this;
1598
+ fallback && this._appendGhost(); // Drag start event
1599
+
1600
+ _dispatchEvent({
1601
+ sortable: this,
1602
+ name: 'start',
1603
+ originalEvent: evt
1604
+ });
1605
+ } else {
1606
+ this._nulling();
1607
+ }
1608
+ },
1609
+ _emulateDragOver: function _emulateDragOver() {
1610
+ if (touchEvt) {
1611
+ this._lastX = touchEvt.clientX;
1612
+ this._lastY = touchEvt.clientY;
1613
+
1614
+ _hideGhostForTarget();
1615
+
1616
+ var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
1617
+ var parent = target;
1618
+
1619
+ while (target && target.shadowRoot) {
1620
+ target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
1621
+ if (target === parent) break;
1622
+ parent = target;
1623
+ }
1624
+
1625
+ dragEl.parentNode[expando]._isOutsideThisEl(target);
1626
+
1627
+ if (parent) {
1628
+ do {
1629
+ if (parent[expando]) {
1630
+ var inserted = void 0;
1631
+ inserted = parent[expando]._onDragOver({
1632
+ clientX: touchEvt.clientX,
1633
+ clientY: touchEvt.clientY,
1634
+ target: target,
1635
+ rootEl: parent
1636
+ });
1637
+
1638
+ if (inserted && !this.options.dragoverBubble) {
1639
+ break;
1640
+ }
1641
+ }
1642
+
1643
+ target = parent; // store last element
1644
+ }
1645
+ /* jshint boss:true */
1646
+ while (parent = parent.parentNode);
1647
+ }
1648
+
1649
+ _unhideGhostForTarget();
1650
+ }
1651
+ },
1652
+ _onTouchMove: function _onTouchMove(
1653
+ /**TouchEvent*/
1654
+ evt) {
1655
+ if (tapEvt) {
1656
+ var options = this.options,
1657
+ fallbackTolerance = options.fallbackTolerance,
1658
+ fallbackOffset = options.fallbackOffset,
1659
+ touch = evt.touches ? evt.touches[0] : evt,
1660
+ ghostMatrix = ghostEl && matrix(ghostEl, true),
1661
+ scaleX = ghostEl && ghostMatrix && ghostMatrix.a,
1662
+ scaleY = ghostEl && ghostMatrix && ghostMatrix.d,
1663
+ relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),
1664
+ dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),
1665
+ dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1); // only set the status to dragging, when we are actually dragging
1666
+
1667
+ if (!Sortable.active && !awaitingDragStarted) {
1668
+ if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {
1669
+ return;
1670
+ }
1671
+
1672
+ this._onDragStart(evt, true);
1673
+ }
1674
+
1675
+ if (ghostEl) {
1676
+ if (ghostMatrix) {
1677
+ ghostMatrix.e += dx - (lastDx || 0);
1678
+ ghostMatrix.f += dy - (lastDy || 0);
1679
+ } else {
1680
+ ghostMatrix = {
1681
+ a: 1,
1682
+ b: 0,
1683
+ c: 0,
1684
+ d: 1,
1685
+ e: dx,
1686
+ f: dy
1687
+ };
1688
+ }
1689
+
1690
+ var cssMatrix = "matrix(".concat(ghostMatrix.a, ",").concat(ghostMatrix.b, ",").concat(ghostMatrix.c, ",").concat(ghostMatrix.d, ",").concat(ghostMatrix.e, ",").concat(ghostMatrix.f, ")");
1691
+ css(ghostEl, 'webkitTransform', cssMatrix);
1692
+ css(ghostEl, 'mozTransform', cssMatrix);
1693
+ css(ghostEl, 'msTransform', cssMatrix);
1694
+ css(ghostEl, 'transform', cssMatrix);
1695
+ lastDx = dx;
1696
+ lastDy = dy;
1697
+ touchEvt = touch;
1698
+ }
1699
+
1700
+ evt.cancelable && evt.preventDefault();
1701
+ }
1702
+ },
1703
+ _appendGhost: function _appendGhost() {
1704
+ // Bug if using scale(): https://stackoverflow.com/questions/2637058
1705
+ // Not being adjusted for
1706
+ if (!ghostEl) {
1707
+ var container = this.options.fallbackOnBody ? document.body : rootEl,
1708
+ rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),
1709
+ options = this.options; // Position absolutely
1710
+
1711
+ if (PositionGhostAbsolutely) {
1712
+ // Get relatively positioned parent
1713
+ ghostRelativeParent = container;
1714
+
1715
+ while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {
1716
+ ghostRelativeParent = ghostRelativeParent.parentNode;
1717
+ }
1718
+
1719
+ if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {
1720
+ if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();
1721
+ rect.top += ghostRelativeParent.scrollTop;
1722
+ rect.left += ghostRelativeParent.scrollLeft;
1723
+ } else {
1724
+ ghostRelativeParent = getWindowScrollingElement();
1725
+ }
1726
+
1727
+ ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);
1728
+ }
1729
+
1730
+ ghostEl = dragEl.cloneNode(true);
1731
+ toggleClass(ghostEl, options.ghostClass, false);
1732
+ toggleClass(ghostEl, options.fallbackClass, true);
1733
+ toggleClass(ghostEl, options.dragClass, true);
1734
+ css(ghostEl, 'transition', '');
1735
+ css(ghostEl, 'transform', '');
1736
+ css(ghostEl, 'box-sizing', 'border-box');
1737
+ css(ghostEl, 'margin', 0);
1738
+ css(ghostEl, 'top', rect.top);
1739
+ css(ghostEl, 'left', rect.left);
1740
+ css(ghostEl, 'width', rect.width);
1741
+ css(ghostEl, 'height', rect.height);
1742
+ css(ghostEl, 'opacity', '0.8');
1743
+ css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');
1744
+ css(ghostEl, 'zIndex', '100000');
1745
+ css(ghostEl, 'pointerEvents', 'none');
1746
+ Sortable.ghost = ghostEl;
1747
+ container.appendChild(ghostEl); // Set transform-origin
1748
+
1749
+ css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');
1750
+ }
1751
+ },
1752
+ _onDragStart: function _onDragStart(
1753
+ /**Event*/
1754
+ evt,
1755
+ /**boolean*/
1756
+ fallback) {
1757
+ var _this = this;
1758
+
1759
+ var dataTransfer = evt.dataTransfer;
1760
+ var options = _this.options;
1761
+ pluginEvent('dragStart', this, {
1762
+ evt: evt
1763
+ });
1764
+
1765
+ if (Sortable.eventCanceled) {
1766
+ this._onDrop();
1767
+
1768
+ return;
1769
+ }
1770
+
1771
+ pluginEvent('setupClone', this);
1772
+
1773
+ if (!Sortable.eventCanceled) {
1774
+ cloneEl = clone(dragEl);
1775
+ cloneEl.removeAttribute("id");
1776
+ cloneEl.draggable = false;
1777
+ cloneEl.style['will-change'] = '';
1778
+
1779
+ this._hideClone();
1780
+
1781
+ toggleClass(cloneEl, this.options.chosenClass, false);
1782
+ Sortable.clone = cloneEl;
1783
+ } // #1143: IFrame support workaround
1784
+
1785
+
1786
+ _this.cloneId = _nextTick(function () {
1787
+ pluginEvent('clone', _this);
1788
+ if (Sortable.eventCanceled) return;
1789
+
1790
+ if (!_this.options.removeCloneOnHide) {
1791
+ rootEl.insertBefore(cloneEl, dragEl);
1792
+ }
1793
+
1794
+ _this._hideClone();
1795
+
1796
+ _dispatchEvent({
1797
+ sortable: _this,
1798
+ name: 'clone'
1799
+ });
1800
+ });
1801
+ !fallback && toggleClass(dragEl, options.dragClass, true); // Set proper drop events
1802
+
1803
+ if (fallback) {
1804
+ ignoreNextClick = true;
1805
+ _this._loopId = setInterval(_this._emulateDragOver, 50);
1806
+ } else {
1807
+ // Undo what was set in _prepareDragStart before drag started
1808
+ off(document, 'mouseup', _this._onDrop);
1809
+ off(document, 'touchend', _this._onDrop);
1810
+ off(document, 'touchcancel', _this._onDrop);
1811
+
1812
+ if (dataTransfer) {
1813
+ dataTransfer.effectAllowed = 'move';
1814
+ options.setData && options.setData.call(_this, dataTransfer, dragEl);
1815
+ }
1816
+
1817
+ on(document, 'drop', _this); // #1276 fix:
1818
+
1819
+ css(dragEl, 'transform', 'translateZ(0)');
1820
+ }
1821
+
1822
+ awaitingDragStarted = true;
1823
+ _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));
1824
+ on(document, 'selectstart', _this);
1825
+ moved = true;
1826
+
1827
+ if (Safari) {
1828
+ css(document.body, 'user-select', 'none');
1829
+ }
1830
+ },
1831
+ // Returns true - if no further action is needed (either inserted or another condition)
1832
+ _onDragOver: function _onDragOver(
1833
+ /**Event*/
1834
+ evt) {
1835
+ var el = this.el,
1836
+ target = evt.target,
1837
+ dragRect,
1838
+ targetRect,
1839
+ revert,
1840
+ options = this.options,
1841
+ group = options.group,
1842
+ activeSortable = Sortable.active,
1843
+ isOwner = activeGroup === group,
1844
+ canSort = options.sort,
1845
+ fromSortable = putSortable || activeSortable,
1846
+ vertical,
1847
+ _this = this,
1848
+ completedFired = false;
1849
+
1850
+ if (_silent) return;
1851
+
1852
+ function dragOverEvent(name, extra) {
1853
+ pluginEvent(name, _this, _objectSpread2({
1854
+ evt: evt,
1855
+ isOwner: isOwner,
1856
+ axis: vertical ? 'vertical' : 'horizontal',
1857
+ revert: revert,
1858
+ dragRect: dragRect,
1859
+ targetRect: targetRect,
1860
+ canSort: canSort,
1861
+ fromSortable: fromSortable,
1862
+ target: target,
1863
+ completed: completed,
1864
+ onMove: function onMove(target, after) {
1865
+ return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);
1866
+ },
1867
+ changed: changed
1868
+ }, extra));
1869
+ } // Capture animation state
1870
+
1871
+
1872
+ function capture() {
1873
+ dragOverEvent('dragOverAnimationCapture');
1874
+
1875
+ _this.captureAnimationState();
1876
+
1877
+ if (_this !== fromSortable) {
1878
+ fromSortable.captureAnimationState();
1879
+ }
1880
+ } // Return invocation when dragEl is inserted (or completed)
1881
+
1882
+
1883
+ function completed(insertion) {
1884
+ dragOverEvent('dragOverCompleted', {
1885
+ insertion: insertion
1886
+ });
1887
+
1888
+ if (insertion) {
1889
+ // Clones must be hidden before folding animation to capture dragRectAbsolute properly
1890
+ if (isOwner) {
1891
+ activeSortable._hideClone();
1892
+ } else {
1893
+ activeSortable._showClone(_this);
1894
+ }
1895
+
1896
+ if (_this !== fromSortable) {
1897
+ // Set ghost class to new sortable's ghost class
1898
+ toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);
1899
+ toggleClass(dragEl, options.ghostClass, true);
1900
+ }
1901
+
1902
+ if (putSortable !== _this && _this !== Sortable.active) {
1903
+ putSortable = _this;
1904
+ } else if (_this === Sortable.active && putSortable) {
1905
+ putSortable = null;
1906
+ } // Animation
1907
+
1908
+
1909
+ if (fromSortable === _this) {
1910
+ _this._ignoreWhileAnimating = target;
1911
+ }
1912
+
1913
+ _this.animateAll(function () {
1914
+ dragOverEvent('dragOverAnimationComplete');
1915
+ _this._ignoreWhileAnimating = null;
1916
+ });
1917
+
1918
+ if (_this !== fromSortable) {
1919
+ fromSortable.animateAll();
1920
+ fromSortable._ignoreWhileAnimating = null;
1921
+ }
1922
+ } // Null lastTarget if it is not inside a previously swapped element
1923
+
1924
+
1925
+ if (target === dragEl && !dragEl.animated || target === el && !target.animated) {
1926
+ lastTarget = null;
1927
+ } // no bubbling and not fallback
1928
+
1929
+
1930
+ if (!options.dragoverBubble && !evt.rootEl && target !== document) {
1931
+ dragEl.parentNode[expando]._isOutsideThisEl(evt.target); // Do not detect for empty insert if already inserted
1932
+
1933
+
1934
+ !insertion && nearestEmptyInsertDetectEvent(evt);
1935
+ }
1936
+
1937
+ !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();
1938
+ return completedFired = true;
1939
+ } // Call when dragEl has been inserted
1940
+
1941
+
1942
+ function changed() {
1943
+ newIndex = index(dragEl);
1944
+ newDraggableIndex = index(dragEl, options.draggable);
1945
+
1946
+ _dispatchEvent({
1947
+ sortable: _this,
1948
+ name: 'change',
1949
+ toEl: el,
1950
+ newIndex: newIndex,
1951
+ newDraggableIndex: newDraggableIndex,
1952
+ originalEvent: evt
1953
+ });
1954
+ }
1955
+
1956
+ if (evt.preventDefault !== void 0) {
1957
+ evt.cancelable && evt.preventDefault();
1958
+ }
1959
+
1960
+ target = closest(target, options.draggable, el, true);
1961
+ dragOverEvent('dragOver');
1962
+ if (Sortable.eventCanceled) return completedFired;
1963
+
1964
+ if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {
1965
+ return completed(false);
1966
+ }
1967
+
1968
+ ignoreNextClick = false;
1969
+
1970
+ if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list
1971
+ : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {
1972
+ vertical = this._getDirection(evt, target) === 'vertical';
1973
+ dragRect = getRect(dragEl);
1974
+ dragOverEvent('dragOverValid');
1975
+ if (Sortable.eventCanceled) return completedFired;
1976
+
1977
+ if (revert) {
1978
+ parentEl = rootEl; // actualization
1979
+
1980
+ capture();
1981
+
1982
+ this._hideClone();
1983
+
1984
+ dragOverEvent('revert');
1985
+
1986
+ if (!Sortable.eventCanceled) {
1987
+ if (nextEl) {
1988
+ rootEl.insertBefore(dragEl, nextEl);
1989
+ } else {
1990
+ rootEl.appendChild(dragEl);
1991
+ }
1992
+ }
1993
+
1994
+ return completed(true);
1995
+ }
1996
+
1997
+ var elLastChild = lastChild(el, options.draggable);
1998
+
1999
+ if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {
2000
+ // Insert to end of list
2001
+ // If already at end of list: Do not insert
2002
+ if (elLastChild === dragEl) {
2003
+ return completed(false);
2004
+ } // if there is a last element, it is the target
2005
+
2006
+
2007
+ if (elLastChild && el === evt.target) {
2008
+ target = elLastChild;
2009
+ }
2010
+
2011
+ if (target) {
2012
+ targetRect = getRect(target);
2013
+ }
2014
+
2015
+ if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {
2016
+ capture();
2017
+
2018
+ if (elLastChild && elLastChild.nextSibling) {
2019
+ // the last draggable element is not the last node
2020
+ el.insertBefore(dragEl, elLastChild.nextSibling);
2021
+ } else {
2022
+ el.appendChild(dragEl);
2023
+ }
2024
+
2025
+ parentEl = el; // actualization
2026
+
2027
+ changed();
2028
+ return completed(true);
2029
+ }
2030
+ } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {
2031
+ // Insert to start of list
2032
+ var firstChild = getChild(el, 0, options, true);
2033
+
2034
+ if (firstChild === dragEl) {
2035
+ return completed(false);
2036
+ }
2037
+
2038
+ target = firstChild;
2039
+ targetRect = getRect(target);
2040
+
2041
+ if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {
2042
+ capture();
2043
+ el.insertBefore(dragEl, firstChild);
2044
+ parentEl = el; // actualization
2045
+
2046
+ changed();
2047
+ return completed(true);
2048
+ }
2049
+ } else if (target.parentNode === el) {
2050
+ targetRect = getRect(target);
2051
+ var direction = 0,
2052
+ targetBeforeFirstSwap,
2053
+ differentLevel = dragEl.parentNode !== el,
2054
+ differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),
2055
+ side1 = vertical ? 'top' : 'left',
2056
+ scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),
2057
+ scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;
2058
+
2059
+ if (lastTarget !== target) {
2060
+ targetBeforeFirstSwap = targetRect[side1];
2061
+ pastFirstInvertThresh = false;
2062
+ isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;
2063
+ }
2064
+
2065
+ direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);
2066
+ var sibling;
2067
+
2068
+ if (direction !== 0) {
2069
+ // Check if target is beside dragEl in respective direction (ignoring hidden elements)
2070
+ var dragIndex = index(dragEl);
2071
+
2072
+ do {
2073
+ dragIndex -= direction;
2074
+ sibling = parentEl.children[dragIndex];
2075
+ } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));
2076
+ } // If dragEl is already beside target: Do not insert
2077
+
2078
+
2079
+ if (direction === 0 || sibling === target) {
2080
+ return completed(false);
2081
+ }
2082
+
2083
+ lastTarget = target;
2084
+ lastDirection = direction;
2085
+ var nextSibling = target.nextElementSibling,
2086
+ after = false;
2087
+ after = direction === 1;
2088
+
2089
+ var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);
2090
+
2091
+ if (moveVector !== false) {
2092
+ if (moveVector === 1 || moveVector === -1) {
2093
+ after = moveVector === 1;
2094
+ }
2095
+
2096
+ _silent = true;
2097
+ setTimeout(_unsilent, 30);
2098
+ capture();
2099
+
2100
+ if (after && !nextSibling) {
2101
+ el.appendChild(dragEl);
2102
+ } else {
2103
+ target.parentNode.insertBefore(dragEl, after ? nextSibling : target);
2104
+ } // Undo chrome's scroll adjustment (has no effect on other browsers)
2105
+
2106
+
2107
+ if (scrolledPastTop) {
2108
+ scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);
2109
+ }
2110
+
2111
+ parentEl = dragEl.parentNode; // actualization
2112
+ // must be done before animation
2113
+
2114
+ if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {
2115
+ targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);
2116
+ }
2117
+
2118
+ changed();
2119
+ return completed(true);
2120
+ }
2121
+ }
2122
+
2123
+ if (el.contains(dragEl)) {
2124
+ return completed(false);
2125
+ }
2126
+ }
2127
+
2128
+ return false;
2129
+ },
2130
+ _ignoreWhileAnimating: null,
2131
+ _offMoveEvents: function _offMoveEvents() {
2132
+ off(document, 'mousemove', this._onTouchMove);
2133
+ off(document, 'touchmove', this._onTouchMove);
2134
+ off(document, 'pointermove', this._onTouchMove);
2135
+ off(document, 'dragover', nearestEmptyInsertDetectEvent);
2136
+ off(document, 'mousemove', nearestEmptyInsertDetectEvent);
2137
+ off(document, 'touchmove', nearestEmptyInsertDetectEvent);
2138
+ },
2139
+ _offUpEvents: function _offUpEvents() {
2140
+ var ownerDocument = this.el.ownerDocument;
2141
+ off(ownerDocument, 'mouseup', this._onDrop);
2142
+ off(ownerDocument, 'touchend', this._onDrop);
2143
+ off(ownerDocument, 'pointerup', this._onDrop);
2144
+ off(ownerDocument, 'touchcancel', this._onDrop);
2145
+ off(document, 'selectstart', this);
2146
+ },
2147
+ _onDrop: function _onDrop(
2148
+ /**Event*/
2149
+ evt) {
2150
+ var el = this.el,
2151
+ options = this.options; // Get the index of the dragged element within its parent
2152
+
2153
+ newIndex = index(dragEl);
2154
+ newDraggableIndex = index(dragEl, options.draggable);
2155
+ pluginEvent('drop', this, {
2156
+ evt: evt
2157
+ });
2158
+ parentEl = dragEl && dragEl.parentNode; // Get again after plugin event
2159
+
2160
+ newIndex = index(dragEl);
2161
+ newDraggableIndex = index(dragEl, options.draggable);
2162
+
2163
+ if (Sortable.eventCanceled) {
2164
+ this._nulling();
2165
+
2166
+ return;
2167
+ }
2168
+
2169
+ awaitingDragStarted = false;
2170
+ isCircumstantialInvert = false;
2171
+ pastFirstInvertThresh = false;
2172
+ clearInterval(this._loopId);
2173
+ clearTimeout(this._dragStartTimer);
2174
+
2175
+ _cancelNextTick(this.cloneId);
2176
+
2177
+ _cancelNextTick(this._dragStartId); // Unbind events
2178
+
2179
+
2180
+ if (this.nativeDraggable) {
2181
+ off(document, 'drop', this);
2182
+ off(el, 'dragstart', this._onDragStart);
2183
+ }
2184
+
2185
+ this._offMoveEvents();
2186
+
2187
+ this._offUpEvents();
2188
+
2189
+ if (Safari) {
2190
+ css(document.body, 'user-select', '');
2191
+ }
2192
+
2193
+ css(dragEl, 'transform', '');
2194
+
2195
+ if (evt) {
2196
+ if (moved) {
2197
+ evt.cancelable && evt.preventDefault();
2198
+ !options.dropBubble && evt.stopPropagation();
2199
+ }
2200
+
2201
+ ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);
2202
+
2203
+ if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {
2204
+ // Remove clone(s)
2205
+ cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);
2206
+ }
2207
+
2208
+ if (dragEl) {
2209
+ if (this.nativeDraggable) {
2210
+ off(dragEl, 'dragend', this);
2211
+ }
2212
+
2213
+ _disableDraggable(dragEl);
2214
+
2215
+ dragEl.style['will-change'] = ''; // Remove classes
2216
+ // ghostClass is added in dragStarted
2217
+
2218
+ if (moved && !awaitingDragStarted) {
2219
+ toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);
2220
+ }
2221
+
2222
+ toggleClass(dragEl, this.options.chosenClass, false); // Drag stop event
2223
+
2224
+ _dispatchEvent({
2225
+ sortable: this,
2226
+ name: 'unchoose',
2227
+ toEl: parentEl,
2228
+ newIndex: null,
2229
+ newDraggableIndex: null,
2230
+ originalEvent: evt
2231
+ });
2232
+
2233
+ if (rootEl !== parentEl) {
2234
+ if (newIndex >= 0) {
2235
+ // Add event
2236
+ _dispatchEvent({
2237
+ rootEl: parentEl,
2238
+ name: 'add',
2239
+ toEl: parentEl,
2240
+ fromEl: rootEl,
2241
+ originalEvent: evt
2242
+ }); // Remove event
2243
+
2244
+
2245
+ _dispatchEvent({
2246
+ sortable: this,
2247
+ name: 'remove',
2248
+ toEl: parentEl,
2249
+ originalEvent: evt
2250
+ }); // drag from one list and drop into another
2251
+
2252
+
2253
+ _dispatchEvent({
2254
+ rootEl: parentEl,
2255
+ name: 'sort',
2256
+ toEl: parentEl,
2257
+ fromEl: rootEl,
2258
+ originalEvent: evt
2259
+ });
2260
+
2261
+ _dispatchEvent({
2262
+ sortable: this,
2263
+ name: 'sort',
2264
+ toEl: parentEl,
2265
+ originalEvent: evt
2266
+ });
2267
+ }
2268
+
2269
+ putSortable && putSortable.save();
2270
+ } else {
2271
+ if (newIndex !== oldIndex) {
2272
+ if (newIndex >= 0) {
2273
+ // drag & drop within the same list
2274
+ _dispatchEvent({
2275
+ sortable: this,
2276
+ name: 'update',
2277
+ toEl: parentEl,
2278
+ originalEvent: evt
2279
+ });
2280
+
2281
+ _dispatchEvent({
2282
+ sortable: this,
2283
+ name: 'sort',
2284
+ toEl: parentEl,
2285
+ originalEvent: evt
2286
+ });
2287
+ }
2288
+ }
2289
+ }
2290
+
2291
+ if (Sortable.active) {
2292
+ /* jshint eqnull:true */
2293
+ if (newIndex == null || newIndex === -1) {
2294
+ newIndex = oldIndex;
2295
+ newDraggableIndex = oldDraggableIndex;
2296
+ }
2297
+
2298
+ _dispatchEvent({
2299
+ sortable: this,
2300
+ name: 'end',
2301
+ toEl: parentEl,
2302
+ originalEvent: evt
2303
+ }); // Save sorting
2304
+
2305
+
2306
+ this.save();
2307
+ }
2308
+ }
2309
+ }
2310
+
2311
+ this._nulling();
2312
+ },
2313
+ _nulling: function _nulling() {
2314
+ pluginEvent('nulling', this);
2315
+ 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;
2316
+ savedInputChecked.forEach(function (el) {
2317
+ el.checked = true;
2318
+ });
2319
+ savedInputChecked.length = lastDx = lastDy = 0;
2320
+ },
2321
+ handleEvent: function handleEvent(
2322
+ /**Event*/
2323
+ evt) {
2324
+ switch (evt.type) {
2325
+ case 'drop':
2326
+ case 'dragend':
2327
+ this._onDrop(evt);
2328
+
2329
+ break;
2330
+
2331
+ case 'dragenter':
2332
+ case 'dragover':
2333
+ if (dragEl) {
2334
+ this._onDragOver(evt);
2335
+
2336
+ _globalDragOver(evt);
2337
+ }
2338
+
2339
+ break;
2340
+
2341
+ case 'selectstart':
2342
+ evt.preventDefault();
2343
+ break;
2344
+ }
2345
+ },
2346
+
2347
+ /**
2348
+ * Serializes the item into an array of string.
2349
+ * @returns {String[]}
2350
+ */
2351
+ toArray: function toArray() {
2352
+ var order = [],
2353
+ el,
2354
+ children = this.el.children,
2355
+ i = 0,
2356
+ n = children.length,
2357
+ options = this.options;
2358
+
2359
+ for (; i < n; i++) {
2360
+ el = children[i];
2361
+
2362
+ if (closest(el, options.draggable, this.el, false)) {
2363
+ order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));
2364
+ }
2365
+ }
2366
+
2367
+ return order;
2368
+ },
2369
+
2370
+ /**
2371
+ * Sorts the elements according to the array.
2372
+ * @param {String[]} order order of the items
2373
+ */
2374
+ sort: function sort(order, useAnimation) {
2375
+ var items = {},
2376
+ rootEl = this.el;
2377
+ this.toArray().forEach(function (id, i) {
2378
+ var el = rootEl.children[i];
2379
+
2380
+ if (closest(el, this.options.draggable, rootEl, false)) {
2381
+ items[id] = el;
2382
+ }
2383
+ }, this);
2384
+ useAnimation && this.captureAnimationState();
2385
+ order.forEach(function (id) {
2386
+ if (items[id]) {
2387
+ rootEl.removeChild(items[id]);
2388
+ rootEl.appendChild(items[id]);
2389
+ }
2390
+ });
2391
+ useAnimation && this.animateAll();
2392
+ },
2393
+
2394
+ /**
2395
+ * Save the current sorting
2396
+ */
2397
+ save: function save() {
2398
+ var store = this.options.store;
2399
+ store && store.set && store.set(this);
2400
+ },
2401
+
2402
+ /**
2403
+ * 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.
2404
+ * @param {HTMLElement} el
2405
+ * @param {String} [selector] default: `options.draggable`
2406
+ * @returns {HTMLElement|null}
2407
+ */
2408
+ closest: function closest$1(el, selector) {
2409
+ return closest(el, selector || this.options.draggable, this.el, false);
2410
+ },
2411
+
2412
+ /**
2413
+ * Set/get option
2414
+ * @param {string} name
2415
+ * @param {*} [value]
2416
+ * @returns {*}
2417
+ */
2418
+ option: function option(name, value) {
2419
+ var options = this.options;
2420
+
2421
+ if (value === void 0) {
2422
+ return options[name];
2423
+ } else {
2424
+ var modifiedValue = PluginManager.modifyOption(this, name, value);
2425
+
2426
+ if (typeof modifiedValue !== 'undefined') {
2427
+ options[name] = modifiedValue;
2428
+ } else {
2429
+ options[name] = value;
2430
+ }
2431
+
2432
+ if (name === 'group') {
2433
+ _prepareGroup(options);
2434
+ }
2435
+ }
2436
+ },
2437
+
2438
+ /**
2439
+ * Destroy
2440
+ */
2441
+ destroy: function destroy() {
2442
+ pluginEvent('destroy', this);
2443
+ var el = this.el;
2444
+ el[expando] = null;
2445
+ off(el, 'mousedown', this._onTapStart);
2446
+ off(el, 'touchstart', this._onTapStart);
2447
+ off(el, 'pointerdown', this._onTapStart);
2448
+
2449
+ if (this.nativeDraggable) {
2450
+ off(el, 'dragover', this);
2451
+ off(el, 'dragenter', this);
2452
+ } // Remove draggable attributes
2453
+
2454
+
2455
+ Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {
2456
+ el.removeAttribute('draggable');
2457
+ });
2458
+
2459
+ this._onDrop();
2460
+
2461
+ this._disableDelayedDragEvents();
2462
+
2463
+ sortables.splice(sortables.indexOf(this.el), 1);
2464
+ this.el = el = null;
2465
+ },
2466
+ _hideClone: function _hideClone() {
2467
+ if (!cloneHidden) {
2468
+ pluginEvent('hideClone', this);
2469
+ if (Sortable.eventCanceled) return;
2470
+ css(cloneEl, 'display', 'none');
2471
+
2472
+ if (this.options.removeCloneOnHide && cloneEl.parentNode) {
2473
+ cloneEl.parentNode.removeChild(cloneEl);
2474
+ }
2475
+
2476
+ cloneHidden = true;
2477
+ }
2478
+ },
2479
+ _showClone: function _showClone(putSortable) {
2480
+ if (putSortable.lastPutMode !== 'clone') {
2481
+ this._hideClone();
2482
+
2483
+ return;
2484
+ }
2485
+
2486
+ if (cloneHidden) {
2487
+ pluginEvent('showClone', this);
2488
+ if (Sortable.eventCanceled) return; // show clone at dragEl or original position
2489
+
2490
+ if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {
2491
+ rootEl.insertBefore(cloneEl, dragEl);
2492
+ } else if (nextEl) {
2493
+ rootEl.insertBefore(cloneEl, nextEl);
2494
+ } else {
2495
+ rootEl.appendChild(cloneEl);
2496
+ }
2497
+
2498
+ if (this.options.group.revertClone) {
2499
+ this.animate(dragEl, cloneEl);
2500
+ }
2501
+
2502
+ css(cloneEl, 'display', '');
2503
+ cloneHidden = false;
2504
+ }
2505
+ }
2506
+ };
2507
+
2508
+ function _globalDragOver(
2509
+ /**Event*/
2510
+ evt) {
2511
+ if (evt.dataTransfer) {
2512
+ evt.dataTransfer.dropEffect = 'move';
2513
+ }
2514
+
2515
+ evt.cancelable && evt.preventDefault();
2516
+ }
2517
+
2518
+ function _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {
2519
+ var evt,
2520
+ sortable = fromEl[expando],
2521
+ onMoveFn = sortable.options.onMove,
2522
+ retVal; // Support for new CustomEvent feature
2523
+
2524
+ if (window.CustomEvent && !IE11OrLess && !Edge) {
2525
+ evt = new CustomEvent('move', {
2526
+ bubbles: true,
2527
+ cancelable: true
2528
+ });
2529
+ } else {
2530
+ evt = document.createEvent('Event');
2531
+ evt.initEvent('move', true, true);
2532
+ }
2533
+
2534
+ evt.to = toEl;
2535
+ evt.from = fromEl;
2536
+ evt.dragged = dragEl;
2537
+ evt.draggedRect = dragRect;
2538
+ evt.related = targetEl || toEl;
2539
+ evt.relatedRect = targetRect || getRect(toEl);
2540
+ evt.willInsertAfter = willInsertAfter;
2541
+ evt.originalEvent = originalEvent;
2542
+ fromEl.dispatchEvent(evt);
2543
+
2544
+ if (onMoveFn) {
2545
+ retVal = onMoveFn.call(sortable, evt, originalEvent);
2546
+ }
2547
+
2548
+ return retVal;
2549
+ }
2550
+
2551
+ function _disableDraggable(el) {
2552
+ el.draggable = false;
2553
+ }
2554
+
2555
+ function _unsilent() {
2556
+ _silent = false;
2557
+ }
2558
+
2559
+ function _ghostIsFirst(evt, vertical, sortable) {
2560
+ var rect = getRect(getChild(sortable.el, 0, sortable.options, true));
2561
+ var spacer = 10;
2562
+ return vertical ? evt.clientX < rect.left - spacer || evt.clientY < rect.top && evt.clientX < rect.right : evt.clientY < rect.top - spacer || evt.clientY < rect.bottom && evt.clientX < rect.left;
2563
+ }
2564
+
2565
+ function _ghostIsLast(evt, vertical, sortable) {
2566
+ var rect = getRect(lastChild(sortable.el, sortable.options.draggable));
2567
+ var spacer = 10;
2568
+ return vertical ? evt.clientX > rect.right + spacer || evt.clientX <= rect.right && evt.clientY > rect.bottom && evt.clientX >= rect.left : evt.clientX > rect.right && evt.clientY > rect.top || evt.clientX <= rect.right && evt.clientY > rect.bottom + spacer;
2569
+ }
2570
+
2571
+ function _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {
2572
+ var mouseOnAxis = vertical ? evt.clientY : evt.clientX,
2573
+ targetLength = vertical ? targetRect.height : targetRect.width,
2574
+ targetS1 = vertical ? targetRect.top : targetRect.left,
2575
+ targetS2 = vertical ? targetRect.bottom : targetRect.right,
2576
+ invert = false;
2577
+
2578
+ if (!invertSwap) {
2579
+ // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold
2580
+ if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {
2581
+ // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2
2582
+ // check if past first invert threshold on side opposite of lastDirection
2583
+ if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {
2584
+ // past first invert threshold, do not restrict inverted threshold to dragEl shadow
2585
+ pastFirstInvertThresh = true;
2586
+ }
2587
+
2588
+ if (!pastFirstInvertThresh) {
2589
+ // dragEl shadow (target move distance shadow)
2590
+ if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow
2591
+ : mouseOnAxis > targetS2 - targetMoveDistance) {
2592
+ return -lastDirection;
2593
+ }
2594
+ } else {
2595
+ invert = true;
2596
+ }
2597
+ } else {
2598
+ // Regular
2599
+ if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {
2600
+ return _getInsertDirection(target);
2601
+ }
2602
+ }
2603
+ }
2604
+
2605
+ invert = invert || invertSwap;
2606
+
2607
+ if (invert) {
2608
+ // Invert of regular
2609
+ if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {
2610
+ return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;
2611
+ }
2612
+ }
2613
+
2614
+ return 0;
2615
+ }
2616
+ /**
2617
+ * Gets the direction dragEl must be swapped relative to target in order to make it
2618
+ * seem that dragEl has been "inserted" into that element's position
2619
+ * @param {HTMLElement} target The target whose position dragEl is being inserted at
2620
+ * @return {Number} Direction dragEl must be swapped
2621
+ */
2622
+
2623
+
2624
+ function _getInsertDirection(target) {
2625
+ if (index(dragEl) < index(target)) {
2626
+ return 1;
2627
+ } else {
2628
+ return -1;
2629
+ }
2630
+ }
2631
+ /**
2632
+ * Generate id
2633
+ * @param {HTMLElement} el
2634
+ * @returns {String}
2635
+ * @private
2636
+ */
2637
+
2638
+
2639
+ function _generateId(el) {
2640
+ var str = el.tagName + el.className + el.src + el.href + el.textContent,
2641
+ i = str.length,
2642
+ sum = 0;
2643
+
2644
+ while (i--) {
2645
+ sum += str.charCodeAt(i);
2646
+ }
2647
+
2648
+ return sum.toString(36);
2649
+ }
2650
+
2651
+ function _saveInputCheckedState(root) {
2652
+ savedInputChecked.length = 0;
2653
+ var inputs = root.getElementsByTagName('input');
2654
+ var idx = inputs.length;
2655
+
2656
+ while (idx--) {
2657
+ var el = inputs[idx];
2658
+ el.checked && savedInputChecked.push(el);
2659
+ }
2660
+ }
2661
+
2662
+ function _nextTick(fn) {
2663
+ return setTimeout(fn, 0);
2664
+ }
2665
+
2666
+ function _cancelNextTick(id) {
2667
+ return clearTimeout(id);
2668
+ } // Fixed #973:
2669
+
2670
+
2671
+ if (documentExists) {
2672
+ on(document, 'touchmove', function (evt) {
2673
+ if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {
2674
+ evt.preventDefault();
2675
+ }
2676
+ });
2677
+ } // Export utils
2678
+
2679
+
2680
+ Sortable.utils = {
2681
+ on: on,
2682
+ off: off,
2683
+ css: css,
2684
+ find: find,
2685
+ is: function is(el, selector) {
2686
+ return !!closest(el, selector, el, false);
2687
+ },
2688
+ extend: extend,
2689
+ throttle: throttle,
2690
+ closest: closest,
2691
+ toggleClass: toggleClass,
2692
+ clone: clone,
2693
+ index: index,
2694
+ nextTick: _nextTick,
2695
+ cancelNextTick: _cancelNextTick,
2696
+ detectDirection: _detectDirection,
2697
+ getChild: getChild
2698
+ };
2699
+ /**
2700
+ * Get the Sortable instance of an element
2701
+ * @param {HTMLElement} element The element
2702
+ * @return {Sortable|undefined} The instance of Sortable
2703
+ */
2704
+
2705
+ Sortable.get = function (element) {
2706
+ return element[expando];
2707
+ };
2708
+ /**
2709
+ * Mount a plugin to Sortable
2710
+ * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted
2711
+ */
2712
+
2713
+
2714
+ Sortable.mount = function () {
2715
+ for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {
2716
+ plugins[_key] = arguments[_key];
2717
+ }
2718
+
2719
+ if (plugins[0].constructor === Array) plugins = plugins[0];
2720
+ plugins.forEach(function (plugin) {
2721
+ if (!plugin.prototype || !plugin.prototype.constructor) {
2722
+ throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(plugin));
2723
+ }
2724
+
2725
+ if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);
2726
+ PluginManager.mount(plugin);
2727
+ });
2728
+ };
2729
+ /**
2730
+ * Create sortable instance
2731
+ * @param {HTMLElement} el
2732
+ * @param {Object} [options]
2733
+ */
2734
+
2735
+
2736
+ Sortable.create = function (el, options) {
2737
+ return new Sortable(el, options);
2738
+ }; // Export
2739
+
2740
+
2741
+ Sortable.version = version;
2742
+
2743
+ var autoScrolls = [],
2744
+ scrollEl,
2745
+ scrollRootEl,
2746
+ scrolling = false,
2747
+ lastAutoScrollX,
2748
+ lastAutoScrollY,
2749
+ touchEvt$1,
2750
+ pointerElemChangedInterval;
2751
+
2752
+ function AutoScrollPlugin() {
2753
+ function AutoScroll() {
2754
+ this.defaults = {
2755
+ scroll: true,
2756
+ forceAutoScrollFallback: false,
2757
+ scrollSensitivity: 30,
2758
+ scrollSpeed: 10,
2759
+ bubbleScroll: true
2760
+ }; // Bind all private methods
2761
+
2762
+ for (var fn in this) {
2763
+ if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
2764
+ this[fn] = this[fn].bind(this);
2765
+ }
2766
+ }
2767
+ }
2768
+
2769
+ AutoScroll.prototype = {
2770
+ dragStarted: function dragStarted(_ref) {
2771
+ var originalEvent = _ref.originalEvent;
2772
+
2773
+ if (this.sortable.nativeDraggable) {
2774
+ on(document, 'dragover', this._handleAutoScroll);
2775
+ } else {
2776
+ if (this.options.supportPointer) {
2777
+ on(document, 'pointermove', this._handleFallbackAutoScroll);
2778
+ } else if (originalEvent.touches) {
2779
+ on(document, 'touchmove', this._handleFallbackAutoScroll);
2780
+ } else {
2781
+ on(document, 'mousemove', this._handleFallbackAutoScroll);
2782
+ }
2783
+ }
2784
+ },
2785
+ dragOverCompleted: function dragOverCompleted(_ref2) {
2786
+ var originalEvent = _ref2.originalEvent;
2787
+
2788
+ // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)
2789
+ if (!this.options.dragOverBubble && !originalEvent.rootEl) {
2790
+ this._handleAutoScroll(originalEvent);
2791
+ }
2792
+ },
2793
+ drop: function drop() {
2794
+ if (this.sortable.nativeDraggable) {
2795
+ off(document, 'dragover', this._handleAutoScroll);
2796
+ } else {
2797
+ off(document, 'pointermove', this._handleFallbackAutoScroll);
2798
+ off(document, 'touchmove', this._handleFallbackAutoScroll);
2799
+ off(document, 'mousemove', this._handleFallbackAutoScroll);
2800
+ }
2801
+
2802
+ clearPointerElemChangedInterval();
2803
+ clearAutoScrolls();
2804
+ cancelThrottle();
2805
+ },
2806
+ nulling: function nulling() {
2807
+ touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;
2808
+ autoScrolls.length = 0;
2809
+ },
2810
+ _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {
2811
+ this._handleAutoScroll(evt, true);
2812
+ },
2813
+ _handleAutoScroll: function _handleAutoScroll(evt, fallback) {
2814
+ var _this = this;
2815
+
2816
+ var x = (evt.touches ? evt.touches[0] : evt).clientX,
2817
+ y = (evt.touches ? evt.touches[0] : evt).clientY,
2818
+ elem = document.elementFromPoint(x, y);
2819
+ touchEvt$1 = evt; // IE does not seem to have native autoscroll,
2820
+ // Edge's autoscroll seems too conditional,
2821
+ // MACOS Safari does not have autoscroll,
2822
+ // Firefox and Chrome are good
2823
+
2824
+ if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {
2825
+ autoScroll(evt, this.options, elem, fallback); // Listener for pointer element change
2826
+
2827
+ var ogElemScroller = getParentAutoScrollElement(elem, true);
2828
+
2829
+ if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {
2830
+ pointerElemChangedInterval && clearPointerElemChangedInterval(); // Detect for pointer elem change, emulating native DnD behaviour
2831
+
2832
+ pointerElemChangedInterval = setInterval(function () {
2833
+ var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);
2834
+
2835
+ if (newElem !== ogElemScroller) {
2836
+ ogElemScroller = newElem;
2837
+ clearAutoScrolls();
2838
+ }
2839
+
2840
+ autoScroll(evt, _this.options, newElem, fallback);
2841
+ }, 10);
2842
+ lastAutoScrollX = x;
2843
+ lastAutoScrollY = y;
2844
+ }
2845
+ } else {
2846
+ // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll
2847
+ if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {
2848
+ clearAutoScrolls();
2849
+ return;
2850
+ }
2851
+
2852
+ autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);
2853
+ }
2854
+ }
2855
+ };
2856
+ return _extends(AutoScroll, {
2857
+ pluginName: 'scroll',
2858
+ initializeByDefault: true
2859
+ });
2860
+ }
2861
+
2862
+ function clearAutoScrolls() {
2863
+ autoScrolls.forEach(function (autoScroll) {
2864
+ clearInterval(autoScroll.pid);
2865
+ });
2866
+ autoScrolls = [];
2867
+ }
2868
+
2869
+ function clearPointerElemChangedInterval() {
2870
+ clearInterval(pointerElemChangedInterval);
2871
+ }
2872
+
2873
+ var autoScroll = throttle(function (evt, options, rootEl, isFallback) {
2874
+ // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521
2875
+ if (!options.scroll) return;
2876
+ var x = (evt.touches ? evt.touches[0] : evt).clientX,
2877
+ y = (evt.touches ? evt.touches[0] : evt).clientY,
2878
+ sens = options.scrollSensitivity,
2879
+ speed = options.scrollSpeed,
2880
+ winScroller = getWindowScrollingElement();
2881
+ var scrollThisInstance = false,
2882
+ scrollCustomFn; // New scroll root, set scrollEl
2883
+
2884
+ if (scrollRootEl !== rootEl) {
2885
+ scrollRootEl = rootEl;
2886
+ clearAutoScrolls();
2887
+ scrollEl = options.scroll;
2888
+ scrollCustomFn = options.scrollFn;
2889
+
2890
+ if (scrollEl === true) {
2891
+ scrollEl = getParentAutoScrollElement(rootEl, true);
2892
+ }
2893
+ }
2894
+
2895
+ var layersOut = 0;
2896
+ var currentParent = scrollEl;
2897
+
2898
+ do {
2899
+ var el = currentParent,
2900
+ rect = getRect(el),
2901
+ top = rect.top,
2902
+ bottom = rect.bottom,
2903
+ left = rect.left,
2904
+ right = rect.right,
2905
+ width = rect.width,
2906
+ height = rect.height,
2907
+ canScrollX = void 0,
2908
+ canScrollY = void 0,
2909
+ scrollWidth = el.scrollWidth,
2910
+ scrollHeight = el.scrollHeight,
2911
+ elCSS = css(el),
2912
+ scrollPosX = el.scrollLeft,
2913
+ scrollPosY = el.scrollTop;
2914
+
2915
+ if (el === winScroller) {
2916
+ canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');
2917
+ canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');
2918
+ } else {
2919
+ canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');
2920
+ canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');
2921
+ }
2922
+
2923
+ var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);
2924
+ var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);
2925
+
2926
+ if (!autoScrolls[layersOut]) {
2927
+ for (var i = 0; i <= layersOut; i++) {
2928
+ if (!autoScrolls[i]) {
2929
+ autoScrolls[i] = {};
2930
+ }
2931
+ }
2932
+ }
2933
+
2934
+ if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {
2935
+ autoScrolls[layersOut].el = el;
2936
+ autoScrolls[layersOut].vx = vx;
2937
+ autoScrolls[layersOut].vy = vy;
2938
+ clearInterval(autoScrolls[layersOut].pid);
2939
+
2940
+ if (vx != 0 || vy != 0) {
2941
+ scrollThisInstance = true;
2942
+ /* jshint loopfunc:true */
2943
+
2944
+ autoScrolls[layersOut].pid = setInterval(function () {
2945
+ // emulate drag over during autoscroll (fallback), emulating native DnD behaviour
2946
+ if (isFallback && this.layer === 0) {
2947
+ Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely
2948
+
2949
+ }
2950
+
2951
+ var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;
2952
+ var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;
2953
+
2954
+ if (typeof scrollCustomFn === 'function') {
2955
+ if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {
2956
+ return;
2957
+ }
2958
+ }
2959
+
2960
+ scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);
2961
+ }.bind({
2962
+ layer: layersOut
2963
+ }), 24);
2964
+ }
2965
+ }
2966
+
2967
+ layersOut++;
2968
+ } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));
2969
+
2970
+ scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not
2971
+ }, 30);
2972
+
2973
+ var drop = function drop(_ref) {
2974
+ var originalEvent = _ref.originalEvent,
2975
+ putSortable = _ref.putSortable,
2976
+ dragEl = _ref.dragEl,
2977
+ activeSortable = _ref.activeSortable,
2978
+ dispatchSortableEvent = _ref.dispatchSortableEvent,
2979
+ hideGhostForTarget = _ref.hideGhostForTarget,
2980
+ unhideGhostForTarget = _ref.unhideGhostForTarget;
2981
+ if (!originalEvent) return;
2982
+ var toSortable = putSortable || activeSortable;
2983
+ hideGhostForTarget();
2984
+ var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;
2985
+ var target = document.elementFromPoint(touch.clientX, touch.clientY);
2986
+ unhideGhostForTarget();
2987
+
2988
+ if (toSortable && !toSortable.el.contains(target)) {
2989
+ dispatchSortableEvent('spill');
2990
+ this.onSpill({
2991
+ dragEl: dragEl,
2992
+ putSortable: putSortable
2993
+ });
2994
+ }
2995
+ };
2996
+
2997
+ function Revert() {}
2998
+
2999
+ Revert.prototype = {
3000
+ startIndex: null,
3001
+ dragStart: function dragStart(_ref2) {
3002
+ var oldDraggableIndex = _ref2.oldDraggableIndex;
3003
+ this.startIndex = oldDraggableIndex;
3004
+ },
3005
+ onSpill: function onSpill(_ref3) {
3006
+ var dragEl = _ref3.dragEl,
3007
+ putSortable = _ref3.putSortable;
3008
+ this.sortable.captureAnimationState();
3009
+
3010
+ if (putSortable) {
3011
+ putSortable.captureAnimationState();
3012
+ }
3013
+
3014
+ var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);
3015
+
3016
+ if (nextSibling) {
3017
+ this.sortable.el.insertBefore(dragEl, nextSibling);
3018
+ } else {
3019
+ this.sortable.el.appendChild(dragEl);
3020
+ }
3021
+
3022
+ this.sortable.animateAll();
3023
+
3024
+ if (putSortable) {
3025
+ putSortable.animateAll();
3026
+ }
3027
+ },
3028
+ drop: drop
3029
+ };
3030
+
3031
+ _extends(Revert, {
3032
+ pluginName: 'revertOnSpill'
3033
+ });
3034
+
3035
+ function Remove() {}
3036
+
3037
+ Remove.prototype = {
3038
+ onSpill: function onSpill(_ref4) {
3039
+ var dragEl = _ref4.dragEl,
3040
+ putSortable = _ref4.putSortable;
3041
+ var parentSortable = putSortable || this.sortable;
3042
+ parentSortable.captureAnimationState();
3043
+ dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);
3044
+ parentSortable.animateAll();
3045
+ },
3046
+ drop: drop
3047
+ };
3048
+
3049
+ _extends(Remove, {
3050
+ pluginName: 'removeOnSpill'
3051
+ });
3052
+
3053
+ Sortable.mount(new AutoScrollPlugin());
3054
+ Sortable.mount(Remove, Revert);
3055
+
3056
+ const swirlOptionListCss = ".sc-swirl-option-list-h{display:block}.sc-swirl-option-list-h *.sc-swirl-option-list{box-sizing:border-box}";
3057
+
3058
+ const SwirlOptionList = class {
3059
+ constructor(hostRef) {
3060
+ registerInstance(this, hostRef);
3061
+ this.itemDrop = createEvent(this, "itemDrop", 7);
3062
+ this.valueChange = createEvent(this, "valueChange", 7);
3063
+ this.onFocus = async () => {
3064
+ // prevent focus from canceling the drag event in Safari
3065
+ await new Promise((resolve) => setTimeout(resolve));
3066
+ if (Boolean(this.focusedItem)) {
3067
+ this.focusItem(this.getActiveItemIndex());
3068
+ }
3069
+ else {
3070
+ this.focusItem(0);
3071
+ }
3072
+ };
3073
+ this.onClick = (event) => {
3074
+ event.preventDefault();
3075
+ const target = event.target;
3076
+ const item = target === null || target === void 0 ? void 0 : target.closest("swirl-option-list-item");
3077
+ const composedTarget = event.composedPath()[0];
3078
+ const clickedOption = Boolean(closestPassShadow(composedTarget, '[role="option"]'));
3079
+ if (!Boolean(item) || !clickedOption) {
3080
+ event.preventDefault();
3081
+ return;
3082
+ }
3083
+ this.selectItem(this.items.findIndex((i) => i.value === item.value));
3084
+ };
3085
+ this.onKeyDown = (event) => {
3086
+ if (event.code === "ArrowDown") {
3087
+ event.preventDefault();
3088
+ if (!Boolean(this.dragging)) {
3089
+ this.focusNextItem();
3090
+ }
3091
+ else {
3092
+ this.moveDraggedItemDown();
3093
+ }
3094
+ }
3095
+ else if (event.code === "ArrowUp") {
3096
+ event.preventDefault();
3097
+ if (!Boolean(this.dragging)) {
3098
+ this.focusPreviousItem();
3099
+ }
3100
+ else {
3101
+ this.moveDraggedItemUp();
3102
+ }
3103
+ }
3104
+ else if (event.code === "Space" || event.code === "Enter") {
3105
+ const target = event.composedPath()[0];
3106
+ const optionFocused = Boolean(closestPassShadow(target, '[role="option"]'));
3107
+ if (!optionFocused) {
3108
+ return;
3109
+ }
3110
+ event.preventDefault();
3111
+ if (Boolean(this.dragging)) {
3112
+ this.stopDrag(this.dragging);
3113
+ }
3114
+ else {
3115
+ this.selectFocusedItem();
3116
+ }
3117
+ }
3118
+ else if (event.code === "Home") {
3119
+ event.preventDefault();
3120
+ this.focusItem(0);
3121
+ }
3122
+ else if (event.code === "End") {
3123
+ event.preventDefault();
3124
+ this.focusItem(this.items.length - 1);
3125
+ }
3126
+ else if (event.code === "KeyA" &&
3127
+ (event.metaKey || event.ctrlKey) &&
3128
+ this.multiSelect) {
3129
+ event.preventDefault();
3130
+ this.selectAllItems();
3131
+ }
3132
+ else if (event.code === "Tab") {
3133
+ if (Boolean(this.dragging)) {
3134
+ event.preventDefault();
3135
+ }
3136
+ }
3137
+ };
3138
+ this.toggleDrag = (event) => {
3139
+ const item = event.detail;
3140
+ if (Boolean(this.dragging)) {
3141
+ this.stopDrag(item);
3142
+ }
3143
+ else {
3144
+ this.startDrag(item);
3145
+ }
3146
+ };
3147
+ this.startDrag = (item) => {
3148
+ this.dragging = item;
3149
+ this.draggingStartIndex = this.getItemIndex(this.dragging);
3150
+ item.setAttribute("dragging", "true");
3151
+ const index = this.getItemIndex(this.dragging);
3152
+ this.focusItem(index);
3153
+ this.assistiveText = this.assistiveTextItemGrabbed;
3154
+ };
3155
+ this.stopDrag = (item) => {
3156
+ this.dragging = undefined;
3157
+ item.removeAttribute("dragging");
3158
+ const newIndex = this.getActiveItemIndex();
3159
+ this.assistiveText = `${this.assistiveTextItemMoved} ${newIndex + 1}`;
3160
+ this.itemDrop.emit({ oldIndex: this.draggingStartIndex, newIndex });
3161
+ this.draggingStartIndex = undefined;
3162
+ };
3163
+ this.allowDrag = undefined;
3164
+ this.assistiveTextItemGrabbed = "Item grabbed. Use arrow keys to move item up or down. Use spacebar to save position.";
3165
+ this.assistiveTextItemMoving = "Current position:";
3166
+ this.assistiveTextItemMoved = "Item moved. New position:";
3167
+ this.disabled = undefined;
3168
+ this.label = undefined;
3169
+ this.optionListId = undefined;
3170
+ this.multiSelect = undefined;
3171
+ this.value = [];
3172
+ this.assistiveText = undefined;
3173
+ }
3174
+ componentDidLoad() {
3175
+ this.updateItems();
3176
+ this.observeSlotChanges();
3177
+ this.setItemAllowDragState();
3178
+ this.setItemDisabledState();
3179
+ this.setItemContext();
3180
+ this.syncItemsWithValue();
3181
+ this.setupDragDrop();
3182
+ }
3183
+ disconnectedCallback() {
3184
+ var _a, _b;
3185
+ (_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
3186
+ (_b = this.sortable) === null || _b === void 0 ? void 0 : _b.destroy();
3187
+ }
3188
+ watchAllowDrag() {
3189
+ this.setItemAllowDragState();
3190
+ this.setupDragDrop();
3191
+ }
3192
+ watchDisabled() {
3193
+ this.setItemDisabledState();
3194
+ }
3195
+ watchMultiSelect() {
3196
+ this.setItemContext();
3197
+ }
3198
+ watchValue() {
3199
+ this.syncItemsWithValue();
3200
+ }
3201
+ observeSlotChanges() {
3202
+ this.observer = new MutationObserver(() => {
3203
+ this.updateItems();
3204
+ });
3205
+ this.observer.observe(this.listboxEl, { childList: true });
3206
+ }
3207
+ updateItems() {
3208
+ this.items = querySelectorAllDeep(this.el, "swirl-option-list-item");
3209
+ }
3210
+ setItemDisabledState() {
3211
+ this.items.forEach((item) => (item.disabled = this.disabled));
3212
+ }
3213
+ setItemContext() {
3214
+ if (this.multiSelect) {
3215
+ this.items.forEach((item) => (item.context = "multi-select"));
3216
+ }
3217
+ else {
3218
+ this.items.forEach((item) => (item.context = "single-select"));
3219
+ if (this.value.length > 1) {
3220
+ this.updateValue([this.value[0]]);
3221
+ }
3222
+ }
3223
+ }
3224
+ setupDragDrop() {
3225
+ if (Boolean(this.sortable)) {
3226
+ this.sortable.destroy();
3227
+ }
3228
+ if (!this.allowDrag) {
3229
+ return;
3230
+ }
3231
+ this.sortable = Sortable.create(this.listboxEl, {
3232
+ animation: 150,
3233
+ draggable: "swirl-option-list-item",
3234
+ handle: ".option-list-item__drag-handle",
3235
+ onEnd: (event) => {
3236
+ this.itemDrop.emit({
3237
+ oldIndex: event.oldIndex,
3238
+ newIndex: event.newIndex,
3239
+ });
3240
+ },
3241
+ });
3242
+ }
3243
+ setItemAllowDragState() {
3244
+ if (this.allowDrag && !this.multiSelect) {
3245
+ console.error("[SwirlOptionList] Drag can only be allowed for multi select lists.");
3246
+ return;
3247
+ }
3248
+ const sections = querySelectorAllDeep(this.el, "swirl-option-list-section");
3249
+ if (this.allowDrag && sections.length > 0) {
3250
+ console.error("[SwirlOptionList] Drag can only be allowed for lists without sections.");
3251
+ return;
3252
+ }
3253
+ if (this.allowDrag) {
3254
+ this.items.forEach((item) => {
3255
+ item.setAttribute("allow-drag", "true");
3256
+ item.addEventListener("toggleDrag", this.toggleDrag);
3257
+ });
3258
+ }
3259
+ else {
3260
+ this.items.forEach((item) => {
3261
+ item.removeAttribute("allow-drag");
3262
+ item.removeEventListener("toggleDrag", this.toggleDrag);
3263
+ });
3264
+ }
3265
+ }
3266
+ selectItem(index) {
3267
+ if (this.disabled) {
3268
+ return;
3269
+ }
3270
+ const item = this.items[index];
3271
+ if (item.disabled) {
3272
+ return;
3273
+ }
3274
+ const itemIsAlreadySelected = this.value.includes(item.value);
3275
+ if (!this.multiSelect) {
3276
+ this.value = [];
3277
+ }
3278
+ if (!itemIsAlreadySelected) {
3279
+ this.updateValue([...this.value, item.value]);
3280
+ }
3281
+ else {
3282
+ this.updateValue(this.value.filter((v) => v !== item.value));
3283
+ }
3284
+ }
3285
+ updateValue(value) {
3286
+ this.value = value;
3287
+ this.valueChange.emit(this.value);
3288
+ }
3289
+ selectFocusedItem() {
3290
+ if (this.disabled || this.getActiveItemIndex() === -1) {
3291
+ return;
3292
+ }
3293
+ this.selectItem(this.getActiveItemIndex());
3294
+ }
3295
+ selectAllItems() {
3296
+ if (this.disabled) {
3297
+ return;
3298
+ }
3299
+ const alreadySelected = this.items.every((item) => this.value.includes(item.value));
3300
+ if (alreadySelected) {
3301
+ this.updateValue([]);
3302
+ }
3303
+ else {
3304
+ this.updateValue(this.items.map((item) => item.value));
3305
+ }
3306
+ }
3307
+ syncItemsWithValue() {
3308
+ this.items.forEach((item) => (item.selected = this.value.includes(item.value)));
3309
+ }
3310
+ focusItem(index) {
3311
+ var _a;
3312
+ if (this.disabled) {
3313
+ return;
3314
+ }
3315
+ this.items.forEach((item) => item.querySelector('[role="option"]').removeAttribute("tabIndex"));
3316
+ const item = (_a = this.items[index]) === null || _a === void 0 ? void 0 : _a.querySelector('[role="option"]');
3317
+ if (!Boolean(item)) {
3318
+ return;
3319
+ }
3320
+ item.setAttribute("tabIndex", "0");
3321
+ item.focus();
3322
+ this.focusedItem = item;
3323
+ }
3324
+ focusNextItem() {
3325
+ if (this.disabled) {
3326
+ return;
3327
+ }
3328
+ const activeItemIndex = this.getActiveItemIndex();
3329
+ const newIndex = Math.min(activeItemIndex + 1, this.items.length - 1);
3330
+ this.focusItem(newIndex);
3331
+ }
3332
+ focusPreviousItem() {
3333
+ const activeItemIndex = this.getActiveItemIndex();
3334
+ const newIndex = Math.max(activeItemIndex - 1, 0);
3335
+ this.focusItem(newIndex);
3336
+ }
3337
+ getActiveItemIndex() {
3338
+ return this.items
3339
+ .map((item) => item.querySelector('[role="option"]'))
3340
+ .findIndex((item) => item === this.focusedItem);
3341
+ }
3342
+ getItemIndex(item) {
3343
+ return this.items.map((i) => i).findIndex((i) => i === item);
3344
+ }
3345
+ moveDraggedItemDown() {
3346
+ const nextSibling = this.dragging.nextElementSibling;
3347
+ if (!Boolean(nextSibling)) {
3348
+ return;
3349
+ }
3350
+ nextSibling.after(this.dragging);
3351
+ this.updateItems();
3352
+ this.listboxEl.focus();
3353
+ this.assistiveText = `${this.assistiveTextItemMoving} ${this.getActiveItemIndex() + 1}`;
3354
+ }
3355
+ moveDraggedItemUp() {
3356
+ const prevSibling = this.dragging.previousElementSibling;
3357
+ if (!Boolean(prevSibling)) {
3358
+ return;
3359
+ }
3360
+ prevSibling.before(this.dragging);
3361
+ this.updateItems();
3362
+ this.listboxEl.focus();
3363
+ this.assistiveText = `${this.assistiveTextItemMoving} ${this.getItemIndex(this.dragging) + 1}`;
3364
+ }
3365
+ render() {
3366
+ const ariaMultiselectable = this.multiSelect ? "true" : undefined;
3367
+ const tabIndex = this.disabled ? -1 : 0;
3368
+ return (h(Host, null, h("swirl-visually-hidden", { role: "alert" }, this.assistiveText), h("div", { "aria-label": this.label, "aria-multiselectable": ariaMultiselectable, class: "option-list", id: this.optionListId, onClick: this.onClick, onFocus: this.onFocus, onKeyDown: this.onKeyDown, ref: (el) => (this.listboxEl = el), role: "listbox", tabIndex: tabIndex }, h("slot", null))));
3369
+ }
3370
+ get el() { return getElement(this); }
3371
+ static get watchers() { return {
3372
+ "allowDrag": ["watchAllowDrag"],
3373
+ "disabled": ["watchDisabled"],
3374
+ "multiSelect": ["watchMultiSelect"],
3375
+ "value": ["watchValue"]
3376
+ }; }
3377
+ };
3378
+ SwirlOptionList.style = swirlOptionListCss;
3379
+
3380
+ const swirlOptionListItemCss = ".sc-swirl-option-list-item-h{position:relative;display:inline-flex;width:100%}.sc-swirl-option-list-item-h *.sc-swirl-option-list-item{box-sizing:border-box}.option-list-item.sc-swirl-option-list-item{display:inline-flex;width:100%;min-height:3rem;padding:var(--s-space-12) var(--s-space-16);align-items:center;background-color:var(--s-surface-overlay-default);cursor:pointer;gap:var(--s-space-12)}.option-list-item.sc-swirl-option-list-item:hover:not(.option-list-item--disabled){background-color:var(--s-surface-overlay-hovered)}.option-list-item.sc-swirl-option-list-item:active:not(.option-list-item--disabled){background-color:var(--s-surface-overlay-pressed)}.option-list-item.sc-swirl-option-list-item:focus{outline:none}.option-list-item.sc-swirl-option-list-item:focus-visible{background-color:var(--s-surface-overlay-hovered)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.option-list-item.sc-swirl-option-list-item{min-height:0;padding:var(--s-space-12);gap:var(--s-space-8)}}.option-list-item--draggable.sc-swirl-option-list-item .option-list-item__label.sc-swirl-option-list-item{padding-right:calc(var(--s-space-16) + 1.5rem)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.option-list-item--draggable.sc-swirl-option-list-item .option-list-item__label.sc-swirl-option-list-item{padding-right:calc(var(--s-space-16) + 1rem)}}.option-list-item--dragging.sc-swirl-option-list-item{z-index:1;border-radius:var(--s-border-radius-s);background-color:var(--s-surface-overlay-pressed);box-shadow:0 0.0625rem 0.125rem rgba(25, 26, 28, 0.08),\n 0 0.25rem 2rem rgba(25, 26, 28, 0.16)}.option-list-item--dragging.sc-swirl-option-list-item:hover:not(.option-list-item--disabled){background-color:var(--s-surface-overlay-pressed)}.option-list-item--selected.sc-swirl-option-list-item .option-list-item__label.sc-swirl-option-list-item{color:var(--s-text-highlight)}.option-list-item--selected.sc-swirl-option-list-item .option-list-item__icon.sc-swirl-option-list-item{color:var(--s-icon-highlight)}.option-list-item--selected.sc-swirl-option-list-item .option-list-item__checkbox-box.sc-swirl-option-list-item{border-color:var(--s-icon-highlight);color:var(--s-text-on-status);background-color:var(--s-icon-highlight)}.option-list-item--disabled.sc-swirl-option-list-item{cursor:default}.option-list-item--disabled.option-list-item--selected.sc-swirl-option-list-item .option-list-item__checkbox-box.sc-swirl-option-list-item{background-color:var(--s-icon-disabled)}.option-list-item--disabled.option-list-item--selected.sc-swirl-option-list-item .option-list-item__checkbox-icon.sc-swirl-option-list-item{color:var(--s-text-on-status)}.option-list-item--disabled.sc-swirl-option-list-item .option-list-item__label.sc-swirl-option-list-item{color:var(--s-text-disabled)}.option-list-item--disabled.sc-swirl-option-list-item .option-list-item__icon.sc-swirl-option-list-item,.option-list-item--disabled.sc-swirl-option-list-item .option-list-item__selection-icon.sc-swirl-option-list-item,.option-list-item--disabled.sc-swirl-option-list-item .option-list-item__checkbox-icon.sc-swirl-option-list-item{color:var(--s-icon-disabled)}.option-list-item--disabled.sc-swirl-option-list-item .option-list-item__checkbox-box.sc-swirl-option-list-item{border-color:var(--s-icon-disabled);background-color:var(--s-surface-overlay-default)}.option-list-item__label.sc-swirl-option-list-item{flex-grow:1;color:var(--s-text-default);font-size:var(--s-font-size-base);font-weight:var(--s-font-weight-medium);line-height:var(--s-line-height-base);text-align:left}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.option-list-item__label.sc-swirl-option-list-item{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.option-list-item__icon.sc-swirl-option-list-item{display:inline-flex;flex-shrink:0;color:var(--s-icon-default)}.option-list-item__selection-icon.sc-swirl-option-list-item{display:inline-flex;flex-shrink:0;color:var(--s-icon-highlight)}.option-list-item__checkbox.sc-swirl-option-list-item{display:inline-flex;width:1.5rem;height:1.5rem;padding:var(--s-space-2)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.option-list-item__checkbox.sc-swirl-option-list-item{width:1.375rem;height:1.375rem}}.option-list-item__checkbox-box.sc-swirl-option-list-item{display:inline-flex;width:100%;height:100%;justify-content:center;align-items:center;border:0.125rem solid var(--s-icon-default);border-radius:var(--s-border-radius-s)}.option-list-item__checkbox-icon.sc-swirl-option-list-item{display:inline-flex}.option-list-item__drag-handle.sc-swirl-option-list-item{position:absolute;z-index:1;top:50%;right:var(--s-space-4);display:inline-flex;margin:0;padding:0;padding:var(--s-space-8);flex-shrink:0;border:none;color:var(--s-icon-default);background-color:transparent;cursor:-webkit-grab;cursor:grab;transform:translateY(-50%)}.option-list-item__drag-handle.sc-swirl-option-list-item:active{cursor:-webkit-grabbing;cursor:grabbing}.option-list-item__drag-handle.sc-swirl-option-list-item:focus:not(:focus-visible){outline:none}.option-list-item__drag-handle.sc-swirl-option-list-item:focus-visible{outline-color:var(--s-focus-default)}";
3381
+
3382
+ const SwirlOptionListItem = class {
3383
+ constructor(hostRef) {
3384
+ registerInstance(this, hostRef);
3385
+ this.toggleDrag = createEvent(this, "toggleDrag", 7);
3386
+ this.desktopMediaQuery = getDesktopMediaQuery();
3387
+ this.desktopMediaQueryHandler = (event) => {
3388
+ this.forceIconProps(event.matches);
3389
+ this.updateIconSize(event.matches);
3390
+ };
3391
+ this.onDragHandleKeyDown = (event) => {
3392
+ if (event.code === "Space" || event.code === "Enter") {
3393
+ event.preventDefault();
3394
+ this.toggleDrag.emit(this.el);
3395
+ }
3396
+ };
3397
+ this.allowDrag = undefined;
3398
+ this.context = "single-select";
3399
+ this.disabled = undefined;
3400
+ this.dragging = undefined;
3401
+ this.dragHandleDescription = "Press spacebar to toggle grab";
3402
+ this.dragHandleLabel = "Move option";
3403
+ this.icon = undefined;
3404
+ this.label = undefined;
3405
+ this.selected = false;
3406
+ this.value = undefined;
3407
+ this.iconSize = 24;
3408
+ }
3409
+ componentDidLoad() {
3410
+ var _a, _b;
3411
+ this.forceIconProps(this.desktopMediaQuery.matches);
3412
+ this.updateIconSize(this.desktopMediaQuery.matches);
3413
+ (_b = (_a = this.desktopMediaQuery).addEventListener) === null || _b === void 0 ? void 0 : _b.call(_a, "change", this.desktopMediaQueryHandler);
3414
+ }
3415
+ disconnectedCallback() {
3416
+ var _a, _b;
3417
+ (_b = (_a = this.desktopMediaQuery).removeEventListener) === null || _b === void 0 ? void 0 : _b.call(_a, "change", this.desktopMediaQueryHandler);
3418
+ }
3419
+ forceIconProps(smallIcon) {
3420
+ var _a;
3421
+ const icon = (_a = this.iconEl) === null || _a === void 0 ? void 0 : _a.children[0];
3422
+ icon === null || icon === void 0 ? void 0 : icon.setAttribute("size", smallIcon ? "20" : "24");
3423
+ }
3424
+ updateIconSize(smallIcon) {
3425
+ this.iconSize = smallIcon ? 20 : 24;
3426
+ }
3427
+ render() {
3428
+ const ariaDisabled = this.disabled ? "true" : undefined;
3429
+ const ariaSelected = String(this.selected);
3430
+ const showCheckbox = this.context === "multi-select";
3431
+ const showIcon = Boolean(this.icon) && this.context === "single-select";
3432
+ const showSelectionIcon = this.selected && this.context === "single-select";
3433
+ const className = classnames("option-list-item", `option-list-item--context-${this.context}`, {
3434
+ "option-list-item--disabled": this.disabled,
3435
+ "option-list-item--draggable": this.allowDrag,
3436
+ "option-list-item--dragging": this.dragging,
3437
+ "option-list-item--selected": this.selected,
3438
+ });
3439
+ return (h(Host, null, h("div", { "aria-disabled": ariaDisabled, "aria-selected": ariaSelected, class: className, part: "option-list-item", role: "option" }, showIcon && (h("span", { class: "option-list-item__icon", innerHTML: this.icon, ref: (el) => (this.iconEl = el) })), showCheckbox && (h("span", { class: "option-list-item__checkbox" }, h("span", { class: "option-list-item__checkbox-box" }, this.selected && (h("swirl-icon-check-strong", { class: "option-list-item__checkbox-icon", size: 16 }))))), h("span", { class: "option-list-item__label", part: "option-list-item__label" }, this.label), showSelectionIcon && (h("span", { class: "option-list-item__selection-icon" }, h("swirl-icon-check-small", { size: this.iconSize })))), this.allowDrag && (h("button", { "aria-describedby": this.dragHandleDescription, "aria-label": `${this.dragHandleLabel} "${this.label}"`, class: "option-list-item__drag-handle", onKeyDown: this.onDragHandleKeyDown, type: "button" }, h("swirl-icon-drag-handle", { size: this.iconSize })))));
3440
+ }
3441
+ get el() { return getElement(this); }
3442
+ };
3443
+ SwirlOptionListItem.style = swirlOptionListItemCss;
3444
+
3445
+ export { SwirlIconCheckSmall as swirl_icon_check_small, SwirlIconDragHandle as swirl_icon_drag_handle, SwirlOptionList as swirl_option_list, SwirlOptionListItem as swirl_option_list_item };