antd-mobile 5.10.1 → 5.10.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 (46) hide show
  1. package/2x/cjs/components/image-uploader/image-uploader.js +2 -1
  2. package/2x/cjs/components/mask/mask.css +1 -0
  3. package/2x/cjs/components/mask/mask.js +8 -1
  4. package/2x/cjs/components/safe-area/safe-area.css +2 -2
  5. package/2x/cjs/global/global.css +1 -0
  6. package/2x/cjs/global/theme.css +1 -0
  7. package/2x/cjs/locales/ko-KR.d.ts +102 -0
  8. package/2x/cjs/locales/ko-KR.js +115 -0
  9. package/2x/cjs/locales/zh-HK.js +56 -0
  10. package/2x/cjs/locales/zh-TW.js +56 -0
  11. package/2x/es/components/image-uploader/image-uploader.js +2 -1
  12. package/2x/es/components/mask/mask.css +1 -0
  13. package/2x/es/components/mask/mask.js +8 -1
  14. package/2x/es/components/safe-area/safe-area.css +2 -2
  15. package/2x/es/global/global.css +1 -0
  16. package/2x/es/global/theme.css +1 -0
  17. package/2x/es/locales/ko-KR.d.ts +102 -0
  18. package/2x/es/locales/ko-KR.js +105 -0
  19. package/2x/es/locales/zh-HK.js +56 -0
  20. package/2x/es/locales/zh-TW.js +56 -0
  21. package/2x/package.json +1 -1
  22. package/bundle/antd-mobile.cjs.js +8 -2
  23. package/bundle/antd-mobile.es.js +8 -2
  24. package/bundle/style.css +4 -2
  25. package/cjs/components/image-uploader/image-uploader.js +2 -1
  26. package/cjs/components/mask/mask.css +1 -0
  27. package/cjs/components/mask/mask.js +8 -1
  28. package/cjs/components/safe-area/safe-area.css +2 -2
  29. package/cjs/global/global.css +1 -0
  30. package/cjs/global/theme.css +1 -0
  31. package/cjs/locales/ko-KR.d.ts +102 -0
  32. package/cjs/locales/ko-KR.js +115 -0
  33. package/cjs/locales/zh-HK.js +56 -0
  34. package/cjs/locales/zh-TW.js +56 -0
  35. package/es/components/image-uploader/image-uploader.js +2 -1
  36. package/es/components/mask/mask.css +1 -0
  37. package/es/components/mask/mask.js +8 -1
  38. package/es/components/safe-area/safe-area.css +2 -2
  39. package/es/global/global.css +1 -0
  40. package/es/global/theme.css +1 -0
  41. package/es/locales/ko-KR.d.ts +102 -0
  42. package/es/locales/ko-KR.js +105 -0
  43. package/es/locales/zh-HK.js +56 -0
  44. package/es/locales/zh-TW.js +56 -0
  45. package/package.json +1 -1
  46. package/umd/antd-mobile.js +1 -1
@@ -114,6 +114,8 @@ const ImageUploader = p => {
114
114
  file
115
115
  }));
116
116
  setTasks(prev => [...prev, ...newTasks]);
117
+ e.target.value = ''; // HACK: fix the same file doesn't trigger onChange
118
+
117
119
  yield Promise.all(newTasks.map(currentTask => (0, _tslib.__awaiter)(this, void 0, void 0, function* () {
118
120
  try {
119
121
  const result = yield props.upload(currentTask.file);
@@ -147,7 +149,6 @@ const ImageUploader = p => {
147
149
  throw e;
148
150
  }
149
151
  }))).catch(error => console.error(error));
150
- e.target.value = ''; // HACK: fix the same file doesn't trigger onChange
151
152
  });
152
153
  }
153
154
 
@@ -16,6 +16,7 @@
16
16
  z-index: 0;
17
17
  width: 100%;
18
18
  height: 100%;
19
+ pointer-events: none;
19
20
  }
20
21
 
