antd-mobile 5.36.0 → 5.36.1

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 (64) hide show
  1. package/2x/bundle/antd-mobile.cjs.development.js +38 -12
  2. package/2x/bundle/antd-mobile.cjs.js +7 -7
  3. package/2x/bundle/antd-mobile.es.development.js +38 -12
  4. package/2x/bundle/antd-mobile.es.js +1432 -1412
  5. package/2x/bundle/antd-mobile.umd.development.js +38 -12
  6. package/2x/bundle/antd-mobile.umd.js +7 -7
  7. package/2x/cjs/components/collapse/collapse.d.ts +1 -1
  8. package/2x/cjs/components/collapse/collapse.js +28 -11
  9. package/2x/cjs/locales/ar-SA.js +2 -2
  10. package/2x/cjs/locales/de-DE.js +3 -3
  11. package/2x/cjs/locales/es-ES.js +2 -2
  12. package/2x/cjs/locales/fr-FR.js +1 -1
  13. package/2x/cjs/locales/in-ID.d.ts +139 -0
  14. package/2x/cjs/locales/in-ID.js +149 -0
  15. package/2x/cjs/locales/ja-JP.js +2 -2
  16. package/2x/cjs/locales/th-TH.js +2 -2
  17. package/2x/cjs/utils/use-mutation-effect.d.ts +1 -0
  18. package/2x/cjs/utils/use-mutation-effect.js +20 -9
  19. package/2x/es/components/collapse/collapse.d.ts +1 -1
  20. package/2x/es/components/collapse/collapse.js +27 -10
  21. package/2x/es/locales/ar-SA.js +2 -2
  22. package/2x/es/locales/de-DE.js +3 -3
  23. package/2x/es/locales/es-ES.js +2 -2
  24. package/2x/es/locales/fr-FR.js +1 -1
  25. package/2x/es/locales/in-ID.d.ts +139 -0
  26. package/2x/es/locales/in-ID.js +142 -0
  27. package/2x/es/locales/ja-JP.js +2 -2
  28. package/2x/es/locales/th-TH.js +2 -2
  29. package/2x/es/utils/use-mutation-effect.d.ts +1 -0
  30. package/2x/es/utils/use-mutation-effect.js +19 -9
  31. package/2x/package.json +3 -2
  32. package/bundle/antd-mobile.cjs.development.js +38 -12
  33. package/bundle/antd-mobile.cjs.js +7 -7
  34. package/bundle/antd-mobile.compatible.umd.js +1 -1
  35. package/bundle/antd-mobile.es.development.js +38 -12
  36. package/bundle/antd-mobile.es.js +1432 -1412
  37. package/bundle/antd-mobile.umd.development.js +38 -12
  38. package/bundle/antd-mobile.umd.js +7 -7
  39. package/cjs/components/collapse/collapse.d.ts +1 -1
  40. package/cjs/components/collapse/collapse.js +28 -11
  41. package/cjs/locales/ar-SA.js +2 -2
  42. package/cjs/locales/de-DE.js +3 -3
  43. package/cjs/locales/es-ES.js +2 -2
  44. package/cjs/locales/fr-FR.js +1 -1
  45. package/cjs/locales/in-ID.d.ts +139 -0
  46. package/cjs/locales/in-ID.js +149 -0
  47. package/cjs/locales/ja-JP.js +2 -2
  48. package/cjs/locales/th-TH.js +2 -2
  49. package/cjs/utils/use-mutation-effect.d.ts +1 -0
  50. package/cjs/utils/use-mutation-effect.js +20 -9
  51. package/es/components/collapse/collapse.d.ts +1 -1
  52. package/es/components/collapse/collapse.js +27 -10
  53. package/es/locales/ar-SA.js +2 -2
  54. package/es/locales/de-DE.js +3 -3
  55. package/es/locales/es-ES.js +2 -2
  56. package/es/locales/fr-FR.js +1 -1
  57. package/es/locales/in-ID.d.ts +139 -0
  58. package/es/locales/in-ID.js +142 -0
  59. package/es/locales/ja-JP.js +2 -2
  60. package/es/locales/th-TH.js +2 -2
  61. package/es/utils/use-mutation-effect.d.ts +1 -0
  62. package/es/utils/use-mutation-effect.js +19 -9
  63. package/package.json +3 -2
  64. package/umd/antd-mobile.js +1 -1
