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

mo-select-user

v1.0.0

Published

This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.3.0.

Downloads

5

Readme

MoSelectUser

This library was generated with Angular CLI version 13.3.0.

安装

npm i -S mo-select-user -registry https://registry.npmjs.org

修改 SharedModule

import { MoSelectUser } from 'mo-select-user';
const MODULES = [MoSelectUser]


@NgModule({
  exports: [
    ...MODULES,
  ]
})
export class SharedModule {}

全局定义接口 CommonService


  get userApiOptions() {
    return {
      url: '',// 用户列表接口
    };
  }

  get userAndDeptApiOptions() {
    return {
      url: '',// 用户列表接口
      departmentUrl: '' // 部门列表接口
    };
  }

使用

import { CommonService } from '@core';

export class SearchBarComponent {

  userApiOptions = this.commonSrv.userAndDeptApiOptions; // 接口地址

  constructor(private commonSrv: CommonService,) {}


  this.form = this.fb.group({
    owners: [{id:'id',lable:'label'}] // value必须是数组
  });

}
<mo-select-user
  [apiOptions]="userApiOptions"
  placeholder="请选择负责人"
  formControlName="owners"
></mo-select-user>

属性说明

  • apiOptions 接口地址,传入部门列表接口,自动显示部门筛选

  • mode 多选:multiple,单选:default,默认单选

  • queryOptions 用户列表默认的筛选条件

  • mValue 用户value的key值,不填写为:id

  • mLabel 用户名称的key值,默认:label

  • placeholder placeholder

  • size 尺寸,NzSelectSizeType

  • departmentId 默认选中的部门ID

  • switchDept 部门是否可以切换

  • disabled 是否禁用

  • allowClear 是否显示清空图标

  • moOnChange 值变化后回掉