@lingxiteam/ebe-utils 0.2.21 → 0.2.23

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 (144) hide show
  1. package/lib/h5public/yarn.lock +7 -8
  2. package/lib/pcpublic/src/components/pcfactory/src/Button/index.tsx +11 -10
  3. package/lib/pcpublic/src/components/pcfactory/src/Card/CardTitle/index.tsx +31 -24
  4. package/lib/pcpublic/src/components/pcfactory/src/Card/index.tsx +32 -14
  5. package/lib/pcpublic/src/components/pcfactory/src/Card/useExtendBtn.tsx +85 -48
  6. package/lib/pcpublic/src/components/pcfactory/src/ChartLine/ChartLine.tsx +24 -6
  7. package/lib/pcpublic/src/components/pcfactory/src/ChartLine/PropsType.ts +31 -5
  8. package/lib/pcpublic/src/components/pcfactory/src/ChartLine/index.tsx +3 -2
  9. package/lib/pcpublic/src/components/pcfactory/src/ChartLine/loader.tsx +1 -1
  10. package/lib/pcpublic/src/components/pcfactory/src/Form/Form.tsx +153 -129
  11. package/lib/pcpublic/src/components/pcfactory/src/Form/index.tsx +2 -5
  12. package/lib/pcpublic/src/components/pcfactory/src/Form/useFormStatus.ts +8 -4
  13. package/lib/pcpublic/src/components/pcfactory/src/LXPieChart/LXPieChart.tsx +15 -3
  14. package/lib/pcpublic/src/components/pcfactory/src/LXPieChart/PropsType.ts +4 -3
  15. package/lib/pcpublic/src/components/pcfactory/src/LXPieChart/index.tsx +1 -1
  16. package/lib/pcpublic/src/components/pcfactory/src/LXPieChart/loader.tsx +1 -1
  17. package/lib/pcpublic/src/components/pcfactory/src/LXRadarChart/LXRadarChat.tsx +18 -4
  18. package/lib/pcpublic/src/components/pcfactory/src/LXRadarChart/PropsType.ts +2 -1
  19. package/lib/pcpublic/src/components/pcfactory/src/LXRadarChart/index.tsx +1 -1
  20. package/lib/pcpublic/src/components/pcfactory/src/LXRadarChart/loader.tsx +1 -1
  21. package/lib/pcpublic/src/components/pcfactory/src/ModalSelect/BaseModalSelect.tsx +7 -2
  22. package/lib/pcpublic/src/components/pcfactory/src/ModalSelect/index.tsx +60 -26
  23. package/lib/pcpublic/src/components/pcfactory/src/RichTextEditor/LcdpUeditorMain.tsx +62 -55
  24. package/lib/pcpublic/src/components/pcfactory/src/RichTextEditor/RichTextEditor.tsx +2 -6
  25. package/lib/pcpublic/src/components/pcfactory/src/RichTextEditor/RichTextEditorMain.tsx +5 -5
  26. package/lib/pcpublic/src/components/pcfactory/src/RichTextEditor/index.tsx +9 -2
  27. package/lib/pcpublic/src/components/pcfactory/src/RichTextEditor/loader.ts +1 -1
  28. package/lib/pcpublic/src/components/pcfactory/src/Select/index.tsx +145 -66
  29. package/lib/pcpublic/src/components/pcfactory/src/Select/selectUtils.ts +13 -9
  30. package/lib/pcpublic/src/components/pcfactory/src/Table/BodyCell/index.tsx +36 -26
  31. package/lib/pcpublic/src/components/pcfactory/src/Table/EditComponent/index.tsx +69 -94
  32. package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/GhostTag/index.tsx +12 -5
  33. package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/Hyperlink/index.tsx +9 -5
  34. package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/PointTag/index.tsx +11 -5
  35. package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/PureColourFill/index.tsx +11 -5
  36. package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/PureFadeColourTag/index.tsx +14 -7
  37. package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/Thumbnail/index.tsx +30 -31
  38. package/lib/pcpublic/src/components/pcfactory/src/Table/FormatCell/index.tsx +89 -41
  39. package/lib/pcpublic/src/components/pcfactory/src/Table/HeaderCell/HeaderCellTitle/index.tsx +25 -12
  40. package/lib/pcpublic/src/components/pcfactory/src/Table/HeaderCell/index.tsx +12 -5
  41. package/lib/pcpublic/src/components/pcfactory/src/Table/OperationCell/PopoverWrapper.tsx +220 -0
  42. package/lib/pcpublic/src/components/pcfactory/src/Table/OperationCell/SingleBtn.tsx +39 -32
  43. package/lib/pcpublic/src/components/pcfactory/src/Table/OperationCell/index.tsx +178 -148
  44. package/lib/pcpublic/src/components/pcfactory/src/Table/Table.tsx +439 -0
  45. package/lib/pcpublic/src/components/pcfactory/src/Table/TableHead/index.tsx +159 -72
  46. package/lib/pcpublic/src/components/pcfactory/src/Table/TableSummaryRow/index.tsx +12 -20
  47. package/lib/pcpublic/src/components/pcfactory/src/Table/constant.ts +3 -0
  48. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/index.ts +4 -4
  49. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useCMDActions.ts +32 -28
  50. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useCheckStrict.ts +44 -57
  51. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useColumns.tsx +306 -276
  52. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useCommon.ts +9 -6
  53. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useDataSource.ts +30 -21
  54. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useExpandable.tsx +33 -27
  55. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useFilter.tsx +84 -77
  56. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useFormatCell.tsx +33 -16
  57. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/usePagination.ts +15 -5
  58. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useRowEdit.ts +33 -33
  59. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useRowMerge.ts +13 -5
  60. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useScroll.ts +94 -28
  61. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useSelection.ts +108 -99
  62. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useSort.ts +8 -5
  63. package/lib/pcpublic/src/components/pcfactory/src/Table/hooks/useSummaryCol.ts +27 -43
  64. package/lib/pcpublic/src/components/pcfactory/src/Table/index.tsx +73 -394
  65. package/lib/pcpublic/src/components/pcfactory/src/Table/loader.tsx +15 -0
  66. package/lib/pcpublic/src/components/pcfactory/src/Table/types/OperationCell.d.ts +2 -2
  67. package/lib/pcpublic/src/components/pcfactory/src/Table/types/event.d.ts +12 -8
  68. package/lib/pcpublic/src/components/pcfactory/src/Table/types/headerCell.d.ts +2 -1
  69. package/lib/pcpublic/src/components/pcfactory/src/Table/types/prop.d.ts +24 -11
  70. package/lib/pcpublic/src/components/pcfactory/src/Table/utils/SequenceId.ts +2 -1
  71. package/lib/pcpublic/src/components/pcfactory/src/Table/utils/index.ts +90 -82
  72. package/lib/pcpublic/src/components/pcfactory/src/Table/utils/indexedDBHelper.ts +9 -22
  73. package/lib/pcpublic/src/components/pcfactory/src/Table/utils/translate.ts +59 -0
  74. package/lib/pcpublic/src/components/pcfactory/src/Transfer/Transfer.tsx +644 -0
  75. package/lib/pcpublic/src/components/pcfactory/src/Transfer/index.tsx +49 -637
  76. package/lib/pcpublic/src/components/pcfactory/src/Transfer/loader.tsx +11 -0
  77. package/lib/pcpublic/src/components/pcfactory/src/Tree/TreeEllipsisIcon.tsx +38 -0
  78. package/lib/pcpublic/src/components/pcfactory/src/Tree/TreeNodeMenu/index.tsx +34 -35
  79. package/lib/pcpublic/src/components/pcfactory/src/Tree/index.tsx +213 -149
  80. package/lib/pcpublic/src/components/pcfactory/src/TreeSelect/index.tsx +47 -43
  81. package/lib/pcpublic/src/components/pcfactory/src/TreeTable/TreeTable.tsx +264 -0
  82. package/lib/pcpublic/src/components/pcfactory/src/TreeTable/hooks/index.ts +4 -1
  83. package/lib/pcpublic/src/components/pcfactory/src/TreeTable/hooks/useCMDAction.ts +9 -3
  84. package/lib/pcpublic/src/components/pcfactory/src/TreeTable/hooks/useExpandable.tsx +9 -3
  85. package/lib/pcpublic/src/components/pcfactory/src/TreeTable/index.tsx +52 -191
  86. package/lib/pcpublic/src/components/pcfactory/src/TreeTable/loader.tsx +16 -0
  87. package/lib/pcpublic/src/components/pcfactory/src/assets/index.tsx +34 -0
  88. package/lib/pcpublic/src/components/pcfactory/src/assets/svg/quadrate.tsx +20 -0
  89. package/lib/pcpublic/src/components/pcfactory/src/assets/svg/roundness.tsx +14 -0
  90. package/lib/pcpublic/src/components/pcfactory/src/assets/svg/semicircle.tsx +15 -0
  91. package/lib/pcpublic/src/components/pcfactory/src/assets/svg/verticalLine.tsx +12 -0
  92. package/lib/pcpublic/src/components/pcfactory/src/styles/common.less +17 -0
  93. package/lib/pcpublic/src/components/pcfactory/src/styles/components/Card.less +57 -11
  94. package/lib/pcpublic/src/components/pcfactory/src/styles/components/Form.less +101 -12
  95. package/lib/pcpublic/src/components/pcfactory/src/styles/components/ModalSelect.less +6 -0
  96. package/lib/pcpublic/src/components/pcfactory/src/styles/components/Select.less +70 -6
  97. package/lib/pcpublic/src/components/pcfactory/src/utils/ChannelContainer.tsx +20 -14
  98. package/lib/pcpublic/src/components/pcfactory/src/utils/ChildRender.ts +6 -8
  99. package/lib/pcpublic/src/components/pcfactory/src/utils/CustomModule.tsx +4 -6
  100. package/lib/pcpublic/src/components/pcfactory/src/utils/DummyFormContext.ts +9 -13
  101. package/lib/pcpublic/src/components/pcfactory/src/utils/Empty/empty.tsx +5 -17
  102. package/lib/pcpublic/src/components/pcfactory/src/utils/Empty/index.tsx +3 -3
  103. package/lib/pcpublic/src/components/pcfactory/src/utils/Holidays.ts +11 -39
  104. package/lib/pcpublic/src/components/pcfactory/src/utils/HolidaysFormat.ts +83 -0
  105. package/lib/pcpublic/src/components/pcfactory/src/utils/IdleContainer/index.tsx +47 -0
  106. package/lib/pcpublic/src/components/pcfactory/src/utils/IdleContainer/scheduler.ts +74 -0
  107. package/lib/pcpublic/src/components/pcfactory/src/utils/LoaderHelper.tsx +4 -1
  108. package/lib/pcpublic/src/components/pcfactory/src/utils/Spin/index.tsx +8 -7
  109. package/lib/pcpublic/src/components/pcfactory/src/utils/WithSyncValue.ts +25 -23
  110. package/lib/pcpublic/src/components/pcfactory/src/utils/ahooks/index.ts +10 -7
  111. package/lib/pcpublic/src/components/pcfactory/src/utils/ahooks/useMap.ts +9 -6
  112. package/lib/pcpublic/src/components/pcfactory/src/utils/ahooks/useMemoizedFn.ts +4 -1
  113. package/lib/pcpublic/src/components/pcfactory/src/utils/ahooks/usePersistFn.ts +17 -0
  114. package/lib/pcpublic/src/components/pcfactory/src/utils/ahooks/useSafeState.ts +2 -2
  115. package/lib/pcpublic/src/components/pcfactory/src/utils/ahooks/useSetState.ts +7 -5
  116. package/lib/pcpublic/src/components/pcfactory/src/utils/common.ts +23 -50
  117. package/lib/pcpublic/src/components/pcfactory/src/utils/constant.ts +53 -57
  118. package/lib/pcpublic/src/components/pcfactory/src/utils/dynamicUtils/DynamicContext.tsx +12 -17
  119. package/lib/pcpublic/src/components/pcfactory/src/utils/formUtils/FormContext.tsx +22 -12
  120. package/lib/pcpublic/src/components/pcfactory/src/utils/formUtils/FormFields.tsx +50 -19
  121. package/lib/pcpublic/src/components/pcfactory/src/utils/formUtils/WrapperContainer.tsx +58 -37
  122. package/lib/pcpublic/src/components/pcfactory/src/utils/formUtils/cmdHelper.ts +33 -30
  123. package/lib/pcpublic/src/components/pcfactory/src/utils/formUtils/common.ts +2 -0
  124. package/lib/pcpublic/src/components/pcfactory/src/utils/generatorDisabledCallback.ts +121 -113
  125. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useCommonImperativeHandle.ts +16 -14
  126. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useCompState.tsx +1 -1
  127. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useDataMask.ts +7 -2
  128. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useDoubleClick.ts +3 -1
  129. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useFuncExpExecute.ts +16 -14
  130. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useGetStaticAttrData.ts +9 -3
  131. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useHiddenStyle.ts +4 -5
  132. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useInit.ts +11 -0
  133. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useInitReactQuill.ts +3 -1
  134. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useListenState.ts +1 -0
  135. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useLocale.ts +5 -3
  136. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/usePrintMode.tsx +2 -2
  137. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useRules.ts +1 -1
  138. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useTestHelper.ts +2 -0
  139. package/lib/pcpublic/src/components/pcfactory/src/utils/hooks/useToggleBoolean.ts +8 -4
  140. package/lib/pcpublic/src/components/pcfactory/src/utils/index.ts +10 -10
  141. package/lib/pcpublic/src/components/pcfactory/src/utils/polyfill.js +29 -31
  142. package/lib/pcpublic/src/components/pcfactory/src/utils/renderReadOnly.tsx +29 -26
  143. package/lib/public/public/iconfont.js +1 -0
  144. package/package.json +2 -2
