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 🙏

© 2025 – Pkg Stats / Ryan Hefner

owl-properties

v3.0.15

Published

properties kanban uesd in odoo owl2

Readme

owl-properties

基于Odoo OWL 2的属性面板组件库

简介

owl-properties 是一个基于 Odoo OWL 2 框架设计的属性面板组件库,提供简洁易用的标签页切换功能,适用于需要分类展示属性或内容的场景。

安装

# 使用npm
npm install owl-properties

# 使用yarn
yarn add owl-properties

组件

PropertiesPanel

属性面板主组件,提供标签页切换和内容显示功能。

属性

| 属性 | 类型 | 默认值 | 说明 | | ------------- | --------------------- | ------ | -------------------------- | | defaultActive | string | '' | 默认激活的标签页值 | | tabs | Array<TabProps> | [] | 标签页配置数组 | | forceRender | boolean | false | 是否强制渲染所有标签页内容 | | onChangeTab | function | - | 标签页切换回调函数 |

TabProps类型说明

| 属性 | 类型 | 必选 | 说明 | | --------- | --------- | ---- | -------------------------------------- | | label | string | 是 | 标签页显示的文本 | | value | string | 是 | 标签页的唯一标识 | | component | Component | 否 | 标签页内容对应的组件 | | props | Object | 否 | 传递给组件的属性 | | icon | string | 否 | 标签页图标html片段,需要使用markup包裹 |

使用示例

import { PropertiesPanel } from 'owl-properties';
import { Component, markup } from '@odoo/owl';

class MyComponent extends Component {
  static components = { PropertiesPanel };

  static template = xml`
    <PropertiesPanel 
      defaultActive="'tab1'" 
      tabs="tabs" 
      onChangeTab.bind="onTabChange"
    />
  `;

  setup() {
    this.tabs = [
      {
        label: '标签1',
        value: 'tab1',
        component: TabContent1,
        props: {
          /* 传递给组件的属性 */
        },
      },
      {
        label: '标签2',
        value: 'tab2',
        component: TabContent2,
        icon: markup('<span>icon</span>'),
      },
    ];

    this.onTabChange = (tabValue) => {
      console.log('当前激活标签:', tabValue);
    };
  }
}

Tab

标签页组件,用于显示和切换标签。

属性

| 属性 | 类型 | 默认值 | 说明 | | --------- | --------------------- | ------ | ------------------ | | active | string | - | 当前激活的标签页值 | | tabs | Array<TabProps> | - | 标签页配置数组 | | onChange | function | - | 标签页切换回调函数 | | className | string | - | 自定义类名 |

Empty

空状态组件,当没有内容时显示。

开发

# 安装依赖
yarn install

# 启动开发服务
yarn start

# 构建
yarn build

# 代码检查
yarn eslint

许可证

MIT