@qn-pandora/pandora-component 3.1.1 → 4.0.0

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 (145) hide show
  1. package/CHANGELOG.json +7 -7
  2. package/CHANGELOG.md +8 -7
  3. package/es/components/AutoComplete/style.css +25 -29
  4. package/es/components/Button/index.d.ts +0 -8
  5. package/es/components/Button/index.js +4 -4
  6. package/es/components/Button/style.css +100 -104
  7. package/es/components/Button/style.less +3 -14
  8. package/es/components/Card/style.css +28 -2
  9. package/es/components/CheckTransformList/style.css +50 -21
  10. package/es/components/Checkbox/style.css +1 -1
  11. package/es/components/CheckboxList/index.d.ts +2 -0
  12. package/es/components/CheckboxList/index.js +2 -2
  13. package/es/components/CheckboxList/style.css +5 -3
  14. package/es/components/CheckboxList/style.less +4 -2
  15. package/es/components/Collapse/style.css +16 -12
  16. package/es/components/CollapsiblePanel/style.css +4 -4
  17. package/es/components/CollapsiblePanel/style.less +4 -4
  18. package/es/components/DateTimePicker/Base/style.css +378 -49
  19. package/es/components/DateTimePicker/Base/style.less +37 -41
  20. package/es/components/DateTimePicker/BaseMobile/style.css +4 -4
  21. package/es/components/DateTimePicker/BaseMobile/style.less +4 -4
  22. package/es/components/DateTimePicker/DisplayInput/style.css +47 -16
  23. package/es/components/DateTimePicker/constants.d.ts +1 -1
  24. package/es/components/DateTimePicker/constants.js +17 -6
  25. package/es/components/DateTimePicker/index.js +1 -1
  26. package/es/components/DateTimePicker/style.css +7 -7
  27. package/es/components/DateTimePicker/style.less +12 -10
  28. package/es/components/DateTimePicker/transform.d.ts +4 -0
  29. package/es/components/DateTimePicker/transform.js +52 -0
  30. package/es/components/Drawer/style.css +45 -45
  31. package/es/components/Input/index.d.ts +1 -2
  32. package/es/components/Input/index.js +0 -2
  33. package/es/components/Input/style.css +47 -16
  34. package/es/components/InputNumber/index.d.ts +1 -8
  35. package/es/components/InputNumber/index.js +1 -35
  36. package/es/components/Menu/Option.d.ts +4 -0
  37. package/es/components/Menu/Option.js +2 -1
  38. package/es/components/Menu/index.d.ts +1 -1
  39. package/es/components/Menu/style.css +20 -10
  40. package/es/components/Menu/style.less +10 -0
  41. package/es/components/NameLimiter/style.css +2 -4
  42. package/es/components/NameLimiter/style.less +2 -4
  43. package/es/components/OptionList/OptionItem/style.css +2 -2
  44. package/es/components/OptionList/OptionItem/style.less +2 -2
  45. package/es/components/OptionList/style.css +2 -2
  46. package/es/components/RadioGroup/style.css +8 -8
  47. package/es/components/RangeInput/style.css +427 -27
  48. package/es/components/RemarkName/style.css +2 -4
  49. package/es/components/Selector/style.css +25 -29
  50. package/es/components/Selector/style.less +27 -28
  51. package/es/components/Spin/style.css +0 -1
  52. package/es/components/Steps/style.css +8 -6
  53. package/es/components/Steps/style.less +9 -7
  54. package/es/components/Table/style.css +81 -23
  55. package/es/components/Table/style.less +10 -17
  56. package/es/components/Tabs/style.css +29 -1
  57. package/es/components/Tabs/style.less +3 -1
  58. package/es/components/TagList/style.css +10 -10
  59. package/es/components/TagList/style.less +1 -1
  60. package/es/components/Transfer/List/index.js +3 -3
  61. package/es/components/Transfer/List/style.css +3 -0
  62. package/es/components/Transfer/List/style.less +4 -0
  63. package/es/components/Transfer/style.css +3 -0
  64. package/es/components/TreeSelector/style.css +64 -20
  65. package/es/components/TreeSelector/style.less +9 -7
  66. package/es/index.css +2701 -2207
  67. package/es/index.d.ts +1 -1
  68. package/es/index.less +0 -1
  69. package/es/style/theme.less +2 -0
  70. package/lib/components/AutoComplete/style.css +25 -29
  71. package/lib/components/Button/index.d.ts +0 -8
  72. package/lib/components/Button/index.js +4 -4
  73. package/lib/components/Button/style.css +100 -104
  74. package/lib/components/Button/style.less +3 -14
  75. package/lib/components/Card/style.css +28 -2
  76. package/lib/components/CheckTransformList/style.css +50 -21
  77. package/lib/components/Checkbox/style.css +1 -1
  78. package/lib/components/CheckboxList/index.d.ts +2 -0
  79. package/lib/components/CheckboxList/index.js +2 -2
  80. package/lib/components/CheckboxList/style.css +5 -3
  81. package/lib/components/CheckboxList/style.less +4 -2
  82. package/lib/components/Collapse/style.css +16 -12
  83. package/lib/components/CollapsiblePanel/style.css +4 -4
  84. package/lib/components/CollapsiblePanel/style.less +4 -4
  85. package/lib/components/DateTimePicker/Base/style.css +378 -49
  86. package/lib/components/DateTimePicker/Base/style.less +37 -41
  87. package/lib/components/DateTimePicker/BaseMobile/style.css +4 -4
  88. package/lib/components/DateTimePicker/BaseMobile/style.less +4 -4
  89. package/lib/components/DateTimePicker/DisplayInput/style.css +47 -16
  90. package/lib/components/DateTimePicker/constants.d.ts +1 -1
  91. package/lib/components/DateTimePicker/constants.js +17 -6
  92. package/lib/components/DateTimePicker/index.js +1 -1
  93. package/lib/components/DateTimePicker/style.css +7 -7
  94. package/lib/components/DateTimePicker/style.less +12 -10
  95. package/lib/components/DateTimePicker/transform.d.ts +4 -0
  96. package/lib/components/DateTimePicker/transform.js +53 -0
  97. package/lib/components/Drawer/style.css +45 -45
  98. package/lib/components/Input/index.d.ts +1 -2
  99. package/lib/components/Input/index.js +0 -2
  100. package/lib/components/Input/style.css +47 -16
  101. package/lib/components/InputNumber/index.d.ts +1 -8
  102. package/lib/components/InputNumber/index.js +1 -38
  103. package/lib/components/Menu/Option.d.ts +4 -0
  104. package/lib/components/Menu/Option.js +2 -1
  105. package/lib/components/Menu/index.d.ts +1 -1
  106. package/lib/components/Menu/style.css +20 -10
  107. package/lib/components/Menu/style.less +10 -0
  108. package/lib/components/NameLimiter/style.css +2 -4
  109. package/lib/components/NameLimiter/style.less +2 -4
  110. package/lib/components/OptionList/OptionItem/style.css +2 -2
  111. package/lib/components/OptionList/OptionItem/style.less +2 -2
  112. package/lib/components/OptionList/style.css +2 -2
  113. package/lib/components/RadioGroup/style.css +8 -8
  114. package/lib/components/RangeInput/style.css +427 -27
  115. package/lib/components/RemarkName/style.css +2 -4
  116. package/lib/components/Selector/style.css +25 -29
  117. package/lib/components/Selector/style.less +27 -28
  118. package/lib/components/Spin/style.css +0 -1
  119. package/lib/components/Steps/style.css +8 -6
  120. package/lib/components/Steps/style.less +9 -7
  121. package/lib/components/Table/style.css +81 -23
  122. package/lib/components/Table/style.less +10 -17
  123. package/lib/components/Tabs/style.css +29 -1
  124. package/lib/components/Tabs/style.less +3 -1
  125. package/lib/components/TagList/style.css +10 -10
  126. package/lib/components/TagList/style.less +1 -1
  127. package/lib/components/Transfer/List/index.js +3 -3
  128. package/lib/components/Transfer/List/style.css +3 -0
  129. package/lib/components/Transfer/List/style.less +4 -0
  130. package/lib/components/Transfer/style.css +3 -0
  131. package/lib/components/TreeSelector/style.css +64 -20
  132. package/lib/components/TreeSelector/style.less +9 -7
  133. package/lib/index.css +5228 -4734
  134. package/lib/index.d.ts +1 -1
  135. package/lib/index.less +6 -7
  136. package/lib/style/theme.less +2 -0
  137. package/package.json +18 -47
  138. package/es/components/Input/NumberInput/index.d.ts +0 -29
  139. package/es/components/Input/NumberInput/index.js +0 -116
  140. package/es/components/InputNumber/style.css +0 -400
  141. package/es/components/InputNumber/style.less +0 -45
  142. package/lib/components/Input/NumberInput/index.d.ts +0 -29
  143. package/lib/components/Input/NumberInput/index.js +0 -121
  144. package/lib/components/InputNumber/style.css +0 -400
  145. package/lib/components/InputNumber/style.less +0 -45
