@giteeteam/apps-team-components 1.0.13 → 1.0.15

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.
@@ -2,8 +2,8 @@ import useTeamConfig from '../../../lib/hooks/useTeamConfig';
2
2
  import useTenant from '../../../lib/hooks/useTenant';
3
3
  import isInOne from '../../../lib/isInOne';
4
4
  export const useToWorkspacePage = () => {
5
- const { teamBasePath, teamGateway } = useTeamConfig();
6
- const inOne = isInOne(teamGateway);
5
+ const { teamBasePath, teamGateway, isMicroApp } = useTeamConfig();
6
+ const inOne = isInOne(teamGateway, isMicroApp);
7
7
  const tenant = useTenant();
8
8
  return {
9
9
  toWorkspacePage: (workspaceKey) => {
@@ -1,4 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { ReadViewBaseProps } from '../types';
3
- declare const DropdownReadView: import("react").NamedExoticComponent<ReadViewBaseProps>;
3
+ type DropdownReadViewProps = ReadViewBaseProps & {
4
+ userData?: Record<string, any>;
5
+ };
6
+ declare const DropdownReadView: import("react").NamedExoticComponent<DropdownReadViewProps>;
4
7
  export default DropdownReadView;
@@ -4,7 +4,15 @@ import EmptyField from '../../common/EmptyField';
4
4
  import SimpleOverflowToolTip from '../../common/overflow-tooltip/SimpleOverflowToolTip';
5
5
  import { handleValue } from './BaseField';
6
6
  const DropdownReadView = memo(props => {
7
- const { value, options, readonly } = props;
7
+ const { value, options, readonly: propsReadonly, userData } = props;
8
+ const readonly = useMemo(() => {
9
+ if ((userData === null || userData === void 0 ? void 0 : userData.source) === 'apps-function') {
10
+ return (userData === null || userData === void 0 ? void 0 : userData.readonly) || propsReadonly;
11
+ }
12
+ else {
13
+ return propsReadonly;
14
+ }
15
+ }, [propsReadonly, userData]);
8
16
  const showValue = useMemo(() => {
9
17
  var _a;
10
18
  if (!(value === null || value === void 0 ? void 0 : value.length))
@@ -11,7 +11,7 @@ import { ItemConfigProvider } from './itemConfig';
11
11
  import { TeamConfigProvider } from './teamConfig';
12
12
  import { TenantProvider } from './tenant';
13
13
  import { WorkflowConfigProvider } from './workflowConfig';
14
- export const LibraryProvider = ({ getPopupContainer, locale, tenant, datetimeFormat, teamBasePath, teamGateway, workspaceKey, workflow, item, currentUser, emotionCacheOptions, children, }) => {
14
+ export const LibraryProvider = ({ getPopupContainer, locale, tenant, datetimeFormat, teamBasePath, teamGateway, isMicroApp, workspaceKey, workflow, item, currentUser, emotionCacheOptions, children, }) => {
15
15
  const emotionCache = useMemo(() => {
16
16
  return createCache({
17
17
  key: 'apps',
@@ -21,5 +21,5 @@ export const LibraryProvider = ({ getPopupContainer, locale, tenant, datetimeFor
21
21
  useEffect(() => {
22
22
  i18n.setLocale(locale);
23
23
  }, [locale]);
24
- return (_jsx(CacheProvider, { value: emotionCache, children: _jsx(AntdConfigProvider, { getPopupContainer: getPopupContainer, children: _jsx(TeamConfigProvider, { teamBasePath: teamBasePath, teamGateway: teamGateway, children: _jsx(TenantProvider, { tenant: tenant, children: _jsx(CurrentWorkspaceProvider, { workspaceKey: workspaceKey, children: _jsx(DatetimeFormatProvider, { datetimeFormat: datetimeFormat, children: _jsx(CurrentUserProvider, { currentUser: currentUser, children: _jsx(WorkflowConfigProvider, { workflow: workflow, children: _jsx(ItemConfigProvider, { item: item, children: children }) }) }) }) }) }) }) }) }));
24
+ return (_jsx(CacheProvider, { value: emotionCache, children: _jsx(AntdConfigProvider, { getPopupContainer: getPopupContainer, children: _jsx(TeamConfigProvider, { teamBasePath: teamBasePath, teamGateway: teamGateway, isMicroApp: isMicroApp, children: _jsx(TenantProvider, { tenant: tenant, children: _jsx(CurrentWorkspaceProvider, { workspaceKey: workspaceKey, children: _jsx(DatetimeFormatProvider, { datetimeFormat: datetimeFormat, children: _jsx(CurrentUserProvider, { currentUser: currentUser, children: _jsx(WorkflowConfigProvider, { workflow: workflow, children: _jsx(ItemConfigProvider, { item: item, children: children }) }) }) }) }) }) }) }) }));
25
25
  };
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  export interface ITeamConfigContext {
3
3
  teamGateway?: string;
4
4
  teamBasePath?: string;
5
+ isMicroApp?: boolean;
5
6
  }
6
7
  export declare const TeamConfigContext: React.Context<ITeamConfigContext>;
7
8
  export interface TeamConfigProviderProps extends React.PropsWithChildren, ITeamConfigContext {
@@ -2,9 +2,10 @@ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
2
  import { createContext } from 'react';
3
3
  const defaultContext = {};
4
4
  export const TeamConfigContext = createContext(defaultContext);
5
- export const TeamConfigProvider = ({ teamGateway, teamBasePath, children }) => {
5
+ export const TeamConfigProvider = ({ teamGateway, teamBasePath, isMicroApp, children, }) => {
6
6
  return (_jsx(TeamConfigContext.Provider, { value: {
7
7
  teamGateway,
8
8
  teamBasePath,
9
+ isMicroApp,
9
10
  }, children: children }));
10
11
  };
@@ -1,2 +1,2 @@
1
- declare const isInOne: (gateway?: string) => boolean;
1
+ declare const isInOne: (gateway?: string, isMicroApp?: boolean) => boolean;
2
2
  export default isInOne;
@@ -1,4 +1,6 @@
1
- const isInOne = (gateway) => {
1
+ const isInOne = (gateway, isMicroApp) => {
2
+ if (isMicroApp != null)
3
+ return !!isMicroApp;
2
4
  if (!gateway)
3
5
  return false;
4
6
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@giteeteam/apps-team-components",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "description": "Gitee team components",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",