@giteeteam/apps-team-components 1.0.1 → 1.0.2-alpha.1

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.
Files changed (83) hide show
  1. package/dist/components/common/EmptyField.js +1 -1
  2. package/dist/components/common/overflow-tooltip/BaseOverflowTooltip.js +10 -9
  3. package/dist/components/common/overflow-tooltip/SimpleOverflowToolTip.js +10 -9
  4. package/dist/components/common/overflow-tooltip/style/index.d.ts +2 -2
  5. package/dist/components/common/overflow-tooltip/style/index.js +3 -4
  6. package/dist/components/common/style/global.d.ts +1 -1
  7. package/dist/components/common/style/global.js +1 -2
  8. package/dist/components/common/user-field/UserAvatar.js +5 -3
  9. package/dist/components/common/user-field/style/index.d.ts +3 -3
  10. package/dist/components/common/user-field/style/index.js +3 -4
  11. package/dist/components/fields/actors/ReadView.js +1 -1
  12. package/dist/components/fields/assignee/ReadView.js +6 -6
  13. package/dist/components/fields/bind-workspace/ReadView.js +5 -3
  14. package/dist/components/fields/bind-workspace/style/index.d.ts +1 -1
  15. package/dist/components/fields/bind-workspace/style/index.js +1 -2
  16. package/dist/components/fields/checkbox/ReadView.js +1 -1
  17. package/dist/components/fields/created-at/ReadView.js +1 -1
  18. package/dist/components/fields/created-by/ReadView.d.ts +1 -1
  19. package/dist/components/fields/created-by/ReadView.js +3 -6
  20. package/dist/components/fields/data-quote/ReadView.js +3 -2
  21. package/dist/components/fields/date/ReadView.js +1 -1
  22. package/dist/components/fields/dropdown/ReadView.js +1 -1
  23. package/dist/components/fields/file/ReadView.js +1 -1
  24. package/dist/components/fields/formula/ReadView.js +1 -1
  25. package/dist/components/fields/hyper-link/ReadView.js +4 -3
  26. package/dist/components/fields/hyper-link/style/index.d.ts +3 -3
  27. package/dist/components/fields/hyper-link/style/index.js +3 -4
  28. package/dist/components/fields/item-group/ReadView.js +1 -1
  29. package/dist/components/fields/item-type/ReadView.js +1 -1
  30. package/dist/components/fields/key/ReadView.js +1 -1
  31. package/dist/components/fields/long-text/ReadView.js +3 -2
  32. package/dist/components/fields/long-text/style/index.d.ts +1 -1
  33. package/dist/components/fields/long-text/style/index.js +1 -2
  34. package/dist/components/fields/number/ReadView.js +1 -1
  35. package/dist/components/fields/priority/ReadView.js +3 -2
  36. package/dist/components/fields/priority/style/index.d.ts +3 -3
  37. package/dist/components/fields/priority/style/index.js +3 -4
  38. package/dist/components/fields/radio/ReadView.js +1 -1
  39. package/dist/components/fields/reporter/ReadView.d.ts +1 -1
  40. package/dist/components/fields/reporter/ReadView.js +3 -6
  41. package/dist/components/fields/script/ReadView.js +1 -1
  42. package/dist/components/fields/sprint/ReadView.js +1 -1
  43. package/dist/components/fields/status/Cell.js +3 -4
  44. package/dist/components/fields/status/ReadView.js +3 -2
  45. package/dist/components/fields/status/Transition.js +16 -14
  46. package/dist/components/fields/status/TransitionButton.js +11 -9
  47. package/dist/components/fields/status/TransitionPanel.js +8 -8
  48. package/dist/components/fields/status/View.js +8 -11
  49. package/dist/components/fields/status/style/index.d.ts +19 -19
  50. package/dist/components/fields/status/style/index.js +36 -39
  51. package/dist/components/fields/story-point/ReadView.js +1 -1
  52. package/dist/components/fields/tag/ReadView.js +3 -2
  53. package/dist/components/fields/tag/style/index.d.ts +1 -1
  54. package/dist/components/fields/tag/style/index.js +1 -2
  55. package/dist/components/fields/team/ReadView.js +3 -2
  56. package/dist/components/fields/team/style/index.d.ts +2 -2
  57. package/dist/components/fields/team/style/index.js +1 -2
  58. package/dist/components/fields/text/ReadView.js +1 -1
  59. package/dist/components/fields/tree/ReadView.js +1 -1
  60. package/dist/components/fields/updated-at/ReadView.js +1 -1
  61. package/dist/components/fields/updated-by/ReadView.d.ts +1 -1
  62. package/dist/components/fields/updated-by/ReadView.js +3 -6
  63. package/dist/components/fields/user/ReadView.js +3 -3
  64. package/dist/components/fields/user/style/index.d.ts +3 -3
  65. package/dist/components/fields/user/style/index.js +3 -4
  66. package/dist/components/fields/user-group/ReadView.js +1 -1
  67. package/dist/components/fields/version/ReadView.js +1 -1
  68. package/dist/components/fields/workspace/ReadView.js +1 -1
  69. package/dist/components/table-components/EditTableCell.js +1 -1
  70. package/dist/components/table-components/index.js +9 -9
  71. package/dist/components/table-components/style/index.d.ts +1 -1
  72. package/dist/components/table-components/style/index.js +6 -9
  73. package/dist/icons/index.js +1 -1
  74. package/dist/lib/contexts/antdConfig.js +1 -1
  75. package/dist/lib/contexts/currentUser.js +1 -1
  76. package/dist/lib/contexts/currentWorkspace.js +1 -1
  77. package/dist/lib/contexts/datetimeFormat.js +1 -1
  78. package/dist/lib/contexts/index.js +1 -1
  79. package/dist/lib/contexts/itemConfig.js +1 -1
  80. package/dist/lib/contexts/teamConfig.js +1 -1
  81. package/dist/lib/contexts/tenant.js +1 -1
  82. package/dist/lib/contexts/workflowConfig.js +1 -1
  83. package/package.json +3 -2
