@titaui/pc 1.11.4-0 → 1.11.4-11
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/text-avatar/index.css +7 -0
- package/lib/components/avatar/text-avatar/index.js +32 -7
- package/lib/components/button/rect-btn/index.js +7 -7
- package/lib/components/change-okr-modal/Item.js +15 -15
- package/lib/components/communication/index.js +30 -29
- package/lib/components/drawer/index.js +7 -6
- package/lib/components/dynamic/constant.js +43 -36
- package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/dynamic-footer.js +243 -0
- package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/index.js +6 -2
- 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 +6 -6
- package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.js +7 -7
- package/lib/components/dynamic/dynamic-item/dynamic-progress/index.js +11 -11
- package/lib/components/dynamic/dynamic-item/dynamic-reply/index.js +14 -14
- package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +10 -10
- package/lib/components/dynamic/dynamic-item/index.js +70 -41
- package/lib/components/dynamic/dynamic-list/index.js +5 -13
- package/lib/components/e-priority/index.js +18 -12
- package/lib/components/eReport/eReportShare/index.js +11 -11
- package/lib/components/file-list/components/single-file/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/icon-button-list/index.css +2 -57
- package/lib/components/icon-button-list/index.js +10 -7
- package/lib/components/img-viewer/index.css +10 -3
- package/lib/components/img-viewer/index.js +57 -18
- package/lib/components/mblog/index.js +31 -30
- 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 +23 -17
- package/lib/components/menus/export-modules/interview-menus/handle-highlight.js +5 -5
- package/lib/components/menus/export-modules/interview-menus/index.css +7 -0
- package/lib/components/menus/export-modules/interview-menus/index.js +5 -4
- 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/request.apis.js +3 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-priority-dropdown.js +7 -7
- package/lib/components/okr-detail/detail-header/actions.js +62 -66
- package/lib/components/okr-detail/detail-header/index.css +2 -2
- package/lib/components/okr-detail/detail-header/index.js +205 -194
- package/lib/components/okr-detail/index.js +21 -19
- package/lib/components/okr-flow/child-node/index.css +67 -21
- package/lib/components/okr-flow/child-node/work-node.js +61 -24
- package/lib/components/okr-flow/empty/index.css +8 -1
- package/lib/components/okr-flow/export-modal/index.js +42 -18
- package/lib/components/okr-flow/export-modules/okr-search-panel/index.css +3 -1
- package/lib/components/okr-flow/export-modules/okr-search-panel/index.js +30 -24
- package/lib/components/okr-flow/images/loading-light.gif +0 -0
- package/lib/components/okr-flow/okr-map/index.js +43 -22
- package/lib/components/okr-flow/request-apis.js +15 -8
- package/lib/components/okr-flow/root-node/index.css +2 -2
- package/lib/components/okr-flow/root-node/index.js +26 -25
- package/lib/components/okr-flow/utils/index.js +45 -29
- package/lib/components/okr-flow/utils/tree-handler.js +29 -18
- package/lib/components/okrcase-library/index.css +6 -4
- package/lib/components/okrcase-library/okrcases-components/submitOkr-dialog.js +36 -30
- package/lib/components/pagination/index.css +3 -3
- package/lib/components/pagination/select.css +58 -23
- package/lib/components/period-selector/index.css +9 -3
- package/lib/components/period-selector/index.js +14 -11
- package/lib/components/picker/components/panels/date-panel/date-body.js +21 -19
- package/lib/components/picker/components/panels/date-panel/date-head.js +29 -8
- package/lib/components/picker/components/panels/month-panel/month-body.js +6 -4
- package/lib/components/picker/components/picker-trigger/index.css +31 -0
- package/lib/components/picker/components/picker-trigger/index.js +24 -15
- package/lib/components/picker/picker-panels.js +1 -1
- package/lib/components/picker/picker.js +12 -13
- package/lib/components/popup/index.js +4 -4
- package/lib/components/radio/index.css +9 -9
- package/lib/components/scroll-container/index.js +423 -0
- package/lib/components/scroll-container/style.css +35 -0
- package/lib/components/scrollbar/scroll-mask/index.js +1 -1
- package/lib/components/superset-charts/components/chart/index.js +1 -1
- package/lib/components/superset-charts/utils/axios.js +5 -13
- package/lib/components/survey-model/contact.js +93 -0
- package/lib/components/survey-model/index.css +141 -0
- package/lib/components/survey-model/index.js +265 -0
- package/lib/components/survey-model/instance.js +86 -0
- package/lib/components/survey-model/request-api.js +80 -0
- 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 +24 -0
- package/lib/components/time-picker/time-picker-selector.js +8 -12
- package/lib/components/time-picker/time-picker.js +136 -108
- package/lib/components/time-picker/utils.js +13 -2
- package/lib/components/user-selector/select-tree/tree-nodes/tree-person-node/index.css +1 -0
- package/lib/components/wechat-btn/index.css +14 -0
- package/lib/components/wechat-btn/index.js +338 -0
- package/lib/components-v1/radio/radio.js +3 -3
- package/lib/components-v1/radio/style/index.css +8 -8
- package/lib/index.js +99 -91
- package/lib/pages/okr-map/export-modules/okr-map/header/index.css +7 -2
- package/lib/pages/okr-map/export-modules/okr-map/header/index.js +73 -34
- package/lib/pages/okr-map/export-modules/okr-map/okr-map.js +65 -42
- package/lib/pages/okr-map/export-modules/share-okr-page/header/index.css +26 -14
- package/lib/pages/okr-map/export-modules/share-okr-page/header/index.js +58 -13
- package/lib/pages/okr-map/export-modules/share-okr-page/share-okr-map.js +28 -20
- package/lib/pages/okr-map/number-select/index.css +12 -9
- package/lib/pages/okr-map/number-select/index.js +3 -3
- package/lib/utils/auth.js +65 -8
- package/lib/utils/bs-global.js +18 -6
- package/lib/utils/open-data.js +63 -43
- package/package.json +6 -2
- 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/yarn-error.log +0 -22184
|
@@ -13,6 +13,8 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
13
13
|
|
|
14
14
|
var _moment = _interopRequireDefault(require("moment"));
|
|
15
15
|
|
|
16
|
+
var _getLocale = require("../../../../../utils/getLocale");
|
|
17
|
+
|
|
16
18
|
var _utils = require("../../../utils");
|
|
17
19
|
|
|
18
20
|
var _context = _interopRequireDefault(require("../../../context"));
|
|
@@ -33,13 +35,13 @@ var DATE_ROW_NUM = 6;
|
|
|
33
35
|
var DatePanelBody = function DatePanelBody(props) {
|
|
34
36
|
var viewDate = props.viewDate,
|
|
35
37
|
_props$weekStartDay = props.weekStartDay,
|
|
36
|
-
weekStartDay = _props$weekStartDay === void 0 ?
|
|
38
|
+
weekStartDay = _props$weekStartDay === void 0 ? 'SUNDAY' : _props$weekStartDay,
|
|
37
39
|
onSelect = props.onSelect;
|
|
38
40
|
|
|
39
41
|
var _useContext = (0, _react.useContext)(_context["default"]),
|
|
40
42
|
value = _useContext.value;
|
|
41
43
|
|
|
42
|
-
var weekStartDaySun = weekStartDay ===
|
|
44
|
+
var weekStartDaySun = weekStartDay === 'SUNDAY';
|
|
43
45
|
|
|
44
46
|
var getCells = function getCells(sunday, currentMonth) {
|
|
45
47
|
var dates = [];
|
|
@@ -47,16 +49,16 @@ var DatePanelBody = function DatePanelBody(props) {
|
|
|
47
49
|
var _loop = function _loop(day) {
|
|
48
50
|
var _classNames;
|
|
49
51
|
|
|
50
|
-
var date = (0, _moment["default"])(sunday).add(day,
|
|
51
|
-
var classes = (0, _classnames["default"])(_utils.PickerCellClass, (_classNames = {}, _defineProperty(_classNames, "".concat(_utils.PickerCellClass, "--tody"), date.isSame((0, _moment["default"])(),
|
|
52
|
+
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));
|
|
52
54
|
dates.push( /*#__PURE__*/_react["default"].createElement("td", {
|
|
53
55
|
className: classes,
|
|
54
|
-
key: date.format(
|
|
56
|
+
key: date.format('YYYY/MM/DD')
|
|
55
57
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
56
58
|
className: (0, _classnames["default"])("".concat(_utils.PickerCellClass, "__inner")),
|
|
57
|
-
title: date.format(
|
|
59
|
+
title: date.format('YYYY-MM-DD'),
|
|
58
60
|
onClick: function onClick() {
|
|
59
|
-
return onSelect && onSelect(date,
|
|
61
|
+
return onSelect && onSelect(date, 'date');
|
|
60
62
|
}
|
|
61
63
|
}, date.date())));
|
|
62
64
|
};
|
|
@@ -71,16 +73,16 @@ var DatePanelBody = function DatePanelBody(props) {
|
|
|
71
73
|
var getRows = function getRows(date) {
|
|
72
74
|
var currentDate = (0, _moment["default"])(date);
|
|
73
75
|
var monthFirstDay = currentDate.date(1);
|
|
74
|
-
var currentMonth = monthFirstDay.format(
|
|
76
|
+
var currentMonth = monthFirstDay.format('YYYYMM');
|
|
75
77
|
var daysDiff = weekStartDaySun ? 0 : 1;
|
|
76
|
-
var weekStartDay = monthFirstDay.subtract(monthFirstDay.day() - daysDiff,
|
|
78
|
+
var weekStartDay = monthFirstDay.subtract(monthFirstDay.day() - daysDiff, 'days');
|
|
77
79
|
var rows = [];
|
|
78
80
|
|
|
79
81
|
for (var row = 0; row < DATE_ROW_NUM; row += 1) {
|
|
80
82
|
rows.push( /*#__PURE__*/_react["default"].createElement("tr", {
|
|
81
83
|
key: row
|
|
82
84
|
}, getCells(weekStartDay, currentMonth)));
|
|
83
|
-
weekStartDay = weekStartDay.add(1,
|
|
85
|
+
weekStartDay = weekStartDay.add(1, 'w');
|
|
84
86
|
}
|
|
85
87
|
|
|
86
88
|
return rows;
|
|
@@ -92,25 +94,25 @@ var DatePanelBody = function DatePanelBody(props) {
|
|
|
92
94
|
className: (0, _classnames["default"])("".concat(_utils.PickerClass, "-content"))
|
|
93
95
|
}, /*#__PURE__*/_react["default"].createElement("thead", null, /*#__PURE__*/_react["default"].createElement("tr", null, weekStartDaySun && /*#__PURE__*/_react["default"].createElement("th", {
|
|
94
96
|
className: _utils.PickerCellClass
|
|
95
|
-
},
|
|
97
|
+
}, (0, _getLocale.getLocale)('Mod_Sun')), /*#__PURE__*/_react["default"].createElement("th", {
|
|
96
98
|
className: _utils.PickerCellClass
|
|
97
|
-
},
|
|
99
|
+
}, (0, _getLocale.getLocale)('Mod_Mon')), /*#__PURE__*/_react["default"].createElement("th", {
|
|
98
100
|
className: _utils.PickerCellClass
|
|
99
|
-
},
|
|
101
|
+
}, (0, _getLocale.getLocale)('Mod_Tues')), /*#__PURE__*/_react["default"].createElement("th", {
|
|
100
102
|
className: _utils.PickerCellClass
|
|
101
|
-
},
|
|
103
|
+
}, (0, _getLocale.getLocale)('Mod_Wed')), /*#__PURE__*/_react["default"].createElement("th", {
|
|
102
104
|
className: _utils.PickerCellClass
|
|
103
|
-
},
|
|
105
|
+
}, (0, _getLocale.getLocale)('Mod_Thur')), /*#__PURE__*/_react["default"].createElement("th", {
|
|
104
106
|
className: _utils.PickerCellClass
|
|
105
|
-
},
|
|
107
|
+
}, (0, _getLocale.getLocale)('Mod_Fri')), /*#__PURE__*/_react["default"].createElement("th", {
|
|
106
108
|
className: _utils.PickerCellClass
|
|
107
|
-
},
|
|
109
|
+
}, (0, _getLocale.getLocale)('Mod_Sat')), weekStartDay !== 'SUNDAY' && /*#__PURE__*/_react["default"].createElement("th", {
|
|
108
110
|
className: _utils.PickerCellClass
|
|
109
|
-
},
|
|
111
|
+
}, (0, _getLocale.getLocale)('Mod_Sun')))), /*#__PURE__*/_react["default"].createElement("tbody", null, getRows((0, _moment["default"])(viewDate)))));
|
|
110
112
|
};
|
|
111
113
|
|
|
112
114
|
DatePanelBody.defaultProps = {
|
|
113
|
-
weekStartDay:
|
|
115
|
+
weekStartDay: 'SUNDAY'
|
|
114
116
|
};
|
|
115
117
|
var _default = DatePanelBody;
|
|
116
118
|
exports["default"] = _default;
|
|
@@ -11,6 +11,8 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
11
11
|
|
|
12
12
|
var _moment = _interopRequireDefault(require("moment"));
|
|
13
13
|
|
|
14
|
+
var _getLocale = require("../../../../../utils/getLocale");
|
|
15
|
+
|
|
14
16
|
var _utils = require("../../../utils");
|
|
15
17
|
|
|
16
18
|
require("./index.css");
|
|
@@ -23,40 +25,59 @@ function DatePanelHead(props) {
|
|
|
23
25
|
onPrev = props.onPrev,
|
|
24
26
|
onNext = props.onNext,
|
|
25
27
|
onPanelChange = props.onPanelChange;
|
|
28
|
+
var yearText = (0, _moment["default"])(viewDate).format('YYYY');
|
|
29
|
+
var monthText = (0, _moment["default"])(viewDate).format('MM');
|
|
26
30
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
27
31
|
className: (0, _classnames["default"])(_utils.PickerHeadClass)
|
|
28
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
32
|
+
}, !_getLocale.isEn && /*#__PURE__*/_react["default"].createElement("div", {
|
|
29
33
|
className: (0, _classnames["default"])("".concat(_utils.PickerHeadClass, "__view"))
|
|
30
34
|
}, /*#__PURE__*/_react["default"].createElement("button", {
|
|
31
35
|
className: (0, _classnames["default"])("".concat(_utils.PickerHeadClass, "-btn__year")),
|
|
32
36
|
onClick: function onClick() {
|
|
33
|
-
return onPanelChange && onPanelChange(viewDate,
|
|
37
|
+
return onPanelChange && onPanelChange(viewDate, 'year');
|
|
34
38
|
},
|
|
35
39
|
type: "button"
|
|
36
|
-
},
|
|
40
|
+
}, yearText), /*#__PURE__*/_react["default"].createElement("span", {
|
|
37
41
|
className: (0, _classnames["default"])("".concat(_utils.PickerClass, "-unit"))
|
|
38
42
|
}, "\xA0\u5E74"), /*#__PURE__*/_react["default"].createElement("button", {
|
|
39
43
|
className: (0, _classnames["default"])("".concat(_utils.PickerHeadClass, "-btn__month")),
|
|
40
44
|
onClick: function onClick() {
|
|
41
|
-
return onPanelChange && onPanelChange(viewDate,
|
|
45
|
+
return onPanelChange && onPanelChange(viewDate, 'month');
|
|
42
46
|
},
|
|
43
47
|
type: "button"
|
|
44
|
-
},
|
|
48
|
+
}, monthText), /*#__PURE__*/_react["default"].createElement("span", {
|
|
45
49
|
className: (0, _classnames["default"])("".concat(_utils.PickerClass, "-unit"))
|
|
46
|
-
}, "\u6708")), /*#__PURE__*/_react["default"].createElement("div", {
|
|
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", {
|
|
47
68
|
className: (0, _classnames["default"])("".concat(_utils.PickerHeadClass, "__operation"))
|
|
48
69
|
},
|
|
49
70
|
/*#__PURE__*/
|
|
50
71
|
// eslint-disable-next-line jsx-a11y/control-has-associated-label
|
|
51
72
|
_react["default"].createElement("button", {
|
|
52
|
-
className: (0, _classnames["default"])("".concat(_utils.PickerHeadClass, "-btn__prev"),
|
|
73
|
+
className: (0, _classnames["default"])("".concat(_utils.PickerHeadClass, "-btn__prev"), 'tu-icon-arrow-up1'),
|
|
53
74
|
onClick: onPrev,
|
|
54
75
|
type: "button"
|
|
55
76
|
}),
|
|
56
77
|
/*#__PURE__*/
|
|
57
78
|
// eslint-disable-next-line jsx-a11y/control-has-associated-label
|
|
58
79
|
_react["default"].createElement("button", {
|
|
59
|
-
className: (0, _classnames["default"])("".concat(_utils.PickerHeadClass, "-btn__next"),
|
|
80
|
+
className: (0, _classnames["default"])("".concat(_utils.PickerHeadClass, "-btn__next"), 'tu-icon-arrow-down1'),
|
|
60
81
|
onClick: onNext,
|
|
61
82
|
type: "button"
|
|
62
83
|
})));
|
|
@@ -13,6 +13,8 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
13
13
|
|
|
14
14
|
var _moment = _interopRequireDefault(require("moment"));
|
|
15
15
|
|
|
16
|
+
var _getLocale = require("../../../../../utils/getLocale");
|
|
17
|
+
|
|
16
18
|
var _utils = require("../../../utils");
|
|
17
19
|
|
|
18
20
|
var _context = _interopRequireDefault(require("../../../context"));
|
|
@@ -44,15 +46,15 @@ var MonthPanelBody = function MonthPanelBody(props) {
|
|
|
44
46
|
|
|
45
47
|
var month = col + baseMonth;
|
|
46
48
|
cols.push( /*#__PURE__*/_react["default"].createElement("td", {
|
|
47
|
-
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 ===
|
|
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
50
|
key: month
|
|
49
51
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
50
52
|
onClick: function onClick() {
|
|
51
|
-
return onSelect && onSelect((0, _moment["default"])(viewDate).month(month),
|
|
53
|
+
return onSelect && onSelect((0, _moment["default"])(viewDate).month(month), 'month');
|
|
52
54
|
},
|
|
53
55
|
className: (0, _classnames["default"])("".concat(_utils.PickerCellClass, "__inner")),
|
|
54
|
-
title: (0, _moment["default"])(viewDate).month(month).format(
|
|
55
|
-
}, _utils.MONTHDATAMAP[month])));
|
|
56
|
+
title: (0, _moment["default"])(viewDate).month(month).format('YYYY-MM')
|
|
57
|
+
}, _getLocale.isEn ? _utils.MONTHDATAMAPEN[month] : _utils.MONTHDATAMAP[month])));
|
|
56
58
|
};
|
|
57
59
|
|
|
58
60
|
for (var col = 0; col < MONTH_COL_NUM; col += 1) {
|
|
@@ -24,3 +24,34 @@
|
|
|
24
24
|
font-weight: normal;
|
|
25
25
|
color: #3f4755;
|
|
26
26
|
}
|
|
27
|
+
|
|
28
|
+
.tita-ui__picker-trigger__input--placeholder {
|
|
29
|
+
color: #bfc7d5;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.tita-ui__picker-trigger__operation {
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.tita-ui__picker-trigger__operation .tu-icon-caret-down {
|
|
38
|
+
font-size: 16px;
|
|
39
|
+
color: #3f4755;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.tita-ui__picker-trigger__operation .tu-icon-caret-down::before {
|
|
43
|
+
transform: scale(0.5);
|
|
44
|
+
display: inline-block;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.tita-ui__picker-trigger--disabled {
|
|
48
|
+
cursor: not-allowed;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.tita-ui__picker-trigger--disabled:hover {
|
|
52
|
+
border-color: #e9ecf0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.tita-ui__picker-trigger--disabled .tita-ui__picker-trigger__input {
|
|
56
|
+
cursor: not-allowed;
|
|
57
|
+
}
|
|
@@ -23,6 +23,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
23
23
|
|
|
24
24
|
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; }
|
|
25
25
|
|
|
26
|
+
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
|
+
|
|
26
28
|
var PickerTrigger = function PickerTrigger(props) {
|
|
27
29
|
var children = props.children,
|
|
28
30
|
viewDate = props.viewDate,
|
|
@@ -30,25 +32,27 @@ var PickerTrigger = function PickerTrigger(props) {
|
|
|
30
32
|
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
31
33
|
_props$allowClear = props.allowClear,
|
|
32
34
|
allowClear = _props$allowClear === void 0 ? false : _props$allowClear,
|
|
33
|
-
|
|
35
|
+
placeholder = props.placeholder,
|
|
36
|
+
_onClick = props.onClick;
|
|
34
37
|
|
|
35
38
|
var _useContext = (0, _react.useContext)(_context["default"]),
|
|
36
39
|
mode = _useContext.mode,
|
|
37
|
-
format = _useContext.format
|
|
40
|
+
format = _useContext.format,
|
|
41
|
+
value = _useContext.value;
|
|
38
42
|
|
|
39
43
|
var currFormat = format;
|
|
40
44
|
|
|
41
45
|
switch (mode) {
|
|
42
|
-
case
|
|
43
|
-
currFormat =
|
|
46
|
+
case 'date':
|
|
47
|
+
currFormat = 'YYYY/MM/DD';
|
|
44
48
|
break;
|
|
45
49
|
|
|
46
|
-
case
|
|
47
|
-
currFormat =
|
|
50
|
+
case 'month':
|
|
51
|
+
currFormat = 'YYYY/MM';
|
|
48
52
|
break;
|
|
49
53
|
|
|
50
|
-
case
|
|
51
|
-
currFormat =
|
|
54
|
+
case 'year':
|
|
55
|
+
currFormat = 'YYYY';
|
|
52
56
|
break;
|
|
53
57
|
|
|
54
58
|
default:
|
|
@@ -60,16 +64,20 @@ var PickerTrigger = function PickerTrigger(props) {
|
|
|
60
64
|
/*#__PURE__*/
|
|
61
65
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
62
66
|
_react["default"].createElement(_react["default"].Fragment, null, children ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
63
|
-
onClick: onClick
|
|
67
|
+
onClick: function onClick() {
|
|
68
|
+
return !disabled && _onClick();
|
|
69
|
+
}
|
|
64
70
|
}, children) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
65
|
-
className: (0, _classnames["default"])(_utils.PickerTriggerClass),
|
|
66
|
-
onClick: onClick
|
|
71
|
+
className: (0, _classnames["default"])(_utils.PickerTriggerClass, _defineProperty({}, "".concat(_utils.PickerTriggerClass, "--disabled"), disabled)),
|
|
72
|
+
onClick: function onClick() {
|
|
73
|
+
return !disabled && _onClick();
|
|
74
|
+
}
|
|
67
75
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
68
|
-
className: (0, _classnames["default"])("".concat(_utils.PickerTriggerClass, "__input"))
|
|
69
|
-
}, viewDate.format(currFormat)), /*#__PURE__*/_react["default"].createElement("div", {
|
|
76
|
+
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", {
|
|
70
78
|
className: (0, _classnames["default"])("".concat(_utils.PickerTriggerClass, "__operation"))
|
|
71
79
|
}, !disabled && /*#__PURE__*/_react["default"].createElement("span", {
|
|
72
|
-
className: "tu-icon-
|
|
80
|
+
className: "tu-icon-caret-down"
|
|
73
81
|
}), allowClear && !disabled && /*#__PURE__*/_react["default"].createElement("span", {
|
|
74
82
|
className: "tu-icon-circle"
|
|
75
83
|
}))))
|
|
@@ -79,7 +87,8 @@ var PickerTrigger = function PickerTrigger(props) {
|
|
|
79
87
|
PickerTrigger.defaultProps = {
|
|
80
88
|
children: null,
|
|
81
89
|
disabled: false,
|
|
82
|
-
allowClear: false
|
|
90
|
+
allowClear: false,
|
|
91
|
+
placeholder: '请选择'
|
|
83
92
|
};
|
|
84
93
|
var _default = PickerTrigger;
|
|
85
94
|
exports["default"] = _default;
|
|
@@ -52,7 +52,7 @@ var PickerPanels = function PickerPanels(props) {
|
|
|
52
52
|
pickerMode = _useState2[0],
|
|
53
53
|
setPickerMode = _useState2[1];
|
|
54
54
|
|
|
55
|
-
var _useState3 = (0, _react.useState)((0, _moment["default"])(value)),
|
|
55
|
+
var _useState3 = (0, _react.useState)(value ? (0, _moment["default"])(value) : (0, _moment["default"])()),
|
|
56
56
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
57
57
|
viewDate = _useState4[0],
|
|
58
58
|
setViewDate = _useState4[1];
|
|
@@ -25,7 +25,7 @@ var _utils = require("./utils");
|
|
|
25
25
|
|
|
26
26
|
require("./index.css");
|
|
27
27
|
|
|
28
|
-
var _excluded = ["onChange", "format", "value", "mode", "children", "popupPlacement", "direction", "visible"];
|
|
28
|
+
var _excluded = ["onChange", "format", "value", "mode", "children", "popupPlacement", "direction", "onPopupVisibleChange", "visible"];
|
|
29
29
|
|
|
30
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
31
31
|
|
|
@@ -35,12 +35,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
35
35
|
|
|
36
36
|
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); }
|
|
37
37
|
|
|
38
|
-
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; }
|
|
39
|
-
|
|
40
|
-
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; }
|
|
41
|
-
|
|
42
|
-
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; }
|
|
43
|
-
|
|
44
38
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
45
39
|
|
|
46
40
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -65,6 +59,7 @@ var Picker = function Picker(props) {
|
|
|
65
59
|
children = props.children,
|
|
66
60
|
popupPlacement = props.popupPlacement,
|
|
67
61
|
direction = props.direction,
|
|
62
|
+
onPopupVisibleChange = props.onPopupVisibleChange,
|
|
68
63
|
_props$visible = props.visible,
|
|
69
64
|
visible = _props$visible === void 0 ? false : _props$visible,
|
|
70
65
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
@@ -92,15 +87,18 @@ var Picker = function Picker(props) {
|
|
|
92
87
|
setPopupVisible(false);
|
|
93
88
|
};
|
|
94
89
|
|
|
90
|
+
var handlePopupVisibleChange = function handlePopupVisibleChange(visible) {
|
|
91
|
+
setPopupVisible(visible);
|
|
92
|
+
onPopupVisibleChange === null || onPopupVisibleChange === void 0 ? void 0 : onPopupVisibleChange(visible);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
95
|
return /*#__PURE__*/_react["default"].createElement(_context["default"].Provider, {
|
|
96
96
|
value: {
|
|
97
97
|
value: value,
|
|
98
98
|
mode: mode || "date",
|
|
99
99
|
format: format
|
|
100
100
|
}
|
|
101
|
-
}, /*#__PURE__*/_react["default"].createElement(_popup["default"], _extends({
|
|
102
|
-
viewDate: (0, _moment["default"])(value)
|
|
103
|
-
}), {
|
|
101
|
+
}, /*#__PURE__*/_react["default"].createElement(_popup["default"], _extends({
|
|
104
102
|
extraClass: (0, _classnames["default"])(_utils.PickerDropdownClass),
|
|
105
103
|
popup: /*#__PURE__*/_react["default"].createElement(_pickerPanels["default"], _extends({
|
|
106
104
|
value: value,
|
|
@@ -111,16 +109,17 @@ var Picker = function Picker(props) {
|
|
|
111
109
|
})),
|
|
112
110
|
popupVisible: popupVisible,
|
|
113
111
|
popupPlacement: getPopupPlacement(),
|
|
114
|
-
onPopupVisibleChange:
|
|
115
|
-
}), /*#__PURE__*/_react["default"].createElement(_pickerTrigger["default"], {
|
|
112
|
+
onPopupVisibleChange: handlePopupVisibleChange
|
|
113
|
+
}, restProps), /*#__PURE__*/_react["default"].createElement(_pickerTrigger["default"], _extends({
|
|
116
114
|
viewDate: (0, _moment["default"])(value),
|
|
117
115
|
onClick: function onClick() {
|
|
118
116
|
return setPopupVisible(true);
|
|
119
117
|
}
|
|
120
|
-
}, children)));
|
|
118
|
+
}, restProps), children)));
|
|
121
119
|
};
|
|
122
120
|
|
|
123
121
|
Picker.defaultProps = {
|
|
122
|
+
children: null,
|
|
124
123
|
value: (0, _moment["default"])(),
|
|
125
124
|
mode: "date",
|
|
126
125
|
format: "YYYY/MM/DD",
|
|
@@ -43,19 +43,19 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
43
43
|
|
|
44
44
|
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; }
|
|
45
45
|
|
|
46
|
-
var preCls =
|
|
46
|
+
var preCls = 'titaui-popup';
|
|
47
47
|
|
|
48
48
|
var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
49
49
|
var _props$extraClass = props.extraClass,
|
|
50
|
-
extraClass = _props$extraClass === void 0 ?
|
|
50
|
+
extraClass = _props$extraClass === void 0 ? '' : _props$extraClass,
|
|
51
51
|
_props$mask = props.mask,
|
|
52
52
|
mask = _props$mask === void 0 ? true : _props$mask,
|
|
53
53
|
_props$destroyPopupOn = props.destroyPopupOnHide,
|
|
54
54
|
destroyPopupOnHide = _props$destroyPopupOn === void 0 ? true : _props$destroyPopupOn,
|
|
55
55
|
_props$action = props.action,
|
|
56
|
-
action = _props$action === void 0 ? [
|
|
56
|
+
action = _props$action === void 0 ? ['click'] : _props$action,
|
|
57
57
|
_props$popupPlacement = props.popupPlacement,
|
|
58
|
-
popupPlacement = _props$popupPlacement === void 0 ?
|
|
58
|
+
popupPlacement = _props$popupPlacement === void 0 ? 'bottomRight' : _props$popupPlacement,
|
|
59
59
|
_props$builtinPlaceme = props.builtinPlacements,
|
|
60
60
|
builtinPlacements = _props$builtinPlaceme === void 0 ? _placement["default"] : _props$builtinPlaceme,
|
|
61
61
|
_props$popupVisible = props.popupVisible,
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
.titaui-radio-wrapper .titaui-radio {
|
|
17
17
|
display: inline-block;
|
|
18
18
|
position: relative;
|
|
19
|
-
top:
|
|
19
|
+
top: 1px;
|
|
20
20
|
width: 16px;
|
|
21
21
|
min-width: 16px;
|
|
22
22
|
height: 16px;
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
margin-right: 5px;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
.titaui-radio-wrapper .titaui-radio input[type=
|
|
27
|
+
.titaui-radio-wrapper .titaui-radio input[type='radio'] {
|
|
28
28
|
width: 16px;
|
|
29
29
|
height: 16px;
|
|
30
30
|
}
|
|
@@ -50,14 +50,14 @@
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
.titaui-radio-wrapper .titaui-radio .titaui-radio-inner::after {
|
|
53
|
-
content:
|
|
53
|
+
content: '';
|
|
54
54
|
position: absolute;
|
|
55
|
-
top:
|
|
56
|
-
left:
|
|
57
|
-
width:
|
|
58
|
-
min-width:
|
|
59
|
-
height:
|
|
60
|
-
min-height:
|
|
55
|
+
top: 2px;
|
|
56
|
+
left: 2px;
|
|
57
|
+
width: 10px;
|
|
58
|
+
min-width: 10px;
|
|
59
|
+
height: 10px;
|
|
60
|
+
min-height: 10px;
|
|
61
61
|
border-radius: 50%;
|
|
62
62
|
background-color: #1687d9;
|
|
63
63
|
transform: scale(0);
|