@titaui/pc 1.11.27-beta.8 → 1.11.29
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.
- package/lib/components/avatar/name-avatar/index.css +0 -1
- package/lib/components/avatar/name-avatar/index.js +13 -22
- package/lib/components/avatar/text-avatar/index.css +7 -0
- package/lib/components/avatar/text-avatar/index.js +32 -7
- package/lib/components/button/icon-btn/index.js +17 -8
- package/lib/components/button/rect-btn/index.css +11 -45
- package/lib/components/button/rect-btn/index.js +13 -19
- package/lib/components/change-okr-modal/Item.js +14 -14
- package/lib/components/change-okr-modal/index.js +1 -2
- package/lib/components/create-okr-modal/index.js +1 -3
- package/lib/components/create-okr-modal/request-api.js +1 -1
- package/lib/components/dialog-confirm/index.css +2 -2
- package/lib/components/drawer/headerAction.js +1 -5
- package/lib/components/drawer/headerDrop.js +4 -42
- package/lib/components/drawer/index.css +0 -33
- package/lib/components/drawer/index.js +3 -26
- package/lib/components/drop-selector/index.js +25 -10
- package/lib/components/dynamic/advertise/components/next-btn/index.css +27 -0
- package/lib/components/dynamic/advertise/components/next-btn/index.js +32 -0
- package/lib/components/dynamic/advertise/components/pre-btn/index.css +26 -0
- package/lib/components/dynamic/advertise/components/pre-btn/index.js +32 -0
- package/lib/components/dynamic/advertise/index.css +21 -0
- package/lib/components/dynamic/advertise/index.js +126 -0
- package/lib/components/dynamic/advertise/interface.js +5 -0
- package/lib/components/dynamic/advertise/util.js +28 -0
- package/lib/components/dynamic/components/dynamic-search-input/index.css +81 -0
- package/lib/components/dynamic/components/dynamic-search-input/index.js +203 -0
- package/lib/components/dynamic/components/first-level-tabs/index.css +101 -0
- package/lib/components/dynamic/components/first-level-tabs/index.js +131 -0
- package/lib/components/dynamic/constant.js +33 -32
- package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/dynamic-footer.js +9 -9
- package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/index.js +1 -1
- package/lib/components/dynamic/dynamic-item/dynamic-interview/img/wifi.svg +24 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview/index.css +51 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview/index.js +50 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview/interview-content.js +65 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview-share/img/wifi.svg +24 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview-share/index.css +61 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview-share/index.js +61 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview-share/interview-content.js +69 -0
- package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +5 -5
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.js +6 -6
- package/lib/components/dynamic/dynamic-item/dynamic-progress/index.js +10 -10
- package/lib/components/dynamic/dynamic-item/dynamic-reply/index.js +13 -13
- package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +9 -9
- package/lib/components/dynamic/dynamic-item/index.js +50 -32
- package/lib/components/dynamic/dynamic-like-ranking/image/like-ranking.svg +23 -0
- package/lib/components/dynamic/dynamic-like-ranking/image/ranking-1.png +0 -0
- package/lib/components/dynamic/dynamic-like-ranking/image/ranking-2.png +0 -0
- package/lib/components/dynamic/dynamic-like-ranking/image/ranking-3.png +0 -0
- package/lib/components/dynamic/dynamic-like-ranking/image/ranking-empty.png +0 -0
- package/lib/components/dynamic/dynamic-like-ranking/index.css +146 -0
- package/lib/components/dynamic/dynamic-like-ranking/index.js +180 -0
- package/lib/components/dynamic/dynamic-like-ranking/item.js +105 -0
- package/lib/components/dynamic/dynamic-like-ranking/mock.js +84 -0
- package/lib/components/dynamic/dynamic-liking/image/like-dynamic.svg +30 -0
- package/lib/components/dynamic/dynamic-liking/index.css +81 -0
- package/lib/{pages/new-okr-list/header/operate-record.js → components/dynamic/dynamic-liking/index.js} +39 -91
- package/lib/components/dynamic/dynamic-liking/item.js +75 -0
- package/lib/components/dynamic/dynamic-liking/mock.js +83 -0
- package/lib/components/dynamic/dynamic-list/index.js +7 -15
- package/lib/components/dynamic/dynamic-topping/image/quotation-mark.svg +16 -0
- package/lib/components/dynamic/dynamic-topping/image/top-icon.svg +30 -0
- package/lib/components/dynamic/dynamic-topping/index.css +141 -0
- package/lib/components/dynamic/dynamic-topping/index.js +82 -0
- package/lib/components/dynamic/dynamic-topping/interface.js +5 -0
- package/lib/components/dynamic/dynamic-topping/item.js +153 -0
- package/lib/components/dynamic/dynamic-topping/request-api.js +36 -0
- package/lib/components/dynamic/dynamic.css +173 -0
- package/lib/components/dynamic/dynamic.js +428 -0
- package/lib/components/dynamic/export-module/index.js +37 -0
- package/lib/components/dynamic/img/dynamic-top.svg +14 -0
- package/lib/components/dynamic/index.js +12 -9
- package/lib/components/dynamic/my-team/img/add-subordinate.png +0 -0
- package/lib/components/dynamic/my-team/img/line.png +0 -0
- package/lib/components/dynamic/my-team/img/team.png +0 -0
- package/lib/components/dynamic/my-team/index.css +184 -0
- package/lib/components/dynamic/my-team/index.js +263 -0
- package/lib/components/dynamic/my-team/request-api.js +52 -0
- package/lib/components/dynamic/my-team/util.js +20 -0
- package/lib/components/dynamic/new-ui.css +192 -0
- package/lib/components/dynamic/online-broadcast/components/broadcast-item/index.css +58 -0
- package/lib/components/dynamic/online-broadcast/components/broadcast-item/index.js +68 -0
- package/lib/components/dynamic/online-broadcast/data.js +77 -0
- package/lib/components/dynamic/online-broadcast/img/broadcast.svg +14 -0
- package/lib/components/dynamic/online-broadcast/img/new.png +0 -0
- package/lib/components/dynamic/online-broadcast/img/preview.png +0 -0
- package/lib/components/dynamic/online-broadcast/index.css +46 -0
- package/lib/components/dynamic/online-broadcast/index.js +61 -0
- package/lib/components/dynamic/online-broadcast/interfact.js +5 -0
- package/lib/components/dynamic/quick-operation/components/create-announcement/index.css +25 -0
- package/lib/components/dynamic/quick-operation/components/create-announcement/index.js +39 -0
- package/lib/components/dynamic/quick-operation/components/create-okr/index.css +25 -0
- package/lib/components/dynamic/quick-operation/components/create-okr/index.js +39 -0
- package/lib/components/dynamic/quick-operation/components/create-share/index.css +25 -0
- package/lib/components/dynamic/quick-operation/components/create-share/index.js +39 -0
- package/lib/components/dynamic/quick-operation/components/create-task/index.css +25 -0
- package/lib/components/dynamic/quick-operation/components/create-task/index.js +44 -0
- package/lib/components/dynamic/quick-operation/img/new-announcement.png +0 -0
- package/lib/components/dynamic/quick-operation/img/new-okr.png +0 -0
- package/lib/components/dynamic/quick-operation/img/new-share.png +0 -0
- package/lib/components/dynamic/quick-operation/img/new-task.png +0 -0
- package/lib/components/dynamic/quick-operation/index.css +51 -0
- package/lib/components/dynamic/quick-operation/index.js +120 -0
- package/lib/components/dynamic/request-api.js +68 -7
- package/lib/components/e-priority/index.js +8 -8
- package/lib/components/eReport/eReportShare/index.js +11 -11
- package/lib/components/form/form-fields/date/index.css +24 -0
- package/lib/components/form/form-fields/date/index.js +102 -0
- package/lib/components/form/form-fields/input/index.js +10 -10
- package/lib/components/form/form-fields/user/index.css +23 -3
- package/lib/components/form/form-fields/user/index.js +18 -8
- package/lib/components/form/form-fields/user/user-input.js +15 -6
- package/lib/components/form/index.js +10 -3
- package/lib/components/grid-layout/sub-employee-okr/person-okr.js +5 -5
- package/lib/components/icon-button-list/index.js +3 -3
- package/lib/components/img-viewer/index.css +3 -3
- package/lib/components/img-viewer/index.js +11 -11
- package/lib/components/menus/components/menu-tree/images/interview-menu/my-interview.svg +16 -0
- package/lib/components/menus/components/menu-tree/images/interview-menu/template.svg +16 -0
- package/lib/components/menus/components/menu-tree/images/interview-menu/todo.svg +16 -0
- package/lib/components/menus/components/menu-tree/index.css +4 -2
- package/lib/components/menus/components/menu-tree/tree-node/index.css +85 -1
- package/lib/components/menus/export-modules/interview-menus/constant.js +30 -0
- package/lib/components/menus/export-modules/interview-menus/handle-highlight.js +63 -0
- package/lib/components/menus/export-modules/interview-menus/index.css +7 -0
- package/lib/components/menus/export-modules/interview-menus/index.js +128 -0
- package/lib/components/menus/index.js +11 -5
- package/lib/components/nav-top/components/menu/index.js +14 -14
- package/lib/components/nav-top/components/user-message/components/inform/inform-item.js +25 -19
- package/lib/components/nav-top/components/user-message/components/remind/remind-item.js +48 -10
- package/lib/components/nav-top/components/user-message/constant.js +1 -0
- package/lib/components/nav-top/components/user-message/hrMessage.js +22 -19
- package/lib/components/nav-top/components/user-message/index.js +23 -20
- package/lib/components/nav-top/index.js +4 -8
- package/lib/components/nav-top/request.apis.js +3 -1
- package/lib/components/okr-detail/base-info/other-infos/date-cycle/index.js +4 -20
- package/lib/components/okr-detail/base-info/other-infos/principal/index.js +1 -9
- package/lib/components/okr-detail/components/header/index.js +3 -10
- package/lib/components/okr-detail/components/header/o-name.js +3 -10
- package/lib/components/okr-detail/components/o-classify.js +1 -5
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-priority-dropdown.js +7 -7
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +10 -14
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/range-picker-pop.js +10 -0
- package/lib/components/okr-detail/detail-header/actions.js +23 -23
- package/lib/components/okr-detail/detail-header/delete-confirm/delete-confirm.js +43 -98
- package/lib/components/okr-detail/detail-header/delete-confirm/style.js +38 -0
- package/lib/components/okr-detail/detail-header/index.css +0 -11
- package/lib/components/okr-detail/detail-header/index.js +234 -228
- package/lib/components/okr-detail/index.js +21 -40
- package/lib/components/okr-detail/okr-list/index.js +8 -11
- package/lib/components/okr-detail/request-apis.js +4 -10
- package/lib/components/okr-flow/child-node/index.css +6 -6
- package/lib/components/okr-flow/child-node/work-node.js +21 -21
- package/lib/components/okr-flow/export-modal/index.js +33 -19
- package/lib/components/okr-flow/export-modules/okr-search-panel/index.js +14 -14
- package/lib/components/okr-flow/okr-map/index.js +5 -5
- package/lib/components/okr-flow/request-apis.js +4 -4
- package/lib/components/okr-flow/root-node/index.js +25 -24
- package/lib/components/okr-flow/utils/index.js +5 -5
- package/lib/components/okr-flow/utils/tree-handler.js +17 -17
- package/lib/components/okr-period-selector/index.js +5 -9
- package/lib/components/okr-period-selector/select-cycle.js +19 -23
- package/lib/components/okrcase-library/okrcases-components/submitOkr-dialog.js +30 -30
- package/lib/components/operation-records/index.js +1 -1
- package/lib/components/operation-records/style.js +1 -1
- package/lib/components/pagination/index.css +3 -3
- package/lib/components/pagination/select.css +58 -23
- package/lib/components/period-selector/index.css +3 -3
- package/lib/components/period-selector/index.js +11 -11
- package/lib/components/picker/components/panels/date-panel/date-body.js +118 -0
- package/lib/components/picker/components/panels/date-panel/date-head.js +87 -0
- package/lib/components/picker/components/panels/date-panel/index.css +14 -0
- package/lib/components/picker/components/panels/date-panel/index.js +49 -0
- package/lib/components/picker/components/panels/month-panel/index.css +27 -0
- package/lib/components/picker/components/panels/month-panel/index.js +63 -0
- package/lib/components/picker/components/panels/month-panel/month-body.js +89 -0
- package/lib/components/picker/components/panels/month-panel/month-head.js +47 -0
- package/lib/components/picker/components/panels/panel-body/index.js +53 -0
- package/lib/components/picker/components/panels/panel-head/index.js +48 -0
- package/lib/components/picker/components/panels/year-panel/index.css +23 -0
- package/lib/components/picker/components/panels/year-panel/index.js +65 -0
- package/lib/components/picker/components/panels/year-panel/year-body.js +92 -0
- package/lib/components/picker/components/panels/year-panel/year-head.js +35 -0
- package/lib/components/picker/components/picker-trigger/index.css +57 -0
- package/lib/components/picker/components/picker-trigger/index.js +94 -0
- package/lib/components/picker/context.js +15 -0
- package/lib/components/picker/index.css +121 -0
- package/lib/components/picker/index.js +13 -0
- package/lib/components/picker/picker-panels.js +182 -0
- package/lib/components/picker/picker.js +132 -0
- package/lib/components/picker/type.js +5 -0
- package/lib/components/picker/utils.js +28 -0
- package/lib/components/popup/index.js +4 -4
- package/lib/components/publish-dynamic-modal/publish-dynamic-modal.js +10 -16
- package/lib/components/radio/index.css +9 -9
- package/lib/components/scrollbar/scroll-mask/index.js +1 -1
- package/lib/components/superset-charts/utils/axios.js +5 -5
- package/lib/components/survey-model/index.css +18 -18
- package/lib/components/survey-model/instance.js +1 -1
- package/lib/components/task-relation-modal/request-api.js +1 -2
- package/lib/components/task-tree/helper.js +61 -0
- package/lib/components/task-tree/images/P1.svg +15 -0
- package/lib/components/task-tree/images/P2.svg +15 -0
- package/lib/components/task-tree/images/P3.svg +15 -0
- package/lib/components/task-tree/images/P4.svg +15 -0
- package/lib/components/task-tree/images/P5.svg +15 -0
- package/lib/components/task-tree/images/arrow.svg +9 -0
- package/lib/components/task-tree/images/empty-131.png +0 -0
- package/lib/components/task-tree/images/followed.svg +33 -0
- package/lib/components/task-tree/images/nice.svg +108 -0
- package/lib/components/task-tree/images/struc12.png +0 -0
- package/lib/components/task-tree/images/struc2.png +0 -0
- package/lib/components/task-tree/images/xialat-s.svg +13 -0
- package/lib/components/task-tree/index.js +22 -0
- package/lib/components/task-tree/mock.js +944 -0
- package/lib/components/task-tree/precls.js +8 -0
- package/lib/components/task-tree/request-apis.js +88 -0
- package/lib/components/task-tree/task-item-node/constant.js +45 -0
- package/lib/components/task-tree/task-item-node/e-empty.js +29 -0
- package/lib/components/task-tree/task-item-node/e-project.js +212 -0
- package/lib/components/task-tree/task-item-node/e-status-dropdown.js +94 -0
- package/lib/components/task-tree/task-item-node/e-task.js +426 -0
- package/lib/components/task-tree/task-item-node/get-process-color.js +62 -0
- package/lib/components/task-tree/task-item-node/index.css +289 -0
- package/lib/components/task-tree/task-item-node/task-node-render.js +43 -0
- package/lib/components/task-tree/task-tree.css +16 -0
- package/lib/components/task-tree/task-tree.js +49 -0
- package/lib/components/time-picker/index.css +123 -0
- package/lib/components/time-picker/index.js +13 -0
- package/lib/components/time-picker/time-picker-selector.js +138 -0
- package/lib/components/time-picker/time-picker.js +336 -0
- package/lib/components/time-picker/timer-picker-input.js +96 -0
- package/lib/components/time-picker/utils.js +52 -0
- package/lib/components/toast/index.js +3 -5
- package/lib/components/user-selector/select-tree/tree-nodes/tree-person-node/index.css +1 -0
- package/lib/components-v1/radio/radio.js +3 -3
- package/lib/components-v1/radio/style/index.css +8 -8
- package/lib/index.js +0 -40
- package/lib/pages/aha2021/index.js +5 -1
- package/lib/pages/new-okr-list/header/index.css +0 -45
- package/lib/pages/new-okr-list/header/index.js +16 -38
- package/lib/pages/new-okr-list/index.js +1 -3
- package/lib/pages/new-okr-list/list/index.js +2 -19
- package/lib/pages/new-okr-list/request-api.js +2 -8
- package/lib/pages/okr-map/export-modules/okr-map/header/index.js +24 -24
- package/lib/pages/okr-map/export-modules/okr-map/okr-map.js +31 -31
- package/lib/pages/okr-map/export-modules/share-okr-page/header/index.css +2 -2
- package/lib/pages/okr-map/export-modules/share-okr-page/header/index.js +11 -11
- package/lib/pages/okr-map/export-modules/share-okr-page/share-okr-map.js +8 -8
- package/lib/pages/okr-map/number-select/index.js +2 -2
- package/lib/pages/okr-map/unsupport-ie/index.js +5 -3
- package/lib/utils/auth.js +6 -6
- package/lib/utils/bs-global.js +12 -12
- package/lib/utils/format-time.js +1 -8
- package/lib/utils/hooks.js +72 -0
- package/lib/utils/open-data.js +27 -31
- package/package.json +6 -3
- package/.eslintignore +0 -3
- package/.eslintrc.js +0 -223
- package/.husky/pre-commit +0 -4
- package/.prettierignore +0 -31
- package/.prettierrc.js +0 -90
- package/.vscode/settings.json +0 -5
- package/lib/components/okr-detail/detail-header/constant.js +0 -53
- package/lib/components/okr-detail/detail-header/delete-confirm/index.css +0 -55
- package/lib/components/okr-detail/helper.js +0 -108
- package/lib/components/textarea/index.css +0 -142
- package/lib/components/textarea/index.js +0 -259
- package/lib/pages/new-okr-list/header/common.js +0 -52
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
|
|
12
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
13
|
+
|
|
14
|
+
var _getLocale = require("../../../../../utils/getLocale");
|
|
15
|
+
|
|
16
|
+
var _utils = require("../../../utils");
|
|
17
|
+
|
|
18
|
+
require("./index.css");
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
+
|
|
22
|
+
function DatePanelHead(props) {
|
|
23
|
+
var _props$viewDate = props.viewDate,
|
|
24
|
+
viewDate = _props$viewDate === void 0 ? (0, _moment["default"])() : _props$viewDate,
|
|
25
|
+
onPrev = props.onPrev,
|
|
26
|
+
onNext = props.onNext,
|
|
27
|
+
onPanelChange = props.onPanelChange;
|
|
28
|
+
var yearText = (0, _moment["default"])(viewDate).format('YYYY');
|
|
29
|
+
var monthText = (0, _moment["default"])(viewDate).format('MM');
|
|
30
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
31
|
+
className: (0, _classnames["default"])(_utils.PickerHeadClass)
|
|
32
|
+
}, !_getLocale.isEn && /*#__PURE__*/_react["default"].createElement("div", {
|
|
33
|
+
className: (0, _classnames["default"])("".concat(_utils.PickerHeadClass, "__view"))
|
|
34
|
+
}, /*#__PURE__*/_react["default"].createElement("button", {
|
|
35
|
+
className: (0, _classnames["default"])("".concat(_utils.PickerHeadClass, "-btn__year")),
|
|
36
|
+
onClick: function onClick() {
|
|
37
|
+
return onPanelChange && onPanelChange(viewDate, 'year');
|
|
38
|
+
},
|
|
39
|
+
type: "button"
|
|
40
|
+
}, yearText), /*#__PURE__*/_react["default"].createElement("span", {
|
|
41
|
+
className: (0, _classnames["default"])("".concat(_utils.PickerClass, "-unit"))
|
|
42
|
+
}, "\xA0\u5E74"), /*#__PURE__*/_react["default"].createElement("button", {
|
|
43
|
+
className: (0, _classnames["default"])("".concat(_utils.PickerHeadClass, "-btn__month")),
|
|
44
|
+
onClick: function onClick() {
|
|
45
|
+
return onPanelChange && onPanelChange(viewDate, 'month');
|
|
46
|
+
},
|
|
47
|
+
type: "button"
|
|
48
|
+
}, monthText), /*#__PURE__*/_react["default"].createElement("span", {
|
|
49
|
+
className: (0, _classnames["default"])("".concat(_utils.PickerClass, "-unit"))
|
|
50
|
+
}, "\u6708")), _getLocale.isEn && /*#__PURE__*/_react["default"].createElement("div", {
|
|
51
|
+
className: (0, _classnames["default"])("".concat(_utils.PickerHeadClass, "__view"))
|
|
52
|
+
}, /*#__PURE__*/_react["default"].createElement("button", {
|
|
53
|
+
className: (0, _classnames["default"])("".concat(_utils.PickerHeadClass, "-btn__month")),
|
|
54
|
+
onClick: function onClick() {
|
|
55
|
+
return onPanelChange && onPanelChange(viewDate, 'month');
|
|
56
|
+
},
|
|
57
|
+
style: {
|
|
58
|
+
marginRight: 4
|
|
59
|
+
},
|
|
60
|
+
type: "button"
|
|
61
|
+
}, _utils.MONTHDATAMAPEN[Number(monthText) - 1]), /*#__PURE__*/_react["default"].createElement("button", {
|
|
62
|
+
className: (0, _classnames["default"])("".concat(_utils.PickerHeadClass, "-btn__year")),
|
|
63
|
+
onClick: function onClick() {
|
|
64
|
+
return onPanelChange && onPanelChange(viewDate, 'year');
|
|
65
|
+
},
|
|
66
|
+
type: "button"
|
|
67
|
+
}, yearText)), /*#__PURE__*/_react["default"].createElement("div", {
|
|
68
|
+
className: (0, _classnames["default"])("".concat(_utils.PickerHeadClass, "__operation"))
|
|
69
|
+
},
|
|
70
|
+
/*#__PURE__*/
|
|
71
|
+
// eslint-disable-next-line jsx-a11y/control-has-associated-label
|
|
72
|
+
_react["default"].createElement("button", {
|
|
73
|
+
className: (0, _classnames["default"])("".concat(_utils.PickerHeadClass, "-btn__prev"), 'tu-icon-arrow-up1'),
|
|
74
|
+
onClick: onPrev,
|
|
75
|
+
type: "button"
|
|
76
|
+
}),
|
|
77
|
+
/*#__PURE__*/
|
|
78
|
+
// eslint-disable-next-line jsx-a11y/control-has-associated-label
|
|
79
|
+
_react["default"].createElement("button", {
|
|
80
|
+
className: (0, _classnames["default"])("".concat(_utils.PickerHeadClass, "-btn__next"), 'tu-icon-arrow-down1'),
|
|
81
|
+
onClick: onNext,
|
|
82
|
+
type: "button"
|
|
83
|
+
})));
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
var _default = DatePanelHead;
|
|
87
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
.tita-ui__picker-panel__date {
|
|
2
|
+
max-height: 252px;
|
|
3
|
+
overflow: hidden;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.tita-ui__picker-panel__date .tita-ui__picker-head-btn__prev {
|
|
7
|
+
margin-right: 8px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.tita-ui__picker-panel__date .tita-ui__picker-content thead {
|
|
11
|
+
background: #fff;
|
|
12
|
+
position: relative;
|
|
13
|
+
z-index: 1;
|
|
14
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
|
|
12
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
13
|
+
|
|
14
|
+
var _utils = require("../../../utils");
|
|
15
|
+
|
|
16
|
+
var _dateHead = _interopRequireDefault(require("./date-head"));
|
|
17
|
+
|
|
18
|
+
var _dateBody = _interopRequireDefault(require("./date-body"));
|
|
19
|
+
|
|
20
|
+
require("./index.css");
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
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); }
|
|
25
|
+
|
|
26
|
+
var DatePanel = function DatePanel(props) {
|
|
27
|
+
var viewDate = props.viewDate,
|
|
28
|
+
onViewDateChange = props.onViewDateChange;
|
|
29
|
+
|
|
30
|
+
var onMonthChange = function onMonthChange(diff) {
|
|
31
|
+
if (onViewDateChange) {
|
|
32
|
+
onViewDateChange((0, _moment["default"])(viewDate).add(diff, "M"));
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
37
|
+
className: (0, _classnames["default"])("".concat(_utils.PickerPanelClass, "__date"))
|
|
38
|
+
}, /*#__PURE__*/_react["default"].createElement(_dateHead["default"], _extends({}, props, {
|
|
39
|
+
onPrev: function onPrev() {
|
|
40
|
+
return onMonthChange(-1);
|
|
41
|
+
},
|
|
42
|
+
onNext: function onNext() {
|
|
43
|
+
return onMonthChange(1);
|
|
44
|
+
}
|
|
45
|
+
})), /*#__PURE__*/_react["default"].createElement(_dateBody["default"], props));
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
var _default = DatePanel;
|
|
49
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
.tita-ui__picker-panel__month .tita-ui__picker-head {
|
|
2
|
+
margin-bottom: 6px;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.tita-ui__picker-panel__month .tita-ui__picker-head__view {
|
|
6
|
+
text-align: center;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.tita-ui__picker-panel__month .tita-ui__picker-cell {
|
|
10
|
+
width: 52px;
|
|
11
|
+
height: 28px;
|
|
12
|
+
padding: 11px 21px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.tita-ui__picker-panel__month .tita-ui__picker-cell__inner {
|
|
16
|
+
color: #141c28;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.tita-ui__picker-panel__month .tita-ui__picker-cell--this-month .tita-ui__picker-cell__inner, .tita-ui__picker-panel__month .tita-ui__picker-cell:hover .tita-ui__picker-cell__inner {
|
|
20
|
+
background-color: #f0f4fa;
|
|
21
|
+
color: #2879ff;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.tita-ui__picker-panel__month .tita-ui__picker-cell--selected .tita-ui__picker-cell__inner {
|
|
25
|
+
background-color: #2879ff;
|
|
26
|
+
color: #ffffff;
|
|
27
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
|
|
12
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
13
|
+
|
|
14
|
+
var _utils = require("../../../utils");
|
|
15
|
+
|
|
16
|
+
var _monthBody = _interopRequireDefault(require("./month-body"));
|
|
17
|
+
|
|
18
|
+
var _monthHead = _interopRequireDefault(require("./month-head"));
|
|
19
|
+
|
|
20
|
+
require("./index.css");
|
|
21
|
+
|
|
22
|
+
var _excluded = ["viewDate", "onPanelChange", "onViewDateChange"];
|
|
23
|
+
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
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); }
|
|
27
|
+
|
|
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
|
+
|
|
30
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
31
|
+
|
|
32
|
+
var MonthPanel = function MonthPanel(props) {
|
|
33
|
+
var viewDate = props.viewDate,
|
|
34
|
+
onPanelChange = props.onPanelChange,
|
|
35
|
+
onViewDateChange = props.onViewDateChange,
|
|
36
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
37
|
+
|
|
38
|
+
var onYearChange = function onYearChange(diff) {
|
|
39
|
+
if (onViewDateChange) {
|
|
40
|
+
onViewDateChange((0, _moment["default"])(viewDate).add(diff, "y"));
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
45
|
+
className: (0, _classnames["default"])("".concat(_utils.PickerPanelClass, "__month"))
|
|
46
|
+
}, /*#__PURE__*/_react["default"].createElement(_monthHead["default"], _extends({}, restProps, {
|
|
47
|
+
viewDate: viewDate,
|
|
48
|
+
onPrevYear: function onPrevYear() {
|
|
49
|
+
onYearChange(-1);
|
|
50
|
+
},
|
|
51
|
+
onNextYear: function onNextYear() {
|
|
52
|
+
onYearChange(1);
|
|
53
|
+
},
|
|
54
|
+
onYearClick: function onYearClick() {
|
|
55
|
+
onPanelChange === null || onPanelChange === void 0 ? void 0 : onPanelChange(viewDate, "year");
|
|
56
|
+
}
|
|
57
|
+
})), /*#__PURE__*/_react["default"].createElement(_monthBody["default"], _extends({
|
|
58
|
+
viewDate: viewDate
|
|
59
|
+
}, restProps)));
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
var _default = MonthPanel;
|
|
63
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
15
|
+
|
|
16
|
+
var _getLocale = require("../../../../../utils/getLocale");
|
|
17
|
+
|
|
18
|
+
var _utils = require("../../../utils");
|
|
19
|
+
|
|
20
|
+
var _context = _interopRequireDefault(require("../../../context"));
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
|
+
|
|
24
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
|
+
|
|
26
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
+
|
|
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; }
|
|
29
|
+
|
|
30
|
+
var MONTH_ROW_NUM = 4;
|
|
31
|
+
var MONTH_COL_NUM = 3;
|
|
32
|
+
|
|
33
|
+
var MonthPanelBody = function MonthPanelBody(props) {
|
|
34
|
+
var viewDate = props.viewDate,
|
|
35
|
+
onSelect = props.onSelect;
|
|
36
|
+
|
|
37
|
+
var _useContext = (0, _react.useContext)(_context["default"]),
|
|
38
|
+
value = _useContext.value,
|
|
39
|
+
mode = _useContext.mode;
|
|
40
|
+
|
|
41
|
+
var getCells = function getCells(baseMonth) {
|
|
42
|
+
var cols = [];
|
|
43
|
+
|
|
44
|
+
var _loop = function _loop(col) {
|
|
45
|
+
var _classNames;
|
|
46
|
+
|
|
47
|
+
var month = col + baseMonth;
|
|
48
|
+
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)),
|
|
50
|
+
key: month
|
|
51
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
52
|
+
onClick: function onClick() {
|
|
53
|
+
return onSelect && onSelect((0, _moment["default"])(viewDate).month(month), 'month');
|
|
54
|
+
},
|
|
55
|
+
className: (0, _classnames["default"])("".concat(_utils.PickerCellClass, "__inner")),
|
|
56
|
+
title: (0, _moment["default"])(viewDate).month(month).format('YYYY-MM')
|
|
57
|
+
}, _getLocale.isEn ? _utils.MONTHDATAMAPEN[month] : _utils.MONTHDATAMAP[month])));
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
for (var col = 0; col < MONTH_COL_NUM; col += 1) {
|
|
61
|
+
_loop(col);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return cols;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
var getRows = function getRows() {
|
|
68
|
+
var rows = [];
|
|
69
|
+
var baseMonth = 0;
|
|
70
|
+
|
|
71
|
+
for (var row = 0; row < MONTH_ROW_NUM; row += 1) {
|
|
72
|
+
rows.push( /*#__PURE__*/_react["default"].createElement("tr", {
|
|
73
|
+
key: row
|
|
74
|
+
}, getCells(baseMonth)));
|
|
75
|
+
baseMonth += MONTH_COL_NUM;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return rows;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
82
|
+
className: (0, _classnames["default"])(_utils.PickerBodyClass)
|
|
83
|
+
}, /*#__PURE__*/_react["default"].createElement("table", {
|
|
84
|
+
className: (0, _classnames["default"])("".concat(_utils.PickerClass, "-content"))
|
|
85
|
+
}, /*#__PURE__*/_react["default"].createElement("tbody", null, getRows())));
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
var _default = MonthPanelBody;
|
|
89
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
|
|
12
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
13
|
+
|
|
14
|
+
var _utils = require("../../../utils");
|
|
15
|
+
|
|
16
|
+
var _panelHead = _interopRequireDefault(require("../panel-head"));
|
|
17
|
+
|
|
18
|
+
var _excluded = ["viewDate", "onPrevYear", "onNextYear", "onYearClick"];
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
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); }
|
|
23
|
+
|
|
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
|
+
|
|
26
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
27
|
+
|
|
28
|
+
var MonthPanelHead = function MonthPanelHead(props) {
|
|
29
|
+
var _props$viewDate = props.viewDate,
|
|
30
|
+
viewDate = _props$viewDate === void 0 ? (0, _moment["default"])() : _props$viewDate,
|
|
31
|
+
onPrevYear = props.onPrevYear,
|
|
32
|
+
onNextYear = props.onNextYear,
|
|
33
|
+
onYearClick = props.onYearClick,
|
|
34
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
35
|
+
|
|
36
|
+
return /*#__PURE__*/_react["default"].createElement(_panelHead["default"], _extends({}, restProps, {
|
|
37
|
+
onPrev: onPrevYear,
|
|
38
|
+
onNext: onNextYear
|
|
39
|
+
}), /*#__PURE__*/_react["default"].createElement("button", {
|
|
40
|
+
className: (0, _classnames["default"])("".concat(_utils.PickerHeadClass, "-btn__year")),
|
|
41
|
+
onClick: onYearClick,
|
|
42
|
+
type: "button"
|
|
43
|
+
}, viewDate.year()));
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
var _default = MonthPanelHead;
|
|
47
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
|
|
12
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
13
|
+
|
|
14
|
+
var React = _interopRequireWildcard(require("react"));
|
|
15
|
+
|
|
16
|
+
var _utils = require("../../../utils");
|
|
17
|
+
|
|
18
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
+
|
|
20
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
26
|
+
var PanelBody = function PanelBody(props) {
|
|
27
|
+
var rowNum = props.rowNum,
|
|
28
|
+
colNum = props.colNum;
|
|
29
|
+
var rows = [];
|
|
30
|
+
var baseMonth = 0;
|
|
31
|
+
|
|
32
|
+
for (var row = 0; row < rowNum; row += 1) {
|
|
33
|
+
var cols = [];
|
|
34
|
+
|
|
35
|
+
for (var col = 0; col < colNum; col += 1) {
|
|
36
|
+
var month = col + baseMonth;
|
|
37
|
+
cols.push( /*#__PURE__*/React.createElement("td", {
|
|
38
|
+
className: (0, _classnames["default"])(_utils.PickerCellClass, "".concat(_utils.PickerCellClass, "--in-view"), _defineProperty({}, "".concat(_utils.PickerCellClass, "--this-month"), month === (0, _moment["default"])().month())),
|
|
39
|
+
key: baseMonth
|
|
40
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
41
|
+
className: (0, _classnames["default"])("".concat(_utils.PickerCellClass, "__inner"))
|
|
42
|
+
})));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
rows.push( /*#__PURE__*/React.createElement("tr", null, cols));
|
|
46
|
+
baseMonth += 3;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return /*#__PURE__*/React.createElement("div", null);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
var _default = PanelBody;
|
|
53
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
|
|
12
|
+
var React = _interopRequireWildcard(require("react"));
|
|
13
|
+
|
|
14
|
+
var _utils = require("../../../utils");
|
|
15
|
+
|
|
16
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
+
|
|
18
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
+
|
|
22
|
+
var PanelHead = function PanelHead(props) {
|
|
23
|
+
var children = props.children,
|
|
24
|
+
onPrev = props.onPrev,
|
|
25
|
+
onNext = props.onNext;
|
|
26
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
27
|
+
className: (0, _classnames["default"])(_utils.PickerHeadClass)
|
|
28
|
+
}, onPrev &&
|
|
29
|
+
/*#__PURE__*/
|
|
30
|
+
// eslint-disable-next-line jsx-a11y/control-has-associated-label
|
|
31
|
+
React.createElement("button", {
|
|
32
|
+
className: (0, _classnames["default"])("".concat(_utils.PickerHeadClass, "-btn__prev"), "tu-icon-left"),
|
|
33
|
+
onClick: onPrev,
|
|
34
|
+
type: "button"
|
|
35
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
className: (0, _classnames["default"])("".concat(_utils.PickerHeadClass, "__view"))
|
|
37
|
+
}, children), onNext &&
|
|
38
|
+
/*#__PURE__*/
|
|
39
|
+
// eslint-disable-next-line jsx-a11y/control-has-associated-label
|
|
40
|
+
React.createElement("button", {
|
|
41
|
+
className: (0, _classnames["default"])("".concat(_utils.PickerHeadClass, "-btn__next"), "tu-icon-APP-xi"),
|
|
42
|
+
onClick: onNext,
|
|
43
|
+
type: "button"
|
|
44
|
+
}));
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
var _default = PanelHead;
|
|
48
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.tita-ui__picker-panel__year .tita-ui__picker-head {
|
|
2
|
+
margin-bottom: 6px;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.tita-ui__picker-panel__year .tita-ui__picker-head__view {
|
|
6
|
+
text-align: center;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.tita-ui__picker-panel__year .tita-ui__picker-cell {
|
|
10
|
+
width: 52px;
|
|
11
|
+
height: 28px;
|
|
12
|
+
padding: 11px 21px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.tita-ui__picker-panel__year .tita-ui__picker-cell--this-year .tita-ui__picker-cell__inner, .tita-ui__picker-panel__year .tita-ui__picker-cell:hover .tita-ui__picker-cell__inner {
|
|
16
|
+
background-color: #f0f4fa;
|
|
17
|
+
color: #2879ff;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.tita-ui__picker-panel__year .tita-ui__picker-cell--selected .tita-ui__picker-cell__inner {
|
|
21
|
+
background-color: #2879ff;
|
|
22
|
+
color: #ffffff;
|
|
23
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
|
|
12
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
13
|
+
|
|
14
|
+
var _utils = require("../../../utils");
|
|
15
|
+
|
|
16
|
+
var _yearBody = _interopRequireDefault(require("./year-body"));
|
|
17
|
+
|
|
18
|
+
var _yearHead = _interopRequireDefault(require("./year-head"));
|
|
19
|
+
|
|
20
|
+
require("./index.css");
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
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); }
|
|
25
|
+
|
|
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
|
+
|
|
28
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
29
|
+
|
|
30
|
+
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; }
|
|
31
|
+
|
|
32
|
+
var YearPanel = function YearPanel(props) {
|
|
33
|
+
var onViewDateChange = props.onViewDateChange,
|
|
34
|
+
viewDate = props.viewDate;
|
|
35
|
+
var yearNumber = (0, _moment["default"])(viewDate).year();
|
|
36
|
+
|
|
37
|
+
var startYear = Math.floor(yearNumber / _utils.YEAR_DECADE_COUNT) * _utils.YEAR_DECADE_COUNT;
|
|
38
|
+
|
|
39
|
+
var endYear = startYear + _utils.YEAR_DECADE_COUNT - 1;
|
|
40
|
+
|
|
41
|
+
var onDecadeYearChange = function onDecadeYearChange(diff) {
|
|
42
|
+
if (onViewDateChange) {
|
|
43
|
+
onViewDateChange((0, _moment["default"])(viewDate).add(diff, "y"));
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
var extendProps = _objectSpread({}, _objectSpread(_objectSpread({}, props), {}, {
|
|
48
|
+
startYear: startYear,
|
|
49
|
+
endYear: endYear
|
|
50
|
+
}));
|
|
51
|
+
|
|
52
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
53
|
+
className: (0, _classnames["default"])("".concat(_utils.PickerPanelClass, "__year"))
|
|
54
|
+
}, /*#__PURE__*/_react["default"].createElement(_yearHead["default"], _extends({}, extendProps, {
|
|
55
|
+
onPrevDecadeYear: function onPrevDecadeYear() {
|
|
56
|
+
return onDecadeYearChange(-_utils.YEAR_DECADE_COUNT);
|
|
57
|
+
},
|
|
58
|
+
onNextDecadeYear: function onNextDecadeYear() {
|
|
59
|
+
return onDecadeYearChange(_utils.YEAR_DECADE_COUNT);
|
|
60
|
+
}
|
|
61
|
+
})), /*#__PURE__*/_react["default"].createElement(_yearBody["default"], extendProps));
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
var _default = YearPanel;
|
|
65
|
+
exports["default"] = _default;
|