@tachybase/components 0.23.8

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 (174) hide show
  1. package/.turbo/turbo-build.log +9 -0
  2. package/LICENSE +201 -0
  3. package/lib/__builtins__/dayjs.d.ts +4 -0
  4. package/lib/__builtins__/dayjs.js +95 -0
  5. package/lib/__builtins__/hooks/index.d.ts +4 -0
  6. package/lib/__builtins__/hooks/index.js +27 -0
  7. package/lib/__builtins__/hooks/useClickAway.d.ts +5 -0
  8. package/lib/__builtins__/hooks/useClickAway.js +64 -0
  9. package/lib/__builtins__/hooks/useConfig.d.ts +1 -0
  10. package/lib/__builtins__/hooks/useConfig.js +31 -0
  11. package/lib/__builtins__/hooks/usePrefixCls.d.ts +3 -0
  12. package/lib/__builtins__/hooks/usePrefixCls.js +38 -0
  13. package/lib/__builtins__/hooks/useToken.d.ts +6 -0
  14. package/lib/__builtins__/hooks/useToken.js +28 -0
  15. package/lib/__builtins__/index.d.ts +7 -0
  16. package/lib/__builtins__/index.js +33 -0
  17. package/lib/__builtins__/loading.d.ts +1 -0
  18. package/lib/__builtins__/loading.js +40 -0
  19. package/lib/__builtins__/pickDataProps.d.ts +1 -0
  20. package/lib/__builtins__/pickDataProps.js +36 -0
  21. package/lib/__builtins__/portal.d.ts +10 -0
  22. package/lib/__builtins__/portal.js +89 -0
  23. package/lib/__builtins__/render.d.ts +9 -0
  24. package/lib/__builtins__/render.js +99 -0
  25. package/lib/__builtins__/sort.d.ts +73 -0
  26. package/lib/__builtins__/sort.js +126 -0
  27. package/lib/__builtins__/style.d.ts +23 -0
  28. package/lib/__builtins__/style.js +88 -0
  29. package/lib/array-base/index.d.ts +64 -0
  30. package/lib/array-base/index.js +345 -0
  31. package/lib/array-base/style.d.ts +2 -0
  32. package/lib/array-base/style.js +68 -0
  33. package/lib/array-cards/index.d.ts +5 -0
  34. package/lib/array-cards/index.js +166 -0
  35. package/lib/array-cards/style.d.ts +2 -0
  36. package/lib/array-cards/style.js +37 -0
  37. package/lib/array-collapse/index.d.ts +10 -0
  38. package/lib/array-collapse/index.js +199 -0
  39. package/lib/array-collapse/style.d.ts +2 -0
  40. package/lib/array-collapse/style.js +33 -0
  41. package/lib/array-items/index.d.ts +8 -0
  42. package/lib/array-items/index.js +122 -0
  43. package/lib/array-items/style.d.ts +2 -0
  44. package/lib/array-items/style.js +82 -0
  45. package/lib/array-table/index.d.ts +9 -0
  46. package/lib/array-table/index.js +376 -0
  47. package/lib/array-table/style.d.ts +2 -0
  48. package/lib/array-table/style.js +71 -0
  49. package/lib/array-tabs/index.d.ts +4 -0
  50. package/lib/array-tabs/index.js +102 -0
  51. package/lib/cascader/index.d.ts +12 -0
  52. package/lib/cascader/index.js +58 -0
  53. package/lib/checkbox/index.d.ts +5 -0
  54. package/lib/checkbox/index.js +51 -0
  55. package/lib/code-mirror/index.d.ts +3 -0
  56. package/lib/code-mirror/index.js +91 -0
  57. package/lib/date-picker/index.d.ts +2 -0
  58. package/lib/date-picker/index.js +70 -0
  59. package/lib/date-picker/style.d.ts +1 -0
  60. package/lib/date-picker/style.js +1 -0
  61. package/lib/editable/index.d.ts +8 -0
  62. package/lib/editable/index.js +181 -0
  63. package/lib/editable/style.d.ts +2 -0
  64. package/lib/editable/style.js +69 -0
  65. package/lib/form/index.d.ts +12 -0
  66. package/lib/form/index.js +71 -0
  67. package/lib/form-button-group/index.d.ts +27 -0
  68. package/lib/form-button-group/index.js +148 -0
  69. package/lib/form-button-group/style.d.ts +2 -0
  70. package/lib/form-button-group/style.js +41 -0
  71. package/lib/form-collapse/index.d.ts +28 -0
  72. package/lib/form-collapse/index.js +150 -0
  73. package/lib/form-dialog/index.d.ts +26 -0
  74. package/lib/form-dialog/index.js +194 -0
  75. package/lib/form-drawer/index.d.ts +25 -0
  76. package/lib/form-drawer/index.js +187 -0
  77. package/lib/form-grid/index.d.ts +34 -0
  78. package/lib/form-grid/index.js +108 -0
  79. package/lib/form-grid/style.d.ts +2 -0
  80. package/lib/form-grid/style.js +31 -0
  81. package/lib/form-item/hooks/index.d.ts +2 -0
  82. package/lib/form-item/hooks/index.js +23 -0
  83. package/lib/form-item/hooks/useFormItemLayout.d.ts +37 -0
  84. package/lib/form-item/hooks/useFormItemLayout.js +66 -0
  85. package/lib/form-item/hooks/useOverflow.d.ts +5 -0
  86. package/lib/form-item/hooks/useOverflow.js +55 -0
  87. package/lib/form-item/index.d.ts +11 -0
  88. package/lib/form-item/index.js +303 -0
  89. package/lib/form-item/style/animation.d.ts +2 -0
  90. package/lib/form-item/style/animation.js +57 -0
  91. package/lib/form-item/style/grid.d.ts +2 -0
  92. package/lib/form-item/style/grid.js +50 -0
  93. package/lib/form-item/style/index.d.ts +2 -0
  94. package/lib/form-item/style/index.js +387 -0
  95. package/lib/form-item/style/other.d.ts +2 -0
  96. package/lib/form-item/style/other.js +490 -0
  97. package/lib/form-item/types.d.ts +35 -0
  98. package/lib/form-item/types.js +15 -0
  99. package/lib/form-layout/index.d.ts +74 -0
  100. package/lib/form-layout/index.js +96 -0
  101. package/lib/form-layout/useResponsiveFormLayout.d.ts +17 -0
  102. package/lib/form-layout/useResponsiveFormLayout.js +89 -0
  103. package/lib/form-step/index.d.ts +27 -0
  104. package/lib/form-step/index.js +154 -0
  105. package/lib/form-tab/index.d.ts +19 -0
  106. package/lib/form-tab/index.js +150 -0
  107. package/lib/index.d.ts +38 -0
  108. package/lib/index.js +95 -0
  109. package/lib/input/index.d.ts +7 -0
  110. package/lib/input/index.js +57 -0
  111. package/lib/lightbox/constant.d.ts +21 -0
  112. package/lib/lightbox/constant.js +79 -0
  113. package/lib/lightbox/index.d.ts +2 -0
  114. package/lib/lightbox/index.js +37 -0
  115. package/lib/lightbox/interface.d.ts +43 -0
  116. package/lib/lightbox/interface.js +15 -0
  117. package/lib/lightbox/react-image-lightbox.d.ts +197 -0
  118. package/lib/lightbox/react-image-lightbox.js +1431 -0
  119. package/lib/lightbox/style.css +305 -0
  120. package/lib/lightbox/util.d.ts +7 -0
  121. package/lib/lightbox/util.js +71 -0
  122. package/lib/number-picker/index.d.ts +4 -0
  123. package/lib/number-picker/index.js +32 -0
  124. package/lib/password/PasswordStrength.d.ts +9 -0
  125. package/lib/password/PasswordStrength.js +188 -0
  126. package/lib/password/index.d.ts +7 -0
  127. package/lib/password/index.js +85 -0
  128. package/lib/preview-text/index.d.ts +12 -0
  129. package/lib/preview-text/index.js +263 -0
  130. package/lib/preview-text/style.d.ts +2 -0
  131. package/lib/preview-text/style.js +37 -0
  132. package/lib/radio/index.d.ts +8 -0
  133. package/lib/radio/index.js +51 -0
  134. package/lib/reset/index.d.ts +10 -0
  135. package/lib/reset/index.js +67 -0
  136. package/lib/select/index.d.ts +4 -0
  137. package/lib/select/index.js +59 -0
  138. package/lib/select-table/hooks/index.d.ts +5 -0
  139. package/lib/select-table/hooks/index.js +29 -0
  140. package/lib/select-table/hooks/useCheckSlackly.d.ts +16 -0
  141. package/lib/select-table/hooks/useCheckSlackly.js +57 -0
  142. package/lib/select-table/hooks/useFilterOptions.d.ts +3 -0
  143. package/lib/select-table/hooks/useFilterOptions.js +97 -0
  144. package/lib/select-table/hooks/useFlatOptions.d.ts +3 -0
  145. package/lib/select-table/hooks/useFlatOptions.js +46 -0
  146. package/lib/select-table/hooks/useSize.d.ts +9 -0
  147. package/lib/select-table/hooks/useSize.js +48 -0
  148. package/lib/select-table/hooks/useTitleAddon.d.ts +7 -0
  149. package/lib/select-table/hooks/useTitleAddon.js +90 -0
  150. package/lib/select-table/index.d.ts +27 -0
  151. package/lib/select-table/index.js +339 -0
  152. package/lib/select-table/style.d.ts +2 -0
  153. package/lib/select-table/style.js +33 -0
  154. package/lib/select-table/utils.d.ts +78 -0
  155. package/lib/select-table/utils.js +166 -0
  156. package/lib/space/index.d.ts +4 -0
  157. package/lib/space/index.js +49 -0
  158. package/lib/submit/index.d.ts +11 -0
  159. package/lib/submit/index.js +67 -0
  160. package/lib/switch/index.d.ts +2 -0
  161. package/lib/switch/index.js +44 -0
  162. package/lib/time-picker/index.d.ts +2 -0
  163. package/lib/time-picker/index.js +60 -0
  164. package/lib/time-picker/style.d.ts +1 -0
  165. package/lib/time-picker/style.js +1 -0
  166. package/lib/transfer/index.d.ts +2 -0
  167. package/lib/transfer/index.js +56 -0
  168. package/lib/tree-select/index.d.ts +2 -0
  169. package/lib/tree-select/index.js +58 -0
  170. package/lib/upload/index.d.ts +18 -0
  171. package/lib/upload/index.js +159 -0
  172. package/lib/upload/placeholder.d.ts +4 -0
  173. package/lib/upload/placeholder.js +88 -0
  174. package/package.json +31 -0
