@giteeteam/apps-team-components 1.0.38 → 1.0.39

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.
@@ -1,2 +1,4 @@
1
1
  import type { RepoFile } from './types';
2
+ export declare const getFullName: (value: RepoFile) => string;
2
3
  export declare const formatDisplayValue: (value: RepoFile | RepoFile[]) => string;
4
+ export declare const getFullPath: (value: RepoFile) => string;
@@ -1,4 +1,18 @@
1
+ export const getFullName = (value) => {
2
+ const fullPath = getFullPath(value);
3
+ if (!fullPath)
4
+ return value === null || value === void 0 ? void 0 : value.name;
5
+ return `${fullPath}/${value === null || value === void 0 ? void 0 : value.name}`;
6
+ };
1
7
  export const formatDisplayValue = (value) => {
2
- const values = (Array.isArray(value) ? value : [value]).map(item => item === null || item === void 0 ? void 0 : item.name).filter(Boolean);
8
+ const values = (Array.isArray(value) ? value : [value]).map(item => getFullName(item)).filter(Boolean);
3
9
  return values.join('、');
4
10
  };
11
+ export const getFullPath = (value) => {
12
+ const { repo, path } = value || {};
13
+ let fullPath = repo;
14
+ if (path) {
15
+ fullPath += '/' + path;
16
+ }
17
+ return fullPath;
18
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@giteeteam/apps-team-components",
3
- "version": "1.0.38",
3
+ "version": "1.0.39",
4
4
  "description": "Gitee team components",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",