@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.
Files changed (222) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +4 -0
  3. package/lib/_utils/cloneElement.d.ts +2 -0
  4. package/lib/_utils/dom.d.ts +68 -0
  5. package/lib/_utils/download.d.ts +7 -0
  6. package/lib/_utils/error.d.ts +2 -0
  7. package/lib/_utils/isServer.d.ts +2 -0
  8. package/lib/_utils/prefix.d.ts +1 -0
  9. package/lib/_utils/resize-event.d.ts +10 -0
  10. package/lib/_utils/scrollbar-width.d.ts +1 -0
  11. package/lib/_utils/types.d.ts +33 -0
  12. package/lib/_utils/util.d.ts +23 -0
  13. package/lib/_utils/validators.d.ts +2 -0
  14. package/lib/anchor/index.d.ts +4 -0
  15. package/lib/anchor/src/anchor-item.d.ts +13 -0
  16. package/lib/anchor/src/anchor-nav.d.ts +12 -0
  17. package/lib/anchor/src/anchor.d.ts +52 -0
  18. package/lib/anchor/style/index.less +60 -0
  19. package/lib/antd/Calendar.d.ts +4 -0
  20. package/lib/antd/DatePicker.d.ts +11 -0
  21. package/lib/antd/TimePicker.d.ts +14 -0
  22. package/lib/antd/index.d.ts +123 -0
  23. package/lib/antd/index.less +7 -0
  24. package/lib/button/index.d.ts +3 -0
  25. package/lib/button/src/button.d.ts +30 -0
  26. package/lib/button/style/index.less +12 -0
  27. package/lib/config-provider/context.d.ts +9 -0
  28. package/lib/config-provider/index.d.ts +3 -0
  29. package/lib/config-provider/src/config-provider.d.ts +34 -0
  30. package/lib/countup/index.d.ts +3 -0
  31. package/lib/countup/src/countup.d.ts +17 -0
  32. package/lib/countup/style/index.less +22 -0
  33. package/lib/cropper/index.d.ts +3 -0
  34. package/lib/cropper/src/cropper.d.ts +213 -0
  35. package/lib/cropper/style/index.less +13 -0
  36. package/lib/divider/index.d.ts +3 -0
  37. package/lib/divider/src/divider.d.ts +25 -0
  38. package/lib/divider/style/index.less +54 -0
  39. package/lib/download/index.d.ts +3 -0
  40. package/lib/download/src/download.d.ts +51 -0
  41. package/lib/download/style/index.less +12 -0
  42. package/lib/drawer/index.d.ts +3 -0
  43. package/lib/drawer/src/drawer.d.ts +33 -0
  44. package/lib/drawer/style/index.less +77 -0
  45. package/lib/empty/index.d.ts +3 -0
  46. package/lib/empty/src/empty.d.ts +15 -0
  47. package/lib/empty/style/index.less +35 -0
  48. package/lib/form/index.d.ts +4 -0
  49. package/lib/form/src/china-data.d.ts +4577 -0
  50. package/lib/form/src/context.d.ts +6 -0
  51. package/lib/form/src/fields-filter.d.ts +26 -0
  52. package/lib/form/src/form-cascader.d.ts +21 -0
  53. package/lib/form/src/form-checkbox-group.d.ts +18 -0
  54. package/lib/form/src/form-checkbox.d.ts +10 -0
  55. package/lib/form/src/form-city-select.d.ts +10 -0
  56. package/lib/form/src/form-date.d.ts +10 -0
  57. package/lib/form/src/form-divider.d.ts +10 -0
  58. package/lib/form/src/form-immediate.d.ts +10 -0
  59. package/lib/form/src/form-input-number.d.ts +10 -0
  60. package/lib/form/src/form-input.d.ts +10 -0
  61. package/lib/form/src/form-radio.d.ts +18 -0
  62. package/lib/form/src/form-range-date.d.ts +10 -0
  63. package/lib/form/src/form-range-input-number.d.ts +10 -0
  64. package/lib/form/src/form-range-input.d.ts +10 -0
  65. package/lib/form/src/form-range-time.d.ts +10 -0
  66. package/lib/form/src/form-region-select.d.ts +10 -0
  67. package/lib/form/src/form-search-helper.d.ts +10 -0
  68. package/lib/form/src/form-select.d.ts +21 -0
  69. package/lib/form/src/form-switch.d.ts +10 -0
  70. package/lib/form/src/form-text-area.d.ts +10 -0
  71. package/lib/form/src/form-time.d.ts +10 -0
  72. package/lib/form/src/form-tinymce.d.ts +10 -0
  73. package/lib/form/src/form-tree-select.d.ts +23 -0
  74. package/lib/form/src/form-upload-file.d.ts +18 -0
  75. package/lib/form/src/form-upload-img.d.ts +18 -0
  76. package/lib/form/src/form.d.ts +169 -0
  77. package/lib/form/src/types.d.ts +251 -0
  78. package/lib/form/src/utils.d.ts +7 -0
  79. package/lib/form/style/index.less +243 -0
  80. package/lib/hooks/useForceUpdate.d.ts +1 -0
  81. package/lib/hooks/useOutsideClick.d.ts +2 -0
  82. package/lib/hooks/useResizeObserve.d.ts +5 -0
  83. package/lib/hooks/useUpdateEffect.d.ts +2 -0
  84. package/lib/index.d.ts +42 -0
  85. package/lib/index.esm.js +16 -0
  86. package/lib/index.full.js +1 -0
  87. package/lib/index.js +16 -0
  88. package/lib/locale/index.d.ts +11 -0
  89. package/lib/locale/index.js +51 -0
  90. package/lib/locale/lang/en.d.ts +243 -0
  91. package/lib/locale/lang/en.js +248 -0
  92. package/lib/locale/lang/zh-cn.d.ts +243 -0
  93. package/lib/locale/lang/zh-cn.js +248 -0
  94. package/lib/modal/index.d.ts +3 -0
  95. package/lib/modal/src/modal.d.ts +38 -0
  96. package/lib/modal/style/index.less +89 -0
  97. package/lib/pinyin/core.d.ts +12 -0
  98. package/lib/pinyin/dict.d.ts +31 -0
  99. package/lib/pinyin/index.d.ts +2 -0
  100. package/lib/pinyin/patchers/56l.d.ts +7 -0
  101. package/lib/qm-design.d.ts +28 -0
  102. package/lib/search-helper/index.d.ts +3 -0
  103. package/lib/search-helper/src/search-helper.d.ts +20 -0
  104. package/lib/search-helper/style/index.less +13 -0
  105. package/lib/space/index.d.ts +3 -0
  106. package/lib/space/src/space.d.ts +12 -0
  107. package/lib/space/style/index.less +12 -0
  108. package/lib/spin/index.d.ts +3 -0
  109. package/lib/spin/src/spin.d.ts +11 -0
  110. package/lib/spin/style/index.less +12 -0
  111. package/lib/split/index.d.ts +4 -0
  112. package/lib/split/src/context.d.ts +8 -0
  113. package/lib/split/src/resize-bar.d.ts +8 -0
  114. package/lib/split/src/split-pane.d.ts +9 -0
  115. package/lib/split/src/split.d.ts +14 -0
  116. package/lib/split/style/index.less +86 -0
  117. package/lib/style/common.less +8 -0
  118. package/lib/style/index.css +1 -0
  119. package/lib/style/index.less +32 -0
  120. package/lib/style/mixins/box.less +13 -0
  121. package/lib/style/mixins/clearfix.less +21 -0
  122. package/lib/style/mixins/index.less +11 -0
  123. package/lib/style/mixins/operation-unit.less +24 -0
  124. package/lib/style/mixins/reset.less +35 -0
  125. package/lib/style/mixins/size.less +15 -0
  126. package/lib/style/reset.less +134 -0
  127. package/lib/style/themes/default.less +113 -0
  128. package/lib/style/themes/index.less +7 -0
  129. package/lib/table/index.d.ts +4 -0
  130. package/lib/table/src/alert/index.d.ts +6 -0
  131. package/lib/table/src/body/index.d.ts +8 -0
  132. package/lib/table/src/body/useValueFormat.d.ts +12 -0
  133. package/lib/table/src/column-filter/index.d.ts +7 -0
  134. package/lib/table/src/config/index.d.ts +47 -0
  135. package/lib/table/src/context/index.d.ts +74 -0
  136. package/lib/table/src/edit/InputNumber.d.ts +17 -0
  137. package/lib/table/src/edit/index.d.ts +12 -0
  138. package/lib/table/src/empty/index.d.ts +3 -0
  139. package/lib/table/src/expandable/index.d.ts +8 -0
  140. package/lib/table/src/export/define.d.ts +8 -0
  141. package/lib/table/src/export/index.d.ts +18 -0
  142. package/lib/table/src/export/setting.d.ts +8 -0
  143. package/lib/table/src/export/useExport.d.ts +9 -0
  144. package/lib/table/src/filter/index.d.ts +8 -0
  145. package/lib/table/src/filter-sql/index.d.ts +5 -0
  146. package/lib/table/src/filter-sql/lib/filter_string.d.ts +11 -0
  147. package/lib/table/src/filter-sql/lib/operations.d.ts +8 -0
  148. package/lib/table/src/filter-sql/lib/variables_replacement.d.ts +5 -0
  149. package/lib/table/src/footer/index.d.ts +8 -0
  150. package/lib/table/src/full-screen/index.d.ts +6 -0
  151. package/lib/table/src/group-summary/index.d.ts +3 -0
  152. package/lib/table/src/group-summary/result.d.ts +9 -0
  153. package/lib/table/src/group-summary/setting.d.ts +6 -0
  154. package/lib/table/src/header/index.d.ts +10 -0
  155. package/lib/table/src/hooks/useImperativeMethod.d.ts +36 -0
  156. package/lib/table/src/hooks/useTableCore.d.ts +86 -0
  157. package/lib/table/src/hooks/useTableEffect.d.ts +35 -0
  158. package/lib/table/src/hooks/useTableLayout.d.ts +39 -0
  159. package/lib/table/src/hooks/useTableMemo.d.ts +43 -0
  160. package/lib/table/src/hooks/useTableRef.d.ts +89 -0
  161. package/lib/table/src/hooks/useTableState.d.ts +94 -0
  162. package/lib/table/src/icon/caretdown.d.ts +3 -0
  163. package/lib/table/src/icon/caretup.d.ts +3 -0
  164. package/lib/table/src/icon/filter.d.ts +3 -0
  165. package/lib/table/src/manager/index.d.ts +15 -0
  166. package/lib/table/src/pager/index.d.ts +11 -0
  167. package/lib/table/src/print/index.d.ts +7 -0
  168. package/lib/table/src/reload/index.d.ts +3 -0
  169. package/lib/table/src/resizable/index.d.ts +7 -0
  170. package/lib/table/src/select-collection/index.d.ts +7 -0
  171. package/lib/table/src/select-collection/result.d.ts +8 -0
  172. package/lib/table/src/selection/all.d.ts +7 -0
  173. package/lib/table/src/selection/index.d.ts +12 -0
  174. package/lib/table/src/store/index.d.ts +29 -0
  175. package/lib/table/src/super-search/index.d.ts +3 -0
  176. package/lib/table/src/super-search/result.d.ts +6 -0
  177. package/lib/table/src/table/index.d.ts +5 -0
  178. package/lib/table/src/table/props.d.ts +243 -0
  179. package/lib/table/src/table/types.d.ts +335 -0
  180. package/lib/table/src/utils/index.d.ts +37 -0
  181. package/lib/table/style/alert.less +34 -0
  182. package/lib/table/style/body.less +42 -0
  183. package/lib/table/style/column-filter.less +88 -0
  184. package/lib/table/style/empty.less +16 -0
  185. package/lib/table/style/expandable.less +55 -0
  186. package/lib/table/style/export.less +30 -0
  187. package/lib/table/style/footer.less +28 -0
  188. package/lib/table/style/full-screen.less +21 -0
  189. package/lib/table/style/group-summary.less +93 -0
  190. package/lib/table/style/header.less +178 -0
  191. package/lib/table/style/index.less +25 -0
  192. package/lib/table/style/pager.less +12 -0
  193. package/lib/table/style/print.less +21 -0
  194. package/lib/table/style/reload.less +21 -0
  195. package/lib/table/style/select-collection.less +21 -0
  196. package/lib/table/style/size.less +69 -0
  197. package/lib/table/style/super-search.less +102 -0
  198. package/lib/table/style/table.less +328 -0
  199. package/lib/table/style/toper.less +28 -0
  200. package/lib/table/style/variable.less +48 -0
  201. package/lib/tabs/index.d.ts +4 -0
  202. package/lib/tabs/src/tab-pane.d.ts +8 -0
  203. package/lib/tabs/src/tabs.d.ts +16 -0
  204. package/lib/tabs/style/index.less +22 -0
  205. package/lib/tinymce/index.d.ts +3 -0
  206. package/lib/tinymce/src/Events.d.ts +78 -0
  207. package/lib/tinymce/src/ScriptLoader.d.ts +13 -0
  208. package/lib/tinymce/src/TinyMCE.d.ts +2 -0
  209. package/lib/tinymce/src/Utils.d.ts +19 -0
  210. package/lib/tinymce/src/components/Editor.d.ts +66 -0
  211. package/lib/tinymce/src/components/EditorPropTypes.d.ts +18 -0
  212. package/lib/tinymce/src/index.d.ts +29 -0
  213. package/lib/tinymce/style/index.less +18 -0
  214. package/lib/upload-file/index.d.ts +3 -0
  215. package/lib/upload-file/src/upload-file.d.ts +16 -0
  216. package/lib/upload-file/style/index.less +12 -0
  217. package/lib/upload-img/index.d.ts +3 -0
  218. package/lib/upload-img/src/cropper-preview.d.ts +30 -0
  219. package/lib/upload-img/src/upload-img.d.ts +27 -0
  220. package/lib/upload-img/style/index.less +36 -0
  221. package/lib/version/index.d.ts +2 -0
  222. package/package.json +136 -0
