@arco-design/mobile-react 2.20.0 → 2.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/CHANGELOG.md +30 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/avatar/index.d.ts +1 -1
- package/cjs/avatar/index.js +1 -1
- package/cjs/badge/index.d.ts +1 -1
- package/cjs/badge/index.js +1 -1
- package/cjs/carousel/index.d.ts +1 -1
- package/cjs/carousel/index.js +1 -1
- package/cjs/cell/index.d.ts +1 -1
- package/cjs/cell/index.js +1 -1
- package/cjs/checkbox/index.d.ts +1 -1
- package/cjs/checkbox/index.js +1 -1
- package/cjs/collapse/index.d.ts +1 -1
- package/cjs/collapse/index.js +1 -1
- package/cjs/count-down/index.d.ts +1 -1
- package/cjs/count-down/index.js +1 -1
- package/cjs/date-picker/index.d.ts +1 -1
- package/cjs/date-picker/index.js +1 -1
- package/cjs/dropdown/dropdown.js +36 -20
- package/cjs/dropdown/style/css/index.css +3 -0
- package/cjs/dropdown/style/index.less +2 -0
- package/cjs/ellipsis/index.d.ts +1 -1
- package/cjs/ellipsis/index.js +1 -1
- package/cjs/image/index.d.ts +1 -1
- package/cjs/image/index.js +1 -1
- package/cjs/image-picker/index.d.ts +4 -175
- package/cjs/image-picker/index.js +41 -18
- package/cjs/image-picker/type.d.ts +174 -0
- package/cjs/image-picker/type.js +3 -0
- package/cjs/image-preview/index.d.ts +1 -1
- package/cjs/image-preview/index.js +1 -1
- package/cjs/index.d.ts +2 -0
- package/cjs/index.js +9 -1
- package/cjs/input/hooks.js +49 -8
- package/cjs/input/index.d.ts +1 -1
- package/cjs/input/index.js +1 -1
- package/cjs/input/props.d.ts +8 -2
- package/cjs/notice-bar/index.d.ts +1 -1
- package/cjs/notice-bar/index.js +1 -1
- package/cjs/picker/index.d.ts +1 -1
- package/cjs/picker/index.js +1 -1
- package/cjs/picker-view/index.d.ts +1 -1
- package/cjs/picker-view/index.js +1 -1
- package/cjs/popover/index.d.ts +1 -1
- package/cjs/popover/index.js +1 -1
- package/cjs/popup-swiper/index.js +3 -2
- package/cjs/radio/index.d.ts +1 -1
- package/cjs/radio/index.js +1 -1
- package/cjs/rate/index.d.ts +1 -1
- package/cjs/rate/index.js +1 -1
- package/cjs/search-bar/association.d.ts +3 -0
- package/cjs/search-bar/association.js +92 -0
- package/cjs/search-bar/cancel-button.d.ts +10 -0
- package/cjs/search-bar/cancel-button.js +41 -0
- package/cjs/search-bar/demo/style/css/mobile.css +5 -0
- package/cjs/search-bar/demo/style/mobile.less +9 -0
- package/cjs/search-bar/highlight.d.ts +12 -0
- package/cjs/search-bar/highlight.js +77 -0
- package/cjs/search-bar/index.d.ts +13 -0
- package/cjs/search-bar/index.js +239 -0
- package/cjs/search-bar/style/css/index.css +148 -0
- package/cjs/search-bar/style/css/index.d.ts +2 -0
- package/cjs/search-bar/style/css/index.js +5 -0
- package/cjs/search-bar/style/index.d.ts +2 -0
- package/cjs/search-bar/style/index.js +5 -0
- package/cjs/search-bar/style/index.less +111 -0
- package/cjs/search-bar/type.d.ts +163 -0
- package/cjs/search-bar/type.js +3 -0
- package/cjs/slider/index.d.ts +1 -1
- package/cjs/slider/index.js +1 -1
- package/cjs/steps/index.d.ts +1 -1
- package/cjs/steps/index.js +1 -1
- package/cjs/sticky/index.d.ts +1 -1
- package/cjs/style.d.ts +2 -0
- package/cjs/style.js +4 -0
- package/cjs/swipe-action/demo/style/css/mobile.css +5 -0
- package/cjs/swipe-action/demo/style/mobile.less +9 -0
- package/cjs/swipe-action/index.d.ts +12 -0
- package/cjs/swipe-action/index.js +339 -0
- package/cjs/swipe-action/item.d.ts +11 -0
- package/cjs/swipe-action/item.js +52 -0
- package/cjs/swipe-action/style/css/index.css +88 -0
- package/cjs/swipe-action/style/css/index.d.ts +2 -0
- package/cjs/swipe-action/style/css/index.js +5 -0
- package/cjs/swipe-action/style/index.d.ts +2 -0
- package/cjs/swipe-action/style/index.js +5 -0
- package/cjs/swipe-action/style/index.less +89 -0
- package/cjs/swipe-action/type.d.ts +123 -0
- package/cjs/swipe-action/type.js +3 -0
- package/cjs/switch/index.d.ts +1 -1
- package/cjs/switch/index.js +1 -1
- package/cjs/tabs/tab-pane.js +5 -1
- package/cjs/tag/index.d.ts +1 -1
- package/cjs/tag/index.js +1 -1
- package/cjs/textarea/index.d.ts +1 -1
- package/cjs/textarea/index.js +1 -1
- package/dist/index.js +7450 -6611
- package/dist/index.min.js +6 -6
- package/dist/style.css +203 -0
- package/dist/style.min.css +1 -1
- package/esm/avatar/index.d.ts +1 -1
- package/esm/avatar/index.js +1 -1
- package/esm/badge/index.d.ts +1 -1
- package/esm/badge/index.js +1 -1
- package/esm/carousel/index.d.ts +1 -1
- package/esm/carousel/index.js +1 -1
- package/esm/cell/index.d.ts +1 -1
- package/esm/cell/index.js +1 -1
- package/esm/checkbox/index.d.ts +1 -1
- package/esm/checkbox/index.js +1 -1
- package/esm/collapse/index.d.ts +1 -1
- package/esm/collapse/index.js +1 -1
- package/esm/count-down/index.d.ts +1 -1
- package/esm/count-down/index.js +1 -1
- package/esm/date-picker/index.d.ts +1 -1
- package/esm/date-picker/index.js +1 -1
- package/esm/dropdown/dropdown.js +36 -20
- package/esm/dropdown/style/css/index.css +3 -0
- package/esm/dropdown/style/index.less +2 -0
- package/esm/ellipsis/index.d.ts +1 -1
- package/esm/ellipsis/index.js +1 -1
- package/esm/image/index.d.ts +1 -1
- package/esm/image/index.js +1 -1
- package/esm/image-picker/index.d.ts +4 -175
- package/esm/image-picker/index.js +30 -17
- package/esm/image-picker/type.d.ts +174 -0
- package/esm/image-picker/type.js +1 -0
- package/esm/image-preview/index.d.ts +1 -1
- package/esm/image-preview/index.js +1 -1
- package/esm/index.d.ts +2 -0
- package/esm/index.js +2 -0
- package/esm/input/hooks.js +49 -8
- package/esm/input/index.d.ts +1 -1
- package/esm/input/index.js +1 -1
- package/esm/input/props.d.ts +8 -2
- package/esm/notice-bar/index.d.ts +1 -1
- package/esm/notice-bar/index.js +1 -1
- package/esm/picker/index.d.ts +1 -1
- package/esm/picker/index.js +1 -1
- package/esm/picker-view/index.d.ts +1 -1
- package/esm/picker-view/index.js +1 -1
- package/esm/popover/index.d.ts +1 -1
- package/esm/popover/index.js +1 -1
- package/esm/popup-swiper/index.js +3 -2
- package/esm/radio/index.d.ts +1 -1
- package/esm/radio/index.js +1 -1
- package/esm/rate/index.d.ts +1 -1
- package/esm/rate/index.js +1 -1
- package/esm/search-bar/association.d.ts +3 -0
- package/esm/search-bar/association.js +82 -0
- package/esm/search-bar/cancel-button.d.ts +10 -0
- package/esm/search-bar/cancel-button.js +30 -0
- package/esm/search-bar/demo/style/css/mobile.css +5 -0
- package/esm/search-bar/demo/style/mobile.less +9 -0
- package/esm/search-bar/highlight.d.ts +12 -0
- package/esm/search-bar/highlight.js +66 -0
- package/esm/search-bar/index.d.ts +13 -0
- package/esm/search-bar/index.js +213 -0
- package/esm/search-bar/style/css/index.css +148 -0
- package/esm/search-bar/style/css/index.d.ts +2 -0
- package/esm/search-bar/style/css/index.js +2 -0
- package/esm/search-bar/style/index.d.ts +2 -0
- package/esm/search-bar/style/index.js +2 -0
- package/esm/search-bar/style/index.less +111 -0
- package/esm/search-bar/type.d.ts +163 -0
- package/esm/search-bar/type.js +1 -0
- package/esm/slider/index.d.ts +1 -1
- package/esm/slider/index.js +1 -1
- package/esm/steps/index.d.ts +1 -1
- package/esm/steps/index.js +1 -1
- package/esm/sticky/index.d.ts +1 -1
- package/esm/style.d.ts +2 -0
- package/esm/style.js +2 -0
- package/esm/swipe-action/demo/style/css/mobile.css +5 -0
- package/esm/swipe-action/demo/style/mobile.less +9 -0
- package/esm/swipe-action/index.d.ts +12 -0
- package/esm/swipe-action/index.js +321 -0
- package/esm/swipe-action/item.d.ts +11 -0
- package/esm/swipe-action/item.js +42 -0
- package/esm/swipe-action/style/css/index.css +88 -0
- package/esm/swipe-action/style/css/index.d.ts +2 -0
- package/esm/swipe-action/style/css/index.js +2 -0
- package/esm/swipe-action/style/index.d.ts +2 -0
- package/esm/swipe-action/style/index.js +2 -0
- package/esm/swipe-action/style/index.less +89 -0
- package/esm/swipe-action/type.d.ts +123 -0
- package/esm/swipe-action/type.js +1 -0
- package/esm/switch/index.d.ts +1 -1
- package/esm/switch/index.js +1 -1
- package/esm/tabs/tab-pane.js +5 -1
- package/esm/tag/index.d.ts +1 -1
- package/esm/tag/index.js +1 -1
- package/esm/textarea/index.d.ts +1 -1
- package/esm/textarea/index.js +1 -1
- package/package.json +3 -3
- package/tokens/app/arcodesign/default/css-variables.less +34 -0
- package/tokens/app/arcodesign/default/index.d.ts +34 -0
- package/tokens/app/arcodesign/default/index.js +34 -0
- package/tokens/app/arcodesign/default/index.json +398 -0
- package/tokens/app/arcodesign/default/index.less +34 -0
- package/umd/avatar/index.d.ts +1 -1
- package/umd/avatar/index.js +1 -1
- package/umd/badge/index.d.ts +1 -1
- package/umd/badge/index.js +1 -1
- package/umd/carousel/index.d.ts +1 -1
- package/umd/carousel/index.js +1 -1
- package/umd/cell/index.d.ts +1 -1
- package/umd/cell/index.js +1 -1
- package/umd/checkbox/index.d.ts +1 -1
- package/umd/checkbox/index.js +1 -1
- package/umd/collapse/index.d.ts +1 -1
- package/umd/collapse/index.js +1 -1
- package/umd/count-down/index.d.ts +1 -1
- package/umd/count-down/index.js +1 -1
- package/umd/date-picker/index.d.ts +1 -1
- package/umd/date-picker/index.js +1 -1
- package/umd/dropdown/dropdown.js +36 -20
- package/umd/dropdown/style/css/index.css +3 -0
- package/umd/dropdown/style/index.less +2 -0
- package/umd/ellipsis/index.d.ts +1 -1
- package/umd/ellipsis/index.js +1 -1
- package/umd/image/index.d.ts +1 -1
- package/umd/image/index.js +1 -1
- package/umd/image-picker/index.d.ts +4 -175
- package/umd/image-picker/index.js +40 -22
- package/umd/image-picker/type.d.ts +174 -0
- package/umd/image-picker/type.js +17 -0
- package/umd/image-preview/index.d.ts +1 -1
- package/umd/image-preview/index.js +1 -1
- package/umd/index.d.ts +2 -0
- package/umd/index.js +9 -5
- package/umd/input/hooks.js +48 -7
- package/umd/input/index.d.ts +1 -1
- package/umd/input/index.js +1 -1
- package/umd/input/props.d.ts +8 -2
- package/umd/notice-bar/index.d.ts +1 -1
- package/umd/notice-bar/index.js +1 -1
- package/umd/picker/index.d.ts +1 -1
- package/umd/picker/index.js +1 -1
- package/umd/picker-view/index.d.ts +1 -1
- package/umd/picker-view/index.js +1 -1
- package/umd/popover/index.d.ts +1 -1
- package/umd/popover/index.js +1 -1
- package/umd/popup-swiper/index.js +3 -2
- package/umd/radio/index.d.ts +1 -1
- package/umd/radio/index.js +1 -1
- package/umd/rate/index.d.ts +1 -1
- package/umd/rate/index.js +1 -1
- package/umd/search-bar/association.d.ts +3 -0
- package/umd/search-bar/association.js +101 -0
- package/umd/search-bar/cancel-button.d.ts +10 -0
- package/umd/search-bar/cancel-button.js +52 -0
- package/umd/search-bar/demo/style/css/mobile.css +5 -0
- package/umd/search-bar/demo/style/mobile.less +9 -0
- package/umd/search-bar/highlight.d.ts +12 -0
- package/umd/search-bar/highlight.js +87 -0
- package/umd/search-bar/index.d.ts +13 -0
- package/umd/search-bar/index.js +235 -0
- package/umd/search-bar/style/css/index.css +148 -0
- package/umd/search-bar/style/css/index.d.ts +2 -0
- package/umd/search-bar/style/css/index.js +15 -0
- package/umd/search-bar/style/index.d.ts +2 -0
- package/umd/search-bar/style/index.js +15 -0
- package/umd/search-bar/style/index.less +111 -0
- package/umd/search-bar/type.d.ts +163 -0
- package/umd/search-bar/type.js +17 -0
- package/umd/slider/index.d.ts +1 -1
- package/umd/slider/index.js +1 -1
- package/umd/steps/index.d.ts +1 -1
- package/umd/steps/index.js +1 -1
- package/umd/sticky/index.d.ts +1 -1
- package/umd/style.d.ts +2 -0
- package/umd/style.js +4 -4
- package/umd/swipe-action/demo/style/css/mobile.css +5 -0
- package/umd/swipe-action/demo/style/mobile.less +9 -0
- package/umd/swipe-action/index.d.ts +12 -0
- package/umd/swipe-action/index.js +342 -0
- package/umd/swipe-action/item.d.ts +11 -0
- package/umd/swipe-action/item.js +62 -0
- package/umd/swipe-action/style/css/index.css +88 -0
- package/umd/swipe-action/style/css/index.d.ts +2 -0
- package/umd/swipe-action/style/css/index.js +15 -0
- package/umd/swipe-action/style/index.d.ts +2 -0
- package/umd/swipe-action/style/index.js +15 -0
- package/umd/swipe-action/style/index.less +89 -0
- package/umd/swipe-action/type.d.ts +123 -0
- package/umd/swipe-action/type.js +17 -0
- package/umd/switch/index.d.ts +1 -1
- package/umd/switch/index.js +1 -1
- package/umd/tabs/tab-pane.js +5 -1
- package/umd/tag/index.d.ts +1 -1
- package/umd/tag/index.js +1 -1
- package/umd/textarea/index.d.ts +1 -1
- package/umd/textarea/index.js +1 -1
@@ -0,0 +1,17 @@
|
|
1
|
+
(function (global, factory) {
|
2
|
+
if (typeof define === "function" && define.amd) {
|
3
|
+
define(["exports"], factory);
|
4
|
+
} else if (typeof exports !== "undefined") {
|
5
|
+
factory(exports);
|
6
|
+
} else {
|
7
|
+
var mod = {
|
8
|
+
exports: {}
|
9
|
+
};
|
10
|
+
factory(mod.exports);
|
11
|
+
global.type = mod.exports;
|
12
|
+
}
|
13
|
+
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports) {
|
14
|
+
"use strict";
|
15
|
+
|
16
|
+
_exports.__esModule = true;
|
17
|
+
});
|
@@ -280,7 +280,7 @@ declare const _default: React.ForwardRefExoticComponent<ImagePreviewProps & Reac
|
|
280
280
|
/**
|
281
281
|
* 图片预览组件,支持循环轮播、双指/双击缩放、缩略图放大效果。
|
282
282
|
* @en The image preview, supports circular rotation, two-finger/double-tap zoom, and thumbnail zoom effects.
|
283
|
-
* @type
|
283
|
+
* @type 信息展示
|
284
284
|
* @type_en Data Display
|
285
285
|
* @name 图片预览
|
286
286
|
* @name_en ImagePreview
|
@@ -1012,7 +1012,7 @@
|
|
1012
1012
|
/**
|
1013
1013
|
* 图片预览组件,支持循环轮播、双指/双击缩放、缩略图放大效果。
|
1014
1014
|
* @en The image preview, supports circular rotation, two-finger/double-tap zoom, and thumbnail zoom effects.
|
1015
|
-
* @type
|
1015
|
+
* @type 信息展示
|
1016
1016
|
* @type_en Data Display
|
1017
1017
|
* @name 图片预览
|
1018
1018
|
* @name_en ImagePreview
|
package/umd/index.d.ts
CHANGED
@@ -41,8 +41,10 @@ export { default as PullRefresh } from './pull-refresh';
|
|
41
41
|
export { default as Radio } from './radio';
|
42
42
|
export { default as Rate } from './rate';
|
43
43
|
export { default as Slider } from './slider';
|
44
|
+
export { default as SearchBar } from './search-bar';
|
44
45
|
export { default as Steps } from './steps';
|
45
46
|
export { default as Sticky } from './sticky';
|
47
|
+
export { default as SwipeAction } from './swipe-action';
|
46
48
|
export { default as SwipeLoad } from './swipe-load';
|
47
49
|
export { default as TabBar } from './tab-bar';
|
48
50
|
export { default as Tag } from './tag';
|
package/umd/index.js
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
(function (global, factory) {
|
2
2
|
if (typeof define === "function" && define.amd) {
|
3
|
-
define(["exports", "./action-sheet", "./cell", "./loading", "./badge", "./avatar", "./button", "./carousel", "./toast", "./switch", "./checkbox", "./circle-progress", "./collapse", "./tabs", "./context-provider", "./dialog", "./count-down", "./date-picker", "./dropdown", "./dropdown-menu", "./ellipsis", "./grid", "./image", "./show-monitor", "./image-picker", "./image-preview", "./input", "./load-more", "./masking", "./nav-bar", "./notice-bar", "./notify", "./pagination", "./picker", "./picker-view", "./popover", "./popup", "./popup-swiper", "./portal", "./progress", "./pull-refresh", "./radio", "./rate", "./slider", "./steps", "./sticky", "./swipe-load", "./tab-bar", "./tag", "./textarea", "./transition"], factory);
|
3
|
+
define(["exports", "./action-sheet", "./cell", "./loading", "./badge", "./avatar", "./button", "./carousel", "./toast", "./switch", "./checkbox", "./circle-progress", "./collapse", "./tabs", "./context-provider", "./dialog", "./count-down", "./date-picker", "./dropdown", "./dropdown-menu", "./ellipsis", "./grid", "./image", "./show-monitor", "./image-picker", "./image-preview", "./input", "./load-more", "./masking", "./nav-bar", "./notice-bar", "./notify", "./pagination", "./picker", "./picker-view", "./popover", "./popup", "./popup-swiper", "./portal", "./progress", "./pull-refresh", "./radio", "./rate", "./slider", "./search-bar", "./steps", "./sticky", "./swipe-action", "./swipe-load", "./tab-bar", "./tag", "./textarea", "./transition"], factory);
|
4
4
|
} else if (typeof exports !== "undefined") {
|
5
|
-
factory(exports, require("./action-sheet"), require("./cell"), require("./loading"), require("./badge"), require("./avatar"), require("./button"), require("./carousel"), require("./toast"), require("./switch"), require("./checkbox"), require("./circle-progress"), require("./collapse"), require("./tabs"), require("./context-provider"), require("./dialog"), require("./count-down"), require("./date-picker"), require("./dropdown"), require("./dropdown-menu"), require("./ellipsis"), require("./grid"), require("./image"), require("./show-monitor"), require("./image-picker"), require("./image-preview"), require("./input"), require("./load-more"), require("./masking"), require("./nav-bar"), require("./notice-bar"), require("./notify"), require("./pagination"), require("./picker"), require("./picker-view"), require("./popover"), require("./popup"), require("./popup-swiper"), require("./portal"), require("./progress"), require("./pull-refresh"), require("./radio"), require("./rate"), require("./slider"), require("./steps"), require("./sticky"), require("./swipe-load"), require("./tab-bar"), require("./tag"), require("./textarea"), require("./transition"));
|
5
|
+
factory(exports, require("./action-sheet"), require("./cell"), require("./loading"), require("./badge"), require("./avatar"), require("./button"), require("./carousel"), require("./toast"), require("./switch"), require("./checkbox"), require("./circle-progress"), require("./collapse"), require("./tabs"), require("./context-provider"), require("./dialog"), require("./count-down"), require("./date-picker"), require("./dropdown"), require("./dropdown-menu"), require("./ellipsis"), require("./grid"), require("./image"), require("./show-monitor"), require("./image-picker"), require("./image-preview"), require("./input"), require("./load-more"), require("./masking"), require("./nav-bar"), require("./notice-bar"), require("./notify"), require("./pagination"), require("./picker"), require("./picker-view"), require("./popover"), require("./popup"), require("./popup-swiper"), require("./portal"), require("./progress"), require("./pull-refresh"), require("./radio"), require("./rate"), require("./slider"), require("./search-bar"), require("./steps"), require("./sticky"), require("./swipe-action"), require("./swipe-load"), require("./tab-bar"), require("./tag"), require("./textarea"), require("./transition"));
|
6
6
|
} else {
|
7
7
|
var mod = {
|
8
8
|
exports: {}
|
9
9
|
};
|
10
|
-
factory(mod.exports, global.actionSheet, global.cell, global.loading, global.badge, global.avatar, global.button, global.carousel, global.toast, global._switch, global.checkbox, global.circleProgress, global.collapse, global.tabs, global.contextProvider, global.dialog, global.countDown, global.datePicker, global.dropdown, global.dropdownMenu, global.ellipsis, global.grid, global.image, global.showMonitor, global.imagePicker, global.imagePreview, global.input, global.loadMore, global.masking, global.navBar, global.noticeBar, global.notify, global.pagination, global.picker, global.pickerView, global.popover, global.popup, global.popupSwiper, global.portal, global.progress, global.pullRefresh, global.radio, global.rate, global.slider, global.steps, global.sticky, global.swipeLoad, global.tabBar, global.tag, global.textarea, global.transition);
|
10
|
+
factory(mod.exports, global.actionSheet, global.cell, global.loading, global.badge, global.avatar, global.button, global.carousel, global.toast, global._switch, global.checkbox, global.circleProgress, global.collapse, global.tabs, global.contextProvider, global.dialog, global.countDown, global.datePicker, global.dropdown, global.dropdownMenu, global.ellipsis, global.grid, global.image, global.showMonitor, global.imagePicker, global.imagePreview, global.input, global.loadMore, global.masking, global.navBar, global.noticeBar, global.notify, global.pagination, global.picker, global.pickerView, global.popover, global.popup, global.popupSwiper, global.portal, global.progress, global.pullRefresh, global.radio, global.rate, global.slider, global.searchBar, global.steps, global.sticky, global.swipeAction, global.swipeLoad, global.tabBar, global.tag, global.textarea, global.transition);
|
11
11
|
global.index = mod.exports;
|
12
12
|
}
|
13
|
-
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _actionSheet, _cell, _loading, _badge, _avatar, _button, _carousel, _toast, _switch, _checkbox, _circleProgress, _collapse, _tabs, _contextProvider, _dialog, _countDown, _datePicker, _dropdown, _dropdownMenu, _ellipsis, _grid, _image, _showMonitor, _imagePicker, _imagePreview, _input, _loadMore, _masking, _navBar, _noticeBar, _notify, _pagination, _picker, _pickerView, _popover, _popup, _popupSwiper, _portal, _progress, _pullRefresh, _radio, _rate, _slider, _steps, _sticky, _swipeLoad, _tabBar, _tag, _textarea, _transition) {
|
13
|
+
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _actionSheet, _cell, _loading, _badge, _avatar, _button, _carousel, _toast, _switch, _checkbox, _circleProgress, _collapse, _tabs, _contextProvider, _dialog, _countDown, _datePicker, _dropdown, _dropdownMenu, _ellipsis, _grid, _image, _showMonitor, _imagePicker, _imagePreview, _input, _loadMore, _masking, _navBar, _noticeBar, _notify, _pagination, _picker, _pickerView, _popover, _popup, _popupSwiper, _portal, _progress, _pullRefresh, _radio, _rate, _slider, _searchBar, _steps, _sticky, _swipeAction, _swipeLoad, _tabBar, _tag, _textarea, _transition) {
|
14
14
|
"use strict";
|
15
15
|
|
16
16
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
17
17
|
|
18
18
|
_exports.__esModule = true;
|
19
|
-
_exports.Transition = _exports.Toast = _exports.Textarea = _exports.Tag = _exports.Tabs = _exports.TabBar = _exports.Switch = _exports.SwipeLoad = _exports.Sticky = _exports.Steps = _exports.Slider = _exports.ShowMonitor = _exports.Rate = _exports.Radio = _exports.PullRefresh = _exports.Progress = _exports.Portal = _exports.PopupSwiper = _exports.Popup = _exports.Popover = _exports.PickerView = _exports.Picker = _exports.Pagination = _exports.Notify = _exports.NoticeBar = _exports.NavBar = _exports.Masking = _exports.Loading = _exports.LoadMore = _exports.Input = _exports.ImagePreview = _exports.ImagePicker = _exports.Image = _exports.Grid = _exports.Ellipsis = _exports.DropdownMenu = _exports.Dropdown = _exports.Dialog = _exports.DatePicker = _exports.CountDown = _exports.ContextProvider = _exports.Collapse = _exports.CircleProgress = _exports.Checkbox = _exports.Cell = _exports.Carousel = _exports.Button = _exports.Badge = _exports.Avatar = _exports.ActionSheet = void 0;
|
19
|
+
_exports.Transition = _exports.Toast = _exports.Textarea = _exports.Tag = _exports.Tabs = _exports.TabBar = _exports.Switch = _exports.SwipeLoad = _exports.SwipeAction = _exports.Sticky = _exports.Steps = _exports.Slider = _exports.ShowMonitor = _exports.SearchBar = _exports.Rate = _exports.Radio = _exports.PullRefresh = _exports.Progress = _exports.Portal = _exports.PopupSwiper = _exports.Popup = _exports.Popover = _exports.PickerView = _exports.Picker = _exports.Pagination = _exports.Notify = _exports.NoticeBar = _exports.NavBar = _exports.Masking = _exports.Loading = _exports.LoadMore = _exports.Input = _exports.ImagePreview = _exports.ImagePicker = _exports.Image = _exports.Grid = _exports.Ellipsis = _exports.DropdownMenu = _exports.Dropdown = _exports.Dialog = _exports.DatePicker = _exports.CountDown = _exports.ContextProvider = _exports.Collapse = _exports.CircleProgress = _exports.Checkbox = _exports.Cell = _exports.Carousel = _exports.Button = _exports.Badge = _exports.Avatar = _exports.ActionSheet = void 0;
|
20
20
|
_actionSheet = _interopRequireDefault(_actionSheet);
|
21
21
|
_exports.ActionSheet = _actionSheet.default;
|
22
22
|
_cell = _interopRequireDefault(_cell);
|
@@ -103,10 +103,14 @@
|
|
103
103
|
_exports.Rate = _rate.default;
|
104
104
|
_slider = _interopRequireDefault(_slider);
|
105
105
|
_exports.Slider = _slider.default;
|
106
|
+
_searchBar = _interopRequireDefault(_searchBar);
|
107
|
+
_exports.SearchBar = _searchBar.default;
|
106
108
|
_steps = _interopRequireDefault(_steps);
|
107
109
|
_exports.Steps = _steps.default;
|
108
110
|
_sticky = _interopRequireDefault(_sticky);
|
109
111
|
_exports.Sticky = _sticky.default;
|
112
|
+
_swipeAction = _interopRequireDefault(_swipeAction);
|
113
|
+
_exports.SwipeAction = _swipeAction.default;
|
110
114
|
_swipeLoad = _interopRequireDefault(_swipeLoad);
|
111
115
|
_exports.SwipeLoad = _swipeLoad.default;
|
112
116
|
_tabBar = _interopRequireDefault(_tabBar);
|
package/umd/input/hooks.js
CHANGED
@@ -52,6 +52,8 @@
|
|
52
52
|
clearShowType = _props$clearShowType === void 0 ? 'focus' : _props$clearShowType,
|
53
53
|
_props$clearIcon = props.clearIcon,
|
54
54
|
clearIcon = _props$clearIcon === void 0 ? /*#__PURE__*/_react.default.createElement(_IconClear.default, null) : _props$clearIcon,
|
55
|
+
_props$preventEventWh = props.preventEventWhenClearing,
|
56
|
+
preventEventWhenClearing = _props$preventEventWh === void 0 ? true : _props$preventEventWh,
|
55
57
|
onClear = props.onClear,
|
56
58
|
autoFocus = props.autoFocus;
|
57
59
|
|
@@ -64,8 +66,30 @@
|
|
64
66
|
}),
|
65
67
|
showClear = _useState2[0],
|
66
68
|
toggleClear = _useState2[1];
|
69
|
+
/**
|
70
|
+
* clear相关问题背景
|
71
|
+
* 如果点击clear按钮之前已经是focusing状态了,那么在点完clear按钮之后会手动聚焦一下
|
72
|
+
* 该行为将导致onClear事件触发时,也会触发一次onBlur和onFocus事件,可能影响一些组件外的代码逻辑
|
73
|
+
*
|
74
|
+
* e.g. 假设input按钮右侧有一个按钮仅在聚焦时展示
|
75
|
+
* 实现代码大致是:onBlur设置其visible为false,onFocus设置其visible为true
|
76
|
+
* 那么这个按钮就会因为clear的点击造成一瞬的闪烁
|
77
|
+
*
|
78
|
+
* 解决思路
|
79
|
+
* 先来看一下,在输入框已激活的状态时,点击清除按钮后,组件的一些事件的触发顺序
|
80
|
+
* handleBlur -> handleClear -> handleFocus -> onBlur(外部回调) -> onFocus(外部回调)
|
81
|
+
* 可以看到外部的onBlur和onFocus回调都是在handleClear函数之后被调用
|
82
|
+
* 因此可以在handleClear中设置一个shouldPreventEvent的boolean标志
|
83
|
+
* 如果这个标志为true,则跳过调用外部的onBlur和onFocus,并在最后再将标志置回false
|
84
|
+
*
|
85
|
+
*/
|
67
86
|
|
68
|
-
|
87
|
+
|
88
|
+
var _useState3 = (0, _react.useState)(false),
|
89
|
+
isFocusing = _useState3[0],
|
90
|
+
setIsFocusing = _useState3[1];
|
91
|
+
|
92
|
+
var shouldPreventEvent = (0, _react.useRef)(false);
|
69
93
|
var actualInputValue = value !== void 0 ? value : inputValue;
|
70
94
|
var system = (0, _helpers.useSystem)();
|
71
95
|
var wrapRef = (0, _react.useRef)(null);
|
@@ -133,7 +157,12 @@
|
|
133
157
|
|
134
158
|
function handleFocus(e) {
|
135
159
|
(0, _mobileUtils.nextTick)(function () {
|
136
|
-
|
160
|
+
if (preventEventWhenClearing && shouldPreventEvent.current) {
|
161
|
+
shouldPreventEvent.current = false;
|
162
|
+
return;
|
163
|
+
}
|
164
|
+
|
165
|
+
setIsFocusing(true);
|
137
166
|
clearShowType === 'focus' && toggleClear(true);
|
138
167
|
onFocus && onFocus(e);
|
139
168
|
});
|
@@ -141,7 +170,11 @@
|
|
141
170
|
|
142
171
|
function handleBlur(e) {
|
143
172
|
(0, _mobileUtils.nextTick)(function () {
|
144
|
-
|
173
|
+
if (preventEventWhenClearing && shouldPreventEvent.current) {
|
174
|
+
return;
|
175
|
+
}
|
176
|
+
|
177
|
+
setIsFocusing(false);
|
145
178
|
clearShowType === 'focus' && toggleClear(false);
|
146
179
|
onBlur && onBlur(e);
|
147
180
|
});
|
@@ -150,7 +183,7 @@
|
|
150
183
|
function handleClick(e) {
|
151
184
|
// 安卓才会有键盘切换不过来的问题,ios不开启此项,因为blur之后不能再自动focus
|
152
185
|
// @en Android will have the problem that the keyboard cannot be switched. iOS does not enable this, because it can no longer automatically focus after blur.
|
153
|
-
if (blurBeforeFocus && system === 'android' && !
|
186
|
+
if (blurBeforeFocus && system === 'android' && !isFocusing) {
|
154
187
|
inputRef.current && inputRef.current.blur();
|
155
188
|
(0, _mobileUtils.nextTick)(function () {
|
156
189
|
inputRef.current && inputRef.current.focus();
|
@@ -173,18 +206,26 @@
|
|
173
206
|
onClear && onClear(e); // 当点击clear前是focus时强制执行focus
|
174
207
|
// @en Enforce focus when focus is before clicking clear
|
175
208
|
|
176
|
-
if (
|
209
|
+
if (isFocusing) {
|
210
|
+
if (preventEventWhenClearing) {
|
211
|
+
shouldPreventEvent.current = true;
|
212
|
+
}
|
213
|
+
|
177
214
|
inputRef.current && inputRef.current.focus();
|
178
215
|
}
|
179
216
|
});
|
180
217
|
}
|
181
218
|
|
219
|
+
function renderPendNode(pend) {
|
220
|
+
return typeof pend === 'function' ? pend(isFocusing, actualInputValue) : pend;
|
221
|
+
}
|
222
|
+
|
182
223
|
function renderWrapper(prefixCls, type, children) {
|
183
224
|
return /*#__PURE__*/_react.default.createElement("div", {
|
184
225
|
className: prefixCls + "-container all-border-box " + (className || ''),
|
185
226
|
style: style,
|
186
227
|
ref: wrapRef
|
187
|
-
}, prepend, /*#__PURE__*/_react.default.createElement("div", {
|
228
|
+
}, renderPendNode(prepend), /*#__PURE__*/_react.default.createElement("div", {
|
188
229
|
className: (0, _mobileUtils.cls)(prefixCls + "-wrap", type, "border-" + border, system, {
|
189
230
|
disabled: disabled
|
190
231
|
}, {
|
@@ -203,7 +244,7 @@
|
|
203
244
|
onClick: handleClear
|
204
245
|
}, clearIcon) : null, suffix ? /*#__PURE__*/_react.default.createElement("div", {
|
205
246
|
className: prefixCls + "-suffix"
|
206
|
-
}, suffix) : null), append);
|
247
|
+
}, suffix) : null), renderPendNode(append));
|
207
248
|
}
|
208
249
|
|
209
250
|
return {
|
package/umd/input/index.d.ts
CHANGED
package/umd/input/index.js
CHANGED
package/umd/input/props.d.ts
CHANGED
@@ -80,12 +80,12 @@ export interface BasicInputProps<T = HTMLInputElement> {
|
|
80
80
|
* 输入框头部内容,在输入框外部
|
81
81
|
* @en The content of the header of the input box, outside the input box
|
82
82
|
*/
|
83
|
-
prepend?: React.ReactNode;
|
83
|
+
prepend?: React.ReactNode | ((focusing: boolean, inputValue: string) => React.ReactNode);
|
84
84
|
/**
|
85
85
|
* 输入框尾部内容,在输入框外部
|
86
86
|
* @en The content at the end of the input box, outside the input box
|
87
87
|
*/
|
88
|
-
append?: React.ReactNode;
|
88
|
+
append?: React.ReactNode | ((focusing: boolean, inputValue: string) => React.ReactNode);
|
89
89
|
/**
|
90
90
|
* 在聚焦之前blur掉,即切换不同input时会重新弹起键盘,常用于input type切换时重新加载键盘,安卓上有效
|
91
91
|
* @en Blur before focusing, that is, the keyboard will be re-bounced when switching between different inputs. It is often used to reload the keyboard when the input type is switched. It is valid on Android.
|
@@ -102,6 +102,12 @@ export interface BasicInputProps<T = HTMLInputElement> {
|
|
102
102
|
* @default "focus"
|
103
103
|
*/
|
104
104
|
clearShowType?: 'focus' | 'value' | 'always';
|
105
|
+
/**
|
106
|
+
* 在聚焦模式下点击清除按钮时,是否要屏蔽对应产生的onBlur和onFocus事件
|
107
|
+
* @en Whether to block the onBlur and onFocus events generated when the clear button is clicked in focus mode
|
108
|
+
* @default true
|
109
|
+
*/
|
110
|
+
preventEventWhenClearing?: boolean;
|
105
111
|
/**
|
106
112
|
* 清除按钮类型,也可自定义
|
107
113
|
* @en Clear button type, also customizable
|
@@ -98,7 +98,7 @@ export interface NoticeBarRef {
|
|
98
98
|
/**
|
99
99
|
* 可自定义换行或滚动效果,支持循环滚动。
|
100
100
|
* @en Line wrapping or scrolling effects can be customized, and circular scrolling is supported.
|
101
|
-
* @type
|
101
|
+
* @type 信息展示
|
102
102
|
* @type_en Data Display
|
103
103
|
* @name 通知栏
|
104
104
|
* @name_en NoticeBar
|
package/umd/notice-bar/index.js
CHANGED
package/umd/picker/index.d.ts
CHANGED
package/umd/picker/index.js
CHANGED
@@ -45,7 +45,7 @@ export interface PickerViewRef {
|
|
45
45
|
/**
|
46
46
|
* 选择器视图组件,不含弹窗,方便使用方灵活定制选择器。
|
47
47
|
* @en The picker view component, not has contain popup, which is convenient for the user to flexibly customize the picker.
|
48
|
-
* @type
|
48
|
+
* @type 数据录入
|
49
49
|
* @type_en Data Entry
|
50
50
|
* @name 选择器视图
|
51
51
|
* @name_en PickerView
|
package/umd/picker-view/index.js
CHANGED
@@ -44,7 +44,7 @@
|
|
44
44
|
/**
|
45
45
|
* 选择器视图组件,不含弹窗,方便使用方灵活定制选择器。
|
46
46
|
* @en The picker view component, not has contain popup, which is convenient for the user to flexibly customize the picker.
|
47
|
-
* @type
|
47
|
+
* @type 数据录入
|
48
48
|
* @type_en Data Entry
|
49
49
|
* @name 选择器视图
|
50
50
|
* @name_en PickerView
|
package/umd/popover/index.d.ts
CHANGED
@@ -8,7 +8,7 @@ declare const _default: import("react").ForwardRefExoticComponent<Partial<import
|
|
8
8
|
* @en Bubble card, supports six directions, small arrows are centered in each direction based on the mounted sub-elements, and supports controlled and uncontrolled modes.
|
9
9
|
* @name 气泡卡片
|
10
10
|
* @name_en Popover
|
11
|
-
* @type
|
11
|
+
* @type 信息展示
|
12
12
|
* @type_en Data Display
|
13
13
|
*/
|
14
14
|
export default _default;
|
package/umd/popover/index.js
CHANGED
@@ -33,7 +33,7 @@
|
|
33
33
|
* @en Bubble card, supports six directions, small arrows are centered in each direction based on the mounted sub-elements, and supports controlled and uncontrolled modes.
|
34
34
|
* @name 气泡卡片
|
35
35
|
* @name_en Popover
|
36
|
-
* @type
|
36
|
+
* @type 信息展示
|
37
37
|
* @type_en Data Display
|
38
38
|
*/
|
39
39
|
|
@@ -139,13 +139,14 @@
|
|
139
139
|
var movingFromDirec = allowedDirections.includes(fromDirec) ? fromDirec : '';
|
140
140
|
var disDirection = exitDirection || movingFromDirec;
|
141
141
|
var direcValue = ['top', 'bottom'].includes(disDirection) ? 'Y' : 'X';
|
142
|
+
var direcRatio = ['bottom', 'right'].includes(disDirection) ? 1 : -1;
|
142
143
|
|
143
144
|
switch (movingFromDirec) {
|
144
145
|
case 'top':
|
145
146
|
case 'bottom':
|
146
147
|
setDistance({
|
147
148
|
direction: direcValue,
|
148
|
-
value: Math
|
149
|
+
value: Math.abs(disY) * direcRatio
|
149
150
|
});
|
150
151
|
break;
|
151
152
|
|
@@ -153,7 +154,7 @@
|
|
153
154
|
case 'right':
|
154
155
|
setDistance({
|
155
156
|
direction: direcValue,
|
156
|
-
value: Math
|
157
|
+
value: Math.abs(disX) * direcRatio
|
157
158
|
});
|
158
159
|
break;
|
159
160
|
|
package/umd/radio/index.d.ts
CHANGED
@@ -8,7 +8,7 @@ declare const _default: import("react").ForwardRefExoticComponent<import("./type
|
|
8
8
|
* @en Radio button, click to switch selection when available, supports disabled state and radio option group.
|
9
9
|
* @name 单选框
|
10
10
|
* @name_en Radio
|
11
|
-
* @type
|
11
|
+
* @type 数据录入
|
12
12
|
* @type_en Data Entry
|
13
13
|
*/
|
14
14
|
export default _default;
|
package/umd/radio/index.js
CHANGED
package/umd/rate/index.d.ts
CHANGED
package/umd/rate/index.js
CHANGED
@@ -0,0 +1,101 @@
|
|
1
|
+
(function (global, factory) {
|
2
|
+
if (typeof define === "function" && define.amd) {
|
3
|
+
define(["exports", "@arco-design/mobile-utils", "react", "./highlight"], factory);
|
4
|
+
} else if (typeof exports !== "undefined") {
|
5
|
+
factory(exports, require("@arco-design/mobile-utils"), require("react"), require("./highlight"));
|
6
|
+
} else {
|
7
|
+
var mod = {
|
8
|
+
exports: {}
|
9
|
+
};
|
10
|
+
factory(mod.exports, global.mobileUtils, global.react, global.highlight);
|
11
|
+
global.association = mod.exports;
|
12
|
+
}
|
13
|
+
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _mobileUtils, _react, _highlight) {
|
14
|
+
"use strict";
|
15
|
+
|
16
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
17
|
+
|
18
|
+
_exports.__esModule = true;
|
19
|
+
_exports.SearchBarAssociation = SearchBarAssociation;
|
20
|
+
_react = _interopRequireDefault(_react);
|
21
|
+
|
22
|
+
function SearchBarAssociation(props) {
|
23
|
+
var _cls;
|
24
|
+
|
25
|
+
var prefixCls = props.prefixCls,
|
26
|
+
_props$associationIte = props.associationItems,
|
27
|
+
associationItems = _props$associationIte === void 0 ? [] : _props$associationIte,
|
28
|
+
highlightClassName = props.highlightClassName,
|
29
|
+
_props$highlightMode = props.highlightMode,
|
30
|
+
highlightMode = _props$highlightMode === void 0 ? 'none' : _props$highlightMode,
|
31
|
+
highlightStyle = props.highlightStyle,
|
32
|
+
onAssociationClick = props.onAssociationClick,
|
33
|
+
onAssociationItemClick = props.onAssociationItemClick,
|
34
|
+
renderAssociation = props.renderAssociation,
|
35
|
+
renderAssociationItem = props.renderAssociationItem,
|
36
|
+
keyword = props.keyword,
|
37
|
+
visible = props.visible;
|
38
|
+
var searchBarAssociationPrefixCls = prefixCls + "-association";
|
39
|
+
var defaultHighlightClassName = searchBarAssociationPrefixCls + "-item-highlight";
|
40
|
+
|
41
|
+
var renderHighlightNode = function renderHighlightNode(content) {
|
42
|
+
if (!content || !keyword || highlightMode === 'none') {
|
43
|
+
return content;
|
44
|
+
}
|
45
|
+
|
46
|
+
var config = {
|
47
|
+
keyword: keyword,
|
48
|
+
content: content,
|
49
|
+
highlightClassName: highlightClassName || defaultHighlightClassName,
|
50
|
+
highlightStyle: highlightStyle
|
51
|
+
};
|
52
|
+
|
53
|
+
if (highlightMode === 'contain') {
|
54
|
+
return (0, _highlight.highlightWithContainMode)(config);
|
55
|
+
}
|
56
|
+
|
57
|
+
if (highlightMode === 'prefix') {
|
58
|
+
return (0, _highlight.highlightWithPrefixMode)(config);
|
59
|
+
}
|
60
|
+
|
61
|
+
return typeof highlightMode === 'function' ? highlightMode(content, keyword, defaultHighlightClassName) : content;
|
62
|
+
};
|
63
|
+
|
64
|
+
var renderItem = function renderItem(item, index) {
|
65
|
+
var itemContent = item.content;
|
66
|
+
var node = itemContent; // itemContent为string类型,并且开启高亮模式才去走渲染高亮内容的逻辑
|
67
|
+
// @en When `itemContent` is a string, and the highlight mode is turned on, the logic of rendering the highlighted content is performed
|
68
|
+
|
69
|
+
if (typeof itemContent === 'string' && highlightMode !== 'none') {
|
70
|
+
node = renderHighlightNode(itemContent);
|
71
|
+
}
|
72
|
+
|
73
|
+
if (renderAssociationItem) {
|
74
|
+
node = renderAssociationItem(item, index, node);
|
75
|
+
}
|
76
|
+
|
77
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
78
|
+
key: index,
|
79
|
+
className: searchBarAssociationPrefixCls + "-item",
|
80
|
+
onClick: function onClick() {
|
81
|
+
return onAssociationItemClick == null ? void 0 : onAssociationItemClick(item, index);
|
82
|
+
}
|
83
|
+
}, node);
|
84
|
+
};
|
85
|
+
|
86
|
+
var renderContent = function renderContent() {
|
87
|
+
var associationContent = associationItems.map(renderItem);
|
88
|
+
|
89
|
+
if (renderAssociation) {
|
90
|
+
return renderAssociation(associationContent);
|
91
|
+
}
|
92
|
+
|
93
|
+
return associationContent;
|
94
|
+
};
|
95
|
+
|
96
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
97
|
+
className: (0, _mobileUtils.cls)(searchBarAssociationPrefixCls, (_cls = {}, _cls[searchBarAssociationPrefixCls + "-visible"] = visible, _cls)),
|
98
|
+
onClick: onAssociationClick
|
99
|
+
}, renderContent());
|
100
|
+
}
|
101
|
+
});
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
interface CancelButtonProps {
|
3
|
+
className: string;
|
4
|
+
onCancel?: () => void;
|
5
|
+
focusing: boolean;
|
6
|
+
currentInputValue: string;
|
7
|
+
text?: string;
|
8
|
+
}
|
9
|
+
export declare function CancelButton(props: CancelButtonProps): JSX.Element | null;
|
10
|
+
export {};
|
@@ -0,0 +1,52 @@
|
|
1
|
+
(function (global, factory) {
|
2
|
+
if (typeof define === "function" && define.amd) {
|
3
|
+
define(["exports", "@arco-design/mobile-utils", "react"], factory);
|
4
|
+
} else if (typeof exports !== "undefined") {
|
5
|
+
factory(exports, require("@arco-design/mobile-utils"), require("react"));
|
6
|
+
} else {
|
7
|
+
var mod = {
|
8
|
+
exports: {}
|
9
|
+
};
|
10
|
+
factory(mod.exports, global.mobileUtils, global.react);
|
11
|
+
global.cancelButton = mod.exports;
|
12
|
+
}
|
13
|
+
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _mobileUtils, _react) {
|
14
|
+
"use strict";
|
15
|
+
|
16
|
+
_exports.__esModule = true;
|
17
|
+
_exports.CancelButton = CancelButton;
|
18
|
+
_react = _interopRequireWildcard(_react);
|
19
|
+
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
21
|
+
|
22
|
+
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; }
|
23
|
+
|
24
|
+
function CancelButton(props) {
|
25
|
+
var className = props.className,
|
26
|
+
onCancel = props.onCancel,
|
27
|
+
focusing = props.focusing,
|
28
|
+
currentInputValue = props.currentInputValue,
|
29
|
+
text = props.text;
|
30
|
+
|
31
|
+
var _useState = (0, _react.useState)(focusing || Boolean(currentInputValue)),
|
32
|
+
visible = _useState[0],
|
33
|
+
setVisible = _useState[1];
|
34
|
+
|
35
|
+
var handleClick = function handleClick() {
|
36
|
+
onCancel == null ? void 0 : onCancel(); // 如果不延迟,在聚焦切输入框有值的情况下,点击取消按钮会造成闪烁
|
37
|
+
// @en If there is no delay, when the focus cut input box has a value, clicking the cancel button will cause flickering
|
38
|
+
|
39
|
+
(0, _mobileUtils.nextTick)(function () {
|
40
|
+
setVisible(false);
|
41
|
+
});
|
42
|
+
};
|
43
|
+
|
44
|
+
(0, _react.useEffect)(function () {
|
45
|
+
setVisible(focusing || Boolean(currentInputValue));
|
46
|
+
}, [focusing, currentInputValue]);
|
47
|
+
return visible ? /*#__PURE__*/_react.default.createElement("span", {
|
48
|
+
className: className,
|
49
|
+
onClick: handleClick
|
50
|
+
}, text) : null;
|
51
|
+
}
|
52
|
+
});
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { SearchBarAssociationHighlightConfig } from './type';
|
3
|
+
/**
|
4
|
+
* 高亮搜索候选项中,包含的关键字
|
5
|
+
*
|
6
|
+
*/
|
7
|
+
export declare function highlightWithContainMode(config: SearchBarAssociationHighlightConfig): React.ReactNode[];
|
8
|
+
/**
|
9
|
+
* 高亮搜索候选项和关键字的最长前缀公共字符串
|
10
|
+
*
|
11
|
+
*/
|
12
|
+
export declare function highlightWithPrefixMode(config: SearchBarAssociationHighlightConfig): string | (string | JSX.Element)[];
|