@@ -2,15 +2,9 @@
2
2
  @import 'antd/lib/date-picker/style/index.less';
3
3
  @import '../../../style/theme.less';
4
4
 
5
- .@{sdk-prefix}-datetime-pick-title {
6
- padding: 8px 16px 6px;
7
- border-bottom: 1px solid @normal-color;
8
- color: @font-color-3;
9
- font-size: 14px;
10
- background-color: @gray-bg-color;
11
- }
5
+ @button-default-preset: #e9f0fa;
12
6
 
13
- .@{sdk-prefix}-datetime-pick-panel {
7
+ .@{sdk-prefix}-panel.@{sdk-prefix}-datetime-pick-panel {
14
8
  margin-bottom: 0;
15
9
 
16
10
  &:last-child {
@@ -18,34 +12,44 @@
18
12
  border-bottom: none;
19
13
  }
20
14
  }
21
- }
22
15
 
23
- .@{sdk-prefix}-datetime-pick-preset {
24
- padding: 12px;
25
- text-align: left;
26
- .@{sdk-prefix}-datetime-pick-item {
27
- display: inline-block;
28
- width: 96px;
29
- line-height: 28px;
30
- margin: 4px;
31
- color: @theme-color;
32
- background: #e9f0fa;
33
- text-align: center;
34
- font-size: 12px;
35
- cursor: pointer;
36
- border-radius: @border-radius-base;
37
- &.active {
38
- background: @theme-color;
39
- color: @normal-color;
40
- pointer-events: none;
16
+ .@{sdk-prefix}-datetime-pick-title {
17
+ padding: 8px 16px 6px;
18
+ border-bottom: 1px solid @normal-color;
19
+ color: @font-color-3;
20
+ font-size: 14px;
21
+ background-color: @gray-bg-color;
22
+ }
23
+
24
+ .@{sdk-prefix}-datetime-pick-preset {
25
+ padding: 12px;
26
+ text-align: left;
27
+ .@{sdk-prefix}-datetime-pick-item {
28
+ display: inline-block;
29
+ width: 96px;
30
+ line-height: 28px;
31
+ margin: 4px;
32
+ color: @theme-color;
33
+ background: @button-default-preset;
34
+ text-align: center;
35
+ font-size: 12px;
36
+ cursor: pointer;
37
+ border-radius: @border-radius-base;
38
+ &.active {
39
+ background: @theme-color;
40
+ color: @normal-color;
41
+ pointer-events: none;
42
+ }
41
43
  }
42
44
  }
45
+
46
+ .@{sdk-prefix}-datetime-pick-panel-content {
47
+ padding: 0;
48
+ }
43
49
  }
50
+
44
51
  .@{sdk-prefix}-datetime-pick-content {
45
52
  padding: 16px;
46
- .range-picker {
47
- width: 100% !important;
48
- }
49
53
  .@{ant-prefix}-calendar-range-picker-input {
50
54
  width: calc(50% - 14px);
51
55
  }
@@ -78,6 +82,9 @@
78
82
  flex: 1;
79
83
  margin-left: 8px;
80
84
  margin-right: 12px;
85
+ &.range-picker {
86
+ width: 100%;
87
+ }
81
88
  }
82
89
  }
83
90
 
@@ -89,10 +96,6 @@
89
96
  }
