@trionesdev/antd-mobile-react 0.0.2-beta.0 → 0.0.2-beta.2

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 (60) hide show
  1. package/LICENSE +21 -21
  2. package/dist/Avatar/demo/base.js +2 -2
  3. package/dist/Avatar/demo/style.scss +6 -6
  4. package/dist/Badge/demo/base.js +2 -2
  5. package/dist/Badge/demo/base.scss +6 -6
  6. package/dist/Button/demo/base.js +2 -2
  7. package/dist/Button/style.scss +232 -231
  8. package/dist/Calendar/calendar-grid.js +2 -2
  9. package/dist/Calendar/calendar-range.js +2 -2
  10. package/dist/Calendar/style.scss +85 -85
  11. package/dist/Calendar/touchable-calendar-grid.js +9 -9
  12. package/dist/CalendarDatetimePicker/style.scss +54 -54
  13. package/dist/CalendarPicker/style.scss +31 -31
  14. package/dist/Card/demo/base.js +2 -2
  15. package/dist/Card/demo/base.scss +18 -18
  16. package/dist/Checkbox/demo/base.js +2 -2
  17. package/dist/ConfigProvider/demo/base.js +2 -2
  18. package/dist/DemoBlock/index.scss +20 -20
  19. package/dist/DemoDescription/index.scss +3 -3
  20. package/dist/Divider/demo/base.js +2 -2
  21. package/dist/Ellipsis/demo/base.js +2 -2
  22. package/dist/Empty/demo/base.js +2 -2
  23. package/dist/ErrorBlock/demo/base.js +2 -2
  24. package/dist/Footer/demo/base.js +2 -2
  25. package/dist/Grid/demo/base.js +2 -2
  26. package/dist/Grid/demo/base.scss +7 -7
  27. package/dist/Icon/demo/base.js +4 -4
  28. package/dist/Image/demo/base.js +2 -2
  29. package/dist/Image/demo/base.scss +4 -4
  30. package/dist/Image/style.scss +30 -30
  31. package/dist/ImagesPreview/style.scss +34 -34
  32. package/dist/ImagesWall/ImagesWall.js +1 -1
  33. package/dist/ImagesWall/style.scss +70 -70
  34. package/dist/Input/demo/base.js +2 -2
  35. package/dist/NavBar/demo/base.scss +5 -5
  36. package/dist/NoticeBar/demo/base.js +2 -2
  37. package/dist/PageIndicator/demo/base.js +2 -2
  38. package/dist/Popup/demo/base.js +2 -2
  39. package/dist/Progress/style.scss +33 -33
  40. package/dist/Radio/demo/base.scss +4 -4
  41. package/dist/Result/demo/base.js +2 -2
  42. package/dist/SafeArea/demo/base.scss +18 -18
  43. package/dist/SideBar/side-bar.js +6 -6
  44. package/dist/SideBar/style.scss +85 -85
  45. package/dist/Space/demo/base.js +2 -2
  46. package/dist/Swiper/style.scss +54 -54
  47. package/dist/Switch/demo/base.js +2 -2
  48. package/dist/TabBar/demo/base.js +2 -2
  49. package/dist/Tag/demo/base.js +2 -2
  50. package/dist/Tag/demo/style.scss +8 -8
  51. package/dist/Toast/style.scss +63 -63
  52. package/dist/WaterMark/demo/demo1.js +2 -2
  53. package/dist/WaterMark/demo/demo1.scss +6 -6
  54. package/dist/WaterMark/demo/demo2.js +2 -2
  55. package/dist/style/variable.scss +1 -0
  56. package/dist/utils/type.js +36 -36
  57. package/dist/utils/use-isomorphic-update-layout-effect.d.ts +1 -1
  58. package/dist/utils/with-default-props.js +4 -4
  59. package/package.json +8 -8
  60. package/readme.md +43 -43
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) fengxiaotx@163.com
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) fengxiaotx@163.com
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,5 +1,5 @@
1
- /**
2
- * compact: true
1
+ /**
2
+ * compact: true
3
3
  */
4
4
  import React from 'react';
5
5
  import { DemoBlock } from "../../DemoBlock";
