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

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.
@@ -24,7 +24,7 @@ import useI18n from '../../../lib/hooks/useI18n.js';
24
24
  import { API_KEY } from '../../../lib/swr/constants.js';
25
25
  import useViewClass from '../hooks/useViewClass.js';
26
26
  import { EMPTY_OPTIONS, useCommonProps } from './hook.js';
27
- import { dropdownSelectDisabled, onlyWorkspaceStyle, onlyWorkspaceDividerStyle, dropdownSelectStyle, optionDisplayWrapClass, dropdownSelectOptionClass, disabledClass, workspaceClass, dropdownStyle, hiddenHoverClass, displayWrapClass, valueOptionContentClass, valueOptionClass, valueOptionIconClass, valueOptionLabelClass, hoverIconClass } from './style.js';
27
+ import { dropdownSelectDisabled, onlyWorkspaceStyle, onlyWorkspaceDividerStyle, dropdownSelectStyle, optionDisplayWrapClass, dropdownSelectOptionClass, disabledClass, workspaceClass, dropdownStyle, hiddenHoverClass, displayWrapClass, pointerClass, valueOptionContentClass, valueOptionClass, valueOptionIconClass, valueOptionLabelClass, hoverIconClass } from './style.js';
28
28
 
29
29
  const loggers = debug('dropdown:BaseField');
30
30
  const isNilFilter = function (value) {
@@ -567,7 +567,7 @@ const Dropdown = props => {
567
567
  ]);