90
97
  }
91
98
 
92
- .@{sdk-prefix}-datetime-pick-panel-content {
93
- padding: 0;
94
- }
95
-
96
99
  .@{sdk-prefix}-datetime-pick-relative-root {
97
100
  position: relative;
98
101
  flex: 1;
@@ -140,9 +143,6 @@
140
143
  margin-top: 30px;
141
144
  }
142
145
 
143
- .@{sdk-prefix}-quarter-datetime-pick-panel {
144
- width: 360px;
145
- }
146
146
  .@{sdk-prefix}-datetime-pick-quarter-content {
147
147
  padding-right: 12px;
148
148
  padding-left: 12px;
@@ -153,10 +153,6 @@
153
153
  flex: 1;
154
154
  min-width: 120px;
155
155
  border-left: 1px solid @normal-color;
156
- .@{ant-prefix}-select-selection {
157
- background: #ebf0fd !important;
158
- border-radius: 2px;
159
- }
160
156
  }
161
157
  .@{sdk-prefix}-selector & .@{sdk-prefix}-selector {
162
158
  margin-left: 18px;
@@ -21,9 +21,9 @@
21
21
  visibility: hidden;
22
22
  }
23
23
  .pandora-sdk-datetime-mobile-picker .am-picker-popup-content .am-picker-popup-body .am-picker-popup-header {
24
- border-bottom: none !important;
25
- background-image: none !important;
26
- background-position: none !important;
27
- background-size: none !important;
24
+ border-bottom: none;
25
+ background-image: none;
26
+ background-position: unset;
27
+ background-size: unset;
28
28
  position: initial;
29
29
  }