@@ -1,6 +1,6 @@
1
- .avatar-content {
2
- display: flex;
3
- align-items: center;
4
- flex-wrap: wrap;
5
- gap: 16px;
6
- }
1
+ .avatar-content {
2
+ display: flex;
3
+ align-items: center;
4
+ flex-wrap: wrap;
5
+ gap: 16px;
6
+ }
@@ -1,5 +1,5 @@
1
- /**
2
- * compact: true
1
+ /**
2
+ * compact: true
3
3
  */
4
4
 
5
5
  import React from 'react';
@@ -1,6 +1,6 @@
1
- .badge-demo {
2
- display: flex;
3
- align-items: center;
4
- flex-wrap: wrap;
5
- gap: 20Px;
6
- }
1
+ .badge-demo {
2
+ display: flex;
3
+ align-items: center;
4
+ flex-wrap: wrap;
5
+ gap: 20Px;
6
+ }
@@ -1,5 +1,5 @@
1
- /**
2
- * compact: true
1
+ /**
2
+ * compact: true
3
3
  */
4
4
  import { DemoBlock } from "../../DemoBlock";
5
5
  import React from 'react';
@@ -1,231 +1,232 @@
1
- @import "@trionesdev/antd-mobile-base-react/dist/style/variable";
2
-
3
- $trionesButtonPendingInlineSm: 7Px;
4
- $trionesButtonHeightSm: 24Px;
5
-
6
- $trionesButtonPendingInline: 15Px;
7
- $trionesButtonHeight: 32Px;
8
-
9
- $trionesButtonContentFontSizeLg: $trionesFontSizeLg;
10
- $trionesButtonPendingInlineLg: 15Px;
11
- $trionesButtonHeightLg: 40Px;
12
-
13
- button::after {
14
- content: none;
15
- width: 100%;
16
- }
17
-
18
- $buttonCls: 'triones-antm-button';
19
- .#{$buttonCls} {
20
- width: auto;
21
- position: relative;
22
- display: inline-flex;
23
- flex-direction: column;
24
- justify-self: center;
25
- align-items: center;
26
- justify-content: center;
27
- height: auto;
28
- line-height: normal;
29
- border-radius: 4Px;
30
- border: 1Px none;
31
- box-sizing: border-box;
32
- font-size: 14Px;
33
- z-index: 2;
34
- margin-top: 0;
35
-
36
- &:active {
37
- filter: brightness(92%);
38
- }
39
- &::after{
40
- content: none;
41
- }
42
-
43
- &[disabled] {
44
- opacity: 0.4;
45
-
46
- &:active {
47
- filter: none;
48
- }
49
- }
50
- &:not([disabled]):active{}
51
-
52
- &-color {
53
- &-default {
54
- background-color: #ffffff;
55
-
56
- &.#{$buttonCls} {
57
- &-variant {
58
- &-solid {
59
- color: #ffffff;
60
- background-color: rgba(0, 0, 0, 0.75);
61
- box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.75);
62
- }
63
-
64
- &-outlined {
65
- color: rgba(0, 0, 0, 0.75);
66
- border: 1px solid rgba(0, 0, 0, 0.75);
67
- background-color: white;
68
- }
69
-
70
- &-dashed {
71
- color: rgba(0, 0, 0, 0.75);
72
- border: 1px dashed rgba(0, 0, 0, 0.75);
73
- background-color: #ffffff;
74
- }
75
-
76
- &-filled {
77
- color: rgba(0, 0, 0, 0.75);
78
- background-color: rgba(0, 0, 0, 0.06);
79
- }
80
-
81
- &-text {
82
- color: rgba(0, 0, 0, 0.75);
83
- background-color: #ffffff;
84
- }
85
-
86
- &-link {
87
- color: rgba(0, 0, 0, 0.75);
88
- background-color: #ffffff;
89
-
90
- &:active {
91
- filter: none;
92
- }
93
- }
94
- }
95
- }
96
- }
97
-
98
- &-primary {
99
- &.#{$buttonCls} {
100
- &-variant {
101
- &-solid {
102
- color: #ffffff;
103
- background-color: $trionesColorPrimaryText;
104
- box-shadow: inset 0 0 0 1px $trionesColorPrimaryText;
105
- }
106
-
107
- &-outlined {
108
- color: #1677ff;
109
- background-color: white;
110
- border: 1px solid $trionesColorPrimaryText;
111
- }
112
-
113
- &-dashed {
114
- color: $trionesColorPrimaryText;
115
- border: 1px dashed $trionesColorPrimaryText;
116
- background-color: #ffffff;
117
- }
118
-
119
- &-filled {
120
- color: $trionesColorPrimaryText;
121
- background-color: $trionesColorPrimaryBg;
122
- }
123
-
124
- &-text {
125
- color: $trionesColorPrimaryText;
126
- background-color: #ffffff;
127
- }
128
-
129
- &-link {
130
- color: $trionesColorPrimaryText;
131
- background-color: #ffffff;
132
-
133
- &:active {
134
- filter: none;
135
- }
136
- }
137
- }
138
- }
139
- }
140
-
141
- &-danger {
142
- &.#{$buttonCls} {
143
- &-variant {
144
- &-solid {
145
- color: #ffffff;
146
- background-color: $trionesColorErrorText;
147
- box-shadow: inset 0 0 0 1px $trionesColorErrorText;
148
- }
149
-
150
- &-outlined {
151
- color: $trionesColorErrorText;
152
- background-color: #ffffff;
153
- border: 1px solid $trionesColorErrorText;
154
- }
155
-
156
- &-dashed {
157
- color: $trionesColorErrorText;
158
- border: 1px dashed $trionesColorErrorText;
159
- background-color: #ffffff;
160
- }
161
-
162
- &-filled {
163
- color: $trionesColorErrorText;
164
- background-color: #ffdfdc;
165
- }
166
-
167
- &-text {
168
- color: $trionesColorErrorText;
169
- background-color: #ffffff;
170
- }
171
-
172
- &-link {
173
- color: $trionesColorErrorText;
174
- background-color: #ffffff;
175
-
176
- &:active {
177
- filter: none;
178
- }
179
- }
180
- }
181
- }
182
- }
183
- }
184
-
185
- &-variant {
186
- &-solid {
187
- }
188
-
189
- &-outlined {
190
- background-color: #ffffff;
191
- }
192
-
193
- &-dashed {
194
- border: 1px dashed #d9d9d9;
195
- background-color: #ffffff;
196
- }
197
-
198
- &-text {
199
- background-color: #ffffff;
200
- }
201
-
202
- &-link {
203
- background-color: #ffffff;
204
- }
205
- }
206
-
207
- &-block {
208
- display: flex;
209
- width: 100%;
210
- }
211
-
212
- &-small {
213
- font-size: $trionesFontSizeSm;
214
- padding-inline: $trionesButtonPendingInlineSm;
215
- height: $trionesButtonHeightSm;
216
- border-radius: $trionesBorderRadiusSm;
217
- }
218
-
219
- &-middle {
220
- padding-inline: $trionesButtonPendingInline;
221
- height: $trionesButtonHeight;
222
- border-radius: $trionesBorderRadius;
223
- }
224
-
225
- &-large {
226
- font-size: $trionesButtonContentFontSizeLg;
227
- padding-inline: $trionesButtonPendingInlineLg;
228
- height: $trionesButtonHeightLg;
229
- border-radius: $trionesBorderRadiusLg;
230
- }
231
- }
1
+ @use "../style/variable" as *;
2
+
3
+ $trionesButtonPendingInlineSm: 7Px;
4
+ $trionesButtonHeightSm: 24Px;
5
+
6
+ $trionesButtonPendingInline: 15Px;
7
+ $trionesButtonHeight: 32Px;
8
+
9
+ $trionesButtonContentFontSizeLg: $trionesFontSizeLg;
10
+ $trionesButtonPendingInlineLg: 15Px;
11
+ $trionesButtonHeightLg: 40Px;
12
+
13
+ // 定义常用颜色变量以提高可维护性
14
+ $buttonBackgroundColor: #ffffff;
15
+ $buttonDarkTextColor: rgba(0, 0, 0, 0.75);
16
+ $buttonLightTextColor: rgba(0, 0, 0, 0.06);
17
+
18
+ button::after {
19
+ content: none;
20
+ width: 100%;
21
+ }
22
+
23
+ $buttonCls: 'triones-antm-button';
24
+ .#{$buttonCls} {
25
+ width: auto;
26
+ position: relative;
27
+ display: inline-flex;
28
+ flex-direction: column;
29
+ justify-self: center;
30
+ align-items: center;
31
+ justify-content: center;
32
+ height: auto;
33
+ line-height: normal;
34
+ border-radius: 4Px;
35
+ border: 1Px none;
36
+ box-sizing: border-box;
37
+ font-size: 14Px;
38
+ z-index: 2;
39
+ margin-top: 0;
40
+
41
+ &:active {
42
+ filter: brightness(92%);
43
+ }
44
+ &::after{
45
+ content: none;
46
+ }
47
+
48
+ &[disabled] {
49
+ opacity: 0.4;
50
+
51
+ &:active {
52
+ filter: none;
53
+ }
54
+ }
55
+
56
+ &-color {
57
+ &-default {
58
+ background-color: $buttonBackgroundColor;
59
+
60
+ &.#{$buttonCls} {
61
+ &-variant {
62
+ &-solid {
63
+ color: $buttonBackgroundColor;
64
+ background-color: $buttonDarkTextColor;
65
+ box-shadow: inset 0 0 0 1px $buttonDarkTextColor;
66
+ }
67
+
68
+ &-outlined {
69
+ color: $buttonDarkTextColor;
70
+ border: 1px solid $buttonDarkTextColor;
71
+ background-color: $buttonBackgroundColor;
72
+ }
73
+
74
+ &-dashed {
75
+ color: $buttonDarkTextColor;
76
+ border: 1px dashed $buttonDarkTextColor;
77
+ background-color: $buttonBackgroundColor;
78
+ }
79
+
80
+ &-filled {
81
+ color: $buttonDarkTextColor;
82
+ background-color: $buttonLightTextColor;
83
+ }
84
+
85
+ &-text {
86
+ color: $buttonDarkTextColor;
87
+ background-color: $buttonBackgroundColor;
88
+ }
89
+
90
+ &-link {
91
+ color: $buttonDarkTextColor;
92
+ background-color: $buttonBackgroundColor;
93
+
94
+ &:active {
95
+ filter: none;
96
+ }
97
+ }
98
+ }
99
+ }
100
+ }
101
+
102
+ &-primary {
103
+ &.#{$buttonCls} {
104
+ &-variant {
105
+ &-solid {
106
+ color: $buttonBackgroundColor;
107
+ background-color: $trionesColorPrimaryText;
108
+ box-shadow: inset 0 0 0 1px $trionesColorPrimaryText;
109
+ }
110
+
111
+ &-outlined {
112
+ color: #1677ff;
113
+ background-color: $buttonBackgroundColor;
114
+ border: 1px solid $trionesColorPrimaryText;
115
+ }
116
+
117
+ &-dashed {
118
+ color: $trionesColorPrimaryText;
119
+ border: 1px dashed $trionesColorPrimaryText;
120
+ background-color: $buttonBackgroundColor;
121
+ }
122
+
123
+ &-filled {
124
+ color: $trionesColorPrimaryText;
125
+ background-color: $trionesColorPrimaryBg;
126
+ }
127
+
128
+ &-text {
129
+ color: $trionesColorPrimaryText;
130
+ background-color: $buttonBackgroundColor;
131
+ }
132
+
133
+ &-link {
134
+ color: $trionesColorPrimaryText;
135
+ background-color: $buttonBackgroundColor;
136
+
137
+ &:active {
138
+ filter: none;
139
+ }
140
+ }
141
+ }
142
+ }
143
+ }
144
+
145
+ &-danger {
146
+ &.#{$buttonCls} {
147
+ &-variant {
148
+ &-solid {
149
+ color: $buttonBackgroundColor;
150
+ background-color: $trionesColorErrorText;
151
+ box-shadow: inset 0 0 0 1px $trionesColorErrorText;
152
+ }
153
+
154
+ &-outlined {
155
+ color: $trionesColorErrorText;
156
+ background-color: $buttonBackgroundColor;
157
+ border: 1px solid $trionesColorErrorText;
158
+ }
159
+
160
+ &-dashed {
161
+ color: $trionesColorErrorText;
162
+ border: 1px dashed $trionesColorErrorText;
163
+ background-color: $buttonBackgroundColor;
164
+ }
165
+
166
+ &-filled {
167
+ color: $trionesColorErrorText;
168
+ background-color: #ffdfdc;
169
+ }
170
+
171
+ &-text {
172
+ color: $trionesColorErrorText;
173
+ background-color: $buttonBackgroundColor;
174
+ }
175
+
176
+ &-link {
177
+ color: $trionesColorErrorText;
178
+ background-color: $buttonBackgroundColor;
179
+
180
+ &:active {
181
+ filter: none;
182
+ }
183
+ }
184
+ }
185
+ }
186
+ }
187
+ }
188
+
189
+ &-variant {
190
+ &-outlined {
191
+ background-color: $buttonBackgroundColor;
192
+ }
193
+
194
+ &-dashed {
195
+ border: 1px dashed #d9d9d9;
196
+ background-color: $buttonBackgroundColor;
197
+ }
198
+
199
+ &-text {
200
+ background-color: $buttonBackgroundColor;
201
+ }
202
+
203
+ &-link {
204
+ background-color: $buttonBackgroundColor;
205
+ }
206
+ }
207
+
208
+ &-block {
209
+ display: flex;
210
+ width: 100%;
211
+ }
212
+
213
+ &-small {
214
+ font-size: $trionesFontSizeSm;
215
+ padding-inline: $trionesButtonPendingInlineSm;
216
+ height: $trionesButtonHeightSm;
217
+ border-radius: $trionesBorderRadiusSm;
218
+ }
219
+
220
+ &-middle {
221
+ padding-inline: $trionesButtonPendingInline;
222
+ height: $trionesButtonHeight;
223
+ border-radius: $trionesBorderRadius;
224
+ }
225
+
226
+ &-large {
227
+ font-size: $trionesButtonContentFontSizeLg;
228
+ padding-inline: $trionesButtonPendingInlineLg;
229
+ height: $trionesButtonHeightLg;
230
+ border-radius: $trionesBorderRadiusLg;
231
+ }
232
+ }
@@ -13,7 +13,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
13
13
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
14
14
  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); }