@@ -0,0 +1,305 @@
1
+ @keyframes closeWindow {
2
+ 0% {
3
+ opacity: 1;
4
+ }
5
+ 100% {
6
+ opacity: 0;
7
+ }
8
+ }
9
+ .ril__outer {
10
+ background-color: rgba(0, 0, 0, 0.85);
11
+ outline: none;
12
+ top: 0;
13
+ left: 0;
14
+ right: 0;
15
+ bottom: 0;
16
+ z-index: 1000;
17
+ width: 100%;
18
+ height: 100%;
19
+ -ms-content-zooming: none;
20
+ -ms-user-select: none;
21
+ -ms-touch-select: none;
22
+ touch-action: none;
23
+ }
24
+ .ril__outerClosing {
25
+ opacity: 0;
26
+ }
27
+ .ril__inner {
28
+ position: absolute;
29
+ top: 0;
30
+ left: 0;
31
+ right: 0;
32
+ bottom: 0;
33
+ }
34
+ .ril__image,
35
+ .ril__imagePrev,
36
+ .ril__imageNext {
37
+ position: absolute;
38
+ top: 0;
39
+ right: 0;
40
+ bottom: 0;
41
+ left: 0;
42
+ margin: auto;
43
+ max-width: none;
44
+ -ms-content-zooming: none;
45
+ -ms-user-select: none;
46
+ -ms-touch-select: none;
47
+ touch-action: none;
48
+ }
49
+ .ril__imageDiscourager {
50
+ background-repeat: no-repeat;
51
+ background-position: center;
52
+ background-size: contain;
53
+ }
54
+ .ril__navButtons {
55
+ border: none;
56
+ position: absolute;
57
+ top: 0;
58
+ bottom: 0;
59
+ width: 20px;
60
+ height: 34px;
61
+ padding: 40px 30px;
62
+ margin: auto;
63
+ cursor: pointer;
64
+ opacity: 0.7;
65
+ }
66
+ .ril__navButtons:hover {
67
+ opacity: 1;
68
+ }
69
+ .ril__navButtons:active {
70
+ opacity: 0.7;
71
+ }
72
+ .ril__navButtonPrev {
73
+ left: 0;
74
+ background: rgba(0, 0, 0, 0.2) url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjIwIiBoZWlnaHQ9IjM0Ij48cGF0aCBkPSJtIDE5LDMgLTIsLTIgLTE2LDE2IDE2LDE2IDEsLTEgLTE1LC0xNSAxNSwtMTUgeiIgZmlsbD0iI0ZGRiIvPjwvc3ZnPg==) no-repeat center;
75
+ }
76
+ .ril__navButtonNext {
77
+ right: 0;
78
+ background: rgba(0, 0, 0, 0.2) url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjIwIiBoZWlnaHQ9IjM0Ij48cGF0aCBkPSJtIDEsMyAyLC0yIDE2LDE2IC0xNiwxNiAtMSwtMSAxNSwtMTUgLTE1LC0xNSB6IiBmaWxsPSIjRkZGIi8+PC9zdmc+) no-repeat center;
79
+ }
80
+ .ril__downloadBlocker {
81
+ position: absolute;
82
+ top: 0;
83
+ left: 0;
84
+ right: 0;
85
+ bottom: 0;
86
+ background-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);
87
+ background-size: cover;
88
+ }
89
+ .ril__caption,
90
+ .ril__toolbar {
91
+ background-color: rgba(0, 0, 0, 0.5);
92
+ position: absolute;
93
+ left: 0;
94
+ right: 0;
95
+ display: flex;
96
+ justify-content: space-between;
97
+ }
98
+ .ril__caption {
99
+ bottom: 0;
100
+ max-height: 150px;
101
+ overflow: auto;
102
+ }
103
+ .ril__captionContent {
104
+ padding: 10px 20px;
105
+ color: #fff;
106
+ }
107
+ .ril__toolbar {
108
+ top: 0;
109
+ height: 50px;
110
+ }
111
+ .ril__toolbarSide {
112
+ height: 50px;
113
+ margin: 0;
114
+ }
115
+ .ril__toolbarLeftSide {
116
+ padding-left: 20px;
117
+ padding-right: 0;
118
+ flex: 0 1 auto;
119
+ overflow: hidden;
120
+ text-overflow: ellipsis;
121
+ }
122
+ .ril__toolbarRightSide {
123
+ padding-left: 0;
124
+ padding-right: 20px;
125
+ flex: 0 0 auto;
126
+ }
127
+ .ril__toolbarItem {
128
+ display: inline-block;
129
+ line-height: 50px;
130
+ padding: 0;
131
+ color: #fff;
132
+ font-size: 120%;
133
+ max-width: 100%;
134
+ overflow: hidden;
135
+ text-overflow: ellipsis;
136
+ white-space: nowrap;
137
+ }
138
+ .ril__toolbarItemChild {
139
+ vertical-align: middle;
140
+ }
141
+ .ril__builtinButton {
142
+ width: 40px;
143
+ height: 35px;
144
+ cursor: pointer;
145
+ border: none;
146
+ opacity: 0.7;
147
+ }
148
+ .ril__builtinButton:hover {
149
+ opacity: 1;
150
+ }
151
+ .ril__builtinButton:active {
152
+ outline: none;
153
+ }
154
+ .ril__builtinButtonDisabled {
155
+ cursor: default;
156
+ opacity: 0.5;
157
+ }
158
+ .ril__builtinButtonDisabled:hover {
159
+ opacity: 0.5;
160
+ }
161
+ .ril__closeButton {
162
+ background: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjIwIiBoZWlnaHQ9IjIwIj48cGF0aCBkPSJtIDEsMyAxLjI1LC0xLjI1IDcuNSw3LjUgNy41LC03LjUgMS4yNSwxLjI1IC03LjUsNy41IDcuNSw3LjUgLTEuMjUsMS4yNSAtNy41LC03LjUgLTcuNSw3LjUgLTEuMjUsLTEuMjUgNy41LC03LjUgLTcuNSwtNy41IHoiIGZpbGw9IiNGRkYiLz48L3N2Zz4=) no-repeat center;
163
+ }
164
+ .ril__zoomInButton {
165
+ background: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCI+PGcgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCI+PHBhdGggZD0iTTEgMTlsNi02Ii8+PHBhdGggZD0iTTkgOGg2Ii8+PHBhdGggZD0iTTEyIDV2NiIvPjwvZz48Y2lyY2xlIGN4PSIxMiIgY3k9IjgiIHI9IjciIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLXdpZHRoPSIyIi8+PC9zdmc+) no-repeat center;
166
+ }
167
+ .ril__zoomOutButton {
168
+ background: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCI+PGcgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCI+PHBhdGggZD0iTTEgMTlsNi02Ii8+PHBhdGggZD0iTTkgOGg2Ii8+PC9nPjxjaXJjbGUgY3g9IjEyIiBjeT0iOCIgcj0iNyIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjIiLz48L3N2Zz4=) no-repeat center;
169
+ }
170
+ .ril__outerAnimating {
171
+ animation-name: closeWindow;
172
+ }
173
+ @keyframes pointFade {
174
+ 0%, 19.999%, 100% {
175
+ opacity: 0;
176
+ }
177
+ 20% {
178
+ opacity: 1;
179
+ }
180
+ }
181
+ .ril__loadingCircle {
182
+ width: 60px;
183
+ height: 60px;
184
+ position: relative;
185
+ }
186
+ .ril__loadingCirclePoint {
187
+ width: 100%;
188
+ height: 100%;
189
+ position: absolute;
190
+ left: 0;
191
+ top: 0;
192
+ }
193
+ .ril__loadingCirclePoint::before {
194
+ content: "";
195
+ display: block;
196
+ margin: 0 auto;
197
+ width: 11%;
198
+ height: 30%;
199
+ background-color: #fff;
200
+ border-radius: 30%;
201
+ animation: pointFade 800ms infinite ease-in-out both;
202
+ }
203
+ .ril__loadingCirclePoint:nth-of-type(1) {
204
+ transform: rotate(0deg);
205
+ }
206
+ .ril__loadingCirclePoint:nth-of-type(7) {
207
+ transform: rotate(180deg);
208
+ }
209
+ .ril__loadingCirclePoint:nth-of-type(1)::before,
210
+ .ril__loadingCirclePoint:nth-of-type(7)::before {
211
+ animation-delay: -800ms;
212
+ }
213
+ .ril__loadingCirclePoint:nth-of-type(2) {
214
+ transform: rotate(30deg);
215
+ }
216
+ .ril__loadingCirclePoint:nth-of-type(8) {
217
+ transform: rotate(210deg);
218
+ }
219
+ .ril__loadingCirclePoint:nth-of-type(2)::before,
220
+ .ril__loadingCirclePoint:nth-of-type(8)::before {
221
+ animation-delay: -666ms;
222
+ }
223
+ .ril__loadingCirclePoint:nth-of-type(3) {
224
+ transform: rotate(60deg);
225
+ }
226
+ .ril__loadingCirclePoint:nth-of-type(9) {
227
+ transform: rotate(240deg);
228
+ }
229
+ .ril__loadingCirclePoint:nth-of-type(3)::before,
230
+ .ril__loadingCirclePoint:nth-of-type(9)::before {
231
+ animation-delay: -533ms;
232
+ }
233
+ .ril__loadingCirclePoint:nth-of-type(4) {
234
+ transform: rotate(90deg);
235
+ }
236
+ .ril__loadingCirclePoint:nth-of-type(10) {
237
+ transform: rotate(270deg);
238
+ }
239
+ .ril__loadingCirclePoint:nth-of-type(4)::before,
240
+ .ril__loadingCirclePoint:nth-of-type(10)::before {
241
+ animation-delay: -400ms;
242
+ }
243
+ .ril__loadingCirclePoint:nth-of-type(5) {
244
+ transform: rotate(120deg);
245
+ }
246
+ .ril__loadingCirclePoint:nth-of-type(11) {
247
+ transform: rotate(300deg);
248
+ }
249
+ .ril__loadingCirclePoint:nth-of-type(5)::before,
250
+ .ril__loadingCirclePoint:nth-of-type(11)::before {
251
+ animation-delay: -266ms;
252
+ }
253
+ .ril__loadingCirclePoint:nth-of-type(6) {
254
+ transform: rotate(150deg);
255
+ }
256
+ .ril__loadingCirclePoint:nth-of-type(12) {
257
+ transform: rotate(330deg);
258
+ }
259
+ .ril__loadingCirclePoint:nth-of-type(6)::before,
260
+ .ril__loadingCirclePoint:nth-of-type(12)::before {
261
+ animation-delay: -133ms;
262
+ }
263
+ .ril__loadingCirclePoint:nth-of-type(7) {
264
+ transform: rotate(180deg);
265
+ }
266
+ .ril__loadingCirclePoint:nth-of-type(13) {
267
+ transform: rotate(360deg);
268
+ }
269
+ .ril__loadingCirclePoint:nth-of-type(7)::before,
270
+ .ril__loadingCirclePoint:nth-of-type(13)::before {
271
+ animation-delay: 0ms;
272
+ }
273
+ .ril__loadingContainer {
274
+ position: absolute;
275
+ top: 0;
276
+ right: 0;
277
+ bottom: 0;
278
+ left: 0;
279
+ }
280
+ .ril__imagePrev .ril__loadingContainer,
281
+ .ril__imageNext .ril__loadingContainer {
282
+ display: none;
283
+ }
284
+ .ril__errorContainer {
285
+ position: absolute;
286
+ top: 0;
287
+ right: 0;
288
+ bottom: 0;
289
+ left: 0;
290
+ display: flex;
291
+ align-items: center;
292
+ justify-content: center;
293
+ color: #fff;
294
+ }
295
+ .ril__imagePrev .ril__errorContainer,
296
+ .ril__imageNext .ril__errorContainer {
297
+ display: none;
298
+ }
299
+ .ril__loadingContainer__icon {
300
+ color: #fff;
301
+ position: absolute;
302
+ top: 50%;
303
+ left: 50%;
304
+ transform: translateX(-50%) translateY(-50%);
305
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Placeholder for future translate functionality
3
+ */
4
+ export declare function translate(str: any, replaceStrings?: any): any;
5
+ export declare function getWindowWidth(): any;
6
+ export declare function getWindowHeight(): any;
7
+ export declare function getHighestSafeWindowContext(self?: Window): Window;
@@ -0,0 +1,71 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var util_exports = {};
20
+ __export(util_exports, {
21
+ getHighestSafeWindowContext: () => getHighestSafeWindowContext,
22
+ getWindowHeight: () => getWindowHeight,
23
+ getWindowWidth: () => getWindowWidth,
24
+ translate: () => translate
25
+ });
26
+ module.exports = __toCommonJS(util_exports);
27
+ function translate(str, replaceStrings = null) {
28
+ if (!str) {
29
+ return "";
30
+ }
31
+ let translated = str;
32
+ if (replaceStrings) {
33
+ Object.keys(replaceStrings).forEach((placeholder) => {
34
+ translated = translated.replace(placeholder, replaceStrings[placeholder]);
35
+ });
36
+ }
37
+ return translated;
38
+ }
39
+ __name(translate, "translate");
40
+ function getWindowWidth() {
41
+ return typeof global.window !== "undefined" ? global.window.innerWidth : 0;
42
+ }
43
+ __name(getWindowWidth, "getWindowWidth");
44
+ function getWindowHeight() {
45
+ return typeof global.window !== "undefined" ? global.window.innerHeight : 0;
46
+ }
47
+ __name(getWindowHeight, "getWindowHeight");
48
+ const isCrossOriginFrame = /* @__PURE__ */ __name(() => {
49
+ try {
50
+ return global.window.location.hostname !== global.window.parent.location.hostname;
51
+ } catch (e) {
52
+ return true;
53
+ }
54
+ }, "isCrossOriginFrame");
55
+ function getHighestSafeWindowContext(self = global.window.self) {
56
+ if (self === global.window.top) {
57
+ return self;
58
+ }
59
+ if (!isCrossOriginFrame()) {
60
+ return getHighestSafeWindowContext(self.parent);
61
+ }
62
+ return self;
63
+ }
64
+ __name(getHighestSafeWindowContext, "getHighestSafeWindowContext");
65
+ // Annotate the CommonJS export names for ESM import in node:
66
+ 0 && (module.exports = {
67
+ getHighestSafeWindowContext,
68
+ getWindowHeight,
69
+ getWindowWidth,
70
+ translate
71
+ });
@@ -0,0 +1,4 @@
1
+ export declare const NumberPicker: import("react").ForwardRefExoticComponent<Omit<Partial<import("antd").InputNumberProps<import("rc-input-number").ValueType> & {
2
+ children?: import("react").ReactNode | undefined;
3
+ } & import("react").RefAttributes<HTMLInputElement>>, "ref"> & import("react").RefAttributes<unknown>>;
4
+ export default NumberPicker;
@@ -0,0 +1,32 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var number_picker_exports = {};
19
+ __export(number_picker_exports, {
20
+ NumberPicker: () => NumberPicker,
21
+ default: () => number_picker_default
22
+ });
23
+ module.exports = __toCommonJS(number_picker_exports);
24
+ var import_schema = require("@tachybase/schema");
25
+ var import_antd = require("antd");
26
+ var import_preview_text = require("../preview-text");
27
+ const NumberPicker = (0, import_schema.connect)(import_antd.InputNumber, (0, import_schema.mapReadPretty)(import_preview_text.PreviewText.NumberPicker));
28
+ var number_picker_default = NumberPicker;
29
+ // Annotate the CommonJS export names for ESM import in node:
30
+ 0 && (module.exports = {
31
+ NumberPicker
32
+ });
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { ReactFC } from '@tachybase/schema';
3
+ type ReactRenderPropsChildren<T = any> = React.ReactNode | ((props: T) => React.ReactElement);
4
+ interface IPasswordStrengthProps {
5
+ value?: string | number;
6
+ children?: ReactRenderPropsChildren<number>;
7
+ }
8
+ export declare const PasswordStrength: ReactFC<IPasswordStrengthProps>;
9
+ export {};
@@ -0,0 +1,188 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var PasswordStrength_exports = {};
30
+ __export(PasswordStrength_exports, {
31
+ PasswordStrength: () => PasswordStrength
32
+ });
33
+ module.exports = __toCommonJS(PasswordStrength_exports);
34
+ var import_react = __toESM(require("react"));
35
+ var import_schema = require("@tachybase/schema");
36
+ const isNum = /* @__PURE__ */ __name(function(c) {
37
+ return c >= 48 && c <= 57;
38
+ }, "isNum");
39
+ const isLower = /* @__PURE__ */ __name(function(c) {
40
+ return c >= 97 && c <= 122;
41
+ }, "isLower");
42
+ const isUpper = /* @__PURE__ */ __name(function(c) {
43
+ return c >= 65 && c <= 90;
44
+ }, "isUpper");
45
+ const isSymbol = /* @__PURE__ */ __name(function(c) {
46
+ return !(isLower(c) || isUpper(c) || isNum(c));
47
+ }, "isSymbol");
48
+ const isLetter = /* @__PURE__ */ __name(function(c) {
49
+ return isLower(c) || isUpper(c);
50
+ }, "isLetter");
51
+ const getStrength = /* @__PURE__ */ __name((val) => {
52
+ if (!val) return 0;
53
+ let num = 0;
54
+ let lower = 0;
55
+ let upper = 0;
56
+ let symbol = 0;
57
+ let MNS = 0;
58
+ let rep = 0;
59
+ let repC = 0;
60
+ let consecutive = 0;
61
+ let sequential = 0;
62
+ const len = /* @__PURE__ */ __name(() => num + lower + upper + symbol, "len");
63
+ const callme = /* @__PURE__ */ __name(() => {
64
+ let re = num > 0 ? 1 : 0;
65
+ re += lower > 0 ? 1 : 0;
66
+ re += upper > 0 ? 1 : 0;
67
+ re += symbol > 0 ? 1 : 0;
68
+ if (re > 2 && len() >= 8) {
69
+ return re + 1;
70
+ } else {
71
+ return 0;
72
+ }
73
+ }, "callme");
74
+ for (let i = 0; i < val.length; i++) {
75
+ const c = val.charCodeAt(i);
76
+ if (isNum(c)) {
77
+ num++;
78
+ if (i !== 0 && i !== val.length - 1) {
79
+ MNS++;
80
+ }
81
+ if (i > 0 && isNum(val.charCodeAt(i - 1))) {
82
+ consecutive++;
83
+ }
84
+ } else if (isLower(c)) {
85
+ lower++;
86
+ if (i > 0 && isLower(val.charCodeAt(i - 1))) {
87
+ consecutive++;
88
+ }
89
+ } else if (isUpper(c)) {
90
+ upper++;
91
+ if (i > 0 && isUpper(val.charCodeAt(i - 1))) {
92
+ consecutive++;
93
+ }
94
+ } else {
95
+ symbol++;
96
+ if (i !== 0 && i !== val.length - 1) {
97
+ MNS++;
98
+ }
99
+ }
100
+ let exists = false;
101
+ for (let j = 0; j < val.length; j++) {
102
+ if (val[i] === val[j] && i !== j) {
103
+ exists = true;
104
+ repC += Math.abs(val.length / (j - i));
105
+ }
106
+ }
107
+ if (exists) {
108
+ rep++;
109
+ const unique = val.length - rep;
110
+ repC = unique ? Math.ceil(repC / unique) : Math.ceil(repC);
111
+ }
112
+ if (i > 1) {
113
+ const last1 = val.charCodeAt(i - 1);
114
+ const last2 = val.charCodeAt(i - 2);
115
+ if (isLetter(c)) {
116
+ if (isLetter(last1) && isLetter(last2)) {
117
+ const v = val.toLowerCase();
118
+ const vi = v.charCodeAt(i);
119
+ const vi1 = v.charCodeAt(i - 1);
120
+ const vi2 = v.charCodeAt(i - 2);
121
+ if (vi - vi1 === vi1 - vi2 && Math.abs(vi - vi1) === 1) {
122
+ sequential++;
123
+ }
124
+ }
125
+ } else if (isNum(c)) {
126
+ if (isNum(last1) && isNum(last2)) {
127
+ if (c - last1 === last1 - last2 && Math.abs(c - last1) === 1) {
128
+ sequential++;
129
+ }
130
+ }
131
+ } else {
132
+ if (isSymbol(last1) && isSymbol(last2)) {
133
+ if (c - last1 === last1 - last2 && Math.abs(c - last1) === 1) {
134
+ sequential++;
135
+ }
136
+ }
137
+ }
138
+ }
139
+ }
140
+ let sum = 0;
141
+ const length = len();
142
+ sum += 4 * length;
143
+ if (lower > 0) {
144
+ sum += 2 * (length - lower);
145
+ }
146
+ if (upper > 0) {
147
+ sum += 2 * (length - upper);
148
+ }
149
+ if (num !== length) {
150
+ sum += 4 * num;
151
+ }
152
+ sum += 6 * symbol;
153
+ sum += 2 * MNS;
154
+ sum += 2 * callme();
155
+ if (length === lower + upper) {
156
+ sum -= length;
157
+ }
158
+ if (length === num) {
159
+ sum -= num;
160
+ }
161
+ sum -= repC;
162
+ sum -= 2 * consecutive;
163
+ sum -= 3 * sequential;
164
+ sum = sum < 0 ? 0 : sum;
165
+ sum = sum > 100 ? 100 : sum;
166
+ if (sum >= 80) {
167
+ return 100;
168
+ } else if (sum >= 60) {
169
+ return 80;
170
+ } else if (sum >= 40) {
171
+ return 60;
172
+ } else if (sum >= 20) {
173
+ return 40;
174
+ } else {
175
+ return 20;
176
+ }
177
+ }, "getStrength");
178
+ const PasswordStrength = /* @__PURE__ */ __name((props) => {
179
+ if ((0, import_schema.isFn)(props.children)) {
180
+ return props.children(getStrength(String(props.value)));
181
+ } else {
182
+ return /* @__PURE__ */ import_react.default.createElement(import_react.Fragment, null, props.children);
183
+ }
184
+ }, "PasswordStrength");
185
+ // Annotate the CommonJS export names for ESM import in node:
186
+ 0 && (module.exports = {
187
+ PasswordStrength
188
+ });
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { PasswordProps } from 'antd/lib/input';
3
+ export interface IPasswordProps extends PasswordProps {
4
+ checkStrength: boolean;
5
+ }
6
+ export declare const Password: React.ForwardRefExoticComponent<Partial<IPasswordProps> & React.RefAttributes<unknown>>;
7
+ export default Password;