@aloudata/aloudata-design 0.4.0-beta.1 → 0.4.0-beta.11

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 (155) hide show
  1. package/es/Avatar/component/Avatar/index.d.ts +84 -0
  2. package/es/Avatar/component/Avatar/index.js +42 -0
  3. package/es/Avatar/index.d.ts +1 -13
  4. package/es/Avatar/index.js +1 -30
  5. package/es/Avatar/style/index.less +1 -1
  6. package/es/Breadcrumb/index.d.ts +5 -2
  7. package/es/Breadcrumb/index.js +17 -7
  8. package/es/Button/index.d.ts +1 -1
  9. package/es/Button/index.js +3 -8
  10. package/es/Button/style/index.less +6 -0
  11. package/es/Button/style/variables.less +26 -26
  12. package/es/Checkbox/component/CheckboxGroup/index.d.ts +4 -0
  13. package/es/Checkbox/component/CheckboxGroup/index.js +27 -0
  14. package/es/Checkbox/index.d.ts +4 -5
  15. package/es/Checkbox/index.js +3 -12
  16. package/es/Checkbox/style/index.less +36 -16
  17. package/es/Checkbox/type.d.ts +94 -0
  18. package/es/Checkbox/type.js +6 -0
  19. package/es/Divider/index.d.ts +40 -2
  20. package/es/Divider/index.js +10 -1
  21. package/es/Divider/style/index.less +4 -0
  22. package/es/Divider/style/index.less.d.ts +183 -0
  23. package/es/Dropdown/Button.d.ts +4 -4
  24. package/es/Dropdown/Button.js +5 -5
  25. package/es/Dropdown/index.d.ts +5 -5
  26. package/es/Dropdown/index.js +5 -5
  27. package/es/Icon/icons.d.ts +9 -0
  28. package/es/Icon/icons.js +1590 -0
  29. package/es/Input/components/Input/index.d.ts +13 -1
  30. package/es/Input/components/Input/index.js +1 -3
  31. package/es/Input/components/Password/index.d.ts +6 -1
  32. package/es/Input/components/Password/index.js +11 -3
  33. package/es/Input/components/TextArea/index.d.ts +1 -1
  34. package/es/Input/style/index.less +139 -59
  35. package/es/InputNumber/index.d.ts +3 -3
  36. package/es/InputNumber/style/index.less +66 -26
  37. package/es/InputNumber/type.d.ts +161 -0
  38. package/es/InputNumber/type.js +1 -0
  39. package/es/Menu/index.d.ts +2 -0
  40. package/es/Popconfirm/index.d.ts +90 -0
  41. package/es/Popconfirm/index.js +111 -0
  42. package/es/Popconfirm/style/index.d.ts +2 -0
  43. package/es/Popconfirm/style/index.js +2 -0
  44. package/es/Popconfirm/style/index.less +57 -0
  45. package/es/Progress/index.d.ts +3 -0
  46. package/es/Progress/index.js +2 -0
  47. package/es/Progress/style/index.d.ts +2 -0
  48. package/es/Progress/style/index.js +2 -0
  49. package/es/Progress/style/index.less +1 -0
  50. package/es/Select/style/variables.less.d.ts +6 -0
  51. package/es/Steps/style/index.less +10 -4
  52. package/es/Table/Table.js +87 -91
  53. package/es/Table/components/TableHead/index.d.ts +0 -1
  54. package/es/Table/components/TableHead/index.js +1 -2
  55. package/es/Table/interface.d.ts +2 -0
  56. package/es/Table/style/index.less +14 -5
  57. package/es/Table/style/variable.less +0 -5
  58. package/es/Table/style/variable.less.d.ts +1 -1
  59. package/es/Table/utils.js +16 -9
  60. package/es/Tabs/index.d.ts +21 -6
  61. package/es/Tabs/index.js +3 -5
  62. package/es/Tabs/style/index.less +1 -1
  63. package/es/Tooltip/index.d.ts +2 -2
  64. package/es/Tooltip/index.js +4 -4
  65. package/es/index.d.ts +7 -3
  66. package/es/index.js +3 -1
  67. package/es/style/themes/default/scrollBar.less +10 -7
  68. package/es/style/themes/default/themeColor.module.less +176 -166
  69. package/es/style/themes/default/themeColor.module.less.d.ts +6 -0
  70. package/lib/Avatar/component/Avatar/index.d.ts +84 -0
  71. package/lib/Avatar/component/Avatar/index.js +61 -0
  72. package/lib/Avatar/index.d.ts +1 -13
  73. package/lib/Avatar/index.js +3 -44
  74. package/lib/Avatar/style/index.less +1 -1
  75. package/lib/Breadcrumb/index.d.ts +5 -2
  76. package/lib/Breadcrumb/index.js +17 -8
  77. package/lib/Button/index.d.ts +1 -1
  78. package/lib/Button/index.js +3 -8
  79. package/lib/Button/style/index.less +6 -0
  80. package/lib/Button/style/variables.less +26 -26
  81. package/lib/Checkbox/component/CheckboxGroup/index.d.ts +4 -0
  82. package/lib/Checkbox/component/CheckboxGroup/index.js +42 -0
  83. package/lib/Checkbox/index.d.ts +4 -5
  84. package/lib/Checkbox/index.js +4 -13
  85. package/lib/Checkbox/style/index.less +36 -16
  86. package/lib/Checkbox/type.d.ts +94 -0
  87. package/lib/Checkbox/type.js +13 -0
  88. package/lib/Divider/index.d.ts +40 -2
  89. package/lib/Divider/index.js +11 -1
  90. package/lib/Divider/style/index.less +4 -0
  91. package/lib/Divider/style/index.less.d.ts +183 -0
  92. package/lib/Dropdown/Button.d.ts +4 -4
  93. package/lib/Dropdown/Button.js +5 -5
  94. package/lib/Dropdown/index.d.ts +5 -5
  95. package/lib/Dropdown/index.js +5 -5
  96. package/lib/Icon/icons.d.ts +9 -0
  97. package/lib/Icon/icons.js +1597 -0
  98. package/lib/Input/components/Input/index.d.ts +13 -1
  99. package/lib/Input/components/Input/index.js +1 -3
  100. package/lib/Input/components/Password/index.d.ts +6 -1
  101. package/lib/Input/components/Password/index.js +14 -4
  102. package/lib/Input/components/TextArea/index.d.ts +1 -1
  103. package/lib/Input/style/index.less +139 -59
  104. package/lib/InputNumber/index.d.ts +3 -3
  105. package/lib/InputNumber/style/index.less +66 -26
  106. package/lib/InputNumber/type.d.ts +161 -0
  107. package/lib/InputNumber/type.js +5 -0
  108. package/lib/Menu/index.d.ts +2 -0
  109. package/lib/Popconfirm/index.d.ts +90 -0
  110. package/lib/Popconfirm/index.js +127 -0
  111. package/lib/Popconfirm/style/index.d.ts +2 -0
  112. package/lib/Popconfirm/style/index.js +5 -0
  113. package/lib/Popconfirm/style/index.less +57 -0
  114. package/lib/Progress/index.d.ts +3 -0
  115. package/lib/Progress/index.js +13 -0
  116. package/lib/Progress/style/index.d.ts +2 -0
  117. package/lib/Progress/style/index.js +5 -0
  118. package/lib/Progress/style/index.less +1 -0
  119. package/lib/Select/style/variables.less.d.ts +6 -0
  120. package/lib/Steps/style/index.less +10 -4
  121. package/lib/Table/Table.js +90 -96
  122. package/lib/Table/components/TableHead/index.d.ts +0 -1
  123. package/lib/Table/components/TableHead/index.js +1 -2
  124. package/lib/Table/interface.d.ts +2 -0
  125. package/lib/Table/style/index.less +14 -5
  126. package/lib/Table/style/variable.less +0 -5
  127. package/lib/Table/style/variable.less.d.ts +1 -1
  128. package/lib/Table/utils.js +16 -9
  129. package/lib/Tabs/index.d.ts +21 -6
  130. package/lib/Tabs/index.js +3 -7
  131. package/lib/Tabs/style/index.less +1 -1
  132. package/lib/Tooltip/index.d.ts +2 -2
  133. package/lib/Tooltip/index.js +4 -4
  134. package/lib/index.d.ts +7 -3
  135. package/lib/index.js +16 -0
  136. package/lib/style/themes/default/scrollBar.less +10 -7
  137. package/lib/style/themes/default/themeColor.module.less +176 -166
  138. package/lib/style/themes/default/themeColor.module.less.d.ts +6 -0
  139. package/package.json +4 -3
  140. package/es/Icon/icons.json +0 -418
  141. package/es/Table/hooks/useFrame.d.ts +0 -7
  142. package/es/Table/hooks/useFrame.js +0 -90
  143. package/es/Table/hooks/useTableColumn.d.ts +0 -28
  144. package/es/Table/hooks/useTableColumn.js +0 -53
  145. package/es/Table/style/index.less.d.ts +0 -126
  146. package/es/Tabs/TabPane.d.ts +0 -21
  147. package/es/Tabs/TabPane.js +0 -6
  148. package/lib/Icon/icons.json +0 -418
  149. package/lib/Table/hooks/useFrame.d.ts +0 -7
  150. package/lib/Table/hooks/useFrame.js +0 -98
  151. package/lib/Table/hooks/useTableColumn.d.ts +0 -28
  152. package/lib/Table/hooks/useTableColumn.js +0 -66
  153. package/lib/Table/style/index.less.d.ts +0 -126
  154. package/lib/Tabs/TabPane.d.ts +0 -21
  155. package/lib/Tabs/TabPane.js +0 -18
