@giteeteam/apps-team-components 1.9.0 → 1.9.2

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,6 +1,8 @@
1
1
  import { jsx } from '@emotion/react/jsx-runtime';
2
2
  import { memo } from 'react';
3
3
  import { ClassNames } from '@emotion/react';
4
+ import { useCreation } from 'ahooks';
5
+ import { getArrayValue } from '../../../lib/array.js';
4
6
  import EmptyField from '../../common/EmptyField.js';
5
7
  import { tooltipOverflowStyle, getTooltipMaxlineStyle } from '../../common/overflow-tooltip/style/index.js';
6
8
  import { useToWorkspacePage } from './hooks.js';
@@ -8,8 +10,9 @@ import { pointerStyle } from './style/index.js';
8
10
  import ValueDisplay from './ValueDisplay.js';
9
11
 
10
12
  const BindWorkspaceReadView = memo(props => {
11
- const { value, mode } = props;
13
+ const { value: _value, mode } = props;
12
14
  const { toWorkspacePage } = useToWorkspacePage();
15
+ const value = useCreation(getArrayValue(_value), [_value]);
13
16
  return (jsx(ClassNames, { children: ({ cx, css }) => {
14
17
  if (!(value === null || value === void 0 ? void 0 : value.length))
15
18
  return jsx(EmptyField, { readonly: true });
@@ -1,6 +1,7 @@
1
1
  import { jsx, jsxs } from '@emotion/react/jsx-runtime';
2
2
  import { memo, Fragment } from 'react';
3
3
  import OverflowTooltip from '../../common/overflow-tooltip/OverflowTooltip.js';
4
+ import { getArrayValue } from '../../../lib/array.js';
4
5
  import useI18n from '../../../lib/hooks/useI18n.js';
5
6
 
6
7
  const WorkspaceLabel = memo(props => {
@@ -10,7 +11,7 @@ const WorkspaceLabel = memo(props => {
10
11
  });
11
12
  const SingleValueDisplay = memo(({ value, onClick, wrapperClassName, itemClassName }) => {
12
13
  const { t } = useI18n();
13
- const [workspace] = value;
14
+ const [workspace] = getArrayValue(value);
14
15
  return (jsx(WorkspaceLabel, { title: t('pages.fields.default.toWorkspacePage'), onClick: onClick, className: `${wrapperClassName} ${itemClassName}`, workspace: workspace }));
15
16
  });
16
17
  const MultipleValueDisplay = memo(({ value, onClick, itemClassName }) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@giteeteam/apps-team-components",
3
- "version": "1.9.0",
3
+ "version": "1.9.2",
4
4
  "description": "Gitee team components",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",