@giteeteam/apps-team-components 1.0.7 → 1.0.9

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.
@@ -6,14 +6,12 @@ import EmptyField from '../../common/EmptyField';
6
6
  import { getTooltipMaxlineStyle, tooltipOverflowStyle } from '../../common/overflow-tooltip/style';
7
7
  import { useToWorkspacePage } from './hooks';
8
8
  import { pointerStyle } from './style';
9
- const defaultValue = [];
10
9
  const BindWorkspaceReadView = memo(props => {
11
10
  const { value } = props;
12
11
  const { t } = useI18n();
13
12
  const { toWorkspacePage } = useToWorkspacePage();
14
- const [, name, key] = value || defaultValue;
15
13
  return (_jsx(ClassNames, { children: ({ cx, css }) => {
16
- return name ? (_jsx("span", { className: cx(css(tooltipOverflowStyle), css(getTooltipMaxlineStyle(1)), css(pointerStyle)), title: t('pages.fields.default.toWorkspacePage'), onClick: () => toWorkspacePage(key), children: name })) : (_jsx(EmptyField, { readonly: true }));
14
+ return value ? (_jsx("span", { className: cx(css(tooltipOverflowStyle), css(getTooltipMaxlineStyle(1)), css(pointerStyle)), title: t('pages.fields.default.toWorkspacePage'), onClick: () => toWorkspacePage(value.key), children: value.name })) : (_jsx(EmptyField, { readonly: true }));
17
15
  } }));
18
16
  });
19
17
  BindWorkspaceReadView.displayName = 'BindWorkspaceReadView';