568
568
  return (jsx(ClassNames, { children: ({ cx, css }) => {
569
569
  const cxShowValue = showValue({ cx, css });
570
- return (jsxs(Col, { style: style, ref: containerRef, className: cx(css(dropdownStyle(antPrefix)), 'field-value', viewClassNames, { [hiddenHoverClass]: hiddenHover }, { [displayWrapClass]: valueDisplayWrap }, { [css(dropdownSelectStyle(antPrefix))]: disabledLineThrough || displayValueHidden }), onClick: handleClick, children: [(readonly || (!editMode && !editing)) &&
570
+ return (jsxs(Col, { style: style, ref: containerRef, className: cx(css(dropdownStyle(antPrefix)), 'field-value', viewClassNames, { [hiddenHoverClass]: hiddenHover }, { [displayWrapClass]: valueDisplayWrap }, { [css(dropdownSelectStyle(antPrefix))]: disabledLineThrough || displayValueHidden }, { [pointerClass]: !readonly }), onClick: handleClick, children: [(readonly || (!editMode && !editing)) &&
571
571
  (cxShowValue ? (!valueDisplayWrap ? (isView && isMultiple ? (jsx(Expand, { readonly: readonly, editing: editing, expandType: EXPAND_TYPE_ENUM.TAG, children: valueOptions.map(item => (jsx("span", { className: "field-common-view-tag", children: jsx(BaseOverflowTooltip, { title: item.label, children: item.label }) }, item.value))) })) : (jsx(OverflowTooltip, { title: cxShowValue, children: cxShowValue }))) : (jsx("div", { className: cx(valueOptionContentClass), children: valueOptions.map(ele => {
572
572
  return (jsxs("div", { className: cx(valueOptionClass), title: ele.label, children: [jsx(ItemIcon, { className: cx(valueOptionIconClass), icon: ele.icon }), jsx("span", { className: cx(valueOptionLabelClass), children: ele.label })] }, ele.value));
573
573
  }) }))) : (jsx(EmptyField, { readonly: readonly }))), !readonly && (editMode || editing) && containerRef && (jsx(Overlay, { show: true, rootClose: true, container: containerRef, target: containerRef, onHide: noop, children: () => overlayRender })), jsx(DownOutlined, { className: cx(hoverIconClass) })] }));
@@ -4,6 +4,7 @@ export declare const onlyWorkspaceDividerStyle = "\n &:not(.add-weights) {\n
4
4
  export declare const hiddenHoverClass: string;
5
5
  export declare const displayWrapClass: string;
6
6
  export declare const valueOptionClass: string;
7
+ export declare const pointerClass: string;
7
8
  export declare const valueOptionContentClass: string;
8
9
  export declare const valueOptionIconClass: string;
9
10
  export declare const valueOptionLabelClass: string;
@@ -15,6 +15,7 @@ const onlyWorkspaceDividerStyle = `
15
15
  const hiddenHoverClass = randomClassName('hidden-hover');
16
16
  const displayWrapClass = randomClassName('display-wrap');
17
17
  const valueOptionClass = randomClassName('value-option');
18
+ const pointerClass = randomClassName('pointer-class');
18
19
  const valueOptionContentClass = randomClassName('value-option-content');
19
20
  const valueOptionIconClass = randomClassName('value-option-icon');
20
21
  const valueOptionLabelClass = randomClassName('value-option-label');
@@ -32,6 +33,10 @@ const dropdownStyle = (antPrefix) => `
32
33
  }
33
34
  }
34
35
 
36
+ .${pointerClass} {
37
+ cursor: pointer;
38
+ }
39
+
35
40
  .${hoverIconClass} {
36
41
  ${hoverIconStyle}
37
42
  }
@@ -90,4 +95,4 @@ const dropdownSelectStyle = (antPrefix) => `
90
95
  }
91
96
  `;
92
97
 
93
- export { disabledClass, displayWrapClass, dropdownSelectDisabled, dropdownSelectOptionClass, dropdownSelectStyle, dropdownStyle, hiddenHoverClass, hoverIconClass, onlyWorkspaceDividerStyle, onlyWorkspaceStyle, optionDisplayWrapClass, valueOptionClass, valueOptionContentClass, valueOptionIconClass, valueOptionLabelClass, workspaceClass };
98
+ export { disabledClass, displayWrapClass, dropdownSelectDisabled, dropdownSelectOptionClass, dropdownSelectStyle, dropdownStyle, hiddenHoverClass, hoverIconClass, onlyWorkspaceDividerStyle, onlyWorkspaceStyle, optionDisplayWrapClass, pointerClass, valueOptionClass, valueOptionContentClass, valueOptionIconClass, valueOptionLabelClass, workspaceClass };
@@ -2,6 +2,7 @@ import { ReadViewBaseProps } from '../types';
2
2
  type LongTextReadViewProps = ReadViewBaseProps & {
3
3
  isReadingTableCell?: boolean;
4
4
  noPadding?: boolean;
5
+ title?: string;
5
6
  };
6
7
  declare const LongTextReadView: import("react").NamedExoticComponent<LongTextReadViewProps>;
7
8
  export default LongTextReadView;
@@ -6,18 +6,18 @@ import EmptyField from '../../common/EmptyField.js';
6
6
  import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip.js';
7
7
  import { whiteSpacePreStyle, textStyle, noPaddingStyle } from './style/index.js';
8
8
 
9
- const OverflowWrapper = ({ needOverflow, children }) => {
9
+ const OverflowWrapper = ({ needOverflow, children, title }) => {
10
10
  if (needOverflow)
11
- return jsx(BaseOverflowTooltip, { maxline: 1, children: children });
11
+ return (jsx(BaseOverflowTooltip, { maxline: 1, title: title, children: children }));
12
12
  return jsx(Fragment, { children: children });
13
13
  };
14
- const LongTextReadView = memo(({ value, readonly, isReadingTableCell, fieldKey, noPadding }) => {
14
+ const LongTextReadView = memo(({ value, readonly, isReadingTableCell, fieldKey, noPadding, title }) => {
15
15
  useEffect(() => {
16
16
  if (fieldKey && value) {
17
17
  proximaSdk.execute('ReadViewValueChange', { fieldKey, value });
18
18
  }
19
19
  }, [value, fieldKey]);
20
- return (jsx(Fragment, { children: value ? (jsx(OverflowWrapper, { needOverflow: !isReadingTableCell, children: jsx("span", { css: css(whiteSpacePreStyle, textStyle, noPadding ? noPaddingStyle : undefined), dangerouslySetInnerHTML: { __html: value } }) })) : (jsx(EmptyField, { readonly: readonly })) }));
20
+ return (jsx(Fragment, { children: value ? (jsx(OverflowWrapper, { needOverflow: !isReadingTableCell, title: title, children: jsx("span", { css: css(whiteSpacePreStyle, textStyle, noPadding ? noPaddingStyle : undefined), dangerouslySetInnerHTML: { __html: value } }) })) : (jsx(EmptyField, { readonly: readonly })) }));
21
21
  });
22
22
  LongTextReadView.displayName = 'LongTextReadView';
23
23
 
@@ -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 };
@@ -11,7 +11,7 @@ import useI18n from '../../../lib/hooks/useI18n.js';
11
11
  import EmptyField from '../../common/EmptyField.js';
12
12
  import { getFieldWidthStyle } from '../base-component/utils.js';
13
13
  import useViewClass from '../hooks/useViewClass.js';
14
- import { textStyle, hiddenHoverClass } from './style.js';
14
+ import { textStyle, hiddenHoverClass, pointerClass } from './style.js';
15
15
 
16
16
  const BASE_FIELD_WIDTH = 104;
17
17
  const Text = props => {
@@ -69,7 +69,7 @@ const Text = props => {
69
69
  };
70
70
  const style = getFieldWidthStyle(labelWidth, labelAlign, hiddenLabel, apply, hasExtraNode);
71
71
  const hiddenHover = readonly || editing || editMode || apply === 'cell' || defaultProps.name === 'name-view' || isView;
72
- return (jsx(ClassNames, { children: ({ cx, css }) => (jsxs(Col, { style: style, ref: containerRef, className: cx(css(textStyle()), 'field-value', viewClassNames, { [hiddenHoverClass]: hiddenHover }), onClick: handleClick, children: [(readonly || (!editMode && !editing)) &&
72
+ return (jsx(ClassNames, { children: ({ cx, css }) => (jsxs(Col, { style: style, ref: containerRef, className: cx(css(textStyle()), 'field-value', viewClassNames, { [hiddenHoverClass]: hiddenHover }, { [pointerClass]: readonly }), onClick: handleClick, children: [(readonly || (!editMode && !editing)) &&
73
73
  (value ? (isView ? (jsxs(Expand, { readonly: readonly, editing: editing, expandType: EXPAND_TYPE_ENUM.TEXT, children: [addonBefore, value, addonAfter] })) : (jsxs(OverflowTooltip, { enterable: true, title: `${addonBefore}${value}${addonAfter}`, maxline: maxline, children: [addonBefore, value, addonAfter] }))) : (jsx(EmptyField, { readonly: readonly }))), !readonly && (editMode || editing) && containerRef && (jsx(Overlay, { show: true, flip: true, rootClose: true, container: containerRef, target: containerRef, onHide: noop, children: () => (jsx("div", { className: "field-value-overlay", children: jsx(Input, { ...defaultProps, className: 'field-value-overlay-component', ref: targetRef, value: value, onChange: handleChange, onBlur: handleBlur, placeholder: placeholder, addonBefore: addonBefore, addonAfter: addonAfter }) })) }))] })) }));
74
74
  };
75
75
  Text.displayName = 'TextBaseField';
@@ -1,2 +1,3 @@
1
1
  export declare const hiddenHoverClass: string;
2
+ export declare const pointerClass: string;
2
3
  export declare const textStyle: () => string;
@@ -2,11 +2,17 @@ import { randomClassName } from '../../../style/common.js';
2
2
  import { hoverStyle } from '../../common/style/mixin.js';
3
3
 
4
4
  const hiddenHoverClass = randomClassName('hidden-hover');
5
+ const pointerClass = randomClassName('pointer-class');
5
6
  const textStyle = () => `
6
7
  width: 100%;
7
8
 
8
9
  &:not(.${hiddenHoverClass}) :hover {
9
10
  ${hoverStyle}
11
+ }
12
+
13
+ .${pointerClass} {
14
+ cursor: pointer;
15
+ }
10
16
  `;
11
17
 
12
- export { hiddenHoverClass, textStyle };
18
+ export { hiddenHoverClass, pointerClass, textStyle };
@@ -8,5 +8,6 @@ export interface TableCellProps {
8
8
  readComponents: Record<string, React.FC>;
9
9
  editComponents?: Record<string, React.FC>;
10
10
  handleChange?: (value: any) => void;
11
+ text?: string;
11
12
  }
12
13
  export declare const TableCell: React.FC<TableCellProps>;
@@ -36,7 +36,7 @@ const transferItem = (item, readonly) => {
36
36
  };
37
37
  const EMPTY_ARRAY = [];
38
38
  const defaultValue = {};
39
- const BaseTableCell = ({ className, cellData, column, rowData, readComponents = defaultValue, editComponents = defaultValue, handleChange, readonly, }) => {
39
+ const BaseTableCell = ({ className, cellData, column, rowData, readComponents = defaultValue, editComponents = defaultValue, handleChange, readonly, text: _text, }) => {
40
40
  var _a, _b, _c;
41
41
  const [cellEntered, setCellEntered] = useState(false);
42
42
  const cls = `field-cell-layout field-layout ${className}`;
@@ -57,7 +57,7 @@ const BaseTableCell = ({ className, cellData, column, rowData, readComponents =
57
57
  return (jsx("div", { className: cls, children: jsx(EditTableCell, { Component: EditComponent, workspaceId: (_a = rowData.workspace) === null || _a === void 0 ? void 0 : _a.objectId, itemTypeId: (_b = rowData.itemType) === null || _b === void 0 ? void 0 : _b.objectId, property: property, data: data, id: rowData.objectId, readonly: readonly, objectId: objectId, text: cellData, type: column.componentType || column.cellType, handleChange: handleChange, dataSource: column.dataSource }) }));
58
58
  }
59
59
  if (ReadComponent) {
60
- return (jsx("div", { className: cls, onMouseOver: handleMouseOver, children: jsx(ReadComponent, { readonly: readonly, value: cellData, ...column.property, userData: column.data, options: ((_c = column.data) === null || _c === void 0 ? void 0 : _c.customData) || EMPTY_ARRAY, itemValues: rowData, objectId: column.objectId, dataSource: column.dataSource, fieldKey: fieldKey, isReadingTableCell: column.isReadingList, noPadding: column.noPadding }) }));
60
+ return (jsx("div", { className: cls, onMouseOver: handleMouseOver, children: jsx(ReadComponent, { readonly: readonly, value: cellData, ...column.property, userData: column.data, options: ((_c = column.data) === null || _c === void 0 ? void 0 : _c.customData) || EMPTY_ARRAY, itemValues: rowData, objectId: column.objectId, dataSource: column.dataSource, fieldKey: fieldKey, isReadingTableCell: column.isReadingList, noPadding: column.noPadding, title: _text }) }));
61
61
  }
62
62
  const text = transferItem(cellData !== null && cellData !== void 0 ? cellData : rowData[column.dataIndex], readonly);
63
63
  return jsx("div", { className: cls, children: text });
@@ -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.6",
4
4
  "description": "Gitee team components",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",