Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bullet-train/bullet-train-sortable

Package Overview
Dependencies
Maintainers
3
Versions
118
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bullet-train/bullet-train-sortable - npm Package Compare versions

Comparing version 1.7.1 to 1.7.2

2

app/assets/javascripts/bullet-train.esm.js

@@ -1,2 +0,2 @@

import{Controller as e}from"@hotwired/stimulus";import{post as t}from"@rails/request.js";import n from"dragula";function r(e){const t=(e.match(/^(?:\.\/)?(.+)(?:[_-]controller\..+?)$/)||[])[1];if(t)return t.replace(/_/g,"-").replace(/\//g,"--")}require("dragula/dist/dragula.min.css");class s extends e{connect(){this.hasReorderPathValue&&this.initPluginInstance()}disconnect(){this.teardownPluginInstance()}initPluginInstance(){const e=this;this.plugin=n([this.element],{moves:function(t,n,r){return $(t).find(".reorder-handle").length?!!$(r).closest(".reorder-handle").length:!$(r).closest(".undraggable").length&&e.element===n},accepts:function(e,t,n,r){return!$(r).hasClass("undraggable")||!$(r).prev().hasClass("undraggable")}}).on("drop",function(t){e.saveOnReorderValue&&e.saveSortOrder()}).on("over",function(e,t){$(document.activeElement).blur()}),this.initReissuePluginEventsAsNativeEvents()}initReissuePluginEventsAsNativeEvents(){var e=this;this.constructor.pluginEventsToReissue.forEach(t=>{this.plugin.on(t,function(){e.dispatch(t,{detail:{plugin:"dragula",type:t,args:[].slice.call(arguments)}})})})}teardownPluginInstance(){void 0!==this.plugin&&this.plugin.destroy()}saveSortOrder(){var e=Array.from(this.element.childNodes).map(e=>{var t;return parseInt(null==(t=e.dataset)?void 0:t.id)});t(this.reorderPathValue,{body:JSON.stringify({ids_in_order:e})})}}s.values={reorderPath:String,saveOnReorder:{type:Boolean,default:!0}},s.pluginEventsToReissue=["drag","dragend","drop","cancel","remove","shadow","over","out","cloned"];const i=[[s,"sortable_controller.js"]].map(function(e){const t=e[0];return{identifier:r(e[1]),controllerConstructor:t}});export{s as SortableController,i as controllerDefinitions};
import{Controller as e}from"@hotwired/stimulus";import{post as r}from"@rails/request.js";import t from"jquery";import n from"dragula";function i(e){const r=(e.match(/^(?:\.\/)?(.+)(?:[_-]controller\..+?)$/)||[])[1];if(r)return r.replace(/_/g,"-").replace(/\//g,"--")}require("dragula/dist/dragula.min.css");class s extends e{initialize(){void 0===window.jQuery&&(window.jQuery=t)}connect(){this.hasReorderPathValue&&this.initPluginInstance()}disconnect(){this.teardownPluginInstance()}initPluginInstance(){const e=this;this.plugin=n([this.element],{moves:function(r,t,n){return jQuery(r).find(".reorder-handle").length?!!jQuery(n).closest(".reorder-handle").length:!jQuery(n).closest(".undraggable").length&&e.element===t},accepts:function(e,r,t,n){return!jQuery(n).hasClass("undraggable")||!jQuery(n).prev().hasClass("undraggable")}}).on("drop",function(r){e.saveOnReorderValue&&e.saveSortOrder()}).on("over",function(e,r){jQuery(document.activeElement).blur()}),this.initReissuePluginEventsAsNativeEvents()}initReissuePluginEventsAsNativeEvents(){var e=this;this.constructor.pluginEventsToReissue.forEach(r=>{this.plugin.on(r,function(){e.dispatch(r,{detail:{plugin:"dragula",type:r,args:[].slice.call(arguments)}})})})}teardownPluginInstance(){void 0!==this.plugin&&this.plugin.destroy()}saveSortOrder(){var e=Array.from(this.element.childNodes).map(e=>{var r;return parseInt(null==(r=e.dataset)?void 0:r.id)});r(this.reorderPathValue,{body:JSON.stringify({ids_in_order:e})})}}s.values={reorderPath:String,saveOnReorder:{type:Boolean,default:!0}},s.pluginEventsToReissue=["drag","dragend","drop","cancel","remove","shadow","over","out","cloned"];const o=[[s,"sortable_controller.js"]].map(function(e){const r=e[0];return{identifier:i(e[1]),controllerConstructor:r}});export{s as SortableController,o as controllerDefinitions};
//# sourceMappingURL=bullet-train.esm.js.map

@@ -1,2 +0,2 @@

var e=require("@hotwired/stimulus"),t=require("@rails/request.js");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(require("dragula"));function s(e){const t=(e.match(/^(?:\.\/)?(.+)(?:[_-]controller\..+?)$/)||[])[1];if(t)return t.replace(/_/g,"-").replace(/\//g,"--")}require("dragula/dist/dragula.min.css");class i extends e.Controller{connect(){this.hasReorderPathValue&&this.initPluginInstance()}disconnect(){this.teardownPluginInstance()}initPluginInstance(){const e=this;this.plugin=r.default([this.element],{moves:function(t,n,r){return $(t).find(".reorder-handle").length?!!$(r).closest(".reorder-handle").length:!$(r).closest(".undraggable").length&&e.element===n},accepts:function(e,t,n,r){return!$(r).hasClass("undraggable")||!$(r).prev().hasClass("undraggable")}}).on("drop",function(t){e.saveOnReorderValue&&e.saveSortOrder()}).on("over",function(e,t){$(document.activeElement).blur()}),this.initReissuePluginEventsAsNativeEvents()}initReissuePluginEventsAsNativeEvents(){var e=this;this.constructor.pluginEventsToReissue.forEach(t=>{this.plugin.on(t,function(){e.dispatch(t,{detail:{plugin:"dragula",type:t,args:[].slice.call(arguments)}})})})}teardownPluginInstance(){void 0!==this.plugin&&this.plugin.destroy()}saveSortOrder(){var e=Array.from(this.element.childNodes).map(e=>{var t;return parseInt(null==(t=e.dataset)?void 0:t.id)});t.post(this.reorderPathValue,{body:JSON.stringify({ids_in_order:e})})}}i.values={reorderPath:String,saveOnReorder:{type:Boolean,default:!0}},i.pluginEventsToReissue=["drag","dragend","drop","cancel","remove","shadow","over","out","cloned"];const o=[[i,"sortable_controller.js"]].map(function(e){const t=e[0];return{identifier:s(e[1]),controllerConstructor:t}});exports.SortableController=i,exports.controllerDefinitions=o;
var e=require("@hotwired/stimulus"),r=require("@rails/request.js"),t=require("jquery"),n=require("dragula");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=i(t),o=i(n);function a(e){const r=(e.match(/^(?:\.\/)?(.+)(?:[_-]controller\..+?)$/)||[])[1];if(r)return r.replace(/_/g,"-").replace(/\//g,"--")}require("dragula/dist/dragula.min.css");class l extends e.Controller{initialize(){void 0===window.jQuery&&(window.jQuery=s.default)}connect(){this.hasReorderPathValue&&this.initPluginInstance()}disconnect(){this.teardownPluginInstance()}initPluginInstance(){const e=this;this.plugin=o.default([this.element],{moves:function(r,t,n){return jQuery(r).find(".reorder-handle").length?!!jQuery(n).closest(".reorder-handle").length:!jQuery(n).closest(".undraggable").length&&e.element===t},accepts:function(e,r,t,n){return!jQuery(n).hasClass("undraggable")||!jQuery(n).prev().hasClass("undraggable")}}).on("drop",function(r){e.saveOnReorderValue&&e.saveSortOrder()}).on("over",function(e,r){jQuery(document.activeElement).blur()}),this.initReissuePluginEventsAsNativeEvents()}initReissuePluginEventsAsNativeEvents(){var e=this;this.constructor.pluginEventsToReissue.forEach(r=>{this.plugin.on(r,function(){e.dispatch(r,{detail:{plugin:"dragula",type:r,args:[].slice.call(arguments)}})})})}teardownPluginInstance(){void 0!==this.plugin&&this.plugin.destroy()}saveSortOrder(){var e=Array.from(this.element.childNodes).map(e=>{var r;return parseInt(null==(r=e.dataset)?void 0:r.id)});r.post(this.reorderPathValue,{body:JSON.stringify({ids_in_order:e})})}}l.values={reorderPath:String,saveOnReorder:{type:Boolean,default:!0}},l.pluginEventsToReissue=["drag","dragend","drop","cancel","remove","shadow","over","out","cloned"];const u=[[l,"sortable_controller.js"]].map(function(e){const r=e[0];return{identifier:a(e[1]),controllerConstructor:r}});exports.SortableController=l,exports.controllerDefinitions=u;
//# sourceMappingURL=bullet-train.js.map

@@ -1,2 +0,2 @@

import{Controller as e}from"@hotwired/stimulus";import{post as t}from"@rails/request.js";import n from"dragula";function r(e){const t=(e.match(/^(?:\.\/)?(.+)(?:[_-]controller\..+?)$/)||[])[1];if(t)return t.replace(/_/g,"-").replace(/\//g,"--")}require("dragula/dist/dragula.min.css");class s extends e{connect(){this.hasReorderPathValue&&this.initPluginInstance()}disconnect(){this.teardownPluginInstance()}initPluginInstance(){const e=this;this.plugin=n([this.element],{moves:function(t,n,r){return $(t).find(".reorder-handle").length?!!$(r).closest(".reorder-handle").length:!$(r).closest(".undraggable").length&&e.element===n},accepts:function(e,t,n,r){return!$(r).hasClass("undraggable")||!$(r).prev().hasClass("undraggable")}}).on("drop",function(t){e.saveOnReorderValue&&e.saveSortOrder()}).on("over",function(e,t){$(document.activeElement).blur()}),this.initReissuePluginEventsAsNativeEvents()}initReissuePluginEventsAsNativeEvents(){this.constructor.pluginEventsToReissue.forEach(e=>{this.plugin.on(e,(...t)=>{this.dispatch(e,{detail:{plugin:"dragula",type:e,args:t}})})})}teardownPluginInstance(){void 0!==this.plugin&&this.plugin.destroy()}saveSortOrder(){var e=Array.from(this.element.childNodes).map(e=>{var t;return parseInt(null==(t=e.dataset)?void 0:t.id)});t(this.reorderPathValue,{body:JSON.stringify({ids_in_order:e})})}}s.values={reorderPath:String,saveOnReorder:{type:Boolean,default:!0}},s.pluginEventsToReissue=["drag","dragend","drop","cancel","remove","shadow","over","out","cloned"];const i=[[s,"sortable_controller.js"]].map(function(e){const t=e[0];return{identifier:r(e[1]),controllerConstructor:t}});export{s as SortableController,i as controllerDefinitions};
import{Controller as e}from"@hotwired/stimulus";import{post as r}from"@rails/request.js";import t from"jquery";import n from"dragula";function i(e){const r=(e.match(/^(?:\.\/)?(.+)(?:[_-]controller\..+?)$/)||[])[1];if(r)return r.replace(/_/g,"-").replace(/\//g,"--")}require("dragula/dist/dragula.min.css");class s extends e{initialize(){void 0===window.jQuery&&(window.jQuery=t)}connect(){this.hasReorderPathValue&&this.initPluginInstance()}disconnect(){this.teardownPluginInstance()}initPluginInstance(){const e=this;this.plugin=n([this.element],{moves:function(r,t,n){return jQuery(r).find(".reorder-handle").length?!!jQuery(n).closest(".reorder-handle").length:!jQuery(n).closest(".undraggable").length&&e.element===t},accepts:function(e,r,t,n){return!jQuery(n).hasClass("undraggable")||!jQuery(n).prev().hasClass("undraggable")}}).on("drop",function(r){e.saveOnReorderValue&&e.saveSortOrder()}).on("over",function(e,r){jQuery(document.activeElement).blur()}),this.initReissuePluginEventsAsNativeEvents()}initReissuePluginEventsAsNativeEvents(){this.constructor.pluginEventsToReissue.forEach(e=>{this.plugin.on(e,(...r)=>{this.dispatch(e,{detail:{plugin:"dragula",type:e,args:r}})})})}teardownPluginInstance(){void 0!==this.plugin&&this.plugin.destroy()}saveSortOrder(){var e=Array.from(this.element.childNodes).map(e=>{var r;return parseInt(null==(r=e.dataset)?void 0:r.id)});r(this.reorderPathValue,{body:JSON.stringify({ids_in_order:e})})}}s.values={reorderPath:String,saveOnReorder:{type:Boolean,default:!0}},s.pluginEventsToReissue=["drag","dragend","drop","cancel","remove","shadow","over","out","cloned"];const o=[[s,"sortable_controller.js"]].map(function(e){const r=e[0];return{identifier:i(e[1]),controllerConstructor:r}});export{s as SortableController,o as controllerDefinitions};
//# sourceMappingURL=bullet-train.modern.js.map

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@hotwired/stimulus"),require("@rails/request.js"),require("dragula")):"function"==typeof define&&define.amd?define(["exports","@hotwired/stimulus","@rails/request.js","dragula"],t):t((e||self).bulletTrainSortable={},e.stimulus,e.request_js,e.dragula)}(this,function(e,t,n,r){function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=s(r);function o(e){const t=(e.match(/^(?:\.\/)?(.+)(?:[_-]controller\..+?)$/)||[])[1];if(t)return t.replace(/_/g,"-").replace(/\//g,"--")}require("dragula/dist/dragula.min.css");class l extends t.Controller{connect(){this.hasReorderPathValue&&this.initPluginInstance()}disconnect(){this.teardownPluginInstance()}initPluginInstance(){const e=this;this.plugin=i.default([this.element],{moves:function(t,n,r){return $(t).find(".reorder-handle").length?!!$(r).closest(".reorder-handle").length:!$(r).closest(".undraggable").length&&e.element===n},accepts:function(e,t,n,r){return!$(r).hasClass("undraggable")||!$(r).prev().hasClass("undraggable")}}).on("drop",function(t){e.saveOnReorderValue&&e.saveSortOrder()}).on("over",function(e,t){$(document.activeElement).blur()}),this.initReissuePluginEventsAsNativeEvents()}initReissuePluginEventsAsNativeEvents(){var e=this;this.constructor.pluginEventsToReissue.forEach(t=>{this.plugin.on(t,function(){e.dispatch(t,{detail:{plugin:"dragula",type:t,args:[].slice.call(arguments)}})})})}teardownPluginInstance(){void 0!==this.plugin&&this.plugin.destroy()}saveSortOrder(){var e=Array.from(this.element.childNodes).map(e=>{var t;return parseInt(null==(t=e.dataset)?void 0:t.id)});n.post(this.reorderPathValue,{body:JSON.stringify({ids_in_order:e})})}}l.values={reorderPath:String,saveOnReorder:{type:Boolean,default:!0}},l.pluginEventsToReissue=["drag","dragend","drop","cancel","remove","shadow","over","out","cloned"];const a=[[l,"sortable_controller.js"]].map(function(e){const t=e[0];return{identifier:o(e[1]),controllerConstructor:t}});e.SortableController=l,e.controllerDefinitions=a});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@hotwired/stimulus"),require("@rails/request.js"),require("jquery"),require("dragula")):"function"==typeof define&&define.amd?define(["exports","@hotwired/stimulus","@rails/request.js","jquery","dragula"],t):t((e||self).bulletTrainSortable={},e.stimulus,e.request_js,e.jquery,e.dragula)}(this,function(e,t,r,n,i){function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=s(n),l=s(i);function u(e){const t=(e.match(/^(?:\.\/)?(.+)(?:[_-]controller\..+?)$/)||[])[1];if(t)return t.replace(/_/g,"-").replace(/\//g,"--")}require("dragula/dist/dragula.min.css");class a extends t.Controller{initialize(){void 0===window.jQuery&&(window.jQuery=o.default)}connect(){this.hasReorderPathValue&&this.initPluginInstance()}disconnect(){this.teardownPluginInstance()}initPluginInstance(){const e=this;this.plugin=l.default([this.element],{moves:function(t,r,n){return jQuery(t).find(".reorder-handle").length?!!jQuery(n).closest(".reorder-handle").length:!jQuery(n).closest(".undraggable").length&&e.element===r},accepts:function(e,t,r,n){return!jQuery(n).hasClass("undraggable")||!jQuery(n).prev().hasClass("undraggable")}}).on("drop",function(t){e.saveOnReorderValue&&e.saveSortOrder()}).on("over",function(e,t){jQuery(document.activeElement).blur()}),this.initReissuePluginEventsAsNativeEvents()}initReissuePluginEventsAsNativeEvents(){var e=this;this.constructor.pluginEventsToReissue.forEach(t=>{this.plugin.on(t,function(){e.dispatch(t,{detail:{plugin:"dragula",type:t,args:[].slice.call(arguments)}})})})}teardownPluginInstance(){void 0!==this.plugin&&this.plugin.destroy()}saveSortOrder(){var e=Array.from(this.element.childNodes).map(e=>{var t;return parseInt(null==(t=e.dataset)?void 0:t.id)});r.post(this.reorderPathValue,{body:JSON.stringify({ids_in_order:e})})}}a.values={reorderPath:String,saveOnReorder:{type:Boolean,default:!0}},a.pluginEventsToReissue=["drag","dragend","drop","cancel","remove","shadow","over","out","cloned"];const d=[[a,"sortable_controller.js"]].map(function(e){const t=e[0];return{identifier:u(e[1]),controllerConstructor:t}});e.SortableController=a,e.controllerDefinitions=d});
//# sourceMappingURL=bullet-train.umd.js.map
import { Controller } from "@hotwired/stimulus"
import { post } from '@rails/request.js'
import jquery from "jquery";
require("dragula/dist/dragula.min.css")

@@ -16,2 +17,8 @@

initialize() {
if (window.jQuery === undefined) {
window.jQuery = jquery // required for select2 used for time zone select, but we also use global jQuery throughout below
}
}
connect() {

@@ -30,7 +37,7 @@ if (!this.hasReorderPathValue) { return }

moves: function(el, container, handle) {
var $handles = $(el).find('.reorder-handle')
var $handles = jQuery(el).find('.reorder-handle')
if ($handles.length) {
return !!$(handle).closest('.reorder-handle').length
return !!jQuery(handle).closest('.reorder-handle').length
} else {
if (!$(handle).closest('.undraggable').length) {
if (!jQuery(handle).closest('.undraggable').length) {
return self.element === container

@@ -43,3 +50,3 @@ } else {

accepts: function (el, target, source, sibling) {
if ($(sibling).hasClass('undraggable') && $(sibling).prev().hasClass('undraggable')) {
if (jQuery(sibling).hasClass('undraggable') && jQuery(sibling).prev().hasClass('undraggable')) {
return false

@@ -57,3 +64,3 @@ } else {

// deselect any text fields, or else things go slow!
$(document.activeElement).blur()
jQuery(document.activeElement).blur()
})

@@ -60,0 +67,0 @@

{
"name": "@bullet-train/bullet-train-sortable",
"version": "1.7.1",
"version": "1.7.2",
"description": "Bullet Train - Sortable",

@@ -57,4 +57,5 @@ "source": "app/javascript/index.js",

"@rails/request.js": "^0.0.6",
"dragula": "^3.7.3"
"dragula": "^3.7.3",
"jquery": "^3.7.1"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc