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

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 (264) hide show
  1. package/README.md +21 -21
  2. package/dist/components/common/EmptyField.d.ts +0 -1
  3. package/dist/components/common/EmptyField.js +7 -5
  4. package/dist/components/common/PriceTag.js +26 -23
  5. package/dist/components/common/expand-component/index.d.ts +0 -1
  6. package/dist/components/common/expand-component/index.js +12 -10
  7. package/dist/components/common/expand-component/style.js +8 -6
  8. package/dist/components/common/item-icon/ItemIcon.d.ts +0 -1
  9. package/dist/components/common/item-icon/ItemIcon.js +6 -4
  10. package/dist/components/common/overflow-tooltip/BaseOverflowTooltip.d.ts +0 -1
  11. package/dist/components/common/overflow-tooltip/BaseOverflowTooltip.js +9 -6
  12. package/dist/components/common/overflow-tooltip/OverflowTooltip.js +9 -6
  13. package/dist/components/common/overflow-tooltip/SimpleOverflowToolTip.js +8 -5
  14. package/dist/components/common/overflow-tooltip/style/index.js +16 -14
  15. package/dist/components/common/style/global.js +4 -2
  16. package/dist/components/common/style/mixin.js +18 -15
  17. package/dist/components/common/user-field/UserAvatar.js +8 -6
  18. package/dist/components/common/user-field/style/index.js +23 -21
  19. package/dist/components/common/utils.js +13 -9
  20. package/dist/components/default-empty-icon/config.js +11 -6
  21. package/dist/components/default-empty-icon/index.js +10 -9
  22. package/dist/components/default-empty-icon/style.js +65 -62
  23. package/dist/components/default-empty-icon/types.js +3 -1
  24. package/dist/components/field-behavior/fields/type.js +5 -2
  25. package/dist/components/fields/actors/BaseField.js +5 -2
  26. package/dist/components/fields/actors/ReadView.d.ts +0 -1
  27. package/dist/components/fields/actors/ReadView.js +8 -6
  28. package/dist/components/fields/ancestor/ReadView.js +8 -6
  29. package/dist/components/fields/ancestor/utils.js +4 -12
  30. package/dist/components/fields/assignee/ReadView.d.ts +0 -1
  31. package/dist/components/fields/assignee/ReadView.js +13 -11
  32. package/dist/components/fields/base-component/utils.js +3 -1
  33. package/dist/components/fields/bind-workspace/ReadView.d.ts +0 -1
  34. package/dist/components/fields/bind-workspace/ReadView.js +11 -9
  35. package/dist/components/fields/bind-workspace/hooks.js +7 -4
  36. package/dist/components/fields/bind-workspace/style/index.js +5 -3
  37. package/dist/components/fields/cascade/ReadView.js +8 -6
  38. package/dist/components/fields/cascade/utils.js +4 -3
  39. package/dist/components/fields/checkbox/ReadView.d.ts +0 -1
  40. package/dist/components/fields/checkbox/ReadView.js +7 -5
  41. package/dist/components/fields/created-at/ReadView.js +10 -8
  42. package/dist/components/fields/created-by/ReadView.d.ts +0 -1
  43. package/dist/components/fields/created-by/ReadView.js +11 -9
  44. package/dist/components/fields/data-quote/ReadView.js +12 -10
  45. package/dist/components/fields/data-quote/utils.js +5 -3
  46. package/dist/components/fields/date/ReadView.d.ts +0 -1
  47. package/dist/components/fields/date/ReadView.js +8 -6
  48. package/dist/components/fields/dropdown/BaseField.js +53 -40
  49. package/dist/components/fields/dropdown/Cell.d.ts +0 -1
  50. package/dist/components/fields/dropdown/Cell.js +6 -4
  51. package/dist/components/fields/dropdown/ReadView.d.ts +0 -1
  52. package/dist/components/fields/dropdown/ReadView.js +10 -8
  53. package/dist/components/fields/dropdown/data.d.ts +1 -1
  54. package/dist/components/fields/dropdown/data.js +6 -3
  55. package/dist/components/fields/dropdown/hook.d.ts +0 -1
  56. package/dist/components/fields/dropdown/hook.js +11 -8
  57. package/dist/components/fields/dropdown/style.js +88 -85
  58. package/dist/components/fields/file/ReadView.d.ts +0 -1
  59. package/dist/components/fields/file/ReadView.js +7 -5
  60. package/dist/components/fields/formula/ReadView.d.ts +0 -1
  61. package/dist/components/fields/formula/ReadView.js +7 -5
  62. package/dist/components/fields/hooks/useViewClass.js +4 -2
  63. package/dist/components/fields/hyper-link/ReadView.d.ts +0 -1
  64. package/dist/components/fields/hyper-link/ReadView.js +8 -6
  65. package/dist/components/fields/hyper-link/style/index.js +18 -15
  66. package/dist/components/fields/item-group/ReadView.d.ts +0 -1
  67. package/dist/components/fields/item-group/ReadView.js +6 -4
  68. package/dist/components/fields/item-type/ItemTypeIcon.js +15 -17
  69. package/dist/components/fields/item-type/ReadView.d.ts +0 -1
  70. package/dist/components/fields/item-type/ReadView.js +7 -5
  71. package/dist/components/fields/item-type/style/index.js +7 -5
  72. package/dist/components/fields/key/ReadView.d.ts +0 -1
  73. package/dist/components/fields/key/ReadView.js +7 -5
  74. package/dist/components/fields/long-text/ReadView.d.ts +0 -1
  75. package/dist/components/fields/long-text/ReadView.js +8 -6
  76. package/dist/components/fields/long-text/style/index.js +7 -5
  77. package/dist/components/fields/number/BaseField.js +5 -2
  78. package/dist/components/fields/number/ReadView.d.ts +0 -1
  79. package/dist/components/fields/number/ReadView.js +8 -6
  80. package/dist/components/fields/priority/ReadView.js +12 -10
  81. package/dist/components/fields/priority/style/index.js +53 -50
  82. package/dist/components/fields/radio/ReadView.d.ts +0 -1
  83. package/dist/components/fields/radio/ReadView.js +8 -6
  84. package/dist/components/fields/repo-files/ReadView.js +8 -6
  85. package/dist/components/fields/repo-files/utils.js +5 -3
  86. package/dist/components/fields/reporter/ReadView.d.ts +0 -1
  87. package/dist/components/fields/reporter/ReadView.js +11 -9
  88. package/dist/components/fields/script/BaseField.js +4 -1
  89. package/dist/components/fields/script/ReadView.d.ts +0 -1
  90. package/dist/components/fields/script/ReadView.js +10 -8
  91. package/dist/components/fields/sprint/ReadView.js +7 -5
  92. package/dist/components/fields/status/Cell.js +8 -6
  93. package/dist/components/fields/status/Field.d.ts +0 -1
  94. package/dist/components/fields/status/ReadView.js +10 -8
  95. package/dist/components/fields/status/SelectFlowHandler.js +15 -12
  96. package/dist/components/fields/status/SelectTransition.js +13 -10
  97. package/dist/components/fields/status/Transition.js +18 -15
  98. package/dist/components/fields/status/TransitionButton.js +17 -14
  99. package/dist/components/fields/status/TransitionPanel.js +14 -11
  100. package/dist/components/fields/status/View.js +11 -8
  101. package/dist/components/fields/status/style/index.js +300 -323
  102. package/dist/components/fields/story-point/ReadView.d.ts +0 -1
  103. package/dist/components/fields/story-point/ReadView.js +6 -4
  104. package/dist/components/fields/tag/ReadView.js +10 -8
  105. package/dist/components/fields/tag/style/index.js +7 -5
  106. package/dist/components/fields/team/ReadView.js +10 -8
  107. package/dist/components/fields/team/style/index.js +5 -3
  108. package/dist/components/fields/text/BaseField.d.ts +0 -1
  109. package/dist/components/fields/text/ReadView.js +8 -6
  110. package/dist/components/fields/tree/ReadView.js +10 -8
  111. package/dist/components/fields/tree/utils.js +5 -3
  112. package/dist/components/fields/updated-at/ReadView.js +10 -8
  113. package/dist/components/fields/updated-by/ReadView.d.ts +0 -1
  114. package/dist/components/fields/updated-by/ReadView.js +11 -9
  115. package/dist/components/fields/user/ReadView.d.ts +0 -1
  116. package/dist/components/fields/user/ReadView.js +11 -9
  117. package/dist/components/fields/user/style/index.js +12 -9
  118. package/dist/components/fields/user-group/BaseField.d.ts +0 -1
  119. package/dist/components/fields/user-group/ReadView.js +11 -13
  120. package/dist/components/fields/version/ReadView.js +8 -6
  121. package/dist/components/fields/workspace/ReadView.d.ts +0 -1
  122. package/dist/components/fields/workspace/ReadView.js +10 -8
  123. package/dist/components/filters/filter-search/utils.js +6 -6
  124. package/dist/components/item/hooks.js +5 -2
  125. package/dist/components/table-components/EditTableCell.d.ts +1 -0
  126. package/dist/components/table-components/EditTableCell.js +38 -16
  127. package/dist/components/table-components/index.js +14 -11
  128. package/dist/components/table-components/style/index.js +7 -5
  129. package/dist/components/table-components/utils.js +49 -46
  130. package/dist/icons/SyncIconFont.js +7 -5
  131. package/dist/icons/createFromIconFontClass.js +3 -1
  132. package/dist/icons/empty-icon/index.d.ts +8 -1
  133. package/dist/icons/empty-icon/large-item@2x.png.js +3 -0
  134. package/dist/icons/empty-icon/large-workspace@2x.png.js +3 -0
  135. package/dist/icons/empty-icon/small-default@2x.png.js +3 -0
  136. package/dist/icons/empty-icon/workspace-empty.svg +126 -126
  137. package/dist/icons/index.d.ts +1 -1
  138. package/dist/icons/index.js +37 -35
  139. package/dist/icons/style/index.js +23 -21
  140. package/dist/icons/svg/ArrowBack.svg.js +3 -0
  141. package/dist/icons/svg/Done.svg.js +3 -0
  142. package/dist/icons/svg/DottedCircle.svg.js +3 -0
  143. package/dist/icons/svg/HollowCircle.svg.js +3 -0
  144. package/dist/icons/svg/Search.svg.js +3 -0
  145. package/dist/icons/svg/Workflow.svg.js +3 -0
  146. package/dist/index.js +47 -47
  147. package/dist/lib/app/utils.d.ts +0 -1
  148. package/dist/lib/app/utils.js +4 -2
  149. package/dist/lib/array.js +5 -44
  150. package/dist/lib/config.js +8 -6
  151. package/dist/lib/constants/code.js +3 -1
  152. package/dist/lib/constants/field.js +5 -2
  153. package/dist/lib/contexts/antdConfig.js +10 -7
  154. package/dist/lib/contexts/currentUser.js +7 -4
  155. package/dist/lib/contexts/currentWorkspace.js +7 -4
  156. package/dist/lib/contexts/datetimeFormat.js +7 -4
  157. package/dist/lib/contexts/index.js +16 -13
  158. package/dist/lib/contexts/itemConfig.js +7 -4
  159. package/dist/lib/contexts/teamConfig.js +8 -5
  160. package/dist/lib/contexts/tenant.js +7 -4
  161. package/dist/lib/contexts/workflowConfig.js +7 -4
  162. package/dist/lib/dataType.js +4 -5
  163. package/dist/lib/date.js +11 -52
  164. package/dist/lib/dayjs.js +2 -1
  165. package/dist/lib/error/log.js +7 -4
  166. package/dist/lib/error/utils.d.ts +1 -1
  167. package/dist/lib/error/utils.js +8 -20
  168. package/dist/lib/error/withServerError.js +3 -1
  169. package/dist/lib/fetch.js +23 -54
  170. package/dist/lib/global.js +16 -14
  171. package/dist/lib/hooks/useAntdConfig.js +4 -2
  172. package/dist/lib/hooks/useCurrentUser.js +4 -2
  173. package/dist/lib/hooks/useCurrentWorkspace.js +4 -2
  174. package/dist/lib/hooks/useDataQuoteStore.js +8 -5
  175. package/dist/lib/hooks/useDateTimeFormatType.js +4 -2
  176. package/dist/lib/hooks/useI18n.d.ts +1 -1
  177. package/dist/lib/hooks/useI18n.js +4 -2
  178. package/dist/lib/hooks/useItemConfig.js +4 -2
  179. package/dist/lib/hooks/useTeamConfig.js +4 -2
  180. package/dist/lib/hooks/useTenant.js +4 -2
  181. package/dist/lib/hooks/useWorkflowConfig.js +4 -2
  182. package/dist/lib/i18n.js +6 -3
  183. package/dist/lib/icons/utils.js +10 -9
  184. package/dist/lib/isInOne.js +2 -1
  185. package/dist/lib/number.js +3 -1
  186. package/dist/lib/path.d.ts +2 -2
  187. package/dist/lib/path.js +9 -6
  188. package/dist/lib/regExp.js +3 -1
  189. package/dist/lib/router.js +4 -1
  190. package/dist/lib/storage.js +4 -39
  191. package/dist/lib/store/dataQuoteStore.js +5 -2
  192. package/dist/lib/swr/constants.js +4 -2
  193. package/dist/lib/swr/hooks.js +6 -3
  194. package/dist/lib/swr/throttleWithCache.js +7 -5
  195. package/dist/lib/throttleFetch.js +4 -2
  196. package/dist/lib/useConfig.js +9 -6
  197. package/dist/lib/useUser.js +9 -6
  198. package/dist/lib/users.js +5 -2
  199. package/dist/lib/workflow.js +21 -20
  200. package/dist/locales/index.js +5 -3
  201. package/dist/public/icons/BulbIcon.svg +1 -1
  202. package/dist/public/icons/Cloud.svg +1 -1
  203. package/dist/public/icons/ConsultIcon.svg +1 -1
  204. package/dist/public/icons/Demo.svg +1 -1
  205. package/dist/public/icons/ErrorTemplate.svg +1 -1
  206. package/dist/public/icons/Fail.svg +1 -1
  207. package/dist/public/icons/Flag.svg +1 -1
  208. package/dist/public/icons/GiteeIcon.svg +1 -1
  209. package/dist/public/icons/IntelligenceGradient.svg +1 -1
  210. package/dist/public/icons/Issue_Approval.svg +1 -1
  211. package/dist/public/icons/Issue_Bug.svg +1 -1
  212. package/dist/public/icons/Issue_Demand.svg +1 -1
  213. package/dist/public/icons/Issue_Doc.svg +1 -1
  214. package/dist/public/icons/Issue_Idea.svg +1 -1
  215. package/dist/public/icons/Issue_List.svg +1 -1
  216. package/dist/public/icons/Issue_Plan.svg +1 -1
  217. package/dist/public/icons/Issue_Product.svg +1 -1
  218. package/dist/public/icons/Issue_Risk.svg +1 -1
  219. package/dist/public/icons/Issue_Story.svg +1 -1
  220. package/dist/public/icons/Issue_Subtask.svg +1 -1
  221. package/dist/public/icons/Issue_Task.svg +1 -1
  222. package/dist/public/icons/Issue_Test.svg +1 -1
  223. package/dist/public/icons/Issue_TestExcution.svg +1 -1
  224. package/dist/public/icons/Issue_TestPlan.svg +1 -1
  225. package/dist/public/icons/Issue_Time.svg +1 -1
  226. package/dist/public/icons/Issue_develop.svg +1 -1
  227. package/dist/public/icons/KanbanCover.svg +7 -7
  228. package/dist/public/icons/ListCover.svg +117 -117
  229. package/dist/public/icons/ManHour.svg +1 -1
  230. package/dist/public/icons/MobileIcon.svg +1 -1
  231. package/dist/public/icons/NoItemType.svg +10 -10
  232. package/dist/public/icons/ProductIcon.svg +1 -1
  233. package/dist/public/icons/RedFlagIcon.svg +1 -1
  234. package/dist/public/icons/Safe.svg +1 -1
  235. package/dist/public/icons/StarIcon.svg +60 -60
  236. package/dist/public/icons/StructureCover.svg +1 -1
  237. package/dist/public/icons/Success.svg +1 -1
  238. package/dist/public/icons/TeamIcon.svg +1 -1
  239. package/dist/public/icons/WebIcon.svg +1 -1
  240. package/dist/public/icons/iconfont.svg +467 -467
  241. package/dist/public/icons/iconfont_single_color.css +912 -912
  242. package/dist/public/mockServiceWorker.js +284 -284
  243. package/dist/style/common.js +11 -24
  244. package/dist/style/global.js +9 -7
  245. package/package.json +111 -105
  246. package/dist/components/fields/base-component/types.js +0 -1
  247. package/dist/components/fields/hooks/useParamsAdapter.js +0 -1
  248. package/dist/components/fields/radio/BaseField.js +0 -1
  249. package/dist/components/fields/status/Field.js +0 -1
  250. package/dist/components/fields/tag/BaseField.js +0 -1
  251. package/dist/components/fields/text/BaseField.js +0 -1
  252. package/dist/components/fields/tree/BaseField.js +0 -1
  253. package/dist/components/fields/tree/types.js +0 -1
  254. package/dist/components/fields/types.js +0 -1
  255. package/dist/components/fields/user-group/ActionCell.js +0 -1
  256. package/dist/components/fields/user-group/BaseField.js +0 -1
  257. package/dist/icons/empty-icon/index.js +0 -8
  258. package/dist/icons/svg/ArrowBack.svg +0 -1
  259. package/dist/icons/svg/Done.svg +0 -1
  260. package/dist/icons/svg/DottedCircle.svg +0 -7
  261. package/dist/icons/svg/HollowCircle.svg +0 -6
  262. package/dist/icons/svg/Search.svg +0 -1
  263. package/dist/icons/svg/Workflow.svg +0 -12
  264. package/dist/lib/error/index.js +0 -2
@@ -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;
@@ -51,6 +52,7 @@ const Dropdown = props => {
51
52
  const valueRef = useRef([]);
52
53
  const containerRef = useRef(null);
53
54
  const targetRef = useRef(null);
55
+ const onBlurRef = useRef({ time: 0, e: null });
54
56
  const [isClicked, setClicked] = useState(false);
55
57
  const optionLoadedRef = useRef(false);
56
58
  const loadMoreRef = useRef(false);
@@ -298,7 +300,7 @@ const Dropdown = props => {
298
300
  return null;
299
301
  showValue = valueArr.map((item, index) => {
300
302
  const content = _optionsMap[item] ? getFormattedLabel(_optionsMap[item]) : item;
301
- return index === value.length - 1 ? content : _jsxs(_Fragment, { children: [content, ","] });
303
+ return index === value.length - 1 ? content : jsxs(Fragment, { children: [content, ","] });
302
304
  });
303
305
  }
304
306
  }
@@ -309,7 +311,7 @@ const Dropdown = props => {
309
311
  const opt = _options.filter(item => item.value === handleValue(val));
310
312
  const label = ((_a = opt[0]) === null || _a === void 0 ? void 0 : _a.label) || handleValue(val);
311
313
  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) }));
314
+ 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
315
  }
314
316
  }
