@titaui/pc 1.11.4-0 → 1.11.4-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/es/components/cascader/time.js +31 -0
- package/es/components/common-share/request-apis.js +56 -0
- package/es/components/confidence/heart.js +66 -0
- package/es/components/create-okr-modal/fields/index.js +17 -0
- package/es/components/create-okr-modal/utils/getCreateOkrSurpassPercent.js +154 -0
- package/es/components/date-picker/BodyItem.js +121 -0
- package/es/components/date-picker/CalendarBody.js +157 -0
- package/es/components/date-picker/CalendarHeader.js +187 -0
- package/es/components/date-picker/index.js +157 -0
- package/es/components/date-range-picker/index.js +210 -0
- package/es/components/dialog/index.js +119 -0
- package/es/components/dialog-confirm/index.js +154 -0
- package/es/components/drop-selector/icon-item.js +40 -0
- package/es/components/drop-selector/index.js +179 -0
- package/es/components/dynamic/dynamic-like-ranking/mock.js +84 -0
- package/es/components/dynamic/dynamic-liking/mock.js +83 -0
- package/es/components/dynamic/dynamic-topping/request-api.js +36 -0
- package/es/components/e-priority/index.js +88 -0
- package/es/components/e-status-dropdown/index.js +94 -0
- package/es/components/grid-layout/commen-components/index.js +73 -0
- package/es/components/grid-layout/image/could.js +8 -0
- package/es/components/grid-layout/image/lv.js +8 -0
- package/es/components/grid-layout/image/tita-mask.js +8 -0
- package/es/components/help-card/request-api.js +35 -0
- package/es/components/icon-button-list/index.js +65 -0
- package/es/components/menus/context.js +18 -0
- package/es/components/menus/precls.js +8 -0
- package/es/components/okr-detail/auth.js +197 -0
- package/es/components/okr-detail/components/ao-nice/index.js +245 -0
- package/es/components/okr-detail/components/block-line/index.js +20 -0
- package/es/components/okr-detail/components/header/index.js +211 -0
- package/es/components/okr-detail/components/icon-text/index.js +116 -0
- package/es/components/okr-detail/components/okr-tree/index.js +48 -0
- package/es/components/okr-detail/components/okr-tree/precls.js +8 -0
- package/es/components/okr-detail/components/okr-tree/tree-node/default-node.js +22 -0
- package/es/components/okr-detail/components/okr-tree/tree-node/e-node/e-priority-dropdown.js +88 -0
- package/es/components/okr-detail/components/okr-tree/tree-node/e-node/e-project.js +200 -0
- package/es/components/okr-detail/components/okr-tree/tree-node/e-node/e-status-dropdown.js +98 -0
- package/es/components/okr-detail/components/okr-tree/tree-node/e-node/e-task-level2.js +412 -0
- package/es/components/okr-detail/components/okr-tree/tree-node/get-process-color.js +62 -0
- package/es/components/okr-detail/components/okr-tree/tree-node/index.js +90 -0
- package/es/components/okr-detail/components/okr-tree/tree-node/kr-node/get-process-color.js +46 -0
- package/es/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +421 -0
- package/es/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/index.js +54 -0
- package/es/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/style.js +62 -0
- package/es/components/okr-detail/components/okr-tree/tree-node/kr-node/range-picker-pop.js +94 -0
- package/es/components/okr-detail/components/okr-tree/tree-node/kr-parent-node/index.js +273 -0
- package/es/components/okr-detail/components/okr-tree/tree-node/o-child-node/index.js +207 -0
- package/es/components/okr-detail/components/okr-tree/tree-node/o-parent-node/index.js +236 -0
- package/es/components/okr-detail/components/padding-layout.js +22 -0
- package/es/components/okr-detail/components/tab-panel-content/index.js +27 -0
- package/es/components/okr-detail/context.js +30 -0
- package/es/components/okr-detail/e-list/index.js +243 -0
- package/es/components/okr-detail/e-list/precls.js +8 -0
- package/es/components/okr-detail/e-list/search-form/fields/e-order.js +172 -0
- package/es/components/okr-detail/e-list/search-form/fields/e-status.js +99 -0
- package/es/components/okr-detail/e-list/search-form/fields/e-user.js +49 -0
- package/es/components/okr-detail/e-list/search-form/index.js +143 -0
- package/es/components/okr-detail/error-page/index.js +33 -0
- package/es/components/okr-detail/index.js +428 -0
- package/es/components/okr-detail/loading/index.js +28 -0
- package/es/components/okr-detail/okr-list/add-parent-okr.js +37 -0
- package/es/components/okr-detail/okr-list/create-kr-item/heart.js +38 -0
- package/es/components/okr-detail/okr-list/drag-order-kr.js +62 -0
- package/es/components/okr-detail/okr-list/empty/index.js +48 -0
- package/es/components/okr-detail/okr-list/index.js +524 -0
- package/es/components/okr-detail/okr-list/warp-parent-okr.js +21 -0
- package/es/components/okr-detail/store.js +1 -0
- package/es/components/okr-flow/child-node/fields/creator.js +175 -0
- package/es/components/okr-flow/child-node/fields/okrClassify.js +31 -0
- package/es/components/okr-flow/child-node/fields/okrType.js +21 -0
- package/es/components/okr-flow/child-node/helper.js +35 -0
- package/es/components/okr-flow/child-node/index.js +110 -0
- package/es/components/okr-flow/child-node/kr-node.js +75 -0
- package/es/components/okr-flow/child-node/work-node.js +242 -0
- package/es/components/okr-flow/context.js +14 -0
- package/es/components/okr-flow/empty/index.js +29 -0
- package/es/components/okr-flow/export-modules/okr-search-panel/index.js +394 -0
- package/es/components/okr-flow/index.js +24 -0
- package/es/components/okr-flow/mini-map/index.js +112 -0
- package/es/components/okr-flow/mini-map/map.js +145 -0
- package/es/components/okr-flow/mini-map/mini-node.js +57 -0
- package/es/components/okr-flow/mini-map/utils.js +79 -0
- package/es/components/okr-flow/okr-map/index.js +192 -0
- package/es/components/okr-flow/open-data/index.js +115 -0
- package/es/components/okr-flow/precls.js +8 -0
- package/es/components/okr-flow/request-apis.js +118 -0
- package/es/components/okr-flow/root-node/index.js +229 -0
- package/es/components/okr-flow/utils/config.js +18 -0
- package/es/components/okr-flow/utils/helper.js +36 -0
- package/es/components/okr-flow/utils/index.js +66 -0
- package/es/components/okr-flow/utils/tree-handler.js +323 -0
- package/es/components/okr-progress-modal/helper.js +156 -0
- package/es/components/okr-progress-modal/request-apis.js +34 -0
- package/es/components/okr-share/request-apis.js +56 -0
- package/es/components/okrcase-library/server/network.js +407 -0
- package/es/components/pagination/locale/en_US.js +22 -0
- package/es/components/pagination/locale/zh_CN.js +22 -0
- package/es/components/point-demo/drop-down-box/index.js +159 -0
- package/es/components/point-demo/index.js +533 -0
- package/es/components/point-demo/input/index.js +176 -0
- package/es/components/point-demo/point-demo.js +75 -0
- package/es/components/point-demo/popup/index.js +113 -0
- package/es/components/point-demo/popup/placement.js +44 -0
- package/es/components/range-picker-pop/index.js +273 -0
- package/es/components/scrollbar/simplebar/helpers.js +59 -0
- package/es/components/scrollbar/simplebar/index.js +91 -0
- package/es/components/scrollbar/simplebar/scrollbar-width.js +47 -0
- package/es/components/scrollbar/simplebar/simplebar.js +852 -0
- package/es/components/scrollbar/simplebar-react.js +163 -0
- package/es/components/search-dropdown/index.js +40 -0
- package/es/components/search-input/index.js +126 -0
- package/es/components/select/Option.js +94 -0
- package/es/components/select/index.js +330 -0
- package/es/components/selector-input/debounce.js +36 -0
- package/es/components/selector-input/index.js +109 -0
- package/es/components/slider-input/index.js +119 -0
- package/es/components/switch/index.js +39 -0
- package/es/components/table/index.js +275 -0
- package/es/components/tabs/index.js +63 -0
- package/es/components/task-relation-modal/tree-node/index.js +58 -0
- package/es/components/tita-chart/charts/img/could.js +8 -0
- package/es/components/tooltip/error-tip.js +24 -0
- package/es/components/tooltip/index.js +21 -0
- package/es/components/tree/index.js +79 -0
- package/es/components/tree/precls.js +8 -0
- package/es/components/upvote/request-apis.js +45 -0
- package/es/components/user-selector/action-btns/btn-cancel.js +21 -0
- package/es/components/user-selector/action-btns/btn-ok.js +21 -0
- package/es/components/user-selector/action-btns/index.js +27 -0
- package/es/components/user-selector/context.js +18 -0
- package/es/components/user-selector/empty/group.js +55 -0
- package/es/components/user-selector/empty/index.js +28 -0
- package/es/components/user-selector/export-modules/depart-search-selector/result-part.js +41 -0
- package/es/components/user-selector/export-modules/group-selector/index.js +170 -0
- package/es/components/user-selector/export-modules/group-selector/searched-panel.js +68 -0
- package/es/components/user-selector/export-modules/multiple-user-selector--bak/index.js +246 -0
- package/es/components/user-selector/index.js +25 -0
- package/es/components/user-selector/layout/index.js +25 -0
- package/es/components/user-selector/loading/index.js +18 -0
- package/es/components/user-selector/request-apis.js +180 -0
- package/es/components/user-selector/searched-panel/index.js +139 -0
- package/es/components/user-selector/searched-panel/result-part.js +43 -0
- package/es/components/user-selector/select-tree/selected-tree/index.js +91 -0
- package/es/components/user-selector/select-tree/tree-nodes/tree-depart-node/index.js +48 -0
- package/es/components/user-selector/select-tree/tree-nodes/tree-duties-node/index.js +27 -0
- package/es/components/user-selector/select-tree/tree-nodes/tree-group-node/index.js +57 -0
- package/es/components/user-selector/select-tree/tree-nodes/tree-person-node/index.js +93 -0
- package/es/components/user-selector/utils.js +139 -0
- package/es/components/viewer/ImageListRender.js +143 -0
- package/es/components/viewer/index.js +168 -0
- package/es/components/word-cloud/index.js +109 -0
- package/es/components/word-cloud/request-apis.js +26 -0
- package/es/components-v1/animate/AnimateChild.js +76 -0
- package/es/components-v1/animate/animate.js +148 -0
- package/es/components-v1/animate/index.js +13 -0
- package/es/components-v1/dom/index.js +30 -0
- package/es/components-v1/placement/index.js +13 -0
- package/es/components-v1/placement/placement.js +111 -0
- package/es/components-v1/placement/placementInner.js +139 -0
- package/es/components-v1/pop/Pop.js +246 -0
- package/es/components-v1/pop/PopInner.js +163 -0
- package/es/components-v1/pop/index.js +13 -0
- package/es/components-v1/progress/CircleProgress.js +152 -0
- package/es/components-v1/progress/LineProgress.js +83 -0
- package/es/components-v1/progress/index.js +80 -0
- package/es/components-v1/select/Option.js +94 -0
- package/es/components-v1/select/index.js +330 -0
- package/es/components-v1/utils/animate/animate.js +103 -0
- package/es/components-v1/utils/animate/event.js +79 -0
- package/es/components-v1/utils/dom/index.js +30 -0
- package/es/components-v1/utils/placement/autoAdjustPlacement.js +93 -0
- package/es/components-v1/utils/placement/getContainerVisibleArea.js +22 -0
- package/es/components-v1/utils/placement/getExpectPlacement.js +49 -0
- package/es/components-v1/utils/placement/getPlacementInContainer.js +26 -0
- package/es/components-v1/utils/placement/placement.js +76 -0
- package/es/index.js +777 -0
- package/es/pages/appointment-demo/drop-down-box/index.js +159 -0
- package/es/pages/appointment-demo/index.js +649 -0
- package/es/pages/appointment-demo/input/index.js +176 -0
- package/es/pages/appointment-demo/popup/index.js +113 -0
- package/es/pages/appointment-demo/popup/placement.js +44 -0
- package/es/pages/group-management/components/checkbox/index.js +28 -0
- package/es/pages/group-management/components/input-form/index.js +174 -0
- package/es/pages/group-management/components/radio/index.js +21 -0
- package/es/pages/group-management/components/table/index.js +174 -0
- package/es/pages/group-management/groupInterface.js +293 -0
- package/es/pages/group-management/index.js +13 -0
- package/es/pages/group-management/page-view/empty.js +111 -0
- package/es/pages/group-management/page-view/group-empty.js +66 -0
- package/es/pages/group-management/page-view/importGroupStaff/index.js +208 -0
- package/es/pages/group-management/page-view/index.js +412 -0
- package/es/pages/group-management/page-view/loading/index.js +32 -0
- package/es/pages/group-management/table/index.js +104 -0
- package/es/pages/group-management/tree/add-group-dialog/index.js +153 -0
- package/es/pages/group-management/tree/delete-group-dialog/index.js +82 -0
- package/es/pages/group-management/tree/edit-group-dialog/index.js +155 -0
- package/es/pages/group-management/tree/group-form/index.js +207 -0
- package/es/pages/group-management/tree/index.js +168 -0
- package/es/pages/group-management/tree/operation-panel.js +41 -0
- package/es/pages/group-management/tree/trigger-render.js +99 -0
- package/es/pages/like-ranking/mock.js +366 -0
- package/es/pages/okr-map/export-modules/index.js +1 -0
- package/es/pages/okr-map/export-modules/okr-map/header/index.js +182 -0
- package/es/pages/okr-map/export-modules/okr-map/header/show-kr-confirm.js +47 -0
- package/es/pages/okr-map/export-modules/okr-map/okr-map.js +497 -0
- package/es/pages/okr-map/export-modules/share-okr-page/header/index.js +69 -0
- package/es/pages/okr-map/export-modules/share-okr-page/share-okr-map.js +168 -0
- package/es/pages/okr-map/hooks/useStorage.js +96 -0
- package/es/pages/okr-map/index.js +18 -0
- package/es/pages/okr-map/level2-search/depart.js +53 -0
- package/es/pages/okr-map/level2-search/group.js +69 -0
- package/es/pages/okr-map/level2-search/index.js +51 -0
- package/es/pages/okr-map/level2-search/level2-input.js +46 -0
- package/es/pages/okr-map/level2-search/user.js +54 -0
- package/es/pages/okr-map/no-okr/index.js +24 -0
- package/es/pages/okr-map/number-select/index.js +81 -0
- package/es/pages/okr-map/open-data/index.js +115 -0
- package/es/pages/okr-map/precls.js +8 -0
- package/es/pages/okr-map/request-apis.js +76 -0
- package/es/pages/okr-map/share-dialog/index.js +122 -0
- package/es/pages/okr-map/unsupport-ie/index.js +83 -0
- package/es/pages/okr-map/utils.js +51 -0
- package/es/utils/auth.js +294 -0
- package/es/utils/bs-global.js +114 -0
- package/es/utils/local-storage.js +42 -0
- package/es/utils/mblog.js +33 -0
- package/es/utils/mock-bsglobal.js +1837 -0
- package/es/utils/open-data.js +341 -0
- package/es/utils/request-v1.js +115 -0
- package/es/utils/request.js +183 -0
- package/es/utils/tools.js +286 -0
- package/lib/components/date-picker/BodyItem.js +3 -3
- package/lib/components/date-picker/CalendarHeader.js +3 -3
- package/lib/components/delete-confirm-pop/ConfirmPop.js +3 -3
- package/lib/components/dynamic/constant.js +31 -31
- package/lib/components/dynamic/dynamic-item/dynamic-interview/img/wifi.svg +24 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview/index.css +36 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview/index.js +51 -0
- package/lib/components/dynamic/dynamic-item/dynamic-interview/interview-content.js +53 -0
- package/lib/components/dynamic/dynamic-item/index.js +40 -32
- package/lib/components/eReport/eReportLists/reportList.js +3 -3
- package/lib/components/emotions-selector/selector-pop.js +3 -3
- package/lib/components/ereport-list/index.js +3 -3
- package/lib/components/form/form-fields/date/index.css +24 -0
- package/lib/components/form/form-fields/date/index.js +98 -0
- package/lib/components/form/form-fields/user/index.css +1 -1
- package/lib/components/form/index.js +10 -3
- package/lib/components/mblog/components/MblogAction.js +3 -3
- 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.js +1 -2
- package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/edit-pop.js +3 -3
- package/lib/components/okr-review/components/ReviewItem/index.js +3 -3
- package/lib/components/okr-review/components/confirm-pop/ConfirmPop.js +3 -3
- package/lib/components/picker/components/picker-trigger/index.css +16 -0
- package/lib/components/picker/components/picker-trigger/index.js +18 -9
- package/lib/components/picker/picker-panels.js +1 -1
- package/lib/components/picker/picker.js +12 -13
- package/lib/components/range-selector-pop/RangeSelectorPop.js +3 -3
- package/lib/components/rich-editor/models/schema.js +6 -6
- package/lib/components/rich-editor/plugins/block/block-quote/index.js +8 -8
- package/lib/components/rich-editor/plugins/block/heading/index.js +8 -8
- package/lib/components/rich-editor/plugins/block/lists/index.js +14 -14
- package/lib/components/rich-editor/plugins/block/paragraph/index.js +5 -5
- package/lib/components/rich-editor/plugins/core/index.js +4 -4
- package/lib/components/rich-editor/plugins/extension/alignment/index.js +5 -5
- package/lib/components/rich-editor/plugins/extension/placeholder/index.js +4 -4
- package/lib/components/rich-editor/plugins/inline/color/index.js +11 -11
- package/lib/components/rich-editor/plugins/inline/delete-line/index.js +8 -8
- package/lib/components/rich-editor/plugins/inline/em/index.js +5 -5
- package/lib/components/rich-editor/plugins/inline/link/index.js +8 -8
- package/lib/components/rich-editor/plugins/inline/strong/index.js +8 -8
- package/lib/components/rich-editor/plugins/inline/under-line/index.js +8 -8
- package/lib/components/rich-editor/react/uiProvider.js +3 -3
- package/lib/components/rich-editor/ui/Popup/index.js +3 -3
- package/lib/components/select/Option.js +3 -3
- package/lib/components/time-picker/index.css +18 -0
- package/lib/components/time-picker/time-picker-selector.js +8 -12
- package/lib/components/time-picker/time-picker.js +117 -100
- package/lib/components/time-picker/utils.js +13 -2
- package/lib/components/tita-chart/errorBoundary/index.js +3 -3
- package/lib/components-v1/animate/AnimateChild.js +3 -3
- package/lib/components-v1/avatar/index.js +3 -3
- package/lib/components-v1/dropDownSelector/StatelessDropdown.js +3 -3
- package/lib/components-v1/progress/CircleProgress.js +3 -3
- package/lib/components-v1/select/Option.js +3 -3
- package/lib/components-v1/userSelector/UserSelectorPop.js +3 -3
- package/lib/components-v1/userSelector/components/MultiMode/index.js +3 -3
- package/lib/components-v1/userSelector/components/UserItem.js +3 -3
- package/package.json +1 -1
- package/yarn-error.log +5424 -6356
|
@@ -0,0 +1,330 @@
|
|
|
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 _pop = _interopRequireDefault(require("../../components-v1/pop"));
|
|
13
|
+
|
|
14
|
+
var _Option = _interopRequireDefault(require("./Option"));
|
|
15
|
+
|
|
16
|
+
require("./index.scss");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
+
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
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
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
33
|
+
|
|
34
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
35
|
+
|
|
36
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
37
|
+
|
|
38
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
39
|
+
|
|
40
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
41
|
+
|
|
42
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
43
|
+
|
|
44
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
45
|
+
|
|
46
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
47
|
+
|
|
48
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
49
|
+
|
|
50
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
51
|
+
|
|
52
|
+
var index = /*#__PURE__*/function (_Component) {
|
|
53
|
+
_inherits(index, _Component);
|
|
54
|
+
|
|
55
|
+
var _super = _createSuper(index);
|
|
56
|
+
|
|
57
|
+
function index(p) {
|
|
58
|
+
var _this;
|
|
59
|
+
|
|
60
|
+
_classCallCheck(this, index);
|
|
61
|
+
|
|
62
|
+
_this = _super.call(this, p);
|
|
63
|
+
|
|
64
|
+
_initialiseProps.call(_assertThisInitialized(_this));
|
|
65
|
+
|
|
66
|
+
var value = _this.props.value;
|
|
67
|
+
|
|
68
|
+
if (value != undefined) {
|
|
69
|
+
_this.controled = true;
|
|
70
|
+
_this.state = {
|
|
71
|
+
focus: false
|
|
72
|
+
};
|
|
73
|
+
return _possibleConstructorReturn(_this);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
_this.state = {
|
|
77
|
+
value: _this.props.defaultValue === undefined ? "" : _this.props.defaultValue,
|
|
78
|
+
focus: false
|
|
79
|
+
};
|
|
80
|
+
return _this;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
_createClass(index, [{
|
|
84
|
+
key: "componentDidUpdate",
|
|
85
|
+
value: function componentDidUpdate(newProps) {
|
|
86
|
+
this.setWrapperScrollTop(newProps);
|
|
87
|
+
}
|
|
88
|
+
}, {
|
|
89
|
+
key: "render",
|
|
90
|
+
value: function render() {
|
|
91
|
+
var _this$props = this.props,
|
|
92
|
+
className = _this$props.className,
|
|
93
|
+
disabled = _this$props.disabled,
|
|
94
|
+
type = _this$props.type,
|
|
95
|
+
containerStyle = _this$props.containerStyle,
|
|
96
|
+
container = _this$props.container,
|
|
97
|
+
title = _this$props.title;
|
|
98
|
+
var style = this.props.maxHeight ? {
|
|
99
|
+
overflow: "auto",
|
|
100
|
+
maxHeight: this.props.maxHeight
|
|
101
|
+
} : {};
|
|
102
|
+
return /*#__PURE__*/_react["default"].createElement("div", _extends({
|
|
103
|
+
className: type == "old" ? "tita-common-select-wrapper-o" : "tita-common-select-wrapper",
|
|
104
|
+
style: containerStyle
|
|
105
|
+
}, this.getHideEventHandler()), /*#__PURE__*/_react["default"].createElement("div", _extends({
|
|
106
|
+
ref: "selector",
|
|
107
|
+
style: _objectSpread(_objectSpread({}, this.props.style || {}), {
|
|
108
|
+
backgroundColor: disabled ? "#f5f5f5" : this.props.dis ? "#4C5D68" : "#ffffff",
|
|
109
|
+
cursor: disabled ? "not-allowed" : "pointer"
|
|
110
|
+
}),
|
|
111
|
+
className: "tita-common-select ".concat(this.state.focus ? "" : "tita-common-select-active")
|
|
112
|
+
}, this.getShowEventHandler()), /*#__PURE__*/_react["default"].createElement("div", {
|
|
113
|
+
className: "tita-select-text"
|
|
114
|
+
}, title || this.getText()), /*#__PURE__*/_react["default"].createElement("span", {
|
|
115
|
+
className: "".concat(type == "old" ? "tu-icon-sort-up" : "tu-icon-arrow-up", " common-select-arrow")
|
|
116
|
+
})), /*#__PURE__*/_react["default"].createElement(_pop["default"], {
|
|
117
|
+
ref: "options",
|
|
118
|
+
blurToHide: this.props.toggle !== "hover",
|
|
119
|
+
transitionName: "none-transition",
|
|
120
|
+
onBeforeHide: this.handleBlur,
|
|
121
|
+
container: container
|
|
122
|
+
}, /*#__PURE__*/_react["default"].createElement("ul", {
|
|
123
|
+
className: className,
|
|
124
|
+
ref: "titaCommonCelectorWrapper",
|
|
125
|
+
style: _objectSpread(_objectSpread({}, {
|
|
126
|
+
minWidth: this.props.style.width
|
|
127
|
+
}), style),
|
|
128
|
+
onClick: function onClick(e) {
|
|
129
|
+
e.stopPropagation();
|
|
130
|
+
e.nativeEvent.stopImmediatePropagation();
|
|
131
|
+
},
|
|
132
|
+
onMouseDown: function onMouseDown(e) {
|
|
133
|
+
e.stopPropagation();
|
|
134
|
+
e.nativeEvent.stopImmediatePropagation();
|
|
135
|
+
}
|
|
136
|
+
}, this.getChildren())));
|
|
137
|
+
}
|
|
138
|
+
}]);
|
|
139
|
+
|
|
140
|
+
return index;
|
|
141
|
+
}(_react.Component);
|
|
142
|
+
|
|
143
|
+
exports["default"] = index;
|
|
144
|
+
index.defaultProps = {
|
|
145
|
+
style: {
|
|
146
|
+
width: "100px !important",
|
|
147
|
+
// NOTE IE11 下 width auto 不展示
|
|
148
|
+
height: "26px"
|
|
149
|
+
},
|
|
150
|
+
toggle: "click",
|
|
151
|
+
data: [],
|
|
152
|
+
disabled: false,
|
|
153
|
+
placeHolder: "",
|
|
154
|
+
wrapperHeight: 300,
|
|
155
|
+
adjustHeight: 54
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
var _initialiseProps = function _initialiseProps() {
|
|
159
|
+
var _this2 = this;
|
|
160
|
+
|
|
161
|
+
this.setWrapperScrollTop = function (newProps) {
|
|
162
|
+
var value = newProps.value || -1;
|
|
163
|
+
var activeTimeIndex = newProps.data.findIndex(function (item) {
|
|
164
|
+
return (item.value || item) == value;
|
|
165
|
+
});
|
|
166
|
+
var scrollTop = activeTimeIndex * 32 >= _this2.props.wrapperHeight ? activeTimeIndex * 32 - _this2.props.wrapperHeight + _this2.props.adjustHeight : 0; // @ts-ignore
|
|
167
|
+
|
|
168
|
+
if (_this2.refs.titaCommonCelectorWrapper) {
|
|
169
|
+
_this2.refs.titaCommonCelectorWrapper.scrollTop = scrollTop;
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
this.getShowEventHandler = function () {
|
|
174
|
+
var handler = {};
|
|
175
|
+
|
|
176
|
+
switch (_this2.props.toggle) {
|
|
177
|
+
case "click":
|
|
178
|
+
{
|
|
179
|
+
handler.onClick = _this2.showOptions;
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
case "hover":
|
|
184
|
+
{
|
|
185
|
+
handler.onMouseOver = _this2.showOptions;
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
case "mousedonwn":
|
|
190
|
+
{
|
|
191
|
+
handler.onMouseDown = _this2.showOptions;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
case "mouseup":
|
|
195
|
+
{
|
|
196
|
+
handler.onMouseUp = _this2.showOptions;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
default:
|
|
200
|
+
{
|
|
201
|
+
handler.onClick = _this2.showOptions;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return handler;
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
this.getHideEventHandler = function () {
|
|
209
|
+
var handler = {};
|
|
210
|
+
|
|
211
|
+
switch (_this2.props.toggle) {
|
|
212
|
+
case "mouseup":
|
|
213
|
+
case "hover":
|
|
214
|
+
{
|
|
215
|
+
handler.onMouseLeave = _this2.hideOptions;
|
|
216
|
+
break;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
return handler;
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
this.getChildren = function () {
|
|
224
|
+
var _this2$props$style = _this2.props.style,
|
|
225
|
+
height = _this2$props$style.height,
|
|
226
|
+
width = _this2$props$style.width;
|
|
227
|
+
var _this2$props = _this2.props,
|
|
228
|
+
valueField = _this2$props.valueField,
|
|
229
|
+
textField = _this2$props.textField,
|
|
230
|
+
value = _this2$props.value;
|
|
231
|
+
return _this2.props.data.map(function (item, index) {
|
|
232
|
+
var text = textField ? item[textField] : item;
|
|
233
|
+
var value = valueField ? item[valueField] : item;
|
|
234
|
+
var trigger = {
|
|
235
|
+
click: "onClick",
|
|
236
|
+
mousedonwn: "onMouseDown",
|
|
237
|
+
mouseup: "onMouseUp"
|
|
238
|
+
};
|
|
239
|
+
return /*#__PURE__*/_react["default"].createElement(_Option["default"], {
|
|
240
|
+
className: _this2.props.value == value ? "active" : "",
|
|
241
|
+
style: {
|
|
242
|
+
width: width,
|
|
243
|
+
height: height
|
|
244
|
+
},
|
|
245
|
+
key: value,
|
|
246
|
+
value: value,
|
|
247
|
+
select: item,
|
|
248
|
+
onSelect: _this2.handleSelect,
|
|
249
|
+
triggerMethod: trigger[_this2.props.toggle]
|
|
250
|
+
}, text);
|
|
251
|
+
});
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
this.handleSelect = function (value) {
|
|
255
|
+
if (!_this2.controled) {
|
|
256
|
+
_this2.setState({
|
|
257
|
+
value: value
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
_this2.hideOptions();
|
|
262
|
+
|
|
263
|
+
var onSelect = _this2.props.onSelect;
|
|
264
|
+
onSelect && onSelect(value);
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
this.getSelected = function () {
|
|
268
|
+
var valueField = _this2.props.valueField;
|
|
269
|
+
if (!valueField) return _this2.getValue();
|
|
270
|
+
return _this2.props.data.filter(function (item) {
|
|
271
|
+
return item[valueField] == _this2.getValue();
|
|
272
|
+
})[0];
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
this.getValue = function () {
|
|
276
|
+
return _this2.controled ? _this2.props.value : _this2.state.value;
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
this.getText = function () {
|
|
280
|
+
var _this2$props2 = _this2.props,
|
|
281
|
+
textField = _this2$props2.textField,
|
|
282
|
+
placeHolder = _this2$props2.placeHolder;
|
|
283
|
+
|
|
284
|
+
var selected = _this2.getSelected();
|
|
285
|
+
|
|
286
|
+
if (!selected) return placeHolder;
|
|
287
|
+
return textField ? selected[textField] : selected;
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
this.showOptions = function () {
|
|
291
|
+
if (_this2.props.disabled) return;
|
|
292
|
+
|
|
293
|
+
_this2.refs.options.show(_this2.refs.selector);
|
|
294
|
+
|
|
295
|
+
_this2.setState({
|
|
296
|
+
focus: true
|
|
297
|
+
});
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
this.hideOptions = function () {
|
|
301
|
+
_this2.refs.options.hide();
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
this.handleBlur = function () {
|
|
305
|
+
_this2.setState({
|
|
306
|
+
focus: false
|
|
307
|
+
});
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
this.getToggle = function (type) {
|
|
311
|
+
var eventName = "onClick";
|
|
312
|
+
var toggle = {};
|
|
313
|
+
|
|
314
|
+
if (_this2.props.toggle == "hover") {
|
|
315
|
+
eventName = "onMouseOver";
|
|
316
|
+
toggle.onMouseLeave = _this2.hideOptions;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
if (_this2.props.toggle == "mousedonwn") {
|
|
320
|
+
eventName = "onMouseDown", toggle.onMouseDown = _this2.hideOptions;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
if (_this2.props.toggle == "mouseup") {
|
|
324
|
+
eventName = "onMouseUp", toggle.onMouseUp = _this2.hideOptions;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
toggle[eventName] = _this2.showOptions;
|
|
328
|
+
return toggle;
|
|
329
|
+
};
|
|
330
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _default = function _default(func, wait, immediate) {
|
|
9
|
+
var timeout;
|
|
10
|
+
var result;
|
|
11
|
+
|
|
12
|
+
var debounced = function debounced() {
|
|
13
|
+
var context = this;
|
|
14
|
+
var args = arguments;
|
|
15
|
+
if (timeout) clearTimeout(timeout);
|
|
16
|
+
|
|
17
|
+
var later = function later() {
|
|
18
|
+
timeout = null;
|
|
19
|
+
if (!immediate) result = func.apply(context, args);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
var callNow = immediate && !timeout;
|
|
23
|
+
timeout = setTimeout(later, wait);
|
|
24
|
+
if (callNow) result = func.apply(this, args);
|
|
25
|
+
return result;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
debounced.cancel = function () {
|
|
29
|
+
clearTimeout(timeout);
|
|
30
|
+
timeout = null;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return debounced;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,109 @@
|
|
|
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"] = _default;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
var _debounce = _interopRequireDefault(require("./debounce"));
|
|
15
|
+
|
|
16
|
+
var _getLocale = require("../../utils/getLocale");
|
|
17
|
+
|
|
18
|
+
require("./index.scss");
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
+
|
|
22
|
+
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); }
|
|
23
|
+
|
|
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
|
+
|
|
26
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
27
|
+
|
|
28
|
+
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."); }
|
|
29
|
+
|
|
30
|
+
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); }
|
|
31
|
+
|
|
32
|
+
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; }
|
|
33
|
+
|
|
34
|
+
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; }
|
|
35
|
+
|
|
36
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
|
+
|
|
38
|
+
function _default(props) {
|
|
39
|
+
var _props$placeholder = props.placeholder,
|
|
40
|
+
placeholder = _props$placeholder === void 0 ? "".concat((0, _getLocale.getLocale)("Mod_Search")) : _props$placeholder,
|
|
41
|
+
onChange = props.onChange;
|
|
42
|
+
|
|
43
|
+
var _useState = (0, _react.useState)(false),
|
|
44
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
45
|
+
heiglight = _useState2[0],
|
|
46
|
+
setHeiglight = _useState2[1];
|
|
47
|
+
|
|
48
|
+
var _useState3 = (0, _react.useState)(false),
|
|
49
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
50
|
+
heiglightClose = _useState4[0],
|
|
51
|
+
setHeiglightClose = _useState4[1];
|
|
52
|
+
|
|
53
|
+
var _useState5 = (0, _react.useState)(""),
|
|
54
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
55
|
+
searchKey = _useState6[0],
|
|
56
|
+
setSearchKey = _useState6[1];
|
|
57
|
+
|
|
58
|
+
var onInputFocus = function onInputFocus() {
|
|
59
|
+
setHeiglight(true);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
var onInputBlur = function onInputBlur() {
|
|
63
|
+
setHeiglight(false);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
var delayChange = (0, _react.useRef)((0, _debounce["default"])(function (val) {
|
|
67
|
+
return onChange(val);
|
|
68
|
+
}, 300)).current;
|
|
69
|
+
|
|
70
|
+
var onInputChange = function onInputChange(e) {
|
|
71
|
+
var val = e.target.value;
|
|
72
|
+
setSearchKey(val);
|
|
73
|
+
delayChange(val);
|
|
74
|
+
if (val) setHeiglightClose(true);
|
|
75
|
+
if (!val) setHeiglightClose(false);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
var onEmpty = function onEmpty() {
|
|
79
|
+
setSearchKey("");
|
|
80
|
+
setHeiglightClose(false);
|
|
81
|
+
onChange("");
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
var wrapperClickHandler = function wrapperClickHandler(e) {
|
|
85
|
+
e.stopPropagation();
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
89
|
+
className: (0, _classnames["default"])("persel-selector", {
|
|
90
|
+
"persel-selector__heiglight": heiglight,
|
|
91
|
+
"persel-selector__heiglight-close": heiglightClose
|
|
92
|
+
}),
|
|
93
|
+
onClick: wrapperClickHandler
|
|
94
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
95
|
+
className: "persel-selector__icon"
|
|
96
|
+
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
97
|
+
className: "persel-selector__input"
|
|
98
|
+
}, /*#__PURE__*/_react["default"].createElement("input", {
|
|
99
|
+
placeholder: placeholder,
|
|
100
|
+
onFocus: onInputFocus,
|
|
101
|
+
value: searchKey,
|
|
102
|
+
onBlur: onInputBlur,
|
|
103
|
+
onChange: onInputChange,
|
|
104
|
+
autoComplete: "off"
|
|
105
|
+
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
106
|
+
className: "persel-selector__input--closable",
|
|
107
|
+
onClick: onEmpty
|
|
108
|
+
})));
|
|
109
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
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"] = _default;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
14
|
+
var _getLocale = require("../../utils/getLocale");
|
|
15
|
+
|
|
16
|
+
require("./index.scss");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
+
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
25
|
+
|
|
26
|
+
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."); }
|
|
27
|
+
|
|
28
|
+
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); }
|
|
29
|
+
|
|
30
|
+
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; }
|
|
31
|
+
|
|
32
|
+
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; }
|
|
33
|
+
|
|
34
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
35
|
+
|
|
36
|
+
function _default(props) {
|
|
37
|
+
var onChange = props.onChange,
|
|
38
|
+
onClose = props.onClose,
|
|
39
|
+
_props$style = props.style,
|
|
40
|
+
style = _props$style === void 0 ? {} : _props$style,
|
|
41
|
+
_props$defaultValue = props.defaultValue,
|
|
42
|
+
defaultValue = _props$defaultValue === void 0 ? "" : _props$defaultValue,
|
|
43
|
+
_props$placeholder = props.placeholder,
|
|
44
|
+
placeholder = _props$placeholder === void 0 ? "".concat((0, _getLocale.getLocale)("Mod_Enterkeywords")) : _props$placeholder,
|
|
45
|
+
onActive = props.onActive;
|
|
46
|
+
var inputRef = (0, _react.useRef)();
|
|
47
|
+
|
|
48
|
+
var _useState = (0, _react.useState)(defaultValue),
|
|
49
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
50
|
+
text = _useState2[0],
|
|
51
|
+
setText = _useState2[1];
|
|
52
|
+
|
|
53
|
+
var _useState3 = (0, _react.useState)(false),
|
|
54
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
55
|
+
showText = _useState4[0],
|
|
56
|
+
setShowText = _useState4[1];
|
|
57
|
+
|
|
58
|
+
var _useState5 = (0, _react.useState)(false),
|
|
59
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
60
|
+
isActive = _useState6[0],
|
|
61
|
+
setIsActive = _useState6[1];
|
|
62
|
+
|
|
63
|
+
var onSearchKeyHandler = function onSearchKeyHandler(e) {
|
|
64
|
+
if (isActive) {
|
|
65
|
+
onChange && onChange(text);
|
|
66
|
+
} else {
|
|
67
|
+
setIsActive(true);
|
|
68
|
+
onActive && onActive();
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
(0, _react.useEffect)(function () {
|
|
73
|
+
if (isActive) inputRef.current.focus();
|
|
74
|
+
}, [isActive]);
|
|
75
|
+
|
|
76
|
+
var onInputChangeHandler = function onInputChangeHandler(e) {
|
|
77
|
+
var value = e.target.value;
|
|
78
|
+
setText(value);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
var onCloseHandler = function onCloseHandler() {
|
|
82
|
+
setText("");
|
|
83
|
+
setIsActive(false);
|
|
84
|
+
onClose && onClose();
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
var onInputKeyDownHandler = function onInputKeyDownHandler(e) {
|
|
88
|
+
if (e.keyCode === 13) {
|
|
89
|
+
onChange && onChange(text);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
var onInputBlurHandler = function onInputBlurHandler() {
|
|
94
|
+
if (!text) {
|
|
95
|
+
setIsActive(false);
|
|
96
|
+
onClose && onClose();
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
101
|
+
className: "slider-input-wrapper",
|
|
102
|
+
style: style
|
|
103
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
104
|
+
className: "slider-input ".concat(isActive ? "active" : "")
|
|
105
|
+
}, /*#__PURE__*/_react["default"].createElement("input", {
|
|
106
|
+
ref: inputRef,
|
|
107
|
+
value: text,
|
|
108
|
+
placeholder: placeholder,
|
|
109
|
+
onChange: onInputChangeHandler,
|
|
110
|
+
onBlur: onInputBlurHandler,
|
|
111
|
+
onKeyDown: onInputKeyDownHandler
|
|
112
|
+
}), text ? /*#__PURE__*/_react["default"].createElement("span", {
|
|
113
|
+
className: "sider-input-icon-close",
|
|
114
|
+
onClick: onCloseHandler
|
|
115
|
+
}) : null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
116
|
+
className: "sider-input-icon-search",
|
|
117
|
+
onClick: onSearchKeyHandler
|
|
118
|
+
})));
|
|
119
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = _default;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _rcSwitch = _interopRequireDefault(require("rc-switch"));
|
|
11
|
+
|
|
12
|
+
require("./rc-switch.scss");
|
|
13
|
+
|
|
14
|
+
require("./index.scss");
|
|
15
|
+
|
|
16
|
+
var _excluded = ["label", "size"];
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
+
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
26
|
+
function _default(props) {
|
|
27
|
+
var label = props.label,
|
|
28
|
+
_props$size = props.size,
|
|
29
|
+
size = _props$size === void 0 ? "normal" : _props$size,
|
|
30
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
31
|
+
|
|
32
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
33
|
+
className: "titaui-switch"
|
|
34
|
+
}, label ? /*#__PURE__*/_react["default"].createElement("span", {
|
|
35
|
+
className: "titaui-switch-label"
|
|
36
|
+
}, label) : "", /*#__PURE__*/_react["default"].createElement(_rcSwitch["default"], _extends({
|
|
37
|
+
prefixCls: "tui-switch"
|
|
38
|
+
}, restProps)));
|
|
39
|
+
}
|