@@ -6,10 +6,14 @@ import { handleValue } from './BaseField';
6
6
  const DropdownReadView = memo(props => {
7
7
  const { value, options, readonly } = props;
8
8
  const showValue = useMemo(() => {
9
- if (!(options === null || options === void 0 ? void 0 : options.length))
10
- return '';
9
+ var _a;
11
10
  if (!(value === null || value === void 0 ? void 0 : value.length))
12
11
  return '';
12
+ if ((_a = value[0]) === null || _a === void 0 ? void 0 : _a.label) {
13
+ return value.map(item => item.label).join(',');
14
+ }
15
+ if (!(options === null || options === void 0 ? void 0 : options.length))
16
+ return '';
13
17
  const result = value
14
18
  .map(item => { var _a; return (item === null || item === void 0 ? void 0 : item.label) || ((_a = options.find(opt => opt.value === handleValue(item))) === null || _a === void 0 ? void 0 : _a.label); })
15
19
  .filter(Boolean)
@@ -1,18 +1,24 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
2
2
  import { memo, useCallback, useMemo } from 'react';
3
+ import { CaretDownOutlined } from '@ant-design/icons';
3
4
  import { css } from '@emotion/react';
4
- import { HollowCircleIcon } from '../../../icons';
5
+ import { DottedCircleIcon, HollowCircleIcon } from '../../../icons';
6
+ import useAntdConfig from '../../../lib/hooks/useAntdConfig';
7
+ import useI18n from '../../../lib/hooks/useI18n';
5
8
  import EmptyField from '../../common/EmptyField';
6
9
  import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip';
7
- import { cellBoxStyle, colorIconStyle, emptyTextStyle } from './style';
8
- const PriorityReadView = memo(({ value, options, readonly }) => {
10
+ import { cellBoxStyle, colorIconStyle, downIconStyle, emptyIconStyle, emptyStyle, emptyTextStyle } from './style';
11
+ const PriorityReadView = memo(({ value, options, readonly, apply }) => {
12
+ const { t } = useI18n();
13
+ const { antPrefix } = useAntdConfig();
14
+ const isFromHeader = useMemo(() => apply === 'header', [apply]);
9
15
  const filterData = useCallback((list, id) => {
10
16
  return list === null || list === void 0 ? void 0 : list.filter(v => {
11
17
  return v.key === id;
12
18
  });
13
19
  }, []);
14
20
  const showData = useMemo(() => { var _a; return (_a = filterData(options, value)) === null || _a === void 0 ? void 0 : _a[0]; }, [filterData, options, value]);
15
- return (_jsx(_Fragment, { children: showData ? (_jsxs("div", { css: css(cellBoxStyle), children: [_jsx(HollowCircleIcon, { css: css(colorIconStyle), style: { color: showData.color } }), _jsx(BaseOverflowTooltip, { title: showData.name, children: showData.name })] })) : (_jsx("div", { css: css(emptyTextStyle), children: _jsx(EmptyField, { readonly: readonly }) })) }));
21
+ return (_jsx(_Fragment, { children: showData ? (_jsxs("div", { css: css(cellBoxStyle(antPrefix)), children: [_jsx(HollowCircleIcon, { css: css(colorIconStyle), style: { color: showData.color } }), _jsx(BaseOverflowTooltip, { title: showData.name, children: showData.name }), isFromHeader && _jsx(CaretDownOutlined, { css: css(downIconStyle) })] })) : !isFromHeader ? (_jsx("div", { css: css(emptyTextStyle), children: _jsx(EmptyField, { readonly: readonly }) })) : (_jsxs("div", { css: css(emptyStyle), children: [_jsx(DottedCircleIcon, { css: css(emptyIconStyle) }), t('pages.fields.view.noPriority')] })) }));
16
22
  });
17
23
  PriorityReadView.displayName = 'PriorityReadView';
18
24
  export default PriorityReadView;
@@ -1,3 +1,6 @@
1
- export declare const cellBoxStyle = "\n display: flex;\n align-items: center;\n line-height: unset;\n\n .ant-dropdown-menu-title-content {\n display: flex;\n align-items: center;\n max-width: 150px;\n\n .anticon {\n flex-shrink: 0;\n }\n\n & > span {\n white-space: pre-line;\n }\n }\n";
1
+ export declare const cellBoxStyle: (antPrefix: string) => string;
2
2
  export declare const emptyTextStyle = "\n display: flex;\n align-items: center;\n width: 100%;\n height: 100%;\n";
3
3
  export declare const colorIconStyle = "\n margin-right: 5px;\n font-size: 12px;\n";
4
+ export declare const emptyStyle = "\n color: #909aaa;\n";
5
+ export declare const emptyIconStyle = "\n margin-right: 5px;\n font-size: 12px;\n";
6
+ export declare const downIconStyle = "\n margin-left: 2px;\n\n svg {\n vertical-align: inherit;\n }\n";
@@ -1,9 +1,10 @@
1
- export const cellBoxStyle = `
1
+ import { fieldLabelColor } from '../../../../style/common';
2
+ export const cellBoxStyle = (antPrefix) => `
2
3
  display: flex;
3
4
  align-items: center;
4
5
  line-height: unset;
5
6
 
6
- .ant-dropdown-menu-title-content {
7
+ .${antPrefix}-dropdown-menu-title-content {
7
8
  display: flex;
8
9
  align-items: center;
9
10
  max-width: 150px;
@@ -27,3 +28,17 @@ export const colorIconStyle = `
27
28
  margin-right: 5px;
28
29
  font-size: 12px;
29
30
  `;
31
+ export const emptyStyle = `
32
+ color: ${fieldLabelColor};
33
+ `;
34
+ export const emptyIconStyle = `
35
+ margin-right: 5px;
36
+ font-size: 12px;
37
+ `;
38
+ export const downIconStyle = `
39
+ margin-left: 2px;
40
+
41
+ svg {
42
+ vertical-align: inherit;
43
+ }
44
+ `;
@@ -110,6 +110,8 @@ const TransitionPanel = ({ itemId, itemType, workspace, objectId, onTransitionSu
110
110
  transition: transitionText,
111
111
  itemId,
112
112
  name: itemDetail === null || itemDetail === void 0 ? void 0 : itemDetail.name,
113
+ reporter: itemDetail === null || itemDetail === void 0 ? void 0 : itemDetail.reporter,
114
+ securityLevel: itemDetail === null || itemDetail === void 0 ? void 0 : itemDetail.securityLevel,
113
115
  values: itemDetail === null || itemDetail === void 0 ? void 0 : itemDetail.values,
114
116
  };
115
117
  try {
@@ -1,8 +1,9 @@
1
- import React from 'react';
2
- export interface WorkSpaceReadViewProps {
1
+ /// <reference types="react" />
2
+ export interface WorkspaceReadViewProps {
3
3
  value?: {
4
4
  name?: string;
5
+ key?: string;
5
6
  };
6
7
  }
7
- declare const WorkspaceReadView: React.FC<WorkSpaceReadViewProps>;
8
+ declare const WorkspaceReadView: import("react").NamedExoticComponent<WorkspaceReadViewProps>;
8
9
  export default WorkspaceReadView;
@@ -1,9 +1,16 @@
1
1
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
2
  import { memo } from 'react';
3
+ import { ClassNames } from '@emotion/react';
3
4
  import EmptyField from '../../common/EmptyField';
4
- import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip';
5
+ import { getTooltipMaxlineStyle, tooltipOverflowStyle } from '../../common/overflow-tooltip/style';
6
+ import { useToWorkspacePage } from '../bind-workspace/hooks';
7
+ import { pointerStyle } from '../bind-workspace/style';
5
8
  const WorkspaceReadView = memo(({ value }) => {
6
- return (value === null || value === void 0 ? void 0 : value.name) ? (_jsx(BaseOverflowTooltip, { title: value === null || value === void 0 ? void 0 : value.name, children: value === null || value === void 0 ? void 0 : value.name })) : (_jsx(EmptyField, { readonly: true }));
9
+ const { name, key } = value || {};
10
+ const { toWorkspacePage } = useToWorkspacePage();
11
+ return (_jsx(ClassNames, { children: ({ cx, css }) => {
12
+ return name ? (_jsx("span", { className: cx(css(tooltipOverflowStyle), css(getTooltipMaxlineStyle(1)), css(pointerStyle)), title: name, onClick: () => toWorkspacePage(key), children: name })) : (_jsx(EmptyField, { readonly: true }));
13
+ } }));
7
14
  });
8
15
  WorkspaceReadView.displayName = 'WorkspaceReadView';
9
16
  export default WorkspaceReadView;
@@ -5,3 +5,4 @@ export interface IconProps {
5
5
  }
6
6
  export declare const HollowCircleIcon: React.FC<IconProps>;
7
7
  export declare const WorkflowIcon: React.FC<IconProps>;
8
+ export declare const DottedCircleIcon: React.FC<IconProps>;
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
2
  import AntdIcon from '@ant-design/icons';
3
+ import DottedCircle from './svg/DottedCircle.svg';
3
4
  import HollowCircle from './svg/HollowCircle.svg';
4
5
  import Workflow from './svg/Workflow.svg';
5
6
  export const HollowCircleIcon = props => {
@@ -8,3 +9,6 @@ export const HollowCircleIcon = props => {
8
9
  export const WorkflowIcon = props => {
9
10
  return _jsx(AntdIcon, { ...props, style: { fontSize: 10, width: 10, marginLeft: 2 }, component: Workflow });
10
11
  };
12
+ export const DottedCircleIcon = props => {
13
+ return _jsx(AntdIcon, { ...props, style: { fontSize: 10, width: 10, marginLeft: 2 }, component: DottedCircle });
14
+ };
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <svg t="1702526505381" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
3
+ p-id="14633" xmlns:xlink="http://www.w3.org/1999/xlink">
4
+ <path
5
+ d="M681.919574 995.136018l-33.919979-96.63994a408.447745 408.447745 0 0 1-130.239919 23.039986l-6.911995 0.064h-4.159998l-1.279999 102.399936H511.99968c59.519963 0 116.735927-10.175994 169.919894-28.863982zM243.839848 821.632126l-67.071958 77.375952a511.74368 511.74368 0 0 0 153.151904 91.647943l36.479977-95.67994a409.343744 409.343744 0 0 1-122.559923-73.343955z m709.503556-49.919968l-88.191945-52.031968a412.159742 412.159742 0 0 1-92.927942 108.671932l65.15196 78.975951a514.559678 514.559678 0 0 0 115.967927-135.679915zM107.391933 576.00028l-101.183937 15.87199c9.471994 60.415962 29.439982 117.311927 58.111964 168.767895l89.471944-49.855969a406.079746 406.079746 0 0 1-46.399971-134.783916zM1023.99936 512.00032c0-29.439982-2.495998-58.239964-7.231995-86.207946l-100.927937 17.087989a412.991742 412.991742 0 0 1-0.896 143.359911l100.735937 18.303988c5.439997-30.015981 8.319995-60.927962 8.319995-92.543942zM74.175954 246.400486a508.799682 508.799682 0 0 0-64.63996 166.399896l100.543937 19.775988a406.399746 406.399746 0 0 1 51.583968-132.927917L74.239954 246.400486z m882.303448 11.327993a514.431678 514.431678 0 0 0-114.303928-137.087914l-66.111959 78.271951a412.031742 412.031742 0 0 1 91.583943 109.759931l88.831944-50.943968z m-607.99962-231.039856A510.975681 510.975681 0 0 0 191.99988 112.38457l63.99996 79.87195a408.575745 408.575745 0 0 1 125.247922-68.543957L348.543782 26.688623zM511.99968 0.00064v102.399936c48.63997 0 95.99994 8.447995 140.607912 24.767985l35.199978-96.19194A511.039681 511.039681 0 0 0 511.99968 0.00064z"
6
+ p-id="14634"></path>
7
+ </svg>
@@ -36,6 +36,7 @@ export declare const en: {
36
36
  'libs.default.tipText': string;
37
37
  'libs.default.flowTextTip.0': string;
38
38
  'libs.default.flowTextTip.1': string;
39
+ 'pages.fields.view.noPriority': string;
39
40
  };
40
41
  export declare const zh: {
41
42
  'pages.users.default.delete': string;
@@ -75,6 +76,7 @@ export declare const zh: {
75
76
  'libs.default.tipText': string;
76
77
  'libs.default.flowTextTip.0': string;
77
78
  'libs.default.flowTextTip.1': string;
79
+ 'pages.fields.view.noPriority': string;
78
80
  };
79
81
  export declare const ru: {
80
82
  'pages.users.default.delete': string;
@@ -114,4 +116,5 @@ export declare const ru: {
114
116
  'libs.default.tipText': string;
115
117
  'libs.default.flowTextTip.0': string;
116
118
  'libs.default.flowTextTip.1': string;
119
+ 'pages.fields.view.noPriority': string;
117
120
  };
@@ -36,6 +36,7 @@ export const en = {
36
36
  'libs.default.tipText': 'This process allows only {{text}}, please contact support',
37
37
  'libs.default.flowTextTip.0': 'The issue field [{{field}}] should be [{{condition}}] specified field [{{target}}]',
38
38
  'libs.default.flowTextTip.1': 'The issue field [{{field}}] should be [{{condition}}]',
39
+ 'pages.fields.view.noPriority': 'No priority',
39
40
  };
40
41
  export const zh = {
41
42
  'pages.users.default.delete': '(已删除)',
@@ -75,6 +76,7 @@ export const zh = {
75
76
  'libs.default.tipText': '此流程只有{{text}}可以进行操作,请联系相关人员处理',
76
77
  'libs.default.flowTextTip.0': '当前事项字段[{{field}}]应该[{{condition}}]指定条件值[{{target}}]',
77
78
  'libs.default.flowTextTip.1': '当前事项字段[{{field}}]应该[{{condition}}]',
79
+ 'pages.fields.view.noPriority': '无优先级',
78
80
  };
79
81
  export const ru = {
80
82
  'pages.users.default.delete': '(удалено)',
@@ -114,4 +116,5 @@ export const ru = {
114
116
  'libs.default.tipText': 'В этом процессе можно использовать только "{{text}}". Пожалуйста, свяжитесь с администратором.',
115
117
  'libs.default.flowTextTip.0': `Поле задачи "{{field}}" должно при условии "{{condition}}" указывать значение условия "{{target}}"`,
116
118
  'libs.default.flowTextTip.1': `Поле задачи "{{field}}" должно при условии "{{condition}}"`,
119
+ 'pages.fields.view.noPriority': 'Нет приоритета',
117
120
  };
package/package.json CHANGED
@@ -1,18 +1,28 @@
1
1
  {
2
2
  "name": "@giteeteam/apps-team-components",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
7
7
  "scripts": {
8
+ "prepare": "husky install",
8
9
  "build": "rm -rf dist && tsc && cp -r src/icons/svg dist/icons/svg",
9
10
  "publish:alpha": "pnpm prepublish && npm publish --tag alpha",
10
11
  "prepack": "pnpm build",
11
- "prepublish": "pnpm build"
12
+ "prepublish": "pnpm build",
13
+ "lint": "eslint . --ext ts --ext tsx --ext js --ext json",
14
+ "pre-commit": "lint-staged",
15
+ "husky": "husky"
12
16
  },
13
17
  "files": [
14
18
  "dist"
15
19
  ],
20
+ "lint-staged": {
21
+ "*.@(js|ts|tsx|json)": [
22
+ "prettier --write",
23
+ "pnpm lint --fix --quiet"
24
+ ]
25
+ },
16
26
  "publishConfig": {
17
27
  "conventionalCommits": true,
18
28
  "access": "public",
@@ -27,12 +37,15 @@
27
37
  "@types/react-dom": "^18.2.14",
28
38
  "@typescript-eslint/eslint-plugin": "^6.4.1",
29
39
  "@typescript-eslint/parser": "^6.4.1",
40
+ "eslint": "^8.55.0",
30
41
  "eslint-config-prettier": "^9.0.0",
31
42
  "eslint-plugin-import": "^2.28.1",
32
43
  "eslint-plugin-prettier": "^5.0.0",
33
44
  "eslint-plugin-react": "^7.33.2",
34
45
  "eslint-plugin-react-hooks": "^4.6.0",
35
46
  "eslint-plugin-simple-import-sort": "^10.0.0",
47
+ "husky": "^8.0.3",
48
+ "lint-staged": "^15.2.0",
36
49
  "prettier": "^3.0.3",
37
50
  "typescript": "^5.2.2"
38
51
  },