@@ -10,6 +10,59 @@
10
10
  margin-bottom: 14px;
11
11
  }
12
12
 
13
+ .formLabel-required {
14
+ font-size: 12px;
15
+ margin-right: 2px;
16
+ color: #ff4d4f;
17
+ position: relative;
18
+ top: 1px;
19
+ font-family: 'SimSun, sans-serif';
20
+ }
21
+
22
+ .formLabel-colon {
23
+ margin-left: 2px;
24
+ margin-right: 4px;
25
+ }
26
+
27
+ .formLabel-item-label {
28
+ display: flex;
29
+ flex-wrap: nowrap;
30
+ justify-content: flex-start;
31
+ align-items: flex-start;
32
+
33
+ &-title {
34
+ display: inline-block;
35
+ max-width: calc(100%-16px);
36
+ overflow: hidden;
37
+ white-space: nowrap;
38
+ text-overflow: ellipsis;
39
+
40
+ &-label-wrap {
41
+ white-space: unset;
42
+ overflow-y: visible;
43
+ }
44
+ }
45
+
46
+ &::after {
47
+ content: ':';
48
+ display: inline-block;
49
+ width: 8px;
50
+ text-align: center;
51
+ margin-right: 8px;
52
+ }
53
+
54
+ &-no-colon {
55
+ .formLabel-item-label-title {
56
+ max-width: 100%;
57
+ padding-right: 8px;
58
+ }
59
+ &::after {
60
+ display: none;
61
+ content: '';
62
+ }
63
+ }
64
+ }
65
+
13
66
  .explainHelp-line-height .@{form-item-prefix-cls}-explain {
14
67
  line-height: var(--explainHelp-Line-height);
15
68
  }
