@fr0st/ui-sortable 2.0.4 → 2.0.5
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frost-ui-sortable.js","sources":["../src/sortable.js","../src/prototype/events.js","../src/prototype/helpers.js","../src/index.js"],"sourcesContent":["import $ from '@fr0st/query';\nimport { BaseComponent } from '@fr0st/ui';\n\n/**\n * Sortable Class\n * @class\n */\nexport default class Sortable extends BaseComponent {\n /**\n * New Sortable constructor.\n * @param {HTMLElement} node The input node.\n * @param {object} [options] The options to create the Sortable with.\n */\n constructor(node, options) {\n super(node, options);\n\n this._selector = this._options.items;\n if (this._options.handle) {\n this._selector += ' ' + this._options.handle;\n }\n\n this._enabled = !this._options.disabled;\n\n this._refreshCursors();\n this._events();\n }\n\n /**\n * Disable the Sortable.\n */\n disable() {\n this._enabled = false;\n }\n\n /**\n * Dispose the Sortable.\n */\n dispose() {\n $.removeEventDelegate(this._node, 'mousedown.ui.sortable touchstart.ui.sortable');\n $.removeEvent(this._node, 'receive.ui.sortable');\n\n this._target = null;\n this._currentSortable = null;\n\n super.dispose();\n }\n\n /**\n * Enable the Sortable.\n */\n enable() {\n this._enabled = true;\n }\n\n /**\n * Get the Sortable item elements.\n * @return {array} The Sortable item elements.\n */\n items() {\n return $.find(this._options.items, this._node);\n }\n}\n","import $ from '@fr0st/query';\nimport { getPosition } from '@fr0st/ui';\n\n/**\n * Attach events for the Sortable.\n */\nexport function _events() {\n const downEvent = (e) => {\n if (\n e.button ||\n !this._enabled ||\n $.is(e.currentTarget, this._options.cancel) ||\n $.getDataset(this._node, 'uiDragging')\n ) {\n return false;\n }\n\n this._target = this._options.handle ?\n this.items().find((node) => $.hasDescendent(node, e.currentTarget)) :\n e.currentTarget;\n };\n\n const moveEvent = (e) => {\n this._pos = getPosition(e);\n\n if (!$.getDataset(this._node, 'uiDragging')) {\n $.setDataset(this._node, { uiDragging: true });\n\n this._startIndex = $.index(this._target);\n this._currentIndex = this._startIndex;\n\n $.triggerEvent(this._node, 'sort.ui.sortable', {\n detail: {\n target: this._target,\n },\n });\n\n if (this._options.helperClass) {\n $.addClass(this._target, this._options.helperClass);\n }\n\n this._currentSortable = this._node;\n\n if (this._options.scroll) {\n this._checkScroll();\n }\n }\n\n let nearestSortable = this._node;\n\n if (this._options.connectWith) {\n const connected = $.find(this._options.connectWith)\n .filter((node) => {\n const sortable = this.constructor.init(node);\n\n return sortable._options.dropOnEmpty || sortable.items().length;\n });\n\n if (connected.length) {\n nearestSortable = $.nearestTo([this._node, ...connected], this._pos.x, this._pos.y, { offset: true });\n }\n }\n\n const nearestItems = $.isSame(this._node, nearestSortable) ?\n this.items() :\n this.constructor.init(nearestSortable).items();\n\n const nearestItem = $.nearestTo(nearestItems, this._pos.x, this._pos.y, { offset: true });\n\n if (!nearestItem) {\n return;\n }\n\n this._updateTarget(nearestItem, this._pos.x, this._pos.y);\n\n const newIndex = $.index(this._target);\n\n if (!$.isSame(nearestSortable, this._currentSortable)) {\n $.triggerEvent(this._currentSortable, 'send.ui.sortable', {\n detail: {\n target: this._target,\n },\n });\n\n $.triggerEvent(nearestSortable, 'receive.ui.sortable', {\n detail: {\n target: this._target,\n },\n });\n } else if (this._currentIndex !== newIndex) {\n $.triggerEvent(nearestSortable, 'sorting.ui.sortable', {\n detail: {\n target: this._target,\n },\n });\n }\n\n this._currentIndex = newIndex;\n this._currentSortable = nearestSortable;\n };\n\n const upEvent = (e) => {\n if (!$.getDataset(this._node, 'uiDragging')) {\n this._target = null;\n return;\n }\n\n if (e.type === 'mouseup') {\n e.preventDefault();\n }\n\n $.triggerEvent(this._currentSortable, 'sorted.ui.sortable', {\n detail: {\n target: this._target,\n },\n });\n\n if (this._options.helperClass) {\n $.removeClass(this._target, this._options.helperClass);\n }\n\n if (this._currentIndex !== this._startIndex || !$.isSame(this._currentSortable, this._node)) {\n $.triggerEvent(this._currentSortable, 'update.ui.sortable', {\n detail: {\n target: this._target,\n },\n });\n }\n\n $.removeDataset(this._node, 'uiDragging');\n\n if (this._checkScrollTimer) {\n clearTimeout(this._checkScrollTimer);\n this._checkScrollTimer = null;\n }\n\n this._target = null;\n this._currentSortable = null;\n this._currentIndex = null;\n this._startIndex = null;\n };\n\n const dragEvent = $.mouseDragFactory(downEvent, moveEvent, upEvent);\n\n $.addEventDelegate(this._node, 'mousedown.ui.sortable touchstart.ui.sortable', this._selector, dragEvent);\n\n $.addEvent(this._node, 'receive.ui.sortable', (_) => {\n this._refreshCursors();\n });\n};\n","import $ from '@fr0st/query';\n\n/**\n * Check for window scroll.\n */\nexport function _checkScroll() {\n $.hide(this._target);\n\n const originalX = $.getScrollX(window);\n const originalY = $.getScrollY(window);\n\n let offsetX = originalX;\n let offsetY = originalY;\n\n if (this._pos.y < originalY + this._options.scrollSensitivity) {\n offsetY = Math.max(0, originalY - this._options.scrollSpeed);\n } else if (this._pos.y > originalY + $.height(window) - this._options.scrollSensitivity) {\n const docHeight = $.height(document, { boxSize: $.SCROLL_BOX });\n offsetY = Math.min(docHeight, originalY + this._options.scrollSpeed);\n }\n\n if (this._pos.x < originalX + this._options.scrollSensitivity) {\n offsetX = Math.max(0, originalX - this._options.scrollSpeed);\n } else if (this._pos.x > originalX + $.width(window) - this._options.scrollSensitivity) {\n const docWidth = $.width(document, { boxSize: $.SCROLL_BOX });\n offsetX = Math.min(docWidth, originalX + this._options.scrollSpeed);\n }\n\n if (offsetX !== originalX || offsetY !== originalY) {\n $.setStyle(':root', { scrollBehavior: 'initial' });\n $.setScroll(document, offsetX, offsetY);\n $.setStyle(':root', { scrollBehavior: '' });\n\n this._pos.x += offsetX - originalX;\n this._pos.y += offsetY - originalY;\n }\n\n $.show(this._target);\n\n this._checkScrollTimer = setTimeout((_) => {\n this._checkScroll();\n }, 0);\n};\n\n/**\n * Refresh Sortable item cursors.\n */\nexport function _refreshCursors() {\n const elements = $.find(this._selector, this._node);\n\n $.setStyle(elements, { cursor: this._options.cursor });\n};\n\n/**\n * Update the target element.\n * @param {HTMLElement} nearestItem The current nearest item.\n * @param {number} x The mouse X position.\n * @param {number} y The mouse Y position.\n */\nexport function _updateTarget(nearestItem, x, y) {\n const nearestCenter = $.center(nearestItem, { offset: true });\n const targetCenter = $.center(this._target, { offset: true });\n\n let method;\n if (this._options.axis === 'y' || nearestCenter.x === targetCenter.x) {\n method = y < nearestCenter.y ?\n 'before' :\n 'after';\n } else if (this._options.axis === 'x' || nearestCenter.y === targetCenter.y) {\n method = x < nearestCenter.x ?\n 'before' :\n 'after';\n } else {\n method = x < nearestCenter.x && y < nearestCenter.y ?\n 'before' :\n 'after';\n }\n\n $[method](nearestItem, this._target);\n};\n","import { initComponent } from '@fr0st/ui';\nimport Sortable from './sortable.js';\nimport { _events } from './prototype/events.js';\nimport { _checkScroll, _refreshCursors, _updateTarget } from './prototype/helpers.js';\n\n// Sortable default options\nSortable.defaults = {\n appendTo: 'body',\n axis: null,\n cancel: 'input, textarea, button, select, option',\n connectWith: null,\n cursor: 'auto',\n disabled: false,\n dropOnEmpty: true,\n handle: null,\n helperClass: 'bg-body-tertiary',\n items: ':scope > li',\n scroll: true,\n scrollSensitivity: 20,\n scrollSpeed: 5,\n};\n\n// Sortable prototype\nconst proto = Sortable.prototype;\n\nproto._checkScroll = _checkScroll;\nproto._events = _events;\nproto._refreshCursors = _refreshCursors;\nproto._updateTarget = _updateTarget;\n\n// Sortable init\ninitComponent('sortable', Sortable);\n\nexport default Sortable;\n"],"names":["BaseComponent","getPosition","initComponent"],"mappings":";;;;;;IAGA;IACA;IACA;IACA;IACe,MAAM,QAAQ,SAASA,gBAAa,CAAC;IACpD;IACA;IACA;IACA;IACA;IACA,IAAI,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE;IAC/B,QAAQ,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC7B;IACA,QAAQ,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC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AAE,IAAI;IAChB,IAAI,iBAAiB,EAAE,EAAE;IACzB,IAAI,WAAW,EAAE,CAAC;IAClB,CAAC,CAAC;AACF;IACA;IACA,MAAM,KAAK,GAAG,QAAQ,CAAC,SAAS,CAAC;AACjC;IACA,KAAK,CAAC,YAAY,GAAG,YAAY,CAAC;IAClC,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC;IACxB,KAAK,CAAC,eAAe,GAAG,eAAe,CAAC;IACxC,KAAK,CAAC,aAAa,GAAG,aAAa,CAAC;AACpC;IACA;AACAC,oBAAa,CAAC,UAAU,EAAE,QAAQ,CAAC;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"frost-ui-sortable.js","sources":["../src/sortable.js","../src/prototype/events.js","../src/prototype/helpers.js","../src/index.js"],"sourcesContent":["import $ from '@fr0st/query';\nimport { BaseComponent } from '@fr0st/ui';\n\n/**\n * Sortable Class\n * @class\n */\nexport default class Sortable extends BaseComponent {\n /**\n * New Sortable constructor.\n * @param {HTMLElement} node The input node.\n * @param {object} [options] The options to create the Sortable with.\n */\n constructor(node, options) {\n super(node, options);\n\n this._selector = this._options.items;\n if (this._options.handle) {\n this._selector += ' ' + this._options.handle;\n }\n\n this._enabled = !this._options.disabled;\n\n this._refreshCursors();\n this._events();\n }\n\n /**\n * Disable the Sortable.\n */\n disable() {\n this._enabled = false;\n }\n\n /**\n * Dispose the Sortable.\n */\n dispose() {\n $.removeEventDelegate(this._node, 'mousedown.ui.sortable touchstart.ui.sortable');\n $.removeEvent(this._node, 'receive.ui.sortable');\n\n this._target = null;\n this._currentSortable = null;\n\n super.dispose();\n }\n\n /**\n * Enable the Sortable.\n */\n enable() {\n this._enabled = true;\n }\n\n /**\n * Get the Sortable item elements.\n * @return {array} The Sortable item elements.\n */\n items() {\n return $.find(this._options.items, this._node);\n }\n}\n","import $ from '@fr0st/query';\nimport { getPosition } from '@fr0st/ui';\n\n/**\n * Attach events for the Sortable.\n */\nexport function _events() {\n const downEvent = (e) => {\n if (\n e.button ||\n !this._enabled ||\n $.is(e.currentTarget, this._options.cancel) ||\n $.getDataset(this._node, 'uiDragging')\n ) {\n return false;\n }\n\n this._target = this._options.handle ?\n this.items().find((node) => $.hasDescendent(node, e.currentTarget)) :\n e.currentTarget;\n };\n\n const moveEvent = (e) => {\n this._pos = getPosition(e);\n\n if (!$.getDataset(this._node, 'uiDragging')) {\n $.setDataset(this._node, { uiDragging: true });\n\n this._startIndex = $.index(this._target);\n this._currentIndex = this._startIndex;\n\n $.triggerEvent(this._node, 'sort.ui.sortable', {\n detail: {\n target: this._target,\n },\n });\n\n if (this._options.helperClass) {\n $.addClass(this._target, this._options.helperClass);\n }\n\n this._currentSortable = this._node;\n\n if (this._options.scroll) {\n this._checkScroll();\n }\n }\n\n let nearestSortable = this._node;\n\n if (this._options.connectWith) {\n const connected = $.find(this._options.connectWith)\n .filter((node) => {\n const sortable = this.constructor.init(node);\n\n return sortable._options.dropOnEmpty || sortable.items().length;\n });\n\n if (connected.length) {\n nearestSortable = $.nearestTo([this._node, ...connected], this._pos.x, this._pos.y, { offset: true });\n }\n }\n\n const nearestItems = $.isSame(this._node, nearestSortable) ?\n this.items() :\n this.constructor.init(nearestSortable).items();\n\n const nearestItem = $.nearestTo(nearestItems, this._pos.x, this._pos.y, { offset: true });\n\n if (!nearestItem) {\n return;\n }\n\n this._updateTarget(nearestItem, this._pos.x, this._pos.y);\n\n const newIndex = $.index(this._target);\n\n if (!$.isSame(nearestSortable, this._currentSortable)) {\n $.triggerEvent(this._currentSortable, 'send.ui.sortable', {\n detail: {\n target: this._target,\n },\n });\n\n $.triggerEvent(nearestSortable, 'receive.ui.sortable', {\n detail: {\n target: this._target,\n },\n });\n } else if (this._currentIndex !== newIndex) {\n $.triggerEvent(nearestSortable, 'sorting.ui.sortable', {\n detail: {\n target: this._target,\n },\n });\n }\n\n this._currentIndex = newIndex;\n this._currentSortable = nearestSortable;\n };\n\n const upEvent = (e) => {\n if (!$.getDataset(this._node, 'uiDragging')) {\n this._target = null;\n return;\n }\n\n if (e.type === 'mouseup') {\n e.preventDefault();\n }\n\n $.triggerEvent(this._currentSortable, 'sorted.ui.sortable', {\n detail: {\n target: this._target,\n },\n });\n\n if (this._options.helperClass) {\n $.removeClass(this._target, this._options.helperClass);\n }\n\n if (this._currentIndex !== this._startIndex || !$.isSame(this._currentSortable, this._node)) {\n $.triggerEvent(this._currentSortable, 'update.ui.sortable', {\n detail: {\n target: this._target,\n },\n });\n }\n\n $.removeDataset(this._node, 'uiDragging');\n\n if (this._checkScrollTimer) {\n clearTimeout(this._checkScrollTimer);\n this._checkScrollTimer = null;\n }\n\n this._target = null;\n this._currentSortable = null;\n this._currentIndex = null;\n this._startIndex = null;\n };\n\n const dragEvent = $.mouseDragFactory(downEvent, moveEvent, upEvent);\n\n $.addEventDelegate(this._node, 'mousedown.ui.sortable touchstart.ui.sortable', this._selector, dragEvent);\n\n $.addEvent(this._node, 'receive.ui.sortable', (_) => {\n this._refreshCursors();\n });\n};\n","import $ from '@fr0st/query';\n\n/**\n * Check for window scroll.\n */\nexport function _checkScroll() {\n $.hide(this._target);\n\n const originalX = $.getScrollX(window);\n const originalY = $.getScrollY(window);\n\n let offsetX = originalX;\n let offsetY = originalY;\n\n if (this._pos.y < originalY + this._options.scrollSensitivity) {\n offsetY = Math.max(0, originalY - this._options.scrollSpeed);\n } else if (this._pos.y > originalY + $.height(window) - this._options.scrollSensitivity) {\n const docHeight = $.height(document, { boxSize: $.SCROLL_BOX });\n offsetY = Math.min(docHeight, originalY + this._options.scrollSpeed);\n }\n\n if (this._pos.x < originalX + this._options.scrollSensitivity) {\n offsetX = Math.max(0, originalX - this._options.scrollSpeed);\n } else if (this._pos.x > originalX + $.width(window) - this._options.scrollSensitivity) {\n const docWidth = $.width(document, { boxSize: $.SCROLL_BOX });\n offsetX = Math.min(docWidth, originalX + this._options.scrollSpeed);\n }\n\n if (offsetX !== originalX || offsetY !== originalY) {\n $.setStyle(':root', { scrollBehavior: 'initial' });\n $.setScroll(document, offsetX, offsetY);\n $.setStyle(':root', { scrollBehavior: '' });\n\n this._pos.x += offsetX - originalX;\n this._pos.y += offsetY - originalY;\n }\n\n $.show(this._target);\n\n this._checkScrollTimer = setTimeout((_) => {\n this._checkScroll();\n }, 0);\n};\n\n/**\n * Refresh Sortable item cursors.\n */\nexport function _refreshCursors() {\n const elements = $.find(this._selector, this._node);\n\n $.setStyle(elements, { cursor: this._options.cursor });\n};\n\n/**\n * Update the target element.\n * @param {HTMLElement} nearestItem The current nearest item.\n * @param {number} x The mouse X position.\n * @param {number} y The mouse Y position.\n */\nexport function _updateTarget(nearestItem, x, y) {\n const nearestCenter = $.center(nearestItem, { offset: true });\n const targetCenter = $.center(this._target, { offset: true });\n\n let method;\n if (this._options.axis === 'y' || nearestCenter.x === targetCenter.x) {\n method = y < nearestCenter.y ?\n 'before' :\n 'after';\n } else if (this._options.axis === 'x' || nearestCenter.y === targetCenter.y) {\n method = x < nearestCenter.x ?\n 'before' :\n 'after';\n } else {\n method = x < nearestCenter.x && y < nearestCenter.y ?\n 'before' :\n 'after';\n }\n\n $[method](nearestItem, this._target);\n};\n","import { initComponent } from '@fr0st/ui';\nimport Sortable from './sortable.js';\nimport { _events } from './prototype/events.js';\nimport { _checkScroll, _refreshCursors, _updateTarget } from './prototype/helpers.js';\n\n// Sortable default options\nSortable.defaults = {\n appendTo: 'body',\n axis: null,\n cancel: 'input, textarea, button, select, option',\n connectWith: null,\n cursor: 'auto',\n disabled: false,\n dropOnEmpty: true,\n handle: null,\n helperClass: 'bg-body-tertiary',\n items: ':scope > li',\n scroll: true,\n scrollSensitivity: 20,\n scrollSpeed: 5,\n};\n\n// Sortable prototype\nconst proto = Sortable.prototype;\n\nproto._checkScroll = _checkScroll;\nproto._events = _events;\nproto._refreshCursors = _refreshCursors;\nproto._updateTarget = _updateTarget;\n\n// Sortable init\ninitComponent('sortable', Sortable);\n\nexport default Sortable;\n"],"names":["BaseComponent","getPosition","initComponent"],"mappings":";;;;;;IAGA;IACA;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AC,GAAG,aAAa,CAAC,CAAC;IACpC,YAAY,QAAQ;IACpB,YAAY,OAAO;IACnB,KAAK,MAAM;IACX,QAAQ,MAAM,GAAG,CAAC,GAAG,aAAa,CAAC,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC;IAC3D,YAAY,QAAQ;IACpB,YAAY,OAAO;IACnB;;IAEA,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC;IACxC;;IC1EA;IACA,QAAQ,CAAC,QAAQ,GAAG;IACpB,IAAI,QAAQ,EAAE,MAAM;IACpB,IAAI,IAAI,EAAE,IAAI;IACd,IAAI,MAAM,EAAE,yCAAyC;IACrD,IAAI,WAAW,EAAE,IAAI;IACrB,IAAI,MAAM,EAAE,MAAM;IAClB,IAAI,QAAQ,EAAE,KAAK;IACnB,IAAI,WAAW,EAAE,IAAI;IACrB,IAAI,MAAM,EAAE,IAAI;IAChB,IAAI,WAAW,EAAE,kBAAkB;IACnC,IAAI,KAAK,EAAE,aAAa;IACxB,IAAI,MAAM,EAAE,IAAI;IAChB,IAAI,iBAAiB,EAAE,EAAE;IACzB,IAAI,WAAW,EAAE,CAAC;IAClB,CAAC;;IAED;IACA,MAAM,KAAK,GAAG,QAAQ,CAAC,SAAS;;IAEhC,KAAK,CAAC,YAAY,GAAG,YAAY;IACjC,KAAK,CAAC,OAAO,GAAG,OAAO;IACvB,KAAK,CAAC,eAAe,GAAG,eAAe;IACvC,KAAK,CAAC,aAAa,GAAG,aAAa;;IAEnC;AACAC,oBAAa,CAAC,UAAU,EAAE,QAAQ,CAAC;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fr0st/ui-sortable",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"description": "FrostUI-Sortable is a free, open-source Sortable component for Javascript.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ui",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"author": "Elusive",
|
|
36
36
|
"license": "MIT",
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@fr0st/eslint-config": "^1.0.
|
|
39
|
-
"@rollup/plugin-node-resolve": "^
|
|
40
|
-
"eslint": "^9.
|
|
41
|
-
"rollup": "^4.
|
|
42
|
-
"terser": "^5.
|
|
38
|
+
"@fr0st/eslint-config": "^1.0.3",
|
|
39
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
40
|
+
"eslint": "^9.26.0",
|
|
41
|
+
"rollup": "^4.40.2",
|
|
42
|
+
"terser": "^5.39.1"
|
|
43
43
|
}
|
|
44
44
|
}
|