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

@hecom/home

v1.2.1

Published

Home Module Management

Downloads

7

Readme

Home

npm version Build Status

这是主页配置管理模块,主要用于注册主页配置信息,以及处理方式。

接口

  • name: string:模块名称。
  • initGlobal: () => void:全局初始化模块。
  • get: () => object:获取当前主页完整配置。
  • setDefault: (config) => void:设置默认主页配置。
  • registerUi:注册UI组件的处理方式,统一参数:name为组件名称,func: (config) => React.Component为展示函数,其中config为当前组件的运行时参数。
    • page: (name, func) => string:注册页面的展示方式。
    • section: (name, func) => string:注册分区的展示方式。
    • cell: (name, func) => string:注册单元格的展示方式。
    • naviButton: (name, func) => string:注册导航按钮的展示方式。
    • function: (name, func) => string:注册定制功能组件的展示方式。
  • registerAction: (name, func) => string:注册点击操作的处理方式,name为组件名称,func: (config) => void为展示函数,其中config为当前组件的运行时参数。
  • create:创建组件配置项,
    • metaCell: (metaName, label, icon, color, other) => object:创建元数据单元格配置项。
    • functionCell: (name, label, icon, color, other) => object:创建定制功能单元格配置项。
    • naviButton: (name, icon, color, other) => object:创建导航按钮配置项。
    • rowSection: (cells, other) => object:创建行形式分区配置项。
    • functionSection: (name, other) => object:创建定制功能分区配置项。
    • sectionPage: (name, label, icon, selected_icon, sections, other) => object:创建分区形式的页面配置项。
    • functionPage: (name, label, icon, selected_icon, other) => object:创建定制功能的页面配置项。
    • tabHome: (init_name, tabs, other) => object:创建标签页形式的主页配置项。
  • matchUi: (params) => React.Component:根据运行时的项目配置参数,在UI组件处理方式中寻找符合条件的处理项,并返回处理结果即组件视图。
  • matchAction: (name, params) => void:根据运行时的项目配置参数,在点击操作处理方式中寻找符合条件的处理项,并执行操作动作。
  • type:判断配置项类型的方法。
    • isPage: (config) => boolean:判断是否是页面配置。
    • isSection: (config) => boolean:判断是否是分区配置。
    • isCell: (config) => boolean:判断是否是单元格配置。
    • isNaviButton: (config) => boolean:判断是否是导航按钮配置。
    • isFunction: (config) => boolean:判断是否是定制功能配置。

通用配置项信息

  • type:配置项类型。
  • name:配置项标识。
  • auth:权限配置数组,只有满足所有权限才可以展示或执行。数组每一项是{app, metaName, innerApp, action}。判断[app, innerApp, action][metaName, innerApp, action]的权限。

非通用配置项信息

每个类别下,都是包含通用部分的配置项信息。

  • MetaCell:元数据单元格。
    • typeCellType
    • name:元数据模块的标识。
    • metaName:对应业务对象的名称。
    • label:展示的文本标签。
    • icon:文本左侧的图标。
    • color:图标的颜色。
  • FunctionCell:定制功能单元格。
    • typeCellType
    • label:展示的文本标签。
    • icon:文本左侧的图标。
    • color:图标的颜色。
  • NaviButton:导航按钮。
    • typeNaviButtonType
    • icon:按钮图标。
    • color:按钮图标的颜色。
  • RowSection:行形式分区。
    • typeSectionType
    • name:空字符串。
    • cells:包含的单元格数组。
    • style:整个视图的自定义样式。
  • FunctionSection:定制功能分区。
    • typeFunctionType
    • style:整个视图的自定义样式。
  • SectionPage:分区形式页面。
    • typePageType
    • label:标题。
    • icon:普通状态图标。
    • selected_icon:选中状态图标。
    • sections:分区列表。
    • position:标题位置,leftcenterright
    • canRefresh:是否可以下拉刷新。
    • absolute:绝对布局配置。
      • offset:滚动深浅颜色渐变的偏移量。
      • light_color:浅颜色,滑动渐变用。
      • dark_bgcolor:深颜色时的背景色。
      • dark_color:深颜色,滑动渐变用。
    • right:右侧按钮列表。
    • disableScroll:禁止滚动。
  • FunctionPage:定制功能页面。
    • typeFunctionType
    • label:标题。
    • icon:普通状态图标。
    • selected_icon:选中状态图标。
  • TabHome:标签页式的主页。
    • typeTabHomeType
    • init_name:初始选中的标签页的名称。
    • tabs:所有标签页的数组。
    • activeTintColor:标签的选中高亮颜色。