antd-mobile 5.12.4 → 5.13.0
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/2x/README.md +10 -8
- package/2x/cjs/components/action-sheet/action-sheet.css +22 -7
- package/2x/cjs/components/action-sheet/action-sheet.js +8 -16
- package/2x/cjs/components/button/button.d.ts +1 -1
- package/2x/cjs/components/calendar/calendar.css +4 -0
- package/2x/cjs/components/calendar/calendar.d.ts +1 -0
- package/2x/cjs/components/calendar/calendar.js +1 -1
- package/2x/cjs/components/dialog/dialog.d.ts +2 -0
- package/2x/cjs/components/dialog/dialog.js +24 -13
- package/2x/cjs/components/ellipsis/ellipsis.js +1 -1
- package/2x/cjs/components/error-block/create-error-block.d.ts +12 -0
- package/2x/cjs/components/error-block/create-error-block.js +59 -0
- package/2x/cjs/components/error-block/error-block.d.ts +2 -11
- package/2x/cjs/components/error-block/error-block.js +7 -53
- package/2x/cjs/components/error-block/images/index.d.ts +4 -2
- package/2x/cjs/components/error-block/images/index.js +25 -10
- package/2x/cjs/components/error-block/index.d.ts +5 -1
- package/2x/cjs/components/error-block/index.js +8 -0
- package/2x/cjs/components/form/form-item.js +1 -4
- package/2x/cjs/components/image/image.d.ts +1 -0
- package/2x/cjs/components/image/image.js +4 -2
- package/2x/cjs/components/image-viewer/image-viewer.css +7 -1
- package/2x/cjs/components/image-viewer/image-viewer.d.ts +5 -2
- package/2x/cjs/components/image-viewer/image-viewer.js +24 -4
- package/2x/cjs/components/image-viewer/index.d.ts +2 -1
- package/2x/cjs/components/index-bar/index-bar.d.ts +2 -0
- package/2x/cjs/components/index-bar/index-bar.js +6 -0
- package/2x/cjs/components/index-bar/index.d.ts +1 -0
- package/2x/cjs/components/input/input.js +22 -4
- package/2x/cjs/components/mask/mask.js +9 -7
- package/2x/cjs/components/modal/modal.d.ts +2 -0
- package/2x/cjs/components/modal/modal.js +24 -11
- package/2x/cjs/components/popover/popover.css +1 -0
- package/2x/cjs/components/search-bar/search-bar.d.ts +1 -1
- package/2x/cjs/components/side-bar/side-bar.js +1 -0
- package/2x/cjs/components/spin-loading/spin-loading.js +6 -2
- package/2x/cjs/components/swiper/index.d.ts +1 -1
- package/2x/cjs/components/swiper/swiper.d.ts +1 -1
- package/2x/cjs/components/tab-bar/tab-bar.js +1 -0
- package/2x/cjs/components/text-area/text-area.js +2 -1
- package/2x/cjs/index.d.ts +2 -0
- package/2x/cjs/index.js +21 -1
- package/2x/cjs/locales/fr-FR.d.ts +106 -0
- package/2x/cjs/locales/fr-FR.js +119 -0
- package/2x/cjs/utils/measure-css-length.js +2 -2
- package/2x/cjs/utils/reduce-and-restore-motion.d.ts +4 -0
- package/2x/cjs/utils/reduce-and-restore-motion.js +53 -0
- package/2x/cjs/utils/use-inner-visible.d.ts +1 -0
- package/2x/cjs/utils/use-inner-visible.js +18 -0
- package/2x/es/components/action-sheet/action-sheet.css +22 -7
- package/2x/es/components/action-sheet/action-sheet.js +8 -15
- package/2x/es/components/button/button.d.ts +1 -1
- package/2x/es/components/calendar/calendar.css +4 -0
- package/2x/es/components/calendar/calendar.d.ts +1 -0
- package/2x/es/components/calendar/calendar.js +1 -1
- package/2x/es/components/dialog/dialog.d.ts +2 -0
- package/2x/es/components/dialog/dialog.js +23 -14
- package/2x/es/components/ellipsis/ellipsis.js +1 -1
- package/2x/es/components/error-block/create-error-block.d.ts +12 -0
- package/2x/es/components/error-block/create-error-block.js +44 -0
- package/2x/es/components/error-block/error-block.d.ts +2 -11
- package/2x/es/components/error-block/error-block.js +8 -46
- package/2x/es/components/error-block/images/index.d.ts +4 -2
- package/2x/es/components/error-block/images/index.js +4 -10
- package/2x/es/components/error-block/index.d.ts +5 -1
- package/2x/es/components/error-block/index.js +1 -0
- package/2x/es/components/form/form-item.js +1 -4
- package/2x/es/components/image/image.d.ts +1 -0
- package/2x/es/components/image/image.js +4 -2
- package/2x/es/components/image-viewer/image-viewer.css +7 -1
- package/2x/es/components/image-viewer/image-viewer.d.ts +5 -2
- package/2x/es/components/image-viewer/image-viewer.js +24 -5
- package/2x/es/components/image-viewer/index.d.ts +2 -1
- package/2x/es/components/index-bar/index-bar.d.ts +2 -0
- package/2x/es/components/index-bar/index-bar.js +6 -0
- package/2x/es/components/index-bar/index.d.ts +1 -0
- package/2x/es/components/input/input.js +21 -4
- package/2x/es/components/mask/mask.js +10 -8
- package/2x/es/components/modal/modal.d.ts +2 -0
- package/2x/es/components/modal/modal.js +23 -12
- package/2x/es/components/popover/popover.css +1 -0
- package/2x/es/components/search-bar/search-bar.d.ts +1 -1
- package/2x/es/components/side-bar/side-bar.js +2 -0
- package/2x/es/components/spin-loading/spin-loading.js +5 -2
- package/2x/es/components/swiper/index.d.ts +1 -1
- package/2x/es/components/swiper/swiper.d.ts +1 -1
- package/2x/es/components/tab-bar/tab-bar.js +2 -0
- package/2x/es/components/text-area/text-area.js +2 -1
- package/2x/es/index.d.ts +2 -0
- package/2x/es/index.js +3 -1
- package/2x/es/locales/fr-FR.d.ts +106 -0
- package/2x/es/locales/fr-FR.js +109 -0
- package/2x/es/utils/measure-css-length.js +2 -2
- package/2x/es/utils/reduce-and-restore-motion.d.ts +4 -0
- package/2x/es/utils/reduce-and-restore-motion.js +36 -0
- package/2x/es/utils/use-inner-visible.d.ts +1 -0
- package/2x/es/utils/use-inner-visible.js +9 -0
- package/2x/package.json +8 -7
- package/README.md +10 -8
- package/bundle/antd-mobile.cjs.js +1708 -1567
- package/bundle/antd-mobile.es.js +1705 -1567
- package/bundle/style.css +100 -79
- package/cjs/components/action-sheet/action-sheet.css +19 -7
- package/cjs/components/action-sheet/action-sheet.js +8 -16
- package/cjs/components/button/button.d.ts +1 -1
- package/cjs/components/calendar/calendar.css +3 -0
- package/cjs/components/calendar/calendar.d.ts +1 -0
- package/cjs/components/calendar/calendar.js +1 -1
- package/cjs/components/dialog/dialog.d.ts +2 -0
- package/cjs/components/dialog/dialog.js +24 -13
- package/cjs/components/ellipsis/ellipsis.js +1 -1
- package/cjs/components/error-block/create-error-block.d.ts +12 -0
- package/cjs/components/error-block/create-error-block.js +59 -0
- package/cjs/components/error-block/error-block.d.ts +2 -11
- package/cjs/components/error-block/error-block.js +7 -53
- package/cjs/components/error-block/images/index.d.ts +4 -2
- package/cjs/components/error-block/images/index.js +25 -10
- package/cjs/components/error-block/index.d.ts +5 -1
- package/cjs/components/error-block/index.js +8 -0
- package/cjs/components/form/form-item.js +1 -4
- package/cjs/components/image/image.d.ts +1 -0
- package/cjs/components/image/image.js +4 -2
- package/cjs/components/image-viewer/image-viewer.css +6 -1
- package/cjs/components/image-viewer/image-viewer.d.ts +5 -2
- package/cjs/components/image-viewer/image-viewer.js +24 -4
- package/cjs/components/image-viewer/index.d.ts +2 -1
- package/cjs/components/index-bar/index-bar.d.ts +2 -0
- package/cjs/components/index-bar/index-bar.js +6 -0
- package/cjs/components/index-bar/index.d.ts +1 -0
- package/cjs/components/input/input.js +22 -4
- package/cjs/components/mask/mask.js +9 -7
- package/cjs/components/modal/modal.d.ts +2 -0
- package/cjs/components/modal/modal.js +24 -11
- package/cjs/components/popover/popover.css +1 -0
- package/cjs/components/search-bar/search-bar.d.ts +1 -1
- package/cjs/components/side-bar/side-bar.js +1 -0
- package/cjs/components/spin-loading/spin-loading.js +6 -2
- package/cjs/components/swiper/index.d.ts +1 -1
- package/cjs/components/swiper/swiper.d.ts +1 -1
- package/cjs/components/tab-bar/tab-bar.js +1 -0
- package/cjs/components/text-area/text-area.js +2 -1
- package/cjs/index.d.ts +2 -0
- package/cjs/index.js +21 -1
- package/cjs/locales/fr-FR.d.ts +106 -0
- package/cjs/locales/fr-FR.js +119 -0
- package/cjs/utils/measure-css-length.js +2 -2
- package/cjs/utils/reduce-and-restore-motion.d.ts +4 -0
- package/cjs/utils/reduce-and-restore-motion.js +53 -0
- package/cjs/utils/use-inner-visible.d.ts +1 -0
- package/cjs/utils/use-inner-visible.js +18 -0
- package/es/components/action-sheet/action-sheet.css +19 -7
- package/es/components/action-sheet/action-sheet.js +8 -15
- package/es/components/button/button.d.ts +1 -1
- package/es/components/calendar/calendar.css +3 -0
- package/es/components/calendar/calendar.d.ts +1 -0
- package/es/components/calendar/calendar.js +1 -1
- package/es/components/dialog/dialog.d.ts +2 -0
- package/es/components/dialog/dialog.js +23 -14
- package/es/components/ellipsis/ellipsis.js +1 -1
- package/es/components/error-block/create-error-block.d.ts +12 -0
- package/es/components/error-block/create-error-block.js +44 -0
- package/es/components/error-block/error-block.d.ts +2 -11
- package/es/components/error-block/error-block.js +8 -46
- package/es/components/error-block/images/index.d.ts +4 -2
- package/es/components/error-block/images/index.js +4 -10
- package/es/components/error-block/index.d.ts +5 -1
- package/es/components/error-block/index.js +1 -0
- package/es/components/form/form-item.js +1 -4
- package/es/components/image/image.d.ts +1 -0
- package/es/components/image/image.js +4 -2
- package/es/components/image-viewer/image-viewer.css +6 -1
- package/es/components/image-viewer/image-viewer.d.ts +5 -2
- package/es/components/image-viewer/image-viewer.js +24 -5
- package/es/components/image-viewer/index.d.ts +2 -1
- package/es/components/index-bar/index-bar.d.ts +2 -0
- package/es/components/index-bar/index-bar.js +6 -0
- package/es/components/index-bar/index.d.ts +1 -0
- package/es/components/input/input.js +21 -4
- package/es/components/mask/mask.js +10 -8
- package/es/components/modal/modal.d.ts +2 -0
- package/es/components/modal/modal.js +23 -12
- package/es/components/popover/popover.css +1 -0
- package/es/components/search-bar/search-bar.d.ts +1 -1
- package/es/components/side-bar/side-bar.js +2 -0
- package/es/components/spin-loading/spin-loading.js +5 -2
- package/es/components/swiper/index.d.ts +1 -1
- package/es/components/swiper/swiper.d.ts +1 -1
- package/es/components/tab-bar/tab-bar.js +2 -0
- package/es/components/text-area/text-area.js +2 -1
- package/es/index.d.ts +2 -0
- package/es/index.js +3 -1
- package/es/locales/fr-FR.d.ts +106 -0
- package/es/locales/fr-FR.js +109 -0
- package/es/utils/measure-css-length.js +2 -2
- package/es/utils/reduce-and-restore-motion.d.ts +4 -0
- package/es/utils/reduce-and-restore-motion.js +36 -0
- package/es/utils/use-inner-visible.d.ts +1 -0
- package/es/utils/use-inner-visible.js +9 -0
- package/package.json +8 -7
- package/umd/antd-mobile.js +1 -1
- package/umd/antd-mobile.js.LICENSE.txt +12 -0
|
@@ -0,0 +1,119 @@
|
|
|
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}Pas un valide${type}';
|
|
13
|
+
const frFR = (0, _mergeLocale.mergeLocale)(_base.base, {
|
|
14
|
+
locale: 'fr-FR',
|
|
15
|
+
common: {
|
|
16
|
+
confirm: 'Valider',
|
|
17
|
+
cancel: 'Annuler',
|
|
18
|
+
loading: 'Chargement'
|
|
19
|
+
},
|
|
20
|
+
Calendar: {
|
|
21
|
+
markItems: ['un', 'deux', 'trois', 'quatre', 'cinq', 'six', 'sept'],
|
|
22
|
+
renderYearAndMonth: (year, month) => `${year}Année ${month}Mois`
|
|
23
|
+
},
|
|
24
|
+
Cascader: {
|
|
25
|
+
placeholder: 'Veuillez sélectionner'
|
|
26
|
+
},
|
|
27
|
+
Dialog: {
|
|
28
|
+
ok: 'Je l’ai compris'
|
|
29
|
+
},
|
|
30
|
+
ErrorBlock: {
|
|
31
|
+
default: {
|
|
32
|
+
title: 'La page rencontre des problèmes mineurs',
|
|
33
|
+
description: 'Venez essayer plus tard'
|
|
34
|
+
},
|
|
35
|
+
busy: {
|
|
36
|
+
title: 'Pas chargé.',
|
|
37
|
+
description: 'Tentative de rafraîchir la page'
|
|
38
|
+
},
|
|
39
|
+
disconnected: {
|
|
40
|
+
title: 'Le réseau est occupé',
|
|
41
|
+
description: 'Tentative de rafraîchir la page'
|
|
42
|
+
},
|
|
43
|
+
empty: {
|
|
44
|
+
title: 'Vous n’avez pas trouvé ce que vous cherchez',
|
|
45
|
+
description: 'Trouvez les autres'
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
Form: {
|
|
49
|
+
required: 'Qu’il remplit',
|
|
50
|
+
optional: 'Décharge sélectionnés',
|
|
51
|
+
defaultValidateMessages: {
|
|
52
|
+
default: 'Erreur de validation de champ${label}',
|
|
53
|
+
required: 'Veuillez entrer le${label}',
|
|
54
|
+
enum: '${label}doit être l’un des[${enum}]',
|
|
55
|
+
whitespace: '${label}Ne peut pas être un caractère vide',
|
|
56
|
+
date: {
|
|
57
|
+
format: '${label}Format de date invalide',
|
|
58
|
+
parse: '${label}Non convertible en date',
|
|
59
|
+
invalid: '${label}Est une date non valide'
|
|
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}pour${len}Un caractère',
|
|
78
|
+
min: '${label}Au moins${min}Un caractère',
|
|
79
|
+
max: '${label}Un maximum de${max}Un caractère',
|
|
80
|
+
range: '${label}Dans les${min}-${max}Entre les caractères'
|
|
81
|
+
},
|
|
82
|
+
number: {
|
|
83
|
+
len: '${label}Doit être égal à${len}',
|
|
84
|
+
min: '${label}La valeur minimale est${min}',
|
|
85
|
+
max: '${label}La valeur maximale est${max}',
|
|
86
|
+
range: '${label}Dans les${min}-${max}entre'
|
|
87
|
+
},
|
|
88
|
+
array: {
|
|
89
|
+
len: 'pour${len}个${label}',
|
|
90
|
+
min: 'Au moins${min}个${label}',
|
|
91
|
+
max: 'Un maximum de${max}个${label}',
|
|
92
|
+
range: '${label}Montant de${min}-${max}entre'
|
|
93
|
+
},
|
|
94
|
+
pattern: {
|
|
95
|
+
mismatch: '${label}Ne correspond pas au modèle${pattern}'
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
ImageUploader: {
|
|
100
|
+
uploading: 'Téléchargement...',
|
|
101
|
+
upload: 'Télécharger'
|
|
102
|
+
},
|
|
103
|
+
InfiniteScroll: {
|
|
104
|
+
noMore: 'Non, plus maintenant.'
|
|
105
|
+
},
|
|
106
|
+
Mask: {
|
|
107
|
+
name: 'Masques'
|
|
108
|
+
},
|
|
109
|
+
Modal: {
|
|
110
|
+
ok: 'Je l’ai compris'
|
|
111
|
+
},
|
|
112
|
+
PullToRefresh: {
|
|
113
|
+
pulling: 'Rafraîchir la liste déroulante',
|
|
114
|
+
canRelease: 'Libérez instantanément rafraîchir',
|
|
115
|
+
complete: 'Rafraîchir avec succès'
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
var _default = frFR;
|
|
119
|
+
exports.default = _default;
|
|
@@ -10,7 +10,7 @@ var _isDev = require("./is-dev");
|
|
|
10
10
|
var _devLog = require("./dev-log");
|
|
11
11
|
|
|
12
12
|
function measureCSSLength(raw) {
|
|
13
|
-
if (raw === null || raw === undefined) {
|
|
13
|
+
if (raw === null || raw === undefined || raw === '') {
|
|
14
14
|
if (_isDev.isDev) {
|
|
15
15
|
(0, _devLog.devError)('Global', 'Seems like the you will encounter a style messed problem. Please check the browser environment to make sure it supports CSS variables.');
|
|
16
16
|
}
|
|
@@ -28,7 +28,7 @@ function measureCSSLength(raw) {
|
|
|
28
28
|
return parseFloat(withUnit) * window.innerWidth / 100;
|
|
29
29
|
} else {
|
|
30
30
|
if (_isDev.isDev) {
|
|
31
|
-
(0, _devLog.devError)('Global',
|
|
31
|
+
(0, _devLog.devError)('Global', `You are using a not supported CSS unit in \`${raw}\`. Only \`px\` \`rem\` and \`vw\` are supported.`);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
return 0;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isMotionReduced = isMotionReduced;
|
|
7
|
+
exports.reduceMotion = reduceMotion;
|
|
8
|
+
exports.restoreMotion = restoreMotion;
|
|
9
|
+
exports.useMotionReduced = useMotionReduced;
|
|
10
|
+
|
|
11
|
+
var _web = require("@react-spring/web");
|
|
12
|
+
|
|
13
|
+
var _shim = require("use-sync-external-store/shim");
|
|
14
|
+
|
|
15
|
+
let reduced = false;
|
|
16
|
+
const subscribers = new Set();
|
|
17
|
+
|
|
18
|
+
function notify() {
|
|
19
|
+
subscribers.forEach(subscriber => {
|
|
20
|
+
subscriber();
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function reduceMotion() {
|
|
25
|
+
reduced = true;
|
|
26
|
+
notify();
|
|
27
|
+
|
|
28
|
+
_web.Globals.assign({
|
|
29
|
+
skipAnimation: true
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function restoreMotion() {
|
|
34
|
+
reduced = false;
|
|
35
|
+
notify();
|
|
36
|
+
|
|
37
|
+
_web.Globals.assign({
|
|
38
|
+
skipAnimation: false
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function isMotionReduced() {
|
|
43
|
+
return reduced;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function useMotionReduced() {
|
|
47
|
+
return (0, _shim.useSyncExternalStore)(onStoreChange => {
|
|
48
|
+
subscribers.add(onStoreChange);
|
|
49
|
+
return () => {
|
|
50
|
+
subscribers.delete(onStoreChange);
|
|
51
|
+
};
|
|
52
|
+
}, isMotionReduced);
|
|
53
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useInnerVisible(outerVisible: boolean): boolean;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useInnerVisible = useInnerVisible;
|
|
7
|
+
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
|
|
10
|
+
var _ahooks = require("ahooks");
|
|
11
|
+
|
|
12
|
+
function useInnerVisible(outerVisible) {
|
|
13
|
+
const [innerVisible, setInnerVisible] = (0, _react.useState)(outerVisible);
|
|
14
|
+
(0, _ahooks.useIsomorphicLayoutEffect)(() => {
|
|
15
|
+
setInnerVisible(outerVisible);
|
|
16
|
+
}, [outerVisible]);
|
|
17
|
+
return innerVisible;
|
|
18
|
+
}
|
|
@@ -9,22 +9,37 @@
|
|
|
9
9
|
justify-content: center;
|
|
10
10
|
color: var(--adm-color-weak);
|
|
11
11
|
font-size: 30px;
|
|
12
|
-
padding: 36px
|
|
12
|
+
padding: 36px 24px;
|
|
13
|
+
border-bottom: 2px solid var(--adm-border-color);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.adm-action-sheet-button-list {
|
|
13
17
|
border-bottom: 2px solid var(--adm-border-color);
|
|
14
18
|
}
|
|
15
19
|
|
|
16
20
|
.adm-action-sheet-button-item-wrapper {
|
|
17
|
-
|
|
18
|
-
border-top: 2px solid var(--adm-border-color);
|
|
21
|
+
border-bottom: 2px solid var(--adm-border-color);
|
|
19
22
|
}
|
|
20
23
|
|
|
21
|
-
.adm-action-sheet-button-item-wrapper:
|
|
22
|
-
border-
|
|
24
|
+
.adm-action-sheet-button-item-wrapper:last-child {
|
|
25
|
+
border-bottom: none;
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
.adm-action-sheet-button-item {
|
|
26
|
-
padding: 28px;
|
|
27
29
|
text-align: center;
|
|
30
|
+
display: block;
|
|
31
|
+
background-color: #ffffff;
|
|
32
|
+
padding: 32px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.adm-action-sheet-button-item:active {
|
|
36
|
+
background-color: #eeeeee;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.adm-action-sheet-button-item-disabled {
|
|
40
|
+
cursor: not-allowed;
|
|
41
|
+
pointer-events: none;
|
|
42
|
+
opacity: 0.4;
|
|
28
43
|
}
|
|
29
44
|
|
|
30
45
|
.adm-action-sheet-button-item-name {
|
|
@@ -35,7 +50,7 @@
|
|
|
35
50
|
.adm-action-sheet-button-item-description {
|
|
36
51
|
font-size: 24px;
|
|
37
52
|
color: var(--adm-color-weak);
|
|
38
|
-
padding-top:
|
|
53
|
+
padding-top: 4px;
|
|
39
54
|
}
|
|
40
55
|
|
|
41
56
|
.adm-action-sheet-button-item-danger .adm-action-sheet-button-item-name {
|
|
@@ -3,7 +3,6 @@ import { withNativeProps } from '../../utils/native-props';
|
|
|
3
3
|
import { mergeProps } from '../../utils/with-default-props';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import Popup from '../popup';
|
|
6
|
-
import Button from '../button';
|
|
7
6
|
import SafeArea from '../safe-area';
|
|
8
7
|
import { renderImperatively } from '../../utils/render-imperatively';
|
|
9
8
|
const classPrefix = `adm-action-sheet`;
|
|
@@ -41,11 +40,11 @@ export const ActionSheet = p => {
|
|
|
41
40
|
}, props.actions.map((action, index) => React.createElement("div", {
|
|
42
41
|
key: action.key,
|
|
43
42
|
className: `${classPrefix}-button-item-wrapper`
|
|
44
|
-
}, React.createElement(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
}, React.createElement("a", {
|
|
44
|
+
className: classNames('adm-plain-anchor', `${classPrefix}-button-item`, {
|
|
45
|
+
[`${classPrefix}-button-item-danger`]: action.danger,
|
|
46
|
+
[`${classPrefix}-button-item-disabled`]: action.disabled
|
|
47
|
+
}),
|
|
49
48
|
onClick: () => {
|
|
50
49
|
var _a, _b, _c;
|
|
51
50
|
|
|
@@ -55,10 +54,7 @@ export const ActionSheet = p => {
|
|
|
55
54
|
if (props.closeOnAction) {
|
|
56
55
|
(_c = props.onClose) === null || _c === void 0 ? void 0 : _c.call(props);
|
|
57
56
|
}
|
|
58
|
-
}
|
|
59
|
-
className: classNames(`${classPrefix}-button-item`, {
|
|
60
|
-
[`${classPrefix}-button-item-danger`]: action.danger
|
|
61
|
-
})
|
|
57
|
+
}
|
|
62
58
|
}, React.createElement("div", {
|
|
63
59
|
className: `${classPrefix}-button-item-name`
|
|
64
60
|
}, action.text), action.description && React.createElement("div", {
|
|
@@ -67,11 +63,8 @@ export const ActionSheet = p => {
|
|
|
67
63
|
className: `${classPrefix}-cancel`
|
|
68
64
|
}, React.createElement("div", {
|
|
69
65
|
className: `${classPrefix}-button-item-wrapper`
|
|
70
|
-
}, React.createElement(
|
|
71
|
-
|
|
72
|
-
fill: 'none',
|
|
73
|
-
shape: 'rectangular',
|
|
74
|
-
className: `${classPrefix}-button-item`,
|
|
66
|
+
}, React.createElement("a", {
|
|
67
|
+
className: classNames('adm-plain-anchor', `${classPrefix}-button-item`),
|
|
75
68
|
onClick: () => {
|
|
76
69
|
var _a;
|
|
77
70
|
|
|
@@ -31,5 +31,5 @@ export declare const Button: React.ForwardRefExoticComponent<{
|
|
|
31
31
|
type?: "reset" | "submit" | "button" | undefined;
|
|
32
32
|
shape?: "default" | "rounded" | "rectangular" | undefined;
|
|
33
33
|
children?: React.ReactNode;
|
|
34
|
-
} & Pick<NativeButtonProps, "onMouseDown" | "onMouseUp" | "onTouchEnd" | "onTouchStart"> & NativeProps<"--
|
|
34
|
+
} & Pick<NativeButtonProps, "onMouseDown" | "onMouseUp" | "onTouchEnd" | "onTouchStart"> & NativeProps<"--border-radius" | "--text-color" | "--background-color" | "--border-width" | "--border-style" | "--border-color"> & React.RefAttributes<ButtonRef>>;
|
|
35
35
|
export {};
|
|
@@ -86,6 +86,10 @@
|
|
|
86
86
|
border-bottom-right-radius: 8px;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
.adm-calendar-cell.adm-calendar-cell-disabled.adm-calendar-cell.adm-calendar-cell-selected {
|
|
90
|
+
color: var(--adm-color-light);
|
|
91
|
+
}
|
|
92
|
+
|
|
89
93
|
.adm-calendar-cell .adm-calendar-cell-top {
|
|
90
94
|
flex: none;
|
|
91
95
|
font-size: 36px;
|
|
@@ -125,7 +125,7 @@ export const Calendar = forwardRef((p, ref) => {
|
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
const inThisMonth = d.month() === current.month();
|
|
128
|
-
const disabled = maxDay && d.isAfter(maxDay, 'day') || minDay && d.isBefore(minDay, 'day');
|
|
128
|
+
const disabled = props.shouldDisableDate ? props.shouldDisableDate(d.toDate()) : maxDay && d.isAfter(maxDay, 'day') || minDay && d.isBefore(minDay, 'day');
|
|
129
129
|
cells.push(React.createElement("div", {
|
|
130
130
|
key: d.valueOf(),
|
|
131
131
|
className: classNames(`${classPrefix}-cell`, (disabled || !inThisMonth) && `${classPrefix}-cell-disabled`, inThisMonth && {
|
|
@@ -2,7 +2,7 @@ import { __awaiter } from "tslib";
|
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
3
|
import { mergeProps } from '../../utils/with-default-props';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
|
-
import { useUnmountedRef } from 'ahooks';
|
|
5
|
+
import { useIsomorphicLayoutEffect, useUnmountedRef } from 'ahooks';
|
|
6
6
|
import Mask from '../mask';
|
|
7
7
|
import { DialogActionButton } from './dialog-action-button';
|
|
8
8
|
import Image from '../image';
|
|
@@ -11,6 +11,8 @@ import { withStopPropagation } from '../../utils/with-stop-propagation';
|
|
|
11
11
|
import AutoCenter from '../auto-center';
|
|
12
12
|
import { useSpring, animated } from '@react-spring/web';
|
|
13
13
|
import { withNativeProps } from '../../utils/native-props';
|
|
14
|
+
import { ShouldRender } from '../../utils/should-render';
|
|
15
|
+
import { useInnerVisible } from '../../utils/use-inner-visible';
|
|
14
16
|
const defaultProps = {
|
|
15
17
|
visible: false,
|
|
16
18
|
actions: [],
|
|
@@ -18,7 +20,9 @@ const defaultProps = {
|
|
|
18
20
|
closeOnMaskClick: false,
|
|
19
21
|
stopPropagation: ['click'],
|
|
20
22
|
getContainer: null,
|
|
21
|
-
disableBodyScroll: true
|
|
23
|
+
disableBodyScroll: true,
|
|
24
|
+
destroyOnClose: false,
|
|
25
|
+
forceRender: false
|
|
22
26
|
};
|
|
23
27
|
export const Dialog = p => {
|
|
24
28
|
const props = mergeProps(defaultProps, p);
|
|
@@ -32,9 +36,6 @@ export const Dialog = p => {
|
|
|
32
36
|
friction: 25,
|
|
33
37
|
clamp: true
|
|
34
38
|
},
|
|
35
|
-
onStart: () => {
|
|
36
|
-
setActive(true);
|
|
37
|
-
},
|
|
38
39
|
onRest: () => {
|
|
39
40
|
var _a, _b;
|
|
40
41
|
|
|
@@ -49,6 +50,12 @@ export const Dialog = p => {
|
|
|
49
50
|
}
|
|
50
51
|
});
|
|
51
52
|
const [active, setActive] = useState(props.visible);
|
|
53
|
+
useIsomorphicLayoutEffect(() => {
|
|
54
|
+
if (props.visible) {
|
|
55
|
+
setActive(true);
|
|
56
|
+
}
|
|
57
|
+
}, [props.visible]);
|
|
58
|
+
const maskVisible = useInnerVisible(active && props.visible);
|
|
52
59
|
const body = React.createElement("div", {
|
|
53
60
|
className: classNames(cls('body'), props.image && cls('with-image'), props.bodyClassName),
|
|
54
61
|
style: props.bodyStyle
|
|
@@ -85,26 +92,28 @@ export const Dialog = p => {
|
|
|
85
92
|
})
|
|
86
93
|
})));
|
|
87
94
|
})));
|
|
88
|
-
const node = withNativeProps(props, React.createElement("div", {
|
|
95
|
+
const node = withStopPropagation(props.stopPropagation, withNativeProps(props, React.createElement("div", {
|
|
89
96
|
className: cls(),
|
|
90
97
|
style: {
|
|
91
|
-
display: active ? undefined : 'none'
|
|
98
|
+
display: active ? undefined : 'none',
|
|
99
|
+
pointerEvents: active ? undefined : 'none'
|
|
92
100
|
}
|
|
93
101
|
}, React.createElement(Mask, {
|
|
94
|
-
visible:
|
|
102
|
+
visible: maskVisible,
|
|
95
103
|
onMaskClick: props.closeOnMaskClick ? props.onClose : undefined,
|
|
96
104
|
style: props.maskStyle,
|
|
97
105
|
className: classNames(cls('mask'), props.maskClassName),
|
|
98
106
|
disableBodyScroll: props.disableBodyScroll
|
|
99
107
|
}), React.createElement("div", {
|
|
100
|
-
className: cls('wrap')
|
|
101
|
-
style: {
|
|
102
|
-
pointerEvents: props.visible ? undefined : 'none'
|
|
103
|
-
}
|
|
108
|
+
className: cls('wrap')
|
|
104
109
|
}, React.createElement(animated.div, {
|
|
105
110
|
style: style
|
|
106
|
-
}, body))));
|
|
107
|
-
return
|
|
111
|
+
}, body)))));
|
|
112
|
+
return React.createElement(ShouldRender, {
|
|
113
|
+
active: active,
|
|
114
|
+
forceRender: props.forceRender,
|
|
115
|
+
destroyOnClose: props.destroyOnClose
|
|
116
|
+
}, renderToContainer(props.getContainer, node));
|
|
108
117
|
};
|
|
109
118
|
|
|
110
119
|
function cls(name = '') {
|
|
@@ -98,7 +98,7 @@ export const Ellipsis = p => {
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
const leftPartMiddle = Math.floor((leftPart[0] + leftPart[1]) / 2);
|
|
101
|
-
const rightPartMiddle = Math.
|
|
101
|
+
const rightPartMiddle = Math.ceil((rightPart[0] + rightPart[1]) / 2);
|
|
102
102
|
container.innerText = props.content.slice(0, leftPartMiddle) + '...' + actionText + '...' + props.content.slice(rightPartMiddle, end);
|
|
103
103
|
|
|
104
104
|
if (container.offsetHeight <= maxHeight) {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { NativeProps } from '../../utils/native-props';
|
|
3
|
+
import type { ErrorBlockStatus, ImageRecord } from '.';
|
|
4
|
+
export declare type ErrorBlockProps = {
|
|
5
|
+
status?: ErrorBlockStatus;
|
|
6
|
+
title?: ReactNode;
|
|
7
|
+
image?: string | ReactElement;
|
|
8
|
+
description?: ReactNode;
|
|
9
|
+
fullPage?: boolean;
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
} & NativeProps<'--image-height' | '--image-height-full-page' | '--image-width' | '--image-width-full-page'>;
|
|
12
|
+
export declare function createErrorBlock(imageRecord: ImageRecord): React.FC<ErrorBlockProps>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { mergeProps } from '../../utils/with-default-props';
|
|
4
|
+
import { withNativeProps } from '../../utils/native-props';
|
|
5
|
+
import { useConfig } from '../config-provider';
|
|
6
|
+
const classPrefix = `adm-error-block`;
|
|
7
|
+
const defaultProps = {
|
|
8
|
+
status: 'default'
|
|
9
|
+
};
|
|
10
|
+
export function createErrorBlock(imageRecord) {
|
|
11
|
+
const ErrorBlock = p => {
|
|
12
|
+
var _a;
|
|
13
|
+
|
|
14
|
+
const props = mergeProps(defaultProps, p);
|
|
15
|
+
const {
|
|
16
|
+
locale
|
|
17
|
+
} = useConfig();
|
|
18
|
+
const contentPack = locale.ErrorBlock[props.status];
|
|
19
|
+
const des = 'description' in props ? props.description : contentPack.description;
|
|
20
|
+
const title = 'title' in props ? props.title : contentPack.title;
|
|
21
|
+
const image = (_a = props.image) !== null && _a !== void 0 ? _a : imageRecord[props.status];
|
|
22
|
+
const imageNode = typeof image === 'string' ? React.createElement("img", {
|
|
23
|
+
src: image,
|
|
24
|
+
alt: 'error block image'
|
|
25
|
+
}) : image;
|
|
26
|
+
return withNativeProps(props, React.createElement("div", {
|
|
27
|
+
className: classNames(classPrefix, {
|
|
28
|
+
[`${classPrefix}-full-page`]: props.fullPage
|
|
29
|
+
})
|
|
30
|
+
}, React.createElement("div", {
|
|
31
|
+
className: `${classPrefix}-image`
|
|
32
|
+
}, imageNode), React.createElement("div", {
|
|
33
|
+
className: `${classPrefix}-description`
|
|
34
|
+
}, title && React.createElement("div", {
|
|
35
|
+
className: `${classPrefix}-description-title`
|
|
36
|
+
}, title), des && React.createElement("div", {
|
|
37
|
+
className: `${classPrefix}-description-subtitle`
|
|
38
|
+
}, des)), props.children && React.createElement("div", {
|
|
39
|
+
className: `${classPrefix}-content`
|
|
40
|
+
}, props.children)));
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
return ErrorBlock;
|
|
44
|
+
}
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare type ErrorBlockProps = {
|
|
4
|
-
status?: 'default' | 'disconnected' | 'empty' | 'busy';
|
|
5
|
-
title?: ReactNode;
|
|
6
|
-
image?: string | ReactElement;
|
|
7
|
-
description?: ReactNode;
|
|
8
|
-
fullPage?: boolean;
|
|
9
|
-
children?: React.ReactNode;
|
|
10
|
-
} & NativeProps<'--image-height' | '--image-height-full-page' | '--image-width' | '--image-width-full-page'>;
|
|
11
|
-
export declare const ErrorBlock: FC<ErrorBlockProps>;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const ErrorBlock: import("react").FC<import("./create-error-block").ErrorBlockProps>;
|
|
@@ -1,47 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const defaultProps = {
|
|
9
|
-
status: 'default'
|
|
1
|
+
import { createErrorBlock } from './create-error-block';
|
|
2
|
+
import { busyImage, defaultImage, disconnectedImage, emptyImage } from './images';
|
|
3
|
+
const imageRecord = {
|
|
4
|
+
'default': defaultImage,
|
|
5
|
+
'disconnected': disconnectedImage,
|
|
6
|
+
'empty': emptyImage,
|
|
7
|
+
'busy': busyImage
|
|
10
8
|
};
|
|
11
|
-
export const ErrorBlock =
|
|
12
|
-
const props = mergeProps(defaultProps, p);
|
|
13
|
-
const {
|
|
14
|
-
locale
|
|
15
|
-
} = useConfig();
|
|
16
|
-
const contentPack = locale.ErrorBlock[props.status];
|
|
17
|
-
const des = 'description' in props ? props.description : contentPack.description;
|
|
18
|
-
const title = 'title' in props ? props.title : contentPack.title;
|
|
19
|
-
let imageNode = imageRecord[props.status];
|
|
20
|
-
|
|
21
|
-
if (props.image) {
|
|
22
|
-
if (typeof props.image === 'string') {
|
|
23
|
-
imageNode = React.createElement("img", {
|
|
24
|
-
src: props.image,
|
|
25
|
-
alt: 'error block image'
|
|
26
|
-
});
|
|
27
|
-
} else {
|
|
28
|
-
imageNode = props.image;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return withNativeProps(props, React.createElement("div", {
|
|
33
|
-
className: classNames(classPrefix, {
|
|
34
|
-
[`${classPrefix}-full-page`]: props.fullPage
|
|
35
|
-
})
|
|
36
|
-
}, React.createElement("div", {
|
|
37
|
-
className: `${classPrefix}-image`
|
|
38
|
-
}, imageNode), React.createElement("div", {
|
|
39
|
-
className: `${classPrefix}-description`
|
|
40
|
-
}, title && React.createElement("div", {
|
|
41
|
-
className: `${classPrefix}-description-title`
|
|
42
|
-
}, title), des && React.createElement("div", {
|
|
43
|
-
className: `${classPrefix}-description-subtitle`
|
|
44
|
-
}, des)), props.children && React.createElement("div", {
|
|
45
|
-
className: `${classPrefix}-content`
|
|
46
|
-
}, props.children)));
|
|
47
|
-
};
|
|
9
|
+
export const ErrorBlock = createErrorBlock(imageRecord);
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
export { defaultImage } from './default';
|
|
2
|
+
export { disconnectedImage } from './disconnected';
|
|
3
|
+
export { emptyImage } from './empty';
|
|
4
|
+
export { busyImage } from './busy';
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export const imageRecord = {
|
|
6
|
-
'default': defaultImage,
|
|
7
|
-
'disconnected': disconnectedImage,
|
|
8
|
-
'empty': emptyImage,
|
|
9
|
-
'busy': busyImage
|
|
10
|
-
};
|
|
1
|
+
export { defaultImage } from './default';
|
|
2
|
+
export { disconnectedImage } from './disconnected';
|
|
3
|
+
export { emptyImage } from './empty';
|
|
4
|
+
export { busyImage } from './busy';
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import './error-block.less';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
2
3
|
import { ErrorBlock } from './error-block';
|
|
3
|
-
export
|
|
4
|
+
export { createErrorBlock } from './create-error-block';
|
|
5
|
+
export type { ErrorBlockProps } from './create-error-block';
|
|
6
|
+
export declare type ErrorBlockStatus = 'default' | 'disconnected' | 'empty' | 'busy';
|
|
7
|
+
export declare type ImageRecord = Partial<Record<ErrorBlockStatus, string | ReactNode>>;
|
|
4
8
|
export default ErrorBlock;
|
|
@@ -228,10 +228,7 @@ export const FormItem = props => {
|
|
|
228
228
|
}
|
|
229
229
|
|
|
230
230
|
let Variables = {};
|
|
231
|
-
|
|
232
|
-
if (typeof label === 'string') {
|
|
233
|
-
Variables.label = label;
|
|
234
|
-
}
|
|
231
|
+
Variables.label = typeof label === 'string' ? label : '';
|
|
235
232
|
|
|
236
233
|
if (messageVariables) {
|
|
237
234
|
Variables = Object.assign(Object.assign({}, Variables), messageVariables);
|
|
@@ -9,6 +9,7 @@ export declare type ImageProps = {
|
|
|
9
9
|
placeholder?: ReactNode;
|
|
10
10
|
fallback?: ReactNode;
|
|
11
11
|
lazy?: boolean;
|
|
12
|
+
draggable?: boolean;
|
|
12
13
|
onClick?: (event: React.MouseEvent<HTMLImageElement, Event>) => void;
|
|
13
14
|
onError?: (event: React.SyntheticEvent<HTMLImageElement, Event>) => void;
|
|
14
15
|
onLoad?: (event: React.SyntheticEvent<HTMLImageElement, Event>) => void;
|