@trionesdev/antd-mobile-base-react 0.0.2-beta.2 → 0.0.2-beta.21
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/dist/Alert/alert.js +1 -1
- package/dist/Alert/style.scss +17 -17
- package/dist/Avatar/avatar.d.ts +4 -1
- package/dist/Avatar/avatar.js +19 -6
- package/dist/Avatar/style.scss +3 -2
- package/dist/Card/style.scss +12 -12
- package/dist/CascaderView/cascader-column-item.js +1 -1
- package/dist/CascaderView/style.scss +2 -2
- package/dist/Cell/CellGroup.js +53 -14
- package/dist/Cell/cell.js +52 -15
- package/dist/Cell/context.d.ts +19 -0
- package/dist/Cell/context.js +2 -0
- package/dist/Cell/styles.scss +42 -13
- package/dist/Cell/types.d.ts +30 -7
- package/dist/Checkbox/checkbox-button.d.ts +6 -2
- package/dist/Checkbox/checkbox-button.js +6 -18
- package/dist/Checkbox/checkbox-group.js +19 -4
- package/dist/Checkbox/checkbox-round.d.ts +8 -0
- package/dist/Checkbox/checkbox-round.js +35 -0
- package/dist/Checkbox/checkbox.js +49 -34
- package/dist/Checkbox/index.d.ts +0 -2
- package/dist/Checkbox/index.js +0 -2
- package/dist/Checkbox/index.scss +48 -34
- package/dist/Checkbox/types.d.ts +11 -1
- package/dist/ConfigProvider/config-provider.d.ts +1 -0
- package/dist/Descriptions/style.scss +4 -4
- package/dist/Divider/divider.d.ts +1 -1
- package/dist/Divider/divider.js +5 -3
- package/dist/Divider/style.scss +7 -7
- package/dist/Form/ErrorList.d.ts +4 -0
- package/dist/Form/ErrorList.js +9 -0
- package/dist/Form/context.d.ts +5 -2
- package/dist/Form/context.js +2 -1
- package/dist/Form/form.d.ts +25 -12
- package/dist/Form/form.js +25 -13
- package/dist/Form/hooks/useForm.js +1 -8
- package/dist/Form/hooks/useFormContext.js +1 -2
- package/dist/Form/index.d.ts +8 -3
- package/dist/Form/index.js +7 -2
- package/dist/Form/styles.scss +11 -0
- package/dist/Form/types.d.ts +8 -0
- package/dist/FormCell/FormCell.d.ts +22 -0
- package/dist/FormCell/FormCell.js +57 -0
- package/dist/FormCell/index.d.ts +4 -0
- package/dist/FormCell/index.js +3 -0
- package/dist/FormCell/styles.scss +103 -0
- package/dist/IndexedStack/IndexedStack.d.ts +9 -0
- package/dist/IndexedStack/IndexedStack.js +27 -0
- package/dist/IndexedStack/index.d.ts +3 -0
- package/dist/IndexedStack/index.js +2 -0
- package/dist/InputNumber/input-number.d.ts +3 -2
- package/dist/InputNumber/input-number.js +48 -26
- package/dist/InputNumber/style.scss +79 -22
- package/dist/Loading/DotLoading.d.ts +7 -0
- package/dist/{Mask/mask-modal.js → Loading/DotLoading.js} +25 -25
- package/dist/{SpinLoading/spin-loading.d.ts → Loading/SpinLoading.d.ts} +0 -1
- package/dist/Loading/SpinLoading.js +69 -0
- package/dist/Loading/index.d.ts +6 -0
- package/dist/Loading/index.js +4 -0
- package/dist/Loading/style.scss +113 -0
- package/dist/NavBar/nav-bar.d.ts +1 -0
- package/dist/NavBar/nav-bar.js +3 -2
- package/dist/NavBar/style.scss +7 -3
- package/dist/Progress/Progress.d.ts +39 -0
- package/dist/Progress/Progress.js +56 -0
- package/dist/Progress/ProgressCircle.d.ts +15 -0
- package/dist/Progress/ProgressCircle.js +117 -0
- package/dist/Progress/ProgressLine.d.ts +15 -0
- package/dist/Progress/ProgressLine.js +87 -0
- package/dist/Progress/index.d.ts +3 -0
- package/dist/Progress/index.js +2 -0
- package/dist/Progress/style.scss +33 -0
- package/dist/Progress/types.d.ts +6 -0
- package/dist/Progress/types.js +2 -0
- package/dist/Radio/RadioGroup.js +3 -3
- package/dist/Radio/radio.js +1 -1
- package/dist/Radio/style.scss +40 -24
- package/dist/Radio/types.d.ts +6 -4
- package/dist/Rate/rate.js +1 -1
- package/dist/Result/use-result-icon.js +1 -1
- package/dist/SafeArea/style.scss +5 -3
- package/dist/Scaffold/style.scss +2 -1
- package/dist/Segmented/Segmented.d.ts +57 -0
- package/dist/Segmented/Segmented.js +82 -0
- package/dist/Segmented/index.d.ts +2 -0
- package/dist/Segmented/index.js +1 -0
- package/dist/Segmented/style.scss +75 -0
- package/dist/Skeleton/Skeleton.d.ts +86 -0
- package/dist/Skeleton/Skeleton.js +263 -0
- package/dist/Skeleton/index.d.ts +3 -0
- package/dist/Skeleton/index.js +2 -0
- package/dist/Skeleton/style.scss +215 -0
- package/dist/Space/space.d.ts +1 -0
- package/dist/Space/space.js +20 -6
- package/dist/Space/style.scss +27 -3
- package/dist/Stepper/index.d.ts +3 -0
- package/dist/Stepper/index.js +2 -0
- package/dist/Stepper/stepper.d.ts +14 -0
- package/dist/Stepper/stepper.js +92 -0
- package/dist/Stepper/style.scss +100 -0
- package/dist/Steps/HorizontalSteps.js +10 -3
- package/dist/Steps/VerticalSteps.js +5 -2
- package/dist/Steps/style.scss +7 -0
- package/dist/Steps/types.d.ts +2 -0
- package/dist/Switch/style.scss +6 -7
- package/dist/Switch/switch.d.ts +2 -0
- package/dist/Switch/switch.js +6 -5
- package/dist/TabBar/index.js +2 -1
- package/dist/TabBar/index.scss +3 -2
- package/dist/Tabs/style.scss +5 -5
- package/dist/Tag/style.scss +45 -21
- package/dist/Tag/tag.d.ts +4 -1
- package/dist/Tag/tag.js +8 -2
- package/dist/index.d.ts +17 -26
- package/dist/index.js +8 -13
- package/dist/style/css-variable.scss +6 -0
- package/dist/style/style.scss +2 -2
- package/dist/style/variable.scss +176 -164
- package/dist/types.d.ts +10 -1
- package/package.json +5 -8
- package/dist/ActionSheet/ActionSheet.d.ts +0 -25
- package/dist/ActionSheet/ActionSheet.js +0 -77
- package/dist/ActionSheet/index.d.ts +0 -3
- package/dist/ActionSheet/index.js +0 -2
- package/dist/ActionSheet/style.scss +0 -51
- package/dist/CascaderPicker/cascader-picker.d.ts +0 -27
- package/dist/CascaderPicker/cascader-picker.js +0 -88
- package/dist/CascaderPicker/index.d.ts +0 -3
- package/dist/CascaderPicker/index.js +0 -2
- package/dist/CascaderPicker/style.scss +0 -42
- package/dist/Form/FormItem/form-item-input.d.ts +0 -15
- package/dist/Form/FormItem/form-item-input.js +0 -39
- package/dist/Form/FormItem/form-item-label.d.ts +0 -13
- package/dist/Form/FormItem/form-item-label.js +0 -25
- package/dist/Form/FormItem/form-item.d.ts +0 -21
- package/dist/Form/FormItem/form-item.js +0 -70
- package/dist/Form/FormItem/index.d.ts +0 -5
- package/dist/Form/FormItem/index.js +0 -3
- package/dist/Form/style.scss +0 -45
- package/dist/Input/base-input.d.ts +0 -14
- package/dist/Input/base-input.js +0 -63
- package/dist/Input/index.d.ts +0 -12
- package/dist/Input/index.js +0 -9
- package/dist/Input/index.scss +0 -173
- package/dist/Input/input-affix-wrapper.d.ts +0 -8
- package/dist/Input/input-affix-wrapper.js +0 -50
- package/dist/Input/input-opt.d.ts +0 -16
- package/dist/Input/input-opt.js +0 -93
- package/dist/Input/input-password.d.ts +0 -7
- package/dist/Input/input-password.js +0 -47
- package/dist/Input/input.d.ts +0 -15
- package/dist/Input/input.js +0 -47
- package/dist/Input/textarea.d.ts +0 -13
- package/dist/Input/textarea.js +0 -45
- package/dist/Input/types.d.ts +0 -1
- package/dist/Input/types.js +0 -1
- package/dist/Mask/index.d.ts +0 -3
- package/dist/Mask/index.js +0 -2
- package/dist/Mask/mask-modal.d.ts +0 -45
- package/dist/Mask/mask.d.ts +0 -5
- package/dist/Mask/mask.js +0 -19
- package/dist/Mask/style.scss +0 -20
- package/dist/Picker/index.d.ts +0 -3
- package/dist/Picker/index.js +0 -2
- package/dist/Picker/picker.d.ts +0 -19
- package/dist/Picker/picker.js +0 -97
- package/dist/Picker/style.scss +0 -41
- package/dist/PickerView/index.d.ts +0 -4
- package/dist/PickerView/index.js +0 -2
- package/dist/PickerView/picker-view-column-item.d.ts +0 -7
- package/dist/PickerView/picker-view-column-item.js +0 -11
- package/dist/PickerView/picker-view-column.d.ts +0 -10
- package/dist/PickerView/picker-view-column.js +0 -117
- package/dist/PickerView/picker-view.d.ts +0 -12
- package/dist/PickerView/picker-view.js +0 -60
- package/dist/PickerView/style.scss +0 -72
- package/dist/PickerView/types.d.ts +0 -4
- package/dist/Popup/index.d.ts +0 -3
- package/dist/Popup/index.js +0 -2
- package/dist/Popup/popup-modal.d.ts +0 -52
- package/dist/Popup/popup-modal.js +0 -74
- package/dist/Popup/popup.d.ts +0 -4
- package/dist/Popup/popup.js +0 -56
- package/dist/Popup/style.scss +0 -53
- package/dist/ScrollView/index.d.ts +0 -4
- package/dist/ScrollView/index.js +0 -2
- package/dist/ScrollView/scroll-view.d.ts +0 -4
- package/dist/ScrollView/scroll-view.js +0 -55
- package/dist/ScrollView/style.scss +0 -19
- package/dist/ScrollView/types.d.ts +0 -26
- package/dist/ScrollView/types.js +0 -1
- package/dist/SideBar/SideBarContext.d.ts +0 -18
- package/dist/SideBar/SideBarContext.js +0 -2
- package/dist/SideBar/index.d.ts +0 -3
- package/dist/SideBar/index.js +0 -2
- package/dist/SideBar/side-bar.d.ts +0 -25
- package/dist/SideBar/side-bar.js +0 -351
- package/dist/SideBar/style.scss +0 -85
- package/dist/SideBar/types.d.ts +0 -7
- package/dist/SideBar/types.js +0 -1
- package/dist/SpinLoading/demo/base.d.ts +0 -3
- package/dist/SpinLoading/demo/base.js +0 -21
- package/dist/SpinLoading/index.d.ts +0 -3
- package/dist/SpinLoading/index.js +0 -2
- package/dist/SpinLoading/spin-loading.js +0 -59
- package/dist/SpinLoading/spin-loading.scss +0 -40
- package/dist/Tabs/demo/base.d.ts +0 -3
- package/dist/Tabs/demo/base.js +0 -59
- package/dist/Tag/demo/base.d.ts +0 -7
- package/dist/Tag/demo/base.js +0 -67
- package/dist/Tag/demo/style.scss +0 -8
- package/dist/Toast/index.d.ts +0 -5
- package/dist/Toast/index.js +0 -3
- package/dist/Toast/style.scss +0 -63
- package/dist/Toast/toast-modal.d.ts +0 -18
- package/dist/Toast/toast-modal.js +0 -112
- package/dist/Toast/toast.d.ts +0 -7
- package/dist/Toast/toast.js +0 -78
- package/dist/VerificationCodeInput/demo/base.d.ts +0 -3
- package/dist/VerificationCodeInput/demo/base.js +0 -11
- package/dist/VerificationCodeInput/index.d.ts +0 -3
- package/dist/VerificationCodeInput/index.js +0 -2
- package/dist/VerificationCodeInput/style.scss +0 -20
- package/dist/VerificationCodeInput/verification-code-input.d.ts +0 -24
- package/dist/VerificationCodeInput/verification-code-input.js +0 -99
- /package/dist/{PickerView → Form}/types.js +0 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
$prefix: triones-antm-skeleton;
|
|
2
|
+
|
|
3
|
+
@mixin skeleton-fill {
|
|
4
|
+
background: rgba(0, 0, 0, 0.06);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.#{$prefix} {
|
|
8
|
+
width: 100%;
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.#{$prefix}-element-active {
|
|
13
|
+
background: linear-gradient(
|
|
14
|
+
90deg,
|
|
15
|
+
rgba(0, 0, 0, 0.06) 25%,
|
|
16
|
+
rgba(0, 0, 0, 0.12) 50%,
|
|
17
|
+
rgba(0, 0, 0, 0.06) 75%
|
|
18
|
+
);
|
|
19
|
+
background-size: 200% 100%;
|
|
20
|
+
animation: #{$prefix}-shimmer 1.4s ease infinite;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.#{$prefix}-with-avatar {
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: flex-start;
|
|
26
|
+
gap: 12px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.#{$prefix}-header {
|
|
30
|
+
flex-shrink: 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.#{$prefix}-section {
|
|
34
|
+
flex: 1;
|
|
35
|
+
min-width: 0;
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
gap: 12px;
|
|
39
|
+
padding-top: 4px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.#{$prefix}-avatar {
|
|
43
|
+
@include skeleton-fill;
|
|
44
|
+
flex-shrink: 0;
|
|
45
|
+
|
|
46
|
+
&.#{$prefix}-element-active {
|
|
47
|
+
@include skeleton-fill;
|
|
48
|
+
background: linear-gradient(
|
|
49
|
+
90deg,
|
|
50
|
+
rgba(0, 0, 0, 0.06) 25%,
|
|
51
|
+
rgba(0, 0, 0, 0.12) 50%,
|
|
52
|
+
rgba(0, 0, 0, 0.06) 75%
|
|
53
|
+
);
|
|
54
|
+
background-size: 200% 100%;
|
|
55
|
+
animation: #{$prefix}-shimmer 1.4s ease infinite;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.#{$prefix}-avatar-circle {
|
|
60
|
+
border-radius: 50%;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.#{$prefix}-avatar-square {
|
|
64
|
+
border-radius: 8px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.#{$prefix}-title {
|
|
68
|
+
height: 16px;
|
|
69
|
+
max-width: 100%;
|
|
70
|
+
border-radius: 4px;
|
|
71
|
+
@include skeleton-fill;
|
|
72
|
+
|
|
73
|
+
&.#{$prefix}-element-active {
|
|
74
|
+
background: linear-gradient(
|
|
75
|
+
90deg,
|
|
76
|
+
rgba(0, 0, 0, 0.06) 25%,
|
|
77
|
+
rgba(0, 0, 0, 0.12) 50%,
|
|
78
|
+
rgba(0, 0, 0, 0.06) 75%
|
|
79
|
+
);
|
|
80
|
+
background-size: 200% 100%;
|
|
81
|
+
animation: #{$prefix}-shimmer 1.4s ease infinite;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.#{$prefix}-round .#{$prefix}-title,
|
|
86
|
+
.#{$prefix}-round .#{$prefix}-paragraph-line {
|
|
87
|
+
border-radius: 9999px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.#{$prefix}-paragraph {
|
|
91
|
+
display: flex;
|
|
92
|
+
flex-direction: column;
|
|
93
|
+
gap: 8px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.#{$prefix}-paragraph-line {
|
|
97
|
+
height: 14px;
|
|
98
|
+
max-width: 100%;
|
|
99
|
+
border-radius: 4px;
|
|
100
|
+
@include skeleton-fill;
|
|
101
|
+
|
|
102
|
+
&.#{$prefix}-element-active {
|
|
103
|
+
background: linear-gradient(
|
|
104
|
+
90deg,
|
|
105
|
+
rgba(0, 0, 0, 0.06) 25%,
|
|
106
|
+
rgba(0, 0, 0, 0.12) 50%,
|
|
107
|
+
rgba(0, 0, 0, 0.06) 75%
|
|
108
|
+
);
|
|
109
|
+
background-size: 200% 100%;
|
|
110
|
+
animation: #{$prefix}-shimmer 1.4s ease infinite;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.#{$prefix}-input {
|
|
115
|
+
width: 100%;
|
|
116
|
+
border-radius: 6px;
|
|
117
|
+
@include skeleton-fill;
|
|
118
|
+
|
|
119
|
+
&.#{$prefix}-element-active {
|
|
120
|
+
background: linear-gradient(
|
|
121
|
+
90deg,
|
|
122
|
+
rgba(0, 0, 0, 0.06) 25%,
|
|
123
|
+
rgba(0, 0, 0, 0.12) 50%,
|
|
124
|
+
rgba(0, 0, 0, 0.06) 75%
|
|
125
|
+
);
|
|
126
|
+
background-size: 200% 100%;
|
|
127
|
+
animation: #{$prefix}-shimmer 1.4s ease infinite;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.#{$prefix}-button {
|
|
132
|
+
display: inline-block;
|
|
133
|
+
min-width: 60px;
|
|
134
|
+
border-radius: 6px;
|
|
135
|
+
@include skeleton-fill;
|
|
136
|
+
|
|
137
|
+
&.#{$prefix}-element-active {
|
|
138
|
+
background: linear-gradient(
|
|
139
|
+
90deg,
|
|
140
|
+
rgba(0, 0, 0, 0.06) 25%,
|
|
141
|
+
rgba(0, 0, 0, 0.12) 50%,
|
|
142
|
+
rgba(0, 0, 0, 0.06) 75%
|
|
143
|
+
);
|
|
144
|
+
background-size: 200% 100%;
|
|
145
|
+
animation: #{$prefix}-shimmer 1.4s ease infinite;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.#{$prefix}-button-block {
|
|
150
|
+
display: block;
|
|
151
|
+
width: 100%;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.#{$prefix}-button-square {
|
|
155
|
+
border-radius: 4px;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.#{$prefix}-button-round {
|
|
159
|
+
border-radius: 9999px;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.#{$prefix}-button-circle {
|
|
163
|
+
min-width: unset;
|
|
164
|
+
border-radius: 50%;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.#{$prefix}-block-root {
|
|
168
|
+
display: flex;
|
|
169
|
+
flex-direction: column;
|
|
170
|
+
gap: 8px;
|
|
171
|
+
width: 100%;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.#{$prefix}-block {
|
|
175
|
+
@include skeleton-fill;
|
|
176
|
+
box-sizing: border-box;
|
|
177
|
+
|
|
178
|
+
&.#{$prefix}-element-active {
|
|
179
|
+
background: linear-gradient(
|
|
180
|
+
90deg,
|
|
181
|
+
rgba(0, 0, 0, 0.06) 25%,
|
|
182
|
+
rgba(0, 0, 0, 0.12) 50%,
|
|
183
|
+
rgba(0, 0, 0, 0.06) 75%
|
|
184
|
+
);
|
|
185
|
+
background-size: 200% 100%;
|
|
186
|
+
animation: #{$prefix}-shimmer 1.4s ease infinite;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.#{$prefix}-block-text {
|
|
191
|
+
width: 100%;
|
|
192
|
+
height: 16px;
|
|
193
|
+
border-radius: 4px;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.#{$prefix}-block-rect {
|
|
197
|
+
width: 100%;
|
|
198
|
+
height: 64px;
|
|
199
|
+
border-radius: 8px;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.#{$prefix}-block-circle {
|
|
203
|
+
width: 32px;
|
|
204
|
+
height: 32px;
|
|
205
|
+
border-radius: 50%;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
@keyframes #{$prefix}-shimmer {
|
|
209
|
+
0% {
|
|
210
|
+
background-position: 100% 0;
|
|
211
|
+
}
|
|
212
|
+
100% {
|
|
213
|
+
background-position: -100% 0;
|
|
214
|
+
}
|
|
215
|
+
}
|
package/dist/Space/space.d.ts
CHANGED
package/dist/Space/space.js
CHANGED
|
@@ -20,7 +20,8 @@ export var Space = function Space(_ref) {
|
|
|
20
20
|
onClick = _ref.onClick,
|
|
21
21
|
_ref$size = _ref.size,
|
|
22
22
|
size = _ref$size === void 0 ? 'small' : _ref$size,
|
|
23
|
-
style = _ref.style
|
|
23
|
+
style = _ref.style,
|
|
24
|
+
separator = _ref.separator;
|
|
24
25
|
var sizeValue = function sizeValue(size) {
|
|
25
26
|
if (typeof size === 'number') {
|
|
26
27
|
return "".concat(size, "Px");
|
|
@@ -53,9 +54,22 @@ export var Space = function Space(_ref) {
|
|
|
53
54
|
rowGap: rowGapValue
|
|
54
55
|
}),
|
|
55
56
|
onClick: onClick
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
57
|
+
}, function () {
|
|
58
|
+
var validChildren = React.Children.toArray(children).filter(function (child) {
|
|
59
|
+
return child !== null && child !== undefined;
|
|
60
|
+
});
|
|
61
|
+
var items = [];
|
|
62
|
+
validChildren.forEach(function (child, index) {
|
|
63
|
+
items.push( /*#__PURE__*/React.createElement("div", {
|
|
64
|
+
key: "space-item-".concat(index),
|
|
65
|
+
className: "".concat(classPrefix, "-item")
|
|
66
|
+
}, child));
|
|
67
|
+
if (separator && index < validChildren.length - 1) {
|
|
68
|
+
items.push( /*#__PURE__*/React.createElement(React.Fragment, {
|
|
69
|
+
key: "space-separator-".concat(index)
|
|
70
|
+
}, separator));
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
return items;
|
|
74
|
+
}());
|
|
61
75
|
};
|
package/dist/Space/style.scss
CHANGED
|
@@ -2,74 +2,98 @@ $class-prefix-space: 'triones-antm-space';
|
|
|
2
2
|
|
|
3
3
|
.#{$class-prefix-space}-item {
|
|
4
4
|
flex: none;
|
|
5
|
-
display: inline-flex;
|
|
5
|
+
//display: inline-flex;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-shrink: 1;
|
|
8
|
+
min-width: 0;
|
|
6
9
|
}
|
|
10
|
+
|
|
7
11
|
/* prettier-ignore */
|
|
8
12
|
.#{$class-prefix-space} {
|
|
9
13
|
display: inline-flex;
|
|
14
|
+
vertical-align: middle;
|
|
15
|
+
|
|
10
16
|
&-vertical {
|
|
11
17
|
flex-direction: column;
|
|
18
|
+
|
|
12
19
|
> .#{$class-prefix-space}-item {
|
|
13
20
|
&:last-child {
|
|
14
21
|
margin-bottom: 0;
|
|
15
22
|
}
|
|
16
23
|
}
|
|
17
24
|
}
|
|
25
|
+
|
|
18
26
|
&-horizontal {
|
|
19
27
|
flex-direction: row;
|
|
28
|
+
|
|
20
29
|
> .#{$class-prefix-space}-item {
|
|
21
30
|
&:last-child {
|
|
22
31
|
|
|
23
32
|
}
|
|
24
33
|
}
|
|
34
|
+
|
|
25
35
|
&.#{$class-prefix-space}-wrap {
|
|
26
36
|
flex-wrap: wrap;
|
|
37
|
+
|
|
27
38
|
> .#{$class-prefix-space}-item {
|
|
28
39
|
|
|
29
40
|
}
|
|
30
41
|
}
|
|
31
42
|
}
|
|
43
|
+
|
|
32
44
|
&.#{$class-prefix-space}-block {
|
|
33
45
|
display: flex;
|
|
34
46
|
width: 100%;
|
|
35
|
-
|
|
36
|
-
|
|
47
|
+
|
|
48
|
+
.#{$class-prefix-space}-item {
|
|
49
|
+
//display: flex;
|
|
37
50
|
}
|
|
38
51
|
|
|
39
52
|
}
|
|
53
|
+
|
|
40
54
|
&-align {
|
|
41
55
|
&-center {
|
|
42
56
|
align-items: center;
|
|
43
57
|
}
|
|
58
|
+
|
|
44
59
|
&-start {
|
|
45
60
|
align-items: flex-start;
|
|
46
61
|
}
|
|
62
|
+
|
|
47
63
|
&-end {
|
|
48
64
|
align-items: flex-end;
|
|
49
65
|
}
|
|
66
|
+
|
|
50
67
|
&-baseline {
|
|
51
68
|
align-items: baseline;
|
|
52
69
|
}
|
|
53
70
|
}
|
|
71
|
+
|
|
54
72
|
&-justify {
|
|
55
73
|
&-center {
|
|
56
74
|
justify-content: center;
|
|
57
75
|
}
|
|
76
|
+
|
|
58
77
|
&-start {
|
|
59
78
|
justify-content: flex-start;
|
|
60
79
|
}
|
|
80
|
+
|
|
61
81
|
&-end {
|
|
62
82
|
justify-content: flex-end;
|
|
63
83
|
}
|
|
84
|
+
|
|
64
85
|
&-between {
|
|
65
86
|
justify-content: space-between;
|
|
66
87
|
}
|
|
88
|
+
|
|
67
89
|
&-around {
|
|
68
90
|
justify-content: space-around;
|
|
69
91
|
}
|
|
92
|
+
|
|
70
93
|
&-evenly {
|
|
71
94
|
justify-content: space-evenly;
|
|
72
95
|
}
|
|
96
|
+
|
|
73
97
|
&-stretch {
|
|
74
98
|
justify-content: stretch;
|
|
75
99
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { FC } from "react";
|
|
2
|
+
import "./style.scss";
|
|
3
|
+
export type StepperProps = {
|
|
4
|
+
value?: number;
|
|
5
|
+
onChange?: (value: number) => void;
|
|
6
|
+
step?: number;
|
|
7
|
+
min?: number;
|
|
8
|
+
max?: number;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
block?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
style?: React.CSSProperties;
|
|
13
|
+
};
|
|
14
|
+
export declare const Stepper: FC<StepperProps>;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
4
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
5
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
+
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."); }
|
|
7
|
+
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); }
|
|
8
|
+
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; }
|
|
9
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
10
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
+
import React, { useEffect, useState } from "react";
|
|
12
|
+
import classNames from "classnames";
|
|
13
|
+
import { AddOutline, MinusOutline } from "@trionesdev/antd-mobile-icons-react";
|
|
14
|
+
import "./style.scss";
|
|
15
|
+
function clampValue(n, min, max) {
|
|
16
|
+
var v = n;
|
|
17
|
+
if (min !== undefined) v = Math.max(min, v);
|
|
18
|
+
if (max !== undefined) v = Math.min(max, v);
|
|
19
|
+
return v;
|
|
20
|
+
}
|
|
21
|
+
export var Stepper = function Stepper(_ref) {
|
|
22
|
+
var value = _ref.value,
|
|
23
|
+
onChange = _ref.onChange,
|
|
24
|
+
step = _ref.step,
|
|
25
|
+
min = _ref.min,
|
|
26
|
+
max = _ref.max,
|
|
27
|
+
_ref$disabled = _ref.disabled,
|
|
28
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
29
|
+
_ref$block = _ref.block,
|
|
30
|
+
block = _ref$block === void 0 ? false : _ref$block,
|
|
31
|
+
className = _ref.className,
|
|
32
|
+
style = _ref.style;
|
|
33
|
+
var _useState = useState(value !== null && value !== void 0 ? value : 0),
|
|
34
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
35
|
+
internalValue = _useState2[0],
|
|
36
|
+
setInternalValue = _useState2[1];
|
|
37
|
+
var stepSize = step !== null && step !== void 0 ? step : 1;
|
|
38
|
+
useEffect(function () {
|
|
39
|
+
if (value !== undefined) {
|
|
40
|
+
setInternalValue(clampValue(value, min, max));
|
|
41
|
+
}
|
|
42
|
+
}, [value, min, max]);
|
|
43
|
+
var minMatch = min !== undefined && internalValue <= min;
|
|
44
|
+
var maxMatch = max !== undefined && internalValue >= max;
|
|
45
|
+
var trionesStepperCls = 'triones-antm-stepper';
|
|
46
|
+
var setValue = function setValue(next) {
|
|
47
|
+
var clamped = clampValue(next, min, max);
|
|
48
|
+
setInternalValue(clamped);
|
|
49
|
+
onChange === null || onChange === void 0 || onChange(clamped);
|
|
50
|
+
};
|
|
51
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
52
|
+
className: classNames(trionesStepperCls, _defineProperty({}, "".concat(trionesStepperCls, "--block"), block), className),
|
|
53
|
+
style: style
|
|
54
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
55
|
+
className: classNames("".concat(trionesStepperCls, "-button"), _defineProperty({}, "".concat(trionesStepperCls, "-button-disabled"), minMatch || disabled)),
|
|
56
|
+
role: "button",
|
|
57
|
+
tabIndex: disabled || minMatch ? -1 : 0,
|
|
58
|
+
onClick: function onClick() {
|
|
59
|
+
if (minMatch || disabled) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
setValue(internalValue - stepSize);
|
|
63
|
+
}
|
|
64
|
+
}, /*#__PURE__*/React.createElement(MinusOutline, null)), /*#__PURE__*/React.createElement("div", {
|
|
65
|
+
className: "".concat(trionesStepperCls, "-input-wrapper")
|
|
66
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
67
|
+
className: "".concat(trionesStepperCls, "-input"),
|
|
68
|
+
type: "number",
|
|
69
|
+
disabled: disabled,
|
|
70
|
+
min: min,
|
|
71
|
+
max: max,
|
|
72
|
+
step: stepSize,
|
|
73
|
+
value: internalValue,
|
|
74
|
+
onChange: function onChange(e) {
|
|
75
|
+
var num = Number(e.target.value);
|
|
76
|
+
if (!Number.isFinite(num)) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
setValue(num);
|
|
80
|
+
}
|
|
81
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
82
|
+
className: classNames("".concat(trionesStepperCls, "-button"), _defineProperty({}, "".concat(trionesStepperCls, "-button-disabled"), maxMatch || disabled)),
|
|
83
|
+
role: "button",
|
|
84
|
+
tabIndex: disabled || maxMatch ? -1 : 0,
|
|
85
|
+
onClick: function onClick() {
|
|
86
|
+
if (maxMatch || disabled) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
setValue(internalValue + stepSize);
|
|
90
|
+
}
|
|
91
|
+
}, /*#__PURE__*/React.createElement(AddOutline, null)));
|
|
92
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
@use "../style/variable" as variable;
|
|
2
|
+
|
|
3
|
+
$trionesStepperCls: 'triones-antm-stepper';
|
|
4
|
+
|
|
5
|
+
$inputNumberBg: #F5F5F5;
|
|
6
|
+
$inputSm: 24Px;
|
|
7
|
+
$inputLg: 40Px;
|
|
8
|
+
$stepperControlHeight: 28Px;
|
|
9
|
+
|
|
10
|
+
.#{$trionesStepperCls} {
|
|
11
|
+
display: inline-flex;
|
|
12
|
+
align-items: stretch;
|
|
13
|
+
gap: 2Px;
|
|
14
|
+
border-radius: variable.$trionesBorderRadiusXs;
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
width: 110Px;
|
|
17
|
+
|
|
18
|
+
&--block {
|
|
19
|
+
display: flex;
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
width: 100%;
|
|
22
|
+
max-width: 100%;
|
|
23
|
+
min-width: 0;
|
|
24
|
+
flex: 1 1 auto;
|
|
25
|
+
|
|
26
|
+
.#{$trionesStepperCls}-input {
|
|
27
|
+
flex: 1 1 auto;
|
|
28
|
+
min-width: 0;
|
|
29
|
+
|
|
30
|
+
input {
|
|
31
|
+
width: 100%;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&-input-wrapper {
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: stretch;
|
|
39
|
+
//flex: 0 1 auto;
|
|
40
|
+
min-width: 36Px;
|
|
41
|
+
min-height: $stepperControlHeight;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&-input {
|
|
45
|
+
width: 100%;
|
|
46
|
+
min-width: 0;
|
|
47
|
+
height: 100%;
|
|
48
|
+
min-height: $stepperControlHeight;
|
|
49
|
+
box-sizing: border-box;
|
|
50
|
+
margin: 0;
|
|
51
|
+
padding: 0 8Px;
|
|
52
|
+
border: 0;
|
|
53
|
+
border-radius: variable.$trionesBorderRadiusXs;
|
|
54
|
+
background-color: $inputNumberBg;
|
|
55
|
+
color: variable.$trionesColorText;
|
|
56
|
+
font-size: 14Px;
|
|
57
|
+
line-height: $stepperControlHeight;
|
|
58
|
+
text-align: center;
|
|
59
|
+
appearance: textfield;
|
|
60
|
+
|
|
61
|
+
&::-webkit-outer-spin-button,
|
|
62
|
+
&::-webkit-inner-spin-button {
|
|
63
|
+
-webkit-appearance: none;
|
|
64
|
+
margin: 0;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&:focus {
|
|
68
|
+
outline: none;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&:disabled {
|
|
72
|
+
color: variable.$trionesColorTextDisabled;
|
|
73
|
+
cursor: not-allowed;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&-button {
|
|
78
|
+
cursor: pointer;
|
|
79
|
+
display: flex;
|
|
80
|
+
flex-shrink: 0;
|
|
81
|
+
font-size: 10Px;
|
|
82
|
+
height: $stepperControlHeight;
|
|
83
|
+
width: $stepperControlHeight;
|
|
84
|
+
justify-content: center;
|
|
85
|
+
align-items: center;
|
|
86
|
+
background-color: $inputNumberBg;
|
|
87
|
+
border-radius: variable.$trionesBorderRadiusXs;
|
|
88
|
+
color: variable.$trionesColorPrimary;
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
&-disabled {
|
|
92
|
+
cursor: not-allowed;
|
|
93
|
+
color: variable.$trionesColorTextDisabled;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.triones-antm-icon {
|
|
97
|
+
font-size: 12Px !important;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -64,15 +64,22 @@ var HorizontalStepItem = function HorizontalStepItem(_ref) {
|
|
|
64
64
|
}
|
|
65
65
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
66
66
|
className: classNames("".concat(clsPrefixStep, "-content"))
|
|
67
|
-
}, title && /*#__PURE__*/React.createElement("div",
|
|
67
|
+
}, title && /*#__PURE__*/React.createElement("div", {
|
|
68
|
+
className: classNames("".concat(clsPrefixStep, "-content-title"))
|
|
69
|
+
}, title), description && /*#__PURE__*/React.createElement("div", {
|
|
70
|
+
className: classNames("".concat(clsPrefixStep, "-content-desc"))
|
|
71
|
+
}, description)));
|
|
68
72
|
};
|
|
69
73
|
export var HorizontalSteps = function HorizontalSteps(_ref2) {
|
|
70
|
-
var
|
|
74
|
+
var className = _ref2.className,
|
|
75
|
+
style = _ref2.style,
|
|
76
|
+
_ref2$stretch = _ref2.stretch,
|
|
71
77
|
stretch = _ref2$stretch === void 0 ? true : _ref2$stretch,
|
|
72
78
|
_ref2$items = _ref2.items,
|
|
73
79
|
items = _ref2$items === void 0 ? [] : _ref2$items;
|
|
74
80
|
return /*#__PURE__*/React.createElement("div", {
|
|
75
|
-
className: classNames(clsPrefixSteps, "".concat(clsPrefixSteps, "-horizontal"))
|
|
81
|
+
className: classNames(clsPrefixSteps, "".concat(clsPrefixSteps, "-horizontal"), className),
|
|
82
|
+
style: style
|
|
76
83
|
}, items.map(function (item, index) {
|
|
77
84
|
return /*#__PURE__*/React.createElement(HorizontalStepItem, {
|
|
78
85
|
icon: item.icon,
|
|
@@ -75,11 +75,14 @@ var VerticalStepIem = function VerticalStepIem(_ref) {
|
|
|
75
75
|
}, title && /*#__PURE__*/React.createElement("div", null, title), description && /*#__PURE__*/React.createElement("div", null, description)));
|
|
76
76
|
};
|
|
77
77
|
export var VerticalSteps = function VerticalSteps(_ref2) {
|
|
78
|
-
var
|
|
78
|
+
var className = _ref2.className,
|
|
79
|
+
style = _ref2.style,
|
|
80
|
+
current = _ref2.current,
|
|
79
81
|
_ref2$items = _ref2.items,
|
|
80
82
|
items = _ref2$items === void 0 ? [] : _ref2$items;
|
|
81
83
|
return /*#__PURE__*/React.createElement("div", {
|
|
82
|
-
className: classNames(clsPrefixSteps, "".concat(clsPrefixSteps, "-vertical"))
|
|
84
|
+
className: classNames(clsPrefixSteps, "".concat(clsPrefixSteps, "-vertical"), className),
|
|
85
|
+
style: style
|
|
83
86
|
}, items.map(function (item, index) {
|
|
84
87
|
return /*#__PURE__*/React.createElement(VerticalStepIem, {
|
|
85
88
|
key: index,
|
package/dist/Steps/style.scss
CHANGED
|
@@ -8,6 +8,9 @@ $clsPrefixStep: 'triones-antm-step';
|
|
|
8
8
|
|
|
9
9
|
.#{$clsPrefixStep} {
|
|
10
10
|
//flex: 1 auto;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
gap: 4Px;
|
|
11
14
|
&-indicator {
|
|
12
15
|
display: flex;
|
|
13
16
|
flex-direction: row;
|
|
@@ -46,6 +49,10 @@ $clsPrefixStep: 'triones-antm-step';
|
|
|
46
49
|
|
|
47
50
|
&-content {
|
|
48
51
|
text-align: center;
|
|
52
|
+
&-title{
|
|
53
|
+
|
|
54
|
+
}
|
|
55
|
+
&-desc{}
|
|
49
56
|
}
|
|
50
57
|
|
|
51
58
|
&:first-child {
|