@giteeteam/apps-team-components 1.10.3 → 1.10.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.
@@ -4,7 +4,7 @@ import StatusReadView from './ReadView.js';
4
4
  import Transition from './Transition.js';
5
5
 
6
6
  const StatusCell = React__default.memo(props => {
7
- const { overlayClsName = '', itemId, readonly, value, workspaceId, itemTypeId, onChange } = props;
7
+ const { overlayClsName = '', itemId, readonly, value, workspaceId, itemTypeId, onChange, getPopupContainer } = props;
8
8
  const [showData, setShowData] = useState(value);
9
9
  useEffect(() => {
10
10
  setShowData(value);
@@ -13,7 +13,7 @@ const StatusCell = React__default.memo(props => {
13
13
  setShowData({ objectId, name, type });
14
14
  onChange === null || onChange === void 0 ? void 0 : onChange({ objectId, name, type });
15
15
  }, [onChange]);
16
- return (jsx("div", { className: `${overlayClsName} field-cell-layout field-layout ${!readonly ? 'pointer' : ''}`, children: readonly ? (jsx(StatusReadView, { value: showData, readonly: true })) : (jsx(Transition, { itemId: itemId, ...showData, ...(props.flowHandler || {}), apply: "cell", workspace: workspaceId, itemType: itemTypeId, onTransitionSuccess: handleChange })) }));
16
+ return (jsx("div", { className: `${overlayClsName} field-cell-layout field-layout ${!readonly ? 'pointer' : ''}`, children: readonly ? (jsx(StatusReadView, { value: showData, readonly: true })) : (jsx(Transition, { itemId: itemId, ...showData, ...(props.flowHandler || {}), apply: "cell", workspace: workspaceId, itemType: itemTypeId, onTransitionSuccess: handleChange, getPopupContainer: getPopupContainer })) }));
17
17
  });
18
18
  StatusCell.displayName = 'StatusCell';
19
19
 
@@ -23,4 +23,5 @@ export type StatusProps = FieldProps & {
23
23
  onChange?: (value?: any) => void;
24
24
  children?: React.ReactNode;
25
25
  flowHandler?: Record<string, any>;
26
+ getPopupContainer?: (node: HTMLElement) => HTMLElement;
26
27
  };
@@ -15,6 +15,7 @@ interface TransitionComponentProps {
15
15
  flowUsers: Array<Record<string, any>>;
16
16
  loadingFlowUsers: boolean;
17
17
  fetchFlowUsers: (itemId: string, status: string, keyword?: string) => Promise<void>;
18
+ getPopupContainer?: (node: HTMLElement) => HTMLElement;
18
19
  }
19
20
  declare const _default: React.NamedExoticComponent<TransitionComponentProps>;
20
21
  export default _default;
@@ -12,7 +12,7 @@ import { workflowContentStyle, statePopoverStyle, flowStateStyle, flowStateInWor
12
12
  import TransitionPanel from './TransitionPanel.js';
13
13
 
14
14
  const Transition = props => {
15
- const { itemId, itemType, workspace, objectId, onTransitionSuccess, name, type, readonly, apply, flowUsers, loadingFlowUsers, fetchFlowUsers, } = props;
15
+ const { itemId, itemType, workspace, objectId, onTransitionSuccess, name, type, readonly, apply, flowUsers, loadingFlowUsers, fetchFlowUsers, getPopupContainer, } = props;
16
16
  const [popoverVisible, setPopoverVisible] = useState(false);
17
17
  const [flowing, setFlowing] = useState(false);
18
18
  const isProcessing = useRef(false);
@@ -36,7 +36,7 @@ const Transition = props => {
36
36
  return;
37
37
  }
38
38
  setPopoverVisible(visible);
39
- }, getPopupContainer: () => document.body, trigger: "click", placement: "bottomLeft", content: jsx(TransitionPanel, { itemId: itemId, itemType: itemType, workspace: workspace, objectId: showData.objectId, onTransitionSuccess: transitionSuccess, name: name, readonly: readonly, setPopoverVisible: setPopoverVisible, isProcessing: isProcessing, flowing: flowing, setFlowing: setFlowing, flowHandlerActive: props.flowHandlerActive, flowUsers: flowUsers, loadingFlowUsers: loadingFlowUsers, fetchFlowUsers: fetchFlowUsers }), children: jsxs(Button, { type: "link", className: cx('status-btn', css(flowStateStyle), css(flowStateInWorkflowStyle), css(flowStateButtonStyle), css(stateBtnStyle), {
39
+ }, getPopupContainer: getPopupContainer || (() => document.body), trigger: "click", placement: "bottomLeft", content: jsx(TransitionPanel, { itemId: itemId, itemType: itemType, workspace: workspace, objectId: showData.objectId, onTransitionSuccess: transitionSuccess, name: name, readonly: readonly, setPopoverVisible: setPopoverVisible, isProcessing: isProcessing, flowing: flowing, setFlowing: setFlowing, flowHandlerActive: props.flowHandlerActive, flowUsers: flowUsers, loadingFlowUsers: loadingFlowUsers, fetchFlowUsers: fetchFlowUsers }), children: jsxs(Button, { type: "link", className: cx('status-btn', css(flowStateStyle), css(flowStateInWorkflowStyle), css(flowStateButtonStyle), css(stateBtnStyle), {
40
40
  [css(noStateStyle)]: !showData.name,
41
41
  }), style: {
42
42
  backgroundColor: (_a = WorkFlowStatusColor[showData.type]) === null || _a === void 0 ? void 0 : _a.bgColor,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@giteeteam/apps-team-components",
3
- "version": "1.10.3",
3
+ "version": "1.10.5",
4
4
  "description": "Gitee team components",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",