yootd 0.0.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/LICENSE +21 -0
- package/README.md +43 -0
- package/dist/Preview/assets/phonebg.png +0 -0
- package/dist/Preview/components/icons/AdaptIcon.d.ts +3 -0
- package/dist/Preview/components/icons/AdaptIcon.js +60 -0
- package/dist/Preview/components/icons/MagnifyIcon.d.ts +3 -0
- package/dist/Preview/components/icons/MagnifyIcon.js +40 -0
- package/dist/Preview/components/icons/ResetIcon.d.ts +3 -0
- package/dist/Preview/components/icons/ResetIcon.js +66 -0
- package/dist/Preview/components/icons/ShrinkIcon.d.ts +3 -0
- package/dist/Preview/components/icons/ShrinkIcon.js +40 -0
- package/dist/Preview/components/preview/phone.d.ts +7 -0
- package/dist/Preview/components/preview/phone.js +10 -0
- package/dist/Preview/components/preview/phone.scss +8 -0
- package/dist/Preview/components/preview/web.d.ts +6 -0
- package/dist/Preview/components/preview/web.js +10 -0
- package/dist/Preview/components/reactflow/Controls.d.ts +5 -0
- package/dist/Preview/components/reactflow/Controls.js +69 -0
- package/dist/Preview/components/reactflow/TopPreview.d.ts +5 -0
- package/dist/Preview/components/reactflow/TopPreview.js +28 -0
- package/dist/Preview/index.d.ts +5 -0
- package/dist/Preview/index.js +94 -0
- package/dist/Preview/index.scss +35 -0
- package/dist/Preview/types/type.d.ts +21 -0
- package/dist/affix/index.d.ts +3 -0
- package/dist/affix/index.js +2 -0
- package/dist/alert/index.d.ts +5 -0
- package/dist/alert/index.js +2 -0
- package/dist/anchor/index.d.ts +10 -0
- package/dist/anchor/index.js +18 -0
- package/dist/anchor/index.scss +23 -0
- package/dist/app/index.d.ts +5 -0
- package/dist/app/index.js +2 -0
- package/dist/approval-process/components/Avatar.d.ts +3 -0
- package/dist/approval-process/components/Avatar.js +100 -0
- package/dist/approval-process/components/BackOut.d.ts +3 -0
- package/dist/approval-process/components/BackOut.js +35 -0
- package/dist/approval-process/components/Failed.d.ts +3 -0
- package/dist/approval-process/components/Failed.js +37 -0
- package/dist/approval-process/components/Pending.d.ts +3 -0
- package/dist/approval-process/components/Pending.js +51 -0
- package/dist/approval-process/components/StartIcon.d.ts +3 -0
- package/dist/approval-process/components/StartIcon.js +35 -0
- package/dist/approval-process/components/Success.d.ts +3 -0
- package/dist/approval-process/components/Success.js +35 -0
- package/dist/approval-process/index.d.ts +7 -0
- package/dist/approval-process/index.js +96 -0
- package/dist/approval-process/index.scss +95 -0
- package/dist/areas/index.d.ts +4 -0
- package/dist/areas/index.js +317 -0
- package/dist/areas/index.scss +21 -0
- package/dist/areas/types/types.d.ts +39 -0
- package/dist/aside/components/AddBtnIcon.d.ts +3 -0
- package/dist/aside/components/AddBtnIcon.js +27 -0
- package/dist/aside/components/DelBtnIcon.d.ts +3 -0
- package/dist/aside/components/DelBtnIcon.js +33 -0
- package/dist/aside/components/DragBtnIcon.d.ts +3 -0
- package/dist/aside/components/DragBtnIcon.js +26 -0
- package/dist/aside/components/EditBtnIcon.d.ts +3 -0
- package/dist/aside/components/EditBtnIcon.js +33 -0
- package/dist/aside/components/SortableItem.d.ts +5 -0
- package/dist/aside/components/SortableItem.js +125 -0
- package/dist/aside/components/SortableItem.scss +93 -0
- package/dist/aside/index.d.ts +4 -0
- package/dist/aside/index.js +186 -0
- package/dist/aside/index.scss +25 -0
- package/dist/aside/types/types.d.ts +44 -0
- package/dist/auto-complete/index.d.ts +4 -0
- package/dist/auto-complete/index.js +2 -0
- package/dist/avatar/index.d.ts +3 -0
- package/dist/avatar/index.js +2 -0
- package/dist/badge/index.d.ts +11 -0
- package/dist/badge/index.js +21 -0
- package/dist/badge/index.scss +5 -0
- package/dist/breadcrumb/index.d.ts +9 -0
- package/dist/breadcrumb/index.js +10 -0
- package/dist/business-tree/components/dept.d.ts +4 -0
- package/dist/business-tree/components/dept.js +35 -0
- package/dist/business-tree/components/space.d.ts +4 -0
- package/dist/business-tree/components/space.js +48 -0
- package/dist/business-tree/index.d.ts +3 -0
- package/dist/business-tree/index.js +16 -0
- package/dist/button/index.d.ts +13 -0
- package/dist/button/index.js +54 -0
- package/dist/button/index.scss +31 -0
- package/dist/calendar/index.d.ts +3 -0
- package/dist/calendar/index.js +2 -0
- package/dist/card/index.d.ts +3 -0
- package/dist/card/index.js +2 -0
- package/dist/carousel/index.d.ts +3 -0
- package/dist/carousel/index.js +2 -0
- package/dist/cascader/index.d.ts +11 -0
- package/dist/cascader/index.js +23 -0
- package/dist/cascader/index.scss +5 -0
- package/dist/checkbox/index.d.ts +10 -0
- package/dist/checkbox/index.js +13 -0
- package/dist/collapse/index.d.ts +3 -0
- package/dist/collapse/index.js +2 -0
- package/dist/color-picker/index.d.ts +6 -0
- package/dist/color-picker/index.js +2 -0
- package/dist/config-provider/context.d.ts +8 -0
- package/dist/config-provider/context.js +2 -0
- package/dist/config-provider/index.d.ts +24 -0
- package/dist/config-provider/index.js +34 -0
- package/dist/date-interval/index.d.ts +16 -0
- package/dist/date-interval/index.js +82 -0
- package/dist/date-picker/index.d.ts +3 -0
- package/dist/date-picker/index.js +2 -0
- package/dist/date-range/index.d.ts +16 -0
- package/dist/date-range/index.js +83 -0
- package/dist/description/index.d.ts +3 -0
- package/dist/description/index.js +2 -0
- package/dist/dictionary/index.d.ts +6 -0
- package/dist/dictionary/index.js +45 -0
- package/dist/dictionary/types/types.d.ts +14 -0
- package/dist/divider/index.d.ts +4 -0
- package/dist/divider/index.js +5 -0
- package/dist/drawer/index.d.ts +3 -0
- package/dist/drawer/index.js +2 -0
- package/dist/drawer-modal/components/CloseOutlined.d.ts +7 -0
- package/dist/drawer-modal/components/CloseOutlined.js +23 -0
- package/dist/drawer-modal/index.d.ts +6 -0
- package/dist/drawer-modal/index.js +37 -0
- package/dist/drawer-modal/index.scss +39 -0
- package/dist/drawer-modal/types/types.d.ts +3 -0
- package/dist/dropdown/assets/arrow-down.svg +6 -0
- package/dist/dropdown/index.d.ts +9 -0
- package/dist/dropdown/index.js +7 -0
- package/dist/empty/assets/404.png +0 -0
- package/dist/empty/assets/empty-content.png +0 -0
- package/dist/empty/assets/empty-data.png +0 -0
- package/dist/empty/assets/image-error.png +0 -0
- package/dist/empty/assets/net-error.png +0 -0
- package/dist/empty/assets/no-collect.png +0 -0
- package/dist/empty/assets/no-news.png +0 -0
- package/dist/empty/assets/no-notice.png +0 -0
- package/dist/empty/assets/no-schedule.png +0 -0
- package/dist/empty/assets/no-search-data.png +0 -0
- package/dist/empty/assets/submit-fail.png +0 -0
- package/dist/empty/assets/submit-success.png +0 -0
- package/dist/empty/index.d.ts +12 -0
- package/dist/empty/index.js +131 -0
- package/dist/empty/index.scss +15 -0
- package/dist/flex/index.d.ts +4 -0
- package/dist/flex/index.js +5 -0
- package/dist/float-button/index.d.ts +9 -0
- package/dist/float-button/index.js +10 -0
- package/dist/form/index.d.ts +3 -0
- package/dist/form/index.js +2 -0
- package/dist/grid/index.d.ts +6 -0
- package/dist/grid/index.js +8 -0
- package/dist/group-title/index.d.ts +7 -0
- package/dist/group-title/index.js +21 -0
- package/dist/group-title/index.scss +31 -0
- package/dist/hooks/useAssets.d.ts +1 -0
- package/dist/hooks/useAssets.js +11 -0
- package/dist/hooks/useBem.d.ts +15 -0
- package/dist/hooks/useBem.js +80 -0
- package/dist/hooks/useRequest.d.ts +1 -0
- package/dist/hooks/useRequest.js +11 -0
- package/dist/image/assets/default.png +0 -0
- package/dist/image/assets/error.png +0 -0
- package/dist/image/assets/eye.png +0 -0
- package/dist/image/index.d.ts +10 -0
- package/dist/image/index.js +95 -0
- package/dist/image/index.scss +27 -0
- package/dist/index.d.ts +156 -0
- package/dist/index.js +85 -0
- package/dist/input/index.d.ts +10 -0
- package/dist/input/index.js +24 -0
- package/dist/input/index.scss +5 -0
- package/dist/input-number/index.d.ts +3 -0
- package/dist/input-number/index.js +2 -0
- package/dist/layout/index.d.ts +6 -0
- package/dist/layout/index.js +2 -0
- package/dist/list/index.d.ts +3 -0
- package/dist/list/index.js +2 -0
- package/dist/mentions/index.d.ts +3 -0
- package/dist/mentions/index.js +2 -0
- package/dist/menu/index.d.ts +9 -0
- package/dist/menu/index.js +12 -0
- package/dist/message/index.d.ts +3 -0
- package/dist/message/index.js +2 -0
- package/dist/modal/components/header-icon.d.ts +3 -0
- package/dist/modal/components/header-icon.js +46 -0
- package/dist/modal/index.d.ts +10 -0
- package/dist/modal/index.js +41 -0
- package/dist/modal/index.scss +65 -0
- package/dist/notification/index.d.ts +3 -0
- package/dist/notification/index.js +2 -0
- package/dist/pagination/index.d.ts +5 -0
- package/dist/pagination/index.js +22 -0
- package/dist/pagination/index.scss +47 -0
- package/dist/pop-confirm/index.d.ts +3 -0
- package/dist/pop-confirm/index.js +2 -0
- package/dist/popover/index.d.ts +5 -0
- package/dist/popover/index.js +2 -0
- package/dist/progress/index.d.ts +3 -0
- package/dist/progress/index.js +2 -0
- package/dist/qrcode/index.d.ts +3 -0
- package/dist/qrcode/index.js +2 -0
- package/dist/radio/index.d.ts +4 -0
- package/dist/radio/index.js +3 -0
- package/dist/rate/index.d.ts +3 -0
- package/dist/rate/index.js +2 -0
- package/dist/result/index.d.ts +2 -0
- package/dist/result/index.js +2 -0
- package/dist/school/index.d.ts +4 -0
- package/dist/school/index.js +304 -0
- package/dist/school/index.scss +21 -0
- package/dist/school/types/types.d.ts +84 -0
- package/dist/segmented/index.d.ts +3 -0
- package/dist/segmented/index.js +2 -0
- package/dist/select/index.d.ts +3 -0
- package/dist/select/index.js +2 -0
- package/dist/skeleton/index.d.ts +9 -0
- package/dist/skeleton/index.js +2 -0
- package/dist/slider/index.d.ts +3 -0
- package/dist/slider/index.js +2 -0
- package/dist/space/index.d.ts +6 -0
- package/dist/space/index.js +2 -0
- package/dist/spin/index.d.ts +2 -0
- package/dist/spin/index.js +2 -0
- package/dist/splitter/index.d.ts +6 -0
- package/dist/splitter/index.js +2 -0
- package/dist/state/index.d.ts +8 -0
- package/dist/state/index.js +28 -0
- package/dist/state/index.scss +89 -0
- package/dist/statistic/index.d.ts +2 -0
- package/dist/statistic/index.js +2 -0
- package/dist/steps/index.d.ts +10 -0
- package/dist/steps/index.js +18 -0
- package/dist/steps/index.scss +32 -0
- package/dist/switch/index.d.ts +3 -0
- package/dist/switch/index.js +2 -0
- package/dist/table/components/icons/DownOutlined.d.ts +3 -0
- package/dist/table/components/icons/DownOutlined.js +28 -0
- package/dist/table/components/icons/DragHandler.d.ts +3 -0
- package/dist/table/components/icons/DragHandler.js +24 -0
- package/dist/table/components/icons/SettingFilled.d.ts +3 -0
- package/dist/table/components/icons/SettingFilled.js +22 -0
- package/dist/table/components/icons/UpOutlined.d.ts +3 -0
- package/dist/table/components/icons/UpOutlined.js +28 -0
- package/dist/table/components/primary-header-row/index.d.ts +3 -0
- package/dist/table/components/primary-header-row/index.js +130 -0
- package/dist/table/components/primary-header-row/index.scss +58 -0
- package/dist/table/components/primary-tbody-row/index.d.ts +3 -0
- package/dist/table/components/primary-tbody-row/index.js +40 -0
- package/dist/table/components/primary-tbody-row/index.scss +5 -0
- package/dist/table/index.d.ts +41 -0
- package/dist/table/index.js +146 -0
- package/dist/table/index.module.scss +9 -0
- package/dist/table/index.scss +33 -0
- package/dist/tabs/index.d.ts +12 -0
- package/dist/tabs/index.js +108 -0
- package/dist/tabs/index.scss +50 -0
- package/dist/tag/index.d.ts +2 -0
- package/dist/tag/index.js +2 -0
- package/dist/teacher/index.d.ts +3 -0
- package/dist/teacher/index.js +59 -0
- package/dist/teacher/types/types.d.ts +31 -0
- package/dist/time-picker/index.d.ts +3 -0
- package/dist/time-picker/index.js +2 -0
- package/dist/timeline/index.d.ts +5 -0
- package/dist/timeline/index.js +2 -0
- package/dist/tooltip/index.d.ts +5 -0
- package/dist/tooltip/index.js +2 -0
- package/dist/tour/index.d.ts +5 -0
- package/dist/tour/index.js +2 -0
- package/dist/transfer/index.d.ts +3 -0
- package/dist/transfer/index.js +2 -0
- package/dist/tree/components/BedIcon.d.ts +3 -0
- package/dist/tree/components/BedIcon.js +29 -0
- package/dist/tree/components/CampusIcon.d.ts +3 -0
- package/dist/tree/components/CampusIcon.js +30 -0
- package/dist/tree/components/DeptIcon.d.ts +3 -0
- package/dist/tree/components/DeptIcon.js +32 -0
- package/dist/tree/components/FloorIcon.d.ts +3 -0
- package/dist/tree/components/FloorIcon.js +32 -0
- package/dist/tree/components/RoomIcon.d.ts +3 -0
- package/dist/tree/components/RoomIcon.js +32 -0
- package/dist/tree/components/SchoolIcon.d.ts +3 -0
- package/dist/tree/components/SchoolIcon.js +70 -0
- package/dist/tree/components/TierlIcon.d.ts +3 -0
- package/dist/tree/components/TierlIcon.js +39 -0
- package/dist/tree/index.d.ts +27 -0
- package/dist/tree/index.js +207 -0
- package/dist/tree/index.scss +25 -0
- package/dist/tree-select/index.d.ts +3 -0
- package/dist/tree-select/index.js +2 -0
- package/dist/typography/index.d.ts +3 -0
- package/dist/typography/index.js +2 -0
- package/dist/upload/assets/again.png +0 -0
- package/dist/upload/assets/delete.png +0 -0
- package/dist/upload/assets/success.png +0 -0
- package/dist/upload/components/AgainIcon.d.ts +3 -0
- package/dist/upload/components/AgainIcon.js +29 -0
- package/dist/upload/components/DeleteIcon.d.ts +3 -0
- package/dist/upload/components/DeleteIcon.js +28 -0
- package/dist/upload/components/DeleteImage.d.ts +3 -0
- package/dist/upload/components/DeleteImage.js +47 -0
- package/dist/upload/components/SuccessIcon.d.ts +3 -0
- package/dist/upload/components/SuccessIcon.js +28 -0
- package/dist/upload/components/UpLoadIconAdd.d.ts +3 -0
- package/dist/upload/components/UpLoadIconAdd.js +28 -0
- package/dist/upload/components/UploadIcon.d.ts +3 -0
- package/dist/upload/components/UploadIcon.js +36 -0
- package/dist/upload/components/fileUpload.d.ts +13 -0
- package/dist/upload/components/fileUpload.js +258 -0
- package/dist/upload/components/imageUpload.d.ts +13 -0
- package/dist/upload/components/imageUpload.js +243 -0
- package/dist/upload/index.d.ts +20 -0
- package/dist/upload/index.js +16 -0
- package/dist/upload/index.scss +115 -0
- package/dist/user-dropdown/index.d.ts +3 -0
- package/dist/user-dropdown/index.js +101 -0
- package/dist/user-dropdown/types/types.d.ts +44 -0
- package/dist/utils/types.d.ts +7 -0
- package/dist/utils/types.js +1 -0
- package/dist/utils/utils.d.ts +2 -0
- package/dist/utils/utils.js +12 -0
- package/dist/watermark/index.d.ts +3 -0
- package/dist/watermark/index.js +2 -0
- package/dist/year-options/index.d.ts +11 -0
- package/dist/year-options/index.js +32 -0
- package/dist/year-term/index.d.ts +4 -0
- package/dist/year-term/index.js +169 -0
- package/dist/year-term/index.scss +21 -0
- package/dist/year-term/types/types.d.ts +28 -0
- package/dist/zones/index.d.ts +3 -0
- package/dist/zones/index.js +186 -0
- package/dist/zones/index.module.scss +23 -0
- package/dist/zones/types/types.d.ts +26 -0
- package/package.json +97 -0
@@ -0,0 +1,16 @@
|
|
1
|
+
var _excluded = ["type"];
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
3
|
+
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; }
|
4
|
+
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; }
|
5
|
+
import React from 'react';
|
6
|
+
import Departments from "./components/dept";
|
7
|
+
import Space from "./components/space";
|
8
|
+
export var BusinessTree = function BusinessTree(_ref) {
|
9
|
+
var type = _ref.type,
|
10
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
11
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, type === 'dept' ? /*#__PURE__*/React.createElement(Departments, _extends({
|
12
|
+
type: type
|
13
|
+
}, props)) : null, type === 'space' ? /*#__PURE__*/React.createElement(Space, _extends({
|
14
|
+
type: type
|
15
|
+
}, props)) : null);
|
16
|
+
};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import type { ButtonProps as AntButtonProps } from 'antd';
|
2
|
+
import { Button as AntButton } from 'antd';
|
3
|
+
import React from 'react';
|
4
|
+
import './index.scss';
|
5
|
+
type AntButtonType = typeof AntButton;
|
6
|
+
type ButtonType = typeof ButtonComponent & Pick<AntButtonType, 'Group'>;
|
7
|
+
export type ButtonProps = Omit<AntButtonProps, 'type'> & {
|
8
|
+
type?: 'default' | 'primary' | 'petit' | 'dashed' | 'link' | 'text' | 'week';
|
9
|
+
variant?: 'filled' | 'outlined';
|
10
|
+
};
|
11
|
+
export declare const ButtonComponent: React.FC<ButtonProps>;
|
12
|
+
export declare const Button: ButtonType;
|
13
|
+
export {};
|
@@ -0,0 +1,54 @@
|
|
1
|
+
var _excluded = ["variant", "className", "type"];
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
3
|
+
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; }
|
4
|
+
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; }
|
5
|
+
import { Button as AntButton } from 'antd';
|
6
|
+
import React from 'react';
|
7
|
+
import { useBem } from "../hooks/useBem";
|
8
|
+
import "./index.scss";
|
9
|
+
|
10
|
+
// 从对象AntButtonProps中删除type属性
|
11
|
+
|
12
|
+
export var ButtonComponent = function ButtonComponent(_ref) {
|
13
|
+
var variant = _ref.variant,
|
14
|
+
className = _ref.className,
|
15
|
+
type = _ref.type,
|
16
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
17
|
+
var mb = useBem('button');
|
18
|
+
var size = rest.size;
|
19
|
+
var _className = '';
|
20
|
+
var antButtonType = 'default';
|
21
|
+
if (type === 'petit' || type === 'week') {
|
22
|
+
antButtonType = 'default';
|
23
|
+
} else {
|
24
|
+
antButtonType = type;
|
25
|
+
}
|
26
|
+
switch (size) {
|
27
|
+
case 'small':
|
28
|
+
_className = "".concat(mb.m('small'));
|
29
|
+
break;
|
30
|
+
case 'large':
|
31
|
+
_className = "".concat(mb.m('large'));
|
32
|
+
break;
|
33
|
+
case 'middle':
|
34
|
+
_className = "".concat(mb.m('middle'));
|
35
|
+
default:
|
36
|
+
break;
|
37
|
+
}
|
38
|
+
switch (type) {
|
39
|
+
case 'link':
|
40
|
+
_className += " ".concat(mb.e('link'));
|
41
|
+
break;
|
42
|
+
default:
|
43
|
+
_className += '';
|
44
|
+
break;
|
45
|
+
}
|
46
|
+
return /*#__PURE__*/React.createElement(AntButton, _extends({
|
47
|
+
variant: variant,
|
48
|
+
size: size,
|
49
|
+
type: antButtonType,
|
50
|
+
className: "".concat(className !== null && className !== void 0 ? className : '', " ").concat(_className)
|
51
|
+
}, rest));
|
52
|
+
};
|
53
|
+
export var Button = ButtonComponent;
|
54
|
+
Button.Group = AntButton.Group;
|
@@ -0,0 +1,31 @@
|
|
1
|
+
.yot-button {
|
2
|
+
&--small {
|
3
|
+
height: 26px;
|
4
|
+
padding-left: 16px;
|
5
|
+
padding-right: 16px;
|
6
|
+
border-radius: 4px;
|
7
|
+
font-size: 14px;
|
8
|
+
}
|
9
|
+
|
10
|
+
&--middle {
|
11
|
+
height: 32px;
|
12
|
+
padding-left: 16px;
|
13
|
+
padding-right: 16px;
|
14
|
+
border-radius: 4px;
|
15
|
+
font-size: 14px;
|
16
|
+
}
|
17
|
+
|
18
|
+
&--large {
|
19
|
+
height: 40px;
|
20
|
+
padding-left: 32px;
|
21
|
+
padding-right: 32px;
|
22
|
+
border-radius: 8px;
|
23
|
+
font-size: 16px;
|
24
|
+
}
|
25
|
+
|
26
|
+
&__link{
|
27
|
+
padding: 0 !important;
|
28
|
+
border: 0 !important;
|
29
|
+
}
|
30
|
+
|
31
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import type { CascaderProps as AntCascaderProps } from 'antd';
|
2
|
+
import { Cascader as AntCascader } from 'antd';
|
3
|
+
import { CascaderRef, DefaultOptionType } from 'antd/es/cascader';
|
4
|
+
import React from 'react';
|
5
|
+
import './index.scss';
|
6
|
+
export type CascaderProps<OptionType extends DefaultOptionType = DefaultOptionType, ValueField extends keyof OptionType = keyof OptionType, Multiple extends boolean = boolean> = AntCascaderProps<OptionType, ValueField, Multiple>;
|
7
|
+
type AntCascaderType = typeof AntCascader;
|
8
|
+
export type CascaderType = typeof CascaderComponent & Pick<AntCascaderType, 'Panel' | 'SHOW_CHILD' | 'SHOW_PARENT'>;
|
9
|
+
declare const CascaderComponent: React.ForwardRefExoticComponent<CascaderProps<any, string | number | symbol, boolean> & React.RefAttributes<CascaderRef>>;
|
10
|
+
export declare const Cascader: CascaderType;
|
11
|
+
export {};
|
@@ -0,0 +1,23 @@
|
|
1
|
+
var _excluded = ["popupClassName"];
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
3
|
+
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; }
|
4
|
+
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; }
|
5
|
+
import { Cascader as AntCascader } from 'antd';
|
6
|
+
import React, { forwardRef } from 'react';
|
7
|
+
import { useBem } from "../hooks/useBem";
|
8
|
+
import "./index.scss";
|
9
|
+
var CascaderComponent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
10
|
+
var popupClassName = _ref.popupClassName,
|
11
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
12
|
+
var mb = useBem('cascader');
|
13
|
+
return /*#__PURE__*/React.createElement(AntCascader, _extends({
|
14
|
+
ref: ref
|
15
|
+
}, rest, {
|
16
|
+
popupClassName: "".concat(mb, " ").concat(popupClassName !== null && popupClassName !== void 0 ? popupClassName : '')
|
17
|
+
}));
|
18
|
+
});
|
19
|
+
export var Cascader = CascaderComponent;
|
20
|
+
Cascader.displayName = 'Cascader';
|
21
|
+
Cascader.Panel = AntCascader.Panel;
|
22
|
+
Cascader.SHOW_CHILD = AntCascader.SHOW_CHILD;
|
23
|
+
Cascader.SHOW_PARENT = AntCascader.SHOW_PARENT;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import type { CheckboxProps as AntCheckboxProps } from 'antd';
|
2
|
+
import { Checkbox as AntCheckBox } from 'antd';
|
3
|
+
import { CheckboxRef } from 'antd/es/checkbox';
|
4
|
+
import React from 'react';
|
5
|
+
export type CheckboxProps = AntCheckboxProps;
|
6
|
+
type AntCheckBoxType = typeof AntCheckBox;
|
7
|
+
type CheckboxType = typeof AntCheckBox & Pick<AntCheckBoxType, 'Group'>;
|
8
|
+
export declare const CheckboxComponent: React.ForwardRefExoticComponent<AntCheckboxProps & React.RefAttributes<CheckboxRef>>;
|
9
|
+
export declare const Checkbox: CheckboxType;
|
10
|
+
export {};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
2
|
+
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
|
3
|
+
import { Checkbox as AntCheckBox } from 'antd';
|
4
|
+
import React, { forwardRef } from 'react';
|
5
|
+
export var CheckboxComponent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
6
|
+
var rest = Object.assign({}, (_objectDestructuringEmpty(_ref), _ref));
|
7
|
+
return /*#__PURE__*/React.createElement(AntCheckBox, _extends({
|
8
|
+
ref: ref
|
9
|
+
}, rest));
|
10
|
+
});
|
11
|
+
export var Checkbox = CheckboxComponent;
|
12
|
+
Checkbox.displayName = 'Checkbox';
|
13
|
+
Checkbox.Group = AntCheckBox.Group;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import type { ColorPickerProps as AntColorPickerProps } from 'antd';
|
3
|
+
export type ColorPickerProps = AntColorPickerProps;
|
4
|
+
export declare const ColorPicker: import("react").FC<AntColorPickerProps> & {
|
5
|
+
_InternalPanelDoNotUseOrYouWillBeFired: (props: import("antd/es/_util/type").AnyObject) => import("react").JSX.Element;
|
6
|
+
};
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import type { ConfigProviderProps as AntConfigProviderProps } from 'antd';
|
2
|
+
import { ConfigProvider as AntConfigProvider } from 'antd';
|
3
|
+
import { AxiosInstance } from 'axios';
|
4
|
+
import { FC } from 'react';
|
5
|
+
import 'dayjs/locale/zh-cn';
|
6
|
+
export type ConfigProviderProps = AntConfigProviderProps & {
|
7
|
+
request?: AxiosInstance;
|
8
|
+
baseURL?: string;
|
9
|
+
assetsURL?: string;
|
10
|
+
theme?: AntConfigProviderProps['theme'] & {
|
11
|
+
yotToken: {
|
12
|
+
colorModalPrimary: string;
|
13
|
+
colorModalSecondary: string;
|
14
|
+
colorModalTertiary: string;
|
15
|
+
colorModalQuaternary: string;
|
16
|
+
colorModalQuinary: string;
|
17
|
+
colorGroupPrimary: string;
|
18
|
+
colorGroupSecondary: string;
|
19
|
+
};
|
20
|
+
};
|
21
|
+
};
|
22
|
+
type ConfigProviderType = typeof AntConfigProvider;
|
23
|
+
export declare const ConfigProvider: FC<ConfigProviderProps> & Pick<ConfigProviderType, 'ConfigContext' | 'SizeContext' | 'config' | 'useConfig'>;
|
24
|
+
export {};
|
@@ -0,0 +1,34 @@
|
|
1
|
+
var _excluded = ["request", "baseURL", "assetsURL"];
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
3
|
+
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; }
|
4
|
+
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; }
|
5
|
+
import { ConfigProvider as AntConfigProvider } from 'antd';
|
6
|
+
import zhCN from 'antd/locale/zh_CN';
|
7
|
+
import React from 'react';
|
8
|
+
import { ConfigContext } from "./context";
|
9
|
+
import 'dayjs/locale/zh-cn';
|
10
|
+
export var ConfigProvider = function ConfigProvider(_ref) {
|
11
|
+
var _props$theme;
|
12
|
+
var request = _ref.request,
|
13
|
+
baseURL = _ref.baseURL,
|
14
|
+
assetsURL = _ref.assetsURL,
|
15
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
16
|
+
if (((_props$theme = props.theme) === null || _props$theme === void 0 ? void 0 : _props$theme.yotToken) != null) {
|
17
|
+
// 生成 css 变量
|
18
|
+
var cssVar = ":root {\n --yot-modal-color-primary: ".concat(props.theme.yotToken.colorModalPrimary, ";\n --yot-modal-color-secondary: ").concat(props.theme.yotToken.colorModalSecondary, ";\n --yot-modal-color-tertiary: ").concat(props.theme.yotToken.colorModalTertiary, ";\n --yot-modal-color-quaternary: ").concat(props.theme.yotToken.colorModalQuaternary, ";\n --yot-modal-color-quinary: ").concat(props.theme.yotToken.colorModalQuinary, ";\n --yot-group-color-primary: ").concat(props.theme.yotToken.colorGroupPrimary, ";\n --yot-group-color-secondary: ").concat(props.theme.yotToken.colorGroupSecondary, ";\n }");
|
19
|
+
document.head.appendChild(document.createElement('style')).innerHTML = cssVar;
|
20
|
+
}
|
21
|
+
return /*#__PURE__*/React.createElement(ConfigContext.Provider, {
|
22
|
+
value: {
|
23
|
+
request: request,
|
24
|
+
baseURL: baseURL,
|
25
|
+
assetsURL: assetsURL
|
26
|
+
}
|
27
|
+
}, /*#__PURE__*/React.createElement(AntConfigProvider, _extends({}, props, {
|
28
|
+
locale: zhCN
|
29
|
+
})));
|
30
|
+
};
|
31
|
+
ConfigProvider.ConfigContext = AntConfigProvider.ConfigContext;
|
32
|
+
ConfigProvider.SizeContext = AntConfigProvider.SizeContext;
|
33
|
+
ConfigProvider.config = AntConfigProvider.config;
|
34
|
+
ConfigProvider.useConfig = AntConfigProvider.useConfig;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
2
|
+
import React, { FC } from 'react';
|
3
|
+
type PickerType = 'date' | 'week' | 'month' | 'quarter' | 'year';
|
4
|
+
type DateIntervalProps = {
|
5
|
+
value?: {
|
6
|
+
pickerType: PickerType;
|
7
|
+
pickerValue?: Dayjs;
|
8
|
+
};
|
9
|
+
onChange?: ({ pickerType, pickerValue, }: {
|
10
|
+
pickerType: PickerType;
|
11
|
+
pickerValue?: Dayjs;
|
12
|
+
}) => void;
|
13
|
+
style?: React.CSSProperties[];
|
14
|
+
};
|
15
|
+
export declare const DateInterval: FC<DateIntervalProps>;
|
16
|
+
export {};
|
@@ -0,0 +1,82 @@
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
2
|
+
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."); }
|
3
|
+
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); }
|
4
|
+
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; }
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
7
|
+
import { DatePicker, Select, Space } from 'antd';
|
8
|
+
import React, { useEffect, useState } from 'react';
|
9
|
+
export var DateInterval = function DateInterval(_ref) {
|
10
|
+
var _style$, _style$2, _style$3;
|
11
|
+
var onChange = _ref.onChange,
|
12
|
+
_ref$value = _ref.value,
|
13
|
+
value = _ref$value === void 0 ? {
|
14
|
+
pickerType: 'date'
|
15
|
+
} : _ref$value,
|
16
|
+
style = _ref.style;
|
17
|
+
// Select下拉框所选值
|
18
|
+
var _useState = useState('date'),
|
19
|
+
_useState2 = _slicedToArray(_useState, 2),
|
20
|
+
type = _useState2[0],
|
21
|
+
setType = _useState2[1];
|
22
|
+
// DatePicker所选择的值
|
23
|
+
var _useState3 = useState(),
|
24
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
25
|
+
date = _useState4[0],
|
26
|
+
setDate = _useState4[1];
|
27
|
+
// Select下拉框的onChange事件
|
28
|
+
var selectOnChange = function selectOnChange(e) {
|
29
|
+
setType(e);
|
30
|
+
onChange === null || onChange === void 0 || onChange({
|
31
|
+
pickerType: e,
|
32
|
+
pickerValue: date
|
33
|
+
});
|
34
|
+
};
|
35
|
+
// DatePicker组件的onChange事件
|
36
|
+
var datePickerOnChange = function datePickerOnChange(e) {
|
37
|
+
setDate(e);
|
38
|
+
onChange === null || onChange === void 0 || onChange({
|
39
|
+
pickerType: type,
|
40
|
+
pickerValue: e
|
41
|
+
});
|
42
|
+
};
|
43
|
+
// 给type设置初始值
|
44
|
+
useEffect(function () {
|
45
|
+
var _value$pickerType;
|
46
|
+
setType((_value$pickerType = value === null || value === void 0 ? void 0 : value.pickerType) !== null && _value$pickerType !== void 0 ? _value$pickerType : 'date');
|
47
|
+
}, [value]);
|
48
|
+
// 给时间选择框设置初始值
|
49
|
+
useEffect(function () {
|
50
|
+
setDate(value === null || value === void 0 ? void 0 : value.pickerValue);
|
51
|
+
}, [value]);
|
52
|
+
return /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Select, {
|
53
|
+
value: type,
|
54
|
+
options: [{
|
55
|
+
label: '日期',
|
56
|
+
value: 'date'
|
57
|
+
}, {
|
58
|
+
label: '周',
|
59
|
+
value: 'week'
|
60
|
+
}, {
|
61
|
+
label: '月份',
|
62
|
+
value: 'month'
|
63
|
+
}, {
|
64
|
+
label: '季度',
|
65
|
+
value: 'quarter'
|
66
|
+
}, {
|
67
|
+
label: '年份',
|
68
|
+
value: 'year'
|
69
|
+
}],
|
70
|
+
onChange: selectOnChange,
|
71
|
+
style: (_style$ = style === null || style === void 0 ? void 0 : style[0]) !== null && _style$ !== void 0 ? _style$ : {}
|
72
|
+
}), type === 'date' ? /*#__PURE__*/React.createElement(DatePicker, {
|
73
|
+
value: date,
|
74
|
+
onChange: datePickerOnChange,
|
75
|
+
style: (_style$2 = style === null || style === void 0 ? void 0 : style[1]) !== null && _style$2 !== void 0 ? _style$2 : {}
|
76
|
+
}) : /*#__PURE__*/React.createElement(DatePicker, {
|
77
|
+
value: date,
|
78
|
+
picker: type,
|
79
|
+
onChange: datePickerOnChange,
|
80
|
+
style: (_style$3 = style === null || style === void 0 ? void 0 : style[1]) !== null && _style$3 !== void 0 ? _style$3 : {}
|
81
|
+
}));
|
82
|
+
};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
2
|
+
import React, { FC } from 'react';
|
3
|
+
type PickerType = 'date' | 'week' | 'month' | 'quarter' | 'year';
|
4
|
+
type DateRangeProps = {
|
5
|
+
value?: {
|
6
|
+
pickerType: PickerType;
|
7
|
+
pickerValue?: [Dayjs, Dayjs];
|
8
|
+
};
|
9
|
+
onChange?: ({ pickerType, pickerValue, }: {
|
10
|
+
pickerType: PickerType;
|
11
|
+
pickerValue?: [Dayjs, Dayjs];
|
12
|
+
}) => void;
|
13
|
+
style?: React.CSSProperties[];
|
14
|
+
};
|
15
|
+
export declare const DateRange: FC<DateRangeProps>;
|
16
|
+
export {};
|
@@ -0,0 +1,83 @@
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
2
|
+
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."); }
|
3
|
+
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); }
|
4
|
+
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; }
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
7
|
+
import { DatePicker, Select, Space } from 'antd';
|
8
|
+
import React, { useEffect, useState } from 'react';
|
9
|
+
var RangePicker = DatePicker.RangePicker;
|
10
|
+
export var DateRange = function DateRange(_ref) {
|
11
|
+
var _style$, _style$2, _style$3;
|
12
|
+
var style = _ref.style,
|
13
|
+
onChange = _ref.onChange,
|
14
|
+
_ref$value = _ref.value,
|
15
|
+
value = _ref$value === void 0 ? {
|
16
|
+
pickerType: 'date'
|
17
|
+
} : _ref$value;
|
18
|
+
// Select下拉框所选值
|
19
|
+
var _useState = useState('date'),
|
20
|
+
_useState2 = _slicedToArray(_useState, 2),
|
21
|
+
type = _useState2[0],
|
22
|
+
setType = _useState2[1];
|
23
|
+
// 时间选择框所选的时间
|
24
|
+
var _useState3 = useState(),
|
25
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
26
|
+
date = _useState4[0],
|
27
|
+
setDate = _useState4[1];
|
28
|
+
// 时间选择框的onChange事件
|
29
|
+
var handleRangeChange = function handleRangeChange(e) {
|
30
|
+
setDate(e);
|
31
|
+
onChange === null || onChange === void 0 || onChange({
|
32
|
+
pickerType: type,
|
33
|
+
pickerValue: e
|
34
|
+
});
|
35
|
+
};
|
36
|
+
// Select下拉框的onChange事件
|
37
|
+
var handleSelectChange = function handleSelectChange(e) {
|
38
|
+
setType(e);
|
39
|
+
onChange === null || onChange === void 0 || onChange({
|
40
|
+
pickerType: e,
|
41
|
+
pickerValue: date
|
42
|
+
});
|
43
|
+
};
|
44
|
+
// 给type设置初始值
|
45
|
+
useEffect(function () {
|
46
|
+
var _value$pickerType;
|
47
|
+
setType((_value$pickerType = value === null || value === void 0 ? void 0 : value.pickerType) !== null && _value$pickerType !== void 0 ? _value$pickerType : 'date');
|
48
|
+
}, [value]);
|
49
|
+
// 给date设置初始值
|
50
|
+
useEffect(function () {
|
51
|
+
setDate(value === null || value === void 0 ? void 0 : value.pickerValue);
|
52
|
+
}, [value]);
|
53
|
+
return /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Select, {
|
54
|
+
value: type,
|
55
|
+
options: [{
|
56
|
+
label: '日期',
|
57
|
+
value: 'date'
|
58
|
+
}, {
|
59
|
+
label: '周',
|
60
|
+
value: 'week'
|
61
|
+
}, {
|
62
|
+
label: '月份',
|
63
|
+
value: 'month'
|
64
|
+
}, {
|
65
|
+
label: '季度',
|
66
|
+
value: 'quarter'
|
67
|
+
}, {
|
68
|
+
label: '年份',
|
69
|
+
value: 'year'
|
70
|
+
}],
|
71
|
+
style: (_style$ = style === null || style === void 0 ? void 0 : style[0]) !== null && _style$ !== void 0 ? _style$ : {},
|
72
|
+
onChange: handleSelectChange
|
73
|
+
}), type === 'date' ? /*#__PURE__*/React.createElement(RangePicker, {
|
74
|
+
onChange: handleRangeChange,
|
75
|
+
value: date,
|
76
|
+
style: (_style$2 = style === null || style === void 0 ? void 0 : style[1]) !== null && _style$2 !== void 0 ? _style$2 : {}
|
77
|
+
}) : /*#__PURE__*/React.createElement(RangePicker, {
|
78
|
+
picker: type,
|
79
|
+
value: date,
|
80
|
+
onChange: handleRangeChange,
|
81
|
+
style: (_style$3 = style === null || style === void 0 ? void 0 : style[1]) !== null && _style$3 !== void 0 ? _style$3 : {}
|
82
|
+
}));
|
83
|
+
};
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import { Descriptions as AntDescriptions } from 'antd';
|
2
|
+
export type { DescriptionsContext, DescriptionsContextProps, DescriptionsItemType, DescriptionsProps, InternalDescriptionsItemType, } from 'antd/es/descriptions';
|
3
|
+
export declare const Descriptions: typeof AntDescriptions;
|
@@ -0,0 +1,45 @@
|
|
1
|
+
var _excluded = ["dictType", "showSearch", "style"];
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
3
|
+
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; }
|
4
|
+
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; }
|
5
|
+
import { useQuery } from '@tanstack/react-query';
|
6
|
+
import React, { useMemo } from 'react';
|
7
|
+
import { Select } from "./..";
|
8
|
+
import { useRequest } from "../hooks/useRequest";
|
9
|
+
export var Dictionary = function Dictionary(_ref) {
|
10
|
+
var dictType = _ref.dictType,
|
11
|
+
_ref$showSearch = _ref.showSearch,
|
12
|
+
showSearch = _ref$showSearch === void 0 ? false : _ref$showSearch,
|
13
|
+
_ref$style = _ref.style,
|
14
|
+
style = _ref$style === void 0 ? {
|
15
|
+
width: 210,
|
16
|
+
height: 32
|
17
|
+
} : _ref$style,
|
18
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
19
|
+
var request = useRequest();
|
20
|
+
// 查询字典数据
|
21
|
+
var _useQuery = useQuery({
|
22
|
+
queryKey: ['dictionaryData'],
|
23
|
+
queryFn: function queryFn() {
|
24
|
+
return request("/v1/dicts/".concat(dictType));
|
25
|
+
}
|
26
|
+
}),
|
27
|
+
dictionaryData = _useQuery.data;
|
28
|
+
console.log('dictionaryData', dictionaryData);
|
29
|
+
// 将字典数据处理成下拉框数据
|
30
|
+
var dictionaryOptions = useMemo(function () {
|
31
|
+
var _dictionaryData$conte;
|
32
|
+
return dictionaryData === null || dictionaryData === void 0 || (_dictionaryData$conte = dictionaryData.content) === null || _dictionaryData$conte === void 0 ? void 0 : _dictionaryData$conte.map(function (item) {
|
33
|
+
return {
|
34
|
+
label: item.dictTitle,
|
35
|
+
value: item.dictValue
|
36
|
+
};
|
37
|
+
});
|
38
|
+
}, [dictionaryData]);
|
39
|
+
return /*#__PURE__*/React.createElement(Select, _extends({
|
40
|
+
options: dictionaryOptions,
|
41
|
+
style: style,
|
42
|
+
showSearch: showSearch,
|
43
|
+
optionFilterProp: "label"
|
44
|
+
}, rest));
|
45
|
+
};
|
@@ -0,0 +1,14 @@
|
|
1
|
+
export interface PageData<T> {
|
2
|
+
content: T[];
|
3
|
+
page: {
|
4
|
+
number: number;
|
5
|
+
size: number;
|
6
|
+
totalElements: number;
|
7
|
+
totalPages: number;
|
8
|
+
};
|
9
|
+
}
|
10
|
+
export interface dictionaryItem {
|
11
|
+
dictValue: string; // 字典项编码
|
12
|
+
dictTitle: string; // 字典项名称
|
13
|
+
dictTitle2?: string; // 字典项描述
|
14
|
+
}
|