@jiaozhiye/qm-design-react 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +4 -0
- package/lib/_utils/cloneElement.d.ts +2 -0
- package/lib/_utils/dom.d.ts +68 -0
- package/lib/_utils/download.d.ts +7 -0
- package/lib/_utils/error.d.ts +2 -0
- package/lib/_utils/isServer.d.ts +2 -0
- package/lib/_utils/prefix.d.ts +1 -0
- package/lib/_utils/resize-event.d.ts +10 -0
- package/lib/_utils/scrollbar-width.d.ts +1 -0
- package/lib/_utils/types.d.ts +33 -0
- package/lib/_utils/util.d.ts +23 -0
- package/lib/_utils/validators.d.ts +2 -0
- package/lib/anchor/index.d.ts +4 -0
- package/lib/anchor/src/anchor-item.d.ts +13 -0
- package/lib/anchor/src/anchor-nav.d.ts +12 -0
- package/lib/anchor/src/anchor.d.ts +52 -0
- package/lib/anchor/style/index.less +60 -0
- package/lib/antd/Calendar.d.ts +4 -0
- package/lib/antd/DatePicker.d.ts +11 -0
- package/lib/antd/TimePicker.d.ts +14 -0
- package/lib/antd/index.d.ts +123 -0
- package/lib/antd/index.less +7 -0
- package/lib/button/index.d.ts +3 -0
- package/lib/button/src/button.d.ts +30 -0
- package/lib/button/style/index.less +12 -0
- package/lib/config-provider/context.d.ts +9 -0
- package/lib/config-provider/index.d.ts +3 -0
- package/lib/config-provider/src/config-provider.d.ts +34 -0
- package/lib/countup/index.d.ts +3 -0
- package/lib/countup/src/countup.d.ts +17 -0
- package/lib/countup/style/index.less +22 -0
- package/lib/cropper/index.d.ts +3 -0
- package/lib/cropper/src/cropper.d.ts +213 -0
- package/lib/cropper/style/index.less +13 -0
- package/lib/divider/index.d.ts +3 -0
- package/lib/divider/src/divider.d.ts +25 -0
- package/lib/divider/style/index.less +54 -0
- package/lib/download/index.d.ts +3 -0
- package/lib/download/src/download.d.ts +51 -0
- package/lib/download/style/index.less +12 -0
- package/lib/drawer/index.d.ts +3 -0
- package/lib/drawer/src/drawer.d.ts +33 -0
- package/lib/drawer/style/index.less +77 -0
- package/lib/empty/index.d.ts +3 -0
- package/lib/empty/src/empty.d.ts +15 -0
- package/lib/empty/style/index.less +35 -0
- package/lib/form/index.d.ts +4 -0
- package/lib/form/src/china-data.d.ts +4577 -0
- package/lib/form/src/context.d.ts +6 -0
- package/lib/form/src/fields-filter.d.ts +26 -0
- package/lib/form/src/form-cascader.d.ts +21 -0
- package/lib/form/src/form-checkbox-group.d.ts +18 -0
- package/lib/form/src/form-checkbox.d.ts +10 -0
- package/lib/form/src/form-city-select.d.ts +10 -0
- package/lib/form/src/form-date.d.ts +10 -0
- package/lib/form/src/form-divider.d.ts +10 -0
- package/lib/form/src/form-immediate.d.ts +10 -0
- package/lib/form/src/form-input-number.d.ts +10 -0
- package/lib/form/src/form-input.d.ts +10 -0
- package/lib/form/src/form-radio.d.ts +18 -0
- package/lib/form/src/form-range-date.d.ts +10 -0
- package/lib/form/src/form-range-input-number.d.ts +10 -0
- package/lib/form/src/form-range-input.d.ts +10 -0
- package/lib/form/src/form-range-time.d.ts +10 -0
- package/lib/form/src/form-region-select.d.ts +10 -0
- package/lib/form/src/form-search-helper.d.ts +10 -0
- package/lib/form/src/form-select.d.ts +21 -0
- package/lib/form/src/form-switch.d.ts +10 -0
- package/lib/form/src/form-text-area.d.ts +10 -0
- package/lib/form/src/form-time.d.ts +10 -0
- package/lib/form/src/form-tinymce.d.ts +10 -0
- package/lib/form/src/form-tree-select.d.ts +23 -0
- package/lib/form/src/form-upload-file.d.ts +18 -0
- package/lib/form/src/form-upload-img.d.ts +18 -0
- package/lib/form/src/form.d.ts +169 -0
- package/lib/form/src/types.d.ts +251 -0
- package/lib/form/src/utils.d.ts +7 -0
- package/lib/form/style/index.less +243 -0
- package/lib/hooks/useForceUpdate.d.ts +1 -0
- package/lib/hooks/useOutsideClick.d.ts +2 -0
- package/lib/hooks/useResizeObserve.d.ts +5 -0
- package/lib/hooks/useUpdateEffect.d.ts +2 -0
- package/lib/index.d.ts +42 -0
- package/lib/index.esm.js +16 -0
- package/lib/index.full.js +1 -0
- package/lib/index.js +16 -0
- package/lib/locale/index.d.ts +11 -0
- package/lib/locale/index.js +51 -0
- package/lib/locale/lang/en.d.ts +243 -0
- package/lib/locale/lang/en.js +248 -0
- package/lib/locale/lang/zh-cn.d.ts +243 -0
- package/lib/locale/lang/zh-cn.js +248 -0
- package/lib/modal/index.d.ts +3 -0
- package/lib/modal/src/modal.d.ts +38 -0
- package/lib/modal/style/index.less +89 -0
- package/lib/pinyin/core.d.ts +12 -0
- package/lib/pinyin/dict.d.ts +31 -0
- package/lib/pinyin/index.d.ts +2 -0
- package/lib/pinyin/patchers/56l.d.ts +7 -0
- package/lib/qm-design.d.ts +28 -0
- package/lib/search-helper/index.d.ts +3 -0
- package/lib/search-helper/src/search-helper.d.ts +20 -0
- package/lib/search-helper/style/index.less +13 -0
- package/lib/space/index.d.ts +3 -0
- package/lib/space/src/space.d.ts +12 -0
- package/lib/space/style/index.less +12 -0
- package/lib/spin/index.d.ts +3 -0
- package/lib/spin/src/spin.d.ts +11 -0
- package/lib/spin/style/index.less +12 -0
- package/lib/split/index.d.ts +4 -0
- package/lib/split/src/context.d.ts +8 -0
- package/lib/split/src/resize-bar.d.ts +8 -0
- package/lib/split/src/split-pane.d.ts +9 -0
- package/lib/split/src/split.d.ts +14 -0
- package/lib/split/style/index.less +86 -0
- package/lib/style/common.less +8 -0
- package/lib/style/index.css +1 -0
- package/lib/style/index.less +32 -0
- package/lib/style/mixins/box.less +13 -0
- package/lib/style/mixins/clearfix.less +21 -0
- package/lib/style/mixins/index.less +11 -0
- package/lib/style/mixins/operation-unit.less +24 -0
- package/lib/style/mixins/reset.less +35 -0
- package/lib/style/mixins/size.less +15 -0
- package/lib/style/reset.less +134 -0
- package/lib/style/themes/default.less +113 -0
- package/lib/style/themes/index.less +7 -0
- package/lib/table/index.d.ts +4 -0
- package/lib/table/src/alert/index.d.ts +6 -0
- package/lib/table/src/body/index.d.ts +8 -0
- package/lib/table/src/body/useValueFormat.d.ts +12 -0
- package/lib/table/src/column-filter/index.d.ts +7 -0
- package/lib/table/src/config/index.d.ts +47 -0
- package/lib/table/src/context/index.d.ts +74 -0
- package/lib/table/src/edit/InputNumber.d.ts +17 -0
- package/lib/table/src/edit/index.d.ts +12 -0
- package/lib/table/src/empty/index.d.ts +3 -0
- package/lib/table/src/expandable/index.d.ts +8 -0
- package/lib/table/src/export/define.d.ts +8 -0
- package/lib/table/src/export/index.d.ts +18 -0
- package/lib/table/src/export/setting.d.ts +8 -0
- package/lib/table/src/export/useExport.d.ts +9 -0
- package/lib/table/src/filter/index.d.ts +8 -0
- package/lib/table/src/filter-sql/index.d.ts +5 -0
- package/lib/table/src/filter-sql/lib/filter_string.d.ts +11 -0
- package/lib/table/src/filter-sql/lib/operations.d.ts +8 -0
- package/lib/table/src/filter-sql/lib/variables_replacement.d.ts +5 -0
- package/lib/table/src/footer/index.d.ts +8 -0
- package/lib/table/src/full-screen/index.d.ts +6 -0
- package/lib/table/src/group-summary/index.d.ts +3 -0
- package/lib/table/src/group-summary/result.d.ts +9 -0
- package/lib/table/src/group-summary/setting.d.ts +6 -0
- package/lib/table/src/header/index.d.ts +10 -0
- package/lib/table/src/hooks/useImperativeMethod.d.ts +36 -0
- package/lib/table/src/hooks/useTableCore.d.ts +86 -0
- package/lib/table/src/hooks/useTableEffect.d.ts +35 -0
- package/lib/table/src/hooks/useTableLayout.d.ts +39 -0
- package/lib/table/src/hooks/useTableMemo.d.ts +43 -0
- package/lib/table/src/hooks/useTableRef.d.ts +89 -0
- package/lib/table/src/hooks/useTableState.d.ts +94 -0
- package/lib/table/src/icon/caretdown.d.ts +3 -0
- package/lib/table/src/icon/caretup.d.ts +3 -0
- package/lib/table/src/icon/filter.d.ts +3 -0
- package/lib/table/src/manager/index.d.ts +15 -0
- package/lib/table/src/pager/index.d.ts +11 -0
- package/lib/table/src/print/index.d.ts +7 -0
- package/lib/table/src/reload/index.d.ts +3 -0
- package/lib/table/src/resizable/index.d.ts +7 -0
- package/lib/table/src/select-collection/index.d.ts +7 -0
- package/lib/table/src/select-collection/result.d.ts +8 -0
- package/lib/table/src/selection/all.d.ts +7 -0
- package/lib/table/src/selection/index.d.ts +12 -0
- package/lib/table/src/store/index.d.ts +29 -0
- package/lib/table/src/super-search/index.d.ts +3 -0
- package/lib/table/src/super-search/result.d.ts +6 -0
- package/lib/table/src/table/index.d.ts +5 -0
- package/lib/table/src/table/props.d.ts +243 -0
- package/lib/table/src/table/types.d.ts +335 -0
- package/lib/table/src/utils/index.d.ts +37 -0
- package/lib/table/style/alert.less +34 -0
- package/lib/table/style/body.less +42 -0
- package/lib/table/style/column-filter.less +88 -0
- package/lib/table/style/empty.less +16 -0
- package/lib/table/style/expandable.less +55 -0
- package/lib/table/style/export.less +30 -0
- package/lib/table/style/footer.less +28 -0
- package/lib/table/style/full-screen.less +21 -0
- package/lib/table/style/group-summary.less +93 -0
- package/lib/table/style/header.less +178 -0
- package/lib/table/style/index.less +25 -0
- package/lib/table/style/pager.less +12 -0
- package/lib/table/style/print.less +21 -0
- package/lib/table/style/reload.less +21 -0
- package/lib/table/style/select-collection.less +21 -0
- package/lib/table/style/size.less +69 -0
- package/lib/table/style/super-search.less +102 -0
- package/lib/table/style/table.less +328 -0
- package/lib/table/style/toper.less +28 -0
- package/lib/table/style/variable.less +48 -0
- package/lib/tabs/index.d.ts +4 -0
- package/lib/tabs/src/tab-pane.d.ts +8 -0
- package/lib/tabs/src/tabs.d.ts +16 -0
- package/lib/tabs/style/index.less +22 -0
- package/lib/tinymce/index.d.ts +3 -0
- package/lib/tinymce/src/Events.d.ts +78 -0
- package/lib/tinymce/src/ScriptLoader.d.ts +13 -0
- package/lib/tinymce/src/TinyMCE.d.ts +2 -0
- package/lib/tinymce/src/Utils.d.ts +19 -0
- package/lib/tinymce/src/components/Editor.d.ts +66 -0
- package/lib/tinymce/src/components/EditorPropTypes.d.ts +18 -0
- package/lib/tinymce/src/index.d.ts +29 -0
- package/lib/tinymce/style/index.less +18 -0
- package/lib/upload-file/index.d.ts +3 -0
- package/lib/upload-file/src/upload-file.d.ts +16 -0
- package/lib/upload-file/style/index.less +12 -0
- package/lib/upload-img/index.d.ts +3 -0
- package/lib/upload-img/src/cropper-preview.d.ts +30 -0
- package/lib/upload-img/src/upload-img.d.ts +27 -0
- package/lib/upload-img/style/index.less +36 -0
- package/lib/version/index.d.ts +2 -0
- package/package.json +136 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare type callbackFn = () => void;
|
|
2
|
+
export interface IStateObj {
|
|
3
|
+
listeners: callbackFn[];
|
|
4
|
+
scriptId: string;
|
|
5
|
+
scriptLoading: boolean;
|
|
6
|
+
scriptLoaded: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface ScriptLoader {
|
|
9
|
+
load: (doc: Document, url: string, async: boolean, defer: boolean, delay: number, callback: callbackFn) => void;
|
|
10
|
+
reinitialize: () => void;
|
|
11
|
+
}
|
|
12
|
+
declare const ScriptLoader: ScriptLoader;
|
|
13
|
+
export { ScriptLoader };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2017-present, Ephox, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache 2 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import { IEventPropTypes } from './components/EditorPropTypes';
|
|
9
|
+
import { IAllProps } from './components/Editor';
|
|
10
|
+
export declare const isFunction: (x: unknown) => boolean;
|
|
11
|
+
declare type PropLookup = <K extends keyof IAllProps>(key: K) => IAllProps[K] | undefined;
|
|
12
|
+
export declare const configHandlers2: <H>(handlerLookup: PropLookup, on: (name: string, handler: H) => void, off: (name: string, handler: H) => void, adapter: <K extends keyof import("./Events").IEvents>(lookup: PropLookup, key: K) => H, prevProps: Partial<IAllProps>, props: Partial<IAllProps>, boundHandlers: Record<string, H>) => void;
|
|
13
|
+
export declare const configHandlers: (editor: any, prevProps: Partial<IAllProps>, props: Partial<IAllProps>, boundHandlers: Record<string, (event: any) => unknown>, lookup: PropLookup) => void;
|
|
14
|
+
export declare const uuid: (prefix: string) => string;
|
|
15
|
+
export declare const isTextareaOrInput: (element: Element | null) => element is HTMLInputElement | HTMLTextAreaElement;
|
|
16
|
+
export declare const mergePlugins: (initPlugins: string | string[] | undefined, inputPlugins: string | string[] | undefined) => string[];
|
|
17
|
+
export declare const isBeforeInputEventAvailable: () => boolean;
|
|
18
|
+
export declare const isInDoc: (elem: Node) => boolean;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2017-present, Ephox, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache 2 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import * as React from 'react';
|
|
9
|
+
import { IEvents } from '../Events';
|
|
10
|
+
import { IEditorPropTypes } from './EditorPropTypes';
|
|
11
|
+
export interface IProps {
|
|
12
|
+
apiKey: string;
|
|
13
|
+
id: string;
|
|
14
|
+
inline: boolean;
|
|
15
|
+
initialValue: string;
|
|
16
|
+
onEditorChange: (a: string, editor: any) => void;
|
|
17
|
+
value: string;
|
|
18
|
+
init: any;
|
|
19
|
+
/** @deprecated use `editor.getContent({format: 'text' })` in `onEditorChange` prop instead */
|
|
20
|
+
outputFormat: 'html' | 'text';
|
|
21
|
+
tagName: string;
|
|
22
|
+
cloudChannel: string;
|
|
23
|
+
plugins: string[] | string;
|
|
24
|
+
toolbar: string[] | string;
|
|
25
|
+
disabled: boolean;
|
|
26
|
+
textareaName: string;
|
|
27
|
+
tinymceScriptSrc: string;
|
|
28
|
+
scriptLoading: {
|
|
29
|
+
async?: boolean;
|
|
30
|
+
defer?: boolean;
|
|
31
|
+
delay?: number;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export interface IAllProps extends Partial<IProps>, Partial<IEvents> {
|
|
35
|
+
}
|
|
36
|
+
export declare class Editor extends React.Component<IAllProps> {
|
|
37
|
+
static propTypes: IEditorPropTypes;
|
|
38
|
+
static defaultProps: Partial<IAllProps>;
|
|
39
|
+
editor?: any;
|
|
40
|
+
private id;
|
|
41
|
+
private elementRef;
|
|
42
|
+
private inline;
|
|
43
|
+
private currentContent?;
|
|
44
|
+
private boundHandlers;
|
|
45
|
+
private rollbackTimer;
|
|
46
|
+
private valueCursor;
|
|
47
|
+
constructor(props: Partial<IAllProps>);
|
|
48
|
+
componentDidUpdate(prevProps: Partial<IAllProps>): void;
|
|
49
|
+
componentDidMount(): void;
|
|
50
|
+
componentWillUnmount(): void;
|
|
51
|
+
render(): React.ReactElement<{
|
|
52
|
+
ref: React.RefObject<HTMLElement>;
|
|
53
|
+
id: string;
|
|
54
|
+
}, string | React.JSXElementConstructor<any>>;
|
|
55
|
+
private renderInline;
|
|
56
|
+
private renderIframe;
|
|
57
|
+
private getScriptSrc;
|
|
58
|
+
private getInitialValue;
|
|
59
|
+
private bindHandlers;
|
|
60
|
+
private rollbackChange;
|
|
61
|
+
private handleBeforeInput;
|
|
62
|
+
private handleBeforeInputSpecial;
|
|
63
|
+
private handleEditorChange;
|
|
64
|
+
private handleEditorChangeSpecial;
|
|
65
|
+
private initialise;
|
|
66
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2017-present, Ephox, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache 2 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import * as PropTypes from 'prop-types';
|
|
9
|
+
import { IEvents } from '../Events';
|
|
10
|
+
import { IProps } from './Editor';
|
|
11
|
+
export declare type CopyProps<T> = {
|
|
12
|
+
[P in keyof T]: PropTypes.Requireable<unknown>;
|
|
13
|
+
};
|
|
14
|
+
export declare type IEventPropTypes = CopyProps<IEvents>;
|
|
15
|
+
export interface IEditorPropTypes extends IEventPropTypes, CopyProps<IProps> {
|
|
16
|
+
}
|
|
17
|
+
export declare const eventPropTypes: IEventPropTypes;
|
|
18
|
+
export declare const EditorPropTypes: IEditorPropTypes;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { ComponentSize, CSSProperties } from '../../_utils/types';
|
|
3
|
+
declare type IProps = {
|
|
4
|
+
value?: string;
|
|
5
|
+
size?: ComponentSize;
|
|
6
|
+
height?: number | string;
|
|
7
|
+
tinymceScriptSrc?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
plugins?: string[] | string;
|
|
10
|
+
toolbar?: string[] | string;
|
|
11
|
+
className?: string;
|
|
12
|
+
style?: CSSProperties;
|
|
13
|
+
onChange?: (value: string) => void;
|
|
14
|
+
};
|
|
15
|
+
export declare type QmTinymceProps = IProps;
|
|
16
|
+
declare class QmTinymce extends Component<IProps> {
|
|
17
|
+
static contextType: React.Context<import("../../config-provider/context").IConfig | undefined>;
|
|
18
|
+
static propTypes: {
|
|
19
|
+
size: (props: any, propName: any, componentName: any) => void;
|
|
20
|
+
height: (props: any, propName: any, componentName: any) => void;
|
|
21
|
+
};
|
|
22
|
+
static defaultProps: {
|
|
23
|
+
height: number;
|
|
24
|
+
plugins: string;
|
|
25
|
+
toolbar: string;
|
|
26
|
+
};
|
|
27
|
+
render(): React.ReactElement;
|
|
28
|
+
}
|
|
29
|
+
export default QmTinymce;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: 焦质晔
|
|
3
|
+
* @Date: 2021-07-23 19:05:57
|
|
4
|
+
* @Last Modified by: 焦质晔
|
|
5
|
+
* @Last Modified time: 2021-07-31 22:38:07
|
|
6
|
+
*/
|
|
7
|
+
@import '../../style/common';
|
|
8
|
+
|
|
9
|
+
@prefix-tinymce: ~'@{qm-prefix}-tinymce';
|
|
10
|
+
|
|
11
|
+
.@{prefix-tinymce} {
|
|
12
|
+
.tox-fullscreen {
|
|
13
|
+
width: 100% !important;
|
|
14
|
+
}
|
|
15
|
+
.tox-statusbar__branding {
|
|
16
|
+
display: none;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import type { UploadProps } from '../../antd';
|
|
3
|
+
declare type IProps = UploadProps;
|
|
4
|
+
export declare type QmUploadFileProps = IProps;
|
|
5
|
+
declare class QmUploadFile extends Component<IProps> {
|
|
6
|
+
static defaultProps: {
|
|
7
|
+
name: string;
|
|
8
|
+
multiple: boolean;
|
|
9
|
+
showUploadList: {
|
|
10
|
+
showDownloadIcon: boolean;
|
|
11
|
+
downloadIcon: JSX.Element;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
render(): React.ReactElement;
|
|
15
|
+
}
|
|
16
|
+
export default QmUploadFile;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import type { CSSProperties } from '../../_utils/types';
|
|
3
|
+
declare type IProps = {
|
|
4
|
+
fixedSize?: [number, number];
|
|
5
|
+
quality?: number;
|
|
6
|
+
beforeCrop?: (file: any, fileList: any[]) => Promise<boolean>;
|
|
7
|
+
};
|
|
8
|
+
declare type IState = {
|
|
9
|
+
src: string;
|
|
10
|
+
};
|
|
11
|
+
declare class CropperPreview extends Component<IProps, IState> {
|
|
12
|
+
static contextType: React.Context<import("../../config-provider/context").IConfig | undefined>;
|
|
13
|
+
private cropperRef;
|
|
14
|
+
private beforeUploadRef;
|
|
15
|
+
private fileRef;
|
|
16
|
+
private resolveRef;
|
|
17
|
+
private rejectRef;
|
|
18
|
+
state: IState;
|
|
19
|
+
get previewSize(): CSSProperties;
|
|
20
|
+
setSrc(src: any): void;
|
|
21
|
+
renderUpload(): React.CElement<any, React.Component<any, any, any>> | null;
|
|
22
|
+
confirmHandle: () => Promise<void>;
|
|
23
|
+
scaleHandle(percent: number): void;
|
|
24
|
+
rotateHandle(deg: number): void;
|
|
25
|
+
renderCropper(): JSX.Element;
|
|
26
|
+
onOk: () => void;
|
|
27
|
+
onClose: () => void;
|
|
28
|
+
render(): React.ReactElement;
|
|
29
|
+
}
|
|
30
|
+
export default CropperPreview;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import type { UploadProps } from '../../antd';
|
|
3
|
+
declare type IProps = UploadProps & {
|
|
4
|
+
fixedSize?: [number, number] | undefined;
|
|
5
|
+
quality?: number;
|
|
6
|
+
beforeCrop?: (file: any, fileList: any[]) => Promise<boolean>;
|
|
7
|
+
};
|
|
8
|
+
declare type IState = {
|
|
9
|
+
previewVisible: boolean;
|
|
10
|
+
previewImage: string;
|
|
11
|
+
previewTitle: string;
|
|
12
|
+
};
|
|
13
|
+
export declare type QmUploadImgProps = IProps;
|
|
14
|
+
declare class QmUploadImg extends Component<IProps, IState> {
|
|
15
|
+
static defaultProps: {
|
|
16
|
+
name: string;
|
|
17
|
+
multiple: boolean;
|
|
18
|
+
accept: string;
|
|
19
|
+
listType: string;
|
|
20
|
+
quality: number;
|
|
21
|
+
};
|
|
22
|
+
state: IState;
|
|
23
|
+
get showUploadButton(): boolean;
|
|
24
|
+
handlePreview: (file: any) => Promise<void>;
|
|
25
|
+
render(): React.ReactElement;
|
|
26
|
+
}
|
|
27
|
+
export default QmUploadImg;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: 焦质晔
|
|
3
|
+
* @Date: 2021-07-23 19:05:57
|
|
4
|
+
* @Last Modified by: 焦质晔
|
|
5
|
+
* @Last Modified time: 2021-08-28 08:54:46
|
|
6
|
+
*/
|
|
7
|
+
@import '../../style/common';
|
|
8
|
+
|
|
9
|
+
@prefix-upload-img: ~'@{qm-prefix}-upload-img';
|
|
10
|
+
@prefix-cropper-preview: ~'@{qm-prefix}-cropper-preview';
|
|
11
|
+
|
|
12
|
+
.@{prefix-upload-img} {
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.@{prefix-cropper-preview} {
|
|
16
|
+
.cropper-preview {
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: row;
|
|
19
|
+
.cropper-area {
|
|
20
|
+
flex: 1;
|
|
21
|
+
.actions {
|
|
22
|
+
margin-top: @--margin-md;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
.preview-area {
|
|
26
|
+
width: 380px;
|
|
27
|
+
min-height: 380px;
|
|
28
|
+
margin-left: @--margin-md;
|
|
29
|
+
display: flex;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
.preview {
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jiaozhiye/qm-design-react",
|
|
3
|
+
"version": "1.0.0-beta.1",
|
|
4
|
+
"description": "A Component Library for React",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"React",
|
|
7
|
+
"components",
|
|
8
|
+
"typescript"
|
|
9
|
+
],
|
|
10
|
+
"author": "jiaozhiye",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"scripts": {
|
|
13
|
+
"dev": "cross-env NODE_ENV=development BABEL_ENV=web webpack serve --progress --config build/webpack.src.conf.js",
|
|
14
|
+
"build:lib": "yarn clean:lib && yarn build:umd && yarn build:esm && yarn build:type && yarn build:locale && yarn build:theme",
|
|
15
|
+
"build:umd": "cross-env NODE_ENV=production BABEL_ENV=lib webpack --config ./build/webpack.build.conf.js",
|
|
16
|
+
"build:esm": "cross-env BABEL_ENV=lib rollup --config ./build/build-esm.rollup.js",
|
|
17
|
+
"build:type": "gulp build --gulpfile ./build/build-type.gulp.js && cp-cli lib/packages lib && rimraf lib/packages",
|
|
18
|
+
"build:locale": "cross-env BABEL_ENV=lib babel packages/locale --extensions .ts --out-dir lib/locale",
|
|
19
|
+
"build:theme": "gulp build --gulpfile ./build/build-style.gulp.js",
|
|
20
|
+
"clean:lib": "rimraf lib",
|
|
21
|
+
"lint": "eslint ./packages --ext .js,.ts,.jsx,.tsx",
|
|
22
|
+
"lint-fix": "eslint --fix ./packages --ext .js,.ts,.jsx,.tsx",
|
|
23
|
+
"format": "prettier --write \"./packages/**/*.{js,ts,jsx,tsx}\"",
|
|
24
|
+
"website-dev": "cross-env NODE_ENV=development BABEL_ENV=web webpack serve --progress --config ./website/webpack.config.js",
|
|
25
|
+
"website-build": "rimraf website-dist && cross-env NODE_ENV=production BABEL_ENV=web webpack --config ./website/webpack.config.js"
|
|
26
|
+
},
|
|
27
|
+
"husky": {
|
|
28
|
+
"hooks": {
|
|
29
|
+
"pre-commit": "lint-staged"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"lint-staged": {
|
|
33
|
+
"packages/**/*.{js,ts,jsx,tsx,vue}": [
|
|
34
|
+
"npm run lint-fix",
|
|
35
|
+
"git add"
|
|
36
|
+
],
|
|
37
|
+
"packages/**/*.{less}": "prettier --write"
|
|
38
|
+
},
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"registry": "https://registry.npmjs.org/"
|
|
41
|
+
},
|
|
42
|
+
"files": [
|
|
43
|
+
"lib"
|
|
44
|
+
],
|
|
45
|
+
"main": "lib/index.js",
|
|
46
|
+
"module": "lib/index.esm.js",
|
|
47
|
+
"unpkg": "lib/index.full.js",
|
|
48
|
+
"typings": "lib/index.d.ts",
|
|
49
|
+
"style": "lib/style/index.css",
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"react": ">=16.14.0"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"add-dom-event-listener": "^1.1.0",
|
|
55
|
+
"antd": "^4.18.2",
|
|
56
|
+
"axios": "^0.24.0",
|
|
57
|
+
"classnames": "^2.3.1",
|
|
58
|
+
"cropperjs": "^1.5.12",
|
|
59
|
+
"dayjs": "1.10.6",
|
|
60
|
+
"exceljs": "^4.3.0",
|
|
61
|
+
"localforage": "^1.10.0",
|
|
62
|
+
"lodash-es": "^4.17.21",
|
|
63
|
+
"memoize-one": "^6.0.0",
|
|
64
|
+
"omit.js": "^2.0.2",
|
|
65
|
+
"prop-types": "^15.8.0",
|
|
66
|
+
"react-countup": "^6.1.0",
|
|
67
|
+
"react-sortablejs": "^6.0.0",
|
|
68
|
+
"resize-observer-polyfill": "^1.5.1",
|
|
69
|
+
"scroll-into-view-if-needed": "^2.2.28",
|
|
70
|
+
"sortablejs": "^1.14.0"
|
|
71
|
+
},
|
|
72
|
+
"devDependencies": {
|
|
73
|
+
"@babel/cli": "^7.16.0",
|
|
74
|
+
"@babel/core": "^7.16.0",
|
|
75
|
+
"@babel/plugin-proposal-class-properties": "^7.16.0",
|
|
76
|
+
"@babel/plugin-proposal-decorators": "^7.16.0",
|
|
77
|
+
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
78
|
+
"@babel/plugin-transform-runtime": "^7.16.0",
|
|
79
|
+
"@babel/preset-env": "^7.16.0",
|
|
80
|
+
"@babel/preset-react": "^7.16.0",
|
|
81
|
+
"@babel/preset-typescript": "^7.16.0",
|
|
82
|
+
"@rollup/plugin-babel": "^5.3.0",
|
|
83
|
+
"@rollup/plugin-commonjs": "^21.0.1",
|
|
84
|
+
"@rollup/plugin-json": "^4.1.0",
|
|
85
|
+
"@rollup/plugin-node-resolve": "^13.1.0",
|
|
86
|
+
"@rollup/plugin-replace": "^3.0.0",
|
|
87
|
+
"@rollup/plugin-typescript": "^8.3.0",
|
|
88
|
+
"@types/lodash-es": "^4.17.5",
|
|
89
|
+
"@types/react": "^17.0.38",
|
|
90
|
+
"@types/react-dom": "^17.0.10",
|
|
91
|
+
"@typescript-eslint/eslint-plugin": "^5.8.0",
|
|
92
|
+
"@typescript-eslint/parser": "^5.8.0",
|
|
93
|
+
"autoprefixer": "^10.4.0",
|
|
94
|
+
"babel-loader": "^8.2.3",
|
|
95
|
+
"core-js": "^3.20.0",
|
|
96
|
+
"cp-cli": "^2.0.0",
|
|
97
|
+
"cross-env": "^7.0.3",
|
|
98
|
+
"css-loader": "^5.2.7",
|
|
99
|
+
"eslint": "^8.5.0",
|
|
100
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
101
|
+
"eslint-plugin-react": "^7.28.0",
|
|
102
|
+
"eslint-plugin-react-hooks": "^4.3.0",
|
|
103
|
+
"eslint-webpack-plugin": "^3.1.0",
|
|
104
|
+
"gulp": "^4.0.2",
|
|
105
|
+
"gulp-autoprefixer": "^8.0.0",
|
|
106
|
+
"gulp-cssmin": "^0.2.0",
|
|
107
|
+
"gulp-ignore": "^3.0.0",
|
|
108
|
+
"gulp-less": "^5.0.0",
|
|
109
|
+
"gulp-rename": "^2.0.0",
|
|
110
|
+
"gulp-typescript": "^6.0.0-alpha.1",
|
|
111
|
+
"html-webpack-plugin": "^5.5.0",
|
|
112
|
+
"husky": "^4.3.8",
|
|
113
|
+
"less": "^4.1.2",
|
|
114
|
+
"less-loader": "^10.2.0",
|
|
115
|
+
"lint-staged": "^10.5.4",
|
|
116
|
+
"mockjs": "^1.1.0",
|
|
117
|
+
"postcss-loader": "^6.2.0",
|
|
118
|
+
"prettier": "^2.5.0",
|
|
119
|
+
"react": "17.0.2",
|
|
120
|
+
"react-dom": "17.0.2",
|
|
121
|
+
"rimraf": "^3.0.2",
|
|
122
|
+
"rollup": "^2.62.0",
|
|
123
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
124
|
+
"style-loader": "^3.3.0",
|
|
125
|
+
"style-resources-loader": "^1.5.0",
|
|
126
|
+
"ts-loader": "^9.2.6",
|
|
127
|
+
"typescript": "^4.5.4",
|
|
128
|
+
"webpack": "^5.65.0",
|
|
129
|
+
"webpack-cli": "^4.9.0",
|
|
130
|
+
"webpack-dev-server": "^4.6.0",
|
|
131
|
+
"webpack-node-externals": "^3.0.0"
|
|
132
|
+
},
|
|
133
|
+
"engines": {
|
|
134
|
+
"node": ">= 14"
|
|
135
|
+
}
|
|
136
|
+
}
|