315
317
  }
@@ -429,6 +431,7 @@ const Dropdown = props => {
429
431
  const handleBlur = useCallback(e => {
430
432
  var _a;
431
433
  if (open) {
434
+ onBlurRef.current = { time: Date.now(), e: e };
432
435
  return;
433
436
  }
434
437
  if (!editMode) {
@@ -496,6 +499,15 @@ const Dropdown = props => {
496
499
  });
497
500
  }
498
501
  }, [isMultiple]);
502
+ useEffect(() => {
503
+ if (!open) {
504
+ const now = Date.now();
505
+ if (now > onBlurRef.current.time && now - onBlurRef.current.time < 200) {
506
+ handleBlur(onBlurRef.current.e);
507
+ onBlurRef.current.time = 0;
508
+ }
509
+ }
510
+ }, [handleBlur, open]);
499
511
  const dropdownRender = useCallback(({ cx, css }) => {
500
512
  return menu => {
501
513
  if (!isShowOnlyWorkspace)
@@ -503,24 +515,24 @@ const Dropdown = props => {
503
515
  const message = t('pages.fields.default.onlyWorkspace', {
504
516
  name: props.onlyWorkspaceTip || t(`pages.fields.fieldName.${fieldTypeKey}`),
505
517
  });
506
- return (_jsxs(_Fragment, { children: [_jsx("div", { className: cx(css(onlyWorkspaceStyle)), children: _jsx(Checkbox, { checked: onlyWorkspace, onChange: onChangeCurrent, onClick: e => {
518
+ return (jsxs(Fragment, { children: [jsx("div", { className: cx(css(onlyWorkspaceStyle)), children: jsx(Checkbox, { checked: onlyWorkspace, onChange: onChangeCurrent, onClick: e => {
507
519
  e.stopPropagation();
508
- }, children: _jsx(BaseOverflowTooltip, { title: message, children: message }) }) }), _jsx(Divider, { className: cx(css(onlyWorkspaceDividerStyle)) }), menu] }));
520
+ }, children: jsx(BaseOverflowTooltip, { title: message, children: message }) }) }), jsx(Divider, { className: cx(css(onlyWorkspaceDividerStyle)) }), menu] }));
509
521
  };
510
522
  }, [fieldTypeKey, isShowOnlyWorkspace, onChangeCurrent, onlyWorkspace, props.onlyWorkspaceTip, t]);
511
523
  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 }) })) }));
