genesys-spark-components 4.0.0-beta.33 → 4.0.0-beta.35
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/en-14558544.js +24 -0
- 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-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-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-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.cjs.entry.js +1 -1
- package/dist/cjs/gux-month-calendar.cjs.entry.js +6 -2
- 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-region-icon.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-legacy.cjs.entry.js +157 -0
- package/dist/cjs/gux-tab-advanced-list-legacy.cjs.entry.js +470 -0
- package/dist/cjs/gux-tab-advanced-list.cjs.entry.js +19 -3038
- package/dist/cjs/gux-tab-advanced-panel-legacy.cjs.entry.js +34 -0
- 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-legacy.cjs.entry.js +63 -0
- 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.cjs.entry.js +1 -1
- package/dist/cjs/index-0d0fdb85.js +20 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sortable.esm-73cf219b.js +3023 -0
- package/dist/cjs/{usage-9520c06b.js → usage-7e2e71dc.js} +1 -1
- package/dist/collection/collection-manifest.json +4 -0
- package/dist/collection/components/beta/gux-month-picker/gux-month-calendar/gux-month-calendar.css +7 -0
- package/dist/collection/components/beta/gux-month-picker/gux-month-calendar/gux-month-calendar.js +5 -1
- package/dist/collection/components/legacy/gux-tabs-advanced-legacy/gux-tab-advanced/gux-tab-advanced.css +117 -0
- package/dist/collection/components/legacy/gux-tabs-advanced-legacy/gux-tab-advanced/gux-tab-advanced.js +317 -0
- package/dist/collection/components/legacy/gux-tabs-advanced-legacy/gux-tab-advanced-list/gux-tab-advanced-list.css +211 -0
- package/dist/collection/components/legacy/gux-tabs-advanced-legacy/gux-tab-advanced-list/gux-tab-advanced-list.js +623 -0
- package/dist/collection/components/legacy/gux-tabs-advanced-legacy/gux-tab-advanced-panel/gux-tab-advanced-panel.css +48 -0
- package/dist/collection/components/legacy/gux-tabs-advanced-legacy/gux-tab-advanced-panel/gux-tab-advanced-panel.js +106 -0
- package/dist/collection/components/legacy/gux-tabs-advanced-legacy/gux-tabs-advanced.css +3 -0
- package/dist/collection/components/legacy/gux-tabs-advanced-legacy/gux-tabs-advanced.js +147 -0
- package/dist/collection/components/stable/gux-icon/gux-icon.js +1 -1
- package/dist/collection/components/stable/gux-icon/icons/custom/face-smile-hearts-regular.svg +1 -0
- package/dist/component-specs.json +10 -0
- package/dist/deploy-info.json +3 -3
- package/dist/esm/en-5b8ff4c7.js +22 -0
- 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-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-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-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.entry.js +1 -1
- package/dist/esm/gux-month-calendar.entry.js +6 -2
- 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-region-icon.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-legacy.entry.js +153 -0
- package/dist/esm/gux-tab-advanced-list-legacy.entry.js +466 -0
- package/dist/esm/gux-tab-advanced-list.entry.js +1 -3020
- package/dist/esm/gux-tab-advanced-panel-legacy.entry.js +30 -0
- 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-legacy.entry.js +59 -0
- 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.entry.js +1 -1
- package/dist/esm/index-0b66fe2c.js +20 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sortable.esm-8c3d5856.js +3021 -0
- package/dist/esm/{usage-03c766e9.js → usage-cd252d08.js} +1 -1
- 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/custom/face-smile-hearts-regular.svg +1 -0
- package/dist/genesys-webcomponents/{p-c24ada31.entry.js → p-0249b669.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-ac151156.entry.js → p-078d3c75.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-02a95985.entry.js → p-0ca229eb.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-30f91270.entry.js → p-0d276dc9.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-1486d7ea.js +7 -0
- package/dist/genesys-webcomponents/{p-fa8b060e.entry.js → p-197d4153.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-1e4c80e5.entry.js +1 -0
- package/dist/genesys-webcomponents/{p-72dfb14e.entry.js → p-2176b2e3.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-4664b32a.entry.js → p-23ef4850.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-3e77a562.entry.js → p-2795474f.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-d853fc68.entry.js → p-280ec994.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-6078f7ff.entry.js → p-29bb65b6.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-95e92240.entry.js → p-2b46c949.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-7e39ea90.entry.js → p-2c9c3cea.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-d2e1fea1.entry.js → p-3493b6c1.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-cce60954.entry.js → p-359d6b16.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-68fc5577.entry.js → p-39151f6f.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-e3bb70a8.entry.js → p-3d15a15a.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-034e6c4d.entry.js → p-3d3fea51.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-c5b07020.entry.js → p-3fc64f89.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-f5b2d539.entry.js → p-409a2aed.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-41617814.entry.js +1 -0
- package/dist/genesys-webcomponents/p-44835bc5.entry.js +1 -0
- package/dist/genesys-webcomponents/{p-bc563e6a.entry.js → p-45baa064.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-a68578ce.entry.js → p-45bcb54b.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-70df8d96.entry.js → p-53c4a7f7.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-572aec19.entry.js +1 -0
- package/dist/genesys-webcomponents/{p-24131412.entry.js → p-57c82db9.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-f9acf306.entry.js → p-5a94a9bf.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-e1e7a459.entry.js → p-5bbffb5a.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-7f9936a9.entry.js → p-5f96b474.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-2d3e13f9.js → p-605734cc.js} +1 -1
- package/dist/genesys-webcomponents/{p-7a26c6e6.entry.js → p-6081375f.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-060cf9a7.entry.js → p-62456443.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-fc24eed4.entry.js → p-67652427.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-b10ec3d3.entry.js → p-6a62e7d1.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-6a8e1026.js +1 -0
- package/dist/genesys-webcomponents/{p-33221bb2.entry.js → p-75146c5b.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-928eb0b3.entry.js → p-782c1b84.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-92d41ee7.entry.js → p-7adb14d8.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-03c0c703.entry.js → p-7b3f06e0.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-f3195e5d.entry.js → p-7cecc169.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-58c457f5.entry.js → p-7fa0ebcf.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-634a50a3.entry.js → p-8691acc1.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-83c031b7.entry.js → p-8cfed8ab.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-15162b49.entry.js → p-8ef5755c.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-af4067b6.entry.js → p-8f781185.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-7cb046d5.entry.js → p-906dfed6.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-58ec395c.entry.js → p-9381f1a8.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-c6cc4d09.entry.js → p-94f2e2a4.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-998197a4.entry.js → p-9571e673.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-f6e30e40.entry.js → p-95a4e80e.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-afeb7307.entry.js → p-95fcbe0c.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-fa6ecb44.entry.js → p-97d57a71.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-cdf9859f.entry.js → p-98f69d35.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-f78428d6.entry.js → p-993b03b1.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-2527e7d0.entry.js → p-a2cc1e97.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-efd268e2.entry.js → p-a871a9cd.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-ac40bdc8.entry.js +1 -0
- package/dist/genesys-webcomponents/{p-f49d4768.entry.js → p-ad9c8e01.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-bc97008d.entry.js → p-b1c23548.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-d5e1b1e3.entry.js → p-b5ee1c41.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-92d50194.entry.js → p-b6ec024f.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-a0bf81e5.entry.js → p-bf36d208.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-a62be169.entry.js → p-c27e3e55.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-89cbb6af.entry.js → p-c6d8e1d8.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-5c1fa7a2.entry.js → p-c743441a.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-3336e979.entry.js → p-d2012304.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-6b076b8b.entry.js → p-d3c907fc.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-0c458b58.entry.js → p-d9a38f04.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-b11b5b21.entry.js → p-dab7466b.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-f67ad756.entry.js → p-dfb9c511.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-63dc1c21.entry.js → p-e078f4fa.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-7620a300.entry.js → p-e1030da3.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-d1dfb11f.entry.js → p-e401da19.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-e4d54add.entry.js +1 -0
- package/dist/genesys-webcomponents/{p-0a6a6a1c.entry.js → p-e511fb43.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-1d144c4d.entry.js → p-e7cab774.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-f32a9587.entry.js → p-ebede868.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-2ecea73a.entry.js → p-ebfa2805.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-0c5fd266.entry.js → p-f242ce05.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-b9e549f3.entry.js → p-f246861a.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-4cb5da55.entry.js → p-f6913d5e.entry.js} +1 -1
- package/dist/genesys-webcomponents/p-f6f9039b.entry.js +1 -0
- package/dist/genesys-webcomponents/{p-4719c10d.entry.js → p-fab9ff54.entry.js} +1 -1
- package/dist/genesys-webcomponents/{p-f9df9b92.entry.js → p-fbc9566f.entry.js} +1 -1
- package/dist/stencil-wrapper.js +1 -1
- package/dist/types/components/beta/gux-month-picker/gux-month-calendar/gux-month-calendar.d.ts +1 -0
- package/dist/types/components/legacy/gux-tabs-advanced-legacy/gux-tab-advanced/gux-tab-advanced.d.ts +45 -0
- package/dist/types/components/legacy/gux-tabs-advanced-legacy/gux-tab-advanced-list/gux-tab-advanced-list.d.ts +82 -0
- package/dist/types/components/legacy/gux-tabs-advanced-legacy/gux-tab-advanced-panel/gux-tab-advanced-panel.d.ts +12 -0
- package/dist/types/components/legacy/gux-tabs-advanced-legacy/gux-tabs-advanced.d.ts +25 -0
- package/dist/types/components/stable/gux-icon/gux-icon.types.d.ts +1 -1
- package/dist/types/components.d.ts +132 -0
- package/dist/types/stencil-wrapper.d.ts +1 -1
- package/package.json +1 -1
- package/dist/genesys-webcomponents/p-4d34cf6e.entry.js +0 -7
- package/dist/genesys-webcomponents/p-9872ae5d.entry.js +0 -1
- package/dist/genesys-webcomponents/p-f7e9572a.entry.js +0 -1
@@ -2,3034 +2,15 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const index
|
5
|
+
const index = require('./index-0d0fdb85.js');
|
6
|
+
const sortable_esm = require('./sortable.esm-73cf219b.js');
|
6
7
|
const onMutation = require('./on-mutation-247f99dd.js');
|
7
8
|
const eventIsFrom = require('./event-is-from-ad1044f2.js');
|
8
9
|
const afterNextRender = require('./after-next-render-a09f528a.js');
|
9
|
-
const index$
|
10
|
+
const index$1 = require('./index-9bbde1aa.js');
|
10
11
|
const en = require('./en-eb56dc17.js');
|
11
12
|
require('./get-closest-element-ab4b2eee.js');
|
12
13
|
|
13
|
-
/**!
|
14
|
-
* Sortable 1.15.0
|
15
|
-
* @author RubaXa <trash@rubaxa.org>
|
16
|
-
* @author owenm <owen23355@gmail.com>
|
17
|
-
* @license MIT
|
18
|
-
*/
|
19
|
-
function ownKeys(object, enumerableOnly) {
|
20
|
-
var keys = Object.keys(object);
|
21
|
-
|
22
|
-
if (Object.getOwnPropertySymbols) {
|
23
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
24
|
-
|
25
|
-
if (enumerableOnly) {
|
26
|
-
symbols = symbols.filter(function (sym) {
|
27
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
28
|
-
});
|
29
|
-
}
|
30
|
-
|
31
|
-
keys.push.apply(keys, symbols);
|
32
|
-
}
|
33
|
-
|
34
|
-
return keys;
|
35
|
-
}
|
36
|
-
|
37
|
-
function _objectSpread2(target) {
|
38
|
-
for (var i = 1; i < arguments.length; i++) {
|
39
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
40
|
-
|
41
|
-
if (i % 2) {
|
42
|
-
ownKeys(Object(source), true).forEach(function (key) {
|
43
|
-
_defineProperty(target, key, source[key]);
|
44
|
-
});
|
45
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
46
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
47
|
-
} else {
|
48
|
-
ownKeys(Object(source)).forEach(function (key) {
|
49
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
50
|
-
});
|
51
|
-
}
|
52
|
-
}
|
53
|
-
|
54
|
-
return target;
|
55
|
-
}
|
56
|
-
|
57
|
-
function _typeof(obj) {
|
58
|
-
"@babel/helpers - typeof";
|
59
|
-
|
60
|
-
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
61
|
-
_typeof = function (obj) {
|
62
|
-
return typeof obj;
|
63
|
-
};
|
64
|
-
} else {
|
65
|
-
_typeof = function (obj) {
|
66
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
67
|
-
};
|
68
|
-
}
|
69
|
-
|
70
|
-
return _typeof(obj);
|
71
|
-
}
|
72
|
-
|
73
|
-
function _defineProperty(obj, key, value) {
|
74
|
-
if (key in obj) {
|
75
|
-
Object.defineProperty(obj, key, {
|
76
|
-
value: value,
|
77
|
-
enumerable: true,
|
78
|
-
configurable: true,
|
79
|
-
writable: true
|
80
|
-
});
|
81
|
-
} else {
|
82
|
-
obj[key] = value;
|
83
|
-
}
|
84
|
-
|
85
|
-
return obj;
|
86
|
-
}
|
87
|
-
|
88
|
-
function _extends() {
|
89
|
-
_extends = Object.assign || function (target) {
|
90
|
-
for (var i = 1; i < arguments.length; i++) {
|
91
|
-
var source = arguments[i];
|
92
|
-
|
93
|
-
for (var key in source) {
|
94
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
95
|
-
target[key] = source[key];
|
96
|
-
}
|
97
|
-
}
|
98
|
-
}
|
99
|
-
|
100
|
-
return target;
|
101
|
-
};
|
102
|
-
|
103
|
-
return _extends.apply(this, arguments);
|
104
|
-
}
|
105
|
-
|
106
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
107
|
-
if (source == null) return {};
|
108
|
-
var target = {};
|
109
|
-
var sourceKeys = Object.keys(source);
|
110
|
-
var key, i;
|
111
|
-
|
112
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
113
|
-
key = sourceKeys[i];
|
114
|
-
if (excluded.indexOf(key) >= 0) continue;
|
115
|
-
target[key] = source[key];
|
116
|
-
}
|
117
|
-
|
118
|
-
return target;
|
119
|
-
}
|
120
|
-
|
121
|
-
function _objectWithoutProperties(source, excluded) {
|
122
|
-
if (source == null) return {};
|
123
|
-
|
124
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
125
|
-
|
126
|
-
var key, i;
|
127
|
-
|
128
|
-
if (Object.getOwnPropertySymbols) {
|
129
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
130
|
-
|
131
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
132
|
-
key = sourceSymbolKeys[i];
|
133
|
-
if (excluded.indexOf(key) >= 0) continue;
|
134
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
135
|
-
target[key] = source[key];
|
136
|
-
}
|
137
|
-
}
|
138
|
-
|
139
|
-
return target;
|
140
|
-
}
|
141
|
-
|
142
|
-
var version = "1.15.0";
|
143
|
-
|
144
|
-
function userAgent(pattern) {
|
145
|
-
if (typeof window !== 'undefined' && window.navigator) {
|
146
|
-
return !! /*@__PURE__*/navigator.userAgent.match(pattern);
|
147
|
-
}
|
148
|
-
}
|
149
|
-
|
150
|
-
var IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i);
|
151
|
-
var Edge = userAgent(/Edge/i);
|
152
|
-
var FireFox = userAgent(/firefox/i);
|
153
|
-
var Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);
|
154
|
-
var IOS = userAgent(/iP(ad|od|hone)/i);
|
155
|
-
var ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);
|
156
|
-
|
157
|
-
var captureMode = {
|
158
|
-
capture: false,
|
159
|
-
passive: false
|
160
|
-
};
|
161
|
-
|
162
|
-
function on(el, event, fn) {
|
163
|
-
el.addEventListener(event, fn, !IE11OrLess && captureMode);
|
164
|
-
}
|
165
|
-
|
166
|
-
function off(el, event, fn) {
|
167
|
-
el.removeEventListener(event, fn, !IE11OrLess && captureMode);
|
168
|
-
}
|
169
|
-
|
170
|
-
function matches(
|
171
|
-
/**HTMLElement*/
|
172
|
-
el,
|
173
|
-
/**String*/
|
174
|
-
selector) {
|
175
|
-
if (!selector) return;
|
176
|
-
selector[0] === '>' && (selector = selector.substring(1));
|
177
|
-
|
178
|
-
if (el) {
|
179
|
-
try {
|
180
|
-
if (el.matches) {
|
181
|
-
return el.matches(selector);
|
182
|
-
} else if (el.msMatchesSelector) {
|
183
|
-
return el.msMatchesSelector(selector);
|
184
|
-
} else if (el.webkitMatchesSelector) {
|
185
|
-
return el.webkitMatchesSelector(selector);
|
186
|
-
}
|
187
|
-
} catch (_) {
|
188
|
-
return false;
|
189
|
-
}
|
190
|
-
}
|
191
|
-
|
192
|
-
return false;
|
193
|
-
}
|
194
|
-
|
195
|
-
function getParentOrHost(el) {
|
196
|
-
return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;
|
197
|
-
}
|
198
|
-
|
199
|
-
function closest(
|
200
|
-
/**HTMLElement*/
|
201
|
-
el,
|
202
|
-
/**String*/
|
203
|
-
selector,
|
204
|
-
/**HTMLElement*/
|
205
|
-
ctx, includeCTX) {
|
206
|
-
if (el) {
|
207
|
-
ctx = ctx || document;
|
208
|
-
|
209
|
-
do {
|
210
|
-
if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {
|
211
|
-
return el;
|
212
|
-
}
|
213
|
-
|
214
|
-
if (el === ctx) break;
|
215
|
-
/* jshint boss:true */
|
216
|
-
} while (el = getParentOrHost(el));
|
217
|
-
}
|
218
|
-
|
219
|
-
return null;
|
220
|
-
}
|
221
|
-
|
222
|
-
var R_SPACE = /\s+/g;
|
223
|
-
|
224
|
-
function toggleClass(el, name, state) {
|
225
|
-
if (el && name) {
|
226
|
-
if (el.classList) {
|
227
|
-
el.classList[state ? 'add' : 'remove'](name);
|
228
|
-
} else {
|
229
|
-
var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');
|
230
|
-
el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');
|
231
|
-
}
|
232
|
-
}
|
233
|
-
}
|
234
|
-
|
235
|
-
function css(el, prop, val) {
|
236
|
-
var style = el && el.style;
|
237
|
-
|
238
|
-
if (style) {
|
239
|
-
if (val === void 0) {
|
240
|
-
if (document.defaultView && document.defaultView.getComputedStyle) {
|
241
|
-
val = document.defaultView.getComputedStyle(el, '');
|
242
|
-
} else if (el.currentStyle) {
|
243
|
-
val = el.currentStyle;
|
244
|
-
}
|
245
|
-
|
246
|
-
return prop === void 0 ? val : val[prop];
|
247
|
-
} else {
|
248
|
-
if (!(prop in style) && prop.indexOf('webkit') === -1) {
|
249
|
-
prop = '-webkit-' + prop;
|
250
|
-
}
|
251
|
-
|
252
|
-
style[prop] = val + (typeof val === 'string' ? '' : 'px');
|
253
|
-
}
|
254
|
-
}
|
255
|
-
}
|
256
|
-
|
257
|
-
function matrix(el, selfOnly) {
|
258
|
-
var appliedTransforms = '';
|
259
|
-
|
260
|
-
if (typeof el === 'string') {
|
261
|
-
appliedTransforms = el;
|
262
|
-
} else {
|
263
|
-
do {
|
264
|
-
var transform = css(el, 'transform');
|
265
|
-
|
266
|
-
if (transform && transform !== 'none') {
|
267
|
-
appliedTransforms = transform + ' ' + appliedTransforms;
|
268
|
-
}
|
269
|
-
/* jshint boss:true */
|
270
|
-
|
271
|
-
} while (!selfOnly && (el = el.parentNode));
|
272
|
-
}
|
273
|
-
|
274
|
-
var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
|
275
|
-
/*jshint -W056 */
|
276
|
-
|
277
|
-
return matrixFn && new matrixFn(appliedTransforms);
|
278
|
-
}
|
279
|
-
|
280
|
-
function find(ctx, tagName, iterator) {
|
281
|
-
if (ctx) {
|
282
|
-
var list = ctx.getElementsByTagName(tagName),
|
283
|
-
i = 0,
|
284
|
-
n = list.length;
|
285
|
-
|
286
|
-
if (iterator) {
|
287
|
-
for (; i < n; i++) {
|
288
|
-
iterator(list[i], i);
|
289
|
-
}
|
290
|
-
}
|
291
|
-
|
292
|
-
return list;
|
293
|
-
}
|
294
|
-
|
295
|
-
return [];
|
296
|
-
}
|
297
|
-
|
298
|
-
function getWindowScrollingElement() {
|
299
|
-
var scrollingElement = document.scrollingElement;
|
300
|
-
|
301
|
-
if (scrollingElement) {
|
302
|
-
return scrollingElement;
|
303
|
-
} else {
|
304
|
-
return document.documentElement;
|
305
|
-
}
|
306
|
-
}
|
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
|
-
|
318
|
-
function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {
|
319
|
-
if (!el.getBoundingClientRect && el !== window) return;
|
320
|
-
var elRect, top, left, bottom, right, height, width;
|
321
|
-
|
322
|
-
if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {
|
323
|
-
elRect = el.getBoundingClientRect();
|
324
|
-
top = elRect.top;
|
325
|
-
left = elRect.left;
|
326
|
-
bottom = elRect.bottom;
|
327
|
-
right = elRect.right;
|
328
|
-
height = elRect.height;
|
329
|
-
width = elRect.width;
|
330
|
-
} else {
|
331
|
-
top = 0;
|
332
|
-
left = 0;
|
333
|
-
bottom = window.innerHeight;
|
334
|
-
right = window.innerWidth;
|
335
|
-
height = window.innerHeight;
|
336
|
-
width = window.innerWidth;
|
337
|
-
}
|
338
|
-
|
339
|
-
if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {
|
340
|
-
// Adjust for translate()
|
341
|
-
container = container || el.parentNode; // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)
|
342
|
-
// Not needed on <= IE11
|
343
|
-
|
344
|
-
if (!IE11OrLess) {
|
345
|
-
do {
|
346
|
-
if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {
|
347
|
-
var containerRect = container.getBoundingClientRect(); // Set relative to edges of padding box of container
|
348
|
-
|
349
|
-
top -= containerRect.top + parseInt(css(container, 'border-top-width'));
|
350
|
-
left -= containerRect.left + parseInt(css(container, 'border-left-width'));
|
351
|
-
bottom = top + elRect.height;
|
352
|
-
right = left + elRect.width;
|
353
|
-
break;
|
354
|
-
}
|
355
|
-
/* jshint boss:true */
|
356
|
-
|
357
|
-
} while (container = container.parentNode);
|
358
|
-
}
|
359
|
-
}
|
360
|
-
|
361
|
-
if (undoScale && el !== window) {
|
362
|
-
// Adjust for scale()
|
363
|
-
var elMatrix = matrix(container || el),
|
364
|
-
scaleX = elMatrix && elMatrix.a,
|
365
|
-
scaleY = elMatrix && elMatrix.d;
|
366
|
-
|
367
|
-
if (elMatrix) {
|
368
|
-
top /= scaleY;
|
369
|
-
left /= scaleX;
|
370
|
-
width /= scaleX;
|
371
|
-
height /= scaleY;
|
372
|
-
bottom = top + height;
|
373
|
-
right = left + width;
|
374
|
-
}
|
375
|
-
}
|
376
|
-
|
377
|
-
return {
|
378
|
-
top: top,
|
379
|
-
left: left,
|
380
|
-
bottom: bottom,
|
381
|
-
right: right,
|
382
|
-
width: width,
|
383
|
-
height: height
|
384
|
-
};
|
385
|
-
}
|
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
|
-
|
395
|
-
function isScrolledPast(el, elSide, parentSide) {
|
396
|
-
var parent = getParentAutoScrollElement(el, true),
|
397
|
-
elSideVal = getRect(el)[elSide];
|
398
|
-
/* jshint boss:true */
|
399
|
-
|
400
|
-
while (parent) {
|
401
|
-
var parentSideVal = getRect(parent)[parentSide],
|
402
|
-
visible = void 0;
|
403
|
-
|
404
|
-
if (parentSide === 'top' || parentSide === 'left') {
|
405
|
-
visible = elSideVal >= parentSideVal;
|
406
|
-
} else {
|
407
|
-
visible = elSideVal <= parentSideVal;
|
408
|
-
}
|
409
|
-
|
410
|
-
if (!visible) return parent;
|
411
|
-
if (parent === getWindowScrollingElement()) break;
|
412
|
-
parent = getParentAutoScrollElement(parent, false);
|
413
|
-
}
|
414
|
-
|
415
|
-
return false;
|
416
|
-
}
|
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
|
-
|
427
|
-
function getChild(el, childNum, options, includeDragEl) {
|
428
|
-
var currentChild = 0,
|
429
|
-
i = 0,
|
430
|
-
children = el.children;
|
431
|
-
|
432
|
-
while (i < children.length) {
|
433
|
-
if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {
|
434
|
-
if (currentChild === childNum) {
|
435
|
-
return children[i];
|
436
|
-
}
|
437
|
-
|
438
|
-
currentChild++;
|
439
|
-
}
|
440
|
-
|
441
|
-
i++;
|
442
|
-
}
|
443
|
-
|
444
|
-
return null;
|
445
|
-
}
|
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
|
-
|
454
|
-
function lastChild(el, selector) {
|
455
|
-
var last = el.lastElementChild;
|
456
|
-
|
457
|
-
while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {
|
458
|
-
last = last.previousElementSibling;
|
459
|
-
}
|
460
|
-
|
461
|
-
return last || null;
|
462
|
-
}
|
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
|
-
|
472
|
-
function index(el, selector) {
|
473
|
-
var index = 0;
|
474
|
-
|
475
|
-
if (!el || !el.parentNode) {
|
476
|
-
return -1;
|
477
|
-
}
|
478
|
-
/* jshint boss:true */
|
479
|
-
|
480
|
-
|
481
|
-
while (el = el.previousElementSibling) {
|
482
|
-
if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {
|
483
|
-
index++;
|
484
|
-
}
|
485
|
-
}
|
486
|
-
|
487
|
-
return index;
|
488
|
-
}
|
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
|
-
|
497
|
-
function getRelativeScrollOffset(el) {
|
498
|
-
var offsetLeft = 0,
|
499
|
-
offsetTop = 0,
|
500
|
-
winScroller = getWindowScrollingElement();
|
501
|
-
|
502
|
-
if (el) {
|
503
|
-
do {
|
504
|
-
var elMatrix = matrix(el),
|
505
|
-
scaleX = elMatrix.a,
|
506
|
-
scaleY = elMatrix.d;
|
507
|
-
offsetLeft += el.scrollLeft * scaleX;
|
508
|
-
offsetTop += el.scrollTop * scaleY;
|
509
|
-
} while (el !== winScroller && (el = el.parentNode));
|
510
|
-
}
|
511
|
-
|
512
|
-
return [offsetLeft, offsetTop];
|
513
|
-
}
|
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
|
-
|
522
|
-
function indexOfObject(arr, obj) {
|
523
|
-
for (var i in arr) {
|
524
|
-
if (!arr.hasOwnProperty(i)) continue;
|
525
|
-
|
526
|
-
for (var key in obj) {
|
527
|
-
if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);
|
528
|
-
}
|
529
|
-
}
|
530
|
-
|
531
|
-
return -1;
|
532
|
-
}
|
533
|
-
|
534
|
-
function getParentAutoScrollElement(el, includeSelf) {
|
535
|
-
// skip to window
|
536
|
-
if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();
|
537
|
-
var elem = el;
|
538
|
-
var gotSelf = false;
|
539
|
-
|
540
|
-
do {
|
541
|
-
// we don't need to get elem css if it isn't even overflowing in the first place (performance)
|
542
|
-
if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {
|
543
|
-
var elemCSS = css(elem);
|
544
|
-
|
545
|
-
if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {
|
546
|
-
if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();
|
547
|
-
if (gotSelf || includeSelf) return elem;
|
548
|
-
gotSelf = true;
|
549
|
-
}
|
550
|
-
}
|
551
|
-
/* jshint boss:true */
|
552
|
-
|
553
|
-
} while (elem = elem.parentNode);
|
554
|
-
|
555
|
-
return getWindowScrollingElement();
|
556
|
-
}
|
557
|
-
|
558
|
-
function extend(dst, src) {
|
559
|
-
if (dst && src) {
|
560
|
-
for (var key in src) {
|
561
|
-
if (src.hasOwnProperty(key)) {
|
562
|
-
dst[key] = src[key];
|
563
|
-
}
|
564
|
-
}
|
565
|
-
}
|
566
|
-
|
567
|
-
return dst;
|
568
|
-
}
|
569
|
-
|
570
|
-
function isRectEqual(rect1, rect2) {
|
571
|
-
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
|
-
}
|
573
|
-
|
574
|
-
var _throttleTimeout;
|
575
|
-
|
576
|
-
function throttle(callback, ms) {
|
577
|
-
return function () {
|
578
|
-
if (!_throttleTimeout) {
|
579
|
-
var args = arguments,
|
580
|
-
_this = this;
|
581
|
-
|
582
|
-
if (args.length === 1) {
|
583
|
-
callback.call(_this, args[0]);
|
584
|
-
} else {
|
585
|
-
callback.apply(_this, args);
|
586
|
-
}
|
587
|
-
|
588
|
-
_throttleTimeout = setTimeout(function () {
|
589
|
-
_throttleTimeout = void 0;
|
590
|
-
}, ms);
|
591
|
-
}
|
592
|
-
};
|
593
|
-
}
|
594
|
-
|
595
|
-
function cancelThrottle() {
|
596
|
-
clearTimeout(_throttleTimeout);
|
597
|
-
_throttleTimeout = void 0;
|
598
|
-
}
|
599
|
-
|
600
|
-
function scrollBy(el, x, y) {
|
601
|
-
el.scrollLeft += x;
|
602
|
-
el.scrollTop += y;
|
603
|
-
}
|
604
|
-
|
605
|
-
function clone(el) {
|
606
|
-
var Polymer = window.Polymer;
|
607
|
-
var $ = window.jQuery || window.Zepto;
|
608
|
-
|
609
|
-
if (Polymer && Polymer.dom) {
|
610
|
-
return Polymer.dom(el).cloneNode(true);
|
611
|
-
} else if ($) {
|
612
|
-
return $(el).clone(true)[0];
|
613
|
-
} else {
|
614
|
-
return el.cloneNode(true);
|
615
|
-
}
|
616
|
-
}
|
617
|
-
|
618
|
-
var expando = 'Sortable' + new Date().getTime();
|
619
|
-
|
620
|
-
function AnimationStateManager() {
|
621
|
-
var animationStates = [],
|
622
|
-
animationCallbackId;
|
623
|
-
return {
|
624
|
-
captureAnimationState: function captureAnimationState() {
|
625
|
-
animationStates = [];
|
626
|
-
if (!this.options.animation) return;
|
627
|
-
var children = [].slice.call(this.el.children);
|
628
|
-
children.forEach(function (child) {
|
629
|
-
if (css(child, 'display') === 'none' || child === Sortable.ghost) return;
|
630
|
-
animationStates.push({
|
631
|
-
target: child,
|
632
|
-
rect: getRect(child)
|
633
|
-
});
|
634
|
-
|
635
|
-
var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect); // If animating: compensate for current animation
|
636
|
-
|
637
|
-
|
638
|
-
if (child.thisAnimationDuration) {
|
639
|
-
var childMatrix = matrix(child, true);
|
640
|
-
|
641
|
-
if (childMatrix) {
|
642
|
-
fromRect.top -= childMatrix.f;
|
643
|
-
fromRect.left -= childMatrix.e;
|
644
|
-
}
|
645
|
-
}
|
646
|
-
|
647
|
-
child.fromRect = fromRect;
|
648
|
-
});
|
649
|
-
},
|
650
|
-
addAnimationState: function addAnimationState(state) {
|
651
|
-
animationStates.push(state);
|
652
|
-
},
|
653
|
-
removeAnimationState: function removeAnimationState(target) {
|
654
|
-
animationStates.splice(indexOfObject(animationStates, {
|
655
|
-
target: target
|
656
|
-
}), 1);
|
657
|
-
},
|
658
|
-
animateAll: function animateAll(callback) {
|
659
|
-
var _this = this;
|
660
|
-
|
661
|
-
if (!this.options.animation) {
|
662
|
-
clearTimeout(animationCallbackId);
|
663
|
-
if (typeof callback === 'function') callback();
|
664
|
-
return;
|
665
|
-
}
|
666
|
-
|
667
|
-
var animating = false,
|
668
|
-
animationTime = 0;
|
669
|
-
animationStates.forEach(function (state) {
|
670
|
-
var time = 0,
|
671
|
-
target = state.target,
|
672
|
-
fromRect = target.fromRect,
|
673
|
-
toRect = getRect(target),
|
674
|
-
prevFromRect = target.prevFromRect,
|
675
|
-
prevToRect = target.prevToRect,
|
676
|
-
animatingRect = state.rect,
|
677
|
-
targetMatrix = matrix(target, true);
|
678
|
-
|
679
|
-
if (targetMatrix) {
|
680
|
-
// Compensate for current animation
|
681
|
-
toRect.top -= targetMatrix.f;
|
682
|
-
toRect.left -= targetMatrix.e;
|
683
|
-
}
|
684
|
-
|
685
|
-
target.toRect = toRect;
|
686
|
-
|
687
|
-
if (target.thisAnimationDuration) {
|
688
|
-
// Could also check if animatingRect is between fromRect and toRect
|
689
|
-
if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) && // Make sure animatingRect is on line between toRect & fromRect
|
690
|
-
(animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {
|
691
|
-
// If returning to same place as started from animation and on same axis
|
692
|
-
time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);
|
693
|
-
}
|
694
|
-
} // if fromRect != toRect: animate
|
695
|
-
|
696
|
-
|
697
|
-
if (!isRectEqual(toRect, fromRect)) {
|
698
|
-
target.prevFromRect = fromRect;
|
699
|
-
target.prevToRect = toRect;
|
700
|
-
|
701
|
-
if (!time) {
|
702
|
-
time = _this.options.animation;
|
703
|
-
}
|
704
|
-
|
705
|
-
_this.animate(target, animatingRect, toRect, time);
|
706
|
-
}
|
707
|
-
|
708
|
-
if (time) {
|
709
|
-
animating = true;
|
710
|
-
animationTime = Math.max(animationTime, time);
|
711
|
-
clearTimeout(target.animationResetTimer);
|
712
|
-
target.animationResetTimer = setTimeout(function () {
|
713
|
-
target.animationTime = 0;
|
714
|
-
target.prevFromRect = null;
|
715
|
-
target.fromRect = null;
|
716
|
-
target.prevToRect = null;
|
717
|
-
target.thisAnimationDuration = null;
|
718
|
-
}, time);
|
719
|
-
target.thisAnimationDuration = time;
|
720
|
-
}
|
721
|
-
});
|
722
|
-
clearTimeout(animationCallbackId);
|
723
|
-
|
724
|
-
if (!animating) {
|
725
|
-
if (typeof callback === 'function') callback();
|
726
|
-
} else {
|
727
|
-
animationCallbackId = setTimeout(function () {
|
728
|
-
if (typeof callback === 'function') callback();
|
729
|
-
}, animationTime);
|
730
|
-
}
|
731
|
-
|
732
|
-
animationStates = [];
|
733
|
-
},
|
734
|
-
animate: function animate(target, currentRect, toRect, duration) {
|
735
|
-
if (duration) {
|
736
|
-
css(target, 'transition', '');
|
737
|
-
css(target, 'transform', '');
|
738
|
-
var elMatrix = matrix(this.el),
|
739
|
-
scaleX = elMatrix && elMatrix.a,
|
740
|
-
scaleY = elMatrix && elMatrix.d,
|
741
|
-
translateX = (currentRect.left - toRect.left) / (scaleX || 1),
|
742
|
-
translateY = (currentRect.top - toRect.top) / (scaleY || 1);
|
743
|
-
target.animatingX = !!translateX;
|
744
|
-
target.animatingY = !!translateY;
|
745
|
-
css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');
|
746
|
-
this.forRepaintDummy = repaint(target); // repaint
|
747
|
-
|
748
|
-
css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));
|
749
|
-
css(target, 'transform', 'translate3d(0,0,0)');
|
750
|
-
typeof target.animated === 'number' && clearTimeout(target.animated);
|
751
|
-
target.animated = setTimeout(function () {
|
752
|
-
css(target, 'transition', '');
|
753
|
-
css(target, 'transform', '');
|
754
|
-
target.animated = false;
|
755
|
-
target.animatingX = false;
|
756
|
-
target.animatingY = false;
|
757
|
-
}, duration);
|
758
|
-
}
|
759
|
-
}
|
760
|
-
};
|
761
|
-
}
|
762
|
-
|
763
|
-
function repaint(target) {
|
764
|
-
return target.offsetWidth;
|
765
|
-
}
|
766
|
-
|
767
|
-
function calculateRealTime(animatingRect, fromRect, toRect, options) {
|
768
|
-
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
|
-
}
|
770
|
-
|
771
|
-
var plugins = [];
|
772
|
-
var defaults = {
|
773
|
-
initializeByDefault: true
|
774
|
-
};
|
775
|
-
var PluginManager = {
|
776
|
-
mount: function mount(plugin) {
|
777
|
-
// Set default static properties
|
778
|
-
for (var option in defaults) {
|
779
|
-
if (defaults.hasOwnProperty(option) && !(option in plugin)) {
|
780
|
-
plugin[option] = defaults[option];
|
781
|
-
}
|
782
|
-
}
|
783
|
-
|
784
|
-
plugins.forEach(function (p) {
|
785
|
-
if (p.pluginName === plugin.pluginName) {
|
786
|
-
throw "Sortable: Cannot mount plugin ".concat(plugin.pluginName, " more than once");
|
787
|
-
}
|
788
|
-
});
|
789
|
-
plugins.push(plugin);
|
790
|
-
},
|
791
|
-
pluginEvent: function pluginEvent(eventName, sortable, evt) {
|
792
|
-
var _this = this;
|
793
|
-
|
794
|
-
this.eventCanceled = false;
|
795
|
-
|
796
|
-
evt.cancel = function () {
|
797
|
-
_this.eventCanceled = true;
|
798
|
-
};
|
799
|
-
|
800
|
-
var eventNameGlobal = eventName + 'Global';
|
801
|
-
plugins.forEach(function (plugin) {
|
802
|
-
if (!sortable[plugin.pluginName]) return; // Fire global events if it exists in this sortable
|
803
|
-
|
804
|
-
if (sortable[plugin.pluginName][eventNameGlobal]) {
|
805
|
-
sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({
|
806
|
-
sortable: sortable
|
807
|
-
}, evt));
|
808
|
-
} // Only fire plugin event if plugin is enabled in this sortable,
|
809
|
-
// and plugin has event defined
|
810
|
-
|
811
|
-
|
812
|
-
if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {
|
813
|
-
sortable[plugin.pluginName][eventName](_objectSpread2({
|
814
|
-
sortable: sortable
|
815
|
-
}, evt));
|
816
|
-
}
|
817
|
-
});
|
818
|
-
},
|
819
|
-
initializePlugins: function initializePlugins(sortable, el, defaults, options) {
|
820
|
-
plugins.forEach(function (plugin) {
|
821
|
-
var pluginName = plugin.pluginName;
|
822
|
-
if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;
|
823
|
-
var initialized = new plugin(sortable, el, sortable.options);
|
824
|
-
initialized.sortable = sortable;
|
825
|
-
initialized.options = sortable.options;
|
826
|
-
sortable[pluginName] = initialized; // Add default options from plugin
|
827
|
-
|
828
|
-
_extends(defaults, initialized.defaults);
|
829
|
-
});
|
830
|
-
|
831
|
-
for (var option in sortable.options) {
|
832
|
-
if (!sortable.options.hasOwnProperty(option)) continue;
|
833
|
-
var modified = this.modifyOption(sortable, option, sortable.options[option]);
|
834
|
-
|
835
|
-
if (typeof modified !== 'undefined') {
|
836
|
-
sortable.options[option] = modified;
|
837
|
-
}
|
838
|
-
}
|
839
|
-
},
|
840
|
-
getEventProperties: function getEventProperties(name, sortable) {
|
841
|
-
var eventProperties = {};
|
842
|
-
plugins.forEach(function (plugin) {
|
843
|
-
if (typeof plugin.eventProperties !== 'function') return;
|
844
|
-
|
845
|
-
_extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));
|
846
|
-
});
|
847
|
-
return eventProperties;
|
848
|
-
},
|
849
|
-
modifyOption: function modifyOption(sortable, name, value) {
|
850
|
-
var modifiedValue;
|
851
|
-
plugins.forEach(function (plugin) {
|
852
|
-
// Plugin must exist on the Sortable
|
853
|
-
if (!sortable[plugin.pluginName]) return; // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin
|
854
|
-
|
855
|
-
if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {
|
856
|
-
modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);
|
857
|
-
}
|
858
|
-
});
|
859
|
-
return modifiedValue;
|
860
|
-
}
|
861
|
-
};
|
862
|
-
|
863
|
-
function dispatchEvent(_ref) {
|
864
|
-
var sortable = _ref.sortable,
|
865
|
-
rootEl = _ref.rootEl,
|
866
|
-
name = _ref.name,
|
867
|
-
targetEl = _ref.targetEl,
|
868
|
-
cloneEl = _ref.cloneEl,
|
869
|
-
toEl = _ref.toEl,
|
870
|
-
fromEl = _ref.fromEl,
|
871
|
-
oldIndex = _ref.oldIndex,
|
872
|
-
newIndex = _ref.newIndex,
|
873
|
-
oldDraggableIndex = _ref.oldDraggableIndex,
|
874
|
-
newDraggableIndex = _ref.newDraggableIndex,
|
875
|
-
originalEvent = _ref.originalEvent,
|
876
|
-
putSortable = _ref.putSortable,
|
877
|
-
extraEventProperties = _ref.extraEventProperties;
|
878
|
-
sortable = sortable || rootEl && rootEl[expando];
|
879
|
-
if (!sortable) return;
|
880
|
-
var evt,
|
881
|
-
options = sortable.options,
|
882
|
-
onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1); // Support for new CustomEvent feature
|
883
|
-
|
884
|
-
if (window.CustomEvent && !IE11OrLess && !Edge) {
|
885
|
-
evt = new CustomEvent(name, {
|
886
|
-
bubbles: true,
|
887
|
-
cancelable: true
|
888
|
-
});
|
889
|
-
} else {
|
890
|
-
evt = document.createEvent('Event');
|
891
|
-
evt.initEvent(name, true, true);
|
892
|
-
}
|
893
|
-
|
894
|
-
evt.to = toEl || rootEl;
|
895
|
-
evt.from = fromEl || rootEl;
|
896
|
-
evt.item = targetEl || rootEl;
|
897
|
-
evt.clone = cloneEl;
|
898
|
-
evt.oldIndex = oldIndex;
|
899
|
-
evt.newIndex = newIndex;
|
900
|
-
evt.oldDraggableIndex = oldDraggableIndex;
|
901
|
-
evt.newDraggableIndex = newDraggableIndex;
|
902
|
-
evt.originalEvent = originalEvent;
|
903
|
-
evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;
|
904
|
-
|
905
|
-
var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));
|
906
|
-
|
907
|
-
for (var option in allEventProperties) {
|
908
|
-
evt[option] = allEventProperties[option];
|
909
|
-
}
|
910
|
-
|
911
|
-
if (rootEl) {
|
912
|
-
rootEl.dispatchEvent(evt);
|
913
|
-
}
|
914
|
-
|
915
|
-
if (options[onName]) {
|
916
|
-
options[onName].call(sortable, evt);
|
917
|
-
}
|
918
|
-
}
|
919
|
-
|
920
|
-
var _excluded = ["evt"];
|
921
|
-
|
922
|
-
var pluginEvent = function pluginEvent(eventName, sortable) {
|
923
|
-
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
924
|
-
originalEvent = _ref.evt,
|
925
|
-
data = _objectWithoutProperties(_ref, _excluded);
|
926
|
-
|
927
|
-
PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({
|
928
|
-
dragEl: dragEl,
|
929
|
-
parentEl: parentEl,
|
930
|
-
ghostEl: ghostEl,
|
931
|
-
rootEl: rootEl,
|
932
|
-
nextEl: nextEl,
|
933
|
-
lastDownEl: lastDownEl,
|
934
|
-
cloneEl: cloneEl,
|
935
|
-
cloneHidden: cloneHidden,
|
936
|
-
dragStarted: moved,
|
937
|
-
putSortable: putSortable,
|
938
|
-
activeSortable: Sortable.active,
|
939
|
-
originalEvent: originalEvent,
|
940
|
-
oldIndex: oldIndex,
|
941
|
-
oldDraggableIndex: oldDraggableIndex,
|
942
|
-
newIndex: newIndex,
|
943
|
-
newDraggableIndex: newDraggableIndex,
|
944
|
-
hideGhostForTarget: _hideGhostForTarget,
|
945
|
-
unhideGhostForTarget: _unhideGhostForTarget,
|
946
|
-
cloneNowHidden: function cloneNowHidden() {
|
947
|
-
cloneHidden = true;
|
948
|
-
},
|
949
|
-
cloneNowShown: function cloneNowShown() {
|
950
|
-
cloneHidden = false;
|
951
|
-
},
|
952
|
-
dispatchSortableEvent: function dispatchSortableEvent(name) {
|
953
|
-
_dispatchEvent({
|
954
|
-
sortable: sortable,
|
955
|
-
name: name,
|
956
|
-
originalEvent: originalEvent
|
957
|
-
});
|
958
|
-
}
|
959
|
-
}, data));
|
960
|
-
};
|
961
|
-
|
962
|
-
function _dispatchEvent(info) {
|
963
|
-
dispatchEvent(_objectSpread2({
|
964
|
-
putSortable: putSortable,
|
965
|
-
cloneEl: cloneEl,
|
966
|
-
targetEl: dragEl,
|
967
|
-
rootEl: rootEl,
|
968
|
-
oldIndex: oldIndex,
|
969
|
-
oldDraggableIndex: oldDraggableIndex,
|
970
|
-
newIndex: newIndex,
|
971
|
-
newDraggableIndex: newDraggableIndex
|
972
|
-
}, info));
|
973
|
-
}
|
974
|
-
|
975
|
-
var dragEl,
|
976
|
-
parentEl,
|
977
|
-
ghostEl,
|
978
|
-
rootEl,
|
979
|
-
nextEl,
|
980
|
-
lastDownEl,
|
981
|
-
cloneEl,
|
982
|
-
cloneHidden,
|
983
|
-
oldIndex,
|
984
|
-
newIndex,
|
985
|
-
oldDraggableIndex,
|
986
|
-
newDraggableIndex,
|
987
|
-
activeGroup,
|
988
|
-
putSortable,
|
989
|
-
awaitingDragStarted = false,
|
990
|
-
ignoreNextClick = false,
|
991
|
-
sortables = [],
|
992
|
-
tapEvt,
|
993
|
-
touchEvt,
|
994
|
-
lastDx,
|
995
|
-
lastDy,
|
996
|
-
tapDistanceLeft,
|
997
|
-
tapDistanceTop,
|
998
|
-
moved,
|
999
|
-
lastTarget,
|
1000
|
-
lastDirection,
|
1001
|
-
pastFirstInvertThresh = false,
|
1002
|
-
isCircumstantialInvert = false,
|
1003
|
-
targetMoveDistance,
|
1004
|
-
// For positioning ghost absolutely
|
1005
|
-
ghostRelativeParent,
|
1006
|
-
ghostRelativeParentInitialScroll = [],
|
1007
|
-
// (left, top)
|
1008
|
-
_silent = false,
|
1009
|
-
savedInputChecked = [];
|
1010
|
-
/** @const */
|
1011
|
-
|
1012
|
-
var documentExists = typeof document !== 'undefined',
|
1013
|
-
PositionGhostAbsolutely = IOS,
|
1014
|
-
CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',
|
1015
|
-
// This will not pass for IE9, because IE9 DnD only works on anchors
|
1016
|
-
supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),
|
1017
|
-
supportCssPointerEvents = function () {
|
1018
|
-
if (!documentExists) return; // false when <= IE11
|
1019
|
-
|
1020
|
-
if (IE11OrLess) {
|
1021
|
-
return false;
|
1022
|
-
}
|
1023
|
-
|
1024
|
-
var el = document.createElement('x');
|
1025
|
-
el.style.cssText = 'pointer-events:auto';
|
1026
|
-
return el.style.pointerEvents === 'auto';
|
1027
|
-
}(),
|
1028
|
-
_detectDirection = function _detectDirection(el, options) {
|
1029
|
-
var elCSS = css(el),
|
1030
|
-
elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),
|
1031
|
-
child1 = getChild(el, 0, options),
|
1032
|
-
child2 = getChild(el, 1, options),
|
1033
|
-
firstChildCSS = child1 && css(child1),
|
1034
|
-
secondChildCSS = child2 && css(child2),
|
1035
|
-
firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,
|
1036
|
-
secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;
|
1037
|
-
|
1038
|
-
if (elCSS.display === 'flex') {
|
1039
|
-
return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';
|
1040
|
-
}
|
1041
|
-
|
1042
|
-
if (elCSS.display === 'grid') {
|
1043
|
-
return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';
|
1044
|
-
}
|
1045
|
-
|
1046
|
-
if (child1 && firstChildCSS["float"] && firstChildCSS["float"] !== 'none') {
|
1047
|
-
var touchingSideChild2 = firstChildCSS["float"] === 'left' ? 'left' : 'right';
|
1048
|
-
return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';
|
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,
|
1055
|
-
dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,
|
1056
|
-
dragElOppLength = vertical ? dragRect.width : dragRect.height,
|
1057
|
-
targetS1Opp = vertical ? targetRect.left : targetRect.top,
|
1058
|
-
targetS2Opp = vertical ? targetRect.right : targetRect.bottom,
|
1059
|
-
targetOppLength = vertical ? targetRect.width : targetRect.height;
|
1060
|
-
return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;
|
1061
|
-
},
|
1062
|
-
|
1063
|
-
/**
|
1064
|
-
* Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.
|
1065
|
-
* @param {Number} x X position
|
1066
|
-
* @param {Number} y Y position
|
1067
|
-
* @return {HTMLElement} Element of the first found nearest Sortable
|
1068
|
-
*/
|
1069
|
-
_detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {
|
1070
|
-
var ret;
|
1071
|
-
sortables.some(function (sortable) {
|
1072
|
-
var threshold = sortable[expando].options.emptyInsertThreshold;
|
1073
|
-
if (!threshold || lastChild(sortable)) return;
|
1074
|
-
var rect = getRect(sortable),
|
1075
|
-
insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,
|
1076
|
-
insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;
|
1077
|
-
|
1078
|
-
if (insideHorizontally && insideVertically) {
|
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;
|
1102
|
-
}
|
1103
|
-
};
|
1104
|
-
}
|
1105
|
-
|
1106
|
-
var group = {};
|
1107
|
-
var originalGroup = options.group;
|
1108
|
-
|
1109
|
-
if (!originalGroup || _typeof(originalGroup) != 'object') {
|
1110
|
-
originalGroup = {
|
1111
|
-
name: originalGroup
|
1112
|
-
};
|
1113
|
-
}
|
1114
|
-
|
1115
|
-
group.name = originalGroup.name;
|
1116
|
-
group.checkPull = toFn(originalGroup.pull, true);
|
1117
|
-
group.checkPut = toFn(originalGroup.put);
|
1118
|
-
group.revertClone = originalGroup.revertClone;
|
1119
|
-
options.group = group;
|
1120
|
-
},
|
1121
|
-
_hideGhostForTarget = function _hideGhostForTarget() {
|
1122
|
-
if (!supportCssPointerEvents && ghostEl) {
|
1123
|
-
css(ghostEl, 'display', 'none');
|
1124
|
-
}
|
1125
|
-
},
|
1126
|
-
_unhideGhostForTarget = function _unhideGhostForTarget() {
|
1127
|
-
if (!supportCssPointerEvents && ghostEl) {
|
1128
|
-
css(ghostEl, 'display', '');
|
1129
|
-
}
|
1130
|
-
}; // #1184 fix - Prevent click event on fallback if dragged but item not changed position
|
1131
|
-
|
1132
|
-
|
1133
|
-
if (documentExists && !ChromeForAndroid) {
|
1134
|
-
document.addEventListener('click', function (evt) {
|
1135
|
-
if (ignoreNextClick) {
|
1136
|
-
evt.preventDefault();
|
1137
|
-
evt.stopPropagation && evt.stopPropagation();
|
1138
|
-
evt.stopImmediatePropagation && evt.stopImmediatePropagation();
|
1139
|
-
ignoreNextClick = false;
|
1140
|
-
return false;
|
1141
|
-
}
|
1142
|
-
}, true);
|
1143
|
-
}
|
1144
|
-
|
1145
|
-
var nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {
|
1146
|
-
if (dragEl) {
|
1147
|
-
evt = evt.touches ? evt.touches[0] : evt;
|
1148
|
-
|
1149
|
-
var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);
|
1150
|
-
|
1151
|
-
if (nearest) {
|
1152
|
-
// Create imitation event
|
1153
|
-
var event = {};
|
1154
|
-
|
1155
|
-
for (var i in evt) {
|
1156
|
-
if (evt.hasOwnProperty(i)) {
|
1157
|
-
event[i] = evt[i];
|
1158
|
-
}
|
1159
|
-
}
|
1160
|
-
|
1161
|
-
event.target = event.rootEl = nearest;
|
1162
|
-
event.preventDefault = void 0;
|
1163
|
-
event.stopPropagation = void 0;
|
1164
|
-
|
1165
|
-
nearest[expando]._onDragOver(event);
|
1166
|
-
}
|
1167
|
-
}
|
1168
|
-
};
|
1169
|
-
|
1170
|
-
var _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {
|
1171
|
-
if (dragEl) {
|
1172
|
-
dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
|
1173
|
-
}
|
1174
|
-
};
|
1175
|
-
/**
|
1176
|
-
* @class Sortable
|
1177
|
-
* @param {HTMLElement} el
|
1178
|
-
* @param {Object} [options]
|
1179
|
-
*/
|
1180
|
-
|
1181
|
-
|
1182
|
-
function Sortable(el, options) {
|
1183
|
-
if (!(el && el.nodeType && el.nodeType === 1)) {
|
1184
|
-
throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(el));
|
1185
|
-
}
|
1186
|
-
|
1187
|
-
this.el = el; // root element
|
1188
|
-
|
1189
|
-
this.options = options = _extends({}, options); // Export instance
|
1190
|
-
|
1191
|
-
el[expando] = this;
|
1192
|
-
var defaults = {
|
1193
|
-
group: null,
|
1194
|
-
sort: true,
|
1195
|
-
disabled: false,
|
1196
|
-
store: null,
|
1197
|
-
handle: null,
|
1198
|
-
draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',
|
1199
|
-
swapThreshold: 1,
|
1200
|
-
// percentage; 0 <= x <= 1
|
1201
|
-
invertSwap: false,
|
1202
|
-
// invert always
|
1203
|
-
invertedSwapThreshold: null,
|
1204
|
-
// will be set to same as swapThreshold if default
|
1205
|
-
removeCloneOnHide: true,
|
1206
|
-
direction: function direction() {
|
1207
|
-
return _detectDirection(el, this.options);
|
1208
|
-
},
|
1209
|
-
ghostClass: 'sortable-ghost',
|
1210
|
-
chosenClass: 'sortable-chosen',
|
1211
|
-
dragClass: 'sortable-drag',
|
1212
|
-
ignore: 'a, img',
|
1213
|
-
filter: null,
|
1214
|
-
preventOnFilter: true,
|
1215
|
-
animation: 0,
|
1216
|
-
easing: null,
|
1217
|
-
setData: function setData(dataTransfer, dragEl) {
|
1218
|
-
dataTransfer.setData('Text', dragEl.textContent);
|
1219
|
-
},
|
1220
|
-
dropBubble: false,
|
1221
|
-
dragoverBubble: false,
|
1222
|
-
dataIdAttr: 'data-id',
|
1223
|
-
delay: 0,
|
1224
|
-
delayOnTouchOnly: false,
|
1225
|
-
touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
|
1226
|
-
forceFallback: false,
|
1227
|
-
fallbackClass: 'sortable-fallback',
|
1228
|
-
fallbackOnBody: false,
|
1229
|
-
fallbackTolerance: 0,
|
1230
|
-
fallbackOffset: {
|
1231
|
-
x: 0,
|
1232
|
-
y: 0
|
1233
|
-
},
|
1234
|
-
supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari,
|
1235
|
-
emptyInsertThreshold: 5
|
1236
|
-
};
|
1237
|
-
PluginManager.initializePlugins(this, el, defaults); // Set default options
|
1238
|
-
|
1239
|
-
for (var name in defaults) {
|
1240
|
-
!(name in options) && (options[name] = defaults[name]);
|
1241
|
-
}
|
1242
|
-
|
1243
|
-
_prepareGroup(options); // Bind all private methods
|
1244
|
-
|
1245
|
-
|
1246
|
-
for (var fn in this) {
|
1247
|
-
if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
|
1248
|
-
this[fn] = this[fn].bind(this);
|
1249
|
-
}
|
1250
|
-
} // Setup drag mode
|
1251
|
-
|
1252
|
-
|
1253
|
-
this.nativeDraggable = options.forceFallback ? false : supportDraggable;
|
1254
|
-
|
1255
|
-
if (this.nativeDraggable) {
|
1256
|
-
// Touch start threshold cannot be greater than the native dragstart threshold
|
1257
|
-
this.options.touchStartThreshold = 1;
|
1258
|
-
} // Bind events
|
1259
|
-
|
1260
|
-
|
1261
|
-
if (options.supportPointer) {
|
1262
|
-
on(el, 'pointerdown', this._onTapStart);
|
1263
|
-
} else {
|
1264
|
-
on(el, 'mousedown', this._onTapStart);
|
1265
|
-
on(el, 'touchstart', this._onTapStart);
|
1266
|
-
}
|
1267
|
-
|
1268
|
-
if (this.nativeDraggable) {
|
1269
|
-
on(el, 'dragover', this);
|
1270
|
-
on(el, 'dragenter', this);
|
1271
|
-
}
|
1272
|
-
|
1273
|
-
sortables.push(this.el); // Restore sorting
|
1274
|
-
|
1275
|
-
options.store && options.store.get && this.sort(options.store.get(this) || []); // Add animation state manager
|
1276
|
-
|
1277
|
-
_extends(this, AnimationStateManager());
|
1278
|
-
}
|
1279
|
-
|
1280
|
-
Sortable.prototype =
|
1281
|
-
/** @lends Sortable.prototype */
|
1282
|
-
{
|
1283
|
-
constructor: Sortable,
|
1284
|
-
_isOutsideThisEl: function _isOutsideThisEl(target) {
|
1285
|
-
if (!this.el.contains(target) && target !== this.el) {
|
1286
|
-
lastTarget = null;
|
1287
|
-
}
|
1288
|
-
},
|
1289
|
-
_getDirection: function _getDirection(evt, target) {
|
1290
|
-
return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;
|
1291
|
-
},
|
1292
|
-
_onTapStart: function _onTapStart(
|
1293
|
-
/** Event|TouchEvent */
|
1294
|
-
evt) {
|
1295
|
-
if (!evt.cancelable) return;
|
1296
|
-
|
1297
|
-
var _this = this,
|
1298
|
-
el = this.el,
|
1299
|
-
options = this.options,
|
1300
|
-
preventOnFilter = options.preventOnFilter,
|
1301
|
-
type = evt.type,
|
1302
|
-
touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,
|
1303
|
-
target = (touch || evt).target,
|
1304
|
-
originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,
|
1305
|
-
filter = options.filter;
|
1306
|
-
|
1307
|
-
_saveInputCheckedState(el); // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.
|
1308
|
-
|
1309
|
-
|
1310
|
-
if (dragEl) {
|
1311
|
-
return;
|
1312
|
-
}
|
1313
|
-
|
1314
|
-
if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {
|
1315
|
-
return; // only left button and enabled
|
1316
|
-
} // cancel dnd if original target is content editable
|
1317
|
-
|
1318
|
-
|
1319
|
-
if (originalTarget.isContentEditable) {
|
1320
|
-
return;
|
1321
|
-
} // Safari ignores further event handling after mousedown
|
1322
|
-
|
1323
|
-
|
1324
|
-
if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {
|
1325
|
-
return;
|
1326
|
-
}
|
1327
|
-
|
1328
|
-
target = closest(target, options.draggable, el, false);
|
1329
|
-
|
1330
|
-
if (target && target.animated) {
|
1331
|
-
return;
|
1332
|
-
}
|
1333
|
-
|
1334
|
-
if (lastDownEl === target) {
|
1335
|
-
// Ignoring duplicate `down`
|
1336
|
-
return;
|
1337
|
-
} // Get the index of the dragged element within its parent
|
1338
|
-
|
1339
|
-
|
1340
|
-
oldIndex = index(target);
|
1341
|
-
oldDraggableIndex = index(target, options.draggable); // Check filter
|
1342
|
-
|
1343
|
-
if (typeof filter === 'function') {
|
1344
|
-
if (filter.call(this, evt, target, this)) {
|
1345
|
-
_dispatchEvent({
|
1346
|
-
sortable: _this,
|
1347
|
-
rootEl: originalTarget,
|
1348
|
-
name: 'filter',
|
1349
|
-
targetEl: target,
|
1350
|
-
toEl: el,
|
1351
|
-
fromEl: el
|
1352
|
-
});
|
1353
|
-
|
1354
|
-
pluginEvent('filter', _this, {
|
1355
|
-
evt: evt
|
1356
|
-
});
|
1357
|
-
preventOnFilter && evt.cancelable && evt.preventDefault();
|
1358
|
-
return; // cancel dnd
|
1359
|
-
}
|
1360
|
-
} else if (filter) {
|
1361
|
-
filter = filter.split(',').some(function (criteria) {
|
1362
|
-
criteria = closest(originalTarget, criteria.trim(), el, false);
|
1363
|
-
|
1364
|
-
if (criteria) {
|
1365
|
-
_dispatchEvent({
|
1366
|
-
sortable: _this,
|
1367
|
-
rootEl: criteria,
|
1368
|
-
name: 'filter',
|
1369
|
-
targetEl: target,
|
1370
|
-
fromEl: el,
|
1371
|
-
toEl: el
|
1372
|
-
});
|
1373
|
-
|
1374
|
-
pluginEvent('filter', _this, {
|
1375
|
-
evt: evt
|
1376
|
-
});
|
1377
|
-
return true;
|
1378
|
-
}
|
1379
|
-
});
|
1380
|
-
|
1381
|
-
if (filter) {
|
1382
|
-
preventOnFilter && evt.cancelable && evt.preventDefault();
|
1383
|
-
return; // cancel dnd
|
1384
|
-
}
|
1385
|
-
}
|
1386
|
-
|
1387
|
-
if (options.handle && !closest(originalTarget, options.handle, el, false)) {
|
1388
|
-
return;
|
1389
|
-
} // Prepare `dragstart`
|
1390
|
-
|
1391
|
-
|
1392
|
-
this._prepareDragStart(evt, touch, target);
|
1393
|
-
},
|
1394
|
-
_prepareDragStart: function _prepareDragStart(
|
1395
|
-
/** Event */
|
1396
|
-
evt,
|
1397
|
-
/** Touch */
|
1398
|
-
touch,
|
1399
|
-
/** HTMLElement */
|
1400
|
-
target) {
|
1401
|
-
var _this = this,
|
1402
|
-
el = _this.el,
|
1403
|
-
options = _this.options,
|
1404
|
-
ownerDocument = el.ownerDocument,
|
1405
|
-
dragStartFn;
|
1406
|
-
|
1407
|
-
if (target && !dragEl && target.parentNode === el) {
|
1408
|
-
var dragRect = getRect(target);
|
1409
|
-
rootEl = el;
|
1410
|
-
dragEl = target;
|
1411
|
-
parentEl = dragEl.parentNode;
|
1412
|
-
nextEl = dragEl.nextSibling;
|
1413
|
-
lastDownEl = target;
|
1414
|
-
activeGroup = options.group;
|
1415
|
-
Sortable.dragged = dragEl;
|
1416
|
-
tapEvt = {
|
1417
|
-
target: dragEl,
|
1418
|
-
clientX: (touch || evt).clientX,
|
1419
|
-
clientY: (touch || evt).clientY
|
1420
|
-
};
|
1421
|
-
tapDistanceLeft = tapEvt.clientX - dragRect.left;
|
1422
|
-
tapDistanceTop = tapEvt.clientY - dragRect.top;
|
1423
|
-
this._lastX = (touch || evt).clientX;
|
1424
|
-
this._lastY = (touch || evt).clientY;
|
1425
|
-
dragEl.style['will-change'] = 'all';
|
1426
|
-
|
1427
|
-
dragStartFn = function dragStartFn() {
|
1428
|
-
pluginEvent('delayEnded', _this, {
|
1429
|
-
evt: evt
|
1430
|
-
});
|
1431
|
-
|
1432
|
-
if (Sortable.eventCanceled) {
|
1433
|
-
_this._onDrop();
|
1434
|
-
|
1435
|
-
return;
|
1436
|
-
} // Delayed drag has been triggered
|
1437
|
-
// we can re-enable the events: touchmove/mousemove
|
1438
|
-
|
1439
|
-
|
1440
|
-
_this._disableDelayedDragEvents();
|
1441
|
-
|
1442
|
-
if (!FireFox && _this.nativeDraggable) {
|
1443
|
-
dragEl.draggable = true;
|
1444
|
-
} // Bind the events: dragstart/dragend
|
1445
|
-
|
1446
|
-
|
1447
|
-
_this._triggerDragStart(evt, touch); // Drag start event
|
1448
|
-
|
1449
|
-
|
1450
|
-
_dispatchEvent({
|
1451
|
-
sortable: _this,
|
1452
|
-
name: 'choose',
|
1453
|
-
originalEvent: evt
|
1454
|
-
}); // Chosen item
|
1455
|
-
|
1456
|
-
|
1457
|
-
toggleClass(dragEl, options.chosenClass, true);
|
1458
|
-
}; // Disable "draggable"
|
1459
|
-
|
1460
|
-
|
1461
|
-
options.ignore.split(',').forEach(function (criteria) {
|
1462
|
-
find(dragEl, criteria.trim(), _disableDraggable);
|
1463
|
-
});
|
1464
|
-
on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);
|
1465
|
-
on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);
|
1466
|
-
on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);
|
1467
|
-
on(ownerDocument, 'mouseup', _this._onDrop);
|
1468
|
-
on(ownerDocument, 'touchend', _this._onDrop);
|
1469
|
-
on(ownerDocument, 'touchcancel', _this._onDrop); // Make dragEl draggable (must be before delay for FireFox)
|
1470
|
-
|
1471
|
-
if (FireFox && this.nativeDraggable) {
|
1472
|
-
this.options.touchStartThreshold = 4;
|
1473
|
-
dragEl.draggable = true;
|
1474
|
-
}
|
1475
|
-
|
1476
|
-
pluginEvent('delayStart', this, {
|
1477
|
-
evt: evt
|
1478
|
-
}); // Delay is impossible for native DnD in Edge or IE
|
1479
|
-
|
1480
|
-
if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {
|
1481
|
-
if (Sortable.eventCanceled) {
|
1482
|
-
this._onDrop();
|
1483
|
-
|
1484
|
-
return;
|
1485
|
-
} // If the user moves the pointer or let go the click or touch
|
1486
|
-
// before the delay has been reached:
|
1487
|
-
// disable the delayed drag
|
1488
|
-
|
1489
|
-
|
1490
|
-
on(ownerDocument, 'mouseup', _this._disableDelayedDrag);
|
1491
|
-
on(ownerDocument, 'touchend', _this._disableDelayedDrag);
|
1492
|
-
on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);
|
1493
|
-
on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);
|
1494
|
-
on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);
|
1495
|
-
options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);
|
1496
|
-
_this._dragStartTimer = setTimeout(dragStartFn, options.delay);
|
1497
|
-
} else {
|
1498
|
-
dragStartFn();
|
1499
|
-
}
|
1500
|
-
}
|
1501
|
-
},
|
1502
|
-
_delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler(
|
1503
|
-
/** TouchEvent|PointerEvent **/
|
1504
|
-
e) {
|
1505
|
-
var touch = e.touches ? e.touches[0] : e;
|
1506
|
-
|
1507
|
-
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
|
-
this._disableDelayedDrag();
|
1509
|
-
}
|
1510
|
-
},
|
1511
|
-
_disableDelayedDrag: function _disableDelayedDrag() {
|
1512
|
-
dragEl && _disableDraggable(dragEl);
|
1513
|
-
clearTimeout(this._dragStartTimer);
|
1514
|
-
|
1515
|
-
this._disableDelayedDragEvents();
|
1516
|
-
},
|
1517
|
-
_disableDelayedDragEvents: function _disableDelayedDragEvents() {
|
1518
|
-
var ownerDocument = this.el.ownerDocument;
|
1519
|
-
off(ownerDocument, 'mouseup', this._disableDelayedDrag);
|
1520
|
-
off(ownerDocument, 'touchend', this._disableDelayedDrag);
|
1521
|
-
off(ownerDocument, 'touchcancel', this._disableDelayedDrag);
|
1522
|
-
off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);
|
1523
|
-
off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);
|
1524
|
-
off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);
|
1525
|
-
},
|
1526
|
-
_triggerDragStart: function _triggerDragStart(
|
1527
|
-
/** Event */
|
1528
|
-
evt,
|
1529
|
-
/** Touch */
|
1530
|
-
touch) {
|
1531
|
-
touch = touch || evt.pointerType == 'touch' && evt;
|
1532
|
-
|
1533
|
-
if (!this.nativeDraggable || touch) {
|
1534
|
-
if (this.options.supportPointer) {
|
1535
|
-
on(document, 'pointermove', this._onTouchMove);
|
1536
|
-
} else if (touch) {
|
1537
|
-
on(document, 'touchmove', this._onTouchMove);
|
1538
|
-
} else {
|
1539
|
-
on(document, 'mousemove', this._onTouchMove);
|
1540
|
-
}
|
1541
|
-
} else {
|
1542
|
-
on(dragEl, 'dragend', this);
|
1543
|
-
on(rootEl, 'dragstart', this._onDragStart);
|
1544
|
-
}
|
1545
|
-
|
1546
|
-
try {
|
1547
|
-
if (document.selection) {
|
1548
|
-
// Timeout neccessary for IE9
|
1549
|
-
_nextTick(function () {
|
1550
|
-
document.selection.empty();
|
1551
|
-
});
|
1552
|
-
} else {
|
1553
|
-
window.getSelection().removeAllRanges();
|
1554
|
-
}
|
1555
|
-
} catch (err) {}
|
1556
|
-
},
|
1557
|
-
_dragStarted: function _dragStarted(fallback, evt) {
|
1558
|
-
|
1559
|
-
awaitingDragStarted = false;
|
1560
|
-
|
1561
|
-
if (rootEl && dragEl) {
|
1562
|
-
pluginEvent('dragStarted', this, {
|
1563
|
-
evt: evt
|
1564
|
-
});
|
1565
|
-
|
1566
|
-
if (this.nativeDraggable) {
|
1567
|
-
on(document, 'dragover', _checkOutsideTargetEl);
|
1568
|
-
}
|
1569
|
-
|
1570
|
-
var options = this.options; // Apply effect
|
1571
|
-
|
1572
|
-
!fallback && toggleClass(dragEl, options.dragClass, false);
|
1573
|
-
toggleClass(dragEl, options.ghostClass, true);
|
1574
|
-
Sortable.active = this;
|
1575
|
-
fallback && this._appendGhost(); // Drag start event
|
1576
|
-
|
1577
|
-
_dispatchEvent({
|
1578
|
-
sortable: this,
|
1579
|
-
name: 'start',
|
1580
|
-
originalEvent: evt
|
1581
|
-
});
|
1582
|
-
} else {
|
1583
|
-
this._nulling();
|
1584
|
-
}
|
1585
|
-
},
|
1586
|
-
_emulateDragOver: function _emulateDragOver() {
|
1587
|
-
if (touchEvt) {
|
1588
|
-
this._lastX = touchEvt.clientX;
|
1589
|
-
this._lastY = touchEvt.clientY;
|
1590
|
-
|
1591
|
-
_hideGhostForTarget();
|
1592
|
-
|
1593
|
-
var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
|
1594
|
-
var parent = target;
|
1595
|
-
|
1596
|
-
while (target && target.shadowRoot) {
|
1597
|
-
target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
|
1598
|
-
if (target === parent) break;
|
1599
|
-
parent = target;
|
1600
|
-
}
|
1601
|
-
|
1602
|
-
dragEl.parentNode[expando]._isOutsideThisEl(target);
|
1603
|
-
|
1604
|
-
if (parent) {
|
1605
|
-
do {
|
1606
|
-
if (parent[expando]) {
|
1607
|
-
var inserted = void 0;
|
1608
|
-
inserted = parent[expando]._onDragOver({
|
1609
|
-
clientX: touchEvt.clientX,
|
1610
|
-
clientY: touchEvt.clientY,
|
1611
|
-
target: target,
|
1612
|
-
rootEl: parent
|
1613
|
-
});
|
1614
|
-
|
1615
|
-
if (inserted && !this.options.dragoverBubble) {
|
1616
|
-
break;
|
1617
|
-
}
|
1618
|
-
}
|
1619
|
-
|
1620
|
-
target = parent; // store last element
|
1621
|
-
}
|
1622
|
-
/* jshint boss:true */
|
1623
|
-
while (parent = parent.parentNode);
|
1624
|
-
}
|
1625
|
-
|
1626
|
-
_unhideGhostForTarget();
|
1627
|
-
}
|
1628
|
-
},
|
1629
|
-
_onTouchMove: function _onTouchMove(
|
1630
|
-
/**TouchEvent*/
|
1631
|
-
evt) {
|
1632
|
-
if (tapEvt) {
|
1633
|
-
var options = this.options,
|
1634
|
-
fallbackTolerance = options.fallbackTolerance,
|
1635
|
-
fallbackOffset = options.fallbackOffset,
|
1636
|
-
touch = evt.touches ? evt.touches[0] : evt,
|
1637
|
-
ghostMatrix = ghostEl && matrix(ghostEl, true),
|
1638
|
-
scaleX = ghostEl && ghostMatrix && ghostMatrix.a,
|
1639
|
-
scaleY = ghostEl && ghostMatrix && ghostMatrix.d,
|
1640
|
-
relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),
|
1641
|
-
dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),
|
1642
|
-
dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1); // only set the status to dragging, when we are actually dragging
|
1643
|
-
|
1644
|
-
if (!Sortable.active && !awaitingDragStarted) {
|
1645
|
-
if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {
|
1646
|
-
return;
|
1647
|
-
}
|
1648
|
-
|
1649
|
-
this._onDragStart(evt, true);
|
1650
|
-
}
|
1651
|
-
|
1652
|
-
if (ghostEl) {
|
1653
|
-
if (ghostMatrix) {
|
1654
|
-
ghostMatrix.e += dx - (lastDx || 0);
|
1655
|
-
ghostMatrix.f += dy - (lastDy || 0);
|
1656
|
-
} else {
|
1657
|
-
ghostMatrix = {
|
1658
|
-
a: 1,
|
1659
|
-
b: 0,
|
1660
|
-
c: 0,
|
1661
|
-
d: 1,
|
1662
|
-
e: dx,
|
1663
|
-
f: dy
|
1664
|
-
};
|
1665
|
-
}
|
1666
|
-
|
1667
|
-
var cssMatrix = "matrix(".concat(ghostMatrix.a, ",").concat(ghostMatrix.b, ",").concat(ghostMatrix.c, ",").concat(ghostMatrix.d, ",").concat(ghostMatrix.e, ",").concat(ghostMatrix.f, ")");
|
1668
|
-
css(ghostEl, 'webkitTransform', cssMatrix);
|
1669
|
-
css(ghostEl, 'mozTransform', cssMatrix);
|
1670
|
-
css(ghostEl, 'msTransform', cssMatrix);
|
1671
|
-
css(ghostEl, 'transform', cssMatrix);
|
1672
|
-
lastDx = dx;
|
1673
|
-
lastDy = dy;
|
1674
|
-
touchEvt = touch;
|
1675
|
-
}
|
1676
|
-
|
1677
|
-
evt.cancelable && evt.preventDefault();
|
1678
|
-
}
|
1679
|
-
},
|
1680
|
-
_appendGhost: function _appendGhost() {
|
1681
|
-
// Bug if using scale(): https://stackoverflow.com/questions/2637058
|
1682
|
-
// Not being adjusted for
|
1683
|
-
if (!ghostEl) {
|
1684
|
-
var container = this.options.fallbackOnBody ? document.body : rootEl,
|
1685
|
-
rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),
|
1686
|
-
options = this.options; // Position absolutely
|
1687
|
-
|
1688
|
-
if (PositionGhostAbsolutely) {
|
1689
|
-
// Get relatively positioned parent
|
1690
|
-
ghostRelativeParent = container;
|
1691
|
-
|
1692
|
-
while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {
|
1693
|
-
ghostRelativeParent = ghostRelativeParent.parentNode;
|
1694
|
-
}
|
1695
|
-
|
1696
|
-
if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {
|
1697
|
-
if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();
|
1698
|
-
rect.top += ghostRelativeParent.scrollTop;
|
1699
|
-
rect.left += ghostRelativeParent.scrollLeft;
|
1700
|
-
} else {
|
1701
|
-
ghostRelativeParent = getWindowScrollingElement();
|
1702
|
-
}
|
1703
|
-
|
1704
|
-
ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);
|
1705
|
-
}
|
1706
|
-
|
1707
|
-
ghostEl = dragEl.cloneNode(true);
|
1708
|
-
toggleClass(ghostEl, options.ghostClass, false);
|
1709
|
-
toggleClass(ghostEl, options.fallbackClass, true);
|
1710
|
-
toggleClass(ghostEl, options.dragClass, true);
|
1711
|
-
css(ghostEl, 'transition', '');
|
1712
|
-
css(ghostEl, 'transform', '');
|
1713
|
-
css(ghostEl, 'box-sizing', 'border-box');
|
1714
|
-
css(ghostEl, 'margin', 0);
|
1715
|
-
css(ghostEl, 'top', rect.top);
|
1716
|
-
css(ghostEl, 'left', rect.left);
|
1717
|
-
css(ghostEl, 'width', rect.width);
|
1718
|
-
css(ghostEl, 'height', rect.height);
|
1719
|
-
css(ghostEl, 'opacity', '0.8');
|
1720
|
-
css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');
|
1721
|
-
css(ghostEl, 'zIndex', '100000');
|
1722
|
-
css(ghostEl, 'pointerEvents', 'none');
|
1723
|
-
Sortable.ghost = ghostEl;
|
1724
|
-
container.appendChild(ghostEl); // Set transform-origin
|
1725
|
-
|
1726
|
-
css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');
|
1727
|
-
}
|
1728
|
-
},
|
1729
|
-
_onDragStart: function _onDragStart(
|
1730
|
-
/**Event*/
|
1731
|
-
evt,
|
1732
|
-
/**boolean*/
|
1733
|
-
fallback) {
|
1734
|
-
var _this = this;
|
1735
|
-
|
1736
|
-
var dataTransfer = evt.dataTransfer;
|
1737
|
-
var options = _this.options;
|
1738
|
-
pluginEvent('dragStart', this, {
|
1739
|
-
evt: evt
|
1740
|
-
});
|
1741
|
-
|
1742
|
-
if (Sortable.eventCanceled) {
|
1743
|
-
this._onDrop();
|
1744
|
-
|
1745
|
-
return;
|
1746
|
-
}
|
1747
|
-
|
1748
|
-
pluginEvent('setupClone', this);
|
1749
|
-
|
1750
|
-
if (!Sortable.eventCanceled) {
|
1751
|
-
cloneEl = clone(dragEl);
|
1752
|
-
cloneEl.removeAttribute("id");
|
1753
|
-
cloneEl.draggable = false;
|
1754
|
-
cloneEl.style['will-change'] = '';
|
1755
|
-
|
1756
|
-
this._hideClone();
|
1757
|
-
|
1758
|
-
toggleClass(cloneEl, this.options.chosenClass, false);
|
1759
|
-
Sortable.clone = cloneEl;
|
1760
|
-
} // #1143: IFrame support workaround
|
1761
|
-
|
1762
|
-
|
1763
|
-
_this.cloneId = _nextTick(function () {
|
1764
|
-
pluginEvent('clone', _this);
|
1765
|
-
if (Sortable.eventCanceled) return;
|
1766
|
-
|
1767
|
-
if (!_this.options.removeCloneOnHide) {
|
1768
|
-
rootEl.insertBefore(cloneEl, dragEl);
|
1769
|
-
}
|
1770
|
-
|
1771
|
-
_this._hideClone();
|
1772
|
-
|
1773
|
-
_dispatchEvent({
|
1774
|
-
sortable: _this,
|
1775
|
-
name: 'clone'
|
1776
|
-
});
|
1777
|
-
});
|
1778
|
-
!fallback && toggleClass(dragEl, options.dragClass, true); // Set proper drop events
|
1779
|
-
|
1780
|
-
if (fallback) {
|
1781
|
-
ignoreNextClick = true;
|
1782
|
-
_this._loopId = setInterval(_this._emulateDragOver, 50);
|
1783
|
-
} else {
|
1784
|
-
// Undo what was set in _prepareDragStart before drag started
|
1785
|
-
off(document, 'mouseup', _this._onDrop);
|
1786
|
-
off(document, 'touchend', _this._onDrop);
|
1787
|
-
off(document, 'touchcancel', _this._onDrop);
|
1788
|
-
|
1789
|
-
if (dataTransfer) {
|
1790
|
-
dataTransfer.effectAllowed = 'move';
|
1791
|
-
options.setData && options.setData.call(_this, dataTransfer, dragEl);
|
1792
|
-
}
|
1793
|
-
|
1794
|
-
on(document, 'drop', _this); // #1276 fix:
|
1795
|
-
|
1796
|
-
css(dragEl, 'transform', 'translateZ(0)');
|
1797
|
-
}
|
1798
|
-
|
1799
|
-
awaitingDragStarted = true;
|
1800
|
-
_this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));
|
1801
|
-
on(document, 'selectstart', _this);
|
1802
|
-
moved = true;
|
1803
|
-
|
1804
|
-
if (Safari) {
|
1805
|
-
css(document.body, 'user-select', 'none');
|
1806
|
-
}
|
1807
|
-
},
|
1808
|
-
// Returns true - if no further action is needed (either inserted or another condition)
|
1809
|
-
_onDragOver: function _onDragOver(
|
1810
|
-
/**Event*/
|
1811
|
-
evt) {
|
1812
|
-
var el = this.el,
|
1813
|
-
target = evt.target,
|
1814
|
-
dragRect,
|
1815
|
-
targetRect,
|
1816
|
-
revert,
|
1817
|
-
options = this.options,
|
1818
|
-
group = options.group,
|
1819
|
-
activeSortable = Sortable.active,
|
1820
|
-
isOwner = activeGroup === group,
|
1821
|
-
canSort = options.sort,
|
1822
|
-
fromSortable = putSortable || activeSortable,
|
1823
|
-
vertical,
|
1824
|
-
_this = this,
|
1825
|
-
completedFired = false;
|
1826
|
-
|
1827
|
-
if (_silent) return;
|
1828
|
-
|
1829
|
-
function dragOverEvent(name, extra) {
|
1830
|
-
pluginEvent(name, _this, _objectSpread2({
|
1831
|
-
evt: evt,
|
1832
|
-
isOwner: isOwner,
|
1833
|
-
axis: vertical ? 'vertical' : 'horizontal',
|
1834
|
-
revert: revert,
|
1835
|
-
dragRect: dragRect,
|
1836
|
-
targetRect: targetRect,
|
1837
|
-
canSort: canSort,
|
1838
|
-
fromSortable: fromSortable,
|
1839
|
-
target: target,
|
1840
|
-
completed: completed,
|
1841
|
-
onMove: function onMove(target, after) {
|
1842
|
-
return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);
|
1843
|
-
},
|
1844
|
-
changed: changed
|
1845
|
-
}, extra));
|
1846
|
-
} // Capture animation state
|
1847
|
-
|
1848
|
-
|
1849
|
-
function capture() {
|
1850
|
-
dragOverEvent('dragOverAnimationCapture');
|
1851
|
-
|
1852
|
-
_this.captureAnimationState();
|
1853
|
-
|
1854
|
-
if (_this !== fromSortable) {
|
1855
|
-
fromSortable.captureAnimationState();
|
1856
|
-
}
|
1857
|
-
} // Return invocation when dragEl is inserted (or completed)
|
1858
|
-
|
1859
|
-
|
1860
|
-
function completed(insertion) {
|
1861
|
-
dragOverEvent('dragOverCompleted', {
|
1862
|
-
insertion: insertion
|
1863
|
-
});
|
1864
|
-
|
1865
|
-
if (insertion) {
|
1866
|
-
// Clones must be hidden before folding animation to capture dragRectAbsolute properly
|
1867
|
-
if (isOwner) {
|
1868
|
-
activeSortable._hideClone();
|
1869
|
-
} else {
|
1870
|
-
activeSortable._showClone(_this);
|
1871
|
-
}
|
1872
|
-
|
1873
|
-
if (_this !== fromSortable) {
|
1874
|
-
// Set ghost class to new sortable's ghost class
|
1875
|
-
toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);
|
1876
|
-
toggleClass(dragEl, options.ghostClass, true);
|
1877
|
-
}
|
1878
|
-
|
1879
|
-
if (putSortable !== _this && _this !== Sortable.active) {
|
1880
|
-
putSortable = _this;
|
1881
|
-
} else if (_this === Sortable.active && putSortable) {
|
1882
|
-
putSortable = null;
|
1883
|
-
} // Animation
|
1884
|
-
|
1885
|
-
|
1886
|
-
if (fromSortable === _this) {
|
1887
|
-
_this._ignoreWhileAnimating = target;
|
1888
|
-
}
|
1889
|
-
|
1890
|
-
_this.animateAll(function () {
|
1891
|
-
dragOverEvent('dragOverAnimationComplete');
|
1892
|
-
_this._ignoreWhileAnimating = null;
|
1893
|
-
});
|
1894
|
-
|
1895
|
-
if (_this !== fromSortable) {
|
1896
|
-
fromSortable.animateAll();
|
1897
|
-
fromSortable._ignoreWhileAnimating = null;
|
1898
|
-
}
|
1899
|
-
} // Null lastTarget if it is not inside a previously swapped element
|
1900
|
-
|
1901
|
-
|
1902
|
-
if (target === dragEl && !dragEl.animated || target === el && !target.animated) {
|
1903
|
-
lastTarget = null;
|
1904
|
-
} // no bubbling and not fallback
|
1905
|
-
|
1906
|
-
|
1907
|
-
if (!options.dragoverBubble && !evt.rootEl && target !== document) {
|
1908
|
-
dragEl.parentNode[expando]._isOutsideThisEl(evt.target); // Do not detect for empty insert if already inserted
|
1909
|
-
|
1910
|
-
|
1911
|
-
!insertion && nearestEmptyInsertDetectEvent(evt);
|
1912
|
-
}
|
1913
|
-
|
1914
|
-
!options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();
|
1915
|
-
return completedFired = true;
|
1916
|
-
} // Call when dragEl has been inserted
|
1917
|
-
|
1918
|
-
|
1919
|
-
function changed() {
|
1920
|
-
newIndex = index(dragEl);
|
1921
|
-
newDraggableIndex = index(dragEl, options.draggable);
|
1922
|
-
|
1923
|
-
_dispatchEvent({
|
1924
|
-
sortable: _this,
|
1925
|
-
name: 'change',
|
1926
|
-
toEl: el,
|
1927
|
-
newIndex: newIndex,
|
1928
|
-
newDraggableIndex: newDraggableIndex,
|
1929
|
-
originalEvent: evt
|
1930
|
-
});
|
1931
|
-
}
|
1932
|
-
|
1933
|
-
if (evt.preventDefault !== void 0) {
|
1934
|
-
evt.cancelable && evt.preventDefault();
|
1935
|
-
}
|
1936
|
-
|
1937
|
-
target = closest(target, options.draggable, el, true);
|
1938
|
-
dragOverEvent('dragOver');
|
1939
|
-
if (Sortable.eventCanceled) return completedFired;
|
1940
|
-
|
1941
|
-
if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {
|
1942
|
-
return completed(false);
|
1943
|
-
}
|
1944
|
-
|
1945
|
-
ignoreNextClick = false;
|
1946
|
-
|
1947
|
-
if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list
|
1948
|
-
: putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {
|
1949
|
-
vertical = this._getDirection(evt, target) === 'vertical';
|
1950
|
-
dragRect = getRect(dragEl);
|
1951
|
-
dragOverEvent('dragOverValid');
|
1952
|
-
if (Sortable.eventCanceled) return completedFired;
|
1953
|
-
|
1954
|
-
if (revert) {
|
1955
|
-
parentEl = rootEl; // actualization
|
1956
|
-
|
1957
|
-
capture();
|
1958
|
-
|
1959
|
-
this._hideClone();
|
1960
|
-
|
1961
|
-
dragOverEvent('revert');
|
1962
|
-
|
1963
|
-
if (!Sortable.eventCanceled) {
|
1964
|
-
if (nextEl) {
|
1965
|
-
rootEl.insertBefore(dragEl, nextEl);
|
1966
|
-
} else {
|
1967
|
-
rootEl.appendChild(dragEl);
|
1968
|
-
}
|
1969
|
-
}
|
1970
|
-
|
1971
|
-
return completed(true);
|
1972
|
-
}
|
1973
|
-
|
1974
|
-
var elLastChild = lastChild(el, options.draggable);
|
1975
|
-
|
1976
|
-
if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {
|
1977
|
-
// Insert to end of list
|
1978
|
-
// If already at end of list: Do not insert
|
1979
|
-
if (elLastChild === dragEl) {
|
1980
|
-
return completed(false);
|
1981
|
-
} // if there is a last element, it is the target
|
1982
|
-
|
1983
|
-
|
1984
|
-
if (elLastChild && el === evt.target) {
|
1985
|
-
target = elLastChild;
|
1986
|
-
}
|
1987
|
-
|
1988
|
-
if (target) {
|
1989
|
-
targetRect = getRect(target);
|
1990
|
-
}
|
1991
|
-
|
1992
|
-
if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {
|
1993
|
-
capture();
|
1994
|
-
|
1995
|
-
if (elLastChild && elLastChild.nextSibling) {
|
1996
|
-
// the last draggable element is not the last node
|
1997
|
-
el.insertBefore(dragEl, elLastChild.nextSibling);
|
1998
|
-
} else {
|
1999
|
-
el.appendChild(dragEl);
|
2000
|
-
}
|
2001
|
-
|
2002
|
-
parentEl = el; // actualization
|
2003
|
-
|
2004
|
-
changed();
|
2005
|
-
return completed(true);
|
2006
|
-
}
|
2007
|
-
} else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {
|
2008
|
-
// Insert to start of list
|
2009
|
-
var firstChild = getChild(el, 0, options, true);
|
2010
|
-
|
2011
|
-
if (firstChild === dragEl) {
|
2012
|
-
return completed(false);
|
2013
|
-
}
|
2014
|
-
|
2015
|
-
target = firstChild;
|
2016
|
-
targetRect = getRect(target);
|
2017
|
-
|
2018
|
-
if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {
|
2019
|
-
capture();
|
2020
|
-
el.insertBefore(dragEl, firstChild);
|
2021
|
-
parentEl = el; // actualization
|
2022
|
-
|
2023
|
-
changed();
|
2024
|
-
return completed(true);
|
2025
|
-
}
|
2026
|
-
} else if (target.parentNode === el) {
|
2027
|
-
targetRect = getRect(target);
|
2028
|
-
var direction = 0,
|
2029
|
-
targetBeforeFirstSwap,
|
2030
|
-
differentLevel = dragEl.parentNode !== el,
|
2031
|
-
differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),
|
2032
|
-
side1 = vertical ? 'top' : 'left',
|
2033
|
-
scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),
|
2034
|
-
scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;
|
2035
|
-
|
2036
|
-
if (lastTarget !== target) {
|
2037
|
-
targetBeforeFirstSwap = targetRect[side1];
|
2038
|
-
pastFirstInvertThresh = false;
|
2039
|
-
isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;
|
2040
|
-
}
|
2041
|
-
|
2042
|
-
direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);
|
2043
|
-
var sibling;
|
2044
|
-
|
2045
|
-
if (direction !== 0) {
|
2046
|
-
// Check if target is beside dragEl in respective direction (ignoring hidden elements)
|
2047
|
-
var dragIndex = index(dragEl);
|
2048
|
-
|
2049
|
-
do {
|
2050
|
-
dragIndex -= direction;
|
2051
|
-
sibling = parentEl.children[dragIndex];
|
2052
|
-
} while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));
|
2053
|
-
} // If dragEl is already beside target: Do not insert
|
2054
|
-
|
2055
|
-
|
2056
|
-
if (direction === 0 || sibling === target) {
|
2057
|
-
return completed(false);
|
2058
|
-
}
|
2059
|
-
|
2060
|
-
lastTarget = target;
|
2061
|
-
lastDirection = direction;
|
2062
|
-
var nextSibling = target.nextElementSibling,
|
2063
|
-
after = false;
|
2064
|
-
after = direction === 1;
|
2065
|
-
|
2066
|
-
var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);
|
2067
|
-
|
2068
|
-
if (moveVector !== false) {
|
2069
|
-
if (moveVector === 1 || moveVector === -1) {
|
2070
|
-
after = moveVector === 1;
|
2071
|
-
}
|
2072
|
-
|
2073
|
-
_silent = true;
|
2074
|
-
setTimeout(_unsilent, 30);
|
2075
|
-
capture();
|
2076
|
-
|
2077
|
-
if (after && !nextSibling) {
|
2078
|
-
el.appendChild(dragEl);
|
2079
|
-
} else {
|
2080
|
-
target.parentNode.insertBefore(dragEl, after ? nextSibling : target);
|
2081
|
-
} // Undo chrome's scroll adjustment (has no effect on other browsers)
|
2082
|
-
|
2083
|
-
|
2084
|
-
if (scrolledPastTop) {
|
2085
|
-
scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);
|
2086
|
-
}
|
2087
|
-
|
2088
|
-
parentEl = dragEl.parentNode; // actualization
|
2089
|
-
// must be done before animation
|
2090
|
-
|
2091
|
-
if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {
|
2092
|
-
targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);
|
2093
|
-
}
|
2094
|
-
|
2095
|
-
changed();
|
2096
|
-
return completed(true);
|
2097
|
-
}
|
2098
|
-
}
|
2099
|
-
|
2100
|
-
if (el.contains(dragEl)) {
|
2101
|
-
return completed(false);
|
2102
|
-
}
|
2103
|
-
}
|
2104
|
-
|
2105
|
-
return false;
|
2106
|
-
},
|
2107
|
-
_ignoreWhileAnimating: null,
|
2108
|
-
_offMoveEvents: function _offMoveEvents() {
|
2109
|
-
off(document, 'mousemove', this._onTouchMove);
|
2110
|
-
off(document, 'touchmove', this._onTouchMove);
|
2111
|
-
off(document, 'pointermove', this._onTouchMove);
|
2112
|
-
off(document, 'dragover', nearestEmptyInsertDetectEvent);
|
2113
|
-
off(document, 'mousemove', nearestEmptyInsertDetectEvent);
|
2114
|
-
off(document, 'touchmove', nearestEmptyInsertDetectEvent);
|
2115
|
-
},
|
2116
|
-
_offUpEvents: function _offUpEvents() {
|
2117
|
-
var ownerDocument = this.el.ownerDocument;
|
2118
|
-
off(ownerDocument, 'mouseup', this._onDrop);
|
2119
|
-
off(ownerDocument, 'touchend', this._onDrop);
|
2120
|
-
off(ownerDocument, 'pointerup', this._onDrop);
|
2121
|
-
off(ownerDocument, 'touchcancel', this._onDrop);
|
2122
|
-
off(document, 'selectstart', this);
|
2123
|
-
},
|
2124
|
-
_onDrop: function _onDrop(
|
2125
|
-
/**Event*/
|
2126
|
-
evt) {
|
2127
|
-
var el = this.el,
|
2128
|
-
options = this.options; // Get the index of the dragged element within its parent
|
2129
|
-
|
2130
|
-
newIndex = index(dragEl);
|
2131
|
-
newDraggableIndex = index(dragEl, options.draggable);
|
2132
|
-
pluginEvent('drop', this, {
|
2133
|
-
evt: evt
|
2134
|
-
});
|
2135
|
-
parentEl = dragEl && dragEl.parentNode; // Get again after plugin event
|
2136
|
-
|
2137
|
-
newIndex = index(dragEl);
|
2138
|
-
newDraggableIndex = index(dragEl, options.draggable);
|
2139
|
-
|
2140
|
-
if (Sortable.eventCanceled) {
|
2141
|
-
this._nulling();
|
2142
|
-
|
2143
|
-
return;
|
2144
|
-
}
|
2145
|
-
|
2146
|
-
awaitingDragStarted = false;
|
2147
|
-
isCircumstantialInvert = false;
|
2148
|
-
pastFirstInvertThresh = false;
|
2149
|
-
clearInterval(this._loopId);
|
2150
|
-
clearTimeout(this._dragStartTimer);
|
2151
|
-
|
2152
|
-
_cancelNextTick(this.cloneId);
|
2153
|
-
|
2154
|
-
_cancelNextTick(this._dragStartId); // Unbind events
|
2155
|
-
|
2156
|
-
|
2157
|
-
if (this.nativeDraggable) {
|
2158
|
-
off(document, 'drop', this);
|
2159
|
-
off(el, 'dragstart', this._onDragStart);
|
2160
|
-
}
|
2161
|
-
|
2162
|
-
this._offMoveEvents();
|
2163
|
-
|
2164
|
-
this._offUpEvents();
|
2165
|
-
|
2166
|
-
if (Safari) {
|
2167
|
-
css(document.body, 'user-select', '');
|
2168
|
-
}
|
2169
|
-
|
2170
|
-
css(dragEl, 'transform', '');
|
2171
|
-
|
2172
|
-
if (evt) {
|
2173
|
-
if (moved) {
|
2174
|
-
evt.cancelable && evt.preventDefault();
|
2175
|
-
!options.dropBubble && evt.stopPropagation();
|
2176
|
-
}
|
2177
|
-
|
2178
|
-
ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);
|
2179
|
-
|
2180
|
-
if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {
|
2181
|
-
// Remove clone(s)
|
2182
|
-
cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);
|
2183
|
-
}
|
2184
|
-
|
2185
|
-
if (dragEl) {
|
2186
|
-
if (this.nativeDraggable) {
|
2187
|
-
off(dragEl, 'dragend', this);
|
2188
|
-
}
|
2189
|
-
|
2190
|
-
_disableDraggable(dragEl);
|
2191
|
-
|
2192
|
-
dragEl.style['will-change'] = ''; // Remove classes
|
2193
|
-
// ghostClass is added in dragStarted
|
2194
|
-
|
2195
|
-
if (moved && !awaitingDragStarted) {
|
2196
|
-
toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);
|
2197
|
-
}
|
2198
|
-
|
2199
|
-
toggleClass(dragEl, this.options.chosenClass, false); // Drag stop event
|
2200
|
-
|
2201
|
-
_dispatchEvent({
|
2202
|
-
sortable: this,
|
2203
|
-
name: 'unchoose',
|
2204
|
-
toEl: parentEl,
|
2205
|
-
newIndex: null,
|
2206
|
-
newDraggableIndex: null,
|
2207
|
-
originalEvent: evt
|
2208
|
-
});
|
2209
|
-
|
2210
|
-
if (rootEl !== parentEl) {
|
2211
|
-
if (newIndex >= 0) {
|
2212
|
-
// Add event
|
2213
|
-
_dispatchEvent({
|
2214
|
-
rootEl: parentEl,
|
2215
|
-
name: 'add',
|
2216
|
-
toEl: parentEl,
|
2217
|
-
fromEl: rootEl,
|
2218
|
-
originalEvent: evt
|
2219
|
-
}); // Remove event
|
2220
|
-
|
2221
|
-
|
2222
|
-
_dispatchEvent({
|
2223
|
-
sortable: this,
|
2224
|
-
name: 'remove',
|
2225
|
-
toEl: parentEl,
|
2226
|
-
originalEvent: evt
|
2227
|
-
}); // drag from one list and drop into another
|
2228
|
-
|
2229
|
-
|
2230
|
-
_dispatchEvent({
|
2231
|
-
rootEl: parentEl,
|
2232
|
-
name: 'sort',
|
2233
|
-
toEl: parentEl,
|
2234
|
-
fromEl: rootEl,
|
2235
|
-
originalEvent: evt
|
2236
|
-
});
|
2237
|
-
|
2238
|
-
_dispatchEvent({
|
2239
|
-
sortable: this,
|
2240
|
-
name: 'sort',
|
2241
|
-
toEl: parentEl,
|
2242
|
-
originalEvent: evt
|
2243
|
-
});
|
2244
|
-
}
|
2245
|
-
|
2246
|
-
putSortable && putSortable.save();
|
2247
|
-
} else {
|
2248
|
-
if (newIndex !== oldIndex) {
|
2249
|
-
if (newIndex >= 0) {
|
2250
|
-
// drag & drop within the same list
|
2251
|
-
_dispatchEvent({
|
2252
|
-
sortable: this,
|
2253
|
-
name: 'update',
|
2254
|
-
toEl: parentEl,
|
2255
|
-
originalEvent: evt
|
2256
|
-
});
|
2257
|
-
|
2258
|
-
_dispatchEvent({
|
2259
|
-
sortable: this,
|
2260
|
-
name: 'sort',
|
2261
|
-
toEl: parentEl,
|
2262
|
-
originalEvent: evt
|
2263
|
-
});
|
2264
|
-
}
|
2265
|
-
}
|
2266
|
-
}
|
2267
|
-
|
2268
|
-
if (Sortable.active) {
|
2269
|
-
/* jshint eqnull:true */
|
2270
|
-
if (newIndex == null || newIndex === -1) {
|
2271
|
-
newIndex = oldIndex;
|
2272
|
-
newDraggableIndex = oldDraggableIndex;
|
2273
|
-
}
|
2274
|
-
|
2275
|
-
_dispatchEvent({
|
2276
|
-
sortable: this,
|
2277
|
-
name: 'end',
|
2278
|
-
toEl: parentEl,
|
2279
|
-
originalEvent: evt
|
2280
|
-
}); // Save sorting
|
2281
|
-
|
2282
|
-
|
2283
|
-
this.save();
|
2284
|
-
}
|
2285
|
-
}
|
2286
|
-
}
|
2287
|
-
|
2288
|
-
this._nulling();
|
2289
|
-
},
|
2290
|
-
_nulling: function _nulling() {
|
2291
|
-
pluginEvent('nulling', this);
|
2292
|
-
rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;
|
2293
|
-
savedInputChecked.forEach(function (el) {
|
2294
|
-
el.checked = true;
|
2295
|
-
});
|
2296
|
-
savedInputChecked.length = lastDx = lastDy = 0;
|
2297
|
-
},
|
2298
|
-
handleEvent: function handleEvent(
|
2299
|
-
/**Event*/
|
2300
|
-
evt) {
|
2301
|
-
switch (evt.type) {
|
2302
|
-
case 'drop':
|
2303
|
-
case 'dragend':
|
2304
|
-
this._onDrop(evt);
|
2305
|
-
|
2306
|
-
break;
|
2307
|
-
|
2308
|
-
case 'dragenter':
|
2309
|
-
case 'dragover':
|
2310
|
-
if (dragEl) {
|
2311
|
-
this._onDragOver(evt);
|
2312
|
-
|
2313
|
-
_globalDragOver(evt);
|
2314
|
-
}
|
2315
|
-
|
2316
|
-
break;
|
2317
|
-
|
2318
|
-
case 'selectstart':
|
2319
|
-
evt.preventDefault();
|
2320
|
-
break;
|
2321
|
-
}
|
2322
|
-
},
|
2323
|
-
|
2324
|
-
/**
|
2325
|
-
* Serializes the item into an array of string.
|
2326
|
-
* @returns {String[]}
|
2327
|
-
*/
|
2328
|
-
toArray: function toArray() {
|
2329
|
-
var order = [],
|
2330
|
-
el,
|
2331
|
-
children = this.el.children,
|
2332
|
-
i = 0,
|
2333
|
-
n = children.length,
|
2334
|
-
options = this.options;
|
2335
|
-
|
2336
|
-
for (; i < n; i++) {
|
2337
|
-
el = children[i];
|
2338
|
-
|
2339
|
-
if (closest(el, options.draggable, this.el, false)) {
|
2340
|
-
order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));
|
2341
|
-
}
|
2342
|
-
}
|
2343
|
-
|
2344
|
-
return order;
|
2345
|
-
},
|
2346
|
-
|
2347
|
-
/**
|
2348
|
-
* Sorts the elements according to the array.
|
2349
|
-
* @param {String[]} order order of the items
|
2350
|
-
*/
|
2351
|
-
sort: function sort(order, useAnimation) {
|
2352
|
-
var items = {},
|
2353
|
-
rootEl = this.el;
|
2354
|
-
this.toArray().forEach(function (id, i) {
|
2355
|
-
var el = rootEl.children[i];
|
2356
|
-
|
2357
|
-
if (closest(el, this.options.draggable, rootEl, false)) {
|
2358
|
-
items[id] = el;
|
2359
|
-
}
|
2360
|
-
}, this);
|
2361
|
-
useAnimation && this.captureAnimationState();
|
2362
|
-
order.forEach(function (id) {
|
2363
|
-
if (items[id]) {
|
2364
|
-
rootEl.removeChild(items[id]);
|
2365
|
-
rootEl.appendChild(items[id]);
|
2366
|
-
}
|
2367
|
-
});
|
2368
|
-
useAnimation && this.animateAll();
|
2369
|
-
},
|
2370
|
-
|
2371
|
-
/**
|
2372
|
-
* Save the current sorting
|
2373
|
-
*/
|
2374
|
-
save: function save() {
|
2375
|
-
var store = this.options.store;
|
2376
|
-
store && store.set && store.set(this);
|
2377
|
-
},
|
2378
|
-
|
2379
|
-
/**
|
2380
|
-
* 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
|
-
* @param {HTMLElement} el
|
2382
|
-
* @param {String} [selector] default: `options.draggable`
|
2383
|
-
* @returns {HTMLElement|null}
|
2384
|
-
*/
|
2385
|
-
closest: function closest$1(el, selector) {
|
2386
|
-
return closest(el, selector || this.options.draggable, this.el, false);
|
2387
|
-
},
|
2388
|
-
|
2389
|
-
/**
|
2390
|
-
* Set/get option
|
2391
|
-
* @param {string} name
|
2392
|
-
* @param {*} [value]
|
2393
|
-
* @returns {*}
|
2394
|
-
*/
|
2395
|
-
option: function option(name, value) {
|
2396
|
-
var options = this.options;
|
2397
|
-
|
2398
|
-
if (value === void 0) {
|
2399
|
-
return options[name];
|
2400
|
-
} else {
|
2401
|
-
var modifiedValue = PluginManager.modifyOption(this, name, value);
|
2402
|
-
|
2403
|
-
if (typeof modifiedValue !== 'undefined') {
|
2404
|
-
options[name] = modifiedValue;
|
2405
|
-
} else {
|
2406
|
-
options[name] = value;
|
2407
|
-
}
|
2408
|
-
|
2409
|
-
if (name === 'group') {
|
2410
|
-
_prepareGroup(options);
|
2411
|
-
}
|
2412
|
-
}
|
2413
|
-
},
|
2414
|
-
|
2415
|
-
/**
|
2416
|
-
* Destroy
|
2417
|
-
*/
|
2418
|
-
destroy: function destroy() {
|
2419
|
-
pluginEvent('destroy', this);
|
2420
|
-
var el = this.el;
|
2421
|
-
el[expando] = null;
|
2422
|
-
off(el, 'mousedown', this._onTapStart);
|
2423
|
-
off(el, 'touchstart', this._onTapStart);
|
2424
|
-
off(el, 'pointerdown', this._onTapStart);
|
2425
|
-
|
2426
|
-
if (this.nativeDraggable) {
|
2427
|
-
off(el, 'dragover', this);
|
2428
|
-
off(el, 'dragenter', this);
|
2429
|
-
} // Remove draggable attributes
|
2430
|
-
|
2431
|
-
|
2432
|
-
Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {
|
2433
|
-
el.removeAttribute('draggable');
|
2434
|
-
});
|
2435
|
-
|
2436
|
-
this._onDrop();
|
2437
|
-
|
2438
|
-
this._disableDelayedDragEvents();
|
2439
|
-
|
2440
|
-
sortables.splice(sortables.indexOf(this.el), 1);
|
2441
|
-
this.el = el = null;
|
2442
|
-
},
|
2443
|
-
_hideClone: function _hideClone() {
|
2444
|
-
if (!cloneHidden) {
|
2445
|
-
pluginEvent('hideClone', this);
|
2446
|
-
if (Sortable.eventCanceled) return;
|
2447
|
-
css(cloneEl, 'display', 'none');
|
2448
|
-
|
2449
|
-
if (this.options.removeCloneOnHide && cloneEl.parentNode) {
|
2450
|
-
cloneEl.parentNode.removeChild(cloneEl);
|
2451
|
-
}
|
2452
|
-
|
2453
|
-
cloneHidden = true;
|
2454
|
-
}
|
2455
|
-
},
|
2456
|
-
_showClone: function _showClone(putSortable) {
|
2457
|
-
if (putSortable.lastPutMode !== 'clone') {
|
2458
|
-
this._hideClone();
|
2459
|
-
|
2460
|
-
return;
|
2461
|
-
}
|
2462
|
-
|
2463
|
-
if (cloneHidden) {
|
2464
|
-
pluginEvent('showClone', this);
|
2465
|
-
if (Sortable.eventCanceled) return; // show clone at dragEl or original position
|
2466
|
-
|
2467
|
-
if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {
|
2468
|
-
rootEl.insertBefore(cloneEl, dragEl);
|
2469
|
-
} else if (nextEl) {
|
2470
|
-
rootEl.insertBefore(cloneEl, nextEl);
|
2471
|
-
} else {
|
2472
|
-
rootEl.appendChild(cloneEl);
|
2473
|
-
}
|
2474
|
-
|
2475
|
-
if (this.options.group.revertClone) {
|
2476
|
-
this.animate(dragEl, cloneEl);
|
2477
|
-
}
|
2478
|
-
|
2479
|
-
css(cloneEl, 'display', '');
|
2480
|
-
cloneHidden = false;
|
2481
|
-
}
|
2482
|
-
}
|
2483
|
-
};
|
2484
|
-
|
2485
|
-
function _globalDragOver(
|
2486
|
-
/**Event*/
|
2487
|
-
evt) {
|
2488
|
-
if (evt.dataTransfer) {
|
2489
|
-
evt.dataTransfer.dropEffect = 'move';
|
2490
|
-
}
|
2491
|
-
|
2492
|
-
evt.cancelable && evt.preventDefault();
|
2493
|
-
}
|
2494
|
-
|
2495
|
-
function _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {
|
2496
|
-
var evt,
|
2497
|
-
sortable = fromEl[expando],
|
2498
|
-
onMoveFn = sortable.options.onMove,
|
2499
|
-
retVal; // Support for new CustomEvent feature
|
2500
|
-
|
2501
|
-
if (window.CustomEvent && !IE11OrLess && !Edge) {
|
2502
|
-
evt = new CustomEvent('move', {
|
2503
|
-
bubbles: true,
|
2504
|
-
cancelable: true
|
2505
|
-
});
|
2506
|
-
} else {
|
2507
|
-
evt = document.createEvent('Event');
|
2508
|
-
evt.initEvent('move', true, true);
|
2509
|
-
}
|
2510
|
-
|
2511
|
-
evt.to = toEl;
|
2512
|
-
evt.from = fromEl;
|
2513
|
-
evt.dragged = dragEl;
|
2514
|
-
evt.draggedRect = dragRect;
|
2515
|
-
evt.related = targetEl || toEl;
|
2516
|
-
evt.relatedRect = targetRect || getRect(toEl);
|
2517
|
-
evt.willInsertAfter = willInsertAfter;
|
2518
|
-
evt.originalEvent = originalEvent;
|
2519
|
-
fromEl.dispatchEvent(evt);
|
2520
|
-
|
2521
|
-
if (onMoveFn) {
|
2522
|
-
retVal = onMoveFn.call(sortable, evt, originalEvent);
|
2523
|
-
}
|
2524
|
-
|
2525
|
-
return retVal;
|
2526
|
-
}
|
2527
|
-
|
2528
|
-
function _disableDraggable(el) {
|
2529
|
-
el.draggable = false;
|
2530
|
-
}
|
2531
|
-
|
2532
|
-
function _unsilent() {
|
2533
|
-
_silent = false;
|
2534
|
-
}
|
2535
|
-
|
2536
|
-
function _ghostIsFirst(evt, vertical, sortable) {
|
2537
|
-
var rect = getRect(getChild(sortable.el, 0, sortable.options, true));
|
2538
|
-
var spacer = 10;
|
2539
|
-
return vertical ? evt.clientX < rect.left - spacer || evt.clientY < rect.top && evt.clientX < rect.right : evt.clientY < rect.top - spacer || evt.clientY < rect.bottom && evt.clientX < rect.left;
|
2540
|
-
}
|
2541
|
-
|
2542
|
-
function _ghostIsLast(evt, vertical, sortable) {
|
2543
|
-
var rect = getRect(lastChild(sortable.el, sortable.options.draggable));
|
2544
|
-
var spacer = 10;
|
2545
|
-
return vertical ? evt.clientX > rect.right + spacer || evt.clientX <= rect.right && evt.clientY > rect.bottom && evt.clientX >= rect.left : evt.clientX > rect.right && evt.clientY > rect.top || evt.clientX <= rect.right && evt.clientY > rect.bottom + spacer;
|
2546
|
-
}
|
2547
|
-
|
2548
|
-
function _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {
|
2549
|
-
var mouseOnAxis = vertical ? evt.clientY : evt.clientX,
|
2550
|
-
targetLength = vertical ? targetRect.height : targetRect.width,
|
2551
|
-
targetS1 = vertical ? targetRect.top : targetRect.left,
|
2552
|
-
targetS2 = vertical ? targetRect.bottom : targetRect.right,
|
2553
|
-
invert = false;
|
2554
|
-
|
2555
|
-
if (!invertSwap) {
|
2556
|
-
// Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold
|
2557
|
-
if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {
|
2558
|
-
// multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2
|
2559
|
-
// check if past first invert threshold on side opposite of lastDirection
|
2560
|
-
if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {
|
2561
|
-
// past first invert threshold, do not restrict inverted threshold to dragEl shadow
|
2562
|
-
pastFirstInvertThresh = true;
|
2563
|
-
}
|
2564
|
-
|
2565
|
-
if (!pastFirstInvertThresh) {
|
2566
|
-
// dragEl shadow (target move distance shadow)
|
2567
|
-
if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow
|
2568
|
-
: mouseOnAxis > targetS2 - targetMoveDistance) {
|
2569
|
-
return -lastDirection;
|
2570
|
-
}
|
2571
|
-
} else {
|
2572
|
-
invert = true;
|
2573
|
-
}
|
2574
|
-
} else {
|
2575
|
-
// Regular
|
2576
|
-
if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {
|
2577
|
-
return _getInsertDirection(target);
|
2578
|
-
}
|
2579
|
-
}
|
2580
|
-
}
|
2581
|
-
|
2582
|
-
invert = invert || invertSwap;
|
2583
|
-
|
2584
|
-
if (invert) {
|
2585
|
-
// Invert of regular
|
2586
|
-
if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {
|
2587
|
-
return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;
|
2588
|
-
}
|
2589
|
-
}
|
2590
|
-
|
2591
|
-
return 0;
|
2592
|
-
}
|
2593
|
-
/**
|
2594
|
-
* Gets the direction dragEl must be swapped relative to target in order to make it
|
2595
|
-
* seem that dragEl has been "inserted" into that element's position
|
2596
|
-
* @param {HTMLElement} target The target whose position dragEl is being inserted at
|
2597
|
-
* @return {Number} Direction dragEl must be swapped
|
2598
|
-
*/
|
2599
|
-
|
2600
|
-
|
2601
|
-
function _getInsertDirection(target) {
|
2602
|
-
if (index(dragEl) < index(target)) {
|
2603
|
-
return 1;
|
2604
|
-
} else {
|
2605
|
-
return -1;
|
2606
|
-
}
|
2607
|
-
}
|
2608
|
-
/**
|
2609
|
-
* Generate id
|
2610
|
-
* @param {HTMLElement} el
|
2611
|
-
* @returns {String}
|
2612
|
-
* @private
|
2613
|
-
*/
|
2614
|
-
|
2615
|
-
|
2616
|
-
function _generateId(el) {
|
2617
|
-
var str = el.tagName + el.className + el.src + el.href + el.textContent,
|
2618
|
-
i = str.length,
|
2619
|
-
sum = 0;
|
2620
|
-
|
2621
|
-
while (i--) {
|
2622
|
-
sum += str.charCodeAt(i);
|
2623
|
-
}
|
2624
|
-
|
2625
|
-
return sum.toString(36);
|
2626
|
-
}
|
2627
|
-
|
2628
|
-
function _saveInputCheckedState(root) {
|
2629
|
-
savedInputChecked.length = 0;
|
2630
|
-
var inputs = root.getElementsByTagName('input');
|
2631
|
-
var idx = inputs.length;
|
2632
|
-
|
2633
|
-
while (idx--) {
|
2634
|
-
var el = inputs[idx];
|
2635
|
-
el.checked && savedInputChecked.push(el);
|
2636
|
-
}
|
2637
|
-
}
|
2638
|
-
|
2639
|
-
function _nextTick(fn) {
|
2640
|
-
return setTimeout(fn, 0);
|
2641
|
-
}
|
2642
|
-
|
2643
|
-
function _cancelNextTick(id) {
|
2644
|
-
return clearTimeout(id);
|
2645
|
-
} // Fixed #973:
|
2646
|
-
|
2647
|
-
|
2648
|
-
if (documentExists) {
|
2649
|
-
on(document, 'touchmove', function (evt) {
|
2650
|
-
if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {
|
2651
|
-
evt.preventDefault();
|
2652
|
-
}
|
2653
|
-
});
|
2654
|
-
} // Export utils
|
2655
|
-
|
2656
|
-
|
2657
|
-
Sortable.utils = {
|
2658
|
-
on: on,
|
2659
|
-
off: off,
|
2660
|
-
css: css,
|
2661
|
-
find: find,
|
2662
|
-
is: function is(el, selector) {
|
2663
|
-
return !!closest(el, selector, el, false);
|
2664
|
-
},
|
2665
|
-
extend: extend,
|
2666
|
-
throttle: throttle,
|
2667
|
-
closest: closest,
|
2668
|
-
toggleClass: toggleClass,
|
2669
|
-
clone: clone,
|
2670
|
-
index: index,
|
2671
|
-
nextTick: _nextTick,
|
2672
|
-
cancelNextTick: _cancelNextTick,
|
2673
|
-
detectDirection: _detectDirection,
|
2674
|
-
getChild: getChild
|
2675
|
-
};
|
2676
|
-
/**
|
2677
|
-
* Get the Sortable instance of an element
|
2678
|
-
* @param {HTMLElement} element The element
|
2679
|
-
* @return {Sortable|undefined} The instance of Sortable
|
2680
|
-
*/
|
2681
|
-
|
2682
|
-
Sortable.get = function (element) {
|
2683
|
-
return element[expando];
|
2684
|
-
};
|
2685
|
-
/**
|
2686
|
-
* Mount a plugin to Sortable
|
2687
|
-
* @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted
|
2688
|
-
*/
|
2689
|
-
|
2690
|
-
|
2691
|
-
Sortable.mount = function () {
|
2692
|
-
for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {
|
2693
|
-
plugins[_key] = arguments[_key];
|
2694
|
-
}
|
2695
|
-
|
2696
|
-
if (plugins[0].constructor === Array) plugins = plugins[0];
|
2697
|
-
plugins.forEach(function (plugin) {
|
2698
|
-
if (!plugin.prototype || !plugin.prototype.constructor) {
|
2699
|
-
throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(plugin));
|
2700
|
-
}
|
2701
|
-
|
2702
|
-
if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);
|
2703
|
-
PluginManager.mount(plugin);
|
2704
|
-
});
|
2705
|
-
};
|
2706
|
-
/**
|
2707
|
-
* Create sortable instance
|
2708
|
-
* @param {HTMLElement} el
|
2709
|
-
* @param {Object} [options]
|
2710
|
-
*/
|
2711
|
-
|
2712
|
-
|
2713
|
-
Sortable.create = function (el, options) {
|
2714
|
-
return new Sortable(el, options);
|
2715
|
-
}; // Export
|
2716
|
-
|
2717
|
-
|
2718
|
-
Sortable.version = version;
|
2719
|
-
|
2720
|
-
var autoScrolls = [],
|
2721
|
-
scrollEl,
|
2722
|
-
scrollRootEl,
|
2723
|
-
scrolling = false,
|
2724
|
-
lastAutoScrollX,
|
2725
|
-
lastAutoScrollY,
|
2726
|
-
touchEvt$1,
|
2727
|
-
pointerElemChangedInterval;
|
2728
|
-
|
2729
|
-
function AutoScrollPlugin() {
|
2730
|
-
function AutoScroll() {
|
2731
|
-
this.defaults = {
|
2732
|
-
scroll: true,
|
2733
|
-
forceAutoScrollFallback: false,
|
2734
|
-
scrollSensitivity: 30,
|
2735
|
-
scrollSpeed: 10,
|
2736
|
-
bubbleScroll: true
|
2737
|
-
}; // Bind all private methods
|
2738
|
-
|
2739
|
-
for (var fn in this) {
|
2740
|
-
if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
|
2741
|
-
this[fn] = this[fn].bind(this);
|
2742
|
-
}
|
2743
|
-
}
|
2744
|
-
}
|
2745
|
-
|
2746
|
-
AutoScroll.prototype = {
|
2747
|
-
dragStarted: function dragStarted(_ref) {
|
2748
|
-
var originalEvent = _ref.originalEvent;
|
2749
|
-
|
2750
|
-
if (this.sortable.nativeDraggable) {
|
2751
|
-
on(document, 'dragover', this._handleAutoScroll);
|
2752
|
-
} else {
|
2753
|
-
if (this.options.supportPointer) {
|
2754
|
-
on(document, 'pointermove', this._handleFallbackAutoScroll);
|
2755
|
-
} else if (originalEvent.touches) {
|
2756
|
-
on(document, 'touchmove', this._handleFallbackAutoScroll);
|
2757
|
-
} else {
|
2758
|
-
on(document, 'mousemove', this._handleFallbackAutoScroll);
|
2759
|
-
}
|
2760
|
-
}
|
2761
|
-
},
|
2762
|
-
dragOverCompleted: function dragOverCompleted(_ref2) {
|
2763
|
-
var originalEvent = _ref2.originalEvent;
|
2764
|
-
|
2765
|
-
// For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)
|
2766
|
-
if (!this.options.dragOverBubble && !originalEvent.rootEl) {
|
2767
|
-
this._handleAutoScroll(originalEvent);
|
2768
|
-
}
|
2769
|
-
},
|
2770
|
-
drop: function drop() {
|
2771
|
-
if (this.sortable.nativeDraggable) {
|
2772
|
-
off(document, 'dragover', this._handleAutoScroll);
|
2773
|
-
} else {
|
2774
|
-
off(document, 'pointermove', this._handleFallbackAutoScroll);
|
2775
|
-
off(document, 'touchmove', this._handleFallbackAutoScroll);
|
2776
|
-
off(document, 'mousemove', this._handleFallbackAutoScroll);
|
2777
|
-
}
|
2778
|
-
|
2779
|
-
clearPointerElemChangedInterval();
|
2780
|
-
clearAutoScrolls();
|
2781
|
-
cancelThrottle();
|
2782
|
-
},
|
2783
|
-
nulling: function nulling() {
|
2784
|
-
touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;
|
2785
|
-
autoScrolls.length = 0;
|
2786
|
-
},
|
2787
|
-
_handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {
|
2788
|
-
this._handleAutoScroll(evt, true);
|
2789
|
-
},
|
2790
|
-
_handleAutoScroll: function _handleAutoScroll(evt, fallback) {
|
2791
|
-
var _this = this;
|
2792
|
-
|
2793
|
-
var x = (evt.touches ? evt.touches[0] : evt).clientX,
|
2794
|
-
y = (evt.touches ? evt.touches[0] : evt).clientY,
|
2795
|
-
elem = document.elementFromPoint(x, y);
|
2796
|
-
touchEvt$1 = evt; // IE does not seem to have native autoscroll,
|
2797
|
-
// Edge's autoscroll seems too conditional,
|
2798
|
-
// MACOS Safari does not have autoscroll,
|
2799
|
-
// Firefox and Chrome are good
|
2800
|
-
|
2801
|
-
if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {
|
2802
|
-
autoScroll(evt, this.options, elem, fallback); // Listener for pointer element change
|
2803
|
-
|
2804
|
-
var ogElemScroller = getParentAutoScrollElement(elem, true);
|
2805
|
-
|
2806
|
-
if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {
|
2807
|
-
pointerElemChangedInterval && clearPointerElemChangedInterval(); // Detect for pointer elem change, emulating native DnD behaviour
|
2808
|
-
|
2809
|
-
pointerElemChangedInterval = setInterval(function () {
|
2810
|
-
var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);
|
2811
|
-
|
2812
|
-
if (newElem !== ogElemScroller) {
|
2813
|
-
ogElemScroller = newElem;
|
2814
|
-
clearAutoScrolls();
|
2815
|
-
}
|
2816
|
-
|
2817
|
-
autoScroll(evt, _this.options, newElem, fallback);
|
2818
|
-
}, 10);
|
2819
|
-
lastAutoScrollX = x;
|
2820
|
-
lastAutoScrollY = y;
|
2821
|
-
}
|
2822
|
-
} else {
|
2823
|
-
// if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll
|
2824
|
-
if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {
|
2825
|
-
clearAutoScrolls();
|
2826
|
-
return;
|
2827
|
-
}
|
2828
|
-
|
2829
|
-
autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);
|
2830
|
-
}
|
2831
|
-
}
|
2832
|
-
};
|
2833
|
-
return _extends(AutoScroll, {
|
2834
|
-
pluginName: 'scroll',
|
2835
|
-
initializeByDefault: true
|
2836
|
-
});
|
2837
|
-
}
|
2838
|
-
|
2839
|
-
function clearAutoScrolls() {
|
2840
|
-
autoScrolls.forEach(function (autoScroll) {
|
2841
|
-
clearInterval(autoScroll.pid);
|
2842
|
-
});
|
2843
|
-
autoScrolls = [];
|
2844
|
-
}
|
2845
|
-
|
2846
|
-
function clearPointerElemChangedInterval() {
|
2847
|
-
clearInterval(pointerElemChangedInterval);
|
2848
|
-
}
|
2849
|
-
|
2850
|
-
var autoScroll = throttle(function (evt, options, rootEl, isFallback) {
|
2851
|
-
// Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521
|
2852
|
-
if (!options.scroll) return;
|
2853
|
-
var x = (evt.touches ? evt.touches[0] : evt).clientX,
|
2854
|
-
y = (evt.touches ? evt.touches[0] : evt).clientY,
|
2855
|
-
sens = options.scrollSensitivity,
|
2856
|
-
speed = options.scrollSpeed,
|
2857
|
-
winScroller = getWindowScrollingElement();
|
2858
|
-
var scrollThisInstance = false,
|
2859
|
-
scrollCustomFn; // New scroll root, set scrollEl
|
2860
|
-
|
2861
|
-
if (scrollRootEl !== rootEl) {
|
2862
|
-
scrollRootEl = rootEl;
|
2863
|
-
clearAutoScrolls();
|
2864
|
-
scrollEl = options.scroll;
|
2865
|
-
scrollCustomFn = options.scrollFn;
|
2866
|
-
|
2867
|
-
if (scrollEl === true) {
|
2868
|
-
scrollEl = getParentAutoScrollElement(rootEl, true);
|
2869
|
-
}
|
2870
|
-
}
|
2871
|
-
|
2872
|
-
var layersOut = 0;
|
2873
|
-
var currentParent = scrollEl;
|
2874
|
-
|
2875
|
-
do {
|
2876
|
-
var el = currentParent,
|
2877
|
-
rect = getRect(el),
|
2878
|
-
top = rect.top,
|
2879
|
-
bottom = rect.bottom,
|
2880
|
-
left = rect.left,
|
2881
|
-
right = rect.right,
|
2882
|
-
width = rect.width,
|
2883
|
-
height = rect.height,
|
2884
|
-
canScrollX = void 0,
|
2885
|
-
canScrollY = void 0,
|
2886
|
-
scrollWidth = el.scrollWidth,
|
2887
|
-
scrollHeight = el.scrollHeight,
|
2888
|
-
elCSS = css(el),
|
2889
|
-
scrollPosX = el.scrollLeft,
|
2890
|
-
scrollPosY = el.scrollTop;
|
2891
|
-
|
2892
|
-
if (el === winScroller) {
|
2893
|
-
canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');
|
2894
|
-
canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');
|
2895
|
-
} else {
|
2896
|
-
canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');
|
2897
|
-
canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');
|
2898
|
-
}
|
2899
|
-
|
2900
|
-
var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);
|
2901
|
-
var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);
|
2902
|
-
|
2903
|
-
if (!autoScrolls[layersOut]) {
|
2904
|
-
for (var i = 0; i <= layersOut; i++) {
|
2905
|
-
if (!autoScrolls[i]) {
|
2906
|
-
autoScrolls[i] = {};
|
2907
|
-
}
|
2908
|
-
}
|
2909
|
-
}
|
2910
|
-
|
2911
|
-
if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {
|
2912
|
-
autoScrolls[layersOut].el = el;
|
2913
|
-
autoScrolls[layersOut].vx = vx;
|
2914
|
-
autoScrolls[layersOut].vy = vy;
|
2915
|
-
clearInterval(autoScrolls[layersOut].pid);
|
2916
|
-
|
2917
|
-
if (vx != 0 || vy != 0) {
|
2918
|
-
scrollThisInstance = true;
|
2919
|
-
/* jshint loopfunc:true */
|
2920
|
-
|
2921
|
-
autoScrolls[layersOut].pid = setInterval(function () {
|
2922
|
-
// emulate drag over during autoscroll (fallback), emulating native DnD behaviour
|
2923
|
-
if (isFallback && this.layer === 0) {
|
2924
|
-
Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely
|
2925
|
-
|
2926
|
-
}
|
2927
|
-
|
2928
|
-
var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;
|
2929
|
-
var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;
|
2930
|
-
|
2931
|
-
if (typeof scrollCustomFn === 'function') {
|
2932
|
-
if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {
|
2933
|
-
return;
|
2934
|
-
}
|
2935
|
-
}
|
2936
|
-
|
2937
|
-
scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);
|
2938
|
-
}.bind({
|
2939
|
-
layer: layersOut
|
2940
|
-
}), 24);
|
2941
|
-
}
|
2942
|
-
}
|
2943
|
-
|
2944
|
-
layersOut++;
|
2945
|
-
} while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));
|
2946
|
-
|
2947
|
-
scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not
|
2948
|
-
}, 30);
|
2949
|
-
|
2950
|
-
var drop = function drop(_ref) {
|
2951
|
-
var originalEvent = _ref.originalEvent,
|
2952
|
-
putSortable = _ref.putSortable,
|
2953
|
-
dragEl = _ref.dragEl,
|
2954
|
-
activeSortable = _ref.activeSortable,
|
2955
|
-
dispatchSortableEvent = _ref.dispatchSortableEvent,
|
2956
|
-
hideGhostForTarget = _ref.hideGhostForTarget,
|
2957
|
-
unhideGhostForTarget = _ref.unhideGhostForTarget;
|
2958
|
-
if (!originalEvent) return;
|
2959
|
-
var toSortable = putSortable || activeSortable;
|
2960
|
-
hideGhostForTarget();
|
2961
|
-
var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;
|
2962
|
-
var target = document.elementFromPoint(touch.clientX, touch.clientY);
|
2963
|
-
unhideGhostForTarget();
|
2964
|
-
|
2965
|
-
if (toSortable && !toSortable.el.contains(target)) {
|
2966
|
-
dispatchSortableEvent('spill');
|
2967
|
-
this.onSpill({
|
2968
|
-
dragEl: dragEl,
|
2969
|
-
putSortable: putSortable
|
2970
|
-
});
|
2971
|
-
}
|
2972
|
-
};
|
2973
|
-
|
2974
|
-
function Revert() {}
|
2975
|
-
|
2976
|
-
Revert.prototype = {
|
2977
|
-
startIndex: null,
|
2978
|
-
dragStart: function dragStart(_ref2) {
|
2979
|
-
var oldDraggableIndex = _ref2.oldDraggableIndex;
|
2980
|
-
this.startIndex = oldDraggableIndex;
|
2981
|
-
},
|
2982
|
-
onSpill: function onSpill(_ref3) {
|
2983
|
-
var dragEl = _ref3.dragEl,
|
2984
|
-
putSortable = _ref3.putSortable;
|
2985
|
-
this.sortable.captureAnimationState();
|
2986
|
-
|
2987
|
-
if (putSortable) {
|
2988
|
-
putSortable.captureAnimationState();
|
2989
|
-
}
|
2990
|
-
|
2991
|
-
var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);
|
2992
|
-
|
2993
|
-
if (nextSibling) {
|
2994
|
-
this.sortable.el.insertBefore(dragEl, nextSibling);
|
2995
|
-
} else {
|
2996
|
-
this.sortable.el.appendChild(dragEl);
|
2997
|
-
}
|
2998
|
-
|
2999
|
-
this.sortable.animateAll();
|
3000
|
-
|
3001
|
-
if (putSortable) {
|
3002
|
-
putSortable.animateAll();
|
3003
|
-
}
|
3004
|
-
},
|
3005
|
-
drop: drop
|
3006
|
-
};
|
3007
|
-
|
3008
|
-
_extends(Revert, {
|
3009
|
-
pluginName: 'revertOnSpill'
|
3010
|
-
});
|
3011
|
-
|
3012
|
-
function Remove() {}
|
3013
|
-
|
3014
|
-
Remove.prototype = {
|
3015
|
-
onSpill: function onSpill(_ref4) {
|
3016
|
-
var dragEl = _ref4.dragEl,
|
3017
|
-
putSortable = _ref4.putSortable;
|
3018
|
-
var parentSortable = putSortable || this.sortable;
|
3019
|
-
parentSortable.captureAnimationState();
|
3020
|
-
dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);
|
3021
|
-
parentSortable.animateAll();
|
3022
|
-
},
|
3023
|
-
drop: drop
|
3024
|
-
};
|
3025
|
-
|
3026
|
-
_extends(Remove, {
|
3027
|
-
pluginName: 'removeOnSpill'
|
3028
|
-
});
|
3029
|
-
|
3030
|
-
Sortable.mount(new AutoScrollPlugin());
|
3031
|
-
Sortable.mount(Remove, Revert);
|
3032
|
-
|
3033
14
|
const guxTabAdvancedListCss = ".gux-focus-ring-focused:focus{outline-width:var(--gse-semantic-focusRing-default-border-width);outline-style:var(--gse-semantic-focusRing-default-border-style);outline-color:var(--gse-semantic-focusRing-default-border-color);outline-offset:var(--gse-semantic-focusRing-offset)}.gux-focus-ring-focused-within:focus-within{outline-width:var(--gse-semantic-focusRing-default-border-width);outline-style:var(--gse-semantic-focusRing-default-border-style);outline-color:var(--gse-semantic-focusRing-default-border-color);outline-offset:var(--gse-semantic-focusRing-offset)}.gux-focus-ring-focused-visible:focus-visible{outline-width:var(--gse-semantic-focusRing-default-border-width);outline-style:var(--gse-semantic-focusRing-default-border-style);outline-color:var(--gse-semantic-focusRing-default-border-color);outline-offset:var(--gse-semantic-focusRing-offset)}.gux-focus-ring-small-focused:focus{outline-width:var(--gse-semantic-focusRing-small-border-width);outline-style:var(--gse-semantic-focusRing-small-border-style);outline-color:var(--gse-semantic-focusRing-small-border-color)}.gux-focus-ring-small-focused-within:focus-within{outline-width:var(--gse-semantic-focusRing-small-border-width);outline-style:var(--gse-semantic-focusRing-small-border-style);outline-color:var(--gse-semantic-focusRing-small-border-color)}.gux-focus-ring-small-focused-visible:focus-visible{outline-width:var(--gse-semantic-focusRing-small-border-width);outline-style:var(--gse-semantic-focusRing-small-border-style);outline-color:var(--gse-semantic-focusRing-small-border-color)}.gux-focus-ring-focused:focus{outline-width:var(--gse-semantic-focusRing-default-border-width);outline-style:var(--gse-semantic-focusRing-default-border-style);outline-color:var(--gse-semantic-focusRing-default-border-color);outline-offset:var(--gse-semantic-focusRing-offset)}.gux-focus-ring-focused-within:focus-within{outline-width:var(--gse-semantic-focusRing-default-border-width);outline-style:var(--gse-semantic-focusRing-default-border-style);outline-color:var(--gse-semantic-focusRing-default-border-color);outline-offset:var(--gse-semantic-focusRing-offset)}.gux-focus-ring-focused-visible:focus-visible{outline-width:var(--gse-semantic-focusRing-default-border-width);outline-style:var(--gse-semantic-focusRing-default-border-style);outline-color:var(--gse-semantic-focusRing-default-border-color);outline-offset:var(--gse-semantic-focusRing-offset)}.gux-focus-ring-small-focused:focus{outline-width:var(--gse-semantic-focusRing-small-border-width);outline-style:var(--gse-semantic-focusRing-small-border-style);outline-color:var(--gse-semantic-focusRing-small-border-color)}.gux-focus-ring-small-focused-within:focus-within{outline-width:var(--gse-semantic-focusRing-small-border-width);outline-style:var(--gse-semantic-focusRing-small-border-style);outline-color:var(--gse-semantic-focusRing-small-border-color)}.gux-focus-ring-small-focused-visible:focus-visible{outline-width:var(--gse-semantic-focusRing-small-border-width);outline-style:var(--gse-semantic-focusRing-small-border-style);outline-color:var(--gse-semantic-focusRing-small-border-color)}.gux-icon-anchor gux-icon{padding-right:var(--gse-ui-links-inLine-padding)}gux-tab-advanced-list .gux-tab-container{display:flex;align-items:flex-end;width:100%;height:50px;margin-bottom:16px;overflow-x:auto;overflow-y:hidden;background-color:#f6f7f9;border-bottom:1px solid #d7dce5;border-radius:4px 4px 0 0}gux-tab-advanced-list .gux-tab-container .action-button-container{display:flex;border-radius:4px}gux-tab-advanced-list .gux-tab-container .action-button-container .add-tab-button{min-width:35px;height:50px;padding:0;margin-left:2px;color:#2e394c;background-color:#e2e6ee;border:none;border-radius:4px;transition:color 0.25s}gux-tab-advanced-list .gux-tab-container .action-button-container .add-tab-button [slot=add-tab]{display:inline-flex;align-items:center;padding:0 12px;white-space:nowrap;font-family:var(--gse-core-fontFamily-body), sans-serif;font-weight:var(--gse-core-fontWeight-bold)}gux-tab-advanced-list .gux-tab-container .action-button-container .add-tab-button [slot=add-tab] gux-icon{padding-right:8px}gux-tab-advanced-list .gux-tab-container .action-button-container .add-tab-button:disabled{opacity:0.5}gux-tab-advanced-list .gux-tab-container .action-button-container .add-tab-button:hover{background-color:#d7dce5}gux-tab-advanced-list .gux-tab-container .action-button-container .add-tab-button:active{background-color:#c8cfda}gux-tab-advanced-list .gux-tab-container .action-button-container .add-tab-button:focus-visible{outline:none;box-shadow:inset 0 0 0 3px #aac9ff}gux-tab-advanced-list .gux-tab-container .action-button-container .add-tab-button:focus-visible{border-radius:5px;outline:none;box-shadow:inset 0 0 0 3px #aac9ff}gux-tab-advanced-list .gux-tab-container .action-button-container .add-tab-button gux-icon{width:16px;height:16px}gux-tab-advanced-list .gux-tab-container .action-button-container .gux-scroll-button-container{display:flex;border-radius:4px}gux-tab-advanced-list .gux-tab-container .action-button-container .gux-scroll-button-container .gux-scroll-button{display:flex;align-items:center;justify-content:center;width:28px;height:50px;padding:0;color:#2e394c;background-color:#e2e6ee;border:none;border-radius:4px;transition:color 0.25s}gux-tab-advanced-list .gux-tab-container .action-button-container .gux-scroll-button-container .gux-scroll-button:focus-visible{border:3px solid #aac9ff;border-radius:5px;outline:none}gux-tab-advanced-list .gux-tab-container .action-button-container .gux-scroll-button-container .gux-scroll-button gux-icon{width:16px;height:16px}gux-tab-advanced-list .gux-tab-container .action-button-container .gux-scroll-button-container .gux-scroll-button:focus-visible{border:3px solid #aac9ff;outline:none}gux-tab-advanced-list .gux-tab-container .action-button-container .gux-scroll-button-container .gux-scroll-button:hover{background-color:#d7dce5}gux-tab-advanced-list .gux-tab-container .action-button-container .gux-scroll-button-container .gux-scroll-button:active{background-color:#c8cfda}gux-tab-advanced-list .gux-tab-container .action-button-container .gux-scroll-button-container .gux-scroll-button:focus-visible{outline-width:var(--gse-semantic-focusRing-default-border-width);outline-style:var(--gse-semantic-focusRing-default-border-style);outline-color:var(--gse-semantic-focusRing-default-border-color);outline-offset:var(--gse-semantic-focusRing-offset)}gux-tab-advanced-list .gux-tab-container .gux-scrollable-section{display:flex;align-items:flex-end;height:50px;overflow-x:auto;scroll-behavior:smooth;scrollbar-width:none}gux-tab-advanced-list .gux-tab-container .gux-scrollable-section::-webkit-scrollbar{height:0}gux-tab-advanced-list .gux-sr-only{position:absolute;top:auto;left:-10000px;width:1px;height:1px;overflow:hidden}";
|
3034
15
|
|
3035
16
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
@@ -3044,9 +25,9 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
|
|
3044
25
|
};
|
3045
26
|
const GuxTabAdvancedList = class {
|
3046
27
|
constructor(hostRef) {
|
3047
|
-
index
|
3048
|
-
this.newTab = index
|
3049
|
-
this.sortChanged = index
|
28
|
+
index.registerInstance(this, hostRef);
|
29
|
+
this.newTab = index.createEvent(this, "newTab", 7);
|
30
|
+
this.sortChanged = index.createEvent(this, "sortChanged", 7);
|
3050
31
|
this.showNewTabButton = true;
|
3051
32
|
this.tabLimit = Infinity;
|
3052
33
|
this.allowSort = true;
|
@@ -3307,7 +288,7 @@ const GuxTabAdvancedList = class {
|
|
3307
288
|
}
|
3308
289
|
}
|
3309
290
|
createSortable() {
|
3310
|
-
this.sortableInstance = new Sortable(this.root.querySelector('.gux-scrollable-section'), {
|
291
|
+
this.sortableInstance = new sortable_esm.Sortable(this.root.querySelector('.gux-scrollable-section'), {
|
3311
292
|
animation: 250,
|
3312
293
|
draggable: 'gux-tab-advanced',
|
3313
294
|
filter: '.ignore-sort',
|
@@ -3330,7 +311,7 @@ const GuxTabAdvancedList = class {
|
|
3330
311
|
this.sortChanged.emit(tabIds);
|
3331
312
|
}
|
3332
313
|
checkForScrollbarHideOrShow() {
|
3333
|
-
index
|
314
|
+
index.readTask(() => {
|
3334
315
|
const el = this.root.querySelector('.gux-scrollable-section');
|
3335
316
|
const hasScrollbar = el.clientWidth < el.scrollWidth;
|
3336
317
|
if (hasScrollbar !== this.hasScrollbar) {
|
@@ -3381,7 +362,7 @@ const GuxTabAdvancedList = class {
|
|
3381
362
|
}
|
3382
363
|
async componentWillLoad() {
|
3383
364
|
this.setTabTriggers();
|
3384
|
-
this.i18n = await index$
|
365
|
+
this.i18n = await index$1.buildI18nForComponent(this.root, en.tabsResources, 'gux-tabs-advanced');
|
3385
366
|
}
|
3386
367
|
validateSortableInstance() {
|
3387
368
|
if (this.allowSort && !this.sortableInstance) {
|
@@ -3411,7 +392,7 @@ const GuxTabAdvancedList = class {
|
|
3411
392
|
}, 500);
|
3412
393
|
}
|
3413
394
|
scrollLeft() {
|
3414
|
-
index
|
395
|
+
index.writeTask(() => {
|
3415
396
|
var _a;
|
3416
397
|
this.root
|
3417
398
|
.querySelector('.gux-scrollable-section')
|
@@ -3419,7 +400,7 @@ const GuxTabAdvancedList = class {
|
|
3419
400
|
});
|
3420
401
|
}
|
3421
402
|
scrollRight() {
|
3422
|
-
index
|
403
|
+
index.writeTask(() => {
|
3423
404
|
var _a;
|
3424
405
|
this.root
|
3425
406
|
.querySelector('.gux-scrollable-section')
|
@@ -3428,13 +409,13 @@ const GuxTabAdvancedList = class {
|
|
3428
409
|
}
|
3429
410
|
scrollToStart() {
|
3430
411
|
const scrollableSection = this.root.querySelector('.gux-scrollable-section');
|
3431
|
-
index
|
412
|
+
index.writeTask(() => {
|
3432
413
|
scrollableSection === null || scrollableSection === void 0 ? void 0 : scrollableSection.scrollBy(-(scrollableSection === null || scrollableSection === void 0 ? void 0 : scrollableSection.scrollWidth), 0);
|
3433
414
|
});
|
3434
415
|
}
|
3435
416
|
scrollToEnd() {
|
3436
417
|
const scrollableSection = this.root.querySelector('.gux-scrollable-section');
|
3437
|
-
index
|
418
|
+
index.writeTask(() => {
|
3438
419
|
scrollableSection.scrollBy(scrollableSection === null || scrollableSection === void 0 ? void 0 : scrollableSection.scrollWidth, 0);
|
3439
420
|
});
|
3440
421
|
}
|
@@ -3444,19 +425,19 @@ const GuxTabAdvancedList = class {
|
|
3444
425
|
}
|
3445
426
|
render() {
|
3446
427
|
const AddNewTabButton = (props) => {
|
3447
|
-
return (index
|
428
|
+
return (index.h("button", { title: this.disableAddTabButton
|
3448
429
|
? this.i18n('disableNewTab')
|
3449
430
|
: this.root.querySelector('[slot="add-tab"]')
|
3450
431
|
? this.root.querySelector('[slot="add-tab"]').textContent.trim()
|
3451
|
-
: this.i18n('createNewTab'), class: "add-tab-button", onClick: () => props.onClick(), disabled: this.disableAddTabButton }, index
|
432
|
+
: this.i18n('createNewTab'), class: "add-tab-button", onClick: () => props.onClick(), disabled: this.disableAddTabButton }, index.h("slot", { name: "add-tab" }, index.h("gux-icon", { "icon-name": "add", decorative: true }))));
|
3452
433
|
};
|
3453
434
|
return [
|
3454
|
-
index
|
3455
|
-
index
|
435
|
+
index.h("span", { class: "gux-sr-only gux-aria-live-region", "aria-live": "polite" }, this.ariaLiveAlert ? this.i18n(this.ariaLiveAlert) : ''),
|
436
|
+
index.h("div", { class: "gux-tab-container" }, index.h("div", { class: "action-button-container" }, this.renderScrollButton('scrollLeft')), index.h("div", { role: "tablist", class: `gux-scrollable-section ${this.keyboardSort ? 'gux-tab-sorting' : ''}`, "aria-owns": this.triggerIds }, index.h("slot", null)), index.h("div", { class: "action-button-container" }, this.renderScrollButton('scrollRight'), this.showNewTabButton ? (index.h(AddNewTabButton, { onClick: () => this.newTab.emit() })) : null))
|
3456
437
|
];
|
3457
438
|
}
|
3458
439
|
renderScrollButton(direction) {
|
3459
|
-
return (index
|
440
|
+
return (index.h("div", { class: "gux-scroll-button-container" }, this.hasScrollbar ? (index.h("button", { tabindex: "-1", title: this.i18n(direction), "aria-label": this.i18n(direction), class: "gux-scroll-button", onDragOver: () => this.getScrollDirection(direction), onClick: () => this.getScrollDirection(direction) }, index.h("gux-icon", { "icon-name": this.getChevronIconName(direction), decorative: true }))) : null));
|
3460
441
|
}
|
3461
442
|
getScrollDirection(direction) {
|
3462
443
|
switch (direction) {
|
@@ -3476,7 +457,7 @@ const GuxTabAdvancedList = class {
|
|
3476
457
|
return 'chevron-right';
|
3477
458
|
}
|
3478
459
|
}
|
3479
|
-
get root() { return index
|
460
|
+
get root() { return index.getElement(this); }
|
3480
461
|
static get watchers() { return {
|
3481
462
|
"allowSort": ["watchAllowSort"]
|
3482
463
|
}; }
|