@giteeteam/apps-team-components 1.3.0-alpha.1 → 1.3.0-alpha.2

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 (219) hide show
  1. package/dist/components/common/EmptyField.d.ts +0 -1
  2. package/dist/components/common/EmptyField.js +7 -5
  3. package/dist/components/common/PriceTag.js +11 -8
  4. package/dist/components/common/expand-component/index.d.ts +0 -1
  5. package/dist/components/common/expand-component/index.js +12 -10
  6. package/dist/components/common/expand-component/style.js +4 -2
  7. package/dist/components/common/item-icon/ItemIcon.d.ts +0 -1
  8. package/dist/components/common/item-icon/ItemIcon.js +6 -4
  9. package/dist/components/common/overflow-tooltip/BaseOverflowTooltip.d.ts +0 -1
  10. package/dist/components/common/overflow-tooltip/BaseOverflowTooltip.js +9 -6
  11. package/dist/components/common/overflow-tooltip/OverflowTooltip.js +9 -6
  12. package/dist/components/common/overflow-tooltip/SimpleOverflowToolTip.js +8 -5
  13. package/dist/components/common/overflow-tooltip/style/index.js +5 -3
  14. package/dist/components/common/style/global.js +3 -1
  15. package/dist/components/common/style/mixin.js +6 -3
  16. package/dist/components/common/user-field/UserAvatar.js +8 -6
  17. package/dist/components/common/user-field/style/index.js +5 -3
  18. package/dist/components/common/utils.js +13 -9
  19. package/dist/components/default-empty-icon/config.js +11 -6
  20. package/dist/components/default-empty-icon/index.js +10 -9
  21. package/dist/components/default-empty-icon/style.js +15 -12
  22. package/dist/components/default-empty-icon/types.js +3 -1
  23. package/dist/components/field-behavior/fields/type.js +5 -2
  24. package/dist/components/fields/actors/BaseField.js +5 -2
  25. package/dist/components/fields/actors/ReadView.d.ts +0 -1
  26. package/dist/components/fields/actors/ReadView.js +8 -6
  27. package/dist/components/fields/ancestor/ReadView.js +8 -6
  28. package/dist/components/fields/ancestor/utils.js +4 -12
  29. package/dist/components/fields/assignee/ReadView.d.ts +0 -1
  30. package/dist/components/fields/assignee/ReadView.js +13 -11
  31. package/dist/components/fields/base-component/utils.js +3 -1
  32. package/dist/components/fields/bind-workspace/ReadView.d.ts +0 -1
  33. package/dist/components/fields/bind-workspace/ReadView.js +11 -9
  34. package/dist/components/fields/bind-workspace/hooks.js +7 -4
  35. package/dist/components/fields/bind-workspace/style/index.js +3 -1
  36. package/dist/components/fields/cascade/ReadView.js +8 -6
  37. package/dist/components/fields/cascade/utils.js +4 -3
  38. package/dist/components/fields/checkbox/ReadView.d.ts +0 -1
  39. package/dist/components/fields/checkbox/ReadView.js +7 -5
  40. package/dist/components/fields/created-at/ReadView.js +10 -8
  41. package/dist/components/fields/created-by/ReadView.d.ts +0 -1
  42. package/dist/components/fields/created-by/ReadView.js +11 -9
  43. package/dist/components/fields/data-quote/ReadView.js +12 -10
  44. package/dist/components/fields/data-quote/utils.js +5 -3
  45. package/dist/components/fields/date/ReadView.d.ts +0 -1
  46. package/dist/components/fields/date/ReadView.js +8 -6
  47. package/dist/components/fields/dropdown/BaseField.js +42 -40
  48. package/dist/components/fields/dropdown/Cell.d.ts +0 -1
  49. package/dist/components/fields/dropdown/Cell.js +6 -4
  50. package/dist/components/fields/dropdown/ReadView.d.ts +0 -1
  51. package/dist/components/fields/dropdown/ReadView.js +10 -8
  52. package/dist/components/fields/dropdown/data.d.ts +1 -1
  53. package/dist/components/fields/dropdown/data.js +6 -3
  54. package/dist/components/fields/dropdown/hook.d.ts +0 -1
  55. package/dist/components/fields/dropdown/hook.js +11 -8
  56. package/dist/components/fields/dropdown/style.js +21 -18
  57. package/dist/components/fields/file/ReadView.d.ts +0 -1
  58. package/dist/components/fields/file/ReadView.js +7 -5
  59. package/dist/components/fields/formula/ReadView.d.ts +0 -1
  60. package/dist/components/fields/formula/ReadView.js +7 -5
  61. package/dist/components/fields/hooks/useViewClass.js +4 -2
  62. package/dist/components/fields/hyper-link/ReadView.d.ts +0 -1
  63. package/dist/components/fields/hyper-link/ReadView.js +8 -6
  64. package/dist/components/fields/hyper-link/style/index.js +7 -4
  65. package/dist/components/fields/item-group/ReadView.d.ts +0 -1
  66. package/dist/components/fields/item-group/ReadView.js +6 -4
  67. package/dist/components/fields/item-type/ItemTypeIcon.js +15 -17
  68. package/dist/components/fields/item-type/ReadView.d.ts +0 -1
  69. package/dist/components/fields/item-type/ReadView.js +7 -5
  70. package/dist/components/fields/item-type/style/index.js +3 -1
  71. package/dist/components/fields/key/ReadView.d.ts +0 -1
  72. package/dist/components/fields/key/ReadView.js +7 -5
  73. package/dist/components/fields/long-text/ReadView.d.ts +0 -1
  74. package/dist/components/fields/long-text/ReadView.js +8 -6
  75. package/dist/components/fields/long-text/style/index.js +3 -1
  76. package/dist/components/fields/number/BaseField.js +5 -2
  77. package/dist/components/fields/number/ReadView.d.ts +0 -1
  78. package/dist/components/fields/number/ReadView.js +8 -6
  79. package/dist/components/fields/priority/ReadView.js +12 -10
  80. package/dist/components/fields/priority/style/index.js +11 -8
  81. package/dist/components/fields/radio/ReadView.d.ts +0 -1
  82. package/dist/components/fields/radio/ReadView.js +8 -6
  83. package/dist/components/fields/repo-files/ReadView.js +8 -6
  84. package/dist/components/fields/repo-files/utils.js +5 -3
  85. package/dist/components/fields/reporter/ReadView.d.ts +0 -1
  86. package/dist/components/fields/reporter/ReadView.js +11 -9
  87. package/dist/components/fields/script/BaseField.js +4 -1
  88. package/dist/components/fields/script/ReadView.d.ts +0 -1
  89. package/dist/components/fields/script/ReadView.js +10 -8
  90. package/dist/components/fields/sprint/ReadView.js +7 -5
  91. package/dist/components/fields/status/Cell.js +8 -6
  92. package/dist/components/fields/status/Field.d.ts +0 -1
  93. package/dist/components/fields/status/ReadView.js +10 -8
  94. package/dist/components/fields/status/SelectFlowHandler.js +15 -12
  95. package/dist/components/fields/status/SelectTransition.js +13 -10
  96. package/dist/components/fields/status/Transition.js +18 -15
  97. package/dist/components/fields/status/TransitionButton.js +17 -14
  98. package/dist/components/fields/status/TransitionPanel.js +14 -11
  99. package/dist/components/fields/status/View.js +11 -8
  100. package/dist/components/fields/status/style/index.js +36 -59
  101. package/dist/components/fields/story-point/ReadView.d.ts +0 -1
  102. package/dist/components/fields/story-point/ReadView.js +6 -4
  103. package/dist/components/fields/tag/ReadView.js +10 -8
  104. package/dist/components/fields/tag/style/index.js +3 -1
  105. package/dist/components/fields/team/ReadView.js +10 -8
  106. package/dist/components/fields/team/style/index.js +4 -2
  107. package/dist/components/fields/text/BaseField.d.ts +0 -1
  108. package/dist/components/fields/text/ReadView.js +8 -6
  109. package/dist/components/fields/tree/ReadView.js +10 -8
  110. package/dist/components/fields/tree/utils.js +5 -3
  111. package/dist/components/fields/updated-at/ReadView.js +10 -8
  112. package/dist/components/fields/updated-by/ReadView.d.ts +0 -1
  113. package/dist/components/fields/updated-by/ReadView.js +11 -9
  114. package/dist/components/fields/user/ReadView.d.ts +0 -1
  115. package/dist/components/fields/user/ReadView.js +11 -9
  116. package/dist/components/fields/user/style/index.js +7 -4
  117. package/dist/components/fields/user-group/BaseField.d.ts +0 -1
  118. package/dist/components/fields/user-group/ReadView.js +11 -13
  119. package/dist/components/fields/version/ReadView.js +8 -6
  120. package/dist/components/fields/workspace/ReadView.d.ts +0 -1
  121. package/dist/components/fields/workspace/ReadView.js +10 -8
  122. package/dist/components/filters/filter-search/utils.js +6 -6
  123. package/dist/components/item/hooks.js +5 -2
  124. package/dist/components/table-components/EditTableCell.js +6 -3
  125. package/dist/components/table-components/index.js +14 -11
  126. package/dist/components/table-components/style/index.js +3 -1
  127. package/dist/components/table-components/utils.js +49 -46
  128. package/dist/icons/SyncIconFont.js +7 -5
  129. package/dist/icons/createFromIconFontClass.js +3 -1
  130. package/dist/icons/empty-icon/index.d.ts +8 -1
  131. package/dist/icons/empty-icon/large-item@2x.png.js +3 -0
  132. package/dist/icons/empty-icon/large-workspace@2x.png.js +3 -0
  133. package/dist/icons/empty-icon/small-default@2x.png.js +3 -0
  134. package/dist/icons/index.d.ts +1 -1
  135. package/dist/icons/index.js +37 -35
  136. package/dist/icons/style/index.js +4 -2
  137. package/dist/icons/svg/ArrowBack.svg.js +3 -0
  138. package/dist/icons/svg/Done.svg.js +3 -0
  139. package/dist/icons/svg/DottedCircle.svg.js +3 -0
  140. package/dist/icons/svg/HollowCircle.svg.js +3 -0
  141. package/dist/icons/svg/Search.svg.js +3 -0
  142. package/dist/icons/svg/Workflow.svg.js +3 -0
  143. package/dist/index.js +47 -47
  144. package/dist/lib/app/utils.d.ts +0 -1
  145. package/dist/lib/app/utils.js +4 -2
  146. package/dist/lib/array.js +5 -44
  147. package/dist/lib/config.js +8 -6
  148. package/dist/lib/constants/code.js +3 -1
  149. package/dist/lib/constants/field.js +5 -2
  150. package/dist/lib/contexts/antdConfig.js +10 -7
  151. package/dist/lib/contexts/currentUser.js +7 -4
  152. package/dist/lib/contexts/currentWorkspace.js +7 -4
  153. package/dist/lib/contexts/datetimeFormat.js +7 -4
  154. package/dist/lib/contexts/index.js +16 -13
  155. package/dist/lib/contexts/itemConfig.js +7 -4
  156. package/dist/lib/contexts/teamConfig.js +8 -5
  157. package/dist/lib/contexts/tenant.js +7 -4
  158. package/dist/lib/contexts/workflowConfig.js +7 -4
  159. package/dist/lib/dataType.js +4 -5
  160. package/dist/lib/date.js +11 -52
  161. package/dist/lib/dayjs.js +2 -1
  162. package/dist/lib/error/log.js +7 -4
  163. package/dist/lib/error/utils.d.ts +1 -1
  164. package/dist/lib/error/utils.js +8 -20
  165. package/dist/lib/error/withServerError.js +3 -1
  166. package/dist/lib/fetch.js +23 -54
  167. package/dist/lib/global.js +16 -14
  168. package/dist/lib/hooks/useAntdConfig.js +4 -2
  169. package/dist/lib/hooks/useCurrentUser.js +4 -2
  170. package/dist/lib/hooks/useCurrentWorkspace.js +4 -2
  171. package/dist/lib/hooks/useDataQuoteStore.js +8 -5
  172. package/dist/lib/hooks/useDateTimeFormatType.js +4 -2
  173. package/dist/lib/hooks/useI18n.d.ts +1 -1
  174. package/dist/lib/hooks/useI18n.js +4 -2
  175. package/dist/lib/hooks/useItemConfig.js +4 -2
  176. package/dist/lib/hooks/useTeamConfig.js +4 -2
  177. package/dist/lib/hooks/useTenant.js +4 -2
  178. package/dist/lib/hooks/useWorkflowConfig.js +4 -2
  179. package/dist/lib/i18n.js +6 -3
  180. package/dist/lib/icons/utils.js +10 -9
  181. package/dist/lib/isInOne.js +2 -1
  182. package/dist/lib/number.js +3 -1
  183. package/dist/lib/path.d.ts +2 -2
  184. package/dist/lib/path.js +9 -6
  185. package/dist/lib/regExp.js +3 -1
  186. package/dist/lib/router.js +4 -1
  187. package/dist/lib/storage.js +4 -39
  188. package/dist/lib/store/dataQuoteStore.js +5 -2
  189. package/dist/lib/swr/constants.js +4 -2
  190. package/dist/lib/swr/hooks.js +6 -3
  191. package/dist/lib/swr/throttleWithCache.js +7 -5
  192. package/dist/lib/throttleFetch.js +4 -2
  193. package/dist/lib/useConfig.js +9 -6
  194. package/dist/lib/useUser.js +9 -6
  195. package/dist/lib/users.js +5 -2
  196. package/dist/lib/workflow.js +21 -20
  197. package/dist/locales/index.js +5 -3
  198. package/dist/style/common.js +11 -24
  199. package/dist/style/global.js +3 -1
  200. package/package.json +8 -2
  201. package/dist/components/fields/base-component/types.js +0 -1
  202. package/dist/components/fields/hooks/useParamsAdapter.js +0 -1
  203. package/dist/components/fields/radio/BaseField.js +0 -1
  204. package/dist/components/fields/status/Field.js +0 -1
  205. package/dist/components/fields/tag/BaseField.js +0 -1
  206. package/dist/components/fields/text/BaseField.js +0 -1
  207. package/dist/components/fields/tree/BaseField.js +0 -1
  208. package/dist/components/fields/tree/types.js +0 -1
  209. package/dist/components/fields/types.js +0 -1
  210. package/dist/components/fields/user-group/ActionCell.js +0 -1
  211. package/dist/components/fields/user-group/BaseField.js +0 -1
  212. package/dist/icons/empty-icon/index.js +0 -8
  213. package/dist/icons/svg/ArrowBack.svg +0 -1
  214. package/dist/icons/svg/Done.svg +0 -1
  215. package/dist/icons/svg/DottedCircle.svg +0 -7
  216. package/dist/icons/svg/HollowCircle.svg +0 -6
  217. package/dist/icons/svg/Search.svg +0 -1
  218. package/dist/icons/svg/Workflow.svg +0 -12
  219. package/dist/lib/error/index.js +0 -2
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ReadViewBaseProps } from '../types';
3
2
  type AssigneeReadViewProps = ReadViewBaseProps & {
4
3
  readonly?: boolean;
@@ -1,20 +1,22 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
- import { Fragment, memo } from 'react';
1
+ import { jsx, jsxs } from '@emotion/react/jsx-runtime';
2
+ import { memo, Fragment } from 'react';
3
3
  import { ClassNames } from '@emotion/react';
4
- import { getArrayValue } from '../../../lib/array';
5
- import { isUserDeleted, isUserDisabled, userDataFormat } from '../../../lib/useUser';
6
- import EmptyField from '../../common/EmptyField';
7
- import { getTooltipMaxlineStyle, tooltipOverflowStyle } from '../../common/overflow-tooltip/style';
8
- import { userDeletedStyle, userDisabledStyle } from '../user/style';
4
+ import { getArrayValue } from '../../../lib/array.js';
5
+ import { userDataFormat, isUserDeleted, isUserDisabled } from '../../../lib/useUser.js';
6
+ import EmptyField from '../../common/EmptyField.js';
7
+ import { tooltipOverflowStyle, getTooltipMaxlineStyle } from '../../common/overflow-tooltip/style/index.js';
8
+ import { userDeletedStyle, userDisabledStyle } from '../user/style/index.js';
9
+
9
10
  const AssigneeReadView = memo(({ value, readonly }) => {
10
11
  const users = getArrayValue(value).map(userDataFormat);
11
12
  if (!(users === null || users === void 0 ? void 0 : users.length))
12
- return _jsx(EmptyField, { readonly: readonly, isUser: true });
13
+ return jsx(EmptyField, { readonly: readonly, isUser: true });
13
14
  const title = users.map(user => user === null || user === void 0 ? void 0 : user.label).join(',');
14
- return (_jsx(ClassNames, { children: ({ cx, css }) => (_jsx("span", { className: cx(css(tooltipOverflowStyle), css(getTooltipMaxlineStyle(1))), title: title, children: users.reduce((prev, user, index) => {
15
- const el = (_jsxs(Fragment, { children: [index ? ',' : '', _jsx("span", { className: cx({ [css(userDeletedStyle)]: isUserDeleted(user) }, { [css(userDisabledStyle)]: isUserDisabled(user) }), children: user === null || user === void 0 ? void 0 : user.label })] }, index));
15
+ return (jsx(ClassNames, { children: ({ cx, css }) => (jsx("span", { className: cx(css(tooltipOverflowStyle), css(getTooltipMaxlineStyle(1))), title: title, children: users.reduce((prev, user, index) => {
16
+ const el = (jsxs(Fragment, { children: [index ? ',' : '', jsx("span", { className: cx({ [css(userDeletedStyle)]: isUserDeleted(user) }, { [css(userDisabledStyle)]: isUserDisabled(user) }), children: user === null || user === void 0 ? void 0 : user.label })] }, index));
16
17
  return prev.concat(el);
17
18
  }, []) })) }));
18
19
  });
19
20
  AssigneeReadView.displayName = 'AssigneeReadView';
20
- export default AssigneeReadView;
21
+
22
+ export { AssigneeReadView as default };
@@ -1,4 +1,4 @@
1
- export const getFieldWidthStyle = (labelWidth, labelAlign, hiddenLabel, apply) => {
1
+ const getFieldWidthStyle = (labelWidth, labelAlign, hiddenLabel, apply) => {
2
2
  if (hiddenLabel) {
3
3
  labelWidth = 0;
4
4
  }
@@ -7,3 +7,5 @@ export const getFieldWidthStyle = (labelWidth, labelAlign, hiddenLabel, apply) =
7
7
  }
8
8
  return { width: '100%' };
9
9
  };
10
+
11
+ export { getFieldWidthStyle };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { ReadViewBaseProps } from '../types';
3
2
  declare const BindWorkspaceReadView: import("react").NamedExoticComponent<ReadViewBaseProps>;
4
3
  export default BindWorkspaceReadView;
@@ -1,18 +1,20 @@
1
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
1
+ import { jsx } from '@emotion/react/jsx-runtime';
2
2
  import { memo } from 'react';
3
3
  import { ClassNames } from '@emotion/react';
4
- import useI18n from '../../../lib/hooks/useI18n';
5
- import EmptyField from '../../common/EmptyField';
6
- import { getTooltipMaxlineStyle, tooltipOverflowStyle } from '../../common/overflow-tooltip/style';
7
- import { useToWorkspacePage } from './hooks';
8
- import { pointerStyle } from './style';
4
+ import useI18n from '../../../lib/hooks/useI18n.js';
5
+ import EmptyField from '../../common/EmptyField.js';
6
+ import { tooltipOverflowStyle, getTooltipMaxlineStyle } from '../../common/overflow-tooltip/style/index.js';
7
+ import { useToWorkspacePage } from './hooks.js';
8
+ import { pointerStyle } from './style/index.js';
9
+
9
10
  const BindWorkspaceReadView = memo(props => {
10
11
  const { value } = props;
11
12
  const { t } = useI18n();
12
13
  const { toWorkspacePage } = useToWorkspacePage();
13
- return (_jsx(ClassNames, { children: ({ cx, css }) => {
14
- return value ? (_jsx("span", { className: cx(css(tooltipOverflowStyle), css(getTooltipMaxlineStyle(1)), css(pointerStyle)), title: t('pages.fields.default.toWorkspacePage'), onClick: () => toWorkspacePage(value.key), children: value.name })) : (_jsx(EmptyField, { readonly: true }));
14
+ return (jsx(ClassNames, { children: ({ cx, css }) => {
15
+ return value ? (jsx("span", { className: cx(css(tooltipOverflowStyle), css(getTooltipMaxlineStyle(1)), css(pointerStyle)), title: t('pages.fields.default.toWorkspacePage'), onClick: () => toWorkspacePage(value.key), children: value.name })) : (jsx(EmptyField, { readonly: true }));
15
16
  } }));
16
17
  });
17
18
  BindWorkspaceReadView.displayName = 'BindWorkspaceReadView';
18
- export default BindWorkspaceReadView;
19
+
20
+ export { BindWorkspaceReadView as default };
@@ -1,7 +1,8 @@
1
- import useTeamConfig from '../../../lib/hooks/useTeamConfig';
2
- import useTenant from '../../../lib/hooks/useTenant';
3
- import isInOne from '../../../lib/isInOne';
4
- export const useToWorkspacePage = () => {
1
+ import useTeamConfig from '../../../lib/hooks/useTeamConfig.js';
2
+ import useTenant from '../../../lib/hooks/useTenant.js';
3
+ import isInOne from '../../../lib/isInOne.js';
4
+
5
+ const useToWorkspacePage = () => {
5
6
  const { publicRuntimeConfig, isMicroApp } = useTeamConfig();
6
7
  const inOne = isInOne(publicRuntimeConfig.gateway, isMicroApp);
7
8
  const tenant = useTenant();
@@ -14,3 +15,5 @@ export const useToWorkspacePage = () => {
14
15
  },
15
16
  };
16
17
  };
18
+
19
+ export { useToWorkspacePage };
@@ -1,4 +1,6 @@
1
- export const pointerStyle = `
1
+ const pointerStyle = `
2
2
  color: #0c62ff;
3
3
  cursor: pointer;
4
4
  `;
5
+
6
+ export { pointerStyle };
@@ -1,14 +1,16 @@
1
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
1
+ import { jsx } from '@emotion/react/jsx-runtime';
2
2
  import { useMemo } from 'react';
3
- import EmptyField from '../../common/EmptyField';
4
- import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip';
5
- import { getShowValue } from './utils';
3
+ import EmptyField from '../../common/EmptyField.js';
4
+ import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip.js';
5
+ import { getShowValue } from './utils.js';
6
+
6
7
  const Cascade = props => {
7
8
  const { value } = props;
8
9
  const showValue = useMemo(() => {
9
10
  return getShowValue(value);
10
11
  }, [value]);
11
- return showValue ? _jsx(BaseOverflowTooltip, { title: showValue, children: showValue }) : _jsx(EmptyField, { readonly: true });
12
+ return showValue ? jsx(BaseOverflowTooltip, { title: showValue, children: showValue }) : jsx(EmptyField, { readonly: true });
12
13
  };
13
14
  Cascade.displayName = 'CascadeReadView';
14
- export default Cascade;
15
+
16
+ export { Cascade as default };
@@ -1,6 +1,5 @@
1
- export const VALUE_SPLIT = '__RC_CASCADER_SPLIT__';
2
- export const LABEL_JOIN_STR = ' / ';
3
- export const getShowValue = (values) => {
1
+ const LABEL_JOIN_STR = ' / ';
2
+ const getShowValue = (values) => {
4
3
  if (!Array.isArray(values) || !values.length)
5
4
  return '';
6
5
  const showValue = values
@@ -19,3 +18,5 @@ export const getShowValue = (values) => {
19
18
  .join(',');
20
19
  return showValue;
21
20
  };
21
+
22
+ export { LABEL_JOIN_STR, getShowValue };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ReadViewBaseProps } from '../types';
3
2
  type CheckboxReadViewProps = Omit<ReadViewBaseProps, 'itemValues'>;
4
3
  declare const CheckboxReadView: import("react").NamedExoticComponent<CheckboxReadViewProps>;
@@ -1,7 +1,8 @@
1
- import { jsx as _jsx, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
1
+ import { jsx, Fragment } from '@emotion/react/jsx-runtime';
2
2
  import { memo, useMemo } from 'react';
3
- import EmptyField from '../../common/EmptyField';
4
- import SimpleOverflowToolTip from '../../common/overflow-tooltip/SimpleOverflowToolTip';
3
+ import EmptyField from '../../common/EmptyField.js';
4
+ import SimpleOverflowToolTip from '../../common/overflow-tooltip/SimpleOverflowToolTip.js';
5
+
5
6
  const CheckboxReadView = memo(props => {
6
7
  const { value, options, readonly } = props;
7
8
  const showValue = useMemo(() => {
@@ -15,7 +16,8 @@ const CheckboxReadView = memo(props => {
15
16
  .join(',');
16
17
  return result;
17
18
  }, [options, value]);
18
- return (_jsx(_Fragment, { children: showValue ? (_jsx(SimpleOverflowToolTip, { title: showValue, children: showValue })) : (_jsx(EmptyField, { readonly: readonly })) }));
19
+ return (jsx(Fragment, { children: showValue ? (jsx(SimpleOverflowToolTip, { title: showValue, children: showValue })) : (jsx(EmptyField, { readonly: readonly })) }));
19
20
  });
20
21
  CheckboxReadView.displayName = 'CheckboxReadView';
21
- export default CheckboxReadView;
22
+
23
+ export { CheckboxReadView as default };
@@ -1,9 +1,10 @@
1
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
1
+ import { jsx } from '@emotion/react/jsx-runtime';
2
2
  import { memo, useMemo } from 'react';
3
- import useDateTimeFormatType from '../../../lib/hooks/useDateTimeFormatType';
4
- import EmptyField from '../../common/EmptyField';
5
- import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip';
6
- import { dateFormat } from '../../common/utils';
3
+ import useDateTimeFormatType from '../../../lib/hooks/useDateTimeFormatType.js';
4
+ import EmptyField from '../../common/EmptyField.js';
5
+ import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip.js';
6
+ import { dateFormat } from '../../common/utils.js';
7
+
7
8
  const CreatedAtReadView = memo(({ value }) => {
8
9
  const dateFormatType = useDateTimeFormatType();
9
10
  const showValue = useMemo(() => {
@@ -13,9 +14,10 @@ const CreatedAtReadView = memo(({ value }) => {
13
14
  return '';
14
15
  }, [value, dateFormatType]);
15
16
  if (!showValue) {
16
- return _jsx(EmptyField, { readonly: true });
17
+ return jsx(EmptyField, { readonly: true });
17
18
  }
18
- return _jsx(BaseOverflowTooltip, { title: showValue, children: showValue });
19
+ return jsx(BaseOverflowTooltip, { title: showValue, children: showValue });
19
20
  });
20
21
  CreatedAtReadView.displayName = 'CreatedAtReadView';
21
- export default CreatedAtReadView;
22
+
23
+ export { CreatedAtReadView as default };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { User as UserTyped } from '../../../lib/types/models';
3
2
  declare const CreatedByReadView: import("react").MemoExoticComponent<({ value }: {
4
3
  value: UserTyped;
@@ -1,11 +1,12 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
1
+ import { jsx, jsxs } from '@emotion/react/jsx-runtime';
2
2
  import { memo, useMemo } from 'react';
3
3
  import { ClassNames } from '@emotion/react';
4
- import { generateUserDisplayName, isUserDeleted, isUserDisabled } from '../../../lib/useUser';
5
- import EmptyField from '../../common/EmptyField';
6
- import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip';
7
- import UserAvatar from '../../common/user-field/UserAvatar';
8
- import { userDeletedStyle, userDisabledStyle, usernameStyle } from '../user/style';
4
+ import { generateUserDisplayName, isUserDeleted, isUserDisabled } from '../../../lib/useUser.js';
5
+ import EmptyField from '../../common/EmptyField.js';
6
+ import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip.js';
7
+ import UserAvatar from '../../common/user-field/UserAvatar.js';
8
+ import { usernameStyle, userDeletedStyle, userDisabledStyle } from '../user/style/index.js';
9
+
9
10
  const CreatedByReadView = memo(({ value }) => {
10
11
  const showValue = useMemo(() => {
11
12
  if (value) {
@@ -14,9 +15,10 @@ const CreatedByReadView = memo(({ value }) => {
14
15
  return '';
15
16
  }, [value]);
16
17
  if (!showValue) {
17
- return _jsx(EmptyField, { readonly: true });
18
+ return jsx(EmptyField, { readonly: true });
18
19
  }
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 })] })) }));
20
+ 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 })] })) }));
20
21
  });
21
22
  CreatedByReadView.displayName = 'CreatedByReadView';
22
- export default CreatedByReadView;
23
+
24
+ export { CreatedByReadView as default };
@@ -1,12 +1,13 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "@emotion/react/jsx-runtime";
2
- import { useEffect, useState } from 'react';
1
+ import { jsxs, jsx } from '@emotion/react/jsx-runtime';
2
+ import { useState, useEffect } from 'react';
3
3
  import { css } from '@emotion/react';
4
4
  import { useRecoilValue } from 'recoil';
5
- import { currentDeleteState, dataQuoteState } from '../../../lib/store/dataQuoteStore';
6
- import EmptyField from '../../common/EmptyField';
7
- import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip';
8
- import { fieldValueOverlayStyle } from '../../common/style/global';
9
- import { dataQuoteInit } from './utils';
5
+ import { dataQuoteState, currentDeleteState } from '../../../lib/store/dataQuoteStore.js';
6
+ import EmptyField from '../../common/EmptyField.js';
7
+ import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip.js';
8
+ import { fieldValueOverlayStyle } from '../../common/style/global.js';
9
+ import { dataQuoteInit } from './utils.js';
10
+
10
11
  const DataQuoteReadView = ({ value, userData }) => {
11
12
  const [dataList, setDataList] = useState(null);
12
13
  const dataQuoteList = useRecoilValue(dataQuoteState);
@@ -16,9 +17,10 @@ const DataQuoteReadView = ({ value, userData }) => {
16
17
  setDataList(dataQuoteInit(dataQuoteList, value, userData === null || userData === void 0 ? void 0 : userData.display));
17
18
  }
18
19
  }, [dataQuoteList, userData === null || userData === void 0 ? void 0 : userData.display, value, currentDeleteItem]);
19
- const cellDisplay = (dataList === null || dataList === void 0 ? void 0 : dataList.length) ? (dataList.map((item, index) => (_jsxs("span", { children: [item.label, " ", index === dataList.length - 1 ? '' : '、'] }, item.value)))) : (_jsx(EmptyField, { readonly: true }));
20
+ const cellDisplay = (dataList === null || dataList === void 0 ? void 0 : dataList.length) ? (dataList.map((item, index) => (jsxs("span", { children: [item.label, " ", index === dataList.length - 1 ? '' : '、'] }, item.value)))) : (jsx(EmptyField, { readonly: true }));
20
21
  const showValue = (dataList === null || dataList === void 0 ? void 0 : dataList.length) ? dataList.map(item => item.label).join('、') : '';
21
- return (_jsx("div", { css: css(fieldValueOverlayStyle), children: _jsx(BaseOverflowTooltip, { title: showValue, maxline: 1, children: cellDisplay }) }));
22
+ return (jsx("div", { css: css(fieldValueOverlayStyle), children: jsx(BaseOverflowTooltip, { title: showValue, maxline: 1, children: cellDisplay }) }));
22
23
  };
23
24
  DataQuoteReadView.displayName = 'DataQuoteReadView';
24
- export default DataQuoteReadView;
25
+
26
+ export { DataQuoteReadView as default };
@@ -1,5 +1,5 @@
1
- export const DATA_QUOTE_OPTION_FORMAT_REG = /{(\S+?)}/g;
2
- export const dataQuoteOptionFormat = (data, display) => {
1
+ const DATA_QUOTE_OPTION_FORMAT_REG = /{(\S+?)}/g;
2
+ const dataQuoteOptionFormat = (data, display) => {
3
3
  var _a, _b, _c;
4
4
  if (!data)
5
5
  return undefined;
@@ -23,8 +23,10 @@ export const dataQuoteOptionFormat = (data, display) => {
23
23
  values: data.values,
24
24
  };
25
25
  };
26
- export const dataQuoteInit = (dates, value, display) => {
26
+ const dataQuoteInit = (dates, value, display) => {
27
27
  const existedDataList = dates === null || dates === void 0 ? void 0 : dates.filter(data => value === null || value === void 0 ? void 0 : value.includes(data.objectId));
28
28
  const dataInit = existedDataList === null || existedDataList === void 0 ? void 0 : existedDataList.map(existedData => dataQuoteOptionFormat(existedData, display));
29
29
  return dataInit;
30
30
  };
31
+
32
+ export { DATA_QUOTE_OPTION_FORMAT_REG, dataQuoteInit, dataQuoteOptionFormat };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ReadViewBaseProps } from '../types';
3
2
  type DateReadViewProps = ReadViewBaseProps & {
4
3
  pickerType?: 'dateTime' | 'date' | 'week' | 'month' | 'year';
@@ -1,14 +1,16 @@
1
- import { jsx as _jsx, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
1
+ import { jsx, Fragment } from '@emotion/react/jsx-runtime';
2
2
  import { memo, useMemo } from 'react';
3
- import { getDateType, getFormat } from '../../../lib/date';
4
- import EmptyField from '../../common/EmptyField';
5
- import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip';
3
+ import { getFormat, getDateType } from '../../../lib/date.js';
4
+ import EmptyField from '../../common/EmptyField.js';
5
+ import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip.js';
6
+
6
7
  const DateReadView = memo(props => {
7
8
  const { readonly, value, pickerType, format } = props;
8
9
  const showValue = useMemo(() => {
9
10
  return getFormat(value, format || getDateType(pickerType));
10
11
  }, [value, format, pickerType]);
11
- return (_jsx(_Fragment, { children: value ? (_jsx(BaseOverflowTooltip, { title: showValue, maxline: 1, children: showValue })) : (_jsx(EmptyField, { readonly: readonly })) }));
12
+ return (jsx(Fragment, { children: value ? (jsx(BaseOverflowTooltip, { title: showValue, maxline: 1, children: showValue })) : (jsx(EmptyField, { readonly: readonly })) }));
12
13
  });
13
14
  DateReadView.displayName = 'DateReadView';
14
- export default DateReadView;
15
+
16
+ export { DateReadView as default };
@@ -1,40 +1,41 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
- import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
1
+ import { jsxs, Fragment, jsx } from '@emotion/react/jsx-runtime';
2
+ import { useMemo, useState, useRef, useEffect, useCallback } from 'react';
3
3
  import { Overlay } from 'react-overlays';
4
4
  import { DownOutlined } from '@ant-design/icons';
5
5
  import { ClassNames } from '@emotion/react';
6
- import { Checkbox, Col, Divider, Select as AntSelect, Spin } from 'antd';
6
+ import { Checkbox, Divider, Spin, Select, Col } from 'antd';
7
7
  import debug from 'debug';
8
- import { isNil, isObject, isPlainObject, noop, xorWith } from 'lodash-es';
9
- import { emptyIconWrapper } from 'style/global';
8
+ import { isObject, isPlainObject, isNil, xorWith, noop } from 'lodash-es';
9
+ import { emptyIconWrapper } from '../../../style/global.js';
10
10
  import useSWR from 'swr';
11
- import EmptyField from 'components/common/EmptyField';
12
- import Expand, { EXPAND_TYPE_ENUM } from 'components/common/expand-component';
13
- import ItemIcon from 'components/common/item-icon/ItemIcon';
14
- import BaseOverflowTooltip from 'components/common/overflow-tooltip/BaseOverflowTooltip';
15
- import OverflowTooltip from 'components/common/overflow-tooltip/OverflowTooltip';
16
- import { defaultFilterOptions, getPopupContainerFun } from 'components/common/utils';
17
- import EmptyIcon from 'components/default-empty-icon';
18
- import { getFieldWidthStyle } from 'components/fields/base-component/utils';
19
- import { getRealValueByIqlTo } from 'components/filters/filter-search/utils';
20
- import { REMOTE_DATA_QUOTE_FIELD_TYPE } from 'lib/constants/field';
21
- import { BASE_FIELD_WIDTH, CURRENT_WORKSPACE, FIELD_CONTAINERS_PAGE, FIELD_TYPE_KEY_MAPPINGS } from 'lib/global';
22
- import useAntdConfig from 'lib/hooks/useAntdConfig';
23
- import useI18n from 'lib/hooks/useI18n';
24
- import { API_KEY } from 'lib/swr/constants';
25
- import useViewClass from '../hooks/useViewClass';
26
- import { EMPTY_OPTIONS, useCommonProps } from './hook';
27
- import { disabledClass, displayWrapClass, dropdownSelectDisabled, dropdownSelectOptionClass, dropdownSelectStyle, dropdownStyle, hiddenHoverClass, hoverIconClass, onlyWorkspaceDividerStyle, onlyWorkspaceStyle, optionDisplayWrapClass, valueOptionClass, valueOptionContentClass, valueOptionIconClass, valueOptionLabelClass, workspaceClass, } from './style';
11
+ import EmptyField from '../../common/EmptyField.js';
12
+ import Expand, { EXPAND_TYPE_ENUM } from '../../common/expand-component/index.js';
13
+ import ItemIcon from '../../common/item-icon/ItemIcon.js';
14
+ import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip.js';
15
+ import OverflowTooltip from '../../common/overflow-tooltip/OverflowTooltip.js';
16
+ import { defaultFilterOptions, getPopupContainerFun } from '../../common/utils.js';
17
+ import EmptyIcon from '../../default-empty-icon/index.js';
18
+ import { getFieldWidthStyle } from '../base-component/utils.js';
19
+ import { getRealValueByIqlTo } from '../../filters/filter-search/utils.js';
20
+ import { REMOTE_DATA_QUOTE_FIELD_TYPE } from '../../../lib/constants/field.js';
21
+ import { FIELD_CONTAINERS_PAGE, CURRENT_WORKSPACE, FIELD_TYPE_KEY_MAPPINGS, BASE_FIELD_WIDTH } from '../../../lib/global.js';
22
+ import useAntdConfig from '../../../lib/hooks/useAntdConfig.js';
23
+ import useI18n from '../../../lib/hooks/useI18n.js';
24
+ import { API_KEY } from '../../../lib/swr/constants.js';
25
+ import useViewClass from '../hooks/useViewClass.js';
26
+ import { useCommonProps, EMPTY_OPTIONS } from './hook.js';
27
+ import { dropdownSelectDisabled, onlyWorkspaceStyle, onlyWorkspaceDividerStyle, dropdownSelectStyle, optionDisplayWrapClass, dropdownSelectOptionClass, disabledClass, workspaceClass, dropdownStyle, hiddenHoverClass, displayWrapClass, valueOptionContentClass, valueOptionClass, valueOptionIconClass, valueOptionLabelClass, hoverIconClass } from './style.js';
28
+
28
29
  const loggers = debug('dropdown:BaseField');
29
- export const isNilFilter = function (value) {
30
+ const isNilFilter = function (value) {
30
31
  var _a;
31
32
  return (_a = value === null || value === void 0 ? void 0 : value.filter) === null || _a === void 0 ? void 0 : _a.call(value, val => !isNil(val));
32
33
  };
33
- export const handleValue = function (value) {
34
+ const handleValue = function (value) {
34
35
  return isObject(value) ? value === null || value === void 0 ? void 0 : value.value : value;
35
36
  };
36
- export const getFormattedLabel = ({ label, style = {} } = {}) => {
37
- return _jsx("span", { style: { borderRadius: 2, color: style === null || style === void 0 ? void 0 : style.color, background: style === null || style === void 0 ? void 0 : style.background }, children: label });
37
+ const getFormattedLabel = ({ label, style = {} } = {}) => {
38
+ return jsx("span", { style: { borderRadius: 2, color: style === null || style === void 0 ? void 0 : style.color, background: style === null || style === void 0 ? void 0 : style.background }, children: label });
38
39
  };
39
40
  const Dropdown = props => {
40
41
  const { onSelect = noop, onBlur, onChange = noop, labelWidth = BASE_FIELD_WIDTH, labelAlign, readonly: propsReadonly = false, options: _propsOptions = EMPTY_OPTIONS, editMode = false, apply, mode, hiddenLabel, allowClear = true, useChange = false, objectId, getPopupContainer, dataQuoteInit, userData, workspace, valueDisplayWrap, optionDisplayWrap, onOptionsChange, page, disabledSwr, onlyValue, screenMode, displayValueHidden = false, disabledLineThrough = false, displayWorkspace = false, isShowOnlyWorkspace = false, fieldTypeKey, iqlKey = 'value', fetchOnFocus, isCascaded, clickFetch, iqlToNeedMore = false, ...defaultProps } = props;
@@ -298,7 +299,7 @@ const Dropdown = props => {
298
299
  return null;
299
300
  showValue = valueArr.map((item, index) => {
300
301
  const content = _optionsMap[item] ? getFormattedLabel(_optionsMap[item]) : item;
301
- return index === value.length - 1 ? content : _jsxs(_Fragment, { children: [content, ","] });
302
+ return index === value.length - 1 ? content : jsxs(Fragment, { children: [content, ","] });
302
303
  });
303
304
  }
304
305
  }
@@ -309,7 +310,7 @@ const Dropdown = props => {
309
310
  const opt = _options.filter(item => item.value === handleValue(val));
310
311
  const label = ((_a = opt[0]) === null || _a === void 0 ? void 0 : _a.label) || handleValue(val);
311
312
  if (opt.length >= 1) {
312
- showValue = (_jsx("span", { className: cx({ [css(dropdownSelectDisabled)]: ((_b = opt[0]) === null || _b === void 0 ? void 0 : _b.disabled) || !opt.length }), children: ((_c = opt[0]) === null || _c === void 0 ? void 0 : _c.icon) ? (_jsx(ItemIcon, { icon: (_d = opt[0]) === null || _d === void 0 ? void 0 : _d.icon, label: label })) : !screenMode && _optionsMap[label] ? (getFormattedLabel(_optionsMap[label])) : (label) }));
313
+ showValue = (jsx("span", { className: cx({ [css(dropdownSelectDisabled)]: ((_b = opt[0]) === null || _b === void 0 ? void 0 : _b.disabled) || !opt.length }), children: ((_c = opt[0]) === null || _c === void 0 ? void 0 : _c.icon) ? (jsx(ItemIcon, { icon: (_d = opt[0]) === null || _d === void 0 ? void 0 : _d.icon, label: label })) : !screenMode && _optionsMap[label] ? (getFormattedLabel(_optionsMap[label])) : (label) }));
313
314
  }
314
315
  }
315
316
  }
@@ -503,24 +504,24 @@ const Dropdown = props => {
503
504
  const message = t('pages.fields.default.onlyWorkspace', {
504
505
  name: props.onlyWorkspaceTip || t(`pages.fields.fieldName.${fieldTypeKey}`),
505
506
  });
506
- return (_jsxs(_Fragment, { children: [_jsx("div", { className: cx(css(onlyWorkspaceStyle)), children: _jsx(Checkbox, { checked: onlyWorkspace, onChange: onChangeCurrent, onClick: e => {
507
+ return (jsxs(Fragment, { children: [jsx("div", { className: cx(css(onlyWorkspaceStyle)), children: jsx(Checkbox, { checked: onlyWorkspace, onChange: onChangeCurrent, onClick: e => {
507
508
  e.stopPropagation();
508
- }, children: _jsx(BaseOverflowTooltip, { title: message, children: message }) }) }), _jsx(Divider, { className: cx(css(onlyWorkspaceDividerStyle)) }), menu] }));
509
+ }, children: jsx(BaseOverflowTooltip, { title: message, children: message }) }) }), jsx(Divider, { className: cx(css(onlyWorkspaceDividerStyle)) }), menu] }));
509
510
  };
510
511
  }, [fieldTypeKey, isShowOnlyWorkspace, onChangeCurrent, onlyWorkspace, props.onlyWorkspaceTip, t]);
511
512
  const notFoundContentMemo = useMemo(() => {
512
- return loading && canAsyncFetchOption ? (_jsx(Spin, { size: "small" })) : (_jsx(ClassNames, { children: ({ css, cx }) => (_jsx("div", { className: cx(css(emptyIconWrapper)), children: _jsx(EmptyIcon, { noMargin: true }) })) }));
513
+ return loading && canAsyncFetchOption ? (jsx(Spin, { size: "small" })) : (jsx(ClassNames, { children: ({ css, cx }) => (jsx("div", { className: cx(css(emptyIconWrapper)), children: jsx(EmptyIcon, { noMargin: true }) })) }));
513
514
  }, [canAsyncFetchOption, loading]);
514
515
  const style = getFieldWidthStyle(labelWidth, labelAlign, hiddenLabel, apply);
515
516
  const hiddenHover = readonly || editMode || editing || apply === 'cell' || isView;
516
517
  const overlayRender = useMemo(() => {
517
- return (_jsx(ClassNames, { children: ({ cx, css }) => {
518
+ return (jsx(ClassNames, { children: ({ cx, css }) => {
518
519
  const cxDropdownRender = dropdownRender({ cx, css });
519
- return (_jsx("div", { className: 'field-value-overlay', children: _jsx(AntSelect, { getPopupContainer: triggerNode => getPopupContainerFun(getPopupContainer, triggerNode, apply, page), filterOption: filterOptionProp, ...defaultProps, className: cx('field-value-overlay-component', disabledLineThrough || displayValueHidden ? css(dropdownSelectStyle(antPrefix)) : '', {
520
+ return (jsx("div", { className: 'field-value-overlay', children: jsx(Select, { getPopupContainer: triggerNode => getPopupContainerFun(getPopupContainer, triggerNode, apply, page), filterOption: filterOptionProp, ...defaultProps, className: cx('field-value-overlay-component', disabledLineThrough || displayValueHidden ? css(dropdownSelectStyle(antPrefix)) : '', {
520
521
  [optionDisplayWrapClass]: optionDisplayWrap,
521
522
  }), mode: mode, ref: targetRef, value: selectValue, showSearch: true, maxTagCount: optionDisplayWrap || isView ? null : 'responsive', onSelect: handleSelect, onClear: handleClear, onBlur: handleBlur, open: open, onDropdownVisibleChange: onDropdownVisibleChange, onFocus: handleFocus, onChange: handleChange, allowClear: allowClear, onSearch: handleSearch, defaultOpen: !editMode, listItemHeight: 32, listHeight: 200, optionLabelProp: fieldTypeKey === FIELD_TYPE_KEY_MAPPINGS.Version ? 'label' : 'children', notFoundContent: notFoundContentMemo, dropdownRender: cxDropdownRender, children: _options.map(item => {
522
523
  var _a, _b, _c;
523
- return (_jsxs(AntSelect.Option, { value: item.value, label: item.label, disabled: item.disabled, values: item.values, children: [_jsx("span", { className: cx({ [dropdownSelectOptionClass]: disabledLineThrough || displayValueHidden }, { [disabledClass]: item === null || item === void 0 ? void 0 : item.disabled }), children: _jsxs(BaseOverflowTooltip, { title: (_a = item === null || item === void 0 ? void 0 : item.label) === null || _a === void 0 ? void 0 : _a.toString(), className: "custom-overflow", children: [_jsx(ItemIcon, { icon: item.icon, label: item.label }), fieldTypeKey === FIELD_TYPE_KEY_MAPPINGS.Version && item.archived && (_jsxs("span", { children: ["(", t('workspaceArchived.archived'), ")"] }))] }) }), displayWorkspace ? (_jsx("div", { className: cx(workspaceClass), children: _jsx(BaseOverflowTooltip, { title: (_b = item === null || item === void 0 ? void 0 : item.workspace) === null || _b === void 0 ? void 0 : _b.name, children: (_c = item === null || item === void 0 ? void 0 : item.workspace) === null || _c === void 0 ? void 0 : _c.name }) })) : null] }, item.value));
524
+ return (jsxs(Select.Option, { value: item.value, label: item.label, disabled: item.disabled, values: item.values, children: [jsx("span", { className: cx({ [dropdownSelectOptionClass]: disabledLineThrough || displayValueHidden }, { [disabledClass]: item === null || item === void 0 ? void 0 : item.disabled }), children: jsxs(BaseOverflowTooltip, { title: (_a = item === null || item === void 0 ? void 0 : item.label) === null || _a === void 0 ? void 0 : _a.toString(), className: "custom-overflow", children: [jsx(ItemIcon, { icon: item.icon, label: item.label }), fieldTypeKey === FIELD_TYPE_KEY_MAPPINGS.Version && item.archived && (jsxs("span", { children: ["(", t('workspaceArchived.archived'), ")"] }))] }) }), displayWorkspace ? (jsx("div", { className: cx(workspaceClass), children: jsx(BaseOverflowTooltip, { title: (_b = item === null || item === void 0 ? void 0 : item.workspace) === null || _b === void 0 ? void 0 : _b.name, children: (_c = item === null || item === void 0 ? void 0 : item.workspace) === null || _c === void 0 ? void 0 : _c.name }) })) : null] }, item.value));
524
525
  }) }) }));
525
526
  } }));
526
527
  }, [
@@ -553,13 +554,14 @@ const Dropdown = props => {
553
554
  selectValue,
554
555
  t,
555
556
  ]);
556
- return (_jsx(ClassNames, { children: ({ cx, css }) => {
557
+ return (jsx(ClassNames, { children: ({ cx, css }) => {
557
558
  const cxShowValue = showValue({ cx, css });
558
- 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)) &&
559
- (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 => {
560
- 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));
561
- }) }))) : (_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) })] }));
559
+ 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)) &&
560
+ (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 => {
561
+ 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));
562
+ }) }))) : (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) })] }));
562
563
  } }));
563
564
  };
564
565
  Dropdown.displayName = 'DropdownBaseField';
565
- export default Dropdown;
566
+
567
+ export { Dropdown as default, getFormattedLabel, handleValue, isNilFilter };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { BaseDropdownProps } from './hook';
3
2
  declare const DropdownCell: React.FC<BaseDropdownProps>;
4
3
  export default DropdownCell;
@@ -1,6 +1,8 @@
1
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
- import BaseField from './BaseField';
1
+ import { jsx } from '@emotion/react/jsx-runtime';
2
+ import Dropdown from './BaseField.js';
3
+
3
4
  const DropdownCell = props => {
4
- return _jsx(BaseField, { ...props, apply: "cell" });
5
+ return jsx(Dropdown, { ...props, apply: "cell" });
5
6
  };
6
- export default DropdownCell;
7
+
8
+ export { DropdownCell as default };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ReadViewBaseProps } from '../types';
3
2
  type DropdownReadViewProps = ReadViewBaseProps & {
4
3
  userData?: Record<string, any>;
@@ -1,15 +1,16 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
1
+ import { jsxs, Fragment, jsx } from '@emotion/react/jsx-runtime';
2
2
  import { memo, useMemo } from 'react';
3
- import EmptyField from '../../common/EmptyField';
4
- import SimpleOverflowToolTip from '../../common/overflow-tooltip/SimpleOverflowToolTip';
5
- import { handleValue } from './BaseField';
3
+ import EmptyField from '../../common/EmptyField.js';
4
+ import SimpleOverflowToolTip from '../../common/overflow-tooltip/SimpleOverflowToolTip.js';
5
+ import { handleValue } from './BaseField.js';
6
+
6
7
  var MUTIPLE_MODE;
7
8
  (function (MUTIPLE_MODE) {
8
9
  MUTIPLE_MODE["multiple"] = "multiple";
9
10
  MUTIPLE_MODE["tags"] = "tags";
10
11
  })(MUTIPLE_MODE || (MUTIPLE_MODE = {}));
11
12
  const getFormattedLabel = ({ label, style = {}, }) => {
12
- return _jsx("span", { style: { borderRadius: 2, color: style === null || style === void 0 ? void 0 : style.color, background: style === null || style === void 0 ? void 0 : style.background }, children: label });
13
+ return jsx("span", { style: { borderRadius: 2, color: style === null || style === void 0 ? void 0 : style.color, background: style === null || style === void 0 ? void 0 : style.background }, children: label });
13
14
  };
14
15
  const DropdownReadView = memo(props => {
15
16
  const { value, options, readonly: propsReadonly, userData, mode } = props;
@@ -45,7 +46,7 @@ const DropdownReadView = memo(props => {
45
46
  return '';
46
47
  return valueArr.map((item, index) => {
47
48
  const content = optionsMap[item] ? getFormattedLabel(optionsMap[item]) : item;
48
- return index === value.length - 1 ? content : _jsxs(_Fragment, { children: [content, ","] });
49
+ return index === value.length - 1 ? content : jsxs(Fragment, { children: [content, ","] });
49
50
  });
50
51
  }
51
52
  else {
@@ -73,7 +74,8 @@ const DropdownReadView = memo(props => {
73
74
  .join(',');
74
75
  return result;
75
76
  }, [options, value]);
76
- return showValue ? (_jsx(SimpleOverflowToolTip, { title: showValueTitle, children: showValue })) : (_jsx(EmptyField, { readonly: readonly }));
77
+ return showValue ? (jsx(SimpleOverflowToolTip, { title: showValueTitle, children: showValue })) : (jsx(EmptyField, { readonly: readonly }));
77
78
  });
78
79
  DropdownReadView.displayName = 'DropdownReadView';
79
- export default DropdownReadView;
80
+
81
+ export { DropdownReadView as default };
@@ -5,5 +5,5 @@ interface FetchDropdownParams {
5
5
  page?: string;
6
6
  propsValue?: string;
7
7
  }
8
- export declare const useFetchDropdown: () => (data: FetchDropdownParams) => Promise<any>;
8
+ export declare const useFetchDropdown: () => ((data: FetchDropdownParams) => Promise<any>);
9
9
  export {};
@@ -1,7 +1,8 @@
1
1
  import { useCallback } from 'react';
2
- import useFetch from 'lib/fetch';
3
- import { throttleFetch } from 'lib/throttleFetch';
4
- export const useFetchDropdown = () => {
2
+ import useFetch from '../../../lib/fetch.js';
3
+ import { throttleFetch } from '../../../lib/throttleFetch.js';
4
+
5
+ const useFetchDropdown = () => {
5
6
  const fetch = useFetch();
6
7
  const fetchDropdownData = useCallback(({ keyword, workspaceId, page, fieldId, propsValue }) => {
7
8
  return throttleFetch({ keyword, workspaceId, page, fieldId }, async () => {
@@ -24,3 +25,5 @@ export const useFetchDropdown = () => {
24
25
  }, [fetch]);
25
26
  return fetchDropdownData;
26
27
  };
28
+
29
+ export { useFetchDropdown };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SelectProps } from 'antd';
3
2
  import { Item, ItemType, PointerObject } from 'lib/types/models';
4
3
  import { FieldProps, IScreenLabelProps } from '../base-component/types';