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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@moluoxixi/components

v0.3.0

Published

`@moluoxixi/components` 是 Moluoxixi 组件集合入口。

Readme

@moluoxixi/components

@moluoxixi/components 是 Moluoxixi 组件集合入口。

当前包维护 Element Plus、Ant Design Vue ConfigForm 的独立公共类型和薄适配器,并提供从旧组件库迁入的常用 Element Plus 辅助组件。ConfigForm 的状态与 Zod 校验收敛在 headless 层,Vue DOM、原生 Grid/Flex、字段壳和 ARIA 收敛在 @moluoxixi/config-form/renderer;本包保留两套 UI 的绑定预设、样式和就近测试。

import { defineFields, ElementConfigForm } from '@moluoxixi/components'

interface MyFormValues {
  name: string
}

const { defineField } = defineFields<MyFormValues>()
import {
  AntdConfigForm,
  antdConfigForm,
  ConfigTable,
  DateRangePicker,
  ElementConfigForm,
  EnterNextContainer,
  PopoverTableSelect,
  RequestCascader,
  RequestSelectV2,
  RequestTreeSelect,
} from '@moluoxixi/components'

两套 ConfigForm 都使用原生 <form>、CSS Grid/Flex 和共享字段壳,不依赖 UI 库的 Form/FormItem/Row/Col。它们支持 headless 层的 defineField / defineFields、Zod schema、validateOn 的 change/blur 校验触发、容器节点、配置化 slots、readonly 与 readonlyRender,并透传 dirty/touched、metaChange、默认 slot metagetMeta / getFieldMeta / setTouched

需要只加载单一 UI 实现时,使用本包的纯入口:

import { AntdConfigForm } from '@moluoxixi/components/antd'
import { ElementConfigForm } from '@moluoxixi/components/element'

只消费无 UI 协议与 controller 时直接使用独立 headless 包:

import { createConfigFormController, defineFields } from '@moluoxixi/config-form-headless'

样式统一通过样式入口引入:

import '@moluoxixi/components/styles'

自动按需加载

@moluoxixi/components/auto-loaders 子路径提供 unplugin-vue-componentsunplugin-auto-import 的官方接入配置。它不经过组件根入口,也不会在 Vite 配置期加载组件运行时:

pnpm add -D unplugin-auto-import unplugin-vue-components
// vite.config.ts
import { autoComponent, autoImport } from '@moluoxixi/components/auto-loaders'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'

export default {
  plugins: [AutoImport({ imports: [autoImport] }), Components({ resolvers: [autoComponent] })],
}

autoComponent 只解析公开组件,并从对应组件子入口按需导入,同时加载 @moluoxixi/components/stylesautoImport 也按 configFormCopyTextHeadlessTable 等最小子入口注入运行时 API,避免一个工具函数把根 barrel 带入首包;TypeScript 类型仍需使用 import type 显式导入。

请求缓存组件

RequestSelectV2RequestCascaderRequestTreeSelectConfigTablePopoverTableSelectquery 模式基于 @moluoxixi/hooks 与 TanStack Vue Query。宿主应用需要提供唯一 QueryClient

import { QueryClient, VueQueryPlugin } from '@tanstack/vue-query'

app.use(VueQueryPlugin, {
  queryClient: new QueryClient(),
})

选项组件固定接收 query(params),并把 params 放进缓存 key。表格组件固定接收 query({ ...params, currentPage, pageSize }),并把 paramscurrentPagepageSize 放进缓存 key。

params 必须是稳定、可序列化的普通对象;不要传入函数、DOM、组件实例、循环引用或会在渲染期间频繁重建且语义不变的对象。