@@ -23,8 +76,10 @@
23
76
  &-label {
24
77
  line-height: 32px;
25
78
 
26
- & > .@{form-prefix-cls}-item-required::before {
79
+ & > label.@{form-prefix-cls}-item-required:not(.pcfactory-form-item-required-mark-optional)::before {
27
80
  margin-right: 2px;
81
+ position: relative;
82
+ top: 1px;
28
83
  font-size: @font-size-sm;
29
84
  }
30
85
  }
@@ -78,6 +133,10 @@
78
133
  .@{form-prefix-cls}-item-hidden {
79
134
  display: none !important;
80
135
  }
136
+ // 解决ie11 垂直布局高度没撑开问题
137
+ .@{form-item-prefix-cls}-row {
138
+ display: block;
139
+ }
81
140
  .@{form-prefix-cls}-item-visibility {
82
141
  visibility: hidden;
83
142
  transform: opacity 0.3s ease;
@@ -133,6 +192,7 @@
133
192
  white-space: nowrap;
134
193
  text-align: right;
135
194
  vertical-align: middle;
195
+ margin-bottom: -4px;
136
196
 
137
197
  &-left {
138
198
  text-align: left;
@@ -193,16 +253,8 @@
193
253
  }
194
254
 
195
255
  &::after {
196
- & when (@form-item-trailing-colon=true) {
197
- content: ':';
198
- }
199
- & when not (@form-item-trailing-colon=true) {
200
- content: ' ';
201
- }
202
-
203
- position: relative;
204
- top: -0.5px;
205
- margin: 0 @form-item-label-colon-margin-right 0 @form-item-label-colon-margin-left;
256
+ display: none;
257
+ content: '';
206
258
  }
207
259
 
208
260
  &.@{form-item-prefix-cls}-no-colon::after {
@@ -235,7 +287,7 @@
235
287
  position: relative;
236
288
  display: flex;
237
289
  align-items: center;
238
- min-height: @input-height-base;
290
+ min-height: @input-height-sm !important;
239
291
 
240
292
  &-content {
241
293
  flex: auto;
@@ -283,3 +335,40 @@
283
335
  // }
284
336
  }
285
337
 
338
+ .@{form-prefix-cls}-horizontal {
339
+ .@{form-item-prefix-cls} {
340
+ // label不换行
341
+ &-label {
342
+ &::after {
343
+ content: ':';
344
+ display: inline-block;
345
+ width: 8px;
346
+ text-align: center;
347
+ margin-right: 8px;
348
+ }
349
+
350
+ &>label {
351
+ // 减去冒号占位符宽度
352
+ max-width: calc(100% - 16px);
353
+ & > span {
354
+ white-space: nowrap;
355
+ overflow: hidden;
356
+ text-overflow: ellipsis;
357
+ }
358
+ }
359
+ }
360
+
361
+ &-no-colon {
362
+ .@{form-item-prefix-cls}-label {
363
+
364
+ & > label {
365
+ max-width: 100%;
366
+ }
367
+ &::after {
368
+ content: '';
369
+ }
370
+ }
371
+ }
372
+ }
373
+ }
374
+
@@ -24,6 +24,12 @@
24
24
  border-right: none;
25
25
  }
26
26
  }
27
+
28
+ &.@{ant-prefix}-input-after-border-right-width {
29
+ .@{ant-prefix}-select-selector {
30
+ border-right-width: 0px !important;
31
+ }
32
+ }
27
33
  }