21
22
  .adm-mask-content {
@@ -98,7 +98,14 @@ const Mask = p => {
98
98
  opacity
99
99
  }, props.style), {
100
100
  display: active ? 'unset' : 'none'
101
- })
101
+ }),
102
+ onClick: e => {
103
+ var _a;
104
+
105
+ if (e.target === e.currentTarget) {
106
+ (_a = props.onMaskClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
107
+ }
108
+ }
102
109
  }, props.onMaskClick && _react.default.createElement("div", {
103
110
  className: `${classPrefix}-aria-button`,
104
111
  role: 'button',
@@ -4,9 +4,9 @@
4
4
  }
5
5
 
6
6
  .adm-safe-area-position-top {
7
- padding-top: env(safe-area-inset-top);
7
+ padding-top: calc(env(safe-area-inset-top) * var(--adm-hd));
8
8
  }
9
9
 
10
10
  .adm-safe-area-position-bottom {
11
- padding-bottom: env(safe-area-inset-bottom);
11
+ padding-bottom: calc(env(safe-area-inset-bottom) * var(--adm-hd));
12
12
  }
@@ -9,6 +9,7 @@
9
9
  --adm-border-color: #eeeeee;
10
10
  --adm-font-size-main: 26px;
11
11
  --adm-color-text: #333333;
12
+ --adm-hd: 2;
12
13
  --adm-font-family: -apple-system, blinkmacsystemfont, 'Helvetica Neue',
13
14
  helvetica, segoe ui, arial, roboto, 'PingFang SC', 'miui',
14
15
  'Hiragino Sans GB', 'Microsoft Yahei', sans-serif;
@@ -9,6 +9,7 @@
9
9
  --adm-border-color: #eeeeee;
10
10
  --adm-font-size-main: 26px;
11
11
  --adm-color-text: #333333;
12
+ --adm-hd: 2;
12
13
  --adm-font-family: -apple-system, blinkmacsystemfont, 'Helvetica Neue',
13
14
  helvetica, segoe ui, arial, roboto, 'PingFang SC', 'miui',
14
15
  'Hiragino Sans GB', 'Microsoft Yahei', sans-serif;
@@ -0,0 +1,102 @@
1
+ declare const koKR: {
2
+ locale: string;
3
+ common: {
4
+ confirm: string;
5
+ cancel: string;
6
+ loading: string;
7
+ };
8
+ Calendar: {
9
+ markItems: string[];
10
+ renderYearAndMonth: (year: number, month: number) => string;
11
+ };
12
+ Cascader: {
13
+ placeholder: string;
14
+ };
15
+ Dialog: {
16
+ ok: string;
17
+ };
18
+ ErrorBlock: {
19
+ default: {
20
+ title: string;
21
+ description: string;
22
+ };
23
+ busy: {
24
+ title: string;
25
+ description: string;
26
+ };
27
+ disconnected: {
28
+ title: string;
29
+ description: string;
30
+ };
31
+ empty: {
32
+ title: string;
33
+ description: string;
34
+ };
35
+ };
36
+ Form: {
37
+ required: string;
38
+ optional: string;
39
+ defaultValidateMessages: {
40
+ default: string;
41
+ required: string;
42
+ enum: string;
43
+ whitespace: string;
44
+ date: {
45
+ format: string;
46
+ parse: string;
47
+ invalid: string;
48
+ };
49
+ types: {
50
+ string: string;
51
+ method: string;
52
+ array: string;
53
+ object: string;
54
+ number: string;
55
+ date: string;
56
+ boolean: string;
57
+ integer: string;
58
+ float: string;
59
+ regexp: string;
60
+ email: string;
61
+ url: string;
62
+ hex: string;
63
+ };
64
+ string: {
65
+ len: string;
66
+ min: string;
67
+ max: string;
68
+ range: string;
69
+ };
70
+ number: {
71
+ len: string;
72
+ min: string;
73
+ max: string;
74
+ range: string;
75
+ };
76
+ array: {
77
+ len: string;
78
+ min: string;
79
+ max: string;
80
+ range: string;
81
+ };
82
+ pattern: {
83
+ mismatch: string;
84
+ };
85
+ };
86
+ };
87
+ ImageUploader: {
88
+ uploading: string;
89
+ };
90
+ Mask: {
91
+ name: string;
92
+ };
93
+ Modal: {
94
+ ok: string;
95
+ };
96
+ PullToRefresh: {
97
+ pulling: string;
98
+ canRelease: string;
99
+ complete: string;
100
+ };
101
+ };
102
+ export default koKR;
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _mergeLocale = require("../utils/merge-locale");
9
+
10
+ var _base = require("./base");
11
+
12
+ const typeTemplate = '${label} 유효하지 않은 ${type} 입니다';
13
+ const koKR = (0, _mergeLocale.mergeLocale)(_base.base, {
14
+ locale: 'ko-KR',
15
+ common: {
16
+ confirm: '확인',
17
+ cancel: '취소',
18
+ loading: '로딩중...'
19
+ },
20
+ Calendar: {
21
+ markItems: ['월', '화', '수', '목', '금', '토', '일'],
22
+ renderYearAndMonth: (year, month) => `${year}년${month}일`
23
+ },
24
+ Cascader: {
25
+ placeholder: '선택됨'
26
+ },
27
+ Dialog: {
28
+ ok: '확인'
29
+ },
30
+ ErrorBlock: {
31
+ default: {
32
+ title: '문제가 발생했습니다',
33
+ description: '잠시 후 다시 시도해주세요'
34
+ },
35
+ busy: {
36
+ title: '로딩 되지 않았습니다.',
37
+ description: '페이지를 새로고침 해주세요'
38
+ },
39
+ disconnected: {
40
+ title: '네트워크를 사용 중 입니다',
41
+ description: '페이지를 새로고침 해주세요'
42
+ },
43
+ empty: {
44
+ title: '정보를 찾을 수 없습니다',
45
+ description: '정확한 검색어인가요?'
46
+ }
47
+ },
48
+ Form: {
49
+ required: '필수',
50
+ optional: '선택',
51
+ defaultValidateMessages: {
52
+ default: '필드 유효성 검사 오류 ${label}',
53
+ required: '${label} 입력해 주세요',
54
+ enum: '${label} [${enum}] 중에 하나여야 합니다',
55
+ whitespace: '${label} 비워둘 수 없습니다',
56
+ date: {
57
+ format: '${label} 유효하지 않은 날짜 형식입니다',
58
+ parse: '${label} 날짜 형식으로 변환될 수 없습니다',
59
+ invalid: '${label} 유효하지 않은 날짜입니다'
60
+ },
61
+ types: {
62
+ string: typeTemplate,
63
+ method: typeTemplate,
64
+ array: typeTemplate,
65
+ object: typeTemplate,
66
+ number: typeTemplate,
67
+ date: typeTemplate,
68
+ boolean: typeTemplate,
69
+ integer: typeTemplate,
70
+ float: typeTemplate,
71
+ regexp: typeTemplate,
72
+ email: typeTemplate,
73
+ url: typeTemplate,
74
+ hex: typeTemplate
75
+ },
76
+ string: {
77
+ len: '${label} ${len}글자여야 합니다',
78
+ min: '${label} 적어도 ${min}글자 이상이어야 합니다',
79
+ max: '${label} ${max}글자 이하여야 합니다',
80
+ range: '${label} ${min}-${max}글자 사이어야 합니다'
81
+ },
82
+ number: {
83
+ len: '${label} 값은 ${len}이어야 합니다',
84
+ min: '${label} 최솟값은 ${min}입니다',
85
+ max: '${label} 최댓값은 ${max}입니다',
86
+ range: '${label} 값은 ${min}-${max} 사이어야 합니다'
87
+ },
88
+ array: {
89
+ len: '${len}이어야 합니다 ${label}',
90
+ min: '최소 ${min}이어야 합니다 ${label}',
91
+ max: '최대 ${max}이어야 합니다 ${label}',
92
+ range: '${label} ${min}-${max} 사이어야 합니다'
93
+ },
94
+ pattern: {
95
+ mismatch: '${label} ${pattern} 패턴과 일치하지 않습니다'
96
+ }
97
+ }
98
+ },
99
+ ImageUploader: {
100
+ uploading: '업로드 중...'
101
+ },
102
+ Mask: {
103
+ name: '마스크'
104
+ },
105
+ Modal: {
106
+ ok: '확인'
107
+ },
108
+ PullToRefresh: {
109
+ pulling: '스크롤을 당겨서 새로고침하십시오',
110
+ canRelease: '새로고침 하려면 놓으십시오',
111
+ complete: '새로고침 완료'
112
+ }
113
+ });
114
+ var _default = koKR;
115
+ exports.default = _default;
@@ -9,6 +9,7 @@ var _mergeLocale = require("../utils/merge-locale");
9
9
 
10
10
  var _base = require("./base");
11
11
 
12
+ const typeTemplate = '${label}不是一個有效的${type}';
12
13
  const zhHK = (0, _mergeLocale.mergeLocale)(_base.base, {
13
14
  locale: 'zh-HK',
14
15
  common: {
@@ -16,6 +17,10 @@ const zhHK = (0, _mergeLocale.mergeLocale)(_base.base, {
16
17
  cancel: '取消',
17
18
  loading: '加載中……'
18
19
  },
20
+ Calendar: {
21
+ markItems: ['一', '二', '三', '四', '五', '六', '日'],
22
+ renderYearAndMonth: (year, month) => `${year}年${month}月`
23
+ },
19
24
  Cascader: {
20
25
  placeholder: '請選擇'
21
26
  },
@@ -40,6 +45,57 @@ const zhHK = (0, _mergeLocale.mergeLocale)(_base.base, {
40
45
  description: '找找其他的吧'
41
46
  }
42
47
  },
48
+ Form: {
49
+ required: '必填',
50
+ optional: '選填',
51
+ defaultValidateMessages: {
52
+ default: '字段驗證錯誤${label}',
53
+ required: '請輸入${label}',
54
+ enum: '${label}必須是其中一個[${enum}]',
55
+ whitespace: '${label}不能為空字符',
56
+ date: {
57
+ format: '${label}日期格式無效',
58
+ parse: '${label}不能轉換為日期',
59
+ invalid: '${label}是一個無效日期'
60
+ },
61
+ types: {
62
+ string: typeTemplate,
63
+ method: typeTemplate,
64
+ array: typeTemplate,
65
+ object: typeTemplate,
66
+ number: typeTemplate,
67
+ date: typeTemplate,
68
+ boolean: typeTemplate,
69
+ integer: typeTemplate,
70
+ float: typeTemplate,
71
+ regexp: typeTemplate,
72
+ email: typeTemplate,
73
+ url: typeTemplate,
74
+ hex: typeTemplate
75
+ },
76
+ string: {
77
+ len: '${label}須為${len}個字符',
78
+ min: '${label}最少${min}個字符',
79
+ max: '${label}最多${max}個字符',
80
+ range: '${label}須在${min}-${max}字符之間'
81
+ },
82
+ number: {
83
+ len: '${label}必須等於${len}',
84
+ min: '${label}最小值為${min}',
85
+ max: '${label}最大值為${max}',
86
+ range: '${label}須在${min}-${max}之間'
87
+ },
88
+ array: {
89
+ len: '須為${len}個${label}',
90
+ min: '最少${min}個${label}',
91
+ max: '最多${max}個${label}',
92
+ range: '${label}数量須在${min}-${max}之間'
93
+ },
94
+ pattern: {
95
+ mismatch: '${label}與模式不匹配${pattern}'
96
+ }
97
+ }
98
+ },
43
99
  ImageUploader: {
44
100
  uploading: '上傳中...'
45
101
  },
@@ -9,6 +9,7 @@ var _mergeLocale = require("../utils/merge-locale");
9
9
 
10
10
  var _base = require("./base");
11
11
 
12
+ const typeTemplate = '${label}不是一個有效的${type}';
12
13
  const zhTW = (0, _mergeLocale.mergeLocale)(_base.base, {
13
14
  locale: 'zh-TW',
14
15
  common: {
@@ -16,6 +17,10 @@ const zhTW = (0, _mergeLocale.mergeLocale)(_base.base, {
16
17
  cancel: '取消',
17
18
  loading: '加載中……'
18
19
  },
20
+ Calendar: {
21
+ markItems: ['一', '二', '三', '四', '五', '六', '日'],
22
+ renderYearAndMonth: (year, month) => `${year}年${month}月`
23
+ },
19
24
  Cascader: {
20
25
  placeholder: '請選擇'
21
26
  },
@@ -40,6 +45,57 @@ const zhTW = (0, _mergeLocale.mergeLocale)(_base.base, {
40
45
  description: '找找其他的吧'
41
46
  }
42
47
  },
48
+ Form: {
49
+ required: '必填',
50
+ optional: '選填',
51
+ defaultValidateMessages: {
52
+ default: '字段驗證錯誤${label}',
53
+ required: '請輸入${label}',
54
+ enum: '${label}必須是其中一個[${enum}]',
55
+ whitespace: '${label}不能為空字符',
56
+ date: {
57
+ format: '${label}日期格式無效',
58
+ parse: '${label}不能轉換為日期',
59
+ invalid: '${label}是一個無效日期'
60
+ },
61
+ types: {
62
+ string: typeTemplate,
63
+ method: typeTemplate,
64
+ array: typeTemplate,
65
+ object: typeTemplate,
66
+ number: typeTemplate,
67
+ date: typeTemplate,
68
+ boolean: typeTemplate,
69
+ integer: typeTemplate,
70
+ float: typeTemplate,
71
+ regexp: typeTemplate,
72
+ email: typeTemplate,
73
+ url: typeTemplate,
74
+ hex: typeTemplate
75
+ },
76
+ string: {
77
+ len: '${label}須為${len}個字符',
78
+ min: '${label}最少${min}個字符',
79
+ max: '${label}最多${max}個字符',
80
+ range: '${label}須在${min}-${max}字符之間'
81
+ },
82
+ number: {
83
+ len: '${label}必須等於${len}',
84
+ min: '${label}最小值為${min}',
85
+ max: '${label}最大值為${max}',
86
+ range: '${label}須在${min}-${max}之間'
87
+ },
88
+ array: {
89
+ len: '須為${len}個${label}',
90
+ min: '最少${min}個${label}',
91
+ max: '最多${max}個${label}',
92
+ range: '${label}数量須在${min}-${max}之間'
93
+ },
94
+ pattern: {
95
+ mismatch: '${label}與模式不匹配${pattern}'
96
+ }
97
+ }
98
+ },
43
99
  ImageUploader: {
44
100
  uploading: '上傳中...'
45
101
  },
@@ -90,6 +90,8 @@ export const ImageUploader = p => {
90
90
  file
91
91
  }));
92
92
  setTasks(prev => [...prev, ...newTasks]);
93
+ e.target.value = ''; // HACK: fix the same file doesn't trigger onChange
94
+
93
95
  yield Promise.all(newTasks.map(currentTask => __awaiter(this, void 0, void 0, function* () {
94
96
  try {
95
97
  const result = yield props.upload(currentTask.file);
@@ -123,7 +125,6 @@ export const ImageUploader = p => {
123
125
  throw e;
124
126
  }
125
127
  }))).catch(error => console.error(error));
126
- e.target.value = ''; // HACK: fix the same file doesn't trigger onChange
127
128
  });
128
129
  }
129
130
 
@@ -16,6 +16,7 @@
16
16
  z-index: 0;
17
17
  width: 100%;
18
18
  height: 100%;
19
+ pointer-events: none;
19
20
  }
20
21
 
21
22
  .adm-mask-content {
@@ -76,7 +76,14 @@ export const Mask = p => {
76
76
  opacity
77
77
  }, props.style), {
78
78
  display: active ? 'unset' : 'none'
79
- })
79
+ }),
80
+ onClick: e => {
81
+ var _a;
82
+
83
+ if (e.target === e.currentTarget) {
84
+ (_a = props.onMaskClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
85
+ }
86
+ }
80
87
  }, props.onMaskClick && React.createElement("div", {
81
88
  className: `${classPrefix}-aria-button`,
82
89
  role: 'button',
@@ -4,9 +4,9 @@
4
4
  }
5
5
 
6
6
  .adm-safe-area-position-top {
7
- padding-top: env(safe-area-inset-top);
7
+ padding-top: calc(env(safe-area-inset-top) * var(--adm-hd));
8
8
  }
9
9
 
10
10
  .adm-safe-area-position-bottom {
11
- padding-bottom: env(safe-area-inset-bottom);
11
+ padding-bottom: calc(env(safe-area-inset-bottom) * var(--adm-hd));
12
12
  }
@@ -9,6 +9,7 @@
9
9
  --adm-border-color: #eeeeee;
10
10
  --adm-font-size-main: 26px;
11
11
  --adm-color-text: #333333;
12
+ --adm-hd: 2;
12
13
  --adm-font-family: -apple-system, blinkmacsystemfont, 'Helvetica Neue',
13
14
  helvetica, segoe ui, arial, roboto, 'PingFang SC', 'miui',
14
15
  'Hiragino Sans GB', 'Microsoft Yahei', sans-serif;
@@ -9,6 +9,7 @@
9
9
  --adm-border-color: #eeeeee;
10
10
  --adm-font-size-main: 26px;
11
11
  --adm-color-text: #333333;
12
+ --adm-hd: 2;
12
13
  --adm-font-family: -apple-system, blinkmacsystemfont, 'Helvetica Neue',
13
14
  helvetica, segoe ui, arial, roboto, 'PingFang SC', 'miui',
14
15
  'Hiragino Sans GB', 'Microsoft Yahei', sans-serif;
@@ -0,0 +1,102 @@
1
+ declare const koKR: {
2
+ locale: string;
3
+ common: {
4
+ confirm: string;
5
+ cancel: string;
6
+ loading: string;
7
+ };
8
+ Calendar: {
9
+ markItems: string[];
10
+ renderYearAndMonth: (year: number, month: number) => string;
11
+ };
12
+ Cascader: {
13
+ placeholder: string;
14
+ };
15
+ Dialog: {
16
+ ok: string;
17
+ };
18
+ ErrorBlock: {
19
+ default: {
20
+ title: string;
21
+ description: string;
22
+ };
23
+ busy: {
24
+ title: string;
25
+ description: string;
26
+ };
27
+ disconnected: {
28
+ title: string;
29
+ description: string;
30
+ };
31
+ empty: {
32
+ title: string;
33
+ description: string;
34
+ };
35
+ };
36
+ Form: {
37
+ required: string;
38
+ optional: string;
39
+ defaultValidateMessages: {
40
+ default: string;
41
+ required: string;
42
+ enum: string;
43
+ whitespace: string;
44
+ date: {
45
+ format: string;
46
+ parse: string;
47
+ invalid: string;
48
+ };
49
+ types: {
50
+ string: string;
51
+ method: string;
52
+ array: string;
53
+ object: string;
54
+ number: string;
55
+ date: string;
56
+ boolean: string;
57
+ integer: string;
58
+ float: string;
59
+ regexp: string;
60
+ email: string;
61
+ url: string;
62
+ hex: string;
63
+ };
64
+ string: {
65
+ len: string;
66
+ min: string;
67
+ max: string;
68
+ range: string;
69
+ };
70
+ number: {
71
+ len: string;
72
+ min: string;
73
+ max: string;
74
+ range: string;
75
+ };
76
+ array: {
77
+ len: string;
78
+ min: string;
79
+ max: string;
80
+ range: string;
81
+ };
82
+ pattern: {
83
+ mismatch: string;
84
+ };
85
+ };
86
+ };
87
+ ImageUploader: {
88
+ uploading: string;
89
+ };
90
+ Mask: {
91
+ name: string;
92
+ };
93
+ Modal: {
94
+ ok: string;
95
+ };
96
+ PullToRefresh: {
97
+ pulling: string;
98
+ canRelease: string;
99
+ complete: string;
100
+ };
101
+ };
102
+ export default koKR;