@@ -21,10 +21,10 @@
21
21
  .am-picker-popup-content {
22
22
  .am-picker-popup-body {
23
23
  .am-picker-popup-header {
24
- border-bottom: none !important;
25
- background-image: none !important;
26
- background-position: none !important;
27
- background-size: none !important;
24
+ border-bottom: none;
25
+ background-image: none;
26
+ background-position: unset;
27
+ background-size: unset;
28
28
  position: initial;
29
29
  }
30
30
  }
@@ -17,6 +17,7 @@
17
17
  border-radius: 2px;
18
18
  -webkit-transition: all 0.3s;
19
19
  transition: all 0.3s;
20
+ /* stylelint-disable-next-line selector-no-vendor-prefix */
20
21
  display: -webkit-inline-box;
21
22
  display: -ms-inline-flexbox;
22
23
  display: inline-flex;
@@ -26,12 +27,20 @@
26
27
  }
27
28
  .ant-input-affix-wrapper::-webkit-input-placeholder {
28
29
  color: #bfbfbf;
30
+ -webkit-user-select: none;
31
+ user-select: none;
29
32
  }
30
33
  .ant-input-affix-wrapper::-ms-input-placeholder {
31
34
  color: #bfbfbf;
35
+ -ms-user-select: none;
36
+ user-select: none;
32
37
  }
33
38
  .ant-input-affix-wrapper::placeholder {
34
39
  color: #bfbfbf;
40
+ -webkit-user-select: none;
41
+ -moz-user-select: none;
42
+ -ms-user-select: none;
43
+ user-select: none;
35
44
  }
36
45
  .ant-input-affix-wrapper:placeholder-shown {
37
46
  text-overflow: ellipsis;
@@ -46,11 +55,11 @@
46
55
  }
47
56
  .ant-input-affix-wrapper:focus,
48
57
  .ant-input-affix-wrapper-focused {
49
- border-color: #528cde;
58
+ border-color: #9ca0a6;
59
+ -webkit-box-shadow: 0 0 0 2px rgba(122, 134, 154, 0.2);
60
+ box-shadow: 0 0 0 2px rgba(122, 134, 154, 0.2);
50
61
  border-right-width: 1px !important;
51
62
  outline: 0;
52
- -webkit-box-shadow: 0 0 0 2px rgba(44, 109, 210, 0.2);
53
- box-shadow: 0 0 0 2px rgba(44, 109, 210, 0.2);
54
63
  }
55
64
  .ant-input-rtl .ant-input-affix-wrapper:focus,