524
+ return loading && canAsyncFetchOption ? (jsx(Spin, { size: "small" })) : (jsx(ClassNames, { children: ({ css, cx }) => (jsx("div", { className: cx(css(emptyIconWrapper)), children: jsx(EmptyIcon, { noMargin: true }) })) }));
513
525
  }, [canAsyncFetchOption, loading]);
514
526
  const style = getFieldWidthStyle(labelWidth, labelAlign, hiddenLabel, apply);
515
527
  const hiddenHover = readonly || editMode || editing || apply === 'cell' || isView;
516
528
  const overlayRender = useMemo(() => {
517
- return (_jsx(ClassNames, { children: ({ cx, css }) => {
529
+ return (jsx(ClassNames, { children: ({ cx, css }) => {
518
530
  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)) : '', {
531
+ 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
532
  [optionDisplayWrapClass]: optionDisplayWrap,
521
533
  }), 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
534
  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));
535
+ 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
536
  }) }) }));
525
537
  } }));
526
538
  }, [
@@ -553,13 +565,14 @@ const Dropdown = props => {
553
565
  selectValue,
554
566
  t,
555
567
  ]);
556
- return (_jsx(ClassNames, { children: ({ cx, css }) => {
568
+ return (jsx(ClassNames, { children: ({ cx, css }) => {
557
569
  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) })] }));
570
+ return (jsxs(Col, { style: style, ref: containerRef, className: cx(css(dropdownStyle(antPrefix)), 'field-value', viewClassNames, { [hiddenHoverClass]: hiddenHover }, { [displayWrapClass]: valueDisplayWrap }, { [css(dropdownSelectStyle(antPrefix))]: disabledLineThrough || displayValueHidden }), onClick: handleClick, children: [(readonly || (!editMode && !editing)) &&
571
+ (cxShowValue ? (!valueDisplayWrap ? (isView && isMultiple ? (jsx(Expand, { readonly: readonly, editing: editing, expandType: EXPAND_TYPE_ENUM.TAG, children: valueOptions.map(item => (jsx("span", { className: "field-common-view-tag", children: jsx(BaseOverflowTooltip, { title: item.label, children: item.label }) }, item.value))) })) : (jsx(OverflowTooltip, { title: cxShowValue, children: cxShowValue }))) : (jsx("div", { className: cx(valueOptionContentClass), children: valueOptions.map(ele => {
572
+ return (jsxs("div", { className: cx(valueOptionClass), title: ele.label, children: [jsx(ItemIcon, { className: cx(valueOptionIconClass), icon: ele.icon }), jsx("span", { className: cx(valueOptionLabelClass), children: ele.label })] }, ele.value));
573
+ }) }))) : (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
574
  } }));
563
575
  };
564
576
  Dropdown.displayName = 'DropdownBaseField';
565
- export default Dropdown;
577
+
578
+ 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';
@@ -1,9 +1,10 @@
1
- import { useCallback, useMemo, useRef, useState } from 'react';
2
- import { debounce, uniqWith } from 'lodash-es';
3
- import { getArrayValue } from 'lib/array';
4
- import { REMOTE_DATA_QUOTE_FIELD_TYPE } from 'lib/constants/field';
5
- import { FIELD_TYPE_KEY_MAPPINGS } from 'lib/global';
6
- import { useFetchDropdown } from './data';
1
+ import { useState, useMemo, useRef, useCallback } from 'react';
2
+ import { uniqWith, debounce } from 'lodash-es';
3
+ import { getArrayValue } from '../../../lib/array.js';
4
+ import { REMOTE_DATA_QUOTE_FIELD_TYPE } from '../../../lib/constants/field.js';
5
+ import { FIELD_TYPE_KEY_MAPPINGS } from '../../../lib/global.js';
6
+ import { useFetchDropdown } from './data.js';
7
+
7
8
  const useGenerateFetchFunction = ({ workspaceId, page, fieldId, propsValue, needFetchDataSource, defaultFetchValues, defaultFetchOptions, }) => {
8
9
  const fetchDropdownData = useFetchDropdown();
9
10
  const fetchOptions = useMemo(() => {
@@ -38,8 +39,8 @@ const useGenerateFetchFunction = ({ workspaceId, page, fieldId, propsValue, need
38
39
  fetchValues,
39
40
  };
40
41
  };
41
- export const EMPTY_OPTIONS = [];
42
- export const useCommonProps = (props) => {
42
+ const EMPTY_OPTIONS = [];
43
+ const useCommonProps = (props) => {
43
44
  var _a;
44
45
  const { value: propsValue, options: _propsOptions = EMPTY_OPTIONS, fetchValues: _fetchValues, fetchOptions: _fetchOptions, debounceTimeout = 600, objectId, userData, workspace, page, fetchChange, onlyWorkspace, setOnlyWorkspace, fieldTypeKey, detailKey, isCascaded, cascadeCustomData, workspaceId, dataSource, } = props;
45
46
  const [loading, setLoading] = useState(true);
@@ -150,3 +151,5 @@ export const useCommonProps = (props) => {
150
151
  value,
151
152
  };
152
153
  };
154
+
155
+ export { EMPTY_OPTIONS, useCommonProps };
@@ -1,90 +1,93 @@
1
- import { randomClassName } from 'style/common';
2
- import { hoverIconStyle, hoverStyle } from 'components/common/style/mixin';
3
- export const dropdownSelectDisabled = `
4
- text-decoration: line-through;
1
+ import { randomClassName } from '../../../style/common.js';
2
+ import { hoverStyle, hoverIconStyle } from '../../common/style/mixin.js';
3
+
4
+ const dropdownSelectDisabled = `
5
+ text-decoration: line-through;
5
6
  `;
6
- export const onlyWorkspaceStyle = `
7
- padding: 5px 12px;
7
+ const onlyWorkspaceStyle = `
8
+ padding: 5px 12px;
8
9
  `;
9
- export const onlyWorkspaceDividerStyle = `
10
- &:not(.add-weights) {
11
- margin: 4px 0;
12
- }
10
+ const onlyWorkspaceDividerStyle = `
11
+ &:not(.add-weights) {
12
+ margin: 4px 0;
13
+ }
13
14
  `;
14
- export const hiddenHoverClass = randomClassName('hidden-hover');
15
- export const displayWrapClass = randomClassName('display-wrap');
16
- export const valueOptionClass = randomClassName('value-option');
17
- export const valueOptionContentClass = randomClassName('value-option-content');
18
- export const valueOptionIconClass = randomClassName('value-option-icon');
19
- export const valueOptionLabelClass = randomClassName('value-option-label');
20
- export const workspaceClass = randomClassName('workspace');
21
- export const hoverIconClass = randomClassName('hover-icon');
22
- export const optionDisplayWrapClass = randomClassName('option-display-wrap');
23
- export const dropdownStyle = (antPrefix) => `
24
- width: 100%;
25
-
26
- &:not(.${hiddenHoverClass}) &:not(.${displayWrapClass}) :hover {
27
- ${hoverStyle}
28
-
29
- .${hoverIconClass} {
30
- display: inline-block;
31
- }
32
- }
33
-
34
- .${hoverIconClass} {
35
- ${hoverIconStyle}
36
- }
37
-
38
- .${antPrefix}-select {
39
- width: 100%;
40
- }
41
-
42
- .${antPrefix}-select-selection-item) {
43
- .${workspaceClass} {
44
- display: none;
45
- }
46
- }
47
-
48
- .${valueOptionClass} {
49
- margin-bottom: 8px;
50
- }
51
-
52
- .${valueOptionContentClass} {
53
- width: 100%;
54
- padding-top: 6px;
55
-
56
- .${valueOptionIconClass} {
57
- position: absolute;
58
- margin-top: 3px;
59
- }
60
-
61
- .${valueOptionLabelClass} {
62
- display: inline-block;
63
- width: ~'calc(100% - 22px)';
64
- margin-left: 22px;
65
- overflow: hidden;
66
- text-overflow: ellipsis;
67
- white-space: nowrap;
68
- }
69
- }
70
-
71
- .${optionDisplayWrapClass} {
72
- .${antPrefix}-select-selection-overflow {
73
- display: block;
74
- .${antPrefix}-select-selection-overflow-item {
75
- width: fit-content;
76
- }
77
- }
78
- }
15
+ const hiddenHoverClass = randomClassName('hidden-hover');
16
+ const displayWrapClass = randomClassName('display-wrap');
17
+ const valueOptionClass = randomClassName('value-option');
18
+ const valueOptionContentClass = randomClassName('value-option-content');
19
+ const valueOptionIconClass = randomClassName('value-option-icon');
20
+ const valueOptionLabelClass = randomClassName('value-option-label');
21
+ const workspaceClass = randomClassName('workspace');
22
+ const hoverIconClass = randomClassName('hover-icon');
23
+ const optionDisplayWrapClass = randomClassName('option-display-wrap');
24
+ const dropdownStyle = (antPrefix) => `
25
+ width: 100%;
26
+
27
+ &:not(.${hiddenHoverClass}) &:not(.${displayWrapClass}) :hover {
28
+ ${hoverStyle}
29
+
30
+ .${hoverIconClass} {
31
+ display: inline-block;
32
+ }
33
+ }
34
+
35
+ .${hoverIconClass} {
36
+ ${hoverIconStyle}
37
+ }
38
+
39
+ .${antPrefix}-select {
40
+ width: 100%;
41
+ }
42
+
43
+ .${antPrefix}-select-selection-item) {
44
+ .${workspaceClass} {
45
+ display: none;
46
+ }
47
+ }
48
+
49
+ .${valueOptionClass} {
50
+ margin-bottom: 8px;
51
+ }
52
+
53
+ .${valueOptionContentClass} {
54
+ width: 100%;
55
+ padding-top: 6px;
56
+
57
+ .${valueOptionIconClass} {
58
+ position: absolute;
59
+ margin-top: 3px;
60
+ }
61
+
62
+ .${valueOptionLabelClass} {
63
+ display: inline-block;
64
+ width: ~'calc(100% - 22px)';
65
+ margin-left: 22px;
66
+ overflow: hidden;
67
+ text-overflow: ellipsis;
68
+ white-space: nowrap;
69
+ }
70
+ }
71
+
72
+ .${optionDisplayWrapClass} {
73
+ .${antPrefix}-select-selection-overflow {
74
+ display: block;
75
+ .${antPrefix}-select-selection-overflow-item {
76
+ width: fit-content;
77
+ }
78
+ }
79
+ }
79
80
  `;
80
- export const dropdownSelectOptionClass = randomClassName('dropdown-select-option');
81
- export const disabledClass = randomClassName('disabled');
82
- export const dropdownSelectStyle = (antPrefix) => `
83
- .${dropdownSelectOptionClass}.${disabledClass} {
84
- text-decoration: line-through;
85
- }
86
-
87
- .${antPrefix}-select-selection-item-content {
88
- text-decoration: line-through;
89
- }
81
+ const dropdownSelectOptionClass = randomClassName('dropdown-select-option');
82
+ const disabledClass = randomClassName('disabled');
83
+ const dropdownSelectStyle = (antPrefix) => `
84
+ .${dropdownSelectOptionClass}.${disabledClass} {
85
+ text-decoration: line-through;
86
+ }
87
+
88
+ .${antPrefix}-select-selection-item-content {
89
+ text-decoration: line-through;
90
+ }
90
91
  `;
92
+
93
+ export { disabledClass, displayWrapClass, dropdownSelectDisabled, dropdownSelectOptionClass, dropdownSelectStyle, dropdownStyle, hiddenHoverClass, hoverIconClass, onlyWorkspaceDividerStyle, onlyWorkspaceStyle, optionDisplayWrapClass, valueOptionClass, valueOptionContentClass, valueOptionIconClass, valueOptionLabelClass, workspaceClass };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ReadViewBaseProps } from '../types';
3
2
  declare const FileReadView: import("react").NamedExoticComponent<ReadViewBaseProps>;
4
3
  export default FileReadView;
@@ -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 } 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 FileReadView = memo(({ value }) => {
6
7
  const showValue = (value === null || value === void 0 ? void 0 : value.length)
7
8
  ? value
@@ -9,6 +10,7 @@ const FileReadView = memo(({ value }) => {
9
10
  .filter(Boolean)
10
11
  .join(',')
11
12
  : '';
12
- return (_jsx(_Fragment, { children: showValue ? (_jsx(SimpleOverflowToolTip, { title: showValue, children: showValue })) : (_jsx(EmptyField, { readonly: true })) }));
13
+ return (jsx(Fragment, { children: showValue ? (jsx(SimpleOverflowToolTip, { title: showValue, children: showValue })) : (jsx(EmptyField, { readonly: true })) }));
13
14
  });
14
- export default FileReadView;
15
+
16
+ export { FileReadView as default };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type FormulaReadViewProps = {
3
2
  value?: string | number | boolean | undefined;
4
3
  placeholder?: string;
@@ -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 FormulaReadView = memo(({ value, addonBefore = '', addonAfter = '' }) => {
6
7
  const showValue = useMemo(() => {
7
8
  return (value === null || value === void 0 ? void 0 : value.toString()) || '';
@@ -9,6 +10,7 @@ const FormulaReadView = memo(({ value, addonBefore = '', addonAfter = '' }) => {
9
10
  const valueWithPrefix = useMemo(() => {
10
11
  return `${addonBefore}${showValue || ''}${addonAfter}`;
11
12
  }, [addonBefore, showValue, addonAfter]);
12
- return (_jsx(_Fragment, { children: valueWithPrefix ? (_jsx(SimpleOverflowToolTip, { title: valueWithPrefix, children: valueWithPrefix })) : (_jsx(EmptyField, { readonly: true })) }));
13
+ return (jsx(Fragment, { children: valueWithPrefix ? (jsx(SimpleOverflowToolTip, { title: valueWithPrefix, children: valueWithPrefix })) : (jsx(EmptyField, { readonly: true })) }));
13
14
  });
14
- export default FormulaReadView;
15
+
16
+ export { FormulaReadView as default };
@@ -1,5 +1,6 @@
1
1
  import { useMemo } from 'react';
2
- import { SCREEN_TYPE } from 'lib/global';
2
+ import { SCREEN_TYPE } from '../../../lib/global.js';
3
+
3
4
  const useViewClass = ({ screenMode, editing, readonly }) => {
4
5
  const isView = useMemo(() => {
5
6
  return screenMode === SCREEN_TYPE.View;
@@ -15,4 +16,5 @@ const useViewClass = ({ screenMode, editing, readonly }) => {
15
16
  isView,
16
17
  };
17
18
  };
18
- export default useViewClass;
19
+
20
+ export { useViewClass as default };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { CellProps } from '../base-component/types';
3
2
  export interface BaseFieldProps {
4
3
  value: {
@@ -1,17 +1,19 @@
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 { css } from '@emotion/react';
4
4
  import { Popover } from 'antd';
5
- import EmptyField from '../../common/EmptyField';
6
- import { hyperLinkItemStyle, hyperLinkListStyle, hyperLinkTipItem } from './style';
5
+ import EmptyField from '../../common/EmptyField.js';
6
+ import { hyperLinkTipItem, hyperLinkListStyle, hyperLinkItemStyle } from './style/index.js';
7
+
7
8
  const HyperLinkCell = memo(props => {
8
9
  const { value } = props;
9
10
  const list = useMemo(() => {
10
11
  return value === null || value === void 0 ? void 0 : value.filter(item => item === null || item === void 0 ? void 0 : item.value);
11
12
  }, [value]);
12
13
  const content = useMemo(() => {
13
- return list === null || list === void 0 ? void 0 : list.map(item => (_jsx("a", { href: item.value, target: "_blank", rel: "noreferrer", css: css(hyperLinkTipItem), children: item.label }, item.id)));
14
+ return list === null || list === void 0 ? void 0 : list.map(item => (jsx("a", { href: item.value, target: "_blank", rel: "noreferrer", css: css(hyperLinkTipItem), children: item.label }, item.id)));
14
15
  }, [list]);
15
- return (list === null || list === void 0 ? void 0 : list.length) > 0 ? (_jsx(Popover, { content: content, destroyTooltipOnHide: true, children: _jsx("div", { css: css(hyperLinkListStyle), children: list.map((item, index) => (_jsxs("a", { href: item.value, target: "_blank", rel: "noreferrer", css: css(hyperLinkItemStyle), children: [item.label, index + 1 !== list.length && _jsx("span", { children: ",\u00A0" })] }, item.id))) }) })) : (_jsx(EmptyField, { readonly: true }));
16
+ return (list === null || list === void 0 ? void 0 : list.length) > 0 ? (jsx(Popover, { content: content, destroyTooltipOnHide: true, children: jsx("div", { css: css(hyperLinkListStyle), children: list.map((item, index) => (jsxs("a", { href: item.value, target: "_blank", rel: "noreferrer", css: css(hyperLinkItemStyle), children: [item.label, index + 1 !== list.length && jsx("span", { children: ",\u00A0" })] }, item.id))) }) })) : (jsx(EmptyField, { readonly: true }));
16
17
  });
17
- export default HyperLinkCell;
18
+
19
+ export { HyperLinkCell as default };