@titaui/pc 1.12.9 → 1.12.12

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 (232) hide show
  1. package/lib/components/avatar/icon-avatar/index.js +1 -1
  2. package/lib/components/avatar/num-avatar/index.js +1 -1
  3. package/lib/components/book-demo/components/pc/components/content/index.js +1 -1
  4. package/lib/components/button/default-button/index.js +1 -1
  5. package/lib/components/button/icon-btn/index.js +1 -1
  6. package/lib/components/cascader/index.js +1 -1
  7. package/lib/components/cascader/time.js +1 -1
  8. package/lib/components/change-okr-modal/Filter.js +2 -2
  9. package/lib/components/change-okr-modal/Item.js +2 -2
  10. package/lib/components/change-okr-modal/filterTab.js +2 -2
  11. package/lib/components/change-okr-modal/index.js +2 -2
  12. package/lib/components/communication/CommunicationAttachments.js +2 -2
  13. package/lib/components/communication/ConvertUserName.js +2 -2
  14. package/lib/components/communication/index.js +2 -2
  15. package/lib/components/create-okr-modal/objectType.js +2 -2
  16. package/lib/components/date-picker/BodyItem.js +3 -3
  17. package/lib/components/date-picker/CalendarBody.js +3 -3
  18. package/lib/components/date-picker/CalendarHeader.js +3 -3
  19. package/lib/components/date-picker/index.js +2 -2
  20. package/lib/components/date-range-picker/index.js +2 -2
  21. package/lib/components/delete-confirm-pop/ConfirmPop.js +2 -2
  22. package/lib/components/dialog/index.js +1 -1
  23. package/lib/components/dialog-confirm/index.js +1 -1
  24. package/lib/components/drawer/headerDrop.js +1 -1
  25. package/lib/components/drawer/index.js +1 -1
  26. package/lib/components/drawer-manager/drawerWrapper.js +1 -1
  27. package/lib/components/drawer-manager/index.js +1 -1
  28. package/lib/components/drop-selector/index.js +1 -1
  29. package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/index.js +1 -1
  30. package/lib/components/dynamic/dynamic-item/dynamic-align/index.js +1 -1
  31. package/lib/components/dynamic/dynamic-item/dynamic-announcement/index.js +1 -1
  32. package/lib/components/dynamic/dynamic-item/dynamic-assessment/index.js +1 -1
  33. package/lib/components/dynamic/dynamic-item/dynamic-chart/index.js +1 -1
  34. package/lib/components/dynamic/dynamic-item/dynamic-create-o/index.js +1 -1
  35. package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +1 -1
  36. package/lib/components/dynamic/dynamic-item/dynamic-learning/index.js +1 -1
  37. package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.js +1 -1
  38. package/lib/components/dynamic/dynamic-item/dynamic-okrs-communication/index.js +1 -1
  39. package/lib/components/dynamic/dynamic-item/dynamic-plan-communication/index.js +1 -1
  40. package/lib/components/dynamic/dynamic-item/dynamic-progress/index.js +1 -1
  41. package/lib/components/dynamic/dynamic-item/dynamic-project/index.js +1 -1
  42. package/lib/components/dynamic/dynamic-item/dynamic-relative/index.js +1 -1
  43. package/lib/components/dynamic/dynamic-item/dynamic-reply/index.js +1 -1
  44. package/lib/components/dynamic/dynamic-item/dynamic-report/index.js +1 -1
  45. package/lib/components/dynamic/dynamic-item/dynamic-reward/index.js +1 -1
  46. package/lib/components/dynamic/dynamic-item/dynamic-share/index.js +1 -1
  47. package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +1 -1
  48. package/lib/components/eReport/eReportListEmpty.js +2 -2
  49. package/lib/components/eReport/eReportLists/reportList.js +2 -2
  50. package/lib/components/eReport/eReportShare/index.js +2 -2
  51. package/lib/components/eReport/eReportShare/toast/index.js +2 -2
  52. package/lib/components/edit-kr-wight/EditKrWightModal.js +2 -2
  53. package/lib/components/edit-kr-wight/FormItemV2.js +2 -2
  54. package/lib/components/emotions-selector/selector-content.js +2 -2
  55. package/lib/components/emotions-selector/selector-pop.js +2 -2
  56. package/lib/components/ereport-list/index.js +2 -2
  57. package/lib/components/error-boundary/index.js +2 -2
  58. package/lib/components/form/form-fields/date/index.js +7 -7
  59. package/lib/components/form/form-fields/dropdown/index.js +1 -1
  60. package/lib/components/form/form-fields/input/index.js +1 -1
  61. package/lib/components/form/form-fields/user/index.js +1 -1
  62. package/lib/components/help-card/index.js +1 -1
  63. package/lib/components/mblog/components/ConfirmPop.js +2 -2
  64. package/lib/components/mblog/components/MblogAction.js +2 -2
  65. package/lib/components/mblog/components/MblogContent.js +2 -2
  66. package/lib/components/mblog/index.js +2 -2
  67. package/lib/components/menus/components/menu-tree/index.js +1 -1
  68. package/lib/components/menus/components/menu-tree/tree-node/index.js +1 -1
  69. package/lib/components/menus/export-modules/demo-menus/menu-highlight.js +19 -1
  70. package/lib/components/menus/export-modules/demo-menus/menus.js +34 -1
  71. package/lib/components/menus/export-modules/interview-menus/constant.js +31 -12
  72. package/lib/components/okr-detail/auth.js +2 -2
  73. package/lib/components/okr-detail/components/base-okr-type/confirm/buttonv2.js +2 -2
  74. package/lib/components/okr-detail/components/base-okr-type/confirm/confirm.js +2 -2
  75. package/lib/components/okr-detail/components/base-okr-type/object-type.js +2 -2
  76. package/lib/components/okr-detail/components/header/o-score.js +1 -1
  77. package/lib/components/okr-detail/components/icon-text/index.js +1 -1
  78. package/lib/components/okr-detail/components/okr-tree/index.js +1 -1
  79. package/lib/components/okr-detail/components/okr-tree/tree-node/index.js +1 -1
  80. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/edit-pop.js +2 -2
  81. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/kr-push-score.js +3 -3
  82. package/lib/components/okr-review/ReviewPop/components/ReviewBody/index.js +2 -2
  83. package/lib/components/okr-review/ReviewPop/components/Toast/index.js +2 -2
  84. package/lib/components/okr-review/ReviewPop/index.js +2 -2
  85. package/lib/components/okr-review/components/ReviewItem/index.js +2 -2
  86. package/lib/components/okr-review/components/confirm-pop/ConfirmPop.js +2 -2
  87. package/lib/components/okr-review/index.js +2 -2
  88. package/lib/components/operation-records/OperationRecordItem.js +2 -2
  89. package/lib/components/operation-records/index.js +2 -2
  90. package/lib/components/pagination/pagination.js +1 -1
  91. package/lib/components/period-selector/components/button/index.js +1 -1
  92. package/lib/components/photo-card/components/card/index.js +12 -9
  93. package/lib/components/picker/components/cross.svg +17 -0
  94. package/lib/components/picker/components/panels/date-panel/date-body.js +14 -2
  95. package/lib/components/picker/components/panels/date-panel/index.js +2 -2
  96. package/lib/components/picker/components/panels/month-panel/index.css +5 -0
  97. package/lib/components/picker/components/panels/month-panel/index.js +3 -3
  98. package/lib/components/picker/components/panels/month-panel/month-body.js +2 -3
  99. package/lib/components/picker/components/panels/month-panel/month-head.js +2 -2
  100. package/lib/components/picker/components/panels/year-panel/index.css +5 -0
  101. package/lib/components/picker/components/panels/year-panel/index.js +2 -2
  102. package/lib/components/picker/components/panels/year-panel/year-body.js +10 -3
  103. package/lib/components/picker/components/panels/year-panel/year-head.js +1 -1
  104. package/lib/components/picker/components/picker-trigger/index.css +6 -1
  105. package/lib/components/picker/components/picker-trigger/index.js +9 -4
  106. package/lib/components/picker/context.js +17 -2
  107. package/lib/components/picker/index.css +29 -1
  108. package/lib/components/picker/index.js +3 -0
  109. package/lib/components/picker/picker-panels.js +79 -64
  110. package/lib/components/picker/picker.js +45 -31
  111. package/lib/components/picker/range-picker/components/picker-trigger/index.css +97 -0
  112. package/lib/components/picker/range-picker/components/picker-trigger/index.js +109 -0
  113. package/lib/components/picker/range-picker/components/placeholder/index.js +91 -0
  114. package/lib/components/picker/range-picker/components/select-input/index.js +72 -0
  115. package/lib/components/picker/range-picker/components/shortcuts/index.js +45 -0
  116. package/lib/components/picker/range-picker/index.css +158 -0
  117. package/lib/components/picker/range-picker/index.js +263 -0
  118. package/lib/components/picker/utils.js +168 -11
  119. package/lib/components/point-demo/drop-down-box/index.js +1 -1
  120. package/lib/components/point-demo/input/index.js +3 -3
  121. package/lib/components/point-demo/popup/index.js +1 -1
  122. package/lib/components/popup/index.js +1 -1
  123. package/lib/components/praise-record/PraiseRecordItem.js +2 -2
  124. package/lib/components/praise-record/index.js +2 -2
  125. package/lib/components/range-picker-pop/index.js +3 -3
  126. package/lib/components/range-selector-pop/RangeList.js +2 -2
  127. package/lib/components/range-selector-pop/RangeSelectorPop.js +2 -2
  128. package/lib/components/rich-editor/models/schema.js +2 -2
  129. package/lib/components/rich-editor/plugins/block/block-quote/index.js +2 -2
  130. package/lib/components/rich-editor/plugins/block/heading/index.js +2 -2
  131. package/lib/components/rich-editor/plugins/block/lists/index.js +2 -2
  132. package/lib/components/rich-editor/plugins/block/paragraph/index.js +2 -2
  133. package/lib/components/rich-editor/plugins/core/index.js +2 -2
  134. package/lib/components/rich-editor/plugins/extension/alignment/index.js +2 -2
  135. package/lib/components/rich-editor/plugins/extension/placeholder/index.js +2 -2
  136. package/lib/components/rich-editor/plugins/inline/color/index.js +2 -2
  137. package/lib/components/rich-editor/plugins/inline/delete-line/index.js +2 -2
  138. package/lib/components/rich-editor/plugins/inline/em/index.js +2 -2
  139. package/lib/components/rich-editor/plugins/inline/link/index.js +2 -2
  140. package/lib/components/rich-editor/plugins/inline/strong/index.js +2 -2
  141. package/lib/components/rich-editor/plugins/inline/under-line/index.js +2 -2
  142. package/lib/components/rich-editor/react/reactNodeView.js +4 -4
  143. package/lib/components/rich-editor/react/uiProvider.js +2 -2
  144. package/lib/components/rich-editor/ui/Popup/index.js +2 -2
  145. package/lib/components/scroll-container/index.js +2 -2
  146. package/lib/components/scrollbar/index.js +1 -1
  147. package/lib/components/scrollbar/scroll-mask/index.js +1 -1
  148. package/lib/components/scrollbar/simplebar-react.js +1 -1
  149. package/lib/components/search-dropdown/index.js +1 -1
  150. package/lib/components/select/Option.js +3 -3
  151. package/lib/components/select/index.js +3 -3
  152. package/lib/components/select-layer/index.js +1 -1
  153. package/lib/components/select-tags/index.js +1 -1
  154. package/lib/components/switch/index.js +1 -1
  155. package/lib/components/table/index.js +1 -1
  156. package/lib/components/tabs/index.js +1 -1
  157. package/lib/components/task-relation-modal/index.js +1 -1
  158. package/lib/components/task-relation-modal/okr-relation/relation-task-model/index.js +1 -1
  159. package/lib/components/task-relation-modal/okr-relation/relation-work-model/index.js +1 -1
  160. package/lib/components/task-relation-modal/tree-node/index.js +1 -1
  161. package/lib/components/task-relation-modal/work-relation/index.js +1 -1
  162. package/lib/components/task-tree/task-item-node/task-node-render.js +1 -1
  163. package/lib/components/task-tree/task-tree.js +1 -1
  164. package/lib/components/textarea/index.js +1 -1
  165. package/lib/components/time-picker/time-picker-selector.js +1 -1
  166. package/lib/components/time-picker/time-picker.js +1 -1
  167. package/lib/components/time-picker/timer-picker-input.js +1 -1
  168. package/lib/components/tita-chart/charts/liquid-ball.js +1 -1
  169. package/lib/components/tita-chart/charts/pie.js +1 -1
  170. package/lib/components/tita-chart/errorBoundary/index.js +2 -2
  171. package/lib/components/tooltip/error-tip.js +1 -1
  172. package/lib/components/tooltip/tooltip.js +1 -1
  173. package/lib/components/tree/index.js +1 -1
  174. package/lib/components/upload/components/uploadedPreview.js +2 -2
  175. package/lib/components/upload/index.js +2 -2
  176. package/lib/components/upvote/index.js +1 -1
  177. package/lib/components/user-selector/category-selector-panel/index.js +1 -0
  178. package/lib/components/user-selector/export-modules/multiple-user-selector--bak/index.js +1 -1
  179. package/lib/components/user-selector/select-tree/choose-tree/index.js +1 -1
  180. package/lib/components/user-selector/select-tree/selected-tree/index.js +1 -1
  181. package/lib/components/viewer/ImageListRender.js +2 -2
  182. package/lib/components/viewer/index.js +2 -2
  183. package/lib/components-v1/animate/AnimateChild.js +2 -2
  184. package/lib/components-v1/animate/animate.js +2 -2
  185. package/lib/components-v1/avatar/index.js +2 -2
  186. package/lib/components-v1/buttonv2/ButtonOutlined.js +2 -2
  187. package/lib/components-v1/buttonv2/ButtonRounded.js +2 -2
  188. package/lib/components-v1/buttonv2/DefaultButton.js +2 -2
  189. package/lib/components-v1/confirm/index.js +2 -2
  190. package/lib/components-v1/dropDownSelector/StatelessDropdown.js +2 -2
  191. package/lib/components-v1/dropDownSelector/dropDownSelector.js +2 -2
  192. package/lib/components-v1/input/Input.js +3 -3
  193. package/lib/components-v1/input/InputNumber.js +2 -2
  194. package/lib/components-v1/placement/placement.js +2 -2
  195. package/lib/components-v1/placement/placementInner.js +2 -2
  196. package/lib/components-v1/pop/Pop.js +2 -2
  197. package/lib/components-v1/pop/PopInner.js +2 -2
  198. package/lib/components-v1/portals/Portals.js +2 -2
  199. package/lib/components-v1/progress/CircleProgress.js +2 -2
  200. package/lib/components-v1/progress/LineProgress.js +2 -2
  201. package/lib/components-v1/progress/index.js +2 -2
  202. package/lib/components-v1/radio/radio.js +2 -2
  203. package/lib/components-v1/radio/radioGroup.js +2 -2
  204. package/lib/components-v1/search/index.js +2 -2
  205. package/lib/components-v1/select/Option.js +3 -3
  206. package/lib/components-v1/select/index.js +3 -3
  207. package/lib/components-v1/tabs/index.js +2 -2
  208. package/lib/components-v1/textarea/index.js +2 -2
  209. package/lib/components-v1/transition/index.js +2 -2
  210. package/lib/components-v1/userSelector/UserSelectorPop.js +2 -2
  211. package/lib/components-v1/userSelector/components/MultiMode/CommonList.js +2 -2
  212. package/lib/components-v1/userSelector/components/MultiMode/DepartmentList.js +2 -2
  213. package/lib/components-v1/userSelector/components/MultiMode/DepartmentTree.js +2 -2
  214. package/lib/components-v1/userSelector/components/MultiMode/SubsList.js +2 -2
  215. package/lib/components-v1/userSelector/components/MultiMode/index.js +2 -2
  216. package/lib/components-v1/userSelector/components/SearchBar.js +2 -2
  217. package/lib/components-v1/userSelector/components/SingleMode.js +2 -2
  218. package/lib/components-v1/userSelector/components/UserItem.js +2 -2
  219. package/lib/components-v1/userSelector/index.js +2 -2
  220. package/lib/index.js +8 -0
  221. package/lib/pages/appointment-demo/drop-down-box/index.js +1 -1
  222. package/lib/pages/appointment-demo/input/index.js +3 -3
  223. package/lib/pages/appointment-demo/popup/index.js +1 -1
  224. package/lib/pages/group-management/components/input-form/index.js +3 -3
  225. package/lib/pages/group-management/components/radio/index.js +1 -1
  226. package/lib/pages/group-management/page-view/importGroupStaff/index.js +1 -1
  227. package/lib/pages/group-management/tree/index.js +1 -1
  228. package/lib/pages/okr-map/export-modules/okr-map/okr-map.js +1 -1
  229. package/lib/pages/okr-map/export-modules/share-okr-page/share-okr-map.js +1 -1
  230. package/lib/pages/okr-map/share-dialog/index.js +1 -1
  231. package/lib/utils/auth.js +2 -2
  232. package/package.json +1 -1
