Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
repl-temp-*
.pulp*
dist
cabal-dev
.cabal-sandbox
cabal.sandbox.config
*.o
*.hi
*.chi
*.chs.h
*.lksh*
.virthualenv
.psci_modules/
.test_modules/
bower_components/
node_modules
tmp/
.stack-work/
output
examples/docs/docs/
core-tests/full-core-docs.md
.psc-ide-port
23 changes: 23 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "purescript-sortable-hoc",
"description": "Purescript wrapper for purescript-sortable-hoc",
"authors": "Vishnu Prasad <vishnu@atomicits.com>",
"license": "MIT",
"keywords": [
"purescript",
"react",
"drag-drop",
],
"homepage": "",
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"purescript-react": "^2.0.0"
}
}
12 changes: 12 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "purescript-sortable-hoc",
"version": "1.0.0",
"description": "Purescript wrapper for purescript-sortable-hoc",
"main": "index.js",
"repository": "atomicits/purescript-sortable-hoc",
"author": "Vishnu Prasad <vishnu@atomicits.com>",
"license": "MIT",
"dependencies": {
"react-sortable-hoc": "^0.6.1"
}
}
41 changes: 41 additions & 0 deletions src/SortableHoc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
'use strict';

var reactSortableHoc = require("react-sortable-hoc");

exports.sortableContainer = function(element){
return function(config){
return function(){
return reactSortableHoc.sortableContainer(element, config);
};
};
};


exports.sortableElement = function(element){
return function(config){
return function(){
return reactSortableHoc.sortableElement(element, config);
};
};
};


exports.sortableHandle = function(element){
return function(config){
return function(){
return reactSortableHoc.sortableHandle(element, config);
};
};
};


exports.arrayMove = function(array){
return function(prevIndex){
return function(newIndex){
return function(){
return reactSortableHoc.arrayMove(array, prevIndex, newIndex);
};

};
};
};
27 changes: 27 additions & 0 deletions src/SortableHoc.purs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module SortableHoc where

import React (ReactElement)
import Control.Monad.Eff (Eff)

type Config = {withRef :: Boolean}

foreign import sortableContainer :: forall e. ReactElement
-> Config
-> Eff e ReactElement


foreign import sortableElement :: forall e. ReactElement
-> Config
-> Eff e ReactElement


foreign import sortableHandle :: forall e. ReactElement
-> Config
-> Eff e ReactElement



foreign import arrayMove :: forall e a. Array a
-> Int
-> Int
-> Eff e (Array a)
7 changes: 7 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


react-native-parallax-scroll-view@^0.19.0:
version "0.19.0"
resolved "https://registry.yarnpkg.com/react-native-parallax-scroll-view/-/react-native-parallax-scroll-view-0.19.0.tgz#23b9af1f13249a610f4641e2582a58997df7d80a"