@@ -1,7 +1,7 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
2
  import { memo, useCallback, useEffect, useRef, useState } from 'react';
3
3
  import { CaretDownOutlined } from '@ant-design/icons';
4
- import { cx } from '@emotion/css';
4
+ import { ClassNames } from '@emotion/react';
5
5
  import { Button, Popover } from 'antd';
6
6
  import { WorkFlowStatusColor } from '../../../lib/global';
7
7
  import useAntdConfig from '../../../lib/hooks/useAntdConfig';
@@ -11,7 +11,6 @@ import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowToolt
11
11
  import { caretDownStyle, flowStateButtonStyle, flowStateInWorkflowStyle, flowStateStyle, noStateStyle, stateBtnStyle, statePopoverStyle, workflowContentStyle, } from './style';
12
12
  import TransitionPanel from './TransitionPanel';
13
13
  const Transition = props => {
14
- var _a, _b, _c;
15
14
  const { itemId, itemType, workspace, objectId, onTransitionSuccess, name, type, readonly, apply } = props;
16
15
  const [popoverVisible, setPopoverVisible] = useState(false);
17
16
  const [flowing, setFlowing] = useState(false);
@@ -29,16 +28,19 @@ const Transition = props => {
29
28
  return { ...data, objectId, name, type };
30
29
  });
31
30
  }, [objectId, name, type]);
32
- return (_jsx("div", { className: workflowContentStyle, children: _jsx(Popover, { overlayClassName: statePopoverStyle(antPrefix), destroyTooltipOnHide: true, open: popoverVisible, onOpenChange: visible => {
33
- if (isProcessing.current || flowing) {
34
- return;
35
- }
36
- setPopoverVisible(visible);
37
- }, 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 }), children: _jsxs(Button, { type: "link", className: cx(flowStateStyle, flowStateInWorkflowStyle, flowStateButtonStyle, stateBtnStyle, {
38
- [noStateStyle]: !showData.name,
39
- }), style: {
40
- backgroundColor: (_a = WorkFlowStatusColor[showData.type]) === null || _a === void 0 ? void 0 : _a.bgColor,
41
- color: (_b = WorkFlowStatusColor[showData.type]) === null || _b === void 0 ? void 0 : _b.color,
42
- }, children: [_jsx(BaseOverflowTooltip, { title: showData.name, children: showData.name || (apply === 'cell' ? _jsx(EmptyField, { readonly: readonly }) : i18n.t('global.stateless')) }), apply !== 'cell' && (_jsx(CaretDownOutlined, { className: caretDownStyle, style: { color: (_c = WorkFlowStatusColor[showData.type]) === null || _c === void 0 ? void 0 : _c.color, marginLeft: 0 } }))] }) }) }));
31
+ return (_jsx(ClassNames, { children: ({ cx, css }) => {
32
+ var _a, _b, _c;
33
+ return (_jsx("div", { css: css(workflowContentStyle), children: _jsx(Popover, { overlayClassName: statePopoverStyle(antPrefix), destroyTooltipOnHide: true, open: popoverVisible, onOpenChange: visible => {
34
+ if (isProcessing.current || flowing) {
35
+ return;
36
+ }
37
+ setPopoverVisible(visible);
38
+ }, 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 }), children: _jsxs(Button, { type: "link", className: cx(css(flowStateStyle), css(flowStateInWorkflowStyle), css(flowStateButtonStyle), css(stateBtnStyle), {
39
+ [css(noStateStyle)]: !showData.name,
40
+ }), style: {
41
+ backgroundColor: (_a = WorkFlowStatusColor[showData.type]) === null || _a === void 0 ? void 0 : _a.bgColor,
42
+ color: (_b = WorkFlowStatusColor[showData.type]) === null || _b === void 0 ? void 0 : _b.color,
43
+ }, children: [_jsx(BaseOverflowTooltip, { title: showData.name, children: showData.name || (apply === 'cell' ? _jsx(EmptyField, { readonly: readonly }) : i18n.t('global.stateless')) }), apply !== 'cell' && (_jsx(CaretDownOutlined, { css: css(caretDownStyle), style: { color: (_c = WorkFlowStatusColor[showData.type]) === null || _c === void 0 ? void 0 : _c.color, marginLeft: 0 } }))] }) }) }));
44
+ } }));
43
45
  };
44
46
  export default memo(Transition);
@@ -1,6 +1,6 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
2
  import { memo, useCallback, useEffect, useMemo, useState } from 'react';
3
- import { cx } from '@emotion/css';
3
+ import { ClassNames, css } from '@emotion/react';
4
4
  import { Tooltip } from 'antd';
5
5
  import { WorkFlowStatusColor } from '../../../lib/global';
6
6
  import { i18n } from '../../../lib/i18n';
@@ -104,19 +104,21 @@ const FlowButton = ({ loading, screenId, text, item, userId, roleIds, groupIds,
104
104
  if (!tip)
105
105
  return '';
106
106
  const contents = tip.split('--');
107
- return (_jsx("div", { children: contents.map((text, index) => (_jsx("p", { className: tipLineStyle, children: text }, String(index)))) }));
107
+ return (_jsx("div", { children: contents.map((text, index) => (_jsx("p", { css: css(tipLineStyle), children: text }, String(index)))) }));
108
108
  }, [tip, readonly]);
