npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

timepack-album

v1.3.5

Published

timepack album component

Downloads

9

Readme

timepack-album

timepack相簿组件包和工具类

Build Setup

# install dependencies
npm install 'timepack-album' --save

组件API

AlbumGlobal

相簿全局预览组件

使用

import {AlbumGlobal} from 'timepack-album'

入参

名称 | 类型 | 含义 ---|---|--- product | Object | 产品参数(包含产品类型:相簿/台历) layout | Array | 容器数据 photoList| Array| 相簿数据

方法

名称 | 参数 | 含义 ---|---|--- change| (photoList,layout)|数据结构变更,反馈变更数据,供父组件处理 upload| 无 | 触发上传事件


AlbumGallery

照片库组件,提供图片的修改删除上传和选择操作

使用

import {AlbumGallery} from 'timepack-album'

入参

名称 | 类型 | 含义 ---|---|--- layout | Array | 容器数据 photoList| Array| 相簿数据 mode | String | 上传模式,有group,single

方法

名称 | 参数 | 含义 ---|---|--- load| 无|懒加载图片列表的请求 pageChange| 无 | 懒加载图片列表页数变更 delete| (ids,groupIndex,imageIndex) | 删除图片 upload| 无| 安卓端图片上传 save|data源图片信息数据| 图片上传保存到服务端 confirm|data相簿图片信息数据|点击确认按钮,同步图片数据结构 afterImageLoaded|(page,data)|由父组件触发,图片加载完成后调用 afterTokenCreated|uptoken|由父组件触发,获取到七牛token后调用 afterImageDeleted|(groupIndex,imageIndex)|由父组件触发,图片删除后调用 afterImageSaved|data源图片信息数据|由父组件触发,图片保存完成后调用


工具API

TimepackQiniu

使用

import {TimepackQiniu} from 'timepack-album'

TimepackUtil

使用

import {TimepackUtil} from 'timepack-album'

方法

method | return | description ---|---|--- getQueryByName(str) | String or Null | get url query-value by query-key isTelephone(str) | Boolean | judge string is telephone or not dateFormat(date,fmt) | String | format date removeArrayItem(array,index) | String | remove item from an array browser().isIE()|Boolean| judge current browser is ie or not browser().isFirefox()|Boolean| judge current browser is firefox or not browser().isChrome()|Boolean| judge current browser is chrome or not browser().isAndroid()|Boolean| judge current browser is android or not browser().isIOS()|Boolean| judge current browser is ios or not browser().isWeixin()|Boolean| judge current browser is wechat or not string().trim(str)|String| trim string string().isEmpty(str)|String| judge the input string is empty string().isNotEmpty(str)|String| judge the input string is not empty string().isBlank(str)|String| judge the input string is blank string().isNotBlank(str)|String| judge the input string is blank fileUploader(param,callback)| No Return| upload a file to server through qiniu

fileUploader method statement

param | default|required ---|---|--- fileType | jpg,png,jpeg |false buttonId | null | true uptoken | null | true domain | https://images.cache.timepack.cn/|true size | 4mb |false

callback | description | required ---|--- | --- added | trigger when files have been added | false progress | trigger when a file were uploading | false complete| trigger when a file uploading event completed | false uploaded| trigger when a file uploading successfully | true error| trigger when a file uploading event came across an error | false

AlbumCanvas

相簿图片自动合成,拖拽,旋转,删除核心模块

render(photo,layout,temp)

init()

初始化相簿数据

compatable()

跨设备分享,数据兼容处理

getter()

  • template(index):模板图片
  • photo(pageIndex,imageIndex):
  • radio(index):获取容器的长宽比
  • rest():获取整页剩余的未填充数量
  • pageRest(index):获取指定页数空区域的数量(即未填充的数量)

setter()

  • editPageStyle(pageIndex,imageIndex,editWidth,editable):单页容器模板样式
  • photoStyle(pageIndex,imageIndex):单页图片样式
  • groupImage($list): 用jquery对象列表批量填充图片
  • listImage(list):用图片数据列表填充图片
  • fillImageByPage($list,page):根据页数填充图片
  • indexImage($list, page, index):单页内根据下标填充图片

operate()

  • exchange(pageIndex,lastIndex,currentIndex):更换图片间顺序
  • rotate(pageIndex,imageIndex):顺时针旋转图片90度
  • zoomImage(pageIndex,index,type):放大或缩小图片,type-1放大,type-2缩小
  • convert($list):图片jquery对象转换为可用的数据结构
  • changeLayout(index):修改容器模板

delete()

  • deleteImageByIndex(pageIndex,imageIndex):删除指定页内指定图片

event

  • touchstart(e,target):
  • touchmove(e, startPosition, position, target):
  • touchend(e, page, index, position, target):