@giteeteam/apps-team-components 1.0.23 → 1.0.25

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.
@@ -7,15 +7,15 @@ import EmptyField from '../../common/EmptyField';
7
7
  import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip';
8
8
  import { fieldValueOverlayStyle } from '../../common/style/global';
9
9
  import { dataQuoteInit } from './utils';
10
- const DataQuoteReadView = ({ value, userData }) => {
10
+ const DataQuoteReadView = ({ value, userData, itemValues }) => {
11
11
  const [dataList, setDataList] = useState(null);
12
12
  const dataQuoteList = useRecoilValue(dataQuoteState);
13
13
  const currentDeleteItem = useRecoilValue(currentDeleteState);
14
14
  useEffect(() => {
15
15
  if (dataQuoteList) {
16
- setDataList(dataQuoteInit(dataQuoteList, value, userData === null || userData === void 0 ? void 0 : userData.display));
16
+ setDataList(dataQuoteInit(dataQuoteList, value, userData === null || userData === void 0 ? void 0 : userData.display, itemValues));
17
17
  }
18
- }, [dataQuoteList, userData === null || userData === void 0 ? void 0 : userData.display, value, currentDeleteItem]);
18
+ }, [dataQuoteList, userData === null || userData === void 0 ? void 0 : userData.display, value, currentDeleteItem, itemValues]);
19
19
  const cellDisplay = (dataList === null || dataList === void 0 ? void 0 : dataList.length) ? (dataList.map((item, index) => (_jsxs("span", { children: [item.label, " ", index === dataList.length - 1 ? '' : '、'] }, item.value)))) : (_jsx(EmptyField, { readonly: true }));
20
20
  return (_jsx("div", { css: css(fieldValueOverlayStyle), children: _jsx(BaseOverflowTooltip, { maxline: 1, children: cellDisplay }) }));
21
21
  };
@@ -1,3 +1,3 @@
1
1
  import { Item } from '../../../lib/types/models';
2
2
  import { selectValue as selectValueProps } from '../dropdown/BaseField';
3
- export declare const dataQuoteInit: (dates: Item[], value: string[], display?: string) => selectValueProps[];
3
+ export declare const dataQuoteInit: (dates: Item[], value: string[], display?: string, itemValues?: Record<string, any>) => selectValueProps[];
@@ -1,4 +1,4 @@
1
- export const dataQuoteInit = (dates, value, display) => {
1
+ export const dataQuoteInit = (dates, value, display, itemValues) => {
2
2
  const regex = /({\S+?})/g;
3
3
  const existedDatas = dates === null || dates === void 0 ? void 0 : dates.filter(data => value === null || value === void 0 ? void 0 : value.includes(data.objectId));
4
4
  const dataInit = existedDatas === null || existedDatas === void 0 ? void 0 : existedDatas.map(existedData => {
@@ -12,7 +12,7 @@ export const dataQuoteInit = (dates, value, display) => {
12
12
  label: display
13
13
  ? display.replace(regex, function (itemKey) {
14
14
  const key = itemKey.slice(1, itemKey.length - 1);
15
- return dataCopy[key];
15
+ return dataCopy[key] || (itemValues && itemValues[key]);
16
16
  })
17
17
  : existedData.name,
18
18
  value: existedData.objectId,
@@ -18,7 +18,7 @@ const PriorityReadView = memo(({ value, options, readonly, apply }) => {
18
18
  });
19
19
  }, []);
20
20
  const showData = useMemo(() => { var _a; return (_a = filterData(options, value)) === null || _a === void 0 ? void 0 : _a[0]; }, [filterData, options, value]);
21
- return (_jsx(_Fragment, { children: showData ? (_jsxs("div", { css: css(cellBoxStyle(antPrefix), headerCellStyle), 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')] })) }));
21
+ return (_jsx(_Fragment, { children: showData ? (_jsxs("div", { css: css(cellBoxStyle(antPrefix), isFromHeader && headerCellStyle), 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')] })) }));
22
22
  });
23
23
  PriorityReadView.displayName = 'PriorityReadView';
24
24
  export default PriorityReadView;
@@ -1,7 +1,7 @@
1
1
  export declare const cellBoxStyle: (antPrefix: string) => string;
2
2
  export declare const headerCellStyle = "\n max-width: 120px;\n height: 24px;\n padding: 0 8px;\n font-size: 12px;\n font-weight: 600;\n line-height: 24px;\n color: #213053;\n text-align: center;\n background-color: #f5f6f8;\n border-radius: 4px;\n";
3
3
  export declare const emptyTextStyle = "\n display: flex;\n align-items: center;\n width: 100%;\n height: 100%;\n";
4
- export declare const colorIconStyle = "\n margin-right: 5px;\n font-size: 10px;\n";
4
+ export declare const colorIconStyle = "\n margin-right: 5px;\n font-size: 12px;\n";
5
5
  export declare const emptyStyle = "\n color: #909aaa;\n";
6
6
  export declare const emptyIconStyle = "\n margin-right: 5px;\n font-size: 12px!important;\n width: 12px!important;\n margin-left: 0!important;\n";
7
7
  export declare const downIconStyle = "\n margin-left: 2px;\n\n svg {\n vertical-align: inherit;\n }\n";
@@ -38,7 +38,7 @@ export const emptyTextStyle = `
38
38
  `;
39
39
  export const colorIconStyle = `
40
40
  margin-right: 5px;
41
- font-size: 10px;
41
+ font-size: 12px;
42
42
  `;
43
43
  export const emptyStyle = `
44
44
  color: ${fieldLabelColor};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@giteeteam/apps-team-components",
3
- "version": "1.0.23",
3
+ "version": "1.0.25",
4
4
  "description": "Gitee team components",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",