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

ionic-angular-improve

v1.0.11

Published

一个改良的ionic官方的组件,包括改良datetime、popver等ionic的组件方法

Downloads

13

Readme

Ionic Framework

官方地址:http://ionicframework.com

这个一个根据ionic官方的组件库改良的组件库,为了迎合不同的项目需要而做针对官方的组件库进行一些修改。修改内容为:DateTime、Picker、Popover

DateTime

官方DateTime组件返回的时间格式是 ISO,这不是我们想要的时间格式,我们通过官方推荐的moment.js,引入到依赖包路径为:/node_modules/ionic-angular/components/datetime/datetime.js的datetime.js文件通过利用momentjs的转换,把ISO的时间格式转换成符合中国时区的时间格式

 // var nowString = (new Date).toISOString();
 var nowString = moments((new Date).toISOString()).utcOffset(8).format();

/**
    * 这里的转换主要针对ionChange事件的数据返回
    * @hidden
    */
  DateTime.prototype._inputChangeEvent = function () {
      return moments(this.value).utcOffset(8).format();
  };
  /**
    * @这里主要针对时间控件中的确认事件所返回的数据
    */
  DateTime.prototype._inputNgModelEvent = function () {
      let date = convertDataToISO(this.value);
      return moments().format(date);
  };

Picker

picker组件主要用于时间控件datetime,当时间格式为:YYYY-MM-DD HH:mm 的时候,时间控件就会显示的非常密集,难以阅读,于是乎我们把时间控件改成带单位的时间,例如:2018年6月20日10时20分。

修改路径:node_modules/ionic-angular/components/picker/picker-component.js

if (isPresent(inputOpt)) {
    if (isString(inputOpt) || isNumber(inputOpt)) {
        opt.text = inputOpt.toString();
        opt.value = inputOpt;
    } else {
        if(column.name === 'year'){
            opt.text =  isPresent(inputOpt.text) ? inputOpt.text + '年' : inputOpt.value+ '年';
        }else if(column.name === 'month'){
            opt.text = isPresent(inputOpt.text) ? inputOpt.text + '月' : inputOpt.value+ '月';
        }else if(column.name === 'day'){
            opt.text =  isPresent(inputOpt.text) ? inputOpt.text + '日' : inputOpt.value+ '日';
        }else if(column.name === 'minute'){
            opt.text =  isPresent(inputOpt.text) ? inputOpt.text + '时' : inputOpt.value+ '时';
        }else if(column.name === 'hour'){
            opt.text =  isPresent(inputOpt.text) ? inputOpt.text + '时' : inputOpt.value+ '时';
        }else if(column.name === 'minute'){
            opt.text = isPresent(inputOpt.text) ? inputOpt.text + '分' : inputOpt.value+ '分';
        }else{
            opt.text = isPresent(inputOpt.text) ? inputOpt.text : inputOpt.value;
        }
        // opt.text = isPresent(inputOpt.text) ? inputOpt.text : inputOpt.value;
        opt.value = isPresent(inputOpt.value) ? inputOpt.value : inputOpt.text;
    }
}

Popover

Popover是弹出窗口是显示在当前页面顶部的对话框。它可以用于任何事情,但通常用于不适合导航栏的溢出操作。主要是ios平台和Android平台出现的动画效果和页面效果都不一样,在项目中,更多希望Android平台的能统一跟ios平台一样。

修改路径:node_modules/ionic-angular/components/popover/popover-transitions.js、/node_modules/ionic-angular/components/popover/popover.md.scss

原来的

 PopoverMdPopIn.prototype.play = function () {
    var _this = this;
    this.plt.raf(function () {
        _this.mdPositionView(_this.enteringView.pageRef().nativeElement, _this.opts.ev);
        _super.prototype.play.call(_this);
    });
};

改为

 PopoverMdPopIn.prototype.play = function () {
    var _this = this;
    this.plt.raf(function () {
        _this.iosPositionView(_this.enteringView.pageRef().nativeElement, _this.opts.ev);
        _super.prototype.play.call(_this);
    });
};