From 7dbdce7dd50a55692ba05f9a658d47e53321875c Mon Sep 17 00:00:00 2001
From: Ben McIntyre <email.ben.mcintyre@gmail.com>
Date: Wed, 23 Nov 2016 23:35:35 +0930
Subject: [PATCH] Round 2: edit npm files for export and require

---
 slick.core-npm.js     | 36 ++++++++++++++++++++++++++++++++++++
 slick.dataview-npm.js | 11 +++++++++++
 slick.grid-npm.js     |  9 +++++++++
 3 files changed, 56 insertions(+)

diff --git a/npm/slick.core.js b/npm/slick.core.js
index c4f04ec..f7524d5 100644
--- a/npm/slick.core.js
+++ b/npm/slick.core.js
@@ -5,6 +5,42 @@
  */
 
 (function ($) {
+  module.exports = {
+    "Event": Event,
+    "EventData": EventData,
+    "EventHandler": EventHandler,
+    "Range": Range,
+    "NonDataRow": NonDataItem,
+    "Group": Group,
+    "GroupTotals": GroupTotals,
+    "EditorLock": EditorLock,
+
+    /***
+     * A global singleton editor lock.
+     * @class GlobalEditorLock
+     * @static
+     * @constructor
+     */
+     "GlobalEditorLock": new EditorLock(),
+
+     "keyCode": {
+       BACKSPACE: 8,
+       DELETE: 46,
+       DOWN: 40,
+       END: 35,
+       ENTER: 13,
+       ESCAPE: 27,
+       HOME: 36,
+       INSERT: 45,
+       LEFT: 37,
+       PAGE_DOWN: 34,
+       PAGE_UP: 33,
+       RIGHT: 39,
+       TAB: 9,
+       UP: 38
+     }
+ };
+
   // register namespace
   $.extend(true, window, {
     "Slick": {
diff --git a/npm/slick.dataview.js b/npm/slick.dataview.js
index e248889..4fe8d74 100644
--- a/npm/slick.dataview.js
+++ b/npm/slick.dataview.js
@@ -1,4 +1,15 @@
 (function ($) {
+
+module.exports = {
+   DataView: DataView,
+   Aggregators: {
+     Avg: AvgAggregator,
+     Min: MinAggregator,
+     Max: MaxAggregator,
+     Sum: SumAggregator
+   }
+ };
+
   $.extend(true, window, {
     Slick: {
       Data: {
diff --git a/npm/slick.grid.js b/npm/slick.grid.js
index 2ccae51..271b160 100644
--- a/npm/slick.grid.js
+++ b/npm/slick.grid.js
@@ -20,6 +20,11 @@
 if (typeof jQuery === "undefined") {
   throw "SlickGrid requires jquery module to be loaded";
 }
+
+require('./lib/jquery.event.drag-2.3.0');
+require('./lib/jquery.event.drop-2.3.0');
+require('jquery-ui/sortable');
+
 if (!jQuery.fn.drag) {
   throw "SlickGrid requires jquery.event.drag module to be loaded";
 }
@@ -27,8 +32,12 @@ if (typeof Slick === "undefined") {
   throw "slick.core.js not loaded";
 }
 
+var Slick = require('./slick.core-npm');
 
 (function ($) {
+
+  module.exports = SlickGrid;
+
   // Slick.Grid
   $.extend(true, window, {
     Slick: {
-- 
2.10.0.windows.1