@@ -0,0 +1,139 @@
1
+ declare const inID: {
2
+ locale: string;
3
+ common: {
4
+ confirm: string;
5
+ cancel: string;
6
+ loading: string;
7
+ close: string;
8
+ };
9
+ Calendar: {
10
+ title: string;
11
+ confirm: string;
12
+ start: string;
13
+ end: string;
14
+ today: string;
15
+ markItems: string[];
16
+ yearAndMonth: string;
17
+ };
18
+ Cascader: {
19
+ placeholder: string;
20
+ };
21
+ Dialog: {
22
+ ok: string;
23
+ };
24
+ DatePicker: {
25
+ tillNow: string;
26
+ };
27
+ ErrorBlock: {
28
+ default: {
29
+ title: string;
30
+ description: string;
31
+ };
32
+ busy: {
33
+ title: string;
34
+ description: string;
35
+ };
36
+ disconnected: {
37
+ title: string;
38
+ description: string;
39
+ };
40
+ empty: {
41
+ title: string;
42
+ description: string;
43
+ };
44
+ };
45
+ Form: {
46
+ required: string;
47
+ optional: string;
48
+ defaultValidateMessages: {
49
+ default: string;
50
+ required: string;
51
+ enum: string;
52
+ whitespace: string;
53
+ date: {
54
+ format: string;
55
+ parse: string;
56
+ invalid: string;
57
+ };
58
+ types: {
59
+ string: string;
60
+ method: string;
61
+ array: string;
62
+ object: string;
63
+ number: string;
64
+ date: string;
65
+ boolean: string;
66
+ integer: string;
67
+ float: string;
68
+ regexp: string;
69
+ email: string;
70
+ url: string;
71
+ hex: string;
72
+ };
73
+ string: {
74
+ len: string;
75
+ min: string;
76
+ max: string;
77
+ range: string;
78
+ };
79
+ number: {
80
+ len: string;
81
+ min: string;
82
+ max: string;
83
+ range: string;
84
+ };
85
+ array: {
86
+ len: string;
87
+ min: string;
88
+ max: string;
89
+ range: string;
90
+ };
91
+ pattern: {
92
+ mismatch: string;
93
+ };
94
+ };
95
+ };
96
+ ImageUploader: {
97
+ uploading: string;
98
+ upload: string;
99
+ };
100
+ InfiniteScroll: {
101
+ noMore: string;
102
+ failedToLoad: string;
103
+ retry: string;
104
+ };
105
+ Input: {
106
+ clear: string;
107
+ };
108
+ Mask: {
109
+ name: string;
110
+ };
111
+ Modal: {
112
+ ok: string;
113
+ };
114
+ PasscodeInput: {
115
+ name: string;
116
+ };
117
+ PullToRefresh: {
118
+ pulling: string;
119
+ canRelease: string;
120
+ complete: string;
121
+ };
122
+ SearchBar: {
123
+ name: string;
124
+ };
125
+ Slider: {
126
+ name: string;
127
+ };
128
+ Stepper: {
129
+ decrease: string;
130
+ increase: string;
131
+ };
132
+ Switch: {
133
+ name: string;
134
+ };
135
+ Selector: {
136
+ name: string;
137
+ };
138
+ };
139
+ export default inID;
@@ -0,0 +1,142 @@
1
+ import { mergeLocale } from '../utils/merge-locale';
2
+ import { base } from './base';
3
+ const typeTemplate = '${label} bukan ${type} yang valid';
4
+ const inID = mergeLocale(base, {
5
+ locale: 'in-ID',
6
+ common: {
7
+ confirm: 'Yakin',
8
+ cancel: 'Batal ',
9
+ loading: 'memuat',
10
+ close: 'Tutup'
11
+ },
12
+ Calendar: {
13
+ title: 'Pilih Tanggal',
14
+ confirm: 'OK',
15
+ start: 'Mulai',
16
+ end: 'Selesai',
17
+ today: 'Hari Ini',
18
+ markItems: ['Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu', 'Minggu'],
19
+ yearAndMonth: '${year} Tahun ${month} Bulan'
20
+ },
21
+ Cascader: {
22
+ placeholder: 'Silahkan Pilih'
23
+ },
24
+ Dialog: {
25
+ ok: 'Saya mendapatkannya'
26
+ },
27
+ DatePicker: {
28
+ tillNow: 'Sampai sekarang'
29
+ },
30
+ ErrorBlock: {
31
+ default: {
32
+ title: 'Halaman mengalami beberapa permasalahan kecil',
33
+ description: 'Coba lagi nanti'
34
+ },
35
+ busy: {
36
+ title: 'kepadatan diawal',
37
+ description: 'Coba untuk menyegarkan'
38
+ },
39
+ disconnected: {
40
+ title: 'jaringan sedikit sibuk',
41
+ description: 'Gerakkan jari Anda untuk membantu memperbaiki'
42
+ },
43
+ empty: {
44
+ title: 'Itu tidak menemukan apa yang Anda butuhkan',
45
+ description: 'Silahkan cari yang lain'
46
+ }
47
+ },
48
+ Form: {
49
+ required: 'Diperlukan',
50
+ optional: 'opsional untuk diisi',
51
+ defaultValidateMessages: {
52
+ default: 'Kesalahan validasi bidang ${label}',
53
+ required: 'Harap masukkan ${label}',
54
+ enum: '${label} harus salah satu dari [${enum}]',
55
+ whitespace: '${label} tidak boleh berupa karakter kosong',
56
+ date: {
57
+ format: 'Format tanggal ${label} tidak valid',
58
+ parse: '${label} tidak dapat dikonversi ke tanggal',
59
+ invalid: '${label} adalah tanggal yang tidak valid'
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} harus berupa ${len} karakter',
78
+ min: '${label} Minimal ${min} karakter',
79
+ max: '${label}Maksimum ${max} karakter',
80
+ range: '${label} harus antara ${min}-${max} karakter'
81
+ },
82
+ number: {
83
+ len: '${label} harus sama dengan ${len}',
84
+ min: 'Nilai minimum ${label} adalah ${min}',
85
+ max: '${label} memiliki nilai maksimum ${max}',
86
+ range: '${label} harus antara ${min}-${max}'
87
+ },
88
+ array: {
89
+ len: 'Harus ${len} ${label}',
90
+ min: 'Minimal ${min} ${label}',
91
+ max: 'Hingga ${max} ${label}',
92
+ range: 'Jumlah ${label} harus antara ${min}-${max}'
93
+ },
94
+ pattern: {
95
+ mismatch: '${label} tidak cocok dengan pola ${pattern}'
96
+ }
97
+ }
98
+ },
99
+ ImageUploader: {
100
+ uploading: 'mengunggah...',
101
+ upload: 'diunggah'
102
+ },
103
+ InfiniteScroll: {
104
+ noMore: 'tidak ada lagi',
105
+ failedToLoad: 'Gagal memuat',
106
+ retry: 'memuat ulang'
107
+ },
108
+ Input: {
109
+ clear: 'Hapus'
110
+ },
111
+ Mask: {
112
+ name: 'lapisan pelindung'
113
+ },
114
+ Modal: {
115
+ ok: 'Saya mendapatkannya'
116
+ },
117
+ PasscodeInput: {
118
+ name: 'Kotak kata sandi'
119
+ },
120
+ PullToRefresh: {
121
+ pulling: 'Tarik ke bawah untuk menyegarkan',
122
+ canRelease: 'Lepaskan untuk menyegarkan segera',
123
+ complete: 'Segarkan berhasil'
124
+ },
125
+ SearchBar: {
126
+ name: 'Bilah Pencarian'
127
+ },
128
+ Slider: {
129
+ name: 'Penggeser'
130
+ },
131
+ Stepper: {
132
+ decrease: 'mengurangi',
133
+ increase: 'meningkat'
134
+ },
135
+ Switch: {
136
+ name: 'Mengalihkan'
137
+ },
138
+ Selector: {
139
+ name: 'Grup pilih'
140
+ }
141
+ });
142
+ export default inID;
@@ -16,7 +16,7 @@ const jaJP = mergeLocale(base, {
16
16
  placeholder: '選択下さい'
17
17
  },
18
18
  Dialog: {
19
- ok: 'わかりました'
19
+ ok: '了解'
20
20
  },
21
21
  ErrorBlock: {
22
22
  default: {
@@ -103,7 +103,7 @@ const jaJP = mergeLocale(base, {
103
103
  name: 'マスク'
104
104
  },
105
105
  Modal: {
106
- ok: 'わかりました'
106
+ ok: '了解'
107
107
  },
108
108
  PasscodeInput: {
109
109
  name: 'パスコード入力'
@@ -22,7 +22,7 @@ const thTH = mergeLocale(base, {
22
22
  placeholder: 'เลือก'
23
23
  },
24
24
  Dialog: {
25
- ok: 'โอเค'
25
+ ok: 'ฉันรู้แล้ว'
26
26
  },
27
27
  DatePicker: {
28
28
  tillNow: 'จนถึงตอนนี้'
@@ -112,7 +112,7 @@ const thTH = mergeLocale(base, {
112
112
  name: 'มาสก์'
113
113
  },
114
114
  Modal: {
115
- ok: 'ตกลง'
115
+ ok: 'ฉันรู้แล้ว'
116
116
  },
117
117
  PasscodeInput: {
118
118
  name: 'ป้อนรหัสผ่าน'
@@ -1,2 +1,3 @@
1
1
  import { RefObject } from 'react';
2
+ export declare function observe(element: HTMLElement | null, options: MutationObserverInit, callback: VoidFunction): () => void;
2
3
  export declare function useMutationEffect(effect: () => void, targetRef: RefObject<HTMLElement>, options: MutationObserverInit): void;
@@ -1,15 +1,25 @@
1
- import { useEffect } from 'react';
2
1
  import { useMemoizedFn } from 'ahooks';
3
- export function useMutationEffect(effect, targetRef, options) {
4
- const fn = useMemoizedFn(effect);
5
- useEffect(() => {
6
- const observer = new MutationObserver(() => {
7
- fn();
2
+ import { useEffect } from 'react';
3
+ export function observe(element, options, callback) {
4
+ if (element && typeof MutationObserver !== 'undefined') {
5
+ let observer = new MutationObserver(() => {
6
+ callback();
8
7
  });
9
- if (!targetRef.current) return;
10
- observer.observe(targetRef.current, options);
8
+ observer.observe(element, options);
9
+ // Return cleanup function
11
10
  return () => {
12
- observer.disconnect();
11
+ if (observer) {
12
+ observer.disconnect();
13
+ observer = null;
14
+ }
13
15
  };
16
+ }
17
+ return () => {};
18
+ }
19
+ export function useMutationEffect(effect, targetRef, options) {
20
+ const fn = useMemoizedFn(effect);
21
+ useEffect(() => {
22
+ const cleanup = observe(targetRef.current, options, fn);
23
+ return cleanup;
14
24
  }, [targetRef]);
15
25
  }
package/2x/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antd-mobile",
3
- "version": "5.36.0",
3
+ "version": "5.36.1",
4
4
  "homepage": "https://github.com/ant-design/ant-design-mobile#readme",
5
5
  "bugs": {
6
6
  "url": "https://github.com/ant-design/ant-design-mobile/issues"
@@ -52,7 +52,8 @@
52
52
  "use-sync-external-store": "^1.2.0"
53
53
  },
54
54
  "peerDependencies": {
55
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
55
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
56
+ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
56
57
  },
57
58
  "GravityCDN": "./umd/antd-mobile.js",
58
59
  "size-limit": [
@@ -9727,18 +9727,27 @@ function useResizeEffect(effect, targetRef) {
9727
9727
  }
9728
9728
  }, [targetRef]);
9729
9729
  }
9730
- function useMutationEffect(effect, targetRef, options) {
9731
- const fn = useMemoizedFn(effect);
9732
- React$1.useEffect(() => {
9733
- const observer = new MutationObserver(() => {
9734
- fn();
9730
+ function observe(element, options, callback) {
9731
+ if (element && typeof MutationObserver !== "undefined") {
9732
+ let observer = new MutationObserver(() => {
9733
+ callback();
9735
9734
  });
9736
- if (!targetRef.current)
9737
- return;
9738
- observer.observe(targetRef.current, options);
9735
+ observer.observe(element, options);
9739
9736
  return () => {
9740
- observer.disconnect();
9737
+ if (observer) {
9738
+ observer.disconnect();
9739
+ observer = null;
9740
+ }
9741
9741
  };
9742
+ }
9743
+ return () => {
9744
+ };
9745
+ }
9746
+ function useMutationEffect(effect, targetRef, options) {
9747
+ const fn = useMemoizedFn(effect);
9748
+ React$1.useEffect(() => {
9749
+ const cleanup = observe(targetRef.current, options, fn);
9750
+ return cleanup;
9742
9751
  }, [targetRef]);
9743
9752
  }
9744
9753
  function bound(position, min2, max2) {
@@ -12215,9 +12224,26 @@ const CollapsePanelContent = (props) => {
12215
12224
  if (!inner)
12216
12225
  return;
12217
12226
  if (visible) {
12218
- api.start({
12219
- height: inner.offsetHeight
12220
- });
12227
+ let lastMotionId = 0;
12228
+ let cancelObserve = () => {
12229
+ };
12230
+ const handleMotion = () => {
12231
+ lastMotionId += 1;
12232
+ const motionId = lastMotionId;
12233
+ api.start({
12234
+ height: inner.offsetHeight
12235
+ })[0].then(() => {
12236
+ if (motionId === lastMotionId) {
12237
+ cancelObserve();
12238
+ }
12239
+ });
12240
+ };
12241
+ cancelObserve = observe(inner, {
12242
+ childList: true,
12243
+ subtree: true
12244
+ }, handleMotion);
12245
+ handleMotion();
12246
+ return cancelObserve;
12221
12247
  } else {
12222
12248
  api.start({
12223
12249
  height: inner.offsetHeight,