28
34
 
29
35
  .@{ant-prefix}-form-item-control-input-content {
@@ -20,9 +20,17 @@
20
20
  overflow: hidden;
21
21
  }
22
22
 
23
+ &-primary {
24
+ color: @primary-color !important;
25
+ }
26
+
27
+ &-primary-remark-color {
28
+ color: fade(@primary-color, 50%) !important;
29
+ }
30
+
23
31
  &-label {
24
32
  max-width: 100%;
25
- color: #414352;
33
+ color: @text-color;
26
34
  line-height: 20px;
27
35
  font-size: 12px;
28
36
  overflow: hidden;
@@ -32,15 +40,15 @@
32
40
 
33
41
  &-lightBackground,
34
42
  &-otherLightBackground {
35
- padding: 0 8px;
36
- background-color: rgba(68, 119, 238, 0.10);
43
+ padding: 0 10px 0 4px;
44
+ background-color: fade(@primary-color, 10%);
37
45
  border-radius: 2px;
38
46
  }
39
47
 
40
48
  &-darkBackground,
41
49
  &-otherDarkBackground {
42
- padding: 0 8px;
43
- background-color: #4477EE;
50
+ padding: 0 10px 0 4px;
51
+ background-color: @primary-color;
44
52
  border-radius: 2px;
45
53
  color: #fff;
46
54
  }
@@ -48,7 +56,7 @@
48
56
  &-remark {
49
57
  width: 100%;
50
58
  margin-top: 2px;
51
- color: rgba(28, 36, 46, 0.45);
59
+ color: @text-color-secondary;
52
60
  line-height: 18px;
53
61
  font-size: 12px;
54
62
  overflow: hidden;
@@ -82,6 +90,58 @@
82
90
  }
83
91
 
84
92
  &-multiple {
93
+ .@{select-prefix-cls}-selection-overflow {
94
+ padding: 2px 0;
95
+ &-item {
96
+ line-height: 0;
97
+ }
98
+ }
99
+ .ued-multiple-select-tag {
100
+ position: relative;
101
+ max-width: 100%;
102
+ margin: 2px 4px 2px 0;
103
+ padding: 4px 14px 4px 4px;
104
+ color: @text-color;
105
+ background-color: fade(@text-color, 6%);;
106
+ overflow: hidden;
107
+ text-overflow: ellipsis;
108
+ white-space: nowrap;
109
+ border: 0;
110
+ border-radius: 4px;
111
+
112
+ .anticon-close {
113
+ position: absolute;
114
+ top: 50%;
115
+ right: 4px;
116
+ transform: translateY(-50%);
117
+ color: @text-color-secondary;
118
+ }
119
+ }
120
+ .lightBackground {
121
+ .ued-multiple-select-tag;
122
+
123
+ padding: 0;
124
+ padding-right: 4px;
125
+ background-color: fade(@primary-color, 10%);;
126
+ .ued-select-item-lightBackground {
127
+ background-color: transparent !important;
128
+ }
129
+ }
130
+ .darkBackground {
131
+ .ued-multiple-select-tag;
132
+
133
+ padding: 0;
134
+ padding-right: 4px;
135
+ background-color: @primary-color;
136
+ color: #fff;
137
+ }
138
+
139
+ .jsx {
140
+ .ued-multiple-select-tag;
141
+ padding: 0;
142
+ background-color: transparent;
143
+ }
144
+
85
145
  .ued-select-checked-tag {
86
146
  position: relative;
87
147
  display: flex;
@@ -169,6 +229,10 @@
169
229
  color: @text-color;
170
230
  background-color: @item-active-bg;
171
231
  font-weight: normal;
232
+ .@{select-prefix-cls}-item-option-state {
233
+ margin-left: 8px;
234
+ align-content: center;
235
+ }
172
236
  }
173
237
  }
174
238
 
@@ -1,4 +1,12 @@
1
- import React, { FC, forwardRef, ForwardRefExoticComponent, FunctionComponent, useCallback, useRef, useState } from 'react';
1
+ import React, {
2
+ FC,
3
+ useRef,
4
+ useState,
5
+ useCallback,
6
+ FunctionComponent,
7
+ ForwardRefExoticComponent,
8
+ forwardRef,
9
+ } from 'react';
2
10
  // TODO: 替换成自定义hooks 待处理
3
11
  import { useDeepCompareEffect } from 'ahooks';
4
12
  import { get, isEqualWith, set } from 'lodash';
@@ -25,25 +33,23 @@ export interface ChannelContainerProps {
25
33
  * @param props
26
34
  * @returns
27
35
  */
28
- const Container: FC<ChannelContainerProps> = props => {
36
+ const Container: FC<ChannelContainerProps> = (props) => {
29
37
  const { children } = props;
30
38
  const childrenProps = useRef<Record<string, any>>({}).current;
31
39
  const [, forceUpdate] = useState({});
32
40
  const uploadChannelProps = useCallback((props: Record<string, any>, key: string) => {
33
- if (
34
- !isEqualWith(props, childrenProps[key], (v1, v2) => {
35
- if (typeof v1 === 'function' && typeof v2 === 'function') {
36
- return true;
37
- }
38
- return undefined;
39
- })
40
- ) {
41
+ if (!isEqualWith(props, childrenProps[key], (v1, v2) => {
42
+ if (typeof v1 === 'function' && typeof v2 === 'function') {
43
+ return true;
44
+ }
45
+ return undefined;
46
+ })) {
41
47
  childrenProps[key] = props;
42
48
  forceUpdate({});
43
49
  }
44
50
  }, []);
45
51
  // @ts-ignore
46
- const getProps = useCallback(c => childrenProps[c.key] || {}, []);
52
+ const getProps = useCallback((c) => childrenProps[c.key] || {}, []);
47
53
 
48
54
  return children({ uploadChannelProps, getProps });
49
55
  };
@@ -55,7 +61,7 @@ Container.displayName = 'ChannelContainer';
55
61
  * @param props
56
62
  * @returns
57
63
  */
58
- const Item: FC<PanelContentProps> = props => {
64
+ const Item: FC<PanelContentProps> = (props) => {
59
65
  const { children, extendProps, uploadChannelProps } = props;
60
66
  return React.cloneElement(children, {
61
67
  extendProps: {
@@ -87,7 +93,7 @@ export interface useRuntimePropsType {
87
93
  */
88
94
  const useChannelProps: useRuntimePropsType = (props, depthKey = [], uploadChannelProps) => {
89
95
  const target = {};
90
- depthKey.forEach(key => set(target, key.split('.'), get(props, key.split('.'))));
96
+ depthKey.forEach((key) => set(target, key.split('.'), get(props, key.split('.'))));
91
97
  useDeepCompareEffect(() => {
92
98
  if (uploadChannelProps) {
93
99
  uploadChannelProps(target);
@@ -106,7 +112,7 @@ const useChannelProps: useRuntimePropsType = (props, depthKey = [], uploadChanne
106
112
  */
107
113
  function withChannelItem<T extends Record<string, any>>(
108
114
  Component: FunctionComponent<any> | ForwardRefExoticComponent<any>,
109
- options: { keyPath: string[] }
115
+ options: { keyPath: string[] },
110
116
  ) {
111
117
  const { keyPath } = options;
112
118
  return forwardRef((props: T, ref) => {
@@ -5,7 +5,7 @@ export interface ChildRenderContextProps {
5
5
  collectChildData?: (id: string, data: any) => void;
6
6
  collectChildren?: (id: string, children: any) => void;
7
7
  update?: () => void;
8
- getCurrentData?: (id: string) => { currentIndex: number; props: any };
8
+ getCurrentData?: (id: string) => { currentIndex: number; props: any; },
9
9
  parentProps?: any;
10
10
  }
11
11
 
@@ -26,7 +26,7 @@ export const useChildRender = () => {
26
26
  const childRef = useRef<{
27
27
  list: string[];
28
28
  data: Map<string, any>;
29
- renderChild: Map<string, { current: any }>;
29
+ renderChild: Map<string, { current: any; }>;
30
30
  props: Map<string, any>;
31
31
  parentProps: any;
32
32
  }>({
@@ -38,11 +38,9 @@ export const useChildRender = () => {
38
38
  });
39
39
 
40
40
  const getIndex = (_id: string) => {
41
- return childRef.current.list
42
- .filter(id => {
43
- return childRef.current.data.get(id)?.visible ?? true;
44
- })
45
- .findIndex(id => id === _id);
41
+ return childRef.current.list.filter(id => {
42
+ return childRef.current.data.get(id)?.visible ?? true;
43
+ }).findIndex(id => id === _id);
46
44
  };
47
45
 
48
46
  // 渲染子组件
@@ -84,7 +82,7 @@ export const useChildRender = () => {
84
82
  };
85
83
  return result;
86
84
  },
87
- collectChildren: (id: string, child: { current: any }) => {
85
+ collectChildren: (id: string, child: { current: any; }) => {
88
86
  childRef.current.renderChild.set(id, child);
89
87
  if (childRef.current.renderChild.size === childRef.current.list.length) {
90
88
  setColletComplete(true);
@@ -10,10 +10,7 @@ export function isAtLeastReact17(version: string): boolean {
10
10
 
11
11
  const withErrorBoundary = (
12
12
  Component: React.ComponentType,
13
- options: {
14
- id: string;
15
- render?: (error: Error, componentStack: string | null) => React.ReactNode;
16
- }
13
+ options: { id: string; render?: (error: Error, componentStack: string | null) => React.ReactNode; }
17
14
  ) =>
18
15
  class CustomErrorModule extends React.Component {
19
16
  state: Readonly<{
@@ -24,7 +21,7 @@ const withErrorBoundary = (
24
21
  componentStack: null,
25
22
  };
26
23
 
27
- componentDidCatch(error: Error & { cause?: Error }, { componentStack }: React.ErrorInfo) {
24
+ componentDidCatch(error: Error & { cause?: Error; }, { componentStack }: React.ErrorInfo) {
28
25
  if (isAtLeastReact17(React.version)) {
29
26
  const errorBoundaryError = new Error(error.message);
30
27
  errorBoundaryError.name = `React ErrorBoundary ${errorBoundaryError.name}`;
@@ -90,6 +87,7 @@ interface CustomModuleProps {
90
87
  allowMap?: Record<string, any>;
91
88
  }
92
89
 
90
+
93
91
  const CustomModule: FC<CustomModuleProps> = ({ sandBoxLoadModule, code, compProps, errorInfo, allowMap }) => {
94
92
  if (typeof code === 'function') {
95
93
  // 特殊处理:源码传递JSX过来,用方法传递上下文
@@ -107,7 +105,7 @@ const CustomModule: FC<CustomModuleProps> = ({ sandBoxLoadModule, code, compProp
107
105
  return Component ? <Component {...compProps} /> : null;
108
106
  };
109
107
 
110
- export const getJSXHtml = (reactNode: React.ReactElement, cb?: (html: string) => void, options: { id?: string } = {}) => {
108
+ export const getJSXHtml = (reactNode: React.ReactElement, cb?: (html: string) => void, options: { id?: string; } = {}) => {
111
109
  const { id = `__JSX_id__${Math.random()}` } = options || {};
112
110
  let tempDOM = document.getElementById(id);
113
111
  if (!tempDOM) {
@@ -9,7 +9,7 @@ const useDummyFormContext = () => {
9
9
  // 以下是用于嵌套fieldName写法的东西
10
10
  const CHECK_ARR = ['[', ']', '.'];
11
11
  // 判断当前索引是否在引号的字符串引用范围内
12
- const inRange = (ind: number, rangearr: any[]) => {
12
+ const inRange = (ind:number, rangearr:any[]) => {
13
13
  let result = false;
14
14
  const findObj = rangearr.find(r => {
15
15
  if (ind > r.end || ind < r.start) {
@@ -26,13 +26,13 @@ const inRange = (ind: number, rangearr: any[]) => {
26
26
  return findObj ? result : false;
27
27
  };
28
28
  // 检查路径。这个方法返回被切分好的标识符数组,空数组代表这个路径是不合法的
29
- const pathSplit = (str: string) => {
29
+ const pathSplit = (str:string) => {
30
30
  const result = [];
31
31
 
32
- let lastchar: string;
33
- let rangestartind: number;
34
- let quotechar: string;
35
- const quoterange: any[] = [];
32
+ let lastchar:string;
33
+ let rangestartind:number;
34
+ let quotechar:string;
35
+ const quoterange:any[] = [];
36
36
  const strarr = [...str];
37
37
  // 第一次遍历,进行简易的词法分析,本次仅额外处理形如[""]的完整字符串强调形式
38
38
  strarr.forEach((c, ind) => {
@@ -75,15 +75,11 @@ const pathSplit = (str: string) => {
75
75
  return result;
76
76
  };
77
77
 
78
- const getObjByPath = (obj: any, path: string) => {
78
+ const getObjByPath = (obj:any, path:string) => {
79
79
  if (!obj) return undefined;
80
80
  const sp = pathSplit(path);
81
81
  // chained: 表示这个值取自一个链式写法 notcompletechain:表示途径属性链不完整,比如一个对象里的a字段对象里没有b字段,但取它的a.b,虽然不会报错(得到undefined),但这属性链条不完整
82
- const finalresult = {
83
- chained: false,
84
- notcompletechain: false,
85
- value: undefined,
86
- };
82
+ const finalresult = { chained: false, notcompletechain: false, value: undefined };
87
83
 
88
84
  let temp = obj;
89
85
  if (sp.length > 0) {
@@ -102,7 +98,7 @@ const getObjByPath = (obj: any, path: string) => {
102
98
  return finalresult;
103
99
  };
104
100
 
105
- const setObjByPath = (obj: any, path: string, val: any) => {
101
+ const setObjByPath = (obj:any, path:string, val:any) => {
106
102
  if (!obj) return;
107
103
 
108
104
  const sp = pathSplit(path);
@@ -1,25 +1,13 @@
1
+ import React from 'react';
2
+
1
3
  export default (props: any) => {
2
4
  return (
3
5
  <svg width="64" height="40" viewBox="0 0 64 40" fill="none" xmlns="http://www.w3.org/2000/svg">
4
6
  <g id=".components/empty-img-simple" clipPath="url(#clip0_6752_81174)">
5
- <path
6
- id="Vector"
7
- d="M32 39.7027C49.6731 39.7027 64 36.592 64 32.7547C64 28.9174 49.6731 25.8066 32 25.8066C14.3269 25.8066 0 28.9174 0 32.7547C0 36.592 14.3269 39.7027 32 39.7027Z"
8
- fill="#F5F5F5"
9
- />
7
+ <path id="Vector" d="M32 39.7027C49.6731 39.7027 64 36.592 64 32.7547C64 28.9174 49.6731 25.8066 32 25.8066C14.3269 25.8066 0 28.9174 0 32.7547C0 36.592 14.3269 39.7027 32 39.7027Z" fill="#F5F5F5" />
10
8
  <g id="Group">
11
- <path
12
- id="Vector_2"
13
- d="M55 13.6653L44.854 2.24866C44.367 1.47048 43.656 1 42.907 1H21.093C20.344 1 19.633 1.47048 19.146 2.24767L9 13.6663V22.8367H55V13.6653Z"
14
- fill="white"
15
- stroke="#D9D9D9"
16
- />
17
- <path
18
- id="Vector_3"
19
- d="M41.613 16.8135C41.613 15.2205 42.607 13.9053 43.84 13.9043H55V31.9067C55 34.0139 53.68 35.741 52.05 35.741H11.95C10.32 35.741 9 34.0129 9 31.9067V13.9043H20.16C21.393 13.9043 22.387 15.2175 22.387 16.8106V16.8324C22.387 18.4255 23.392 19.7119 24.624 19.7119H39.376C40.608 19.7119 41.613 18.4136 41.613 16.8205V16.8135Z"
20
- fill="#FAFAFA"
21
- stroke="#D9D9D9"
22
- />
9
+ <path id="Vector_2" d="M55 13.6653L44.854 2.24866C44.367 1.47048 43.656 1 42.907 1H21.093C20.344 1 19.633 1.47048 19.146 2.24767L9 13.6663V22.8367H55V13.6653Z" fill="white" stroke="#D9D9D9" />
10
+ <path id="Vector_3" d="M41.613 16.8135C41.613 15.2205 42.607 13.9053 43.84 13.9043H55V31.9067C55 34.0139 53.68 35.741 52.05 35.741H11.95C10.32 35.741 9 34.0129 9 31.9067V13.9043H20.16C21.393 13.9043 22.387 15.2175 22.387 16.8106V16.8324C22.387 18.4255 23.392 19.7119 24.624 19.7119H39.376C40.608 19.7119 41.613 18.4136 41.613 16.8205V16.8135Z" fill="#FAFAFA" stroke="#D9D9D9" />
23
11
  </g>
24
12
  </g>
25
13
  <defs>
@@ -1,9 +1,9 @@
1
- import { LocaleFunction } from '@lingxiteam/types';
1
+ import React, { useMemo } from 'react';
2
2
  import { Empty } from 'antd';
3
3
  import classnames from 'classnames';
4
- import { useMemo } from 'react';
5
- import useCompState from '../hooks/useCompState';
4
+ import { LocaleFunction } from '@lingxiteam/types';
6
5
  import EmptySvg from './empty';
6
+ import useCompState from '../hooks/useCompState';
7
7
 
8
8
  interface EmptyProps {
9
9
  dataState: any; // 数据状态
@@ -1,43 +1,13 @@
1
- import moment, { Moment } from 'moment';
2
1
  import { HolidaysLimitType } from './generatorDisabledCallback';
3
- import HolidaysData from './HolidaysList.json';
4
-
5
- const getHolidays = () => {
6
- const workdays: string[] = [];
7
- const holidays: string[] = [];
8
- const loop = (source: any[], list: string[]) => {
9
- source.forEach(item => {
10
- if (item.start_date < item.end_date) {
11
- let tmpDate = item.end_date;
12
- while (tmpDate !== item.start_date) {
13
- list.push(tmpDate);
14
- tmpDate = moment(tmpDate, 'YYYY-MM-DD').subtract(1, 'days').format('YYYY-MM-DD');
15
- }
16
- }
17
- list.push(item.start_date);
18
- });
19
- };
20
-
21
- loop(
22
- HolidaysData.filter(el => el.date_type === '补班'),
23
- workdays
24
- );
25
- loop(
26
- HolidaysData.filter(el => el.date_type === '节假日'),
27
- holidays
28
- );
29
-
30
- return [workdays, holidays];
31
- };
32
-
33
- const [workdays, holidays] = getHolidays();
2
+ import { Moment } from 'moment';
3
+ import { workdays, holidays } from './HolidaysFormat';
34
4
 
35
5
  /**
36
6
  * 判断是否为节假日
37
7
  * @param cur
38
8
  * @returns
39
9
  */
40
- export const isHoliday = (cur: Moment) => {
10
+ export const isHoliday = (cur:Moment) => {
41
11
  return holidays.includes(cur.format('YYYY-MM-DD'));
42
12
  };
43
13
 
@@ -46,15 +16,16 @@ export const isHoliday = (cur: Moment) => {
46
16
  * @param cur
47
17
  * @returns
48
18
  */
49
- export const isWeekend = (cur: Moment) => {
19
+ export const isWeekend = (cur:Moment) => {
50
20
  return [0, 6].includes(cur.day());
51
21
  };
52
22
 
23
+
53
24
  /**
54
25
  * 判断是否为工作日
55
26
  * @param cur 当前时间
56
27
  */
57
- export const isWorkdays = (cur: Moment): boolean => {
28
+ export const isWorkdays = (cur:Moment): boolean => {
58
29
  const curStr = cur.format('YYYY-MM-DD');
59
30
  if (workdays.includes(curStr)) {
60
31
  return true;
@@ -78,11 +49,11 @@ export const getHolidaysChecker = (holidaysLimit: HolidaysLimitType) => {
78
49
  const disabledWeekend = holidaysLimit === 'weekend' || holidaysLimit === 'all';
79
50
 
80
51
  /**
81
- * 禁用的节假日
82
- */
52
+ * 禁用的节假日
53
+ */
83
54
  const disabledHoliday = holidaysLimit === 'holiday' || holidaysLimit === 'all';
84
-
85
- const isHolidayLimit = (cur: Moment) => {
55
+
56
+ const isHolidayLimit = (cur:Moment) => {
86
57
  if (disabledWeekend) {
87
58
  return isWeekend(cur);
88
59
  }
@@ -99,6 +70,7 @@ export const getHolidaysChecker = (holidaysLimit: HolidaysLimitType) => {
99
70
  };
100
71
  };
101
72
 
73
+
102
74
  export default {
103
75
  workdays,
104
76
  holidays,