109
109
  const OverflowText = ({ text, target }) => {
110
110
  var _a, _b;
111
- return (_jsxs(_Fragment, { children: [_jsx(BaseOverflowTooltip, { className: tooltipStyle, title: text, children: text }), _jsx("span", { className: iconStyle, children: " \u2192 " }), _jsx("div", { className: stateBoxStyle, children: _jsx(BaseOverflowTooltip, { className: flowStateStyle, style: {
111
+ return (_jsxs(_Fragment, { children: [_jsx(BaseOverflowTooltip, { css: css(tooltipStyle), title: text, children: text }), _jsx("span", { css: css(iconStyle), children: " \u2192 " }), _jsx("div", { css: css(stateBoxStyle), children: _jsx(BaseOverflowTooltip, { css: css(flowStateStyle), style: {
112
112
  backgroundColor: (_a = WorkFlowStatusColor[target.type]) === null || _a === void 0 ? void 0 : _a.bgColor,
113
113
  color: (_b = WorkFlowStatusColor[target.type]) === null || _b === void 0 ? void 0 : _b.color,
114
114
  }, title: target.name, children: target.name }) })] }));
115
115
  };
116
- return isCheck && !readonly ? (_jsx("div", { className: cx(flowBtnStyle, loading ? notAllowedStyle : pointerStyle), onClick: () => {
117
- if (!loading) {
118
- handleTransition(text, screenId, scriptValidator);
119
- }
120
- }, children: _jsx(OverflowText, { text: text, target: target }) })) : (_jsx(Tooltip, { title: tipContent, placement: "right", children: _jsx("div", { className: cx(flowBtnStyle, notAllowedStyle), children: _jsx(OverflowText, { text: text, target: target }) }) }));
116
+ return (_jsx(ClassNames, { children: ({ cx, css }) => {
117
+ return isCheck && !readonly ? (_jsx("div", { className: cx(css(flowBtnStyle), loading ? css(notAllowedStyle) : css(pointerStyle)), onClick: () => {
118
+ if (!loading) {
119
+ handleTransition(text, screenId, scriptValidator);
120
+ }
121
+ }, children: _jsx(OverflowText, { text: text, target: target }) })) : (_jsx(Tooltip, { title: tipContent, placement: "right", children: _jsx("div", { className: cx(css(flowBtnStyle), css(notAllowedStyle)), children: _jsx(OverflowText, { text: text, target: target }) }) }));
122
+ } }));
121
123
  };
122
124
  export default memo(FlowButton);
@@ -1,6 +1,6 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
2
  import { memo, useCallback, useEffect, useRef, useState } from 'react';
3
- import { cx } from '@emotion/css';
3
+ import { ClassNames } from '@emotion/react';
4
4
  import { proximaSdk, useListener } from '@giteeteam/proxima-sdk-js';
5
5
  import { message, Spin } from 'antd';
6
6
  import debug from 'debug';
@@ -217,12 +217,12 @@ const TransitionPanel = ({ itemId, itemType, workspace, objectId, onTransitionSu
217
217
  refreshFlag.current++;
218
218
  refresh();
219
219
  });
220
- return (_jsxs(_Fragment, { children: [fetching ? (_jsx(Spin, { className: spinStyle })) : tasks.length ? (_jsx("div", { className: cx(flowNextStyle, `flow-next-global`), children: _jsx("div", { children: tasks.map(task => {
221
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
222
- return (_jsx(TransitionButton, { itemId: itemId, loading: flowing, text: task.name, item: itemData, workspace: workspace, userId: currentUser.id, groupIds: groupIds, roleIds: roleIds, workspaceRoleIds: workspaceRoleIds, currentTaskId: task.id, authUsers: (_b = (_a = task.parameters) === null || _a === void 0 ? void 0 : _a.permissionType) === null || _b === void 0 ? void 0 : _b.users, authRoles: (_d = (_c = task.parameters) === null || _c === void 0 ? void 0 : _c.permissionType) === null || _d === void 0 ? void 0 : _d.roles, authGroups: (_f = (_e = task.parameters) === null || _e === void 0 ? void 0 : _e.permissionType) === null || _f === void 0 ? void 0 : _f.groups, authUserFields: (_h = (_g = task.parameters) === null || _g === void 0 ? void 0 : _g.permissionType) === null || _h === void 0 ? void 0 : _h.customFields, authWorkSpaceRoles: (_k = (_j = task.parameters) === null || _j === void 0 ? void 0 : _j.permissionType) === null || _k === void 0 ? void 0 : _k.workspaceRoles, creatorAuth: (_m = (_l = task.parameters) === null || _l === void 0 ? void 0 : _l.permissionType) === null || _m === void 0 ? void 0 : _m.creatorAuth, scriptValidator: (_o = task.parameters) === null || _o === void 0 ? void 0 : _o.scriptValidator, conditions: (_p = task.parameters) === null || _p === void 0 ? void 0 : _p.fieldType, screenId: (_r = (_q = task.parameters) === null || _q === void 0 ? void 0 : _q.screen) === null || _r === void 0 ? void 0 : _r.key, target: task.target, approval: approval, checkIn: checkIn, handleTransition: handleTransition, hiddenPopover: () => setPopoverVisible(false), readonly: readonly }, task.id));
223
- }) }) })) : (_jsx("span", { onClick: () => {
224
- setPopoverVisible(false);
225
- }, className: noPermissionStyle, children: i18n.t('pages.fields.view.noWorkflowOrAuth') })), _jsx(View, { workflowData: workflowData, hiddenPopover: () => setPopoverVisible(false), name: name, objectId: objectId })] }));
220
+ return (_jsx(ClassNames, { children: ({ cx, css }) => (_jsxs(_Fragment, { children: [fetching ? (_jsx(Spin, { css: css(spinStyle) })) : tasks.length ? (_jsx("div", { className: cx(css(flowNextStyle), `flow-next-global`), children: _jsx("div", { children: tasks.map(task => {
221
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
222
+ return (_jsx(TransitionButton, { itemId: itemId, loading: flowing, text: task.name, item: itemData, workspace: workspace, userId: currentUser.id, groupIds: groupIds, roleIds: roleIds, workspaceRoleIds: workspaceRoleIds, currentTaskId: task.id, authUsers: (_b = (_a = task.parameters) === null || _a === void 0 ? void 0 : _a.permissionType) === null || _b === void 0 ? void 0 : _b.users, authRoles: (_d = (_c = task.parameters) === null || _c === void 0 ? void 0 : _c.permissionType) === null || _d === void 0 ? void 0 : _d.roles, authGroups: (_f = (_e = task.parameters) === null || _e === void 0 ? void 0 : _e.permissionType) === null || _f === void 0 ? void 0 : _f.groups, authUserFields: (_h = (_g = task.parameters) === null || _g === void 0 ? void 0 : _g.permissionType) === null || _h === void 0 ? void 0 : _h.customFields, authWorkSpaceRoles: (_k = (_j = task.parameters) === null || _j === void 0 ? void 0 : _j.permissionType) === null || _k === void 0 ? void 0 : _k.workspaceRoles, creatorAuth: (_m = (_l = task.parameters) === null || _l === void 0 ? void 0 : _l.permissionType) === null || _m === void 0 ? void 0 : _m.creatorAuth, scriptValidator: (_o = task.parameters) === null || _o === void 0 ? void 0 : _o.scriptValidator, conditions: (_p = task.parameters) === null || _p === void 0 ? void 0 : _p.fieldType, screenId: (_r = (_q = task.parameters) === null || _q === void 0 ? void 0 : _q.screen) === null || _r === void 0 ? void 0 : _r.key, target: task.target, approval: approval, checkIn: checkIn, handleTransition: handleTransition, hiddenPopover: () => setPopoverVisible(false), readonly: readonly }, task.id));
223
+ }) }) })) : (_jsx("span", { onClick: () => {
224
+ setPopoverVisible(false);
225
+ }, css: css(noPermissionStyle), children: i18n.t('pages.fields.view.noWorkflowOrAuth') })), _jsx(View, { workflowData: workflowData, hiddenPopover: () => setPopoverVisible(false), name: name, objectId: objectId })] })) }));
226
226
  };
227
227
  function getWorkflowConfig(workflow, statusId) {
228
228
  var _a, _b, _c, _d, _e;
@@ -1,20 +1,17 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { memo, useCallback, useEffect } from 'react';
3
- import { cx } from '@emotion/css';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ import { memo, useCallback } from 'react';
3
+ import { css, Global } from '@emotion/react';
4
4
  import { proximaSdk } from '@giteeteam/proxima-sdk-js';
5
5
  import { WorkflowIcon } from '../../../icons';
6
6
  import { i18n } from '../../../lib/i18n';
7
- import { injectStatusViewGlobalStyle } from './style';
7
+ import { statusViewGlobalStyle } from './style';
8
8
  const View = ({ name, objectId, hiddenPopover, workflowData }) => {
9
9
  const viewClickHandle = useCallback(e => {
10
10
  e.stopPropagation();
11
11
  }, []);
12
- useEffect(() => {
13
- injectStatusViewGlobalStyle();
14
- }, []);
15
- return (_jsx("div", { className: cx('field-layout', 'status-view'), onClick: viewClickHandle, children: _jsxs("span", { onClick: () => {
16
- hiddenPopover === null || hiddenPopover === void 0 ? void 0 : hiddenPopover();
17
- proximaSdk.execute('openItemWorkflowViewerModal', { name, objectId, workflowData });
18
- }, children: [_jsx(WorkflowIcon, { className: 'status-view-watch' }), i18n.t('pages.fields.view.viewWorkflow')] }) }));
12
+ return (_jsxs("div", { className: 'field-layout status-view', onClick: viewClickHandle, children: [_jsx(Global, { styles: css(statusViewGlobalStyle) }), _jsxs("span", { onClick: () => {
13
+ hiddenPopover === null || hiddenPopover === void 0 ? void 0 : hiddenPopover();
14
+ proximaSdk.execute('openItemWorkflowViewerModal', { name, objectId, workflowData });
15
+ }, children: [_jsx(WorkflowIcon, { className: 'status-view-watch' }), i18n.t('pages.fields.view.viewWorkflow')] })] }));
19
16
  };
20
17
  export default memo(View);
@@ -1,20 +1,20 @@
1
- export declare const readViewWrapper: string;
2
- export declare const workflowContentStyle: string;
1
+ export declare const readViewWrapper = "\n display: -webkit-box;\n align-items: center;\n justify-content: center;\n min-width: 62px;\n height: 22px;\n padding: 0 8px;\n font-size: 12px;\n font-weight: 600;\n line-height: 22px;\n text-align: center;\n border-radius: 4px;\n";
2
+ export declare const workflowContentStyle = "\n max-width: 200px;\n text-align: left;\n";
3
3
  export declare const statePopoverStyle: (antPrefix: string) => string;
4
- export declare const flowNextStyle: string;
5
- export declare const flowStateStyle: string;
6
- export declare const flowStateInWorkflowStyle: string;
7
- export declare const flowStateButtonStyle: string;
8
- export declare const stateBtnStyle: string;
9
- export declare const noStateStyle: string;
10
- export declare const caretDownStyle: string;
11
- export declare const injectStatusViewGlobalStyle: () => void;
12
- export declare const tipLineStyle: string;
13
- export declare const tooltipStyle: string;
14
- export declare const iconStyle: string;
15
- export declare const stateBoxStyle: string;
16
- export declare const flowBtnStyle: string;
17
- export declare const notAllowedStyle: string;
18
- export declare const pointerStyle: string;
19
- export declare const spinStyle: string;
20
- export declare const noPermissionStyle: string;
4
+ export declare const flowNextStyle = "\n max-height: 260px;\n padding-top: 10px;\n overflow: auto;\n";
5
+ export declare const flowStateStyle = "\n min-width: 62px;\n height: 24px;\n padding: 0 18px 0 8px;\n font-size: 12px;\n font-weight: 600;\n line-height: 24px;\n color: #fff;\n text-align: center;\n background: #cdcdcd;\n border-radius: 4px;\n box-shadow: none !important;\n\n span {\n text-decoration: none !important;\n }\n";
6
+ export declare const flowStateInWorkflowStyle = "\n :not(.add-weights) {\n min-width: 62px;\n height: 22px;\n padding: 0 8px;\n font-size: 12px;\n font-weight: 600;\n line-height: 22px;\n color: #fff;\n text-align: center;\n background: #cdcdcd;\n border-radius: 4px;\n\n display: flex;\n align-items: center;\n justify-content: center;\n }\n";
7
+ export declare const flowStateButtonStyle = "\n &:not(.add-weights) > span {\n display: -webkit-box;\n }\n";
8
+ export declare const stateBtnStyle = "\n height: 22px;\n line-height: 22px;\n";
9
+ export declare const noStateStyle = "\n color: #909aaa;\n background: #F1F2F4;\n";
10
+ export declare const caretDownStyle = "\n padding-left: 2px;\n margin-left: 0;\n line-height: 10px;\n";
11
+ export declare const statusViewGlobalStyle = "\n.field-layout.status-view {\n position: relative;\n padding: 10px;\n margin-top: 10px;\n font-size: 12px;\n cursor: pointer;\n border-top: 1px solid #ddd;\n}\n\n.field-layout.status-view .status-view-watch {\n width: 12px;\n height: 12px;\n margin-right: 5px;\n font-size: 12px;\n vertical-align: middle;\n}\n";
12
+ export declare const tipLineStyle = "\n margin-bottom: 0;\n";
13
+ export declare const tooltipStyle = "\n width: 80px;\n";
14
+ export declare const iconStyle = "\n padding: 0 6px;\n color: #848C9F;\n";
15
+ export declare const stateBoxStyle = "\n display: flex;\n width: 80px;\n\n span {\n padding-right: 8px;\n }\n";
16
+ export declare const flowBtnStyle = "\n display: flex;\n padding: 5px 10px;\n margin: 0;\n\n &:hover {\n background-color: var(--select-item-selected-bg, #e6f3ff);\n }\n";
17
+ export declare const notAllowedStyle = "\n cursor: not-allowed;\n opacity: 0.3;\n";
18
+ export declare const pointerStyle = "\n cursor: pointer;\n";
19
+ export declare const spinStyle = "\n width: 150px;\n height: 50px;\n";
20
+ export declare const noPermissionStyle = "\n display: block;\n width: 120px;\n padding: 20px 10px 10px;\n font-size: 12px;\n color: #2e405e;\n";
@@ -1,6 +1,5 @@
1
- import { css, injectGlobal } from '@emotion/css';
2
1
  import { fieldLabelColor, gray7, statusCellMinWidth, themeBgColorBase } from '../../../../style/common';
3
- export const readViewWrapper = css `
2
+ export const readViewWrapper = `
4
3
  display: -webkit-box;
5
4
  align-items: center;
6
5
  justify-content: center;
@@ -13,11 +12,11 @@ export const readViewWrapper = css `
13
12
  text-align: center;
14
13
  border-radius: 4px;
15
14
  `;
16
- export const workflowContentStyle = css `
15
+ export const workflowContentStyle = `
17
16
  max-width: 200px;
18
17
  text-align: left;
19
18
  `;
20
- export const statePopoverStyle = (antPrefix) => css `
19
+ export const statePopoverStyle = (antPrefix) => `
21
20
  z-index: 1000 !important;
22
21
 
23
22
  div.${antPrefix}-popover-inner-content, div.${antPrefix}-popover-inner {
@@ -30,12 +29,12 @@ export const statePopoverStyle = (antPrefix) => css `
30
29
  border-width: 0;
31
30
  }
32
31
  `;
33
- export const flowNextStyle = css `
32
+ export const flowNextStyle = `
34
33
  max-height: 260px;
35
34
  padding-top: 10px;
36
35
  overflow: auto;
37
36
  `;
38
- export const flowStateStyle = css `
37
+ export const flowStateStyle = `
39
38
  min-width: ${statusCellMinWidth};
40
39
  height: 24px;
41
40
  padding: 0 18px 0 8px;
@@ -52,7 +51,7 @@ export const flowStateStyle = css `
52
51
  text-decoration: none !important;
53
52
  }
54
53
  `;
55
- export const flowStateInWorkflowStyle = css `
54
+ export const flowStateInWorkflowStyle = `
56
55
  :not(.add-weights) {
57
56
  min-width: ${statusCellMinWidth};
58
57
  height: 22px;
@@ -70,55 +69,53 @@ export const flowStateInWorkflowStyle = css `
70
69
  justify-content: center;
71
70
  }
72
71
  `;
73
- export const flowStateButtonStyle = css `
72
+ export const flowStateButtonStyle = `
74
73
  &:not(.add-weights) > span {
75
74
  display: -webkit-box;
76
75
  }
77
76
  `;
78
- export const stateBtnStyle = css `
77
+ export const stateBtnStyle = `
79
78
  height: 22px;
80
79
  line-height: 22px;
81
80
  `;
82
- export const noStateStyle = css `
81
+ export const noStateStyle = `
83
82
  color: ${fieldLabelColor};
84
83
  background: ${themeBgColorBase};
85
84
  `;
86
- export const caretDownStyle = css `
85
+ export const caretDownStyle = `
87
86
  padding-left: 2px;
88
87
  margin-left: 0;
89
88
  line-height: 10px;
90
89
  `;
91
- export const injectStatusViewGlobalStyle = () => {
92
- injectGlobal `
93
- .field-layout.status-view {
94
- position: relative;
95
- padding: 10px;
96
- margin-top: 10px;
97
- font-size: 12px;
98
- cursor: pointer;
99
- border-top: 1px solid #ddd;
100
- }
90
+ export const statusViewGlobalStyle = `
91
+ .field-layout.status-view {
92
+ position: relative;
93
+ padding: 10px;
94
+ margin-top: 10px;
95
+ font-size: 12px;
96
+ cursor: pointer;
97
+ border-top: 1px solid #ddd;
98
+ }
101
99
 
102
- .field-layout.status-view .status-view-watch {
103
- width: 12px;
104
- height: 12px;
105
- margin-right: 5px;
106
- font-size: 12px;
107
- vertical-align: middle;
108
- }
109
- `;
110
- };
111
- export const tipLineStyle = css `
100
+ .field-layout.status-view .status-view-watch {
101
+ width: 12px;
102
+ height: 12px;
103
+ margin-right: 5px;
104
+ font-size: 12px;
105
+ vertical-align: middle;
106
+ }
107
+ `;
108
+ export const tipLineStyle = `
112
109
  margin-bottom: 0;
113
110
  `;
114
- export const tooltipStyle = css `
111
+ export const tooltipStyle = `
115
112
  width: 80px;
116
113
  `;
117
- export const iconStyle = css `
114
+ export const iconStyle = `
118
115
  padding: 0 6px;
119
116
  color: ${gray7};
120
117
  `;
121
- export const stateBoxStyle = css `
118
+ export const stateBoxStyle = `
122
119
  display: flex;
123
120
  width: 80px;
124
121
 
@@ -126,7 +123,7 @@ export const stateBoxStyle = css `
126
123
  padding-right: 8px;
127
124
  }
128
125
  `;
129
- export const flowBtnStyle = css `
126
+ export const flowBtnStyle = `
130
127
  display: flex;
131
128
  padding: 5px 10px;
132
129
  margin: 0;
@@ -135,18 +132,18 @@ export const flowBtnStyle = css `
135
132
  background-color: var(--select-item-selected-bg, #e6f3ff);
136
133
  }
137
134
  `;
138
- export const notAllowedStyle = css `
135
+ export const notAllowedStyle = `
139
136
  cursor: not-allowed;
140
137
  opacity: 0.3;
141
138
  `;
142
- export const pointerStyle = css `
139
+ export const pointerStyle = `
143
140
  cursor: pointer;
144
141
  `;
145
- export const spinStyle = css `
142
+ export const spinStyle = `
146
143
  width: 150px;
147
144
  height: 50px;
148
145
  `;
149
- export const noPermissionStyle = css `
146
+ export const noPermissionStyle = `
150
147
  display: block;
151
148
  width: 120px;
152
149
  padding: 20px 10px 10px;
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
2
2
  import EmptyField from '../../common/EmptyField';
3
3
  const StoryPointReadView = ({ value, readonly }) => {
4
4
  if (!value) {
@@ -1,5 +1,6 @@
1
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
2
2
  import { memo, useMemo } from 'react';
3
+ import { css } from '@emotion/react';
3
4
  import { Tag as AntdTag } from 'antd';
4
5
  import { isObject } from 'lodash-es';
5
6
  import EmptyField from '../../common/EmptyField';
@@ -13,7 +14,7 @@ const TagReadView = memo(({ value }) => {
13
14
  })
14
15
  : [];
15
16
  }, [value]);
16
- const content = useMemo(() => tags.length ? (tags.map(item => (_jsx(AntdTag, { className: baseTagStyle, children: _jsx(BaseOverflowTooltip, { title: item, children: item }) }, item)))) : (_jsx(EmptyField, { readonly: true })), [tags]);
17
+ const content = useMemo(() => tags.length ? (tags.map(item => (_jsx(AntdTag, { css: css(baseTagStyle), children: _jsx(BaseOverflowTooltip, { title: item, children: item }) }, item)))) : (_jsx(EmptyField, { readonly: true })), [tags]);
17
18
  return _jsx(_Fragment, { children: content });
18
19
  });
19
20
  TagReadView.displayName = 'TagReadView';
@@ -1 +1 @@
1
- export declare const baseTagStyle: string;
1
+ export declare const baseTagStyle = "\n max-width: 6em;\n height: 22px;\n white-space: normal;\n vertical-align: middle;\n";
@@ -1,5 +1,4 @@
1
- import { css } from '@emotion/css';
2
- export const baseTagStyle = css `
1
+ export const baseTagStyle = `
3
2
  max-width: 6em;
4
3
  height: 22px;
5
4
  white-space: normal;
@@ -1,5 +1,6 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
2
  import { memo } from 'react';
3
+ import { css } from '@emotion/react';
3
4
  import useCurrentWorkspace from '../../../lib/hooks/useCurrentWorkspace';
4
5
  import { i18n } from '../../../lib/i18n';
5
6
  import EmptyField from '../../common/EmptyField';
@@ -11,7 +12,7 @@ const TeamReadView = memo(({ value, readonly }) => {
11
12
  const deleted = value === null || value === void 0 ? void 0 : value.every(team => team.deleted);
12
13
  const forbidden = value === null || value === void 0 ? void 0 : value.every(team => !team.enable);
13
14
  const { workspaceKey } = useCurrentWorkspace();
14
- return (value === null || value === void 0 ? void 0 : value.length) ? (hasName ? (_jsx(BaseOverflowTooltip, { className: forbidden ? forbiddenStyle : undefined, children: (_a = value === null || value === void 0 ? void 0 : value.map(team => (team.enable ? team.name : `${team.name}(${i18n.t('global.columns.forbiddenActive')})`))) === null || _a === void 0 ? void 0 : _a.join(',') })) : deleted ? (_jsx(BaseOverflowTooltip, { className: deletedStyle, children: i18n.t('global.haveDelete') })) : null) : (_jsx(EmptyField, { readonly: readonly || !workspaceKey }));
15
+ return (value === null || value === void 0 ? void 0 : value.length) ? (hasName ? (_jsx(BaseOverflowTooltip, { css: forbidden ? css(forbiddenStyle) : undefined, children: (_a = value === null || value === void 0 ? void 0 : value.map(team => (team.enable ? team.name : `${team.name}(${i18n.t('global.columns.forbiddenActive')})`))) === null || _a === void 0 ? void 0 : _a.join(',') })) : deleted ? (_jsx(BaseOverflowTooltip, { css: css(deletedStyle), children: i18n.t('global.haveDelete') })) : null) : (_jsx(EmptyField, { readonly: readonly || !workspaceKey }));
15
16
  });
16
17
  TeamReadView.displayName = 'TeamReadView';
17
18
  export default TeamReadView;
@@ -1,2 +1,2 @@
1
- export declare const forbiddenStyle: string;
2
- export declare const deletedStyle: string;
1
+ export declare const forbiddenStyle = "\n text-decoration: line-through;\n";
2
+ export declare const deletedStyle = "\n text-decoration: line-through;\n";
@@ -1,5 +1,4 @@
1
- import { css } from '@emotion/css';
2
- export const forbiddenStyle = css `
1
+ export const forbiddenStyle = `
3
2
  text-decoration: line-through;
4
3
  `;
5
4
  export const deletedStyle = forbiddenStyle;
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
2
  import { memo, useMemo } from 'react';
3
3
  import EmptyField from '../../common/EmptyField';
4
4
  import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip';
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
2
  import { memo, useEffect, useMemo, useState } from 'react';
3
3
  import { cloneDeep } from 'lodash-es';
4
4
  import EmptyField from '../../common/EmptyField';
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
2
  import { memo, useMemo } from 'react';
3
3
  import useDateTimeFormatType from '../../../lib/hooks/useDateTimeFormatType';
4
4
  import EmptyField from '../../common/EmptyField';
@@ -2,5 +2,5 @@
2
2
  import { User as UserTyped } from '../../../lib/types/models';
3
3
  declare const UpdatedByReadView: import("react").MemoExoticComponent<({ value }: {
4
4
  value: UserTyped;
5
- }) => import("react/jsx-runtime").JSX.Element>;
5
+ }) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element>;
6
6
  export default UpdatedByReadView;
@@ -1,6 +1,6 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
2
  import { memo, useMemo } from 'react';
3
- import { cx } from '@emotion/css';
3
+ import { ClassNames } from '@emotion/react';
4
4
  import { generateUserDisplayName, isUserDeleted, isUserDisabled } from '../../../lib/useUser';
5
5
  import EmptyField from '../../common/EmptyField';
6
6
  import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip';
@@ -13,13 +13,10 @@ const UpdatedByReadView = memo(({ value }) => {
13
13
  }
14
14
  return '';
15
15
  }, [value]);
16
- const className = useMemo(() => {
17
- return cx(usernameStyle, isUserDeleted(value) ? userDeletedStyle : '', isUserDisabled(value) ? userDisabledStyle : '');
18
- }, [value]);
19
16
  if (!showValue) {
20
17
  return _jsx(EmptyField, { readonly: true });
21
18
  }
22
- return (_jsxs(BaseOverflowTooltip, { title: showValue, maxline: 1, children: [_jsx(UserAvatar, { user: value }), _jsx("span", { className: className, children: showValue })] }));
19
+ return (_jsx(ClassNames, { children: ({ cx, css }) => (_jsxs(BaseOverflowTooltip, { title: showValue, maxline: 1, children: [_jsx(UserAvatar, { user: value }), _jsx("span", { className: cx(css(usernameStyle), isUserDeleted(value) ? css(userDeletedStyle) : '', isUserDisabled(value) ? css(userDisabledStyle) : ''), children: showValue })] })) }));
23
20
  });
24
21
  UpdatedByReadView.displayName = 'UpdatedByReadView';
25
22
  export default UpdatedByReadView;
@@ -1,6 +1,6 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
2
  import { memo, useMemo } from 'react';
3
- import { cx } from '@emotion/css';
3
+ import { ClassNames } from '@emotion/react';
4
4
  import { generateUserDisplayName, isUserDeleted, isUserDisabled, userDataFormat } from '../../../lib/useUser';
5
5
  import EmptyField from '../../common/EmptyField';
6
6
  import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip';
@@ -10,7 +10,7 @@ const UserReadView = memo(({ value, readonly }) => {
10
10
  const displayValues = useMemo(() => {
11
11
  return ((value === null || value === void 0 ? void 0 : value.map((val, i) => {
12
12
  const item = userDataFormat(val);
13
- return (_jsxs("span", { children: [i ? ',' : '', _jsx("span", { className: cx({ [userDeletedStyle]: isUserDeleted(item) }, { [userDisabledStyle]: isUserDisabled(item) }), children: generateUserDisplayName(item) })] }, i));
13
+ return (_jsxs("span", { children: [i ? ',' : '', _jsx(ClassNames, { children: ({ cx, css }) => (_jsx("span", { className: cx({ [css(userDeletedStyle)]: isUserDeleted(item) }, { [css(userDisabledStyle)]: isUserDisabled(item) }), children: generateUserDisplayName(item) })) })] }, i));
14
14
  })) || EMPTY_ARRAY);
15
15
  }, [value]);
16
16
  if (!displayValues.length) {
@@ -1,3 +1,3 @@
1
- export declare const userDisabledStyle: string;
2
- export declare const userDeletedStyle: string;
3
- export declare const usernameStyle: string;
1
+ export declare const userDisabledStyle = "\n color: #C1C5CF;\n";
2
+ export declare const userDeletedStyle = "\n text-decoration: line-through;\n";
3
+ export declare const usernameStyle = "\n font-size: 14px;\n line-height: 20px;\n color: #213053;\n";
@@ -1,12 +1,11 @@
1
- import { css } from '@emotion/css';
2
1
  import { gray6, gray9 } from '../../../../style/common';
3
- export const userDisabledStyle = css `
2
+ export const userDisabledStyle = `
4
3
  color: ${gray6};
5
4
  `;
6
- export const userDeletedStyle = css `
5
+ export const userDeletedStyle = `
7
6
  text-decoration: line-through;
8
7
  `;
9
- export const usernameStyle = css `
8
+ export const usernameStyle = `
10
9
  font-size: 14px;
11
10
  line-height: 20px;
12
11
  color: ${gray9};
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
2
  import { useEffect, useMemo, useState } from 'react';
3
3
  import { isNil, isObject } from 'lodash-es';
4
4
  import EmptyField from '../../common/EmptyField';
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
2
  import { memo } from 'react';
3
3
  import useCurrentWorkspace from '../../../lib/hooks/useCurrentWorkspace';
4
4
  import EmptyField from '../../common/EmptyField';
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
2
  import { memo } from 'react';
3
3
  import EmptyField from '../../common/EmptyField';
4
4
  import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip';
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
2
  import { memo } from 'react';
3
3
  import { omit } from 'lodash-es';
4
4
  const EditTableCell = ({ overlayClsName, itemTypeId, workspaceId, readonly, id, objectId, property, text, Component, handleChange, }) => {
@@ -1,10 +1,10 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useCallback, useEffect, useRef, useState } from 'react';
3
- import { cx } from '@emotion/css';
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ import { useCallback, useRef, useState } from 'react';
3
+ import { css, Global } from '@emotion/react';
4
4
  import { isEmpty } from 'lodash-es';
5
5
  import EmptyField from '../common/EmptyField';
6
6
  import EditTableCell from './EditTableCell';
7
- import { injectFieldCellGlobalStyle } from './style';
7
+ import { fieldCellGlobalStyle } from './style';
8
8
  const reduceObjArr = ({ arr, keys }) => {
9
9
  return arr.reduce((accumulatorStr, nextObj) => {
10
10
  const nextValue = keys.length > 1 ? `${nextObj[keys[0]]}(${nextObj[keys[1]]})` : nextObj[keys[0]];
@@ -37,10 +37,10 @@ const transferItem = item => {
37
37
  };
38
38
  const EMPTY_ARRAY = [];
39
39
  const defaultValue = {};
40
- export const TableCell = ({ className, cellData, column, rowData, readComponents = defaultValue, editComponents = defaultValue, handleChange, }) => {
40
+ const BaseTableCell = ({ className, cellData, column, rowData, readComponents = defaultValue, editComponents = defaultValue, handleChange, }) => {
41
41
  var _a, _b, _c;
42
42
  const [cellEntered, setCellEntered] = useState(false);
43
- const cls = cx('field-cell-layout', 'field-layout', className);
43
+ const cls = `field-cell-layout field-layout ${className}`;
44
44
  const timeoutCurrent = useRef();
45
45
  const ReadComponent = readComponents[column.cellType] || readComponents[column.componentType];
46
46
  const EditComponent = readComponents[column.cellType] || readComponents[column.componentType];
@@ -52,9 +52,6 @@ export const TableCell = ({ className, cellData, column, rowData, readComponents
52
52
  }, 50);
53
53
  }
54
54
  }, [editComponents]);
55
- useEffect(() => {
56
- injectFieldCellGlobalStyle();
57
- }, []);
58
55
  if (cellEntered && EditComponent) {
59
56
  const { property, data, objectId } = column;
60
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: rowData.readonly, objectId: objectId, text: cellData, handleChange: handleChange }) }));
@@ -65,3 +62,6 @@ export const TableCell = ({ className, cellData, column, rowData, readComponents
65
62
  const text = transferItem(cellData !== null && cellData !== void 0 ? cellData : rowData[column.dataIndex]);
66
63
  return _jsx("div", { className: cls, children: text });
67
64
  };
65
+ export const TableCell = props => {
66
+ return (_jsxs(_Fragment, { children: [_jsx(Global, { styles: css(fieldCellGlobalStyle) }), _jsx(BaseTableCell, { ...props })] }));
67
+ };
@@ -1 +1 @@
1
- export declare const injectFieldCellGlobalStyle: () => void;
1
+ export declare const fieldCellGlobalStyle = "\n.field-cell-layout {\n align-items: center;\n width: 100%;\n}\n";