@@ -1,126 +0,0 @@
1
- // This file is automatically generated.
2
- // Please do not change this file!
3
- interface CssExports {
4
- 'B10': string;
5
- 'B20': string;
6
- 'B30': string;
7
- 'B40': string;
8
- 'B50': string;
9
- 'B60': string;
10
- 'B70': string;
11
- 'B80': string;
12
- 'B90': string;
13
- 'B95': string;
14
- 'B98': string;
15
- 'BG0': string;
16
- 'BG10': string;
17
- 'BG100': string;
18
- 'BG20': string;
19
- 'BG30': string;
20
- 'BG40': string;
21
- 'BG50': string;
22
- 'BG60': string;
23
- 'BG70': string;
24
- 'BG80': string;
25
- 'BG90': string;
26
- 'BG95': string;
27
- 'BG97': string;
28
- 'BLACK': string;
29
- 'IMAGE_HOLDER': string;
30
- 'MATE': string;
31
- 'ND0': string;
32
- 'ND10': string;
33
- 'ND20': string;
34
- 'ND30': string;
35
- 'ND40': string;
36
- 'ND50': string;
37
- 'ND60': string;
38
- 'ND70': string;
39
- 'ND80': string;
40
- 'ND90': string;
41
- 'ND95': string;
42
- 'ND97': string;
43
- 'NL0': string;
44
- 'NL10': string;
45
- 'NL20': string;
46
- 'NL30': string;
47
- 'NL40': string;
48
- 'NL50': string;
49
- 'NL60': string;
50
- 'NL70': string;
51
- 'NL80': string;
52
- 'NL90': string;
53
- 'NL95': string;
54
- 'NL97': string;
55
- 'SA10': string;
56
- 'SA20': string;
57
- 'SA30': string;
58
- 'SA40': string;
59
- 'SA50': string;
60
- 'SA60': string;
61
- 'SA70': string;
62
- 'SA80': string;
63
- 'SA90': string;
64
- 'SA95': string;
65
- 'SA98': string;
66
- 'SB10': string;
67
- 'SB20': string;
68
- 'SB30': string;
69
- 'SB40': string;
70
- 'SB50': string;
71
- 'SB60': string;
72
- 'SB70': string;
73
- 'SB80': string;
74
- 'SB90': string;
75
- 'SB95': string;
76
- 'SB98': string;
77
- 'SC10': string;
78
- 'SC20': string;
79
- 'SC30': string;
80
- 'SC40': string;
81
- 'SC50': string;
82
- 'SC60': string;
83
- 'SC70': string;
84
- 'SC80': string;
85
- 'SC90': string;
86
- 'SC95': string;
87
- 'SC98': string;
88
- 'SHADOW_L': string;
89
- 'TableHeadRowHeight': string;
90
- 'WHITE': string;
91
- 'ald-empty': string;
92
- 'ald-empty-description': string;
93
- 'ald-empty-image': string;
94
- 'ald-empty-img': string;
95
- 'ald-empty-large': string;
96
- 'ald-empty-small': string;
97
- 'ald-empty-title': string;
98
- 'ald-table': string;
99
- 'ald-table-bar': string;
100
- 'ald-table-canNotInnerScroll': string;
101
- 'ald-table-cell': string;
102
- 'ald-table-cell-content': string;
103
- 'ald-table-column-resizable': string;
104
- 'ald-table-empty-icon': string;
105
- 'ald-table-header': string;
106
- 'ald-table-header-left': string;
107
- 'ald-table-header-right': string;
108
- 'ald-table-init-loading': string;
109
- 'ald-table-inner-wrap': string;
110
- 'ald-table-list': string;
111
- 'ald-table-loading': string;
112
- 'ald-table-loading-icon': string;
113
- 'ald-table-page-loading': string;
114
- 'ald-table-row': string;
115
- 'ald-table-row-ellipsis': string;
116
- 'ald-table-row-list-wrap': string;
117
- 'ald-table-row-selected': string;
118
- 'ald-table-sortIcon': string;
119
- 'ald-table-table-wrap': string;
120
- 'ald-table-tableHeadScrollWrap': string;
121
- 'ald-table-tbody': string;
122
- 'ald-table-tbody-innerScroll': string;
123
- 'ald-table-thead': string;
124
- }
125
- export const cssExports: CssExports;
126
- export default cssExports;
@@ -1,21 +0,0 @@
1
- import { ReactNode } from 'react';
2
- export interface ITabPaneProps {
3
- /**
4
- * @description 被隐藏时是否渲染 DOM 结构
5
- * @default false
6
- */
7
- forceRender?: boolean;
8
- /**
9
- * @description 对应 activeKey
10
- * @default -
11
- */
12
- key?: string;
13
- /**
14
- * @description 选项卡头显示的内容
15
- * @default -
16
- */
17
- tab: ReactNode;
18
- className?: string;
19
- children?: ReactNode;
20
- }
21
- export default function TabPane(props: ITabPaneProps): JSX.Element;
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- import AntdTabs from 'antd/lib/tabs';
3
- var AntdTabPane = AntdTabs.TabPane;
4
- export default function TabPane(props) {
5
- return /*#__PURE__*/React.createElement(AntdTabPane, Object.assign({}, props));
6
- }
@@ -1,418 +0,0 @@
1
- [
2
- {
3
- "id": 0,
4
- "title": "加载中",
5
- "name": "loading-line",
6
- "category": "Line",
7
- "categoryCN": "线",
8
- "author": "阿广"
9
- },
10
- {
11
- "id": 1,
12
- "title": "全部",
13
- "name": "all-line",
14
- "category": "Line",
15
- "categoryCN": "线",
16
- "author": "阿广"
17
- },
18
- {
19
- "id": 2,
20
- "title": "至底",
21
- "name": "to-bottom-line",
22
- "category": "Line",
23
- "categoryCN": "线",
24
- "author": "阿广"
25
- },
26
- {
27
- "id": 3,
28
- "title": "闪电",
29
- "name": "lightning-line",
30
- "category": "Line",
31
- "categoryCN": "线",
32
- "author": "阿广"
33
- },
34
- {
35
- "id": 4,
36
- "title": "复制",
37
- "name": "copy-line",
38
- "category": "Line",
39
- "categoryCN": "线",
40
- "author": "阿广"
41
- },
42
- {
43
- "id": 5,
44
- "title": "标签",
45
- "name": "hashtag-line",
46
- "category": "Line",
47
- "categoryCN": "线",
48
- "author": "阿广"
49
- },
50
- {
51
- "id": 6,
52
- "title": "日历",
53
- "name": "calendar-line",
54
- "category": "Line",
55
- "categoryCN": "线",
56
- "author": "阿广"
57
- },
58
- {
59
- "id": 7,
60
- "title": "至顶",
61
- "name": "to-top-line",
62
- "category": "Line",
63
- "categoryCN": "线",
64
- "author": "阿广"
65
- },
66
- {
67
- "id": 8,
68
- "title": "最大化",
69
- "name": "maximize-line",
70
- "category": "Line",
71
- "categoryCN": "线",
72
- "author": "阿广"
73
- },
74
- {
75
- "id": 9,
76
- "title": "等待中_圆形",
77
- "name": "waiting-line",
78
- "category": "Line",
79
- "categoryCN": "线",
80
- "author": "阿广"
81
- },
82
- {
83
- "id": 10,
84
- "title": "收缩",
85
- "name": "shrink-line",
86
- "category": "Line",
87
- "categoryCN": "线",
88
- "author": "阿广"
89
- },
90
- {
91
- "id": 11,
92
- "title": "明细",
93
- "name": "lists-line",
94
- "category": "Line",
95
- "categoryCN": "线",
96
- "author": "阿广"
97
- },
98
- {
99
- "id": 12,
100
- "title": "正确_圆形",
101
- "name": "check-circle-line",
102
- "category": "Line",
103
- "categoryCN": "线",
104
- "author": "阿广"
105
- },
106
- {
107
- "id": 13,
108
- "title": "错误_圆形",
109
- "name": "error-circle-line",
110
- "category": "Line",
111
- "categoryCN": "线",
112
- "author": "阿广"
113
- },
114
- {
115
- "id": 14,
116
- "title": "右箭头_小号",
117
- "name": "arrows-right-sm-line",
118
- "category": "Line",
119
- "categoryCN": "线",
120
- "author": "阿广"
121
- },
122
- {
123
- "id": 15,
124
- "title": "优化",
125
- "name": "optimize-line",
126
- "category": "Line",
127
- "categoryCN": "线",
128
- "author": "阿广"
129
- },
130
- {
131
- "id": 16,
132
- "title": "文本",
133
- "name": "text-line",
134
- "category": "Line",
135
- "categoryCN": "线",
136
- "author": "阿广"
137
- },
138
- {
139
- "id": 17,
140
- "title": "用户_圆形",
141
- "name": "user-circle-line",
142
- "category": "Line",
143
- "categoryCN": "线",
144
- "author": "阿广"
145
- },
146
- {
147
- "id": 18,
148
- "title": "智能_模板",
149
- "name": "ai-template-line",
150
- "category": "Line",
151
- "categoryCN": "线",
152
- "author": "阿广"
153
- },
154
- {
155
- "id": 19,
156
- "title": "添加",
157
- "name": "add-line",
158
- "category": "Line",
159
- "categoryCN": "线",
160
- "author": "阿广"
161
- },
162
- {
163
- "id": 20,
164
- "title": "智能_明细",
165
- "name": "ai-lists-line",
166
- "category": "Line",
167
- "categoryCN": "线",
168
- "author": "阿广"
169
- },
170
- {
171
- "id": 21,
172
- "title": "check",
173
- "name": "check-line",
174
- "category": "Line",
175
- "categoryCN": "线",
176
- "author": "阿广"
177
- },
178
- {
179
- "id": 22,
180
- "title": "聚合",
181
- "name": "column-line",
182
- "category": "Line",
183
- "categoryCN": "线",
184
- "author": "阿广"
185
- },
186
- {
187
- "id": 23,
188
- "title": "新窗口",
189
- "name": "new-windows-line",
190
- "category": "Line",
191
- "categoryCN": "线",
192
- "author": "阿广"
193
- },
194
- {
195
- "id": 24,
196
- "title": "智能_聚合",
197
- "name": "ai-column-line",
198
- "category": "Line",
199
- "categoryCN": "线",
200
- "author": "阿广"
201
- },
202
- {
203
- "id": 25,
204
- "title": "文章",
205
- "name": "article-fill",
206
- "category": "Fill",
207
- "categoryCN": "填充",
208
- "author": "阿广"
209
- },
210
- {
211
- "id": 26,
212
- "title": "存储",
213
- "name": "storage-fill",
214
- "category": "Fill",
215
- "categoryCN": "填充",
216
- "author": "阿广"
217
- },
218
- {
219
- "id": 27,
220
- "title": "点",
221
- "name": "dot-fill",
222
- "category": "Fill",
223
- "categoryCN": "填充",
224
- "author": "阿广"
225
- },
226
- {
227
- "id": 28,
228
- "title": "信息",
229
- "name": "info-fill",
230
- "category": "Fill",
231
- "categoryCN": "填充",
232
- "author": "阿广"
233
- },
234
- {
235
- "id": 29,
236
- "title": "闪电",
237
- "name": "lightning-fill",
238
- "category": "Fill",
239
- "categoryCN": "填充",
240
- "author": "阿广"
241
- },
242
- {
243
- "id": 30,
244
- "title": "文件夹_打开",
245
- "name": "folder-open-fill",
246
- "category": "Fill",
247
- "categoryCN": "填充",
248
- "author": "阿广"
249
- },
250
- {
251
- "id": 31,
252
- "title": "文件夹",
253
- "name": "folder-fill",
254
- "category": "Fill",
255
- "categoryCN": "填充",
256
- "author": "阿广"
257
- },
258
- {
259
- "id": 32,
260
- "title": "箭头_向下",
261
- "name": "arrows-down-line",
262
- "category": "Line",
263
- "categoryCN": "线",
264
- "author": "阿广"
265
- },
266
- {
267
- "id": 33,
268
- "title": "取消",
269
- "name": "cancel-fill",
270
- "category": "Fill",
271
- "categoryCN": "填充",
272
- "author": "阿广"
273
- },
274
- {
275
- "id": 34,
276
- "title": "关闭",
277
- "name": "close-line",
278
- "category": "Line",
279
- "categoryCN": "线",
280
- "author": "阿广"
281
- },
282
- {
283
- "id": 35,
284
- "title": "删除",
285
- "name": "delete-line",
286
- "category": "Line",
287
- "categoryCN": "线",
288
- "author": "阿广"
289
- },
290
- {
291
- "id": 36,
292
- "title": "下载",
293
- "name": "download-line",
294
- "category": "Line",
295
- "categoryCN": "线",
296
- "author": "阿广"
297
- },
298
- {
299
- "id": 37,
300
- "title": "闭眼",
301
- "name": "eye-off-line",
302
- "category": "Line",
303
- "categoryCN": "线",
304
- "author": "阿广"
305
- },
306
- {
307
- "id": 38,
308
- "title": "睁眼",
309
- "name": "eye-on-line",
310
- "category": "Line",
311
- "categoryCN": "线",
312
- "author": "阿广"
313
- },
314
- {
315
- "id": 39,
316
- "title": "更多",
317
- "name": "more",
318
- "category": "Fill",
319
- "categoryCN": "填充",
320
- "author": "阿广"
321
- },
322
- {
323
- "id": 40,
324
- "title": "查询",
325
- "name": "search-line",
326
- "category": "Line",
327
- "categoryCN": "线",
328
- "author": "阿广"
329
- },
330
- {
331
- "id": 41,
332
- "title": "升序排列",
333
- "name": "sort-ascending-line",
334
- "category": "Line",
335
- "categoryCN": "线",
336
- "author": "阿广"
337
- },
338
- {
339
- "id": 42,
340
- "title": "降序排列",
341
- "name": "sort-descending-line",
342
- "category": "Line",
343
- "categoryCN": "线",
344
- "author": "阿广"
345
- },
346
- {
347
- "id": 43,
348
- "title": "check@fill",
349
- "name": "check-fill",
350
- "category": "Fill",
351
- "categoryCN": "填充",
352
- "author": "阿广"
353
- },
354
- {
355
- "id": 44,
356
- "title": "数据空间",
357
- "name": "data-space-line",
358
- "category": "Line",
359
- "categoryCN": "线",
360
- "author": "阿广"
361
- },
362
- {
363
- "id": 45,
364
- "title": "数据集",
365
- "name": "dataset-line",
366
- "category": "Line",
367
- "categoryCN": "线",
368
- "author": "阿广"
369
- },
370
- {
371
- "id": 46,
372
- "title": "文件",
373
- "name": "file-line",
374
- "category": "Line",
375
- "categoryCN": "线",
376
- "author": "阿广"
377
- },
378
- {
379
- "id": 47,
380
- "title": "同步刷新",
381
- "name": "sync-refresh-line",
382
- "category": "Line",
383
- "categoryCN": "线",
384
- "author": "阿广"
385
- },
386
- {
387
- "id": 48,
388
- "title": "表格",
389
- "name": "table-line",
390
- "category": "Line",
391
- "categoryCN": "线",
392
- "author": "阿广"
393
- },
394
- {
395
- "id": 49,
396
- "title": "视图",
397
- "name": "view-line",
398
- "category": "Line",
399
- "categoryCN": "线",
400
- "author": "阿广"
401
- },
402
- {
403
- "id": 50,
404
- "title": "错误",
405
- "name": "error-fill",
406
- "category": "Fill",
407
- "categoryCN": "填充",
408
- "author": "阿广"
409
- },
410
- {
411
- "id": 51,
412
- "title": "数据库",
413
- "name": "database-line",
414
- "category": "Line",
415
- "categoryCN": "线",
416
- "author": "阿广"
417
- }
418
- ]
@@ -1,7 +0,0 @@
1
- export declare type Updater<State> = (prev: State) => State;
2
- /**
3
- * Execute code before next frame but async
4
- */
5
- export declare function useLayoutState<State>(defaultState: State): [State, (updater: Updater<State>) => void];
6
- /** Lock frame, when frame pass reset the lock. */
7
- export declare function useTimeoutLock<State>(defaultState?: State): [(state: State) => void, () => State];
@@ -1,98 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useLayoutState = useLayoutState;
7
- exports.useTimeoutLock = useTimeoutLock;
8
-
9
- var _react = require("react");
10
-
11
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
12
-
13
- 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."); }
14
-
15
- 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); }
16
-
17
- 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; }
18
-
19
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
20
-
21
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
22
-
23
- /**
24
- * Execute code before next frame but async
25
- */
26
- function useLayoutState(defaultState) {
27
- var stateRef = (0, _react.useRef)(defaultState);
28
-
29
- var _useState = (0, _react.useState)({}),
30
- _useState2 = _slicedToArray(_useState, 2),
31
- forceUpdate = _useState2[1];
32
-
33
- var lastPromiseRef = (0, _react.useRef)(null);
34
- var updateBatchRef = (0, _react.useRef)([]);
35
-
36
- function setFrameState(updater) {
37
- updateBatchRef.current.push(updater);
38
- var promise = Promise.resolve(); // @ts-ignore;
39
-
40
- lastPromiseRef.current = promise;
41
- promise.then(function () {
42
- if (lastPromiseRef.current === promise) {
43
- var prevBatch = updateBatchRef.current;
44
- var prevState = stateRef.current;
45
- updateBatchRef.current = [];
46
- prevBatch.forEach(function (batchUpdater) {
47
- stateRef.current = batchUpdater(stateRef.current);
48
- }); // @ts-ignore;
49
-
50
- lastPromiseRef.current = null;
51
-
52
- if (prevState !== stateRef.current) {
53
- forceUpdate({});
54
- }
55
- }
56
- });
57
- }
58
-
59
- (0, _react.useEffect)(function () {
60
- return function () {
61
- // @ts-ignore;
62
- lastPromiseRef.current = null;
63
- };
64
- }, []);
65
- return [stateRef.current, setFrameState];
66
- }
67
- /** Lock frame, when frame pass reset the lock. */
68
-
69
-
70
- function useTimeoutLock(defaultState) {
71
- var frameRef = (0, _react.useRef)(defaultState || null);
72
- var timeoutRef = (0, _react.useRef)();
73
- var TIMEOUT_DELAY = 50;
74
-
75
- function cleanUp() {
76
- window.clearTimeout(timeoutRef.current);
77
- }
78
-
79
- function setState(newState) {
80
- // @ts-ignore;
81
- frameRef.current = newState;
82
- cleanUp();
83
- timeoutRef.current = window.setTimeout(function () {
84
- // @ts-ignore;
85
- frameRef.current = null;
86
- timeoutRef.current = undefined;
87
- }, TIMEOUT_DELAY);
88
- }
89
-
90
- function getState() {
91
- return frameRef.current;
92
- }
93
-
94
- (0, _react.useEffect)(function () {
95
- return cleanUp;
96
- }, []);
97
- return [setState, getState];
98
- }