@@ -39,6 +39,7 @@ var DatePanelBody = function DatePanelBody(props) {
39
39
  onSelect = props.onSelect;
40
40
 
41
41
  var _useContext = (0, _react.useContext)(_context["default"]),
42
+ format = _useContext.format,
42
43
  value = _useContext.value;
43
44
 
44
45
  var weekStartDaySun = weekStartDay === 'SUNDAY';
@@ -50,7 +51,18 @@ var DatePanelBody = function DatePanelBody(props) {
50
51
  var _classNames;
51
52
 
52
53
  var date = (0, _moment["default"])(sunday).add(day, 'd');
53
- var classes = (0, _classnames["default"])(_utils.PickerCellClass, (_classNames = {}, _defineProperty(_classNames, "".concat(_utils.PickerCellClass, "--tody"), date.isSame((0, _moment["default"])(), 'date')), _defineProperty(_classNames, "".concat(_utils.PickerCellClass, "--in-view"), date.format('YYYYMM') === currentMonth), _defineProperty(_classNames, "".concat(_utils.PickerCellClass, "--selected"), date.isSame(value)), _classNames));
54
+
55
+ var _isCurrentDateInRange = (0, _utils.isCurrentDateInRanges)({
56
+ nowDate: date,
57
+ values: value
58
+ }),
59
+ inRanges = _isCurrentDateInRange.inRanges,
60
+ rangeStart = _isCurrentDateInRange.rangeStart,
61
+ rangeEnd = _isCurrentDateInRange.rangeEnd;
62
+
63
+ var classes = (0, _classnames["default"])(_utils.PickerCellClass, (_classNames = {}, _defineProperty(_classNames, "".concat(_utils.PickerCellClass, "--today"), date.isSame((0, _moment["default"])(), 'date')), _defineProperty(_classNames, "".concat(_utils.PickerCellClass, "--in-view"), date.format('YYYY/MM') === currentMonth), _defineProperty(_classNames, "".concat(_utils.PickerCellClass, "--in-ranges"), inRanges), _defineProperty(_classNames, "".concat(_utils.PickerCellClass, "--in-ranges--start"), rangeStart), _defineProperty(_classNames, "".concat(_utils.PickerCellClass, "--in-ranges--end"), rangeEnd), _defineProperty(_classNames, "".concat(_utils.PickerCellClass, "--selected"), value === null || value === void 0 ? void 0 : value.some(function (v) {
64
+ return date.isSame((0, _moment["default"])(v).format('YYYY/MM/DD'), 'date');
65
+ })), _classNames));
54
66
  dates.push( /*#__PURE__*/_react["default"].createElement("td", {
55
67
  className: classes,
56
68
  key: date.format('YYYY/MM/DD')
@@ -73,7 +85,7 @@ var DatePanelBody = function DatePanelBody(props) {
73
85
  var getRows = function getRows(date) {
74
86
  var currentDate = (0, _moment["default"])(date);
75
87
  var monthFirstDay = currentDate.date(1);
76
- var currentMonth = monthFirstDay.format('YYYYMM');
88
+ var currentMonth = monthFirstDay.format('YYYY/MM');
77
89
  var daysDiff = weekStartDaySun ? 0 : 1;
78
90
  var weekStartDay = monthFirstDay.subtract(monthFirstDay.day() - daysDiff, 'days');
79
91
  var rows = [];
@@ -21,7 +21,7 @@ require("./index.css");
21
21
 
22
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23
23
 
24
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
24
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
25
25
 
26
26
  var DatePanel = function DatePanel(props) {
27
27
  var viewDate = props.viewDate,
@@ -29,7 +29,7 @@ var DatePanel = function DatePanel(props) {
29
29
 
30
30
  var onMonthChange = function onMonthChange(diff) {
31
31
  if (onViewDateChange) {
32
- onViewDateChange((0, _moment["default"])(viewDate).add(diff, "M"));
32
+ onViewDateChange((0, _moment["default"])(viewDate).add(diff, 'M'));
33
33
  }
34
34
  };
35
35
 
@@ -25,3 +25,8 @@
25
25
  background-color: #2879ff;
26
26
  color: #ffffff;
27
27
  }
28
+
29
+ .tita-ui__picker-panel__month .tita-ui__picker-cell--selected:hover .tita-ui__picker-cell__inner {
30
+ background-color: #5c8eff;
31
+ color: #ffffff;
32
+ }
@@ -23,7 +23,7 @@ var _excluded = ["viewDate", "onPanelChange", "onViewDateChange"];
23
23
 
24
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
25
25
 
26
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
26
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
27
27
 
28
28
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
29
29
 
@@ -37,7 +37,7 @@ var MonthPanel = function MonthPanel(props) {
37
37
 
38
38
  var onYearChange = function onYearChange(diff) {
39
39
  if (onViewDateChange) {
40
- onViewDateChange((0, _moment["default"])(viewDate).add(diff, "y"));
40
+ onViewDateChange((0, _moment["default"])(viewDate).add(diff, 'y'));
41
41
  }
42
42
  };
43
43
 
@@ -52,7 +52,7 @@ var MonthPanel = function MonthPanel(props) {
52
52
  onYearChange(1);
53
53
  },
54
54
  onYearClick: function onYearClick() {
55
- onPanelChange === null || onPanelChange === void 0 ? void 0 : onPanelChange(viewDate, "year");
55
+ onPanelChange === null || onPanelChange === void 0 ? void 0 : onPanelChange(viewDate, 'year');
56
56
  }
57
57
  })), /*#__PURE__*/_react["default"].createElement(_monthBody["default"], _extends({
58
58
  viewDate: viewDate
@@ -35,8 +35,7 @@ var MonthPanelBody = function MonthPanelBody(props) {
35
35
  onSelect = props.onSelect;
36
36
 
37
37
  var _useContext = (0, _react.useContext)(_context["default"]),
38
- value = _useContext.value,
39
- mode = _useContext.mode;
38
+ value = _useContext.value;
40
39
 
41
40
  var getCells = function getCells(baseMonth) {
42
41
  var cols = [];
@@ -46,7 +45,7 @@ var MonthPanelBody = function MonthPanelBody(props) {
46
45
 
47
46
  var month = col + baseMonth;
48
47
  cols.push( /*#__PURE__*/_react["default"].createElement("td", {
49
- className: (0, _classnames["default"])(_utils.PickerCellClass, "".concat(_utils.PickerCellClass, "--in-view"), (_classNames = {}, _defineProperty(_classNames, "".concat(_utils.PickerCellClass, "--this-month"), month === (0, _moment["default"])().month()), _defineProperty(_classNames, "".concat(_utils.PickerCellClass, "--selected"), month === (0, _moment["default"])(value).month() && mode === 'month'), _classNames)),
48
+ className: (0, _classnames["default"])(_utils.PickerCellClass, "".concat(_utils.PickerCellClass, "--in-view"), (_classNames = {}, _defineProperty(_classNames, "".concat(_utils.PickerCellClass, "--this-month"), month === (0, _moment["default"])().month()), _defineProperty(_classNames, "".concat(_utils.PickerCellClass, "--selected"), month === (0, _moment["default"])(viewDate).month()), _classNames)),
50
49
  key: month
51
50
  }, /*#__PURE__*/_react["default"].createElement("div", {
52
51
  onClick: function onClick() {
@@ -19,7 +19,7 @@ var _excluded = ["viewDate", "onPrevYear", "onNextYear", "onYearClick"];
19
19
 
20
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
21
 
22
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
22
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
23
23
 
24
24
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
25
25
 
@@ -40,7 +40,7 @@ var MonthPanelHead = function MonthPanelHead(props) {
40
40
  className: (0, _classnames["default"])("".concat(_utils.PickerHeadClass, "-btn__year")),
41
41
  onClick: onYearClick,
42
42
  type: "button"
43
- }, viewDate.year()));
43
+ }, (0, _moment["default"])(viewDate).year()));
44
44
  };
45
45
 
46
46
  var _default = MonthPanelHead;
@@ -21,3 +21,8 @@
21
21
  background-color: #2879ff;
22
22
  color: #ffffff;
23
23
  }
24
+
25
+ .tita-ui__picker-panel__year .tita-ui__picker-cell--selected:hover .tita-ui__picker-cell__inner {
26
+ background-color: #5c8eff;
27
+ color: #ffffff;
28
+ }
@@ -21,7 +21,7 @@ require("./index.css");
21
21
 
22
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23
23
 
24
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
24
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
25
25
 
26
26
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
27
27
 
@@ -40,7 +40,7 @@ var YearPanel = function YearPanel(props) {
40
40
 
41
41
  var onDecadeYearChange = function onDecadeYearChange(diff) {
42
42
  if (onViewDateChange) {
43
- onViewDateChange((0, _moment["default"])(viewDate).add(diff, "y"));
43
+ onViewDateChange((0, _moment["default"])(viewDate).add(diff, 'y'));
44
44
  }
45
45
  };
46
46
 
@@ -36,8 +36,15 @@ var YearPanelBody = function YearPanelBody(props) {
36
36
  endYear = props.endYear;
37
37
 
38
38
  var _useContext = (0, _react.useContext)(_context["default"]),
39
+ format = _useContext.format,
39
40
  value = _useContext.value,
40
- mode = _useContext.mode;
41
+ settingType = _useContext.settingType;
42
+
43
+ var date = (0, _utils.getPickerDateBySettingType)({
44
+ format: format,
45
+ settingType: settingType,
46
+ values: value
47
+ });
41
48
 
42
49
  var getCells = function getCells(baseYear) {
43
50
  var cols = [];
@@ -47,14 +54,14 @@ var YearPanelBody = function YearPanelBody(props) {
47
54
 
48
55
  var year = baseYear + col;
49
56
  cols.push( /*#__PURE__*/_react["default"].createElement("td", {
50
- className: (0, _classnames["default"])(_utils.PickerCellClass, (_classNames = {}, _defineProperty(_classNames, "".concat(_utils.PickerCellClass, "--this-year"), year === (0, _moment["default"])().year()), _defineProperty(_classNames, "".concat(_utils.PickerCellClass, "--in-view"), year >= startYear && year <= endYear), _defineProperty(_classNames, "".concat(_utils.PickerCellClass, "--selected"), year === (0, _moment["default"])(value).year() && mode === "year"), _classNames)),
57
+ className: (0, _classnames["default"])(_utils.PickerCellClass, (_classNames = {}, _defineProperty(_classNames, "".concat(_utils.PickerCellClass, "--this-year"), year === (0, _moment["default"])().year()), _defineProperty(_classNames, "".concat(_utils.PickerCellClass, "--in-view"), year >= startYear && year <= endYear), _defineProperty(_classNames, "".concat(_utils.PickerCellClass, "--selected"), year === (0, _moment["default"])(date).year()), _classNames)),
51
58
  key: year
52
59
  }, /*#__PURE__*/_react["default"].createElement("div", {
53
60
  className: (0, _classnames["default"])("".concat(_utils.PickerCellClass, "__inner")),
54
61
  title: year,
55
62
  onClick: function onClick() {
56
63
  if (onSelect) {
57
- onSelect((0, _moment["default"])(viewDate).year(year), "year");
64
+ onSelect((0, _moment["default"])(viewDate).year(year), 'year');
58
65
  }
59
66
  }
60
67
  }, year)));
@@ -15,7 +15,7 @@ var _panelHead = _interopRequireDefault(require("../panel-head"));
15
15
 
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17
17
 
18
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
18
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
19
19
 
20
20
  var YearPanelHead = function YearPanelHead(props) {
21
21
  var onPrevDecadeYear = props.onPrevDecadeYear,
@@ -12,10 +12,14 @@
12
12
  align-items: center;
13
13
  }
14
14
 
15
- .tita-ui__picker-trigger:hover {
15
+ .tita-ui__picker-trigger:hover, .tita-ui__picker-trigger--focused {
16
16
  border-color: #2879ff;
17
17
  }
18
18
 
19
+ .tita-ui__picker-trigger--focused .tita-ui__picker-trigger__operation .tu-icon-caret-down::before {
20
+ transform: scale(0.5) rotate(-180deg);
21
+ }
22
+
19
23
  .tita-ui__picker-trigger__input {
20
24
  flex: 1;
21
25
  margin-right: 12px;
@@ -41,6 +45,7 @@
41
45
 
42
46
  .tita-ui__picker-trigger__operation .tu-icon-caret-down::before {
43
47
  transform: scale(0.5);
48
+ transition: all 0.3s ease;
44
49
  display: inline-block;
45
50
  }
46
51
 
@@ -11,6 +11,8 @@ var _react = _interopRequireWildcard(require("react"));
11
11
 
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
13
 
14
+ var _moment = _interopRequireDefault(require("moment"));
15
+
14
16
  var _utils = require("../../utils");
15
17
 
16
18
  var _context = _interopRequireDefault(require("../../context"));
@@ -26,7 +28,10 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
26
28
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
27
29
 
28
30
  var PickerTrigger = function PickerTrigger(props) {
31
+ var _classNames;
32
+
29
33
  var children = props.children,
34
+ focused = props.focused,
30
35
  viewDate = props.viewDate,
31
36
  _props$disabled = props.disabled,
32
37
  disabled = _props$disabled === void 0 ? false : _props$disabled,
@@ -36,13 +41,13 @@ var PickerTrigger = function PickerTrigger(props) {
36
41
  _onClick = props.onClick;
37
42
 
38
43
  var _useContext = (0, _react.useContext)(_context["default"]),
39
- mode = _useContext.mode,
44
+ picker = _useContext.picker,
40
45
  format = _useContext.format,
41
46
  value = _useContext.value;
42
47
 
43
48
  var currFormat = format;
44
49
 
45
- switch (mode) {
50
+ switch (picker) {
46
51
  case 'date':
47
52
  currFormat = 'YYYY/MM/DD';
48
53
  break;
@@ -68,13 +73,13 @@ var PickerTrigger = function PickerTrigger(props) {
68
73
  return !disabled && _onClick();
69
74
  }
70
75
  }, children) : /*#__PURE__*/_react["default"].createElement("div", {
71
- className: (0, _classnames["default"])(_utils.PickerTriggerClass, _defineProperty({}, "".concat(_utils.PickerTriggerClass, "--disabled"), disabled)),
76
+ className: (0, _classnames["default"])(_utils.PickerTriggerClass, (_classNames = {}, _defineProperty(_classNames, "".concat(_utils.PickerTriggerClass, "--disabled"), disabled), _defineProperty(_classNames, "".concat(_utils.PickerTriggerClass, "--focused"), focused), _classNames)),
72
77
  onClick: function onClick() {
73
78
  return !disabled && _onClick();
74
79
  }
75
80
  }, /*#__PURE__*/_react["default"].createElement("div", {
76
81
  className: (0, _classnames["default"])("".concat(_utils.PickerTriggerClass, "__input"), _defineProperty({}, "".concat(_utils.PickerTriggerClass, "__input--placeholder"), !value && placeholder))
77
- }, value ? viewDate.format(currFormat) : placeholder), /*#__PURE__*/_react["default"].createElement("div", {
82
+ }, value ? (0, _moment["default"])(viewDate).format(currFormat) : placeholder), /*#__PURE__*/_react["default"].createElement("div", {
78
83
  className: (0, _classnames["default"])("".concat(_utils.PickerTriggerClass, "__operation"))
79
84
  }, !disabled && /*#__PURE__*/_react["default"].createElement("span", {
80
85
  className: "tu-icon-caret-down"
@@ -3,13 +3,28 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports["default"] = void 0;
6
+ exports["default"] = exports.RangePickerContext = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
10
+ var _moment = _interopRequireDefault(require("moment"));
11
+
10
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
13
 
12
- var PickerContext = /*#__PURE__*/_react["default"].createContext({});
14
+ var PickerContext = /*#__PURE__*/_react["default"].createContext({
15
+ format: 'YYYY/MM/DD',
16
+ picker: 'date',
17
+ settingType: 'startDate',
18
+ value: [(0, _moment["default"])()]
19
+ });
20
+
21
+ var RangePickerContext = /*#__PURE__*/_react["default"].createContext({
22
+ format: 'YYYY/MM/DD',
23
+ picker: 'date',
24
+ settingType: 'startDate',
25
+ values: [(0, _moment["default"])(), (0, _moment["default"])()]
26
+ });
13
27
 
28
+ exports.RangePickerContext = RangePickerContext;
14
29
  var _default = PickerContext;
15
30
  exports["default"] = _default;
@@ -27,7 +27,7 @@
27
27
  color: #141c28;
28
28
  }
29
29
 
30
- .tita-ui__picker-cell--tody .tita-ui__picker-cell__inner, .tita-ui__picker-cell:hover .tita-ui__picker-cell__inner {
30
+ .tita-ui__picker-cell--today .tita-ui__picker-cell__inner, .tita-ui__picker-cell:hover .tita-ui__picker-cell__inner {
31
31
  background-color: #f0f4fa;
32
32
  color: #2879ff;
33
33
  }
@@ -37,6 +37,34 @@
37
37
  color: #ffffff;
38
38
  }
39
39
 
40
+ .tita-ui__picker-cell--selected:hover .tita-ui__picker-cell__inner {
41
+ background-color: #5c8eff;
42
+ color: #ffffff;
43
+ }
44
+
45
+ .tita-ui__picker-cell--in-ranges {
46
+ position: relative;
47
+ }
48
+
49
+ .tita-ui__picker-cell--in-ranges::after {
50
+ content: '';
51
+ background-color: rgba(40, 121, 255, 0.1);
52
+ pointer-events: none;
53
+ position: absolute;
54
+ top: 4px;
55
+ right: 0;
56
+ bottom: 4px;
57
+ left: 0;
58
+ }
59
+
60
+ .tita-ui__picker-cell--in-ranges--start.tita-ui__picker-cell--selected::after {
61
+ left: 10px;
62
+ }
63
+
64
+ .tita-ui__picker-cell--in-ranges--end.tita-ui__picker-cell--selected::after {
65
+ right: 10px;
66
+ }
67
+
40
68
  .tita-ui__picker-cell__inner {
41
69
  width: 100%;
42
70
  height: 100%;
@@ -7,7 +7,10 @@ exports["default"] = void 0;
7
7
 
8
8
  var _picker = _interopRequireDefault(require("./picker"));
9
9
 
10
+ var _rangePicker = _interopRequireDefault(require("./range-picker"));
11
+
10
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
13
 
14
+ _picker["default"]['Range'] = _rangePicker["default"];
12
15
  var _default = _picker["default"];
13
16
  exports["default"] = _default;
@@ -17,6 +17,8 @@ var _monthPanel = _interopRequireDefault(require("./components/panels/month-pane
17
17
 
18
18
  var _yearPanel = _interopRequireDefault(require("./components/panels/year-panel"));
19
19
 
20
+ var _context = _interopRequireDefault(require("./context"));
21
+
20
22
  var _utils = require("./utils");
21
23
 
22
24
  require("./index.css");
@@ -40,26 +42,37 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
40
42
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
41
43
 
42
44
  var PickerPanels = function PickerPanels(props) {
43
- var _props$mode = props.mode,
44
- mode = _props$mode === void 0 ? "date" : _props$mode,
45
+ var _props$picker = props.picker,
46
+ picker = _props$picker === void 0 ? 'date' : _props$picker,
45
47
  onChange = props.onChange,
46
48
  onClose = props.onClose,
49
+ settingType = props.settingType,
47
50
  _props$value = props.value,
48
- value = _props$value === void 0 ? (0, _moment["default"])() : _props$value;
51
+ value = _props$value === void 0 ? [(0, _moment["default"])()] : _props$value;
52
+
53
+ var _useContext = (0, _react.useContext)(_context["default"]),
54
+ format = _useContext.format;
49
55
 
50
- var _useState = (0, _react.useState)(mode),
56
+ var _useState = (0, _react.useState)(picker),
51
57
  _useState2 = _slicedToArray(_useState, 2),
52
58
  pickerMode = _useState2[0],
53
59
  setPickerMode = _useState2[1];
54
60
 
55
- var _useState3 = (0, _react.useState)(value ? (0, _moment["default"])(value) : (0, _moment["default"])()),
61
+ var _useState3 = (0, _react.useState)(value),
56
62
  _useState4 = _slicedToArray(_useState3, 2),
57
63
  viewDate = _useState4[0],
58
- setViewDate = _useState4[1];
64
+ setViewDate = _useState4[1]; // const getNewDate = useCallback((date) => {
65
+ // return setPickerDateBySettingType({
66
+ // newDate: date,
67
+ // settingType,
68
+ // values: viewDate,
69
+ // })
70
+ // }, [settingType, viewDate])
71
+
59
72
 
60
73
  var onViewDateChange = function onViewDateChange(date) {
61
74
  setViewDate(function () {
62
- return date;
75
+ return [date];
63
76
  });
64
77
  };
65
78
 
@@ -70,16 +83,14 @@ var PickerPanels = function PickerPanels(props) {
70
83
  };
71
84
 
72
85
  var onCloseHandler = function onCloseHandler() {
73
- if (pickerMode === mode) {
74
- if (onClose) {
75
- onClose();
76
- }
86
+ if (pickerMode === picker && onClose) {
87
+ onClose();
77
88
  }
78
89
  };
79
90
 
80
91
  var onDateSelect = function onDateSelect(date) {
81
92
  if (onChange) {
82
- onChange(date);
93
+ onChange([date]);
83
94
  }
84
95
 
85
96
  onCloseHandler();
@@ -87,15 +98,13 @@ var PickerPanels = function PickerPanels(props) {
87
98
 
88
99
  var onMonthSelect = function onMonthSelect(date) {
89
100
  setViewDate(function () {
90
- return date;
101
+ return [date];
91
102
  });
92
103
 
93
- if (mode !== "month") {
94
- onPanelChange(date, "date");
95
- }
96
-
97
- if (onChange) {
98
- onChange(date);
104
+ if (picker !== 'month') {
105
+ onPanelChange(date, 'date');
106
+ } else if (onChange) {
107
+ onChange([date]);
99
108
  }
100
109
 
101
110
  onCloseHandler();
@@ -103,15 +112,13 @@ var PickerPanels = function PickerPanels(props) {
103
112
 
104
113
  var onYearSelect = function onYearSelect(date) {
105
114
  setViewDate(function () {
106
- return date;
115
+ return [date];
107
116
  });
108
117
 
109
- if (mode !== "year") {
110
- onPanelChange(date, "month");
111
- }
112
-
113
- if (onChange) {
114
- onChange(date);
118
+ if (picker !== 'year') {
119
+ onPanelChange(date, 'month');
120
+ } else if (onChange) {
121
+ onChange([date]);
115
122
  }
116
123
 
117
124
  onCloseHandler();
@@ -119,15 +126,15 @@ var PickerPanels = function PickerPanels(props) {
119
126
 
120
127
  var onSelectChange = function onSelectChange(date, type) {
121
128
  switch (type) {
122
- case "date":
129
+ case 'date':
123
130
  onDateSelect(date);
124
131
  break;
125
132
 
126
- case "month":
133
+ case 'month':
127
134
  onMonthSelect(date);
128
135
  break;
129
136
 
130
- case "year":
137
+ case 'year':
131
138
  onYearSelect(date);
132
139
  break;
133
140
 
@@ -136,47 +143,55 @@ var PickerPanels = function PickerPanels(props) {
136
143
  }
137
144
  };
138
145
 
139
- var panel;
140
-
141
- switch (pickerMode) {
142
- case "date":
143
- panel = /*#__PURE__*/_react["default"].createElement(_datePanel["default"], {
144
- viewDate: viewDate,
145
- onSelect: onSelectChange,
146
- onViewDateChange: onViewDateChange,
147
- onPanelChange: onPanelChange
148
- });
149
- break;
150
-
151
- case "month":
152
- panel = /*#__PURE__*/_react["default"].createElement(_monthPanel["default"], {
153
- viewDate: viewDate,
154
- onSelect: onSelectChange,
155
- onViewDateChange: onViewDateChange,
156
- onPanelChange: onPanelChange
157
- });
158
- break;
159
-
160
- case "year":
161
- panel = /*#__PURE__*/_react["default"].createElement(_yearPanel["default"], {
162
- viewDate: viewDate,
163
- onSelect: onSelectChange,
164
- onViewDateChange: onViewDateChange
165
- });
166
- break;
167
-
168
- default:
169
- break;
170
- }
146
+ var renderPanels = (0, _react.useCallback)(function () {
147
+ var panel;
148
+ var date = (0, _utils.getPickerDateBySettingType)({
149
+ format: format,
150
+ settingType: settingType,
151
+ values: viewDate
152
+ });
153
+
154
+ switch (pickerMode) {
155
+ case 'date':
156
+ panel = /*#__PURE__*/_react["default"].createElement(_datePanel["default"], {
157
+ viewDate: date,
158
+ onSelect: onSelectChange,
159
+ onViewDateChange: onViewDateChange,
160
+ onPanelChange: onPanelChange
161
+ });
162
+ break;
163
+
164
+ case 'month':
165
+ panel = /*#__PURE__*/_react["default"].createElement(_monthPanel["default"], {
166
+ viewDate: date,
167
+ onSelect: onSelectChange,
168
+ onViewDateChange: onViewDateChange,
169
+ onPanelChange: onPanelChange
170
+ });
171
+ break;
172
+
173
+ case 'year':
174
+ panel = /*#__PURE__*/_react["default"].createElement(_yearPanel["default"], {
175
+ viewDate: date,
176
+ onSelect: onSelectChange,
177
+ onViewDateChange: onViewDateChange
178
+ });
179
+ break;
180
+
181
+ default:
182
+ break;
183
+ }
171
184
 
185
+ return panel;
186
+ }, [pickerMode, viewDate]);
172
187
  return /*#__PURE__*/_react["default"].createElement("div", {
173
188
  className: _utils.PickerClass
174
- }, panel);
189
+ }, renderPanels());
175
190
  };
176
191
 
177
192
  PickerPanels.defaultProps = {
178
- mode: "date",
179
- value: (0, _moment["default"])()
193
+ picker: 'date',
194
+ value: [(0, _moment["default"])()]
180
195
  };
181
196
  var _default = PickerPanels;
182
197
  exports["default"] = _default;