antd-mobile 5.18.0 → 5.21.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/bundle/antd-mobile.cjs.js +47 -18976
- package/2x/bundle/antd-mobile.compatible.umd.js +25911 -0
- package/2x/bundle/antd-mobile.es.js +16358 -16685
- package/2x/bundle/antd-mobile.umd.js +64 -0
- package/2x/bundle/style.css +359 -273
- package/2x/cjs/components/action-sheet/action-sheet.d.ts +1 -1
- package/2x/cjs/components/button/button.js +1 -1
- package/2x/cjs/components/calendar/calendar.d.ts +1 -1
- package/2x/cjs/components/cascader/cascader.d.ts +2 -0
- package/2x/cjs/components/cascader/index.d.ts +1 -0
- package/2x/cjs/components/cascader-view/cascader-view.d.ts +2 -1
- package/2x/cjs/components/cascader-view/cascader-view.js +2 -1
- package/2x/cjs/components/dialog/show.d.ts +1 -1
- package/2x/cjs/components/form/context.d.ts +1 -1
- package/2x/cjs/components/form/form-item.d.ts +1 -1
- package/2x/cjs/components/form/form-item.js +3 -0
- package/2x/cjs/components/image/test/image.test.js +57 -8
- package/2x/cjs/components/image-viewer/slide.js +75 -56
- package/2x/cjs/components/input/input.js +9 -2
- package/2x/cjs/components/modal/show.d.ts +1 -1
- package/2x/cjs/components/number-keyboard/number-keyboard.css +11 -15
- package/2x/cjs/components/number-keyboard/number-keyboard.d.ts +1 -1
- package/2x/cjs/components/number-keyboard/number-keyboard.js +19 -17
- package/2x/cjs/components/passcode-input/index.d.ts +1 -1
- package/2x/cjs/components/passcode-input/passcode-input.css +12 -12
- package/2x/cjs/components/passcode-input/passcode-input.js +16 -8
- package/2x/cjs/components/picker-view/wheel.js +2 -0
- package/2x/cjs/components/rate/rate.css +4 -0
- package/2x/cjs/components/rate/rate.js +42 -13
- package/2x/cjs/components/result/result.d.ts +1 -1
- package/2x/cjs/components/result/result.js +7 -1
- package/2x/cjs/components/result-page/index.d.ts +7 -0
- package/2x/cjs/components/result-page/index.js +20 -0
- package/2x/cjs/components/result-page/result-page-card.d.ts +6 -0
- package/2x/cjs/components/result-page/result-page-card.js +24 -0
- package/2x/cjs/components/result-page/result-page.css +130 -0
- package/2x/cjs/components/result-page/result-page.d.ts +23 -0
- package/2x/cjs/components/result-page/result-page.js +108 -0
- package/2x/cjs/components/search-bar/search-bar.js +12 -2
- package/2x/cjs/components/swipe-action/swipe-action.d.ts +2 -0
- package/2x/cjs/components/swipe-action/swipe-action.js +34 -6
- package/2x/cjs/components/swiper/swiper.js +15 -1
- package/2x/cjs/index.d.ts +1 -0
- package/2x/cjs/index.js +8 -0
- package/2x/cjs/locales/base.d.ts +9 -0
- package/2x/cjs/locales/base.js +9 -0
- package/2x/cjs/locales/en-US.d.ts +9 -0
- package/2x/cjs/locales/es-ES.d.ts +9 -0
- package/2x/cjs/locales/fa-IR.d.ts +9 -0
- package/2x/cjs/locales/fr-FR.d.ts +9 -0
- package/2x/cjs/locales/id-ID.d.ts +9 -0
- package/2x/cjs/locales/id-ID.js +13 -0
- package/2x/cjs/locales/kk-KZ.d.ts +9 -0
- package/2x/cjs/locales/ko-KR.d.ts +9 -0
- package/2x/cjs/locales/zh-CN.d.ts +9 -0
- package/2x/cjs/locales/zh-CN.js +9 -0
- package/2x/cjs/locales/zh-HK.d.ts +9 -0
- package/2x/cjs/locales/zh-TW.d.ts +9 -0
- package/2x/cjs/utils/matrix.d.ts +10 -0
- package/2x/cjs/utils/matrix.js +60 -0
- package/2x/cjs/utils/use-resize-effect.js +3 -1
- package/2x/es/components/action-sheet/action-sheet.d.ts +1 -1
- package/2x/es/components/button/button.js +1 -1
- package/2x/es/components/calendar/calendar.d.ts +1 -1
- package/2x/es/components/cascader/cascader.d.ts +2 -0
- package/2x/es/components/cascader/index.d.ts +1 -0
- package/2x/es/components/cascader-view/cascader-view.d.ts +2 -1
- package/2x/es/components/cascader-view/cascader-view.js +2 -1
- package/2x/es/components/dialog/show.d.ts +1 -1
- package/2x/es/components/form/context.d.ts +1 -1
- package/2x/es/components/form/form-item.d.ts +1 -1
- package/2x/es/components/form/form-item.js +3 -0
- package/2x/es/components/image/test/image.test.js +54 -8
- package/2x/es/components/image-viewer/slide.js +73 -56
- package/2x/es/components/input/input.js +8 -2
- package/2x/es/components/modal/show.d.ts +1 -1
- package/2x/es/components/number-keyboard/number-keyboard.css +11 -15
- package/2x/es/components/number-keyboard/number-keyboard.d.ts +1 -1
- package/2x/es/components/number-keyboard/number-keyboard.js +19 -17
- package/2x/es/components/passcode-input/index.d.ts +1 -1
- package/2x/es/components/passcode-input/passcode-input.css +12 -12
- package/2x/es/components/passcode-input/passcode-input.js +15 -8
- package/2x/es/components/picker-view/wheel.js +2 -0
- package/2x/es/components/rate/rate.css +4 -0
- package/2x/es/components/rate/rate.js +36 -13
- package/2x/es/components/result/result.d.ts +1 -1
- package/2x/es/components/result/result.js +6 -1
- package/2x/es/components/result-page/index.d.ts +7 -0
- package/2x/es/components/result-page/index.js +7 -0
- package/2x/es/components/result-page/result-page-card.d.ts +6 -0
- package/2x/es/components/result-page/result-page-card.js +9 -0
- package/2x/es/components/result-page/result-page.css +130 -0
- package/2x/es/components/result-page/result-page.d.ts +23 -0
- package/2x/es/components/result-page/result-page.js +83 -0
- package/2x/es/components/search-bar/search-bar.js +12 -2
- package/2x/es/components/swipe-action/swipe-action.d.ts +2 -0
- package/2x/es/components/swipe-action/swipe-action.js +34 -6
- package/2x/es/components/swiper/swiper.js +15 -1
- package/2x/es/index.d.ts +1 -0
- package/2x/es/index.js +1 -0
- package/2x/es/locales/base.d.ts +9 -0
- package/2x/es/locales/base.js +9 -0
- package/2x/es/locales/en-US.d.ts +9 -0
- package/2x/es/locales/es-ES.d.ts +9 -0
- package/2x/es/locales/fa-IR.d.ts +9 -0
- package/2x/es/locales/fr-FR.d.ts +9 -0
- package/2x/es/locales/id-ID.d.ts +9 -0
- package/2x/es/locales/id-ID.js +13 -0
- package/2x/es/locales/kk-KZ.d.ts +9 -0
- package/2x/es/locales/ko-KR.d.ts +9 -0
- package/2x/es/locales/zh-CN.d.ts +9 -0
- package/2x/es/locales/zh-CN.js +9 -0
- package/2x/es/locales/zh-HK.d.ts +9 -0
- package/2x/es/locales/zh-TW.d.ts +9 -0
- package/2x/es/utils/matrix.d.ts +10 -0
- package/2x/es/utils/matrix.js +27 -0
- package/2x/es/utils/use-resize-effect.js +3 -1
- package/2x/package.json +6 -6
- package/2x/umd/antd-mobile.js +25911 -2
- package/bundle/antd-mobile.cjs.js +47 -18976
- package/bundle/antd-mobile.compatible.umd.js +25911 -0
- package/bundle/antd-mobile.es.js +16358 -16685
- package/bundle/antd-mobile.umd.js +64 -0
- package/bundle/style.css +1 -4088
- package/cjs/components/action-sheet/action-sheet.d.ts +1 -1
- package/cjs/components/button/button.js +1 -1
- package/cjs/components/calendar/calendar.d.ts +1 -1
- package/cjs/components/cascader/cascader.d.ts +2 -0
- package/cjs/components/cascader/index.d.ts +1 -0
- package/cjs/components/cascader-view/cascader-view.d.ts +2 -1
- package/cjs/components/cascader-view/cascader-view.js +2 -1
- package/cjs/components/dialog/show.d.ts +1 -1
- package/cjs/components/form/context.d.ts +1 -1
- package/cjs/components/form/form-item.d.ts +1 -1
- package/cjs/components/form/form-item.js +3 -0
- package/cjs/components/image/test/image.test.js +57 -8
- package/cjs/components/image-viewer/slide.js +75 -56
- package/cjs/components/input/input.js +9 -2
- package/cjs/components/modal/show.d.ts +1 -1
- package/cjs/components/number-keyboard/number-keyboard.css +11 -14
- package/cjs/components/number-keyboard/number-keyboard.d.ts +1 -1
- package/cjs/components/number-keyboard/number-keyboard.js +19 -17
- package/cjs/components/passcode-input/index.d.ts +1 -1
- package/cjs/components/passcode-input/passcode-input.css +12 -12
- package/cjs/components/passcode-input/passcode-input.js +16 -8
- package/cjs/components/picker-view/wheel.js +2 -0
- package/cjs/components/rate/rate.css +4 -0
- package/cjs/components/rate/rate.js +42 -13
- package/cjs/components/result/result.d.ts +1 -1
- package/cjs/components/result/result.js +7 -1
- package/cjs/components/result-page/index.d.ts +7 -0
- package/cjs/components/result-page/index.js +20 -0
- package/cjs/components/result-page/result-page-card.d.ts +6 -0
- package/cjs/components/result-page/result-page-card.js +24 -0
- package/cjs/components/result-page/result-page.css +113 -0
- package/cjs/components/result-page/result-page.d.ts +23 -0
- package/cjs/components/result-page/result-page.js +108 -0
- package/cjs/components/search-bar/search-bar.js +12 -2
- package/cjs/components/swipe-action/swipe-action.d.ts +2 -0
- package/cjs/components/swipe-action/swipe-action.js +34 -6
- package/cjs/components/swiper/swiper.js +15 -1
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +8 -0
- package/cjs/locales/base.d.ts +9 -0
- package/cjs/locales/base.js +9 -0
- package/cjs/locales/en-US.d.ts +9 -0
- package/cjs/locales/es-ES.d.ts +9 -0
- package/cjs/locales/fa-IR.d.ts +9 -0
- package/cjs/locales/fr-FR.d.ts +9 -0
- package/cjs/locales/id-ID.d.ts +9 -0
- package/cjs/locales/id-ID.js +13 -0
- package/cjs/locales/kk-KZ.d.ts +9 -0
- package/cjs/locales/ko-KR.d.ts +9 -0
- package/cjs/locales/zh-CN.d.ts +9 -0
- package/cjs/locales/zh-CN.js +9 -0
- package/cjs/locales/zh-HK.d.ts +9 -0
- package/cjs/locales/zh-TW.d.ts +9 -0
- package/cjs/utils/matrix.d.ts +10 -0
- package/cjs/utils/matrix.js +60 -0
- package/cjs/utils/use-resize-effect.js +3 -1
- package/es/components/action-sheet/action-sheet.d.ts +1 -1
- package/es/components/button/button.js +1 -1
- package/es/components/calendar/calendar.d.ts +1 -1
- package/es/components/cascader/cascader.d.ts +2 -0
- package/es/components/cascader/index.d.ts +1 -0
- package/es/components/cascader-view/cascader-view.d.ts +2 -1
- package/es/components/cascader-view/cascader-view.js +2 -1
- package/es/components/dialog/show.d.ts +1 -1
- package/es/components/form/context.d.ts +1 -1
- package/es/components/form/form-item.d.ts +1 -1
- package/es/components/form/form-item.js +3 -0
- package/es/components/image/test/image.test.js +54 -8
- package/es/components/image-viewer/slide.js +73 -56
- package/es/components/input/input.js +8 -2
- package/es/components/modal/show.d.ts +1 -1
- package/es/components/number-keyboard/number-keyboard.css +11 -14
- package/es/components/number-keyboard/number-keyboard.d.ts +1 -1
- package/es/components/number-keyboard/number-keyboard.js +19 -17
- package/es/components/passcode-input/index.d.ts +1 -1
- package/es/components/passcode-input/passcode-input.css +12 -12
- package/es/components/passcode-input/passcode-input.js +15 -8
- package/es/components/picker-view/wheel.js +2 -0
- package/es/components/rate/rate.css +4 -0
- package/es/components/rate/rate.js +36 -13
- package/es/components/result/result.d.ts +1 -1
- package/es/components/result/result.js +6 -1
- package/es/components/result-page/index.d.ts +7 -0
- package/es/components/result-page/index.js +7 -0
- package/es/components/result-page/result-page-card.d.ts +6 -0
- package/es/components/result-page/result-page-card.js +9 -0
- package/es/components/result-page/result-page.css +113 -0
- package/es/components/result-page/result-page.d.ts +23 -0
- package/es/components/result-page/result-page.js +83 -0
- package/es/components/search-bar/search-bar.js +12 -2
- package/es/components/swipe-action/swipe-action.d.ts +2 -0
- package/es/components/swipe-action/swipe-action.js +34 -6
- package/es/components/swiper/swiper.js +15 -1
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/locales/base.d.ts +9 -0
- package/es/locales/base.js +9 -0
- package/es/locales/en-US.d.ts +9 -0
- package/es/locales/es-ES.d.ts +9 -0
- package/es/locales/fa-IR.d.ts +9 -0
- package/es/locales/fr-FR.d.ts +9 -0
- package/es/locales/id-ID.d.ts +9 -0
- package/es/locales/id-ID.js +13 -0
- package/es/locales/kk-KZ.d.ts +9 -0
- package/es/locales/ko-KR.d.ts +9 -0
- package/es/locales/zh-CN.d.ts +9 -0
- package/es/locales/zh-CN.js +9 -0
- package/es/locales/zh-HK.d.ts +9 -0
- package/es/locales/zh-TW.d.ts +9 -0
- package/es/utils/matrix.d.ts +10 -0
- package/es/utils/matrix.js +27 -0
- package/es/utils/use-resize-effect.js +3 -1
- package/package.json +6 -6
- package/umd/antd-mobile.js +1 -1
- package/2x/umd/antd-mobile.js.LICENSE.txt +0 -35
|
@@ -22,53 +22,53 @@
|
|
|
22
22
|
height: var(--cell-size);
|
|
23
23
|
background: var(--adm-color-background);
|
|
24
24
|
}
|
|
25
|
-
.adm-passcode-input:not(.seperated) {
|
|
25
|
+
.adm-passcode-input:not(.adm-passcode-input-seperated) {
|
|
26
26
|
border-radius: var(--border-radius);
|
|
27
27
|
overflow: hidden;
|
|
28
28
|
border: 1px solid var(--border-color);
|
|
29
29
|
}
|
|
30
|
-
.adm-passcode-input:not(.seperated) .adm-passcode-input-cell:not(:last-child) {
|
|
30
|
+
.adm-passcode-input:not(.adm-passcode-input-seperated) .adm-passcode-input-cell:not(:last-child) {
|
|
31
31
|
border-right: 1px solid var(--border-color);
|
|
32
32
|
}
|
|
33
|
-
.adm-passcode-input:not(.seperated).focused {
|
|
33
|
+
.adm-passcode-input:not(.adm-passcode-input-seperated).adm-passcode-input-focused {
|
|
34
34
|
border-color: var(--adm-color-primary);
|
|
35
35
|
box-shadow: 0 0 2px 0 var(--adm-color-primary);
|
|
36
36
|
outline: none;
|
|
37
37
|
}
|
|
38
|
-
.adm-passcode-input:not(.seperated).error {
|
|
38
|
+
.adm-passcode-input:not(.adm-passcode-input-seperated).adm-passcode-input-error {
|
|
39
39
|
border-color: var(--adm-color-danger);
|
|
40
40
|
box-shadow: 0 0 2px 0 var(--adm-color-danger);
|
|
41
41
|
animation: 100ms ease-in-out 0s 3 normal none running adm-shake-horizontal;
|
|
42
42
|
}
|
|
43
|
-
.adm-passcode-input.seperated .adm-passcode-input-cell {
|
|
43
|
+
.adm-passcode-input.adm-passcode-input-seperated .adm-passcode-input-cell {
|
|
44
44
|
border-radius: var(--border-radius);
|
|
45
45
|
border: 1px solid var(--border-color);
|
|
46
46
|
}
|
|
47
|
-
.adm-passcode-input.seperated .adm-passcode-input-cell:not(:last-child) {
|
|
47
|
+
.adm-passcode-input.adm-passcode-input-seperated .adm-passcode-input-cell:not(:last-child) {
|
|
48
48
|
margin-right: var(--cell-gap);
|
|
49
49
|
}
|
|
50
|
-
.adm-passcode-input.seperated .adm-passcode-input-cell
|
|
50
|
+
.adm-passcode-input.adm-passcode-input-seperated .adm-passcode-input-cell-focused {
|
|
51
51
|
border-color: var(--adm-color-primary);
|
|
52
52
|
box-shadow: 0 0 2px 0 var(--adm-color-primary);
|
|
53
53
|
}
|
|
54
|
-
.adm-passcode-input
|
|
54
|
+
.adm-passcode-input-seperated.adm-passcode-input-focused {
|
|
55
55
|
outline: none;
|
|
56
56
|
}
|
|
57
|
-
.adm-passcode-input.seperated.error {
|
|
57
|
+
.adm-passcode-input.adm-passcode-input-seperated.adm-passcode-input-error {
|
|
58
58
|
animation: 100ms ease-in-out 0s 3 normal none running adm-shake-horizontal;
|
|
59
59
|
}
|
|
60
|
-
.adm-passcode-input.seperated.error .adm-passcode-input-cell {
|
|
60
|
+
.adm-passcode-input.adm-passcode-input-seperated.adm-passcode-input-error .adm-passcode-input-cell {
|
|
61
61
|
border-color: var(--adm-color-danger);
|
|
62
62
|
box-shadow: 0 0 2px 0 var(--adm-color-danger);
|
|
63
63
|
}
|
|
64
|
-
.adm-passcode-input-cell
|
|
64
|
+
.adm-passcode-input-cell-dot::before {
|
|
65
65
|
content: '';
|
|
66
66
|
width: var(--dot-size);
|
|
67
67
|
height: var(--dot-size);
|
|
68
68
|
border-radius: 50%;
|
|
69
69
|
background: var(--adm-color-text);
|
|
70
70
|
}
|
|
71
|
-
.adm-passcode-input-cell
|
|
71
|
+
.adm-passcode-input-cell-caret::after {
|
|
72
72
|
content: '';
|
|
73
73
|
width: 2px;
|
|
74
74
|
height: 1.1em;
|
|
@@ -17,6 +17,8 @@ var _bound = require("../../utils/bound");
|
|
|
17
17
|
|
|
18
18
|
var _usePropsValue = require("../../utils/use-props-value");
|
|
19
19
|
|
|
20
|
+
var _configProvider = require("../config-provider");
|
|
21
|
+
|
|
20
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
23
|
|
|
22
24
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -36,6 +38,9 @@ const PasscodeInput = (0, _react.forwardRef)((p, ref) => {
|
|
|
36
38
|
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p); // 防止 length 值不合法
|
|
37
39
|
|
|
38
40
|
const cellLength = props.length > 0 && props.length < Infinity ? Math.floor(props.length) : defaultProps.length;
|
|
41
|
+
const {
|
|
42
|
+
locale
|
|
43
|
+
} = (0, _configProvider.useConfig)();
|
|
39
44
|
const [focused, setFocused] = (0, _react.useState)(false);
|
|
40
45
|
const [value, setValue] = (0, _usePropsValue.usePropsValue)(props);
|
|
41
46
|
const rootRef = (0, _react.useRef)(null);
|
|
@@ -106,9 +111,9 @@ const PasscodeInput = (0, _react.forwardRef)((p, ref) => {
|
|
|
106
111
|
for (let i = 0; i < cellLength; i++) {
|
|
107
112
|
cells.push(_react.default.createElement("div", {
|
|
108
113
|
className: (0, _classnames.default)(`${classPrefix}-cell`, {
|
|
109
|
-
caret: props.caret && caretIndex === i && focused,
|
|
110
|
-
focused: focusedIndex === i && focused,
|
|
111
|
-
dot: !props.plain && chars[i]
|
|
114
|
+
[`${classPrefix}-cell-caret`]: props.caret && caretIndex === i && focused,
|
|
115
|
+
[`${classPrefix}-cell-focused`]: focusedIndex === i && focused,
|
|
116
|
+
[`${classPrefix}-cell-dot`]: !props.plain && chars[i]
|
|
112
117
|
}),
|
|
113
118
|
key: i
|
|
114
119
|
}, chars[i] && props.plain ? chars[i] : ''));
|
|
@@ -118,16 +123,18 @@ const PasscodeInput = (0, _react.forwardRef)((p, ref) => {
|
|
|
118
123
|
};
|
|
119
124
|
|
|
120
125
|
const cls = (0, _classnames.default)(classPrefix, {
|
|
121
|
-
focused: focused,
|
|
122
|
-
error: props.error,
|
|
123
|
-
seperated: props.seperated
|
|
126
|
+
[`${classPrefix}-focused`]: focused,
|
|
127
|
+
[`${classPrefix}-error`]: props.error,
|
|
128
|
+
[`${classPrefix}-seperated`]: props.seperated
|
|
124
129
|
});
|
|
125
130
|
return _react.default.createElement(_react.default.Fragment, null, (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
126
131
|
ref: rootRef,
|
|
127
132
|
tabIndex: 0,
|
|
128
133
|
className: cls,
|
|
129
134
|
onFocus: onFocus,
|
|
130
|
-
onBlur: onBlur
|
|
135
|
+
onBlur: onBlur,
|
|
136
|
+
role: 'button',
|
|
137
|
+
"aria-label": locale.PasscodeInput.name
|
|
131
138
|
}, _react.default.createElement("div", {
|
|
132
139
|
className: `${classPrefix}-cell-container`
|
|
133
140
|
}, renderCells()), _react.default.createElement("input", {
|
|
@@ -139,7 +146,8 @@ const PasscodeInput = (0, _react.forwardRef)((p, ref) => {
|
|
|
139
146
|
inputMode: 'numeric',
|
|
140
147
|
onChange: e => {
|
|
141
148
|
setValue(e.target.value.slice(0, props.length));
|
|
142
|
-
}
|
|
149
|
+
},
|
|
150
|
+
"aria-hidden": true
|
|
143
151
|
}))), props.keyboard && _react.default.cloneElement(props.keyboard, {
|
|
144
152
|
visible: focused,
|
|
145
153
|
onInput: v => {
|
|
@@ -208,6 +208,8 @@ const Wheel = (0, _react.memo)(props => {
|
|
|
208
208
|
if (prev.index !== next.index) return false;
|
|
209
209
|
if (prev.value !== next.value) return false;
|
|
210
210
|
if (prev.onSelect !== next.onSelect) return false;
|
|
211
|
+
if (prev.renderLabel !== next.renderLabel) return false;
|
|
212
|
+
if (prev.mouseWheel !== next.mouseWheel) return false;
|
|
211
213
|
|
|
212
214
|
if (!(0, _isEqual.default)(prev.column, next.column)) {
|
|
213
215
|
return false;
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
--active-color: #ffd21e;
|
|
4
4
|
--inactive-color: var(--adm-color-border);
|
|
5
5
|
display: inline-flex;
|
|
6
|
+
touch-action: pan-y;
|
|
7
|
+
-webkit-user-select: none;
|
|
8
|
+
user-select: none;
|
|
6
9
|
}
|
|
7
10
|
.adm-rate-box {
|
|
8
11
|
position: relative;
|
|
@@ -16,6 +19,7 @@
|
|
|
16
19
|
overflow: hidden;
|
|
17
20
|
cursor: pointer;
|
|
18
21
|
box-sizing: border-box;
|
|
22
|
+
transition: all 0.3s;
|
|
19
23
|
}
|
|
20
24
|
.adm-rate-star-half {
|
|
21
25
|
padding-right: 0;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.Rate = void 0;
|
|
7
7
|
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
11
|
|
|
@@ -17,8 +17,16 @@ var _usePropsValue = require("../../utils/use-props-value");
|
|
|
17
17
|
|
|
18
18
|
var _star = require("./star");
|
|
19
19
|
|
|
20
|
+
var _react2 = require("@use-gesture/react");
|
|
21
|
+
|
|
22
|
+
var _bound = require("../../utils/bound");
|
|
23
|
+
|
|
20
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
25
|
|
|
26
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
|
+
|
|
28
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
|
+
|
|
22
30
|
const classPrefix = `adm-rate`;
|
|
23
31
|
const defaultProps = {
|
|
24
32
|
count: 5,
|
|
@@ -32,6 +40,7 @@ const defaultProps = {
|
|
|
32
40
|
const Rate = p => {
|
|
33
41
|
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
34
42
|
const [value, setValue] = (0, _usePropsValue.usePropsValue)(props);
|
|
43
|
+
const containerRef = (0, _react.useRef)(null);
|
|
35
44
|
const starList = Array(props.count).fill(null);
|
|
36
45
|
|
|
37
46
|
function renderStar(v, half) {
|
|
@@ -41,26 +50,46 @@ const Rate = p => {
|
|
|
41
50
|
[`${classPrefix}-star-half`]: half,
|
|
42
51
|
[`${classPrefix}-star-readonly`]: props.readOnly
|
|
43
52
|
}),
|
|
44
|
-
onClick: () => {
|
|
45
|
-
if (props.readOnly) return;
|
|
46
|
-
|
|
47
|
-
if (props.allowClear && value === v) {
|
|
48
|
-
setValue(0);
|
|
49
|
-
} else {
|
|
50
|
-
setValue(v);
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
53
|
role: 'radio',
|
|
54
54
|
"aria-checked": value >= v,
|
|
55
55
|
"aria-label": '' + v
|
|
56
56
|
}, props.character);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
const bind = (0, _react2.useDrag)(state => {
|
|
60
|
+
if (props.readOnly) return;
|
|
61
|
+
const {
|
|
62
|
+
xy: [clientX],
|
|
63
|
+
tap
|
|
64
|
+
} = state;
|
|
65
|
+
const container = containerRef.current;
|
|
66
|
+
if (!container) return;
|
|
67
|
+
const rect = container.getBoundingClientRect();
|
|
68
|
+
const rawValue = (clientX - rect.left) / rect.width * props.count;
|
|
69
|
+
const ceiledValue = props.allowHalf ? Math.ceil(rawValue * 2) / 2 : Math.ceil(rawValue);
|
|
70
|
+
const boundValue = (0, _bound.bound)(ceiledValue, 0, props.count);
|
|
71
|
+
|
|
72
|
+
if (tap) {
|
|
73
|
+
if (props.allowClear && boundValue === value) {
|
|
74
|
+
setValue(0);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
setValue(boundValue);
|
|
80
|
+
}, {
|
|
81
|
+
axis: 'x',
|
|
82
|
+
pointer: {
|
|
83
|
+
touch: true
|
|
84
|
+
},
|
|
85
|
+
filterTaps: true
|
|
86
|
+
});
|
|
87
|
+
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", Object.assign({
|
|
60
88
|
className: classPrefix,
|
|
61
89
|
role: 'radiogroup',
|
|
62
|
-
"aria-readonly": props.readOnly
|
|
63
|
-
|
|
90
|
+
"aria-readonly": props.readOnly,
|
|
91
|
+
ref: containerRef
|
|
92
|
+
}, bind()), starList.map((_, i) => _react.default.createElement("div", {
|
|
64
93
|
key: i,
|
|
65
94
|
className: (0, _classnames.default)(`${classPrefix}-box`)
|
|
66
95
|
}, props.allowHalf && renderStar(i + 0.5, true), renderStar(i + 1, false)))));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
export declare type ResultProps = {
|
|
4
|
-
status
|
|
4
|
+
status?: 'success' | 'error' | 'info' | 'waiting' | 'warning';
|
|
5
5
|
title: ReactNode;
|
|
6
6
|
description?: ReactNode;
|
|
7
7
|
icon?: ReactNode;
|
|
@@ -13,6 +13,8 @@ var _antdMobileIcons = require("antd-mobile-icons");
|
|
|
13
13
|
|
|
14
14
|
var _nativeProps = require("../../utils/native-props");
|
|
15
15
|
|
|
16
|
+
var _withDefaultProps = require("../../utils/with-default-props");
|
|
17
|
+
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
19
|
|
|
18
20
|
const classPrefix = `adm-result`;
|
|
@@ -23,8 +25,12 @@ const iconRecord = {
|
|
|
23
25
|
waiting: _antdMobileIcons.ClockCircleFill,
|
|
24
26
|
warning: _antdMobileIcons.ExclamationCircleFill
|
|
25
27
|
};
|
|
28
|
+
const defaultProps = {
|
|
29
|
+
status: 'info'
|
|
30
|
+
};
|
|
26
31
|
|
|
27
|
-
const Result =
|
|
32
|
+
const Result = p => {
|
|
33
|
+
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
28
34
|
const {
|
|
29
35
|
status,
|
|
30
36
|
title,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import './result-page.less';
|
|
3
|
+
export type { ResultPageProps } from './result-page';
|
|
4
|
+
declare const _default: import("react").FC<import("./result-page").ResultPageProps> & {
|
|
5
|
+
Card: import("react").FC<import("./result-page-card").ResultPageCardProps>;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
require("./result-page.css");
|
|
9
|
+
|
|
10
|
+
var _resultPage2 = require("./result-page");
|
|
11
|
+
|
|
12
|
+
var _attachPropertiesToComponent = require("../../utils/attach-properties-to-component");
|
|
13
|
+
|
|
14
|
+
var _resultPageCard = require("./result-page-card");
|
|
15
|
+
|
|
16
|
+
var _default = (0, _attachPropertiesToComponent.attachPropertiesToComponent)(_resultPage2.ResultPage, {
|
|
17
|
+
Card: _resultPageCard.ResultPageCard
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
exports.default = _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ResultPageCard = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _nativeProps = require("../../utils/native-props");
|
|
11
|
+
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
const classPrefix = `adm-result-page-card`;
|
|
17
|
+
|
|
18
|
+
const ResultPageCard = props => {
|
|
19
|
+
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement('div', {
|
|
20
|
+
className: (0, _classnames.default)(`${classPrefix}`)
|
|
21
|
+
}, props.children));
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
exports.ResultPageCard = ResultPageCard;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
.adm-result-page {
|
|
2
|
+
--background-color: var(--adm-color-primary);
|
|
3
|
+
position: relative;
|
|
4
|
+
background-color: var(--adm-color-box);
|
|
5
|
+
min-height: 100vh;
|
|
6
|
+
width: 100%;
|
|
7
|
+
}
|
|
8
|
+
.adm-result-page-header {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
background-color: transparent;
|
|
13
|
+
position: relative;
|
|
14
|
+
padding: 20px;
|
|
15
|
+
padding-bottom: 100px;
|
|
16
|
+
z-index: 1;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
}
|
|
19
|
+
.adm-result-page-icon {
|
|
20
|
+
color: var(--adm-color-background);
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
padding: 2px;
|
|
23
|
+
margin-bottom: 8px;
|
|
24
|
+
}
|
|
25
|
+
.adm-result-page-icon .antd-mobile-icon {
|
|
26
|
+
font-size: 32px;
|
|
27
|
+
}
|
|
28
|
+
.adm-result-page-title {
|
|
29
|
+
font-size: var(--adm-font-size-10);
|
|
30
|
+
color: var(--adm-color-background);
|
|
31
|
+
line-height: 1.4;
|
|
32
|
+
text-align: center;
|
|
33
|
+
}
|
|
34
|
+
.adm-result-page-description {
|
|
35
|
+
margin-top: 8px;
|
|
36
|
+
margin-bottom: 24px;
|
|
37
|
+
font-size: var(--adm-font-size-6);
|
|
38
|
+
color: rgba(255, 255, 255, 0.6);
|
|
39
|
+
line-height: 1.4;
|
|
40
|
+
text-align: center;
|
|
41
|
+
}
|
|
42
|
+
.adm-result-page-details {
|
|
43
|
+
width: 100%;
|
|
44
|
+
}
|
|
45
|
+
.adm-result-page-detail {
|
|
46
|
+
width: 100%;
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: row;
|
|
49
|
+
justify-content: space-between;
|
|
50
|
+
margin-bottom: 5px;
|
|
51
|
+
color: var(--adm-color-background);
|
|
52
|
+
font-size: var(--adm-font-size-6);
|
|
53
|
+
}
|
|
54
|
+
.adm-result-page-detail-bold {
|
|
55
|
+
font-weight: 600;
|
|
56
|
+
}
|
|
57
|
+
.adm-result-page-collapse {
|
|
58
|
+
opacity: 0.6;
|
|
59
|
+
width: 10px;
|
|
60
|
+
height: 10px;
|
|
61
|
+
margin: auto;
|
|
62
|
+
margin-bottom: 5px;
|
|
63
|
+
border-top: 2px solid var(--adm-color-background);
|
|
64
|
+
border-right: 2px solid var(--adm-color-background);
|
|
65
|
+
transform: rotate(135deg);
|
|
66
|
+
}
|
|
67
|
+
.adm-result-page-collapse-active {
|
|
68
|
+
transform: rotate(-45deg);
|
|
69
|
+
}
|
|
70
|
+
.adm-result-page-bgWrapper {
|
|
71
|
+
position: relative;
|
|
72
|
+
align-self: flex-start;
|
|
73
|
+
top: 54px;
|
|
74
|
+
}
|
|
75
|
+
.adm-result-page-bg {
|
|
76
|
+
--width: 440vw;
|
|
77
|
+
position: absolute;
|
|
78
|
+
height: var(--width);
|
|
79
|
+
width: var(--width);
|
|
80
|
+
left: calc((var(--width) - 100vw) * -1 / 2 - 20px);
|
|
81
|
+
top: calc(var(--width) * -1 + 1vw);
|
|
82
|
+
border-radius: 50%;
|
|
83
|
+
background-color: var(--background-color);
|
|
84
|
+
z-index: -1;
|
|
85
|
+
}
|
|
86
|
+
.adm-result-page-content {
|
|
87
|
+
position: relative;
|
|
88
|
+
padding: 12px;
|
|
89
|
+
top: -104px;
|
|
90
|
+
z-index: 2;
|
|
91
|
+
}
|
|
92
|
+
.adm-result-page-footer {
|
|
93
|
+
position: fixed;
|
|
94
|
+
bottom: 0;
|
|
95
|
+
width: 100%;
|
|
96
|
+
padding: 12px;
|
|
97
|
+
padding-bottom: 24px;
|
|
98
|
+
display: flex;
|
|
99
|
+
justify-content: center;
|
|
100
|
+
background-color: var(--adm-color-box);
|
|
101
|
+
z-index: 3;
|
|
102
|
+
}
|
|
103
|
+
.adm-result-page-footer-btn {
|
|
104
|
+
flex: 1;
|
|
105
|
+
max-width: calc((100vw - 36px) / 2);
|
|
106
|
+
}
|
|
107
|
+
.adm-result-page-footer-space {
|
|
108
|
+
width: 12px;
|
|
109
|
+
}
|
|
110
|
+
.adm-result-page-card {
|
|
111
|
+
border-radius: 8px;
|
|
112
|
+
background-color: var(--adm-color-background);
|
|
113
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { FC, ReactNode } from 'react';
|
|
2
|
+
import { NativeProps } from '../../utils/native-props';
|
|
3
|
+
interface ResultPageDetail {
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
value: ReactNode;
|
|
6
|
+
bold?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare type ResultPageDetails = ResultPageDetail[];
|
|
9
|
+
declare type OnClick = (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void | Promise<void> | unknown;
|
|
10
|
+
export declare type ResultPageProps = {
|
|
11
|
+
status?: 'success' | 'error' | 'info' | 'waiting' | 'warning';
|
|
12
|
+
title: ReactNode;
|
|
13
|
+
description?: ReactNode;
|
|
14
|
+
icon?: ReactNode;
|
|
15
|
+
details?: ResultPageDetails;
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
primaryButtonText?: ReactNode;
|
|
18
|
+
secondaryButtonText?: ReactNode;
|
|
19
|
+
onPrimaryButtonClick?: OnClick;
|
|
20
|
+
onSecondaryButtonClick?: OnClick;
|
|
21
|
+
} & NativeProps<'--background-color'>;
|
|
22
|
+
export declare const ResultPage: FC<ResultPageProps>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ResultPage = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _antdMobileIcons = require("antd-mobile-icons");
|
|
11
|
+
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
var _nativeProps = require("../../utils/native-props");
|
|
15
|
+
|
|
16
|
+
var _withDefaultProps = require("../../utils/with-default-props");
|
|
17
|
+
|
|
18
|
+
var _isNodeWithContent = require("../../utils/is-node-with-content");
|
|
19
|
+
|
|
20
|
+
var _button = _interopRequireDefault(require("../button"));
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
|
|
24
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
|
+
|
|
26
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
+
|
|
28
|
+
const classPrefix = `adm-result-page`;
|
|
29
|
+
const iconRecord = {
|
|
30
|
+
success: _antdMobileIcons.CheckCircleFill,
|
|
31
|
+
error: _antdMobileIcons.CloseCircleFill,
|
|
32
|
+
info: _antdMobileIcons.InformationCircleFill,
|
|
33
|
+
waiting: _antdMobileIcons.ClockCircleFill,
|
|
34
|
+
warning: _antdMobileIcons.ExclamationCircleFill
|
|
35
|
+
};
|
|
36
|
+
const defaultProps = {
|
|
37
|
+
status: 'info',
|
|
38
|
+
details: []
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const ResultPage = p => {
|
|
42
|
+
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
43
|
+
const {
|
|
44
|
+
status,
|
|
45
|
+
title,
|
|
46
|
+
description,
|
|
47
|
+
details,
|
|
48
|
+
icon,
|
|
49
|
+
primaryButtonText,
|
|
50
|
+
secondaryButtonText,
|
|
51
|
+
onPrimaryButtonClick,
|
|
52
|
+
onSecondaryButtonClick
|
|
53
|
+
} = props;
|
|
54
|
+
|
|
55
|
+
const resultIcon = icon || _react.default.createElement(iconRecord[status]);
|
|
56
|
+
|
|
57
|
+
const [collapse, setCollapse] = (0, _react.useState)(true);
|
|
58
|
+
const showSecondaryButton = (0, _isNodeWithContent.isNodeWithContent)(secondaryButtonText);
|
|
59
|
+
const showPrimaryButton = (0, _isNodeWithContent.isNodeWithContent)(primaryButtonText);
|
|
60
|
+
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
61
|
+
className: classPrefix
|
|
62
|
+
}, _react.default.createElement("div", {
|
|
63
|
+
className: `${classPrefix}-header`
|
|
64
|
+
}, _react.default.createElement("div", {
|
|
65
|
+
className: `${classPrefix}-icon`
|
|
66
|
+
}, resultIcon), _react.default.createElement("div", {
|
|
67
|
+
className: `${classPrefix}-title`
|
|
68
|
+
}, title), (0, _isNodeWithContent.isNodeWithContent)(description) ? _react.default.createElement("div", {
|
|
69
|
+
className: `${classPrefix}-description`
|
|
70
|
+
}, description) : null, details.length ? _react.default.createElement("div", {
|
|
71
|
+
className: `${classPrefix}-details`
|
|
72
|
+
}, (collapse ? details.slice(0, 3) : details).map((detail, index) => {
|
|
73
|
+
return _react.default.createElement("div", {
|
|
74
|
+
className: (0, _classnames.default)(`${classPrefix}-detail`, detail.bold && `${classPrefix}-detail-bold`),
|
|
75
|
+
key: index
|
|
76
|
+
}, _react.default.createElement("span", null, detail.label), _react.default.createElement("span", null, detail.value));
|
|
77
|
+
}), details.length > 3 && _react.default.createElement("div", {
|
|
78
|
+
onClick: () => setCollapse(prev => !prev)
|
|
79
|
+
}, _react.default.createElement("div", {
|
|
80
|
+
className: (0, _classnames.default)(`${classPrefix}-collapse`, !collapse && `${classPrefix}-collapse-active`)
|
|
81
|
+
}))) : null, _react.default.createElement("div", {
|
|
82
|
+
className: `${classPrefix}-bgWrapper`
|
|
83
|
+
}, _react.default.createElement("div", {
|
|
84
|
+
className: `${classPrefix}-bg`
|
|
85
|
+
}))), _react.default.createElement("div", {
|
|
86
|
+
className: `${classPrefix}-content`
|
|
87
|
+
}, props.children), _react.default.createElement("div", {
|
|
88
|
+
className: `${classPrefix}-footer`
|
|
89
|
+
}, showSecondaryButton && _react.default.createElement(_button.default, {
|
|
90
|
+
block: true,
|
|
91
|
+
color: 'default',
|
|
92
|
+
fill: 'solid',
|
|
93
|
+
size: 'large',
|
|
94
|
+
onClick: onSecondaryButtonClick,
|
|
95
|
+
className: `${classPrefix}-footer-btn`
|
|
96
|
+
}, secondaryButtonText), showPrimaryButton && showSecondaryButton && _react.default.createElement("div", {
|
|
97
|
+
className: `${classPrefix}-footer-space`
|
|
98
|
+
}), showPrimaryButton && _react.default.createElement(_button.default, {
|
|
99
|
+
block: true,
|
|
100
|
+
color: 'primary',
|
|
101
|
+
fill: 'solid',
|
|
102
|
+
size: 'large',
|
|
103
|
+
onClick: onPrimaryButtonClick,
|
|
104
|
+
className: `${classPrefix}-footer-btn`
|
|
105
|
+
}, primaryButtonText))));
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
exports.ResultPage = ResultPage;
|
|
@@ -48,6 +48,7 @@ const SearchBar = (0, _react.forwardRef)((p, ref) => {
|
|
|
48
48
|
const [value, setValue] = (0, _usePropsValue.usePropsValue)(props);
|
|
49
49
|
const [hasFocus, setHasFocus] = (0, _react.useState)(false);
|
|
50
50
|
const inputRef = (0, _react.useRef)(null);
|
|
51
|
+
const composingRef = (0, _react.useRef)(false);
|
|
51
52
|
(0, _react.useImperativeHandle)(ref, () => ({
|
|
52
53
|
clear: () => {
|
|
53
54
|
var _a;
|
|
@@ -140,8 +141,17 @@ const SearchBar = (0, _react.forwardRef)((p, ref) => {
|
|
|
140
141
|
onEnterPress: () => {
|
|
141
142
|
var _a, _b;
|
|
142
143
|
|
|
143
|
-
(
|
|
144
|
-
|
|
144
|
+
if (!composingRef.current) {
|
|
145
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
146
|
+
(_b = props.onSearch) === null || _b === void 0 ? void 0 : _b.call(props, value);
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
"aria-label": locale.SearchBar.name,
|
|
150
|
+
onCompositionStart: () => {
|
|
151
|
+
composingRef.current = true;
|
|
152
|
+
},
|
|
153
|
+
onCompositionEnd: () => {
|
|
154
|
+
composingRef.current = false;
|
|
145
155
|
}
|
|
146
156
|
})), renderCancelButton()));
|
|
147
157
|
});
|
|
@@ -20,6 +20,7 @@ export declare type SwipeActionProps = {
|
|
|
20
20
|
closeOnAction?: boolean;
|
|
21
21
|
children: ReactNode;
|
|
22
22
|
stopPropagation?: PropagationEvent[];
|
|
23
|
+
onActionsReveal?: (side: 'left' | 'right') => void;
|
|
23
24
|
} & NativeProps<'--background'>;
|
|
24
25
|
export declare const SwipeAction: React.ForwardRefExoticComponent<{
|
|
25
26
|
rightActions?: Action[] | undefined;
|
|
@@ -29,6 +30,7 @@ export declare const SwipeAction: React.ForwardRefExoticComponent<{
|
|
|
29
30
|
closeOnAction?: boolean | undefined;
|
|
30
31
|
children: ReactNode;
|
|
31
32
|
stopPropagation?: "click"[] | undefined;
|
|
33
|
+
onActionsReveal?: ((side: 'left' | 'right') => void) | undefined;
|
|
32
34
|
} & {
|
|
33
35
|
className?: string | undefined;
|
|
34
36
|
style?: (React.CSSProperties & Partial<Record<"--background", string>>) | undefined;
|