genesys-spark-components 4.22.0 → 4.23.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.
- package/dist/cjs/genesys-webcomponents.cjs.js +1 -1
- package/dist/cjs/gux-accordion.cjs.entry.js +1 -1
- package/dist/cjs/gux-action-button.cjs.entry.js +1 -1
- package/dist/cjs/gux-action-toast-legacy.cjs.entry.js +1 -1
- package/dist/cjs/gux-advanced-dropdown-legacy.cjs.entry.js +1 -1
- package/dist/cjs/gux-announce-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-avatar-beta.cjs.entry.js +73 -8
- package/dist/cjs/gux-badge.cjs.entry.js +1 -1
- package/dist/cjs/gux-blank-state.cjs.entry.js +1 -1
- package/dist/cjs/gux-breadcrumbs.cjs.entry.js +1 -1
- package/dist/cjs/gux-button-multi.cjs.entry.js +1 -1
- package/dist/cjs/gux-button-slot.cjs.entry.js +1 -1
- package/dist/cjs/gux-button.cjs.entry.js +1 -1
- package/dist/cjs/gux-calendar.cjs.entry.js +1 -1
- package/dist/cjs/gux-card.cjs.entry.js +1 -1
- package/dist/cjs/gux-column-manager.cjs.entry.js +1 -1
- package/dist/cjs/gux-content-search.cjs.entry.js +1 -1
- package/dist/cjs/gux-context-menu.cjs.entry.js +1 -1
- package/dist/cjs/gux-copy-to-clipboard.cjs.entry.js +1 -1
- package/dist/cjs/gux-date-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-date-time-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-datepicker.cjs.entry.js +1 -1
- package/dist/cjs/gux-disclosure-button-legacy.cjs.entry.js +1 -1
- package/dist/cjs/gux-dismiss-button.cjs.entry.js +1 -1
- package/dist/cjs/gux-dropdown-multi.cjs.entry.js +1 -1
- package/dist/cjs/gux-dropdown_3.cjs.entry.js +1 -1
- package/dist/cjs/gux-flag-icon-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-flyout-menu.cjs.entry.js +1 -1
- package/dist/cjs/gux-form-field-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/gux-form-field-color.cjs.entry.js +1 -1
- package/dist/cjs/gux-form-field-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/gux-form-field-input-clear-button.cjs.entry.js +1 -1
- package/dist/cjs/gux-form-field-number_3.cjs.entry.js +1 -1
- package/dist/cjs/gux-form-field-phone.cjs.entry.js +1 -1
- package/dist/cjs/gux-form-field-radio.cjs.entry.js +1 -1
- package/dist/cjs/gux-form-field-range.cjs.entry.js +1 -1
- package/dist/cjs/gux-form-field-search.cjs.entry.js +1 -1
- package/dist/cjs/gux-form-field-select.cjs.entry.js +1 -1
- package/dist/cjs/gux-form-field-text-like.cjs.entry.js +1 -1
- package/dist/cjs/gux-form-field-textarea.cjs.entry.js +1 -1
- package/dist/cjs/gux-form-field-time-picker.cjs.entry.js +1 -1
- package/dist/cjs/gux-form-field-time-zone-picker.cjs.entry.js +1 -1
- package/dist/cjs/gux-icon.cjs.entry.js +1 -1
- package/dist/cjs/gux-inline-alert.cjs.entry.js +1 -1
- package/dist/cjs/gux-list.cjs.entry.js +1 -1
- package/dist/cjs/gux-listbox-multi.cjs.entry.js +1 -1
- package/dist/cjs/gux-loading-message.cjs.entry.js +1 -1
- package/dist/cjs/gux-modal-legacy.cjs.entry.js +1 -1
- package/dist/cjs/gux-modal.cjs.entry.js +1 -1
- package/dist/cjs/gux-month-picker-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-notification-toast-legacy.cjs.entry.js +1 -1
- package/dist/cjs/gux-page-loading-spinner.cjs.entry.js +1 -1
- package/dist/cjs/gux-pagination-cursor.cjs.entry.js +1 -1
- package/dist/cjs/gux-pagination-legacy.cjs.entry.js +1 -1
- package/dist/cjs/gux-pagination.cjs.entry.js +1 -1
- package/dist/cjs/gux-phone-input-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-popover-list.cjs.entry.js +1 -1
- package/dist/cjs/gux-radial-loading.cjs.entry.js +1 -1
- package/dist/cjs/gux-radial-progress.cjs.entry.js +1 -1
- package/dist/cjs/gux-rating.cjs.entry.js +1 -1
- package/dist/cjs/gux-screen-reader-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-segmented-control-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-simple-toast-legacy.cjs.entry.js +1 -1
- package/dist/cjs/gux-skip-navigation-list.cjs.entry.js +1 -1
- package/dist/cjs/gux-sort-control.cjs.entry.js +1 -1
- package/dist/cjs/gux-switch-legacy.cjs.entry.js +1 -1
- package/dist/cjs/gux-tab-advanced-list.cjs.entry.js +500 -871
- package/dist/cjs/gux-table-toolbar-action.cjs.entry.js +1 -1
- package/dist/cjs/gux-table-toolbar-custom-action.cjs.entry.js +1 -1
- package/dist/cjs/gux-table-toolbar-menu-button.cjs.entry.js +1 -1
- package/dist/cjs/gux-table-toolbar.cjs.entry.js +1 -1
- package/dist/cjs/gux-table.cjs.entry.js +1 -1
- package/dist/cjs/gux-tabs-advanced.cjs.entry.js +1 -1
- package/dist/cjs/gux-tabs.cjs.entry.js +1 -1
- package/dist/cjs/gux-tag.cjs.entry.js +1 -1
- package/dist/cjs/gux-text-highlight.cjs.entry.js +1 -1
- package/dist/cjs/gux-time-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-time-picker.cjs.entry.js +1 -1
- package/dist/cjs/gux-time-zone-picker-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-toast.cjs.entry.js +1 -1
- package/dist/cjs/gux-toggle.cjs.entry.js +1 -1
- package/dist/cjs/gux-tooltip-base-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-tooltip-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{usage-d4f6418b.js → usage-9ea1a406.js} +9 -9
- package/dist/collection/components/beta/gux-avatar/gux-avatar.css +168 -30
- package/dist/collection/components/beta/gux-avatar/gux-avatar.js +161 -6
- package/dist/collection/components/beta/gux-avatar/tests/gux-avatar.spec.js +42 -0
- package/dist/collection/components/stable/gux-icon/gux-icon.js +1 -1
- package/dist/collection/components/stable/gux-icon/icons/fa/00-regular.svg +1 -0
- package/dist/collection/components/stable/gux-icon/icons/fa/anchor-regular.svg +1 -0
- package/dist/collection/components/stable/gux-icon/icons/fa/arrows-up-down-regular.svg +1 -0
- package/dist/collection/components/stable/gux-icon/icons/restricted/fa/building-user-regular.svg +1 -0
- package/dist/collection/components/stable/gux-icon/icons/restricted/fa/calendar-circle-user-regular.svg +1 -0
- package/dist/collection/components/stable/gux-icon/icons/restricted/fa/compass-drafting-regular.svg +1 -0
- package/dist/collection/components/stable/gux-icon/icons/restricted/fa/grid-2-regular.svg +1 -0
- package/dist/collection/components/stable/gux-icon/icons/restricted/fa/headset-regular.svg +1 -0
- package/dist/collection/components/stable/gux-icon/icons/restricted/fa/screwdriver-wrench-regular.svg +1 -0
- package/dist/deploy-info.json +3 -3
- package/dist/esm/genesys-webcomponents.js +1 -1
- package/dist/esm/gux-accordion.entry.js +1 -1
- package/dist/esm/gux-action-button.entry.js +1 -1
- package/dist/esm/gux-action-toast-legacy.entry.js +1 -1
- package/dist/esm/gux-advanced-dropdown-legacy.entry.js +1 -1
- package/dist/esm/gux-announce-beta.entry.js +1 -1
- package/dist/esm/gux-avatar-beta.entry.js +73 -8
- package/dist/esm/gux-badge.entry.js +1 -1
- package/dist/esm/gux-blank-state.entry.js +1 -1
- package/dist/esm/gux-breadcrumbs.entry.js +1 -1
- package/dist/esm/gux-button-multi.entry.js +1 -1
- package/dist/esm/gux-button-slot.entry.js +1 -1
- package/dist/esm/gux-button.entry.js +1 -1
- package/dist/esm/gux-calendar.entry.js +1 -1
- package/dist/esm/gux-card.entry.js +1 -1
- package/dist/esm/gux-column-manager.entry.js +1 -1
- package/dist/esm/gux-content-search.entry.js +1 -1
- package/dist/esm/gux-context-menu.entry.js +1 -1
- package/dist/esm/gux-copy-to-clipboard.entry.js +1 -1
- package/dist/esm/gux-date-beta.entry.js +1 -1
- package/dist/esm/gux-date-time-beta.entry.js +1 -1
- package/dist/esm/gux-datepicker.entry.js +1 -1
- package/dist/esm/gux-disclosure-button-legacy.entry.js +1 -1
- package/dist/esm/gux-dismiss-button.entry.js +1 -1
- package/dist/esm/gux-dropdown-multi.entry.js +1 -1
- package/dist/esm/gux-dropdown_3.entry.js +1 -1
- package/dist/esm/gux-flag-icon-beta.entry.js +1 -1
- package/dist/esm/gux-flyout-menu.entry.js +1 -1
- package/dist/esm/gux-form-field-checkbox.entry.js +1 -1
- package/dist/esm/gux-form-field-color.entry.js +1 -1
- package/dist/esm/gux-form-field-dropdown.entry.js +1 -1
- package/dist/esm/gux-form-field-input-clear-button.entry.js +1 -1
- package/dist/esm/gux-form-field-number_3.entry.js +1 -1
- package/dist/esm/gux-form-field-phone.entry.js +1 -1
- package/dist/esm/gux-form-field-radio.entry.js +1 -1
- package/dist/esm/gux-form-field-range.entry.js +1 -1
- package/dist/esm/gux-form-field-search.entry.js +1 -1
- package/dist/esm/gux-form-field-select.entry.js +1 -1
- package/dist/esm/gux-form-field-text-like.entry.js +1 -1
- package/dist/esm/gux-form-field-textarea.entry.js +1 -1
- package/dist/esm/gux-form-field-time-picker.entry.js +1 -1
- package/dist/esm/gux-form-field-time-zone-picker.entry.js +1 -1
- package/dist/esm/gux-icon.entry.js +1 -1
- package/dist/esm/gux-inline-alert.entry.js +1 -1
- package/dist/esm/gux-list.entry.js +1 -1
- package/dist/esm/gux-listbox-multi.entry.js +1 -1
- package/dist/esm/gux-loading-message.entry.js +1 -1
- package/dist/esm/gux-modal-legacy.entry.js +1 -1
- package/dist/esm/gux-modal.entry.js +1 -1
- package/dist/esm/gux-month-picker-beta.entry.js +1 -1
- package/dist/esm/gux-notification-toast-legacy.entry.js +1 -1
- package/dist/esm/gux-page-loading-spinner.entry.js +1 -1
- package/dist/esm/gux-pagination-cursor.entry.js +1 -1
- package/dist/esm/gux-pagination-legacy.entry.js +1 -1
- package/dist/esm/gux-pagination.entry.js +1 -1
- package/dist/esm/gux-phone-input-beta.entry.js +1 -1
- package/dist/esm/gux-popover-list.entry.js +1 -1
- package/dist/esm/gux-radial-loading.entry.js +1 -1
- package/dist/esm/gux-radial-progress.entry.js +1 -1
- package/dist/esm/gux-rating.entry.js +1 -1
- package/dist/esm/gux-screen-reader-beta.entry.js +1 -1
- package/dist/esm/gux-segmented-control-beta.entry.js +1 -1
- package/dist/esm/gux-simple-toast-legacy.entry.js +1 -1
- package/dist/esm/gux-skip-navigation-list.entry.js +1 -1
- package/dist/esm/gux-sort-control.entry.js +1 -1
- package/dist/esm/gux-switch-legacy.entry.js +1 -1
- package/dist/esm/gux-tab-advanced-list.entry.js +500 -871
- package/dist/esm/gux-table-toolbar-action.entry.js +1 -1
- package/dist/esm/gux-table-toolbar-custom-action.entry.js +1 -1
- package/dist/esm/gux-table-toolbar-menu-button.entry.js +1 -1
- package/dist/esm/gux-table-toolbar.entry.js +1 -1
- package/dist/esm/gux-table.entry.js +1 -1
- package/dist/esm/gux-tabs-advanced.entry.js +1 -1
- package/dist/esm/gux-tabs.entry.js +1 -1
- package/dist/esm/gux-tag.entry.js +1 -1
- package/dist/esm/gux-text-highlight.entry.js +1 -1
- package/dist/esm/gux-time-beta.entry.js +1 -1
- package/dist/esm/gux-time-picker.entry.js +1 -1
- package/dist/esm/gux-time-zone-picker-beta.entry.js +1 -1
- package/dist/esm/gux-toast.entry.js +1 -1
- package/dist/esm/gux-toggle.entry.js +1 -1
- package/dist/esm/gux-tooltip-base-beta.entry.js +1 -1
- package/dist/esm/gux-tooltip-beta.entry.js +1 -1
- package/dist/esm/gux-tooltip.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{usage-ccad1705.js → usage-eea733de.js} +9 -9
- package/dist/genesys-webcomponents/genesys-webcomponents.esm.js +1 -1
- package/dist/genesys-webcomponents/i18n/genesys-webcomponents.i18n.en.json +1 -1
- package/dist/genesys-webcomponents/icons/fa/00-regular.svg +1 -0
- package/dist/genesys-webcomponents/icons/fa/anchor-regular.svg +1 -0
- package/dist/genesys-webcomponents/icons/fa/arrows-up-down-regular.svg +1 -0
- package/dist/genesys-webcomponents/icons/restricted/fa/building-user-regular.svg +1 -0
- package/dist/genesys-webcomponents/icons/restricted/fa/calendar-circle-user-regular.svg +1 -0
- package/dist/genesys-webcomponents/icons/restricted/fa/compass-drafting-regular.svg +1 -0
- package/dist/genesys-webcomponents/icons/restricted/fa/grid-2-regular.svg +1 -0
- package/dist/genesys-webcomponents/icons/restricted/fa/headset-regular.svg +1 -0
- package/dist/genesys-webcomponents/icons/restricted/fa/screwdriver-wrench-regular.svg +1 -0
- package/dist/genesys-webcomponents/{p-c3a10929.entry.js → p-014b7b95.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-d3922e0d.entry.js → p-01a8d6c1.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-bd633b17.entry.js → p-04c030c9.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-436839a1.entry.js → p-058b1736.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-183ebc76.entry.js → p-077188b0.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-51696fd4.entry.js → p-09afb249.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-9deee030.entry.js → p-0adf91e0.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-0ceb12d0.entry.js → p-121da8e3.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-d4e792cd.entry.js → p-193966c2.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-1f3e0cea.entry.js → p-1a068ac8.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-a98a27ea.entry.js → p-1b718321.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-665596a4.entry.js → p-20a720bc.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-164cbe2d.entry.js → p-236b382d.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-b35fcc0e.entry.js → p-24248e7e.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-d368a948.entry.js → p-34c40a4c.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-eaf65c90.entry.js → p-3cdf8399.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-fb351660.entry.js → p-3ce032c1.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-5a657bbc.entry.js → p-3cea1bf3.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-2c542005.entry.js → p-442f93cd.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-f6f69e46.entry.js → p-4451e9e7.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-11af17f2.entry.js → p-45311fde.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-a255e23a.entry.js → p-489636ea.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-c36d1b5a.entry.js → p-4935a82e.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-79fbe8e0.entry.js → p-499550e5.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-7ca55c80.entry.js → p-49a85cb8.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-23171357.entry.js → p-49d2dcaf.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-207ba8d5.entry.js → p-4ce1b965.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-bdfcd4db.entry.js → p-511f214f.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-7904b3fd.entry.js → p-5196bdf4.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-52704a37.entry.js → p-55ea85d3.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-56d2d225.entry.js +1 -0
- package/dist/genesys-webcomponents/{p-e5c64958.entry.js → p-58d6febb.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-772098d0.entry.js → p-5a6ce278.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-84b54a2f.entry.js → p-5b859e97.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-78d84998.entry.js → p-5d887843.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-e3dfe5d3.entry.js → p-5ecac4a0.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-1b170b63.entry.js → p-5ff5df46.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-9220bd29.entry.js → p-610191fd.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-8d6953cd.entry.js → p-64e00c2b.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-0d96f4e7.entry.js → p-6b9c841e.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-5e1c9998.entry.js → p-6bbdd915.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-bf7644f8.entry.js → p-79136dcf.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-ce7c9d60.entry.js → p-7d95c216.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-37e1b433.entry.js → p-7f3cfaa1.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-41dd7efe.entry.js → p-7f4a59da.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-80a2f466.entry.js +7 -0
- package/dist/genesys-webcomponents/{p-c4b8e38d.entry.js → p-8995a20b.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-34505fdc.entry.js → p-8feba2d5.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-60a50d43.js → p-92ca1cb8.js} +1 -1
- package/dist/genesys-webcomponents/{p-1c4a2a1c.entry.js → p-9a9db5c4.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-8066476e.entry.js → p-9d8299c0.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-b3dc16e3.entry.js → p-9f776d21.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-beaf804b.entry.js → p-aa495152.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-69501693.entry.js → p-ae7194ef.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-fa3a24f2.entry.js → p-b1e06b6a.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-8eaf5391.entry.js → p-b38e2806.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-fb69efcf.entry.js → p-b61152b7.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-5eee572e.entry.js → p-b8089f64.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-a31b5c94.entry.js → p-bcb2307f.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-444a5df9.entry.js → p-c0417b42.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-eb29dca1.entry.js → p-c1b66bdb.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-9de59cfa.entry.js → p-c4a5a383.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-03ba668d.entry.js → p-c60f8690.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-0ab1bbb6.entry.js → p-c8e43c05.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-fca8d502.entry.js → p-c9a6c986.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-2e073447.entry.js → p-ca92d44e.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-6bb263db.entry.js → p-d653e150.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-5de076c5.entry.js → p-dc4c2180.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-7a135697.entry.js → p-dc841662.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-bc6b4ae4.entry.js → p-ddfcfea2.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-8aeb5e21.entry.js → p-e4d1ab82.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-78b2275c.entry.js → p-e6688260.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-ac3b69fa.entry.js → p-e693c9fe.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-857815d7.entry.js → p-e6c0695a.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-8c253e0e.entry.js → p-e7535dd1.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-36446966.entry.js → p-e8074f91.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-52de21b5.entry.js → p-e8eade47.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-ecbe0963.entry.js → p-edcbdcf4.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-f1b51ca5.entry.js → p-f0b4f3c8.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-983a999c.entry.js → p-f521a7b2.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-98b0d772.entry.js → p-f91a5996.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-445107bf.entry.js → p-fbad3254.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-82adf097.entry.js → p-ff467af0.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-b1b47734.entry.js → p-ffd1add0.entry.js} +1 -1
- package/dist/stencil-wrapper.js +1 -1
- package/dist/types/components/beta/gux-avatar/gux-avatar.d.ts +28 -2
- package/dist/types/components/beta/gux-avatar/gux-avatar.types.d.ts +1 -0
- package/dist/types/components/stable/gux-icon/gux-icon.types.d.ts +1 -1
- package/dist/types/components.d.ts +42 -2
- package/dist/types/stencil-wrapper.d.ts +1 -1
- package/package.json +9 -9
- package/dist/genesys-webcomponents/p-45c42eca.entry.js +0 -1
- package/dist/genesys-webcomponents/p-54bbb104.entry.js +0 -7
@@ -11,33 +11,27 @@ const en = require('./en-85604f0f.js');
|
|
11
11
|
require('./get-closest-element-26894e5a.js');
|
12
12
|
|
13
13
|
/**!
|
14
|
-
* Sortable 1.15.
|
14
|
+
* Sortable 1.15.2
|
15
15
|
* @author RubaXa <trash@rubaxa.org>
|
16
16
|
* @author owenm <owen23355@gmail.com>
|
17
17
|
* @license MIT
|
18
18
|
*/
|
19
19
|
function ownKeys(object, enumerableOnly) {
|
20
20
|
var keys = Object.keys(object);
|
21
|
-
|
22
21
|
if (Object.getOwnPropertySymbols) {
|
23
22
|
var symbols = Object.getOwnPropertySymbols(object);
|
24
|
-
|
25
23
|
if (enumerableOnly) {
|
26
24
|
symbols = symbols.filter(function (sym) {
|
27
25
|
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
28
26
|
});
|
29
27
|
}
|
30
|
-
|
31
28
|
keys.push.apply(keys, symbols);
|
32
29
|
}
|
33
|
-
|
34
30
|
return keys;
|
35
31
|
}
|
36
|
-
|
37
32
|
function _objectSpread2(target) {
|
38
33
|
for (var i = 1; i < arguments.length; i++) {
|
39
34
|
var source = arguments[i] != null ? arguments[i] : {};
|
40
|
-
|
41
35
|
if (i % 2) {
|
42
36
|
ownKeys(Object(source), true).forEach(function (key) {
|
43
37
|
_defineProperty(target, key, source[key]);
|
@@ -50,10 +44,8 @@ function _objectSpread2(target) {
|
|
50
44
|
});
|
51
45
|
}
|
52
46
|
}
|
53
|
-
|
54
47
|
return target;
|
55
48
|
}
|
56
|
-
|
57
49
|
function _typeof(obj) {
|
58
50
|
"@babel/helpers - typeof";
|
59
51
|
|
@@ -66,10 +58,8 @@ function _typeof(obj) {
|
|
66
58
|
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
67
59
|
};
|
68
60
|
}
|
69
|
-
|
70
61
|
return _typeof(obj);
|
71
62
|
}
|
72
|
-
|
73
63
|
function _defineProperty(obj, key, value) {
|
74
64
|
if (key in obj) {
|
75
65
|
Object.defineProperty(obj, key, {
|
@@ -81,53 +71,40 @@ function _defineProperty(obj, key, value) {
|
|
81
71
|
} else {
|
82
72
|
obj[key] = value;
|
83
73
|
}
|
84
|
-
|
85
74
|
return obj;
|
86
75
|
}
|
87
|
-
|
88
76
|
function _extends() {
|
89
77
|
_extends = Object.assign || function (target) {
|
90
78
|
for (var i = 1; i < arguments.length; i++) {
|
91
79
|
var source = arguments[i];
|
92
|
-
|
93
80
|
for (var key in source) {
|
94
81
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
95
82
|
target[key] = source[key];
|
96
83
|
}
|
97
84
|
}
|
98
85
|
}
|
99
|
-
|
100
86
|
return target;
|
101
87
|
};
|
102
|
-
|
103
88
|
return _extends.apply(this, arguments);
|
104
89
|
}
|
105
|
-
|
106
90
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
107
91
|
if (source == null) return {};
|
108
92
|
var target = {};
|
109
93
|
var sourceKeys = Object.keys(source);
|
110
94
|
var key, i;
|
111
|
-
|
112
95
|
for (i = 0; i < sourceKeys.length; i++) {
|
113
96
|
key = sourceKeys[i];
|
114
97
|
if (excluded.indexOf(key) >= 0) continue;
|
115
98
|
target[key] = source[key];
|
116
99
|
}
|
117
|
-
|
118
100
|
return target;
|
119
101
|
}
|
120
|
-
|
121
102
|
function _objectWithoutProperties(source, excluded) {
|
122
103
|
if (source == null) return {};
|
123
|
-
|
124
104
|
var target = _objectWithoutPropertiesLoose(source, excluded);
|
125
|
-
|
126
105
|
var key, i;
|
127
|
-
|
128
106
|
if (Object.getOwnPropertySymbols) {
|
129
107
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
130
|
-
|
131
108
|
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
132
109
|
key = sourceSymbolKeys[i];
|
133
110
|
if (excluded.indexOf(key) >= 0) continue;
|
@@ -135,18 +112,16 @@ function _objectWithoutProperties(source, excluded) {
|
|
135
112
|
target[key] = source[key];
|
136
113
|
}
|
137
114
|
}
|
138
|
-
|
139
115
|
return target;
|
140
116
|
}
|
141
117
|
|
142
|
-
var version = "1.15.
|
118
|
+
var version = "1.15.2";
|
143
119
|
|
144
120
|
function userAgent(pattern) {
|
145
121
|
if (typeof window !== 'undefined' && window.navigator) {
|
146
122
|
return !! /*@__PURE__*/navigator.userAgent.match(pattern);
|
147
123
|
}
|
148
124
|
}
|
149
|
-
|
150
125
|
var IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i);
|
151
126
|
var Edge = userAgent(/Edge/i);
|
152
127
|
var FireFox = userAgent(/firefox/i);
|
@@ -158,23 +133,15 @@ var captureMode = {
|
|
158
133
|
capture: false,
|
159
134
|
passive: false
|
160
135
|
};
|
161
|
-
|
162
136
|
function on(el, event, fn) {
|
163
137
|
el.addEventListener(event, fn, !IE11OrLess && captureMode);
|
164
138
|
}
|
165
|
-
|
166
139
|
function off(el, event, fn) {
|
167
140
|
el.removeEventListener(event, fn, !IE11OrLess && captureMode);
|
168
141
|
}
|
169
|
-
|
170
|
-
function matches(
|
171
|
-
/**HTMLElement*/
|
172
|
-
el,
|
173
|
-
/**String*/
|
174
|
-
selector) {
|
142
|
+
function matches( /**HTMLElement*/el, /**String*/selector) {
|
175
143
|
if (!selector) return;
|
176
144
|
selector[0] === '>' && (selector = selector.substring(1));
|
177
|
-
|
178
145
|
if (el) {
|
179
146
|
try {
|
180
147
|
if (el.matches) {
|
@@ -188,39 +155,25 @@ selector) {
|
|
188
155
|
return false;
|
189
156
|
}
|
190
157
|
}
|
191
|
-
|
192
158
|
return false;
|
193
159
|
}
|
194
|
-
|
195
160
|
function getParentOrHost(el) {
|
196
161
|
return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;
|
197
162
|
}
|
198
|
-
|
199
|
-
function closest(
|
200
|
-
/**HTMLElement*/
|
201
|
-
el,
|
202
|
-
/**String*/
|
203
|
-
selector,
|
204
|
-
/**HTMLElement*/
|
205
|
-
ctx, includeCTX) {
|
163
|
+
function closest( /**HTMLElement*/el, /**String*/selector, /**HTMLElement*/ctx, includeCTX) {
|
206
164
|
if (el) {
|
207
165
|
ctx = ctx || document;
|
208
|
-
|
209
166
|
do {
|
210
167
|
if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {
|
211
168
|
return el;
|
212
169
|
}
|
213
|
-
|
214
170
|
if (el === ctx) break;
|
215
171
|
/* jshint boss:true */
|
216
172
|
} while (el = getParentOrHost(el));
|
217
173
|
}
|
218
|
-
|
219
174
|
return null;
|
220
175
|
}
|
221
|
-
|
222
176
|
var R_SPACE = /\s+/g;
|
223
|
-
|
224
177
|
function toggleClass(el, name, state) {
|
225
178
|
if (el && name) {
|
226
179
|
if (el.classList) {
|
@@ -231,10 +184,8 @@ function toggleClass(el, name, state) {
|
|
231
184
|
}
|
232
185
|
}
|
233
186
|
}
|
234
|
-
|
235
187
|
function css(el, prop, val) {
|
236
188
|
var style = el && el.style;
|
237
|
-
|
238
189
|
if (style) {
|
239
190
|
if (val === void 0) {
|
240
191
|
if (document.defaultView && document.defaultView.getComputedStyle) {
|
@@ -242,83 +193,67 @@ function css(el, prop, val) {
|
|
242
193
|
} else if (el.currentStyle) {
|
243
194
|
val = el.currentStyle;
|
244
195
|
}
|
245
|
-
|
246
196
|
return prop === void 0 ? val : val[prop];
|
247
197
|
} else {
|
248
198
|
if (!(prop in style) && prop.indexOf('webkit') === -1) {
|
249
199
|
prop = '-webkit-' + prop;
|
250
200
|
}
|
251
|
-
|
252
201
|
style[prop] = val + (typeof val === 'string' ? '' : 'px');
|
253
202
|
}
|
254
203
|
}
|
255
204
|
}
|
256
|
-
|
257
205
|
function matrix(el, selfOnly) {
|
258
206
|
var appliedTransforms = '';
|
259
|
-
|
260
207
|
if (typeof el === 'string') {
|
261
208
|
appliedTransforms = el;
|
262
209
|
} else {
|
263
210
|
do {
|
264
211
|
var transform = css(el, 'transform');
|
265
|
-
|
266
212
|
if (transform && transform !== 'none') {
|
267
213
|
appliedTransforms = transform + ' ' + appliedTransforms;
|
268
214
|
}
|
269
215
|
/* jshint boss:true */
|
270
|
-
|
271
216
|
} while (!selfOnly && (el = el.parentNode));
|
272
217
|
}
|
273
|
-
|
274
218
|
var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
|
275
219
|
/*jshint -W056 */
|
276
|
-
|
277
220
|
return matrixFn && new matrixFn(appliedTransforms);
|
278
221
|
}
|
279
|
-
|
280
222
|
function find(ctx, tagName, iterator) {
|
281
223
|
if (ctx) {
|
282
224
|
var list = ctx.getElementsByTagName(tagName),
|
283
|
-
|
284
|
-
|
285
|
-
|
225
|
+
i = 0,
|
226
|
+
n = list.length;
|
286
227
|
if (iterator) {
|
287
228
|
for (; i < n; i++) {
|
288
229
|
iterator(list[i], i);
|
289
230
|
}
|
290
231
|
}
|
291
|
-
|
292
232
|
return list;
|
293
233
|
}
|
294
|
-
|
295
234
|
return [];
|
296
235
|
}
|
297
|
-
|
298
236
|
function getWindowScrollingElement() {
|
299
237
|
var scrollingElement = document.scrollingElement;
|
300
|
-
|
301
238
|
if (scrollingElement) {
|
302
239
|
return scrollingElement;
|
303
240
|
} else {
|
304
241
|
return document.documentElement;
|
305
242
|
}
|
306
243
|
}
|
307
|
-
/**
|
308
|
-
* Returns the "bounding client rect" of given element
|
309
|
-
* @param {HTMLElement} el The element whose boundingClientRect is wanted
|
310
|
-
* @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container
|
311
|
-
* @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr
|
312
|
-
* @param {[Boolean]} undoScale Whether the container's scale() should be undone
|
313
|
-
* @param {[HTMLElement]} container The parent the element will be placed in
|
314
|
-
* @return {Object} The boundingClientRect of el, with specified adjustments
|
315
|
-
*/
|
316
|
-
|
317
244
|
|
245
|
+
/**
|
246
|
+
* Returns the "bounding client rect" of given element
|
247
|
+
* @param {HTMLElement} el The element whose boundingClientRect is wanted
|
248
|
+
* @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container
|
249
|
+
* @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr
|
250
|
+
* @param {[Boolean]} undoScale Whether the container's scale() should be undone
|
251
|
+
* @param {[HTMLElement]} container The parent the element will be placed in
|
252
|
+
* @return {Object} The boundingClientRect of el, with specified adjustments
|
253
|
+
*/
|
318
254
|
function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {
|
319
255
|
if (!el.getBoundingClientRect && el !== window) return;
|
320
256
|
var elRect, top, left, bottom, right, height, width;
|
321
|
-
|
322
257
|
if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {
|
323
258
|
elRect = el.getBoundingClientRect();
|
324
259
|
top = elRect.top;
|
@@ -335,17 +270,18 @@ function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoS
|
|
335
270
|
height = window.innerHeight;
|
336
271
|
width = window.innerWidth;
|
337
272
|
}
|
338
|
-
|
339
273
|
if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {
|
340
274
|
// Adjust for translate()
|
341
|
-
container = container || el.parentNode;
|
342
|
-
// Not needed on <= IE11
|
275
|
+
container = container || el.parentNode;
|
343
276
|
|
277
|
+
// solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)
|
278
|
+
// Not needed on <= IE11
|
344
279
|
if (!IE11OrLess) {
|
345
280
|
do {
|
346
281
|
if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {
|
347
|
-
var containerRect = container.getBoundingClientRect();
|
282
|
+
var containerRect = container.getBoundingClientRect();
|
348
283
|
|
284
|
+
// Set relative to edges of padding box of container
|
349
285
|
top -= containerRect.top + parseInt(css(container, 'border-top-width'));
|
350
286
|
left -= containerRect.left + parseInt(css(container, 'border-left-width'));
|
351
287
|
bottom = top + elRect.height;
|
@@ -353,17 +289,14 @@ function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoS
|
|
353
289
|
break;
|
354
290
|
}
|
355
291
|
/* jshint boss:true */
|
356
|
-
|
357
292
|
} while (container = container.parentNode);
|
358
293
|
}
|
359
294
|
}
|
360
|
-
|
361
295
|
if (undoScale && el !== window) {
|
362
296
|
// Adjust for scale()
|
363
297
|
var elMatrix = matrix(container || el),
|
364
|
-
|
365
|
-
|
366
|
-
|
298
|
+
scaleX = elMatrix && elMatrix.a,
|
299
|
+
scaleY = elMatrix && elMatrix.d;
|
367
300
|
if (elMatrix) {
|
368
301
|
top /= scaleY;
|
369
302
|
left /= scaleX;
|
@@ -373,7 +306,6 @@ function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoS
|
|
373
306
|
right = left + width;
|
374
307
|
}
|
375
308
|
}
|
376
|
-
|
377
309
|
return {
|
378
310
|
top: top,
|
379
311
|
left: left,
|
@@ -383,165 +315,140 @@ function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoS
|
|
383
315
|
height: height
|
384
316
|
};
|
385
317
|
}
|
386
|
-
/**
|
387
|
-
* Checks if a side of an element is scrolled past a side of its parents
|
388
|
-
* @param {HTMLElement} el The element who's side being scrolled out of view is in question
|
389
|
-
* @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')
|
390
|
-
* @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')
|
391
|
-
* @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element
|
392
|
-
*/
|
393
|
-
|
394
318
|
|
319
|
+
/**
|
320
|
+
* Checks if a side of an element is scrolled past a side of its parents
|
321
|
+
* @param {HTMLElement} el The element who's side being scrolled out of view is in question
|
322
|
+
* @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')
|
323
|
+
* @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')
|
324
|
+
* @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element
|
325
|
+
*/
|
395
326
|
function isScrolledPast(el, elSide, parentSide) {
|
396
327
|
var parent = getParentAutoScrollElement(el, true),
|
397
|
-
|
398
|
-
/* jshint boss:true */
|
328
|
+
elSideVal = getRect(el)[elSide];
|
399
329
|
|
330
|
+
/* jshint boss:true */
|
400
331
|
while (parent) {
|
401
332
|
var parentSideVal = getRect(parent)[parentSide],
|
402
|
-
|
403
|
-
|
333
|
+
visible = void 0;
|
404
334
|
if (parentSide === 'top' || parentSide === 'left') {
|
405
335
|
visible = elSideVal >= parentSideVal;
|
406
336
|
} else {
|
407
337
|
visible = elSideVal <= parentSideVal;
|
408
338
|
}
|
409
|
-
|
410
339
|
if (!visible) return parent;
|
411
340
|
if (parent === getWindowScrollingElement()) break;
|
412
341
|
parent = getParentAutoScrollElement(parent, false);
|
413
342
|
}
|
414
|
-
|
415
343
|
return false;
|
416
344
|
}
|
417
|
-
/**
|
418
|
-
* Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)
|
419
|
-
* and non-draggable elements
|
420
|
-
* @param {HTMLElement} el The parent element
|
421
|
-
* @param {Number} childNum The index of the child
|
422
|
-
* @param {Object} options Parent Sortable's options
|
423
|
-
* @return {HTMLElement} The child at index childNum, or null if not found
|
424
|
-
*/
|
425
|
-
|
426
345
|
|
346
|
+
/**
|
347
|
+
* Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)
|
348
|
+
* and non-draggable elements
|
349
|
+
* @param {HTMLElement} el The parent element
|
350
|
+
* @param {Number} childNum The index of the child
|
351
|
+
* @param {Object} options Parent Sortable's options
|
352
|
+
* @return {HTMLElement} The child at index childNum, or null if not found
|
353
|
+
*/
|
427
354
|
function getChild(el, childNum, options, includeDragEl) {
|
428
355
|
var currentChild = 0,
|
429
|
-
|
430
|
-
|
431
|
-
|
356
|
+
i = 0,
|
357
|
+
children = el.children;
|
432
358
|
while (i < children.length) {
|
433
359
|
if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {
|
434
360
|
if (currentChild === childNum) {
|
435
361
|
return children[i];
|
436
362
|
}
|
437
|
-
|
438
363
|
currentChild++;
|
439
364
|
}
|
440
|
-
|
441
365
|
i++;
|
442
366
|
}
|
443
|
-
|
444
367
|
return null;
|
445
368
|
}
|
446
|
-
/**
|
447
|
-
* Gets the last child in the el, ignoring ghostEl or invisible elements (clones)
|
448
|
-
* @param {HTMLElement} el Parent element
|
449
|
-
* @param {selector} selector Any other elements that should be ignored
|
450
|
-
* @return {HTMLElement} The last child, ignoring ghostEl
|
451
|
-
*/
|
452
|
-
|
453
369
|
|
370
|
+
/**
|
371
|
+
* Gets the last child in the el, ignoring ghostEl or invisible elements (clones)
|
372
|
+
* @param {HTMLElement} el Parent element
|
373
|
+
* @param {selector} selector Any other elements that should be ignored
|
374
|
+
* @return {HTMLElement} The last child, ignoring ghostEl
|
375
|
+
*/
|
454
376
|
function lastChild(el, selector) {
|
455
377
|
var last = el.lastElementChild;
|
456
|
-
|
457
378
|
while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {
|
458
379
|
last = last.previousElementSibling;
|
459
380
|
}
|
460
|
-
|
461
381
|
return last || null;
|
462
382
|
}
|
463
|
-
/**
|
464
|
-
* Returns the index of an element within its parent for a selected set of
|
465
|
-
* elements
|
466
|
-
* @param {HTMLElement} el
|
467
|
-
* @param {selector} selector
|
468
|
-
* @return {number}
|
469
|
-
*/
|
470
|
-
|
471
383
|
|
384
|
+
/**
|
385
|
+
* Returns the index of an element within its parent for a selected set of
|
386
|
+
* elements
|
387
|
+
* @param {HTMLElement} el
|
388
|
+
* @param {selector} selector
|
389
|
+
* @return {number}
|
390
|
+
*/
|
472
391
|
function index(el, selector) {
|
473
392
|
var index = 0;
|
474
|
-
|
475
393
|
if (!el || !el.parentNode) {
|
476
394
|
return -1;
|
477
395
|
}
|
478
|
-
/* jshint boss:true */
|
479
|
-
|
480
396
|
|
397
|
+
/* jshint boss:true */
|
481
398
|
while (el = el.previousElementSibling) {
|
482
399
|
if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {
|
483
400
|
index++;
|
484
401
|
}
|
485
402
|
}
|
486
|
-
|
487
403
|
return index;
|
488
404
|
}
|
489
|
-
/**
|
490
|
-
* Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.
|
491
|
-
* The value is returned in real pixels.
|
492
|
-
* @param {HTMLElement} el
|
493
|
-
* @return {Array} Offsets in the format of [left, top]
|
494
|
-
*/
|
495
|
-
|
496
405
|
|
406
|
+
/**
|
407
|
+
* Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.
|
408
|
+
* The value is returned in real pixels.
|
409
|
+
* @param {HTMLElement} el
|
410
|
+
* @return {Array} Offsets in the format of [left, top]
|
411
|
+
*/
|
497
412
|
function getRelativeScrollOffset(el) {
|
498
413
|
var offsetLeft = 0,
|
499
|
-
|
500
|
-
|
501
|
-
|
414
|
+
offsetTop = 0,
|
415
|
+
winScroller = getWindowScrollingElement();
|
502
416
|
if (el) {
|
503
417
|
do {
|
504
418
|
var elMatrix = matrix(el),
|
505
|
-
|
506
|
-
|
419
|
+
scaleX = elMatrix.a,
|
420
|
+
scaleY = elMatrix.d;
|
507
421
|
offsetLeft += el.scrollLeft * scaleX;
|
508
422
|
offsetTop += el.scrollTop * scaleY;
|
509
423
|
} while (el !== winScroller && (el = el.parentNode));
|
510
424
|
}
|
511
|
-
|
512
425
|
return [offsetLeft, offsetTop];
|
513
426
|
}
|
514
|
-
/**
|
515
|
-
* Returns the index of the object within the given array
|
516
|
-
* @param {Array} arr Array that may or may not hold the object
|
517
|
-
* @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
|
518
|
-
* @return {Number} The index of the object in the array, or -1
|
519
|
-
*/
|
520
|
-
|
521
427
|
|
428
|
+
/**
|
429
|
+
* Returns the index of the object within the given array
|
430
|
+
* @param {Array} arr Array that may or may not hold the object
|
431
|
+
* @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
|
432
|
+
* @return {Number} The index of the object in the array, or -1
|
433
|
+
*/
|
522
434
|
function indexOfObject(arr, obj) {
|
523
435
|
for (var i in arr) {
|
524
436
|
if (!arr.hasOwnProperty(i)) continue;
|
525
|
-
|
526
437
|
for (var key in obj) {
|
527
438
|
if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);
|
528
439
|
}
|
529
440
|
}
|
530
|
-
|
531
441
|
return -1;
|
532
442
|
}
|
533
|
-
|
534
443
|
function getParentAutoScrollElement(el, includeSelf) {
|
535
444
|
// skip to window
|
536
445
|
if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();
|
537
446
|
var elem = el;
|
538
447
|
var gotSelf = false;
|
539
|
-
|
540
448
|
do {
|
541
449
|
// we don't need to get elem css if it isn't even overflowing in the first place (performance)
|
542
450
|
if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {
|
543
451
|
var elemCSS = css(elem);
|
544
|
-
|
545
452
|
if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {
|
546
453
|
if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();
|
547
454
|
if (gotSelf || includeSelf) return elem;
|
@@ -549,12 +456,9 @@ function getParentAutoScrollElement(el, includeSelf) {
|
|
549
456
|
}
|
550
457
|
}
|
551
458
|
/* jshint boss:true */
|
552
|
-
|
553
459
|
} while (elem = elem.parentNode);
|
554
|
-
|
555
460
|
return getWindowScrollingElement();
|
556
461
|
}
|
557
|
-
|
558
462
|
function extend(dst, src) {
|
559
463
|
if (dst && src) {
|
560
464
|
for (var key in src) {
|
@@ -563,49 +467,39 @@ function extend(dst, src) {
|
|
563
467
|
}
|
564
468
|
}
|
565
469
|
}
|
566
|
-
|
567
470
|
return dst;
|
568
471
|
}
|
569
|
-
|
570
472
|
function isRectEqual(rect1, rect2) {
|
571
473
|
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);
|
572
474
|
}
|
573
|
-
|
574
475
|
var _throttleTimeout;
|
575
|
-
|
576
476
|
function throttle(callback, ms) {
|
577
477
|
return function () {
|
578
478
|
if (!_throttleTimeout) {
|
579
479
|
var args = arguments,
|
580
|
-
|
581
|
-
|
480
|
+
_this = this;
|
582
481
|
if (args.length === 1) {
|
583
482
|
callback.call(_this, args[0]);
|
584
483
|
} else {
|
585
484
|
callback.apply(_this, args);
|
586
485
|
}
|
587
|
-
|
588
486
|
_throttleTimeout = setTimeout(function () {
|
589
487
|
_throttleTimeout = void 0;
|
590
488
|
}, ms);
|
591
489
|
}
|
592
490
|
};
|
593
491
|
}
|
594
|
-
|
595
492
|
function cancelThrottle() {
|
596
493
|
clearTimeout(_throttleTimeout);
|
597
494
|
_throttleTimeout = void 0;
|
598
495
|
}
|
599
|
-
|
600
496
|
function scrollBy(el, x, y) {
|
601
497
|
el.scrollLeft += x;
|
602
498
|
el.scrollTop += y;
|
603
499
|
}
|
604
|
-
|
605
500
|
function clone(el) {
|
606
501
|
var Polymer = window.Polymer;
|
607
502
|
var $ = window.jQuery || window.Zepto;
|
608
|
-
|
609
503
|
if (Polymer && Polymer.dom) {
|
610
504
|
return Polymer.dom(el).cloneNode(true);
|
611
505
|
} else if ($) {
|
@@ -614,12 +508,28 @@ function clone(el) {
|
|
614
508
|
return el.cloneNode(true);
|
615
509
|
}
|
616
510
|
}
|
617
|
-
|
511
|
+
function getChildContainingRectFromElement(container, options, ghostEl) {
|
512
|
+
var rect = {};
|
513
|
+
Array.from(container.children).forEach(function (child) {
|
514
|
+
var _rect$left, _rect$top, _rect$right, _rect$bottom;
|
515
|
+
if (!closest(child, options.draggable, container, false) || child.animated || child === ghostEl) return;
|
516
|
+
var childRect = getRect(child);
|
517
|
+
rect.left = Math.min((_rect$left = rect.left) !== null && _rect$left !== void 0 ? _rect$left : Infinity, childRect.left);
|
518
|
+
rect.top = Math.min((_rect$top = rect.top) !== null && _rect$top !== void 0 ? _rect$top : Infinity, childRect.top);
|
519
|
+
rect.right = Math.max((_rect$right = rect.right) !== null && _rect$right !== void 0 ? _rect$right : -Infinity, childRect.right);
|
520
|
+
rect.bottom = Math.max((_rect$bottom = rect.bottom) !== null && _rect$bottom !== void 0 ? _rect$bottom : -Infinity, childRect.bottom);
|
521
|
+
});
|
522
|
+
rect.width = rect.right - rect.left;
|
523
|
+
rect.height = rect.bottom - rect.top;
|
524
|
+
rect.x = rect.left;
|
525
|
+
rect.y = rect.top;
|
526
|
+
return rect;
|
527
|
+
}
|
618
528
|
var expando = 'Sortable' + new Date().getTime();
|
619
529
|
|
620
530
|
function AnimationStateManager() {
|
621
531
|
var animationStates = [],
|
622
|
-
|
532
|
+
animationCallbackId;
|
623
533
|
return {
|
624
534
|
captureAnimationState: function captureAnimationState() {
|
625
535
|
animationStates = [];
|
@@ -631,19 +541,16 @@ function AnimationStateManager() {
|
|
631
541
|
target: child,
|
632
542
|
rect: getRect(child)
|
633
543
|
});
|
544
|
+
var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect);
|
634
545
|
|
635
|
-
|
636
|
-
|
637
|
-
|
546
|
+
// If animating: compensate for current animation
|
638
547
|
if (child.thisAnimationDuration) {
|
639
548
|
var childMatrix = matrix(child, true);
|
640
|
-
|
641
549
|
if (childMatrix) {
|
642
550
|
fromRect.top -= childMatrix.f;
|
643
551
|
fromRect.left -= childMatrix.e;
|
644
552
|
}
|
645
553
|
}
|
646
|
-
|
647
554
|
child.fromRect = fromRect;
|
648
555
|
});
|
649
556
|
},
|
@@ -657,54 +564,47 @@ function AnimationStateManager() {
|
|
657
564
|
},
|
658
565
|
animateAll: function animateAll(callback) {
|
659
566
|
var _this = this;
|
660
|
-
|
661
567
|
if (!this.options.animation) {
|
662
568
|
clearTimeout(animationCallbackId);
|
663
569
|
if (typeof callback === 'function') callback();
|
664
570
|
return;
|
665
571
|
}
|
666
|
-
|
667
572
|
var animating = false,
|
668
|
-
|
573
|
+
animationTime = 0;
|
669
574
|
animationStates.forEach(function (state) {
|
670
575
|
var time = 0,
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
576
|
+
target = state.target,
|
577
|
+
fromRect = target.fromRect,
|
578
|
+
toRect = getRect(target),
|
579
|
+
prevFromRect = target.prevFromRect,
|
580
|
+
prevToRect = target.prevToRect,
|
581
|
+
animatingRect = state.rect,
|
582
|
+
targetMatrix = matrix(target, true);
|
679
583
|
if (targetMatrix) {
|
680
584
|
// Compensate for current animation
|
681
585
|
toRect.top -= targetMatrix.f;
|
682
586
|
toRect.left -= targetMatrix.e;
|
683
587
|
}
|
684
|
-
|
685
588
|
target.toRect = toRect;
|
686
|
-
|
687
589
|
if (target.thisAnimationDuration) {
|
688
590
|
// Could also check if animatingRect is between fromRect and toRect
|
689
|
-
if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) &&
|
591
|
+
if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) &&
|
592
|
+
// Make sure animatingRect is on line between toRect & fromRect
|
690
593
|
(animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {
|
691
594
|
// If returning to same place as started from animation and on same axis
|
692
595
|
time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);
|
693
596
|
}
|
694
|
-
}
|
695
|
-
|
597
|
+
}
|
696
598
|
|
599
|
+
// if fromRect != toRect: animate
|
697
600
|
if (!isRectEqual(toRect, fromRect)) {
|
698
601
|
target.prevFromRect = fromRect;
|
699
602
|
target.prevToRect = toRect;
|
700
|
-
|
701
603
|
if (!time) {
|
702
604
|
time = _this.options.animation;
|
703
605
|
}
|
704
|
-
|
705
606
|
_this.animate(target, animatingRect, toRect, time);
|
706
607
|
}
|
707
|
-
|
708
608
|
if (time) {
|
709
609
|
animating = true;
|
710
610
|
animationTime = Math.max(animationTime, time);
|
@@ -720,7 +620,6 @@ function AnimationStateManager() {
|
|
720
620
|
}
|
721
621
|
});
|
722
622
|
clearTimeout(animationCallbackId);
|
723
|
-
|
724
623
|
if (!animating) {
|
725
624
|
if (typeof callback === 'function') callback();
|
726
625
|
} else {
|
@@ -728,7 +627,6 @@ function AnimationStateManager() {
|
|
728
627
|
if (typeof callback === 'function') callback();
|
729
628
|
}, animationTime);
|
730
629
|
}
|
731
|
-
|
732
630
|
animationStates = [];
|
733
631
|
},
|
734
632
|
animate: function animate(target, currentRect, toRect, duration) {
|
@@ -736,10 +634,10 @@ function AnimationStateManager() {
|
|
736
634
|
css(target, 'transition', '');
|
737
635
|
css(target, 'transform', '');
|
738
636
|
var elMatrix = matrix(this.el),
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
637
|
+
scaleX = elMatrix && elMatrix.a,
|
638
|
+
scaleY = elMatrix && elMatrix.d,
|
639
|
+
translateX = (currentRect.left - toRect.left) / (scaleX || 1),
|
640
|
+
translateY = (currentRect.top - toRect.top) / (scaleY || 1);
|
743
641
|
target.animatingX = !!translateX;
|
744
642
|
target.animatingY = !!translateY;
|
745
643
|
css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');
|
@@ -759,11 +657,9 @@ function AnimationStateManager() {
|
|
759
657
|
}
|
760
658
|
};
|
761
659
|
}
|
762
|
-
|
763
660
|
function repaint(target) {
|
764
661
|
return target.offsetWidth;
|
765
662
|
}
|
766
|
-
|
767
663
|
function calculateRealTime(animatingRect, fromRect, toRect, options) {
|
768
664
|
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;
|
769
665
|
}
|
@@ -780,7 +676,6 @@ var PluginManager = {
|
|
780
676
|
plugin[option] = defaults[option];
|
781
677
|
}
|
782
678
|
}
|
783
|
-
|
784
679
|
plugins.forEach(function (p) {
|
785
680
|
if (p.pluginName === plugin.pluginName) {
|
786
681
|
throw "Sortable: Cannot mount plugin ".concat(plugin.pluginName, " more than once");
|
@@ -790,25 +685,22 @@ var PluginManager = {
|
|
790
685
|
},
|
791
686
|
pluginEvent: function pluginEvent(eventName, sortable, evt) {
|
792
687
|
var _this = this;
|
793
|
-
|
794
688
|
this.eventCanceled = false;
|
795
|
-
|
796
689
|
evt.cancel = function () {
|
797
690
|
_this.eventCanceled = true;
|
798
691
|
};
|
799
|
-
|
800
692
|
var eventNameGlobal = eventName + 'Global';
|
801
693
|
plugins.forEach(function (plugin) {
|
802
|
-
if (!sortable[plugin.pluginName]) return;
|
803
|
-
|
694
|
+
if (!sortable[plugin.pluginName]) return;
|
695
|
+
// Fire global events if it exists in this sortable
|
804
696
|
if (sortable[plugin.pluginName][eventNameGlobal]) {
|
805
697
|
sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({
|
806
698
|
sortable: sortable
|
807
699
|
}, evt));
|
808
|
-
}
|
809
|
-
// and plugin has event defined
|
810
|
-
|
700
|
+
}
|
811
701
|
|
702
|
+
// Only fire plugin event if plugin is enabled in this sortable,
|
703
|
+
// and plugin has event defined
|
812
704
|
if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {
|
813
705
|
sortable[plugin.pluginName][eventName](_objectSpread2({
|
814
706
|
sortable: sortable
|
@@ -823,15 +715,14 @@ var PluginManager = {
|
|
823
715
|
var initialized = new plugin(sortable, el, sortable.options);
|
824
716
|
initialized.sortable = sortable;
|
825
717
|
initialized.options = sortable.options;
|
826
|
-
sortable[pluginName] = initialized;
|
718
|
+
sortable[pluginName] = initialized;
|
827
719
|
|
720
|
+
// Add default options from plugin
|
828
721
|
_extends(defaults, initialized.defaults);
|
829
722
|
});
|
830
|
-
|
831
723
|
for (var option in sortable.options) {
|
832
724
|
if (!sortable.options.hasOwnProperty(option)) continue;
|
833
725
|
var modified = this.modifyOption(sortable, option, sortable.options[option]);
|
834
|
-
|
835
726
|
if (typeof modified !== 'undefined') {
|
836
727
|
sortable.options[option] = modified;
|
837
728
|
}
|
@@ -841,7 +732,6 @@ var PluginManager = {
|
|
841
732
|
var eventProperties = {};
|
842
733
|
plugins.forEach(function (plugin) {
|
843
734
|
if (typeof plugin.eventProperties !== 'function') return;
|
844
|
-
|
845
735
|
_extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));
|
846
736
|
});
|
847
737
|
return eventProperties;
|
@@ -850,8 +740,9 @@ var PluginManager = {
|
|
850
740
|
var modifiedValue;
|
851
741
|
plugins.forEach(function (plugin) {
|
852
742
|
// Plugin must exist on the Sortable
|
853
|
-
if (!sortable[plugin.pluginName]) return;
|
743
|
+
if (!sortable[plugin.pluginName]) return;
|
854
744
|
|
745
|
+
// If static option listener exists for this option, call in the context of the Sortable's instance of this plugin
|
855
746
|
if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {
|
856
747
|
modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);
|
857
748
|
}
|
@@ -862,25 +753,25 @@ var PluginManager = {
|
|
862
753
|
|
863
754
|
function dispatchEvent(_ref) {
|
864
755
|
var sortable = _ref.sortable,
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
756
|
+
rootEl = _ref.rootEl,
|
757
|
+
name = _ref.name,
|
758
|
+
targetEl = _ref.targetEl,
|
759
|
+
cloneEl = _ref.cloneEl,
|
760
|
+
toEl = _ref.toEl,
|
761
|
+
fromEl = _ref.fromEl,
|
762
|
+
oldIndex = _ref.oldIndex,
|
763
|
+
newIndex = _ref.newIndex,
|
764
|
+
oldDraggableIndex = _ref.oldDraggableIndex,
|
765
|
+
newDraggableIndex = _ref.newDraggableIndex,
|
766
|
+
originalEvent = _ref.originalEvent,
|
767
|
+
putSortable = _ref.putSortable,
|
768
|
+
extraEventProperties = _ref.extraEventProperties;
|
878
769
|
sortable = sortable || rootEl && rootEl[expando];
|
879
770
|
if (!sortable) return;
|
880
771
|
var evt,
|
881
|
-
|
882
|
-
|
883
|
-
|
772
|
+
options = sortable.options,
|
773
|
+
onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1);
|
774
|
+
// Support for new CustomEvent feature
|
884
775
|
if (window.CustomEvent && !IE11OrLess && !Edge) {
|
885
776
|
evt = new CustomEvent(name, {
|
886
777
|
bubbles: true,
|
@@ -890,7 +781,6 @@ function dispatchEvent(_ref) {
|
|
890
781
|
evt = document.createEvent('Event');
|
891
782
|
evt.initEvent(name, true, true);
|
892
783
|
}
|
893
|
-
|
894
784
|
evt.to = toEl || rootEl;
|
895
785
|
evt.from = fromEl || rootEl;
|
896
786
|
evt.item = targetEl || rootEl;
|
@@ -901,29 +791,23 @@ function dispatchEvent(_ref) {
|
|
901
791
|
evt.newDraggableIndex = newDraggableIndex;
|
902
792
|
evt.originalEvent = originalEvent;
|
903
793
|
evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;
|
904
|
-
|
905
794
|
var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));
|
906
|
-
|
907
795
|
for (var option in allEventProperties) {
|
908
796
|
evt[option] = allEventProperties[option];
|
909
797
|
}
|
910
|
-
|
911
798
|
if (rootEl) {
|
912
799
|
rootEl.dispatchEvent(evt);
|
913
800
|
}
|
914
|
-
|
915
801
|
if (options[onName]) {
|
916
802
|
options[onName].call(sortable, evt);
|
917
803
|
}
|
918
804
|
}
|
919
805
|
|
920
806
|
var _excluded = ["evt"];
|
921
|
-
|
922
807
|
var pluginEvent = function pluginEvent(eventName, sortable) {
|
923
808
|
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
924
|
-
|
925
|
-
|
926
|
-
|
809
|
+
originalEvent = _ref.evt,
|
810
|
+
data = _objectWithoutProperties(_ref, _excluded);
|
927
811
|
PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({
|
928
812
|
dragEl: dragEl,
|
929
813
|
parentEl: parentEl,
|
@@ -958,7 +842,6 @@ var pluginEvent = function pluginEvent(eventName, sortable) {
|
|
958
842
|
}
|
959
843
|
}, data));
|
960
844
|
};
|
961
|
-
|
962
845
|
function _dispatchEvent(info) {
|
963
846
|
dispatchEvent(_objectSpread2({
|
964
847
|
putSortable: putSortable,
|
@@ -971,62 +854,61 @@ function _dispatchEvent(info) {
|
|
971
854
|
newDraggableIndex: newDraggableIndex
|
972
855
|
}, info));
|
973
856
|
}
|
974
|
-
|
975
857
|
var dragEl,
|
976
|
-
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
ghostRelativeParent,
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
858
|
+
parentEl,
|
859
|
+
ghostEl,
|
860
|
+
rootEl,
|
861
|
+
nextEl,
|
862
|
+
lastDownEl,
|
863
|
+
cloneEl,
|
864
|
+
cloneHidden,
|
865
|
+
oldIndex,
|
866
|
+
newIndex,
|
867
|
+
oldDraggableIndex,
|
868
|
+
newDraggableIndex,
|
869
|
+
activeGroup,
|
870
|
+
putSortable,
|
871
|
+
awaitingDragStarted = false,
|
872
|
+
ignoreNextClick = false,
|
873
|
+
sortables = [],
|
874
|
+
tapEvt,
|
875
|
+
touchEvt,
|
876
|
+
lastDx,
|
877
|
+
lastDy,
|
878
|
+
tapDistanceLeft,
|
879
|
+
tapDistanceTop,
|
880
|
+
moved,
|
881
|
+
lastTarget,
|
882
|
+
lastDirection,
|
883
|
+
pastFirstInvertThresh = false,
|
884
|
+
isCircumstantialInvert = false,
|
885
|
+
targetMoveDistance,
|
886
|
+
// For positioning ghost absolutely
|
887
|
+
ghostRelativeParent,
|
888
|
+
ghostRelativeParentInitialScroll = [],
|
889
|
+
// (left, top)
|
890
|
+
|
891
|
+
_silent = false,
|
892
|
+
savedInputChecked = [];
|
1011
893
|
|
894
|
+
/** @const */
|
1012
895
|
var documentExists = typeof document !== 'undefined',
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
var elCSS = css(el),
|
896
|
+
PositionGhostAbsolutely = IOS,
|
897
|
+
CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',
|
898
|
+
// This will not pass for IE9, because IE9 DnD only works on anchors
|
899
|
+
supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),
|
900
|
+
supportCssPointerEvents = function () {
|
901
|
+
if (!documentExists) return;
|
902
|
+
// false when <= IE11
|
903
|
+
if (IE11OrLess) {
|
904
|
+
return false;
|
905
|
+
}
|
906
|
+
var el = document.createElement('x');
|
907
|
+
el.style.cssText = 'pointer-events:auto';
|
908
|
+
return el.style.pointerEvents === 'auto';
|
909
|
+
}(),
|
910
|
+
_detectDirection = function _detectDirection(el, options) {
|
911
|
+
var elCSS = css(el),
|
1030
912
|
elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),
|
1031
913
|
child1 = getChild(el, 0, options),
|
1032
914
|
child2 = getChild(el, 1, options),
|
@@ -1034,102 +916,92 @@ supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in
|
|
1034
916
|
secondChildCSS = child2 && css(child2),
|
1035
917
|
firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,
|
1036
918
|
secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
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';
|
1052
|
-
},
|
1053
|
-
_dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {
|
1054
|
-
var dragElS1Opp = vertical ? dragRect.left : dragRect.top,
|
919
|
+
if (elCSS.display === 'flex') {
|
920
|
+
return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';
|
921
|
+
}
|
922
|
+
if (elCSS.display === 'grid') {
|
923
|
+
return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';
|
924
|
+
}
|
925
|
+
if (child1 && firstChildCSS["float"] && firstChildCSS["float"] !== 'none') {
|
926
|
+
var touchingSideChild2 = firstChildCSS["float"] === 'left' ? 'left' : 'right';
|
927
|
+
return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';
|
928
|
+
}
|
929
|
+
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';
|
930
|
+
},
|
931
|
+
_dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {
|
932
|
+
var dragElS1Opp = vertical ? dragRect.left : dragRect.top,
|
1055
933
|
dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,
|
1056
934
|
dragElOppLength = vertical ? dragRect.width : dragRect.height,
|
1057
935
|
targetS1Opp = vertical ? targetRect.left : targetRect.top,
|
1058
936
|
targetS2Opp = vertical ? targetRect.right : targetRect.bottom,
|
1059
937
|
targetOppLength = vertical ? targetRect.width : targetRect.height;
|
1060
|
-
|
1061
|
-
},
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
var rect = getRect(sortable),
|
938
|
+
return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;
|
939
|
+
},
|
940
|
+
/**
|
941
|
+
* Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.
|
942
|
+
* @param {Number} x X position
|
943
|
+
* @param {Number} y Y position
|
944
|
+
* @return {HTMLElement} Element of the first found nearest Sortable
|
945
|
+
*/
|
946
|
+
_detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {
|
947
|
+
var ret;
|
948
|
+
sortables.some(function (sortable) {
|
949
|
+
var threshold = sortable[expando].options.emptyInsertThreshold;
|
950
|
+
if (!threshold || lastChild(sortable)) return;
|
951
|
+
var rect = getRect(sortable),
|
1075
952
|
insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,
|
1076
953
|
insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;
|
1077
|
-
|
1078
|
-
|
1079
|
-
return ret = sortable;
|
1080
|
-
}
|
1081
|
-
});
|
1082
|
-
return ret;
|
1083
|
-
},
|
1084
|
-
_prepareGroup = function _prepareGroup(options) {
|
1085
|
-
function toFn(value, pull) {
|
1086
|
-
return function (to, from, dragEl, evt) {
|
1087
|
-
var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;
|
1088
|
-
|
1089
|
-
if (value == null && (pull || sameGroup)) {
|
1090
|
-
// Default pull value
|
1091
|
-
// Default pull and put value if same group
|
1092
|
-
return true;
|
1093
|
-
} else if (value == null || value === false) {
|
1094
|
-
return false;
|
1095
|
-
} else if (pull && value === 'clone') {
|
1096
|
-
return value;
|
1097
|
-
} else if (typeof value === 'function') {
|
1098
|
-
return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);
|
1099
|
-
} else {
|
1100
|
-
var otherGroup = (pull ? to : from).options.group.name;
|
1101
|
-
return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;
|
954
|
+
if (insideHorizontally && insideVertically) {
|
955
|
+
return ret = sortable;
|
1102
956
|
}
|
1103
|
-
};
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
}
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
}
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
957
|
+
});
|
958
|
+
return ret;
|
959
|
+
},
|
960
|
+
_prepareGroup = function _prepareGroup(options) {
|
961
|
+
function toFn(value, pull) {
|
962
|
+
return function (to, from, dragEl, evt) {
|
963
|
+
var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;
|
964
|
+
if (value == null && (pull || sameGroup)) {
|
965
|
+
// Default pull value
|
966
|
+
// Default pull and put value if same group
|
967
|
+
return true;
|
968
|
+
} else if (value == null || value === false) {
|
969
|
+
return false;
|
970
|
+
} else if (pull && value === 'clone') {
|
971
|
+
return value;
|
972
|
+
} else if (typeof value === 'function') {
|
973
|
+
return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);
|
974
|
+
} else {
|
975
|
+
var otherGroup = (pull ? to : from).options.group.name;
|
976
|
+
return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;
|
977
|
+
}
|
978
|
+
};
|
979
|
+
}
|
980
|
+
var group = {};
|
981
|
+
var originalGroup = options.group;
|
982
|
+
if (!originalGroup || _typeof(originalGroup) != 'object') {
|
983
|
+
originalGroup = {
|
984
|
+
name: originalGroup
|
985
|
+
};
|
986
|
+
}
|
987
|
+
group.name = originalGroup.name;
|
988
|
+
group.checkPull = toFn(originalGroup.pull, true);
|
989
|
+
group.checkPut = toFn(originalGroup.put);
|
990
|
+
group.revertClone = originalGroup.revertClone;
|
991
|
+
options.group = group;
|
992
|
+
},
|
993
|
+
_hideGhostForTarget = function _hideGhostForTarget() {
|
994
|
+
if (!supportCssPointerEvents && ghostEl) {
|
995
|
+
css(ghostEl, 'display', 'none');
|
996
|
+
}
|
997
|
+
},
|
998
|
+
_unhideGhostForTarget = function _unhideGhostForTarget() {
|
999
|
+
if (!supportCssPointerEvents && ghostEl) {
|
1000
|
+
css(ghostEl, 'display', '');
|
1001
|
+
}
|
1002
|
+
};
|
1132
1003
|
|
1004
|
+
// #1184 fix - Prevent click event on fallback if dragged but item not changed position
|
1133
1005
|
if (documentExists && !ChromeForAndroid) {
|
1134
1006
|
document.addEventListener('click', function (evt) {
|
1135
1007
|
if (ignoreNextClick) {
|
@@ -1141,53 +1013,44 @@ if (documentExists && !ChromeForAndroid) {
|
|
1141
1013
|
}
|
1142
1014
|
}, true);
|
1143
1015
|
}
|
1144
|
-
|
1145
1016
|
var nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {
|
1146
1017
|
if (dragEl) {
|
1147
1018
|
evt = evt.touches ? evt.touches[0] : evt;
|
1148
|
-
|
1149
1019
|
var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);
|
1150
|
-
|
1151
1020
|
if (nearest) {
|
1152
1021
|
// Create imitation event
|
1153
1022
|
var event = {};
|
1154
|
-
|
1155
1023
|
for (var i in evt) {
|
1156
1024
|
if (evt.hasOwnProperty(i)) {
|
1157
1025
|
event[i] = evt[i];
|
1158
1026
|
}
|
1159
1027
|
}
|
1160
|
-
|
1161
1028
|
event.target = event.rootEl = nearest;
|
1162
1029
|
event.preventDefault = void 0;
|
1163
1030
|
event.stopPropagation = void 0;
|
1164
|
-
|
1165
1031
|
nearest[expando]._onDragOver(event);
|
1166
1032
|
}
|
1167
1033
|
}
|
1168
1034
|
};
|
1169
|
-
|
1170
1035
|
var _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {
|
1171
1036
|
if (dragEl) {
|
1172
1037
|
dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
|
1173
1038
|
}
|
1174
1039
|
};
|
1040
|
+
|
1175
1041
|
/**
|
1176
1042
|
* @class Sortable
|
1177
1043
|
* @param {HTMLElement} el
|
1178
1044
|
* @param {Object} [options]
|
1179
1045
|
*/
|
1180
|
-
|
1181
|
-
|
1182
1046
|
function Sortable(el, options) {
|
1183
1047
|
if (!(el && el.nodeType && el.nodeType === 1)) {
|
1184
1048
|
throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(el));
|
1185
1049
|
}
|
1186
|
-
|
1187
1050
|
this.el = el; // root element
|
1051
|
+
this.options = options = _extends({}, options);
|
1188
1052
|
|
1189
|
-
|
1190
|
-
|
1053
|
+
// Export instance
|
1191
1054
|
el[expando] = this;
|
1192
1055
|
var defaults = {
|
1193
1056
|
group: null,
|
@@ -1234,52 +1097,48 @@ function Sortable(el, options) {
|
|
1234
1097
|
supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari,
|
1235
1098
|
emptyInsertThreshold: 5
|
1236
1099
|
};
|
1237
|
-
PluginManager.initializePlugins(this, el, defaults);
|
1100
|
+
PluginManager.initializePlugins(this, el, defaults);
|
1238
1101
|
|
1102
|
+
// Set default options
|
1239
1103
|
for (var name in defaults) {
|
1240
1104
|
!(name in options) && (options[name] = defaults[name]);
|
1241
1105
|
}
|
1106
|
+
_prepareGroup(options);
|
1242
1107
|
|
1243
|
-
|
1244
|
-
|
1245
|
-
|
1108
|
+
// Bind all private methods
|
1246
1109
|
for (var fn in this) {
|
1247
1110
|
if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
|
1248
1111
|
this[fn] = this[fn].bind(this);
|
1249
1112
|
}
|
1250
|
-
}
|
1251
|
-
|
1113
|
+
}
|
1252
1114
|
|
1115
|
+
// Setup drag mode
|
1253
1116
|
this.nativeDraggable = options.forceFallback ? false : supportDraggable;
|
1254
|
-
|
1255
1117
|
if (this.nativeDraggable) {
|
1256
1118
|
// Touch start threshold cannot be greater than the native dragstart threshold
|
1257
1119
|
this.options.touchStartThreshold = 1;
|
1258
|
-
}
|
1259
|
-
|
1120
|
+
}
|
1260
1121
|
|
1122
|
+
// Bind events
|
1261
1123
|
if (options.supportPointer) {
|
1262
1124
|
on(el, 'pointerdown', this._onTapStart);
|
1263
1125
|
} else {
|
1264
1126
|
on(el, 'mousedown', this._onTapStart);
|
1265
1127
|
on(el, 'touchstart', this._onTapStart);
|
1266
1128
|
}
|
1267
|
-
|
1268
1129
|
if (this.nativeDraggable) {
|
1269
1130
|
on(el, 'dragover', this);
|
1270
1131
|
on(el, 'dragenter', this);
|
1271
1132
|
}
|
1133
|
+
sortables.push(this.el);
|
1272
1134
|
|
1273
|
-
|
1274
|
-
|
1275
|
-
options.store && options.store.get && this.sort(options.store.get(this) || []); // Add animation state manager
|
1135
|
+
// Restore sorting
|
1136
|
+
options.store && options.store.get && this.sort(options.store.get(this) || []);
|
1276
1137
|
|
1138
|
+
// Add animation state manager
|
1277
1139
|
_extends(this, AnimationStateManager());
|
1278
1140
|
}
|
1279
|
-
|
1280
|
-
Sortable.prototype =
|
1281
|
-
/** @lends Sortable.prototype */
|
1282
|
-
{
|
1141
|
+
Sortable.prototype = /** @lends Sortable.prototype */{
|
1283
1142
|
constructor: Sortable,
|
1284
1143
|
_isOutsideThisEl: function _isOutsideThisEl(target) {
|
1285
1144
|
if (!this.el.contains(target) && target !== this.el) {
|
@@ -1289,57 +1148,50 @@ Sortable.prototype =
|
|
1289
1148
|
_getDirection: function _getDirection(evt, target) {
|
1290
1149
|
return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;
|
1291
1150
|
},
|
1292
|
-
_onTapStart: function _onTapStart(
|
1293
|
-
/** Event|TouchEvent */
|
1294
|
-
evt) {
|
1151
|
+
_onTapStart: function _onTapStart( /** Event|TouchEvent */evt) {
|
1295
1152
|
if (!evt.cancelable) return;
|
1296
|
-
|
1297
1153
|
var _this = this,
|
1298
|
-
|
1299
|
-
|
1300
|
-
|
1301
|
-
|
1302
|
-
|
1303
|
-
|
1304
|
-
|
1305
|
-
|
1306
|
-
|
1307
|
-
|
1308
|
-
|
1309
|
-
|
1154
|
+
el = this.el,
|
1155
|
+
options = this.options,
|
1156
|
+
preventOnFilter = options.preventOnFilter,
|
1157
|
+
type = evt.type,
|
1158
|
+
touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,
|
1159
|
+
target = (touch || evt).target,
|
1160
|
+
originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,
|
1161
|
+
filter = options.filter;
|
1162
|
+
_saveInputCheckedState(el);
|
1163
|
+
|
1164
|
+
// Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.
|
1310
1165
|
if (dragEl) {
|
1311
1166
|
return;
|
1312
1167
|
}
|
1313
|
-
|
1314
1168
|
if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {
|
1315
1169
|
return; // only left button and enabled
|
1316
|
-
}
|
1317
|
-
|
1170
|
+
}
|
1318
1171
|
|
1172
|
+
// cancel dnd if original target is content editable
|
1319
1173
|
if (originalTarget.isContentEditable) {
|
1320
1174
|
return;
|
1321
|
-
}
|
1322
|
-
|
1175
|
+
}
|
1323
1176
|
|
1177
|
+
// Safari ignores further event handling after mousedown
|
1324
1178
|
if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {
|
1325
1179
|
return;
|
1326
1180
|
}
|
1327
|
-
|
1328
1181
|
target = closest(target, options.draggable, el, false);
|
1329
|
-
|
1330
1182
|
if (target && target.animated) {
|
1331
1183
|
return;
|
1332
1184
|
}
|
1333
|
-
|
1334
1185
|
if (lastDownEl === target) {
|
1335
1186
|
// Ignoring duplicate `down`
|
1336
1187
|
return;
|
1337
|
-
}
|
1338
|
-
|
1188
|
+
}
|
1339
1189
|
|
1190
|
+
// Get the index of the dragged element within its parent
|
1340
1191
|
oldIndex = index(target);
|
1341
|
-
oldDraggableIndex = index(target, options.draggable);
|
1192
|
+
oldDraggableIndex = index(target, options.draggable);
|
1342
1193
|
|
1194
|
+
// Check filter
|
1343
1195
|
if (typeof filter === 'function') {
|
1344
1196
|
if (filter.call(this, evt, target, this)) {
|
1345
1197
|
_dispatchEvent({
|
@@ -1350,7 +1202,6 @@ Sortable.prototype =
|
|
1350
1202
|
toEl: el,
|
1351
1203
|
fromEl: el
|
1352
1204
|
});
|
1353
|
-
|
1354
1205
|
pluginEvent('filter', _this, {
|
1355
1206
|
evt: evt
|
1356
1207
|
});
|
@@ -1360,7 +1211,6 @@ Sortable.prototype =
|
|
1360
1211
|
} else if (filter) {
|
1361
1212
|
filter = filter.split(',').some(function (criteria) {
|
1362
1213
|
criteria = closest(originalTarget, criteria.trim(), el, false);
|
1363
|
-
|
1364
1214
|
if (criteria) {
|
1365
1215
|
_dispatchEvent({
|
1366
1216
|
sortable: _this,
|
@@ -1370,40 +1220,30 @@ Sortable.prototype =
|
|
1370
1220
|
fromEl: el,
|
1371
1221
|
toEl: el
|
1372
1222
|
});
|
1373
|
-
|
1374
1223
|
pluginEvent('filter', _this, {
|
1375
1224
|
evt: evt
|
1376
1225
|
});
|
1377
1226
|
return true;
|
1378
1227
|
}
|
1379
1228
|
});
|
1380
|
-
|
1381
1229
|
if (filter) {
|
1382
1230
|
preventOnFilter && evt.cancelable && evt.preventDefault();
|
1383
1231
|
return; // cancel dnd
|
1384
1232
|
}
|
1385
1233
|
}
|
1386
|
-
|
1387
1234
|
if (options.handle && !closest(originalTarget, options.handle, el, false)) {
|
1388
1235
|
return;
|
1389
|
-
}
|
1390
|
-
|
1236
|
+
}
|
1391
1237
|
|
1238
|
+
// Prepare `dragstart`
|
1392
1239
|
this._prepareDragStart(evt, touch, target);
|
1393
1240
|
},
|
1394
|
-
_prepareDragStart: function _prepareDragStart(
|
1395
|
-
/** Event */
|
1396
|
-
evt,
|
1397
|
-
/** Touch */
|
1398
|
-
touch,
|
1399
|
-
/** HTMLElement */
|
1400
|
-
target) {
|
1241
|
+
_prepareDragStart: function _prepareDragStart( /** Event */evt, /** Touch */touch, /** HTMLElement */target) {
|
1401
1242
|
var _this = this,
|
1402
|
-
|
1403
|
-
|
1404
|
-
|
1405
|
-
|
1406
|
-
|
1243
|
+
el = _this.el,
|
1244
|
+
options = _this.options,
|
1245
|
+
ownerDocument = el.ownerDocument,
|
1246
|
+
dragStartFn;
|
1407
1247
|
if (target && !dragEl && target.parentNode === el) {
|
1408
1248
|
var dragRect = getRect(target);
|
1409
1249
|
rootEl = el;
|
@@ -1423,41 +1263,36 @@ Sortable.prototype =
|
|
1423
1263
|
this._lastX = (touch || evt).clientX;
|
1424
1264
|
this._lastY = (touch || evt).clientY;
|
1425
1265
|
dragEl.style['will-change'] = 'all';
|
1426
|
-
|
1427
1266
|
dragStartFn = function dragStartFn() {
|
1428
1267
|
pluginEvent('delayEnded', _this, {
|
1429
1268
|
evt: evt
|
1430
1269
|
});
|
1431
|
-
|
1432
1270
|
if (Sortable.eventCanceled) {
|
1433
1271
|
_this._onDrop();
|
1434
|
-
|
1435
1272
|
return;
|
1436
|
-
}
|
1273
|
+
}
|
1274
|
+
// Delayed drag has been triggered
|
1437
1275
|
// we can re-enable the events: touchmove/mousemove
|
1438
|
-
|
1439
|
-
|
1440
1276
|
_this._disableDelayedDragEvents();
|
1441
|
-
|
1442
1277
|
if (!FireFox && _this.nativeDraggable) {
|
1443
1278
|
dragEl.draggable = true;
|
1444
|
-
}
|
1445
|
-
|
1446
|
-
|
1447
|
-
_this._triggerDragStart(evt, touch); // Drag start event
|
1279
|
+
}
|
1448
1280
|
|
1281
|
+
// Bind the events: dragstart/dragend
|
1282
|
+
_this._triggerDragStart(evt, touch);
|
1449
1283
|
|
1284
|
+
// Drag start event
|
1450
1285
|
_dispatchEvent({
|
1451
1286
|
sortable: _this,
|
1452
1287
|
name: 'choose',
|
1453
1288
|
originalEvent: evt
|
1454
|
-
});
|
1455
|
-
|
1289
|
+
});
|
1456
1290
|
|
1291
|
+
// Chosen item
|
1457
1292
|
toggleClass(dragEl, options.chosenClass, true);
|
1458
|
-
};
|
1459
|
-
|
1293
|
+
};
|
1460
1294
|
|
1295
|
+
// Disable "draggable"
|
1461
1296
|
options.ignore.split(',').forEach(function (criteria) {
|
1462
1297
|
find(dragEl, criteria.trim(), _disableDraggable);
|
1463
1298
|
});
|
@@ -1466,27 +1301,26 @@ Sortable.prototype =
|
|
1466
1301
|
on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);
|
1467
1302
|
on(ownerDocument, 'mouseup', _this._onDrop);
|
1468
1303
|
on(ownerDocument, 'touchend', _this._onDrop);
|
1469
|
-
on(ownerDocument, 'touchcancel', _this._onDrop);
|
1304
|
+
on(ownerDocument, 'touchcancel', _this._onDrop);
|
1470
1305
|
|
1306
|
+
// Make dragEl draggable (must be before delay for FireFox)
|
1471
1307
|
if (FireFox && this.nativeDraggable) {
|
1472
1308
|
this.options.touchStartThreshold = 4;
|
1473
1309
|
dragEl.draggable = true;
|
1474
1310
|
}
|
1475
|
-
|
1476
1311
|
pluginEvent('delayStart', this, {
|
1477
1312
|
evt: evt
|
1478
|
-
});
|
1313
|
+
});
|
1479
1314
|
|
1315
|
+
// Delay is impossible for native DnD in Edge or IE
|
1480
1316
|
if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {
|
1481
1317
|
if (Sortable.eventCanceled) {
|
1482
1318
|
this._onDrop();
|
1483
|
-
|
1484
1319
|
return;
|
1485
|
-
}
|
1320
|
+
}
|
1321
|
+
// If the user moves the pointer or let go the click or touch
|
1486
1322
|
// before the delay has been reached:
|
1487
1323
|
// disable the delayed drag
|
1488
|
-
|
1489
|
-
|
1490
1324
|
on(ownerDocument, 'mouseup', _this._disableDelayedDrag);
|
1491
1325
|
on(ownerDocument, 'touchend', _this._disableDelayedDrag);
|
1492
1326
|
on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);
|
@@ -1499,11 +1333,8 @@ Sortable.prototype =
|
|
1499
1333
|
}
|
1500
1334
|
}
|
1501
1335
|
},
|
1502
|
-
_delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler(
|
1503
|
-
/** TouchEvent|PointerEvent **/
|
1504
|
-
e) {
|
1336
|
+
_delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler( /** TouchEvent|PointerEvent **/e) {
|
1505
1337
|
var touch = e.touches ? e.touches[0] : e;
|
1506
|
-
|
1507
1338
|
if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {
|
1508
1339
|
this._disableDelayedDrag();
|
1509
1340
|
}
|
@@ -1511,7 +1342,6 @@ Sortable.prototype =
|
|
1511
1342
|
_disableDelayedDrag: function _disableDelayedDrag() {
|
1512
1343
|
dragEl && _disableDraggable(dragEl);
|
1513
1344
|
clearTimeout(this._dragStartTimer);
|
1514
|
-
|
1515
1345
|
this._disableDelayedDragEvents();
|
1516
1346
|
},
|
1517
1347
|
_disableDelayedDragEvents: function _disableDelayedDragEvents() {
|
@@ -1523,13 +1353,8 @@ Sortable.prototype =
|
|
1523
1353
|
off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);
|
1524
1354
|
off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);
|
1525
1355
|
},
|
1526
|
-
_triggerDragStart: function _triggerDragStart(
|
1527
|
-
/** Event */
|
1528
|
-
evt,
|
1529
|
-
/** Touch */
|
1530
|
-
touch) {
|
1356
|
+
_triggerDragStart: function _triggerDragStart( /** Event */evt, /** Touch */touch) {
|
1531
1357
|
touch = touch || evt.pointerType == 'touch' && evt;
|
1532
|
-
|
1533
1358
|
if (!this.nativeDraggable || touch) {
|
1534
1359
|
if (this.options.supportPointer) {
|
1535
1360
|
on(document, 'pointermove', this._onTouchMove);
|
@@ -1542,7 +1367,6 @@ Sortable.prototype =
|
|
1542
1367
|
on(dragEl, 'dragend', this);
|
1543
1368
|
on(rootEl, 'dragstart', this._onDragStart);
|
1544
1369
|
}
|
1545
|
-
|
1546
1370
|
try {
|
1547
1371
|
if (document.selection) {
|
1548
1372
|
// Timeout neccessary for IE9
|
@@ -1555,25 +1379,23 @@ Sortable.prototype =
|
|
1555
1379
|
} catch (err) {}
|
1556
1380
|
},
|
1557
1381
|
_dragStarted: function _dragStarted(fallback, evt) {
|
1558
|
-
|
1559
1382
|
awaitingDragStarted = false;
|
1560
|
-
|
1561
1383
|
if (rootEl && dragEl) {
|
1562
1384
|
pluginEvent('dragStarted', this, {
|
1563
1385
|
evt: evt
|
1564
1386
|
});
|
1565
|
-
|
1566
1387
|
if (this.nativeDraggable) {
|
1567
1388
|
on(document, 'dragover', _checkOutsideTargetEl);
|
1568
1389
|
}
|
1390
|
+
var options = this.options;
|
1569
1391
|
|
1570
|
-
|
1571
|
-
|
1392
|
+
// Apply effect
|
1572
1393
|
!fallback && toggleClass(dragEl, options.dragClass, false);
|
1573
1394
|
toggleClass(dragEl, options.ghostClass, true);
|
1574
1395
|
Sortable.active = this;
|
1575
|
-
fallback && this._appendGhost();
|
1396
|
+
fallback && this._appendGhost();
|
1576
1397
|
|
1398
|
+
// Drag start event
|
1577
1399
|
_dispatchEvent({
|
1578
1400
|
sortable: this,
|
1579
1401
|
name: 'start',
|
@@ -1587,20 +1409,15 @@ Sortable.prototype =
|
|
1587
1409
|
if (touchEvt) {
|
1588
1410
|
this._lastX = touchEvt.clientX;
|
1589
1411
|
this._lastY = touchEvt.clientY;
|
1590
|
-
|
1591
1412
|
_hideGhostForTarget();
|
1592
|
-
|
1593
1413
|
var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
|
1594
1414
|
var parent = target;
|
1595
|
-
|
1596
1415
|
while (target && target.shadowRoot) {
|
1597
1416
|
target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
|
1598
1417
|
if (target === parent) break;
|
1599
1418
|
parent = target;
|
1600
1419
|
}
|
1601
|
-
|
1602
1420
|
dragEl.parentNode[expando]._isOutsideThisEl(target);
|
1603
|
-
|
1604
1421
|
if (parent) {
|
1605
1422
|
do {
|
1606
1423
|
if (parent[expando]) {
|
@@ -1611,44 +1428,37 @@ Sortable.prototype =
|
|
1611
1428
|
target: target,
|
1612
1429
|
rootEl: parent
|
1613
1430
|
});
|
1614
|
-
|
1615
1431
|
if (inserted && !this.options.dragoverBubble) {
|
1616
1432
|
break;
|
1617
1433
|
}
|
1618
1434
|
}
|
1619
|
-
|
1620
1435
|
target = parent; // store last element
|
1621
1436
|
}
|
1622
|
-
/* jshint boss:true */
|
1623
|
-
while (parent = parent.parentNode);
|
1437
|
+
/* jshint boss:true */ while (parent = parent.parentNode);
|
1624
1438
|
}
|
1625
|
-
|
1626
1439
|
_unhideGhostForTarget();
|
1627
1440
|
}
|
1628
1441
|
},
|
1629
|
-
_onTouchMove: function _onTouchMove(
|
1630
|
-
/**TouchEvent*/
|
1631
|
-
evt) {
|
1442
|
+
_onTouchMove: function _onTouchMove( /**TouchEvent*/evt) {
|
1632
1443
|
if (tapEvt) {
|
1633
1444
|
var options = this.options,
|
1634
|
-
|
1635
|
-
|
1636
|
-
|
1637
|
-
|
1638
|
-
|
1639
|
-
|
1640
|
-
|
1641
|
-
|
1642
|
-
|
1643
|
-
|
1445
|
+
fallbackTolerance = options.fallbackTolerance,
|
1446
|
+
fallbackOffset = options.fallbackOffset,
|
1447
|
+
touch = evt.touches ? evt.touches[0] : evt,
|
1448
|
+
ghostMatrix = ghostEl && matrix(ghostEl, true),
|
1449
|
+
scaleX = ghostEl && ghostMatrix && ghostMatrix.a,
|
1450
|
+
scaleY = ghostEl && ghostMatrix && ghostMatrix.d,
|
1451
|
+
relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),
|
1452
|
+
dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),
|
1453
|
+
dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1);
|
1454
|
+
|
1455
|
+
// only set the status to dragging, when we are actually dragging
|
1644
1456
|
if (!Sortable.active && !awaitingDragStarted) {
|
1645
1457
|
if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {
|
1646
1458
|
return;
|
1647
1459
|
}
|
1648
|
-
|
1649
1460
|
this._onDragStart(evt, true);
|
1650
1461
|
}
|
1651
|
-
|
1652
1462
|
if (ghostEl) {
|
1653
1463
|
if (ghostMatrix) {
|
1654
1464
|
ghostMatrix.e += dx - (lastDx || 0);
|
@@ -1663,7 +1473,6 @@ Sortable.prototype =
|
|
1663
1473
|
f: dy
|
1664
1474
|
};
|
1665
1475
|
}
|
1666
|
-
|
1667
1476
|
var cssMatrix = "matrix(".concat(ghostMatrix.a, ",").concat(ghostMatrix.b, ",").concat(ghostMatrix.c, ",").concat(ghostMatrix.d, ",").concat(ghostMatrix.e, ",").concat(ghostMatrix.f, ")");
|
1668
1477
|
css(ghostEl, 'webkitTransform', cssMatrix);
|
1669
1478
|
css(ghostEl, 'mozTransform', cssMatrix);
|
@@ -1673,7 +1482,6 @@ Sortable.prototype =
|
|
1673
1482
|
lastDy = dy;
|
1674
1483
|
touchEvt = touch;
|
1675
1484
|
}
|
1676
|
-
|
1677
1485
|
evt.cancelable && evt.preventDefault();
|
1678
1486
|
}
|
1679
1487
|
},
|
@@ -1682,17 +1490,16 @@ Sortable.prototype =
|
|
1682
1490
|
// Not being adjusted for
|
1683
1491
|
if (!ghostEl) {
|
1684
1492
|
var container = this.options.fallbackOnBody ? document.body : rootEl,
|
1685
|
-
|
1686
|
-
|
1493
|
+
rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),
|
1494
|
+
options = this.options;
|
1687
1495
|
|
1496
|
+
// Position absolutely
|
1688
1497
|
if (PositionGhostAbsolutely) {
|
1689
1498
|
// Get relatively positioned parent
|
1690
1499
|
ghostRelativeParent = container;
|
1691
|
-
|
1692
1500
|
while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {
|
1693
1501
|
ghostRelativeParent = ghostRelativeParent.parentNode;
|
1694
1502
|
}
|
1695
|
-
|
1696
1503
|
if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {
|
1697
1504
|
if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();
|
1698
1505
|
rect.top += ghostRelativeParent.scrollTop;
|
@@ -1700,10 +1507,8 @@ Sortable.prototype =
|
|
1700
1507
|
} else {
|
1701
1508
|
ghostRelativeParent = getWindowScrollingElement();
|
1702
1509
|
}
|
1703
|
-
|
1704
1510
|
ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);
|
1705
1511
|
}
|
1706
|
-
|
1707
1512
|
ghostEl = dragEl.cloneNode(true);
|
1708
1513
|
toggleClass(ghostEl, options.ghostClass, false);
|
1709
1514
|
toggleClass(ghostEl, options.fallbackClass, true);
|
@@ -1721,62 +1526,50 @@ Sortable.prototype =
|
|
1721
1526
|
css(ghostEl, 'zIndex', '100000');
|
1722
1527
|
css(ghostEl, 'pointerEvents', 'none');
|
1723
1528
|
Sortable.ghost = ghostEl;
|
1724
|
-
container.appendChild(ghostEl);
|
1529
|
+
container.appendChild(ghostEl);
|
1725
1530
|
|
1531
|
+
// Set transform-origin
|
1726
1532
|
css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');
|
1727
1533
|
}
|
1728
1534
|
},
|
1729
|
-
_onDragStart: function _onDragStart(
|
1730
|
-
/**Event*/
|
1731
|
-
evt,
|
1732
|
-
/**boolean*/
|
1733
|
-
fallback) {
|
1535
|
+
_onDragStart: function _onDragStart( /**Event*/evt, /**boolean*/fallback) {
|
1734
1536
|
var _this = this;
|
1735
|
-
|
1736
1537
|
var dataTransfer = evt.dataTransfer;
|
1737
1538
|
var options = _this.options;
|
1738
1539
|
pluginEvent('dragStart', this, {
|
1739
1540
|
evt: evt
|
1740
1541
|
});
|
1741
|
-
|
1742
1542
|
if (Sortable.eventCanceled) {
|
1743
1543
|
this._onDrop();
|
1744
|
-
|
1745
1544
|
return;
|
1746
1545
|
}
|
1747
|
-
|
1748
1546
|
pluginEvent('setupClone', this);
|
1749
|
-
|
1750
1547
|
if (!Sortable.eventCanceled) {
|
1751
1548
|
cloneEl = clone(dragEl);
|
1752
1549
|
cloneEl.removeAttribute("id");
|
1753
1550
|
cloneEl.draggable = false;
|
1754
1551
|
cloneEl.style['will-change'] = '';
|
1755
|
-
|
1756
1552
|
this._hideClone();
|
1757
|
-
|
1758
1553
|
toggleClass(cloneEl, this.options.chosenClass, false);
|
1759
1554
|
Sortable.clone = cloneEl;
|
1760
|
-
}
|
1761
|
-
|
1555
|
+
}
|
1762
1556
|
|
1557
|
+
// #1143: IFrame support workaround
|
1763
1558
|
_this.cloneId = _nextTick(function () {
|
1764
1559
|
pluginEvent('clone', _this);
|
1765
1560
|
if (Sortable.eventCanceled) return;
|
1766
|
-
|
1767
1561
|
if (!_this.options.removeCloneOnHide) {
|
1768
1562
|
rootEl.insertBefore(cloneEl, dragEl);
|
1769
1563
|
}
|
1770
|
-
|
1771
1564
|
_this._hideClone();
|
1772
|
-
|
1773
1565
|
_dispatchEvent({
|
1774
1566
|
sortable: _this,
|
1775
1567
|
name: 'clone'
|
1776
1568
|
});
|
1777
1569
|
});
|
1778
|
-
!fallback && toggleClass(dragEl, options.dragClass, true);
|
1570
|
+
!fallback && toggleClass(dragEl, options.dragClass, true);
|
1779
1571
|
|
1572
|
+
// Set proper drop events
|
1780
1573
|
if (fallback) {
|
1781
1574
|
ignoreNextClick = true;
|
1782
1575
|
_this._loopId = setInterval(_this._emulateDragOver, 50);
|
@@ -1785,47 +1578,40 @@ Sortable.prototype =
|
|
1785
1578
|
off(document, 'mouseup', _this._onDrop);
|
1786
1579
|
off(document, 'touchend', _this._onDrop);
|
1787
1580
|
off(document, 'touchcancel', _this._onDrop);
|
1788
|
-
|
1789
1581
|
if (dataTransfer) {
|
1790
1582
|
dataTransfer.effectAllowed = 'move';
|
1791
1583
|
options.setData && options.setData.call(_this, dataTransfer, dragEl);
|
1792
1584
|
}
|
1585
|
+
on(document, 'drop', _this);
|
1793
1586
|
|
1794
|
-
|
1795
|
-
|
1587
|
+
// #1276 fix:
|
1796
1588
|
css(dragEl, 'transform', 'translateZ(0)');
|
1797
1589
|
}
|
1798
|
-
|
1799
1590
|
awaitingDragStarted = true;
|
1800
1591
|
_this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));
|
1801
1592
|
on(document, 'selectstart', _this);
|
1802
1593
|
moved = true;
|
1803
|
-
|
1804
1594
|
if (Safari) {
|
1805
1595
|
css(document.body, 'user-select', 'none');
|
1806
1596
|
}
|
1807
1597
|
},
|
1808
1598
|
// Returns true - if no further action is needed (either inserted or another condition)
|
1809
|
-
_onDragOver: function _onDragOver(
|
1810
|
-
/**Event*/
|
1811
|
-
evt) {
|
1599
|
+
_onDragOver: function _onDragOver( /**Event*/evt) {
|
1812
1600
|
var el = this.el,
|
1813
|
-
|
1814
|
-
|
1815
|
-
|
1816
|
-
|
1817
|
-
|
1818
|
-
|
1819
|
-
|
1820
|
-
|
1821
|
-
|
1822
|
-
|
1823
|
-
|
1824
|
-
|
1825
|
-
|
1826
|
-
|
1601
|
+
target = evt.target,
|
1602
|
+
dragRect,
|
1603
|
+
targetRect,
|
1604
|
+
revert,
|
1605
|
+
options = this.options,
|
1606
|
+
group = options.group,
|
1607
|
+
activeSortable = Sortable.active,
|
1608
|
+
isOwner = activeGroup === group,
|
1609
|
+
canSort = options.sort,
|
1610
|
+
fromSortable = putSortable || activeSortable,
|
1611
|
+
vertical,
|
1612
|
+
_this = this,
|
1613
|
+
completedFired = false;
|
1827
1614
|
if (_silent) return;
|
1828
|
-
|
1829
1615
|
function dragOverEvent(name, extra) {
|
1830
1616
|
pluginEvent(name, _this, _objectSpread2({
|
1831
1617
|
evt: evt,
|
@@ -1843,25 +1629,22 @@ Sortable.prototype =
|
|
1843
1629
|
},
|
1844
1630
|
changed: changed
|
1845
1631
|
}, extra));
|
1846
|
-
}
|
1847
|
-
|
1632
|
+
}
|
1848
1633
|
|
1634
|
+
// Capture animation state
|
1849
1635
|
function capture() {
|
1850
1636
|
dragOverEvent('dragOverAnimationCapture');
|
1851
|
-
|
1852
1637
|
_this.captureAnimationState();
|
1853
|
-
|
1854
1638
|
if (_this !== fromSortable) {
|
1855
1639
|
fromSortable.captureAnimationState();
|
1856
1640
|
}
|
1857
|
-
}
|
1858
|
-
|
1641
|
+
}
|
1859
1642
|
|
1643
|
+
// Return invocation when dragEl is inserted (or completed)
|
1860
1644
|
function completed(insertion) {
|
1861
1645
|
dragOverEvent('dragOverCompleted', {
|
1862
1646
|
insertion: insertion
|
1863
1647
|
});
|
1864
|
-
|
1865
1648
|
if (insertion) {
|
1866
1649
|
// Clones must be hidden before folding animation to capture dragRectAbsolute properly
|
1867
1650
|
if (isOwner) {
|
@@ -1869,57 +1652,51 @@ Sortable.prototype =
|
|
1869
1652
|
} else {
|
1870
1653
|
activeSortable._showClone(_this);
|
1871
1654
|
}
|
1872
|
-
|
1873
1655
|
if (_this !== fromSortable) {
|
1874
1656
|
// Set ghost class to new sortable's ghost class
|
1875
1657
|
toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);
|
1876
1658
|
toggleClass(dragEl, options.ghostClass, true);
|
1877
1659
|
}
|
1878
|
-
|
1879
1660
|
if (putSortable !== _this && _this !== Sortable.active) {
|
1880
1661
|
putSortable = _this;
|
1881
1662
|
} else if (_this === Sortable.active && putSortable) {
|
1882
1663
|
putSortable = null;
|
1883
|
-
}
|
1884
|
-
|
1664
|
+
}
|
1885
1665
|
|
1666
|
+
// Animation
|
1886
1667
|
if (fromSortable === _this) {
|
1887
1668
|
_this._ignoreWhileAnimating = target;
|
1888
1669
|
}
|
1889
|
-
|
1890
1670
|
_this.animateAll(function () {
|
1891
1671
|
dragOverEvent('dragOverAnimationComplete');
|
1892
1672
|
_this._ignoreWhileAnimating = null;
|
1893
1673
|
});
|
1894
|
-
|
1895
1674
|
if (_this !== fromSortable) {
|
1896
1675
|
fromSortable.animateAll();
|
1897
1676
|
fromSortable._ignoreWhileAnimating = null;
|
1898
1677
|
}
|
1899
|
-
}
|
1900
|
-
|
1678
|
+
}
|
1901
1679
|
|
1680
|
+
// Null lastTarget if it is not inside a previously swapped element
|
1902
1681
|
if (target === dragEl && !dragEl.animated || target === el && !target.animated) {
|
1903
1682
|
lastTarget = null;
|
1904
|
-
}
|
1905
|
-
|
1683
|
+
}
|
1906
1684
|
|
1685
|
+
// no bubbling and not fallback
|
1907
1686
|
if (!options.dragoverBubble && !evt.rootEl && target !== document) {
|
1908
|
-
dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
|
1909
|
-
|
1687
|
+
dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
|
1910
1688
|
|
1689
|
+
// Do not detect for empty insert if already inserted
|
1911
1690
|
!insertion && nearestEmptyInsertDetectEvent(evt);
|
1912
1691
|
}
|
1913
|
-
|
1914
1692
|
!options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();
|
1915
1693
|
return completedFired = true;
|
1916
|
-
}
|
1917
|
-
|
1694
|
+
}
|
1918
1695
|
|
1696
|
+
// Call when dragEl has been inserted
|
1919
1697
|
function changed() {
|
1920
1698
|
newIndex = index(dragEl);
|
1921
1699
|
newDraggableIndex = index(dragEl, options.draggable);
|
1922
|
-
|
1923
1700
|
_dispatchEvent({
|
1924
1701
|
sortable: _this,
|
1925
1702
|
name: 'change',
|
@@ -1929,37 +1706,27 @@ Sortable.prototype =
|
|
1929
1706
|
originalEvent: evt
|
1930
1707
|
});
|
1931
1708
|
}
|
1932
|
-
|
1933
1709
|
if (evt.preventDefault !== void 0) {
|
1934
1710
|
evt.cancelable && evt.preventDefault();
|
1935
1711
|
}
|
1936
|
-
|
1937
1712
|
target = closest(target, options.draggable, el, true);
|
1938
1713
|
dragOverEvent('dragOver');
|
1939
1714
|
if (Sortable.eventCanceled) return completedFired;
|
1940
|
-
|
1941
1715
|
if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {
|
1942
1716
|
return completed(false);
|
1943
1717
|
}
|
1944
|
-
|
1945
1718
|
ignoreNextClick = false;
|
1946
|
-
|
1947
1719
|
if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list
|
1948
1720
|
: putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {
|
1949
1721
|
vertical = this._getDirection(evt, target) === 'vertical';
|
1950
1722
|
dragRect = getRect(dragEl);
|
1951
1723
|
dragOverEvent('dragOverValid');
|
1952
1724
|
if (Sortable.eventCanceled) return completedFired;
|
1953
|
-
|
1954
1725
|
if (revert) {
|
1955
1726
|
parentEl = rootEl; // actualization
|
1956
|
-
|
1957
1727
|
capture();
|
1958
|
-
|
1959
1728
|
this._hideClone();
|
1960
|
-
|
1961
1729
|
dragOverEvent('revert');
|
1962
|
-
|
1963
1730
|
if (!Sortable.eventCanceled) {
|
1964
1731
|
if (nextEl) {
|
1965
1732
|
rootEl.insertBefore(dragEl, nextEl);
|
@@ -1967,38 +1734,32 @@ Sortable.prototype =
|
|
1967
1734
|
rootEl.appendChild(dragEl);
|
1968
1735
|
}
|
1969
1736
|
}
|
1970
|
-
|
1971
1737
|
return completed(true);
|
1972
1738
|
}
|
1973
|
-
|
1974
1739
|
var elLastChild = lastChild(el, options.draggable);
|
1975
|
-
|
1976
1740
|
if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {
|
1977
1741
|
// Insert to end of list
|
1742
|
+
|
1978
1743
|
// If already at end of list: Do not insert
|
1979
1744
|
if (elLastChild === dragEl) {
|
1980
1745
|
return completed(false);
|
1981
|
-
}
|
1982
|
-
|
1746
|
+
}
|
1983
1747
|
|
1748
|
+
// if there is a last element, it is the target
|
1984
1749
|
if (elLastChild && el === evt.target) {
|
1985
1750
|
target = elLastChild;
|
1986
1751
|
}
|
1987
|
-
|
1988
1752
|
if (target) {
|
1989
1753
|
targetRect = getRect(target);
|
1990
1754
|
}
|
1991
|
-
|
1992
1755
|
if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {
|
1993
1756
|
capture();
|
1994
|
-
|
1995
1757
|
if (elLastChild && elLastChild.nextSibling) {
|
1996
1758
|
// the last draggable element is not the last node
|
1997
1759
|
el.insertBefore(dragEl, elLastChild.nextSibling);
|
1998
1760
|
} else {
|
1999
1761
|
el.appendChild(dragEl);
|
2000
1762
|
}
|
2001
|
-
|
2002
1763
|
parentEl = el; // actualization
|
2003
1764
|
|
2004
1765
|
changed();
|
@@ -2007,14 +1768,11 @@ Sortable.prototype =
|
|
2007
1768
|
} else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {
|
2008
1769
|
// Insert to start of list
|
2009
1770
|
var firstChild = getChild(el, 0, options, true);
|
2010
|
-
|
2011
1771
|
if (firstChild === dragEl) {
|
2012
1772
|
return completed(false);
|
2013
1773
|
}
|
2014
|
-
|
2015
1774
|
target = firstChild;
|
2016
1775
|
targetRect = getRect(target);
|
2017
|
-
|
2018
1776
|
if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {
|
2019
1777
|
capture();
|
2020
1778
|
el.insertBefore(dragEl, firstChild);
|
@@ -2026,82 +1784,68 @@ Sortable.prototype =
|
|
2026
1784
|
} else if (target.parentNode === el) {
|
2027
1785
|
targetRect = getRect(target);
|
2028
1786
|
var direction = 0,
|
2029
|
-
|
2030
|
-
|
2031
|
-
|
2032
|
-
|
2033
|
-
|
2034
|
-
|
2035
|
-
|
1787
|
+
targetBeforeFirstSwap,
|
1788
|
+
differentLevel = dragEl.parentNode !== el,
|
1789
|
+
differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),
|
1790
|
+
side1 = vertical ? 'top' : 'left',
|
1791
|
+
scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),
|
1792
|
+
scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;
|
2036
1793
|
if (lastTarget !== target) {
|
2037
1794
|
targetBeforeFirstSwap = targetRect[side1];
|
2038
1795
|
pastFirstInvertThresh = false;
|
2039
1796
|
isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;
|
2040
1797
|
}
|
2041
|
-
|
2042
1798
|
direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);
|
2043
1799
|
var sibling;
|
2044
|
-
|
2045
1800
|
if (direction !== 0) {
|
2046
1801
|
// Check if target is beside dragEl in respective direction (ignoring hidden elements)
|
2047
1802
|
var dragIndex = index(dragEl);
|
2048
|
-
|
2049
1803
|
do {
|
2050
1804
|
dragIndex -= direction;
|
2051
1805
|
sibling = parentEl.children[dragIndex];
|
2052
1806
|
} while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));
|
2053
|
-
}
|
2054
|
-
|
2055
|
-
|
1807
|
+
}
|
1808
|
+
// If dragEl is already beside target: Do not insert
|
2056
1809
|
if (direction === 0 || sibling === target) {
|
2057
1810
|
return completed(false);
|
2058
1811
|
}
|
2059
|
-
|
2060
1812
|
lastTarget = target;
|
2061
1813
|
lastDirection = direction;
|
2062
1814
|
var nextSibling = target.nextElementSibling,
|
2063
|
-
|
1815
|
+
after = false;
|
2064
1816
|
after = direction === 1;
|
2065
|
-
|
2066
1817
|
var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);
|
2067
|
-
|
2068
1818
|
if (moveVector !== false) {
|
2069
1819
|
if (moveVector === 1 || moveVector === -1) {
|
2070
1820
|
after = moveVector === 1;
|
2071
1821
|
}
|
2072
|
-
|
2073
1822
|
_silent = true;
|
2074
1823
|
setTimeout(_unsilent, 30);
|
2075
1824
|
capture();
|
2076
|
-
|
2077
1825
|
if (after && !nextSibling) {
|
2078
1826
|
el.appendChild(dragEl);
|
2079
1827
|
} else {
|
2080
1828
|
target.parentNode.insertBefore(dragEl, after ? nextSibling : target);
|
2081
|
-
}
|
2082
|
-
|
1829
|
+
}
|
2083
1830
|
|
1831
|
+
// Undo chrome's scroll adjustment (has no effect on other browsers)
|
2084
1832
|
if (scrolledPastTop) {
|
2085
1833
|
scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);
|
2086
1834
|
}
|
2087
|
-
|
2088
1835
|
parentEl = dragEl.parentNode; // actualization
|
2089
|
-
// must be done before animation
|
2090
1836
|
|
1837
|
+
// must be done before animation
|
2091
1838
|
if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {
|
2092
1839
|
targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);
|
2093
1840
|
}
|
2094
|
-
|
2095
1841
|
changed();
|
2096
1842
|
return completed(true);
|
2097
1843
|
}
|
2098
1844
|
}
|
2099
|
-
|
2100
1845
|
if (el.contains(dragEl)) {
|
2101
1846
|
return completed(false);
|
2102
1847
|
}
|
2103
1848
|
}
|
2104
|
-
|
2105
1849
|
return false;
|
2106
1850
|
},
|
2107
1851
|
_ignoreWhileAnimating: null,
|
@@ -2121,83 +1865,69 @@ Sortable.prototype =
|
|
2121
1865
|
off(ownerDocument, 'touchcancel', this._onDrop);
|
2122
1866
|
off(document, 'selectstart', this);
|
2123
1867
|
},
|
2124
|
-
_onDrop: function _onDrop(
|
2125
|
-
/**Event*/
|
2126
|
-
evt) {
|
1868
|
+
_onDrop: function _onDrop( /**Event*/evt) {
|
2127
1869
|
var el = this.el,
|
2128
|
-
|
1870
|
+
options = this.options;
|
2129
1871
|
|
1872
|
+
// Get the index of the dragged element within its parent
|
2130
1873
|
newIndex = index(dragEl);
|
2131
1874
|
newDraggableIndex = index(dragEl, options.draggable);
|
2132
1875
|
pluginEvent('drop', this, {
|
2133
1876
|
evt: evt
|
2134
1877
|
});
|
2135
|
-
parentEl = dragEl && dragEl.parentNode;
|
1878
|
+
parentEl = dragEl && dragEl.parentNode;
|
2136
1879
|
|
1880
|
+
// Get again after plugin event
|
2137
1881
|
newIndex = index(dragEl);
|
2138
1882
|
newDraggableIndex = index(dragEl, options.draggable);
|
2139
|
-
|
2140
1883
|
if (Sortable.eventCanceled) {
|
2141
1884
|
this._nulling();
|
2142
|
-
|
2143
1885
|
return;
|
2144
1886
|
}
|
2145
|
-
|
2146
1887
|
awaitingDragStarted = false;
|
2147
1888
|
isCircumstantialInvert = false;
|
2148
1889
|
pastFirstInvertThresh = false;
|
2149
1890
|
clearInterval(this._loopId);
|
2150
1891
|
clearTimeout(this._dragStartTimer);
|
2151
|
-
|
2152
1892
|
_cancelNextTick(this.cloneId);
|
1893
|
+
_cancelNextTick(this._dragStartId);
|
2153
1894
|
|
2154
|
-
|
2155
|
-
|
2156
|
-
|
1895
|
+
// Unbind events
|
2157
1896
|
if (this.nativeDraggable) {
|
2158
1897
|
off(document, 'drop', this);
|
2159
1898
|
off(el, 'dragstart', this._onDragStart);
|
2160
1899
|
}
|
2161
|
-
|
2162
1900
|
this._offMoveEvents();
|
2163
|
-
|
2164
1901
|
this._offUpEvents();
|
2165
|
-
|
2166
1902
|
if (Safari) {
|
2167
1903
|
css(document.body, 'user-select', '');
|
2168
1904
|
}
|
2169
|
-
|
2170
1905
|
css(dragEl, 'transform', '');
|
2171
|
-
|
2172
1906
|
if (evt) {
|
2173
1907
|
if (moved) {
|
2174
1908
|
evt.cancelable && evt.preventDefault();
|
2175
1909
|
!options.dropBubble && evt.stopPropagation();
|
2176
1910
|
}
|
2177
|
-
|
2178
1911
|
ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);
|
2179
|
-
|
2180
1912
|
if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {
|
2181
1913
|
// Remove clone(s)
|
2182
1914
|
cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);
|
2183
1915
|
}
|
2184
|
-
|
2185
1916
|
if (dragEl) {
|
2186
1917
|
if (this.nativeDraggable) {
|
2187
1918
|
off(dragEl, 'dragend', this);
|
2188
1919
|
}
|
2189
|
-
|
2190
1920
|
_disableDraggable(dragEl);
|
1921
|
+
dragEl.style['will-change'] = '';
|
2191
1922
|
|
2192
|
-
|
1923
|
+
// Remove classes
|
2193
1924
|
// ghostClass is added in dragStarted
|
2194
|
-
|
2195
1925
|
if (moved && !awaitingDragStarted) {
|
2196
1926
|
toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);
|
2197
1927
|
}
|
1928
|
+
toggleClass(dragEl, this.options.chosenClass, false);
|
2198
1929
|
|
2199
|
-
|
2200
|
-
|
1930
|
+
// Drag stop event
|
2201
1931
|
_dispatchEvent({
|
2202
1932
|
sortable: this,
|
2203
1933
|
name: 'unchoose',
|
@@ -2206,7 +1936,6 @@ Sortable.prototype =
|
|
2206
1936
|
newDraggableIndex: null,
|
2207
1937
|
originalEvent: evt
|
2208
1938
|
});
|
2209
|
-
|
2210
1939
|
if (rootEl !== parentEl) {
|
2211
1940
|
if (newIndex >= 0) {
|
2212
1941
|
// Add event
|
@@ -2216,17 +1945,17 @@ Sortable.prototype =
|
|
2216
1945
|
toEl: parentEl,
|
2217
1946
|
fromEl: rootEl,
|
2218
1947
|
originalEvent: evt
|
2219
|
-
});
|
2220
|
-
|
1948
|
+
});
|
2221
1949
|
|
1950
|
+
// Remove event
|
2222
1951
|
_dispatchEvent({
|
2223
1952
|
sortable: this,
|
2224
1953
|
name: 'remove',
|
2225
1954
|
toEl: parentEl,
|
2226
1955
|
originalEvent: evt
|
2227
|
-
});
|
2228
|
-
|
1956
|
+
});
|
2229
1957
|
|
1958
|
+
// drag from one list and drop into another
|
2230
1959
|
_dispatchEvent({
|
2231
1960
|
rootEl: parentEl,
|
2232
1961
|
name: 'sort',
|
@@ -2234,7 +1963,6 @@ Sortable.prototype =
|
|
2234
1963
|
fromEl: rootEl,
|
2235
1964
|
originalEvent: evt
|
2236
1965
|
});
|
2237
|
-
|
2238
1966
|
_dispatchEvent({
|
2239
1967
|
sortable: this,
|
2240
1968
|
name: 'sort',
|
@@ -2242,7 +1970,6 @@ Sortable.prototype =
|
|
2242
1970
|
originalEvent: evt
|
2243
1971
|
});
|
2244
1972
|
}
|
2245
|
-
|
2246
1973
|
putSortable && putSortable.save();
|
2247
1974
|
} else {
|
2248
1975
|
if (newIndex !== oldIndex) {
|
@@ -2254,7 +1981,6 @@ Sortable.prototype =
|
|
2254
1981
|
toEl: parentEl,
|
2255
1982
|
originalEvent: evt
|
2256
1983
|
});
|
2257
|
-
|
2258
1984
|
_dispatchEvent({
|
2259
1985
|
sortable: this,
|
2260
1986
|
name: 'sort',
|
@@ -2264,27 +1990,24 @@ Sortable.prototype =
|
|
2264
1990
|
}
|
2265
1991
|
}
|
2266
1992
|
}
|
2267
|
-
|
2268
1993
|
if (Sortable.active) {
|
2269
1994
|
/* jshint eqnull:true */
|
2270
1995
|
if (newIndex == null || newIndex === -1) {
|
2271
1996
|
newIndex = oldIndex;
|
2272
1997
|
newDraggableIndex = oldDraggableIndex;
|
2273
1998
|
}
|
2274
|
-
|
2275
1999
|
_dispatchEvent({
|
2276
2000
|
sortable: this,
|
2277
2001
|
name: 'end',
|
2278
2002
|
toEl: parentEl,
|
2279
2003
|
originalEvent: evt
|
2280
|
-
});
|
2281
|
-
|
2004
|
+
});
|
2282
2005
|
|
2006
|
+
// Save sorting
|
2283
2007
|
this.save();
|
2284
2008
|
}
|
2285
2009
|
}
|
2286
2010
|
}
|
2287
|
-
|
2288
2011
|
this._nulling();
|
2289
2012
|
},
|
2290
2013
|
_nulling: function _nulling() {
|
@@ -2295,65 +2018,52 @@ Sortable.prototype =
|
|
2295
2018
|
});
|
2296
2019
|
savedInputChecked.length = lastDx = lastDy = 0;
|
2297
2020
|
},
|
2298
|
-
handleEvent: function handleEvent(
|
2299
|
-
/**Event*/
|
2300
|
-
evt) {
|
2021
|
+
handleEvent: function handleEvent( /**Event*/evt) {
|
2301
2022
|
switch (evt.type) {
|
2302
2023
|
case 'drop':
|
2303
2024
|
case 'dragend':
|
2304
2025
|
this._onDrop(evt);
|
2305
|
-
|
2306
2026
|
break;
|
2307
|
-
|
2308
2027
|
case 'dragenter':
|
2309
2028
|
case 'dragover':
|
2310
2029
|
if (dragEl) {
|
2311
2030
|
this._onDragOver(evt);
|
2312
|
-
|
2313
2031
|
_globalDragOver(evt);
|
2314
2032
|
}
|
2315
|
-
|
2316
2033
|
break;
|
2317
|
-
|
2318
2034
|
case 'selectstart':
|
2319
2035
|
evt.preventDefault();
|
2320
2036
|
break;
|
2321
2037
|
}
|
2322
2038
|
},
|
2323
|
-
|
2324
2039
|
/**
|
2325
2040
|
* Serializes the item into an array of string.
|
2326
2041
|
* @returns {String[]}
|
2327
2042
|
*/
|
2328
2043
|
toArray: function toArray() {
|
2329
2044
|
var order = [],
|
2330
|
-
|
2331
|
-
|
2332
|
-
|
2333
|
-
|
2334
|
-
|
2335
|
-
|
2045
|
+
el,
|
2046
|
+
children = this.el.children,
|
2047
|
+
i = 0,
|
2048
|
+
n = children.length,
|
2049
|
+
options = this.options;
|
2336
2050
|
for (; i < n; i++) {
|
2337
2051
|
el = children[i];
|
2338
|
-
|
2339
2052
|
if (closest(el, options.draggable, this.el, false)) {
|
2340
2053
|
order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));
|
2341
2054
|
}
|
2342
2055
|
}
|
2343
|
-
|
2344
2056
|
return order;
|
2345
2057
|
},
|
2346
|
-
|
2347
2058
|
/**
|
2348
2059
|
* Sorts the elements according to the array.
|
2349
2060
|
* @param {String[]} order order of the items
|
2350
2061
|
*/
|
2351
2062
|
sort: function sort(order, useAnimation) {
|
2352
2063
|
var items = {},
|
2353
|
-
|
2064
|
+
rootEl = this.el;
|
2354
2065
|
this.toArray().forEach(function (id, i) {
|
2355
2066
|
var el = rootEl.children[i];
|
2356
|
-
|
2357
2067
|
if (closest(el, this.options.draggable, rootEl, false)) {
|
2358
2068
|
items[id] = el;
|
2359
2069
|
}
|
@@ -2367,7 +2077,6 @@ Sortable.prototype =
|
|
2367
2077
|
});
|
2368
2078
|
useAnimation && this.animateAll();
|
2369
2079
|
},
|
2370
|
-
|
2371
2080
|
/**
|
2372
2081
|
* Save the current sorting
|
2373
2082
|
*/
|
@@ -2375,7 +2084,6 @@ Sortable.prototype =
|
|
2375
2084
|
var store = this.options.store;
|
2376
2085
|
store && store.set && store.set(this);
|
2377
2086
|
},
|
2378
|
-
|
2379
2087
|
/**
|
2380
2088
|
* 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.
|
2381
2089
|
* @param {HTMLElement} el
|
@@ -2385,7 +2093,6 @@ Sortable.prototype =
|
|
2385
2093
|
closest: function closest$1(el, selector) {
|
2386
2094
|
return closest(el, selector || this.options.draggable, this.el, false);
|
2387
2095
|
},
|
2388
|
-
|
2389
2096
|
/**
|
2390
2097
|
* Set/get option
|
2391
2098
|
* @param {string} name
|
@@ -2394,24 +2101,20 @@ Sortable.prototype =
|
|
2394
2101
|
*/
|
2395
2102
|
option: function option(name, value) {
|
2396
2103
|
var options = this.options;
|
2397
|
-
|
2398
2104
|
if (value === void 0) {
|
2399
2105
|
return options[name];
|
2400
2106
|
} else {
|
2401
2107
|
var modifiedValue = PluginManager.modifyOption(this, name, value);
|
2402
|
-
|
2403
2108
|
if (typeof modifiedValue !== 'undefined') {
|
2404
2109
|
options[name] = modifiedValue;
|
2405
2110
|
} else {
|
2406
2111
|
options[name] = value;
|
2407
2112
|
}
|
2408
|
-
|
2409
2113
|
if (name === 'group') {
|
2410
2114
|
_prepareGroup(options);
|
2411
2115
|
}
|
2412
2116
|
}
|
2413
2117
|
},
|
2414
|
-
|
2415
2118
|
/**
|
2416
2119
|
* Destroy
|
2417
2120
|
*/
|
@@ -2422,21 +2125,16 @@ Sortable.prototype =
|
|
2422
2125
|
off(el, 'mousedown', this._onTapStart);
|
2423
2126
|
off(el, 'touchstart', this._onTapStart);
|
2424
2127
|
off(el, 'pointerdown', this._onTapStart);
|
2425
|
-
|
2426
2128
|
if (this.nativeDraggable) {
|
2427
2129
|
off(el, 'dragover', this);
|
2428
2130
|
off(el, 'dragenter', this);
|
2429
|
-
}
|
2430
|
-
|
2431
|
-
|
2131
|
+
}
|
2132
|
+
// Remove draggable attributes
|
2432
2133
|
Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {
|
2433
2134
|
el.removeAttribute('draggable');
|
2434
2135
|
});
|
2435
|
-
|
2436
2136
|
this._onDrop();
|
2437
|
-
|
2438
2137
|
this._disableDelayedDragEvents();
|
2439
|
-
|
2440
2138
|
sortables.splice(sortables.indexOf(this.el), 1);
|
2441
2139
|
this.el = el = null;
|
2442
2140
|
},
|
@@ -2445,25 +2143,22 @@ Sortable.prototype =
|
|
2445
2143
|
pluginEvent('hideClone', this);
|
2446
2144
|
if (Sortable.eventCanceled) return;
|
2447
2145
|
css(cloneEl, 'display', 'none');
|
2448
|
-
|
2449
2146
|
if (this.options.removeCloneOnHide && cloneEl.parentNode) {
|
2450
2147
|
cloneEl.parentNode.removeChild(cloneEl);
|
2451
2148
|
}
|
2452
|
-
|
2453
2149
|
cloneHidden = true;
|
2454
2150
|
}
|
2455
2151
|
},
|
2456
2152
|
_showClone: function _showClone(putSortable) {
|
2457
2153
|
if (putSortable.lastPutMode !== 'clone') {
|
2458
2154
|
this._hideClone();
|
2459
|
-
|
2460
2155
|
return;
|
2461
2156
|
}
|
2462
|
-
|
2463
2157
|
if (cloneHidden) {
|
2464
2158
|
pluginEvent('showClone', this);
|
2465
|
-
if (Sortable.eventCanceled) return;
|
2159
|
+
if (Sortable.eventCanceled) return;
|
2466
2160
|
|
2161
|
+
// show clone at dragEl or original position
|
2467
2162
|
if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {
|
2468
2163
|
rootEl.insertBefore(cloneEl, dragEl);
|
2469
2164
|
} else if (nextEl) {
|
@@ -2471,33 +2166,26 @@ Sortable.prototype =
|
|
2471
2166
|
} else {
|
2472
2167
|
rootEl.appendChild(cloneEl);
|
2473
2168
|
}
|
2474
|
-
|
2475
2169
|
if (this.options.group.revertClone) {
|
2476
2170
|
this.animate(dragEl, cloneEl);
|
2477
2171
|
}
|
2478
|
-
|
2479
2172
|
css(cloneEl, 'display', '');
|
2480
2173
|
cloneHidden = false;
|
2481
2174
|
}
|
2482
2175
|
}
|
2483
2176
|
};
|
2484
|
-
|
2485
|
-
function _globalDragOver(
|
2486
|
-
/**Event*/
|
2487
|
-
evt) {
|
2177
|
+
function _globalDragOver( /**Event*/evt) {
|
2488
2178
|
if (evt.dataTransfer) {
|
2489
2179
|
evt.dataTransfer.dropEffect = 'move';
|
2490
2180
|
}
|
2491
|
-
|
2492
2181
|
evt.cancelable && evt.preventDefault();
|
2493
2182
|
}
|
2494
|
-
|
2495
2183
|
function _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {
|
2496
2184
|
var evt,
|
2497
|
-
|
2498
|
-
|
2499
|
-
|
2500
|
-
|
2185
|
+
sortable = fromEl[expando],
|
2186
|
+
onMoveFn = sortable.options.onMove,
|
2187
|
+
retVal;
|
2188
|
+
// Support for new CustomEvent feature
|
2501
2189
|
if (window.CustomEvent && !IE11OrLess && !Edge) {
|
2502
2190
|
evt = new CustomEvent('move', {
|
2503
2191
|
bubbles: true,
|
@@ -2507,7 +2195,6 @@ function _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalE
|
|
2507
2195
|
evt = document.createEvent('Event');
|
2508
2196
|
evt.initEvent('move', true, true);
|
2509
2197
|
}
|
2510
|
-
|
2511
2198
|
evt.to = toEl;
|
2512
2199
|
evt.from = fromEl;
|
2513
2200
|
evt.dragged = dragEl;
|
@@ -2517,41 +2204,35 @@ function _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalE
|
|
2517
2204
|
evt.willInsertAfter = willInsertAfter;
|
2518
2205
|
evt.originalEvent = originalEvent;
|
2519
2206
|
fromEl.dispatchEvent(evt);
|
2520
|
-
|
2521
2207
|
if (onMoveFn) {
|
2522
2208
|
retVal = onMoveFn.call(sortable, evt, originalEvent);
|
2523
2209
|
}
|
2524
|
-
|
2525
2210
|
return retVal;
|
2526
2211
|
}
|
2527
|
-
|
2528
2212
|
function _disableDraggable(el) {
|
2529
2213
|
el.draggable = false;
|
2530
2214
|
}
|
2531
|
-
|
2532
2215
|
function _unsilent() {
|
2533
2216
|
_silent = false;
|
2534
2217
|
}
|
2535
|
-
|
2536
2218
|
function _ghostIsFirst(evt, vertical, sortable) {
|
2537
|
-
var
|
2219
|
+
var firstElRect = getRect(getChild(sortable.el, 0, sortable.options, true));
|
2220
|
+
var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);
|
2538
2221
|
var spacer = 10;
|
2539
|
-
return vertical ? evt.clientX <
|
2222
|
+
return vertical ? evt.clientX < childContainingRect.left - spacer || evt.clientY < firstElRect.top && evt.clientX < firstElRect.right : evt.clientY < childContainingRect.top - spacer || evt.clientY < firstElRect.bottom && evt.clientX < firstElRect.left;
|
2540
2223
|
}
|
2541
|
-
|
2542
2224
|
function _ghostIsLast(evt, vertical, sortable) {
|
2543
|
-
var
|
2225
|
+
var lastElRect = getRect(lastChild(sortable.el, sortable.options.draggable));
|
2226
|
+
var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);
|
2544
2227
|
var spacer = 10;
|
2545
|
-
return vertical ? evt.clientX >
|
2228
|
+
return vertical ? evt.clientX > childContainingRect.right + spacer || evt.clientY > lastElRect.bottom && evt.clientX > lastElRect.left : evt.clientY > childContainingRect.bottom + spacer || evt.clientX > lastElRect.right && evt.clientY > lastElRect.top;
|
2546
2229
|
}
|
2547
|
-
|
2548
2230
|
function _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {
|
2549
2231
|
var mouseOnAxis = vertical ? evt.clientY : evt.clientX,
|
2550
|
-
|
2551
|
-
|
2552
|
-
|
2553
|
-
|
2554
|
-
|
2232
|
+
targetLength = vertical ? targetRect.height : targetRect.width,
|
2233
|
+
targetS1 = vertical ? targetRect.top : targetRect.left,
|
2234
|
+
targetS2 = vertical ? targetRect.bottom : targetRect.right,
|
2235
|
+
invert = false;
|
2555
2236
|
if (!invertSwap) {
|
2556
2237
|
// Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold
|
2557
2238
|
if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {
|
@@ -2561,7 +2242,6 @@ function _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, inv
|
|
2561
2242
|
// past first invert threshold, do not restrict inverted threshold to dragEl shadow
|
2562
2243
|
pastFirstInvertThresh = true;
|
2563
2244
|
}
|
2564
|
-
|
2565
2245
|
if (!pastFirstInvertThresh) {
|
2566
2246
|
// dragEl shadow (target move distance shadow)
|
2567
2247
|
if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow
|
@@ -2578,26 +2258,22 @@ function _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, inv
|
|
2578
2258
|
}
|
2579
2259
|
}
|
2580
2260
|
}
|
2581
|
-
|
2582
2261
|
invert = invert || invertSwap;
|
2583
|
-
|
2584
2262
|
if (invert) {
|
2585
2263
|
// Invert of regular
|
2586
2264
|
if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {
|
2587
2265
|
return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;
|
2588
2266
|
}
|
2589
2267
|
}
|
2590
|
-
|
2591
2268
|
return 0;
|
2592
2269
|
}
|
2270
|
+
|
2593
2271
|
/**
|
2594
2272
|
* Gets the direction dragEl must be swapped relative to target in order to make it
|
2595
2273
|
* seem that dragEl has been "inserted" into that element's position
|
2596
2274
|
* @param {HTMLElement} target The target whose position dragEl is being inserted at
|
2597
2275
|
* @return {Number} Direction dragEl must be swapped
|
2598
2276
|
*/
|
2599
|
-
|
2600
|
-
|
2601
2277
|
function _getInsertDirection(target) {
|
2602
2278
|
if (index(dragEl) < index(target)) {
|
2603
2279
|
return 1;
|
@@ -2605,55 +2281,48 @@ function _getInsertDirection(target) {
|
|
2605
2281
|
return -1;
|
2606
2282
|
}
|
2607
2283
|
}
|
2284
|
+
|
2608
2285
|
/**
|
2609
2286
|
* Generate id
|
2610
2287
|
* @param {HTMLElement} el
|
2611
2288
|
* @returns {String}
|
2612
2289
|
* @private
|
2613
2290
|
*/
|
2614
|
-
|
2615
|
-
|
2616
2291
|
function _generateId(el) {
|
2617
2292
|
var str = el.tagName + el.className + el.src + el.href + el.textContent,
|
2618
|
-
|
2619
|
-
|
2620
|
-
|
2293
|
+
i = str.length,
|
2294
|
+
sum = 0;
|
2621
2295
|
while (i--) {
|
2622
2296
|
sum += str.charCodeAt(i);
|
2623
2297
|
}
|
2624
|
-
|
2625
2298
|
return sum.toString(36);
|
2626
2299
|
}
|
2627
|
-
|
2628
2300
|
function _saveInputCheckedState(root) {
|
2629
2301
|
savedInputChecked.length = 0;
|
2630
2302
|
var inputs = root.getElementsByTagName('input');
|
2631
2303
|
var idx = inputs.length;
|
2632
|
-
|
2633
2304
|
while (idx--) {
|
2634
2305
|
var el = inputs[idx];
|
2635
2306
|
el.checked && savedInputChecked.push(el);
|
2636
2307
|
}
|
2637
2308
|
}
|
2638
|
-
|
2639
2309
|
function _nextTick(fn) {
|
2640
2310
|
return setTimeout(fn, 0);
|
2641
2311
|
}
|
2642
|
-
|
2643
2312
|
function _cancelNextTick(id) {
|
2644
2313
|
return clearTimeout(id);
|
2645
|
-
}
|
2646
|
-
|
2314
|
+
}
|
2647
2315
|
|
2316
|
+
// Fixed #973:
|
2648
2317
|
if (documentExists) {
|
2649
2318
|
on(document, 'touchmove', function (evt) {
|
2650
2319
|
if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {
|
2651
2320
|
evt.preventDefault();
|
2652
2321
|
}
|
2653
2322
|
});
|
2654
|
-
}
|
2655
|
-
|
2323
|
+
}
|
2656
2324
|
|
2325
|
+
// Export utils
|
2657
2326
|
Sortable.utils = {
|
2658
2327
|
on: on,
|
2659
2328
|
off: off,
|
@@ -2673,59 +2342,54 @@ Sortable.utils = {
|
|
2673
2342
|
detectDirection: _detectDirection,
|
2674
2343
|
getChild: getChild
|
2675
2344
|
};
|
2345
|
+
|
2676
2346
|
/**
|
2677
2347
|
* Get the Sortable instance of an element
|
2678
2348
|
* @param {HTMLElement} element The element
|
2679
2349
|
* @return {Sortable|undefined} The instance of Sortable
|
2680
2350
|
*/
|
2681
|
-
|
2682
2351
|
Sortable.get = function (element) {
|
2683
2352
|
return element[expando];
|
2684
2353
|
};
|
2354
|
+
|
2685
2355
|
/**
|
2686
2356
|
* Mount a plugin to Sortable
|
2687
2357
|
* @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted
|
2688
2358
|
*/
|
2689
|
-
|
2690
|
-
|
2691
2359
|
Sortable.mount = function () {
|
2692
2360
|
for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {
|
2693
2361
|
plugins[_key] = arguments[_key];
|
2694
2362
|
}
|
2695
|
-
|
2696
2363
|
if (plugins[0].constructor === Array) plugins = plugins[0];
|
2697
2364
|
plugins.forEach(function (plugin) {
|
2698
2365
|
if (!plugin.prototype || !plugin.prototype.constructor) {
|
2699
2366
|
throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(plugin));
|
2700
2367
|
}
|
2701
|
-
|
2702
2368
|
if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);
|
2703
2369
|
PluginManager.mount(plugin);
|
2704
2370
|
});
|
2705
2371
|
};
|
2372
|
+
|
2706
2373
|
/**
|
2707
2374
|
* Create sortable instance
|
2708
2375
|
* @param {HTMLElement} el
|
2709
2376
|
* @param {Object} [options]
|
2710
2377
|
*/
|
2711
|
-
|
2712
|
-
|
2713
2378
|
Sortable.create = function (el, options) {
|
2714
2379
|
return new Sortable(el, options);
|
2715
|
-
};
|
2716
|
-
|
2380
|
+
};
|
2717
2381
|
|
2382
|
+
// Export
|
2718
2383
|
Sortable.version = version;
|
2719
2384
|
|
2720
2385
|
var autoScrolls = [],
|
2721
|
-
|
2722
|
-
|
2723
|
-
|
2724
|
-
|
2725
|
-
|
2726
|
-
|
2727
|
-
|
2728
|
-
|
2386
|
+
scrollEl,
|
2387
|
+
scrollRootEl,
|
2388
|
+
scrolling = false,
|
2389
|
+
lastAutoScrollX,
|
2390
|
+
lastAutoScrollY,
|
2391
|
+
touchEvt$1,
|
2392
|
+
pointerElemChangedInterval;
|
2729
2393
|
function AutoScrollPlugin() {
|
2730
2394
|
function AutoScroll() {
|
2731
2395
|
this.defaults = {
|
@@ -2734,19 +2398,18 @@ function AutoScrollPlugin() {
|
|
2734
2398
|
scrollSensitivity: 30,
|
2735
2399
|
scrollSpeed: 10,
|
2736
2400
|
bubbleScroll: true
|
2737
|
-
};
|
2401
|
+
};
|
2738
2402
|
|
2403
|
+
// Bind all private methods
|
2739
2404
|
for (var fn in this) {
|
2740
2405
|
if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
|
2741
2406
|
this[fn] = this[fn].bind(this);
|
2742
2407
|
}
|
2743
2408
|
}
|
2744
2409
|
}
|
2745
|
-
|
2746
2410
|
AutoScroll.prototype = {
|
2747
2411
|
dragStarted: function dragStarted(_ref) {
|
2748
2412
|
var originalEvent = _ref.originalEvent;
|
2749
|
-
|
2750
2413
|
if (this.sortable.nativeDraggable) {
|
2751
2414
|
on(document, 'dragover', this._handleAutoScroll);
|
2752
2415
|
} else {
|
@@ -2761,7 +2424,6 @@ function AutoScrollPlugin() {
|
|
2761
2424
|
},
|
2762
2425
|
dragOverCompleted: function dragOverCompleted(_ref2) {
|
2763
2426
|
var originalEvent = _ref2.originalEvent;
|
2764
|
-
|
2765
2427
|
// For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)
|
2766
2428
|
if (!this.options.dragOverBubble && !originalEvent.rootEl) {
|
2767
2429
|
this._handleAutoScroll(originalEvent);
|
@@ -2775,7 +2437,6 @@ function AutoScrollPlugin() {
|
|
2775
2437
|
off(document, 'touchmove', this._handleFallbackAutoScroll);
|
2776
2438
|
off(document, 'mousemove', this._handleFallbackAutoScroll);
|
2777
2439
|
}
|
2778
|
-
|
2779
2440
|
clearPointerElemChangedInterval();
|
2780
2441
|
clearAutoScrolls();
|
2781
2442
|
cancelThrottle();
|
@@ -2789,31 +2450,29 @@ function AutoScrollPlugin() {
|
|
2789
2450
|
},
|
2790
2451
|
_handleAutoScroll: function _handleAutoScroll(evt, fallback) {
|
2791
2452
|
var _this = this;
|
2792
|
-
|
2793
2453
|
var x = (evt.touches ? evt.touches[0] : evt).clientX,
|
2794
|
-
|
2795
|
-
|
2796
|
-
touchEvt$1 = evt;
|
2454
|
+
y = (evt.touches ? evt.touches[0] : evt).clientY,
|
2455
|
+
elem = document.elementFromPoint(x, y);
|
2456
|
+
touchEvt$1 = evt;
|
2457
|
+
|
2458
|
+
// IE does not seem to have native autoscroll,
|
2797
2459
|
// Edge's autoscroll seems too conditional,
|
2798
2460
|
// MACOS Safari does not have autoscroll,
|
2799
2461
|
// Firefox and Chrome are good
|
2800
|
-
|
2801
2462
|
if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {
|
2802
|
-
autoScroll(evt, this.options, elem, fallback);
|
2463
|
+
autoScroll(evt, this.options, elem, fallback);
|
2803
2464
|
|
2465
|
+
// Listener for pointer element change
|
2804
2466
|
var ogElemScroller = getParentAutoScrollElement(elem, true);
|
2805
|
-
|
2806
2467
|
if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {
|
2807
|
-
pointerElemChangedInterval && clearPointerElemChangedInterval();
|
2808
|
-
|
2468
|
+
pointerElemChangedInterval && clearPointerElemChangedInterval();
|
2469
|
+
// Detect for pointer elem change, emulating native DnD behaviour
|
2809
2470
|
pointerElemChangedInterval = setInterval(function () {
|
2810
2471
|
var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);
|
2811
|
-
|
2812
2472
|
if (newElem !== ogElemScroller) {
|
2813
2473
|
ogElemScroller = newElem;
|
2814
2474
|
clearAutoScrolls();
|
2815
2475
|
}
|
2816
|
-
|
2817
2476
|
autoScroll(evt, _this.options, newElem, fallback);
|
2818
2477
|
}, 10);
|
2819
2478
|
lastAutoScrollX = x;
|
@@ -2825,7 +2484,6 @@ function AutoScrollPlugin() {
|
|
2825
2484
|
clearAutoScrolls();
|
2826
2485
|
return;
|
2827
2486
|
}
|
2828
|
-
|
2829
2487
|
autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);
|
2830
2488
|
}
|
2831
2489
|
}
|
@@ -2835,60 +2493,54 @@ function AutoScrollPlugin() {
|
|
2835
2493
|
initializeByDefault: true
|
2836
2494
|
});
|
2837
2495
|
}
|
2838
|
-
|
2839
2496
|
function clearAutoScrolls() {
|
2840
2497
|
autoScrolls.forEach(function (autoScroll) {
|
2841
2498
|
clearInterval(autoScroll.pid);
|
2842
2499
|
});
|
2843
2500
|
autoScrolls = [];
|
2844
2501
|
}
|
2845
|
-
|
2846
2502
|
function clearPointerElemChangedInterval() {
|
2847
2503
|
clearInterval(pointerElemChangedInterval);
|
2848
2504
|
}
|
2849
|
-
|
2850
2505
|
var autoScroll = throttle(function (evt, options, rootEl, isFallback) {
|
2851
2506
|
// Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521
|
2852
2507
|
if (!options.scroll) return;
|
2853
2508
|
var x = (evt.touches ? evt.touches[0] : evt).clientX,
|
2854
|
-
|
2855
|
-
|
2856
|
-
|
2857
|
-
|
2509
|
+
y = (evt.touches ? evt.touches[0] : evt).clientY,
|
2510
|
+
sens = options.scrollSensitivity,
|
2511
|
+
speed = options.scrollSpeed,
|
2512
|
+
winScroller = getWindowScrollingElement();
|
2858
2513
|
var scrollThisInstance = false,
|
2859
|
-
|
2514
|
+
scrollCustomFn;
|
2860
2515
|
|
2516
|
+
// New scroll root, set scrollEl
|
2861
2517
|
if (scrollRootEl !== rootEl) {
|
2862
2518
|
scrollRootEl = rootEl;
|
2863
2519
|
clearAutoScrolls();
|
2864
2520
|
scrollEl = options.scroll;
|
2865
2521
|
scrollCustomFn = options.scrollFn;
|
2866
|
-
|
2867
2522
|
if (scrollEl === true) {
|
2868
2523
|
scrollEl = getParentAutoScrollElement(rootEl, true);
|
2869
2524
|
}
|
2870
2525
|
}
|
2871
|
-
|
2872
2526
|
var layersOut = 0;
|
2873
2527
|
var currentParent = scrollEl;
|
2874
|
-
|
2875
2528
|
do {
|
2876
2529
|
var el = currentParent,
|
2877
|
-
|
2878
|
-
|
2879
|
-
|
2880
|
-
|
2881
|
-
|
2882
|
-
|
2883
|
-
|
2884
|
-
|
2885
|
-
|
2886
|
-
|
2887
|
-
|
2888
|
-
|
2889
|
-
|
2890
|
-
|
2891
|
-
|
2530
|
+
rect = getRect(el),
|
2531
|
+
top = rect.top,
|
2532
|
+
bottom = rect.bottom,
|
2533
|
+
left = rect.left,
|
2534
|
+
right = rect.right,
|
2535
|
+
width = rect.width,
|
2536
|
+
height = rect.height,
|
2537
|
+
canScrollX = void 0,
|
2538
|
+
canScrollY = void 0,
|
2539
|
+
scrollWidth = el.scrollWidth,
|
2540
|
+
scrollHeight = el.scrollHeight,
|
2541
|
+
elCSS = css(el),
|
2542
|
+
scrollPosX = el.scrollLeft,
|
2543
|
+
scrollPosY = el.scrollTop;
|
2892
2544
|
if (el === winScroller) {
|
2893
2545
|
canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');
|
2894
2546
|
canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');
|
@@ -2896,10 +2548,8 @@ var autoScroll = throttle(function (evt, options, rootEl, isFallback) {
|
|
2896
2548
|
canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');
|
2897
2549
|
canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');
|
2898
2550
|
}
|
2899
|
-
|
2900
2551
|
var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);
|
2901
2552
|
var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);
|
2902
|
-
|
2903
2553
|
if (!autoScrolls[layersOut]) {
|
2904
2554
|
for (var i = 0; i <= layersOut; i++) {
|
2905
2555
|
if (!autoScrolls[i]) {
|
@@ -2907,61 +2557,51 @@ var autoScroll = throttle(function (evt, options, rootEl, isFallback) {
|
|
2907
2557
|
}
|
2908
2558
|
}
|
2909
2559
|
}
|
2910
|
-
|
2911
2560
|
if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {
|
2912
2561
|
autoScrolls[layersOut].el = el;
|
2913
2562
|
autoScrolls[layersOut].vx = vx;
|
2914
2563
|
autoScrolls[layersOut].vy = vy;
|
2915
2564
|
clearInterval(autoScrolls[layersOut].pid);
|
2916
|
-
|
2917
2565
|
if (vx != 0 || vy != 0) {
|
2918
2566
|
scrollThisInstance = true;
|
2919
2567
|
/* jshint loopfunc:true */
|
2920
|
-
|
2921
2568
|
autoScrolls[layersOut].pid = setInterval(function () {
|
2922
2569
|
// emulate drag over during autoscroll (fallback), emulating native DnD behaviour
|
2923
2570
|
if (isFallback && this.layer === 0) {
|
2924
2571
|
Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely
|
2925
|
-
|
2926
2572
|
}
|
2927
|
-
|
2928
2573
|
var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;
|
2929
2574
|
var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;
|
2930
|
-
|
2931
2575
|
if (typeof scrollCustomFn === 'function') {
|
2932
2576
|
if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {
|
2933
2577
|
return;
|
2934
2578
|
}
|
2935
2579
|
}
|
2936
|
-
|
2937
2580
|
scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);
|
2938
2581
|
}.bind({
|
2939
2582
|
layer: layersOut
|
2940
2583
|
}), 24);
|
2941
2584
|
}
|
2942
2585
|
}
|
2943
|
-
|
2944
2586
|
layersOut++;
|
2945
2587
|
} while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));
|
2946
|
-
|
2947
2588
|
scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not
|
2948
2589
|
}, 30);
|
2949
2590
|
|
2950
2591
|
var drop = function drop(_ref) {
|
2951
2592
|
var originalEvent = _ref.originalEvent,
|
2952
|
-
|
2953
|
-
|
2954
|
-
|
2955
|
-
|
2956
|
-
|
2957
|
-
|
2593
|
+
putSortable = _ref.putSortable,
|
2594
|
+
dragEl = _ref.dragEl,
|
2595
|
+
activeSortable = _ref.activeSortable,
|
2596
|
+
dispatchSortableEvent = _ref.dispatchSortableEvent,
|
2597
|
+
hideGhostForTarget = _ref.hideGhostForTarget,
|
2598
|
+
unhideGhostForTarget = _ref.unhideGhostForTarget;
|
2958
2599
|
if (!originalEvent) return;
|
2959
2600
|
var toSortable = putSortable || activeSortable;
|
2960
2601
|
hideGhostForTarget();
|
2961
2602
|
var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;
|
2962
2603
|
var target = document.elementFromPoint(touch.clientX, touch.clientY);
|
2963
2604
|
unhideGhostForTarget();
|
2964
|
-
|
2965
2605
|
if (toSortable && !toSortable.el.contains(target)) {
|
2966
2606
|
dispatchSortableEvent('spill');
|
2967
2607
|
this.onSpill({
|
@@ -2970,9 +2610,7 @@ var drop = function drop(_ref) {
|
|
2970
2610
|
});
|
2971
2611
|
}
|
2972
2612
|
};
|
2973
|
-
|
2974
2613
|
function Revert() {}
|
2975
|
-
|
2976
2614
|
Revert.prototype = {
|
2977
2615
|
startIndex: null,
|
2978
2616
|
dragStart: function dragStart(_ref2) {
|
@@ -2981,40 +2619,32 @@ Revert.prototype = {
|
|
2981
2619
|
},
|
2982
2620
|
onSpill: function onSpill(_ref3) {
|
2983
2621
|
var dragEl = _ref3.dragEl,
|
2984
|
-
|
2622
|
+
putSortable = _ref3.putSortable;
|
2985
2623
|
this.sortable.captureAnimationState();
|
2986
|
-
|
2987
2624
|
if (putSortable) {
|
2988
2625
|
putSortable.captureAnimationState();
|
2989
2626
|
}
|
2990
|
-
|
2991
2627
|
var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);
|
2992
|
-
|
2993
2628
|
if (nextSibling) {
|
2994
2629
|
this.sortable.el.insertBefore(dragEl, nextSibling);
|
2995
2630
|
} else {
|
2996
2631
|
this.sortable.el.appendChild(dragEl);
|
2997
2632
|
}
|
2998
|
-
|
2999
2633
|
this.sortable.animateAll();
|
3000
|
-
|
3001
2634
|
if (putSortable) {
|
3002
2635
|
putSortable.animateAll();
|
3003
2636
|
}
|
3004
2637
|
},
|
3005
2638
|
drop: drop
|
3006
2639
|
};
|
3007
|
-
|
3008
2640
|
_extends(Revert, {
|
3009
2641
|
pluginName: 'revertOnSpill'
|
3010
2642
|
});
|
3011
|
-
|
3012
2643
|
function Remove() {}
|
3013
|
-
|
3014
2644
|
Remove.prototype = {
|
3015
2645
|
onSpill: function onSpill(_ref4) {
|
3016
2646
|
var dragEl = _ref4.dragEl,
|
3017
|
-
|
2647
|
+
putSortable = _ref4.putSortable;
|
3018
2648
|
var parentSortable = putSortable || this.sortable;
|
3019
2649
|
parentSortable.captureAnimationState();
|
3020
2650
|
dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);
|
@@ -3022,7 +2652,6 @@ Remove.prototype = {
|
|
3022
2652
|
},
|
3023
2653
|
drop: drop
|
3024
2654
|
};
|
3025
|
-
|
3026
2655
|
_extends(Remove, {
|
3027
2656
|
pluginName: 'removeOnSpill'
|
3028
2657
|
});
|