carousel-component
Advanced tools
Comparing version 1.0.0 to 1.0.1
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var animationKeyframesIdName = "carousel-animation-keyframes"; | ||
function setStyle(num, width, count) { | ||
export function setStyle(num, width, count) { | ||
var style = document.getElementById(animationKeyframesIdName); | ||
@@ -14,4 +13,3 @@ if (!style) { | ||
} | ||
exports.setStyle = setStyle; | ||
function runAnimation(ul, timeout, keyframes, num, next) { | ||
export function runAnimation(ul, timeout, keyframes, num, next) { | ||
ul.style.animation = ""; | ||
@@ -27,4 +25,3 @@ window.requestAnimationFrame(function () { | ||
} | ||
exports.runAnimation = runAnimation; | ||
function appendLeftAndRightData(data, actualCount) { | ||
export function appendLeftAndRightData(data, actualCount) { | ||
var leftItems = data.slice(data.length - actualCount); | ||
@@ -35,2 +32,1 @@ var rightItems = data.slice(0, actualCount); | ||
} | ||
exports.appendLeftAndRightData = appendLeftAndRightData; |
/// <reference types="react" /> | ||
/// <reference types="node" /> | ||
import * as React from "react"; | ||
import * as common from "./common"; | ||
export * from "./common"; | ||
export declare type Props = { | ||
@@ -14,3 +14,3 @@ data: common.CarouselData[]; | ||
export declare class Carousel extends React.Component<Props, {}> { | ||
timer: NodeJS.Timer; | ||
timer: number; | ||
currentIndex: number; | ||
@@ -17,0 +17,0 @@ hoveringLeft: boolean; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var React = require("react"); | ||
var ReactDOM = require("react-dom"); | ||
var common = require("./common"); | ||
import * as tslib_1 from "tslib"; | ||
import * as React from "react"; | ||
import * as ReactDOM from "react-dom"; | ||
import * as common from "./common"; | ||
export * from "./common"; | ||
var Carousel = (function (_super) { | ||
@@ -157,2 +157,2 @@ tslib_1.__extends(Carousel, _super); | ||
}(React.Component)); | ||
exports.Carousel = Carousel; | ||
export { Carousel }; |
@@ -1,1 +0,1 @@ | ||
export declare const srcVueTemplateHtml: string; | ||
export declare const vueTemplateHtml: string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.srcVueTemplateHtml = "<div class=\"carousel\" :style=\"containerStyle\"><div class=\"main\" :style=\"mainStyle\"><ul ref=\"ul\" :style=\"ulStyle\" @mouseenter=\"pause()\" @mouseleave=\"start()\"><li v-for=\"(item, i) in data\" v-if=\"i >= currentIndex - actualCount && i < currentIndex + actualCount * 2\" :style=\"liStyle\"><component :is=\"item.component\" :data=\"item.data\"></component></li></ul></div><div class=\"left\" :style=\"leftStyle\" @click=\"moveLeft(actualCount)\" @mouseenter=\"mouseenterLeft()\" @mouseleave=\"mouseleaveLeft()\"></div><div class=\"right\" :style=\"rightStyle\" @click=\"moveRight(actualCount)\" @mouseenter=\"mouseenterRight()\" @mouseleave=\"mouseleaveRight()\"></div></div>"; | ||
export var vueTemplateHtml = "<div class=\"carousel\" :style=\"containerStyle\"><div class=\"main\" :style=\"mainStyle\"><ul ref=\"ul\" :style=\"ulStyle\" @mouseenter=\"pause()\" @mouseleave=\"start()\"><li v-for=\"(item, i) in data\" v-if=\"i >= currentIndex - actualCount && i < currentIndex + actualCount * 2\" :style=\"liStyle\"><component :is=\"item.component\" :data=\"item.data\"></component></li></ul></div><div class=\"left\" :style=\"leftStyle\" @click=\"moveLeft(actualCount)\" @mouseenter=\"mouseenterLeft()\" @mouseleave=\"mouseleaveLeft()\"></div><div class=\"right\" :style=\"rightStyle\" @click=\"moveRight(actualCount)\" @mouseenter=\"mouseenterRight()\" @mouseleave=\"mouseleaveRight()\"></div></div>"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var Vue = require("vue"); | ||
var vue_class_component_1 = require("vue-class-component"); | ||
var common = require("./common"); | ||
var variables_1 = require("./variables"); | ||
import * as tslib_1 from "tslib"; | ||
import Vue from "vue"; | ||
import Component from "vue-class-component"; | ||
import * as common from "./common"; | ||
export * from "./common"; | ||
import { vueTemplateHtml } from "./variables"; | ||
var Carousel = (function (_super) { | ||
@@ -136,10 +136,10 @@ tslib_1.__extends(Carousel, _super); | ||
}; | ||
Carousel = tslib_1.__decorate([ | ||
Component({ | ||
template: vueTemplateHtml, | ||
props: ["data", "timeout", "interval", "count", "width", "height"], | ||
}) | ||
], Carousel); | ||
return Carousel; | ||
}(Vue)); | ||
Carousel = tslib_1.__decorate([ | ||
vue_class_component_1.default({ | ||
template: variables_1.srcVueTemplateHtml, | ||
props: ["data", "timeout", "interval", "count", "width", "height"], | ||
}) | ||
], Carousel); | ||
Vue.component("carousel", Carousel); |
{ | ||
"name": "carousel-component", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A vuejs and reactjs carousel component.", | ||
@@ -13,7 +13,11 @@ "main": "index.js", | ||
"stylelint": "stylelint \"src/**/*.less\"", | ||
"cleancss": "cleancss -o dist/carousel.min.css dist/carousel.css", | ||
"clean": "rimraf dist && rimraf demo/*.bundle-*.js", | ||
"file2variable": "file2variable-cli src/vue.template.html -o src/variables.ts --html-minify", | ||
"cleancss": "cleancss -o dist/carousel.min.css dist/carousel.css && cleancss -o demo/index.bundle.css dist/carousel.min.css ./node_modules/github-fork-ribbon-css/gh-fork-ribbon.css", | ||
"clean": "rimraf dist && rimraf demo/**/index.bundle-*.js", | ||
"file2variable": "file2variable-cli src/vue.template.html -o src/variables.ts --html-minify --base src", | ||
"build": "npm run clean && npm run file2variable && npm run tsc && npm run lessc && npm run cleancss && npm run webpack && npm run rev-static", | ||
"lint": "npm run tslint && npm run stylelint" | ||
"lint": "npm run tslint && npm run stylelint && npm run standard", | ||
"standard": "standard **/*.config.js", | ||
"fix": "standard --fix **/*.config.js", | ||
"test": "tsc -p spec && karma start spec/karma.config.js", | ||
"release": "clean-release" | ||
}, | ||
@@ -31,18 +35,28 @@ "repository": { | ||
"devDependencies": { | ||
"@types/react": "15.0.24", | ||
"@types/react-dom": "15.5.0", | ||
"clean-css-cli": "4.1.2", | ||
"file2variable-cli": "1.3.0", | ||
"@types/jasmine": "2.5.53", | ||
"@types/react": "15.0.34", | ||
"@types/react-dom": "15.5.1", | ||
"clean-css-cli": "4.1.6", | ||
"clean-release": "1.0.3", | ||
"file2variable-cli": "1.4.0", | ||
"github-fork-ribbon-css": "0.2.1", | ||
"jasmine": "2.6.0", | ||
"karma": "1.7.0", | ||
"karma-chrome-launcher": "2.2.0", | ||
"karma-firefox-launcher": "1.0.1", | ||
"karma-jasmine": "1.1.0", | ||
"karma-webpack": "2.0.3", | ||
"less": "2.7.2", | ||
"react": "15.5.4", | ||
"react-dom": "15.5.4", | ||
"rev-static": "2.4.2", | ||
"react": "15.6.1", | ||
"react-dom": "15.6.1", | ||
"rev-static": "2.7.1", | ||
"rimraf": "2.6.1", | ||
"stylelint": "7.10.1", | ||
"standard": "10.0.2", | ||
"stylelint": "7.12.0", | ||
"stylelint-config-standard": "16.0.0", | ||
"tslint": "5.2.0", | ||
"typescript": "2.3.2", | ||
"vue": "2.3.3", | ||
"vue-class-component": "5.0.1", | ||
"webpack": "2.5.1" | ||
"tslint": "5.4.3", | ||
"typescript": "2.4.1", | ||
"vue": "2.3.4", | ||
"vue-class-component": "5.0.2", | ||
"webpack": "3.0.0" | ||
}, | ||
@@ -49,0 +63,0 @@ "dependencies": { |
@@ -10,2 +10,8 @@ [![Dependency Status](https://david-dm.org/plantain-00/carousel-component.svg)](https://david-dm.org/plantain-00/carousel-component) | ||
#### features | ||
+ vuejs component | ||
+ reactjs component | ||
+ custom component | ||
#### install | ||
@@ -41,4 +47,2 @@ | ||
the source code of the demo: https://github.com/plantain-00/carousel-component/tree/master/demo/vue | ||
#### reactjs component demo | ||
@@ -62,4 +66,2 @@ | ||
the source code of the demo: https://github.com/plantain-00/carousel-component/tree/master/demo/react | ||
#### properties and events of the component | ||
@@ -84,8 +86,1 @@ | ||
``` | ||
#### features | ||
+ vuejs component | ||
+ reactjs component | ||
+ commonjs module | ||
+ custom component |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
0
21686
26
13
433
83
1