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

zipcode-tw-react

v1.2.0

Published

提供台灣縣市、行政區下拉選單以及郵遞區號輸入欄位組合的React Component 藉由RawData快速進行郵遞區號切換,並提供地址合併顯示。

Downloads

51

Readme

zipcode-tw-react

提供台灣縣市、行政區下拉選單以及郵遞區號輸入欄位組合的React Component
藉由RawData快速進行郵遞區號切換,並提供地址合併顯示。

travis-ci Status Coverage Status License

Feature

  • 挑選台灣縣市、行政區下拉選單,快速帶出郵遞區號。
  • 提供可自定義台灣縣市下拉選單排序(countySort)。
  • 輸入郵遞區號,快速帶出台灣縣市、行政區。
  • 提供完整地址(fullAddress)或路段地址(address)欄位傳入,合併顯示郵遞區號及地址。
  • 可自定義下拉選單、輸入欄位、地址顯示欄位的CSS, Style,達到畫面的一致性。

Demo

Try it online: https://chris-tsai.github.io/

pic

Installation

npm install zipcode-tw-react --save

or use package.json

"dependencies": {
      ...
    + "zipcode-tw-react": "^1.2.0",
 },

Usage

import {ZipCodeTW} from "zipcode-tw-react";

<ZipCodeTW displayType="text"
          ...
/>

Example : zipcode-tw-react-example

Props

Field

Name | Type | Default | Description :--- | :--- | :--- | :--- displayType| one of: 'text', 'display' | 'text' | displayType= display1. 以span顯示且包含readOnly & disabled屬性2. 提供fullAddress、address參數合併顯示郵遞區號及地址 countySort| object | {"基隆市": 1, "台北市":2, "新北市":3, "桃園市":4, "新竹市":5, "新竹縣":6, "苗栗縣":7, "台中市":8, "彰化縣":9, "南投縣":10,"雲林縣":11, "嘉義市":12, "嘉義縣":13, "台南市":14, "高雄市":15, "屏東縣":16, "台東縣":17, "花蓮縣":18, "宜蘭縣":19, "澎湖縣":20,"金門縣":21, "連江縣":22}| zipCodePositionLast| bool | true| Decide zipCode input text position, when displayType= display, position is fixed countyFieldName | string |'county' | countyValue | string | | districtFieldName | string |'district' | districtValue | string | | zipCodeFieldName | string |'zipCode' | zipCodeValue | string | | countyClass | string |'form-control' | countyStyle | object | {} | districtClass | string |'form-control' | districtStyle | object | displayType= 'text'預設為 {marginLeft:'5px', minWidth:'107px', paddingRight:'0px'} | zipClass | string | 'form-control'| zipStyle | object | displayType= 'text'預設為 {marginLeft:'5px', width: '50px'}| zipCodePlaceholder | string | | fullAddress | string | | 完整地址(優化顯示) address | string | | 路段地址資訊(優化顯示) addressClass | string | 'form-control'| addressStyle | object | {} |

Method

Name | Return | Description :--- | :--- | :--- handleChangeCounty | { countyFieldName, countyValue, districtFieldName, districtValue, zipFieldName, zipValue } handleChangeDistrict | { countyFieldName, countyValue, districtFieldName, districtValue, zipFieldName, zipValue } handleChangeZipCode | { zipFieldName, zipValue } handleBlurZipCode | { countyFieldName, countyValue, districtFieldName, districtValue, zipFieldName, zipValue } handleZipCodeNotExists | { countyFieldName, countyValue, districtFieldName, districtValue, zipFieldName, zipValue, origZipCode }