@blueking/bk-user-selector 0.0.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/package.json +71 -0
- package/typings/index.vue.d.ts +22 -0
- package/typings/single.vue.d.ts +12 -0
- package/typings/utils/index.d.ts +59 -0
- package/typings/utils/jsonp.d.ts +4 -0
- package/typings/utils/lang.d.ts +3 -0
- package/typings/utils/service.d.ts +36 -0
- package/typings/vue2.d.ts +2 -0
- package/typings/vue3.d.ts +3 -0
- package/vue2/config.json +1 -0
- package/vue2/index.es.min.js +40385 -0
- package/vue2/index.iife.min.js +49864 -0
- package/vue2/index.umd.min.js +40407 -0
- package/vue2/vue2.css +3168 -0
- package/vue3/config.json +1 -0
- package/vue3/index.es.min.js +7433 -0
- package/vue3/index.iife.min.js +40366 -0
- package/vue3/index.umd.min.js +7438 -0
- package/vue3/vue3.css +219 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
### 人员选择器
|
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@blueking/bk-user-selector",
|
|
3
|
+
"version": "0.0.1-beta.1",
|
|
4
|
+
"description": "蓝鲸用户选择器",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Tencent BlueKing",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"prepublishOnly": "run-p build dts",
|
|
9
|
+
"dev": "vite --mode development -c scripts/vite.dev.ts",
|
|
10
|
+
"build": "tsx ./scripts/vite.build.ts",
|
|
11
|
+
"dts": "vue-tsc --project tsconfig.dts.json",
|
|
12
|
+
"prettier": "prettier ./src ./scripts ./playground --write",
|
|
13
|
+
"visualize": "vite-bundle-visualizer -c scripts/vite.vusualizer.ts"
|
|
14
|
+
},
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./typings/vue3.d.ts",
|
|
18
|
+
"import": "./vue3/index.es.min.js",
|
|
19
|
+
"default": "./vue3/index.es.min.js"
|
|
20
|
+
},
|
|
21
|
+
"./vue3": {
|
|
22
|
+
"types": "./typings/vue3.d.ts",
|
|
23
|
+
"import": "./vue3/index.es.min.js",
|
|
24
|
+
"default": "./vue3/index.es.min.js"
|
|
25
|
+
},
|
|
26
|
+
"./vue2": {
|
|
27
|
+
"types": "./typings/vue2.d.ts",
|
|
28
|
+
"import": "./vue2/index.es.min.js",
|
|
29
|
+
"default": "./vue2/index.es.min.js"
|
|
30
|
+
},
|
|
31
|
+
"./vue3/*": "./vue3/*",
|
|
32
|
+
"./vue2/*": "./vue2/*"
|
|
33
|
+
},
|
|
34
|
+
"typesVersions": {
|
|
35
|
+
"*": {
|
|
36
|
+
".": [
|
|
37
|
+
"./typings/vue3.d.ts"
|
|
38
|
+
],
|
|
39
|
+
"vue3": [
|
|
40
|
+
"./typings/vue3.d.ts"
|
|
41
|
+
],
|
|
42
|
+
"vue2": [
|
|
43
|
+
"./typings/vue2.d.ts"
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"types": "./typings/vue3.d.ts",
|
|
48
|
+
"module": "./vue3/index.es.min.js",
|
|
49
|
+
"unpkg": "./vue3/index.es.min.js",
|
|
50
|
+
"files": [
|
|
51
|
+
"vue2",
|
|
52
|
+
"vue3",
|
|
53
|
+
"typings"
|
|
54
|
+
],
|
|
55
|
+
"publishConfig": {
|
|
56
|
+
"access": "public",
|
|
57
|
+
"registry": "https://registry.npmjs.org/"
|
|
58
|
+
},
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"lodash": "^4.17.21",
|
|
61
|
+
"vuedraggable": "^4.1.0"
|
|
62
|
+
},
|
|
63
|
+
"peerDependencies": {
|
|
64
|
+
"@blueking/bkui-library": "^0.0.0-beta.4",
|
|
65
|
+
"vue": "^3",
|
|
66
|
+
"vuedraggable": "^4.1.0"
|
|
67
|
+
},
|
|
68
|
+
"engines": {
|
|
69
|
+
"node": ">=18.16.0"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
+
$emit: (event: "update:modelValue" | "change", ...args: any[]) => void;
|
|
3
|
+
label: string;
|
|
4
|
+
required: boolean;
|
|
5
|
+
placeholder: string;
|
|
6
|
+
modelValue: string | unknown[];
|
|
7
|
+
draggable: boolean;
|
|
8
|
+
multiple: boolean;
|
|
9
|
+
apiBaseUrl: string;
|
|
10
|
+
tenantId: string;
|
|
11
|
+
$props: {
|
|
12
|
+
readonly label?: string | undefined;
|
|
13
|
+
readonly required?: boolean | undefined;
|
|
14
|
+
readonly placeholder?: string | undefined;
|
|
15
|
+
readonly modelValue?: string | unknown[] | undefined;
|
|
16
|
+
readonly draggable?: boolean | undefined;
|
|
17
|
+
readonly multiple?: boolean | undefined;
|
|
18
|
+
readonly apiBaseUrl?: string | undefined;
|
|
19
|
+
readonly tenantId?: string | undefined;
|
|
20
|
+
};
|
|
21
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
+
$emit: (event: "update:modelValue" | "change", ...args: any[]) => void;
|
|
3
|
+
modelValue: string;
|
|
4
|
+
apiBaseUrl: string;
|
|
5
|
+
tenantId: string;
|
|
6
|
+
$props: {
|
|
7
|
+
readonly modelValue?: string | undefined;
|
|
8
|
+
readonly apiBaseUrl?: string | undefined;
|
|
9
|
+
readonly tenantId?: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export interface IDept {
|
|
2
|
+
id: number | string;
|
|
3
|
+
name: string;
|
|
4
|
+
full_name: string;
|
|
5
|
+
has_children?: boolean;
|
|
6
|
+
parent?: number | string;
|
|
7
|
+
children?: IDept[];
|
|
8
|
+
order?: number;
|
|
9
|
+
extras?: {
|
|
10
|
+
code: string;
|
|
11
|
+
};
|
|
12
|
+
enabled?: boolean;
|
|
13
|
+
ancestors?: {
|
|
14
|
+
id: number | string;
|
|
15
|
+
name: string;
|
|
16
|
+
full_name: string;
|
|
17
|
+
has_children?: boolean;
|
|
18
|
+
children?: IDept[];
|
|
19
|
+
}[];
|
|
20
|
+
code?: string;
|
|
21
|
+
level?: number;
|
|
22
|
+
async?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare const enum LookupFieldEnum {
|
|
25
|
+
ID = "id",
|
|
26
|
+
LEVEL = "level",
|
|
27
|
+
NAME = "name",
|
|
28
|
+
PARENT = "parent"
|
|
29
|
+
}
|
|
30
|
+
export interface IAPIParams {
|
|
31
|
+
lookup_field: Lowercase<keyof typeof LookupFieldEnum>;
|
|
32
|
+
exact_lookups?: number | string;
|
|
33
|
+
no_page?: boolean;
|
|
34
|
+
fuzzy_lookups?: string;
|
|
35
|
+
with_ancestors?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface IAPIResponse {
|
|
38
|
+
code: number;
|
|
39
|
+
data: IDept[];
|
|
40
|
+
message: string;
|
|
41
|
+
result?: boolean;
|
|
42
|
+
request_id?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface ITreeNode {
|
|
45
|
+
ids: IDept['id'][];
|
|
46
|
+
map: IDept;
|
|
47
|
+
remove?: boolean;
|
|
48
|
+
}
|
|
49
|
+
export interface IOrgSelectorProps {
|
|
50
|
+
modelValue: number | number[] | string | string[];
|
|
51
|
+
dataUrl: string;
|
|
52
|
+
multiple?: boolean;
|
|
53
|
+
disabled?: boolean;
|
|
54
|
+
showOnInit?: boolean;
|
|
55
|
+
dropdownMaxHeight?: number;
|
|
56
|
+
autoExpandTags?: boolean;
|
|
57
|
+
placeholder?: string;
|
|
58
|
+
searchPlaceholder?: string;
|
|
59
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type IOrgSelectorProps, type IAPIParams, type IDept, LookupFieldEnum } from './index';
|
|
2
|
+
declare const _default: (props: IOrgSelectorProps) => {
|
|
3
|
+
level0Params: () => {
|
|
4
|
+
no_page: boolean;
|
|
5
|
+
lookup_field: LookupFieldEnum;
|
|
6
|
+
exact_lookups: number;
|
|
7
|
+
};
|
|
8
|
+
searchParams: (keyword: string) => {
|
|
9
|
+
no_page: boolean;
|
|
10
|
+
lookup_field: LookupFieldEnum;
|
|
11
|
+
fuzzy_lookups: string;
|
|
12
|
+
with_ancestors: boolean;
|
|
13
|
+
};
|
|
14
|
+
expandParentParams: (id: IDept["id"]) => {
|
|
15
|
+
no_page: boolean;
|
|
16
|
+
lookup_field: LookupFieldEnum;
|
|
17
|
+
exact_lookups: string | number;
|
|
18
|
+
with_ancestors: boolean;
|
|
19
|
+
};
|
|
20
|
+
defaultValueParams: (values: IDept["id"][]) => {
|
|
21
|
+
no_page: boolean;
|
|
22
|
+
lookup_field: LookupFieldEnum;
|
|
23
|
+
exact_lookups: string;
|
|
24
|
+
with_ancestors: boolean;
|
|
25
|
+
};
|
|
26
|
+
getCheckedFullTreeData: (checkedTreeData: IDept[]) => Promise<IDept[]>;
|
|
27
|
+
getTreeSearchData: (data: IDept[]) => IDept[];
|
|
28
|
+
fetchData: (params: IAPIParams) => Promise<IDept[]>;
|
|
29
|
+
loading: {
|
|
30
|
+
level0: boolean;
|
|
31
|
+
expandParent: boolean;
|
|
32
|
+
defaultValue: boolean;
|
|
33
|
+
search: boolean;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export default _default;
|
package/vue2/config.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"bk-user-selector","name":"bk-user-selector","displayName":"人员选择器","framework":"vue2","styles":[],"props":{"modelValue":{"type":["number","string"],"tips":"值"},"dataUrl":{"type":"string","tips":"数据源接口"}},"events":[],"slots":{}}
|