@@ -0,0 +1,3 @@
1
+ import Cropper from './src/cropper';
2
+ export type { QmCropperProps } from './src/cropper';
3
+ export default Cropper;
@@ -0,0 +1,213 @@
1
+ import React, { Component } from 'react';
2
+ import { CSSProperties, AnyObject, AnyFunction } from '../../_utils/types';
3
+ declare type IProps = {
4
+ src: string;
5
+ alt?: string;
6
+ imgStyle?: CSSProperties;
7
+ style?: CSSProperties;
8
+ className?: string;
9
+ viewMode?: number;
10
+ dragMode?: string;
11
+ initialAspectRatio?: number;
12
+ aspectRatio?: number;
13
+ data?: AnyObject<any>;
14
+ preview?: string;
15
+ responsive?: boolean;
16
+ restore?: boolean;
17
+ checkCrossOrigin?: boolean;
18
+ checkOrientation?: boolean;
19
+ crossorigin?: string;
20
+ guides?: boolean;
21
+ center?: boolean;
22
+ highlight?: boolean;
23
+ background?: boolean;
24
+ autoCrop?: boolean;
25
+ autoCropArea?: number;
26
+ movable?: boolean;
27
+ rotatable?: boolean;
28
+ scalable?: boolean;
29
+ zoomable?: boolean;
30
+ zoomOnTouch?: boolean;
31
+ zoomOnWheel?: boolean;
32
+ wheelZoomRatio?: number;
33
+ cropBoxMovable?: boolean;
34
+ cropBoxResizable?: boolean;
35
+ toggleDragModeOnDblclick?: boolean;
36
+ minCanvasWidth?: number;
37
+ minCanvasHeight?: number;
38
+ minCropBoxWidth?: number;
39
+ minCropBoxHeight?: number;
40
+ minContainerWidth?: number;
41
+ minContainerHeight?: number;
42
+ ready?: AnyFunction<void>;
43
+ cropstart?: AnyFunction<void>;
44
+ cropmove?: AnyFunction<void>;
45
+ cropend?: AnyFunction<void>;
46
+ crop?: AnyFunction<void>;
47
+ zoom?: AnyFunction<void>;
48
+ };
49
+ export declare type QmCropperProps = IProps;
50
+ declare class QmCropper extends Component<IProps> {
51
+ static defaultProps: {
52
+ src: string;
53
+ responsive: boolean;
54
+ restore: boolean;
55
+ checkCrossOrigin: boolean;
56
+ checkOrientation: boolean;
57
+ modal: boolean;
58
+ guides: boolean;
59
+ center: boolean;
60
+ highlight: boolean;
61
+ background: boolean;
62
+ autoCrop: boolean;
63
+ movable: boolean;
64
+ rotatable: boolean;
65
+ scalable: boolean;
66
+ zoomable: boolean;
67
+ zoomOnTouch: boolean;
68
+ zoomOnWheel: boolean;
69
+ cropBoxMovable: boolean;
70
+ cropBoxResizable: boolean;
71
+ toggleDragModeOnDblclick: boolean;
72
+ };
73
+ private imgRef;
74
+ private cropper;
75
+ componentDidMount(): void;
76
+ componentWillUnmount(): void;
77
+ reset(): any;
78
+ clear(): any;
79
+ initCrop(): any;
80
+ /**
81
+ * Replace the image's src and rebuild the cropper
82
+ * @param {string} url - The new URL.
83
+ * @param {boolean} [onlyColorChanged] - Indicate if the new image only changed color.
84
+ * @returns {Object} this
85
+ */
86
+ replace(url: any, onlyColorChanged?: boolean): any;
87
+ enable(): any;
88
+ disable(): any;
89
+ destroy(): any;
90
+ /**
91
+ * Move the canvas with relative offsets
92
+ * @param {number} offsetX - The relative offset distance on the x-axis.
93
+ * @param {number} offsetY - The relative offset distance on the y-axis.
94
+ * @returns {Object} this
95
+ */
96
+ move(offsetX: any, offsetY: any): any;
97
+ /**
98
+ * Move the canvas to an absolute point
99
+ * @param {number} x - The x-axis coordinate.
100
+ * @param {number} [y=x] - The y-axis coordinate.
101
+ * @returns {Object} this
102
+ */
103
+ moveTo(x: any, y?: any): any;
104
+ /**
105
+ * Zoom the canvas with a relative ratio
106
+ * @param {number} ratio - The target ratio.
107
+ * @param {Event} _originalEvent - The original event if any.
108
+ * @returns {Object} this
109
+ */
110
+ relativeZoom(ratio: any, _originalEvent: any): any;
111
+ /**
112
+ * Zoom the canvas to an absolute ratio
113
+ * @param {number} ratio - The target ratio.
114
+ * @param {Event} _originalEvent - The original event if any.
115
+ * @returns {Object} this
116
+ */
117
+ zoomTo(ratio: any, _originalEvent: any): any;
118
+ /**
119
+ * Rotate the canvas with a relative degree
120
+ * @param {number} degree - The rotate degree.
121
+ * @returns {Object} this
122
+ */
123
+ rotate(degree: any): any;
124
+ /**
125
+ * Rotate the canvas to an absolute degree
126
+ * @param {number} degree - The rotate degree.
127
+ * @returns {Object} this
128
+ */
129
+ rotateTo(degree: any): any;
130
+ /**
131
+ * Scale the image on the x-axis.
132
+ * @param {number} scaleX - The scale ratio on the x-axis.
133
+ * @returns {Object} this
134
+ */
135
+ scaleX(scaleX: any): any;
136
+ /**
137
+ * Scale the image on the y-axis.
138
+ * @param {number} scaleY - The scale ratio on the y-axis.
139
+ * @returns {Object} this
140
+ */
141
+ scaleY(scaleY: any): any;
142
+ /**
143
+ * Scale the image
144
+ * @param {number} scaleX - The scale ratio on the x-axis.
145
+ * @param {number} [scaleY=scaleX] - The scale ratio on the y-axis.
146
+ * @returns {Object} this
147
+ */
148
+ scale(scaleX: any, scaleY?: any): any;
149
+ /**
150
+ * Get the cropped area position and size data (base on the original image)
151
+ * @param {boolean} [rounded=false] - Indicate if round the data values or not.
152
+ * @returns {Object} The result cropped data.
153
+ */
154
+ getData(rounded?: boolean): any;
155
+ /**
156
+ * Set the cropped area position and size with new data
157
+ * @param {Object} data - The new data.
158
+ * @returns {Object} this
159
+ */
160
+ setData(data: any): any;
161
+ /**
162
+ * Get the container size data.
163
+ * @returns {Object} The result container data.
164
+ */
165
+ getContainerData(): any;
166
+ /**
167
+ * Get the image position and size data.
168
+ * @returns {Object} The result image data.
169
+ */
170
+ getImageData(): any;
171
+ /**
172
+ * Get the canvas position and size data.
173
+ * @returns {Object} The result canvas data.
174
+ */
175
+ getCanvasData(): any;
176
+ /**
177
+ * Set the canvas position and size with new data.
178
+ * @param {Object} data - The new canvas data.
179
+ * @returns {Object} this
180
+ */
181
+ setCanvasData(data: any): any;
182
+ /**
183
+ * Get the crop box position and size data.
184
+ * @returns {Object} The result crop box data.
185
+ */
186
+ getCropBoxData(): any;
187
+ /**
188
+ * Set the crop box position and size with new data.
189
+ * @param {Object} data - The new crop box data.
190
+ * @returns {Object} this
191
+ */
192
+ setCropBoxData(data: any): any;
193
+ /**
194
+ * Get a canvas drawn the cropped image.
195
+ * @param {Object} [options={}] - The config options.
196
+ * @returns {HTMLCanvasElement} - The result canvas.
197
+ */
198
+ getCroppedCanvas(options?: {}): any;
199
+ /**
200
+ * Change the aspect ratio of the crop box.
201
+ * @param {number} aspectRatio - The new aspect ratio.
202
+ * @returns {Object} this
203
+ */
204
+ setAspectRatio(aspectRatio: any): any;
205
+ /**
206
+ * Change the drag mode.
207
+ * @param {string} mode - The new drag mode.
208
+ * @returns {Object} this
209
+ */
210
+ setDragMode(mode: any): any;
211
+ render(): React.ReactElement;
212
+ }
213
+ export default QmCropper;
@@ -0,0 +1,13 @@
1
+ /*
2
+ * @Author: 焦质晔
3
+ * @Date: 2021-07-23 19:05:57
4
+ * @Last Modified by: 焦质晔
5
+ * @Last Modified time: 2021-08-27 13:28:50
6
+ */
7
+ @import '~cropperjs/dist/cropper.css';
8
+ @import '../../style/common';
9
+
10
+ @prefix-cropper: ~'@{qm-prefix}-cropper';
11
+
12
+ .@{prefix-cropper} {
13
+ }
@@ -0,0 +1,3 @@
1
+ import Divider from './src/divider';
2
+ export type { QmDividerProps } from './src/divider';
3
+ export default Divider;
@@ -0,0 +1,25 @@
1
+ import React, { Component } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { ComponentSize, CSSProperties, JSXElement } from '../../_utils/types';
4
+ declare type IProps = {
5
+ label: string;
6
+ size?: ComponentSize;
7
+ extra?: JSXElement | string;
8
+ collapse?: boolean;
9
+ className?: string;
10
+ style?: CSSProperties;
11
+ onCollapseChange?: (collapse: boolean) => void;
12
+ };
13
+ export declare type QmDividerProps = IProps;
14
+ declare class QmDivider extends Component<IProps> {
15
+ static propTypes: {
16
+ label: PropTypes.Requireable<string>;
17
+ size: (props: any, propName: any, componentName: any) => void;
18
+ extra: PropTypes.Requireable<string | PropTypes.ReactElementLike>;
19
+ collapse: PropTypes.Requireable<boolean>;
20
+ };
21
+ static contextType: React.Context<import("../../config-provider/context").IConfig | undefined>;
22
+ clickHandle: () => void;
23
+ render(): React.ReactElement;
24
+ }
25
+ export default QmDivider;
@@ -0,0 +1,54 @@
1
+ /*
2
+ * @Author: 焦质晔
3
+ * @Date: 2021-07-23 19:05:57
4
+ * @Last Modified by: 焦质晔
5
+ * @Last Modified time: 2021-08-21 20:34:44
6
+ */
7
+ @import '../../style/common';
8
+
9
+ @prefix-divider: ~'@{qm-prefix}-divider';
10
+
11
+ .@{prefix-divider} {
12
+ .reset-component;
13
+ display: flex;
14
+ align-items: center;
15
+ padding: 0 @--padding-md;
16
+ height: @--height-md;
17
+ border: 1px solid @--border-color-base;
18
+ border-radius: @--border-radius-base;
19
+ background-color: @--background-color-cecondary;
20
+ position: relative;
21
+ &::before {
22
+ content: ' ';
23
+ position: absolute;
24
+ width: 6px;
25
+ left: -1px;
26
+ top: -1px;
27
+ bottom: -1px;
28
+ background-color: @--primary-color;
29
+ }
30
+ &__title {
31
+ margin-left: 5px;
32
+ }
33
+ &__extra {
34
+ .text-overflow-cut();
35
+ flex: 1;
36
+ margin-left: @--margin-md;
37
+ }
38
+ &__collapse {
39
+ margin-left: @--margin-md;
40
+ padding-left: 0;
41
+ padding-right: 0;
42
+ .anticon {
43
+ margin-left: 4px !important;
44
+ }
45
+ }
46
+ // ------ size ------
47
+ // 40 32 24
48
+ &--lg {
49
+ height: @--height-lg;
50
+ }
51
+ &--sm {
52
+ height: @--height-sm;
53
+ }
54
+ }
@@ -0,0 +1,3 @@
1
+ import Download from './src/download';
2
+ export type { QmDownloadProps } from './src/download';
3
+ export default Download;
@@ -0,0 +1,51 @@
1
+ import React, { Component } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import type { ButtonProps } from '../../antd';
4
+ import { AnyFunction, AnyObject } from '../../_utils/types';
5
+ declare type HttpRequestHeader = {
6
+ [key: string]: string;
7
+ };
8
+ declare type ActionConfig = {
9
+ api: AnyFunction<Promise<any>>;
10
+ params?: AnyObject<unknown>;
11
+ };
12
+ declare type IProps = Omit<ButtonProps, 'prefixCls' | 'ghost' | 'danger' | 'block'> & {
13
+ action: string | ActionConfig;
14
+ fileName?: string;
15
+ headers?: HttpRequestHeader;
16
+ withCredentials?: boolean;
17
+ params?: AnyObject<unknown>;
18
+ beforeDownload?: AnyFunction<boolean>;
19
+ onSuccess: AnyFunction<void>;
20
+ onError: AnyFunction<void>;
21
+ };
22
+ declare type IState = {
23
+ loading: boolean;
24
+ };
25
+ export declare type QmDownloadProps = IProps;
26
+ declare class QmDownload extends Component<IProps, IState> {
27
+ static propTypes: {
28
+ action: PropTypes.Requireable<string | PropTypes.InferProps<{
29
+ api: PropTypes.Validator<(...args: any[]) => any>;
30
+ params: PropTypes.Requireable<object>;
31
+ }>>;
32
+ fileName: PropTypes.Requireable<string>;
33
+ headers: PropTypes.Requireable<object>;
34
+ withCredentials: PropTypes.Requireable<boolean>;
35
+ params: PropTypes.Requireable<object>;
36
+ beforeDownload: PropTypes.Requireable<(...args: any[]) => any>;
37
+ onSuccess: PropTypes.Requireable<(...args: any[]) => any>;
38
+ onError: PropTypes.Requireable<(...args: any[]) => any>;
39
+ };
40
+ static defaultProps: {
41
+ icon: JSX.Element;
42
+ children: string;
43
+ withCredentials: boolean;
44
+ };
45
+ state: IState;
46
+ getActionUrl(): Promise<string>;
47
+ downloadFile(url: string): Promise<void>;
48
+ downloadHandle: () => Promise<void>;
49
+ render(): React.ReactElement;
50
+ }
51
+ export default QmDownload;
@@ -0,0 +1,12 @@
1
+ /*
2
+ * @Author: 焦质晔
3
+ * @Date: 2021-07-23 19:05:57
4
+ * @Last Modified by: 焦质晔
5
+ * @Last Modified time: 2021-08-02 18:00:03
6
+ */
7
+ @import '../../style/common';
8
+
9
+ @prefix-download: ~'@{qm-prefix}-download';
10
+
11
+ .@{prefix-download} {
12
+ }
@@ -0,0 +1,3 @@
1
+ import Drawer from './src/drawer';
2
+ export type { QmDrawerProps } from './src/drawer';
3
+ export default Drawer;
@@ -0,0 +1,33 @@
1
+ import React, { Component } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { ComponentSize } from '../../_utils/types';
4
+ import type { DrawerProps } from '../../antd';
5
+ declare type IProps = DrawerProps & {
6
+ size?: ComponentSize;
7
+ loading?: boolean;
8
+ };
9
+ declare type IState = {
10
+ fullscreen: boolean;
11
+ spinning: boolean;
12
+ };
13
+ export declare type QmDrawerProps = IProps;
14
+ declare class QmDrawer extends Component<IProps, IState> {
15
+ static contextType: React.Context<import("../../config-provider/context").IConfig | undefined>;
16
+ static propTypes: {
17
+ size: (props: any, propName: any, componentName: any) => void;
18
+ spinning: PropTypes.Requireable<boolean>;
19
+ };
20
+ static defaultProps: {
21
+ width: string;
22
+ destroyOnClose: boolean;
23
+ maskClosable: boolean;
24
+ };
25
+ state: IState;
26
+ private opened;
27
+ componentDidUpdate(prevProps: IProps): void;
28
+ afterVisibleChange: (visible: boolean) => void;
29
+ toggleHandle: (ev: any) => void;
30
+ renderTitle(): JSX.Element;
31
+ render(): React.ReactElement;
32
+ }
33
+ export default QmDrawer;
@@ -0,0 +1,77 @@
1
+ /*
2
+ * @Author: 焦质晔
3
+ * @Date: 2021-07-23 19:05:57
4
+ * @Last Modified by: 焦质晔
5
+ * @Last Modified time: 2021-08-05 15:57:45
6
+ */
7
+ @import '../../style/common';
8
+
9
+ @prefix-drawer: ~'@{qm-prefix}-drawer';
10
+
11
+ .@{prefix-drawer} {
12
+ .ant-drawer-header {
13
+ display: flex;
14
+ align-items: center;
15
+ flex-shrink: 0;
16
+ height: 44px;
17
+ padding: 0 15px;
18
+ border-bottom: 1px solid @--border-color-secondary;
19
+ .ant-drawer-title {
20
+ display: flex;
21
+ flex: 1;
22
+ align-items: center;
23
+ justify-content: space-between;
24
+ padding-right: 20px;
25
+ .full-screen {
26
+ padding: @--padding-md 5px @--padding-md @--padding-md;
27
+ color: @--text-color-secondary;
28
+ transition: all 0.3s ease;
29
+ &:hover {
30
+ color: @--text-color;
31
+ }
32
+ }
33
+ }
34
+ .ant-drawer-close {
35
+ top: auto;
36
+ font-size: 17px;
37
+ padding: @--padding-md 15px @--padding-md 5px;
38
+ }
39
+ }
40
+ .ant-drawer-body {
41
+ padding: @--padding-md;
42
+ }
43
+ &-spin {
44
+ position: absolute;
45
+ top: 44px;
46
+ left: 0;
47
+ right: 0;
48
+ bottom: 0;
49
+ display: flex;
50
+ flex-direction: column;
51
+ justify-content: center;
52
+ align-items: center;
53
+ background-color: rgba(255, 255, 255, 0.65);
54
+ z-index: 9999;
55
+ .ant-spin-text {
56
+ margin-top: 4px;
57
+ }
58
+ }
59
+ // ------ size ------
60
+ // 52 48 44
61
+ &--lg {
62
+ .ant-drawer-header {
63
+ height: 48px;
64
+ }
65
+ .qm-drawer-spin {
66
+ top: 48px;
67
+ }
68
+ }
69
+ &--sm {
70
+ .ant-drawer-header {
71
+ height: 40px;
72
+ }
73
+ .qm-drawer-spin {
74
+ top: 40px;
75
+ }
76
+ }
77
+ }
@@ -0,0 +1,3 @@
1
+ import Empty from './src/empty';
2
+ export type { QmEmptyProps } from './src/empty';
3
+ export default Empty;
@@ -0,0 +1,15 @@
1
+ import React, { Component } from 'react';
2
+ import { ComponentSize } from '../../_utils/types';
3
+ import type { EmptyProps } from '../../antd';
4
+ declare type IProps = EmptyProps & {
5
+ size?: ComponentSize;
6
+ };
7
+ export declare type QmEmptyProps = IProps;
8
+ declare class QmEmpty extends Component<IProps> {
9
+ static contextType: React.Context<import("../../config-provider/context").IConfig | undefined>;
10
+ static propTypes: {
11
+ size: (props: any, propName: any, componentName: any) => void;
12
+ };
13
+ render(): React.ReactElement;
14
+ }
15
+ export default QmEmpty;
@@ -0,0 +1,35 @@
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-empty: ~'@{qm-prefix}-empty';
10
+
11
+ .@{prefix-empty} {
12
+ .ant-empty-image {
13
+ height: auto;
14
+ }
15
+ // ------ size ------
16
+ // 40 32 24
17
+ &--lg {
18
+ .ant-empty-image > svg {
19
+ width: 80px;
20
+ height: 50px;
21
+ }
22
+ .ant-empty-description {
23
+ font-size: @--font-size-base;
24
+ }
25
+ }
26
+ &--sm {
27
+ .ant-empty-image > svg {
28
+ width: 55px;
29
+ height: 35px;
30
+ }
31
+ .ant-empty-description {
32
+ font-size: @--font-size-sm;
33
+ }
34
+ }
35
+ }
@@ -0,0 +1,4 @@
1
+ import Form from './src/form';
2
+ export type { QmFormProps } from './src/form';
3
+ export type { IFormItem as QmFormItem, IFormItemType as QmFormItemType } from './src/types';
4
+ export default Form;