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

com-serp-common-components

v0.1.1

Published

``` formJson: { inline: false, // 是否inline展示 labelPosition: "right", // 标题位置(左,右,居中) labelWidth: "", // 标题宽度 (可在单行上定义) statusIcon: true, formItemList: [ // 表单配置项 { type: "slot", slotName: "upload", label: "上传", // 中文名或标题 pro

Downloads

10

Readme

common-components

组件库内容

上传组件

-支持定义上传url

-附加参数

-支持断点续传和分片上传

-支持批量上传

-可定义上传类型及数量

自定义表单组件

-通过配置获取表单内容

formJson: {
	inline: false, // 是否inline展示
	labelPosition: "right", // 标题位置(左,右,居中)
	labelWidth: "", // 标题宽度 (可在单行上定义)
	statusIcon: true, 
	formItemList: [ // 表单配置项
		{
			type: "slot",
			slotName: "upload",
			label: "上传", // 中文名或标题
			prop: "upload", // 字段名
			value: "baidu.com" // 值
		}, {
			type: "select",
			label: "下拉框1", // 中文名或标题
			prop: "select1", // 字段名
			value: [], // 值
			clearable: true, // 可清空 true / false
			disabled: false, // 置灰 true / false
			readonly: false, // 只读 true / false
			search: true, // 搜索
			multiple: true, // 多选
			limit: 2, // 多选限制
			colaTags: true, // 是否折叠
			placeholder: "请选择下拉框1", // 暗文
			rules: [{ required: true, message: "不能为空", trigger: "change" }],
			requestBody: { // 发请求获取下拉数据(示例)
				request: "post", // 触发请求 post / get
				url: "/api/getSelectOptions",
				param: {
					a: 1,
					b: 2
				}
			},
			options: [], // 下拉数据
			defaultKey: { // 通过这个统一数据格式
				label: 'name',
				value: 'code'
			},
			extraName: 'selectName' // 额外需要传给后台的字段
		}, {
			type: "input",
			label: "输入框1", // 中文名或标题
			prop: "test1", // 字段名
			value: "", // 值
			subType: "text", // 输入框类型
			clearable: true, // 可清空 true / false
			disabled: false, // 置灰 true / false
			readonly: false, // 只读 true / false
			placeholder: "请输入内容1", // 暗文
			maxlength: 20, // 最大长度 number
			size: "", // 尺寸 medium / small / mini / ''
			prefix: "", // 内嵌式前文字
			suffix: "", // 内嵌式后文字
			prefixIcon: "el-icon-search", // 前图标
			suffixIcon: "", // 后图标
			prepend: "", // 前扩展
			append: "", // 后扩展
			rules: [ // 校验
				{
					validator: (rule, value, callback) => {
						setTimeout(() => {
							if (value && value.length) {
								if (value.length > 10) {
									callback(new Error("最多10个字符"));
								} else {
									callback();
								}
							} else {
								callback(new Error("不能为空"));
							}
						}, 100);
					},
					trigger: "blur"
				}
			]
		}, {
			type: "date",
			label: "日期", // 中文名或标题
			prop: "date", // 字段名
			value: "", // 值
			subType: "", // 输入框类型
			clearable: true, // 可清空 true / false
			disabled: false, // 置灰 true / false
			readonly: false, // 只读 true / false
			placeholder: "", // 暗文
			valueFormat: "yyyy-MM-DD", // 返回数据格式
			pickerOptions: [], // 可选时间
			rules: [{ required: true, message: "不能为空", trigger: "change" }]
		}, {
			type: "daterange",
			label: "日期时间", // 中文名或标题
			prop: "daterange", // 字段名
			value: "", // 值
			subType: "", // 输入框类型
			clearable: true, // 可清空 true / false
			disabled: false, // 置灰 true / false
			readonly: false, // 只读 true / false
			valueFormat: "yyyy-MM-DD", // 返回数据格式
			pickerOptions: [], // 可选时间
			placeholder: "", // 暗文
			rules: [{ required: true, message: "不能为空", trigger: "change" }]
		}, {
			type: "timerange",
			label: "时间段", // 中文名或标题
			prop: "timerange", // 字段名
			value: "", // 值
			subType: "", // 输入框类型
			clearable: true, // 可清空 true / false
			disabled: false, // 置灰 true / false
			readonly: false, // 只读 true / false
			valueFormat: "HH:mm:ss", // 返回数据格式
			pickerOptions: [], // 可选时间
			placeholder: "", // 暗文
			rules: [{ required: true, message: "不能为空", trigger: "change" }]
		}, {
			type: "checkbox",
			label: "多选", // 中文名或标题
			prop: "checkbox", // 字段名
			value: [], // 值
			// limit: 1, // 多选限制
			disabled: false, // 置灰 true / false
			requestBody: {
				request: "post", // 触发请求 post / get ...
				url: "/api/getCheckBoxOptions",
				param: {
					a: 1,
					b: 2
				}
			},
			options: [], // 数据
			defaultKey: { // 通过这个统一数据格式
				label: 'name',
				value: 'code'
			},
			rules: [{ required: true, message: "不能为空", trigger: "change" }]
		}, {
			type: "radio",
			label: "单选", // 中文名或标题
			prop: "radio", // 字段名
			value: "", // 值
			disabled: false, // 置灰 true / false
			requestBody: {
				request: "post", // 触发请求 post / get ...
				url: "/api/getRadioOptions",
				param: {
					a: 1,
					b: 2
				}
			},
			options: [], // 数据
			defaultKey: { // 通过这个统一数据格式
				label: 'name',
				value: 'code'
			},
			rules: [{ required: true, message: "不能为空", trigger: "change" }]
		}
	]
}

在项目中引用

"devDependencies": {
    "com-serp-common-components": "git+https://code.mlamp.cn/serp/common-components.git"
}

在开发过程中

为避免频繁修改导致需要频繁更新依赖

开发过程中使用npm link的方式进行开发

在执行npm link后,在项目目录下执行npm link com-serp-common-components即可

打包时会获取git上最新的包

所以请保证git上是稳定版本