ionic-swiper
Advanced tools
Comparing version 0.2.2 to 0.2.3
{ | ||
"name": "ionic-swiper", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "An angular wrapper for swiper focused on ionic v1 as an 'swipe' lib (not slide)", | ||
@@ -14,3 +14,3 @@ "main": "src/swiper.module.js", | ||
"watch": "webpack --watch", | ||
"start": "webpack-dev-server --open", | ||
"start": "browser-sync start --files demo --server demo --index index.html", | ||
"prepack": "npm run build" | ||
@@ -21,3 +21,3 @@ }, | ||
"v1", | ||
"angular", | ||
"angularjs", | ||
"swiper" | ||
@@ -35,2 +35,3 @@ ], | ||
"babel-preset-env": "^1.6.1", | ||
"browser-sync": "^2.18.13", | ||
"css-loader": "^0.28.7", | ||
@@ -47,4 +48,4 @@ "extract-text-webpack-plugin": "^3.0.2", | ||
"ramda": "^0.25.0", | ||
"swiper": "^4.0.5" | ||
"swiper": "^4.0.6" | ||
} | ||
} |
@@ -5,3 +5,3 @@ # Ionic v1 Swiper | ||
My version of angular swiper is focused on **ionic v1**, since ionic v1 lists does'nt support swipes for both sides i wrote this | ||
My version of angular swiper is focused on **ionic v1**, since ionic v1 lists doesn't support swipes for both sides i wrote this | ||
'simple' wrappers for Swiper (which seems to be the one used in ionic 2) | ||
@@ -8,0 +8,0 @@ to support this. |
@@ -1,2 +0,2 @@ | ||
import {equals, find, findIndex, map, path, pipe, propEq} from 'ramda' | ||
import {add, curry, equals, find, findIndex, map, path, pipe, length, propEq} from 'ramda' | ||
@@ -12,5 +12,3 @@ /* | ||
export const toInstances = map(x => x.instance); | ||
//TODO:Adopt ramda instead of lambdas. | ||
export const isFinalIndex = (array) => equals(array.length - 1); | ||
export const isFirstIndex = (array) => equals(0); | ||
export const isFinalIndex = pipe(length, add(-1), equals); | ||
export const eqPointer = curry((f, s) => f === s); |
@@ -6,3 +6,3 @@ | ||
* @ngdoc provider | ||
* @name ionic.swiper.SwiperConfigurationsProvider | ||
* @name SwiperConfigurations | ||
* | ||
@@ -9,0 +9,0 @@ * @description |
import {directiveName} from "./swiper.container.directive"; | ||
import {SWIPER_DESTROY_EVENT} from "./swiper.events"; | ||
import {equals, findIndex, pipe, prop, unless} from 'ramda'; | ||
import {eqPointer} from "./functional.core"; | ||
const unless = require('ramda/src/unless'); | ||
const equals = require('ramda/src/equals'); | ||
const findIndex = require('ramda/src/findIndex'); | ||
const eqPointer = (f) => (s) => f === s; | ||
export const controllerName = 'SwiperContainerController'; | ||
@@ -14,4 +11,9 @@ export const controllerAsName = 'spcCtrl'; | ||
* @ngdoc controller | ||
* @name ionic.swiper:SwiperContainerController | ||
* @name SwiperContainerController | ||
* @alias tskCtrl | ||
* @requires $rootScope | ||
* @requires $element | ||
* @requires $scope | ||
* @requires $attrs | ||
* @requires SwiperService | ||
* | ||
@@ -21,3 +23,2 @@ * @description | ||
* | ||
* @require $element | ||
* | ||
@@ -60,7 +61,9 @@ **/ | ||
_self.slideToElement = function($element) { | ||
const index = findIndex(eqPointer($element))(swiperInstance.slides); | ||
unless(equals(-1), swiperInstance.slideTo(index)); | ||
pipe( | ||
prop('slides'), | ||
findIndex(eqPointer($element)), | ||
unless(equals(-1), swiperInstance.slideTo) | ||
)(swiperInstance); | ||
return _self; | ||
} | ||
} |
@@ -8,3 +8,3 @@ import { | ||
* @ngdoc directive | ||
* @name ionic.swiper#SwiperContainerDirective | ||
* @name SwiperContainer | ||
* @description | ||
@@ -11,0 +11,0 @@ * An wrapper directive for swiper container |
@@ -6,3 +6,3 @@ import {directiveName as containerName} from './swiper.container.directive'; | ||
* @ngdoc directive | ||
* @name ionic.swiper#SwiperRequireFocusDirective | ||
* @name SwiperRequireFocus | ||
* @requires $timeout | ||
@@ -9,0 +9,0 @@ * |
@@ -1,7 +0,7 @@ | ||
import {complement, cond, equals, forEach, ifElse, isNil, pipe, T, unless} from 'ramda' | ||
import {findForContainerId, findIndexForContainerId, isFinalIndex, isFirstIndex, toInstances} from "./functional.core"; | ||
import {complement, cond, equals, forEach, ifElse, isNil, pipe, T, unless, path} from 'ramda' | ||
import {findForContainerId, findIndexForContainerId, isFinalIndex, toInstances} from "./functional.core"; | ||
import {SWIPER_DESTROY_EVENT} from "./swiper.events"; | ||
const clearAllControllers = pipe(toInstances,forEach( i => i.controller.control = [])); | ||
const isDestroyed = path(['instance','destroyed']); | ||
export const serviceName = 'SwiperSelectionService'; | ||
@@ -11,3 +11,3 @@ | ||
* @ngdoc service | ||
* @name ionic.swiper:SwiperSelectionService | ||
* @name SwiperSelectionService | ||
* @requires $rootScope | ||
@@ -52,3 +52,3 @@ * @requires SwiperService | ||
unless(equals(-1), index => { | ||
selectedList[index].instance.controller.control = []; | ||
unless(isDestroyed, w => w.instance.controller.control = [])(selectedList[index]); | ||
selectedList.splice(index, 1); | ||
@@ -81,3 +81,3 @@ createControllersAsCircularLinkedList(selectedList); | ||
[isFinalIndex(array), putUnderInstanceControl(-1)], | ||
[isFirstIndex(array), putUnderInstanceControl(1)], | ||
[equals(0), putUnderInstanceControl(1)], | ||
[T, i => { | ||
@@ -84,0 +84,0 @@ const added = [array[i - 1], array[i + 1]]; |
@@ -11,3 +11,3 @@ import {equals, merge, pipe, unless} from 'ramda' | ||
* @ngdoc service | ||
* @name ionic.swiper:SwiperService | ||
* @name SwiperService | ||
* | ||
@@ -14,0 +14,0 @@ * @description |
@@ -8,3 +8,3 @@ import {directiveName as containerName} from './swiper.container.directive'; | ||
* @ngdoc directive | ||
* @name ionic.swiper#SwiperSlideDirective | ||
* @name SwiperSlide | ||
* | ||
@@ -11,0 +11,0 @@ * @description |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
302998
16
15
314
Updatedswiper@^4.0.6