@titaui/pc 1.11.2 → 1.11.3-2.beta-1
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/icon-btn/index.js +17 -8
- 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/drop-selector/index.js +25 -10
- 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 +12 -12
- 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/grid-layout/sub-employee-okr/person-okr.js +11 -5
- 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/components/MblogContent.js +5 -2
- 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 +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/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/components/okr-tree/tree-node/kr-node/index.js +3 -2
- 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 +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-detail/okr-list/index.js +5 -3
- 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 +63 -21
- 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/okr-progress-modal/index.css +1 -1
- 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 +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/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 +268 -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 +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/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 +101 -77
- package/lib/pages/aha2021/index.js +5 -1
- 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/hooks.js +72 -0
- 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
|
@@ -0,0 +1,182 @@
|
|
|
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 _moment = _interopRequireDefault(require("moment"));
|
|
13
|
+
|
|
14
|
+
var _datePanel = _interopRequireDefault(require("./components/panels/date-panel"));
|
|
15
|
+
|
|
16
|
+
var _monthPanel = _interopRequireDefault(require("./components/panels/month-panel"));
|
|
17
|
+
|
|
18
|
+
var _yearPanel = _interopRequireDefault(require("./components/panels/year-panel"));
|
|
19
|
+
|
|
20
|
+
var _utils = require("./utils");
|
|
21
|
+
|
|
22
|
+
require("./index.css");
|
|
23
|
+
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
|
+
|
|
26
|
+
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); }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
30
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
31
|
+
|
|
32
|
+
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."); }
|
|
33
|
+
|
|
34
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
35
|
+
|
|
36
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
37
|
+
|
|
38
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
39
|
+
|
|
40
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
41
|
+
|
|
42
|
+
var PickerPanels = function PickerPanels(props) {
|
|
43
|
+
var _props$mode = props.mode,
|
|
44
|
+
mode = _props$mode === void 0 ? "date" : _props$mode,
|
|
45
|
+
onChange = props.onChange,
|
|
46
|
+
onClose = props.onClose,
|
|
47
|
+
_props$value = props.value,
|
|
48
|
+
value = _props$value === void 0 ? (0, _moment["default"])() : _props$value;
|
|
49
|
+
|
|
50
|
+
var _useState = (0, _react.useState)(mode),
|
|
51
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
52
|
+
pickerMode = _useState2[0],
|
|
53
|
+
setPickerMode = _useState2[1];
|
|
54
|
+
|
|
55
|
+
var _useState3 = (0, _react.useState)(value ? (0, _moment["default"])(value) : (0, _moment["default"])()),
|
|
56
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
57
|
+
viewDate = _useState4[0],
|
|
58
|
+
setViewDate = _useState4[1];
|
|
59
|
+
|
|
60
|
+
var onViewDateChange = function onViewDateChange(date) {
|
|
61
|
+
setViewDate(function () {
|
|
62
|
+
return date;
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
var onPanelChange = function onPanelChange(viewDate, type) {
|
|
67
|
+
setPickerMode(function () {
|
|
68
|
+
return type;
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
var onCloseHandler = function onCloseHandler() {
|
|
73
|
+
if (pickerMode === mode) {
|
|
74
|
+
if (onClose) {
|
|
75
|
+
onClose();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
var onDateSelect = function onDateSelect(date) {
|
|
81
|
+
if (onChange) {
|
|
82
|
+
onChange(date);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
onCloseHandler();
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
var onMonthSelect = function onMonthSelect(date) {
|
|
89
|
+
setViewDate(function () {
|
|
90
|
+
return date;
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
if (mode !== "month") {
|
|
94
|
+
onPanelChange(date, "date");
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (onChange) {
|
|
98
|
+
onChange(date);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
onCloseHandler();
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
var onYearSelect = function onYearSelect(date) {
|
|
105
|
+
setViewDate(function () {
|
|
106
|
+
return date;
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
if (mode !== "year") {
|
|
110
|
+
onPanelChange(date, "month");
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (onChange) {
|
|
114
|
+
onChange(date);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
onCloseHandler();
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
var onSelectChange = function onSelectChange(date, type) {
|
|
121
|
+
switch (type) {
|
|
122
|
+
case "date":
|
|
123
|
+
onDateSelect(date);
|
|
124
|
+
break;
|
|
125
|
+
|
|
126
|
+
case "month":
|
|
127
|
+
onMonthSelect(date);
|
|
128
|
+
break;
|
|
129
|
+
|
|
130
|
+
case "year":
|
|
131
|
+
onYearSelect(date);
|
|
132
|
+
break;
|
|
133
|
+
|
|
134
|
+
default:
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
|
|
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
|
+
}
|
|
171
|
+
|
|
172
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
173
|
+
className: _utils.PickerClass
|
|
174
|
+
}, panel);
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
PickerPanels.defaultProps = {
|
|
178
|
+
mode: "date",
|
|
179
|
+
value: (0, _moment["default"])()
|
|
180
|
+
};
|
|
181
|
+
var _default = PickerPanels;
|
|
182
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,132 @@
|
|
|
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 _popup = _interopRequireDefault(require("../popup"));
|
|
17
|
+
|
|
18
|
+
var _pickerPanels = _interopRequireDefault(require("./picker-panels"));
|
|
19
|
+
|
|
20
|
+
var _pickerTrigger = _interopRequireDefault(require("./components/picker-trigger"));
|
|
21
|
+
|
|
22
|
+
var _context = _interopRequireDefault(require("./context"));
|
|
23
|
+
|
|
24
|
+
var _utils = require("./utils");
|
|
25
|
+
|
|
26
|
+
require("./index.css");
|
|
27
|
+
|
|
28
|
+
var _excluded = ["onChange", "format", "value", "mode", "children", "popupPlacement", "direction", "onPopupVisibleChange", "visible"];
|
|
29
|
+
|
|
30
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
31
|
+
|
|
32
|
+
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); }
|
|
33
|
+
|
|
34
|
+
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; }
|
|
35
|
+
|
|
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
|
+
|
|
38
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
39
|
+
|
|
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."); }
|
|
41
|
+
|
|
42
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
43
|
+
|
|
44
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
45
|
+
|
|
46
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
47
|
+
|
|
48
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
49
|
+
|
|
50
|
+
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; }
|
|
51
|
+
|
|
52
|
+
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; }
|
|
53
|
+
|
|
54
|
+
var Picker = function Picker(props) {
|
|
55
|
+
var onChange = props.onChange,
|
|
56
|
+
format = props.format,
|
|
57
|
+
value = props.value,
|
|
58
|
+
mode = props.mode,
|
|
59
|
+
children = props.children,
|
|
60
|
+
popupPlacement = props.popupPlacement,
|
|
61
|
+
direction = props.direction,
|
|
62
|
+
onPopupVisibleChange = props.onPopupVisibleChange,
|
|
63
|
+
_props$visible = props.visible,
|
|
64
|
+
visible = _props$visible === void 0 ? false : _props$visible,
|
|
65
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
66
|
+
|
|
67
|
+
var _useState = (0, _react.useState)(visible),
|
|
68
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
69
|
+
popupVisible = _useState2[0],
|
|
70
|
+
setPopupVisible = _useState2[1];
|
|
71
|
+
|
|
72
|
+
var getPopupPlacement = function getPopupPlacement() {
|
|
73
|
+
if (popupPlacement !== undefined) {
|
|
74
|
+
return popupPlacement;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return direction === "rtl" ? "bottomRight" : "bottomLeft";
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
var onChangeHandler = function onChangeHandler(date) {
|
|
81
|
+
if (onChange) {
|
|
82
|
+
onChange(date);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
var onCloseHandler = function onCloseHandler() {
|
|
87
|
+
setPopupVisible(false);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
var handlePopupVisibleChange = function handlePopupVisibleChange(visible) {
|
|
91
|
+
setPopupVisible(visible);
|
|
92
|
+
onPopupVisibleChange === null || onPopupVisibleChange === void 0 ? void 0 : onPopupVisibleChange(visible);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
return /*#__PURE__*/_react["default"].createElement(_context["default"].Provider, {
|
|
96
|
+
value: {
|
|
97
|
+
value: value,
|
|
98
|
+
mode: mode || "date",
|
|
99
|
+
format: format
|
|
100
|
+
}
|
|
101
|
+
}, /*#__PURE__*/_react["default"].createElement(_popup["default"], _extends({
|
|
102
|
+
extraClass: (0, _classnames["default"])(_utils.PickerDropdownClass),
|
|
103
|
+
popup: /*#__PURE__*/_react["default"].createElement(_pickerPanels["default"], _extends({
|
|
104
|
+
value: value,
|
|
105
|
+
mode: mode
|
|
106
|
+
}, restProps, {
|
|
107
|
+
onChange: onChangeHandler,
|
|
108
|
+
onClose: onCloseHandler
|
|
109
|
+
})),
|
|
110
|
+
popupVisible: popupVisible,
|
|
111
|
+
popupPlacement: getPopupPlacement(),
|
|
112
|
+
onPopupVisibleChange: handlePopupVisibleChange
|
|
113
|
+
}, restProps), /*#__PURE__*/_react["default"].createElement(_pickerTrigger["default"], _extends({
|
|
114
|
+
viewDate: (0, _moment["default"])(value),
|
|
115
|
+
onClick: function onClick() {
|
|
116
|
+
return setPopupVisible(true);
|
|
117
|
+
}
|
|
118
|
+
}, restProps), children)));
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
Picker.defaultProps = {
|
|
122
|
+
children: null,
|
|
123
|
+
value: (0, _moment["default"])(),
|
|
124
|
+
mode: "date",
|
|
125
|
+
format: "YYYY/MM/DD",
|
|
126
|
+
popupStyle: {},
|
|
127
|
+
popupPlacement: "bottomLeft",
|
|
128
|
+
direction: "ltr",
|
|
129
|
+
visible: false
|
|
130
|
+
};
|
|
131
|
+
var _default = Picker;
|
|
132
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.YEAR_DECADE_COUNT = exports.WEEK_DAYS_COUNT = exports.PickerTriggerClass = exports.PickerPanelClass = exports.PickerHeadClass = exports.PickerDropdownClass = exports.PickerClass = exports.PickerCellClass = exports.PickerBodyClass = exports.MONTHDATAMAPEN = exports.MONTHDATAMAP = void 0;
|
|
7
|
+
var PickerClass = "tita-ui__picker";
|
|
8
|
+
exports.PickerClass = PickerClass;
|
|
9
|
+
var PickerHeadClass = "tita-ui__picker-head";
|
|
10
|
+
exports.PickerHeadClass = PickerHeadClass;
|
|
11
|
+
var PickerBodyClass = "tita-ui__picker-body";
|
|
12
|
+
exports.PickerBodyClass = PickerBodyClass;
|
|
13
|
+
var PickerPanelClass = "tita-ui__picker-panel";
|
|
14
|
+
exports.PickerPanelClass = PickerPanelClass;
|
|
15
|
+
var PickerCellClass = "tita-ui__picker-cell";
|
|
16
|
+
exports.PickerCellClass = PickerCellClass;
|
|
17
|
+
var PickerTriggerClass = "tita-ui__picker-trigger";
|
|
18
|
+
exports.PickerTriggerClass = PickerTriggerClass;
|
|
19
|
+
var PickerDropdownClass = "tita-ui__picker-dropdown";
|
|
20
|
+
exports.PickerDropdownClass = PickerDropdownClass;
|
|
21
|
+
var MONTHDATAMAP = ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"];
|
|
22
|
+
exports.MONTHDATAMAP = MONTHDATAMAP;
|
|
23
|
+
var MONTHDATAMAPEN = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
24
|
+
exports.MONTHDATAMAPEN = MONTHDATAMAPEN;
|
|
25
|
+
var WEEK_DAYS_COUNT = 7;
|
|
26
|
+
exports.WEEK_DAYS_COUNT = WEEK_DAYS_COUNT;
|
|
27
|
+
var YEAR_DECADE_COUNT = 10;
|
|
28
|
+
exports.YEAR_DECADE_COUNT = YEAR_DECADE_COUNT;
|
|
@@ -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);
|