56
65
  .ant-input-rtl .ant-input-affix-wrapper-focused {
@@ -60,6 +69,9 @@
60
69
  .ant-input-affix-wrapper-disabled {
61
70
  color: rgba(0, 0, 0, 0.25);
62
71
  background-color: #f5f5f5;
72
+ border-color: #bfbfbf;
73
+ -webkit-box-shadow: none;
74
+ box-shadow: none;
63
75
  cursor: not-allowed;
64
76
  opacity: 1;
65
77
  }
@@ -70,6 +82,9 @@
70
82
  .ant-input-affix-wrapper[disabled] {
71
83
  color: rgba(0, 0, 0, 0.25);
72
84
  background-color: #f5f5f5;
85
+ border-color: #bfbfbf;
86
+ -webkit-box-shadow: none;
87
+ box-shadow: none;
73
88
  cursor: not-allowed;
74
89
  opacity: 1;
75
90
  }
@@ -159,7 +174,7 @@ textarea.ant-input-affix-wrapper {
159
174
  margin-left: 4px;
160
175
  }
161
176
  .anticon.ant-input-clear-icon {
162
- margin: 0 4px;
177
+ margin: 0;
163
178
  color: rgba(0, 0, 0, 0.25);
164
179
  font-size: 12px;
165
180
  vertical-align: -1px;
@@ -176,8 +191,8 @@ textarea.ant-input-affix-wrapper {
176
191
  .anticon.ant-input-clear-icon-hidden {
177
192
  visibility: hidden;
178
193
  }
179
- .anticon.ant-input-clear-icon:last-child {
180
- margin-right: 0;
194
+ .anticon.ant-input-clear-icon-has-suffix {
195
+ margin: 0 4px;
181
196
  }
182
197
  .ant-input-affix-wrapper-textarea-with-clear-btn {
183
198
  padding: 0 !important;
@@ -213,18 +228,27 @@ textarea.ant-input-affix-wrapper {
213
228
  border-radius: 2px;
214
229
  -webkit-transition: all 0.3s;
215
230
  transition: all 0.3s;
231
+ /* stylelint-disable-next-line selector-no-vendor-prefix */
216
232
  }
217
233
  .ant-input::-moz-placeholder {
218
234
  opacity: 1;
219
235
  }
220
236
  .ant-input::-webkit-input-placeholder {
221
237
  color: #bfbfbf;
238
+ -webkit-user-select: none;
239
+ user-select: none;
222
240
  }
223
241
  .ant-input::-ms-input-placeholder {
224
242
  color: #bfbfbf;
243
+ -ms-user-select: none;
244
+ user-select: none;
225
245
  }
226
246
  .ant-input::placeholder {
227
247
  color: #bfbfbf;
248
+ -webkit-user-select: none;
249
+ -moz-user-select: none;
250
+ -ms-user-select: none;
251
+ user-select: none;
228
252
  }
229
253
  .ant-input:placeholder-shown {
230
254
  text-overflow: ellipsis;
@@ -239,11 +263,11 @@ textarea.ant-input-affix-wrapper {
239
263
  }
240
264
  .ant-input:focus,
241
265
  .ant-input-focused {
242
- border-color: #528cde;
266
+ border-color: #9ca0a6;
267
+ -webkit-box-shadow: 0 0 0 2px rgba(122, 134, 154, 0.2);
268
+ box-shadow: 0 0 0 2px rgba(122, 134, 154, 0.2);
243
269
  border-right-width: 1px !important;
244
270
  outline: 0;
245
- -webkit-box-shadow: 0 0 0 2px rgba(44, 109, 210, 0.2);
246
- box-shadow: 0 0 0 2px rgba(44, 109, 210, 0.2);
247
271
  }
248
272
  .ant-input-rtl .ant-input:focus,
249
273
  .ant-input-rtl .ant-input-focused {
@@ -253,6 +277,9 @@ textarea.ant-input-affix-wrapper {
253
277
  .ant-input-disabled {
254
278
  color: rgba(0, 0, 0, 0.25);
255
279
  background-color: #f5f5f5;
280
+ border-color: #bfbfbf;
281
+ -webkit-box-shadow: none;
282
+ box-shadow: none;
256
283
  cursor: not-allowed;
257
284
  opacity: 1;
258
285
  }
@@ -263,6 +290,9 @@ textarea.ant-input-affix-wrapper {
263
290
  .ant-input[disabled] {
264
291
  color: rgba(0, 0, 0, 0.25);
265
292
  background-color: #f5f5f5;
293
+ border-color: #bfbfbf;
294
+ -webkit-box-shadow: none;
295
+ box-shadow: none;
266
296
  cursor: not-allowed;
267
297
  opacity: 1;
268
298
  }
@@ -450,10 +480,6 @@ textarea.ant-input {
450
480
  .ant-input-group-sm .ant-select-single .ant-select-selector {
451
481
  height: 26px;
452
482
  }
453
- .ant-input-group .ant-input-affix-wrapper:not(:first-child) {
454
- border-top-left-radius: 0;
455
- border-bottom-left-radius: 0;
456
- }
457
483
  .ant-input-group .ant-input-affix-wrapper:not(:last-child) {
458
484
  border-top-right-radius: 0;
459
485
  border-bottom-right-radius: 0;
@@ -462,6 +488,11 @@ textarea.ant-input {
462
488
  border-top-left-radius: 2px;
463
489
  border-bottom-left-radius: 2px;
464
490
  }
491
+ .ant-input-group .ant-input-affix-wrapper:not(:first-child),
492
+ .ant-input-search .ant-input-group .ant-input-affix-wrapper:not(:first-child) {
493
+ border-top-left-radius: 0;
494
+ border-bottom-left-radius: 0;
495
+ }
465
496
  .ant-input-group.ant-input-group-compact {
466
497
  display: block;
467
498
  }
@@ -716,9 +747,9 @@ textarea.ant-input {
716
747
  .ant-input-textarea-rtl.ant-input-textarea-show-count::after {
717
748
  text-align: left;
718
749
  }
719
- .ant-input-affix-wrapper-rtl .ant-input-clear-icon:last-child {
720
- margin-right: 4px;
721
- margin-left: 0;
750
+ .ant-input-affix-wrapper-rtl .ant-input-clear-icon-has-suffix {
751
+ margin-right: 0;
752
+ margin-left: 4px;
722
753
  }
723
754
  .ant-input-affix-wrapper-rtl .ant-input-clear-icon {
724
755
  right: auto;
@@ -207,7 +207,7 @@ export interface ITimeRange {
207
207
  rangePreset?: RangePreset;
208
208
  quarterTime?: IQuarterTime;
209
209
  }
210
- export declare const enum TimeShiftUnit {
210
+ export declare enum TimeShiftUnit {
211
211
  Second = "seconds",
212
212
  Minute = "minutes",
213
213
  Hour = "hours",
@@ -330,29 +330,40 @@ exports.QuartersMap = {
330
330
  endMonth: 0
331
331
  }
332
332
  };
333
+ var TimeShiftUnit;
334
+ (function (TimeShiftUnit) {
335
+ TimeShiftUnit["Second"] = "seconds";
336
+ TimeShiftUnit["Minute"] = "minutes";
337
+ TimeShiftUnit["Hour"] = "hours";
338
+ TimeShiftUnit["Day"] = "days";
339
+ TimeShiftUnit["Week"] = "weeks";
340
+ TimeShiftUnit["Month"] = "months";
341
+ TimeShiftUnit["Quarter"] = "quarters";
342
+ TimeShiftUnit["Year"] = "years";
343
+ })(TimeShiftUnit = exports.TimeShiftUnit || (exports.TimeShiftUnit = {}));
333
344
  exports.TimeShiftUnitOptions = [
334
345
  {
335
- value: "seconds" /* Second */,
346
+ value: TimeShiftUnit.Second,
336
347
  text: '秒'
337
348
  },
338
349
  {
339
- value: "minutes" /* Minute */,
350
+ value: TimeShiftUnit.Minute,
340
351
  text: '分钟'
341
352
  },
342
353
  {
343
- value: "hours" /* Hour */,
354
+ value: TimeShiftUnit.Hour,
344
355
  text: '小时'
345
356
  },
346
357
  {
347
- value: "days" /* Day */,
358
+ value: TimeShiftUnit.Day,
348
359
  text: '天'
349
360
  },
350
361
  {
351
- value: "months" /* Month */,
362
+ value: TimeShiftUnit.Month,
352
363
  text: '月'
353
364
  },
354
365
  {
355
- value: "years" /* Year */,
366
+ value: TimeShiftUnit.Year,
356
367
  text: '年'
357
368
  }
358
369
  ];
@@ -97,7 +97,7 @@ var DateTimePicker = /** @class */ (function (_super) {
97
97
  var ismobile = env_1.isMobileDevice() && showTimeType && showTimeType.length;
98
98
  return (React.createElement("div", null,
99
99
  ismobile && (React.createElement(BaseMobile_1.default, __assign({}, restProps, { showTimeType: showTimeType, buttonType: constants_1.EButtonType.Normal, value: value || this.props.defaultValue, onChange: this.handleChange }))),
100
- !ismobile && (React.createElement(antd_1.Popover, { placement: this.props.placement, trigger: "click", visible: this.visible, openClassName: overlayClassName, getPopupContainer: getPopupContainer, onVisibleChange: this.setVisible, getTooltipContainer: this.props.getPopupContainer, content: React.createElement(Base_1.default, __assign({}, restProps, { showTimeType: showTimeType, onChange: this.handleChange, className: classnames_1.default(style_1.SDK_PREFIX + "-datetime-pick-popover", timeClassName), getPopupContainer: getPopupContainer, value: value || this.props.defaultValue })) }, children || (React.createElement(DisplayInput_1.default, { value: value || this.props.defaultValue, timeFormat: this.props.timeFormat, presets: this.props.presets, className: contentClassName }))))));
100
+ !ismobile && (React.createElement(antd_1.Popover, { placement: this.props.placement, trigger: "click", visible: this.visible, overlayClassName: classnames_1.default(style_1.SDK_PREFIX + "-datetime-pick-popover-root", overlayClassName), getPopupContainer: getPopupContainer, onVisibleChange: this.setVisible, getTooltipContainer: this.props.getPopupContainer, content: React.createElement(Base_1.default, __assign({}, restProps, { showTimeType: showTimeType, onChange: this.handleChange, className: classnames_1.default(style_1.SDK_PREFIX + "-datetime-pick-popover", timeClassName), getPopupContainer: getPopupContainer, value: value || this.props.defaultValue })) }, children || (React.createElement(DisplayInput_1.default, { value: value || this.props.defaultValue, timeFormat: this.props.timeFormat, presets: this.props.presets, className: contentClassName }))))));
101
101
  };
102
102
  DateTimePicker.Base = Base_1.default;
103
103
  DateTimePicker.BaseMobile = BaseMobile_1.default;
@@ -326,15 +326,15 @@
326
326
  .ant-btn-sm {
327
327
  padding: 0 7px;
328
328
  }
329
- .pandora-sdk-datetime-pick-popover {
330
- width: 650px;
331
- }
332
- .ant-popover-inner-content {
333
- padding: 0 !important;
329
+ .pandora-sdk-datetime-pick-popover-root .ant-popover-inner-content {
330
+ padding: 0;
334
331
  }
335
- .ant-btn {
332
+ .pandora-sdk-datetime-pick-popover-root .ant-btn {
336
333
  line-height: 1.499;
337
334
  }
338
- .ant-table {
335
+ .pandora-sdk-datetime-pick-popover-root .ant-table {
339
336
  line-height: 1.5;
340
337
  }
338
+ .pandora-sdk-datetime-pick-popover {
339
+ width: 650px;
340
+ }
@@ -1,17 +1,19 @@
1
1
  @import 'antd/lib/popover/style/index.less';
2
2
  @import '../../style/theme.less';
3
3
 
4
- .@{sdk-prefix}-datetime-pick-popover {
5
- width: 650px;
6
- }
4
+ .@{sdk-prefix}-datetime-pick-popover-root {
5
+ .@{ant-prefix}-popover-inner-content {
6
+ padding: 0;
7
+ }
8
+ .@{ant-prefix}-btn {
9
+ line-height: 1.499;
10
+ }
7
11
 
8
- .@{ant-prefix}-popover-inner-content {
9
- padding: 0 !important;
10
- }
11
- .@{ant-prefix}-btn {
12
- line-height: 1.499;
12
+ .@{ant-prefix}-table {
13
+ line-height: 1.5;
14
+ }
13
15
  }
14
16
 
15
- .@{ant-prefix}-table {
16
- line-height: 1.5;
17
+ .@{sdk-prefix}-datetime-pick-popover {
18
+ width: 650px;
17
19
  }
@@ -1,3 +1,7 @@
1
1
  import { ITimeRange, ITime } from './constants';
2
2
  export declare function transformToTime(time: ITimeRange): ITime;
3
3
  export declare function transformToTimeRange(time: ITime): ITimeRange;
4
+ export declare function calcFullTime(time?: ITimeRange): {
5
+ start: number | undefined;
6
+ end: number | undefined;
7
+ } | undefined;
@@ -1,10 +1,23 @@
1
1
  "use strict";
2
+ var __values = (this && this.__values) || function(o) {
3
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
4
+ if (m) return m.call(o);
5
+ if (o && typeof o.length === "number") return {
6
+ next: function () {
7
+ if (o && i >= o.length) o = void 0;
8
+ return { value: o && o[i++], done: !o };
9
+ }
10
+ };
11
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
12
+ };
2
13
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
15
  };
5
16
  Object.defineProperty(exports, "__esModule", { value: true });
6
17
  var moment_1 = __importDefault(require("moment"));
7
18
  var lodash_1 = require("lodash");
19
+ var constants_1 = require("./constants");
20
+ var time_1 = __importDefault(require("./time"));
8
21
  function transformToTime(time) {
9
22
  return {
10
23
  preset: time.preset,
@@ -27,3 +40,43 @@ function transformToTimeRange(time) {
27
40
  };
28
41
  }
29
42
  exports.transformToTimeRange = transformToTimeRange;
43
+ function getTimeShiftUnit(time) {
44
+ var e_1, _a;
45
+ try {
46
+ for (var TimeShiftUnitOptions_1 = __values(constants_1.TimeShiftUnitOptions), TimeShiftUnitOptions_1_1 = TimeShiftUnitOptions_1.next(); !TimeShiftUnitOptions_1_1.done; TimeShiftUnitOptions_1_1 = TimeShiftUnitOptions_1.next()) {
47
+ var item = TimeShiftUnitOptions_1_1.value;
48
+ if (time.endsWith(item.value)) {
49
+ return item.value;
50
+ }
51
+ }
52
+ }
53
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
54
+ finally {
55
+ try {
56
+ if (TimeShiftUnitOptions_1_1 && !TimeShiftUnitOptions_1_1.done && (_a = TimeShiftUnitOptions_1.return)) _a.call(TimeShiftUnitOptions_1);
57
+ }
58
+ finally { if (e_1) throw e_1.error; }
59
+ }
60
+ return constants_1.TimeShiftUnit.Second;
61
+ }
62
+ function getRelativeTime(timeShift, time) {
63
+ var timeShiftValue = parseFloat(timeShift) || 0;
64
+ var timeShiftUnit = getTimeShiftUnit(timeShift);
65
+ if (time) {
66
+ return moment_1.default(time).subtract(timeShiftValue, timeShiftUnit);
67
+ }
68
+ }
69
+ function calcFullTime(time) {
70
+ if (!time) {
71
+ return;
72
+ }
73
+ var timeShift = time.timeShift;
74
+ var _a = new time_1.default(transformToTime(time)).toDate(), start = _a.start, end = _a.end;
75
+ var relativeStart = timeShift && start ? getRelativeTime(timeShift, start) : start;
76
+ var relativeEnd = timeShift && end ? getRelativeTime(timeShift, end) : end;
77
+ return {
78
+ start: relativeStart && relativeStart.valueOf(),
79
+ end: relativeEnd && relativeEnd.valueOf()
80
+ };
81
+ }
82
+ exports.calcFullTime = calcFullTime;