15
15
  import classNames from 'classnames';
16
- import _ from 'lodash';
16
+ import { isEmpty } from 'lodash-es';
17
17
  import React, { forwardRef, memo, useEffect, useMemo, useState } from 'react';
18
18
  import "./style.scss";
19
19
  var calendarCls = 'triones-antm-calendar';
@@ -29,7 +29,7 @@ var CalendarCell = /*#__PURE__*/memo(function (_ref) {
29
29
  return date.getMonth() !== mouth.getMonth();
30
30
  }, [date, mouth]);
31
31
  var selected = useMemo(function () {
32
- if (disabled || _.isEmpty(value)) {
32
+ if (disabled || isEmpty(value)) {
33
33
  return false;
34
34
  }
35
35
  if (value !== null && value !== void 0 && value[0]) {
@@ -5,7 +5,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5
5
  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; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import classNames from 'classnames';
8
- import _ from 'lodash';
8
+ import { isEqual } from 'lodash-es';
9
9
  import React, { memo, useEffect, useRef, useState } from 'react';
10
10
  import { CalendarGrid } from "./calendar-grid";
11
11
  import { CalendarHeader } from "./calendar-header";
@@ -26,7 +26,7 @@ export var CalendarRange = /*#__PURE__*/memo(function (_ref) {
26
26
  var valueRef = useRef();
27
27
  useEffect(function () {
28
28
  if (value !== undefined) {
29
- if (!_.isEqual(value, valueRef.current)) {
29
+ if (!isEqual(value, valueRef.current)) {
30
30
  valueRef.current = value;
31
31
  }
32
32
  }