@giteeteam/apps-team-components 1.11.5-alpha.1 → 1.11.5

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.
@@ -9,7 +9,7 @@ import useI18n from '../../../lib/hooks/useI18n.js';
9
9
  import EmptyField from '../../common/EmptyField.js';
10
10
  import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip.js';
11
11
  import { getPopupContainerFun } from '../../common/utils.js';
12
- import { menuBoxStyle, cellBoxStyle, checkedStyle, colorIconStyle, emptyTipStyle, dropdownStyle, cellWrapperStyle, headerCellStyle, downIconStyle, emptyTextStyle, emptyStyle, emptyIconStyle } from './style/index.js';
12
+ import { menuBoxStyle, cellBoxStyle, checkedStyle, colorIconStyle, emptyTipStyle, dropdownStyle, headerCellStyle, downIconStyle, emptyTextStyle, emptyStyle, emptyIconStyle } from './style/index.js';
13
13
 
14
14
  const filterData = (list, id) => {
15
15
  return list === null || list === void 0 ? void 0 : list.filter(v => {
@@ -51,7 +51,7 @@ const PriorityCell = props => {
51
51
  if (readonly)
52
52
  return;
53
53
  setVisible(flag);
54
- }, open: visible, getPopupContainer: triggerNode => getPopupContainerFun(getPopupContainer, triggerNode, apply, page), children: jsx("div", { css: css(cellWrapperStyle), 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')] })) }) })) }));
54
+ }, open: visible, getPopupContainer: triggerNode => getPopupContainerFun(getPopupContainer, triggerNode, apply, page), 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')] })) })) }));
55
55
  };
56
56
  PriorityCell.displayName = 'ActionPriorityCell';
57
57
 
@@ -11,4 +11,3 @@ export declare const iconStyle = "\n padding-left: 3px;\n color: var(--theme-t
11
11
  export declare const spinStyle = "\n width: 150px;\n height: 50px;\n line-height: 60px;\n";
12
12
  export declare const menuBoxStyle = "\n max-height: 300px;\n overflow: auto;\n";
13
13
  export declare const dropdownStyle = "\n background: var(--color-gray-1, #FFFFFF);\n\n .menu-box {\n max-height: 300px;\n overflow: auto;\n }\n";
14
- export declare const cellWrapperStyle = "\n cursor: pointer;\n";
@@ -85,8 +85,5 @@ const dropdownStyle = `
85
85
  overflow: auto;
86
86
  }
87
87
  `;
88
- const cellWrapperStyle = `
89
- cursor: pointer;
90
- `;
91
88
 
92
- export { cellBoxStyle, cellWrapperStyle, checkedStyle, colorIconStyle, downIconStyle, dropdownStyle, emptyIconStyle, emptyStyle, emptyTextStyle, emptyTipStyle, headerCellStyle, iconStyle, menuBoxStyle, spinStyle };
89
+ export { cellBoxStyle, checkedStyle, colorIconStyle, downIconStyle, dropdownStyle, emptyIconStyle, emptyStyle, emptyTextStyle, emptyTipStyle, headerCellStyle, iconStyle, menuBoxStyle, spinStyle };
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from '@emotion/react/jsx-runtime';
2
- import { createContext } from 'react';
2
+ import { createContext, useMemo } from 'react';
3
3
  import { Global, css } from '@emotion/react';
4
4
  import { fieldCellGlobalStyle } from '../../components/table-components/style/index.js';
5
5
 
@@ -7,10 +7,11 @@ const defaultContext = {};
7
7
  const defaultAntPrefix = 'ant';
8
8
  const AntdConfigContext = createContext(defaultContext);
9
9
  const AntdConfigProvider = ({ getPopupContainer, antPrefix = defaultAntPrefix, children, }) => {
10
- return (jsxs(AntdConfigContext.Provider, { value: {
11
- getPopupContainer,
12
- antPrefix,
13
- }, children: [jsx(Global, { styles: css(fieldCellGlobalStyle) }), children] }));
10
+ const value = useMemo(() => ({
11
+ getPopupContainer,
12
+ antPrefix,
13
+ }), [getPopupContainer, antPrefix]);
14
+ return (jsxs(AntdConfigContext.Provider, { value: value, children: [jsx(Global, { styles: css(fieldCellGlobalStyle) }), children] }));
14
15
  };
15
16
 
16
17
  export { AntdConfigContext, AntdConfigProvider };
@@ -1,12 +1,13 @@
1
1
  import { jsx } from '@emotion/react/jsx-runtime';
2
- import { createContext } from 'react';
2
+ import { createContext, useMemo } from 'react';
3
3
 
4
4
  const defaultContext = {};
5
5
  const CurrentUserContext = createContext(defaultContext);
6
6
  const CurrentUserProvider = ({ currentUser, children }) => {
7
- return (jsx(CurrentUserContext.Provider, { value: {
8
- currentUser,
9
- }, children: children }));
7
+ const value = useMemo(() => ({
8
+ currentUser,
9
+ }), [currentUser]);
10
+ return jsx(CurrentUserContext.Provider, { value: value, children: children });
10
11
  };
11
12
 
12
13
  export { CurrentUserContext, CurrentUserProvider };
@@ -1,12 +1,13 @@
1
1
  import { jsx } from '@emotion/react/jsx-runtime';
2
- import { createContext } from 'react';
2
+ import { createContext, useMemo } from 'react';
3
3
 
4
4
  const defaultContext = {};
5
5
  const CurrentWorkspaceContext = createContext(defaultContext);
6
6
  const CurrentWorkspaceProvider = ({ workspaceKey, children }) => {
7
- return (jsx(CurrentWorkspaceContext.Provider, { value: {
8
- workspaceKey,
9
- }, children: children }));
7
+ const value = useMemo(() => ({
8
+ workspaceKey,
9
+ }), [workspaceKey]);
10
+ return jsx(CurrentWorkspaceContext.Provider, { value: value, children: children });
10
11
  };
11
12
 
12
13
  export { CurrentWorkspaceContext, CurrentWorkspaceProvider };
@@ -1,12 +1,13 @@
1
1
  import { jsx } from '@emotion/react/jsx-runtime';
2
- import { createContext } from 'react';
2
+ import { createContext, useMemo } from 'react';
3
3
 
4
4
  const defaultContext = {};
5
5
  const DatetimeFormatContext = createContext(defaultContext);
6
6
  const DatetimeFormatProvider = ({ datetimeFormat, children }) => {
7
- return (jsx(DatetimeFormatContext.Provider, { value: {
8
- datetimeFormat,
9
- }, children: children }));
7
+ const value = useMemo(() => ({
8
+ datetimeFormat,
9
+ }), [datetimeFormat]);
10
+ return jsx(DatetimeFormatContext.Provider, { value: value, children: children });
10
11
  };
11
12
 
12
13
  export { DatetimeFormatContext, DatetimeFormatProvider };
@@ -1,12 +1,13 @@
1
1
  import { jsx } from '@emotion/react/jsx-runtime';
2
- import { createContext } from 'react';
2
+ import { createContext, useMemo } from 'react';
3
3
 
4
4
  const defaultContext = {};
5
5
  const ItemConfigContext = createContext(defaultContext);
6
6
  const ItemConfigProvider = ({ item, children }) => {
7
- return (jsx(ItemConfigContext.Provider, { value: {
8
- item,
9
- }, children: children }));
7
+ const value = useMemo(() => ({
8
+ item,
9
+ }), [item]);
10
+ return jsx(ItemConfigContext.Provider, { value: value, children: children });
10
11
  };
11
12
 
12
13
  export { ItemConfigContext, ItemConfigProvider };
@@ -19,12 +19,13 @@ const TeamConfigProvider = ({ teamGateway, teamBasePath, isMicroApp, children, p
19
19
  const config = { ...getUserConfig(), ...(userConfig || {}) };
20
20
  return config;
21
21
  }, [userConfig]);
22
- return (jsx(TeamConfigContext.Provider, { value: {
23
- isMicroApp,
24
- publicRuntimeConfig: runtimeConfig,
25
- userConfig: _userConfig,
26
- extraHeaders,
27
- }, children: children }));
22
+ const value = useMemo(() => ({
23
+ isMicroApp,
24
+ publicRuntimeConfig: runtimeConfig,
25
+ userConfig: _userConfig,
26
+ extraHeaders,
27
+ }), [isMicroApp, runtimeConfig, _userConfig, extraHeaders]);
28
+ return jsx(TeamConfigContext.Provider, { value: value, children: children });
28
29
  };
29
30
 
30
31
  export { TeamConfigContext, TeamConfigProvider };
@@ -1,12 +1,13 @@
1
1
  import { jsx } from '@emotion/react/jsx-runtime';
2
- import { createContext } from 'react';
2
+ import { createContext, useMemo } from 'react';
3
3
 
4
4
  const defaultContext = {};
5
5
  const TenantContext = createContext(defaultContext);
6
6
  const TenantProvider = ({ tenant, children }) => {
7
- return (jsx(TenantContext.Provider, { value: {
8
- tenant,
9
- }, children: children }));
7
+ const value = useMemo(() => ({
8
+ tenant,
9
+ }), [tenant]);
10
+ return jsx(TenantContext.Provider, { value: value, children: children });
10
11
  };
11
12
 
12
13
  export { TenantContext, TenantProvider };
@@ -1,12 +1,13 @@
1
1
  import { jsx } from '@emotion/react/jsx-runtime';
2
- import { createContext } from 'react';
2
+ import { createContext, useMemo } from 'react';
3
3
 
4
4
  const defaultContext = {};
5
5
  const WorkflowConfigContext = createContext(defaultContext);
6
6
  const WorkflowConfigProvider = ({ workflow, children }) => {
7
- return (jsx(WorkflowConfigContext.Provider, { value: {
8
- workflow,
9
- }, children: children }));
7
+ const value = useMemo(() => ({
8
+ workflow,
9
+ }), [workflow]);
10
+ return jsx(WorkflowConfigContext.Provider, { value: value, children: children });
10
11
  };
11
12
 
12
13
  export { WorkflowConfigContext, WorkflowConfigProvider };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@giteeteam/apps-team-components",
3
- "version": "1.11.5-alpha.1",
3
+ "version": "1.11.5",
4
4
  "description": "Gitee team components",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",